@ionic/core 7.5.8-dev.11701894917.1c1465bd → 7.5.8-dev.11702074871.1238046f
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/data.js +1 -1
- package/components/ion-datetime.js +39 -30
- package/components/ion-picker-column-option.d.ts +11 -0
- package/components/ion-picker-column-option.js +9 -0
- package/components/ion-picker-column.js +2 -2
- package/components/ion-picker-legacy-column.d.ts +11 -0
- package/components/ion-picker-legacy-column.js +9 -0
- package/components/{ion-picker-internal.d.ts → ion-picker-legacy.d.ts} +4 -4
- package/components/ion-picker-legacy.js +309 -0
- package/components/ion-picker.js +1 -309
- package/components/overlays.js +6 -3
- package/components/picker-column-option.js +122 -0
- package/components/picker-column.js +351 -322
- package/components/picker-column2.js +379 -0
- package/components/{picker-internal.js → picker.js} +29 -22
- package/dist/cjs/{data-36b9094e.js → data-e7526b58.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/ion-alert.cjs.entry.js +1 -1
- package/dist/cjs/ion-datetime-button.cjs.entry.js +1 -1
- package/dist/cjs/ion-datetime_3.cjs.entry.js +29 -35
- package/dist/cjs/ion-loading.cjs.entry.js +1 -1
- package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-picker-column-option.cjs.entry.js +104 -0
- package/dist/cjs/{ion-picker-column-internal.cjs.entry.js → ion-picker-column.cjs.entry.js} +104 -87
- package/dist/cjs/{ion-picker-internal.cjs.entry.js → ion-picker.cjs.entry.js} +26 -19
- package/dist/cjs/ion-popover.cjs.entry.js +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-toast.cjs.entry.js +1 -1
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{overlays-2c6b1072.js → overlays-e8e05b0e.js} +6 -3
- package/dist/collection/collection-manifest.json +7 -6
- package/dist/collection/components/datetime/datetime.ios.css +8 -13
- package/dist/collection/components/datetime/datetime.js +19 -16
- package/dist/collection/components/datetime/datetime.md.css +8 -13
- package/dist/collection/components/datetime/test/datetime.e2e.js +2 -2
- package/dist/collection/components/datetime/test/disabled/datetime.spec.js +4 -4
- package/dist/collection/components/datetime/test/locale/datetime.e2e.js +2 -2
- package/dist/collection/components/datetime/test/minmax/datetime.e2e.js +6 -6
- package/dist/collection/components/datetime/test/prefer-wheel/datetime.e2e.js +43 -41
- package/dist/collection/components/datetime/test/presentation/datetime.e2e.js +1 -1
- package/dist/collection/components/datetime/test/readonly/datetime.e2e.js +2 -2
- package/dist/collection/components/datetime/test/values/datetime.e2e.js +15 -12
- package/dist/collection/components/datetime/utils/data.js +1 -1
- package/dist/collection/components/picker/picker.ios.css +113 -211
- package/dist/collection/components/picker/picker.js +468 -743
- package/dist/collection/components/picker/picker.md.css +109 -198
- package/dist/collection/components/{picker-internal/test/a11y/picker-internal.e2e.js → picker/test/a11y/picker.e2e.js} +2 -2
- package/dist/collection/components/picker/test/basic/picker.e2e.js +99 -13
- package/dist/collection/components/picker/test/custom/picker.e2e.js +85 -0
- package/dist/collection/components/{picker-internal/test/keyboard-entry/picker-internal.e2e.js → picker/test/keyboard-entry/picker.e2e.js} +63 -32
- package/dist/collection/components/{picker-column-internal/picker-column-internal.md.css → picker-column/picker-column.css} +96 -83
- package/dist/collection/components/picker-column/picker-column.js +497 -335
- package/dist/collection/components/{picker-column-internal/test/basic/picker-column-internal.e2e.js → picker-column/test/basic/picker-column.e2e.js} +8 -8
- package/dist/collection/components/picker-column/test/disabled/picker-column.e2e.js +91 -0
- package/dist/collection/components/picker-column/test/slots/picker-column.e2e.js +39 -0
- package/dist/collection/components/picker-column-option/picker-column-option.ios.css +87 -0
- package/dist/collection/components/picker-column-option/picker-column-option.js +173 -0
- package/dist/collection/components/{picker-column-internal/picker-column-internal.ios.css → picker-column-option/picker-column-option.md.css} +6 -53
- package/dist/collection/components/picker-column-option/test/a11y/picker-column-option.e2e.js +18 -0
- package/dist/collection/components/picker-column-option/test/basic/picker-column-option.e2e.js +37 -0
- package/dist/collection/components/picker-column-option/test/picker-column-option.spec.js +29 -0
- package/dist/collection/components/{picker-internal/picker-internal.md.css → picker-legacy/picker.ios.css} +207 -98
- package/dist/collection/components/picker-legacy/picker.js +817 -0
- package/dist/collection/components/{picker-internal/picker-internal.ios.css → picker-legacy/picker.md.css} +192 -100
- package/dist/collection/components/picker-legacy/test/basic/picker.e2e.js +25 -0
- package/dist/collection/components/{picker → picker-legacy}/test/is-open/picker.e2e.js +4 -4
- package/dist/collection/components/{picker → picker-legacy}/test/picker-id.spec.js +5 -5
- package/dist/collection/components/{picker → picker-legacy}/test/trigger/picker.e2e.js +1 -1
- package/dist/collection/components/picker-legacy-column/picker-column.js +419 -0
- package/dist/collection/components/{picker-column → picker-legacy-column}/test/picker-column-aria.spec.js +3 -3
- package/dist/collection/components/{picker-column → picker-legacy-column}/test/picker-column-dynamic.spec.js +2 -2
- package/dist/collection/components/{picker-column → picker-legacy-column}/test/picker-column.spec.js +2 -2
- package/dist/collection/components/{picker-column → picker-legacy-column}/test/standalone/picker-column.e2e.js +3 -3
- package/dist/collection/utils/overlays.js +6 -3
- package/dist/docs.json +493 -24
- package/dist/esm/{data-f5c75b4e.js → data-4b9508c9.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +1 -1
- package/dist/esm/ion-alert.entry.js +1 -1
- package/dist/esm/ion-datetime-button.entry.js +1 -1
- package/dist/esm/ion-datetime_3.entry.js +28 -34
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu_3.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +1 -1
- package/dist/esm/ion-picker-column-option.entry.js +100 -0
- package/dist/esm/{ion-picker-column-internal.entry.js → ion-picker-column.entry.js} +104 -87
- package/dist/esm/{ion-picker-internal.entry.js → ion-picker.entry.js} +26 -19
- package/dist/esm/ion-popover.entry.js +1 -1
- package/dist/esm/ion-select_3.entry.js +1 -1
- package/dist/esm/ion-toast.entry.js +1 -1
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{overlays-d23ea6e1.js → overlays-fbc5cab5.js} +6 -3
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
- package/dist/esm-es5/ion-alert.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-loading.entry.js +1 -1
- package/dist/esm-es5/ion-menu_3.entry.js +1 -1
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/esm-es5/ion-picker-column-option.entry.js +4 -0
- package/dist/esm-es5/ion-picker-column.entry.js +4 -0
- package/dist/esm-es5/ion-picker.entry.js +4 -0
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-toast.entry.js +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/overlays-fbc5cab5.js +4 -0
- package/dist/html.html-data.json +152 -1
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-2f300cca.entry.js → p-21c3515a.entry.js} +1 -1
- package/dist/ionic/{p-1f620cd4.system.entry.js → p-26798a7b.system.entry.js} +1 -1
- package/dist/ionic/{p-e1e5afe1.system.entry.js → p-27bcbbc7.system.entry.js} +1 -1
- package/dist/ionic/p-36d194c5.entry.js +4 -0
- package/dist/ionic/{p-3b568d18.entry.js → p-4a081ea9.entry.js} +1 -1
- package/dist/ionic/{p-2f2293da.system.entry.js → p-4a36430f.system.entry.js} +1 -1
- package/dist/ionic/{p-fff7a57e.system.js → p-54dfc9b5.system.js} +1 -1
- package/dist/ionic/{p-60b386c9.system.entry.js → p-563c41f0.system.entry.js} +1 -1
- package/dist/ionic/p-5a1aac13.system.entry.js +4 -0
- package/dist/ionic/{p-27ea6f4e.entry.js → p-5d42b6b4.entry.js} +1 -1
- package/dist/ionic/{p-2dc43d20.entry.js → p-6b7c55cd.entry.js} +1 -1
- package/dist/ionic/{p-f78efbd1.entry.js → p-73190c5f.entry.js} +1 -1
- package/dist/ionic/{p-af19a573.entry.js → p-73aa7604.entry.js} +1 -1
- package/dist/ionic/{p-39a335b6.system.entry.js → p-8017aad2.system.entry.js} +1 -1
- package/dist/ionic/{p-1e57bd24.entry.js → p-846ee227.entry.js} +1 -1
- package/dist/ionic/p-8e42850f.entry.js +4 -0
- package/dist/ionic/p-8fa6583d.system.js +4 -0
- package/dist/ionic/{p-4df97e3c.system.entry.js → p-96dbbac1.system.entry.js} +1 -1
- package/dist/ionic/p-9f1b2214.entry.js +4 -0
- package/dist/ionic/{p-8780cc2a.entry.js → p-a8baa23e.entry.js} +1 -1
- package/dist/ionic/p-afcf4620.entry.js +4 -0
- package/dist/ionic/{p-ddb30596.entry.js → p-b133e9b4.entry.js} +1 -1
- package/dist/ionic/{p-3e3d06a6.system.entry.js → p-c18de88a.system.entry.js} +1 -1
- package/dist/ionic/p-c41bff4e.system.entry.js +4 -0
- package/dist/ionic/p-ca846d0b.system.entry.js +4 -0
- package/dist/ionic/p-ca8938f4.js +4 -0
- package/dist/ionic/p-e3584231.system.js +1 -1
- package/dist/ionic/{p-9eec42cc.system.entry.js → p-f910cc73.system.entry.js} +1 -1
- package/dist/ionic/{p-e3ad9607.system.entry.js → p-fbf3a689.system.entry.js} +1 -1
- package/dist/ionic/p-ffd5dba4.system.entry.js +4 -0
- package/dist/types/components/datetime/utils/data.d.ts +11 -7
- package/dist/types/components/picker/picker-interfaces.d.ts +8 -0
- package/dist/types/components/picker/picker.d.ts +74 -131
- package/dist/types/components/picker-column/picker-column-interfaces.d.ts +4 -0
- package/dist/types/components/picker-column/picker-column.d.ts +99 -39
- package/dist/types/components/picker-column-option/picker-column-option.d.ts +66 -0
- package/dist/types/components/picker-legacy/picker.d.ts +158 -0
- package/dist/types/components/picker-legacy-column/picker-column.d.ts +46 -0
- package/dist/types/components.d.ts +155 -122
- package/dist/types/interface.d.ts +1 -1
- package/dist/types/utils/config.d.ts +2 -2
- package/dist/types/utils/overlays.d.ts +5 -2
- package/hydrate/index.js +1486 -1362
- package/package.json +1 -1
- package/components/ion-picker-column-internal.d.ts +0 -11
- package/components/ion-picker-column-internal.js +0 -9
- package/components/ion-picker-internal.js +0 -9
- package/components/picker-column-internal.js +0 -390
- package/dist/collection/components/picker-column-internal/picker-column-internal.js +0 -565
- package/dist/collection/components/picker-column-internal/test/disabled/picker-column-internal.e2e.js +0 -162
- package/dist/collection/components/picker-internal/picker-internal.js +0 -544
- package/dist/collection/components/picker-internal/test/basic/picker-internal.e2e.js +0 -118
- package/dist/esm-es5/ion-picker-column-internal.entry.js +0 -4
- package/dist/esm-es5/ion-picker-internal.entry.js +0 -4
- package/dist/esm-es5/overlays-d23ea6e1.js +0 -4
- package/dist/ionic/p-60502e3f.system.entry.js +0 -4
- package/dist/ionic/p-67da080d.entry.js +0 -4
- package/dist/ionic/p-73ea8f82.system.entry.js +0 -4
- package/dist/ionic/p-80fa068e.entry.js +0 -4
- package/dist/ionic/p-ab11130c.system.js +0 -4
- package/dist/ionic/p-af16fe62.entry.js +0 -4
- package/dist/ionic/p-c14f8ac8.js +0 -4
- package/dist/ionic/p-cce9f61a.system.entry.js +0 -4
- package/dist/types/components/picker-column-internal/picker-column-internal-interfaces.d.ts +0 -5
- package/dist/types/components/picker-column-internal/picker-column-internal.d.ts +0 -102
- package/dist/types/components/picker-internal/picker-internal-interfaces.d.ts +0 -8
- package/dist/types/components/picker-internal/picker-internal.d.ts +0 -102
- /package/dist/collection/components/{picker-internal/picker-internal-interfaces.js → picker/picker-interfaces.js} +0 -0
- /package/dist/collection/components/{picker-column-internal/picker-column-internal-interfaces.js → picker-column/picker-column-interfaces.js} +0 -0
- /package/dist/collection/components/{picker → picker-legacy}/animations/ios.enter.js +0 -0
- /package/dist/collection/components/{picker → picker-legacy}/animations/ios.leave.js +0 -0
- /package/dist/collection/components/{picker → picker-legacy}/picker-interface.js +0 -0
- /package/dist/collection/components/{picker-column → picker-legacy-column}/picker-column.ios.css +0 -0
- /package/dist/collection/components/{picker-column → picker-legacy-column}/picker-column.md.css +0 -0
- /package/dist/collection/components/{picker-column → picker-legacy-column}/test/test.utils.js +0 -0
- /package/dist/esm-es5/{data-f5c75b4e.js → data-4b9508c9.js} +0 -0
- /package/dist/ionic/{p-2aea8b1e.js → p-368f5215.js} +0 -0
- /package/dist/ionic/{p-82e3d633.system.js → p-f58981c2.system.js} +0 -0
- /package/dist/types/components/{picker → picker-legacy}/animations/ios.enter.d.ts +0 -0
- /package/dist/types/components/{picker → picker-legacy}/animations/ios.leave.d.ts +0 -0
- /package/dist/types/components/{picker → picker-legacy}/picker-interface.d.ts +0 -0
- /package/dist/types/components/{picker-column → picker-legacy-column}/test/test.utils.d.ts +0 -0
package/hydrate/index.js
CHANGED
|
@@ -8355,7 +8355,7 @@ const focusLastDescendant = (ref, overlay) => {
|
|
|
8355
8355
|
* Should NOT include: Toast
|
|
8356
8356
|
*/
|
|
8357
8357
|
const trapKeyboardFocus = (ev, doc) => {
|
|
8358
|
-
const lastOverlay = getPresentedOverlay(doc, 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover');
|
|
8358
|
+
const lastOverlay = getPresentedOverlay(doc, 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker-legacy,ion-popover');
|
|
8359
8359
|
const target = ev.target;
|
|
8360
8360
|
/**
|
|
8361
8361
|
* If no active overlay, ignore this event.
|
|
@@ -8540,7 +8540,7 @@ const dismissOverlay = (doc, data, role, overlayTag, id) => {
|
|
|
8540
8540
|
*/
|
|
8541
8541
|
const getOverlays = (doc, selector) => {
|
|
8542
8542
|
if (selector === undefined) {
|
|
8543
|
-
selector = 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast';
|
|
8543
|
+
selector = 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker-legacy,ion-popover,ion-toast';
|
|
8544
8544
|
}
|
|
8545
8545
|
return Array.from(doc.querySelectorAll(selector)).filter((c) => c.overlayIndex > 0);
|
|
8546
8546
|
};
|
|
@@ -14518,7 +14518,7 @@ const getMonthColumnData = (locale, refParts, minParts, maxParts, monthValues, f
|
|
|
14518
14518
|
* @param minParts The minimum bound on the date that can be returned
|
|
14519
14519
|
* @param maxParts The maximum bound on the date that can be returned
|
|
14520
14520
|
* @param dayValues The allowed date values
|
|
14521
|
-
* @returns Date data to be used in ion-picker-column
|
|
14521
|
+
* @returns Date data to be used in ion-picker-column
|
|
14522
14522
|
*/
|
|
14523
14523
|
const getDayColumnData = (locale, refParts, minParts, maxParts, dayValues, formatOptions = {
|
|
14524
14524
|
day: 'numeric',
|
|
@@ -14865,9 +14865,9 @@ const getHighlightStyles = (highlightedDates, dateIsoString, el) => {
|
|
|
14865
14865
|
return undefined;
|
|
14866
14866
|
};
|
|
14867
14867
|
|
|
14868
|
-
const datetimeIosCss = "/*!@:host*/.sc-ion-datetime-ios-h{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}/*!@ion-picker-column-internal*/ion-picker-column-internal.sc-ion-datetime-ios{min-width:26px}/*!@:host(.datetime-size-fixed)*/.datetime-size-fixed.sc-ion-datetime-ios-h{width:auto;height:auto}/*!@:host(.datetime-size-fixed:not(.datetime-prefer-wheel))*/.datetime-size-fixed.sc-ion-datetime-ios-h:not(.datetime-prefer-wheel){max-width:350px}/*!@:host(.datetime-size-fixed.datetime-prefer-wheel)*/.datetime-size-fixed.datetime-prefer-wheel.sc-ion-datetime-ios-h{min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}/*!@:host(.datetime-size-cover)*/.datetime-size-cover.sc-ion-datetime-ios-h{width:100%}/*!@:host .calendar-body,\n:host .datetime-year*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios,.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{opacity:0}/*!@:host(:not(.datetime-ready)) .datetime-year*/.sc-ion-datetime-ios-h:not(.datetime-ready) .datetime-year.sc-ion-datetime-ios{position:absolute;pointer-events:none}/*!@:host(.datetime-ready) .calendar-body*/.datetime-ready.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios{opacity:1}/*!@:host(.datetime-ready) .datetime-year*/.datetime-ready.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{display:none;opacity:1}/*!@:host .wheel-order-year-first .day-column*/.sc-ion-datetime-ios-h .wheel-order-year-first.sc-ion-datetime-ios .day-column.sc-ion-datetime-ios{-ms-flex-order:3;order:3;text-align:end}/*!@:host .wheel-order-year-first .month-column*/.sc-ion-datetime-ios-h .wheel-order-year-first.sc-ion-datetime-ios .month-column.sc-ion-datetime-ios{-ms-flex-order:2;order:2;text-align:end}/*!@:host .wheel-order-year-first .year-column*/.sc-ion-datetime-ios-h .wheel-order-year-first.sc-ion-datetime-ios .year-column.sc-ion-datetime-ios{-ms-flex-order:1;order:1;text-align:start}/*!@:host .datetime-calendar,\n:host .datetime-year*/.sc-ion-datetime-ios-h .datetime-calendar.sc-ion-datetime-ios,.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}/*!@:host(.show-month-and-year) .datetime-year*/.show-month-and-year.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{display:-ms-flexbox;display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){/*!@:host(.show-month-and-year) .calendar-next-prev,\n :host(.show-month-and-year) .calendar-days-of-week,\n :host(.show-month-and-year) .calendar-body,\n :host(.show-month-and-year) .datetime-time*/.show-month-and-year.sc-ion-datetime-ios-h .calendar-next-prev.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{position:absolute;visibility:hidden;pointer-events:none}/*!@@supports (inset-inline-start: 0)*/@supports .sc-ion-datetime-ios (inset-inline-start.sc-ion-datetime-ios: 0).sc-ion-datetime-ios{.sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-ios-h.show-month-and-year .calendar-body,.sc-ion-datetime-ios-h.show-month-and-year .datetime-time{inset-inline-start:-99999px}}/*!@@supports not (inset-inline-start: 0)*/@supports .sc-ion-datetime-ios not.sc-ion-datetime-ios (inset-inline-start.sc-ion-datetime-ios: 0).sc-ion-datetime-ios{.sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-ios-h.show-month-and-year .calendar-body,.sc-ion-datetime-ios-h.show-month-and-year .datetime-time{left:-99999px}.sc-ion-datetime-ios-h[dir=rtl].sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,[dir=rtl] .sc-ion-datetime-ios-h.sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-ios-h[dir=rtl].show-month-and-year .calendar-next-prev,[dir=rtl] .sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-ios-h[dir=rtl].sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,[dir=rtl] .sc-ion-datetime-ios-h.sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-ios-h[dir=rtl].show-month-and-year .calendar-days-of-week,[dir=rtl] .sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-ios-h[dir=rtl].sc-ion-datetime-ios-h.show-month-and-year .calendar-body,[dir=rtl] .sc-ion-datetime-ios-h.sc-ion-datetime-ios-h.show-month-and-year .calendar-body,.sc-ion-datetime-ios-h[dir=rtl].show-month-and-year .calendar-body,[dir=rtl] .sc-ion-datetime-ios-h.show-month-and-year .calendar-body,.sc-ion-datetime-ios-h[dir=rtl].sc-ion-datetime-ios-h.show-month-and-year .datetime-time,[dir=rtl] .sc-ion-datetime-ios-h.sc-ion-datetime-ios-h.show-month-and-year .datetime-time,.sc-ion-datetime-ios-h[dir=rtl].show-month-and-year .datetime-time,[dir=rtl] .sc-ion-datetime-ios-h.show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){.sc-ion-datetime-ios-h.show-month-and-year:dir(rtl) .calendar-next-prev,.sc-ion-datetime-ios-h.show-month-and-year:dir(rtl) .calendar-days-of-week,.sc-ion-datetime-ios-h.show-month-and-year:dir(rtl) .calendar-body,.sc-ion-datetime-ios-h.show-month-and-year:dir(rtl) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){/*!@:host(.show-month-and-year) .calendar-next-prev,\n :host(.show-month-and-year) .calendar-days-of-week,\n :host(.show-month-and-year) .calendar-body,\n :host(.show-month-and-year) .datetime-time*/.show-month-and-year.sc-ion-datetime-ios-h .calendar-next-prev.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{display:none}}/*!@:host(.month-year-picker-open) .datetime-footer*/.month-year-picker-open.sc-ion-datetime-ios-h .datetime-footer.sc-ion-datetime-ios{display:none}/*!@:host(.datetime-disabled)*/.datetime-disabled.sc-ion-datetime-ios-h{pointer-events:none}/*!@:host(.datetime-disabled) .calendar-days-of-week,\n:host(.datetime-disabled) .datetime-time*/.datetime-disabled.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios,.datetime-disabled.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{opacity:0.4}/*!@:host(.datetime-readonly)*/.datetime-readonly.sc-ion-datetime-ios-h{pointer-events:none}/*!@:host(.datetime-readonly) .calendar-action-buttons,\n:host(.datetime-readonly) .calendar-body,\n:host(.datetime-readonly) .datetime-year*/.datetime-readonly.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios,.datetime-readonly.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios,.datetime-readonly.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{pointer-events:initial}/*!@:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),\n:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]*/.datetime-readonly.sc-ion-datetime-ios-h .calendar-day[disabled].sc-ion-datetime-ios:not(.calendar-day-constrained),.datetime-readonly.sc-ion-datetime-ios-h .datetime-action-buttons.sc-ion-datetime-ios ion-button[disabled].sc-ion-datetime-ios{opacity:1}/*!@:host .datetime-header .datetime-title*/.sc-ion-datetime-ios-h .datetime-header.sc-ion-datetime-ios .datetime-title.sc-ion-datetime-ios{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}/*!@:host .datetime-action-buttons.has-clear-button*/.sc-ion-datetime-ios-h .datetime-action-buttons.has-clear-button.sc-ion-datetime-ios{width:100%}/*!@:host .datetime-action-buttons ion-buttons*/.sc-ion-datetime-ios-h .datetime-action-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@.datetime-action-buttons .datetime-action-buttons-container*/.datetime-action-buttons.sc-ion-datetime-ios .datetime-action-buttons-container.sc-ion-datetime-ios{display:-ms-flexbox;display:flex}/*!@:host .calendar-action-buttons*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@:host .calendar-action-buttons ion-button*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-button.sc-ion-datetime-ios{--background:transparent}/*!@:host .calendar-days-of-week*/.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}/*!@.calendar-days-of-week .day-of-week*/.calendar-days-of-week.sc-ion-datetime-ios .day-of-week.sc-ion-datetime-ios{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}/*!@:host .calendar-body*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}/*!@:host .calendar-body .calendar-month*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios .calendar-month.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}/*!@:host .calendar-body .calendar-month-disabled*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios .calendar-month-disabled.sc-ion-datetime-ios{scroll-snap-align:none}/*!@:host .calendar-body::-webkit-scrollbar*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios::-webkit-scrollbar{display:none}/*!@:host .calendar-body .calendar-month-grid*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios .calendar-month-grid.sc-ion-datetime-ios{display:grid;grid-template-columns:repeat(7, 1fr)}/*!@:host .calendar-day-wrapper*/.sc-ion-datetime-ios-h .calendar-day-wrapper.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}/*!@.calendar-day*/.calendar-day.sc-ion-datetime-ios{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}/*!@:host .calendar-day[disabled]*/.sc-ion-datetime-ios-h .calendar-day[disabled].sc-ion-datetime-ios{pointer-events:none;opacity:0.4}/*!@.calendar-day:focus*/.calendar-day.sc-ion-datetime-ios:focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}/*!@:host .datetime-time*/.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@:host(.datetime-presentation-time) .datetime-time*/.datetime-presentation-time.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}/*!@:host ion-popover*/.sc-ion-datetime-ios-h ion-popover.sc-ion-datetime-ios{--height:200px}/*!@:host .time-header*/.sc-ion-datetime-ios-h .time-header.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}/*!@:host .time-body*/.sc-ion-datetime-ios-h .time-body.sc-ion-datetime-ios{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}/*!@:host .time-body-active*/.sc-ion-datetime-ios-h .time-body-active.sc-ion-datetime-ios{color:var(--ion-color-base)}/*!@:host(.in-item)*/.in-item.sc-ion-datetime-ios-h{position:static}/*!@:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle*/.show-month-and-year.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios .calendar-month-year-toggle.sc-ion-datetime-ios{color:var(--ion-color-base)}/*!@.calendar-month-year*/.calendar-month-year.sc-ion-datetime-ios{min-width:0}/*!@.calendar-month-year-toggle*/.calendar-month-year-toggle.sc-ion-datetime-ios{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}/*!@.calendar-month-year-toggle::after*/.calendar-month-year-toggle.sc-ion-datetime-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}/*!@.calendar-month-year-toggle.ion-focused::after*/.calendar-month-year-toggle.ion-focused.sc-ion-datetime-ios::after{background:currentColor}/*!@.calendar-month-year-toggle:disabled*/.calendar-month-year-toggle.sc-ion-datetime-ios:disabled{opacity:0.3;pointer-events:none}/*!@.calendar-month-year-toggle ion-icon*/.calendar-month-year-toggle.sc-ion-datetime-ios ion-icon.sc-ion-datetime-ios{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}/*!@.calendar-month-year-toggle #toggle-wrapper*/.calendar-month-year-toggle.sc-ion-datetime-ios #toggle-wrapper.sc-ion-datetime-ios{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}/*!@:host*/.sc-ion-datetime-ios-h{--background:var(--ion-color-light, #ffffff);--background-rgb:var(--ion-color-light-rgb);--title-color:var(--ion-color-step-600, #666666)}/*!@:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),\n:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),\n:host(.datetime-presentation-date:not(.datetime-prefer-wheel))*/.datetime-presentation-date-time.sc-ion-datetime-ios-h:not(.datetime-prefer-wheel),.datetime-presentation-time-date.sc-ion-datetime-ios-h:not(.datetime-prefer-wheel),.datetime-presentation-date.sc-ion-datetime-ios-h:not(.datetime-prefer-wheel){min-height:350px}/*!@:host .datetime-header*/.sc-ion-datetime-ios-h .datetime-header.sc-ion-datetime-ios{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, #cccccc);font-size:min(0.875rem, 22.4px)}/*!@:host .datetime-header .datetime-title*/.sc-ion-datetime-ios-h .datetime-header.sc-ion-datetime-ios .datetime-title.sc-ion-datetime-ios{color:var(--title-color)}/*!@:host .datetime-header .datetime-selected-date*/.sc-ion-datetime-ios-h .datetime-header.sc-ion-datetime-ios .datetime-selected-date.sc-ion-datetime-ios{margin-top:10px}/*!@.calendar-month-year-toggle*/.calendar-month-year-toggle.sc-ion-datetime-ios{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-height:44px;font-size:min(1rem, 25.6px);font-weight:600}/*!@.calendar-month-year-toggle.ion-focused::after*/.calendar-month-year-toggle.ion-focused.sc-ion-datetime-ios::after{opacity:0.15}/*!@.calendar-month-year-toggle #toggle-wrapper*/.calendar-month-year-toggle.sc-ion-datetime-ios #toggle-wrapper.sc-ion-datetime-ios{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:10px}/*!@:host .calendar-action-buttons .calendar-month-year-toggle ion-icon,\n:host .calendar-action-buttons ion-buttons ion-button*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios .calendar-month-year-toggle.sc-ion-datetime-ios ion-icon.sc-ion-datetime-ios,.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios ion-button.sc-ion-datetime-ios{color:var(--ion-color-base)}/*!@:host .calendar-action-buttons ion-buttons*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:0}/*!@:host .calendar-action-buttons ion-buttons ion-button*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios ion-button.sc-ion-datetime-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}/*!@:host .calendar-days-of-week*/.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, #b3b3b3);font-size:min(0.75rem, 19.2px);font-weight:600;line-height:24px;text-transform:uppercase}@supports (border-radius: mod(1px, 1px)){/*!@.calendar-days-of-week .day-of-week*/.calendar-days-of-week.sc-ion-datetime-ios .day-of-week.sc-ion-datetime-ios{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}/*!@.calendar-day*/.calendar-day.sc-ion-datetime-ios{border-radius:max(8px, mod(min(1rem, 24px), 24px) * 10)}}@supports ((border-radius: mod(1px, 1px)) and (background: -webkit-named-image(apple-pay-logo-black)) and (not (contain-intrinsic-size: none))) or (not (border-radius: mod(1px, 1px))){/*!@.calendar-days-of-week .day-of-week*/.calendar-days-of-week.sc-ion-datetime-ios .day-of-week.sc-ion-datetime-ios{width:auto;height:auto;overflow:initial}/*!@.calendar-day*/.calendar-day.sc-ion-datetime-ios{border-radius:32px}}/*!@:host .calendar-body .calendar-month .calendar-month-grid*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios .calendar-month.sc-ion-datetime-ios .calendar-month-grid.sc-ion-datetime-ios{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;-ms-flex-align:center;align-items:center;height:calc(100% - 16px)}/*!@:host .calendar-day-wrapper*/.sc-ion-datetime-ios-h .calendar-day-wrapper.sc-ion-datetime-ios{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;height:0;min-height:1rem}/*!@:host .calendar-day*/.sc-ion-datetime-ios-h .calendar-day.sc-ion-datetime-ios{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}/*!@.calendar-day.calendar-day-active*/.calendar-day.calendar-day-active.sc-ion-datetime-ios{background:rgba(var(--ion-color-base-rgb), 0.2)}/*!@:host .calendar-day.calendar-day-today*/.sc-ion-datetime-ios-h .calendar-day.calendar-day-today.sc-ion-datetime-ios{color:var(--ion-color-base)}/*!@:host .calendar-day.calendar-day-active*/.sc-ion-datetime-ios-h .calendar-day.calendar-day-active.sc-ion-datetime-ios{color:var(--ion-color-base);font-weight:600}/*!@:host .calendar-day.calendar-day-today.calendar-day-active*/.sc-ion-datetime-ios-h .calendar-day.calendar-day-today.calendar-day-active.sc-ion-datetime-ios{color:var(--ion-color-contrast)}/*!@:host .datetime-time*/.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:min(1rem, 25.6px)}/*!@:host .datetime-time .time-header*/.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios .time-header.sc-ion-datetime-ios{font-weight:600}/*!@:host .datetime-buttons*/.sc-ion-datetime-ios-h .datetime-buttons.sc-ion-datetime-ios{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, #cccccc)}/*!@:host .datetime-buttons ::slotted(ion-buttons),\n:host .datetime-buttons ion-buttons*/.sc-ion-datetime-ios-h .datetime-buttons .sc-ion-datetime-ios-s>ion-buttons,.sc-ion-datetime-ios-h .datetime-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}/*!@:host .datetime-action-buttons*/.sc-ion-datetime-ios-h .datetime-action-buttons.sc-ion-datetime-ios{width:100%}";
|
|
14868
|
+
const datetimeIosCss = "/*!@:host*/.sc-ion-datetime-ios-h{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}/*!@:host(.datetime-size-fixed)*/.datetime-size-fixed.sc-ion-datetime-ios-h{width:auto;height:auto}/*!@:host(.datetime-size-fixed:not(.datetime-prefer-wheel))*/.datetime-size-fixed.sc-ion-datetime-ios-h:not(.datetime-prefer-wheel){max-width:350px}/*!@:host(.datetime-size-fixed.datetime-prefer-wheel)*/.datetime-size-fixed.datetime-prefer-wheel.sc-ion-datetime-ios-h{min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}/*!@:host(.datetime-size-cover)*/.datetime-size-cover.sc-ion-datetime-ios-h{width:100%}/*!@:host .calendar-body,\n:host .datetime-year*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios,.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{opacity:0}/*!@:host(:not(.datetime-ready)) .datetime-year*/.sc-ion-datetime-ios-h:not(.datetime-ready) .datetime-year.sc-ion-datetime-ios{position:absolute;pointer-events:none}/*!@:host(.datetime-ready) .calendar-body*/.datetime-ready.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios{opacity:1}/*!@:host(.datetime-ready) .datetime-year*/.datetime-ready.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{display:none;opacity:1}/*!@:host .wheel-order-year-first .day-column*/.sc-ion-datetime-ios-h .wheel-order-year-first.sc-ion-datetime-ios .day-column.sc-ion-datetime-ios{-ms-flex-order:3;order:3;text-align:end}/*!@:host .wheel-order-year-first .month-column*/.sc-ion-datetime-ios-h .wheel-order-year-first.sc-ion-datetime-ios .month-column.sc-ion-datetime-ios{-ms-flex-order:2;order:2;text-align:end}/*!@:host .wheel-order-year-first .year-column*/.sc-ion-datetime-ios-h .wheel-order-year-first.sc-ion-datetime-ios .year-column.sc-ion-datetime-ios{-ms-flex-order:1;order:1;text-align:start}/*!@:host .datetime-calendar,\n:host .datetime-year*/.sc-ion-datetime-ios-h .datetime-calendar.sc-ion-datetime-ios,.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}/*!@:host(.show-month-and-year) .datetime-year*/.show-month-and-year.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{display:-ms-flexbox;display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){/*!@:host(.show-month-and-year) .calendar-next-prev,\n :host(.show-month-and-year) .calendar-days-of-week,\n :host(.show-month-and-year) .calendar-body,\n :host(.show-month-and-year) .datetime-time*/.show-month-and-year.sc-ion-datetime-ios-h .calendar-next-prev.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{position:absolute;visibility:hidden;pointer-events:none}/*!@@supports (inset-inline-start: 0)*/@supports .sc-ion-datetime-ios (inset-inline-start.sc-ion-datetime-ios: 0).sc-ion-datetime-ios{.sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-ios-h.show-month-and-year .calendar-body,.sc-ion-datetime-ios-h.show-month-and-year .datetime-time{inset-inline-start:-99999px}}/*!@@supports not (inset-inline-start: 0)*/@supports .sc-ion-datetime-ios not.sc-ion-datetime-ios (inset-inline-start.sc-ion-datetime-ios: 0).sc-ion-datetime-ios{.sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-ios-h.show-month-and-year .calendar-body,.sc-ion-datetime-ios-h.show-month-and-year .datetime-time{left:-99999px}.sc-ion-datetime-ios-h[dir=rtl].sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,[dir=rtl] .sc-ion-datetime-ios-h.sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-ios-h[dir=rtl].show-month-and-year .calendar-next-prev,[dir=rtl] .sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-ios-h[dir=rtl].sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,[dir=rtl] .sc-ion-datetime-ios-h.sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-ios-h[dir=rtl].show-month-and-year .calendar-days-of-week,[dir=rtl] .sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-ios-h[dir=rtl].sc-ion-datetime-ios-h.show-month-and-year .calendar-body,[dir=rtl] .sc-ion-datetime-ios-h.sc-ion-datetime-ios-h.show-month-and-year .calendar-body,.sc-ion-datetime-ios-h[dir=rtl].show-month-and-year .calendar-body,[dir=rtl] .sc-ion-datetime-ios-h.show-month-and-year .calendar-body,.sc-ion-datetime-ios-h[dir=rtl].sc-ion-datetime-ios-h.show-month-and-year .datetime-time,[dir=rtl] .sc-ion-datetime-ios-h.sc-ion-datetime-ios-h.show-month-and-year .datetime-time,.sc-ion-datetime-ios-h[dir=rtl].show-month-and-year .datetime-time,[dir=rtl] .sc-ion-datetime-ios-h.show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){.sc-ion-datetime-ios-h.show-month-and-year:dir(rtl) .calendar-next-prev,.sc-ion-datetime-ios-h.show-month-and-year:dir(rtl) .calendar-days-of-week,.sc-ion-datetime-ios-h.show-month-and-year:dir(rtl) .calendar-body,.sc-ion-datetime-ios-h.show-month-and-year:dir(rtl) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){/*!@:host(.show-month-and-year) .calendar-next-prev,\n :host(.show-month-and-year) .calendar-days-of-week,\n :host(.show-month-and-year) .calendar-body,\n :host(.show-month-and-year) .datetime-time*/.show-month-and-year.sc-ion-datetime-ios-h .calendar-next-prev.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{display:none}}/*!@:host(.month-year-picker-open) .datetime-footer*/.month-year-picker-open.sc-ion-datetime-ios-h .datetime-footer.sc-ion-datetime-ios{display:none}/*!@:host(.datetime-disabled)*/.datetime-disabled.sc-ion-datetime-ios-h{pointer-events:none}/*!@:host(.datetime-disabled) .calendar-days-of-week,\n:host(.datetime-disabled) .datetime-time*/.datetime-disabled.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios,.datetime-disabled.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{opacity:0.4}/*!@:host(.datetime-readonly)*/.datetime-readonly.sc-ion-datetime-ios-h{pointer-events:none}/*!@:host(.datetime-readonly) .calendar-action-buttons,\n:host(.datetime-readonly) .calendar-body,\n:host(.datetime-readonly) .datetime-year*/.datetime-readonly.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios,.datetime-readonly.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios,.datetime-readonly.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{pointer-events:initial}/*!@:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),\n:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]*/.datetime-readonly.sc-ion-datetime-ios-h .calendar-day[disabled].sc-ion-datetime-ios:not(.calendar-day-constrained),.datetime-readonly.sc-ion-datetime-ios-h .datetime-action-buttons.sc-ion-datetime-ios ion-button[disabled].sc-ion-datetime-ios{opacity:1}/*!@:host .datetime-header .datetime-title*/.sc-ion-datetime-ios-h .datetime-header.sc-ion-datetime-ios .datetime-title.sc-ion-datetime-ios{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}/*!@:host .datetime-action-buttons.has-clear-button*/.sc-ion-datetime-ios-h .datetime-action-buttons.has-clear-button.sc-ion-datetime-ios{width:100%}/*!@:host .datetime-action-buttons ion-buttons*/.sc-ion-datetime-ios-h .datetime-action-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@.datetime-action-buttons .datetime-action-buttons-container*/.datetime-action-buttons.sc-ion-datetime-ios .datetime-action-buttons-container.sc-ion-datetime-ios{display:-ms-flexbox;display:flex}/*!@:host .calendar-action-buttons*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@:host .calendar-action-buttons ion-button*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-button.sc-ion-datetime-ios{--background:transparent}/*!@:host .calendar-days-of-week*/.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}/*!@.calendar-days-of-week .day-of-week*/.calendar-days-of-week.sc-ion-datetime-ios .day-of-week.sc-ion-datetime-ios{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}/*!@:host .calendar-body*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}/*!@:host .calendar-body .calendar-month*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios .calendar-month.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}/*!@:host .calendar-body .calendar-month-disabled*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios .calendar-month-disabled.sc-ion-datetime-ios{scroll-snap-align:none}/*!@:host .calendar-body::-webkit-scrollbar*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios::-webkit-scrollbar{display:none}/*!@:host .calendar-body .calendar-month-grid*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios .calendar-month-grid.sc-ion-datetime-ios{display:grid;grid-template-columns:repeat(7, 1fr)}/*!@:host .calendar-day-wrapper*/.sc-ion-datetime-ios-h .calendar-day-wrapper.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}/*!@.calendar-day*/.calendar-day.sc-ion-datetime-ios{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}/*!@:host .calendar-day[disabled]*/.sc-ion-datetime-ios-h .calendar-day[disabled].sc-ion-datetime-ios{pointer-events:none;opacity:0.4}/*!@.calendar-day:focus*/.calendar-day.sc-ion-datetime-ios:focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}/*!@:host .datetime-time*/.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@:host(.datetime-presentation-time) .datetime-time*/.datetime-presentation-time.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}/*!@:host ion-popover*/.sc-ion-datetime-ios-h ion-popover.sc-ion-datetime-ios{--height:200px}/*!@:host .time-header*/.sc-ion-datetime-ios-h .time-header.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}/*!@:host .time-body*/.sc-ion-datetime-ios-h .time-body.sc-ion-datetime-ios{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}/*!@:host .time-body-active*/.sc-ion-datetime-ios-h .time-body-active.sc-ion-datetime-ios{color:var(--ion-color-base)}/*!@:host(.in-item)*/.in-item.sc-ion-datetime-ios-h{position:static}/*!@:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle*/.show-month-and-year.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios .calendar-month-year-toggle.sc-ion-datetime-ios{color:var(--ion-color-base)}/*!@.calendar-month-year*/.calendar-month-year.sc-ion-datetime-ios{min-width:0}/*!@.calendar-month-year-toggle*/.calendar-month-year-toggle.sc-ion-datetime-ios{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}/*!@.calendar-month-year-toggle::after*/.calendar-month-year-toggle.sc-ion-datetime-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}/*!@.calendar-month-year-toggle.ion-focused::after*/.calendar-month-year-toggle.ion-focused.sc-ion-datetime-ios::after{background:currentColor}/*!@.calendar-month-year-toggle:disabled*/.calendar-month-year-toggle.sc-ion-datetime-ios:disabled{opacity:0.3;pointer-events:none}/*!@.calendar-month-year-toggle ion-icon*/.calendar-month-year-toggle.sc-ion-datetime-ios ion-icon.sc-ion-datetime-ios{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}/*!@.calendar-month-year-toggle #toggle-wrapper*/.calendar-month-year-toggle.sc-ion-datetime-ios #toggle-wrapper.sc-ion-datetime-ios{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}/*!@ion-picker*/ion-picker.sc-ion-datetime-ios{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}/*!@:host*/.sc-ion-datetime-ios-h{--background:var(--ion-color-light, #ffffff);--background-rgb:var(--ion-color-light-rgb);--title-color:var(--ion-color-step-600, #666666)}/*!@:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),\n:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),\n:host(.datetime-presentation-date:not(.datetime-prefer-wheel))*/.datetime-presentation-date-time.sc-ion-datetime-ios-h:not(.datetime-prefer-wheel),.datetime-presentation-time-date.sc-ion-datetime-ios-h:not(.datetime-prefer-wheel),.datetime-presentation-date.sc-ion-datetime-ios-h:not(.datetime-prefer-wheel){min-height:350px}/*!@:host .datetime-header*/.sc-ion-datetime-ios-h .datetime-header.sc-ion-datetime-ios{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, #cccccc);font-size:min(0.875rem, 22.4px)}/*!@:host .datetime-header .datetime-title*/.sc-ion-datetime-ios-h .datetime-header.sc-ion-datetime-ios .datetime-title.sc-ion-datetime-ios{color:var(--title-color)}/*!@:host .datetime-header .datetime-selected-date*/.sc-ion-datetime-ios-h .datetime-header.sc-ion-datetime-ios .datetime-selected-date.sc-ion-datetime-ios{margin-top:10px}/*!@.calendar-month-year-toggle*/.calendar-month-year-toggle.sc-ion-datetime-ios{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-height:44px;font-size:min(1rem, 25.6px);font-weight:600}/*!@.calendar-month-year-toggle.ion-focused::after*/.calendar-month-year-toggle.ion-focused.sc-ion-datetime-ios::after{opacity:0.15}/*!@.calendar-month-year-toggle #toggle-wrapper*/.calendar-month-year-toggle.sc-ion-datetime-ios #toggle-wrapper.sc-ion-datetime-ios{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:10px}/*!@:host .calendar-action-buttons .calendar-month-year-toggle ion-icon,\n:host .calendar-action-buttons ion-buttons ion-button*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios .calendar-month-year-toggle.sc-ion-datetime-ios ion-icon.sc-ion-datetime-ios,.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios ion-button.sc-ion-datetime-ios{color:var(--ion-color-base)}/*!@:host .calendar-action-buttons ion-buttons*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:0}/*!@:host .calendar-action-buttons ion-buttons ion-button*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios ion-button.sc-ion-datetime-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}/*!@:host .calendar-days-of-week*/.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, #b3b3b3);font-size:min(0.75rem, 19.2px);font-weight:600;line-height:24px;text-transform:uppercase}@supports (border-radius: mod(1px, 1px)){/*!@.calendar-days-of-week .day-of-week*/.calendar-days-of-week.sc-ion-datetime-ios .day-of-week.sc-ion-datetime-ios{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}/*!@.calendar-day*/.calendar-day.sc-ion-datetime-ios{border-radius:max(8px, mod(min(1rem, 24px), 24px) * 10)}}@supports ((border-radius: mod(1px, 1px)) and (background: -webkit-named-image(apple-pay-logo-black)) and (not (contain-intrinsic-size: none))) or (not (border-radius: mod(1px, 1px))){/*!@.calendar-days-of-week .day-of-week*/.calendar-days-of-week.sc-ion-datetime-ios .day-of-week.sc-ion-datetime-ios{width:auto;height:auto;overflow:initial}/*!@.calendar-day*/.calendar-day.sc-ion-datetime-ios{border-radius:32px}}/*!@:host .calendar-body .calendar-month .calendar-month-grid*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios .calendar-month.sc-ion-datetime-ios .calendar-month-grid.sc-ion-datetime-ios{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;-ms-flex-align:center;align-items:center;height:calc(100% - 16px)}/*!@:host .calendar-day-wrapper*/.sc-ion-datetime-ios-h .calendar-day-wrapper.sc-ion-datetime-ios{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;height:0;min-height:1rem}/*!@:host .calendar-day*/.sc-ion-datetime-ios-h .calendar-day.sc-ion-datetime-ios{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}/*!@.calendar-day.calendar-day-active*/.calendar-day.calendar-day-active.sc-ion-datetime-ios{background:rgba(var(--ion-color-base-rgb), 0.2)}/*!@:host .calendar-day.calendar-day-today*/.sc-ion-datetime-ios-h .calendar-day.calendar-day-today.sc-ion-datetime-ios{color:var(--ion-color-base)}/*!@:host .calendar-day.calendar-day-active*/.sc-ion-datetime-ios-h .calendar-day.calendar-day-active.sc-ion-datetime-ios{color:var(--ion-color-base);font-weight:600}/*!@:host .calendar-day.calendar-day-today.calendar-day-active*/.sc-ion-datetime-ios-h .calendar-day.calendar-day-today.calendar-day-active.sc-ion-datetime-ios{color:var(--ion-color-contrast)}/*!@:host .datetime-time*/.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:min(1rem, 25.6px)}/*!@:host .datetime-time .time-header*/.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios .time-header.sc-ion-datetime-ios{font-weight:600}/*!@:host .datetime-buttons*/.sc-ion-datetime-ios-h .datetime-buttons.sc-ion-datetime-ios{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, #cccccc)}/*!@:host .datetime-buttons ::slotted(ion-buttons),\n:host .datetime-buttons ion-buttons*/.sc-ion-datetime-ios-h .datetime-buttons .sc-ion-datetime-ios-s>ion-buttons,.sc-ion-datetime-ios-h .datetime-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}/*!@:host .datetime-action-buttons*/.sc-ion-datetime-ios-h .datetime-action-buttons.sc-ion-datetime-ios{width:100%}";
|
|
14869
14869
|
|
|
14870
|
-
const datetimeMdCss = "/*!@:host*/.sc-ion-datetime-md-h{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}/*!@ion-picker-column-internal*/ion-picker-column-internal.sc-ion-datetime-md{min-width:26px}/*!@:host(.datetime-size-fixed)*/.datetime-size-fixed.sc-ion-datetime-md-h{width:auto;height:auto}/*!@:host(.datetime-size-fixed:not(.datetime-prefer-wheel))*/.datetime-size-fixed.sc-ion-datetime-md-h:not(.datetime-prefer-wheel){max-width:350px}/*!@:host(.datetime-size-fixed.datetime-prefer-wheel)*/.datetime-size-fixed.datetime-prefer-wheel.sc-ion-datetime-md-h{min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}/*!@:host(.datetime-size-cover)*/.datetime-size-cover.sc-ion-datetime-md-h{width:100%}/*!@:host .calendar-body,\n:host .datetime-year*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md,.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md{opacity:0}/*!@:host(:not(.datetime-ready)) .datetime-year*/.sc-ion-datetime-md-h:not(.datetime-ready) .datetime-year.sc-ion-datetime-md{position:absolute;pointer-events:none}/*!@:host(.datetime-ready) .calendar-body*/.datetime-ready.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md{opacity:1}/*!@:host(.datetime-ready) .datetime-year*/.datetime-ready.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md{display:none;opacity:1}/*!@:host .wheel-order-year-first .day-column*/.sc-ion-datetime-md-h .wheel-order-year-first.sc-ion-datetime-md .day-column.sc-ion-datetime-md{-ms-flex-order:3;order:3;text-align:end}/*!@:host .wheel-order-year-first .month-column*/.sc-ion-datetime-md-h .wheel-order-year-first.sc-ion-datetime-md .month-column.sc-ion-datetime-md{-ms-flex-order:2;order:2;text-align:end}/*!@:host .wheel-order-year-first .year-column*/.sc-ion-datetime-md-h .wheel-order-year-first.sc-ion-datetime-md .year-column.sc-ion-datetime-md{-ms-flex-order:1;order:1;text-align:start}/*!@:host .datetime-calendar,\n:host .datetime-year*/.sc-ion-datetime-md-h .datetime-calendar.sc-ion-datetime-md,.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}/*!@:host(.show-month-and-year) .datetime-year*/.show-month-and-year.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md{display:-ms-flexbox;display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){/*!@:host(.show-month-and-year) .calendar-next-prev,\n :host(.show-month-and-year) .calendar-days-of-week,\n :host(.show-month-and-year) .calendar-body,\n :host(.show-month-and-year) .datetime-time*/.show-month-and-year.sc-ion-datetime-md-h .calendar-next-prev.sc-ion-datetime-md,.show-month-and-year.sc-ion-datetime-md-h .calendar-days-of-week.sc-ion-datetime-md,.show-month-and-year.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md,.show-month-and-year.sc-ion-datetime-md-h .datetime-time.sc-ion-datetime-md{position:absolute;visibility:hidden;pointer-events:none}/*!@@supports (inset-inline-start: 0)*/@supports .sc-ion-datetime-md (inset-inline-start.sc-ion-datetime-md: 0).sc-ion-datetime-md{.sc-ion-datetime-md-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-md-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-md-h.show-month-and-year .calendar-body,.sc-ion-datetime-md-h.show-month-and-year .datetime-time{inset-inline-start:-99999px}}/*!@@supports not (inset-inline-start: 0)*/@supports .sc-ion-datetime-md not.sc-ion-datetime-md (inset-inline-start.sc-ion-datetime-md: 0).sc-ion-datetime-md{.sc-ion-datetime-md-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-md-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-md-h.show-month-and-year .calendar-body,.sc-ion-datetime-md-h.show-month-and-year .datetime-time{left:-99999px}.sc-ion-datetime-md-h[dir=rtl].sc-ion-datetime-md-h.show-month-and-year .calendar-next-prev,[dir=rtl] .sc-ion-datetime-md-h.sc-ion-datetime-md-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-md-h[dir=rtl].show-month-and-year .calendar-next-prev,[dir=rtl] .sc-ion-datetime-md-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-md-h[dir=rtl].sc-ion-datetime-md-h.show-month-and-year .calendar-days-of-week,[dir=rtl] .sc-ion-datetime-md-h.sc-ion-datetime-md-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-md-h[dir=rtl].show-month-and-year .calendar-days-of-week,[dir=rtl] .sc-ion-datetime-md-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-md-h[dir=rtl].sc-ion-datetime-md-h.show-month-and-year .calendar-body,[dir=rtl] .sc-ion-datetime-md-h.sc-ion-datetime-md-h.show-month-and-year .calendar-body,.sc-ion-datetime-md-h[dir=rtl].show-month-and-year .calendar-body,[dir=rtl] .sc-ion-datetime-md-h.show-month-and-year .calendar-body,.sc-ion-datetime-md-h[dir=rtl].sc-ion-datetime-md-h.show-month-and-year .datetime-time,[dir=rtl] .sc-ion-datetime-md-h.sc-ion-datetime-md-h.show-month-and-year .datetime-time,.sc-ion-datetime-md-h[dir=rtl].show-month-and-year .datetime-time,[dir=rtl] .sc-ion-datetime-md-h.show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){.sc-ion-datetime-md-h.show-month-and-year:dir(rtl) .calendar-next-prev,.sc-ion-datetime-md-h.show-month-and-year:dir(rtl) .calendar-days-of-week,.sc-ion-datetime-md-h.show-month-and-year:dir(rtl) .calendar-body,.sc-ion-datetime-md-h.show-month-and-year:dir(rtl) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){/*!@:host(.show-month-and-year) .calendar-next-prev,\n :host(.show-month-and-year) .calendar-days-of-week,\n :host(.show-month-and-year) .calendar-body,\n :host(.show-month-and-year) .datetime-time*/.show-month-and-year.sc-ion-datetime-md-h .calendar-next-prev.sc-ion-datetime-md,.show-month-and-year.sc-ion-datetime-md-h .calendar-days-of-week.sc-ion-datetime-md,.show-month-and-year.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md,.show-month-and-year.sc-ion-datetime-md-h .datetime-time.sc-ion-datetime-md{display:none}}/*!@:host(.month-year-picker-open) .datetime-footer*/.month-year-picker-open.sc-ion-datetime-md-h .datetime-footer.sc-ion-datetime-md{display:none}/*!@:host(.datetime-disabled)*/.datetime-disabled.sc-ion-datetime-md-h{pointer-events:none}/*!@:host(.datetime-disabled) .calendar-days-of-week,\n:host(.datetime-disabled) .datetime-time*/.datetime-disabled.sc-ion-datetime-md-h .calendar-days-of-week.sc-ion-datetime-md,.datetime-disabled.sc-ion-datetime-md-h .datetime-time.sc-ion-datetime-md{opacity:0.4}/*!@:host(.datetime-readonly)*/.datetime-readonly.sc-ion-datetime-md-h{pointer-events:none}/*!@:host(.datetime-readonly) .calendar-action-buttons,\n:host(.datetime-readonly) .calendar-body,\n:host(.datetime-readonly) .datetime-year*/.datetime-readonly.sc-ion-datetime-md-h .calendar-action-buttons.sc-ion-datetime-md,.datetime-readonly.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md,.datetime-readonly.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md{pointer-events:initial}/*!@:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),\n:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]*/.datetime-readonly.sc-ion-datetime-md-h .calendar-day[disabled].sc-ion-datetime-md:not(.calendar-day-constrained),.datetime-readonly.sc-ion-datetime-md-h .datetime-action-buttons.sc-ion-datetime-md ion-button[disabled].sc-ion-datetime-md{opacity:1}/*!@:host .datetime-header .datetime-title*/.sc-ion-datetime-md-h .datetime-header.sc-ion-datetime-md .datetime-title.sc-ion-datetime-md{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}/*!@:host .datetime-action-buttons.has-clear-button*/.sc-ion-datetime-md-h .datetime-action-buttons.has-clear-button.sc-ion-datetime-md{width:100%}/*!@:host .datetime-action-buttons ion-buttons*/.sc-ion-datetime-md-h .datetime-action-buttons.sc-ion-datetime-md ion-buttons.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@.datetime-action-buttons .datetime-action-buttons-container*/.datetime-action-buttons.sc-ion-datetime-md .datetime-action-buttons-container.sc-ion-datetime-md{display:-ms-flexbox;display:flex}/*!@:host .calendar-action-buttons*/.sc-ion-datetime-md-h .calendar-action-buttons.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@:host .calendar-action-buttons ion-button*/.sc-ion-datetime-md-h .calendar-action-buttons.sc-ion-datetime-md ion-button.sc-ion-datetime-md{--background:transparent}/*!@:host .calendar-days-of-week*/.sc-ion-datetime-md-h .calendar-days-of-week.sc-ion-datetime-md{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}/*!@.calendar-days-of-week .day-of-week*/.calendar-days-of-week.sc-ion-datetime-md .day-of-week.sc-ion-datetime-md{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}/*!@:host .calendar-body*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}/*!@:host .calendar-body .calendar-month*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md .calendar-month.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}/*!@:host .calendar-body .calendar-month-disabled*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md .calendar-month-disabled.sc-ion-datetime-md{scroll-snap-align:none}/*!@:host .calendar-body::-webkit-scrollbar*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md::-webkit-scrollbar{display:none}/*!@:host .calendar-body .calendar-month-grid*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md .calendar-month-grid.sc-ion-datetime-md{display:grid;grid-template-columns:repeat(7, 1fr)}/*!@:host .calendar-day-wrapper*/.sc-ion-datetime-md-h .calendar-day-wrapper.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}/*!@.calendar-day*/.calendar-day.sc-ion-datetime-md{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}/*!@:host .calendar-day[disabled]*/.sc-ion-datetime-md-h .calendar-day[disabled].sc-ion-datetime-md{pointer-events:none;opacity:0.4}/*!@.calendar-day:focus*/.calendar-day.sc-ion-datetime-md:focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}/*!@:host .datetime-time*/.sc-ion-datetime-md-h .datetime-time.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@:host(.datetime-presentation-time) .datetime-time*/.datetime-presentation-time.sc-ion-datetime-md-h .datetime-time.sc-ion-datetime-md{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}/*!@:host ion-popover*/.sc-ion-datetime-md-h ion-popover.sc-ion-datetime-md{--height:200px}/*!@:host .time-header*/.sc-ion-datetime-md-h .time-header.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}/*!@:host .time-body*/.sc-ion-datetime-md-h .time-body.sc-ion-datetime-md{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}/*!@:host .time-body-active*/.sc-ion-datetime-md-h .time-body-active.sc-ion-datetime-md{color:var(--ion-color-base)}/*!@:host(.in-item)*/.in-item.sc-ion-datetime-md-h{position:static}/*!@:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle*/.show-month-and-year.sc-ion-datetime-md-h .calendar-action-buttons.sc-ion-datetime-md .calendar-month-year-toggle.sc-ion-datetime-md{color:var(--ion-color-base)}/*!@.calendar-month-year*/.calendar-month-year.sc-ion-datetime-md{min-width:0}/*!@.calendar-month-year-toggle*/.calendar-month-year-toggle.sc-ion-datetime-md{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}/*!@.calendar-month-year-toggle::after*/.calendar-month-year-toggle.sc-ion-datetime-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}/*!@.calendar-month-year-toggle.ion-focused::after*/.calendar-month-year-toggle.ion-focused.sc-ion-datetime-md::after{background:currentColor}/*!@.calendar-month-year-toggle:disabled*/.calendar-month-year-toggle.sc-ion-datetime-md:disabled{opacity:0.3;pointer-events:none}/*!@.calendar-month-year-toggle ion-icon*/.calendar-month-year-toggle.sc-ion-datetime-md ion-icon.sc-ion-datetime-md{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}/*!@.calendar-month-year-toggle #toggle-wrapper*/.calendar-month-year-toggle.sc-ion-datetime-md #toggle-wrapper.sc-ion-datetime-md{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}/*!@:host*/.sc-ion-datetime-md-h{--background:var(--ion-color-step-100, #ffffff);--title-color:var(--ion-color-contrast)}/*!@:host .datetime-header*/.sc-ion-datetime-md-h .datetime-header.sc-ion-datetime-md{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-base);color:var(--title-color)}/*!@:host .datetime-header .datetime-title*/.sc-ion-datetime-md-h .datetime-header.sc-ion-datetime-md .datetime-title.sc-ion-datetime-md{font-size:0.75rem;text-transform:uppercase}/*!@:host .datetime-header .datetime-selected-date*/.sc-ion-datetime-md-h .datetime-header.sc-ion-datetime-md .datetime-selected-date.sc-ion-datetime-md{margin-top:30px;font-size:2.125rem}/*!@:host .calendar-action-buttons ion-button*/.sc-ion-datetime-md-h .calendar-action-buttons.sc-ion-datetime-md ion-button.sc-ion-datetime-md{--color:var(--ion-color-step-650, #595959)}/*!@.calendar-month-year-toggle*/.calendar-month-year-toggle.sc-ion-datetime-md{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:12px;padding-bottom:12px;min-height:48px;background:transparent;color:var(--ion-color-step-650, #595959);z-index:1}/*!@.calendar-month-year-toggle.ion-focused::after*/.calendar-month-year-toggle.ion-focused.sc-ion-datetime-md::after{opacity:0.04}/*!@.calendar-month-year-toggle ion-ripple-effect*/.calendar-month-year-toggle.sc-ion-datetime-md ion-ripple-effect.sc-ion-datetime-md{color:currentColor}@media (any-hover: hover){/*!@.calendar-month-year-toggle.ion-activatable:not(.ion-focused):hover::after*/.calendar-month-year-toggle.ion-activatable.sc-ion-datetime-md:not(.ion-focused):hover::after{background:currentColor;opacity:0.04}}/*!@:host .calendar-days-of-week*/.sc-ion-datetime-md-h .calendar-days-of-week.sc-ion-datetime-md{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, gray);font-size:0.875rem;line-height:36px}/*!@:host .calendar-body .calendar-month .calendar-month-grid*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md .calendar-month.sc-ion-datetime-md .calendar-month-grid.sc-ion-datetime-md{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:4px;padding-bottom:4px;grid-template-rows:repeat(6, 1fr)}/*!@:host .calendar-day*/.sc-ion-datetime-md-h .calendar-day.sc-ion-datetime-md{width:42px;min-width:42px;height:42px;font-size:0.875rem}/*!@:host .calendar-day.calendar-day-today*/.sc-ion-datetime-md-h .calendar-day.calendar-day-today.sc-ion-datetime-md{border:1px solid var(--ion-color-base);color:var(--ion-color-base)}/*!@:host .calendar-day.calendar-day-active*/.sc-ion-datetime-md-h .calendar-day.calendar-day-active.sc-ion-datetime-md{color:var(--ion-color-contrast)}/*!@.calendar-day.calendar-day-active*/.calendar-day.calendar-day-active.sc-ion-datetime-md{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}/*!@:host .datetime-time*/.sc-ion-datetime-md-h .datetime-time.sc-ion-datetime-md{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}/*!@:host .time-header*/.sc-ion-datetime-md-h .time-header.sc-ion-datetime-md{color:var(--ion-color-step-650, #595959)}/*!@:host(.datetime-presentation-month) .datetime-year,\n:host(.datetime-presentation-year) .datetime-year,\n:host(.datetime-presentation-month-year) .datetime-year*/.datetime-presentation-month.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md,.datetime-presentation-year.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md,.datetime-presentation-month-year.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md{margin-top:20px;margin-bottom:20px}/*!@:host .datetime-buttons*/.sc-ion-datetime-md-h .datetime-buttons.sc-ion-datetime-md{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:10px;padding-bottom:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}";
|
|
14870
|
+
const datetimeMdCss = "/*!@:host*/.sc-ion-datetime-md-h{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}/*!@:host(.datetime-size-fixed)*/.datetime-size-fixed.sc-ion-datetime-md-h{width:auto;height:auto}/*!@:host(.datetime-size-fixed:not(.datetime-prefer-wheel))*/.datetime-size-fixed.sc-ion-datetime-md-h:not(.datetime-prefer-wheel){max-width:350px}/*!@:host(.datetime-size-fixed.datetime-prefer-wheel)*/.datetime-size-fixed.datetime-prefer-wheel.sc-ion-datetime-md-h{min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}/*!@:host(.datetime-size-cover)*/.datetime-size-cover.sc-ion-datetime-md-h{width:100%}/*!@:host .calendar-body,\n:host .datetime-year*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md,.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md{opacity:0}/*!@:host(:not(.datetime-ready)) .datetime-year*/.sc-ion-datetime-md-h:not(.datetime-ready) .datetime-year.sc-ion-datetime-md{position:absolute;pointer-events:none}/*!@:host(.datetime-ready) .calendar-body*/.datetime-ready.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md{opacity:1}/*!@:host(.datetime-ready) .datetime-year*/.datetime-ready.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md{display:none;opacity:1}/*!@:host .wheel-order-year-first .day-column*/.sc-ion-datetime-md-h .wheel-order-year-first.sc-ion-datetime-md .day-column.sc-ion-datetime-md{-ms-flex-order:3;order:3;text-align:end}/*!@:host .wheel-order-year-first .month-column*/.sc-ion-datetime-md-h .wheel-order-year-first.sc-ion-datetime-md .month-column.sc-ion-datetime-md{-ms-flex-order:2;order:2;text-align:end}/*!@:host .wheel-order-year-first .year-column*/.sc-ion-datetime-md-h .wheel-order-year-first.sc-ion-datetime-md .year-column.sc-ion-datetime-md{-ms-flex-order:1;order:1;text-align:start}/*!@:host .datetime-calendar,\n:host .datetime-year*/.sc-ion-datetime-md-h .datetime-calendar.sc-ion-datetime-md,.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}/*!@:host(.show-month-and-year) .datetime-year*/.show-month-and-year.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md{display:-ms-flexbox;display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){/*!@:host(.show-month-and-year) .calendar-next-prev,\n :host(.show-month-and-year) .calendar-days-of-week,\n :host(.show-month-and-year) .calendar-body,\n :host(.show-month-and-year) .datetime-time*/.show-month-and-year.sc-ion-datetime-md-h .calendar-next-prev.sc-ion-datetime-md,.show-month-and-year.sc-ion-datetime-md-h .calendar-days-of-week.sc-ion-datetime-md,.show-month-and-year.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md,.show-month-and-year.sc-ion-datetime-md-h .datetime-time.sc-ion-datetime-md{position:absolute;visibility:hidden;pointer-events:none}/*!@@supports (inset-inline-start: 0)*/@supports .sc-ion-datetime-md (inset-inline-start.sc-ion-datetime-md: 0).sc-ion-datetime-md{.sc-ion-datetime-md-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-md-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-md-h.show-month-and-year .calendar-body,.sc-ion-datetime-md-h.show-month-and-year .datetime-time{inset-inline-start:-99999px}}/*!@@supports not (inset-inline-start: 0)*/@supports .sc-ion-datetime-md not.sc-ion-datetime-md (inset-inline-start.sc-ion-datetime-md: 0).sc-ion-datetime-md{.sc-ion-datetime-md-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-md-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-md-h.show-month-and-year .calendar-body,.sc-ion-datetime-md-h.show-month-and-year .datetime-time{left:-99999px}.sc-ion-datetime-md-h[dir=rtl].sc-ion-datetime-md-h.show-month-and-year .calendar-next-prev,[dir=rtl] .sc-ion-datetime-md-h.sc-ion-datetime-md-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-md-h[dir=rtl].show-month-and-year .calendar-next-prev,[dir=rtl] .sc-ion-datetime-md-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-md-h[dir=rtl].sc-ion-datetime-md-h.show-month-and-year .calendar-days-of-week,[dir=rtl] .sc-ion-datetime-md-h.sc-ion-datetime-md-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-md-h[dir=rtl].show-month-and-year .calendar-days-of-week,[dir=rtl] .sc-ion-datetime-md-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-md-h[dir=rtl].sc-ion-datetime-md-h.show-month-and-year .calendar-body,[dir=rtl] .sc-ion-datetime-md-h.sc-ion-datetime-md-h.show-month-and-year .calendar-body,.sc-ion-datetime-md-h[dir=rtl].show-month-and-year .calendar-body,[dir=rtl] .sc-ion-datetime-md-h.show-month-and-year .calendar-body,.sc-ion-datetime-md-h[dir=rtl].sc-ion-datetime-md-h.show-month-and-year .datetime-time,[dir=rtl] .sc-ion-datetime-md-h.sc-ion-datetime-md-h.show-month-and-year .datetime-time,.sc-ion-datetime-md-h[dir=rtl].show-month-and-year .datetime-time,[dir=rtl] .sc-ion-datetime-md-h.show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){.sc-ion-datetime-md-h.show-month-and-year:dir(rtl) .calendar-next-prev,.sc-ion-datetime-md-h.show-month-and-year:dir(rtl) .calendar-days-of-week,.sc-ion-datetime-md-h.show-month-and-year:dir(rtl) .calendar-body,.sc-ion-datetime-md-h.show-month-and-year:dir(rtl) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){/*!@:host(.show-month-and-year) .calendar-next-prev,\n :host(.show-month-and-year) .calendar-days-of-week,\n :host(.show-month-and-year) .calendar-body,\n :host(.show-month-and-year) .datetime-time*/.show-month-and-year.sc-ion-datetime-md-h .calendar-next-prev.sc-ion-datetime-md,.show-month-and-year.sc-ion-datetime-md-h .calendar-days-of-week.sc-ion-datetime-md,.show-month-and-year.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md,.show-month-and-year.sc-ion-datetime-md-h .datetime-time.sc-ion-datetime-md{display:none}}/*!@:host(.month-year-picker-open) .datetime-footer*/.month-year-picker-open.sc-ion-datetime-md-h .datetime-footer.sc-ion-datetime-md{display:none}/*!@:host(.datetime-disabled)*/.datetime-disabled.sc-ion-datetime-md-h{pointer-events:none}/*!@:host(.datetime-disabled) .calendar-days-of-week,\n:host(.datetime-disabled) .datetime-time*/.datetime-disabled.sc-ion-datetime-md-h .calendar-days-of-week.sc-ion-datetime-md,.datetime-disabled.sc-ion-datetime-md-h .datetime-time.sc-ion-datetime-md{opacity:0.4}/*!@:host(.datetime-readonly)*/.datetime-readonly.sc-ion-datetime-md-h{pointer-events:none}/*!@:host(.datetime-readonly) .calendar-action-buttons,\n:host(.datetime-readonly) .calendar-body,\n:host(.datetime-readonly) .datetime-year*/.datetime-readonly.sc-ion-datetime-md-h .calendar-action-buttons.sc-ion-datetime-md,.datetime-readonly.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md,.datetime-readonly.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md{pointer-events:initial}/*!@:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),\n:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]*/.datetime-readonly.sc-ion-datetime-md-h .calendar-day[disabled].sc-ion-datetime-md:not(.calendar-day-constrained),.datetime-readonly.sc-ion-datetime-md-h .datetime-action-buttons.sc-ion-datetime-md ion-button[disabled].sc-ion-datetime-md{opacity:1}/*!@:host .datetime-header .datetime-title*/.sc-ion-datetime-md-h .datetime-header.sc-ion-datetime-md .datetime-title.sc-ion-datetime-md{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}/*!@:host .datetime-action-buttons.has-clear-button*/.sc-ion-datetime-md-h .datetime-action-buttons.has-clear-button.sc-ion-datetime-md{width:100%}/*!@:host .datetime-action-buttons ion-buttons*/.sc-ion-datetime-md-h .datetime-action-buttons.sc-ion-datetime-md ion-buttons.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@.datetime-action-buttons .datetime-action-buttons-container*/.datetime-action-buttons.sc-ion-datetime-md .datetime-action-buttons-container.sc-ion-datetime-md{display:-ms-flexbox;display:flex}/*!@:host .calendar-action-buttons*/.sc-ion-datetime-md-h .calendar-action-buttons.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@:host .calendar-action-buttons ion-button*/.sc-ion-datetime-md-h .calendar-action-buttons.sc-ion-datetime-md ion-button.sc-ion-datetime-md{--background:transparent}/*!@:host .calendar-days-of-week*/.sc-ion-datetime-md-h .calendar-days-of-week.sc-ion-datetime-md{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}/*!@.calendar-days-of-week .day-of-week*/.calendar-days-of-week.sc-ion-datetime-md .day-of-week.sc-ion-datetime-md{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}/*!@:host .calendar-body*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}/*!@:host .calendar-body .calendar-month*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md .calendar-month.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}/*!@:host .calendar-body .calendar-month-disabled*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md .calendar-month-disabled.sc-ion-datetime-md{scroll-snap-align:none}/*!@:host .calendar-body::-webkit-scrollbar*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md::-webkit-scrollbar{display:none}/*!@:host .calendar-body .calendar-month-grid*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md .calendar-month-grid.sc-ion-datetime-md{display:grid;grid-template-columns:repeat(7, 1fr)}/*!@:host .calendar-day-wrapper*/.sc-ion-datetime-md-h .calendar-day-wrapper.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}/*!@.calendar-day*/.calendar-day.sc-ion-datetime-md{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}/*!@:host .calendar-day[disabled]*/.sc-ion-datetime-md-h .calendar-day[disabled].sc-ion-datetime-md{pointer-events:none;opacity:0.4}/*!@.calendar-day:focus*/.calendar-day.sc-ion-datetime-md:focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}/*!@:host .datetime-time*/.sc-ion-datetime-md-h .datetime-time.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@:host(.datetime-presentation-time) .datetime-time*/.datetime-presentation-time.sc-ion-datetime-md-h .datetime-time.sc-ion-datetime-md{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}/*!@:host ion-popover*/.sc-ion-datetime-md-h ion-popover.sc-ion-datetime-md{--height:200px}/*!@:host .time-header*/.sc-ion-datetime-md-h .time-header.sc-ion-datetime-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}/*!@:host .time-body*/.sc-ion-datetime-md-h .time-body.sc-ion-datetime-md{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}/*!@:host .time-body-active*/.sc-ion-datetime-md-h .time-body-active.sc-ion-datetime-md{color:var(--ion-color-base)}/*!@:host(.in-item)*/.in-item.sc-ion-datetime-md-h{position:static}/*!@:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle*/.show-month-and-year.sc-ion-datetime-md-h .calendar-action-buttons.sc-ion-datetime-md .calendar-month-year-toggle.sc-ion-datetime-md{color:var(--ion-color-base)}/*!@.calendar-month-year*/.calendar-month-year.sc-ion-datetime-md{min-width:0}/*!@.calendar-month-year-toggle*/.calendar-month-year-toggle.sc-ion-datetime-md{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}/*!@.calendar-month-year-toggle::after*/.calendar-month-year-toggle.sc-ion-datetime-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}/*!@.calendar-month-year-toggle.ion-focused::after*/.calendar-month-year-toggle.ion-focused.sc-ion-datetime-md::after{background:currentColor}/*!@.calendar-month-year-toggle:disabled*/.calendar-month-year-toggle.sc-ion-datetime-md:disabled{opacity:0.3;pointer-events:none}/*!@.calendar-month-year-toggle ion-icon*/.calendar-month-year-toggle.sc-ion-datetime-md ion-icon.sc-ion-datetime-md{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}/*!@.calendar-month-year-toggle #toggle-wrapper*/.calendar-month-year-toggle.sc-ion-datetime-md #toggle-wrapper.sc-ion-datetime-md{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}/*!@ion-picker*/ion-picker.sc-ion-datetime-md{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}/*!@:host*/.sc-ion-datetime-md-h{--background:var(--ion-color-step-100, #ffffff);--title-color:var(--ion-color-contrast)}/*!@:host .datetime-header*/.sc-ion-datetime-md-h .datetime-header.sc-ion-datetime-md{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-base);color:var(--title-color)}/*!@:host .datetime-header .datetime-title*/.sc-ion-datetime-md-h .datetime-header.sc-ion-datetime-md .datetime-title.sc-ion-datetime-md{font-size:0.75rem;text-transform:uppercase}/*!@:host .datetime-header .datetime-selected-date*/.sc-ion-datetime-md-h .datetime-header.sc-ion-datetime-md .datetime-selected-date.sc-ion-datetime-md{margin-top:30px;font-size:2.125rem}/*!@:host .calendar-action-buttons ion-button*/.sc-ion-datetime-md-h .calendar-action-buttons.sc-ion-datetime-md ion-button.sc-ion-datetime-md{--color:var(--ion-color-step-650, #595959)}/*!@.calendar-month-year-toggle*/.calendar-month-year-toggle.sc-ion-datetime-md{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:12px;padding-bottom:12px;min-height:48px;background:transparent;color:var(--ion-color-step-650, #595959);z-index:1}/*!@.calendar-month-year-toggle.ion-focused::after*/.calendar-month-year-toggle.ion-focused.sc-ion-datetime-md::after{opacity:0.04}/*!@.calendar-month-year-toggle ion-ripple-effect*/.calendar-month-year-toggle.sc-ion-datetime-md ion-ripple-effect.sc-ion-datetime-md{color:currentColor}@media (any-hover: hover){/*!@.calendar-month-year-toggle.ion-activatable:not(.ion-focused):hover::after*/.calendar-month-year-toggle.ion-activatable.sc-ion-datetime-md:not(.ion-focused):hover::after{background:currentColor;opacity:0.04}}/*!@:host .calendar-days-of-week*/.sc-ion-datetime-md-h .calendar-days-of-week.sc-ion-datetime-md{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, gray);font-size:0.875rem;line-height:36px}/*!@:host .calendar-body .calendar-month .calendar-month-grid*/.sc-ion-datetime-md-h .calendar-body.sc-ion-datetime-md .calendar-month.sc-ion-datetime-md .calendar-month-grid.sc-ion-datetime-md{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:4px;padding-bottom:4px;grid-template-rows:repeat(6, 1fr)}/*!@:host .calendar-day*/.sc-ion-datetime-md-h .calendar-day.sc-ion-datetime-md{width:42px;min-width:42px;height:42px;font-size:0.875rem}/*!@:host .calendar-day.calendar-day-today*/.sc-ion-datetime-md-h .calendar-day.calendar-day-today.sc-ion-datetime-md{border:1px solid var(--ion-color-base);color:var(--ion-color-base)}/*!@:host .calendar-day.calendar-day-active*/.sc-ion-datetime-md-h .calendar-day.calendar-day-active.sc-ion-datetime-md{color:var(--ion-color-contrast)}/*!@.calendar-day.calendar-day-active*/.calendar-day.calendar-day-active.sc-ion-datetime-md{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}/*!@:host .datetime-time*/.sc-ion-datetime-md-h .datetime-time.sc-ion-datetime-md{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}/*!@:host .time-header*/.sc-ion-datetime-md-h .time-header.sc-ion-datetime-md{color:var(--ion-color-step-650, #595959)}/*!@:host(.datetime-presentation-month) .datetime-year,\n:host(.datetime-presentation-year) .datetime-year,\n:host(.datetime-presentation-month-year) .datetime-year*/.datetime-presentation-month.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md,.datetime-presentation-year.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md,.datetime-presentation-month-year.sc-ion-datetime-md-h .datetime-year.sc-ion-datetime-md{margin-top:20px;margin-bottom:20px}/*!@:host .datetime-buttons*/.sc-ion-datetime-md-h .datetime-buttons.sc-ion-datetime-md{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:10px;padding-bottom:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}";
|
|
14871
14871
|
|
|
14872
14872
|
/**
|
|
14873
14873
|
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
|
@@ -15838,7 +15838,7 @@ class Datetime {
|
|
|
15838
15838
|
const renderArray = forcePresentation === 'time-date'
|
|
15839
15839
|
? [this.renderTimePickerColumns(forcePresentation), this.renderDatePickerColumns(forcePresentation)]
|
|
15840
15840
|
: [this.renderDatePickerColumns(forcePresentation), this.renderTimePickerColumns(forcePresentation)];
|
|
15841
|
-
return hAsync("ion-picker
|
|
15841
|
+
return hAsync("ion-picker", null, renderArray);
|
|
15842
15842
|
}
|
|
15843
15843
|
renderDatePickerColumns(forcePresentation) {
|
|
15844
15844
|
return forcePresentation === 'date-time' || forcePresentation === 'time-date'
|
|
@@ -15897,7 +15897,7 @@ class Datetime {
|
|
|
15897
15897
|
const todayString = workingParts.day !== null
|
|
15898
15898
|
? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
|
|
15899
15899
|
: `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
|
|
15900
|
-
return (hAsync("ion-picker-column
|
|
15900
|
+
return (hAsync("ion-picker-column", { class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
|
|
15901
15901
|
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
15902
15902
|
// Due to a Safari 14 issue we need to destroy
|
|
15903
15903
|
// the scroll listener before we update state
|
|
@@ -15913,7 +15913,7 @@ class Datetime {
|
|
|
15913
15913
|
// the working parts have been updated.
|
|
15914
15914
|
this.initializeCalendarListener();
|
|
15915
15915
|
ev.stopPropagation();
|
|
15916
|
-
} }));
|
|
15916
|
+
} }, items.map((item) => (hAsync("ion-picker-column-option", { part: item.value === todayString ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: item.value, disabled: item.disabled, value: item.value }, item.text)))));
|
|
15917
15917
|
}
|
|
15918
15918
|
renderIndividualDatePickerColumns(forcePresentation) {
|
|
15919
15919
|
const { workingParts, isDateEnabled } = this;
|
|
@@ -15981,7 +15981,8 @@ class Datetime {
|
|
|
15981
15981
|
}
|
|
15982
15982
|
const { disabled, workingParts } = this;
|
|
15983
15983
|
const activePart = this.getActivePartsWithFallback();
|
|
15984
|
-
|
|
15984
|
+
const pickerColumnValue = (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined;
|
|
15985
|
+
return (hAsync("ion-picker-column", { class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
|
|
15985
15986
|
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
15986
15987
|
// Due to a Safari 14 issue we need to destroy
|
|
15987
15988
|
// the scroll listener before we update state
|
|
@@ -15995,7 +15996,7 @@ class Datetime {
|
|
|
15995
15996
|
// the working parts have been updated.
|
|
15996
15997
|
this.initializeCalendarListener();
|
|
15997
15998
|
ev.stopPropagation();
|
|
15998
|
-
} }));
|
|
15999
|
+
} }, days.map((day) => (hAsync("ion-picker-column-option", { part: day.value === pickerColumnValue ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: day.value, disabled: day.disabled, value: day.value }, day.text)))));
|
|
15999
16000
|
}
|
|
16000
16001
|
renderMonthPickerColumn(months) {
|
|
16001
16002
|
if (months.length === 0) {
|
|
@@ -16003,7 +16004,7 @@ class Datetime {
|
|
|
16003
16004
|
}
|
|
16004
16005
|
const { disabled, workingParts } = this;
|
|
16005
16006
|
const activePart = this.getActivePartsWithFallback();
|
|
16006
|
-
return (hAsync("ion-picker-column
|
|
16007
|
+
return (hAsync("ion-picker-column", { class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
|
|
16007
16008
|
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
16008
16009
|
// Due to a Safari 14 issue we need to destroy
|
|
16009
16010
|
// the scroll listener before we update state
|
|
@@ -16017,7 +16018,7 @@ class Datetime {
|
|
|
16017
16018
|
// the working parts have been updated.
|
|
16018
16019
|
this.initializeCalendarListener();
|
|
16019
16020
|
ev.stopPropagation();
|
|
16020
|
-
} }));
|
|
16021
|
+
} }, months.map((month) => (hAsync("ion-picker-column-option", { part: month.value === workingParts.month ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: month.value, disabled: month.disabled, value: month.value }, month.text)))));
|
|
16021
16022
|
}
|
|
16022
16023
|
renderYearPickerColumn(years) {
|
|
16023
16024
|
if (years.length === 0) {
|
|
@@ -16025,7 +16026,7 @@ class Datetime {
|
|
|
16025
16026
|
}
|
|
16026
16027
|
const { disabled, workingParts } = this;
|
|
16027
16028
|
const activePart = this.getActivePartsWithFallback();
|
|
16028
|
-
return (hAsync("ion-picker-column
|
|
16029
|
+
return (hAsync("ion-picker-column", { class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
|
|
16029
16030
|
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
16030
16031
|
// Due to a Safari 14 issue we need to destroy
|
|
16031
16032
|
// the scroll listener before we update state
|
|
@@ -16039,7 +16040,7 @@ class Datetime {
|
|
|
16039
16040
|
// the working parts have been updated.
|
|
16040
16041
|
this.initializeCalendarListener();
|
|
16041
16042
|
ev.stopPropagation();
|
|
16042
|
-
} }));
|
|
16043
|
+
} }, years.map((year) => (hAsync("ion-picker-column-option", { part: year.value === workingParts.year ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: year.value, disabled: year.disabled, value: year.value }, year.text)))));
|
|
16043
16044
|
}
|
|
16044
16045
|
renderTimePickerColumns(forcePresentation) {
|
|
16045
16046
|
if (['date', 'month', 'month-year', 'year'].includes(forcePresentation)) {
|
|
@@ -16068,22 +16069,22 @@ class Datetime {
|
|
|
16068
16069
|
if (hoursData.length === 0)
|
|
16069
16070
|
return [];
|
|
16070
16071
|
const activePart = this.getActivePartsWithFallback();
|
|
16071
|
-
return (hAsync("ion-picker-column
|
|
16072
|
+
return (hAsync("ion-picker-column", { color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
|
|
16072
16073
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
|
|
16073
16074
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { hour: ev.detail.value }));
|
|
16074
16075
|
ev.stopPropagation();
|
|
16075
|
-
} }));
|
|
16076
|
+
} }, hoursData.map((hour) => (hAsync("ion-picker-column-option", { part: hour.value === activePart.hour ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: hour.value, disabled: hour.disabled, value: hour.value }, hour.text)))));
|
|
16076
16077
|
}
|
|
16077
16078
|
renderMinutePickerColumn(minutesData) {
|
|
16078
16079
|
const { disabled, workingParts } = this;
|
|
16079
16080
|
if (minutesData.length === 0)
|
|
16080
16081
|
return [];
|
|
16081
16082
|
const activePart = this.getActivePartsWithFallback();
|
|
16082
|
-
return (hAsync("ion-picker-column
|
|
16083
|
+
return (hAsync("ion-picker-column", { color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
|
|
16083
16084
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
|
|
16084
16085
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { minute: ev.detail.value }));
|
|
16085
16086
|
ev.stopPropagation();
|
|
16086
|
-
} }));
|
|
16087
|
+
} }, minutesData.map((minute) => (hAsync("ion-picker-column-option", { part: minute.value === activePart.minute ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: minute.value, disabled: minute.disabled, value: minute.value }, minute.text)))));
|
|
16087
16088
|
}
|
|
16088
16089
|
renderDayPeriodPickerColumn(dayPeriodData) {
|
|
16089
16090
|
const { disabled, workingParts } = this;
|
|
@@ -16092,12 +16093,12 @@ class Datetime {
|
|
|
16092
16093
|
}
|
|
16093
16094
|
const activePart = this.getActivePartsWithFallback();
|
|
16094
16095
|
const isDayPeriodRTL = isLocaleDayPeriodRTL(this.locale);
|
|
16095
|
-
return (hAsync("ion-picker-column
|
|
16096
|
+
return (hAsync("ion-picker-column", { style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, onIonChange: (ev) => {
|
|
16096
16097
|
const hour = calculateHourFromAMPM(workingParts, ev.detail.value);
|
|
16097
16098
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
|
|
16098
16099
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { ampm: ev.detail.value, hour }));
|
|
16099
16100
|
ev.stopPropagation();
|
|
16100
|
-
} }));
|
|
16101
|
+
} }, dayPeriodData.map((dayPeriod) => (hAsync("ion-picker-column-option", { part: dayPeriod.value === activePart.ampm ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: dayPeriod.value, disabled: dayPeriod.disabled, value: dayPeriod.value }, dayPeriod.text)))));
|
|
16101
16102
|
}
|
|
16102
16103
|
renderWheelView(forcePresentation) {
|
|
16103
16104
|
const { locale } = this;
|
|
@@ -16283,7 +16284,7 @@ class Datetime {
|
|
|
16283
16284
|
* This will correctly scroll the element position to the correct time value,
|
|
16284
16285
|
* before the popover is fully presented.
|
|
16285
16286
|
*/
|
|
16286
|
-
const cols = ev.target.querySelectorAll('ion-picker-column
|
|
16287
|
+
const cols = ev.target.querySelectorAll('ion-picker-column');
|
|
16287
16288
|
// TODO (FW-615): Potentially remove this when intersection observers are fixed in picker column
|
|
16288
16289
|
cols.forEach((col) => col.scrollActiveItemIntoView());
|
|
16289
16290
|
}, style: {
|
|
@@ -16477,6 +16478,8 @@ class Datetime {
|
|
|
16477
16478
|
}; }
|
|
16478
16479
|
}
|
|
16479
16480
|
let datetimeIds = 0;
|
|
16481
|
+
const WHEEL_ITEM_PART = 'wheel-item';
|
|
16482
|
+
const WHEEL_ITEM_ACTIVE_PART = `active`;
|
|
16480
16483
|
|
|
16481
16484
|
const iosDatetimeButtonCss = "/*!@:host*/.sc-ion-datetime-button-ios-h{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}/*!@:host button*/.sc-ion-datetime-button-ios-h button.sc-ion-datetime-button-ios{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px;margin-top:0px;margin-bottom:0px;position:relative;-webkit-transition:150ms color ease-in-out;transition:150ms color ease-in-out;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:1rem;cursor:pointer;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}/*!@:host(.time-active) #time-button,\n:host(.date-active) #date-button*/.time-active.sc-ion-datetime-button-ios-h #time-button.sc-ion-datetime-button-ios,.date-active.sc-ion-datetime-button-ios-h #date-button.sc-ion-datetime-button-ios{color:var(--ion-color-base)}/*!@:host(.datetime-button-disabled)*/.datetime-button-disabled.sc-ion-datetime-button-ios-h{pointer-events:none}/*!@:host(.datetime-button-disabled) button*/.datetime-button-disabled.sc-ion-datetime-button-ios-h button.sc-ion-datetime-button-ios{opacity:0.4}";
|
|
16482
16485
|
|
|
@@ -24524,1516 +24527,1636 @@ class Note {
|
|
|
24524
24527
|
}; }
|
|
24525
24528
|
}
|
|
24526
24529
|
|
|
24527
|
-
|
|
24528
|
-
* iOS Picker Enter Animation
|
|
24529
|
-
*/
|
|
24530
|
-
const iosEnterAnimation$2 = (baseEl) => {
|
|
24531
|
-
const baseAnimation = createAnimation();
|
|
24532
|
-
const backdropAnimation = createAnimation();
|
|
24533
|
-
const wrapperAnimation = createAnimation();
|
|
24534
|
-
backdropAnimation
|
|
24535
|
-
.addElement(baseEl.querySelector('ion-backdrop'))
|
|
24536
|
-
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
|
24537
|
-
.beforeStyles({
|
|
24538
|
-
'pointer-events': 'none',
|
|
24539
|
-
})
|
|
24540
|
-
.afterClearStyles(['pointer-events']);
|
|
24541
|
-
wrapperAnimation
|
|
24542
|
-
.addElement(baseEl.querySelector('.picker-wrapper'))
|
|
24543
|
-
.fromTo('transform', 'translateY(100%)', 'translateY(0%)');
|
|
24544
|
-
return baseAnimation
|
|
24545
|
-
.addElement(baseEl)
|
|
24546
|
-
.easing('cubic-bezier(.36,.66,.04,1)')
|
|
24547
|
-
.duration(400)
|
|
24548
|
-
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
24549
|
-
};
|
|
24550
|
-
|
|
24551
|
-
/**
|
|
24552
|
-
* iOS Picker Leave Animation
|
|
24553
|
-
*/
|
|
24554
|
-
const iosLeaveAnimation$2 = (baseEl) => {
|
|
24555
|
-
const baseAnimation = createAnimation();
|
|
24556
|
-
const backdropAnimation = createAnimation();
|
|
24557
|
-
const wrapperAnimation = createAnimation();
|
|
24558
|
-
backdropAnimation
|
|
24559
|
-
.addElement(baseEl.querySelector('ion-backdrop'))
|
|
24560
|
-
.fromTo('opacity', 'var(--backdrop-opacity)', 0.01);
|
|
24561
|
-
wrapperAnimation
|
|
24562
|
-
.addElement(baseEl.querySelector('.picker-wrapper'))
|
|
24563
|
-
.fromTo('transform', 'translateY(0%)', 'translateY(100%)');
|
|
24564
|
-
return baseAnimation
|
|
24565
|
-
.addElement(baseEl)
|
|
24566
|
-
.easing('cubic-bezier(.36,.66,.04,1)')
|
|
24567
|
-
.duration(400)
|
|
24568
|
-
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
24569
|
-
};
|
|
24570
|
-
|
|
24571
|
-
const pickerIosCss = ".sc-ion-picker-ios-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}@supports (inset-inline-start: 0){.sc-ion-picker-ios-h{inset-inline-start:0}}@supports not (inset-inline-start: 0){.sc-ion-picker-ios-h{left:0}[dir=rtl].sc-ion-picker-ios-h,[dir=rtl] .sc-ion-picker-ios-h{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.sc-ion-picker-ios-h:dir(rtl){left:unset;right:unset;right:0}}}.overlay-hidden.sc-ion-picker-ios-h{display:none}.picker-wrapper.sc-ion-picker-ios{border-radius:var(--border-radius);left:0;right:0;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}.picker-toolbar.sc-ion-picker-ios{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-ios{border:0;font-family:inherit}.picker-button.sc-ion-picker-ios:active,.picker-button.sc-ion-picker-ios:focus{outline:none}.picker-columns.sc-ion-picker-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;overflow:hidden}.picker-above-highlight.sc-ion-picker-ios,.picker-below-highlight.sc-ion-picker-ios{display:none;pointer-events:none}.sc-ion-picker-ios-h{--background:var(--ion-background-color, #fff);--border-width:1px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-ios{display:-ms-flexbox;display:flex;height:44px;border-bottom:0.55px solid var(--border-color)}.picker-toolbar-button.sc-ion-picker-ios{-ms-flex:1;flex:1;text-align:end}.picker-toolbar-button.sc-ion-picker-ios:last-child .picker-button.sc-ion-picker-ios{font-weight:600}.picker-toolbar-button.sc-ion-picker-ios:first-child{font-weight:normal;text-align:start}.picker-button.sc-ion-picker-ios,.picker-button.ion-activated.sc-ion-picker-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:1em;padding-inline-start:1em;-webkit-padding-end:1em;padding-inline-end:1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #3880ff);font-size:16px}.picker-columns.sc-ion-picker-ios{height:215px;-webkit-perspective:1000px;perspective:1000px}.picker-above-highlight.sc-ion-picker-ios{top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:81px;border-bottom:1px solid var(--border-color);background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to bottom, var(--background, var(--ion-background-color, #fff)) 20%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:10}@supports (inset-inline-start: 0){.picker-above-highlight.sc-ion-picker-ios{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-above-highlight.sc-ion-picker-ios{left:0}[dir=rtl].sc-ion-picker-ios-h .picker-above-highlight.sc-ion-picker-ios,[dir=rtl] .sc-ion-picker-ios-h .picker-above-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}[dir=rtl].sc-ion-picker-ios .picker-above-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-above-highlight.sc-ion-picker-ios:dir(rtl){left:unset;right:unset;right:0}}}.picker-below-highlight.sc-ion-picker-ios{top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:119px;border-top:1px solid var(--border-color);background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to top, var(--background, var(--ion-background-color, #fff)) 30%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:11}@supports (inset-inline-start: 0){.picker-below-highlight.sc-ion-picker-ios{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-below-highlight.sc-ion-picker-ios{left:0}[dir=rtl].sc-ion-picker-ios-h .picker-below-highlight.sc-ion-picker-ios,[dir=rtl] .sc-ion-picker-ios-h .picker-below-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}[dir=rtl].sc-ion-picker-ios .picker-below-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-below-highlight.sc-ion-picker-ios:dir(rtl){left:unset;right:unset;right:0}}}";
|
|
24530
|
+
const pickerIosCss$1 = "/*!@:host*/.sc-ion-picker-ios-h{--highlight-border-radius:8px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:200px;direction:ltr;z-index:0}/*!@:host .picker-before,\n:host .picker-after*/.sc-ion-picker-ios-h .picker-before.sc-ion-picker-ios,.sc-ion-picker-ios-h .picker-after.sc-ion-picker-ios{position:absolute;width:100%;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:1;pointer-events:none}/*!@:host .picker-before*/.sc-ion-picker-ios-h .picker-before.sc-ion-picker-ios{top:0;height:83px}@supports (inset-inline-start: 0){/*!@:host .picker-before*/.sc-ion-picker-ios-h .picker-before.sc-ion-picker-ios{inset-inline-start:0}}@supports not (inset-inline-start: 0){/*!@:host .picker-before*/.sc-ion-picker-ios-h .picker-before.sc-ion-picker-ios{left:0}/*!@:host-context([dir=rtl]) .picker-before*/[dir=rtl].sc-ion-picker-ios-h .picker-before.sc-ion-picker-ios,[dir=rtl] .sc-ion-picker-ios-h .picker-before.sc-ion-picker-ios{left:unset;right:unset;right:0}/*!@@supports selector(:dir(rtl))*/@supports .sc-ion-picker-ios selector(.sc-ion-picker-ios:dir(rtl)){.sc-ion-picker-ios-h:dir(rtl) .picker-before{left:unset;right:unset;right:0}}}/*!@:host .picker-after*/.sc-ion-picker-ios-h .picker-after.sc-ion-picker-ios{top:116px;height:84px}@supports (inset-inline-start: 0){/*!@:host .picker-after*/.sc-ion-picker-ios-h .picker-after.sc-ion-picker-ios{inset-inline-start:0}}@supports not (inset-inline-start: 0){/*!@:host .picker-after*/.sc-ion-picker-ios-h .picker-after.sc-ion-picker-ios{left:0}/*!@:host-context([dir=rtl]) .picker-after*/[dir=rtl].sc-ion-picker-ios-h .picker-after.sc-ion-picker-ios,[dir=rtl] .sc-ion-picker-ios-h .picker-after.sc-ion-picker-ios{left:unset;right:unset;right:0}/*!@@supports selector(:dir(rtl))*/@supports .sc-ion-picker-ios selector(.sc-ion-picker-ios:dir(rtl)){.sc-ion-picker-ios-h:dir(rtl) .picker-after{left:unset;right:unset;right:0}}}/*!@:host .picker-highlight*/.sc-ion-picker-ios-h .picker-highlight.sc-ion-picker-ios{border-radius:var(--highlight-border-radius);left:0;right:0;top:50%;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;position:absolute;width:calc(100% - 16px);height:34px;-webkit-transform:translateY(-50%);transform:translateY(-50%);background:var(--highlight-background);z-index:-1}/*!@:host input*/.sc-ion-picker-ios-h input.sc-ion-picker-ios{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}/*!@:host ::slotted(ion-picker-column:first-of-type)*/.sc-ion-picker-ios-h .sc-ion-picker-ios-s>ion-picker-column:first-of-type{text-align:start}/*!@:host ::slotted(ion-picker-column:last-of-type)*/.sc-ion-picker-ios-h .sc-ion-picker-ios-s>ion-picker-column:last-of-type{text-align:end}/*!@:host ::slotted(ion-picker-column:only-child)*/.sc-ion-picker-ios-h .sc-ion-picker-ios-s>ion-picker-column:only-child{text-align:center}/*!@:host .picker-before*/.sc-ion-picker-ios-h .picker-before.sc-ion-picker-ios{background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), to(rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8)));background:linear-gradient(to bottom, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 20%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8) 100%)}/*!@:host .picker-after*/.sc-ion-picker-ios-h .picker-after.sc-ion-picker-ios{background:-webkit-gradient(linear, left bottom, left top, color-stop(20%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), to(rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8)));background:linear-gradient(to top, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 20%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8) 100%)}/*!@:host .picker-highlight*/.sc-ion-picker-ios-h .picker-highlight.sc-ion-picker-ios{background:var(--highlight-background, var(--ion-color-step-150, #eeeeef))}";
|
|
24572
24531
|
|
|
24573
|
-
const pickerMdCss = "
|
|
24532
|
+
const pickerMdCss$1 = "/*!@:host*/.sc-ion-picker-md-h{--highlight-border-radius:8px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:200px;direction:ltr;z-index:0}/*!@:host .picker-before,\n:host .picker-after*/.sc-ion-picker-md-h .picker-before.sc-ion-picker-md,.sc-ion-picker-md-h .picker-after.sc-ion-picker-md{position:absolute;width:100%;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:1;pointer-events:none}/*!@:host .picker-before*/.sc-ion-picker-md-h .picker-before.sc-ion-picker-md{top:0;height:83px}@supports (inset-inline-start: 0){/*!@:host .picker-before*/.sc-ion-picker-md-h .picker-before.sc-ion-picker-md{inset-inline-start:0}}@supports not (inset-inline-start: 0){/*!@:host .picker-before*/.sc-ion-picker-md-h .picker-before.sc-ion-picker-md{left:0}/*!@:host-context([dir=rtl]) .picker-before*/[dir=rtl].sc-ion-picker-md-h .picker-before.sc-ion-picker-md,[dir=rtl] .sc-ion-picker-md-h .picker-before.sc-ion-picker-md{left:unset;right:unset;right:0}/*!@@supports selector(:dir(rtl))*/@supports .sc-ion-picker-md selector(.sc-ion-picker-md:dir(rtl)){.sc-ion-picker-md-h:dir(rtl) .picker-before{left:unset;right:unset;right:0}}}/*!@:host .picker-after*/.sc-ion-picker-md-h .picker-after.sc-ion-picker-md{top:116px;height:84px}@supports (inset-inline-start: 0){/*!@:host .picker-after*/.sc-ion-picker-md-h .picker-after.sc-ion-picker-md{inset-inline-start:0}}@supports not (inset-inline-start: 0){/*!@:host .picker-after*/.sc-ion-picker-md-h .picker-after.sc-ion-picker-md{left:0}/*!@:host-context([dir=rtl]) .picker-after*/[dir=rtl].sc-ion-picker-md-h .picker-after.sc-ion-picker-md,[dir=rtl] .sc-ion-picker-md-h .picker-after.sc-ion-picker-md{left:unset;right:unset;right:0}/*!@@supports selector(:dir(rtl))*/@supports .sc-ion-picker-md selector(.sc-ion-picker-md:dir(rtl)){.sc-ion-picker-md-h:dir(rtl) .picker-after{left:unset;right:unset;right:0}}}/*!@:host .picker-highlight*/.sc-ion-picker-md-h .picker-highlight.sc-ion-picker-md{border-radius:var(--highlight-border-radius);left:0;right:0;top:50%;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;position:absolute;width:calc(100% - 16px);height:34px;-webkit-transform:translateY(-50%);transform:translateY(-50%);background:var(--highlight-background);z-index:-1}/*!@:host input*/.sc-ion-picker-md-h input.sc-ion-picker-md{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}/*!@:host ::slotted(ion-picker-column:first-of-type)*/.sc-ion-picker-md-h .sc-ion-picker-md-s>ion-picker-column:first-of-type{text-align:start}/*!@:host ::slotted(ion-picker-column:last-of-type)*/.sc-ion-picker-md-h .sc-ion-picker-md-s>ion-picker-column:last-of-type{text-align:end}/*!@:host ::slotted(ion-picker-column:only-child)*/.sc-ion-picker-md-h .sc-ion-picker-md-s>ion-picker-column:only-child{text-align:center}/*!@:host .picker-before*/.sc-ion-picker-md-h .picker-before.sc-ion-picker-md{background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), color-stop(90%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0)));background:linear-gradient(to bottom, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 20%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0) 90%)}/*!@:host .picker-after*/.sc-ion-picker-md-h .picker-after.sc-ion-picker-md{background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), color-stop(90%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0)));background:linear-gradient(to top, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 30%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0) 90%)}";
|
|
24574
24533
|
|
|
24575
|
-
// TODO(FW-2832): types
|
|
24576
24534
|
/**
|
|
24577
24535
|
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
|
24578
24536
|
*/
|
|
24579
|
-
class Picker {
|
|
24537
|
+
class Picker$1 {
|
|
24580
24538
|
constructor(hostRef) {
|
|
24581
24539
|
registerInstance(this, hostRef);
|
|
24582
|
-
this.
|
|
24583
|
-
this.
|
|
24584
|
-
this.
|
|
24585
|
-
|
|
24586
|
-
|
|
24587
|
-
|
|
24588
|
-
|
|
24589
|
-
|
|
24590
|
-
|
|
24591
|
-
|
|
24592
|
-
|
|
24593
|
-
|
|
24594
|
-
|
|
24595
|
-
|
|
24596
|
-
|
|
24597
|
-
|
|
24598
|
-
if (isCancel(role)) {
|
|
24599
|
-
const cancelButton = this.buttons.find((b) => b.role === 'cancel');
|
|
24600
|
-
this.callButtonHandler(cancelButton);
|
|
24540
|
+
this.ionInputModeChange = createEvent(this, "ionInputModeChange", 7);
|
|
24541
|
+
this.useInputMode = false;
|
|
24542
|
+
this.isInHighlightBounds = (ev) => {
|
|
24543
|
+
const { highlightEl } = this;
|
|
24544
|
+
if (!highlightEl) {
|
|
24545
|
+
return false;
|
|
24546
|
+
}
|
|
24547
|
+
const bbox = highlightEl.getBoundingClientRect();
|
|
24548
|
+
/**
|
|
24549
|
+
* Check to see if the user clicked
|
|
24550
|
+
* outside the bounds of the highlight.
|
|
24551
|
+
*/
|
|
24552
|
+
const outsideX = ev.clientX < bbox.left || ev.clientX > bbox.right;
|
|
24553
|
+
const outsideY = ev.clientY < bbox.top || ev.clientY > bbox.bottom;
|
|
24554
|
+
if (outsideX || outsideY) {
|
|
24555
|
+
return false;
|
|
24601
24556
|
}
|
|
24557
|
+
return true;
|
|
24602
24558
|
};
|
|
24603
|
-
this.presented = false;
|
|
24604
|
-
this.overlayIndex = undefined;
|
|
24605
|
-
this.delegate = undefined;
|
|
24606
|
-
this.hasController = false;
|
|
24607
|
-
this.keyboardClose = true;
|
|
24608
|
-
this.enterAnimation = undefined;
|
|
24609
|
-
this.leaveAnimation = undefined;
|
|
24610
|
-
this.buttons = [];
|
|
24611
|
-
this.columns = [];
|
|
24612
|
-
this.cssClass = undefined;
|
|
24613
|
-
this.duration = 0;
|
|
24614
|
-
this.showBackdrop = true;
|
|
24615
|
-
this.backdropDismiss = true;
|
|
24616
|
-
this.animated = true;
|
|
24617
|
-
this.htmlAttributes = undefined;
|
|
24618
|
-
this.isOpen = false;
|
|
24619
|
-
this.trigger = undefined;
|
|
24620
|
-
}
|
|
24621
|
-
onIsOpenChange(newValue, oldValue) {
|
|
24622
|
-
if (newValue === true && oldValue === false) {
|
|
24623
|
-
this.present();
|
|
24624
|
-
}
|
|
24625
|
-
else if (newValue === false && oldValue === true) {
|
|
24626
|
-
this.dismiss();
|
|
24627
|
-
}
|
|
24628
|
-
}
|
|
24629
|
-
triggerChanged() {
|
|
24630
|
-
const { trigger, el, triggerController } = this;
|
|
24631
|
-
if (trigger) {
|
|
24632
|
-
triggerController.addClickListener(el, trigger);
|
|
24633
|
-
}
|
|
24634
|
-
}
|
|
24635
|
-
connectedCallback() {
|
|
24636
|
-
prepareOverlay(this.el);
|
|
24637
|
-
this.triggerChanged();
|
|
24638
|
-
}
|
|
24639
|
-
disconnectedCallback() {
|
|
24640
|
-
this.triggerController.removeClickListener();
|
|
24641
|
-
}
|
|
24642
|
-
componentWillLoad() {
|
|
24643
|
-
setOverlayId(this.el);
|
|
24644
|
-
}
|
|
24645
|
-
componentDidLoad() {
|
|
24646
24559
|
/**
|
|
24647
|
-
* If
|
|
24648
|
-
* then we should
|
|
24560
|
+
* If we are no longer focused
|
|
24561
|
+
* on a picker column, then we should
|
|
24562
|
+
* exit input mode. An exception is made
|
|
24563
|
+
* for the input in the picker since having
|
|
24564
|
+
* that focused means we are still in input mode.
|
|
24649
24565
|
*/
|
|
24650
|
-
|
|
24651
|
-
|
|
24652
|
-
|
|
24566
|
+
this.onFocusOut = (ev) => {
|
|
24567
|
+
// TODO(FW-2832): type
|
|
24568
|
+
const { relatedTarget } = ev;
|
|
24569
|
+
if (!relatedTarget || (relatedTarget.tagName !== 'ION-PICKER-COLUMN' && relatedTarget !== this.inputEl)) {
|
|
24570
|
+
this.exitInputMode();
|
|
24571
|
+
}
|
|
24572
|
+
};
|
|
24653
24573
|
/**
|
|
24654
|
-
* When
|
|
24655
|
-
*
|
|
24656
|
-
*
|
|
24657
|
-
* As a result, the watcher callback may not be fired.
|
|
24658
|
-
* We work around this by manually calling the watcher
|
|
24659
|
-
* callback when the component has loaded and the watcher
|
|
24660
|
-
* is configured.
|
|
24574
|
+
* When picker columns receive focus
|
|
24575
|
+
* the parent picker needs to determine
|
|
24576
|
+
* whether to enter/exit input mode.
|
|
24661
24577
|
*/
|
|
24662
|
-
this.
|
|
24663
|
-
|
|
24664
|
-
|
|
24665
|
-
|
|
24666
|
-
|
|
24667
|
-
|
|
24668
|
-
|
|
24669
|
-
|
|
24670
|
-
|
|
24671
|
-
|
|
24672
|
-
|
|
24673
|
-
}
|
|
24674
|
-
unlock();
|
|
24675
|
-
}
|
|
24676
|
-
/**
|
|
24677
|
-
* Dismiss the picker overlay after it has been presented.
|
|
24678
|
-
*
|
|
24679
|
-
* @param data Any data to emit in the dismiss events.
|
|
24680
|
-
* @param role The role of the element that is dismissing the picker.
|
|
24681
|
-
* This can be useful in a button handler for determining which button was
|
|
24682
|
-
* clicked to dismiss the picker.
|
|
24683
|
-
* Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
|
|
24684
|
-
*/
|
|
24685
|
-
async dismiss(data, role) {
|
|
24686
|
-
const unlock = await this.lockController.lock();
|
|
24687
|
-
if (this.durationTimeout) {
|
|
24688
|
-
clearTimeout(this.durationTimeout);
|
|
24689
|
-
}
|
|
24690
|
-
const dismissed = await dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation$2, iosLeaveAnimation$2);
|
|
24691
|
-
if (dismissed) {
|
|
24692
|
-
this.delegateController.removeViewFromDom();
|
|
24693
|
-
}
|
|
24694
|
-
unlock();
|
|
24695
|
-
return dismissed;
|
|
24696
|
-
}
|
|
24697
|
-
/**
|
|
24698
|
-
* Returns a promise that resolves when the picker did dismiss.
|
|
24699
|
-
*/
|
|
24700
|
-
onDidDismiss() {
|
|
24701
|
-
return eventMethod(this.el, 'ionPickerDidDismiss');
|
|
24702
|
-
}
|
|
24703
|
-
/**
|
|
24704
|
-
* Returns a promise that resolves when the picker will dismiss.
|
|
24705
|
-
*/
|
|
24706
|
-
onWillDismiss() {
|
|
24707
|
-
return eventMethod(this.el, 'ionPickerWillDismiss');
|
|
24708
|
-
}
|
|
24709
|
-
/**
|
|
24710
|
-
* Get the column that matches the specified name.
|
|
24711
|
-
*
|
|
24712
|
-
* @param name The name of the column.
|
|
24713
|
-
*/
|
|
24714
|
-
getColumn(name) {
|
|
24715
|
-
return Promise.resolve(this.columns.find((column) => column.name === name));
|
|
24716
|
-
}
|
|
24717
|
-
async buttonClick(button) {
|
|
24718
|
-
const role = button.role;
|
|
24719
|
-
if (isCancel(role)) {
|
|
24720
|
-
return this.dismiss(undefined, role);
|
|
24721
|
-
}
|
|
24722
|
-
const shouldDismiss = await this.callButtonHandler(button);
|
|
24723
|
-
if (shouldDismiss) {
|
|
24724
|
-
return this.dismiss(this.getSelected(), button.role);
|
|
24725
|
-
}
|
|
24726
|
-
return Promise.resolve();
|
|
24727
|
-
}
|
|
24728
|
-
async callButtonHandler(button) {
|
|
24729
|
-
if (button) {
|
|
24730
|
-
// a handler has been provided, execute it
|
|
24731
|
-
// pass the handler the values from the inputs
|
|
24732
|
-
const rtn = await safeCall(button.handler, this.getSelected());
|
|
24733
|
-
if (rtn === false) {
|
|
24734
|
-
// if the return value of the handler is false then do not dismiss
|
|
24735
|
-
return false;
|
|
24578
|
+
this.onFocusIn = (ev) => {
|
|
24579
|
+
// TODO(FW-2832): type
|
|
24580
|
+
const { target } = ev;
|
|
24581
|
+
/**
|
|
24582
|
+
* Due to browser differences in how/when focus
|
|
24583
|
+
* is dispatched on certain elements, we need to
|
|
24584
|
+
* make sure that this function only ever runs when
|
|
24585
|
+
* focusing a picker column.
|
|
24586
|
+
*/
|
|
24587
|
+
if (target.tagName !== 'ION-PICKER-COLUMN') {
|
|
24588
|
+
return;
|
|
24736
24589
|
}
|
|
24737
|
-
|
|
24738
|
-
|
|
24739
|
-
|
|
24740
|
-
|
|
24741
|
-
|
|
24742
|
-
|
|
24743
|
-
|
|
24744
|
-
|
|
24745
|
-
|
|
24746
|
-
|
|
24747
|
-
|
|
24748
|
-
|
|
24749
|
-
|
|
24750
|
-
|
|
24751
|
-
|
|
24752
|
-
|
|
24753
|
-
|
|
24754
|
-
|
|
24755
|
-
|
|
24756
|
-
|
|
24757
|
-
|
|
24758
|
-
|
|
24759
|
-
|
|
24760
|
-
|
|
24761
|
-
|
|
24762
|
-
|
|
24763
|
-
|
|
24764
|
-
|
|
24765
|
-
|
|
24766
|
-
|
|
24767
|
-
|
|
24768
|
-
|
|
24769
|
-
|
|
24770
|
-
|
|
24771
|
-
|
|
24772
|
-
|
|
24773
|
-
|
|
24774
|
-
|
|
24775
|
-
|
|
24776
|
-
|
|
24777
|
-
|
|
24778
|
-
|
|
24779
|
-
|
|
24780
|
-
|
|
24781
|
-
|
|
24782
|
-
|
|
24783
|
-
|
|
24784
|
-
|
|
24785
|
-
|
|
24786
|
-
|
|
24787
|
-
|
|
24788
|
-
|
|
24789
|
-
|
|
24790
|
-
|
|
24791
|
-
|
|
24792
|
-
|
|
24793
|
-
|
|
24794
|
-
|
|
24795
|
-
|
|
24796
|
-
|
|
24797
|
-
|
|
24798
|
-
|
|
24799
|
-
|
|
24800
|
-
|
|
24801
|
-
|
|
24802
|
-
|
|
24803
|
-
|
|
24804
|
-
|
|
24805
|
-
|
|
24806
|
-
|
|
24807
|
-
|
|
24808
|
-
|
|
24809
|
-
|
|
24810
|
-
|
|
24811
|
-
|
|
24812
|
-
|
|
24813
|
-
|
|
24814
|
-
|
|
24815
|
-
|
|
24816
|
-
|
|
24817
|
-
|
|
24818
|
-
|
|
24819
|
-
|
|
24820
|
-
|
|
24821
|
-
|
|
24822
|
-
|
|
24823
|
-
|
|
24824
|
-
|
|
24825
|
-
|
|
24826
|
-
|
|
24827
|
-
|
|
24828
|
-
|
|
24829
|
-
// `colDidChange` is a flag that gets set when the column is changed
|
|
24830
|
-
// dynamically. When this flag is set, the column will refresh
|
|
24831
|
-
// after the component re-renders to incorporate the new column data.
|
|
24832
|
-
// This is necessary because `this.refresh` queries for the option elements,
|
|
24833
|
-
// so it needs to wait for the latest elements to be available in the DOM.
|
|
24834
|
-
// Ex: column is created with 3 options. User updates the column data
|
|
24835
|
-
// to have 5 options. The column will still think it only has 3 options.
|
|
24836
|
-
this.colDidChange = false;
|
|
24837
|
-
this.col = undefined;
|
|
24838
|
-
}
|
|
24839
|
-
colChanged() {
|
|
24840
|
-
this.colDidChange = true;
|
|
24841
|
-
}
|
|
24842
|
-
async connectedCallback() {
|
|
24843
|
-
let pickerRotateFactor = 0;
|
|
24844
|
-
let pickerScaleFactor = 0.81;
|
|
24845
|
-
const mode = getIonMode$1(this);
|
|
24846
|
-
if (mode === 'ios') {
|
|
24847
|
-
pickerRotateFactor = -0.46;
|
|
24848
|
-
pickerScaleFactor = 1;
|
|
24849
|
-
}
|
|
24850
|
-
this.rotateFactor = pickerRotateFactor;
|
|
24851
|
-
this.scaleFactor = pickerScaleFactor;
|
|
24852
|
-
this.gesture = (await Promise.resolve().then(function () { return index; })).createGesture({
|
|
24853
|
-
el: this.el,
|
|
24854
|
-
gestureName: 'picker-swipe',
|
|
24855
|
-
gesturePriority: 100,
|
|
24856
|
-
threshold: 0,
|
|
24857
|
-
passive: false,
|
|
24858
|
-
onStart: (ev) => this.onStart(ev),
|
|
24859
|
-
onMove: (ev) => this.onMove(ev),
|
|
24860
|
-
onEnd: (ev) => this.onEnd(ev),
|
|
24861
|
-
});
|
|
24862
|
-
this.gesture.enable();
|
|
24863
|
-
// Options have not been initialized yet
|
|
24864
|
-
// Animation must be disabled through the `noAnimate` flag
|
|
24865
|
-
// Otherwise, the options will render
|
|
24866
|
-
// at the top of the column and transition down
|
|
24867
|
-
this.tmrId = setTimeout(() => {
|
|
24868
|
-
this.noAnimate = false;
|
|
24869
|
-
// After initialization, `refresh()` will be called
|
|
24870
|
-
// At this point, animation will be enabled. The options will
|
|
24871
|
-
// animate as they are being selected.
|
|
24872
|
-
this.refresh(true);
|
|
24873
|
-
}, 250);
|
|
24874
|
-
}
|
|
24875
|
-
componentDidLoad() {
|
|
24876
|
-
this.onDomChange();
|
|
24877
|
-
}
|
|
24878
|
-
componentDidUpdate() {
|
|
24879
|
-
// Options may have changed since last update.
|
|
24880
|
-
if (this.colDidChange) {
|
|
24881
|
-
// Animation must be disabled through the `onDomChange` parameter.
|
|
24882
|
-
// Otherwise, the recently added options will render
|
|
24883
|
-
// at the top of the column and transition down
|
|
24884
|
-
this.onDomChange(true, false);
|
|
24885
|
-
this.colDidChange = false;
|
|
24886
|
-
}
|
|
24887
|
-
}
|
|
24888
|
-
disconnectedCallback() {
|
|
24889
|
-
if (this.rafId !== undefined)
|
|
24890
|
-
cancelAnimationFrame(this.rafId);
|
|
24891
|
-
if (this.tmrId)
|
|
24892
|
-
clearTimeout(this.tmrId);
|
|
24893
|
-
if (this.gesture) {
|
|
24894
|
-
this.gesture.destroy();
|
|
24895
|
-
this.gesture = undefined;
|
|
24896
|
-
}
|
|
24897
|
-
}
|
|
24898
|
-
emitColChange() {
|
|
24899
|
-
this.ionPickerColChange.emit(this.col);
|
|
24900
|
-
}
|
|
24901
|
-
setSelected(selectedIndex, duration) {
|
|
24902
|
-
// if there is a selected index, then figure out it's y position
|
|
24903
|
-
// if there isn't a selected index, then just use the top y position
|
|
24904
|
-
const y = selectedIndex > -1 ? -(selectedIndex * this.optHeight) : 0;
|
|
24905
|
-
this.velocity = 0;
|
|
24906
|
-
// set what y position we're at
|
|
24907
|
-
if (this.rafId !== undefined)
|
|
24908
|
-
cancelAnimationFrame(this.rafId);
|
|
24909
|
-
this.update(y, duration, true);
|
|
24910
|
-
this.emitColChange();
|
|
24911
|
-
}
|
|
24912
|
-
update(y, duration, saveY) {
|
|
24913
|
-
if (!this.optsEl) {
|
|
24914
|
-
return;
|
|
24915
|
-
}
|
|
24916
|
-
// ensure we've got a good round number :)
|
|
24917
|
-
let translateY = 0;
|
|
24918
|
-
let translateZ = 0;
|
|
24919
|
-
const { col, rotateFactor } = this;
|
|
24920
|
-
const prevSelected = col.selectedIndex;
|
|
24921
|
-
const selectedIndex = (col.selectedIndex = this.indexForY(-y));
|
|
24922
|
-
const durationStr = duration === 0 ? '' : duration + 'ms';
|
|
24923
|
-
const scaleStr = `scale(${this.scaleFactor})`;
|
|
24924
|
-
const children = this.optsEl.children;
|
|
24925
|
-
for (let i = 0; i < children.length; i++) {
|
|
24926
|
-
const button = children[i];
|
|
24927
|
-
const opt = col.options[i];
|
|
24928
|
-
const optOffset = i * this.optHeight + y;
|
|
24929
|
-
let transform = '';
|
|
24930
|
-
if (rotateFactor !== 0) {
|
|
24931
|
-
const rotateX = optOffset * rotateFactor;
|
|
24932
|
-
if (Math.abs(rotateX) <= 90) {
|
|
24933
|
-
translateY = 0;
|
|
24934
|
-
translateZ = 90;
|
|
24935
|
-
transform = `rotateX(${rotateX}deg) `;
|
|
24590
|
+
/**
|
|
24591
|
+
* If we have actionOnClick
|
|
24592
|
+
* then this means the user focused
|
|
24593
|
+
* a picker column via mouse or
|
|
24594
|
+
* touch (i.e. a PointerEvent). As a result,
|
|
24595
|
+
* we should not enter/exit input mode
|
|
24596
|
+
* until the click event has fired, which happens
|
|
24597
|
+
* after the `focusin` event.
|
|
24598
|
+
*
|
|
24599
|
+
* Otherwise, the user likely focused
|
|
24600
|
+
* the column using their keyboard and
|
|
24601
|
+
* we should enter/exit input mode automatically.
|
|
24602
|
+
*/
|
|
24603
|
+
if (!this.actionOnClick) {
|
|
24604
|
+
const columnEl = target;
|
|
24605
|
+
const allowInput = columnEl.numericInput;
|
|
24606
|
+
if (allowInput) {
|
|
24607
|
+
this.enterInputMode(columnEl, false);
|
|
24608
|
+
}
|
|
24609
|
+
else {
|
|
24610
|
+
this.exitInputMode();
|
|
24611
|
+
}
|
|
24612
|
+
}
|
|
24613
|
+
};
|
|
24614
|
+
/**
|
|
24615
|
+
* On click we need to run an actionOnClick
|
|
24616
|
+
* function that has been set in onPointerDown
|
|
24617
|
+
* so that we enter/exit input mode correctly.
|
|
24618
|
+
*/
|
|
24619
|
+
this.onClick = () => {
|
|
24620
|
+
const { actionOnClick } = this;
|
|
24621
|
+
if (actionOnClick) {
|
|
24622
|
+
actionOnClick();
|
|
24623
|
+
this.actionOnClick = undefined;
|
|
24624
|
+
}
|
|
24625
|
+
};
|
|
24626
|
+
/**
|
|
24627
|
+
* Clicking a column also focuses the column on
|
|
24628
|
+
* certain browsers, so we use onPointerDown
|
|
24629
|
+
* to tell the onFocusIn function that users
|
|
24630
|
+
* are trying to click the column rather than
|
|
24631
|
+
* focus the column using the keyboard. When the
|
|
24632
|
+
* user completes the click, the onClick function
|
|
24633
|
+
* runs and runs the actionOnClick callback.
|
|
24634
|
+
*/
|
|
24635
|
+
this.onPointerDown = (ev) => {
|
|
24636
|
+
const { useInputMode, inputModeColumn, el } = this;
|
|
24637
|
+
if (this.isInHighlightBounds(ev)) {
|
|
24638
|
+
/**
|
|
24639
|
+
* If we were already in
|
|
24640
|
+
* input mode, then we should determine
|
|
24641
|
+
* if we tapped a particular column and
|
|
24642
|
+
* should switch to input mode for
|
|
24643
|
+
* that specific column.
|
|
24644
|
+
*/
|
|
24645
|
+
if (useInputMode) {
|
|
24646
|
+
/**
|
|
24647
|
+
* If we tapped a picker column
|
|
24648
|
+
* then we should either switch to input
|
|
24649
|
+
* mode for that column or all columns.
|
|
24650
|
+
* Otherwise we should exit input mode
|
|
24651
|
+
* since we just tapped the highlight and
|
|
24652
|
+
* not a column.
|
|
24653
|
+
*/
|
|
24654
|
+
if (ev.target.tagName === 'ION-PICKER-COLUMN') {
|
|
24655
|
+
/**
|
|
24656
|
+
* If user taps 2 different columns
|
|
24657
|
+
* then we should just switch to input mode
|
|
24658
|
+
* for the new column rather than switching to
|
|
24659
|
+
* input mode for all columns.
|
|
24660
|
+
*/
|
|
24661
|
+
if (inputModeColumn && inputModeColumn === ev.target) {
|
|
24662
|
+
this.actionOnClick = () => {
|
|
24663
|
+
this.enterInputMode();
|
|
24664
|
+
};
|
|
24665
|
+
}
|
|
24666
|
+
else {
|
|
24667
|
+
this.actionOnClick = () => {
|
|
24668
|
+
this.enterInputMode(ev.target);
|
|
24669
|
+
};
|
|
24670
|
+
}
|
|
24671
|
+
}
|
|
24672
|
+
else {
|
|
24673
|
+
this.actionOnClick = () => {
|
|
24674
|
+
this.exitInputMode();
|
|
24675
|
+
};
|
|
24676
|
+
}
|
|
24677
|
+
/**
|
|
24678
|
+
* If we were not already in
|
|
24679
|
+
* input mode, then we should
|
|
24680
|
+
* enter input mode for all columns.
|
|
24681
|
+
*/
|
|
24936
24682
|
}
|
|
24937
24683
|
else {
|
|
24938
|
-
|
|
24684
|
+
/**
|
|
24685
|
+
* If there is only 1 numeric input column
|
|
24686
|
+
* then we should skip multi column input.
|
|
24687
|
+
*/
|
|
24688
|
+
const columns = el.querySelectorAll('ion-picker-column.picker-column-numeric-input');
|
|
24689
|
+
const columnEl = columns.length === 1 ? ev.target : undefined;
|
|
24690
|
+
this.actionOnClick = () => {
|
|
24691
|
+
this.enterInputMode(columnEl);
|
|
24692
|
+
};
|
|
24693
|
+
}
|
|
24694
|
+
return;
|
|
24695
|
+
}
|
|
24696
|
+
this.actionOnClick = () => {
|
|
24697
|
+
this.exitInputMode();
|
|
24698
|
+
};
|
|
24699
|
+
};
|
|
24700
|
+
/**
|
|
24701
|
+
* Enters input mode to allow
|
|
24702
|
+
* for text entry of numeric values.
|
|
24703
|
+
* If on mobile, we focus a hidden input
|
|
24704
|
+
* field so that the on screen keyboard
|
|
24705
|
+
* is brought up. When tabbing using a
|
|
24706
|
+
* keyboard, picker columns receive an outline
|
|
24707
|
+
* to indicate they are focused. As a result,
|
|
24708
|
+
* we should not focus the hidden input as it
|
|
24709
|
+
* would cause the outline to go away, preventing
|
|
24710
|
+
* users from having any visual indication of which
|
|
24711
|
+
* column is focused.
|
|
24712
|
+
*/
|
|
24713
|
+
this.enterInputMode = (columnEl, focusInput = true) => {
|
|
24714
|
+
const { inputEl, el } = this;
|
|
24715
|
+
if (!inputEl) {
|
|
24716
|
+
return;
|
|
24717
|
+
}
|
|
24718
|
+
/**
|
|
24719
|
+
* Only active input mode if there is at
|
|
24720
|
+
* least one column that accepts numeric input.
|
|
24721
|
+
*/
|
|
24722
|
+
const hasInputColumn = el.querySelector('ion-picker-column.picker-column-numeric-input');
|
|
24723
|
+
if (!hasInputColumn) {
|
|
24724
|
+
return;
|
|
24725
|
+
}
|
|
24726
|
+
/**
|
|
24727
|
+
* If columnEl is undefined then
|
|
24728
|
+
* it is assumed that all numeric pickers
|
|
24729
|
+
* are eligible for text entry.
|
|
24730
|
+
* (i.e. hour and minute columns)
|
|
24731
|
+
*/
|
|
24732
|
+
this.useInputMode = true;
|
|
24733
|
+
this.inputModeColumn = columnEl;
|
|
24734
|
+
/**
|
|
24735
|
+
* Users with a keyboard and mouse can
|
|
24736
|
+
* activate input mode where the input is
|
|
24737
|
+
* focused as well as when it is not focused,
|
|
24738
|
+
* so we need to make sure we clean up any
|
|
24739
|
+
* old listeners.
|
|
24740
|
+
*/
|
|
24741
|
+
if (focusInput) {
|
|
24742
|
+
if (this.destroyKeypressListener) {
|
|
24743
|
+
this.destroyKeypressListener();
|
|
24744
|
+
this.destroyKeypressListener = undefined;
|
|
24939
24745
|
}
|
|
24746
|
+
inputEl.focus();
|
|
24940
24747
|
}
|
|
24941
24748
|
else {
|
|
24942
|
-
|
|
24943
|
-
|
|
24749
|
+
el.addEventListener('keypress', this.onKeyPress);
|
|
24750
|
+
this.destroyKeypressListener = () => {
|
|
24751
|
+
el.removeEventListener('keypress', this.onKeyPress);
|
|
24752
|
+
};
|
|
24944
24753
|
}
|
|
24945
|
-
|
|
24946
|
-
|
|
24947
|
-
|
|
24948
|
-
|
|
24754
|
+
this.emitInputModeChange();
|
|
24755
|
+
};
|
|
24756
|
+
this.onKeyPress = (ev) => {
|
|
24757
|
+
const { inputEl } = this;
|
|
24758
|
+
if (!inputEl) {
|
|
24759
|
+
return;
|
|
24949
24760
|
}
|
|
24950
|
-
|
|
24951
|
-
|
|
24952
|
-
|
|
24953
|
-
|
|
24761
|
+
const parsedValue = parseInt(ev.key, 10);
|
|
24762
|
+
/**
|
|
24763
|
+
* Only numbers should be allowed
|
|
24764
|
+
*/
|
|
24765
|
+
if (!Number.isNaN(parsedValue)) {
|
|
24766
|
+
inputEl.value += ev.key;
|
|
24767
|
+
this.onInputChange();
|
|
24954
24768
|
}
|
|
24955
|
-
|
|
24956
|
-
|
|
24957
|
-
|
|
24769
|
+
};
|
|
24770
|
+
this.selectSingleColumn = () => {
|
|
24771
|
+
const { inputEl, inputModeColumn, singleColumnSearchTimeout } = this;
|
|
24772
|
+
if (!inputEl || !inputModeColumn) {
|
|
24773
|
+
return;
|
|
24958
24774
|
}
|
|
24959
|
-
|
|
24960
|
-
|
|
24961
|
-
|
|
24775
|
+
const options = Array.from(inputModeColumn.querySelectorAll('ion-picker-column-option')).filter((el) => el.disabled !== true);
|
|
24776
|
+
/**
|
|
24777
|
+
* If users pause for a bit, the search
|
|
24778
|
+
* value should be reset similar to how a
|
|
24779
|
+
* <select> behaves. So typing "34", waiting,
|
|
24780
|
+
* then typing "5" should select "05".
|
|
24781
|
+
*/
|
|
24782
|
+
if (singleColumnSearchTimeout) {
|
|
24783
|
+
clearTimeout(singleColumnSearchTimeout);
|
|
24962
24784
|
}
|
|
24963
|
-
|
|
24785
|
+
this.singleColumnSearchTimeout = setTimeout(() => {
|
|
24786
|
+
inputEl.value = '';
|
|
24787
|
+
this.singleColumnSearchTimeout = undefined;
|
|
24788
|
+
}, 1000);
|
|
24964
24789
|
/**
|
|
24965
|
-
*
|
|
24966
|
-
*
|
|
24790
|
+
* For values that are longer than 2 digits long
|
|
24791
|
+
* we should shift the value over 1 character
|
|
24792
|
+
* to the left. So typing "456" would result in "56".
|
|
24793
|
+
* TODO: If we want to support more than just
|
|
24794
|
+
* time entry, we should update this value to be
|
|
24795
|
+
* the max length of all of the picker items.
|
|
24967
24796
|
*/
|
|
24968
|
-
|
|
24969
|
-
|
|
24970
|
-
|
|
24797
|
+
if (inputEl.value.length >= 3) {
|
|
24798
|
+
const startIndex = inputEl.value.length - 2;
|
|
24799
|
+
const newString = inputEl.value.substring(startIndex);
|
|
24800
|
+
inputEl.value = newString;
|
|
24801
|
+
this.selectSingleColumn();
|
|
24802
|
+
return;
|
|
24971
24803
|
}
|
|
24972
|
-
|
|
24973
|
-
|
|
24804
|
+
/**
|
|
24805
|
+
* Checking the value of the input gets priority
|
|
24806
|
+
* first. For example, if the value of the input
|
|
24807
|
+
* is "1" and we entered "2", then the complete value
|
|
24808
|
+
* is "12" and we should select hour 12.
|
|
24809
|
+
*
|
|
24810
|
+
* Regex removes any leading zeros from values like "02",
|
|
24811
|
+
* but it keeps a single zero if there are only zeros in the string.
|
|
24812
|
+
* 0+(?=[1-9]) --> Match 1 or more zeros that are followed by 1-9
|
|
24813
|
+
* 0+(?=0$) --> Match 1 or more zeros that must be followed by one 0 and end.
|
|
24814
|
+
*/
|
|
24815
|
+
const findItemFromCompleteValue = options.find(({ textContent }) => {
|
|
24816
|
+
/**
|
|
24817
|
+
* Keyboard entry is currently only used inside of Datetime
|
|
24818
|
+
* where we guarantee textContent is set.
|
|
24819
|
+
* If we end up exposing this feature publicly we should revisit this assumption.
|
|
24820
|
+
*/
|
|
24821
|
+
const parsedText = textContent.replace(/^0+(?=[1-9])|0+(?=0$)/, '');
|
|
24822
|
+
return parsedText === inputEl.value;
|
|
24823
|
+
});
|
|
24824
|
+
if (findItemFromCompleteValue) {
|
|
24825
|
+
inputModeColumn.setValue(findItemFromCompleteValue.value);
|
|
24826
|
+
return;
|
|
24974
24827
|
}
|
|
24975
|
-
|
|
24976
|
-
|
|
24977
|
-
|
|
24978
|
-
|
|
24979
|
-
|
|
24980
|
-
|
|
24981
|
-
|
|
24982
|
-
|
|
24983
|
-
|
|
24984
|
-
}
|
|
24985
|
-
|
|
24986
|
-
|
|
24987
|
-
|
|
24988
|
-
|
|
24989
|
-
|
|
24990
|
-
|
|
24991
|
-
|
|
24992
|
-
|
|
24993
|
-
|
|
24994
|
-
|
|
24995
|
-
|
|
24996
|
-
|
|
24828
|
+
/**
|
|
24829
|
+
* If we typed "56" to get minute 56, then typed "7",
|
|
24830
|
+
* we should select "07" as "567" is not a valid minute.
|
|
24831
|
+
*/
|
|
24832
|
+
if (inputEl.value.length === 2) {
|
|
24833
|
+
const changedCharacter = inputEl.value.substring(inputEl.value.length - 1);
|
|
24834
|
+
inputEl.value = changedCharacter;
|
|
24835
|
+
this.selectSingleColumn();
|
|
24836
|
+
}
|
|
24837
|
+
};
|
|
24838
|
+
/**
|
|
24839
|
+
* Searches a list of column items for a particular
|
|
24840
|
+
* value. This is currently used for numeric values.
|
|
24841
|
+
* The zeroBehavior can be set to account for leading
|
|
24842
|
+
* or trailing zeros when looking at the item text.
|
|
24843
|
+
*/
|
|
24844
|
+
this.searchColumn = (colEl, value, zeroBehavior = 'start') => {
|
|
24845
|
+
const behavior = zeroBehavior === 'start' ? /^0+/ : /0$/;
|
|
24846
|
+
const option = Array.from(colEl.querySelectorAll('ion-picker-column-option')).find((el) => {
|
|
24847
|
+
return el.disabled !== true && el.textContent.replace(behavior, '') === value;
|
|
24848
|
+
});
|
|
24849
|
+
if (option) {
|
|
24850
|
+
colEl.setValue(option.value);
|
|
24851
|
+
}
|
|
24852
|
+
};
|
|
24853
|
+
this.selectMultiColumn = () => {
|
|
24854
|
+
const { inputEl, el } = this;
|
|
24855
|
+
if (!inputEl) {
|
|
24856
|
+
return;
|
|
24857
|
+
}
|
|
24858
|
+
const numericPickers = Array.from(el.querySelectorAll('ion-picker-column')).filter((col) => col.numericInput);
|
|
24859
|
+
const firstColumn = numericPickers[0];
|
|
24860
|
+
const lastColumn = numericPickers[1];
|
|
24861
|
+
let value = inputEl.value;
|
|
24862
|
+
let minuteValue;
|
|
24863
|
+
switch (value.length) {
|
|
24864
|
+
case 1:
|
|
24865
|
+
this.searchColumn(firstColumn, value);
|
|
24866
|
+
break;
|
|
24867
|
+
case 2:
|
|
24868
|
+
/**
|
|
24869
|
+
* If the first character is `0` or `1` it is
|
|
24870
|
+
* possible that users are trying to type `09`
|
|
24871
|
+
* or `11` into the hour field, so we should look
|
|
24872
|
+
* at that first.
|
|
24873
|
+
*/
|
|
24874
|
+
const firstCharacter = inputEl.value.substring(0, 1);
|
|
24875
|
+
value = firstCharacter === '0' || firstCharacter === '1' ? inputEl.value : firstCharacter;
|
|
24876
|
+
this.searchColumn(firstColumn, value);
|
|
24877
|
+
/**
|
|
24878
|
+
* If only checked the first value,
|
|
24879
|
+
* we can check the second value
|
|
24880
|
+
* for a match in the minutes column
|
|
24881
|
+
*/
|
|
24882
|
+
if (value.length === 1) {
|
|
24883
|
+
minuteValue = inputEl.value.substring(inputEl.value.length - 1);
|
|
24884
|
+
this.searchColumn(lastColumn, minuteValue, 'end');
|
|
24885
|
+
}
|
|
24886
|
+
break;
|
|
24887
|
+
case 3:
|
|
24888
|
+
/**
|
|
24889
|
+
* If the first character is `0` or `1` it is
|
|
24890
|
+
* possible that users are trying to type `09`
|
|
24891
|
+
* or `11` into the hour field, so we should look
|
|
24892
|
+
* at that first.
|
|
24893
|
+
*/
|
|
24894
|
+
const firstCharacterAgain = inputEl.value.substring(0, 1);
|
|
24895
|
+
value =
|
|
24896
|
+
firstCharacterAgain === '0' || firstCharacterAgain === '1'
|
|
24897
|
+
? inputEl.value.substring(0, 2)
|
|
24898
|
+
: firstCharacterAgain;
|
|
24899
|
+
this.searchColumn(firstColumn, value);
|
|
24900
|
+
/**
|
|
24901
|
+
* If only checked the first value,
|
|
24902
|
+
* we can check the second value
|
|
24903
|
+
* for a match in the minutes column
|
|
24904
|
+
*/
|
|
24905
|
+
minuteValue = value.length === 1 ? inputEl.value.substring(1) : inputEl.value.substring(2);
|
|
24906
|
+
this.searchColumn(lastColumn, minuteValue, 'end');
|
|
24907
|
+
break;
|
|
24908
|
+
case 4:
|
|
24909
|
+
/**
|
|
24910
|
+
* If the first character is `0` or `1` it is
|
|
24911
|
+
* possible that users are trying to type `09`
|
|
24912
|
+
* or `11` into the hour field, so we should look
|
|
24913
|
+
* at that first.
|
|
24914
|
+
*/
|
|
24915
|
+
const firstCharacterAgainAgain = inputEl.value.substring(0, 1);
|
|
24916
|
+
value =
|
|
24917
|
+
firstCharacterAgainAgain === '0' || firstCharacterAgainAgain === '1'
|
|
24918
|
+
? inputEl.value.substring(0, 2)
|
|
24919
|
+
: firstCharacterAgainAgain;
|
|
24920
|
+
this.searchColumn(firstColumn, value);
|
|
24921
|
+
/**
|
|
24922
|
+
* If only checked the first value,
|
|
24923
|
+
* we can check the second value
|
|
24924
|
+
* for a match in the minutes column
|
|
24925
|
+
*/
|
|
24926
|
+
const minuteValueAgain = value.length === 1
|
|
24927
|
+
? inputEl.value.substring(1, inputEl.value.length)
|
|
24928
|
+
: inputEl.value.substring(2, inputEl.value.length);
|
|
24929
|
+
this.searchColumn(lastColumn, minuteValueAgain, 'end');
|
|
24930
|
+
break;
|
|
24931
|
+
default:
|
|
24932
|
+
const startIndex = inputEl.value.length - 4;
|
|
24933
|
+
const newString = inputEl.value.substring(startIndex);
|
|
24934
|
+
inputEl.value = newString;
|
|
24935
|
+
this.selectMultiColumn();
|
|
24936
|
+
break;
|
|
24997
24937
|
}
|
|
24998
|
-
|
|
24999
|
-
|
|
25000
|
-
|
|
25001
|
-
|
|
24938
|
+
};
|
|
24939
|
+
/**
|
|
24940
|
+
* Searches the value of the active column
|
|
24941
|
+
* to determine which value users are trying
|
|
24942
|
+
* to select
|
|
24943
|
+
*/
|
|
24944
|
+
this.onInputChange = () => {
|
|
24945
|
+
const { useInputMode, inputEl, inputModeColumn } = this;
|
|
24946
|
+
if (!useInputMode || !inputEl) {
|
|
24947
|
+
return;
|
|
25002
24948
|
}
|
|
25003
|
-
|
|
25004
|
-
|
|
25005
|
-
if (notLockedIn) {
|
|
25006
|
-
// isn't locked in yet, keep decelerating until it is
|
|
25007
|
-
this.rafId = requestAnimationFrame(() => this.decelerate());
|
|
24949
|
+
if (inputModeColumn) {
|
|
24950
|
+
this.selectSingleColumn();
|
|
25008
24951
|
}
|
|
25009
24952
|
else {
|
|
25010
|
-
this.
|
|
25011
|
-
this.emitColChange();
|
|
25012
|
-
hapticSelectionEnd();
|
|
25013
|
-
}
|
|
25014
|
-
}
|
|
25015
|
-
else if (this.y % this.optHeight !== 0) {
|
|
25016
|
-
// needs to still get locked into a position so options line up
|
|
25017
|
-
const currentPos = Math.abs(this.y % this.optHeight);
|
|
25018
|
-
// create a velocity in the direction it needs to scroll
|
|
25019
|
-
this.velocity = currentPos > this.optHeight / 2 ? 1 : -1;
|
|
25020
|
-
this.decelerate();
|
|
25021
|
-
}
|
|
25022
|
-
}
|
|
25023
|
-
indexForY(y) {
|
|
25024
|
-
return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
|
|
25025
|
-
}
|
|
25026
|
-
onStart(detail) {
|
|
25027
|
-
// We have to prevent default in order to block scrolling under the picker
|
|
25028
|
-
// but we DO NOT have to stop propagation, since we still want
|
|
25029
|
-
// some "click" events to capture
|
|
25030
|
-
if (detail.event.cancelable) {
|
|
25031
|
-
detail.event.preventDefault();
|
|
25032
|
-
}
|
|
25033
|
-
detail.event.stopPropagation();
|
|
25034
|
-
hapticSelectionStart();
|
|
25035
|
-
// reset everything
|
|
25036
|
-
if (this.rafId !== undefined)
|
|
25037
|
-
cancelAnimationFrame(this.rafId);
|
|
25038
|
-
const options = this.col.options;
|
|
25039
|
-
let minY = options.length - 1;
|
|
25040
|
-
let maxY = 0;
|
|
25041
|
-
for (let i = 0; i < options.length; i++) {
|
|
25042
|
-
if (!options[i].disabled) {
|
|
25043
|
-
minY = Math.min(minY, i);
|
|
25044
|
-
maxY = Math.max(maxY, i);
|
|
24953
|
+
this.selectMultiColumn();
|
|
25045
24954
|
}
|
|
25046
|
-
}
|
|
25047
|
-
|
|
25048
|
-
|
|
24955
|
+
};
|
|
24956
|
+
/**
|
|
24957
|
+
* Emit ionInputModeChange. Picker columns
|
|
24958
|
+
* listen for this event to determine whether
|
|
24959
|
+
* or not their column is "active" for text input.
|
|
24960
|
+
*/
|
|
24961
|
+
this.emitInputModeChange = () => {
|
|
24962
|
+
const { useInputMode, inputModeColumn } = this;
|
|
24963
|
+
this.ionInputModeChange.emit({
|
|
24964
|
+
useInputMode,
|
|
24965
|
+
inputModeColumn,
|
|
24966
|
+
});
|
|
24967
|
+
};
|
|
25049
24968
|
}
|
|
25050
|
-
|
|
25051
|
-
|
|
25052
|
-
|
|
25053
|
-
|
|
25054
|
-
|
|
25055
|
-
|
|
25056
|
-
|
|
25057
|
-
|
|
25058
|
-
|
|
25059
|
-
|
|
25060
|
-
this.bounceFrom = y;
|
|
25061
|
-
}
|
|
25062
|
-
else if (y < this.maxY) {
|
|
25063
|
-
// scrolling down below scroll area
|
|
25064
|
-
y += Math.pow(this.maxY - y, 0.9);
|
|
25065
|
-
this.bounceFrom = y;
|
|
25066
|
-
}
|
|
25067
|
-
else {
|
|
25068
|
-
this.bounceFrom = 0;
|
|
25069
|
-
}
|
|
25070
|
-
this.update(y, 0, false);
|
|
24969
|
+
/**
|
|
24970
|
+
* When the picker is interacted with
|
|
24971
|
+
* we need to prevent touchstart so other
|
|
24972
|
+
* gestures do not fire. For example,
|
|
24973
|
+
* scrolling on the wheel picker
|
|
24974
|
+
* in ion-datetime should not cause
|
|
24975
|
+
* a card modal to swipe to close.
|
|
24976
|
+
*/
|
|
24977
|
+
preventTouchStartPropagation(ev) {
|
|
24978
|
+
ev.stopPropagation();
|
|
25071
24979
|
}
|
|
25072
|
-
|
|
25073
|
-
|
|
25074
|
-
|
|
25075
|
-
this.update(this.minY, 100, true);
|
|
25076
|
-
this.emitColChange();
|
|
25077
|
-
return;
|
|
25078
|
-
}
|
|
25079
|
-
else if (this.bounceFrom < 0) {
|
|
25080
|
-
// bounce back down
|
|
25081
|
-
this.update(this.maxY, 100, true);
|
|
25082
|
-
this.emitColChange();
|
|
25083
|
-
return;
|
|
25084
|
-
}
|
|
25085
|
-
this.velocity = clamp(-MAX_PICKER_SPEED, detail.velocityY * 23, MAX_PICKER_SPEED);
|
|
25086
|
-
if (this.velocity === 0 && detail.deltaY === 0) {
|
|
25087
|
-
const opt = detail.event.target.closest('.picker-opt');
|
|
25088
|
-
if (opt === null || opt === void 0 ? void 0 : opt.hasAttribute('opt-index')) {
|
|
25089
|
-
this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);
|
|
25090
|
-
}
|
|
25091
|
-
}
|
|
25092
|
-
else {
|
|
25093
|
-
this.y += detail.deltaY;
|
|
25094
|
-
if (Math.abs(detail.velocityY) < 0.05) {
|
|
25095
|
-
const isScrollingUp = detail.deltaY > 0;
|
|
25096
|
-
const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;
|
|
25097
|
-
if (isScrollingUp && optHeightFraction > 0.5) {
|
|
25098
|
-
this.velocity = Math.abs(this.velocity) * -1;
|
|
25099
|
-
}
|
|
25100
|
-
else if (!isScrollingUp && optHeightFraction <= 0.5) {
|
|
25101
|
-
this.velocity = Math.abs(this.velocity);
|
|
25102
|
-
}
|
|
25103
|
-
}
|
|
25104
|
-
this.decelerate();
|
|
25105
|
-
}
|
|
24980
|
+
componentWillLoad() {
|
|
24981
|
+
getElementRoot(this.el).addEventListener('focusin', this.onFocusIn);
|
|
24982
|
+
getElementRoot(this.el).addEventListener('focusout', this.onFocusOut);
|
|
25106
24983
|
}
|
|
25107
|
-
|
|
25108
|
-
|
|
25109
|
-
|
|
25110
|
-
|
|
25111
|
-
|
|
25112
|
-
|
|
25113
|
-
|
|
25114
|
-
|
|
25115
|
-
|
|
25116
|
-
}
|
|
25117
|
-
}
|
|
25118
|
-
/**
|
|
25119
|
-
* Only update selected value if column has a
|
|
25120
|
-
* velocity of 0. If it does not, then the
|
|
25121
|
-
* column is animating might land on
|
|
25122
|
-
* a value different than the value at
|
|
25123
|
-
* selectedIndex
|
|
25124
|
-
*/
|
|
25125
|
-
if (this.velocity !== 0) {
|
|
24984
|
+
/**
|
|
24985
|
+
* @internal
|
|
24986
|
+
* Exits text entry mode for the picker
|
|
24987
|
+
* This method blurs the hidden input
|
|
24988
|
+
* and cause the keyboard to dismiss.
|
|
24989
|
+
*/
|
|
24990
|
+
async exitInputMode() {
|
|
24991
|
+
const { inputEl, useInputMode } = this;
|
|
24992
|
+
if (!useInputMode || !inputEl) {
|
|
25126
24993
|
return;
|
|
25127
24994
|
}
|
|
25128
|
-
|
|
25129
|
-
|
|
25130
|
-
|
|
25131
|
-
|
|
25132
|
-
|
|
25133
|
-
this.
|
|
25134
|
-
|
|
25135
|
-
}
|
|
25136
|
-
onDomChange(forceRefresh, animated) {
|
|
25137
|
-
const colEl = this.optsEl;
|
|
25138
|
-
if (colEl) {
|
|
25139
|
-
// DOM READ
|
|
25140
|
-
// We perfom a DOM read over a rendered item, this needs to happen after the first render or after the the column has changed
|
|
25141
|
-
this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
|
|
24995
|
+
this.useInputMode = false;
|
|
24996
|
+
this.inputModeColumn = undefined;
|
|
24997
|
+
inputEl.blur();
|
|
24998
|
+
inputEl.value = '';
|
|
24999
|
+
if (this.destroyKeypressListener) {
|
|
25000
|
+
this.destroyKeypressListener();
|
|
25001
|
+
this.destroyKeypressListener = undefined;
|
|
25142
25002
|
}
|
|
25143
|
-
this.
|
|
25003
|
+
this.emitInputModeChange();
|
|
25144
25004
|
}
|
|
25145
25005
|
render() {
|
|
25146
|
-
|
|
25147
|
-
const mode = getIonMode$1(this);
|
|
25148
|
-
return (hAsync(Host, { class: Object.assign({ [mode]: true, 'picker-col': true, 'picker-opts-left': this.col.align === 'left', 'picker-opts-right': this.col.align === 'right' }, getClassMap(col.cssClass)), style: {
|
|
25149
|
-
'max-width': this.col.columnWidth,
|
|
25150
|
-
} }, col.prefix && (hAsync("div", { class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)), hAsync("div", { class: "picker-opts", style: { maxWidth: col.optionsWidth }, ref: (el) => (this.optsEl = el) }, col.options.map((o, index) => (hAsync("button", { "aria-label": o.ariaLabel, class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, "opt-index": index }, o.text)))), col.suffix && (hAsync("div", { class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix))));
|
|
25006
|
+
return (hAsync(Host, { onPointerDown: (ev) => this.onPointerDown(ev), onClick: () => this.onClick() }, hAsync("input", { "aria-hidden": "true", tabindex: -1, inputmode: "numeric", type: "number", ref: (el) => (this.inputEl = el), onInput: () => this.onInputChange(), onBlur: () => this.exitInputMode() }), hAsync("div", { class: "picker-before" }), hAsync("div", { class: "picker-after" }), hAsync("div", { class: "picker-highlight", ref: (el) => (this.highlightEl = el) }), hAsync("slot", null)));
|
|
25151
25007
|
}
|
|
25152
25008
|
get el() { return getElement(this); }
|
|
25153
|
-
static get watchers() { return {
|
|
25154
|
-
"col": ["colChanged"]
|
|
25155
|
-
}; }
|
|
25156
25009
|
static get style() { return {
|
|
25157
|
-
ios:
|
|
25158
|
-
md:
|
|
25010
|
+
ios: pickerIosCss$1,
|
|
25011
|
+
md: pickerMdCss$1
|
|
25159
25012
|
}; }
|
|
25160
25013
|
static get cmpMeta() { return {
|
|
25161
|
-
"$flags$":
|
|
25162
|
-
"$tagName$": "ion-picker
|
|
25014
|
+
"$flags$": 41,
|
|
25015
|
+
"$tagName$": "ion-picker",
|
|
25163
25016
|
"$members$": {
|
|
25164
|
-
"
|
|
25017
|
+
"exitInputMode": [64]
|
|
25165
25018
|
},
|
|
25166
|
-
"$listeners$":
|
|
25019
|
+
"$listeners$": [[1, "touchstart", "preventTouchStartPropagation"]],
|
|
25167
25020
|
"$lazyBundleId$": "-",
|
|
25168
25021
|
"$attrsToReflect$": []
|
|
25169
25022
|
}; }
|
|
25170
25023
|
}
|
|
25171
|
-
const PICKER_OPT_SELECTED = 'picker-opt-selected';
|
|
25172
|
-
const DECELERATION_FRICTION = 0.97;
|
|
25173
|
-
const MAX_PICKER_SPEED = 90;
|
|
25174
|
-
const TRANSITION_DURATION = 150;
|
|
25175
25024
|
|
|
25176
|
-
|
|
25025
|
+
/**
|
|
25026
|
+
* iOS Picker Enter Animation
|
|
25027
|
+
*/
|
|
25028
|
+
const iosEnterAnimation$2 = (baseEl) => {
|
|
25029
|
+
const baseAnimation = createAnimation();
|
|
25030
|
+
const backdropAnimation = createAnimation();
|
|
25031
|
+
const wrapperAnimation = createAnimation();
|
|
25032
|
+
backdropAnimation
|
|
25033
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
|
25034
|
+
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
|
25035
|
+
.beforeStyles({
|
|
25036
|
+
'pointer-events': 'none',
|
|
25037
|
+
})
|
|
25038
|
+
.afterClearStyles(['pointer-events']);
|
|
25039
|
+
wrapperAnimation
|
|
25040
|
+
.addElement(baseEl.querySelector('.picker-wrapper'))
|
|
25041
|
+
.fromTo('transform', 'translateY(100%)', 'translateY(0%)');
|
|
25042
|
+
return baseAnimation
|
|
25043
|
+
.addElement(baseEl)
|
|
25044
|
+
.easing('cubic-bezier(.36,.66,.04,1)')
|
|
25045
|
+
.duration(400)
|
|
25046
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
25047
|
+
};
|
|
25048
|
+
|
|
25049
|
+
/**
|
|
25050
|
+
* iOS Picker Leave Animation
|
|
25051
|
+
*/
|
|
25052
|
+
const iosLeaveAnimation$2 = (baseEl) => {
|
|
25053
|
+
const baseAnimation = createAnimation();
|
|
25054
|
+
const backdropAnimation = createAnimation();
|
|
25055
|
+
const wrapperAnimation = createAnimation();
|
|
25056
|
+
backdropAnimation
|
|
25057
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
|
25058
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 0.01);
|
|
25059
|
+
wrapperAnimation
|
|
25060
|
+
.addElement(baseEl.querySelector('.picker-wrapper'))
|
|
25061
|
+
.fromTo('transform', 'translateY(0%)', 'translateY(100%)');
|
|
25062
|
+
return baseAnimation
|
|
25063
|
+
.addElement(baseEl)
|
|
25064
|
+
.easing('cubic-bezier(.36,.66,.04,1)')
|
|
25065
|
+
.duration(400)
|
|
25066
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
25067
|
+
};
|
|
25068
|
+
|
|
25069
|
+
const pickerIosCss = ".sc-ion-picker-legacy-ios-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}@supports (inset-inline-start: 0){.sc-ion-picker-legacy-ios-h{inset-inline-start:0}}@supports not (inset-inline-start: 0){.sc-ion-picker-legacy-ios-h{left:0}[dir=rtl].sc-ion-picker-legacy-ios-h,[dir=rtl] .sc-ion-picker-legacy-ios-h{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.sc-ion-picker-legacy-ios-h:dir(rtl){left:unset;right:unset;right:0}}}.overlay-hidden.sc-ion-picker-legacy-ios-h{display:none}.picker-wrapper.sc-ion-picker-legacy-ios{border-radius:var(--border-radius);left:0;right:0;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}.picker-toolbar.sc-ion-picker-legacy-ios{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-legacy-ios{border:0;font-family:inherit}.picker-button.sc-ion-picker-legacy-ios:active,.picker-button.sc-ion-picker-legacy-ios:focus{outline:none}.picker-columns.sc-ion-picker-legacy-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;overflow:hidden}.picker-above-highlight.sc-ion-picker-legacy-ios,.picker-below-highlight.sc-ion-picker-legacy-ios{display:none;pointer-events:none}.sc-ion-picker-legacy-ios-h{--background:var(--ion-background-color, #fff);--border-width:1px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-legacy-ios{display:-ms-flexbox;display:flex;height:44px;border-bottom:0.55px solid var(--border-color)}.picker-toolbar-button.sc-ion-picker-legacy-ios{-ms-flex:1;flex:1;text-align:end}.picker-toolbar-button.sc-ion-picker-legacy-ios:last-child .picker-button.sc-ion-picker-legacy-ios{font-weight:600}.picker-toolbar-button.sc-ion-picker-legacy-ios:first-child{font-weight:normal;text-align:start}.picker-button.sc-ion-picker-legacy-ios,.picker-button.ion-activated.sc-ion-picker-legacy-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:1em;padding-inline-start:1em;-webkit-padding-end:1em;padding-inline-end:1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #3880ff);font-size:16px}.picker-columns.sc-ion-picker-legacy-ios{height:215px;-webkit-perspective:1000px;perspective:1000px}.picker-above-highlight.sc-ion-picker-legacy-ios{top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:81px;border-bottom:1px solid var(--border-color);background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to bottom, var(--background, var(--ion-background-color, #fff)) 20%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:10}@supports (inset-inline-start: 0){.picker-above-highlight.sc-ion-picker-legacy-ios{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-above-highlight.sc-ion-picker-legacy-ios{left:0}[dir=rtl].sc-ion-picker-legacy-ios-h .picker-above-highlight.sc-ion-picker-legacy-ios,[dir=rtl] .sc-ion-picker-legacy-ios-h .picker-above-highlight.sc-ion-picker-legacy-ios{left:unset;right:unset;right:0}[dir=rtl].sc-ion-picker-legacy-ios .picker-above-highlight.sc-ion-picker-legacy-ios{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-above-highlight.sc-ion-picker-legacy-ios:dir(rtl){left:unset;right:unset;right:0}}}.picker-below-highlight.sc-ion-picker-legacy-ios{top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:119px;border-top:1px solid var(--border-color);background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to top, var(--background, var(--ion-background-color, #fff)) 30%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:11}@supports (inset-inline-start: 0){.picker-below-highlight.sc-ion-picker-legacy-ios{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-below-highlight.sc-ion-picker-legacy-ios{left:0}[dir=rtl].sc-ion-picker-legacy-ios-h .picker-below-highlight.sc-ion-picker-legacy-ios,[dir=rtl] .sc-ion-picker-legacy-ios-h .picker-below-highlight.sc-ion-picker-legacy-ios{left:unset;right:unset;right:0}[dir=rtl].sc-ion-picker-legacy-ios .picker-below-highlight.sc-ion-picker-legacy-ios{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-below-highlight.sc-ion-picker-legacy-ios:dir(rtl){left:unset;right:unset;right:0}}}";
|
|
25177
25070
|
|
|
25178
|
-
const
|
|
25071
|
+
const pickerMdCss = ".sc-ion-picker-legacy-md-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}@supports (inset-inline-start: 0){.sc-ion-picker-legacy-md-h{inset-inline-start:0}}@supports not (inset-inline-start: 0){.sc-ion-picker-legacy-md-h{left:0}[dir=rtl].sc-ion-picker-legacy-md-h,[dir=rtl] .sc-ion-picker-legacy-md-h{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.sc-ion-picker-legacy-md-h:dir(rtl){left:unset;right:unset;right:0}}}.overlay-hidden.sc-ion-picker-legacy-md-h{display:none}.picker-wrapper.sc-ion-picker-legacy-md{border-radius:var(--border-radius);left:0;right:0;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}.picker-toolbar.sc-ion-picker-legacy-md{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-legacy-md{border:0;font-family:inherit}.picker-button.sc-ion-picker-legacy-md:active,.picker-button.sc-ion-picker-legacy-md:focus{outline:none}.picker-columns.sc-ion-picker-legacy-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;overflow:hidden}.picker-above-highlight.sc-ion-picker-legacy-md,.picker-below-highlight.sc-ion-picker-legacy-md{display:none;pointer-events:none}.sc-ion-picker-legacy-md-h{--background:var(--ion-background-color, #fff);--border-width:0.55px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-legacy-md{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;height:44px}.picker-button.sc-ion-picker-legacy-md,.picker-button.ion-activated.sc-ion-picker-legacy-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:1.1em;padding-inline-start:1.1em;-webkit-padding-end:1.1em;padding-inline-end:1.1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #3880ff);font-size:14px;font-weight:500;text-transform:uppercase;-webkit-box-shadow:none;box-shadow:none}.picker-columns.sc-ion-picker-legacy-md{height:216px;-webkit-perspective:1800px;perspective:1800px}.picker-above-highlight.sc-ion-picker-legacy-md{top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:81px;border-bottom:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to bottom, var(--ion-background-color, #fff) 20%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:10}@supports (inset-inline-start: 0){.picker-above-highlight.sc-ion-picker-legacy-md{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-above-highlight.sc-ion-picker-legacy-md{left:0}[dir=rtl].sc-ion-picker-legacy-md-h .picker-above-highlight.sc-ion-picker-legacy-md,[dir=rtl] .sc-ion-picker-legacy-md-h .picker-above-highlight.sc-ion-picker-legacy-md{left:unset;right:unset;right:0}[dir=rtl].sc-ion-picker-legacy-md .picker-above-highlight.sc-ion-picker-legacy-md{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-above-highlight.sc-ion-picker-legacy-md:dir(rtl){left:unset;right:unset;right:0}}}.picker-below-highlight.sc-ion-picker-legacy-md{top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:119px;border-top:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to top, var(--ion-background-color, #fff) 30%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:11}@supports (inset-inline-start: 0){.picker-below-highlight.sc-ion-picker-legacy-md{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-below-highlight.sc-ion-picker-legacy-md{left:0}[dir=rtl].sc-ion-picker-legacy-md-h .picker-below-highlight.sc-ion-picker-legacy-md,[dir=rtl] .sc-ion-picker-legacy-md-h .picker-below-highlight.sc-ion-picker-legacy-md{left:unset;right:unset;right:0}[dir=rtl].sc-ion-picker-legacy-md .picker-below-highlight.sc-ion-picker-legacy-md{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-below-highlight.sc-ion-picker-legacy-md:dir(rtl){left:unset;right:unset;right:0}}}";
|
|
25179
25072
|
|
|
25073
|
+
// TODO(FW-2832): types
|
|
25180
25074
|
/**
|
|
25181
25075
|
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
|
25182
|
-
* @internal
|
|
25183
25076
|
*/
|
|
25184
|
-
class
|
|
25077
|
+
class Picker {
|
|
25185
25078
|
constructor(hostRef) {
|
|
25186
25079
|
registerInstance(this, hostRef);
|
|
25187
|
-
this.
|
|
25188
|
-
this.
|
|
25189
|
-
this.
|
|
25190
|
-
this.
|
|
25191
|
-
this.
|
|
25192
|
-
|
|
25193
|
-
|
|
25194
|
-
|
|
25195
|
-
|
|
25196
|
-
|
|
25197
|
-
|
|
25198
|
-
|
|
25199
|
-
|
|
25200
|
-
* scroll callback. This is useful when the user manually
|
|
25201
|
-
* taps an item or types on the keyboard as both
|
|
25202
|
-
* of these can cause a scroll to occur.
|
|
25203
|
-
*/
|
|
25204
|
-
this.canExitInputMode = canExitInputMode;
|
|
25205
|
-
el.scroll({
|
|
25206
|
-
top,
|
|
25207
|
-
left: 0,
|
|
25208
|
-
behavior: smooth ? 'smooth' : undefined,
|
|
25209
|
-
});
|
|
25210
|
-
}
|
|
25211
|
-
}
|
|
25212
|
-
};
|
|
25213
|
-
this.setPickerItemActiveState = (item, isActive) => {
|
|
25214
|
-
if (isActive) {
|
|
25215
|
-
item.classList.add(PICKER_ITEM_ACTIVE_CLASS);
|
|
25216
|
-
item.part.add(PICKER_ITEM_ACTIVE_PART);
|
|
25217
|
-
}
|
|
25218
|
-
else {
|
|
25219
|
-
item.classList.remove(PICKER_ITEM_ACTIVE_CLASS);
|
|
25220
|
-
item.part.remove(PICKER_ITEM_ACTIVE_PART);
|
|
25221
|
-
}
|
|
25222
|
-
};
|
|
25223
|
-
/**
|
|
25224
|
-
* When ionInputModeChange is emitted, each column
|
|
25225
|
-
* needs to check if it is the one being made available
|
|
25226
|
-
* for text entry.
|
|
25227
|
-
*/
|
|
25228
|
-
this.inputModeChange = (ev) => {
|
|
25229
|
-
if (!this.numericInput) {
|
|
25230
|
-
return;
|
|
25231
|
-
}
|
|
25232
|
-
const { useInputMode, inputModeColumn } = ev.detail;
|
|
25233
|
-
/**
|
|
25234
|
-
* If inputModeColumn is undefined then this means
|
|
25235
|
-
* all numericInput columns are being selected.
|
|
25236
|
-
*/
|
|
25237
|
-
const isColumnActive = inputModeColumn === undefined || inputModeColumn === this.el;
|
|
25238
|
-
if (!useInputMode || !isColumnActive) {
|
|
25239
|
-
this.setInputModeActive(false);
|
|
25240
|
-
return;
|
|
25241
|
-
}
|
|
25242
|
-
this.setInputModeActive(true);
|
|
25080
|
+
this.didPresent = createEvent(this, "ionPickerDidPresent", 7);
|
|
25081
|
+
this.willPresent = createEvent(this, "ionPickerWillPresent", 7);
|
|
25082
|
+
this.willDismiss = createEvent(this, "ionPickerWillDismiss", 7);
|
|
25083
|
+
this.didDismiss = createEvent(this, "ionPickerDidDismiss", 7);
|
|
25084
|
+
this.didPresentShorthand = createEvent(this, "didPresent", 7);
|
|
25085
|
+
this.willPresentShorthand = createEvent(this, "willPresent", 7);
|
|
25086
|
+
this.willDismissShorthand = createEvent(this, "willDismiss", 7);
|
|
25087
|
+
this.didDismissShorthand = createEvent(this, "didDismiss", 7);
|
|
25088
|
+
this.delegateController = createDelegateController(this);
|
|
25089
|
+
this.lockController = createLockController();
|
|
25090
|
+
this.triggerController = createTriggerController();
|
|
25091
|
+
this.onBackdropTap = () => {
|
|
25092
|
+
this.dismiss(undefined, BACKDROP);
|
|
25243
25093
|
};
|
|
25244
|
-
|
|
25245
|
-
|
|
25246
|
-
|
|
25247
|
-
|
|
25248
|
-
|
|
25249
|
-
* whatever value was selected at the
|
|
25250
|
-
* start of the scroll interaction.
|
|
25251
|
-
*/
|
|
25252
|
-
this.setInputModeActive = (state) => {
|
|
25253
|
-
if (this.isScrolling) {
|
|
25254
|
-
this.scrollEndCallback = () => {
|
|
25255
|
-
this.isActive = state;
|
|
25256
|
-
};
|
|
25257
|
-
return;
|
|
25094
|
+
this.dispatchCancelHandler = (ev) => {
|
|
25095
|
+
const role = ev.detail.role;
|
|
25096
|
+
if (isCancel(role)) {
|
|
25097
|
+
const cancelButton = this.buttons.find((b) => b.role === 'cancel');
|
|
25098
|
+
this.callButtonHandler(cancelButton);
|
|
25258
25099
|
}
|
|
25259
|
-
this.isActive = state;
|
|
25260
|
-
};
|
|
25261
|
-
/**
|
|
25262
|
-
* When the column scrolls, the component
|
|
25263
|
-
* needs to determine which item is centered
|
|
25264
|
-
* in the view and will emit an ionChange with
|
|
25265
|
-
* the item object.
|
|
25266
|
-
*/
|
|
25267
|
-
this.initializeScrollListener = () => {
|
|
25268
|
-
/**
|
|
25269
|
-
* The haptics for the wheel picker are
|
|
25270
|
-
* an iOS-only feature. As a result, they should
|
|
25271
|
-
* be disabled on Android.
|
|
25272
|
-
*/
|
|
25273
|
-
const enableHaptics = isPlatform('ios');
|
|
25274
|
-
const { el } = this;
|
|
25275
|
-
let timeout;
|
|
25276
|
-
let activeEl = this.activeItem;
|
|
25277
|
-
const scrollCallback = () => {
|
|
25278
|
-
raf(() => {
|
|
25279
|
-
if (timeout) {
|
|
25280
|
-
clearTimeout(timeout);
|
|
25281
|
-
timeout = undefined;
|
|
25282
|
-
}
|
|
25283
|
-
if (!this.isScrolling) {
|
|
25284
|
-
enableHaptics && hapticSelectionStart();
|
|
25285
|
-
this.isScrolling = true;
|
|
25286
|
-
}
|
|
25287
|
-
/**
|
|
25288
|
-
* Select item in the center of the column
|
|
25289
|
-
* which is the month/year that we want to select
|
|
25290
|
-
*/
|
|
25291
|
-
const bbox = el.getBoundingClientRect();
|
|
25292
|
-
const centerX = bbox.x + bbox.width / 2;
|
|
25293
|
-
const centerY = bbox.y + bbox.height / 2;
|
|
25294
|
-
const activeElement = el.shadowRoot.elementFromPoint(centerX, centerY);
|
|
25295
|
-
if (activeEl !== null) {
|
|
25296
|
-
this.setPickerItemActiveState(activeEl, false);
|
|
25297
|
-
}
|
|
25298
|
-
if (activeElement === null || activeElement.disabled) {
|
|
25299
|
-
return;
|
|
25300
|
-
}
|
|
25301
|
-
/**
|
|
25302
|
-
* If we are selecting a new value,
|
|
25303
|
-
* we need to run haptics again.
|
|
25304
|
-
*/
|
|
25305
|
-
if (activeElement !== activeEl) {
|
|
25306
|
-
enableHaptics && hapticSelectionChanged();
|
|
25307
|
-
if (this.canExitInputMode) {
|
|
25308
|
-
/**
|
|
25309
|
-
* The native iOS wheel picker
|
|
25310
|
-
* only dismisses the keyboard
|
|
25311
|
-
* once the selected item has changed
|
|
25312
|
-
* as a result of a swipe
|
|
25313
|
-
* from the user. If `canExitInputMode` is
|
|
25314
|
-
* `false` then this means that the
|
|
25315
|
-
* scroll is happening as a result of
|
|
25316
|
-
* the `value` property programmatically changing
|
|
25317
|
-
* either by an application or by the user via the keyboard.
|
|
25318
|
-
*/
|
|
25319
|
-
this.exitInputMode();
|
|
25320
|
-
}
|
|
25321
|
-
}
|
|
25322
|
-
activeEl = activeElement;
|
|
25323
|
-
this.setPickerItemActiveState(activeElement, true);
|
|
25324
|
-
timeout = setTimeout(() => {
|
|
25325
|
-
this.isScrolling = false;
|
|
25326
|
-
enableHaptics && hapticSelectionEnd();
|
|
25327
|
-
/**
|
|
25328
|
-
* Certain tasks (such as those that
|
|
25329
|
-
* cause re-renders) should only be done
|
|
25330
|
-
* once scrolling has finished, otherwise
|
|
25331
|
-
* flickering may occur.
|
|
25332
|
-
*/
|
|
25333
|
-
const { scrollEndCallback } = this;
|
|
25334
|
-
if (scrollEndCallback) {
|
|
25335
|
-
scrollEndCallback();
|
|
25336
|
-
this.scrollEndCallback = undefined;
|
|
25337
|
-
}
|
|
25338
|
-
/**
|
|
25339
|
-
* Reset this flag as the
|
|
25340
|
-
* next scroll interaction could
|
|
25341
|
-
* be a scroll from the user. In this
|
|
25342
|
-
* case, we should exit input mode.
|
|
25343
|
-
*/
|
|
25344
|
-
this.canExitInputMode = true;
|
|
25345
|
-
const dataIndex = activeElement.getAttribute('data-index');
|
|
25346
|
-
/**
|
|
25347
|
-
* If no value it is
|
|
25348
|
-
* possible we hit one of the
|
|
25349
|
-
* empty padding columns.
|
|
25350
|
-
*/
|
|
25351
|
-
if (dataIndex === null) {
|
|
25352
|
-
return;
|
|
25353
|
-
}
|
|
25354
|
-
const index = parseInt(dataIndex, 10);
|
|
25355
|
-
const selectedItem = this.items[index];
|
|
25356
|
-
if (selectedItem.value !== this.value) {
|
|
25357
|
-
this.setValue(selectedItem.value);
|
|
25358
|
-
}
|
|
25359
|
-
}, 250);
|
|
25360
|
-
});
|
|
25361
|
-
};
|
|
25362
|
-
/**
|
|
25363
|
-
* Wrap this in an raf so that the scroll callback
|
|
25364
|
-
* does not fire when component is initially shown.
|
|
25365
|
-
*/
|
|
25366
|
-
raf(() => {
|
|
25367
|
-
el.addEventListener('scroll', scrollCallback);
|
|
25368
|
-
this.destroyScrollListener = () => {
|
|
25369
|
-
el.removeEventListener('scroll', scrollCallback);
|
|
25370
|
-
};
|
|
25371
|
-
});
|
|
25372
25100
|
};
|
|
25101
|
+
this.presented = false;
|
|
25102
|
+
this.overlayIndex = undefined;
|
|
25103
|
+
this.delegate = undefined;
|
|
25104
|
+
this.hasController = false;
|
|
25105
|
+
this.keyboardClose = true;
|
|
25106
|
+
this.enterAnimation = undefined;
|
|
25107
|
+
this.leaveAnimation = undefined;
|
|
25108
|
+
this.buttons = [];
|
|
25109
|
+
this.columns = [];
|
|
25110
|
+
this.cssClass = undefined;
|
|
25111
|
+
this.duration = 0;
|
|
25112
|
+
this.showBackdrop = true;
|
|
25113
|
+
this.backdropDismiss = true;
|
|
25114
|
+
this.animated = true;
|
|
25115
|
+
this.htmlAttributes = undefined;
|
|
25116
|
+
this.isOpen = false;
|
|
25117
|
+
this.trigger = undefined;
|
|
25118
|
+
}
|
|
25119
|
+
onIsOpenChange(newValue, oldValue) {
|
|
25120
|
+
if (newValue === true && oldValue === false) {
|
|
25121
|
+
this.present();
|
|
25122
|
+
}
|
|
25123
|
+
else if (newValue === false && oldValue === true) {
|
|
25124
|
+
this.dismiss();
|
|
25125
|
+
}
|
|
25126
|
+
}
|
|
25127
|
+
triggerChanged() {
|
|
25128
|
+
const { trigger, el, triggerController } = this;
|
|
25129
|
+
if (trigger) {
|
|
25130
|
+
triggerController.addClickListener(el, trigger);
|
|
25131
|
+
}
|
|
25132
|
+
}
|
|
25133
|
+
connectedCallback() {
|
|
25134
|
+
prepareOverlay(this.el);
|
|
25135
|
+
this.triggerChanged();
|
|
25136
|
+
}
|
|
25137
|
+
disconnectedCallback() {
|
|
25138
|
+
this.triggerController.removeClickListener();
|
|
25139
|
+
}
|
|
25140
|
+
componentWillLoad() {
|
|
25141
|
+
setOverlayId(this.el);
|
|
25142
|
+
}
|
|
25143
|
+
componentDidLoad() {
|
|
25144
|
+
printIonWarning('ion-picker-legacy and ion-picker-legacy-column have been deprecated in favor of new versions of the ion-picker and ion-picker-column components. These new components display inline with your page content allowing for more presentation flexibility than before.', this.el);
|
|
25373
25145
|
/**
|
|
25374
|
-
*
|
|
25375
|
-
*
|
|
25376
|
-
* when the selected item changes during scroll, so
|
|
25377
|
-
* we know that the user likely wants to scroll
|
|
25378
|
-
* instead of type.
|
|
25146
|
+
* If picker was rendered with isOpen="true"
|
|
25147
|
+
* then we should open picker immediately.
|
|
25379
25148
|
*/
|
|
25380
|
-
this.
|
|
25381
|
-
|
|
25382
|
-
if (parentEl == null)
|
|
25383
|
-
return;
|
|
25384
|
-
parentEl.exitInputMode();
|
|
25385
|
-
/**
|
|
25386
|
-
* setInputModeActive only takes
|
|
25387
|
-
* effect once scrolling stops to avoid
|
|
25388
|
-
* a component re-render while scrolling.
|
|
25389
|
-
* However, we want the visual active
|
|
25390
|
-
* indicator to go away immediately, so
|
|
25391
|
-
* we call classList.remove here.
|
|
25392
|
-
*/
|
|
25393
|
-
this.el.classList.remove('picker-column-active');
|
|
25394
|
-
};
|
|
25395
|
-
this.isActive = false;
|
|
25396
|
-
this.disabled = false;
|
|
25397
|
-
this.items = [];
|
|
25398
|
-
this.value = undefined;
|
|
25399
|
-
this.color = 'primary';
|
|
25400
|
-
this.numericInput = false;
|
|
25401
|
-
}
|
|
25402
|
-
valueChange() {
|
|
25403
|
-
if (this.isColumnVisible) {
|
|
25404
|
-
/**
|
|
25405
|
-
* Only scroll the active item into view when the picker column
|
|
25406
|
-
* is actively visible to the user.
|
|
25407
|
-
*/
|
|
25408
|
-
this.scrollActiveItemIntoView();
|
|
25149
|
+
if (this.isOpen === true) {
|
|
25150
|
+
raf(() => this.present());
|
|
25409
25151
|
}
|
|
25410
25152
|
}
|
|
25411
25153
|
/**
|
|
25412
|
-
*
|
|
25413
|
-
* when the picker is visible, otherwise
|
|
25414
|
-
* the container will have a scroll
|
|
25415
|
-
* height of 0px.
|
|
25154
|
+
* Present the picker overlay after it has been created.
|
|
25416
25155
|
*/
|
|
25417
|
-
|
|
25418
|
-
const
|
|
25419
|
-
|
|
25420
|
-
|
|
25421
|
-
|
|
25422
|
-
|
|
25423
|
-
/**
|
|
25424
|
-
* Because this initial call to scrollActiveItemIntoView has to fire before
|
|
25425
|
-
* the scroll listener is set up, we need to manage the active class manually.
|
|
25426
|
-
*/
|
|
25427
|
-
const oldActive = getElementRoot(el).querySelector(`.${PICKER_ITEM_ACTIVE_CLASS}`);
|
|
25428
|
-
if (oldActive) {
|
|
25429
|
-
this.setPickerItemActiveState(oldActive, false);
|
|
25430
|
-
}
|
|
25431
|
-
this.scrollActiveItemIntoView();
|
|
25432
|
-
if (activeItem) {
|
|
25433
|
-
this.setPickerItemActiveState(activeItem, true);
|
|
25434
|
-
}
|
|
25435
|
-
this.initializeScrollListener();
|
|
25436
|
-
}
|
|
25437
|
-
else {
|
|
25438
|
-
this.isColumnVisible = false;
|
|
25439
|
-
if (this.destroyScrollListener) {
|
|
25440
|
-
this.destroyScrollListener();
|
|
25441
|
-
this.destroyScrollListener = undefined;
|
|
25442
|
-
}
|
|
25443
|
-
}
|
|
25444
|
-
};
|
|
25445
|
-
new IntersectionObserver(visibleCallback, { threshold: 0.001 }).observe(this.el);
|
|
25446
|
-
const parentEl = (this.parentEl = this.el.closest('ion-picker-internal'));
|
|
25447
|
-
if (parentEl !== null) {
|
|
25448
|
-
// TODO(FW-2832): type
|
|
25449
|
-
parentEl.addEventListener('ionInputModeChange', (ev) => this.inputModeChange(ev));
|
|
25156
|
+
async present() {
|
|
25157
|
+
const unlock = await this.lockController.lock();
|
|
25158
|
+
await this.delegateController.attachViewToDom();
|
|
25159
|
+
await present(this, 'pickerEnter', iosEnterAnimation$2, iosEnterAnimation$2, undefined);
|
|
25160
|
+
if (this.duration > 0) {
|
|
25161
|
+
this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
|
|
25450
25162
|
}
|
|
25163
|
+
unlock();
|
|
25451
25164
|
}
|
|
25452
|
-
|
|
25453
|
-
|
|
25454
|
-
|
|
25455
|
-
|
|
25456
|
-
|
|
25457
|
-
|
|
25458
|
-
|
|
25459
|
-
|
|
25460
|
-
|
|
25461
|
-
|
|
25462
|
-
|
|
25463
|
-
|
|
25464
|
-
|
|
25465
|
-
*
|
|
25466
|
-
*/
|
|
25467
|
-
this.setValue(items[0].value);
|
|
25468
|
-
}
|
|
25165
|
+
/**
|
|
25166
|
+
* Dismiss the picker overlay after it has been presented.
|
|
25167
|
+
*
|
|
25168
|
+
* @param data Any data to emit in the dismiss events.
|
|
25169
|
+
* @param role The role of the element that is dismissing the picker.
|
|
25170
|
+
* This can be useful in a button handler for determining which button was
|
|
25171
|
+
* clicked to dismiss the picker.
|
|
25172
|
+
* Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
|
|
25173
|
+
*/
|
|
25174
|
+
async dismiss(data, role) {
|
|
25175
|
+
const unlock = await this.lockController.lock();
|
|
25176
|
+
if (this.durationTimeout) {
|
|
25177
|
+
clearTimeout(this.durationTimeout);
|
|
25469
25178
|
}
|
|
25470
|
-
|
|
25471
|
-
|
|
25472
|
-
|
|
25473
|
-
const activeEl = this.activeItem;
|
|
25474
|
-
if (activeEl) {
|
|
25475
|
-
this.centerPickerItemInView(activeEl, false, false);
|
|
25179
|
+
const dismissed = await dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation$2, iosLeaveAnimation$2);
|
|
25180
|
+
if (dismissed) {
|
|
25181
|
+
this.delegateController.removeViewFromDom();
|
|
25476
25182
|
}
|
|
25183
|
+
unlock();
|
|
25184
|
+
return dismissed;
|
|
25477
25185
|
}
|
|
25478
25186
|
/**
|
|
25479
|
-
*
|
|
25480
|
-
* This is used when we need to fire ionChange from
|
|
25481
|
-
* user-generated events that cannot be caught with normal
|
|
25482
|
-
* input/change event listeners.
|
|
25483
|
-
* @internal
|
|
25187
|
+
* Returns a promise that resolves when the picker did dismiss.
|
|
25484
25188
|
*/
|
|
25485
|
-
|
|
25486
|
-
|
|
25487
|
-
|
|
25488
|
-
|
|
25489
|
-
|
|
25490
|
-
|
|
25189
|
+
onDidDismiss() {
|
|
25190
|
+
return eventMethod(this.el, 'ionPickerDidDismiss');
|
|
25191
|
+
}
|
|
25192
|
+
/**
|
|
25193
|
+
* Returns a promise that resolves when the picker will dismiss.
|
|
25194
|
+
*/
|
|
25195
|
+
onWillDismiss() {
|
|
25196
|
+
return eventMethod(this.el, 'ionPickerWillDismiss');
|
|
25197
|
+
}
|
|
25198
|
+
/**
|
|
25199
|
+
* Get the column that matches the specified name.
|
|
25200
|
+
*
|
|
25201
|
+
* @param name The name of the column.
|
|
25202
|
+
*/
|
|
25203
|
+
getColumn(name) {
|
|
25204
|
+
return Promise.resolve(this.columns.find((column) => column.name === name));
|
|
25205
|
+
}
|
|
25206
|
+
async buttonClick(button) {
|
|
25207
|
+
const role = button.role;
|
|
25208
|
+
if (isCancel(role)) {
|
|
25209
|
+
return this.dismiss(undefined, role);
|
|
25210
|
+
}
|
|
25211
|
+
const shouldDismiss = await this.callButtonHandler(button);
|
|
25212
|
+
if (shouldDismiss) {
|
|
25213
|
+
return this.dismiss(this.getSelected(), button.role);
|
|
25491
25214
|
}
|
|
25215
|
+
return Promise.resolve();
|
|
25492
25216
|
}
|
|
25493
|
-
|
|
25494
|
-
|
|
25495
|
-
|
|
25496
|
-
|
|
25497
|
-
|
|
25217
|
+
async callButtonHandler(button) {
|
|
25218
|
+
if (button) {
|
|
25219
|
+
// a handler has been provided, execute it
|
|
25220
|
+
// pass the handler the values from the inputs
|
|
25221
|
+
const rtn = await safeCall(button.handler, this.getSelected());
|
|
25222
|
+
if (rtn === false) {
|
|
25223
|
+
// if the return value of the handler is false then do not dismiss
|
|
25224
|
+
return false;
|
|
25225
|
+
}
|
|
25226
|
+
}
|
|
25227
|
+
return true;
|
|
25228
|
+
}
|
|
25229
|
+
getSelected() {
|
|
25230
|
+
const selected = {};
|
|
25231
|
+
this.columns.forEach((col, index) => {
|
|
25232
|
+
const selectedColumn = col.selectedIndex !== undefined ? col.options[col.selectedIndex] : undefined;
|
|
25233
|
+
selected[col.name] = {
|
|
25234
|
+
text: selectedColumn ? selectedColumn.text : undefined,
|
|
25235
|
+
value: selectedColumn ? selectedColumn.value : undefined,
|
|
25236
|
+
columnIndex: index,
|
|
25237
|
+
};
|
|
25238
|
+
});
|
|
25239
|
+
return selected;
|
|
25498
25240
|
}
|
|
25499
25241
|
render() {
|
|
25500
|
-
const {
|
|
25242
|
+
const { htmlAttributes } = this;
|
|
25501
25243
|
const mode = getIonMode$1(this);
|
|
25502
|
-
|
|
25503
|
-
|
|
25504
|
-
|
|
25505
|
-
|
|
25506
|
-
|
|
25507
|
-
*/
|
|
25508
|
-
return (hAsync(Host, { exportparts: `${PICKER_ITEM_PART}, ${PICKER_ITEM_ACTIVE_PART}`, disabled: pickerDisabled, tabindex: pickerDisabled ? null : 0, class: createColorClasses$1(color, {
|
|
25509
|
-
[mode]: true,
|
|
25510
|
-
['picker-column-active']: isActive,
|
|
25511
|
-
['picker-column-numeric-input']: numericInput,
|
|
25512
|
-
}) }, hAsync("div", { class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), items.map((item, index) => {
|
|
25513
|
-
const isItemDisabled = pickerDisabled || item.disabled || false;
|
|
25514
|
-
return (hAsync("button", { tabindex: "-1", class: {
|
|
25515
|
-
'picker-item': true,
|
|
25516
|
-
}, "data-value": item.value, "data-index": index, onClick: (ev) => {
|
|
25517
|
-
this.centerPickerItemInView(ev.target, true);
|
|
25518
|
-
}, disabled: isItemDisabled, part: PICKER_ITEM_PART }, item.text));
|
|
25519
|
-
}), hAsync("div", { class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0")));
|
|
25244
|
+
return (hAsync(Host, Object.assign({ "aria-modal": "true", tabindex: "-1" }, htmlAttributes, { style: {
|
|
25245
|
+
zIndex: `${20000 + this.overlayIndex}`,
|
|
25246
|
+
}, class: Object.assign({ [mode]: true,
|
|
25247
|
+
// Used internally for styling
|
|
25248
|
+
[`picker-${mode}`]: true, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), hAsync("ion-backdrop", { visible: this.showBackdrop, tappable: this.backdropDismiss }), hAsync("div", { tabindex: "0" }), hAsync("div", { class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, hAsync("div", { class: "picker-toolbar" }, this.buttons.map((b) => (hAsync("div", { class: buttonWrapperClass(b) }, hAsync("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass$1(b) }, b.text))))), hAsync("div", { class: "picker-columns" }, hAsync("div", { class: "picker-above-highlight" }), this.presented && this.columns.map((c) => hAsync("ion-picker-legacy-column", { col: c })), hAsync("div", { class: "picker-below-highlight" }))), hAsync("div", { tabindex: "0" })));
|
|
25520
25249
|
}
|
|
25521
25250
|
get el() { return getElement(this); }
|
|
25522
25251
|
static get watchers() { return {
|
|
25523
|
-
"
|
|
25252
|
+
"isOpen": ["onIsOpenChange"],
|
|
25253
|
+
"trigger": ["triggerChanged"]
|
|
25524
25254
|
}; }
|
|
25525
25255
|
static get style() { return {
|
|
25526
|
-
ios:
|
|
25527
|
-
md:
|
|
25256
|
+
ios: pickerIosCss,
|
|
25257
|
+
md: pickerMdCss
|
|
25528
25258
|
}; }
|
|
25529
25259
|
static get cmpMeta() { return {
|
|
25530
|
-
"$flags$":
|
|
25531
|
-
"$tagName$": "ion-picker-
|
|
25260
|
+
"$flags$": 34,
|
|
25261
|
+
"$tagName$": "ion-picker-legacy",
|
|
25532
25262
|
"$members$": {
|
|
25533
|
-
"
|
|
25534
|
-
"
|
|
25535
|
-
"
|
|
25536
|
-
"
|
|
25537
|
-
"
|
|
25538
|
-
"
|
|
25539
|
-
"
|
|
25540
|
-
"
|
|
25263
|
+
"overlayIndex": [2, "overlay-index"],
|
|
25264
|
+
"delegate": [16],
|
|
25265
|
+
"hasController": [4, "has-controller"],
|
|
25266
|
+
"keyboardClose": [4, "keyboard-close"],
|
|
25267
|
+
"enterAnimation": [16],
|
|
25268
|
+
"leaveAnimation": [16],
|
|
25269
|
+
"buttons": [16],
|
|
25270
|
+
"columns": [16],
|
|
25271
|
+
"cssClass": [1, "css-class"],
|
|
25272
|
+
"duration": [2],
|
|
25273
|
+
"showBackdrop": [4, "show-backdrop"],
|
|
25274
|
+
"backdropDismiss": [4, "backdrop-dismiss"],
|
|
25275
|
+
"animated": [4],
|
|
25276
|
+
"htmlAttributes": [16],
|
|
25277
|
+
"isOpen": [4, "is-open"],
|
|
25278
|
+
"trigger": [1],
|
|
25279
|
+
"presented": [32],
|
|
25280
|
+
"present": [64],
|
|
25281
|
+
"dismiss": [64],
|
|
25282
|
+
"onDidDismiss": [64],
|
|
25283
|
+
"onWillDismiss": [64],
|
|
25284
|
+
"getColumn": [64]
|
|
25541
25285
|
},
|
|
25542
25286
|
"$listeners$": undefined,
|
|
25543
25287
|
"$lazyBundleId$": "-",
|
|
25544
|
-
"$attrsToReflect$": [
|
|
25288
|
+
"$attrsToReflect$": []
|
|
25545
25289
|
}; }
|
|
25546
25290
|
}
|
|
25547
|
-
const
|
|
25548
|
-
|
|
25549
|
-
|
|
25550
|
-
|
|
25551
|
-
|
|
25552
|
-
|
|
25553
|
-
const
|
|
25554
|
-
|
|
25555
|
-
|
|
25556
|
-
|
|
25557
|
-
|
|
25558
|
-
|
|
25559
|
-
|
|
25560
|
-
|
|
25561
|
-
|
|
25562
|
-
|
|
25563
|
-
|
|
25564
|
-
|
|
25565
|
-
|
|
25566
|
-
|
|
25567
|
-
|
|
25568
|
-
|
|
25569
|
-
|
|
25570
|
-
|
|
25571
|
-
|
|
25572
|
-
|
|
25573
|
-
|
|
25574
|
-
|
|
25575
|
-
|
|
25576
|
-
|
|
25577
|
-
|
|
25291
|
+
const buttonWrapperClass = (button) => {
|
|
25292
|
+
return {
|
|
25293
|
+
[`picker-toolbar-${button.role}`]: button.role !== undefined,
|
|
25294
|
+
'picker-toolbar-button': true,
|
|
25295
|
+
};
|
|
25296
|
+
};
|
|
25297
|
+
const buttonClass$1 = (button) => {
|
|
25298
|
+
return Object.assign({ 'picker-button': true, 'ion-activatable': true }, getClassMap(button.cssClass));
|
|
25299
|
+
};
|
|
25300
|
+
|
|
25301
|
+
const pickerColumnCss = "/*!@:host*/.sc-ion-picker-column-h{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;max-width:100%;height:200px;font-size:22px;text-align:center}/*!@.picker-opts*/.picker-opts.sc-ion-picker-column{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-width:26px;max-height:200px;outline:none;text-align:inherit;-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory;overflow-x:hidden;overflow-y:scroll;scrollbar-width:none}/*!@.picker-item-empty*/.picker-item-empty.sc-ion-picker-column{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}/*!@.picker-opts::-webkit-scrollbar*/.picker-opts.sc-ion-picker-column::-webkit-scrollbar{display:none}/*!@::slotted(ion-picker-column-option)*/.sc-ion-picker-column-s>ion-picker-column-option{display:block;scroll-snap-align:center}/*!@.picker-item-empty,\n:host(:not([disabled])) ::slotted(ion-picker-column-option.option-disabled)*/.picker-item-empty.sc-ion-picker-column,.sc-ion-picker-column-h:not([disabled]).sc-ion-picker-column-s>ion-picker-column-option.option-disabled,.sc-ion-picker-column-h:not([disabled]) .sc-ion-picker-column-s>ion-picker-column-option.option-disabled{scroll-snap-align:none}/*!@::slotted([slot=prefix]), ::slotted([slot=suffix])*/.sc-ion-picker-column-s>[slot=prefix],.sc-ion-picker-column-s>[slot=suffix]{max-width:200px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}/*!@::slotted([slot=prefix])*/.sc-ion-picker-column-s>[slot=prefix]{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0;padding-bottom:0;-ms-flex-pack:end;justify-content:end}/*!@::slotted([slot=suffix])*/.sc-ion-picker-column-s>[slot=suffix]{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0;padding-bottom:0;-ms-flex-pack:start;justify-content:start}/*!@:host(.picker-column-disabled) .picker-opts*/.picker-column-disabled.sc-ion-picker-column-h .picker-opts.sc-ion-picker-column{overflow-y:hidden}/*!@:host(.picker-column-disabled) ::slotted(ion-picker-column-option)*/.sc-ion-picker-column-h.picker-column-disabled .sc-ion-picker-column-s>ion-picker-column-option{cursor:default;opacity:0.4;pointer-events:none}@media (any-hover: hover){/*!@:host(:focus) .picker-opts*/.sc-ion-picker-column-h:focus .picker-opts.sc-ion-picker-column{outline:none;background:rgba(var(--ion-color-base-rgb), 0.2)}}";
|
|
25302
|
+
|
|
25303
|
+
/**
|
|
25304
|
+
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
|
25305
|
+
*
|
|
25306
|
+
* @slot prefix - Content to show on the left side of the picker options.
|
|
25307
|
+
* @slot suffix - Content to show on the right side of the picker options.
|
|
25308
|
+
*/
|
|
25309
|
+
class PickerColumn {
|
|
25310
|
+
constructor(hostRef) {
|
|
25311
|
+
registerInstance(this, hostRef);
|
|
25312
|
+
this.ionChange = createEvent(this, "ionChange", 7);
|
|
25313
|
+
this.isScrolling = false;
|
|
25314
|
+
this.isColumnVisible = false;
|
|
25315
|
+
this.canExitInputMode = true;
|
|
25316
|
+
this.centerPickerItemInView = (target, smooth = true, canExitInputMode = true) => {
|
|
25317
|
+
const { isColumnVisible, scrollEl } = this;
|
|
25318
|
+
if (isColumnVisible && scrollEl) {
|
|
25319
|
+
// (Vertical offset from parent) - (three empty picker rows) + (half the height of the target to ensure the scroll triggers)
|
|
25320
|
+
const top = target.offsetTop - 3 * target.clientHeight + target.clientHeight / 2;
|
|
25321
|
+
if (scrollEl.scrollTop !== top) {
|
|
25322
|
+
/**
|
|
25323
|
+
* Setting this flag prevents input
|
|
25324
|
+
* mode from exiting in the picker column's
|
|
25325
|
+
* scroll callback. This is useful when the user manually
|
|
25326
|
+
* taps an item or types on the keyboard as both
|
|
25327
|
+
* of these can cause a scroll to occur.
|
|
25328
|
+
*/
|
|
25329
|
+
this.canExitInputMode = canExitInputMode;
|
|
25330
|
+
scrollEl.scroll({
|
|
25331
|
+
top,
|
|
25332
|
+
left: 0,
|
|
25333
|
+
behavior: smooth ? 'smooth' : undefined,
|
|
25334
|
+
});
|
|
25335
|
+
}
|
|
25578
25336
|
}
|
|
25579
|
-
return true;
|
|
25580
25337
|
};
|
|
25581
|
-
|
|
25582
|
-
|
|
25583
|
-
|
|
25584
|
-
|
|
25585
|
-
|
|
25586
|
-
|
|
25587
|
-
*/
|
|
25588
|
-
this.onFocusOut = (ev) => {
|
|
25589
|
-
// TODO(FW-2832): type
|
|
25590
|
-
const { relatedTarget } = ev;
|
|
25591
|
-
if (!relatedTarget || (relatedTarget.tagName !== 'ION-PICKER-COLUMN-INTERNAL' && relatedTarget !== this.inputEl)) {
|
|
25592
|
-
this.exitInputMode();
|
|
25338
|
+
this.setPickerItemActiveState = (item, isActive) => {
|
|
25339
|
+
if (isActive) {
|
|
25340
|
+
item.classList.add(PICKER_ITEM_ACTIVE_CLASS);
|
|
25341
|
+
}
|
|
25342
|
+
else {
|
|
25343
|
+
item.classList.remove(PICKER_ITEM_ACTIVE_CLASS);
|
|
25593
25344
|
}
|
|
25594
25345
|
};
|
|
25595
25346
|
/**
|
|
25596
|
-
* When
|
|
25597
|
-
* the
|
|
25598
|
-
*
|
|
25347
|
+
* When ionInputModeChange is emitted, each column
|
|
25348
|
+
* needs to check if it is the one being made available
|
|
25349
|
+
* for text entry.
|
|
25599
25350
|
*/
|
|
25600
|
-
this.
|
|
25601
|
-
|
|
25602
|
-
const { target } = ev;
|
|
25603
|
-
/**
|
|
25604
|
-
* Due to browser differences in how/when focus
|
|
25605
|
-
* is dispatched on certain elements, we need to
|
|
25606
|
-
* make sure that this function only ever runs when
|
|
25607
|
-
* focusing a picker column.
|
|
25608
|
-
*/
|
|
25609
|
-
if (target.tagName !== 'ION-PICKER-COLUMN-INTERNAL') {
|
|
25351
|
+
this.inputModeChange = (ev) => {
|
|
25352
|
+
if (!this.numericInput) {
|
|
25610
25353
|
return;
|
|
25611
25354
|
}
|
|
25355
|
+
const { useInputMode, inputModeColumn } = ev.detail;
|
|
25612
25356
|
/**
|
|
25613
|
-
* If
|
|
25614
|
-
*
|
|
25615
|
-
* a picker column via mouse or
|
|
25616
|
-
* touch (i.e. a PointerEvent). As a result,
|
|
25617
|
-
* we should not enter/exit input mode
|
|
25618
|
-
* until the click event has fired, which happens
|
|
25619
|
-
* after the `focusin` event.
|
|
25620
|
-
*
|
|
25621
|
-
* Otherwise, the user likely focused
|
|
25622
|
-
* the column using their keyboard and
|
|
25623
|
-
* we should enter/exit input mode automatically.
|
|
25357
|
+
* If inputModeColumn is undefined then this means
|
|
25358
|
+
* all numericInput columns are being selected.
|
|
25624
25359
|
*/
|
|
25625
|
-
|
|
25626
|
-
|
|
25627
|
-
|
|
25628
|
-
|
|
25629
|
-
this.enterInputMode(columnEl, false);
|
|
25630
|
-
}
|
|
25631
|
-
else {
|
|
25632
|
-
this.exitInputMode();
|
|
25633
|
-
}
|
|
25360
|
+
const isColumnActive = inputModeColumn === undefined || inputModeColumn === this.el;
|
|
25361
|
+
if (!useInputMode || !isColumnActive) {
|
|
25362
|
+
this.setInputModeActive(false);
|
|
25363
|
+
return;
|
|
25634
25364
|
}
|
|
25365
|
+
this.setInputModeActive(true);
|
|
25635
25366
|
};
|
|
25636
25367
|
/**
|
|
25637
|
-
*
|
|
25638
|
-
*
|
|
25639
|
-
*
|
|
25368
|
+
* Setting isActive will cause a re-render.
|
|
25369
|
+
* As a result, we do not want to cause the
|
|
25370
|
+
* re-render mid scroll as this will cause
|
|
25371
|
+
* the picker column to jump back to
|
|
25372
|
+
* whatever value was selected at the
|
|
25373
|
+
* start of the scroll interaction.
|
|
25640
25374
|
*/
|
|
25641
|
-
this.
|
|
25642
|
-
|
|
25643
|
-
|
|
25644
|
-
|
|
25645
|
-
|
|
25375
|
+
this.setInputModeActive = (state) => {
|
|
25376
|
+
if (this.isScrolling) {
|
|
25377
|
+
this.scrollEndCallback = () => {
|
|
25378
|
+
this.isActive = state;
|
|
25379
|
+
};
|
|
25380
|
+
return;
|
|
25646
25381
|
}
|
|
25382
|
+
this.isActive = state;
|
|
25647
25383
|
};
|
|
25648
25384
|
/**
|
|
25649
|
-
*
|
|
25650
|
-
*
|
|
25651
|
-
*
|
|
25652
|
-
*
|
|
25653
|
-
* focus the column using the keyboard. When the
|
|
25654
|
-
* user completes the click, the onClick function
|
|
25655
|
-
* runs and runs the actionOnClick callback.
|
|
25385
|
+
* When the column scrolls, the component
|
|
25386
|
+
* needs to determine which item is centered
|
|
25387
|
+
* in the view and will emit an ionChange with
|
|
25388
|
+
* the item object.
|
|
25656
25389
|
*/
|
|
25657
|
-
this.
|
|
25658
|
-
|
|
25659
|
-
|
|
25660
|
-
|
|
25661
|
-
|
|
25662
|
-
|
|
25663
|
-
|
|
25664
|
-
|
|
25665
|
-
|
|
25666
|
-
|
|
25667
|
-
|
|
25390
|
+
this.initializeScrollListener = () => {
|
|
25391
|
+
/**
|
|
25392
|
+
* The haptics for the wheel picker are
|
|
25393
|
+
* an iOS-only feature. As a result, they should
|
|
25394
|
+
* be disabled on Android.
|
|
25395
|
+
*/
|
|
25396
|
+
const enableHaptics = isPlatform('ios');
|
|
25397
|
+
const { el, scrollEl } = this;
|
|
25398
|
+
let timeout;
|
|
25399
|
+
let activeEl = this.activeItem;
|
|
25400
|
+
const scrollCallback = () => {
|
|
25401
|
+
raf(() => {
|
|
25402
|
+
if (!scrollEl)
|
|
25403
|
+
return;
|
|
25404
|
+
if (timeout) {
|
|
25405
|
+
clearTimeout(timeout);
|
|
25406
|
+
timeout = undefined;
|
|
25407
|
+
}
|
|
25408
|
+
if (!this.isScrolling) {
|
|
25409
|
+
enableHaptics && hapticSelectionStart();
|
|
25410
|
+
this.isScrolling = true;
|
|
25411
|
+
}
|
|
25668
25412
|
/**
|
|
25669
|
-
*
|
|
25670
|
-
*
|
|
25671
|
-
* mode for that column or all columns.
|
|
25672
|
-
* Otherwise we should exit input mode
|
|
25673
|
-
* since we just tapped the highlight and
|
|
25674
|
-
* not a column.
|
|
25413
|
+
* Select item in the center of the column
|
|
25414
|
+
* which is the month/year that we want to select
|
|
25675
25415
|
*/
|
|
25676
|
-
|
|
25677
|
-
|
|
25678
|
-
|
|
25679
|
-
|
|
25680
|
-
|
|
25681
|
-
|
|
25682
|
-
|
|
25683
|
-
|
|
25684
|
-
|
|
25685
|
-
|
|
25686
|
-
|
|
25687
|
-
|
|
25688
|
-
|
|
25689
|
-
|
|
25690
|
-
|
|
25691
|
-
|
|
25692
|
-
|
|
25693
|
-
|
|
25694
|
-
|
|
25695
|
-
|
|
25696
|
-
|
|
25697
|
-
|
|
25416
|
+
const bbox = scrollEl.getBoundingClientRect();
|
|
25417
|
+
const centerX = bbox.x + bbox.width / 2;
|
|
25418
|
+
const centerY = bbox.y + bbox.height / 2;
|
|
25419
|
+
/**
|
|
25420
|
+
* elementFromPoint returns the top-most element.
|
|
25421
|
+
* This means that if an ion-backdrop is overlaying the
|
|
25422
|
+
* picker then the appropriate picker column option will
|
|
25423
|
+
* not be selected. To account for this, we use elementsFromPoint
|
|
25424
|
+
* and use an Array.find to find the appropriate column option
|
|
25425
|
+
* at that point.
|
|
25426
|
+
*
|
|
25427
|
+
* Additionally, the picker column could be used in the
|
|
25428
|
+
* Shadow DOM (i.e. in ion-datetime) so we need to make
|
|
25429
|
+
* sure we are choosing the correct host otherwise
|
|
25430
|
+
* the elements returns by elementsFromPoint will be
|
|
25431
|
+
* retargeted. To account for this, we check to see
|
|
25432
|
+
* if the picker column has a parent shadow root. If
|
|
25433
|
+
* so, we use that shadow root when doing elementsFromPoint.
|
|
25434
|
+
* Otherwise, we just use the document.
|
|
25435
|
+
*/
|
|
25436
|
+
const rootNode = el.getRootNode();
|
|
25437
|
+
const hasParentShadow = rootNode instanceof ShadowRoot;
|
|
25438
|
+
const referenceNode = hasParentShadow ? rootNode : doc;
|
|
25439
|
+
/**
|
|
25440
|
+
* If the reference node is undefined
|
|
25441
|
+
* then it's likely that doc is undefined
|
|
25442
|
+
* due to being in an SSR environment.
|
|
25443
|
+
*/
|
|
25444
|
+
if (referenceNode === undefined) {
|
|
25445
|
+
return;
|
|
25698
25446
|
}
|
|
25447
|
+
const elementsAtPoint = referenceNode.elementsFromPoint(centerX, centerY);
|
|
25699
25448
|
/**
|
|
25700
|
-
*
|
|
25701
|
-
*
|
|
25702
|
-
* enter input mode for all columns.
|
|
25449
|
+
* elementsFromPoint can returns multiple elements
|
|
25450
|
+
* so find the relevant picker column option if one exists.
|
|
25703
25451
|
*/
|
|
25704
|
-
|
|
25705
|
-
|
|
25452
|
+
const newActiveElement = elementsAtPoint.find((el) => el.tagName === 'ION-PICKER-COLUMN-OPTION');
|
|
25453
|
+
if (activeEl !== undefined) {
|
|
25454
|
+
this.setPickerItemActiveState(activeEl, false);
|
|
25455
|
+
}
|
|
25456
|
+
if (newActiveElement === undefined || newActiveElement.disabled) {
|
|
25457
|
+
return;
|
|
25458
|
+
}
|
|
25706
25459
|
/**
|
|
25707
|
-
* If
|
|
25708
|
-
*
|
|
25460
|
+
* If we are selecting a new value,
|
|
25461
|
+
* we need to run haptics again.
|
|
25709
25462
|
*/
|
|
25710
|
-
|
|
25711
|
-
|
|
25712
|
-
|
|
25713
|
-
|
|
25714
|
-
|
|
25715
|
-
|
|
25716
|
-
|
|
25717
|
-
|
|
25718
|
-
|
|
25719
|
-
|
|
25463
|
+
if (newActiveElement !== activeEl) {
|
|
25464
|
+
enableHaptics && hapticSelectionChanged();
|
|
25465
|
+
if (this.canExitInputMode) {
|
|
25466
|
+
/**
|
|
25467
|
+
* The native iOS wheel picker
|
|
25468
|
+
* only dismisses the keyboard
|
|
25469
|
+
* once the selected item has changed
|
|
25470
|
+
* as a result of a swipe
|
|
25471
|
+
* from the user. If `canExitInputMode` is
|
|
25472
|
+
* `false` then this means that the
|
|
25473
|
+
* scroll is happening as a result of
|
|
25474
|
+
* the `value` property programmatically changing
|
|
25475
|
+
* either by an application or by the user via the keyboard.
|
|
25476
|
+
*/
|
|
25477
|
+
this.exitInputMode();
|
|
25478
|
+
}
|
|
25479
|
+
}
|
|
25480
|
+
activeEl = newActiveElement;
|
|
25481
|
+
this.setPickerItemActiveState(newActiveElement, true);
|
|
25482
|
+
timeout = setTimeout(() => {
|
|
25483
|
+
this.isScrolling = false;
|
|
25484
|
+
enableHaptics && hapticSelectionEnd();
|
|
25485
|
+
/**
|
|
25486
|
+
* Certain tasks (such as those that
|
|
25487
|
+
* cause re-renders) should only be done
|
|
25488
|
+
* once scrolling has finished, otherwise
|
|
25489
|
+
* flickering may occur.
|
|
25490
|
+
*/
|
|
25491
|
+
const { scrollEndCallback } = this;
|
|
25492
|
+
if (scrollEndCallback) {
|
|
25493
|
+
scrollEndCallback();
|
|
25494
|
+
this.scrollEndCallback = undefined;
|
|
25495
|
+
}
|
|
25496
|
+
/**
|
|
25497
|
+
* Reset this flag as the
|
|
25498
|
+
* next scroll interaction could
|
|
25499
|
+
* be a scroll from the user. In this
|
|
25500
|
+
* case, we should exit input mode.
|
|
25501
|
+
*/
|
|
25502
|
+
this.canExitInputMode = true;
|
|
25503
|
+
this.setValue(newActiveElement.value);
|
|
25504
|
+
}, 250);
|
|
25505
|
+
});
|
|
25720
25506
|
};
|
|
25507
|
+
/**
|
|
25508
|
+
* Wrap this in an raf so that the scroll callback
|
|
25509
|
+
* does not fire when component is initially shown.
|
|
25510
|
+
*/
|
|
25511
|
+
raf(() => {
|
|
25512
|
+
if (!scrollEl)
|
|
25513
|
+
return;
|
|
25514
|
+
scrollEl.addEventListener('scroll', scrollCallback);
|
|
25515
|
+
this.destroyScrollListener = () => {
|
|
25516
|
+
scrollEl.removeEventListener('scroll', scrollCallback);
|
|
25517
|
+
};
|
|
25518
|
+
});
|
|
25721
25519
|
};
|
|
25722
25520
|
/**
|
|
25723
|
-
*
|
|
25724
|
-
*
|
|
25725
|
-
*
|
|
25726
|
-
*
|
|
25727
|
-
*
|
|
25728
|
-
* keyboard, picker columns receive an outline
|
|
25729
|
-
* to indicate they are focused. As a result,
|
|
25730
|
-
* we should not focus the hidden input as it
|
|
25731
|
-
* would cause the outline to go away, preventing
|
|
25732
|
-
* users from having any visual indication of which
|
|
25733
|
-
* column is focused.
|
|
25521
|
+
* Tells the parent picker to
|
|
25522
|
+
* exit text entry mode. This is only called
|
|
25523
|
+
* when the selected item changes during scroll, so
|
|
25524
|
+
* we know that the user likely wants to scroll
|
|
25525
|
+
* instead of type.
|
|
25734
25526
|
*/
|
|
25735
|
-
this.
|
|
25736
|
-
const {
|
|
25737
|
-
if (
|
|
25527
|
+
this.exitInputMode = () => {
|
|
25528
|
+
const { parentEl } = this;
|
|
25529
|
+
if (parentEl == null)
|
|
25738
25530
|
return;
|
|
25739
|
-
|
|
25531
|
+
parentEl.exitInputMode();
|
|
25740
25532
|
/**
|
|
25741
|
-
*
|
|
25742
|
-
*
|
|
25533
|
+
* setInputModeActive only takes
|
|
25534
|
+
* effect once scrolling stops to avoid
|
|
25535
|
+
* a component re-render while scrolling.
|
|
25536
|
+
* However, we want the visual active
|
|
25537
|
+
* indicator to go away immediately, so
|
|
25538
|
+
* we call classList.remove here.
|
|
25743
25539
|
*/
|
|
25744
|
-
|
|
25745
|
-
|
|
25746
|
-
|
|
25540
|
+
this.el.classList.remove('picker-column-active');
|
|
25541
|
+
};
|
|
25542
|
+
this.isActive = false;
|
|
25543
|
+
this.disabled = false;
|
|
25544
|
+
this.value = undefined;
|
|
25545
|
+
this.color = 'primary';
|
|
25546
|
+
this.numericInput = false;
|
|
25547
|
+
}
|
|
25548
|
+
valueChange() {
|
|
25549
|
+
if (this.isColumnVisible) {
|
|
25550
|
+
/**
|
|
25551
|
+
* Only scroll the active item into view when the picker column
|
|
25552
|
+
* is actively visible to the user.
|
|
25553
|
+
*/
|
|
25554
|
+
this.scrollActiveItemIntoView(true);
|
|
25555
|
+
}
|
|
25556
|
+
}
|
|
25557
|
+
/**
|
|
25558
|
+
* Only setup scroll listeners
|
|
25559
|
+
* when the picker is visible, otherwise
|
|
25560
|
+
* the container will have a scroll
|
|
25561
|
+
* height of 0px.
|
|
25562
|
+
*/
|
|
25563
|
+
componentWillLoad() {
|
|
25564
|
+
const visibleCallback = (entries) => {
|
|
25565
|
+
const ev = entries[0];
|
|
25566
|
+
if (ev.isIntersecting) {
|
|
25567
|
+
const { activeItem, el } = this;
|
|
25568
|
+
this.isColumnVisible = true;
|
|
25569
|
+
/**
|
|
25570
|
+
* Because this initial call to scrollActiveItemIntoView has to fire before
|
|
25571
|
+
* the scroll listener is set up, we need to manage the active class manually.
|
|
25572
|
+
*/
|
|
25573
|
+
const oldActive = getElementRoot(el).querySelector(`.${PICKER_ITEM_ACTIVE_CLASS}`);
|
|
25574
|
+
if (oldActive) {
|
|
25575
|
+
this.setPickerItemActiveState(oldActive, false);
|
|
25576
|
+
}
|
|
25577
|
+
this.scrollActiveItemIntoView();
|
|
25578
|
+
if (activeItem) {
|
|
25579
|
+
this.setPickerItemActiveState(activeItem, true);
|
|
25580
|
+
}
|
|
25581
|
+
this.initializeScrollListener();
|
|
25747
25582
|
}
|
|
25583
|
+
else {
|
|
25584
|
+
this.isColumnVisible = false;
|
|
25585
|
+
if (this.destroyScrollListener) {
|
|
25586
|
+
this.destroyScrollListener();
|
|
25587
|
+
this.destroyScrollListener = undefined;
|
|
25588
|
+
}
|
|
25589
|
+
}
|
|
25590
|
+
};
|
|
25591
|
+
new IntersectionObserver(visibleCallback, { threshold: 0.001 }).observe(this.el);
|
|
25592
|
+
const parentEl = (this.parentEl = this.el.closest('ion-picker'));
|
|
25593
|
+
if (parentEl !== null) {
|
|
25594
|
+
// TODO(FW-2832): type
|
|
25595
|
+
parentEl.addEventListener('ionInputModeChange', (ev) => this.inputModeChange(ev));
|
|
25596
|
+
}
|
|
25597
|
+
}
|
|
25598
|
+
componentDidRender() {
|
|
25599
|
+
const { el, activeItem, isColumnVisible, value } = this;
|
|
25600
|
+
if (isColumnVisible && !activeItem) {
|
|
25601
|
+
const firstOption = el.querySelector('ion-picker-column-option');
|
|
25748
25602
|
/**
|
|
25749
|
-
* If
|
|
25750
|
-
*
|
|
25751
|
-
*
|
|
25752
|
-
*
|
|
25603
|
+
* If the picker column does not have an active item and the current value
|
|
25604
|
+
* does not match the first item in the picker column, that means
|
|
25605
|
+
* the value is out of bounds. In this case, we assign the value to the
|
|
25606
|
+
* first item to match the scroll position of the column.
|
|
25607
|
+
*
|
|
25753
25608
|
*/
|
|
25754
|
-
|
|
25755
|
-
|
|
25609
|
+
if (firstOption !== null && firstOption.value !== value) {
|
|
25610
|
+
this.setValue(firstOption.value);
|
|
25611
|
+
}
|
|
25612
|
+
}
|
|
25613
|
+
}
|
|
25614
|
+
/** @internal */
|
|
25615
|
+
async scrollActiveItemIntoView(smooth = false) {
|
|
25616
|
+
const activeEl = this.activeItem;
|
|
25617
|
+
if (activeEl) {
|
|
25618
|
+
this.centerPickerItemInView(activeEl, smooth, false);
|
|
25619
|
+
}
|
|
25620
|
+
}
|
|
25621
|
+
/**
|
|
25622
|
+
* Sets the value prop and fires the ionChange event.
|
|
25623
|
+
* This is used when we need to fire ionChange from
|
|
25624
|
+
* user-generated events that cannot be caught with normal
|
|
25625
|
+
* input/change event listeners.
|
|
25626
|
+
* @internal
|
|
25627
|
+
*/
|
|
25628
|
+
async setValue(value) {
|
|
25629
|
+
if (this.disabled === true || this.value === value) {
|
|
25630
|
+
return;
|
|
25631
|
+
}
|
|
25632
|
+
this.value = value;
|
|
25633
|
+
this.ionChange.emit({ value });
|
|
25634
|
+
}
|
|
25635
|
+
/**
|
|
25636
|
+
* Sets focus on the scrollable container within the picker column.
|
|
25637
|
+
* Use this method instead of the global `pickerColumn.focus()`.
|
|
25638
|
+
*/
|
|
25639
|
+
async setFocus() {
|
|
25640
|
+
if (this.scrollEl) {
|
|
25641
|
+
this.scrollEl.focus();
|
|
25642
|
+
}
|
|
25643
|
+
}
|
|
25644
|
+
get activeItem() {
|
|
25645
|
+
const { value } = this;
|
|
25646
|
+
const options = Array.from(this.el.querySelectorAll('ion-picker-column-option'));
|
|
25647
|
+
return options.find((option) => {
|
|
25756
25648
|
/**
|
|
25757
|
-
*
|
|
25758
|
-
*
|
|
25759
|
-
* focused as well as when it is not focused,
|
|
25760
|
-
* so we need to make sure we clean up any
|
|
25761
|
-
* old listeners.
|
|
25649
|
+
* If the whole picker column is disabled, the current value should appear active
|
|
25650
|
+
* If the current value item is specifically disabled, it should not appear active
|
|
25762
25651
|
*/
|
|
25763
|
-
if (
|
|
25764
|
-
|
|
25765
|
-
|
|
25766
|
-
|
|
25652
|
+
if (!this.disabled && option.disabled) {
|
|
25653
|
+
return false;
|
|
25654
|
+
}
|
|
25655
|
+
return option.value === value;
|
|
25656
|
+
});
|
|
25657
|
+
}
|
|
25658
|
+
render() {
|
|
25659
|
+
const { color, disabled, isActive, numericInput } = this;
|
|
25660
|
+
const mode = getIonMode$1(this);
|
|
25661
|
+
return (hAsync(Host, { class: createColorClasses$1(color, {
|
|
25662
|
+
[mode]: true,
|
|
25663
|
+
['picker-column-active']: isActive,
|
|
25664
|
+
['picker-column-numeric-input']: numericInput,
|
|
25665
|
+
['picker-column-disabled']: disabled,
|
|
25666
|
+
}) }, hAsync("slot", { name: "prefix" }), hAsync("div", { class: "picker-opts", tabindex: disabled ? undefined : 0, ref: (el) => {
|
|
25667
|
+
this.scrollEl = el;
|
|
25668
|
+
} }, hAsync("div", { class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("slot", null), hAsync("div", { class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0")), hAsync("slot", { name: "suffix" })));
|
|
25669
|
+
}
|
|
25670
|
+
get el() { return getElement(this); }
|
|
25671
|
+
static get watchers() { return {
|
|
25672
|
+
"value": ["valueChange"]
|
|
25673
|
+
}; }
|
|
25674
|
+
static get style() { return pickerColumnCss; }
|
|
25675
|
+
static get cmpMeta() { return {
|
|
25676
|
+
"$flags$": 9,
|
|
25677
|
+
"$tagName$": "ion-picker-column",
|
|
25678
|
+
"$members$": {
|
|
25679
|
+
"disabled": [4],
|
|
25680
|
+
"value": [1032],
|
|
25681
|
+
"color": [513],
|
|
25682
|
+
"numericInput": [4, "numeric-input"],
|
|
25683
|
+
"isActive": [32],
|
|
25684
|
+
"scrollActiveItemIntoView": [64],
|
|
25685
|
+
"setValue": [64],
|
|
25686
|
+
"setFocus": [64]
|
|
25687
|
+
},
|
|
25688
|
+
"$listeners$": undefined,
|
|
25689
|
+
"$lazyBundleId$": "-",
|
|
25690
|
+
"$attrsToReflect$": [["color", "color"]]
|
|
25691
|
+
}; }
|
|
25692
|
+
}
|
|
25693
|
+
const PICKER_ITEM_ACTIVE_CLASS = 'option-active';
|
|
25694
|
+
|
|
25695
|
+
const pickerColumnIosCss = ".picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}@supports (inset-inline-start: 0){.picker-opt{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-opt{left:0}:host-context([dir=rtl]) .picker-opt{left:unset;right:unset;right:0}[dir=rtl] .picker-opt{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-opt:dir(rtl){left:unset;right:unset;right:0}}}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:20px;line-height:42px;pointer-events:none}.picker-opt{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-transform-origin:center center;transform-origin:center center;height:46px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:20px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}:host-context([dir=rtl]) .picker-opt{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}[dir=rtl] .picker-opt{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}@supports selector(:dir(rtl)){.picker-opt:dir(rtl){-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}}";
|
|
25696
|
+
|
|
25697
|
+
const pickerColumnMdCss = ".picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}@supports (inset-inline-start: 0){.picker-opt{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-opt{left:0}:host-context([dir=rtl]) .picker-opt{left:unset;right:unset;right:0}[dir=rtl] .picker-opt{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-opt:dir(rtl){left:unset;right:unset;right:0}}}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:22px;line-height:42px;pointer-events:none}.picker-opt{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;height:43px;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:22px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}.picker-prefix,.picker-suffix,.picker-opt.picker-opt-selected{color:var(--ion-color-primary, #3880ff)}";
|
|
25698
|
+
|
|
25699
|
+
/**
|
|
25700
|
+
* @internal
|
|
25701
|
+
*/
|
|
25702
|
+
class PickerColumnCmp {
|
|
25703
|
+
constructor(hostRef) {
|
|
25704
|
+
registerInstance(this, hostRef);
|
|
25705
|
+
this.ionPickerColChange = createEvent(this, "ionPickerColChange", 7);
|
|
25706
|
+
this.optHeight = 0;
|
|
25707
|
+
this.rotateFactor = 0;
|
|
25708
|
+
this.scaleFactor = 1;
|
|
25709
|
+
this.velocity = 0;
|
|
25710
|
+
this.y = 0;
|
|
25711
|
+
this.noAnimate = true;
|
|
25712
|
+
// `colDidChange` is a flag that gets set when the column is changed
|
|
25713
|
+
// dynamically. When this flag is set, the column will refresh
|
|
25714
|
+
// after the component re-renders to incorporate the new column data.
|
|
25715
|
+
// This is necessary because `this.refresh` queries for the option elements,
|
|
25716
|
+
// so it needs to wait for the latest elements to be available in the DOM.
|
|
25717
|
+
// Ex: column is created with 3 options. User updates the column data
|
|
25718
|
+
// to have 5 options. The column will still think it only has 3 options.
|
|
25719
|
+
this.colDidChange = false;
|
|
25720
|
+
this.col = undefined;
|
|
25721
|
+
}
|
|
25722
|
+
colChanged() {
|
|
25723
|
+
this.colDidChange = true;
|
|
25724
|
+
}
|
|
25725
|
+
async connectedCallback() {
|
|
25726
|
+
let pickerRotateFactor = 0;
|
|
25727
|
+
let pickerScaleFactor = 0.81;
|
|
25728
|
+
const mode = getIonMode$1(this);
|
|
25729
|
+
if (mode === 'ios') {
|
|
25730
|
+
pickerRotateFactor = -0.46;
|
|
25731
|
+
pickerScaleFactor = 1;
|
|
25732
|
+
}
|
|
25733
|
+
this.rotateFactor = pickerRotateFactor;
|
|
25734
|
+
this.scaleFactor = pickerScaleFactor;
|
|
25735
|
+
this.gesture = (await Promise.resolve().then(function () { return index; })).createGesture({
|
|
25736
|
+
el: this.el,
|
|
25737
|
+
gestureName: 'picker-swipe',
|
|
25738
|
+
gesturePriority: 100,
|
|
25739
|
+
threshold: 0,
|
|
25740
|
+
passive: false,
|
|
25741
|
+
onStart: (ev) => this.onStart(ev),
|
|
25742
|
+
onMove: (ev) => this.onMove(ev),
|
|
25743
|
+
onEnd: (ev) => this.onEnd(ev),
|
|
25744
|
+
});
|
|
25745
|
+
this.gesture.enable();
|
|
25746
|
+
// Options have not been initialized yet
|
|
25747
|
+
// Animation must be disabled through the `noAnimate` flag
|
|
25748
|
+
// Otherwise, the options will render
|
|
25749
|
+
// at the top of the column and transition down
|
|
25750
|
+
this.tmrId = setTimeout(() => {
|
|
25751
|
+
this.noAnimate = false;
|
|
25752
|
+
// After initialization, `refresh()` will be called
|
|
25753
|
+
// At this point, animation will be enabled. The options will
|
|
25754
|
+
// animate as they are being selected.
|
|
25755
|
+
this.refresh(true);
|
|
25756
|
+
}, 250);
|
|
25757
|
+
}
|
|
25758
|
+
componentDidLoad() {
|
|
25759
|
+
this.onDomChange();
|
|
25760
|
+
}
|
|
25761
|
+
componentDidUpdate() {
|
|
25762
|
+
// Options may have changed since last update.
|
|
25763
|
+
if (this.colDidChange) {
|
|
25764
|
+
// Animation must be disabled through the `onDomChange` parameter.
|
|
25765
|
+
// Otherwise, the recently added options will render
|
|
25766
|
+
// at the top of the column and transition down
|
|
25767
|
+
this.onDomChange(true, false);
|
|
25768
|
+
this.colDidChange = false;
|
|
25769
|
+
}
|
|
25770
|
+
}
|
|
25771
|
+
disconnectedCallback() {
|
|
25772
|
+
if (this.rafId !== undefined)
|
|
25773
|
+
cancelAnimationFrame(this.rafId);
|
|
25774
|
+
if (this.tmrId)
|
|
25775
|
+
clearTimeout(this.tmrId);
|
|
25776
|
+
if (this.gesture) {
|
|
25777
|
+
this.gesture.destroy();
|
|
25778
|
+
this.gesture = undefined;
|
|
25779
|
+
}
|
|
25780
|
+
}
|
|
25781
|
+
emitColChange() {
|
|
25782
|
+
this.ionPickerColChange.emit(this.col);
|
|
25783
|
+
}
|
|
25784
|
+
setSelected(selectedIndex, duration) {
|
|
25785
|
+
// if there is a selected index, then figure out it's y position
|
|
25786
|
+
// if there isn't a selected index, then just use the top y position
|
|
25787
|
+
const y = selectedIndex > -1 ? -(selectedIndex * this.optHeight) : 0;
|
|
25788
|
+
this.velocity = 0;
|
|
25789
|
+
// set what y position we're at
|
|
25790
|
+
if (this.rafId !== undefined)
|
|
25791
|
+
cancelAnimationFrame(this.rafId);
|
|
25792
|
+
this.update(y, duration, true);
|
|
25793
|
+
this.emitColChange();
|
|
25794
|
+
}
|
|
25795
|
+
update(y, duration, saveY) {
|
|
25796
|
+
if (!this.optsEl) {
|
|
25797
|
+
return;
|
|
25798
|
+
}
|
|
25799
|
+
// ensure we've got a good round number :)
|
|
25800
|
+
let translateY = 0;
|
|
25801
|
+
let translateZ = 0;
|
|
25802
|
+
const { col, rotateFactor } = this;
|
|
25803
|
+
const prevSelected = col.selectedIndex;
|
|
25804
|
+
const selectedIndex = (col.selectedIndex = this.indexForY(-y));
|
|
25805
|
+
const durationStr = duration === 0 ? '' : duration + 'ms';
|
|
25806
|
+
const scaleStr = `scale(${this.scaleFactor})`;
|
|
25807
|
+
const children = this.optsEl.children;
|
|
25808
|
+
for (let i = 0; i < children.length; i++) {
|
|
25809
|
+
const button = children[i];
|
|
25810
|
+
const opt = col.options[i];
|
|
25811
|
+
const optOffset = i * this.optHeight + y;
|
|
25812
|
+
let transform = '';
|
|
25813
|
+
if (rotateFactor !== 0) {
|
|
25814
|
+
const rotateX = optOffset * rotateFactor;
|
|
25815
|
+
if (Math.abs(rotateX) <= 90) {
|
|
25816
|
+
translateY = 0;
|
|
25817
|
+
translateZ = 90;
|
|
25818
|
+
transform = `rotateX(${rotateX}deg) `;
|
|
25819
|
+
}
|
|
25820
|
+
else {
|
|
25821
|
+
translateY = -9999;
|
|
25767
25822
|
}
|
|
25768
|
-
inputEl.focus();
|
|
25769
25823
|
}
|
|
25770
25824
|
else {
|
|
25771
|
-
|
|
25772
|
-
|
|
25773
|
-
el.removeEventListener('keypress', this.onKeyPress);
|
|
25774
|
-
};
|
|
25775
|
-
}
|
|
25776
|
-
this.emitInputModeChange();
|
|
25777
|
-
};
|
|
25778
|
-
this.onKeyPress = (ev) => {
|
|
25779
|
-
const { inputEl } = this;
|
|
25780
|
-
if (!inputEl) {
|
|
25781
|
-
return;
|
|
25782
|
-
}
|
|
25783
|
-
const parsedValue = parseInt(ev.key, 10);
|
|
25784
|
-
/**
|
|
25785
|
-
* Only numbers should be allowed
|
|
25786
|
-
*/
|
|
25787
|
-
if (!Number.isNaN(parsedValue)) {
|
|
25788
|
-
inputEl.value += ev.key;
|
|
25789
|
-
this.onInputChange();
|
|
25825
|
+
translateZ = 0;
|
|
25826
|
+
translateY = optOffset;
|
|
25790
25827
|
}
|
|
25791
|
-
|
|
25792
|
-
|
|
25793
|
-
|
|
25794
|
-
|
|
25795
|
-
return;
|
|
25828
|
+
const selected = selectedIndex === i;
|
|
25829
|
+
transform += `translate3d(0px,${translateY}px,${translateZ}px) `;
|
|
25830
|
+
if (this.scaleFactor !== 1 && !selected) {
|
|
25831
|
+
transform += scaleStr;
|
|
25796
25832
|
}
|
|
25797
|
-
|
|
25798
|
-
|
|
25799
|
-
|
|
25800
|
-
|
|
25801
|
-
* <select> behaves. So typing "34", waiting,
|
|
25802
|
-
* then typing "5" should select "05".
|
|
25803
|
-
*/
|
|
25804
|
-
if (singleColumnSearchTimeout) {
|
|
25805
|
-
clearTimeout(singleColumnSearchTimeout);
|
|
25833
|
+
// Update transition duration
|
|
25834
|
+
if (this.noAnimate) {
|
|
25835
|
+
opt.duration = 0;
|
|
25836
|
+
button.style.transitionDuration = '';
|
|
25806
25837
|
}
|
|
25807
|
-
|
|
25808
|
-
|
|
25809
|
-
|
|
25810
|
-
}, 1000);
|
|
25811
|
-
/**
|
|
25812
|
-
* For values that are longer than 2 digits long
|
|
25813
|
-
* we should shift the value over 1 character
|
|
25814
|
-
* to the left. So typing "456" would result in "56".
|
|
25815
|
-
* TODO: If we want to support more than just
|
|
25816
|
-
* time entry, we should update this value to be
|
|
25817
|
-
* the max length of all of the picker items.
|
|
25818
|
-
*/
|
|
25819
|
-
if (inputEl.value.length >= 3) {
|
|
25820
|
-
const startIndex = inputEl.value.length - 2;
|
|
25821
|
-
const newString = inputEl.value.substring(startIndex);
|
|
25822
|
-
inputEl.value = newString;
|
|
25823
|
-
this.selectSingleColumn();
|
|
25824
|
-
return;
|
|
25838
|
+
else if (duration !== opt.duration) {
|
|
25839
|
+
opt.duration = duration;
|
|
25840
|
+
button.style.transitionDuration = durationStr;
|
|
25825
25841
|
}
|
|
25826
|
-
|
|
25827
|
-
|
|
25828
|
-
|
|
25829
|
-
* is "1" and we entered "2", then the complete value
|
|
25830
|
-
* is "12" and we should select hour 12.
|
|
25831
|
-
*
|
|
25832
|
-
* Regex removes any leading zeros from values like "02",
|
|
25833
|
-
* but it keeps a single zero if there are only zeros in the string.
|
|
25834
|
-
* 0+(?=[1-9]) --> Match 1 or more zeros that are followed by 1-9
|
|
25835
|
-
* 0+(?=0$) --> Match 1 or more zeros that must be followed by one 0 and end.
|
|
25836
|
-
*/
|
|
25837
|
-
const findItemFromCompleteValue = values.find(({ text }) => {
|
|
25838
|
-
const parsedText = text.replace(/^0+(?=[1-9])|0+(?=0$)/, '');
|
|
25839
|
-
return parsedText === inputEl.value;
|
|
25840
|
-
});
|
|
25841
|
-
if (findItemFromCompleteValue) {
|
|
25842
|
-
inputModeColumn.setValue(findItemFromCompleteValue.value);
|
|
25843
|
-
return;
|
|
25842
|
+
// Update transform
|
|
25843
|
+
if (transform !== opt.transform) {
|
|
25844
|
+
opt.transform = transform;
|
|
25844
25845
|
}
|
|
25846
|
+
button.style.transform = transform;
|
|
25845
25847
|
/**
|
|
25846
|
-
*
|
|
25847
|
-
*
|
|
25848
|
+
* Ensure that the select column
|
|
25849
|
+
* item has the selected class
|
|
25848
25850
|
*/
|
|
25849
|
-
|
|
25850
|
-
|
|
25851
|
-
|
|
25852
|
-
this.selectSingleColumn();
|
|
25853
|
-
}
|
|
25854
|
-
};
|
|
25855
|
-
/**
|
|
25856
|
-
* Searches a list of column items for a particular
|
|
25857
|
-
* value. This is currently used for numeric values.
|
|
25858
|
-
* The zeroBehavior can be set to account for leading
|
|
25859
|
-
* or trailing zeros when looking at the item text.
|
|
25860
|
-
*/
|
|
25861
|
-
this.searchColumn = (colEl, value, zeroBehavior = 'start') => {
|
|
25862
|
-
const behavior = zeroBehavior === 'start' ? /^0+/ : /0$/;
|
|
25863
|
-
const item = colEl.items.find(({ text, disabled }) => disabled !== true && text.replace(behavior, '') === value);
|
|
25864
|
-
if (item) {
|
|
25865
|
-
colEl.setValue(item.value);
|
|
25851
|
+
opt.selected = selected;
|
|
25852
|
+
if (selected) {
|
|
25853
|
+
button.classList.add(PICKER_OPT_SELECTED);
|
|
25866
25854
|
}
|
|
25867
|
-
|
|
25868
|
-
|
|
25869
|
-
const { inputEl, el } = this;
|
|
25870
|
-
if (!inputEl) {
|
|
25871
|
-
return;
|
|
25855
|
+
else {
|
|
25856
|
+
button.classList.remove(PICKER_OPT_SELECTED);
|
|
25872
25857
|
}
|
|
25873
|
-
|
|
25874
|
-
|
|
25875
|
-
|
|
25876
|
-
|
|
25877
|
-
|
|
25878
|
-
|
|
25879
|
-
|
|
25880
|
-
|
|
25881
|
-
|
|
25882
|
-
|
|
25883
|
-
|
|
25884
|
-
|
|
25885
|
-
|
|
25886
|
-
|
|
25887
|
-
|
|
25888
|
-
|
|
25889
|
-
|
|
25890
|
-
|
|
25891
|
-
|
|
25892
|
-
|
|
25893
|
-
|
|
25894
|
-
|
|
25895
|
-
* for a match in the minutes column
|
|
25896
|
-
*/
|
|
25897
|
-
if (value.length === 1) {
|
|
25898
|
-
minuteValue = inputEl.value.substring(inputEl.value.length - 1);
|
|
25899
|
-
this.searchColumn(lastColumn, minuteValue, 'end');
|
|
25900
|
-
}
|
|
25901
|
-
break;
|
|
25902
|
-
case 3:
|
|
25903
|
-
/**
|
|
25904
|
-
* If the first character is `0` or `1` it is
|
|
25905
|
-
* possible that users are trying to type `09`
|
|
25906
|
-
* or `11` into the hour field, so we should look
|
|
25907
|
-
* at that first.
|
|
25908
|
-
*/
|
|
25909
|
-
const firstCharacterAgain = inputEl.value.substring(0, 1);
|
|
25910
|
-
value =
|
|
25911
|
-
firstCharacterAgain === '0' || firstCharacterAgain === '1'
|
|
25912
|
-
? inputEl.value.substring(0, 2)
|
|
25913
|
-
: firstCharacterAgain;
|
|
25914
|
-
this.searchColumn(firstColumn, value);
|
|
25915
|
-
/**
|
|
25916
|
-
* If only checked the first value,
|
|
25917
|
-
* we can check the second value
|
|
25918
|
-
* for a match in the minutes column
|
|
25919
|
-
*/
|
|
25920
|
-
minuteValue = value.length === 1 ? inputEl.value.substring(1) : inputEl.value.substring(2);
|
|
25921
|
-
this.searchColumn(lastColumn, minuteValue, 'end');
|
|
25922
|
-
break;
|
|
25923
|
-
case 4:
|
|
25924
|
-
/**
|
|
25925
|
-
* If the first character is `0` or `1` it is
|
|
25926
|
-
* possible that users are trying to type `09`
|
|
25927
|
-
* or `11` into the hour field, so we should look
|
|
25928
|
-
* at that first.
|
|
25929
|
-
*/
|
|
25930
|
-
const firstCharacterAgainAgain = inputEl.value.substring(0, 1);
|
|
25931
|
-
value =
|
|
25932
|
-
firstCharacterAgainAgain === '0' || firstCharacterAgainAgain === '1'
|
|
25933
|
-
? inputEl.value.substring(0, 2)
|
|
25934
|
-
: firstCharacterAgainAgain;
|
|
25935
|
-
this.searchColumn(firstColumn, value);
|
|
25936
|
-
/**
|
|
25937
|
-
* If only checked the first value,
|
|
25938
|
-
* we can check the second value
|
|
25939
|
-
* for a match in the minutes column
|
|
25940
|
-
*/
|
|
25941
|
-
const minuteValueAgain = value.length === 1
|
|
25942
|
-
? inputEl.value.substring(1, inputEl.value.length)
|
|
25943
|
-
: inputEl.value.substring(2, inputEl.value.length);
|
|
25944
|
-
this.searchColumn(lastColumn, minuteValueAgain, 'end');
|
|
25945
|
-
break;
|
|
25946
|
-
default:
|
|
25947
|
-
const startIndex = inputEl.value.length - 4;
|
|
25948
|
-
const newString = inputEl.value.substring(startIndex);
|
|
25949
|
-
inputEl.value = newString;
|
|
25950
|
-
this.selectMultiColumn();
|
|
25951
|
-
break;
|
|
25858
|
+
}
|
|
25859
|
+
this.col.prevSelected = prevSelected;
|
|
25860
|
+
if (saveY) {
|
|
25861
|
+
this.y = y;
|
|
25862
|
+
}
|
|
25863
|
+
if (this.lastIndex !== selectedIndex) {
|
|
25864
|
+
// have not set a last index yet
|
|
25865
|
+
hapticSelectionChanged();
|
|
25866
|
+
this.lastIndex = selectedIndex;
|
|
25867
|
+
}
|
|
25868
|
+
}
|
|
25869
|
+
decelerate() {
|
|
25870
|
+
if (this.velocity !== 0) {
|
|
25871
|
+
// still decelerating
|
|
25872
|
+
this.velocity *= DECELERATION_FRICTION;
|
|
25873
|
+
// do not let it go slower than a velocity of 1
|
|
25874
|
+
this.velocity = this.velocity > 0 ? Math.max(this.velocity, 1) : Math.min(this.velocity, -1);
|
|
25875
|
+
let y = this.y + this.velocity;
|
|
25876
|
+
if (y > this.minY) {
|
|
25877
|
+
// whoops, it's trying to scroll up farther than the options we have!
|
|
25878
|
+
y = this.minY;
|
|
25879
|
+
this.velocity = 0;
|
|
25952
25880
|
}
|
|
25953
|
-
|
|
25954
|
-
|
|
25955
|
-
|
|
25956
|
-
|
|
25957
|
-
* to select
|
|
25958
|
-
*/
|
|
25959
|
-
this.onInputChange = () => {
|
|
25960
|
-
const { useInputMode, inputEl, inputModeColumn } = this;
|
|
25961
|
-
if (!useInputMode || !inputEl) {
|
|
25962
|
-
return;
|
|
25881
|
+
else if (y < this.maxY) {
|
|
25882
|
+
// gahh, it's trying to scroll down farther than we can!
|
|
25883
|
+
y = this.maxY;
|
|
25884
|
+
this.velocity = 0;
|
|
25963
25885
|
}
|
|
25964
|
-
|
|
25965
|
-
|
|
25886
|
+
this.update(y, 0, true);
|
|
25887
|
+
const notLockedIn = Math.round(y) % this.optHeight !== 0 || Math.abs(this.velocity) > 1;
|
|
25888
|
+
if (notLockedIn) {
|
|
25889
|
+
// isn't locked in yet, keep decelerating until it is
|
|
25890
|
+
this.rafId = requestAnimationFrame(() => this.decelerate());
|
|
25966
25891
|
}
|
|
25967
25892
|
else {
|
|
25968
|
-
this.
|
|
25893
|
+
this.velocity = 0;
|
|
25894
|
+
this.emitColChange();
|
|
25895
|
+
hapticSelectionEnd();
|
|
25969
25896
|
}
|
|
25970
|
-
}
|
|
25897
|
+
}
|
|
25898
|
+
else if (this.y % this.optHeight !== 0) {
|
|
25899
|
+
// needs to still get locked into a position so options line up
|
|
25900
|
+
const currentPos = Math.abs(this.y % this.optHeight);
|
|
25901
|
+
// create a velocity in the direction it needs to scroll
|
|
25902
|
+
this.velocity = currentPos > this.optHeight / 2 ? 1 : -1;
|
|
25903
|
+
this.decelerate();
|
|
25904
|
+
}
|
|
25905
|
+
}
|
|
25906
|
+
indexForY(y) {
|
|
25907
|
+
return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
|
|
25908
|
+
}
|
|
25909
|
+
onStart(detail) {
|
|
25910
|
+
// We have to prevent default in order to block scrolling under the picker
|
|
25911
|
+
// but we DO NOT have to stop propagation, since we still want
|
|
25912
|
+
// some "click" events to capture
|
|
25913
|
+
if (detail.event.cancelable) {
|
|
25914
|
+
detail.event.preventDefault();
|
|
25915
|
+
}
|
|
25916
|
+
detail.event.stopPropagation();
|
|
25917
|
+
hapticSelectionStart();
|
|
25918
|
+
// reset everything
|
|
25919
|
+
if (this.rafId !== undefined)
|
|
25920
|
+
cancelAnimationFrame(this.rafId);
|
|
25921
|
+
const options = this.col.options;
|
|
25922
|
+
let minY = options.length - 1;
|
|
25923
|
+
let maxY = 0;
|
|
25924
|
+
for (let i = 0; i < options.length; i++) {
|
|
25925
|
+
if (!options[i].disabled) {
|
|
25926
|
+
minY = Math.min(minY, i);
|
|
25927
|
+
maxY = Math.max(maxY, i);
|
|
25928
|
+
}
|
|
25929
|
+
}
|
|
25930
|
+
this.minY = -(minY * this.optHeight);
|
|
25931
|
+
this.maxY = -(maxY * this.optHeight);
|
|
25932
|
+
}
|
|
25933
|
+
onMove(detail) {
|
|
25934
|
+
if (detail.event.cancelable) {
|
|
25935
|
+
detail.event.preventDefault();
|
|
25936
|
+
}
|
|
25937
|
+
detail.event.stopPropagation();
|
|
25938
|
+
// update the scroll position relative to pointer start position
|
|
25939
|
+
let y = this.y + detail.deltaY;
|
|
25940
|
+
if (y > this.minY) {
|
|
25941
|
+
// scrolling up higher than scroll area
|
|
25942
|
+
y = Math.pow(y, 0.8);
|
|
25943
|
+
this.bounceFrom = y;
|
|
25944
|
+
}
|
|
25945
|
+
else if (y < this.maxY) {
|
|
25946
|
+
// scrolling down below scroll area
|
|
25947
|
+
y += Math.pow(this.maxY - y, 0.9);
|
|
25948
|
+
this.bounceFrom = y;
|
|
25949
|
+
}
|
|
25950
|
+
else {
|
|
25951
|
+
this.bounceFrom = 0;
|
|
25952
|
+
}
|
|
25953
|
+
this.update(y, 0, false);
|
|
25954
|
+
}
|
|
25955
|
+
onEnd(detail) {
|
|
25956
|
+
if (this.bounceFrom > 0) {
|
|
25957
|
+
// bounce back up
|
|
25958
|
+
this.update(this.minY, 100, true);
|
|
25959
|
+
this.emitColChange();
|
|
25960
|
+
return;
|
|
25961
|
+
}
|
|
25962
|
+
else if (this.bounceFrom < 0) {
|
|
25963
|
+
// bounce back down
|
|
25964
|
+
this.update(this.maxY, 100, true);
|
|
25965
|
+
this.emitColChange();
|
|
25966
|
+
return;
|
|
25967
|
+
}
|
|
25968
|
+
this.velocity = clamp(-MAX_PICKER_SPEED, detail.velocityY * 23, MAX_PICKER_SPEED);
|
|
25969
|
+
if (this.velocity === 0 && detail.deltaY === 0) {
|
|
25970
|
+
const opt = detail.event.target.closest('.picker-opt');
|
|
25971
|
+
if (opt === null || opt === void 0 ? void 0 : opt.hasAttribute('opt-index')) {
|
|
25972
|
+
this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);
|
|
25973
|
+
}
|
|
25974
|
+
}
|
|
25975
|
+
else {
|
|
25976
|
+
this.y += detail.deltaY;
|
|
25977
|
+
if (Math.abs(detail.velocityY) < 0.05) {
|
|
25978
|
+
const isScrollingUp = detail.deltaY > 0;
|
|
25979
|
+
const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;
|
|
25980
|
+
if (isScrollingUp && optHeightFraction > 0.5) {
|
|
25981
|
+
this.velocity = Math.abs(this.velocity) * -1;
|
|
25982
|
+
}
|
|
25983
|
+
else if (!isScrollingUp && optHeightFraction <= 0.5) {
|
|
25984
|
+
this.velocity = Math.abs(this.velocity);
|
|
25985
|
+
}
|
|
25986
|
+
}
|
|
25987
|
+
this.decelerate();
|
|
25988
|
+
}
|
|
25989
|
+
}
|
|
25990
|
+
refresh(forceRefresh, animated) {
|
|
25991
|
+
var _a;
|
|
25992
|
+
let min = this.col.options.length - 1;
|
|
25993
|
+
let max = 0;
|
|
25994
|
+
const options = this.col.options;
|
|
25995
|
+
for (let i = 0; i < options.length; i++) {
|
|
25996
|
+
if (!options[i].disabled) {
|
|
25997
|
+
min = Math.min(min, i);
|
|
25998
|
+
max = Math.max(max, i);
|
|
25999
|
+
}
|
|
26000
|
+
}
|
|
25971
26001
|
/**
|
|
25972
|
-
*
|
|
25973
|
-
*
|
|
25974
|
-
*
|
|
26002
|
+
* Only update selected value if column has a
|
|
26003
|
+
* velocity of 0. If it does not, then the
|
|
26004
|
+
* column is animating might land on
|
|
26005
|
+
* a value different than the value at
|
|
26006
|
+
* selectedIndex
|
|
25975
26007
|
*/
|
|
25976
|
-
this.
|
|
25977
|
-
|
|
25978
|
-
|
|
25979
|
-
|
|
25980
|
-
|
|
25981
|
-
|
|
25982
|
-
|
|
26008
|
+
if (this.velocity !== 0) {
|
|
26009
|
+
return;
|
|
26010
|
+
}
|
|
26011
|
+
const selectedIndex = clamp(min, (_a = this.col.selectedIndex) !== null && _a !== void 0 ? _a : 0, max);
|
|
26012
|
+
if (this.col.prevSelected !== selectedIndex || forceRefresh) {
|
|
26013
|
+
const y = selectedIndex * this.optHeight * -1;
|
|
26014
|
+
const duration = animated ? TRANSITION_DURATION : 0;
|
|
26015
|
+
this.velocity = 0;
|
|
26016
|
+
this.update(y, duration, true);
|
|
26017
|
+
}
|
|
26018
|
+
}
|
|
26019
|
+
onDomChange(forceRefresh, animated) {
|
|
26020
|
+
const colEl = this.optsEl;
|
|
26021
|
+
if (colEl) {
|
|
26022
|
+
// DOM READ
|
|
26023
|
+
// We perfom a DOM read over a rendered item, this needs to happen after the first render or after the the column has changed
|
|
26024
|
+
this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
|
|
26025
|
+
}
|
|
26026
|
+
this.refresh(forceRefresh, animated);
|
|
26027
|
+
}
|
|
26028
|
+
render() {
|
|
26029
|
+
const col = this.col;
|
|
26030
|
+
const mode = getIonMode$1(this);
|
|
26031
|
+
return (hAsync(Host, { class: Object.assign({ [mode]: true, 'picker-col': true, 'picker-opts-left': this.col.align === 'left', 'picker-opts-right': this.col.align === 'right' }, getClassMap(col.cssClass)), style: {
|
|
26032
|
+
'max-width': this.col.columnWidth,
|
|
26033
|
+
} }, col.prefix && (hAsync("div", { class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)), hAsync("div", { class: "picker-opts", style: { maxWidth: col.optionsWidth }, ref: (el) => (this.optsEl = el) }, col.options.map((o, index) => (hAsync("button", { "aria-label": o.ariaLabel, class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, "opt-index": index }, o.text)))), col.suffix && (hAsync("div", { class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix))));
|
|
26034
|
+
}
|
|
26035
|
+
get el() { return getElement(this); }
|
|
26036
|
+
static get watchers() { return {
|
|
26037
|
+
"col": ["colChanged"]
|
|
26038
|
+
}; }
|
|
26039
|
+
static get style() { return {
|
|
26040
|
+
ios: pickerColumnIosCss,
|
|
26041
|
+
md: pickerColumnMdCss
|
|
26042
|
+
}; }
|
|
26043
|
+
static get cmpMeta() { return {
|
|
26044
|
+
"$flags$": 32,
|
|
26045
|
+
"$tagName$": "ion-picker-legacy-column",
|
|
26046
|
+
"$members$": {
|
|
26047
|
+
"col": [16]
|
|
26048
|
+
},
|
|
26049
|
+
"$listeners$": undefined,
|
|
26050
|
+
"$lazyBundleId$": "-",
|
|
26051
|
+
"$attrsToReflect$": []
|
|
26052
|
+
}; }
|
|
26053
|
+
}
|
|
26054
|
+
const PICKER_OPT_SELECTED = 'picker-opt-selected';
|
|
26055
|
+
const DECELERATION_FRICTION = 0.97;
|
|
26056
|
+
const MAX_PICKER_SPEED = 90;
|
|
26057
|
+
const TRANSITION_DURATION = 150;
|
|
26058
|
+
|
|
26059
|
+
const pickerColumnOptionIosCss = "/*!@button*/button.sc-ion-picker-column-option-ios{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden}/*!@:host(.option-disabled)*/.option-disabled.sc-ion-picker-column-option-ios-h{opacity:0.4}/*!@:host(.option-disabled) button*/.option-disabled.sc-ion-picker-column-option-ios-h button.sc-ion-picker-column-option-ios{cursor:default}";
|
|
26060
|
+
|
|
26061
|
+
const pickerColumnOptionMdCss = "/*!@button*/button.sc-ion-picker-column-option-md{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden}/*!@:host(.option-disabled)*/.option-disabled.sc-ion-picker-column-option-md-h{opacity:0.4}/*!@:host(.option-disabled) button*/.option-disabled.sc-ion-picker-column-option-md-h button.sc-ion-picker-column-option-md{cursor:default}/*!@:host(.option-active)*/.option-active.sc-ion-picker-column-option-md-h{color:var(--ion-color-base)}";
|
|
26062
|
+
|
|
26063
|
+
class PickerColumnOption {
|
|
26064
|
+
constructor(hostRef) {
|
|
26065
|
+
registerInstance(this, hostRef);
|
|
26066
|
+
/**
|
|
26067
|
+
* We keep track of the parent picker column
|
|
26068
|
+
* so we can update the value of it when
|
|
26069
|
+
* clicking an enable option.
|
|
26070
|
+
*/
|
|
26071
|
+
this.pickerColumn = null;
|
|
26072
|
+
this.ariaLabel = null;
|
|
26073
|
+
this.disabled = false;
|
|
26074
|
+
this.value = undefined;
|
|
26075
|
+
this.color = 'primary';
|
|
25983
26076
|
}
|
|
25984
26077
|
/**
|
|
25985
|
-
*
|
|
25986
|
-
*
|
|
25987
|
-
*
|
|
25988
|
-
*
|
|
25989
|
-
* in ion-datetime should not cause
|
|
25990
|
-
* a card modal to swipe to close.
|
|
26078
|
+
* The aria-label of the option has changed after the
|
|
26079
|
+
* first render and needs to be updated within the component.
|
|
26080
|
+
*
|
|
26081
|
+
* @param ariaLbl The new aria-label value.
|
|
25991
26082
|
*/
|
|
25992
|
-
|
|
25993
|
-
|
|
26083
|
+
onAriaLabelChange(ariaLbl) {
|
|
26084
|
+
this.ariaLabel = ariaLbl;
|
|
25994
26085
|
}
|
|
25995
26086
|
componentWillLoad() {
|
|
25996
|
-
|
|
25997
|
-
|
|
26087
|
+
const inheritedAttributes = inheritAttributes$1(this.el, ['aria-label']);
|
|
26088
|
+
/**
|
|
26089
|
+
* The initial value of `aria-label` needs to be set for
|
|
26090
|
+
* the first render.
|
|
26091
|
+
|
|
26092
|
+
*/
|
|
26093
|
+
this.ariaLabel = inheritedAttributes['aria-label'] || null;
|
|
26094
|
+
}
|
|
26095
|
+
connectedCallback() {
|
|
26096
|
+
this.pickerColumn = this.el.closest('ion-picker-column');
|
|
26097
|
+
}
|
|
26098
|
+
disconnectedCallback() {
|
|
26099
|
+
this.pickerColumn = null;
|
|
25998
26100
|
}
|
|
25999
26101
|
/**
|
|
26000
|
-
*
|
|
26001
|
-
*
|
|
26002
|
-
*
|
|
26003
|
-
*
|
|
26102
|
+
* The column options can load at any time
|
|
26103
|
+
* so the options needs to tell the
|
|
26104
|
+
* parent picker column when it is loaded
|
|
26105
|
+
* so the picker column can ensure it is
|
|
26106
|
+
* centered in the view.
|
|
26107
|
+
*
|
|
26108
|
+
* We intentionally run this for every
|
|
26109
|
+
* option. If we only ran this from
|
|
26110
|
+
* the selected option then if the newly
|
|
26111
|
+
* loaded options were not selected then
|
|
26112
|
+
* scrollActiveItemIntoView would not be called.
|
|
26004
26113
|
*/
|
|
26005
|
-
|
|
26006
|
-
const {
|
|
26007
|
-
if (
|
|
26008
|
-
|
|
26114
|
+
componentDidLoad() {
|
|
26115
|
+
const { pickerColumn } = this;
|
|
26116
|
+
if (pickerColumn !== null) {
|
|
26117
|
+
pickerColumn.scrollActiveItemIntoView();
|
|
26009
26118
|
}
|
|
26010
|
-
|
|
26011
|
-
|
|
26012
|
-
|
|
26013
|
-
|
|
26014
|
-
|
|
26015
|
-
|
|
26016
|
-
|
|
26119
|
+
}
|
|
26120
|
+
/**
|
|
26121
|
+
* When an option is clicked, update the
|
|
26122
|
+
* parent picker column value. This
|
|
26123
|
+
* component will handle centering the option
|
|
26124
|
+
* in the column view.
|
|
26125
|
+
*/
|
|
26126
|
+
onClick() {
|
|
26127
|
+
const { pickerColumn } = this;
|
|
26128
|
+
if (pickerColumn !== null) {
|
|
26129
|
+
pickerColumn.setValue(this.value);
|
|
26017
26130
|
}
|
|
26018
|
-
this.emitInputModeChange();
|
|
26019
26131
|
}
|
|
26020
26132
|
render() {
|
|
26021
|
-
|
|
26133
|
+
const { color, disabled, ariaLabel } = this;
|
|
26134
|
+
const mode = getIonMode$1(this);
|
|
26135
|
+
return (hAsync(Host, { class: createColorClasses$1(color, {
|
|
26136
|
+
[mode]: true,
|
|
26137
|
+
['option-disabled']: disabled,
|
|
26138
|
+
}) }, hAsync("button", { tabindex: "-1", "aria-label": ariaLabel, disabled: disabled, onClick: () => this.onClick() }, hAsync("slot", null))));
|
|
26022
26139
|
}
|
|
26023
26140
|
get el() { return getElement(this); }
|
|
26141
|
+
static get watchers() { return {
|
|
26142
|
+
"aria-label": ["onAriaLabelChange"]
|
|
26143
|
+
}; }
|
|
26024
26144
|
static get style() { return {
|
|
26025
|
-
ios:
|
|
26026
|
-
md:
|
|
26145
|
+
ios: pickerColumnOptionIosCss,
|
|
26146
|
+
md: pickerColumnOptionMdCss
|
|
26027
26147
|
}; }
|
|
26028
26148
|
static get cmpMeta() { return {
|
|
26029
26149
|
"$flags$": 41,
|
|
26030
|
-
"$tagName$": "ion-picker-
|
|
26150
|
+
"$tagName$": "ion-picker-column-option",
|
|
26031
26151
|
"$members$": {
|
|
26032
|
-
"
|
|
26152
|
+
"disabled": [4],
|
|
26153
|
+
"value": [8],
|
|
26154
|
+
"color": [513],
|
|
26155
|
+
"ariaLabel": [32]
|
|
26033
26156
|
},
|
|
26034
|
-
"$listeners$":
|
|
26157
|
+
"$listeners$": undefined,
|
|
26035
26158
|
"$lazyBundleId$": "-",
|
|
26036
|
-
"$attrsToReflect$": []
|
|
26159
|
+
"$attrsToReflect$": [["color", "color"]]
|
|
26037
26160
|
}; }
|
|
26038
26161
|
}
|
|
26039
26162
|
|
|
@@ -35024,10 +35147,11 @@ registerComponents([
|
|
|
35024
35147
|
Nav,
|
|
35025
35148
|
NavLink,
|
|
35026
35149
|
Note,
|
|
35150
|
+
Picker$1,
|
|
35027
35151
|
Picker,
|
|
35152
|
+
PickerColumn,
|
|
35028
35153
|
PickerColumnCmp,
|
|
35029
|
-
|
|
35030
|
-
PickerInternal,
|
|
35154
|
+
PickerColumnOption,
|
|
35031
35155
|
Popover,
|
|
35032
35156
|
ProgressBar,
|
|
35033
35157
|
Radio,
|