@ionic/core 7.3.4-dev.11699991837.1bc64f72 → 7.3.4-dev.11700516018.128deb56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/button-active.js +1 -1
- package/components/checkbox.js +3 -6
- package/components/data.js +7 -31
- package/components/index.js +2 -2
- package/components/index2.js +429 -203
- package/components/index3.js +203 -429
- package/components/ion-datetime-button.js +0 -3
- package/components/ion-datetime.js +92 -132
- package/components/ion-item-sliding.js +1 -1
- package/components/ion-menu.js +3 -3
- package/components/ion-modal.js +2 -2
- package/components/ion-nav.js +1 -1
- package/components/ion-range.js +3 -3
- package/components/ion-refresher.js +3 -3
- package/components/ion-reorder-group.js +1 -1
- package/components/ion-router-outlet.js +1 -1
- package/components/ion-segment.js +1 -1
- package/components/ion-toggle.js +4 -7
- package/components/ion-toolbar.js +2 -2
- package/components/ios.transition.js +1 -1
- package/components/md.transition.js +1 -1
- package/components/picker-column.js +1 -1
- package/components/popover.js +1 -1
- package/components/radio.js +3 -6
- package/components/swipe-back.js +1 -1
- package/dist/cjs/{data-db832785.js → data-967b9c15.js} +7 -31
- package/dist/cjs/index.cjs.js +9 -10
- package/dist/cjs/ion-app_8.cjs.entry.js +2 -2
- package/dist/cjs/ion-checkbox.cjs.entry.js +3 -5
- package/dist/cjs/ion-datetime-button.cjs.entry.js +1 -4
- package/dist/cjs/ion-datetime_3.cjs.entry.js +93 -132
- package/dist/cjs/ion-menu_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-radio_2.cjs.entry.js +3 -5
- package/dist/cjs/ion-range.cjs.entry.js +2 -2
- package/dist/cjs/ion-toggle.cjs.entry.js +3 -5
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/checkbox/checkbox.ios.css +0 -35
- package/dist/collection/components/checkbox/checkbox.js +4 -24
- package/dist/collection/components/checkbox/checkbox.md.css +0 -35
- package/dist/collection/components/checkbox/test/item/checkbox.e2e.js +0 -13
- package/dist/collection/components/checkbox/test/label/checkbox.e2e.js +0 -16
- package/dist/collection/components/datetime/datetime.ios.css +29 -32
- package/dist/collection/components/datetime/datetime.js +93 -137
- package/dist/collection/components/datetime/datetime.md.css +28 -20
- package/dist/collection/components/datetime/test/basic/datetime.e2e.js +0 -25
- package/dist/collection/components/datetime/test/color/datetime.e2e.js +1 -1
- package/dist/collection/components/datetime/test/custom/datetime.e2e.js +1 -27
- package/dist/collection/components/datetime/test/prefer-wheel/datetime.e2e.js +0 -15
- package/dist/collection/components/datetime/test/set-value/datetime.e2e.js +12 -9
- package/dist/collection/components/datetime/utils/data.js +6 -14
- package/dist/collection/components/datetime/utils/parse.js +1 -18
- package/dist/collection/components/datetime-button/datetime-button.js +0 -3
- package/dist/collection/components/menu/menu.ios.css +0 -94
- package/dist/collection/components/menu/menu.md.css +0 -94
- package/dist/collection/components/radio/radio.ios.css +0 -35
- package/dist/collection/components/radio/radio.js +4 -24
- package/dist/collection/components/radio/radio.md.css +0 -35
- package/dist/collection/components/radio/test/item/radio.e2e.js +0 -15
- package/dist/collection/components/radio/test/label-placement/radio.e2e.js +0 -20
- package/dist/collection/components/range/range.ios.css +1 -41
- package/dist/collection/components/range/range.js +3 -3
- package/dist/collection/components/range/range.md.css +1 -41
- package/dist/collection/components/range/test/label/range.e2e.js +0 -48
- package/dist/collection/components/toggle/test/item/toggle.e2e.js +0 -15
- package/dist/collection/components/toggle/test/label/toggle.e2e.js +0 -16
- package/dist/collection/components/toggle/toggle.ios.css +1 -35
- package/dist/collection/components/toggle/toggle.js +4 -24
- package/dist/collection/components/toggle/toggle.md.css +1 -35
- package/dist/collection/components/toolbar/toolbar.ios.css +4 -2
- package/dist/collection/components/toolbar/toolbar.md.css +4 -2
- package/dist/collection/index.js +0 -1
- package/dist/docs.json +18 -147
- package/dist/esm/{data-009dbf15.js → data-4b448e3a.js} +7 -31
- package/dist/esm/index.js +2 -2
- package/dist/esm/ion-app_8.entry.js +2 -2
- package/dist/esm/ion-checkbox.entry.js +3 -5
- package/dist/esm/ion-datetime-button.entry.js +1 -4
- package/dist/esm/ion-datetime_3.entry.js +93 -132
- package/dist/esm/ion-menu_3.entry.js +2 -2
- package/dist/esm/ion-radio_2.entry.js +3 -5
- package/dist/esm/ion-range.entry.js +2 -2
- package/dist/esm/ion-toggle.entry.js +3 -5
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/data-4b448e3a.js +4 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/ion-app_8.entry.js +1 -1
- package/dist/esm-es5/ion-checkbox.entry.js +1 -1
- package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-menu_3.entry.js +1 -1
- package/dist/esm-es5/ion-radio_2.entry.js +1 -1
- package/dist/esm-es5/ion-range.entry.js +1 -1
- package/dist/esm-es5/ion-toggle.entry.js +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/html.html-data.json +4 -52
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-0053fe81.system.entry.js +4 -0
- package/dist/ionic/p-06902103.system.js +1 -1
- package/dist/ionic/p-091cd81e.entry.js +4 -0
- package/dist/ionic/p-28f5715a.system.entry.js +4 -0
- package/dist/ionic/p-2cdcd6f2.entry.js +4 -0
- package/dist/ionic/{p-a34669bf.system.entry.js → p-45ee211b.system.entry.js} +1 -1
- package/dist/ionic/p-5009cb46.entry.js +4 -0
- package/dist/ionic/p-5b88f780.entry.js +4 -0
- package/dist/ionic/p-601fd53c.js +4 -0
- package/dist/ionic/p-8843b046.system.js +4 -0
- package/dist/ionic/p-98b618ce.system.entry.js +4 -0
- package/dist/ionic/p-b1e8f045.entry.js +4 -0
- package/dist/ionic/p-b3394798.system.entry.js +4 -0
- package/dist/ionic/p-b3cfc6e1.system.entry.js +4 -0
- package/dist/ionic/{p-f9567c67.entry.js → p-c759a704.entry.js} +1 -1
- package/dist/ionic/p-cc8910e7.system.js +4 -0
- package/dist/ionic/{p-67b891af.entry.js → p-d3b8aebf.entry.js} +1 -1
- package/dist/ionic/p-e53b8af4.system.entry.js +4 -0
- package/dist/ionic/p-f78e60a5.entry.js +4 -0
- package/dist/ionic/p-fd42994b.system.entry.js +4 -0
- package/dist/types/components/checkbox/checkbox.d.ts +1 -8
- package/dist/types/components/datetime/datetime.d.ts +10 -23
- package/dist/types/components/datetime/utils/data.d.ts +1 -1
- package/dist/types/components/datetime/utils/parse.d.ts +3 -3
- package/dist/types/components/radio/radio.d.ts +1 -8
- package/dist/types/components/range/range.d.ts +1 -2
- package/dist/types/components/toast/toast-interface.d.ts +0 -3
- package/dist/types/components/toggle/toggle.d.ts +1 -8
- package/dist/types/components.d.ts +16 -40
- package/dist/types/index.d.ts +0 -1
- package/dist/types/interface.d.ts +0 -1
- package/hydrate/index.js +114 -196
- package/package.json +2 -2
- package/dist/esm-es5/data-009dbf15.js +0 -4
- package/dist/ionic/p-1f4adf06.system.entry.js +0 -4
- package/dist/ionic/p-218b6f33.entry.js +0 -4
- package/dist/ionic/p-2da6ba37.system.entry.js +0 -4
- package/dist/ionic/p-40138199.entry.js +0 -4
- package/dist/ionic/p-44ef7224.system.js +0 -4
- package/dist/ionic/p-4ca1ce6b.system.entry.js +0 -4
- package/dist/ionic/p-51b165af.system.js +0 -4
- package/dist/ionic/p-57f0efcc.entry.js +0 -4
- package/dist/ionic/p-7cfd253c.js +0 -4
- package/dist/ionic/p-82f5c07e.system.entry.js +0 -4
- package/dist/ionic/p-86c5c320.entry.js +0 -4
- package/dist/ionic/p-90ec5785.system.entry.js +0 -4
- package/dist/ionic/p-af986299.system.entry.js +0 -4
- package/dist/ionic/p-b321c999.entry.js +0 -4
- package/dist/ionic/p-d8a0267b.system.entry.js +0 -4
- package/dist/ionic/p-f5c19164.entry.js +0 -4
|
@@ -220,20 +220,12 @@ export const generateTime = (refParts, hourCycle = 'h12', minParts, maxParts, ho
|
|
|
220
220
|
* Given DatetimeParts, generate the previous,
|
|
221
221
|
* current, and and next months.
|
|
222
222
|
*/
|
|
223
|
-
export const generateMonths = (refParts
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
if (forcedDate !== undefined && (refParts.month !== forcedDate.month || refParts.year !== forcedDate.year)) {
|
|
230
|
-
const forced = { month: forcedDate.month, year: forcedDate.year, day: forcedDate.day };
|
|
231
|
-
const forcedMonthIsBefore = isBefore(forced, current);
|
|
232
|
-
return forcedMonthIsBefore
|
|
233
|
-
? [forced, current, getNextMonth(refParts)]
|
|
234
|
-
: [getPreviousMonth(refParts), current, forced];
|
|
235
|
-
}
|
|
236
|
-
return [getPreviousMonth(refParts), current, getNextMonth(refParts)];
|
|
223
|
+
export const generateMonths = (refParts) => {
|
|
224
|
+
return [
|
|
225
|
+
getPreviousMonth(refParts),
|
|
226
|
+
{ month: refParts.month, year: refParts.year, day: refParts.day },
|
|
227
|
+
getNextMonth(refParts),
|
|
228
|
+
];
|
|
237
229
|
};
|
|
238
230
|
export const getMonthColumnData = (locale, refParts, minParts, maxParts, monthValues, formatOptions = {
|
|
239
231
|
month: 'long',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { printIonWarning } from "../../../utils/logging/index";
|
|
5
4
|
import { isAfter, isBefore } from "./comparison";
|
|
6
5
|
import { getNumDaysInMonth } from "./helpers";
|
|
7
6
|
const ISO_8601_REGEXP =
|
|
@@ -48,22 +47,7 @@ export const getPartsFromCalendarDay = (el) => {
|
|
|
48
47
|
};
|
|
49
48
|
export function parseDate(val) {
|
|
50
49
|
if (Array.isArray(val)) {
|
|
51
|
-
|
|
52
|
-
for (const valStr of val) {
|
|
53
|
-
const parsedVal = parseDate(valStr);
|
|
54
|
-
/**
|
|
55
|
-
* If any of the values weren't parsed correctly, consider
|
|
56
|
-
* the entire batch incorrect. This simplifies the type
|
|
57
|
-
* signatures by having "undefined" be a general error case
|
|
58
|
-
* instead of returning (Datetime | undefined)[], which is
|
|
59
|
-
* harder for TS to perform type narrowing on.
|
|
60
|
-
*/
|
|
61
|
-
if (!parsedVal) {
|
|
62
|
-
return undefined;
|
|
63
|
-
}
|
|
64
|
-
parsedArray.push(parsedVal);
|
|
65
|
-
}
|
|
66
|
-
return parsedArray;
|
|
50
|
+
return val.map((valStr) => parseDate(valStr));
|
|
67
51
|
}
|
|
68
52
|
// manually parse IS0 cuz Date.parse cannot be trusted
|
|
69
53
|
// ISO 8601 format: 1994-12-15T13:47:20Z
|
|
@@ -83,7 +67,6 @@ export function parseDate(val) {
|
|
|
83
67
|
}
|
|
84
68
|
if (parse === null) {
|
|
85
69
|
// wasn't able to parse the ISO datetime
|
|
86
|
-
printIonWarning(`Unable to parse date string: ${val}. Please provide a valid ISO 8601 datetime string.`);
|
|
87
70
|
return undefined;
|
|
88
71
|
}
|
|
89
72
|
// ensure all the parse values exist with at least 0
|
|
@@ -54,9 +54,6 @@ export class DatetimeButton {
|
|
|
54
54
|
* to today's date and time if no value is set.
|
|
55
55
|
*/
|
|
56
56
|
const parsedDatetimes = parseDate(parsedValues.length > 0 ? parsedValues : [getToday()]);
|
|
57
|
-
if (!parsedDatetimes) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
57
|
/**
|
|
61
58
|
* If developers incorrectly use multiple="true"
|
|
62
59
|
* with non "date" datetimes, then just select
|
|
@@ -47,18 +47,6 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
:host(.menu-side-start) .menu-inner {
|
|
50
|
-
/**
|
|
51
|
-
* Menu does not cover the whole screen so we need to set the safe area for the
|
|
52
|
-
* side that touches the screen edge only. Since safe area is not logical, it
|
|
53
|
-
* needs to be applied to the correct side depending on the language direction.
|
|
54
|
-
* Otherwise, the content will have less space on both sides.
|
|
55
|
-
*
|
|
56
|
-
* LTR:
|
|
57
|
-
* The left side of the menu touches the screen edge. The safe area padding has
|
|
58
|
-
* already been set in the core styles, so there's no need to set it again.
|
|
59
|
-
* The right side of the menu is not touching the screen edge. Padding is not
|
|
60
|
-
* applied to the right side of the menu. A value of 0 is set.
|
|
61
|
-
*/
|
|
62
50
|
--ion-safe-area-right: 0px;
|
|
63
51
|
top: 0;
|
|
64
52
|
bottom: 0;
|
|
@@ -89,55 +77,8 @@
|
|
|
89
77
|
}
|
|
90
78
|
}
|
|
91
79
|
}
|
|
92
|
-
:host-context([dir=rtl]):host(.menu-side-start) .menu-inner, :host-context([dir=rtl]).menu-side-start .menu-inner {
|
|
93
|
-
/**
|
|
94
|
-
* Menu does not cover the whole screen so we need to set the safe area for the
|
|
95
|
-
* side that touches the screen edge only. Since safe area is not logical, it
|
|
96
|
-
* needs to be applied to the correct side depending on the language direction.
|
|
97
|
-
* Otherwise, the content will have less space on both sides.
|
|
98
|
-
*
|
|
99
|
-
* RTL:
|
|
100
|
-
* The right side of the menu touches the screen edge. The safe area padding has
|
|
101
|
-
* already been set in the core styles, so there's no need to set it again.
|
|
102
|
-
* The left side of the menu is not touching the screen edge. Padding is not
|
|
103
|
-
* applied to the left side of the menu. A value of 0 is set.
|
|
104
|
-
*/
|
|
105
|
-
--ion-safe-area-right: env(safe-area-inset-right);
|
|
106
|
-
--ion-safe-area-left: 0px;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
@supports selector(:dir(rtl)) {
|
|
110
|
-
:host(.menu-side-start) .menu-inner:dir(rtl) {
|
|
111
|
-
/**
|
|
112
|
-
* Menu does not cover the whole screen so we need to set the safe area for the
|
|
113
|
-
* side that touches the screen edge only. Since safe area is not logical, it
|
|
114
|
-
* needs to be applied to the correct side depending on the language direction.
|
|
115
|
-
* Otherwise, the content will have less space on both sides.
|
|
116
|
-
*
|
|
117
|
-
* RTL:
|
|
118
|
-
* The right side of the menu touches the screen edge. The safe area padding has
|
|
119
|
-
* already been set in the core styles, so there's no need to set it again.
|
|
120
|
-
* The left side of the menu is not touching the screen edge. Padding is not
|
|
121
|
-
* applied to the left side of the menu. A value of 0 is set.
|
|
122
|
-
*/
|
|
123
|
-
--ion-safe-area-right: env(safe-area-inset-right);
|
|
124
|
-
--ion-safe-area-left: 0px;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
80
|
|
|
128
81
|
:host(.menu-side-end) .menu-inner {
|
|
129
|
-
/**
|
|
130
|
-
* Menu does not cover the whole screen so we need to set the safe area for the
|
|
131
|
-
* side that touches the screen edge only. Since safe area is not logical, it
|
|
132
|
-
* needs to be applied to the correct side depending on the language direction.
|
|
133
|
-
* Otherwise, the content will have less space on both sides.
|
|
134
|
-
*
|
|
135
|
-
* LTR:
|
|
136
|
-
* The right side of the menu touches the screen edge. The safe area padding has
|
|
137
|
-
* already been set in the core styles, so there's no need to set it again.
|
|
138
|
-
* The left side of the menu is not touching the screen edge. Padding is not
|
|
139
|
-
* applied to the left side of the menu. A value of 0 is set.
|
|
140
|
-
*/
|
|
141
82
|
--ion-safe-area-left: 0px;
|
|
142
83
|
top: 0;
|
|
143
84
|
bottom: 0;
|
|
@@ -168,41 +109,6 @@
|
|
|
168
109
|
}
|
|
169
110
|
}
|
|
170
111
|
}
|
|
171
|
-
:host-context([dir=rtl]):host(.menu-side-end) .menu-inner, :host-context([dir=rtl]).menu-side-end .menu-inner {
|
|
172
|
-
/**
|
|
173
|
-
* Menu does not cover the whole screen so we need to set the safe area for the
|
|
174
|
-
* side that touches the screen edge only. Since safe area is not logical, it
|
|
175
|
-
* needs to be applied to the correct side depending on the language direction.
|
|
176
|
-
* Otherwise, the content will have less space on both sides.
|
|
177
|
-
*
|
|
178
|
-
* RTL:
|
|
179
|
-
* The left side of the menu touches the screen edge. The safe area padding has
|
|
180
|
-
* already been set in the core styles, so there's no need to set it again.
|
|
181
|
-
* The right side of the menu is not touching the screen edge. Padding is not
|
|
182
|
-
* applied to the right side of the menu. A value of 0 is set.
|
|
183
|
-
*/
|
|
184
|
-
--ion-safe-area-left: env(safe-area-inset-left);
|
|
185
|
-
--ion-safe-area-right: 0px;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
@supports selector(:dir(rtl)) {
|
|
189
|
-
:host(.menu-side-end) .menu-inner:dir(rtl) {
|
|
190
|
-
/**
|
|
191
|
-
* Menu does not cover the whole screen so we need to set the safe area for the
|
|
192
|
-
* side that touches the screen edge only. Since safe area is not logical, it
|
|
193
|
-
* needs to be applied to the correct side depending on the language direction.
|
|
194
|
-
* Otherwise, the content will have less space on both sides.
|
|
195
|
-
*
|
|
196
|
-
* RTL:
|
|
197
|
-
* The left side of the menu touches the screen edge. The safe area padding has
|
|
198
|
-
* already been set in the core styles, so there's no need to set it again.
|
|
199
|
-
* The right side of the menu is not touching the screen edge. Padding is not
|
|
200
|
-
* applied to the right side of the menu. A value of 0 is set.
|
|
201
|
-
*/
|
|
202
|
-
--ion-safe-area-left: env(safe-area-inset-left);
|
|
203
|
-
--ion-safe-area-right: 0px;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
112
|
|
|
207
113
|
ion-backdrop {
|
|
208
114
|
display: none;
|
|
@@ -47,18 +47,6 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
:host(.menu-side-start) .menu-inner {
|
|
50
|
-
/**
|
|
51
|
-
* Menu does not cover the whole screen so we need to set the safe area for the
|
|
52
|
-
* side that touches the screen edge only. Since safe area is not logical, it
|
|
53
|
-
* needs to be applied to the correct side depending on the language direction.
|
|
54
|
-
* Otherwise, the content will have less space on both sides.
|
|
55
|
-
*
|
|
56
|
-
* LTR:
|
|
57
|
-
* The left side of the menu touches the screen edge. The safe area padding has
|
|
58
|
-
* already been set in the core styles, so there's no need to set it again.
|
|
59
|
-
* The right side of the menu is not touching the screen edge. Padding is not
|
|
60
|
-
* applied to the right side of the menu. A value of 0 is set.
|
|
61
|
-
*/
|
|
62
50
|
--ion-safe-area-right: 0px;
|
|
63
51
|
top: 0;
|
|
64
52
|
bottom: 0;
|
|
@@ -89,55 +77,8 @@
|
|
|
89
77
|
}
|
|
90
78
|
}
|
|
91
79
|
}
|
|
92
|
-
:host-context([dir=rtl]):host(.menu-side-start) .menu-inner, :host-context([dir=rtl]).menu-side-start .menu-inner {
|
|
93
|
-
/**
|
|
94
|
-
* Menu does not cover the whole screen so we need to set the safe area for the
|
|
95
|
-
* side that touches the screen edge only. Since safe area is not logical, it
|
|
96
|
-
* needs to be applied to the correct side depending on the language direction.
|
|
97
|
-
* Otherwise, the content will have less space on both sides.
|
|
98
|
-
*
|
|
99
|
-
* RTL:
|
|
100
|
-
* The right side of the menu touches the screen edge. The safe area padding has
|
|
101
|
-
* already been set in the core styles, so there's no need to set it again.
|
|
102
|
-
* The left side of the menu is not touching the screen edge. Padding is not
|
|
103
|
-
* applied to the left side of the menu. A value of 0 is set.
|
|
104
|
-
*/
|
|
105
|
-
--ion-safe-area-right: env(safe-area-inset-right);
|
|
106
|
-
--ion-safe-area-left: 0px;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
@supports selector(:dir(rtl)) {
|
|
110
|
-
:host(.menu-side-start) .menu-inner:dir(rtl) {
|
|
111
|
-
/**
|
|
112
|
-
* Menu does not cover the whole screen so we need to set the safe area for the
|
|
113
|
-
* side that touches the screen edge only. Since safe area is not logical, it
|
|
114
|
-
* needs to be applied to the correct side depending on the language direction.
|
|
115
|
-
* Otherwise, the content will have less space on both sides.
|
|
116
|
-
*
|
|
117
|
-
* RTL:
|
|
118
|
-
* The right side of the menu touches the screen edge. The safe area padding has
|
|
119
|
-
* already been set in the core styles, so there's no need to set it again.
|
|
120
|
-
* The left side of the menu is not touching the screen edge. Padding is not
|
|
121
|
-
* applied to the left side of the menu. A value of 0 is set.
|
|
122
|
-
*/
|
|
123
|
-
--ion-safe-area-right: env(safe-area-inset-right);
|
|
124
|
-
--ion-safe-area-left: 0px;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
80
|
|
|
128
81
|
:host(.menu-side-end) .menu-inner {
|
|
129
|
-
/**
|
|
130
|
-
* Menu does not cover the whole screen so we need to set the safe area for the
|
|
131
|
-
* side that touches the screen edge only. Since safe area is not logical, it
|
|
132
|
-
* needs to be applied to the correct side depending on the language direction.
|
|
133
|
-
* Otherwise, the content will have less space on both sides.
|
|
134
|
-
*
|
|
135
|
-
* LTR:
|
|
136
|
-
* The right side of the menu touches the screen edge. The safe area padding has
|
|
137
|
-
* already been set in the core styles, so there's no need to set it again.
|
|
138
|
-
* The left side of the menu is not touching the screen edge. Padding is not
|
|
139
|
-
* applied to the left side of the menu. A value of 0 is set.
|
|
140
|
-
*/
|
|
141
82
|
--ion-safe-area-left: 0px;
|
|
142
83
|
top: 0;
|
|
143
84
|
bottom: 0;
|
|
@@ -168,41 +109,6 @@
|
|
|
168
109
|
}
|
|
169
110
|
}
|
|
170
111
|
}
|
|
171
|
-
:host-context([dir=rtl]):host(.menu-side-end) .menu-inner, :host-context([dir=rtl]).menu-side-end .menu-inner {
|
|
172
|
-
/**
|
|
173
|
-
* Menu does not cover the whole screen so we need to set the safe area for the
|
|
174
|
-
* side that touches the screen edge only. Since safe area is not logical, it
|
|
175
|
-
* needs to be applied to the correct side depending on the language direction.
|
|
176
|
-
* Otherwise, the content will have less space on both sides.
|
|
177
|
-
*
|
|
178
|
-
* RTL:
|
|
179
|
-
* The left side of the menu touches the screen edge. The safe area padding has
|
|
180
|
-
* already been set in the core styles, so there's no need to set it again.
|
|
181
|
-
* The right side of the menu is not touching the screen edge. Padding is not
|
|
182
|
-
* applied to the right side of the menu. A value of 0 is set.
|
|
183
|
-
*/
|
|
184
|
-
--ion-safe-area-left: env(safe-area-inset-left);
|
|
185
|
-
--ion-safe-area-right: 0px;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
@supports selector(:dir(rtl)) {
|
|
189
|
-
:host(.menu-side-end) .menu-inner:dir(rtl) {
|
|
190
|
-
/**
|
|
191
|
-
* Menu does not cover the whole screen so we need to set the safe area for the
|
|
192
|
-
* side that touches the screen edge only. Since safe area is not logical, it
|
|
193
|
-
* needs to be applied to the correct side depending on the language direction.
|
|
194
|
-
* Otherwise, the content will have less space on both sides.
|
|
195
|
-
*
|
|
196
|
-
* RTL:
|
|
197
|
-
* The left side of the menu touches the screen edge. The safe area padding has
|
|
198
|
-
* already been set in the core styles, so there's no need to set it again.
|
|
199
|
-
* The right side of the menu is not touching the screen edge. Padding is not
|
|
200
|
-
* applied to the right side of the menu. A value of 0 is set.
|
|
201
|
-
*/
|
|
202
|
-
--ion-safe-area-left: env(safe-area-inset-left);
|
|
203
|
-
--ion-safe-area-right: 0px;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
112
|
|
|
207
113
|
ion-backdrop {
|
|
208
114
|
display: none;
|
|
@@ -147,15 +147,6 @@ input {
|
|
|
147
147
|
margin-bottom: 10px;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
:host(.in-item.radio-label-placement-stacked) .label-text-wrapper {
|
|
151
|
-
margin-top: 10px;
|
|
152
|
-
margin-bottom: 16px;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
:host(.in-item.radio-label-placement-stacked) .native-wrapper {
|
|
156
|
-
margin-bottom: 10px;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
150
|
/**
|
|
160
151
|
* If no label text is placed into the slot
|
|
161
152
|
* then the element should be hidden otherwise
|
|
@@ -182,14 +173,6 @@ input {
|
|
|
182
173
|
justify-content: end;
|
|
183
174
|
}
|
|
184
175
|
|
|
185
|
-
:host(.radio-alignment-start) .radio-wrapper {
|
|
186
|
-
align-items: start;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
:host(.radio-alignment-center) .radio-wrapper {
|
|
190
|
-
align-items: center;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
176
|
/**
|
|
194
177
|
* Label is on the left of the radio in LTR and
|
|
195
178
|
* on the right in RTL.
|
|
@@ -252,24 +235,6 @@ input {
|
|
|
252
235
|
min-width: 100px;
|
|
253
236
|
}
|
|
254
237
|
|
|
255
|
-
/**
|
|
256
|
-
* Label is on top of the radio.
|
|
257
|
-
*/
|
|
258
|
-
:host(.radio-label-placement-stacked) .radio-wrapper {
|
|
259
|
-
flex-direction: column;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
:host(.radio-label-placement-stacked) .label-text-wrapper {
|
|
263
|
-
/**
|
|
264
|
-
* The margin between the label and
|
|
265
|
-
* the radio should be on the bottom
|
|
266
|
-
* when the label sits on top.
|
|
267
|
-
*/
|
|
268
|
-
margin-left: 0;
|
|
269
|
-
margin-right: 0;
|
|
270
|
-
margin-bottom: 16px;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
238
|
:host {
|
|
274
239
|
--color-checked: var(--ion-color-primary, #3880ff);
|
|
275
240
|
}
|
|
@@ -70,7 +70,6 @@ export class Radio {
|
|
|
70
70
|
this.labelPlacement = 'start';
|
|
71
71
|
this.legacy = undefined;
|
|
72
72
|
this.justify = 'space-between';
|
|
73
|
-
this.alignment = 'center';
|
|
74
73
|
}
|
|
75
74
|
valueChanged() {
|
|
76
75
|
/**
|
|
@@ -135,7 +134,7 @@ export class Radio {
|
|
|
135
134
|
return legacyFormController.hasLegacyControl() ? this.renderLegacyRadio() : this.renderRadio();
|
|
136
135
|
}
|
|
137
136
|
renderRadio() {
|
|
138
|
-
const { checked, disabled, color, el, justify, labelPlacement, hasLabel, buttonTabindex
|
|
137
|
+
const { checked, disabled, color, el, justify, labelPlacement, hasLabel, buttonTabindex } = this;
|
|
139
138
|
const mode = getIonMode(this);
|
|
140
139
|
const inItem = hostContext('ion-item', el);
|
|
141
140
|
return (h(Host, { onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.onClick, class: createColorClasses(color, {
|
|
@@ -144,7 +143,6 @@ export class Radio {
|
|
|
144
143
|
'radio-checked': checked,
|
|
145
144
|
'radio-disabled': disabled,
|
|
146
145
|
[`radio-justify-${justify}`]: true,
|
|
147
|
-
[`radio-alignment-${alignment}`]: true,
|
|
148
146
|
[`radio-label-placement-${labelPlacement}`]: true,
|
|
149
147
|
// Focus and active styling should not apply when the radio is in an item
|
|
150
148
|
'ion-activatable': !inItem,
|
|
@@ -277,15 +275,15 @@ Developers can dismiss this warning by removing their usage of the "legacy" prop
|
|
|
277
275
|
"type": "string",
|
|
278
276
|
"mutable": false,
|
|
279
277
|
"complexType": {
|
|
280
|
-
"original": "'start' | 'end' | 'fixed'
|
|
281
|
-
"resolved": "\"end\" | \"fixed\" | \"
|
|
278
|
+
"original": "'start' | 'end' | 'fixed'",
|
|
279
|
+
"resolved": "\"end\" | \"fixed\" | \"start\"",
|
|
282
280
|
"references": {}
|
|
283
281
|
},
|
|
284
282
|
"required": false,
|
|
285
283
|
"optional": false,
|
|
286
284
|
"docs": {
|
|
287
285
|
"tags": [],
|
|
288
|
-
"text": "Where to place the label relative to the radio.\n`\"start\"`: The label will appear to the left of the radio in LTR and to the right in RTL.\n`\"end\"`: The label will appear to the right of the radio in LTR and to the left in RTL.\n`\"fixed\"`: The label has the same behavior as `\"start\"` except it also has a fixed width. Long text will be truncated with ellipses (\"...\")
|
|
286
|
+
"text": "Where to place the label relative to the radio.\n`\"start\"`: The label will appear to the left of the radio in LTR and to the right in RTL.\n`\"end\"`: The label will appear to the right of the radio in LTR and to the left in RTL.\n`\"fixed\"`: The label has the same behavior as `\"start\"` except it also has a fixed width. Long text will be truncated with ellipses (\"...\")."
|
|
289
287
|
},
|
|
290
288
|
"attribute": "label-placement",
|
|
291
289
|
"reflect": false,
|
|
@@ -325,24 +323,6 @@ Developers can dismiss this warning by removing their usage of the "legacy" prop
|
|
|
325
323
|
"attribute": "justify",
|
|
326
324
|
"reflect": false,
|
|
327
325
|
"defaultValue": "'space-between'"
|
|
328
|
-
},
|
|
329
|
-
"alignment": {
|
|
330
|
-
"type": "string",
|
|
331
|
-
"mutable": false,
|
|
332
|
-
"complexType": {
|
|
333
|
-
"original": "'start' | 'center'",
|
|
334
|
-
"resolved": "\"center\" | \"start\"",
|
|
335
|
-
"references": {}
|
|
336
|
-
},
|
|
337
|
-
"required": false,
|
|
338
|
-
"optional": false,
|
|
339
|
-
"docs": {
|
|
340
|
-
"tags": [],
|
|
341
|
-
"text": "How to control the alignment of the radio and label on the cross axis.\n`\"start\"`: The label and control will appear on the left of the cross axis in LTR, and on the right side in RTL.\n`\"center\"`: The label and control will appear at the center of the cross axis in both LTR and RTL."
|
|
342
|
-
},
|
|
343
|
-
"attribute": "alignment",
|
|
344
|
-
"reflect": false,
|
|
345
|
-
"defaultValue": "'center'"
|
|
346
326
|
}
|
|
347
327
|
};
|
|
348
328
|
}
|
|
@@ -147,15 +147,6 @@ input {
|
|
|
147
147
|
margin-bottom: 10px;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
:host(.in-item.radio-label-placement-stacked) .label-text-wrapper {
|
|
151
|
-
margin-top: 10px;
|
|
152
|
-
margin-bottom: 16px;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
:host(.in-item.radio-label-placement-stacked) .native-wrapper {
|
|
156
|
-
margin-bottom: 10px;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
150
|
/**
|
|
160
151
|
* If no label text is placed into the slot
|
|
161
152
|
* then the element should be hidden otherwise
|
|
@@ -182,14 +173,6 @@ input {
|
|
|
182
173
|
justify-content: end;
|
|
183
174
|
}
|
|
184
175
|
|
|
185
|
-
:host(.radio-alignment-start) .radio-wrapper {
|
|
186
|
-
align-items: start;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
:host(.radio-alignment-center) .radio-wrapper {
|
|
190
|
-
align-items: center;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
176
|
/**
|
|
194
177
|
* Label is on the left of the radio in LTR and
|
|
195
178
|
* on the right in RTL.
|
|
@@ -252,24 +235,6 @@ input {
|
|
|
252
235
|
min-width: 100px;
|
|
253
236
|
}
|
|
254
237
|
|
|
255
|
-
/**
|
|
256
|
-
* Label is on top of the radio.
|
|
257
|
-
*/
|
|
258
|
-
:host(.radio-label-placement-stacked) .radio-wrapper {
|
|
259
|
-
flex-direction: column;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
:host(.radio-label-placement-stacked) .label-text-wrapper {
|
|
263
|
-
/**
|
|
264
|
-
* The margin between the label and
|
|
265
|
-
* the radio should be on the bottom
|
|
266
|
-
* when the label sits on top.
|
|
267
|
-
*/
|
|
268
|
-
margin-left: 0;
|
|
269
|
-
margin-right: 0;
|
|
270
|
-
margin-bottom: 16px;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
238
|
:host {
|
|
274
239
|
--color: rgb(var(--ion-text-color-rgb, 0, 0, 0), 0.6);
|
|
275
240
|
--color-checked: var(--ion-color-primary, #3880ff);
|
|
@@ -51,19 +51,4 @@ configs({ directions: ['ltr'], modes: ['md'] }).forEach(({ title, screenshot, co
|
|
|
51
51
|
await expect(list).toHaveScreenshot(screenshot(`radio-long-label-in-item`));
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
|
-
test.describe(title('radio: stacked label in item'), () => {
|
|
55
|
-
test('should render margins correctly when using stacked label in item', async ({ page }) => {
|
|
56
|
-
await page.setContent(`
|
|
57
|
-
<ion-list>
|
|
58
|
-
<ion-radio-group>
|
|
59
|
-
<ion-item>
|
|
60
|
-
<ion-radio label-placement="stacked">Enable Notifications</ion-radio>
|
|
61
|
-
</ion-item>
|
|
62
|
-
</ion-radio-group>
|
|
63
|
-
</ion-list>
|
|
64
|
-
`, config);
|
|
65
|
-
const list = page.locator('ion-list');
|
|
66
|
-
await expect(list).toHaveScreenshot(screenshot(`radio-stacked-label-in-item`));
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
54
|
});
|
|
@@ -100,25 +100,5 @@ configs().forEach(({ title, screenshot, config }) => {
|
|
|
100
100
|
await expect(radio).toHaveScreenshot(screenshot(`radio-label-fixed-justify-space-between`));
|
|
101
101
|
});
|
|
102
102
|
});
|
|
103
|
-
test.describe('radio: stacked placement', () => {
|
|
104
|
-
test('should align the label to the start of the container in the stacked position', async ({ page }) => {
|
|
105
|
-
await page.setContent(`
|
|
106
|
-
<ion-radio-group value="1">
|
|
107
|
-
<ion-radio label-placement="stacked" alignment="start" style="width: 200px" value="1">This is a long label</ion-radio>
|
|
108
|
-
</ion-radio-group>
|
|
109
|
-
`, config);
|
|
110
|
-
const radio = page.locator('ion-radio');
|
|
111
|
-
await expect(radio).toHaveScreenshot(screenshot(`radio-label-stacked-align-start`));
|
|
112
|
-
});
|
|
113
|
-
test('should align the label to the center of the container in the stacked position', async ({ page }) => {
|
|
114
|
-
await page.setContent(`
|
|
115
|
-
<ion-radio-group value="1">
|
|
116
|
-
<ion-radio label-placement="stacked" alignment="center" style="width: 200px" value="1">This is a long label</ion-radio>
|
|
117
|
-
</ion-radio-group>
|
|
118
|
-
`, config);
|
|
119
|
-
const radio = page.locator('ion-radio');
|
|
120
|
-
await expect(radio).toHaveScreenshot(screenshot(`radio-label-stacked-align-center`));
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
103
|
});
|
|
124
104
|
});
|
|
@@ -363,25 +363,6 @@
|
|
|
363
363
|
max-width: 200px;
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
-
/**
|
|
367
|
-
* Label is on top of the range.
|
|
368
|
-
*/
|
|
369
|
-
:host(.range-label-placement-stacked) .range-wrapper {
|
|
370
|
-
flex-direction: column;
|
|
371
|
-
align-items: stretch;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
:host(.range-label-placement-stacked) .label-text-wrapper {
|
|
375
|
-
/**
|
|
376
|
-
* The margin between the label and
|
|
377
|
-
* the range should be on the bottom
|
|
378
|
-
* when the label sits on top.
|
|
379
|
-
*/
|
|
380
|
-
margin-left: 0;
|
|
381
|
-
margin-right: 0;
|
|
382
|
-
margin-bottom: 16px;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
366
|
:host {
|
|
386
367
|
--knob-border-radius: 50%;
|
|
387
368
|
--knob-background: #ffffff;
|
|
@@ -426,31 +407,10 @@
|
|
|
426
407
|
margin-bottom: 0;
|
|
427
408
|
}
|
|
428
409
|
|
|
429
|
-
:host(.range-has-pin
|
|
430
|
-
/**
|
|
431
|
-
* The pin should not overlap any elements that are
|
|
432
|
-
* above the range. By adding padding to the top of the
|
|
433
|
-
* range, it provides a buffer for the pin to move into
|
|
434
|
-
* when it is pressed.
|
|
435
|
-
*
|
|
436
|
-
* The padding is not included when the label is stacked
|
|
437
|
-
* because the pin is below the label.
|
|
438
|
-
* It still requires a buffer to prevent the pin from
|
|
439
|
-
* overlapping the range. The buffer is added to the
|
|
440
|
-
* bottom of the range label instead of the host.
|
|
441
|
-
*/
|
|
410
|
+
:host(.range-has-pin) {
|
|
442
411
|
padding-top: 20px;
|
|
443
412
|
}
|
|
444
413
|
|
|
445
|
-
:host(.range-has-pin.range-label-placement-stacked) .label-text-wrapper {
|
|
446
|
-
/**
|
|
447
|
-
* The pin should not overlap the stacked label. By adding
|
|
448
|
-
* margin to the bottom of the label, it provides a buffer
|
|
449
|
-
* for the pin to move into when it is pressed.
|
|
450
|
-
*/
|
|
451
|
-
margin-bottom: 20px;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
414
|
.range-bar-active {
|
|
455
415
|
bottom: 0;
|
|
456
416
|
width: auto;
|
|
@@ -808,15 +808,15 @@ Developers can dismiss this warning by removing their usage of the "legacy" prop
|
|
|
808
808
|
"type": "string",
|
|
809
809
|
"mutable": false,
|
|
810
810
|
"complexType": {
|
|
811
|
-
"original": "'start' | 'end' | 'fixed'
|
|
812
|
-
"resolved": "\"end\" | \"fixed\" | \"
|
|
811
|
+
"original": "'start' | 'end' | 'fixed'",
|
|
812
|
+
"resolved": "\"end\" | \"fixed\" | \"start\"",
|
|
813
813
|
"references": {}
|
|
814
814
|
},
|
|
815
815
|
"required": false,
|
|
816
816
|
"optional": false,
|
|
817
817
|
"docs": {
|
|
818
818
|
"tags": [],
|
|
819
|
-
"text": "Where to place the label relative to the range.\n`\"start\"`: The label will appear to the left of the range in LTR and to the right in RTL.\n`\"end\"`: The label will appear to the right of the range in LTR and to the left in RTL.\n`\"fixed\"`: The label has the same behavior as `\"start\"` except it also has a fixed width. Long text will be truncated with ellipses (\"...\")
|
|
819
|
+
"text": "Where to place the label relative to the range.\n`\"start\"`: The label will appear to the left of the range in LTR and to the right in RTL.\n`\"end\"`: The label will appear to the right of the range in LTR and to the left in RTL.\n`\"fixed\"`: The label has the same behavior as `\"start\"` except it also has a fixed width. Long text will be truncated with ellipses (\"...\")."
|
|
820
820
|
},
|
|
821
821
|
"attribute": "label-placement",
|
|
822
822
|
"reflect": false,
|
|
@@ -363,25 +363,6 @@
|
|
|
363
363
|
max-width: 200px;
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
-
/**
|
|
367
|
-
* Label is on top of the range.
|
|
368
|
-
*/
|
|
369
|
-
:host(.range-label-placement-stacked) .range-wrapper {
|
|
370
|
-
flex-direction: column;
|
|
371
|
-
align-items: stretch;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
:host(.range-label-placement-stacked) .label-text-wrapper {
|
|
375
|
-
/**
|
|
376
|
-
* The margin between the label and
|
|
377
|
-
* the range should be on the bottom
|
|
378
|
-
* when the label sits on top.
|
|
379
|
-
*/
|
|
380
|
-
margin-left: 0;
|
|
381
|
-
margin-right: 0;
|
|
382
|
-
margin-bottom: 16px;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
366
|
:host {
|
|
386
367
|
--knob-border-radius: 50%;
|
|
387
368
|
--knob-background: var(--bar-background-active);
|
|
@@ -442,31 +423,10 @@
|
|
|
442
423
|
margin-bottom: 0;
|
|
443
424
|
}
|
|
444
425
|
|
|
445
|
-
:host(.range-has-pin
|
|
446
|
-
/**
|
|
447
|
-
* The pin should not overlap any elements that are
|
|
448
|
-
* above the range. By adding padding to the top of the
|
|
449
|
-
* range, it provides a buffer for the pin to move into
|
|
450
|
-
* when it is pressed.
|
|
451
|
-
*
|
|
452
|
-
* The padding is not included when the label is stacked
|
|
453
|
-
* because the pin is below the label.
|
|
454
|
-
* It still requires a buffer to prevent the pin from
|
|
455
|
-
* overlapping the range. The buffer is added to the
|
|
456
|
-
* bottom of the range label instead of the host.
|
|
457
|
-
*/
|
|
426
|
+
:host(.range-has-pin) {
|
|
458
427
|
padding-top: 28px;
|
|
459
428
|
}
|
|
460
429
|
|
|
461
|
-
:host(.range-has-pin.range-label-placement-stacked) .label-text-wrapper {
|
|
462
|
-
/**
|
|
463
|
-
* The pin should not overlap the stacked label. By adding
|
|
464
|
-
* margin to the bottom of the label, it provides a buffer
|
|
465
|
-
* for the pin to move into when it is pressed.
|
|
466
|
-
*/
|
|
467
|
-
margin-bottom: 28px;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
430
|
.range-bar-active {
|
|
471
431
|
bottom: 0;
|
|
472
432
|
width: auto;
|