diff --git a/packages/BREAKING.md b/packages/BREAKING.md index 6ce856aeb6..6bebd6f64f 100644 --- a/packages/BREAKING.md +++ b/packages/BREAKING.md @@ -14,6 +14,7 @@ A list of the breaking changes introduced in Ionic Angular v4. - [Nav](#nav) - [Option](#option) - [Radio](#radio) +- [Range](#range) - [Segment](#segment) - [Toolbar](#toolbar) - [Sass](#sass) @@ -53,7 +54,7 @@ Button should now be written as an `` element. Ionic will determine ``` -### Icon Attributes Renamed +### Attributes Renamed Previously to style icons inside of a button the following attributes were used: `icon-left`, `icon-right`, (and with the added support of RTL) `icon-start`, `icon-end`. @@ -468,11 +469,49 @@ Radio group has been changed to an element. It should now be wrapped around any ``` -### Order for Windows +### Windows Mode Order Previously a radio inside of an item in Windows Platform mode would align itself to the start of the item. This has been removed, `slot` should always be used to align a radio inside of an item now. +## Range + +### Attributes Renamed + +Previously to place content inside of a range the following attributes were used: `range-left`, `range-right`, (and with the added support of RTL) `range-start`, `range-end`. + +These have been renamed to the following: + +| Old Property | New Property | Property Behavior | +|-----------------------------|----------------|-----------------------------------------------------------------------| +| `range-left`, `range-start` | `slot="start"` | Positions to the left of the range in LTR, and to the right in RTL. | +| `range-right`, `range-end` | `slot="end"` | Positions to the right of the range in LTR, and to the left in RTL. | + + +**Old Usage Example:** + +```html + + + + + + + + + +``` + +**New Usage Example:** + +```html + + + + +``` + + ## Segment The markup hasn't changed for Segments, but now writing `` will render a native button element inside of it. diff --git a/packages/core/src/components.d.ts b/packages/core/src/components.d.ts index 2703fc5a52..16ce01283e 100644 --- a/packages/core/src/components.d.ts +++ b/packages/core/src/components.d.ts @@ -2212,7 +2212,7 @@ declare global { min?: number, pin?: boolean, snaps?: boolean, - steps?: number, + step?: number, value?: any } } diff --git a/packages/core/src/components/icon/icon.scss b/packages/core/src/components/icon/icon.scss index 0ab73dea65..0c147f13b5 100644 --- a/packages/core/src/components/icon/icon.scss +++ b/packages/core/src/components/icon/icon.scss @@ -9,7 +9,8 @@ ion-icon { font-size: 1.2em; } -ion-icon[small] { +ion-icon[small], +ion-icon[small][slot] { min-height: 1.1em; font-size: 1.1em; diff --git a/packages/core/src/components/range/range.tsx b/packages/core/src/components/range/range.tsx index c708679a55..6e62aadb99 100644 --- a/packages/core/src/components/range/range.tsx +++ b/packages/core/src/components/range/range.tsx @@ -114,7 +114,7 @@ export class Range implements BaseInputComponent { /** * @input {number} Specifies the value granularity. Defaults to `1`. */ - @Prop() steps: number = 1; + @Prop() step: number = 1; /** * @input {string} the value of the range. @@ -196,7 +196,7 @@ export class Range implements BaseInputComponent { createTicks() { if (this.snaps) { - for (let value = this.min; value <= this.max; value += this.steps) { + for (let value = this.min; value <= this.max; value += this.step) { let ratio = this.valueToRatio(value); this.ticks.push({ ratio, @@ -226,14 +226,14 @@ export class Range implements BaseInputComponent { } valueToRatio(value: number) { - value = Math.round((value - this.min) / this.steps) * this.steps; + value = Math.round((value - this.min) / this.step) * this.step; value = value / (this.max - this.min); return clamp(0, value, 1); } ratioToValue(ratio: number) { ratio = Math.round((this.max - this.min) * ratio); - ratio = Math.round(ratio / this.steps) * this.steps + this.min; + ratio = Math.round(ratio / this.step) * this.step + this.min; return clamp(this.min, ratio, this.max); } @@ -329,7 +329,7 @@ export class Range implements BaseInputComponent { @Listen('ionIncrease, ionDecrease') keyChng(ev: RangeEvent) { - const step = this.steps; + const step = this.step; if (ev.detail.knob === 'knobB') { if (!!ev.detail.isIncrease) { this.valB += step; @@ -404,7 +404,7 @@ export class Range implements BaseInputComponent { protected render() { return [ - , + , , - + ]; } } diff --git a/packages/core/src/components/range/test/basic.html b/packages/core/src/components/range/test/basic.html index 7b78b0d32e..7b38078ac6 100644 --- a/packages/core/src/components/range/test/basic.html +++ b/packages/core/src/components/range/test/basic.html @@ -24,9 +24,6 @@ - - - @@ -34,7 +31,14 @@ - + + + + + + + + @@ -60,19 +64,15 @@ + + + - - - - - - - Test