Skip to content

Commit 58c795f

Browse files
authored
refactor(range): remove legacy property and support for legacy syntax (#29040)
BREAKING CHANGE: The `legacy` property and support for the legacy syntax, which involved placing an `ion-range` inside of an `ion-item` with an `ion-label`, have been removed from range. For more information on migrating from the legacy range syntax, refer to the [Range documentation](https://ionicframework.com/docs/api/range#migrating-from-legacy-range-syntax).
1 parent fb5ae5b commit 58c795f

File tree

92 files changed

+74
-1197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+74
-1197
lines changed

BREAKING.md

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
2727
- [Picker](#version-8x-picker)
2828
- [Progress bar](#version-8x-progress-bar)
2929
- [Radio](#version-8x-radio)
30+
- [Range](#version-8x-range)
3031
- [Select](#version-8x-select)
3132
- [Textarea](#version-8x-textarea)
3233
- [Toggle](#version-8x-toggle)
@@ -195,6 +196,10 @@ For more information on styling toast buttons, refer to the [Toast Theming docum
195196

196197
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-radio` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy radio syntax, refer to the [Radio documentation](https://ionicframework.com/docs/api/radio#migrating-from-legacy-radio-syntax).
197198

199+
<h4 id="version-8x-range">Range</h4>
200+
201+
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-range` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy range syntax, refer to the [Range documentation](https://ionicframework.com/docs/api/range#migrating-from-legacy-range-syntax).
202+
198203
<h4 id="version-8x-select">Select</h4>
199204

200205
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-select` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy select syntax, refer to the [Select documentation](https://ionicframework.com/docs/api/select#migrating-from-legacy-select-syntax).

core/api.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,6 @@ ion-range,prop,disabled,boolean,false,false,false
10641064
ion-range,prop,dualKnobs,boolean,false,false,false
10651065
ion-range,prop,label,string | undefined,undefined,false,false
10661066
ion-range,prop,labelPlacement,"end" | "fixed" | "stacked" | "start",'start',false,false
1067-
ion-range,prop,legacy,boolean | undefined,undefined,false,false
10681067
ion-range,prop,max,number,100,false,false
10691068
ion-range,prop,min,number,0,false,false
10701069
ion-range,prop,mode,"ios" | "md",undefined,false,false

core/src/components.d.ts

-13
Original file line numberDiff line numberDiff line change
@@ -2311,10 +2311,6 @@ export namespace Components {
23112311
* Where to place the label relative to the range. `"start"`: The label will appear to the left of the range in LTR and to the right in RTL. `"end"`: The label will appear to the right of the range in LTR and to the left in RTL. `"fixed"`: The label has the same behavior as `"start"` except it also has a fixed width. Long text will be truncated with ellipses ("..."). `"stacked"`: The label will appear above the range regardless of the direction.
23122312
*/
23132313
"labelPlacement": 'start' | 'end' | 'fixed' | 'stacked';
2314-
/**
2315-
* Set the `legacy` property to `true` to forcibly use the legacy form control markup. Ionic will only opt components in to the modern form markup when they are using either the `aria-label` attribute or the `label` property. As a result, the `legacy` property should only be used as an escape hatch when you want to avoid this automatic opt-in behavior. Note that this property will be removed in an upcoming major release of Ionic, and all form components will be opted-in to using the modern form markup.
2316-
*/
2317-
"legacy"?: boolean;
23182314
/**
23192315
* Maximum integer value of the range.
23202316
*/
@@ -4174,7 +4170,6 @@ declare global {
41744170
interface HTMLIonRangeElementEventMap {
41754171
"ionChange": RangeChangeEventDetail;
41764172
"ionInput": RangeChangeEventDetail;
4177-
"ionStyle": StyleEventDetail;
41784173
"ionFocus": void;
41794174
"ionBlur": void;
41804175
"ionKnobMoveStart": RangeKnobMoveStartEventDetail;
@@ -6988,10 +6983,6 @@ declare namespace LocalJSX {
69886983
* Where to place the label relative to the range. `"start"`: The label will appear to the left of the range in LTR and to the right in RTL. `"end"`: The label will appear to the right of the range in LTR and to the left in RTL. `"fixed"`: The label has the same behavior as `"start"` except it also has a fixed width. Long text will be truncated with ellipses ("..."). `"stacked"`: The label will appear above the range regardless of the direction.
69896984
*/
69906985
"labelPlacement"?: 'start' | 'end' | 'fixed' | 'stacked';
6991-
/**
6992-
* Set the `legacy` property to `true` to forcibly use the legacy form control markup. Ionic will only opt components in to the modern form markup when they are using either the `aria-label` attribute or the `label` property. As a result, the `legacy` property should only be used as an escape hatch when you want to avoid this automatic opt-in behavior. Note that this property will be removed in an upcoming major release of Ionic, and all form components will be opted-in to using the modern form markup.
6993-
*/
6994-
"legacy"?: boolean;
69956986
/**
69966987
* Maximum integer value of the range.
69976988
*/
@@ -7032,10 +7023,6 @@ declare namespace LocalJSX {
70327023
* Emitted when the user starts moving the range knob, whether through mouse drag, touch gesture, or keyboard interaction.
70337024
*/
70347025
"onIonKnobMoveStart"?: (event: IonRangeCustomEvent<RangeKnobMoveStartEventDetail>) => void;
7035-
/**
7036-
* Emitted when the styles change.
7037-
*/
7038-
"onIonStyle"?: (event: IonRangeCustomEvent<StyleEventDetail>) => void;
70397026
/**
70407027
* If `true`, a pin with integer value is shown when the knob is pressed.
70417028
*/

core/src/components/item/test/disabled/index.html

-6
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@
3838
<ion-item disabled href="#">
3939
<ion-label>Disabled Item Anchor</ion-label>
4040
</ion-item>
41-
42-
<ion-item>
43-
<ion-range disabled value="10">
44-
<span slot="label">Disabled Range</span>
45-
</ion-range>
46-
</ion-item>
4741
</ion-list>
4842
</ion-content>
4943

core/src/components/item/test/legacy/disabled/index.html

-5
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@
3838
<ion-item disabled href="#">
3939
<ion-label>Disabled Item Anchor</ion-label>
4040
</ion-item>
41-
42-
<ion-item>
43-
<ion-label>Disabled Range</ion-label>
44-
<ion-range disabled value="10" legacy="true"></ion-range>
45-
</ion-item>
4641
</ion-list>
4742
</ion-content>
4843

core/src/components/range/range.ios.scss

-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616
--height: #{$range-ios-slider-height};
1717
}
1818

19-
// TODO FW-2997 remove this
20-
:host(.legacy-range) {
21-
@include padding($range-ios-padding-vertical, $range-ios-padding-horizontal);
22-
}
23-
2419
:host(.range-item-start-adjustment) {
2520
@include padding(null, null, null, $range-ios-item-padding-horizontal);
2621
}

core/src/components/range/range.ios.vars.scss

-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
/// @prop - Padding top/bottom of the range
77
$range-ios-padding-vertical: 8px !default;
88

9-
/// @prop - Padding start/end of the range
10-
// TODO FW-2997 Remove this
11-
$range-ios-padding-horizontal: 16px !default;
12-
139
/// @prop - Padding start/end of the range - modern syntax
1410
/**
1511
* 24px was chosen so the knob and its

core/src/components/range/range.md.scss

+3-15
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,9 @@
1818
--pin-color: #{ion-color(primary, contrast)};
1919
}
2020

21-
// TODO FW-2997 Remove this
22-
:host(.legacy-range) ::slotted([slot="label"]) {
23-
font-size: initial;
24-
}
25-
26-
:host(:not(.legacy-range)) ::slotted(:not(ion-icon)[slot="start"]),
27-
:host(:not(.legacy-range)) ::slotted(:not(ion-icon)[slot="end"]),
28-
:host(:not(.legacy-range)) .native-wrapper {
29-
font-size: $range-md-pin-font-size;
30-
}
31-
32-
// TODO FW-2997 remove this
33-
:host(.legacy-range) {
34-
@include padding($range-md-padding-vertical, $range-md-padding-horizontal);
35-
21+
::slotted(:not(ion-icon)[slot="start"]),
22+
::slotted(:not(ion-icon)[slot="end"]),
23+
.native-wrapper {
3624
font-size: $range-md-pin-font-size;
3725
}
3826

core/src/components/range/range.md.vars.scss

-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
/// @prop - Padding top/bottom of the range
77
$range-md-padding-vertical: 8px !default;
88

9-
/// @prop - Padding start/end of the range
10-
// TODO FW-2997 Remove this
11-
$range-md-padding-horizontal: 14px !default;
12-
139
/// @prop - Padding start/end of the range - modern range
1410
/**
1511
* 18px was chosen so the knob and its focus/active

0 commit comments

Comments
 (0)