@ionic/core 7.5.7-dev.11700601905.13f94170 → 7.5.7-dev.11701113479.149fdab6
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/backdrop.js +0 -12
- package/components/data.js +13 -41
- package/components/gesture-controller.js +1 -1
- package/components/ion-content.js +1 -1
- package/components/ion-datetime.js +32 -84
- package/components/ion-picker-legacy-column.d.ts +11 -0
- package/components/{ion-picker-column.js → ion-picker-legacy-column.js} +2 -2
- package/components/{ion-picker-column.d.ts → ion-picker-legacy.d.ts} +4 -4
- package/components/ion-picker-legacy.js +309 -0
- package/components/overlays.js +11 -4
- package/components/picker-column-internal.js +12 -7
- package/components/picker-column.js +3 -3
- package/dist/cjs/{button-active-af897e0e.js → button-active-cd07b55b.js} +1 -1
- package/dist/cjs/{data-88d0864d.js → data-c8d21093.js} +13 -41
- package/dist/cjs/{gesture-controller-b46721be.js → gesture-controller-d6a3f907.js} +1 -0
- package/dist/cjs/{index-0ee995e4.js → index-0f8b33f8.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/ion-action-sheet.cjs.entry.js +4 -4
- package/dist/cjs/ion-alert.cjs.entry.js +4 -4
- package/dist/cjs/ion-app_8.cjs.entry.js +2 -2
- package/dist/cjs/ion-backdrop.cjs.entry.js +0 -12
- package/dist/cjs/ion-datetime-button.cjs.entry.js +1 -1
- package/dist/cjs/ion-datetime_3.cjs.entry.js +34 -66
- package/dist/cjs/ion-item-option_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-loading.cjs.entry.js +2 -1
- package/dist/cjs/ion-menu_3.cjs.entry.js +3 -3
- package/dist/cjs/ion-modal.cjs.entry.js +3 -3
- package/dist/cjs/ion-nav_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-picker-column-internal.cjs.entry.js +11 -7
- package/dist/cjs/ion-popover.cjs.entry.js +2 -1
- package/dist/cjs/ion-range.cjs.entry.js +1 -1
- package/dist/cjs/ion-refresher_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-reorder_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-segment_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +2 -1
- package/dist/cjs/ion-toast.cjs.entry.js +2 -1
- package/dist/cjs/ion-toggle.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-2ffc5f27.js → overlays-dbb71984.js} +11 -4
- package/dist/cjs/{swipe-back-d0412fb6.js → swipe-back-a6dc6e5d.js} +2 -2
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/backdrop/backdrop.js +0 -12
- package/dist/collection/components/content/content.css +0 -4
- package/dist/collection/components/datetime/datetime.ios.css +83 -24
- package/dist/collection/components/datetime/datetime.js +22 -56
- package/dist/collection/components/datetime/datetime.md.css +88 -24
- package/dist/collection/components/datetime/test/a11y/datetime.e2e.js +1 -1
- package/dist/collection/components/datetime/test/a11y/datetime.spec.js +6 -9
- package/dist/collection/components/datetime/test/basic/datetime.e2e.js +10 -0
- package/dist/collection/components/datetime/test/disabled/datetime.spec.js +33 -0
- package/dist/collection/components/datetime/test/manipulation.spec.js +1 -77
- package/dist/collection/components/datetime/test/month-year-picker/datetime.e2e.js +1 -1
- package/dist/collection/components/datetime/test/readonly/datetime.e2e.js +2 -2
- package/dist/collection/components/datetime/utils/manipulation.js +14 -42
- package/dist/collection/components/picker-column-internal/picker-column-internal.ios.css +11 -3
- package/dist/collection/components/picker-column-internal/picker-column-internal.js +27 -5
- package/dist/collection/components/picker-column-internal/picker-column-internal.md.css +11 -3
- package/dist/collection/components/picker-column-internal/test/disabled/picker-column-internal.e2e.js +34 -5
- package/dist/collection/components/{picker-column → picker-column-legacy}/picker-column.js +5 -5
- package/dist/collection/components/{picker-column → picker-column-legacy}/test/picker-column-aria.spec.js +3 -3
- package/dist/collection/components/{picker-column → picker-column-legacy}/test/picker-column-dynamic.spec.js +2 -2
- package/dist/collection/components/{picker-column → picker-column-legacy}/test/picker-column.spec.js +2 -2
- package/dist/collection/components/{picker-column → picker-column-legacy}/test/standalone/picker-column.e2e.js +3 -3
- package/dist/collection/components/{picker → picker-legacy}/picker.js +7 -5
- package/dist/collection/components/{picker → picker-legacy}/test/basic/picker.e2e.js +2 -2
- 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/utils/gesture/gesture-controller.js +1 -1
- package/dist/collection/utils/overlays.js +11 -4
- package/dist/collection/utils/test/overlays/overlays-scroll-blocking.spec.js +65 -0
- package/dist/docs.json +32 -43
- package/dist/esm/{button-active-ce5cba4c.js → button-active-5b0516e7.js} +1 -1
- package/dist/esm/{data-2b019469.js → data-44d9e816.js} +13 -41
- package/dist/esm/{gesture-controller-0fa396c4.js → gesture-controller-3723db7c.js} +1 -1
- package/dist/esm/{index-ff313b19.js → index-32cbee52.js} +2 -2
- package/dist/esm/index.js +3 -3
- package/dist/esm/ion-action-sheet.entry.js +4 -4
- package/dist/esm/ion-alert.entry.js +4 -4
- package/dist/esm/ion-app_8.entry.js +2 -2
- package/dist/esm/ion-backdrop.entry.js +0 -12
- package/dist/esm/ion-datetime-button.entry.js +1 -1
- package/dist/esm/ion-datetime_3.entry.js +33 -65
- package/dist/esm/ion-item-option_3.entry.js +1 -1
- package/dist/esm/ion-loading.entry.js +2 -1
- package/dist/esm/ion-menu_3.entry.js +3 -3
- package/dist/esm/ion-modal.entry.js +3 -3
- package/dist/esm/ion-nav_2.entry.js +1 -1
- package/dist/esm/ion-picker-column-internal.entry.js +11 -7
- package/dist/esm/ion-popover.entry.js +2 -1
- package/dist/esm/ion-range.entry.js +1 -1
- package/dist/esm/ion-refresher_2.entry.js +3 -3
- package/dist/esm/ion-reorder_2.entry.js +1 -1
- package/dist/esm/ion-segment_2.entry.js +1 -1
- package/dist/esm/ion-select_3.entry.js +2 -1
- package/dist/esm/ion-toast.entry.js +2 -1
- package/dist/esm/ion-toggle.entry.js +1 -1
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{overlays-6c9feb7e.js → overlays-789cd7a7.js} +11 -4
- package/dist/esm/{swipe-back-0f3bfc8e.js → swipe-back-cc4c2bcb.js} +2 -2
- package/dist/esm-es5/{button-active-ce5cba4c.js → button-active-5b0516e7.js} +1 -1
- package/dist/esm-es5/data-44d9e816.js +4 -0
- package/dist/esm-es5/{gesture-controller-0fa396c4.js → gesture-controller-3723db7c.js} +1 -1
- package/dist/esm-es5/{index-ff313b19.js → index-32cbee52.js} +1 -1
- 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-app_8.entry.js +1 -1
- package/dist/esm-es5/ion-backdrop.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-item-option_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-nav_2.entry.js +1 -1
- package/dist/esm-es5/ion-picker-column-internal.entry.js +1 -1
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-range.entry.js +1 -1
- package/dist/esm-es5/ion-refresher_2.entry.js +1 -1
- package/dist/esm-es5/ion-reorder_2.entry.js +1 -1
- package/dist/esm-es5/ion-segment_2.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/ion-toggle.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-789cd7a7.js +4 -0
- package/dist/esm-es5/swipe-back-cc4c2bcb.js +4 -0
- package/dist/html.html-data.json +2 -2
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-67e644bd.system.entry.js → p-02d8fdba.system.entry.js} +1 -1
- package/dist/ionic/{p-f3c82f74.system.entry.js → p-06e6d235.system.entry.js} +2 -2
- package/dist/ionic/p-0c244faf.entry.js +4 -0
- package/dist/ionic/{p-e0b06b65.js → p-100ef961.js} +1 -1
- package/dist/ionic/p-17240d90.js +4 -0
- package/dist/ionic/p-1a368f2e.system.entry.js +4 -0
- package/dist/ionic/{p-34d2de14.system.entry.js → p-22813b28.system.entry.js} +1 -1
- package/dist/ionic/p-234b9617.system.entry.js +4 -0
- package/dist/ionic/p-25c34422.system.entry.js +4 -0
- package/dist/ionic/p-2804781b.entry.js +4 -0
- package/dist/ionic/p-29fe18ef.entry.js +4 -0
- package/dist/ionic/p-2ad38423.system.entry.js +4 -0
- package/dist/ionic/{p-7176cea3.entry.js → p-2ba9414e.entry.js} +1 -1
- package/dist/ionic/{p-fa8d4788.system.js → p-2e1794df.system.js} +1 -1
- package/dist/ionic/{p-e627ed84.js → p-302091ab.js} +1 -1
- package/dist/ionic/{p-67ed452a.system.entry.js → p-3f88eab8.system.entry.js} +1 -1
- package/dist/ionic/p-40903d34.system.js +1 -1
- package/dist/ionic/{p-0dc0d9b5.entry.js → p-477a182e.entry.js} +1 -1
- package/dist/ionic/{p-2743f9a7.system.entry.js → p-4c80afe1.system.entry.js} +1 -1
- package/dist/ionic/{p-377c636c.system.entry.js → p-4f3e2767.system.entry.js} +1 -1
- package/dist/ionic/{p-3de79805.entry.js → p-56224549.entry.js} +1 -1
- package/dist/ionic/{p-965677f1.entry.js → p-5ce11143.entry.js} +1 -1
- package/dist/ionic/{p-9e852ff1.system.js → p-6500b298.system.js} +1 -1
- package/dist/ionic/p-6893f6e4.entry.js +4 -0
- package/dist/ionic/{p-b2a74a72.entry.js → p-835e0346.entry.js} +1 -1
- package/dist/ionic/{p-39044fe6.system.entry.js → p-878c7aa5.system.entry.js} +1 -1
- package/dist/ionic/{p-c4c7fd8f.entry.js → p-8ad82eb3.entry.js} +1 -1
- package/dist/ionic/p-8b4ab236.entry.js +4 -0
- package/dist/ionic/{p-f37b4b79.entry.js → p-939d903b.entry.js} +1 -1
- package/dist/ionic/{p-6d812360.system.entry.js → p-966cf574.system.entry.js} +1 -1
- package/dist/ionic/p-992d3bad.entry.js +4 -0
- package/dist/ionic/{p-1cb5f2f8.system.entry.js → p-9b5301cc.system.entry.js} +1 -1
- package/dist/ionic/p-9c967a65.system.entry.js +4 -0
- package/dist/ionic/{p-8e1bded3.entry.js → p-9e6bf9ed.entry.js} +1 -1
- package/dist/ionic/{p-6e23777e.system.entry.js → p-a4cda7a8.system.entry.js} +1 -1
- package/dist/ionic/{p-09d142b3.system.js → p-a57f223c.system.js} +1 -1
- package/dist/ionic/{p-8b1be026.js → p-a7e2ac5c.js} +1 -1
- package/dist/ionic/{p-bed722c4.system.entry.js → p-b3e79338.system.entry.js} +1 -1
- package/dist/ionic/p-b4cbb736.js +4 -0
- package/dist/ionic/{p-4fa201a7.entry.js → p-b6a8588f.entry.js} +1 -1
- package/dist/ionic/p-b8c3f071.system.js +4 -0
- package/dist/ionic/{p-73411c1b.entry.js → p-c1229981.entry.js} +1 -1
- package/dist/ionic/{p-db5043df.system.entry.js → p-c31fc05f.system.entry.js} +1 -1
- package/dist/ionic/p-c56b6570.system.entry.js +4 -0
- package/dist/ionic/p-c59d068a.entry.js +4 -0
- package/dist/ionic/{p-a936d224.system.js → p-c7fd81ba.system.js} +1 -1
- package/dist/ionic/p-dc565ca3.js +4 -0
- package/dist/ionic/{p-deab76dc.entry.js → p-dd837fa8.entry.js} +1 -1
- package/dist/ionic/p-e88ed07f.system.js +4 -0
- package/dist/ionic/p-eb07ec1a.system.entry.js +4 -0
- package/dist/ionic/p-eb5697b5.system.js +4 -0
- package/dist/ionic/{p-3ce8c3e3.entry.js → p-ee800093.entry.js} +1 -1
- package/dist/ionic/p-f0559c5d.system.entry.js +4 -0
- package/dist/ionic/p-fdd22426.entry.js +4 -0
- package/dist/types/components/backdrop/backdrop.d.ts +0 -3
- package/dist/types/components/datetime/datetime.d.ts +0 -1
- package/dist/types/components/datetime/utils/manipulation.d.ts +15 -34
- package/dist/types/components/menu/menu.d.ts +1 -1
- package/dist/types/components/picker-column-internal/picker-column-internal.d.ts +4 -0
- package/dist/types/components/{picker-column → picker-column-legacy}/picker-column.d.ts +1 -1
- package/dist/types/components/{picker → picker-legacy}/picker.d.ts +1 -1
- package/dist/types/components.d.ts +138 -130
- package/dist/types/interface.d.ts +1 -1
- package/dist/types/utils/config.d.ts +2 -2
- package/dist/types/utils/gesture/gesture-controller.d.ts +1 -0
- package/dist/types/utils/overlays.d.ts +5 -2
- package/hydrate/index.js +62 -126
- package/package.json +1 -1
- package/components/ion-picker.d.ts +0 -11
- package/components/ion-picker.js +0 -307
- package/dist/collection/components/datetime/test/prefer-wheel/datetime.spec.js +0 -27
- package/dist/esm-es5/data-2b019469.js +0 -4
- package/dist/esm-es5/overlays-6c9feb7e.js +0 -4
- package/dist/esm-es5/swipe-back-0f3bfc8e.js +0 -4
- package/dist/ionic/p-0d8e9393.entry.js +0 -4
- package/dist/ionic/p-1108f9bf.system.entry.js +0 -4
- package/dist/ionic/p-18e01b30.system.entry.js +0 -4
- package/dist/ionic/p-1e5165db.system.entry.js +0 -4
- package/dist/ionic/p-264c16e9.entry.js +0 -4
- package/dist/ionic/p-297741bc.system.js +0 -4
- package/dist/ionic/p-4794e0ac.system.entry.js +0 -4
- package/dist/ionic/p-4dbac22d.entry.js +0 -4
- package/dist/ionic/p-598cdf16.js +0 -4
- package/dist/ionic/p-64296b15.entry.js +0 -4
- package/dist/ionic/p-800ef057.js +0 -4
- package/dist/ionic/p-8dbdb163.system.js +0 -4
- package/dist/ionic/p-97e31c0a.system.js +0 -4
- package/dist/ionic/p-a5c1e6ce.entry.js +0 -4
- package/dist/ionic/p-a9c3699b.system.entry.js +0 -4
- package/dist/ionic/p-b203659a.system.entry.js +0 -4
- package/dist/ionic/p-b91fe549.entry.js +0 -4
- package/dist/ionic/p-c919498d.entry.js +0 -4
- package/dist/ionic/p-cf425ec5.system.entry.js +0 -4
- package/dist/ionic/p-ddfc4ef4.system.entry.js +0 -4
- package/dist/ionic/p-e6b240a0.js +0 -4
- package/dist/ionic/p-f54ddd19.entry.js +0 -4
- /package/dist/collection/components/{picker-column → picker-column-legacy}/picker-column.ios.css +0 -0
- /package/dist/collection/components/{picker-column → picker-column-legacy}/picker-column.md.css +0 -0
- /package/dist/collection/components/{picker-column → picker-column-legacy}/test/test.utils.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 → picker-legacy}/picker.ios.css +0 -0
- /package/dist/collection/components/{picker → picker-legacy}/picker.md.css +0 -0
- /package/dist/types/components/{picker-column → picker-column-legacy}/test/test.utils.d.ts +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
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
const index = require('./index-306a7476.js');
|
|
7
7
|
const ionicGlobal = require('./ionic-global-ea2901a3.js');
|
|
8
8
|
const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
|
|
9
|
+
const gestureController = require('./gesture-controller-d6a3f907.js');
|
|
9
10
|
const hardwareBackButton = require('./hardware-back-button-b67c8e75.js');
|
|
10
11
|
const helpers = require('./helpers-ea4ccbcb.js');
|
|
11
12
|
const index$1 = require('./index-cc7dfb7c.js');
|
|
@@ -30,7 +31,10 @@ const alertController = /*@__PURE__*/ createController('ion-alert');
|
|
|
30
31
|
const actionSheetController = /*@__PURE__*/ createController('ion-action-sheet');
|
|
31
32
|
const loadingController = /*@__PURE__*/ createController('ion-loading');
|
|
32
33
|
const modalController = /*@__PURE__*/ createController('ion-modal');
|
|
33
|
-
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Use the inline ion-picker component instead.
|
|
36
|
+
*/
|
|
37
|
+
const pickerController = /*@__PURE__*/ createController('ion-picker-legacy');
|
|
34
38
|
const popoverController = /*@__PURE__*/ createController('ion-popover');
|
|
35
39
|
const toastController = /*@__PURE__*/ createController('ion-toast');
|
|
36
40
|
/**
|
|
@@ -140,7 +144,7 @@ const focusLastDescendant = (ref, overlay) => {
|
|
|
140
144
|
* Should NOT include: Toast
|
|
141
145
|
*/
|
|
142
146
|
const trapKeyboardFocus = (ev, doc) => {
|
|
143
|
-
const lastOverlay = getPresentedOverlay(doc, 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover');
|
|
147
|
+
const lastOverlay = getPresentedOverlay(doc, 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker-legacy,ion-popover');
|
|
144
148
|
const target = ev.target;
|
|
145
149
|
/**
|
|
146
150
|
* If no active overlay, ignore this event.
|
|
@@ -325,7 +329,7 @@ const dismissOverlay = (doc, data, role, overlayTag, id) => {
|
|
|
325
329
|
*/
|
|
326
330
|
const getOverlays = (doc, selector) => {
|
|
327
331
|
if (selector === undefined) {
|
|
328
|
-
selector = 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast';
|
|
332
|
+
selector = 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker-legacy,ion-popover,ion-toast';
|
|
329
333
|
}
|
|
330
334
|
return Array.from(doc.querySelectorAll(selector)).filter((c) => c.overlayIndex > 0);
|
|
331
335
|
};
|
|
@@ -391,6 +395,7 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
391
395
|
return;
|
|
392
396
|
}
|
|
393
397
|
setRootAriaHidden(true);
|
|
398
|
+
document.body.classList.add(gestureController.BACKDROP_NO_SCROLL);
|
|
394
399
|
overlay.presented = true;
|
|
395
400
|
overlay.willPresent.emit();
|
|
396
401
|
(_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
|
|
@@ -453,12 +458,14 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
453
458
|
if (!overlay.presented) {
|
|
454
459
|
return false;
|
|
455
460
|
}
|
|
461
|
+
const lastOverlay = index.doc !== undefined && getPresentedOverlays(index.doc).length === 1;
|
|
456
462
|
/**
|
|
457
463
|
* If this is the last visible overlay then
|
|
458
464
|
* we want to re-add the root to the accessibility tree.
|
|
459
465
|
*/
|
|
460
|
-
if (
|
|
466
|
+
if (lastOverlay) {
|
|
461
467
|
setRootAriaHidden(false);
|
|
468
|
+
document.body.classList.remove(gestureController.BACKDROP_NO_SCROLL);
|
|
462
469
|
}
|
|
463
470
|
overlay.presented = false;
|
|
464
471
|
try {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
const helpers = require('./helpers-ea4ccbcb.js');
|
|
7
7
|
const dir = require('./dir-f1e0ca26.js');
|
|
8
|
-
const index = require('./index-
|
|
9
|
-
require('./gesture-controller-
|
|
8
|
+
const index = require('./index-0f8b33f8.js');
|
|
9
|
+
require('./gesture-controller-d6a3f907.js');
|
|
10
10
|
|
|
11
11
|
const createSwipeBackGesture = (el, canStartHandler, onStartHandler, onMoveHandler, onEndHandler) => {
|
|
12
12
|
const win = el.ownerDocument.defaultView;
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"components/col/col.js",
|
|
25
25
|
"components/content/content.js",
|
|
26
26
|
"components/datetime/datetime.js",
|
|
27
|
+
"components/picker-column-internal/picker-column-internal.js",
|
|
28
|
+
"components/picker-internal/picker-internal.js",
|
|
27
29
|
"components/datetime-button/datetime-button.js",
|
|
28
30
|
"components/fab/fab.js",
|
|
29
31
|
"components/fab-button/fab-button.js",
|
|
@@ -53,10 +55,8 @@
|
|
|
53
55
|
"components/nav/nav.js",
|
|
54
56
|
"components/nav-link/nav-link.js",
|
|
55
57
|
"components/note/note.js",
|
|
56
|
-
"components/picker/picker.js",
|
|
57
|
-
"components/picker-
|
|
58
|
-
"components/picker-column-internal/picker-column-internal.js",
|
|
59
|
-
"components/picker-internal/picker-internal.js",
|
|
58
|
+
"components/picker-column-legacy/picker-column.js",
|
|
59
|
+
"components/picker-legacy/picker.js",
|
|
60
60
|
"components/popover/popover.js",
|
|
61
61
|
"components/progress-bar/progress-bar.js",
|
|
62
62
|
"components/range/range.js",
|
|
@@ -287,8 +287,8 @@
|
|
|
287
287
|
{
|
|
288
288
|
"components": [
|
|
289
289
|
"ion-datetime",
|
|
290
|
-
"ion-picker",
|
|
291
|
-
"ion-picker-column"
|
|
290
|
+
"ion-picker-legacy",
|
|
291
|
+
"ion-picker-legacy-column"
|
|
292
292
|
]
|
|
293
293
|
},
|
|
294
294
|
{
|
|
@@ -2,25 +2,13 @@
|
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { Host, h } from "@stencil/core";
|
|
5
|
-
import { GESTURE_CONTROLLER } from "../../utils/gesture/index";
|
|
6
5
|
import { getIonMode } from "../../global/ionic-global";
|
|
7
6
|
export class Backdrop {
|
|
8
7
|
constructor() {
|
|
9
|
-
this.blocker = GESTURE_CONTROLLER.createBlocker({
|
|
10
|
-
disableScroll: true,
|
|
11
|
-
});
|
|
12
8
|
this.visible = true;
|
|
13
9
|
this.tappable = true;
|
|
14
10
|
this.stopPropagation = true;
|
|
15
11
|
}
|
|
16
|
-
connectedCallback() {
|
|
17
|
-
if (this.stopPropagation) {
|
|
18
|
-
this.blocker.block();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
disconnectedCallback() {
|
|
22
|
-
this.blocker.unblock();
|
|
23
|
-
}
|
|
24
12
|
onMouseDown(ev) {
|
|
25
13
|
this.emitTap(ev);
|
|
26
14
|
}
|
|
@@ -94,7 +94,7 @@ ion-picker-column-internal {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
|
-
* This ensures that the picker is
|
|
97
|
+
* This ensures that the picker is appropriately
|
|
98
98
|
* sized and never truncates the text.
|
|
99
99
|
*/
|
|
100
100
|
:host(.datetime-size-fixed.datetime-prefer-wheel) {
|
|
@@ -317,23 +317,8 @@ ion-picker-column-internal {
|
|
|
317
317
|
justify-content: space-between;
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
:host .calendar-action-buttons ion-item,
|
|
321
320
|
:host .calendar-action-buttons ion-button {
|
|
322
|
-
--background:
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
:host .calendar-action-buttons ion-item ion-label {
|
|
326
|
-
display: flex;
|
|
327
|
-
align-items: center;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
:host .calendar-action-buttons ion-item ion-icon {
|
|
331
|
-
-webkit-padding-start: 4px;
|
|
332
|
-
padding-inline-start: 4px;
|
|
333
|
-
-webkit-padding-end: 0;
|
|
334
|
-
padding-inline-end: 0;
|
|
335
|
-
padding-top: 0;
|
|
336
|
-
padding-bottom: 0;
|
|
321
|
+
--background: transparent;
|
|
337
322
|
}
|
|
338
323
|
|
|
339
324
|
:host .calendar-days-of-week {
|
|
@@ -515,8 +500,66 @@ ion-picker-column-internal {
|
|
|
515
500
|
position: static;
|
|
516
501
|
}
|
|
517
502
|
|
|
518
|
-
:host(.show-month-and-year) .calendar-action-buttons
|
|
519
|
-
|
|
503
|
+
:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle {
|
|
504
|
+
color: var(--ion-color-base);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.calendar-month-year {
|
|
508
|
+
min-width: 0;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.calendar-month-year-toggle {
|
|
512
|
+
font-family: inherit;
|
|
513
|
+
font-size: inherit;
|
|
514
|
+
font-style: inherit;
|
|
515
|
+
font-weight: inherit;
|
|
516
|
+
letter-spacing: inherit;
|
|
517
|
+
text-decoration: inherit;
|
|
518
|
+
text-indent: inherit;
|
|
519
|
+
text-overflow: inherit;
|
|
520
|
+
text-transform: inherit;
|
|
521
|
+
text-align: inherit;
|
|
522
|
+
white-space: inherit;
|
|
523
|
+
color: inherit;
|
|
524
|
+
position: relative;
|
|
525
|
+
border: 0;
|
|
526
|
+
outline: none;
|
|
527
|
+
background: transparent;
|
|
528
|
+
cursor: pointer;
|
|
529
|
+
z-index: 1;
|
|
530
|
+
}
|
|
531
|
+
.calendar-month-year-toggle::after {
|
|
532
|
+
left: 0;
|
|
533
|
+
right: 0;
|
|
534
|
+
top: 0;
|
|
535
|
+
bottom: 0;
|
|
536
|
+
position: absolute;
|
|
537
|
+
content: "";
|
|
538
|
+
opacity: 0;
|
|
539
|
+
transition: opacity 15ms linear, background-color 15ms linear;
|
|
540
|
+
z-index: -1;
|
|
541
|
+
}
|
|
542
|
+
.calendar-month-year-toggle.ion-focused::after {
|
|
543
|
+
background: currentColor;
|
|
544
|
+
}
|
|
545
|
+
.calendar-month-year-toggle:disabled {
|
|
546
|
+
opacity: 0.3;
|
|
547
|
+
pointer-events: none;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
.calendar-month-year-toggle ion-icon {
|
|
551
|
+
-webkit-padding-start: 4px;
|
|
552
|
+
padding-inline-start: 4px;
|
|
553
|
+
-webkit-padding-end: 0;
|
|
554
|
+
padding-inline-end: 0;
|
|
555
|
+
padding-top: 0;
|
|
556
|
+
padding-bottom: 0;
|
|
557
|
+
flex-shrink: 0;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.calendar-month-year-toggle #toggle-wrapper {
|
|
561
|
+
display: inline-flex;
|
|
562
|
+
align-items: center;
|
|
520
563
|
}
|
|
521
564
|
|
|
522
565
|
/**
|
|
@@ -605,15 +648,31 @@ ion-picker-column-internal {
|
|
|
605
648
|
margin-top: 10px;
|
|
606
649
|
}
|
|
607
650
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
651
|
+
.calendar-month-year-toggle {
|
|
652
|
+
-webkit-padding-start: 16px;
|
|
653
|
+
padding-inline-start: 16px;
|
|
654
|
+
-webkit-padding-end: 16px;
|
|
655
|
+
padding-inline-end: 16px;
|
|
656
|
+
padding-top: 0px;
|
|
657
|
+
padding-bottom: 0px;
|
|
658
|
+
min-height: 44px;
|
|
612
659
|
font-size: min(1rem, 25.6px);
|
|
613
660
|
font-weight: 600;
|
|
614
661
|
}
|
|
662
|
+
.calendar-month-year-toggle.ion-focused::after {
|
|
663
|
+
opacity: 0.15;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
.calendar-month-year-toggle #toggle-wrapper {
|
|
667
|
+
-webkit-margin-start: 0;
|
|
668
|
+
margin-inline-start: 0;
|
|
669
|
+
-webkit-margin-end: 8px;
|
|
670
|
+
margin-inline-end: 8px;
|
|
671
|
+
margin-top: 10px;
|
|
672
|
+
margin-bottom: 10px;
|
|
673
|
+
}
|
|
615
674
|
|
|
616
|
-
:host .calendar-action-buttons
|
|
675
|
+
:host .calendar-action-buttons .calendar-month-year-toggle ion-icon,
|
|
617
676
|
:host .calendar-action-buttons ion-buttons ion-button {
|
|
618
677
|
color: var(--ion-color-base);
|
|
619
678
|
}
|
|
@@ -704,24 +704,14 @@ export class Datetime {
|
|
|
704
704
|
* or modal that the datetime was presented in.
|
|
705
705
|
*/
|
|
706
706
|
async confirm(closeOverlay = false) {
|
|
707
|
-
const { isCalendarPicker, activeParts
|
|
707
|
+
const { isCalendarPicker, activeParts } = this;
|
|
708
708
|
/**
|
|
709
709
|
* We only update the value if the presentation is not a calendar picker.
|
|
710
710
|
*/
|
|
711
711
|
if (activeParts !== undefined || !isCalendarPicker) {
|
|
712
712
|
const activePartsIsArray = Array.isArray(activeParts);
|
|
713
713
|
if (activePartsIsArray && activeParts.length === 0) {
|
|
714
|
-
|
|
715
|
-
/**
|
|
716
|
-
* If the datetime is using a wheel picker, but the
|
|
717
|
-
* active parts are empty, then the user has confirmed the
|
|
718
|
-
* initial value (working parts) presented to them.
|
|
719
|
-
*/
|
|
720
|
-
this.setValue(convertDataToISO(workingParts));
|
|
721
|
-
}
|
|
722
|
-
else {
|
|
723
|
-
this.setValue(undefined);
|
|
724
|
-
}
|
|
714
|
+
this.setValue(undefined);
|
|
725
715
|
}
|
|
726
716
|
else {
|
|
727
717
|
this.setValue(convertDataToISO(activeParts));
|
|
@@ -925,18 +915,9 @@ export class Datetime {
|
|
|
925
915
|
const yearValues = (this.parsedYearValues = convertToArrayOfNumbers(this.yearValues));
|
|
926
916
|
const dayValues = (this.parsedDayValues = convertToArrayOfNumbers(this.dayValues));
|
|
927
917
|
const todayParts = (this.todayParts = parseDate(getToday()));
|
|
918
|
+
this.defaultParts = getClosestValidDate(todayParts, monthValues, dayValues, yearValues, hourValues, minuteValues);
|
|
928
919
|
this.processMinParts();
|
|
929
920
|
this.processMaxParts();
|
|
930
|
-
this.defaultParts = getClosestValidDate({
|
|
931
|
-
refParts: todayParts,
|
|
932
|
-
monthValues,
|
|
933
|
-
dayValues,
|
|
934
|
-
yearValues,
|
|
935
|
-
hourValues,
|
|
936
|
-
minuteValues,
|
|
937
|
-
minParts: this.minParts,
|
|
938
|
-
maxParts: this.maxParts,
|
|
939
|
-
});
|
|
940
921
|
this.processValue(this.value);
|
|
941
922
|
this.emitStyle();
|
|
942
923
|
}
|
|
@@ -1004,7 +985,7 @@ export class Datetime {
|
|
|
1004
985
|
: this.renderIndividualDatePickerColumns(forcePresentation);
|
|
1005
986
|
}
|
|
1006
987
|
renderCombinedDatePickerColumn() {
|
|
1007
|
-
const { defaultParts, workingParts, locale, minParts, maxParts, todayParts, isDateEnabled } = this;
|
|
988
|
+
const { defaultParts, disabled, workingParts, locale, minParts, maxParts, todayParts, isDateEnabled } = this;
|
|
1008
989
|
const activePart = this.getActivePartsWithFallback();
|
|
1009
990
|
/**
|
|
1010
991
|
* By default, generate a range of 3 months:
|
|
@@ -1055,7 +1036,7 @@ export class Datetime {
|
|
|
1055
1036
|
const todayString = workingParts.day !== null
|
|
1056
1037
|
? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
|
|
1057
1038
|
: `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
|
|
1058
|
-
return (h("ion-picker-column-internal", { class: "date-column", color: this.color, items: items, value: todayString, onIonChange: (ev) => {
|
|
1039
|
+
return (h("ion-picker-column-internal", { class: "date-column", color: this.color, disabled: disabled, items: items, value: todayString, onIonChange: (ev) => {
|
|
1059
1040
|
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
1060
1041
|
// Due to a Safari 14 issue we need to destroy
|
|
1061
1042
|
// the scroll listener before we update state
|
|
@@ -1137,9 +1118,9 @@ export class Datetime {
|
|
|
1137
1118
|
if (days.length === 0) {
|
|
1138
1119
|
return [];
|
|
1139
1120
|
}
|
|
1140
|
-
const { workingParts } = this;
|
|
1121
|
+
const { disabled, workingParts } = this;
|
|
1141
1122
|
const activePart = this.getActivePartsWithFallback();
|
|
1142
|
-
return (h("ion-picker-column-internal", { class: "day-column", color: this.color, items: days, value: (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined, onIonChange: (ev) => {
|
|
1123
|
+
return (h("ion-picker-column-internal", { class: "day-column", color: this.color, disabled: disabled, items: days, value: (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined, onIonChange: (ev) => {
|
|
1143
1124
|
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
1144
1125
|
// Due to a Safari 14 issue we need to destroy
|
|
1145
1126
|
// the scroll listener before we update state
|
|
@@ -1159,9 +1140,9 @@ export class Datetime {
|
|
|
1159
1140
|
if (months.length === 0) {
|
|
1160
1141
|
return [];
|
|
1161
1142
|
}
|
|
1162
|
-
const { workingParts } = this;
|
|
1143
|
+
const { disabled, workingParts } = this;
|
|
1163
1144
|
const activePart = this.getActivePartsWithFallback();
|
|
1164
|
-
return (h("ion-picker-column-internal", { class: "month-column", color: this.color, items: months, value: workingParts.month, onIonChange: (ev) => {
|
|
1145
|
+
return (h("ion-picker-column-internal", { class: "month-column", color: this.color, disabled: disabled, items: months, value: workingParts.month, onIonChange: (ev) => {
|
|
1165
1146
|
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
1166
1147
|
// Due to a Safari 14 issue we need to destroy
|
|
1167
1148
|
// the scroll listener before we update state
|
|
@@ -1181,9 +1162,9 @@ export class Datetime {
|
|
|
1181
1162
|
if (years.length === 0) {
|
|
1182
1163
|
return [];
|
|
1183
1164
|
}
|
|
1184
|
-
const { workingParts } = this;
|
|
1165
|
+
const { disabled, workingParts } = this;
|
|
1185
1166
|
const activePart = this.getActivePartsWithFallback();
|
|
1186
|
-
return (h("ion-picker-column-internal", { class: "year-column", color: this.color, items: years, value: workingParts.year, onIonChange: (ev) => {
|
|
1167
|
+
return (h("ion-picker-column-internal", { class: "year-column", color: this.color, disabled: disabled, items: years, value: workingParts.year, onIonChange: (ev) => {
|
|
1187
1168
|
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
1188
1169
|
// Due to a Safari 14 issue we need to destroy
|
|
1189
1170
|
// the scroll listener before we update state
|
|
@@ -1222,35 +1203,35 @@ export class Datetime {
|
|
|
1222
1203
|
];
|
|
1223
1204
|
}
|
|
1224
1205
|
renderHourPickerColumn(hoursData) {
|
|
1225
|
-
const { workingParts } = this;
|
|
1206
|
+
const { disabled, workingParts } = this;
|
|
1226
1207
|
if (hoursData.length === 0)
|
|
1227
1208
|
return [];
|
|
1228
1209
|
const activePart = this.getActivePartsWithFallback();
|
|
1229
|
-
return (h("ion-picker-column-internal", { color: this.color, value: activePart.hour, items: hoursData, numericInput: true, onIonChange: (ev) => {
|
|
1210
|
+
return (h("ion-picker-column-internal", { color: this.color, disabled: disabled, value: activePart.hour, items: hoursData, numericInput: true, onIonChange: (ev) => {
|
|
1230
1211
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
|
|
1231
1212
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { hour: ev.detail.value }));
|
|
1232
1213
|
ev.stopPropagation();
|
|
1233
1214
|
} }));
|
|
1234
1215
|
}
|
|
1235
1216
|
renderMinutePickerColumn(minutesData) {
|
|
1236
|
-
const { workingParts } = this;
|
|
1217
|
+
const { disabled, workingParts } = this;
|
|
1237
1218
|
if (minutesData.length === 0)
|
|
1238
1219
|
return [];
|
|
1239
1220
|
const activePart = this.getActivePartsWithFallback();
|
|
1240
|
-
return (h("ion-picker-column-internal", { color: this.color, value: activePart.minute, items: minutesData, numericInput: true, onIonChange: (ev) => {
|
|
1221
|
+
return (h("ion-picker-column-internal", { color: this.color, disabled: disabled, value: activePart.minute, items: minutesData, numericInput: true, onIonChange: (ev) => {
|
|
1241
1222
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
|
|
1242
1223
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { minute: ev.detail.value }));
|
|
1243
1224
|
ev.stopPropagation();
|
|
1244
1225
|
} }));
|
|
1245
1226
|
}
|
|
1246
1227
|
renderDayPeriodPickerColumn(dayPeriodData) {
|
|
1247
|
-
const { workingParts } = this;
|
|
1228
|
+
const { disabled, workingParts } = this;
|
|
1248
1229
|
if (dayPeriodData.length === 0) {
|
|
1249
1230
|
return [];
|
|
1250
1231
|
}
|
|
1251
1232
|
const activePart = this.getActivePartsWithFallback();
|
|
1252
1233
|
const isDayPeriodRTL = isLocaleDayPeriodRTL(this.locale);
|
|
1253
|
-
return (h("ion-picker-column-internal", { style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, value: activePart.ampm, items: dayPeriodData, onIonChange: (ev) => {
|
|
1234
|
+
return (h("ion-picker-column-internal", { style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, items: dayPeriodData, onIonChange: (ev) => {
|
|
1254
1235
|
const hour = calculateHourFromAMPM(workingParts, ev.detail.value);
|
|
1255
1236
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
|
|
1256
1237
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { ampm: ev.detail.value, hour }));
|
|
@@ -1276,26 +1257,11 @@ export class Datetime {
|
|
|
1276
1257
|
const nextMonthDisabled = disabled || isNextMonthDisabled(this.workingParts, this.maxParts);
|
|
1277
1258
|
// don't use the inheritAttributes util because it removes dir from the host, and we still need that
|
|
1278
1259
|
const hostDir = this.el.getAttribute('dir') || undefined;
|
|
1279
|
-
return (h("div", { class: "calendar-header" }, h("div", { class: "calendar-action-buttons" }, h("div", { class: "calendar-month-year" }, h("
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
*
|
|
1285
|
-
* Currently there is not a way to set the aria-label on the inner button
|
|
1286
|
-
* on the `ion-item` and have it be reactive to changes. This is a workaround
|
|
1287
|
-
* until we either refactor `ion-item` to a button or Stencil adds a way to
|
|
1288
|
-
* have reactive props for built-in properties, such as `aria-label`.
|
|
1289
|
-
*/
|
|
1290
|
-
const { monthYearToggleItemRef } = this;
|
|
1291
|
-
if (monthYearToggleItemRef) {
|
|
1292
|
-
const btn = (_a = monthYearToggleItemRef.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.item-native');
|
|
1293
|
-
if (btn) {
|
|
1294
|
-
const monthYearAriaLabel = this.showMonthAndYear ? 'Hide year picker' : 'Show year picker';
|
|
1295
|
-
btn.setAttribute('aria-label', monthYearAriaLabel);
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
} }, h("ion-label", null, getMonthAndYear(this.locale, this.workingParts), h("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? expandedIcon : collapsedIcon, lazy: false, flipRtl: true })))), h("div", { class: "calendar-next-prev" }, h("ion-buttons", null, h("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth() }, h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: chevronBack, lazy: false, flipRtl: true })), h("ion-button", { "aria-label": "Next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth() }, h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: chevronForward, lazy: false, flipRtl: true }))))), h("div", { class: "calendar-days-of-week", "aria-hidden": "true" }, getDaysOfWeek(this.locale, mode, this.firstDayOfWeek % 7).map((d) => {
|
|
1260
|
+
return (h("div", { class: "calendar-header" }, h("div", { class: "calendar-action-buttons" }, h("div", { class: "calendar-month-year" }, h("button", { class: {
|
|
1261
|
+
'calendar-month-year-toggle': true,
|
|
1262
|
+
'ion-activatable': true,
|
|
1263
|
+
'ion-focusable': true,
|
|
1264
|
+
}, part: "month-year-button", disabled: disabled, "aria-label": this.showMonthAndYear ? 'Hide year picker' : 'Show year picker', onClick: () => this.toggleMonthAndYearView() }, h("span", { id: "toggle-wrapper" }, getMonthAndYear(this.locale, this.workingParts), h("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? expandedIcon : collapsedIcon, lazy: false, flipRtl: true })), mode === 'md' && h("ion-ripple-effect", null))), h("div", { class: "calendar-next-prev" }, h("ion-buttons", null, h("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth() }, h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: chevronBack, lazy: false, flipRtl: true })), h("ion-button", { "aria-label": "Next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth() }, h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: chevronForward, lazy: false, flipRtl: true }))))), h("div", { class: "calendar-days-of-week", "aria-hidden": "true" }, getDaysOfWeek(this.locale, mode, this.firstDayOfWeek % 7).map((d) => {
|
|
1299
1265
|
return h("div", { class: "day-of-week" }, d);
|
|
1300
1266
|
}))));
|
|
1301
1267
|
}
|
|
@@ -94,7 +94,7 @@ ion-picker-column-internal {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
|
-
* This ensures that the picker is
|
|
97
|
+
* This ensures that the picker is appropriately
|
|
98
98
|
* sized and never truncates the text.
|
|
99
99
|
*/
|
|
100
100
|
:host(.datetime-size-fixed.datetime-prefer-wheel) {
|
|
@@ -317,23 +317,8 @@ ion-picker-column-internal {
|
|
|
317
317
|
justify-content: space-between;
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
:host .calendar-action-buttons ion-item,
|
|
321
320
|
:host .calendar-action-buttons ion-button {
|
|
322
|
-
--background:
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
:host .calendar-action-buttons ion-item ion-label {
|
|
326
|
-
display: flex;
|
|
327
|
-
align-items: center;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
:host .calendar-action-buttons ion-item ion-icon {
|
|
331
|
-
-webkit-padding-start: 4px;
|
|
332
|
-
padding-inline-start: 4px;
|
|
333
|
-
-webkit-padding-end: 0;
|
|
334
|
-
padding-inline-end: 0;
|
|
335
|
-
padding-top: 0;
|
|
336
|
-
padding-bottom: 0;
|
|
321
|
+
--background: transparent;
|
|
337
322
|
}
|
|
338
323
|
|
|
339
324
|
:host .calendar-days-of-week {
|
|
@@ -515,8 +500,66 @@ ion-picker-column-internal {
|
|
|
515
500
|
position: static;
|
|
516
501
|
}
|
|
517
502
|
|
|
518
|
-
:host(.show-month-and-year) .calendar-action-buttons
|
|
519
|
-
|
|
503
|
+
:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle {
|
|
504
|
+
color: var(--ion-color-base);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.calendar-month-year {
|
|
508
|
+
min-width: 0;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.calendar-month-year-toggle {
|
|
512
|
+
font-family: inherit;
|
|
513
|
+
font-size: inherit;
|
|
514
|
+
font-style: inherit;
|
|
515
|
+
font-weight: inherit;
|
|
516
|
+
letter-spacing: inherit;
|
|
517
|
+
text-decoration: inherit;
|
|
518
|
+
text-indent: inherit;
|
|
519
|
+
text-overflow: inherit;
|
|
520
|
+
text-transform: inherit;
|
|
521
|
+
text-align: inherit;
|
|
522
|
+
white-space: inherit;
|
|
523
|
+
color: inherit;
|
|
524
|
+
position: relative;
|
|
525
|
+
border: 0;
|
|
526
|
+
outline: none;
|
|
527
|
+
background: transparent;
|
|
528
|
+
cursor: pointer;
|
|
529
|
+
z-index: 1;
|
|
530
|
+
}
|
|
531
|
+
.calendar-month-year-toggle::after {
|
|
532
|
+
left: 0;
|
|
533
|
+
right: 0;
|
|
534
|
+
top: 0;
|
|
535
|
+
bottom: 0;
|
|
536
|
+
position: absolute;
|
|
537
|
+
content: "";
|
|
538
|
+
opacity: 0;
|
|
539
|
+
transition: opacity 15ms linear, background-color 15ms linear;
|
|
540
|
+
z-index: -1;
|
|
541
|
+
}
|
|
542
|
+
.calendar-month-year-toggle.ion-focused::after {
|
|
543
|
+
background: currentColor;
|
|
544
|
+
}
|
|
545
|
+
.calendar-month-year-toggle:disabled {
|
|
546
|
+
opacity: 0.3;
|
|
547
|
+
pointer-events: none;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
.calendar-month-year-toggle ion-icon {
|
|
551
|
+
-webkit-padding-start: 4px;
|
|
552
|
+
padding-inline-start: 4px;
|
|
553
|
+
-webkit-padding-end: 0;
|
|
554
|
+
padding-inline-end: 0;
|
|
555
|
+
padding-top: 0;
|
|
556
|
+
padding-bottom: 0;
|
|
557
|
+
flex-shrink: 0;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.calendar-month-year-toggle #toggle-wrapper {
|
|
561
|
+
display: inline-flex;
|
|
562
|
+
align-items: center;
|
|
520
563
|
}
|
|
521
564
|
|
|
522
565
|
/**
|
|
@@ -600,15 +643,36 @@ ion-picker-column-internal {
|
|
|
600
643
|
font-size: 2.125rem;
|
|
601
644
|
}
|
|
602
645
|
|
|
603
|
-
:host .datetime-calendar .calendar-action-buttons ion-item {
|
|
604
|
-
--padding-start: 20px;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
:host .calendar-action-buttons ion-item,
|
|
608
646
|
:host .calendar-action-buttons ion-button {
|
|
609
647
|
--color: var(--ion-color-step-650, #595959);
|
|
610
648
|
}
|
|
611
649
|
|
|
650
|
+
.calendar-month-year-toggle {
|
|
651
|
+
-webkit-padding-start: 20px;
|
|
652
|
+
padding-inline-start: 20px;
|
|
653
|
+
-webkit-padding-end: 16px;
|
|
654
|
+
padding-inline-end: 16px;
|
|
655
|
+
padding-top: 12px;
|
|
656
|
+
padding-bottom: 12px;
|
|
657
|
+
min-height: 48px;
|
|
658
|
+
background: transparent;
|
|
659
|
+
color: var(--ion-color-step-650, #595959);
|
|
660
|
+
z-index: 1;
|
|
661
|
+
}
|
|
662
|
+
.calendar-month-year-toggle.ion-focused::after {
|
|
663
|
+
opacity: 0.04;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
.calendar-month-year-toggle ion-ripple-effect {
|
|
667
|
+
color: currentColor;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
@media (any-hover: hover) {
|
|
671
|
+
.calendar-month-year-toggle.ion-activatable:not(.ion-focused):hover::after {
|
|
672
|
+
background: currentColor;
|
|
673
|
+
opacity: 0.04;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
612
676
|
:host .calendar-days-of-week {
|
|
613
677
|
-webkit-padding-start: 10px;
|
|
614
678
|
padding-inline-start: 10px;
|
|
@@ -38,7 +38,7 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) =>
|
|
|
38
38
|
`, config);
|
|
39
39
|
const tabKey = browserName === 'webkit' ? 'Alt+Tab' : 'Tab';
|
|
40
40
|
const datetime = page.locator('ion-datetime');
|
|
41
|
-
const monthYearButton = page.locator('.calendar-month-year
|
|
41
|
+
const monthYearButton = page.locator('.calendar-month-year-toggle');
|
|
42
42
|
const prevButton = page.locator('.calendar-next-prev ion-button:nth-child(1)');
|
|
43
43
|
const nextButton = page.locator('.calendar-next-prev ion-button:nth-child(2)');
|
|
44
44
|
await page.keyboard.press(tabKey);
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { newSpecPage } from "@stencil/core/testing";
|
|
5
|
-
import { Item } from "../../../item/item";
|
|
6
5
|
import { Datetime } from "../../datetime";
|
|
7
6
|
describe('datetime', () => {
|
|
8
7
|
beforeEach(() => {
|
|
@@ -18,25 +17,23 @@ describe('datetime', () => {
|
|
|
18
17
|
let page;
|
|
19
18
|
beforeEach(async () => {
|
|
20
19
|
page = await newSpecPage({
|
|
21
|
-
components: [Datetime
|
|
20
|
+
components: [Datetime],
|
|
22
21
|
html: `<ion-datetime></ion-datetime>`,
|
|
23
22
|
});
|
|
24
23
|
});
|
|
25
24
|
it('should have aria-label "Show year picker" when collapsed', async () => {
|
|
26
25
|
const datetime = page.body.querySelector('ion-datetime');
|
|
27
|
-
const
|
|
28
|
-
const monthYearToggleBtn = item.shadowRoot.querySelector('button');
|
|
26
|
+
const monthYearToggleBtn = datetime.shadowRoot.querySelector('.calendar-month-year .calendar-month-year-toggle');
|
|
29
27
|
const ariaLabel = monthYearToggleBtn.getAttribute('aria-label');
|
|
30
28
|
expect(ariaLabel).toContain('Show year picker');
|
|
31
29
|
});
|
|
32
30
|
it('should have aria-label "Hide year picker" when expanded', async () => {
|
|
33
31
|
const datetime = page.body.querySelector('ion-datetime');
|
|
34
|
-
const
|
|
35
|
-
|
|
32
|
+
const monthYearToggleBtn = datetime.shadowRoot.querySelector('.calendar-month-year .calendar-month-year-toggle');
|
|
33
|
+
monthYearToggleBtn.click();
|
|
36
34
|
await page.waitForChanges();
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const ariaLabel = monthYearToggleBtn.getAttribute('aria-label');
|
|
35
|
+
const monthYearToggleBtnAfter = datetime.shadowRoot.querySelector('.calendar-month-year .calendar-month-year-toggle');
|
|
36
|
+
const ariaLabel = monthYearToggleBtnAfter.getAttribute('aria-label');
|
|
40
37
|
expect(ariaLabel).toContain('Hide year picker');
|
|
41
38
|
});
|
|
42
39
|
});
|
|
@@ -372,4 +372,14 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|
|
372
372
|
await expect(datetime).toHaveScreenshot(screenshot(`datetime-focus-calendar-day`));
|
|
373
373
|
});
|
|
374
374
|
});
|
|
375
|
+
test.describe(title('datetime: calendar month toggle'), () => {
|
|
376
|
+
test('should have focus styles', async ({ page }) => {
|
|
377
|
+
await page.setContent('<ion-datetime value="2021-01-01"></ion-datetime>', config);
|
|
378
|
+
const datetime = page.locator('ion-datetime');
|
|
379
|
+
await page.waitForSelector('.datetime-ready');
|
|
380
|
+
const monthYearToggle = datetime.locator('.calendar-month-year-toggle');
|
|
381
|
+
monthYearToggle.evaluate((el) => el.classList.add('ion-focused'));
|
|
382
|
+
await expect(datetime).toHaveScreenshot(screenshot(`date-month-toggle-focused`));
|
|
383
|
+
});
|
|
384
|
+
});
|
|
375
385
|
});
|