@haiilo/catalyst 11.0.0 → 12.0.0
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/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.esm.js +2 -2
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/loader.esm.js.map +1 -0
- package/dist/catalyst/p-6a54965a.entry.js +10 -0
- package/dist/catalyst/p-6a54965a.entry.js.map +1 -0
- package/dist/catalyst/p-B-m4GNf1.js +3 -0
- package/dist/catalyst/p-B-m4GNf1.js.map +1 -0
- package/dist/catalyst/p-DQuL1Twl.js +2 -0
- package/dist/catalyst/p-DQuL1Twl.js.map +1 -0
- package/dist/catalyst/p-LJZzaWFR.js +2 -0
- package/dist/catalyst/p-LJZzaWFR.js.map +1 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/cat-alert_30.cjs.entry.js +1467 -1833
- package/dist/cjs/cat-alert_30.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +8 -7
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/index-DNLT6JC9.js +10178 -0
- package/dist/cjs/index-DNLT6JC9.js.map +1 -0
- package/dist/cjs/{index-1094f0fc.js → index-jGQAsDy6.js} +528 -358
- package/dist/cjs/index-jGQAsDy6.js.map +1 -0
- package/dist/cjs/index.cjs.js +461 -453
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +4 -5
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/cat-alert/cat-alert.js +15 -4
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
- package/dist/collection/components/cat-avatar/cat-avatar.js +33 -14
- package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.js +45 -9
- package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.css +4 -2
- package/dist/collection/components/cat-button/cat-button.js +107 -35
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-button-group/cat-button-group.js +3 -2
- package/dist/collection/components/cat-button-group/cat-button-group.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +83 -24
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-date/cat-date.js +114 -39
- package/dist/collection/components/cat-date/cat-date.js.map +1 -1
- package/dist/collection/components/cat-date-inline/cat-date-inline.js +69 -19
- package/dist/collection/components/cat-date-inline/cat-date-inline.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +130 -42
- package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +37 -12
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +129 -17
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +19 -4
- package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.js +15 -7
- package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.js +143 -51
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +60 -10
- package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.js +65 -18
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +21 -8
- package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +32 -7
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.js +105 -34
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +22 -5
- package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js +15 -4
- package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
- package/dist/collection/components/cat-tab/cat-tab.js +84 -17
- package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.css +29 -12
- package/dist/collection/components/cat-tabs/cat-tabs.js +189 -8
- package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
- package/dist/collection/components/cat-tag/cat-tag.js +84 -25
- package/dist/collection/components/cat-tag/cat-tag.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +90 -32
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-time/cat-time.js +120 -39
- package/dist/collection/components/cat-time/cat-time.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +71 -22
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +49 -8
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
- package/dist/components/cat-alert.js +8 -3
- package/dist/components/cat-alert.js.map +1 -1
- package/dist/components/cat-avatar.js +1 -0
- package/dist/components/cat-avatar2.js +11 -8
- package/dist/components/cat-avatar2.js.map +1 -1
- package/dist/components/cat-badge.js +23 -3
- package/dist/components/cat-badge.js.map +1 -1
- package/dist/components/cat-button-group.js +2 -3
- package/dist/components/cat-button-group.js.map +1 -1
- package/dist/components/cat-button.js +1 -0
- package/dist/components/cat-button2.js +41 -17
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-card.js +2 -2
- package/dist/components/cat-card.js.map +1 -1
- package/dist/components/cat-checkbox.js +1 -0
- package/dist/components/cat-checkbox2.js +34 -10
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-date-inline.js +1 -0
- package/dist/components/cat-date-inline2.js +29 -7
- package/dist/components/cat-date-inline2.js.map +1 -1
- package/dist/components/cat-date.js +41 -17
- package/dist/components/cat-date.js.map +1 -1
- package/dist/components/cat-datepicker-inline.js +16 -8
- package/dist/components/cat-datepicker-inline.js.map +1 -1
- package/dist/components/cat-datepicker.js +50 -20
- package/dist/components/cat-datepicker.js.map +1 -1
- package/dist/components/cat-datepicker.locale.js +110 -99
- package/dist/components/cat-datepicker.locale.js.map +1 -1
- package/dist/components/cat-dropdown.js +1 -0
- package/dist/components/cat-dropdown2.js +70 -13
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +12 -3
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-form-hint.js +1 -0
- package/dist/components/cat-form-hint.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +1 -0
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-icon-registry.js +22 -21
- package/dist/components/cat-icon-registry.js.map +1 -1
- package/dist/components/cat-icon.js +1 -0
- package/dist/components/cat-icon2.js +5 -5
- package/dist/components/cat-icon2.js.map +1 -1
- package/dist/components/cat-input.js +1 -0
- package/dist/components/cat-input2.js +50 -25
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-pagination.js +32 -2
- package/dist/components/cat-pagination.js.map +1 -1
- package/dist/components/cat-radio-group.js +8 -5
- package/dist/components/cat-radio-group.js.map +1 -1
- package/dist/components/cat-radio.js +28 -8
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-scrollable.js +1 -0
- package/dist/components/cat-scrollable2.js +322 -542
- package/dist/components/cat-scrollable2.js.map +1 -1
- package/dist/components/cat-select-demo.js +27 -49
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-select.js +1 -0
- package/dist/components/cat-select2.js +135 -316
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-skeleton.js +1 -0
- package/dist/components/cat-skeleton2.js +12 -3
- package/dist/components/cat-skeleton2.js.map +1 -1
- package/dist/components/cat-spinner.js +1 -0
- package/dist/components/cat-spinner2.js +8 -3
- package/dist/components/cat-spinner2.js.map +1 -1
- package/dist/components/cat-tab.js +34 -9
- package/dist/components/cat-tab.js.map +1 -1
- package/dist/components/cat-tabs.js +140 -11
- package/dist/components/cat-tabs.js.map +1 -1
- package/dist/components/cat-tag.js +35 -13
- package/dist/components/cat-tag.js.map +1 -1
- package/dist/components/cat-textarea.js +33 -16
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-time.js +44 -16
- package/dist/components/cat-time.js.map +1 -1
- package/dist/components/cat-toggle.js +28 -10
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/cat-tooltip.js +28 -3
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/coerce.js +1 -0
- package/dist/components/coerce.js.map +1 -1
- package/dist/components/first-tabbable.js +1 -0
- package/dist/components/first-tabbable.js.map +1 -1
- package/dist/components/{floating-ui.dom.esm.js → floating-ui.dom.js} +3 -492
- package/dist/components/floating-ui.dom.js.map +1 -0
- package/dist/components/index.js +460 -450
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +9456 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/loglevel.js +368 -356
- package/dist/components/loglevel.js.map +1 -1
- package/dist/components/media-matcher.js +1 -0
- package/dist/components/media-matcher.js.map +1 -1
- package/dist/esm/app-globals-DQuL1Twl.js +6 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/cat-alert_30.entry.js +1428 -1792
- package/dist/esm/cat-alert_30.entry.js.map +1 -1
- package/dist/esm/catalyst.js +7 -5
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/{index-e8c0ddf2.js → index-B-m4GNf1.js} +528 -338
- package/dist/esm/index-B-m4GNf1.js.map +1 -0
- package/dist/esm/index-LJZzaWFR.js +10057 -0
- package/dist/esm/index-LJZzaWFR.js.map +1 -0
- package/dist/esm/index.js +458 -448
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +5 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +11 -1
- package/dist/types/components/cat-tab/cat-tab.d.ts +6 -0
- package/dist/types/components/cat-tabs/cat-tabs.d.ts +18 -0
- package/dist/types/components.d.ts +46 -0
- package/dist/types/stencil-public-runtime.d.ts +28 -2
- package/loader/index.d.ts +3 -0
- package/package.json +3 -3
- package/dist/catalyst/p-59e2ada2.entry.js +0 -10
- package/dist/catalyst/p-59e2ada2.entry.js.map +0 -1
- package/dist/catalyst/p-7f3bcfb9.js +0 -3
- package/dist/catalyst/p-7f3bcfb9.js.map +0 -1
- package/dist/catalyst/p-9500d6fb.js +0 -2
- package/dist/catalyst/p-9500d6fb.js.map +0 -1
- package/dist/catalyst/p-e1255160.js +0 -2
- package/dist/catalyst/p-e1255160.js.map +0 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/index-1094f0fc.js.map +0 -1
- package/dist/cjs/of-958251e4.js +0 -1549
- package/dist/cjs/of-958251e4.js.map +0 -1
- package/dist/collection/components/cat-alert/cat-alert.e2e.js +0 -11
- package/dist/collection/components/cat-alert/cat-alert.e2e.js.map +0 -1
- package/dist/collection/components/cat-alert/cat-alert.spec.js +0 -14
- package/dist/collection/components/cat-alert/cat-alert.spec.js.map +0 -1
- package/dist/collection/components/cat-avatar/cat-avatar.e2e.js +0 -10
- package/dist/collection/components/cat-avatar/cat-avatar.e2e.js.map +0 -1
- package/dist/collection/components/cat-avatar/cat-avatar.spec.js +0 -14
- package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +0 -1
- package/dist/collection/components/cat-badge/cat-badge.e2e.js +0 -10
- package/dist/collection/components/cat-badge/cat-badge.e2e.js.map +0 -1
- package/dist/collection/components/cat-badge/cat-badge.spec.js +0 -14
- package/dist/collection/components/cat-badge/cat-badge.spec.js.map +0 -1
- package/dist/collection/components/cat-button/cat-button.e2e.js +0 -10
- package/dist/collection/components/cat-button/cat-button.e2e.js.map +0 -1
- package/dist/collection/components/cat-button/cat-button.spec.js +0 -20
- package/dist/collection/components/cat-button/cat-button.spec.js.map +0 -1
- package/dist/collection/components/cat-button-group/cat-button-group.e2e.js +0 -10
- package/dist/collection/components/cat-button-group/cat-button-group.e2e.js.map +0 -1
- package/dist/collection/components/cat-button-group/cat-button-group.spec.js +0 -14
- package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +0 -1
- package/dist/collection/components/cat-card/cat-card.e2e.js +0 -10
- package/dist/collection/components/cat-card/cat-card.e2e.js.map +0 -1
- package/dist/collection/components/cat-card/cat-card.spec.js +0 -14
- package/dist/collection/components/cat-card/cat-card.spec.js.map +0 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js +0 -10
- package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js.map +0 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +0 -14
- package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +0 -1
- package/dist/collection/components/cat-date/cat-date.e2e.js +0 -11
- package/dist/collection/components/cat-date/cat-date.e2e.js.map +0 -1
- package/dist/collection/components/cat-date/cat-date.spec.js +0 -17
- package/dist/collection/components/cat-date/cat-date.spec.js.map +0 -1
- package/dist/collection/components/cat-date-inline/cat-date-inline.e2e.js +0 -11
- package/dist/collection/components/cat-date-inline/cat-date-inline.e2e.js.map +0 -1
- package/dist/collection/components/cat-date-inline/cat-date-inline.spec.js +0 -16
- package/dist/collection/components/cat-date-inline/cat-date-inline.spec.js.map +0 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js +0 -11
- package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js.map +0 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +0 -15
- package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +0 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js +0 -11
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js.map +0 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +0 -15
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +0 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js +0 -10
- package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js.map +0 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +0 -21
- package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +0 -1
- package/dist/collection/components/cat-form-group/cat-form-group.e2e.js +0 -10
- package/dist/collection/components/cat-form-group/cat-form-group.e2e.js.map +0 -1
- package/dist/collection/components/cat-form-group/cat-form-group.spec.js +0 -14
- package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +0 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +0 -15
- package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +0 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js +0 -7
- package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js.map +0 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.spec.js +0 -7
- package/dist/collection/components/cat-icon/cat-icon-registry.spec.js.map +0 -1
- package/dist/collection/components/cat-icon/cat-icon.e2e.js +0 -11
- package/dist/collection/components/cat-icon/cat-icon.e2e.js.map +0 -1
- package/dist/collection/components/cat-icon/cat-icon.spec.js +0 -15
- package/dist/collection/components/cat-icon/cat-icon.spec.js.map +0 -1
- package/dist/collection/components/cat-input/cat-input.e2e.js +0 -11
- package/dist/collection/components/cat-input/cat-input.e2e.js.map +0 -1
- package/dist/collection/components/cat-input/cat-input.spec.js +0 -15
- package/dist/collection/components/cat-input/cat-input.spec.js.map +0 -1
- package/dist/collection/components/cat-notification/cat-notification.spec.js +0 -7
- package/dist/collection/components/cat-notification/cat-notification.spec.js.map +0 -1
- package/dist/collection/components/cat-pagination/cat-pagination.e2e.js +0 -14
- package/dist/collection/components/cat-pagination/cat-pagination.e2e.js.map +0 -1
- package/dist/collection/components/cat-pagination/cat-pagination.spec.js +0 -15
- package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +0 -1
- package/dist/collection/components/cat-radio/cat-radio.e2e.js +0 -10
- package/dist/collection/components/cat-radio/cat-radio.e2e.js.map +0 -1
- package/dist/collection/components/cat-radio/cat-radio.spec.js +0 -14
- package/dist/collection/components/cat-radio/cat-radio.spec.js.map +0 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js +0 -10
- package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js.map +0 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +0 -14
- package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +0 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js +0 -10
- package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js.map +0 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +0 -14
- package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +0 -1
- package/dist/collection/components/cat-select/cat-select.e2e.js +0 -14
- package/dist/collection/components/cat-select/cat-select.e2e.js.map +0 -1
- package/dist/collection/components/cat-select/cat-select.spec.js +0 -15
- package/dist/collection/components/cat-select/cat-select.spec.js.map +0 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js +0 -10
- package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js.map +0 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +0 -14
- package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +0 -1
- package/dist/collection/components/cat-spinner/cat-spinner.e2e.js +0 -10
- package/dist/collection/components/cat-spinner/cat-spinner.e2e.js.map +0 -1
- package/dist/collection/components/cat-spinner/cat-spinner.spec.js +0 -18
- package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +0 -1
- package/dist/collection/components/cat-tab/cat-tab.e2e.js +0 -10
- package/dist/collection/components/cat-tab/cat-tab.e2e.js.map +0 -1
- package/dist/collection/components/cat-tab/cat-tab.spec.js +0 -14
- package/dist/collection/components/cat-tab/cat-tab.spec.js.map +0 -1
- package/dist/collection/components/cat-tabs/cat-tabs.e2e.js +0 -10
- package/dist/collection/components/cat-tabs/cat-tabs.e2e.js.map +0 -1
- package/dist/collection/components/cat-tabs/cat-tabs.spec.js +0 -14
- package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +0 -1
- package/dist/collection/components/cat-tag/cat-tag.e2e.js +0 -14
- package/dist/collection/components/cat-tag/cat-tag.e2e.js.map +0 -1
- package/dist/collection/components/cat-tag/cat-tag.spec.js +0 -23
- package/dist/collection/components/cat-tag/cat-tag.spec.js.map +0 -1
- package/dist/collection/components/cat-textarea/cat-textarea.e2e.js +0 -11
- package/dist/collection/components/cat-textarea/cat-textarea.e2e.js.map +0 -1
- package/dist/collection/components/cat-textarea/cat-textarea.spec.js +0 -15
- package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +0 -1
- package/dist/collection/components/cat-time/cat-time.e2e.js +0 -11
- package/dist/collection/components/cat-time/cat-time.e2e.js.map +0 -1
- package/dist/collection/components/cat-time/cat-time.spec.js +0 -16
- package/dist/collection/components/cat-time/cat-time.spec.js.map +0 -1
- package/dist/collection/components/cat-toggle/cat-toggle.e2e.js +0 -10
- package/dist/collection/components/cat-toggle/cat-toggle.e2e.js.map +0 -1
- package/dist/collection/components/cat-toggle/cat-toggle.spec.js +0 -14
- package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +0 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js +0 -10
- package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js.map +0 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +0 -20
- package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +0 -1
- package/dist/collection/utils/media-matcher.spec.js +0 -39
- package/dist/collection/utils/media-matcher.spec.js.map +0 -1
- package/dist/components/floating-ui.dom.esm.js.map +0 -1
- package/dist/components/from.js +0 -928
- package/dist/components/from.js.map +0 -1
- package/dist/components/of.js +0 -10
- package/dist/components/of.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/index-e8c0ddf2.js.map +0 -1
- package/dist/esm/of-e4ec2eb4.js +0 -1523
- package/dist/esm/of-e4ec2eb4.js.map +0 -1
- package/loader/package.json +0 -11
|
@@ -10,34 +10,64 @@ export class CatDatepickerFlat {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
this.hasSlottedLabel = false;
|
|
12
12
|
this.hasSlottedHint = false;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the label need a marker to shown if the input is required or optional.
|
|
15
|
+
*/
|
|
13
16
|
this.requiredMarker = 'optional';
|
|
17
|
+
/**
|
|
18
|
+
* Whether the label is on top or left.
|
|
19
|
+
*/
|
|
14
20
|
this.horizontal = false;
|
|
21
|
+
/**
|
|
22
|
+
* Hint for form autofill feature.
|
|
23
|
+
*/
|
|
15
24
|
this.autoComplete = 'off';
|
|
25
|
+
/**
|
|
26
|
+
* Whether the input should show a clear button.
|
|
27
|
+
*/
|
|
16
28
|
this.clearable = false;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the input is disabled.
|
|
31
|
+
*/
|
|
17
32
|
this.disabled = false;
|
|
18
|
-
|
|
19
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Display the icon on the right.
|
|
35
|
+
*/
|
|
20
36
|
this.iconRight = false;
|
|
21
|
-
|
|
37
|
+
/**
|
|
38
|
+
* The label for the input.
|
|
39
|
+
*/
|
|
22
40
|
this.label = '';
|
|
41
|
+
/**
|
|
42
|
+
* Visually hide the label, but still show it to assistive technologies like screen readers.
|
|
43
|
+
*/
|
|
23
44
|
this.labelHidden = false;
|
|
24
|
-
|
|
25
|
-
|
|
45
|
+
/**
|
|
46
|
+
* The mode of the datepicker, to select a date, time, both, a date range or a week number.
|
|
47
|
+
*/
|
|
26
48
|
this.mode = 'date';
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.textSuffix = undefined;
|
|
49
|
+
/**
|
|
50
|
+
* The value is not editable.
|
|
51
|
+
*/
|
|
31
52
|
this.readonly = false;
|
|
53
|
+
/**
|
|
54
|
+
* A value is required or must be check for the form to be submittable.
|
|
55
|
+
*/
|
|
32
56
|
this.required = false;
|
|
57
|
+
/**
|
|
58
|
+
* The step size to use when changing the time.
|
|
59
|
+
*/
|
|
33
60
|
this.step = 5;
|
|
61
|
+
/**
|
|
62
|
+
* Instead of body, appends the calendar to the cat-datepicker element instead
|
|
63
|
+
*/
|
|
34
64
|
this.attachToElement = false;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Fine-grained control over when the errors are shown. Can be `false` to
|
|
67
|
+
* never show errors, `true` to show errors on blur, or a number to show
|
|
68
|
+
* errors change with the given delay in milliseconds or immediately on blur.
|
|
69
|
+
*/
|
|
38
70
|
this.errorUpdate = 0;
|
|
39
|
-
this.nativeAttributes = undefined;
|
|
40
|
-
this.nativePickerAttributes = undefined;
|
|
41
71
|
}
|
|
42
72
|
get input() {
|
|
43
73
|
return this._input?.shadowRoot?.querySelector('input') ?? undefined;
|
|
@@ -179,6 +209,7 @@ export class CatDatepickerFlat {
|
|
|
179
209
|
return {
|
|
180
210
|
"requiredMarker": {
|
|
181
211
|
"type": "string",
|
|
212
|
+
"attribute": "required-marker",
|
|
182
213
|
"mutable": false,
|
|
183
214
|
"complexType": {
|
|
184
215
|
"original": "'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!'",
|
|
@@ -191,12 +222,14 @@ export class CatDatepickerFlat {
|
|
|
191
222
|
"tags": [],
|
|
192
223
|
"text": "Whether the label need a marker to shown if the input is required or optional."
|
|
193
224
|
},
|
|
194
|
-
"
|
|
225
|
+
"getter": false,
|
|
226
|
+
"setter": false,
|
|
195
227
|
"reflect": false,
|
|
196
228
|
"defaultValue": "'optional'"
|
|
197
229
|
},
|
|
198
230
|
"horizontal": {
|
|
199
231
|
"type": "boolean",
|
|
232
|
+
"attribute": "horizontal",
|
|
200
233
|
"mutable": false,
|
|
201
234
|
"complexType": {
|
|
202
235
|
"original": "boolean",
|
|
@@ -209,12 +242,14 @@ export class CatDatepickerFlat {
|
|
|
209
242
|
"tags": [],
|
|
210
243
|
"text": "Whether the label is on top or left."
|
|
211
244
|
},
|
|
212
|
-
"
|
|
245
|
+
"getter": false,
|
|
246
|
+
"setter": false,
|
|
213
247
|
"reflect": false,
|
|
214
248
|
"defaultValue": "false"
|
|
215
249
|
},
|
|
216
250
|
"autoComplete": {
|
|
217
251
|
"type": "string",
|
|
252
|
+
"attribute": "auto-complete",
|
|
218
253
|
"mutable": false,
|
|
219
254
|
"complexType": {
|
|
220
255
|
"original": "string",
|
|
@@ -227,12 +262,14 @@ export class CatDatepickerFlat {
|
|
|
227
262
|
"tags": [],
|
|
228
263
|
"text": "Hint for form autofill feature."
|
|
229
264
|
},
|
|
230
|
-
"
|
|
265
|
+
"getter": false,
|
|
266
|
+
"setter": false,
|
|
231
267
|
"reflect": false,
|
|
232
268
|
"defaultValue": "'off'"
|
|
233
269
|
},
|
|
234
270
|
"clearable": {
|
|
235
271
|
"type": "boolean",
|
|
272
|
+
"attribute": "clearable",
|
|
236
273
|
"mutable": false,
|
|
237
274
|
"complexType": {
|
|
238
275
|
"original": "boolean",
|
|
@@ -245,12 +282,14 @@ export class CatDatepickerFlat {
|
|
|
245
282
|
"tags": [],
|
|
246
283
|
"text": "Whether the input should show a clear button."
|
|
247
284
|
},
|
|
248
|
-
"
|
|
285
|
+
"getter": false,
|
|
286
|
+
"setter": false,
|
|
249
287
|
"reflect": false,
|
|
250
288
|
"defaultValue": "false"
|
|
251
289
|
},
|
|
252
290
|
"disabled": {
|
|
253
291
|
"type": "boolean",
|
|
292
|
+
"attribute": "disabled",
|
|
254
293
|
"mutable": false,
|
|
255
294
|
"complexType": {
|
|
256
295
|
"original": "boolean",
|
|
@@ -263,12 +302,14 @@ export class CatDatepickerFlat {
|
|
|
263
302
|
"tags": [],
|
|
264
303
|
"text": "Whether the input is disabled."
|
|
265
304
|
},
|
|
266
|
-
"
|
|
305
|
+
"getter": false,
|
|
306
|
+
"setter": false,
|
|
267
307
|
"reflect": false,
|
|
268
308
|
"defaultValue": "false"
|
|
269
309
|
},
|
|
270
310
|
"hint": {
|
|
271
311
|
"type": "string",
|
|
312
|
+
"attribute": "hint",
|
|
272
313
|
"mutable": false,
|
|
273
314
|
"complexType": {
|
|
274
315
|
"original": "string | string[]",
|
|
@@ -281,11 +322,13 @@ export class CatDatepickerFlat {
|
|
|
281
322
|
"tags": [],
|
|
282
323
|
"text": "Optional hint text(s) to be displayed with the input."
|
|
283
324
|
},
|
|
284
|
-
"
|
|
325
|
+
"getter": false,
|
|
326
|
+
"setter": false,
|
|
285
327
|
"reflect": false
|
|
286
328
|
},
|
|
287
329
|
"icon": {
|
|
288
330
|
"type": "string",
|
|
331
|
+
"attribute": "icon",
|
|
289
332
|
"mutable": false,
|
|
290
333
|
"complexType": {
|
|
291
334
|
"original": "string",
|
|
@@ -298,11 +341,13 @@ export class CatDatepickerFlat {
|
|
|
298
341
|
"tags": [],
|
|
299
342
|
"text": "The name of an icon to be displayed in the input."
|
|
300
343
|
},
|
|
301
|
-
"
|
|
344
|
+
"getter": false,
|
|
345
|
+
"setter": false,
|
|
302
346
|
"reflect": false
|
|
303
347
|
},
|
|
304
348
|
"iconRight": {
|
|
305
349
|
"type": "boolean",
|
|
350
|
+
"attribute": "icon-right",
|
|
306
351
|
"mutable": false,
|
|
307
352
|
"complexType": {
|
|
308
353
|
"original": "boolean",
|
|
@@ -315,12 +360,14 @@ export class CatDatepickerFlat {
|
|
|
315
360
|
"tags": [],
|
|
316
361
|
"text": "Display the icon on the right."
|
|
317
362
|
},
|
|
318
|
-
"
|
|
363
|
+
"getter": false,
|
|
364
|
+
"setter": false,
|
|
319
365
|
"reflect": false,
|
|
320
366
|
"defaultValue": "false"
|
|
321
367
|
},
|
|
322
368
|
"identifier": {
|
|
323
369
|
"type": "string",
|
|
370
|
+
"attribute": "identifier",
|
|
324
371
|
"mutable": false,
|
|
325
372
|
"complexType": {
|
|
326
373
|
"original": "string",
|
|
@@ -333,11 +380,13 @@ export class CatDatepickerFlat {
|
|
|
333
380
|
"tags": [],
|
|
334
381
|
"text": "A unique identifier for the input."
|
|
335
382
|
},
|
|
336
|
-
"
|
|
383
|
+
"getter": false,
|
|
384
|
+
"setter": false,
|
|
337
385
|
"reflect": false
|
|
338
386
|
},
|
|
339
387
|
"label": {
|
|
340
388
|
"type": "string",
|
|
389
|
+
"attribute": "label",
|
|
341
390
|
"mutable": false,
|
|
342
391
|
"complexType": {
|
|
343
392
|
"original": "string",
|
|
@@ -350,12 +399,14 @@ export class CatDatepickerFlat {
|
|
|
350
399
|
"tags": [],
|
|
351
400
|
"text": "The label for the input."
|
|
352
401
|
},
|
|
353
|
-
"
|
|
402
|
+
"getter": false,
|
|
403
|
+
"setter": false,
|
|
354
404
|
"reflect": false,
|
|
355
405
|
"defaultValue": "''"
|
|
356
406
|
},
|
|
357
407
|
"labelHidden": {
|
|
358
408
|
"type": "boolean",
|
|
409
|
+
"attribute": "label-hidden",
|
|
359
410
|
"mutable": false,
|
|
360
411
|
"complexType": {
|
|
361
412
|
"original": "boolean",
|
|
@@ -368,12 +419,14 @@ export class CatDatepickerFlat {
|
|
|
368
419
|
"tags": [],
|
|
369
420
|
"text": "Visually hide the label, but still show it to assistive technologies like screen readers."
|
|
370
421
|
},
|
|
371
|
-
"
|
|
422
|
+
"getter": false,
|
|
423
|
+
"setter": false,
|
|
372
424
|
"reflect": false,
|
|
373
425
|
"defaultValue": "false"
|
|
374
426
|
},
|
|
375
427
|
"max": {
|
|
376
428
|
"type": "string",
|
|
429
|
+
"attribute": "max",
|
|
377
430
|
"mutable": false,
|
|
378
431
|
"complexType": {
|
|
379
432
|
"original": "string",
|
|
@@ -386,11 +439,13 @@ export class CatDatepickerFlat {
|
|
|
386
439
|
"tags": [],
|
|
387
440
|
"text": "A maximum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z."
|
|
388
441
|
},
|
|
389
|
-
"
|
|
442
|
+
"getter": false,
|
|
443
|
+
"setter": false,
|
|
390
444
|
"reflect": false
|
|
391
445
|
},
|
|
392
446
|
"min": {
|
|
393
447
|
"type": "string",
|
|
448
|
+
"attribute": "min",
|
|
394
449
|
"mutable": false,
|
|
395
450
|
"complexType": {
|
|
396
451
|
"original": "string",
|
|
@@ -403,11 +458,13 @@ export class CatDatepickerFlat {
|
|
|
403
458
|
"tags": [],
|
|
404
459
|
"text": "A minimum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z."
|
|
405
460
|
},
|
|
406
|
-
"
|
|
461
|
+
"getter": false,
|
|
462
|
+
"setter": false,
|
|
407
463
|
"reflect": false
|
|
408
464
|
},
|
|
409
465
|
"mode": {
|
|
410
466
|
"type": "string",
|
|
467
|
+
"attribute": "mode",
|
|
411
468
|
"mutable": false,
|
|
412
469
|
"complexType": {
|
|
413
470
|
"original": "CatDatepickerMode",
|
|
@@ -426,12 +483,14 @@ export class CatDatepickerFlat {
|
|
|
426
483
|
"tags": [],
|
|
427
484
|
"text": "The mode of the datepicker, to select a date, time, both, a date range or a week number."
|
|
428
485
|
},
|
|
429
|
-
"
|
|
486
|
+
"getter": false,
|
|
487
|
+
"setter": false,
|
|
430
488
|
"reflect": false,
|
|
431
489
|
"defaultValue": "'date'"
|
|
432
490
|
},
|
|
433
491
|
"name": {
|
|
434
492
|
"type": "string",
|
|
493
|
+
"attribute": "name",
|
|
435
494
|
"mutable": false,
|
|
436
495
|
"complexType": {
|
|
437
496
|
"original": "string",
|
|
@@ -444,11 +503,13 @@ export class CatDatepickerFlat {
|
|
|
444
503
|
"tags": [],
|
|
445
504
|
"text": "The name of the form control. Submitted with the form as part of a name/value pair."
|
|
446
505
|
},
|
|
447
|
-
"
|
|
506
|
+
"getter": false,
|
|
507
|
+
"setter": false,
|
|
448
508
|
"reflect": false
|
|
449
509
|
},
|
|
450
510
|
"placeholder": {
|
|
451
511
|
"type": "string",
|
|
512
|
+
"attribute": "placeholder",
|
|
452
513
|
"mutable": false,
|
|
453
514
|
"complexType": {
|
|
454
515
|
"original": "string",
|
|
@@ -461,11 +522,13 @@ export class CatDatepickerFlat {
|
|
|
461
522
|
"tags": [],
|
|
462
523
|
"text": "The placeholder text to display within the input."
|
|
463
524
|
},
|
|
464
|
-
"
|
|
525
|
+
"getter": false,
|
|
526
|
+
"setter": false,
|
|
465
527
|
"reflect": false
|
|
466
528
|
},
|
|
467
529
|
"textPrefix": {
|
|
468
530
|
"type": "string",
|
|
531
|
+
"attribute": "text-prefix",
|
|
469
532
|
"mutable": false,
|
|
470
533
|
"complexType": {
|
|
471
534
|
"original": "string",
|
|
@@ -478,11 +541,13 @@ export class CatDatepickerFlat {
|
|
|
478
541
|
"tags": [],
|
|
479
542
|
"text": "A textual prefix to be displayed in the input."
|
|
480
543
|
},
|
|
481
|
-
"
|
|
544
|
+
"getter": false,
|
|
545
|
+
"setter": false,
|
|
482
546
|
"reflect": false
|
|
483
547
|
},
|
|
484
548
|
"textSuffix": {
|
|
485
549
|
"type": "string",
|
|
550
|
+
"attribute": "text-suffix",
|
|
486
551
|
"mutable": false,
|
|
487
552
|
"complexType": {
|
|
488
553
|
"original": "string",
|
|
@@ -495,11 +560,13 @@ export class CatDatepickerFlat {
|
|
|
495
560
|
"tags": [],
|
|
496
561
|
"text": "A textual suffix to be displayed in the input."
|
|
497
562
|
},
|
|
498
|
-
"
|
|
563
|
+
"getter": false,
|
|
564
|
+
"setter": false,
|
|
499
565
|
"reflect": false
|
|
500
566
|
},
|
|
501
567
|
"readonly": {
|
|
502
568
|
"type": "boolean",
|
|
569
|
+
"attribute": "readonly",
|
|
503
570
|
"mutable": false,
|
|
504
571
|
"complexType": {
|
|
505
572
|
"original": "boolean",
|
|
@@ -512,12 +579,14 @@ export class CatDatepickerFlat {
|
|
|
512
579
|
"tags": [],
|
|
513
580
|
"text": "The value is not editable."
|
|
514
581
|
},
|
|
515
|
-
"
|
|
582
|
+
"getter": false,
|
|
583
|
+
"setter": false,
|
|
516
584
|
"reflect": false,
|
|
517
585
|
"defaultValue": "false"
|
|
518
586
|
},
|
|
519
587
|
"required": {
|
|
520
588
|
"type": "boolean",
|
|
589
|
+
"attribute": "required",
|
|
521
590
|
"mutable": false,
|
|
522
591
|
"complexType": {
|
|
523
592
|
"original": "boolean",
|
|
@@ -530,12 +599,14 @@ export class CatDatepickerFlat {
|
|
|
530
599
|
"tags": [],
|
|
531
600
|
"text": "A value is required or must be check for the form to be submittable."
|
|
532
601
|
},
|
|
533
|
-
"
|
|
602
|
+
"getter": false,
|
|
603
|
+
"setter": false,
|
|
534
604
|
"reflect": false,
|
|
535
605
|
"defaultValue": "false"
|
|
536
606
|
},
|
|
537
607
|
"step": {
|
|
538
608
|
"type": "number",
|
|
609
|
+
"attribute": "step",
|
|
539
610
|
"mutable": false,
|
|
540
611
|
"complexType": {
|
|
541
612
|
"original": "number",
|
|
@@ -548,12 +619,14 @@ export class CatDatepickerFlat {
|
|
|
548
619
|
"tags": [],
|
|
549
620
|
"text": "The step size to use when changing the time."
|
|
550
621
|
},
|
|
551
|
-
"
|
|
622
|
+
"getter": false,
|
|
623
|
+
"setter": false,
|
|
552
624
|
"reflect": false,
|
|
553
625
|
"defaultValue": "5"
|
|
554
626
|
},
|
|
555
627
|
"attachToElement": {
|
|
556
628
|
"type": "boolean",
|
|
629
|
+
"attribute": "attach-to-element",
|
|
557
630
|
"mutable": false,
|
|
558
631
|
"complexType": {
|
|
559
632
|
"original": "boolean",
|
|
@@ -566,12 +639,14 @@ export class CatDatepickerFlat {
|
|
|
566
639
|
"tags": [],
|
|
567
640
|
"text": "Instead of body, appends the calendar to the cat-datepicker element instead"
|
|
568
641
|
},
|
|
569
|
-
"
|
|
642
|
+
"getter": false,
|
|
643
|
+
"setter": false,
|
|
570
644
|
"reflect": false,
|
|
571
645
|
"defaultValue": "false"
|
|
572
646
|
},
|
|
573
647
|
"position": {
|
|
574
648
|
"type": "string",
|
|
649
|
+
"attribute": "position",
|
|
575
650
|
"mutable": false,
|
|
576
651
|
"complexType": {
|
|
577
652
|
"original": "BaseOptions['position'] | Placement",
|
|
@@ -598,11 +673,13 @@ export class CatDatepickerFlat {
|
|
|
598
673
|
}],
|
|
599
674
|
"text": "Where the calendar is rendered relative to the input vertically and horizontally.\nIn the format of \"[vertical] [horizontal]\". Vertical can be auto, above or below (required).\nHorizontal can be left, center or right.\nIf"
|
|
600
675
|
},
|
|
601
|
-
"
|
|
676
|
+
"getter": false,
|
|
677
|
+
"setter": false,
|
|
602
678
|
"reflect": false
|
|
603
679
|
},
|
|
604
680
|
"value": {
|
|
605
681
|
"type": "string",
|
|
682
|
+
"attribute": "value",
|
|
606
683
|
"mutable": true,
|
|
607
684
|
"complexType": {
|
|
608
685
|
"original": "string",
|
|
@@ -615,11 +692,13 @@ export class CatDatepickerFlat {
|
|
|
615
692
|
"tags": [],
|
|
616
693
|
"text": "The value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z or as a week number string."
|
|
617
694
|
},
|
|
618
|
-
"
|
|
695
|
+
"getter": false,
|
|
696
|
+
"setter": false,
|
|
619
697
|
"reflect": false
|
|
620
698
|
},
|
|
621
699
|
"errors": {
|
|
622
700
|
"type": "boolean",
|
|
701
|
+
"attribute": "errors",
|
|
623
702
|
"mutable": false,
|
|
624
703
|
"complexType": {
|
|
625
704
|
"original": "boolean | string[] | ErrorMap",
|
|
@@ -638,11 +717,13 @@ export class CatDatepickerFlat {
|
|
|
638
717
|
"tags": [],
|
|
639
718
|
"text": "The validation errors for this input. Will render a hint under the input\nwith the translated error message(s) `error.${key}`. If an object is\npassed, the keys will be used as error keys and the values translation\nparameters.\nIf the value is `true`, the input will be marked as invalid without any\nhints under the input."
|
|
640
719
|
},
|
|
641
|
-
"
|
|
720
|
+
"getter": false,
|
|
721
|
+
"setter": false,
|
|
642
722
|
"reflect": false
|
|
643
723
|
},
|
|
644
724
|
"errorUpdate": {
|
|
645
725
|
"type": "any",
|
|
726
|
+
"attribute": "error-update",
|
|
646
727
|
"mutable": false,
|
|
647
728
|
"complexType": {
|
|
648
729
|
"original": "boolean | number",
|
|
@@ -655,12 +736,14 @@ export class CatDatepickerFlat {
|
|
|
655
736
|
"tags": [],
|
|
656
737
|
"text": "Fine-grained control over when the errors are shown. Can be `false` to\nnever show errors, `true` to show errors on blur, or a number to show\nerrors change with the given delay in milliseconds or immediately on blur."
|
|
657
738
|
},
|
|
658
|
-
"
|
|
739
|
+
"getter": false,
|
|
740
|
+
"setter": false,
|
|
659
741
|
"reflect": false,
|
|
660
742
|
"defaultValue": "0"
|
|
661
743
|
},
|
|
662
744
|
"nativeAttributes": {
|
|
663
745
|
"type": "unknown",
|
|
746
|
+
"attribute": "native-attributes",
|
|
664
747
|
"mutable": false,
|
|
665
748
|
"complexType": {
|
|
666
749
|
"original": "{ [key: string]: string }",
|
|
@@ -672,10 +755,13 @@ export class CatDatepickerFlat {
|
|
|
672
755
|
"docs": {
|
|
673
756
|
"tags": [],
|
|
674
757
|
"text": "Attributes that will be added to the native HTML input element."
|
|
675
|
-
}
|
|
758
|
+
},
|
|
759
|
+
"getter": false,
|
|
760
|
+
"setter": false
|
|
676
761
|
},
|
|
677
762
|
"nativePickerAttributes": {
|
|
678
763
|
"type": "unknown",
|
|
764
|
+
"attribute": "native-picker-attributes",
|
|
679
765
|
"mutable": false,
|
|
680
766
|
"complexType": {
|
|
681
767
|
"original": "{ [key: string]: string }",
|
|
@@ -687,7 +773,9 @@ export class CatDatepickerFlat {
|
|
|
687
773
|
"docs": {
|
|
688
774
|
"tags": [],
|
|
689
775
|
"text": "Attributes that will be added to the rendered HTML datepicker element."
|
|
690
|
-
}
|
|
776
|
+
},
|
|
777
|
+
"getter": false,
|
|
778
|
+
"setter": false
|
|
691
779
|
}
|
|
692
780
|
};
|
|
693
781
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-datepicker.js","sourceRoot":"","sources":["../../../src/components/cat-datepicker/cat-datepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAA+B,MAAM,kBAAkB,CAAC;AAQlG,MAAM,OAAO,iBAAiB;;+BAUD,KAAK;8BAEN,KAAK;8BAKmE,UAAU;0BAKvF,KAAK;4BAKH,KAAK;yBAKR,KAAK;wBAKN,KAAK;;;yBAeJ,KAAK;;qBAUT,EAAE;2BAKI,KAAK;;;oBAeO,MAAM;;;;;wBAyBrB,KAAK;wBAKL,KAAK;oBAKT,CAAC;+BAKU,KAAK;;;;2BA8BS,CAAC;;;;IApJzC,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Method, Prop, State, Watch, h } from '@stencil/core';\nimport flatpickr from 'flatpickr';\nimport { findClosest } from '../../utils/find-closest';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { getConfig } from './cat-datepicker.config';\nimport { getFormat } from './cat-datepicker.format';\nimport { getLocale } from './cat-datepicker.locale';\nimport { CatDatepickerMode } from './cat-datepicker.mode';\nimport { autoUpdate, computePosition, flip, Placement, ReferenceElement } from '@floating-ui/dom';\nimport { BaseOptions } from 'flatpickr/dist/types/options';\n\n@Component({\n tag: 'cat-datepicker',\n styleUrl: 'cat-datepicker.scss',\n shadow: true\n})\nexport class CatDatepickerFlat {\n private pickr?: flatpickr.Instance;\n private _input?: HTMLCatInputElement;\n private _calendarWrapper?: HTMLDivElement;\n private get input(): HTMLInputElement | undefined {\n return this._input?.shadowRoot?.querySelector('input') ?? undefined;\n }\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete = 'off';\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() min?: string;\n\n /**\n * The mode of the datepicker, to select a date, time, both, a date range or a week number.\n */\n @Prop() mode: CatDatepickerMode = 'date';\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * The step size to use when changing the time.\n */\n @Prop() step = 5;\n\n /**\n * Instead of body, appends the calendar to the cat-datepicker element instead\n */\n @Prop() attachToElement = false;\n\n /**\n * Where the calendar is rendered relative to the input vertically and horizontally.\n * In the format of \"[vertical] [horizontal]\". Vertical can be auto, above or below (required).\n * Horizontal can be left, center or right.\n * If @attachToElement is passed the value should be in Placement format\n */\n @Prop() position?: BaseOptions['position'] | Placement;\n\n /**\n * The value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z or as a week number string.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors change with the given delay in milliseconds or immediately on blur.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Attributes that will be added to the rendered HTML datepicker element.\n */\n @Prop() nativePickerAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n @Watch('value')\n onValueChanged(value: string) {\n if (value) {\n this.pickr?.setDate(value, false);\n if (this.mode !== 'daterange' || value.includes(' - ')) {\n this.catChange.emit(value);\n }\n } else {\n this.pickr?.clear(false);\n this.catChange.emit(undefined);\n }\n }\n\n @Watch('disabled')\n @Watch('readonly')\n @Watch('mode')\n onDisabledChanged() {\n // Dynamically changing config value is not working due to a bug in the\n // library. We thus need to fully recreate the date picker after the value\n // has been updated.\n this.pickr?.destroy();\n this.pickr = undefined;\n setTimeout(() => {\n this.input ? (this.input.disabled = this.disabled) : null;\n this.pickr = this.initDatepicker(this.input);\n });\n }\n\n componentDidLoad() {\n this.pickr = this.initDatepicker(this.input);\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n }\n\n @Watch('min')\n @Watch('max')\n onMinChanged() {\n this.pickr?.set('minDate', this.min);\n this.pickr?.set('maxDate', this.max);\n if (this.value && !this.pickr?.selectedDates?.length) {\n // Dynamically changing 'minDate' or 'maxDate' does not emit a change if\n // the value is cleared due to an invalid date.\n this.pickr?.clear();\n }\n }\n\n /**\n * Programmatically move focus to the datepicker. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this._input?.doFocus(options);\n }\n\n /**\n * Programmatically remove focus from the datepicker. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this._input?.doBlur();\n }\n\n render() {\n return [\n <cat-input\n ref={el => (this._input = el)}\n requiredMarker={this.requiredMarker}\n horizontal={this.horizontal}\n autoComplete={this.autoComplete}\n clearable={this.clearable}\n disabled={this.disabled}\n hint={this.hint}\n icon={this.icon}\n iconRight={this.iconRight}\n identifier={this.identifier}\n label={this.label}\n labelHidden={this.labelHidden}\n name={this.name}\n placeholder={this.placeholder}\n textPrefix={this.textPrefix}\n textSuffix={this.textSuffix}\n readonly={this.readonly}\n required={this.required}\n value={this.value}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n nativeAttributes={this.nativeAttributes}\n onCatChange={e => {\n e.stopPropagation();\n this.value = e.detail || undefined;\n }}\n onCatFocus={e => {\n e.stopPropagation();\n this.catFocus.emit(e.detail);\n }}\n onCatBlur={e => {\n e.stopPropagation();\n this.catBlur.emit(e.detail);\n }}\n >\n {this.hasSlottedLabel && (\n <span slot=\"label\">\n <slot name=\"label\"></slot>\n </span>\n )}\n {this.hasSlottedHint && (\n <span slot=\"hint\">\n <slot name=\"hint\"></slot>\n </span>\n )}\n </cat-input>,\n <div ref={el => (this._calendarWrapper = el)} class=\"datepicker-wrapper\"></div>\n ];\n }\n\n private initDatepicker(input?: HTMLInputElement): flatpickr.Instance | undefined {\n if (!input) {\n return;\n }\n\n // avoid dropdown closing if datepicker is part of a dropdown\n const withinDropdown = !!findClosest('cat-dropdown', input);\n const nativePickerAttributes: { [key: string]: string } = withinDropdown ? { 'data-dropdown-no-close': '' } : {};\n\n return flatpickr(\n input,\n getConfig({\n locale: getLocale(i18n.getLocale()),\n format: getFormat(i18n.getLocale(), this.mode),\n mode: this.mode,\n min: this.min,\n max: this.max,\n step: this.step,\n disabled: this.disabled,\n readonly: this.readonly,\n appendTo: this.attachToElement ? this._calendarWrapper : undefined,\n nativePickerAttributes: { ...nativePickerAttributes, ...this.nativePickerAttributes },\n // flatpickr has open bug about incorrect positioning when appendTo is used,\n // we have to use custom logic to calculate position\n // https://github.com/flatpickr/flatpickr/issues/1619\n position: this.attachToElement\n ? (flatpickr, positionElement) => {\n this.updatePosition(flatpickr, positionElement);\n }\n : (this.position as BaseOptions['position']) || undefined,\n onReady: (_dates, _dateStr, flatpickr) => {\n autoUpdate(input, flatpickr.calendarContainer, () => this.updatePosition(flatpickr, flatpickr._input));\n },\n applyChange: value => (this.value = value)\n })\n );\n }\n\n private updatePosition(flatpickr: flatpickr.Instance, positionElement: HTMLElement | undefined): void {\n if (positionElement) {\n computePosition(positionElement as ReferenceElement, flatpickr.calendarContainer, {\n strategy: 'fixed',\n placement: (this.position as Placement) || 'bottom-start',\n middleware: [flip()]\n }).then(({ x, y, placement }) => {\n if (flatpickr.calendarContainer) {\n flatpickr.calendarContainer.dataset.placement = placement;\n Object.assign(flatpickr.calendarContainer.style, {\n left: `${x}px`,\n top: `${y}px`,\n position: 'fixed'\n });\n }\n });\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cat-datepicker.js","sourceRoot":"","sources":["../../../src/components/cat-datepicker/cat-datepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,SAAS,MAAM,WAAW,CAAC;AACl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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Method, Prop, State, Watch, h } from '@stencil/core';\nimport flatpickr from 'flatpickr';\nimport { findClosest } from '../../utils/find-closest';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { getConfig } from './cat-datepicker.config';\nimport { getFormat } from './cat-datepicker.format';\nimport { getLocale } from './cat-datepicker.locale';\nimport { CatDatepickerMode } from './cat-datepicker.mode';\nimport { autoUpdate, computePosition, flip, Placement, ReferenceElement } from '@floating-ui/dom';\nimport { BaseOptions } from 'flatpickr/dist/types/options';\n\n@Component({\n tag: 'cat-datepicker',\n styleUrl: 'cat-datepicker.scss',\n shadow: true\n})\nexport class CatDatepickerFlat {\n private pickr?: flatpickr.Instance;\n private _input?: HTMLCatInputElement;\n private _calendarWrapper?: HTMLDivElement;\n private get input(): HTMLInputElement | undefined {\n return this._input?.shadowRoot?.querySelector('input') ?? undefined;\n }\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete = 'off';\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() min?: string;\n\n /**\n * The mode of the datepicker, to select a date, time, both, a date range or a week number.\n */\n @Prop() mode: CatDatepickerMode = 'date';\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * The step size to use when changing the time.\n */\n @Prop() step = 5;\n\n /**\n * Instead of body, appends the calendar to the cat-datepicker element instead\n */\n @Prop() attachToElement = false;\n\n /**\n * Where the calendar is rendered relative to the input vertically and horizontally.\n * In the format of \"[vertical] [horizontal]\". Vertical can be auto, above or below (required).\n * Horizontal can be left, center or right.\n * If @attachToElement is passed the value should be in Placement format\n */\n @Prop() position?: BaseOptions['position'] | Placement;\n\n /**\n * The value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z or as a week number string.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors change with the given delay in milliseconds or immediately on blur.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Attributes that will be added to the rendered HTML datepicker element.\n */\n @Prop() nativePickerAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n @Watch('value')\n onValueChanged(value: string) {\n if (value) {\n this.pickr?.setDate(value, false);\n if (this.mode !== 'daterange' || value.includes(' - ')) {\n this.catChange.emit(value);\n }\n } else {\n this.pickr?.clear(false);\n this.catChange.emit(undefined);\n }\n }\n\n @Watch('disabled')\n @Watch('readonly')\n @Watch('mode')\n onDisabledChanged() {\n // Dynamically changing config value is not working due to a bug in the\n // library. We thus need to fully recreate the date picker after the value\n // has been updated.\n this.pickr?.destroy();\n this.pickr = undefined;\n setTimeout(() => {\n this.input ? (this.input.disabled = this.disabled) : null;\n this.pickr = this.initDatepicker(this.input);\n });\n }\n\n componentDidLoad() {\n this.pickr = this.initDatepicker(this.input);\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n }\n\n @Watch('min')\n @Watch('max')\n onMinChanged() {\n this.pickr?.set('minDate', this.min);\n this.pickr?.set('maxDate', this.max);\n if (this.value && !this.pickr?.selectedDates?.length) {\n // Dynamically changing 'minDate' or 'maxDate' does not emit a change if\n // the value is cleared due to an invalid date.\n this.pickr?.clear();\n }\n }\n\n /**\n * Programmatically move focus to the datepicker. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this._input?.doFocus(options);\n }\n\n /**\n * Programmatically remove focus from the datepicker. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this._input?.doBlur();\n }\n\n render() {\n return [\n <cat-input\n ref={el => (this._input = el)}\n requiredMarker={this.requiredMarker}\n horizontal={this.horizontal}\n autoComplete={this.autoComplete}\n clearable={this.clearable}\n disabled={this.disabled}\n hint={this.hint}\n icon={this.icon}\n iconRight={this.iconRight}\n identifier={this.identifier}\n label={this.label}\n labelHidden={this.labelHidden}\n name={this.name}\n placeholder={this.placeholder}\n textPrefix={this.textPrefix}\n textSuffix={this.textSuffix}\n readonly={this.readonly}\n required={this.required}\n value={this.value}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n nativeAttributes={this.nativeAttributes}\n onCatChange={e => {\n e.stopPropagation();\n this.value = e.detail || undefined;\n }}\n onCatFocus={e => {\n e.stopPropagation();\n this.catFocus.emit(e.detail);\n }}\n onCatBlur={e => {\n e.stopPropagation();\n this.catBlur.emit(e.detail);\n }}\n >\n {this.hasSlottedLabel && (\n <span slot=\"label\">\n <slot name=\"label\"></slot>\n </span>\n )}\n {this.hasSlottedHint && (\n <span slot=\"hint\">\n <slot name=\"hint\"></slot>\n </span>\n )}\n </cat-input>,\n <div ref={el => (this._calendarWrapper = el)} class=\"datepicker-wrapper\"></div>\n ];\n }\n\n private initDatepicker(input?: HTMLInputElement): flatpickr.Instance | undefined {\n if (!input) {\n return;\n }\n\n // avoid dropdown closing if datepicker is part of a dropdown\n const withinDropdown = !!findClosest('cat-dropdown', input);\n const nativePickerAttributes: { [key: string]: string } = withinDropdown ? { 'data-dropdown-no-close': '' } : {};\n\n return flatpickr(\n input,\n getConfig({\n locale: getLocale(i18n.getLocale()),\n format: getFormat(i18n.getLocale(), this.mode),\n mode: this.mode,\n min: this.min,\n max: this.max,\n step: this.step,\n disabled: this.disabled,\n readonly: this.readonly,\n appendTo: this.attachToElement ? this._calendarWrapper : undefined,\n nativePickerAttributes: { ...nativePickerAttributes, ...this.nativePickerAttributes },\n // flatpickr has open bug about incorrect positioning when appendTo is used,\n // we have to use custom logic to calculate position\n // https://github.com/flatpickr/flatpickr/issues/1619\n position: this.attachToElement\n ? (flatpickr, positionElement) => {\n this.updatePosition(flatpickr, positionElement);\n }\n : (this.position as BaseOptions['position']) || undefined,\n onReady: (_dates, _dateStr, flatpickr) => {\n autoUpdate(input, flatpickr.calendarContainer, () => this.updatePosition(flatpickr, flatpickr._input));\n },\n applyChange: value => (this.value = value)\n })\n );\n }\n\n private updatePosition(flatpickr: flatpickr.Instance, positionElement: HTMLElement | undefined): void {\n if (positionElement) {\n computePosition(positionElement as ReferenceElement, flatpickr.calendarContainer, {\n strategy: 'fixed',\n placement: (this.position as Placement) || 'bottom-start',\n middleware: [flip()]\n }).then(({ x, y, placement }) => {\n if (flatpickr.calendarContainer) {\n flatpickr.calendarContainer.dataset.placement = placement;\n Object.assign(flatpickr.calendarContainer.style, {\n left: `${x}px`,\n top: `${y}px`,\n position: 'fixed'\n });\n }\n });\n }\n }\n}\n"]}
|