@ionic/core 7.3.2-dev.11693321763.15a54694 → 7.3.2-dev.11693507138.1f9ed625
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/checkbox.js +6 -3
- package/components/data.js +31 -7
- package/components/framework-delegate.js +2 -21
- package/components/ion-datetime-button.js +3 -0
- package/components/ion-datetime.js +106 -81
- package/components/ion-modal.js +1 -1
- package/components/ion-range.js +2 -2
- package/components/ion-toggle.js +6 -3
- package/components/popover.js +1 -1
- package/components/radio.js +6 -3
- package/dist/cjs/{data-967b9c15.js → data-db832785.js} +31 -7
- package/dist/cjs/{framework-delegate-c0873a6f.js → framework-delegate-e8174951.js} +2 -21
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/ion-action-sheet.cjs.entry.js +2 -2
- package/dist/cjs/ion-alert.cjs.entry.js +2 -2
- package/dist/cjs/ion-app_8.cjs.entry.js +1 -1
- package/dist/cjs/ion-checkbox.cjs.entry.js +5 -3
- package/dist/cjs/ion-datetime-button.cjs.entry.js +4 -1
- package/dist/cjs/ion-datetime_3.cjs.entry.js +108 -84
- package/dist/cjs/ion-loading.cjs.entry.js +2 -2
- package/dist/cjs/ion-menu_3.cjs.entry.js +2 -2
- 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-popover.cjs.entry.js +3 -3
- package/dist/cjs/ion-radio_2.cjs.entry.js +5 -3
- package/dist/cjs/ion-range.cjs.entry.js +2 -2
- package/dist/cjs/ion-select_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-toast.cjs.entry.js +2 -2
- package/dist/cjs/ion-toggle.cjs.entry.js +5 -3
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{overlays-5c1706ed.js → overlays-0ea06fcb.js} +1 -1
- package/dist/collection/components/checkbox/checkbox.ios.css +35 -0
- package/dist/collection/components/checkbox/checkbox.js +24 -4
- package/dist/collection/components/checkbox/checkbox.md.css +35 -0
- package/dist/collection/components/checkbox/test/item/checkbox.e2e.js +13 -0
- package/dist/collection/components/checkbox/test/label/checkbox.e2e.js +16 -0
- package/dist/collection/components/datetime/datetime.js +107 -84
- package/dist/collection/components/datetime/test/prefer-wheel/datetime.e2e.js +15 -0
- package/dist/collection/components/datetime/test/set-value/datetime.e2e.js +9 -12
- package/dist/collection/components/datetime/utils/data.js +14 -6
- package/dist/collection/components/datetime/utils/parse.js +18 -1
- package/dist/collection/components/datetime-button/datetime-button.js +3 -0
- package/dist/collection/components/modal/modal.js +1 -1
- package/dist/collection/components/popover/popover.js +1 -1
- package/dist/collection/components/radio/radio.ios.css +35 -0
- package/dist/collection/components/radio/radio.js +24 -4
- package/dist/collection/components/radio/radio.md.css +35 -0
- package/dist/collection/components/radio/test/item/radio.e2e.js +15 -0
- package/dist/collection/components/radio/test/label-placement/radio.e2e.js +20 -0
- package/dist/collection/components/range/range.ios.css +41 -1
- package/dist/collection/components/range/range.js +3 -3
- package/dist/collection/components/range/range.md.css +41 -1
- package/dist/collection/components/range/test/label/range.e2e.js +48 -0
- package/dist/collection/components/toggle/test/item/toggle.e2e.js +15 -0
- package/dist/collection/components/toggle/test/label/toggle.e2e.js +16 -0
- package/dist/collection/components/toggle/toggle.ios.css +35 -1
- package/dist/collection/components/toggle/toggle.js +24 -4
- package/dist/collection/components/toggle/toggle.md.css +35 -1
- package/dist/collection/utils/framework-delegate.js +2 -21
- package/dist/docs.json +115 -18
- package/dist/esm/{data-4b448e3a.js → data-009dbf15.js} +31 -7
- package/dist/esm/{framework-delegate-aa433dea.js → framework-delegate-2b76c681.js} +2 -21
- package/dist/esm/index.js +2 -2
- package/dist/esm/ion-action-sheet.entry.js +2 -2
- package/dist/esm/ion-alert.entry.js +2 -2
- package/dist/esm/ion-app_8.entry.js +1 -1
- package/dist/esm/ion-checkbox.entry.js +5 -3
- package/dist/esm/ion-datetime-button.entry.js +4 -1
- package/dist/esm/ion-datetime_3.entry.js +108 -84
- package/dist/esm/ion-loading.entry.js +2 -2
- package/dist/esm/ion-menu_3.entry.js +2 -2
- package/dist/esm/ion-modal.entry.js +3 -3
- package/dist/esm/ion-nav_2.entry.js +1 -1
- package/dist/esm/ion-popover.entry.js +3 -3
- package/dist/esm/ion-radio_2.entry.js +5 -3
- package/dist/esm/ion-range.entry.js +2 -2
- package/dist/esm/ion-select_3.entry.js +2 -2
- package/dist/esm/ion-tab_2.entry.js +1 -1
- package/dist/esm/ion-toast.entry.js +2 -2
- package/dist/esm/ion-toggle.entry.js +5 -3
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{overlays-e1dadfe6.js → overlays-c3387ec0.js} +1 -1
- package/dist/esm-es5/data-009dbf15.js +4 -0
- package/dist/esm-es5/framework-delegate-2b76c681.js +4 -0
- 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-checkbox.entry.js +1 -1
- package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-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-popover.entry.js +1 -1
- package/dist/esm-es5/ion-radio_2.entry.js +1 -1
- package/dist/esm-es5/ion-range.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-tab_2.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-e1dadfe6.js → overlays-c3387ec0.js} +1 -1
- package/dist/html.html-data.json +52 -4
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-84a95033.system.entry.js → p-06f1f560.system.entry.js} +1 -1
- package/dist/ionic/p-1f4adf06.system.entry.js +4 -0
- package/dist/ionic/{p-c759a704.entry.js → p-20087c90.entry.js} +1 -1
- package/dist/ionic/{p-98ebc376.entry.js → p-229df0d8.entry.js} +1 -1
- package/dist/ionic/{p-51669f1e.system.entry.js → p-2936ec7f.system.entry.js} +1 -1
- package/dist/ionic/{p-e44233f5.entry.js → p-29b3e70a.entry.js} +1 -1
- package/dist/ionic/{p-2bff71d5.system.entry.js → p-2bc49e5d.system.entry.js} +1 -1
- package/dist/ionic/{p-f2c667c9.system.entry.js → p-2da3e015.system.entry.js} +1 -1
- package/dist/ionic/p-2f8bea16.entry.js +4 -0
- package/dist/ionic/p-40138199.entry.js +4 -0
- package/dist/ionic/{p-7c9dd24d.entry.js → p-423d5a4d.entry.js} +1 -1
- package/dist/ionic/p-44ef7224.system.js +4 -0
- package/dist/ionic/p-4ca1ce6b.system.entry.js +4 -0
- package/dist/ionic/{p-f7faa32d.entry.js → p-5c96dc4e.entry.js} +1 -1
- package/dist/ionic/{p-582dc7c1.js → p-5ef91692.js} +1 -1
- package/dist/ionic/{p-f9708a54.entry.js → p-61769039.entry.js} +1 -1
- package/dist/ionic/{p-d3b8aebf.entry.js → p-67b891af.entry.js} +1 -1
- package/dist/ionic/{p-d1d3b740.system.entry.js → p-6b9bf14c.system.entry.js} +1 -1
- package/dist/ionic/p-6da27ab8.system.entry.js +4 -0
- package/dist/ionic/p-721933ff.system.js +1 -1
- package/dist/ionic/{p-f789b7fa.entry.js → p-74723f41.entry.js} +1 -1
- package/dist/ionic/{p-28f5715a.system.entry.js → p-74bd26b8.system.entry.js} +1 -1
- package/dist/ionic/p-7cfd253c.js +4 -0
- package/dist/ionic/{p-45ee211b.system.entry.js → p-8074bdd7.system.entry.js} +1 -1
- package/dist/ionic/{p-b32742f3.system.js → p-81b46714.system.js} +1 -1
- package/dist/ionic/p-86c5c320.entry.js +4 -0
- package/dist/ionic/{p-613d4042.system.js → p-8d9475b5.system.js} +1 -1
- package/dist/ionic/{p-d693e765.system.entry.js → p-8fa43732.system.entry.js} +1 -1
- package/dist/ionic/p-90ec5785.system.entry.js +4 -0
- package/dist/ionic/{p-091cd81e.entry.js → p-958bde76.entry.js} +1 -1
- package/dist/ionic/{p-b3a58769.entry.js → p-9b3c3564.entry.js} +1 -1
- package/dist/ionic/p-af986299.system.entry.js +4 -0
- package/dist/ionic/p-b321c999.entry.js +4 -0
- package/dist/ionic/p-b34c1ae1.js +4 -0
- package/dist/ionic/{p-5c17f888.entry.js → p-c0d1e5a1.entry.js} +1 -1
- package/dist/ionic/{p-dab7745f.system.entry.js → p-ccea9adc.system.entry.js} +1 -1
- package/dist/ionic/{p-0b68c41d.system.entry.js → p-d1356034.system.entry.js} +1 -1
- package/dist/ionic/{p-d9eb4632.system.entry.js → p-d5db0834.system.entry.js} +1 -1
- package/dist/ionic/{p-79e3f0b6.entry.js → p-d8538837.entry.js} +1 -1
- package/dist/ionic/p-d8a0267b.system.entry.js +4 -0
- package/dist/ionic/{p-8843b046.system.js → p-db46fc66.system.js} +1 -1
- package/dist/ionic/p-f5c19164.entry.js +4 -0
- package/dist/types/components/checkbox/checkbox.d.ts +8 -1
- package/dist/types/components/datetime/datetime.d.ts +17 -10
- package/dist/types/components/datetime/utils/data.d.ts +1 -1
- package/dist/types/components/datetime/utils/parse.d.ts +3 -3
- package/dist/types/components/radio/radio.d.ts +8 -1
- package/dist/types/components/range/range.d.ts +2 -1
- package/dist/types/components/toast/toast-interface.d.ts +3 -0
- package/dist/types/components/toggle/toggle.d.ts +8 -1
- package/dist/types/components.d.ts +40 -16
- package/hydrate/index.js +164 -122
- package/package.json +1 -1
- package/dist/collection/components/popover/test/async/popover.e2e.js +0 -20
- package/dist/esm-es5/data-4b448e3a.js +0 -4
- package/dist/esm-es5/framework-delegate-aa433dea.js +0 -4
- package/dist/ionic/p-0053fe81.system.entry.js +0 -4
- package/dist/ionic/p-2cdcd6f2.entry.js +0 -4
- package/dist/ionic/p-3565c8a0.entry.js +0 -4
- package/dist/ionic/p-5b88f780.entry.js +0 -4
- package/dist/ionic/p-601fd53c.js +0 -4
- package/dist/ionic/p-98b618ce.system.entry.js +0 -4
- package/dist/ionic/p-b1e8f045.entry.js +0 -4
- package/dist/ionic/p-b287ab05.js +0 -4
- package/dist/ionic/p-b3cfc6e1.system.entry.js +0 -4
- package/dist/ionic/p-b54a1fcb.system.entry.js +0 -4
- package/dist/ionic/p-cc8910e7.system.js +0 -4
- package/dist/ionic/p-e53b8af4.system.entry.js +0 -4
- package/dist/ionic/p-f78e60a5.entry.js +0 -4
- package/dist/ionic/p-fd42994b.system.entry.js +0 -4
package/components/checkbox.js
CHANGED
|
@@ -8,9 +8,9 @@ import { p as printIonWarning } from './index6.js';
|
|
|
8
8
|
import { c as createColorClasses, h as hostContext } from './theme.js';
|
|
9
9
|
import { b as getIonMode } from './ionic-global.js';
|
|
10
10
|
|
|
11
|
-
const checkboxIosCss = ":host{--checkbox-background-checked:var(--ion-color-primary, #3880ff);--border-color-checked:var(--ion-color-primary, #3880ff);--checkmark-color:var(--ion-color-primary-contrast, #fff);--checkmark-width:1;--transition:none;display:inline-block;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.in-item){width:100%;height:100%}:host([slot=start]:not(.legacy-checkbox)),:host([slot=end]:not(.legacy-checkbox)){width:auto}:host(.legacy-checkbox){width:var(--size);height:var(--size)}:host(.ion-color){--checkbox-background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}:host(.legacy-checkbox) label{top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}@supports (inset-inline-start: 0){:host(.legacy-checkbox) label{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.legacy-checkbox) label{left:0}:host-context([dir=rtl]):host(.legacy-checkbox) label,:host-context([dir=rtl]).legacy-checkbox label{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.legacy-checkbox) label:dir(rtl){left:unset;right:unset;right:0}}}:host(.legacy-checkbox) label::-moz-focus-inner{border:0}.checkbox-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit;cursor:inherit}.label-text-wrapper{pointer-events:none;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item:not(.legacy-checkbox)) .label-text-wrapper{margin-top:10px;margin-bottom:10px}.label-text-wrapper-hidden{display:none}input{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}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.checkbox-icon{border-radius:var(--border-radius);position:relative;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--checkbox-background);-webkit-box-sizing:border-box;box-sizing:border-box}:host(.legacy-checkbox) .checkbox-icon{display:block;width:100%;height:100%}:host(:not(.legacy-checkbox)) .checkbox-icon{width:var(--size);height:var(--size)}.checkbox-icon path{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}:host(.checkbox-justify-space-between) .checkbox-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.checkbox-justify-start) .checkbox-wrapper{-ms-flex-pack:start;justify-content:start}:host(.checkbox-justify-end) .checkbox-wrapper{-ms-flex-pack:end;justify-content:end}:host(.checkbox-label-placement-start) .checkbox-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.checkbox-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-end) .checkbox-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.checkbox-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.checkbox-checked) .checkbox-icon,:host(.checkbox-indeterminate) .checkbox-icon{border-color:var(--border-color-checked);background:var(--checkbox-background-checked)}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{opacity:1}:host(.checkbox-disabled){pointer-events:none}:host{--border-radius:50%;--border-width:1px;--border-style:solid;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.23);--checkbox-background:var(--ion-item-background, var(--ion-background-color, #fff));--size:26px}:host(.checkbox-disabled){opacity:0.3}:host(.in-item.legacy-checkbox){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:9px;display:block;position:static}:host(.in-item.legacy-checkbox[slot=start]){-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:8px;margin-bottom:8px}";
|
|
11
|
+
const checkboxIosCss = ":host{--checkbox-background-checked:var(--ion-color-primary, #3880ff);--border-color-checked:var(--ion-color-primary, #3880ff);--checkmark-color:var(--ion-color-primary-contrast, #fff);--checkmark-width:1;--transition:none;display:inline-block;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.in-item){width:100%;height:100%}:host([slot=start]:not(.legacy-checkbox)),:host([slot=end]:not(.legacy-checkbox)){width:auto}:host(.legacy-checkbox){width:var(--size);height:var(--size)}:host(.ion-color){--checkbox-background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}:host(.legacy-checkbox) label{top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}@supports (inset-inline-start: 0){:host(.legacy-checkbox) label{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.legacy-checkbox) label{left:0}:host-context([dir=rtl]):host(.legacy-checkbox) label,:host-context([dir=rtl]).legacy-checkbox label{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.legacy-checkbox) label:dir(rtl){left:unset;right:unset;right:0}}}:host(.legacy-checkbox) label::-moz-focus-inner{border:0}.checkbox-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit;cursor:inherit}.label-text-wrapper{pointer-events:none;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item:not(.legacy-checkbox)) .label-text-wrapper{margin-top:10px;margin-bottom:10px}:host(.in-item.checkbox-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.checkbox-label-placement-stacked) .native-wrapper{margin-bottom:10px}.label-text-wrapper-hidden{display:none}input{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}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.checkbox-icon{border-radius:var(--border-radius);position:relative;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--checkbox-background);-webkit-box-sizing:border-box;box-sizing:border-box}:host(.legacy-checkbox) .checkbox-icon{display:block;width:100%;height:100%}:host(:not(.legacy-checkbox)) .checkbox-icon{width:var(--size);height:var(--size)}.checkbox-icon path{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}:host(.checkbox-justify-space-between) .checkbox-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.checkbox-justify-start) .checkbox-wrapper{-ms-flex-pack:start;justify-content:start}:host(.checkbox-justify-end) .checkbox-wrapper{-ms-flex-pack:end;justify-content:end}:host(.checkbox-alignment-start) .checkbox-wrapper{-ms-flex-align:start;align-items:start}:host(.checkbox-alignment-center) .checkbox-wrapper{-ms-flex-align:center;align-items:center}:host(.checkbox-label-placement-start) .checkbox-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.checkbox-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-end) .checkbox-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.checkbox-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.checkbox-label-placement-stacked) .checkbox-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.checkbox-label-placement-stacked) .label-text-wrapper{margin-left:0;margin-right:0;margin-bottom:16px}:host(.checkbox-checked) .checkbox-icon,:host(.checkbox-indeterminate) .checkbox-icon{border-color:var(--border-color-checked);background:var(--checkbox-background-checked)}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{opacity:1}:host(.checkbox-disabled){pointer-events:none}:host{--border-radius:50%;--border-width:1px;--border-style:solid;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.23);--checkbox-background:var(--ion-item-background, var(--ion-background-color, #fff));--size:26px}:host(.checkbox-disabled){opacity:0.3}:host(.in-item.legacy-checkbox){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:9px;display:block;position:static}:host(.in-item.legacy-checkbox[slot=start]){-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:8px;margin-bottom:8px}";
|
|
12
12
|
|
|
13
|
-
const checkboxMdCss = ":host{--checkbox-background-checked:var(--ion-color-primary, #3880ff);--border-color-checked:var(--ion-color-primary, #3880ff);--checkmark-color:var(--ion-color-primary-contrast, #fff);--checkmark-width:1;--transition:none;display:inline-block;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.in-item){width:100%;height:100%}:host([slot=start]:not(.legacy-checkbox)),:host([slot=end]:not(.legacy-checkbox)){width:auto}:host(.legacy-checkbox){width:var(--size);height:var(--size)}:host(.ion-color){--checkbox-background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}:host(.legacy-checkbox) label{top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}@supports (inset-inline-start: 0){:host(.legacy-checkbox) label{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.legacy-checkbox) label{left:0}:host-context([dir=rtl]):host(.legacy-checkbox) label,:host-context([dir=rtl]).legacy-checkbox label{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.legacy-checkbox) label:dir(rtl){left:unset;right:unset;right:0}}}:host(.legacy-checkbox) label::-moz-focus-inner{border:0}.checkbox-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit;cursor:inherit}.label-text-wrapper{pointer-events:none;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item:not(.legacy-checkbox)) .label-text-wrapper{margin-top:10px;margin-bottom:10px}.label-text-wrapper-hidden{display:none}input{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}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.checkbox-icon{border-radius:var(--border-radius);position:relative;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--checkbox-background);-webkit-box-sizing:border-box;box-sizing:border-box}:host(.legacy-checkbox) .checkbox-icon{display:block;width:100%;height:100%}:host(:not(.legacy-checkbox)) .checkbox-icon{width:var(--size);height:var(--size)}.checkbox-icon path{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}:host(.checkbox-justify-space-between) .checkbox-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.checkbox-justify-start) .checkbox-wrapper{-ms-flex-pack:start;justify-content:start}:host(.checkbox-justify-end) .checkbox-wrapper{-ms-flex-pack:end;justify-content:end}:host(.checkbox-label-placement-start) .checkbox-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.checkbox-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-end) .checkbox-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.checkbox-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.checkbox-checked) .checkbox-icon,:host(.checkbox-indeterminate) .checkbox-icon{border-color:var(--border-color-checked);background:var(--checkbox-background-checked)}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{opacity:1}:host(.checkbox-disabled){pointer-events:none}:host{--border-radius:calc(var(--size) * .125);--border-width:2px;--border-style:solid;--border-color:rgb(var(--ion-text-color-rgb, 0, 0, 0), 0.6);--checkmark-width:3;--checkbox-background:var(--ion-item-background, var(--ion-background-color, #fff));--transition:background 180ms cubic-bezier(0.4, 0, 0.2, 1);--size:18px}.checkbox-icon path{stroke-dasharray:30;stroke-dashoffset:30}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{stroke-dashoffset:0;-webkit-transition:stroke-dashoffset 90ms linear 90ms;transition:stroke-dashoffset 90ms linear 90ms}:host(.legacy-checkbox.checkbox-disabled),:host(.checkbox-disabled) .label-text-wrapper{opacity:0.38}:host(.checkbox-disabled) .native-wrapper{opacity:0.63}:host(.in-item.legacy-checkbox){margin-left:0;margin-right:0;margin-top:18px;margin-bottom:18px;display:block;position:static}:host(.in-item.legacy-checkbox[slot=start]){-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:36px;margin-inline-end:36px;margin-top:18px;margin-bottom:18px}";
|
|
13
|
+
const checkboxMdCss = ":host{--checkbox-background-checked:var(--ion-color-primary, #3880ff);--border-color-checked:var(--ion-color-primary, #3880ff);--checkmark-color:var(--ion-color-primary-contrast, #fff);--checkmark-width:1;--transition:none;display:inline-block;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.in-item){width:100%;height:100%}:host([slot=start]:not(.legacy-checkbox)),:host([slot=end]:not(.legacy-checkbox)){width:auto}:host(.legacy-checkbox){width:var(--size);height:var(--size)}:host(.ion-color){--checkbox-background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}:host(.legacy-checkbox) label{top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}@supports (inset-inline-start: 0){:host(.legacy-checkbox) label{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.legacy-checkbox) label{left:0}:host-context([dir=rtl]):host(.legacy-checkbox) label,:host-context([dir=rtl]).legacy-checkbox label{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.legacy-checkbox) label:dir(rtl){left:unset;right:unset;right:0}}}:host(.legacy-checkbox) label::-moz-focus-inner{border:0}.checkbox-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit;cursor:inherit}.label-text-wrapper{pointer-events:none;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item:not(.legacy-checkbox)) .label-text-wrapper{margin-top:10px;margin-bottom:10px}:host(.in-item.checkbox-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.checkbox-label-placement-stacked) .native-wrapper{margin-bottom:10px}.label-text-wrapper-hidden{display:none}input{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}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.checkbox-icon{border-radius:var(--border-radius);position:relative;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--checkbox-background);-webkit-box-sizing:border-box;box-sizing:border-box}:host(.legacy-checkbox) .checkbox-icon{display:block;width:100%;height:100%}:host(:not(.legacy-checkbox)) .checkbox-icon{width:var(--size);height:var(--size)}.checkbox-icon path{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}:host(.checkbox-justify-space-between) .checkbox-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.checkbox-justify-start) .checkbox-wrapper{-ms-flex-pack:start;justify-content:start}:host(.checkbox-justify-end) .checkbox-wrapper{-ms-flex-pack:end;justify-content:end}:host(.checkbox-alignment-start) .checkbox-wrapper{-ms-flex-align:start;align-items:start}:host(.checkbox-alignment-center) .checkbox-wrapper{-ms-flex-align:center;align-items:center}:host(.checkbox-label-placement-start) .checkbox-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.checkbox-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-end) .checkbox-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.checkbox-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.checkbox-label-placement-stacked) .checkbox-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.checkbox-label-placement-stacked) .label-text-wrapper{margin-left:0;margin-right:0;margin-bottom:16px}:host(.checkbox-checked) .checkbox-icon,:host(.checkbox-indeterminate) .checkbox-icon{border-color:var(--border-color-checked);background:var(--checkbox-background-checked)}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{opacity:1}:host(.checkbox-disabled){pointer-events:none}:host{--border-radius:calc(var(--size) * .125);--border-width:2px;--border-style:solid;--border-color:rgb(var(--ion-text-color-rgb, 0, 0, 0), 0.6);--checkmark-width:3;--checkbox-background:var(--ion-item-background, var(--ion-background-color, #fff));--transition:background 180ms cubic-bezier(0.4, 0, 0.2, 1);--size:18px}.checkbox-icon path{stroke-dasharray:30;stroke-dashoffset:30}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{stroke-dashoffset:0;-webkit-transition:stroke-dashoffset 90ms linear 90ms;transition:stroke-dashoffset 90ms linear 90ms}:host(.legacy-checkbox.checkbox-disabled),:host(.checkbox-disabled) .label-text-wrapper{opacity:0.38}:host(.checkbox-disabled) .native-wrapper{opacity:0.63}:host(.in-item.legacy-checkbox){margin-left:0;margin-right:0;margin-top:18px;margin-bottom:18px;display:block;position:static}:host(.in-item.legacy-checkbox[slot=start]){-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:36px;margin-inline-end:36px;margin-top:18px;margin-bottom:18px}";
|
|
14
14
|
|
|
15
15
|
const Checkbox = /*@__PURE__*/ proxyCustomElement(class Checkbox extends HTMLElement {
|
|
16
16
|
constructor() {
|
|
@@ -59,6 +59,7 @@ const Checkbox = /*@__PURE__*/ proxyCustomElement(class Checkbox extends HTMLEle
|
|
|
59
59
|
this.value = 'on';
|
|
60
60
|
this.labelPlacement = 'start';
|
|
61
61
|
this.justify = 'space-between';
|
|
62
|
+
this.alignment = 'center';
|
|
62
63
|
this.legacy = undefined;
|
|
63
64
|
}
|
|
64
65
|
// TODO(FW-3100): remove this
|
|
@@ -96,7 +97,7 @@ const Checkbox = /*@__PURE__*/ proxyCustomElement(class Checkbox extends HTMLEle
|
|
|
96
97
|
return legacyFormController.hasLegacyControl() ? this.renderLegacyCheckbox() : this.renderCheckbox();
|
|
97
98
|
}
|
|
98
99
|
renderCheckbox() {
|
|
99
|
-
const { color, checked, disabled, el, getSVGPath, indeterminate, inheritedAttributes, inputId, justify, labelPlacement, name, value, } = this;
|
|
100
|
+
const { color, checked, disabled, el, getSVGPath, indeterminate, inheritedAttributes, inputId, justify, labelPlacement, name, value, alignment, } = this;
|
|
100
101
|
const mode = getIonMode(this);
|
|
101
102
|
const path = getSVGPath(mode, indeterminate);
|
|
102
103
|
renderHiddenInput(true, el, name, checked ? value : '', disabled);
|
|
@@ -108,6 +109,7 @@ const Checkbox = /*@__PURE__*/ proxyCustomElement(class Checkbox extends HTMLEle
|
|
|
108
109
|
'checkbox-indeterminate': indeterminate,
|
|
109
110
|
interactive: true,
|
|
110
111
|
[`checkbox-justify-${justify}`]: true,
|
|
112
|
+
[`checkbox-alignment-${alignment}`]: true,
|
|
111
113
|
[`checkbox-label-placement-${labelPlacement}`]: true,
|
|
112
114
|
}) }, h("label", { class: "checkbox-wrapper" }, h("input", Object.assign({ type: "checkbox", checked: checked ? true : undefined, disabled: disabled, id: inputId, onChange: this.toggleChecked, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: (focusEl) => (this.focusEl = focusEl) }, inheritedAttributes)), h("div", { class: {
|
|
113
115
|
'label-text-wrapper': true,
|
|
@@ -169,6 +171,7 @@ Developers can dismiss this warning by removing their usage of the "legacy" prop
|
|
|
169
171
|
"value": [8],
|
|
170
172
|
"labelPlacement": [1, "label-placement"],
|
|
171
173
|
"justify": [1],
|
|
174
|
+
"alignment": [1],
|
|
172
175
|
"legacy": [4]
|
|
173
176
|
}]);
|
|
174
177
|
let checkboxIds = 0;
|
package/components/data.js
CHANGED
|
@@ -185,7 +185,22 @@ const getPartsFromCalendarDay = (el) => {
|
|
|
185
185
|
};
|
|
186
186
|
function parseDate(val) {
|
|
187
187
|
if (Array.isArray(val)) {
|
|
188
|
-
|
|
188
|
+
const parsedArray = [];
|
|
189
|
+
for (const valStr of val) {
|
|
190
|
+
const parsedVal = parseDate(valStr);
|
|
191
|
+
/**
|
|
192
|
+
* If any of the values weren't parsed correctly, consider
|
|
193
|
+
* the entire batch incorrect. This simplifies the type
|
|
194
|
+
* signatures by having "undefined" be a general error case
|
|
195
|
+
* instead of returning (Datetime | undefined)[], which is
|
|
196
|
+
* harder for TS to perform type narrowing on.
|
|
197
|
+
*/
|
|
198
|
+
if (!parsedVal) {
|
|
199
|
+
return undefined;
|
|
200
|
+
}
|
|
201
|
+
parsedArray.push(parsedVal);
|
|
202
|
+
}
|
|
203
|
+
return parsedArray;
|
|
189
204
|
}
|
|
190
205
|
// manually parse IS0 cuz Date.parse cannot be trusted
|
|
191
206
|
// ISO 8601 format: 1994-12-15T13:47:20Z
|
|
@@ -205,6 +220,7 @@ function parseDate(val) {
|
|
|
205
220
|
}
|
|
206
221
|
if (parse === null) {
|
|
207
222
|
// wasn't able to parse the ISO datetime
|
|
223
|
+
printIonWarning(`Unable to parse date string: ${val}. Please provide a valid ISO 8601 datetime string.`);
|
|
208
224
|
return undefined;
|
|
209
225
|
}
|
|
210
226
|
// ensure all the parse values exist with at least 0
|
|
@@ -1225,12 +1241,20 @@ const generateTime = (refParts, hourCycle = 'h12', minParts, maxParts, hourValue
|
|
|
1225
1241
|
* Given DatetimeParts, generate the previous,
|
|
1226
1242
|
* current, and and next months.
|
|
1227
1243
|
*/
|
|
1228
|
-
const generateMonths = (refParts) => {
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1244
|
+
const generateMonths = (refParts, forcedDate) => {
|
|
1245
|
+
const current = { month: refParts.month, year: refParts.year, day: refParts.day };
|
|
1246
|
+
/**
|
|
1247
|
+
* If we're forcing a month to appear, and it's different from the current month,
|
|
1248
|
+
* ensure it appears by replacing the next or previous month as appropriate.
|
|
1249
|
+
*/
|
|
1250
|
+
if (forcedDate !== undefined && (refParts.month !== forcedDate.month || refParts.year !== forcedDate.year)) {
|
|
1251
|
+
const forced = { month: forcedDate.month, year: forcedDate.year, day: forcedDate.day };
|
|
1252
|
+
const forcedMonthIsBefore = isBefore(forced, current);
|
|
1253
|
+
return forcedMonthIsBefore
|
|
1254
|
+
? [forced, current, getNextMonth(refParts)]
|
|
1255
|
+
: [getPreviousMonth(refParts), current, forced];
|
|
1256
|
+
}
|
|
1257
|
+
return [getPreviousMonth(refParts), current, getNextMonth(refParts)];
|
|
1234
1258
|
};
|
|
1235
1259
|
const getMonthColumnData = (locale, refParts, minParts, maxParts, monthValues, formatOptions = {
|
|
1236
1260
|
month: 'long',
|
|
@@ -39,7 +39,6 @@ const CoreDelegate = () => {
|
|
|
39
39
|
const attachViewToDom = async (parentElement, userComponent, userComponentProps = {}, cssClasses = []) => {
|
|
40
40
|
var _a, _b;
|
|
41
41
|
BaseComponent = parentElement;
|
|
42
|
-
let ChildComponent;
|
|
43
42
|
/**
|
|
44
43
|
* If passing in a component via the `component` props
|
|
45
44
|
* we need to append it inside of our overlay component.
|
|
@@ -66,7 +65,6 @@ const CoreDelegate = () => {
|
|
|
66
65
|
* inside of the overlay component.
|
|
67
66
|
*/
|
|
68
67
|
BaseComponent.appendChild(el);
|
|
69
|
-
ChildComponent = el;
|
|
70
68
|
await new Promise((resolve) => componentOnReady(el, resolve));
|
|
71
69
|
}
|
|
72
70
|
else if (BaseComponent.children.length > 0 &&
|
|
@@ -75,7 +73,7 @@ const CoreDelegate = () => {
|
|
|
75
73
|
* The delegate host wrapper el is only needed for modals and popovers
|
|
76
74
|
* because they allow the dev to provide custom content to the overlay.
|
|
77
75
|
*/
|
|
78
|
-
const root =
|
|
76
|
+
const root = BaseComponent.children[0];
|
|
79
77
|
if (!root.classList.contains('ion-delegate-host')) {
|
|
80
78
|
/**
|
|
81
79
|
* If the root element is not a delegate host, it means
|
|
@@ -90,12 +88,6 @@ const CoreDelegate = () => {
|
|
|
90
88
|
el.append(...BaseComponent.children);
|
|
91
89
|
// Append the new parent element to the original parent element.
|
|
92
90
|
BaseComponent.appendChild(el);
|
|
93
|
-
/**
|
|
94
|
-
* Update the ChildComponent to be the
|
|
95
|
-
* newly created div in the event that one
|
|
96
|
-
* does not already exist.
|
|
97
|
-
*/
|
|
98
|
-
ChildComponent = el;
|
|
99
91
|
}
|
|
100
92
|
}
|
|
101
93
|
/**
|
|
@@ -111,18 +103,7 @@ const CoreDelegate = () => {
|
|
|
111
103
|
Reference = document.createComment('ionic teleport');
|
|
112
104
|
BaseComponent.parentNode.insertBefore(Reference, BaseComponent);
|
|
113
105
|
app.appendChild(BaseComponent);
|
|
114
|
-
|
|
115
|
-
* We return the child component rather than the overlay
|
|
116
|
-
* reference itself since modal and popover will
|
|
117
|
-
* use this to wait for any Ionic components in the child view
|
|
118
|
-
* to be ready (i.e. componentOnReady) when using the
|
|
119
|
-
* lazy loaded component bundle.
|
|
120
|
-
*
|
|
121
|
-
* However, we fall back to returning BaseComponent
|
|
122
|
-
* in the event that a modal or popover is presented
|
|
123
|
-
* with no child content.
|
|
124
|
-
*/
|
|
125
|
-
return ChildComponent !== null && ChildComponent !== void 0 ? ChildComponent : BaseComponent;
|
|
106
|
+
return BaseComponent;
|
|
126
107
|
};
|
|
127
108
|
const removeViewFromDom = () => {
|
|
128
109
|
/**
|
|
@@ -52,6 +52,9 @@ const DatetimeButton = /*@__PURE__*/ proxyCustomElement(class DatetimeButton ext
|
|
|
52
52
|
* to today's date and time if no value is set.
|
|
53
53
|
*/
|
|
54
54
|
const parsedDatetimes = parseDate(parsedValues.length > 0 ? parsedValues : [getToday()]);
|
|
55
|
+
if (!parsedDatetimes) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
55
58
|
/**
|
|
56
59
|
* If developers incorrectly use multiple="true"
|
|
57
60
|
* with non "date" datetimes, then just select
|
|
@@ -207,11 +207,6 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
207
207
|
this.ionRender = createEvent(this, "ionRender", 7);
|
|
208
208
|
this.inputId = `ion-dt-${datetimeIds++}`;
|
|
209
209
|
this.prevPresentation = null;
|
|
210
|
-
/**
|
|
211
|
-
* Duplicate reference to `activeParts` that does not trigger a re-render of the component.
|
|
212
|
-
* Allows caching an instance of the `activeParts` in between render cycles.
|
|
213
|
-
*/
|
|
214
|
-
this.activePartsClone = [];
|
|
215
210
|
this.warnIfIncorrectValueUsage = () => {
|
|
216
211
|
const { multiple, value } = this;
|
|
217
212
|
if (!multiple && Array.isArray(value)) {
|
|
@@ -239,9 +234,9 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
239
234
|
* data. This should be used when rendering an
|
|
240
235
|
* interface in an environment where the `value`
|
|
241
236
|
* may not be set. This function works
|
|
242
|
-
* by returning the first selected date
|
|
243
|
-
*
|
|
244
|
-
*
|
|
237
|
+
* by returning the first selected date and then
|
|
238
|
+
* falling back to defaultParts if no active date
|
|
239
|
+
* is selected.
|
|
245
240
|
*/
|
|
246
241
|
this.getActivePartsWithFallback = () => {
|
|
247
242
|
var _a;
|
|
@@ -249,8 +244,8 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
249
244
|
return (_a = this.getActivePart()) !== null && _a !== void 0 ? _a : defaultParts;
|
|
250
245
|
};
|
|
251
246
|
this.getActivePart = () => {
|
|
252
|
-
const {
|
|
253
|
-
return Array.isArray(
|
|
247
|
+
const { activeParts } = this;
|
|
248
|
+
return Array.isArray(activeParts) ? activeParts[0] : activeParts;
|
|
254
249
|
};
|
|
255
250
|
this.closeParentOverlay = () => {
|
|
256
251
|
const popoverOrModal = this.el.closest('ion-modal, ion-popover');
|
|
@@ -262,7 +257,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
262
257
|
this.workingParts = Object.assign({}, parts);
|
|
263
258
|
};
|
|
264
259
|
this.setActiveParts = (parts, removeDate = false) => {
|
|
265
|
-
const { multiple, minParts, maxParts,
|
|
260
|
+
const { multiple, minParts, maxParts, activeParts } = this;
|
|
266
261
|
/**
|
|
267
262
|
* When setting the active parts, it is possible
|
|
268
263
|
* to set invalid data. For example,
|
|
@@ -276,16 +271,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
276
271
|
const validatedParts = validateParts(parts, minParts, maxParts);
|
|
277
272
|
this.setWorkingParts(validatedParts);
|
|
278
273
|
if (multiple) {
|
|
279
|
-
|
|
280
|
-
* We read from activePartsClone here because valueChanged() only updates that,
|
|
281
|
-
* so it's the more reliable source of truth. If we read from activeParts, then
|
|
282
|
-
* if you click July 1, manually set the value to July 2, and then click July 3,
|
|
283
|
-
* the new value would be [July 1, July 3], ignoring the value set.
|
|
284
|
-
*
|
|
285
|
-
* We can then pass the new value to activeParts (rather than activePartsClone)
|
|
286
|
-
* since the clone will be updated automatically by activePartsChanged().
|
|
287
|
-
*/
|
|
288
|
-
const activePartsArray = Array.isArray(activePartsClone) ? activePartsClone : [activePartsClone];
|
|
274
|
+
const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
|
|
289
275
|
if (removeDate) {
|
|
290
276
|
this.activeParts = activePartsArray.filter((p) => !isSameDay(p, validatedParts));
|
|
291
277
|
}
|
|
@@ -502,6 +488,19 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
502
488
|
const monthBox = month.getBoundingClientRect();
|
|
503
489
|
if (Math.abs(monthBox.x - box.x) > 2)
|
|
504
490
|
return;
|
|
491
|
+
/**
|
|
492
|
+
* If we're force-rendering a month, assume we've
|
|
493
|
+
* scrolled to that and return it.
|
|
494
|
+
*
|
|
495
|
+
* If forceRenderDate is ever used in a context where the
|
|
496
|
+
* forced month is not immediately auto-scrolled to, this
|
|
497
|
+
* should be updated to also check whether `month` has the
|
|
498
|
+
* same month and year as the forced date.
|
|
499
|
+
*/
|
|
500
|
+
const { forceRenderDate } = this;
|
|
501
|
+
if (forceRenderDate !== undefined) {
|
|
502
|
+
return { month: forceRenderDate.month, year: forceRenderDate.year, day: forceRenderDate.day };
|
|
503
|
+
}
|
|
505
504
|
/**
|
|
506
505
|
* From here, we can determine if the start
|
|
507
506
|
* month or the end month was scrolled into view.
|
|
@@ -556,6 +555,9 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
556
555
|
this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month, day: day, year }));
|
|
557
556
|
calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
|
|
558
557
|
calendarBodyRef.style.removeProperty('overflow');
|
|
558
|
+
if (this.resolveForceDateScrolling) {
|
|
559
|
+
this.resolveForceDateScrolling();
|
|
560
|
+
}
|
|
559
561
|
});
|
|
560
562
|
};
|
|
561
563
|
/**
|
|
@@ -610,10 +612,17 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
610
612
|
}
|
|
611
613
|
};
|
|
612
614
|
this.processValue = (value) => {
|
|
613
|
-
const hasValue = value !== null && value !== undefined;
|
|
615
|
+
const hasValue = value !== null && value !== undefined && (!Array.isArray(value) || value.length > 0);
|
|
614
616
|
const valueToProcess = hasValue ? parseDate(value) : this.defaultParts;
|
|
615
|
-
const { minParts, maxParts } = this;
|
|
617
|
+
const { minParts, maxParts, workingParts, el } = this;
|
|
616
618
|
this.warnIfIncorrectValueUsage();
|
|
619
|
+
/**
|
|
620
|
+
* Return early if the value wasn't parsed correctly, such as
|
|
621
|
+
* if an improperly formatted date string was provided.
|
|
622
|
+
*/
|
|
623
|
+
if (!valueToProcess) {
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
617
626
|
/**
|
|
618
627
|
* Datetime should only warn of out of bounds values
|
|
619
628
|
* if set by the user. If the `value` is undefined,
|
|
@@ -631,16 +640,9 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
631
640
|
* that the values don't necessarily have to be in order.
|
|
632
641
|
*/
|
|
633
642
|
const singleValue = Array.isArray(valueToProcess) ? valueToProcess[0] : valueToProcess;
|
|
634
|
-
const
|
|
643
|
+
const targetValue = clampDate(singleValue, minParts, maxParts);
|
|
644
|
+
const { month, day, year, hour, minute } = targetValue;
|
|
635
645
|
const ampm = parseAmPm(hour);
|
|
636
|
-
this.setWorkingParts({
|
|
637
|
-
month,
|
|
638
|
-
day,
|
|
639
|
-
year,
|
|
640
|
-
hour,
|
|
641
|
-
minute,
|
|
642
|
-
ampm,
|
|
643
|
-
});
|
|
644
646
|
/**
|
|
645
647
|
* Since `activeParts` indicates a value that
|
|
646
648
|
* been explicitly selected either by the
|
|
@@ -670,6 +672,62 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
670
672
|
*/
|
|
671
673
|
this.activeParts = [];
|
|
672
674
|
}
|
|
675
|
+
/**
|
|
676
|
+
* Only animate if:
|
|
677
|
+
* 1. We're using grid style (wheel style pickers should just jump to new value)
|
|
678
|
+
* 2. The month and/or year actually changed, and both are defined (otherwise there's nothing to animate to)
|
|
679
|
+
* 3. The calendar body is visible (prevents animation when in collapsed datetime-button, for example)
|
|
680
|
+
* 4. The month/year picker is not open (since you wouldn't see the animation anyway)
|
|
681
|
+
*/
|
|
682
|
+
const didChangeMonth = (month !== undefined && month !== workingParts.month) || (year !== undefined && year !== workingParts.year);
|
|
683
|
+
const bodyIsVisible = el.classList.contains('datetime-ready');
|
|
684
|
+
const { isGridStyle, showMonthAndYear } = this;
|
|
685
|
+
if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
|
|
686
|
+
this.animateToDate(targetValue);
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
/**
|
|
690
|
+
* We only need to do this if we didn't just animate to a new month,
|
|
691
|
+
* since that calls prevMonth/nextMonth which calls setWorkingParts for us.
|
|
692
|
+
*/
|
|
693
|
+
this.setWorkingParts({
|
|
694
|
+
month,
|
|
695
|
+
day,
|
|
696
|
+
year,
|
|
697
|
+
hour,
|
|
698
|
+
minute,
|
|
699
|
+
ampm,
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
this.animateToDate = async (targetValue) => {
|
|
704
|
+
const { workingParts } = this;
|
|
705
|
+
/**
|
|
706
|
+
* Tell other render functions that we need to force the
|
|
707
|
+
* target month to appear in place of the actual next/prev month.
|
|
708
|
+
* Because this is a State variable, a rerender will be triggered
|
|
709
|
+
* automatically, updating the rendered months.
|
|
710
|
+
*/
|
|
711
|
+
this.forceRenderDate = targetValue;
|
|
712
|
+
/**
|
|
713
|
+
* Flag that we've started scrolling to the forced date.
|
|
714
|
+
* The resolve function will be called by the datetime's
|
|
715
|
+
* scroll listener when it's done updating everything.
|
|
716
|
+
* This is a replacement for making prev/nextMonth async,
|
|
717
|
+
* since the logic we're waiting on is in a listener.
|
|
718
|
+
*/
|
|
719
|
+
const forceDateScrollingPromise = new Promise((resolve) => {
|
|
720
|
+
this.resolveForceDateScrolling = resolve;
|
|
721
|
+
});
|
|
722
|
+
/**
|
|
723
|
+
* Animate smoothly to the forced month. This will also update
|
|
724
|
+
* workingParts and correct the surrounding months for us.
|
|
725
|
+
*/
|
|
726
|
+
const targetMonthIsBefore = isBefore(targetValue, workingParts);
|
|
727
|
+
targetMonthIsBefore ? this.prevMonth() : this.nextMonth();
|
|
728
|
+
await forceDateScrollingPromise;
|
|
729
|
+
this.resolveForceDateScrolling = undefined;
|
|
730
|
+
this.forceRenderDate = undefined;
|
|
673
731
|
};
|
|
674
732
|
this.onFocus = () => {
|
|
675
733
|
this.ionFocus.emit();
|
|
@@ -725,6 +783,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
725
783
|
ampm: 'pm',
|
|
726
784
|
};
|
|
727
785
|
this.isTimePopoverOpen = false;
|
|
786
|
+
this.forceRenderDate = undefined;
|
|
728
787
|
this.color = 'primary';
|
|
729
788
|
this.name = this.inputId;
|
|
730
789
|
this.disabled = false;
|
|
@@ -764,6 +823,11 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
764
823
|
maxChanged() {
|
|
765
824
|
this.processMaxParts();
|
|
766
825
|
}
|
|
826
|
+
get isGridStyle() {
|
|
827
|
+
const { presentation, preferWheel } = this;
|
|
828
|
+
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
829
|
+
return hasDatePresentation && !preferWheel;
|
|
830
|
+
}
|
|
767
831
|
yearValuesChanged() {
|
|
768
832
|
this.parsedYearValues = convertToArrayOfNumbers(this.yearValues);
|
|
769
833
|
}
|
|
@@ -779,51 +843,13 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
779
843
|
minuteValuesChanged() {
|
|
780
844
|
this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues);
|
|
781
845
|
}
|
|
782
|
-
activePartsChanged() {
|
|
783
|
-
this.activePartsClone = this.activeParts;
|
|
784
|
-
}
|
|
785
846
|
/**
|
|
786
847
|
* Update the datetime value when the value changes
|
|
787
848
|
*/
|
|
788
|
-
valueChanged() {
|
|
789
|
-
const { value
|
|
849
|
+
async valueChanged() {
|
|
850
|
+
const { value } = this;
|
|
790
851
|
if (this.hasValue()) {
|
|
791
|
-
this.
|
|
792
|
-
/**
|
|
793
|
-
* Clones the value of the `activeParts` to the private clone, to update
|
|
794
|
-
* the date display on the current render cycle without causing another render.
|
|
795
|
-
*
|
|
796
|
-
* This allows us to update the current value's date/time display without
|
|
797
|
-
* refocusing or shifting the user's display (leaves the user in place).
|
|
798
|
-
*/
|
|
799
|
-
const valueDateParts = parseDate(value);
|
|
800
|
-
if (valueDateParts) {
|
|
801
|
-
warnIfValueOutOfBounds(valueDateParts, minParts, maxParts);
|
|
802
|
-
if (Array.isArray(valueDateParts)) {
|
|
803
|
-
this.activePartsClone = [...valueDateParts];
|
|
804
|
-
}
|
|
805
|
-
else {
|
|
806
|
-
const { month, day, year, hour, minute } = valueDateParts;
|
|
807
|
-
const ampm = hour != null ? (hour >= 12 ? 'pm' : 'am') : undefined;
|
|
808
|
-
this.activePartsClone = Object.assign(Object.assign({}, this.activeParts), { month,
|
|
809
|
-
day,
|
|
810
|
-
year,
|
|
811
|
-
hour,
|
|
812
|
-
minute,
|
|
813
|
-
ampm });
|
|
814
|
-
/**
|
|
815
|
-
* The working parts am/pm value must be updated when the value changes, to
|
|
816
|
-
* ensure the time picker hour column values are generated correctly.
|
|
817
|
-
*
|
|
818
|
-
* Note that we don't need to do this if valueDateParts is an array, since
|
|
819
|
-
* multiple="true" does not apply to time pickers.
|
|
820
|
-
*/
|
|
821
|
-
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm }));
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
else {
|
|
825
|
-
printIonWarning(`Unable to parse date string: ${value}. Please provide a valid ISO 8601 datetime string.`);
|
|
826
|
-
}
|
|
852
|
+
this.processValue(value);
|
|
827
853
|
}
|
|
828
854
|
this.emitStyle();
|
|
829
855
|
this.ionValueChange.emit({ value });
|
|
@@ -1026,8 +1052,6 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1026
1052
|
printIonWarning('The highlightedDates property is not supported with preferWheel="true".', el);
|
|
1027
1053
|
}
|
|
1028
1054
|
}
|
|
1029
|
-
this.processMinParts();
|
|
1030
|
-
this.processMaxParts();
|
|
1031
1055
|
const hourValues = (this.parsedHourValues = convertToArrayOfNumbers(this.hourValues));
|
|
1032
1056
|
const minuteValues = (this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues));
|
|
1033
1057
|
const monthValues = (this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues));
|
|
@@ -1035,6 +1059,8 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1035
1059
|
const dayValues = (this.parsedDayValues = convertToArrayOfNumbers(this.dayValues));
|
|
1036
1060
|
const todayParts = (this.todayParts = parseDate(getToday()));
|
|
1037
1061
|
this.defaultParts = getClosestValidDate(todayParts, monthValues, dayValues, yearValues, hourValues, minuteValues);
|
|
1062
|
+
this.processMinParts();
|
|
1063
|
+
this.processMaxParts();
|
|
1038
1064
|
this.processValue(this.value);
|
|
1039
1065
|
this.emitStyle();
|
|
1040
1066
|
}
|
|
@@ -1419,7 +1445,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1419
1445
|
const { el, highlightedDates, isDateEnabled, multiple } = this;
|
|
1420
1446
|
const referenceParts = { month, day, year };
|
|
1421
1447
|
const isCalendarPadding = day === null;
|
|
1422
|
-
const { isActive, isToday, ariaLabel, ariaSelected, disabled, text } = getCalendarDayState(this.locale, referenceParts, this.
|
|
1448
|
+
const { isActive, isToday, ariaLabel, ariaSelected, disabled, text } = getCalendarDayState(this.locale, referenceParts, this.activeParts, this.todayParts, this.minParts, this.maxParts, this.parsedDayValues);
|
|
1423
1449
|
const dateIsoString = convertDataToISO(referenceParts);
|
|
1424
1450
|
let isCalDayDisabled = isCalMonthDisabled || disabled;
|
|
1425
1451
|
if (!isCalDayDisabled && isDateEnabled !== undefined) {
|
|
@@ -1476,7 +1502,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1476
1502
|
}))));
|
|
1477
1503
|
}
|
|
1478
1504
|
renderCalendarBody() {
|
|
1479
|
-
return (h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" }, generateMonths(this.workingParts).map(({ month, year }) => {
|
|
1505
|
+
return (h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" }, generateMonths(this.workingParts, this.forceRenderDate).map(({ month, year }) => {
|
|
1480
1506
|
return this.renderMonth(month, year);
|
|
1481
1507
|
})));
|
|
1482
1508
|
}
|
|
@@ -1631,14 +1657,13 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1631
1657
|
}
|
|
1632
1658
|
}
|
|
1633
1659
|
render() {
|
|
1634
|
-
const { name, value, disabled, el, color, readonly, showMonthAndYear, preferWheel, presentation, size } = this;
|
|
1660
|
+
const { name, value, disabled, el, color, readonly, showMonthAndYear, preferWheel, presentation, size, isGridStyle, } = this;
|
|
1635
1661
|
const mode = getIonMode(this);
|
|
1636
1662
|
const isMonthAndYearPresentation = presentation === 'year' || presentation === 'month' || presentation === 'month-year';
|
|
1637
1663
|
const shouldShowMonthAndYear = showMonthAndYear || isMonthAndYearPresentation;
|
|
1638
1664
|
const monthYearPickerOpen = showMonthAndYear && !isMonthAndYearPresentation;
|
|
1639
1665
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1640
1666
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1641
|
-
const hasGrid = hasDatePresentation && !preferWheel;
|
|
1642
1667
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
1643
1668
|
return (h(Host, { "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
|
|
1644
1669
|
[mode]: true,
|
|
@@ -1649,7 +1674,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1649
1674
|
[`datetime-presentation-${presentation}`]: true,
|
|
1650
1675
|
[`datetime-size-${size}`]: true,
|
|
1651
1676
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
1652
|
-
[`datetime-grid`]:
|
|
1677
|
+
[`datetime-grid`]: isGridStyle,
|
|
1653
1678
|
})) }, this.renderDatetime(mode)));
|
|
1654
1679
|
}
|
|
1655
1680
|
get el() { return this; }
|
|
@@ -1662,7 +1687,6 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1662
1687
|
"dayValues": ["dayValuesChanged"],
|
|
1663
1688
|
"hourValues": ["hourValuesChanged"],
|
|
1664
1689
|
"minuteValues": ["minuteValuesChanged"],
|
|
1665
|
-
"activeParts": ["activePartsChanged"],
|
|
1666
1690
|
"value": ["valueChanged"]
|
|
1667
1691
|
}; }
|
|
1668
1692
|
static get style() { return {
|
|
@@ -1703,6 +1727,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1703
1727
|
"activeParts": [32],
|
|
1704
1728
|
"workingParts": [32],
|
|
1705
1729
|
"isTimePopoverOpen": [32],
|
|
1730
|
+
"forceRenderDate": [32],
|
|
1706
1731
|
"confirm": [64],
|
|
1707
1732
|
"reset": [64],
|
|
1708
1733
|
"cancel": [64]
|
package/components/ion-modal.js
CHANGED
|
@@ -1298,8 +1298,8 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
|
|
|
1298
1298
|
*/
|
|
1299
1299
|
this.currentBreakpoint = this.initialBreakpoint;
|
|
1300
1300
|
const { inline, delegate } = this.getDelegate(true);
|
|
1301
|
-
this.ionMount.emit();
|
|
1302
1301
|
this.usersElement = await attachComponent(delegate, el, this.component, ['ion-page'], this.componentProps, inline);
|
|
1302
|
+
this.ionMount.emit();
|
|
1303
1303
|
/**
|
|
1304
1304
|
* When using the lazy loaded build of Stencil, we need to wait
|
|
1305
1305
|
* for every Stencil component instance to be ready before presenting
|