@baloise/ds-core 16.3.0 → 16.4.0-nightly.20240916
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/README.md +1 -1
- package/components/all.d.ts +6 -0
- package/components/all.js +9 -0
- package/components/bal-accordion-summary.js +12 -2
- package/components/bal-accordion-trigger.js +15 -2
- package/components/bal-app.js +1 -85
- package/components/bal-app2.js +87 -0
- package/components/bal-carousel-item2.js +13 -3
- package/components/bal-carousel2.js +50 -20
- package/components/bal-checkbox-group.js +1 -1
- package/components/bal-checkbox2.js +13 -2
- package/components/bal-close2.js +1 -6
- package/components/bal-content.js +1 -69
- package/{dist/esm/bal-content.entry.js → components/bal-content2.js} +31 -12
- package/components/bal-date.js +1 -1
- package/components/bal-datepicker.js +1 -1
- package/components/bal-doc-app.d.ts +11 -0
- package/components/bal-doc-app.js +260 -0
- package/components/bal-dropdown.js +3 -3
- package/components/bal-file-upload.js +1 -1
- package/components/bal-icon2.js +1 -1
- package/components/bal-label2.js +3 -2
- package/components/bal-list-item-accordion-head2.js +7 -1
- package/components/bal-nav-menu-bar2.js +1 -1
- package/components/bal-nav-menu-flyout2.js +3 -6
- package/components/bal-nav.js +11 -8
- package/components/bal-option-list.js +27 -2
- package/components/bal-pagination2.js +3 -3
- package/components/bal-progress-bar.js +27 -12
- package/components/bal-radio2.js +1 -1
- package/components/bal-segment-item.d.ts +11 -0
- package/components/bal-segment-item.js +203 -0
- package/components/bal-segment.d.ts +11 -0
- package/components/bal-segment.js +337 -0
- package/components/bal-select2.js +1 -1
- package/components/bal-stack2.js +1 -1
- package/components/bal-steps.js +8 -6
- package/components/bal-tab-item.js +10 -2
- package/components/bal-tabs2.js +149 -31
- package/components/breakpoints.subject.js +3 -3
- package/components/index.esm.js +25 -1
- package/components/index.js +5 -289
- package/components/initialize.js +288 -0
- package/components/option.js +4 -1
- package/components/tokens.esm.js +1 -1
- package/components/window-resize.decorator.js +46 -0
- package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
- package/dist/baloise-design-system/baloise-design-system.js +1 -1
- package/dist/baloise-design-system/index.esm.js +1 -1
- package/dist/baloise-design-system/p-028b2074da.system.entry.js +1 -0
- package/dist/baloise-design-system/p-03dd9d77.js +1 -0
- package/dist/baloise-design-system/{p-ae28b86fe5.entry.js → p-0ab43941ba.entry.js} +1 -1
- package/dist/baloise-design-system/p-0b657bd621.entry.js +1 -0
- package/dist/baloise-design-system/p-0ffc64a85d.entry.js +1 -0
- package/dist/baloise-design-system/p-13b192fa66.system.entry.js +1 -0
- package/dist/baloise-design-system/p-1509eaa7.system.js +1 -1
- package/dist/baloise-design-system/{p-60f45a7b48.entry.js → p-18322c3982.entry.js} +1 -1
- package/dist/baloise-design-system/p-265f9d51c9.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-6ceac3e144.system.entry.js → p-28620358f2.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-51c0348938.entry.js → p-2905abdfb8.entry.js} +1 -1
- package/dist/baloise-design-system/p-29ba4f9afe.system.entry.js +1 -0
- package/dist/baloise-design-system/p-29cc1f4f03.entry.js +1 -0
- package/dist/baloise-design-system/{p-f6599f64b7.entry.js → p-2db4ff4c5b.entry.js} +1 -1
- package/dist/baloise-design-system/p-2f5e34adb5.entry.js +1 -0
- package/dist/baloise-design-system/{p-39bc49bc3d.entry.js → p-33028eda8b.entry.js} +1 -1
- package/dist/baloise-design-system/p-357ad79a9f.system.entry.js +1 -0
- package/dist/baloise-design-system/p-360068a4.system.js +1 -0
- package/dist/baloise-design-system/p-376d065607.entry.js +1 -0
- package/dist/baloise-design-system/{p-330b875d9d.system.entry.js → p-3818fa189f.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-381fe5557d.entry.js +1 -0
- package/dist/baloise-design-system/p-40b5ad07c5.system.entry.js +1 -0
- package/dist/baloise-design-system/p-41924c6dc6.entry.js +1 -0
- package/dist/baloise-design-system/{p-e60c936359.system.entry.js → p-43824ec17e.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-44732905.system.js +1 -0
- package/dist/baloise-design-system/{p-4afba8511a.system.entry.js → p-47a8ad4d7a.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-976ed5bcf1.entry.js → p-488c4a8ce1.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f9db454e37.entry.js → p-50bedf66b0.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c572e259f4.system.entry.js → p-50e6507a04.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-53e98a0f71.entry.js +1 -0
- package/dist/baloise-design-system/{p-cef24f8c62.entry.js → p-547aae9610.entry.js} +1 -1
- package/dist/baloise-design-system/p-54f81c32.js +1 -1
- package/dist/baloise-design-system/{p-6f4a362824.system.entry.js → p-5db0544e97.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-5e2b47ce.system.js +1 -0
- package/dist/baloise-design-system/{p-b779742f50.entry.js → p-5f004add03.entry.js} +1 -1
- package/dist/baloise-design-system/{p-d319b257.system.js → p-688b402d.system.js} +1 -1
- package/dist/baloise-design-system/p-6b9abd0d.js +1 -0
- package/dist/baloise-design-system/{p-22b041a511.entry.js → p-6c2bf02eb3.entry.js} +1 -1
- package/dist/baloise-design-system/p-6d1b6215.js +1 -0
- package/dist/baloise-design-system/p-6e3a79cce0.system.entry.js +1 -0
- package/dist/baloise-design-system/p-71588db3.system.js +1 -0
- package/dist/baloise-design-system/p-7291766c.system.js +1 -0
- package/dist/baloise-design-system/p-72fc9f680b.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-ba14aa7026.system.entry.js → p-8080a1192c.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1be257c9cd.system.entry.js → p-8131896202.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-814945e07a.system.entry.js +1 -0
- package/dist/baloise-design-system/p-8de1a12660.entry.js +1 -0
- package/dist/baloise-design-system/{p-8870e1f3e0.system.entry.js → p-8e17b76e7c.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1de6b20b1c.system.entry.js → p-97d2dc2d80.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-12bcc7da.js → p-9b4da619.js} +1 -1
- package/dist/baloise-design-system/{p-b97d9336a7.system.entry.js → p-9bb8778cdc.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-a507ff25cb.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-ad00d94e7f.entry.js → p-a5ee486a2b.entry.js} +1 -1
- package/dist/baloise-design-system/{p-301e753d6f.system.entry.js → p-a6c5468187.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-a78d1ca569.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-cf0c50d42a.system.entry.js → p-aa10ce253b.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-b51665840d.entry.js +1 -0
- package/dist/baloise-design-system/{p-982fa892e8.system.entry.js → p-b8251b8f68.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-b87c29c80b.entry.js +1 -0
- package/dist/baloise-design-system/{p-80b45dd4d6.system.entry.js → p-bcb892a723.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-bee13e834e.entry.js +1 -0
- package/dist/baloise-design-system/p-bfcaf2bb.js +1 -0
- package/dist/baloise-design-system/p-c0125be5ed.entry.js +1 -0
- package/dist/baloise-design-system/p-c2de2596d1.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-f02ea04390.entry.js → p-c6339999ca.entry.js} +1 -1
- package/dist/baloise-design-system/p-c68cc06fbe.system.entry.js +1 -0
- package/dist/baloise-design-system/p-c6f79792ab.entry.js +1 -0
- package/dist/baloise-design-system/p-c957d4dada.entry.js +1 -0
- package/dist/baloise-design-system/{p-3f1c49d0.js → p-caec1f9e.js} +1 -1
- package/dist/baloise-design-system/{p-45e0c0783b.entry.js → p-cafe624e35.entry.js} +1 -1
- package/dist/baloise-design-system/p-cda868a6a5.entry.js +1 -0
- package/dist/baloise-design-system/{p-a52564d27f.system.entry.js → p-d059465399.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-7292c6e1a1.entry.js → p-dbab5242fb.entry.js} +1 -1
- package/dist/baloise-design-system/{p-3bad0907.system.js → p-de36076c.system.js} +1 -1
- package/dist/baloise-design-system/p-e137e273b7.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-55faac1d.system.js → p-e187b9de.system.js} +1 -1
- package/dist/baloise-design-system/p-e8ffddeb.js +1 -0
- package/dist/baloise-design-system/{p-9e167705ca.entry.js → p-ecab0d67d5.entry.js} +1 -1
- package/dist/baloise-design-system/p-f33cfe7825.entry.js +1 -0
- package/dist/baloise-design-system/{p-94efe2aa.js → p-f5940253.js} +1 -1
- package/dist/baloise-design-system/{p-013b4c72.system.js → p-f959646a.system.js} +1 -1
- package/dist/baloise-design-system/{p-47b18581c7.system.entry.js → p-f9dba0b697.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-d0d06aa690.entry.js → p-fa8201fa9b.entry.js} +1 -1
- package/dist/baloise-design-system/{p-b7035c24.system.js → p-fb186fec.system.js} +1 -1
- package/dist/baloise-design-system/p-fd4bbaef5e.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-692536f9ff.system.entry.js → p-fd5a78208f.system.entry.js} +1 -1
- package/dist/cjs/app-globals-5fd73c0c.js +7 -0
- package/dist/cjs/bal-accordion_4.cjs.entry.js +29 -4
- package/dist/cjs/bal-carousel_2.cjs.entry.js +60 -24
- package/dist/cjs/bal-checkbox_2.cjs.entry.js +12 -2
- package/dist/cjs/bal-close.cjs.entry.js +1 -6
- package/dist/cjs/{bal-label.cjs.entry.js → bal-content_2.cjs.entry.js} +48 -2
- package/dist/cjs/bal-date-calendar_2.cjs.entry.js +2 -2
- package/dist/cjs/bal-date.cjs.entry.js +2 -2
- package/dist/cjs/bal-datepicker.cjs.entry.js +4 -4
- package/dist/cjs/bal-doc-app.cjs.entry.js +231 -0
- package/dist/cjs/bal-dropdown.cjs.entry.js +4 -4
- package/dist/cjs/bal-file-upload.cjs.entry.js +1 -1
- package/dist/cjs/bal-footer.cjs.entry.js +1 -1
- package/dist/cjs/bal-hint_3.cjs.entry.js +3 -3
- package/dist/cjs/bal-icon.cjs.entry.js +1 -1
- package/dist/cjs/bal-input-stepper.cjs.entry.js +1 -1
- package/dist/cjs/bal-list_8.cjs.entry.js +12 -4
- package/dist/cjs/bal-logo.cjs.entry.js +3 -3
- package/dist/cjs/bal-nav_8.cjs.entry.js +17 -18
- package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-number-input.cjs.entry.js +1 -1
- package/dist/cjs/bal-option_2.cjs.entry.js +26 -2
- package/dist/cjs/bal-pagination.cjs.entry.js +6 -6
- package/dist/cjs/bal-popover_2.cjs.entry.js +3 -3
- package/dist/cjs/bal-popup.cjs.entry.js +1 -1
- package/dist/cjs/bal-progress-bar.cjs.entry.js +30 -17
- package/dist/cjs/bal-radio_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-segment-item.cjs.entry.js +156 -0
- package/dist/cjs/bal-segment.cjs.entry.js +319 -0
- package/dist/cjs/bal-select_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-shape.cjs.entry.js +1 -1
- package/dist/cjs/bal-stack.cjs.entry.js +1 -1
- package/dist/cjs/bal-steps.cjs.entry.js +10 -9
- package/dist/cjs/bal-tab-item_2.cjs.entry.js +158 -34
- package/dist/cjs/baloise-design-system.cjs.js +3 -2
- package/dist/cjs/{breakpoints.decorator-47fd06b2.js → breakpoints.decorator-86a4414a.js} +1 -1
- package/dist/cjs/{breakpoints.subject-06716a68.js → breakpoints.subject-7294b174.js} +4 -4
- package/dist/cjs/{date-3e33b208.js → date-20be7524.js} +1 -1
- package/dist/cjs/{app-globals-ae3a8623.js → global-2562a984.js} +2 -4
- package/dist/cjs/index.cjs.js +5 -5
- package/dist/cjs/{index.esm-4587dbf0.js → index.esm-54a3d84e.js} +28 -0
- package/dist/cjs/initialize-2a19d091.js +1 -1
- package/dist/cjs/loader.cjs.js +3 -2
- package/dist/cjs/{option-c33cf2b8.js → option-4034ca7d.js} +4 -1
- package/dist/cjs/{tokens.esm-dc93a5d7.js → tokens.esm-cddf70ee.js} +1 -1
- package/dist/cjs/window-resize.decorator-ef87a6fc.js +48 -0
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/bal-accordion/bal-accordion-summary/bal-accordion-summary.css +1 -1
- package/dist/collection/components/bal-accordion/bal-accordion-summary/bal-accordion-summary.js +11 -1
- package/dist/collection/components/bal-accordion/bal-accordion-trigger/bal-accordion-trigger.css +1 -1
- package/dist/collection/components/bal-accordion/bal-accordion-trigger/bal-accordion-trigger.js +14 -1
- package/dist/collection/components/bal-carousel/bal-carousel-item/bal-carousel-item.js +45 -2
- package/dist/collection/components/bal-carousel/bal-carousel.js +76 -13
- package/dist/collection/components/bal-carousel/controls/dot-control.js +2 -2
- package/dist/collection/components/bal-carousel/controls/large-control.js +2 -2
- package/dist/collection/components/bal-carousel/controls/small-control.js +2 -2
- package/dist/collection/components/bal-carousel/controls/tab-control.js +2 -2
- package/dist/collection/components/bal-checkbox/bal-checkbox.js +13 -2
- package/dist/collection/components/bal-close/bal-close.js +1 -6
- package/dist/collection/components/bal-content/bal-content.css +1 -1
- package/dist/collection/components/bal-content/bal-content.js +1 -1
- package/dist/collection/components/bal-icon/bal-icon.css +1 -1
- package/dist/collection/components/bal-label/bal-label.js +20 -2
- package/dist/collection/components/bal-list/bal-list-item-accordion-head/bal-list-item-accordion-head.js +7 -1
- package/dist/collection/components/bal-nav/bal-nav-menu-bar/bal-nav-menu-bar.css +1 -1
- package/dist/collection/components/bal-nav/bal-nav-menu-flyout/bal-nav-menu-flyout.js +24 -6
- package/dist/collection/components/bal-nav/bal-nav.css +1 -1
- package/dist/collection/components/bal-nav/bal-nav.js +5 -2
- package/dist/collection/components/bal-nav/models/bal-nav-menu-link-item.js +2 -2
- package/dist/collection/components/bal-nav/models/bal-nav-meta-link-item.js +3 -3
- package/dist/collection/components/bal-option-list/bal-option-list.js +43 -2
- package/dist/collection/components/bal-pagination/bal-pagination.js +3 -3
- package/dist/collection/components/bal-progress-bar/bal-progress-bar.css +1 -1
- package/dist/collection/components/bal-progress-bar/bal-progress-bar.js +49 -12
- package/dist/collection/components/bal-segment/bal-segment-item/bal-segment-item.css +1 -0
- package/dist/collection/components/bal-segment/bal-segment-item/bal-segment-item.js +332 -0
- package/dist/collection/components/bal-segment/bal-segment.css +1 -0
- package/dist/collection/components/bal-segment/bal-segment.interfaces.js +4 -0
- package/dist/collection/components/bal-segment/bal-segment.js +537 -0
- package/dist/collection/components/bal-segment/bal-segment.types.js +1 -0
- package/dist/collection/components/bal-stack/bal-stack.css +1 -1
- package/dist/collection/components/bal-steps/bal-steps.css +1 -1
- package/dist/collection/components/bal-steps/bal-steps.js +26 -2
- package/dist/collection/components/bal-steps/components/step-button.js +2 -2
- package/dist/collection/components/bal-tabs/bal-tab-item/bal-tab-item.js +47 -2
- package/dist/collection/components/bal-tabs/bal-tabs.js +124 -21
- package/dist/collection/components/bal-tabs/components/tab-button.js +18 -6
- package/dist/collection/components/bal-tabs/components/tab-nav.js +3 -3
- package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +1 -0
- package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +229 -0
- package/dist/collection/utils/constants/version.constant.js +1 -1
- package/dist/collection/utils/date/date.spec.js +0 -1
- package/dist/collection/utils/dropdown/option.js +4 -1
- package/dist/collection/utils/dropdown/popup.js +2 -2
- package/dist/collection/utils/resize/index.js +4 -1
- package/dist/collection/utils/resize/window-resize.decorator.js +20 -0
- package/dist/collection/utils/resize/window-resize.interfaces.js +1 -0
- package/dist/collection/utils/resize/window-resize.listener.js +3 -3
- package/dist/collection/utils/resize/window-resize.subject.js +23 -0
- package/dist/collection/utils/string.js +10 -0
- package/dist/collection/utils/string.spec.js +24 -0
- package/dist/esm/app-globals-970bab17.js +5 -0
- package/dist/esm/bal-accordion_4.entry.js +29 -4
- package/dist/esm/bal-carousel_2.entry.js +61 -25
- package/dist/esm/bal-checkbox_2.entry.js +12 -2
- package/dist/esm/bal-close.entry.js +1 -6
- package/dist/esm/{bal-label.entry.js → bal-content_2.entry.js} +48 -3
- package/dist/esm/bal-date-calendar_2.entry.js +2 -2
- package/dist/esm/bal-date.entry.js +2 -2
- package/dist/esm/bal-datepicker.entry.js +4 -4
- package/dist/esm/bal-doc-app.entry.js +227 -0
- package/dist/esm/bal-dropdown.entry.js +4 -4
- package/dist/esm/bal-file-upload.entry.js +1 -1
- package/dist/esm/bal-footer.entry.js +1 -1
- package/dist/esm/bal-hint_3.entry.js +3 -3
- package/dist/esm/bal-icon.entry.js +1 -1
- package/dist/esm/bal-input-stepper.entry.js +1 -1
- package/dist/esm/bal-list_8.entry.js +12 -4
- package/dist/esm/bal-logo.entry.js +3 -3
- package/dist/esm/bal-nav_8.entry.js +17 -18
- package/dist/esm/bal-navbar_5.entry.js +3 -3
- package/dist/esm/bal-number-input.entry.js +1 -1
- package/dist/esm/bal-option_2.entry.js +26 -2
- package/dist/esm/bal-pagination.entry.js +6 -6
- package/dist/esm/bal-popover_2.entry.js +3 -3
- package/dist/esm/bal-popup.entry.js +1 -1
- package/dist/esm/bal-progress-bar.entry.js +30 -17
- package/dist/esm/bal-radio_2.entry.js +1 -1
- package/dist/esm/bal-segment-item.entry.js +152 -0
- package/dist/esm/bal-segment.entry.js +315 -0
- package/dist/esm/bal-select_2.entry.js +1 -1
- package/dist/esm/bal-shape.entry.js +1 -1
- package/dist/esm/bal-stack.entry.js +1 -1
- package/dist/esm/bal-steps.entry.js +10 -9
- package/dist/esm/bal-tab-item_2.entry.js +159 -35
- package/dist/esm/baloise-design-system.js +3 -2
- package/dist/esm/{breakpoints.decorator-f979fe5c.js → breakpoints.decorator-35deac22.js} +1 -1
- package/dist/esm/{breakpoints.subject-9ea7074e.js → breakpoints.subject-23463a68.js} +4 -4
- package/dist/esm/{date-38a0b208.js → date-aba2d404.js} +1 -1
- package/dist/esm/{app-globals-b0dd0fc4.js → global-63f4bcec.js} +2 -4
- package/dist/esm/{index.esm-83b1f9c4.js → index.esm-76abd8e3.js} +25 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/initialize-e216cfe4.js +1 -1
- package/dist/esm/loader.js +3 -2
- package/dist/esm/{option-37cb0282.js → option-01553dab.js} +4 -1
- package/dist/esm/{tokens.esm-7d2734e1.js → tokens.esm-225678ae.js} +1 -1
- package/dist/esm/window-resize.decorator-fddb8221.js +46 -0
- package/dist/esm-es5/app-globals-970bab17.js +1 -0
- package/dist/esm-es5/bal-accordion_4.entry.js +1 -1
- package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
- package/dist/esm-es5/bal-checkbox_2.entry.js +1 -1
- package/dist/esm-es5/bal-close.entry.js +1 -1
- package/dist/esm-es5/bal-content_2.entry.js +1 -0
- package/dist/esm-es5/bal-date-calendar_2.entry.js +1 -1
- package/dist/esm-es5/bal-date.entry.js +1 -1
- package/dist/esm-es5/bal-datepicker.entry.js +1 -1
- package/dist/esm-es5/bal-doc-app.entry.js +1 -0
- package/dist/esm-es5/bal-dropdown.entry.js +1 -1
- package/dist/esm-es5/bal-file-upload.entry.js +1 -1
- package/dist/esm-es5/bal-footer.entry.js +1 -1
- package/dist/esm-es5/bal-hint_3.entry.js +1 -1
- package/dist/esm-es5/bal-icon.entry.js +1 -1
- package/dist/esm-es5/bal-input-stepper.entry.js +1 -1
- package/dist/esm-es5/bal-list_8.entry.js +1 -1
- package/dist/esm-es5/bal-logo.entry.js +1 -1
- package/dist/esm-es5/bal-nav_8.entry.js +1 -1
- package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
- package/dist/esm-es5/bal-number-input.entry.js +1 -1
- package/dist/esm-es5/bal-option_2.entry.js +1 -1
- package/dist/esm-es5/bal-pagination.entry.js +1 -1
- package/dist/esm-es5/bal-popover_2.entry.js +1 -1
- package/dist/esm-es5/bal-popup.entry.js +1 -1
- package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
- package/dist/esm-es5/bal-radio_2.entry.js +1 -1
- package/dist/esm-es5/bal-segment-item.entry.js +1 -0
- package/dist/esm-es5/bal-segment.entry.js +1 -0
- package/dist/esm-es5/bal-select_2.entry.js +1 -1
- package/dist/esm-es5/bal-shape.entry.js +1 -1
- package/dist/esm-es5/bal-stack.entry.js +1 -1
- package/dist/esm-es5/bal-steps.entry.js +1 -1
- package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
- package/dist/esm-es5/baloise-design-system.js +1 -1
- package/dist/esm-es5/breakpoints.decorator-35deac22.js +1 -0
- package/dist/esm-es5/breakpoints.subject-23463a68.js +1 -0
- package/dist/esm-es5/{date-38a0b208.js → date-aba2d404.js} +1 -1
- package/dist/esm-es5/global-63f4bcec.js +1 -0
- package/dist/esm-es5/{index.esm-83b1f9c4.js → index.esm-76abd8e3.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/initialize-e216cfe4.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/option-01553dab.js +1 -0
- package/dist/esm-es5/window-resize.decorator-fddb8221.js +1 -0
- package/dist/html.html-data.json +161 -3
- package/dist/types/components/bal-accordion/bal-accordion-summary/bal-accordion-summary.d.ts +1 -0
- package/dist/types/components/bal-accordion/bal-accordion-trigger/bal-accordion-trigger.d.ts +1 -0
- package/dist/types/components/bal-carousel/bal-carousel-item/bal-carousel-item.d.ts +6 -0
- package/dist/types/components/bal-carousel/bal-carousel.d.ts +11 -2
- package/dist/types/components/bal-carousel/controls/dot-control.d.ts +1 -0
- package/dist/types/components/bal-carousel/controls/large-control.d.ts +1 -0
- package/dist/types/components/bal-carousel/controls/small-control.d.ts +1 -0
- package/dist/types/components/bal-carousel/controls/tab-control.d.ts +1 -0
- package/dist/types/components/bal-checkbox/bal-checkbox.d.ts +5 -0
- package/dist/types/components/bal-close/bal-close.d.ts +0 -2
- package/dist/types/components/bal-content/bal-content.interfaces.d.ts +1 -1
- package/dist/types/components/bal-icon/bal-icon.interfaces.d.ts +1 -1
- package/dist/types/components/bal-label/bal-label.d.ts +4 -1
- package/dist/types/components/bal-list/bal-list-item-accordion-head/bal-list-item-accordion-head.d.ts +1 -0
- package/dist/types/components/bal-nav/bal-nav-menu-flyout/bal-nav-menu-flyout.d.ts +4 -1
- package/dist/types/components/bal-nav/models/bal-nav-link-item.d.ts +1 -0
- package/dist/types/components/bal-nav/models/bal-nav-menu-link-item.d.ts +1 -0
- package/dist/types/components/bal-nav/models/bal-nav-meta-link-item.d.ts +3 -1
- package/dist/types/components/bal-option-list/bal-option-list.d.ts +5 -0
- package/dist/types/components/bal-progress-bar/bal-progress-bar.d.ts +8 -2
- package/dist/types/components/bal-progress-bar/bal-progress-bar.interfaces.d.ts +1 -0
- package/dist/types/components/bal-segment/bal-segment-item/bal-segment-item.d.ts +62 -0
- package/dist/types/components/bal-segment/bal-segment.d.ts +111 -0
- package/dist/types/components/bal-segment/bal-segment.interfaces.d.ts +20 -0
- package/dist/types/components/bal-segment/bal-segment.types.d.ts +1 -0
- package/dist/types/components/bal-steps/bal-steps.d.ts +4 -0
- package/dist/types/components/bal-steps/bal-steps.interfaces.d.ts +3 -1
- package/dist/types/components/bal-steps/components/step-button.d.ts +1 -0
- package/dist/types/components/bal-tabs/bal-tab-item/bal-tab-item.d.ts +10 -0
- package/dist/types/components/bal-tabs/bal-tab.type.d.ts +5 -3
- package/dist/types/components/bal-tabs/bal-tabs.d.ts +15 -3
- package/dist/types/components/bal-tabs/bal-tabs.interfaces.d.ts +3 -0
- package/dist/types/components/bal-tabs/components/tab-button.d.ts +1 -0
- package/dist/types/components/bal-tabs/components/tab-nav.d.ts +1 -0
- package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +21 -0
- package/dist/types/components.d.ts +272 -10
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/icons/src/index.d.ts +81 -0
- package/dist/types/interfaces.d.ts +1 -0
- package/dist/types/utils/dropdown/option.d.ts +1 -1
- package/dist/types/utils/dropdown/popup.d.ts +1 -1
- package/dist/types/utils/resize/index.d.ts +4 -1
- package/dist/types/utils/resize/window-resize.decorator.d.ts +3 -0
- package/dist/types/utils/resize/window-resize.interfaces.d.ts +5 -0
- package/dist/types/utils/resize/window-resize.listener.d.ts +1 -1
- package/dist/types/utils/resize/window-resize.subject.d.ts +9 -0
- package/dist/types/utils/string.d.ts +1 -0
- package/package.json +9 -9
- package/dist/baloise-design-system/p-0ab7aa0e.js +0 -1
- package/dist/baloise-design-system/p-126c79c9e9.system.entry.js +0 -1
- package/dist/baloise-design-system/p-1502fa2526.entry.js +0 -1
- package/dist/baloise-design-system/p-1e100fd83b.entry.js +0 -1
- package/dist/baloise-design-system/p-254b130be5.system.entry.js +0 -1
- package/dist/baloise-design-system/p-2d82b78410.entry.js +0 -1
- package/dist/baloise-design-system/p-2d8bd11634.entry.js +0 -1
- package/dist/baloise-design-system/p-2e2ed7a07f.entry.js +0 -1
- package/dist/baloise-design-system/p-2ebc8f9d0c.system.entry.js +0 -1
- package/dist/baloise-design-system/p-30fc270ec1.entry.js +0 -1
- package/dist/baloise-design-system/p-35aa7ecb24.entry.js +0 -1
- package/dist/baloise-design-system/p-4f3776ea4e.system.entry.js +0 -1
- package/dist/baloise-design-system/p-55f280cf33.system.entry.js +0 -1
- package/dist/baloise-design-system/p-63dfa27862.system.entry.js +0 -1
- package/dist/baloise-design-system/p-6cf5e22bb4.entry.js +0 -1
- package/dist/baloise-design-system/p-7047afd8.system.js +0 -1
- package/dist/baloise-design-system/p-7d498fc5.js +0 -1
- package/dist/baloise-design-system/p-87d9c24d45.system.entry.js +0 -1
- package/dist/baloise-design-system/p-8a87b9a8.system.js +0 -1
- package/dist/baloise-design-system/p-96c55b4f58.entry.js +0 -1
- package/dist/baloise-design-system/p-b22fa7966b.entry.js +0 -1
- package/dist/baloise-design-system/p-bcca1ed3.system.js +0 -1
- package/dist/baloise-design-system/p-c304d5fa9c.entry.js +0 -1
- package/dist/baloise-design-system/p-cee7a0dd73.system.entry.js +0 -1
- package/dist/baloise-design-system/p-cf47f1f53c.entry.js +0 -1
- package/dist/baloise-design-system/p-d585a3ad56.system.entry.js +0 -1
- package/dist/baloise-design-system/p-dbc2d22240.system.entry.js +0 -1
- package/dist/baloise-design-system/p-e71a27141c.entry.js +0 -1
- package/dist/baloise-design-system/p-e78a6409.js +0 -1
- package/dist/baloise-design-system/p-e7a4d97c51.entry.js +0 -1
- package/dist/baloise-design-system/p-e93d9571f5.system.entry.js +0 -1
- package/dist/baloise-design-system/p-ecd39e3bec.entry.js +0 -1
- package/dist/baloise-design-system/p-f076d1ed4f.system.entry.js +0 -1
- package/dist/baloise-design-system/p-f0ee1b670b.system.entry.js +0 -1
- package/dist/cjs/bal-content.cjs.entry.js +0 -56
- package/dist/esm-es5/app-globals-b0dd0fc4.js +0 -1
- package/dist/esm-es5/bal-content.entry.js +0 -1
- package/dist/esm-es5/bal-label.entry.js +0 -1
- package/dist/esm-es5/breakpoints.decorator-f979fe5c.js +0 -1
- package/dist/esm-es5/breakpoints.subject-9ea7074e.js +0 -1
- package/dist/esm-es5/option-37cb0282.js +0 -1
- /package/dist/baloise-design-system/{p-fc80aa3e.system.js → p-7b021f06.system.js} +0 -0
- /package/dist/baloise-design-system/{p-6b5343bd.js → p-f8552716.js} +0 -0
- /package/dist/esm-es5/{tokens.esm-7d2734e1.js → tokens.esm-225678ae.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter,__extends,__generator,__spreadArray}from"tslib";import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-b6003bc7.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-654e2c24.js";import{z as lodash_padstart,d as dateSeparator}from"./index.esm-83b1f9c4.js";import{l as lodash_isnil}from"./index-82aff103.js";import{B as BalDate,i as i18nBalDate}from"./date-38a0b208.js";import{L as Logger}from"./log-dfd1c19f.js";import{b as waitAfterFramePaint,n as hasParent}from"./helpers-c201154e.js";import{B as BEM}from"./bem-8c7d2eb0.js";import{d as defaultConfig}from"./config.default-7efdc82d.js";import{L as ListenToConfig}from"./config.decorator-d18abfe1.js";import{L as ListenToSwipe}from"./swipe.decorator-9d904794.js";import{i as inheritAttributes}from"./attributes-4fa7040f.js";import{c as inputSetFocus,d as inputSetBlur}from"./form-input-28a08ec5.js";import{d as defaultBalAriaForm}from"./form-fb8dd9f5.js";import{N as NUMBER_KEYS}from"./keys.constant-0eb059e0.js";import{I as INVALID_VALUE}from"./mask-util-71edc2b8.js";import"./_commonjsHelpers-1c8beb5f.js";import"./config.utils-6ac6c9bd.js";import"./browser-a8073d92.js";import"./icons.constant-a7885631.js";import"./swipe.subject-f1d64e8d.js";import"./device-8c6d2881.js";import"./listener-04842ae9.js";function getDaysInMonth(t,e){if(e<1||t<0){return undefined}return new Date(t,e,0).getDate()}function isoDateOfDay(t,e,a){return"".concat(a,"-").concat(lodash_padstart("".concat(e),2,"0"),"-").concat(lodash_padstart("".concat(t),2,"0"))}function isoDateOfToday(){var t=new Date;return"".concat(t.getFullYear(),"-").concat(lodash_padstart("".concat(t.getMonth()+1),2,"0"),"-").concat(lodash_padstart("".concat(t.getDate()),2,"0"))}function generateCalendarGrid(t,e,a,i,n){var r=[];var s=getDaysInMonth(t,e);var l=getFirstDayOfMonth(t,e);if(s!==undefined&&l){var o=isoDateOfToday();var u=BalDate.fromISO(a);var d=BalDate.fromISO(i);var c=function(t){if(lodash_isnil(n)){return false}return!n(t)};for(var h=1;h<=s;h++){var f=isoDateOfDay(h,e,t);r.push({day:h,month:e,year:t,isoDate:f,fullDate:BalDate.fromISO(f).toFormat(),today:o===f,disabled:u.isAfter(f)||d.isBefore(f)||c(f)})}}return r}function getFirstWeekdayOfMonth(t,e){if(e<1||t<0){return 1}var a=new Date(t,e-1,1);var i=a.getDay();return i===0?7:i}function validateLanguage(t){if(["en","de","fr","it","nl","es","pl","pt","sv","fi"].includes(t)){return t}return"de"}function generateYears(t,e,a){var i=[];var n=new Date;var r=n.getFullYear();for(var s=e;s<=a;s++){i.push({value:s,label:"".concat(s),disabled:false,today:r===s,selected:t===s})}return i}function generateMonths(t,e,a,i,n){var r=validateLanguage(t);var s=BalDate.infoMonths({format:"long",locale:r});var l=BalDate.fromISO(a);var o=new Date;var u=o.getFullYear();var d=o.getMonth()+1;var c=0;if(i&&e!==undefined){var h=BalDate.fromISO(i);if(h.isValid){if(e>h.year){c=0}else{c=h.month||c}}}var f=12;if(n&&e!==undefined){var b=BalDate.fromISO(n);if(b.isValid){if(e<b.year){f=12}else{f=b.month||f}}}return s.map((function(t,a){var i=a+1;return{label:t,value:i,today:i===d&&e===u,selected:i===l.month&&e===l.year,disabled:i<c||i>f}}))}function generateWeekDays(t){var e=validateLanguage(t);var a=BalDate.infoWeekdays({format:"short",locale:e});var i=BalDate.infoWeekdays({format:"long",locale:e});return a.map((function(t,e){return{ariaLabel:i[e],textContent:t}}))}function getFirstDayOfMonth(t,e){if(e<1||e>12||t<0){return undefined}return new Date(t,e-1,1)}var CalendarList=function(t){var e=t.name,a=t.isVisible,i=t.girdHeight,n=t.list,r=t.onSelect,s=t.ref;var l=BEM.block("date-calendar");var o=l.element("body");var u=o.element("list");return h("ul",{class:Object.assign(Object.assign(Object.assign({},u.class()),u.modifier(e).class()),u.modifier("visible").class(a)),"aria-hidden":a?"false":"true",style:{height:"".concat(i-2-8-8,"px")},ref:function(t){return s?s(t):undefined}},n.map((function(t){return h("li",{key:t.value,id:"".concat(e,"-").concat(t.value)},h("button",{class:Object.assign(Object.assign(Object.assign(Object.assign({},u.element("item").class()),u.element("item").modifier("today").class(t.today)),u.element("item").modifier("selected").class(t.selected)),u.element("item").modifier("disabled").class(t.disabled)),disabled:t.disabled,tabIndex:-1,onClick:function(){if(!t.disabled){r(t)}}},t.label))})))};var CalendarGrid=function(t){var e=t.isVisible,a=t.ref,i=t.grid,n=t.weekdays,r=t.selectedDate,s=t.firstDayOfWeek,l=t.onSelectDay;var o=BEM.block("date-calendar");var u=o.element("body");var d=u.element("grid");return h("div",{role:"grid",class:Object.assign(Object.assign({},d.class()),d.modifier("visible").class(e)),"aria-hidden":e?"false":"true",ref:function(t){return a(t)}},h("div",{role:"row",class:Object.assign({},d.element("head").class())},n.map((function(t){return h("span",{key:t.textContent,role:"columnheader","aria-label":t.ariaLabel,title:t.ariaLabel},t.textContent)}))),h("div",{role:"row",class:Object.assign({},d.element("body").class()),style:{"--bal-date-first-week-day":"".concat(s)}},i.map((function(t){return h("bal-date-calendar-cell",Object.assign({key:t.isoDate},t,{selected:t.isoDate===r,onBalSelectDay:function(t){var e=t.detail;return l(e)}}))}))))};var CalendarNav=function(t){var e=t.language,a=t.onClickSelectMonthAndYear,i=t.monthFullNames,n=t.month,r=t.year,s=t.isCalendarVisible,l=t.isListVisible,o=t.onClickPreviousMonth,u=t.onClickNextMonth;var d=BEM.block("date-calendar");var c=d.element("nav");var f=i18nBalDate[e].nextMonth;var b=i18nBalDate[e].previousMonth;var _=i18nBalDate[e].selectMonth;return h("div",{class:Object.assign({},c.class())},h("div",{class:Object.assign({},c.modifier("start").class())},h("button",{title:_,"aria-label":_,tabIndex:-1,"data-test":"change-year-month",onClick:a},h("span",null,i[n-1]," ",r),h("bal-icon",{name:"caret-up",color:"primary",size:"small",turn:s}))),h("div",{class:Object.assign({},c.modifier("end").class()),style:{display:l?"none":"flex"}},h("button",{title:b,"aria-label":b,onClick:o,tabIndex:-1,"data-test":"previous-month"},h("bal-icon",{name:"caret-left",color:"primary",size:"small"})),h("button",{title:f,"aria-label":f,onClick:u,tabIndex:-1,"data-test":"next-month"},h("bal-icon",{name:"caret-right",color:"primary",size:"small"}))))};var balDateCalendarCss=':host{--bal-date-first-week-day:0;--bal-date-calendar-background:var(--bal-color-red-3)}:host{--bal-date-first-week-day:0;--bal-date-calendar-background:var(--bal-color-red-3)}:host{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;background:var(--bal-color-white);border-radius:var(--bal-radius-normal)}.bal-date-calendar__nav{display:-ms-flexbox;display:flex;width:calc(100% - 1rem);-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;padding:.5rem;gap:.5rem}.bal-date-calendar__nav--start>button{display:-ms-flexbox;display:flex;gap:.5rem}.bal-date-calendar__nav--end{display:-ms-flexbox;display:flex;gap:.5rem}.bal-date-calendar__nav button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-color-text-primary);border:none;background:rgba(0,0,0,0);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;min-height:2rem;min-width:2rem;padding:.25rem;border-radius:var(--bal-button-radius);font-family:var(--bal-font-family-title);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__nav button:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):hover{background:var(--bal-color-light-blue-1)}}.bal-date-calendar__nav button:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):active{background:var(--bal-color-light-blue-2)}.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled){color:var(--bal-color-light-blue-3);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):hover{color:var(--bal-color-text-primary)}}.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):active{color:var(--bal-color-text-primary)}.bal-date-calendar__nav button--selected{background:var(--bal-color-primary);color:var(--bal-color-text-white);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar__nav button--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}.bal-date-calendar__body{display:block}.bal-date-calendar__body__grid{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding:.5rem;height:0;padding-top:0;padding-bottom:0;visibility:hidden}.bal-date-calendar__body__grid--visible{height:auto;padding-top:.5rem;padding-bottom:.5rem;visibility:visible}.bal-date-calendar__body__grid__head{position:relative;display:grid;grid-template-columns:repeat(7, 1fr);-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.bal-date-calendar__body__grid__head::after{position:absolute;content:"";height:2px;width:calc(100% + 1rem);bottom:0;left:-0.5rem;right:-0.5rem;background:var(--bal-color-border)}.bal-date-calendar__body__grid__head span{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:2rem;width:2rem;font-family:var(--bal-font-family-title);font-weight:var(--bal-font-weight-bold);font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;text-wrap:nowrap}.bal-date-calendar__body__grid__body{display:grid;grid-template-columns:repeat(7, 1fr);-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding-top:.5rem}.bal-date-calendar__body__grid__body>.bal-date-calendar-cell{width:2rem;height:2rem;text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}.bal-date-calendar__body__grid__body>.bal-date-calendar-cell:first-child{grid-column:var(--bal-date-first-week-day)}.bal-date-calendar__body__list{display:none;list-style:none;margin:0;padding:0;-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:calc(100% - 1rem);overflow-y:auto;max-height:18rem;position:relative;padding:.5rem;border-top:2px solid var(--bal-color-border)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-color-text-primary);border:none;background:rgba(0,0,0,0);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;width:100%}@media (hover: hover)and (pointer: fine){.bal-date-calendar__body__list .bal-date-calendar__body__list__item:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):hover{background:var(--bal-color-light-blue-1)}}.bal-date-calendar__body__list .bal-date-calendar__body__list__item:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):active{background:var(--bal-color-light-blue-2)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled){color:var(--bal-color-light-blue-3);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):hover{color:var(--bal-color-text-primary)}}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):active{color:var(--bal-color-text-primary)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected{background:var(--bal-color-primary);color:var(--bal-color-text-white);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}.bal-date-calendar__body__list--visible{display:grid}.bal-date-calendar__body__list--year{grid-template-columns:repeat(4, 1fr)}.bal-date-calendar__body__list--month{grid-template-columns:repeat(2, 1fr)}.bal-date-calendar-cell{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-color-text-primary);border:none;background:rgba(0,0,0,0);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;width:2rem;height:2rem}@media (hover: hover)and (pointer: fine){.bal-date-calendar-cell:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):hover{background:var(--bal-color-light-blue-1)}}.bal-date-calendar-cell:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):active{background:var(--bal-color-light-blue-2)}.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled){color:var(--bal-color-light-blue-3);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):hover{color:var(--bal-color-text-primary)}}.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):active{color:var(--bal-color-text-primary)}.bal-date-calendar-cell--selected{background:var(--bal-color-primary);color:var(--bal-color-text-white);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar-cell--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}';var BalDateCalendarStyle0=balDateCalendarCss;var DateCalendar=function(){function t(t){var e=this;registerInstance(this,t);this.balChange=createEvent(this,"balChange",7);this.oldMin="";this.oldMax="";this.onSelectDay=function(t){e.valueChanged(t,e.selectedDate);e.balChange.emit(e.selectedDate)};this.onClickNextMonth=function(){var t=e.year;var a=e.month+1;if(a>12){a=1;t=t+1}e.generateGridByMonthAndYear(a,t)};this.onClickPreviousMonth=function(){var t=e.year;var a=e.month-1;if(a<1){a=12;t=t-1}e.generateGridByMonthAndYear(a,t)};this.onClickSelectMonthAndYear=function(){return __awaiter(e,void 0,void 0,(function(){var t,e;return __generator(this,(function(a){switch(a.label){case 0:this.updateSelections();if(!(this.isCalendarVisible===true))return[3,2];this.isCalendarVisible=false;this.isYearListVisible=true;this.isMonthListVisible=false;return[4,waitAfterFramePaint()];case 1:a.sent();if(this.yearListEl){t=this.yearListEl.querySelector("#year-".concat(this.year));if(t){e=26+8+4;this.yearListEl.scrollTop=t.offsetTop-e*2}else{this.yearListEl.scrollTop=0}}return[3,3];case 2:this.isCalendarVisible=true;this.isYearListVisible=false;this.isMonthListVisible=false;a.label=3;case 3:return[2]}}))}))};this.onClickYear=function(t){e.isYearListVisible=false;e.isMonthListVisible=true;e.generateGridByMonthAndYear(e.month,t);e.months=generateMonths(e.language,t,e.selectedDate,e.min,e.max)};this.onClickMonth=function(t){e.isYearListVisible=false;e.isMonthListVisible=false;e.isCalendarVisible=true;e.generateGridByMonthAndYear(t,e.year)};this.selectedDate="";this.monthFullNames=[];this.weekdays=[];this.months=[];this.years=[];this.calendarGrid=[];this.firstDayOfWeek=0;this.month=0;this.year=0;this.language=defaultConfig.language;this.isCalendarVisible=true;this.isYearListVisible=false;this.isMonthListVisible=false;this.value=undefined;this.defaultDate=undefined;this.allowedDates=undefined;this.min=undefined;this.max=undefined;this.minYearProp=undefined;this.maxYearProp=undefined}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(t,e){if(t!==e){var a=BalDate.fromISO(t);if(!a.isValid){this.generateGridByDefaultDate();this.selectedDate=""}else{this.generateGridByDate(a);this.selectedDate=a.toISODate()}this.updateSelections()}};t.prototype.rangePropChanged=function(){this.updateSelections();this.generateGrid()};t.prototype.yearRangePropChanged=function(){this.updateSelections()};t.prototype.connectedCallback=function(){this.generateGridByDefaultDate();this.valueChanged(this.value,undefined)};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;this.monthFullNames=BalDate.infoMonths({format:"long",locale:this.language});this.weekdays=generateWeekDays(this.language);this.updateSelections();return[2]}))}))};t.prototype.swipeListener=function(t){var e=t.left,a=t.right;if(e){this.onClickNextMonth()}else if(a){this.onClickPreviousMonth()}};Object.defineProperty(t.prototype,"minYear",{get:function(){if(this.minYearProp===undefined){var t=new Date;var e=t.getFullYear();var a=e-100;if(this.min){var i=BalDate.fromISO(this.min);return i.year||a}else{return a}}return this.minYearProp},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxYear",{get:function(){if(this.maxYearProp===undefined){var t=new Date;var e=t.getFullYear();var a=e+50;if(this.max){var i=BalDate.fromISO(this.max);return i.year||a}else{return a}}return this.maxYearProp},enumerable:false,configurable:true});t.prototype.updateSelections=function(){this.years=generateYears(this.year,this.minYear,this.maxYear);this.months=generateMonths(this.language,this.year,this.selectedDate,this.min,this.max)};t.prototype.generateGrid=function(){var t=BalDate.fromISO(this.value);if(t.isValid){this.generateGridByDate(t)}else{this.generateGridByDefaultDate()}};t.prototype.generateGridByDate=function(t){if(t.year!==undefined&&t.month!==undefined){this.generateGridByMonthAndYear(t.month,t.year)}};t.prototype.generateGridByDefaultDate=function(){var t=BalDate.fromISO(this.defaultDate);if(t.isValid){this.generateGridByDate(t)}else{var e=new Date;this.month=e.getMonth()+1;this.year=e.getFullYear();this.calendarGrid=generateCalendarGrid(this.year,this.month,this.min,this.max,this.allowedDates);this.firstDayOfWeek=getFirstWeekdayOfMonth(this.year,this.month)}};t.prototype.generateGridByMonthAndYear=function(t,e){if(this.month!==t||this.year!==e||this.oldMin!==this.min||this.oldMax!==this.max){this.calendarGrid=generateCalendarGrid(e,t,this.min,this.max,this.allowedDates);this.firstDayOfWeek=getFirstWeekdayOfMonth(e,t)}this.month=t;this.year=e;this.oldMin=this.min;this.oldMax=this.max};t.prototype.render=function(){var t=this;var e;var a=((e=this.gridEl)===null||e===void 0?void 0:e.clientHeight)||0;var i=BEM.block("date-calendar");var n=i.element("body");var r=i.element("foot");return h(Host,{class:Object.assign({},i.class())},h(CalendarNav,{language:this.language,monthFullNames:this.monthFullNames,month:this.month,year:this.year,isCalendarVisible:this.isCalendarVisible,isListVisible:this.isMonthListVisible||this.isYearListVisible,onClickSelectMonthAndYear:this.onClickSelectMonthAndYear,onClickPreviousMonth:this.onClickPreviousMonth,onClickNextMonth:this.onClickNextMonth}),h("div",{class:Object.assign({},n.class())},h(CalendarGrid,{isVisible:this.isCalendarVisible,grid:this.calendarGrid,weekdays:this.weekdays,firstDayOfWeek:this.firstDayOfWeek,selectedDate:this.selectedDate,ref:function(e){return t.gridEl=e},onSelectDay:function(e){return t.onSelectDay(e)}}),h(CalendarList,{name:"year",isVisible:this.isYearListVisible,girdHeight:a,list:this.years,ref:function(e){return t.yearListEl=e},onSelect:function(e){return t.onClickYear(e.value)}}),h(CalendarList,{name:"month",isVisible:this.isMonthListVisible,girdHeight:a,list:this.months,onSelect:function(e){return t.onClickMonth(e.value)}})),h("div",{class:Object.assign({},r.class())},h("slot",null)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],min:["rangePropChanged"],max:["rangePropChanged"],minYearProp:["yearRangePropChanged"],maxYearProp:["yearRangePropChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-date-calendar"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],DateCalendar.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],DateCalendar.prototype,"configChanged",null);__decorate([ListenToSwipe({mobileOnly:true}),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],DateCalendar.prototype,"swipeListener",null);DateCalendar.style=BalDateCalendarStyle0;var MaskPosition=function(){function t(t){this._options=t;this._position=0;this._positionEnd=0;this._isRangeSelection=false;if(t.component&&t.component.nativeInput){this._position=t.component.nativeInput.selectionStart||0;this._positionEnd=t.component.nativeInput.selectionEnd||0;this._isRangeSelection=this._position!==this._positionEnd}}Object.defineProperty(t.prototype,"isRangeSelection",{get:function(){return this._isRangeSelection},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){if(this._options.isBackspace&&this._position>0){return this._position-1}return this._position},set:function(t){var e=t<0?0:t>this._options.mask.maxLength?this._options.mask.maxLength:t;this._position=e},enumerable:false,configurable:true});t.prototype.toStart=function(){this.value=0};t.prototype.toEnd=function(){var t=this.getTarget();if(t){this.value=t.value.length}};t.prototype.next=function(t){if(t===void 0){t=1}var e=this._position+t;if(e<=this._options.mask.maxLength){this._position=e}return this._position};t.prototype.previous=function(t){if(t===void 0){t=1}var e=this._position-t;if(e>=0){this._position=e}else{this._position=0}return this._position};t.prototype.submit=function(){var t=this.getTarget();if(t&&t.selectionStart!==this._position&&t.selectionEnd!==this._position){t.selectionStart=this._position;t.selectionEnd=this._position}};t.prototype.getTarget=function(){if(this._options.component&&this._options.component.nativeInput){return this._options.component.nativeInput}return undefined};return t}();var MaskContext=function(){function t(t){this._options=t;this._value="";if(this._options.component&&this._options.component.nativeInput){this._value=this._options.component.nativeInput.value}this.position=new MaskPosition(this._options);this.component=this._options.component}Object.defineProperty(t.prototype,"target",{get:function(){if(this._options.component&&this._options.component.nativeInput){return this._options.component.nativeInput}return undefined},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"focused",{get:function(){return this._options.component.focused},enumerable:false,configurable:true});t.prototype.isValueEmpty=function(){return this.value===""||this.value===undefined||this.value===null};t.prototype.preventDefault=function(){if(this._options.event.preventDefault){this._options.event.preventDefault()}};t.prototype.stopPropagation=function(){this.preventDefault();if(this._options.event.stopPropagation){this._options.event.stopPropagation()}};t.prototype.submit=function(t,e){if(t===void 0){t="input"}return __awaiter(this,void 0,void 0,(function(){var a;return __generator(this,(function(i){if(this.target){this.target.value=this.value;if(t!=="blur"&&t!=="tab"){this.position.submit()}if(this._options.component){if(t==="input"||t==="tab"){this._options.component.balInput.emit(this.value)}if((t==="change"||t==="blur")&&e!==undefined){a=this._options.component.value!==e;if(a){this._options.component.value=e;this._options.component.balChange.emit(e)}}}}return[2]}))}))};return t}();var MaskClipboardContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"clipboardData",{get:function(){var t;return(t=this._options.event.clipboardData)===null||t===void 0?void 0:t.getData("text")},enumerable:false,configurable:true});return e}(MaskContext);var MaskFocusContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(MaskContext);var MaskKeyboardContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"key",{get:function(){return this._options.event.key},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isCtrlOrCommandKey",{get:function(){return this._options.event.metaKey||this._options.event.ctrlKey},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isBackspaceKey",{get:function(){return this._options.event.key==="Backspace"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isTabKey",{get:function(){return this._options.event.key==="Tab"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isWhiteSpaceKey",{get:function(){return this._options.event.key===" "},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isDeleteKey",{get:function(){return this._options.event.key==="Delete"||this._options.event.key==="Del"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isNumberKey",{get:function(){return e.NUMBER_KEYS.includes(this._options.event.key)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isNavigationKey",{get:function(){return e.NAVIGATION_KEYS.includes(this._options.event.key)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isSelectAllCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="a"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isCopyCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="c"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isPasteCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="v"},enumerable:false,configurable:true});e.prototype.getCharAt=function(t){if(t===void 0){t=this.position.value}return this.value.charAt(t)};e.prototype.getCharAtBackspacePosition=function(){return this.getCharAt(this.position.value-1)};e.prototype.setChar=function(t,e){if(t===void 0){t=this._options.event.key}if(e===void 0){e=this.position.value}this.value=this.value.substring(0,e)+t+this.value.substring(e+1)};return e}(MaskContext);MaskKeyboardContext.NUMBER_KEYS=["0","1","2","3","4","5","6","7","8","9"];MaskKeyboardContext.NAVIGATION_KEYS=["Home","End","ArrowLeft","Left","ArrowRight","Right","Tab","Enter","Esc","Escape"];var MaskLocaleContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"locale",{get:function(){return this._options.event.locale},enumerable:false,configurable:true});return e}(MaskContext);var MaskMouseContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(MaskContext);var MaskValueChangedContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"newValue",{get:function(){return this._options.event.newValue},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"oldValue",{get:function(){return this._options.event.oldValue},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"didValueChange",{get:function(){return this.newValue!==this.oldValue},enumerable:false,configurable:true});return e}(MaskContext);var MaskBlock=function(){function t(t){this._isSeparator=false;this._allowedKeys=[];this._locale="de-CH";this._from=t.from||0;this._to=t.to||0;this._isSeparator=t.isSeparator===undefined?false:t.isSeparator;this._mask=t.mask||"_";this._allowedKeys=t.allowedKeys?t.allowedKeys:this.allowedKeys;this._format=t.format}t.prototype.format=function(t){if(this._format){return this._format(t.replace(this.mask,""),this._locale,this.mask)}return t};Object.defineProperty(t.prototype,"isSeparator",{get:function(){return this._isSeparator},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"to",{get:function(){return this._to},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"from",{get:function(){return this._from},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"mask",{get:function(){if(typeof this._mask==="function"){return this._mask(this._locale)}return this._mask},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"allowedKeys",{get:function(){return this._allowedKeys},enumerable:false,configurable:true});t.prototype.onI18nChange=function(t){this._locale=t};t.prototype.getValueOfTheBlock=function(t){return t.slice(this._from,this._to)};t.prototype.isTouched=function(t){var e=this;var a=this.getValueOfTheBlock(t);return!a.split("").every((function(t){return t===e.mask}))};t.prototype.verifyAllowedKeyHits=function(t){if(this.isSeparator&&t===this.mask){return true}else if(this.allowedKeys.indexOf(t)>=0){return true}else{return false}};return t}();var MaskBlockList=function(){function t(t){if(t===void 0){t=[]}this._list=t}Object.defineProperty(t.prototype,"lastPosition",{get:function(){return this._list[this._list.length-1].to},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"list",{get:function(){return this._list},set:function(t){this._list=t},enumerable:false,configurable:true});t.prototype.clone=function(){return new t(__spreadArray([],this._list,true))};t.prototype.findByIndex=function(t,e){if(e===void 0){e=this.list}return e.find((function(e){return e.from<=t&&t<e.to}))};t.prototype.getPlaceholderMask=function(){var t=[];this.list.forEach((function(e){var a=e.to-e.from;for(var i=0;i<a;i++){t.push(e.mask)}}));return t.join("")};t.prototype.getRawValueWithoutMaskByContext=function(t){return this.getRawValueWithoutMask(t.value)};t.prototype.getRawValueWithoutMask=function(t){if(t){var e=[];var a=t.split("");for(var i=0;i<a.length;i++){var n=a[i];var r=this.findByIndex(i);if(r&&!r.isSeparator){e.push(n.replace(r.mask,""))}else{e.push(n)}}e=e.filter((function(t){return t}));var s=this.list.filter((function(t){return t.isSeparator})).length;if(s===e.length){return""}return e.join("")}return""};t.prototype.formatBlocks=function(t,e){var a="".concat(t);for(var i=0;i<this.list.length;i++){var n=this.list[i];if(e!==i&&!n.isSeparator&&n.isTouched(a)){var r=n.getValueOfTheBlock(a);var s=n.format(r);a=a.substring(0,n.from)+s+a.substring(n.to)}}return a};t.prototype.getBlockIndexFromPosition=function(t){var e=this.list.reduce((function(t,e){return t+e.to-e.from}),0);if(t===e){return this.list.length-1}var a=this.list.findIndex((function(e){return e.from<=t&&t<e.to}));return a<0?undefined:Math.min(e,a)};t.prototype.verifyCallOfNextSeparator=function(t,e){if(this.list.length-1>e){var a=this.list[e+1];if(a.isSeparator&&a.mask===t){return true}}return false};return t}();var AbstractMask=function(){function t(t){if(t===void 0){t=[]}this.inputMode="text";this.locale="de-CH";this.blocks=new MaskBlockList(t)}t.prototype.onLocaleChange=function(t,e,a){if(t.target){var i=t.value;var n=i.split("");for(var r=0;r<n.length;r++){var s=n[r];var l=this.blocks.findByIndex(r);var o=a.findByIndex(r);if(l&&o){if(l.isSeparator){n[r]=l.mask}else if(s===o.mask){n[r]=l.mask}}}t.value=n.join("")}};t.prototype.onFocus=function(t){};t.prototype.onBlur=function(t){};t.prototype.onChange=function(t){t.submit("change",this.onParseValue(t.value))};t.prototype.onNavigationDown=function(t,e,a){};t.prototype.onSelectAll=function(t,e,a){};t.prototype.onPaste=function(t,e,a){var i=t.clipboardData||"";t.value=i;t.position.toEnd()};t.prototype.onBlockChange=function(t,e,a){t.setChar();t.position.next();var i=this.blocks.list[a+1];if(t.position.value===e.to&&i&&i.isSeparator){t.position.next()}};t.prototype.onBackspaceDown=function(t,e,a){t.position.previous();if(!e.isSeparator){t.setChar(e.mask);var i=this.blocks.list[a-1];if(t.position.value===e.from&&i&&i.isSeparator){t.position.previous()}}};t.prototype.onDeleteDown=function(t,e,a){t.setChar(e.mask);t.position.next();var i=this.blocks.list[a+1];if(t.position.value===e.to&&i&&i.isSeparator){t.position.next()}};t.prototype.onValueChanged=function(t){var e=this.onFormatValue(t.newValue);var a=t.focused&&e===""?this.blocks.getPlaceholderMask():e;t.value=a;t.position.toEnd()};t.prototype.onParseValue=function(t,e){if(e===void 0){e={allowInvalidValue:false}}if(t){return t.trim()}return t||""};t.prototype.onFormatValue=function(t){if(t){return t.trim()}return t||""};t.prototype.toParsedValue=function(t){return this.onParseValue(t)};t.prototype.toFormattedValue=function(t){return this.onFormatValue(t)};t.prototype.fireI18nChange=function(t){var e=this.blocks.clone();var a="".concat(t.locale);this.locale=t.locale;this.blocks.list.forEach((function(e){return e.onI18nChange(t.locale)}));this.onLocaleChange(t,a,e)};t.prototype.fireValueChanged=function(t){if(t.didValueChange){this.onValueChanged(t)}};t.prototype.firePaste=function(t){var e=this.blocks.getBlockIndexFromPosition(t.position.value);if(e!==undefined){var a=this.blocks.list[e];this.onPaste(t,a,e);this.onChange(t)}};t.prototype.fireClick=function(t){var e=this.blocks.getPlaceholderMask();if(e===t.value){t.position.toStart()}};t.prototype.fireFocus=function(t){if(t.target&&t.isValueEmpty()){this.resetInputValueWithMask(t)}this.onFocus(t)};t.prototype.fireBlur=function(t){if(t.target){if(this.isValueEmptyMask(t)){this.emptyInputValue(t)}else{this.onBlur(t);t.submit("blur",this.onParseValue(t.value,{allowInvalidValue:t.component.allowInvalidValue}))}}};t.prototype.fireKeyDown=function(t){var e=t.isBackspaceKey?Math.max(0,t.position.value-1):t.position.value;var a=this.blocks.getBlockIndexFromPosition(e);if(e>=this.blocks.lastPosition&&!t.isNavigationKey&&!t.isSelectAllCommand){t.preventDefault();t.stopPropagation();return}if(a!==undefined&&!t.position.isRangeSelection){var i=this.blocks.list[a];if(t.isNavigationKey){this.onNavigationDown(t,i,a)}else if(t.isSelectAllCommand){this.onSelectAll(t,i,a)}else if(t.isCopyCommand);else if(t.isPasteCommand);else if(t.isBackspaceKey){t.preventDefault();this.onBackspaceDown(t,i,a)}else if(t.isDeleteKey){t.preventDefault();this.onDeleteDown(t,i,a)}else if(t.isWhiteSpaceKey){t.preventDefault();var n=t.value[t.position.value];if(n==="."){t.stopPropagation();var r=t.value;t.value=r.substring(0,t.position.value)+"_"+r.substring(t.position.value+1)}}else if(i.verifyAllowedKeyHits(t.key)){t.preventDefault();this.onBlockChange(t,i,a)}else if(this.blocks.verifyCallOfNextSeparator(t.key,a)){t.preventDefault();var s=this.blocks.list[a];if(t.position.value>s.from){var l=this.blocks.list[a+1];var r=t.value;var o=i.getValueOfTheBlock(r);var u=i.format(o);t.value=r.substring(0,i.from)+u+r.substring(i.to);t.position.value=l.to}}var d=this.blocks.getBlockIndexFromPosition(t.position.value);if(d&&!t.isBackspaceKey){var c=this.blocks.formatBlocks(t.value,d);var h=t.position.value;t.value=c;t.position.value=h}}else{if(!t.isTabKey){t.preventDefault()}if(t.isBackspaceKey||t.isDeleteKey){this.resetInputValueWithMask(t)}else if(this.blocks.list[0].verifyAllowedKeyHits(t.key)){this.onBlockChange(t,this.blocks.list[0],0)}}};t.prototype.resetInputValueWithMask=function(t){t.value=this.blocks.getPlaceholderMask();t.position.toStart()};t.prototype.isValueEmptyMask=function(t){var e=this.blocks.getPlaceholderMask();return e===t.value};t.prototype.emptyInputValue=function(t){t.value="";t.submit("blur",t.value)};return t}();var DateMask=function(t){__extends(e,t);function e(){var e=t.call(this,[new MaskBlock({from:0,to:2,allowedKeys:__spreadArray([],NUMBER_KEYS,true),format:function(t,e,a){if(Number.isNaN(parseInt(t,10))){return"".concat(a).concat(a)}return t.padStart(2,"0")},mask:function(t){return e.dayMask[t.split("-")[0]]||e.dayMask["de"]}}),new MaskBlock({from:2,to:3,mask:function(t){return dateSeparator(t)},isSeparator:true}),new MaskBlock({from:3,to:5,allowedKeys:__spreadArray([],NUMBER_KEYS,true),format:function(t,e,a){if(Number.isNaN(parseInt(t,10))){return"".concat(a).concat(a)}return t.padStart(2,"0")},mask:function(t){return e.monthMask[t.split("-")[0]]||e.monthMask["de"]}}),new MaskBlock({from:5,to:6,mask:function(t){return dateSeparator(t)},isSeparator:true}),new MaskBlock({from:6,to:10,allowedKeys:__spreadArray([],NUMBER_KEYS,true),mask:function(t){return e.yearMask[t.split("-")[0]]||e.yearMask["de"]}})])||this;e.maxLength=10;e.minLength=10;e.inputMode="decimal";e.dayMask={de:"T",en:"D",fr:"J",it:"G",nl:"D",es:"D",pl:"D",pt:"D",sv:"D",fi:"M"};e.monthMask={de:"M",en:"M",fr:"M",it:"M",nl:"M",es:"M",pl:"M",pt:"M",sv:"M",fi:"K"};e.yearMask={de:"J",en:"Y",fr:"A",it:"A",nl:"J",es:"A",pl:"R",pt:"A",sv:"Å",fi:"V"};return e}e.prototype.onParseValue=function(t,e){if(e===void 0){e={allowInvalidValue:false}}if(t){var a=BalDate.fromAnyFormat(this.blocks.getRawValueWithoutMask(t));if(a.isValid){return a.toISODate()}else if(e&&e.allowInvalidValue){return INVALID_VALUE}}return""};e.prototype.onFormatValue=function(t){if(t){var e=BalDate.fromISO(t);if(e.isValid){return e.toFormat()}}return""};e.prototype.onPaste=function(t,e,a){var i=t.clipboardData||"";var n=BalDate.fromAnyFormat(i);if(n.isValid){t.value=n.toFormat();t.position.toEnd()}};e.prototype.onBlur=function(t){var e=this.blocks.getRawValueWithoutMaskByContext(t);var a=BalDate.fromAnyFormat(e);if(a.isValid){var i=a.toFormat();if(i!==t.value){t.value=i}}else if(t.component.allowInvalidValue){if(e!==t.value){t.value=e}}};return e}(AbstractMask);var MaskComponentAdapter=function(){function t(t){this.mask=t}Object.defineProperty(t.prototype,"attributes",{get:function(){return{inputMode:this.mask.inputMode,maxLength:this.mask.maxLength,minLength:this.mask.minLength,type:"text",autoCapitalize:"off",autoCorrect:"off",spellcheck:false}},enumerable:false,configurable:true});t.prototype.bindComponent=function(t){this.component=t};t.prototype.bindComponentDidLoad=function(){if(this.component&&this.component.nativeInput){this.component.nativeInput.value=this.component.value||""}this.bindValueChanged(this.component.value,undefined)};t.prototype.bindConfigChanged=function(t){var e=this,a=e.component,i=e.mask;var n=new MaskLocaleContext({component:a,mask:i,event:{locale:"".concat(t.language,"-").concat(t.region)}});this.mask.fireI18nChange(n);n.submit()};t.prototype.bindValueChanged=function(t,e){var a=this,i=a.component,n=a.mask;var r=new MaskValueChangedContext({component:i,mask:n,event:{newValue:t,oldValue:e}});this.mask.fireValueChanged(r);r.submit("blur")};t.prototype.bindKeyDown=function(t){if(this.isComponentAccessible){var e=this,a=e.component,i=e.mask;var n=new MaskKeyboardContext({event:t,component:a,mask:i});this.mask.fireKeyDown(n);var r=t.key==="Tab";n.submit(r?"tab":"input");a.balKeyPress.emit(t)}};t.prototype.bindFocus=function(t){if(this.isComponentAccessible){var e=this,a=e.component,i=e.mask;a.focused=true;var n=new MaskFocusContext({event:t,component:a,mask:i});this.mask.fireFocus(n);n.submit();a.balFocus.emit(t)}};t.prototype.bindBlur=function(t){if(this.isComponentAccessible){var e=this,a=e.component,i=e.mask;a.focused=false;var n=new MaskFocusContext({event:t,component:a,mask:i});this.mask.fireBlur(n);n.submit("blur");a.balBlur.emit(t)}};t.prototype.bindPaste=function(t){if(this.isComponentAccessible){var e=this,a=e.component,i=e.mask;var n=new MaskClipboardContext({event:t,component:a,mask:i});this.mask.firePaste(n);n.submit()}};t.prototype.bindFormReset=function(t){var e=this;var a=t.target;if(a&&(a===this.component.el||a.contains(this.component.el))){this.component.value=this.component.initialValue;this.component.inputValue=this.component.initialValue;clearTimeout(this.resetHandlerTimer);this.resetHandlerTimer=setTimeout((function(){if(e.component.nativeInput){e.component.nativeInput.value=e.mask.toFormattedValue(e.component.value||"")}}))}};t.prototype.bindClick=function(t){if(this.isComponentAccessible){var e=this,a=e.component,i=e.mask;var n=new MaskMouseContext({event:t,component:a,mask:i});this.mask.fireClick(n);n.submit()}};t.prototype.bindHostClick=function(t){if(!this.isComponentAccessible){t.preventDefault();t.stopPropagation()}};t.prototype.bindGlobalClick=function(t){if(!this.isComponentAccessible){if(t.target&&t.target===this.component.el){t.preventDefault();t.stopPropagation()}}};Object.defineProperty(t.prototype,"isComponentAccessible",{get:function(){return!this.component.disabled&&!this.component.readonly},enumerable:false,configurable:true});return t}();var balInputDateCss=".bal-input-date{display:block;width:100%;-ms-flex:1;flex:1}.bal-input-date input:not(:-moz-placeholder-shown){letter-spacing:.4px}.bal-input-date input:not(:-ms-input-placeholder){letter-spacing:.4px}.bal-input-date input:not(:placeholder-shown){letter-spacing:.4px}.bal-input-date__native{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}";var BalInputDateStyle0=balInputDateCss;var InputDate=function(){function t(t){registerInstance(this,t);this.balKeyPress=createEvent(this,"balKeyPress",7);this.balChange=createEvent(this,"balChange",7);this.balInput=createEvent(this,"balInput",7);this.balBlur=createEvent(this,"balBlur",7);this.balFocus=createEvent(this,"balFocus",7);this.inputId="bal-i-date-".concat(inputDateIds++);this.inheritedAttributes={};this.maskAdapter=new MaskComponentAdapter(new DateMask);this.inputValue=this.value;this.initialValue=this.value||"";this.focused=false;this.isGrouped=false;this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.placeholder=undefined;this.clickable=false;this.min=undefined;this.max=undefined;this.autocomplete="off";this.hasIconRight=false;this.value=undefined;this.autoInvalidOff=false;this.allowInvalidValue=false}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(t,e){this.maskAdapter.bindValueChanged(t,e)};t.prototype.connectedCallback=function(){this.maskAdapter.bindComponent(this);this.isGrouped=hasParent("bal-input-group",this.el)};t.prototype.componentDidLoad=function(){this.maskAdapter.bindComponentDidLoad()};t.prototype.componentWillRender=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title"])};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.maskAdapter.bindConfigChanged(t);return[2]}))}))};t.prototype.resetHandler=function(t){this.maskAdapter.bindFormReset(t)};t.prototype.listenOnClick=function(t){this.maskAdapter.bindGlobalClick(t)};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){inputSetFocus(this);return[2]}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){inputSetBlur(this);return[2]}))}))};t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.ariaForm=Object.assign({},t);return[2]}))}))};t.prototype.render=function(){var t=this;var e=BEM.block("input-date");var a=e.element("native");return h(Host,{onClick:function(e){return t.maskAdapter.bindHostClick(e)},class:Object.assign({},e.class())},h("input",Object.assign({class:{input:true,"is-disabled":this.disabled||this.readonly,"is-danger":this.invalid,"is-clickable":this.clickable&&!(this.disabled||this.readonly),"bal-focusable":!this.disabled,"has-icon-right":this.hasIconRight},"data-testid":"bal-date-input",ref:function(e){return t.nativeInput=e},id:this.ariaForm.controlId||this.inputId,"aria-labelledby":this.ariaForm.labelId,"aria-describedby":this.ariaForm.messageId,"aria-invalid":this.invalid===true?"true":"false","aria-disabled":this.disabled?"true":null,required:this.required,disabled:this.disabled,readonly:this.readonly,autoComplete:this.autocomplete},this.maskAdapter.attributes,this.inheritedAttributes,{placeholder:this.placeholder,value:this.inputValue,onKeyDown:function(e){return t.maskAdapter.bindKeyDown(e)},onClick:function(e){return t.maskAdapter.bindClick(e)},onFocus:function(e){return t.maskAdapter.bindFocus(e)},onBlur:function(e){return t.maskAdapter.bindBlur(e)},onPaste:function(e){return t.maskAdapter.bindPaste(e)}})),h("input",{type:"date",class:Object.assign({},a.class()),name:this.name,min:this.min,max:this.max,value:this.value,tabindex:-1,"aria-hidden":"true"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-input-date"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],InputDate.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],InputDate.prototype,"configChanged",null);var inputDateIds=0;InputDate.style=BalInputDateStyle0;export{DateCalendar as bal_date_calendar,InputDate as bal_input_date};
|
|
1
|
+
import{__awaiter,__extends,__generator,__spreadArray}from"tslib";import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-b6003bc7.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-654e2c24.js";import{D as lodash_padstart,d as dateSeparator}from"./index.esm-76abd8e3.js";import{l as lodash_isnil}from"./index-82aff103.js";import{B as BalDate,i as i18nBalDate}from"./date-aba2d404.js";import{L as Logger}from"./log-dfd1c19f.js";import{b as waitAfterFramePaint,n as hasParent}from"./helpers-c201154e.js";import{B as BEM}from"./bem-8c7d2eb0.js";import{d as defaultConfig}from"./config.default-7efdc82d.js";import{L as ListenToConfig}from"./config.decorator-d18abfe1.js";import{L as ListenToSwipe}from"./swipe.decorator-9d904794.js";import{i as inheritAttributes}from"./attributes-4fa7040f.js";import{c as inputSetFocus,d as inputSetBlur}from"./form-input-28a08ec5.js";import{d as defaultBalAriaForm}from"./form-fb8dd9f5.js";import{N as NUMBER_KEYS}from"./keys.constant-0eb059e0.js";import{I as INVALID_VALUE}from"./mask-util-71edc2b8.js";import"./_commonjsHelpers-1c8beb5f.js";import"./config.utils-6ac6c9bd.js";import"./browser-a8073d92.js";import"./icons.constant-a7885631.js";import"./swipe.subject-f1d64e8d.js";import"./device-8c6d2881.js";import"./listener-04842ae9.js";function getDaysInMonth(t,e){if(e<1||t<0){return undefined}return new Date(t,e,0).getDate()}function isoDateOfDay(t,e,a){return"".concat(a,"-").concat(lodash_padstart("".concat(e),2,"0"),"-").concat(lodash_padstart("".concat(t),2,"0"))}function isoDateOfToday(){var t=new Date;return"".concat(t.getFullYear(),"-").concat(lodash_padstart("".concat(t.getMonth()+1),2,"0"),"-").concat(lodash_padstart("".concat(t.getDate()),2,"0"))}function generateCalendarGrid(t,e,a,i,n){var r=[];var s=getDaysInMonth(t,e);var l=getFirstDayOfMonth(t,e);if(s!==undefined&&l){var o=isoDateOfToday();var u=BalDate.fromISO(a);var d=BalDate.fromISO(i);var c=function(t){if(lodash_isnil(n)){return false}return!n(t)};for(var h=1;h<=s;h++){var f=isoDateOfDay(h,e,t);r.push({day:h,month:e,year:t,isoDate:f,fullDate:BalDate.fromISO(f).toFormat(),today:o===f,disabled:u.isAfter(f)||d.isBefore(f)||c(f)})}}return r}function getFirstWeekdayOfMonth(t,e){if(e<1||t<0){return 1}var a=new Date(t,e-1,1);var i=a.getDay();return i===0?7:i}function validateLanguage(t){if(["en","de","fr","it","nl","es","pl","pt","sv","fi"].includes(t)){return t}return"de"}function generateYears(t,e,a){var i=[];var n=new Date;var r=n.getFullYear();for(var s=e;s<=a;s++){i.push({value:s,label:"".concat(s),disabled:false,today:r===s,selected:t===s})}return i}function generateMonths(t,e,a,i,n){var r=validateLanguage(t);var s=BalDate.infoMonths({format:"long",locale:r});var l=BalDate.fromISO(a);var o=new Date;var u=o.getFullYear();var d=o.getMonth()+1;var c=0;if(i&&e!==undefined){var h=BalDate.fromISO(i);if(h.isValid){if(e>h.year){c=0}else{c=h.month||c}}}var f=12;if(n&&e!==undefined){var b=BalDate.fromISO(n);if(b.isValid){if(e<b.year){f=12}else{f=b.month||f}}}return s.map((function(t,a){var i=a+1;return{label:t,value:i,today:i===d&&e===u,selected:i===l.month&&e===l.year,disabled:i<c||i>f}}))}function generateWeekDays(t){var e=validateLanguage(t);var a=BalDate.infoWeekdays({format:"short",locale:e});var i=BalDate.infoWeekdays({format:"long",locale:e});return a.map((function(t,e){return{ariaLabel:i[e],textContent:t}}))}function getFirstDayOfMonth(t,e){if(e<1||e>12||t<0){return undefined}return new Date(t,e-1,1)}var CalendarList=function(t){var e=t.name,a=t.isVisible,i=t.girdHeight,n=t.list,r=t.onSelect,s=t.ref;var l=BEM.block("date-calendar");var o=l.element("body");var u=o.element("list");return h("ul",{class:Object.assign(Object.assign(Object.assign({},u.class()),u.modifier(e).class()),u.modifier("visible").class(a)),"aria-hidden":a?"false":"true",style:{height:"".concat(i-2-8-8,"px")},ref:function(t){return s?s(t):undefined}},n.map((function(t){return h("li",{key:t.value,id:"".concat(e,"-").concat(t.value)},h("button",{class:Object.assign(Object.assign(Object.assign(Object.assign({},u.element("item").class()),u.element("item").modifier("today").class(t.today)),u.element("item").modifier("selected").class(t.selected)),u.element("item").modifier("disabled").class(t.disabled)),disabled:t.disabled,tabIndex:-1,onClick:function(){if(!t.disabled){r(t)}}},t.label))})))};var CalendarGrid=function(t){var e=t.isVisible,a=t.ref,i=t.grid,n=t.weekdays,r=t.selectedDate,s=t.firstDayOfWeek,l=t.onSelectDay;var o=BEM.block("date-calendar");var u=o.element("body");var d=u.element("grid");return h("div",{role:"grid",class:Object.assign(Object.assign({},d.class()),d.modifier("visible").class(e)),"aria-hidden":e?"false":"true",ref:function(t){return a(t)}},h("div",{role:"row",class:Object.assign({},d.element("head").class())},n.map((function(t){return h("span",{key:t.textContent,role:"columnheader","aria-label":t.ariaLabel,title:t.ariaLabel},t.textContent)}))),h("div",{role:"row",class:Object.assign({},d.element("body").class()),style:{"--bal-date-first-week-day":"".concat(s)}},i.map((function(t){return h("bal-date-calendar-cell",Object.assign({key:t.isoDate},t,{selected:t.isoDate===r,onBalSelectDay:function(t){var e=t.detail;return l(e)}}))}))))};var CalendarNav=function(t){var e=t.language,a=t.onClickSelectMonthAndYear,i=t.monthFullNames,n=t.month,r=t.year,s=t.isCalendarVisible,l=t.isListVisible,o=t.onClickPreviousMonth,u=t.onClickNextMonth;var d=BEM.block("date-calendar");var c=d.element("nav");var f=i18nBalDate[e].nextMonth;var b=i18nBalDate[e].previousMonth;var _=i18nBalDate[e].selectMonth;return h("div",{class:Object.assign({},c.class())},h("div",{class:Object.assign({},c.modifier("start").class())},h("button",{title:_,"aria-label":_,tabIndex:-1,"data-test":"change-year-month",onClick:a},h("span",null,i[n-1]," ",r),h("bal-icon",{name:"caret-up",color:"primary",size:"small",turn:s}))),h("div",{class:Object.assign({},c.modifier("end").class()),style:{display:l?"none":"flex"}},h("button",{title:b,"aria-label":b,onClick:o,tabIndex:-1,"data-test":"previous-month"},h("bal-icon",{name:"caret-left",color:"primary",size:"small"})),h("button",{title:f,"aria-label":f,onClick:u,tabIndex:-1,"data-test":"next-month"},h("bal-icon",{name:"caret-right",color:"primary",size:"small"}))))};var balDateCalendarCss=':host{--bal-date-first-week-day:0;--bal-date-calendar-background:var(--bal-color-red-3)}:host{--bal-date-first-week-day:0;--bal-date-calendar-background:var(--bal-color-red-3)}:host{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;background:var(--bal-color-white);border-radius:var(--bal-radius-normal)}.bal-date-calendar__nav{display:-ms-flexbox;display:flex;width:calc(100% - 1rem);-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;padding:.5rem;gap:.5rem}.bal-date-calendar__nav--start>button{display:-ms-flexbox;display:flex;gap:.5rem}.bal-date-calendar__nav--end{display:-ms-flexbox;display:flex;gap:.5rem}.bal-date-calendar__nav button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-color-text-primary);border:none;background:rgba(0,0,0,0);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;min-height:2rem;min-width:2rem;padding:.25rem;border-radius:var(--bal-button-radius);font-family:var(--bal-font-family-title);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__nav button:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):hover{background:var(--bal-color-light-blue-1)}}.bal-date-calendar__nav button:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):active{background:var(--bal-color-light-blue-2)}.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled){color:var(--bal-color-light-blue-3);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):hover{color:var(--bal-color-text-primary)}}.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):active{color:var(--bal-color-text-primary)}.bal-date-calendar__nav button--selected{background:var(--bal-color-primary);color:var(--bal-color-text-white);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar__nav button--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}.bal-date-calendar__body{display:block}.bal-date-calendar__body__grid{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding:.5rem;height:0;padding-top:0;padding-bottom:0;visibility:hidden}.bal-date-calendar__body__grid--visible{height:auto;padding-top:.5rem;padding-bottom:.5rem;visibility:visible}.bal-date-calendar__body__grid__head{position:relative;display:grid;grid-template-columns:repeat(7, 1fr);-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.bal-date-calendar__body__grid__head::after{position:absolute;content:"";height:2px;width:calc(100% + 1rem);bottom:0;left:-0.5rem;right:-0.5rem;background:var(--bal-color-border)}.bal-date-calendar__body__grid__head span{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:2rem;width:2rem;font-family:var(--bal-font-family-title);font-weight:var(--bal-font-weight-bold);font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;text-wrap:nowrap}.bal-date-calendar__body__grid__body{display:grid;grid-template-columns:repeat(7, 1fr);-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding-top:.5rem}.bal-date-calendar__body__grid__body>.bal-date-calendar-cell{width:2rem;height:2rem;text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}.bal-date-calendar__body__grid__body>.bal-date-calendar-cell:first-child{grid-column:var(--bal-date-first-week-day)}.bal-date-calendar__body__list{display:none;list-style:none;margin:0;padding:0;-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:calc(100% - 1rem);overflow-y:auto;max-height:18rem;position:relative;padding:.5rem;border-top:2px solid var(--bal-color-border)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-color-text-primary);border:none;background:rgba(0,0,0,0);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;width:100%}@media (hover: hover)and (pointer: fine){.bal-date-calendar__body__list .bal-date-calendar__body__list__item:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):hover{background:var(--bal-color-light-blue-1)}}.bal-date-calendar__body__list .bal-date-calendar__body__list__item:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):active{background:var(--bal-color-light-blue-2)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled){color:var(--bal-color-light-blue-3);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):hover{color:var(--bal-color-text-primary)}}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):active{color:var(--bal-color-text-primary)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected{background:var(--bal-color-primary);color:var(--bal-color-text-white);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}.bal-date-calendar__body__list--visible{display:grid}.bal-date-calendar__body__list--year{grid-template-columns:repeat(4, 1fr)}.bal-date-calendar__body__list--month{grid-template-columns:repeat(2, 1fr)}.bal-date-calendar-cell{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-color-text-primary);border:none;background:rgba(0,0,0,0);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;width:2rem;height:2rem}@media (hover: hover)and (pointer: fine){.bal-date-calendar-cell:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):hover{background:var(--bal-color-light-blue-1)}}.bal-date-calendar-cell:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):active{background:var(--bal-color-light-blue-2)}.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled){color:var(--bal-color-light-blue-3);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):hover{color:var(--bal-color-text-primary)}}.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):active{color:var(--bal-color-text-primary)}.bal-date-calendar-cell--selected{background:var(--bal-color-primary);color:var(--bal-color-text-white);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar-cell--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}';var BalDateCalendarStyle0=balDateCalendarCss;var DateCalendar=function(){function t(t){var e=this;registerInstance(this,t);this.balChange=createEvent(this,"balChange",7);this.oldMin="";this.oldMax="";this.onSelectDay=function(t){e.valueChanged(t,e.selectedDate);e.balChange.emit(e.selectedDate)};this.onClickNextMonth=function(){var t=e.year;var a=e.month+1;if(a>12){a=1;t=t+1}e.generateGridByMonthAndYear(a,t)};this.onClickPreviousMonth=function(){var t=e.year;var a=e.month-1;if(a<1){a=12;t=t-1}e.generateGridByMonthAndYear(a,t)};this.onClickSelectMonthAndYear=function(){return __awaiter(e,void 0,void 0,(function(){var t,e;return __generator(this,(function(a){switch(a.label){case 0:this.updateSelections();if(!(this.isCalendarVisible===true))return[3,2];this.isCalendarVisible=false;this.isYearListVisible=true;this.isMonthListVisible=false;return[4,waitAfterFramePaint()];case 1:a.sent();if(this.yearListEl){t=this.yearListEl.querySelector("#year-".concat(this.year));if(t){e=26+8+4;this.yearListEl.scrollTop=t.offsetTop-e*2}else{this.yearListEl.scrollTop=0}}return[3,3];case 2:this.isCalendarVisible=true;this.isYearListVisible=false;this.isMonthListVisible=false;a.label=3;case 3:return[2]}}))}))};this.onClickYear=function(t){e.isYearListVisible=false;e.isMonthListVisible=true;e.generateGridByMonthAndYear(e.month,t);e.months=generateMonths(e.language,t,e.selectedDate,e.min,e.max)};this.onClickMonth=function(t){e.isYearListVisible=false;e.isMonthListVisible=false;e.isCalendarVisible=true;e.generateGridByMonthAndYear(t,e.year)};this.selectedDate="";this.monthFullNames=[];this.weekdays=[];this.months=[];this.years=[];this.calendarGrid=[];this.firstDayOfWeek=0;this.month=0;this.year=0;this.language=defaultConfig.language;this.isCalendarVisible=true;this.isYearListVisible=false;this.isMonthListVisible=false;this.value=undefined;this.defaultDate=undefined;this.allowedDates=undefined;this.min=undefined;this.max=undefined;this.minYearProp=undefined;this.maxYearProp=undefined}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(t,e){if(t!==e){var a=BalDate.fromISO(t);if(!a.isValid){this.generateGridByDefaultDate();this.selectedDate=""}else{this.generateGridByDate(a);this.selectedDate=a.toISODate()}this.updateSelections()}};t.prototype.rangePropChanged=function(){this.updateSelections();this.generateGrid()};t.prototype.yearRangePropChanged=function(){this.updateSelections()};t.prototype.connectedCallback=function(){this.generateGridByDefaultDate();this.valueChanged(this.value,undefined)};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;this.monthFullNames=BalDate.infoMonths({format:"long",locale:this.language});this.weekdays=generateWeekDays(this.language);this.updateSelections();return[2]}))}))};t.prototype.swipeListener=function(t){var e=t.left,a=t.right;if(e){this.onClickNextMonth()}else if(a){this.onClickPreviousMonth()}};Object.defineProperty(t.prototype,"minYear",{get:function(){if(this.minYearProp===undefined){var t=new Date;var e=t.getFullYear();var a=e-100;if(this.min){var i=BalDate.fromISO(this.min);return i.year||a}else{return a}}return this.minYearProp},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxYear",{get:function(){if(this.maxYearProp===undefined){var t=new Date;var e=t.getFullYear();var a=e+50;if(this.max){var i=BalDate.fromISO(this.max);return i.year||a}else{return a}}return this.maxYearProp},enumerable:false,configurable:true});t.prototype.updateSelections=function(){this.years=generateYears(this.year,this.minYear,this.maxYear);this.months=generateMonths(this.language,this.year,this.selectedDate,this.min,this.max)};t.prototype.generateGrid=function(){var t=BalDate.fromISO(this.value);if(t.isValid){this.generateGridByDate(t)}else{this.generateGridByDefaultDate()}};t.prototype.generateGridByDate=function(t){if(t.year!==undefined&&t.month!==undefined){this.generateGridByMonthAndYear(t.month,t.year)}};t.prototype.generateGridByDefaultDate=function(){var t=BalDate.fromISO(this.defaultDate);if(t.isValid){this.generateGridByDate(t)}else{var e=new Date;this.month=e.getMonth()+1;this.year=e.getFullYear();this.calendarGrid=generateCalendarGrid(this.year,this.month,this.min,this.max,this.allowedDates);this.firstDayOfWeek=getFirstWeekdayOfMonth(this.year,this.month)}};t.prototype.generateGridByMonthAndYear=function(t,e){if(this.month!==t||this.year!==e||this.oldMin!==this.min||this.oldMax!==this.max){this.calendarGrid=generateCalendarGrid(e,t,this.min,this.max,this.allowedDates);this.firstDayOfWeek=getFirstWeekdayOfMonth(e,t)}this.month=t;this.year=e;this.oldMin=this.min;this.oldMax=this.max};t.prototype.render=function(){var t=this;var e;var a=((e=this.gridEl)===null||e===void 0?void 0:e.clientHeight)||0;var i=BEM.block("date-calendar");var n=i.element("body");var r=i.element("foot");return h(Host,{class:Object.assign({},i.class())},h(CalendarNav,{language:this.language,monthFullNames:this.monthFullNames,month:this.month,year:this.year,isCalendarVisible:this.isCalendarVisible,isListVisible:this.isMonthListVisible||this.isYearListVisible,onClickSelectMonthAndYear:this.onClickSelectMonthAndYear,onClickPreviousMonth:this.onClickPreviousMonth,onClickNextMonth:this.onClickNextMonth}),h("div",{class:Object.assign({},n.class())},h(CalendarGrid,{isVisible:this.isCalendarVisible,grid:this.calendarGrid,weekdays:this.weekdays,firstDayOfWeek:this.firstDayOfWeek,selectedDate:this.selectedDate,ref:function(e){return t.gridEl=e},onSelectDay:function(e){return t.onSelectDay(e)}}),h(CalendarList,{name:"year",isVisible:this.isYearListVisible,girdHeight:a,list:this.years,ref:function(e){return t.yearListEl=e},onSelect:function(e){return t.onClickYear(e.value)}}),h(CalendarList,{name:"month",isVisible:this.isMonthListVisible,girdHeight:a,list:this.months,onSelect:function(e){return t.onClickMonth(e.value)}})),h("div",{class:Object.assign({},r.class())},h("slot",null)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],min:["rangePropChanged"],max:["rangePropChanged"],minYearProp:["yearRangePropChanged"],maxYearProp:["yearRangePropChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-date-calendar"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],DateCalendar.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],DateCalendar.prototype,"configChanged",null);__decorate([ListenToSwipe({mobileOnly:true}),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],DateCalendar.prototype,"swipeListener",null);DateCalendar.style=BalDateCalendarStyle0;var MaskPosition=function(){function t(t){this._options=t;this._position=0;this._positionEnd=0;this._isRangeSelection=false;if(t.component&&t.component.nativeInput){this._position=t.component.nativeInput.selectionStart||0;this._positionEnd=t.component.nativeInput.selectionEnd||0;this._isRangeSelection=this._position!==this._positionEnd}}Object.defineProperty(t.prototype,"isRangeSelection",{get:function(){return this._isRangeSelection},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){if(this._options.isBackspace&&this._position>0){return this._position-1}return this._position},set:function(t){var e=t<0?0:t>this._options.mask.maxLength?this._options.mask.maxLength:t;this._position=e},enumerable:false,configurable:true});t.prototype.toStart=function(){this.value=0};t.prototype.toEnd=function(){var t=this.getTarget();if(t){this.value=t.value.length}};t.prototype.next=function(t){if(t===void 0){t=1}var e=this._position+t;if(e<=this._options.mask.maxLength){this._position=e}return this._position};t.prototype.previous=function(t){if(t===void 0){t=1}var e=this._position-t;if(e>=0){this._position=e}else{this._position=0}return this._position};t.prototype.submit=function(){var t=this.getTarget();if(t&&t.selectionStart!==this._position&&t.selectionEnd!==this._position){t.selectionStart=this._position;t.selectionEnd=this._position}};t.prototype.getTarget=function(){if(this._options.component&&this._options.component.nativeInput){return this._options.component.nativeInput}return undefined};return t}();var MaskContext=function(){function t(t){this._options=t;this._value="";if(this._options.component&&this._options.component.nativeInput){this._value=this._options.component.nativeInput.value}this.position=new MaskPosition(this._options);this.component=this._options.component}Object.defineProperty(t.prototype,"target",{get:function(){if(this._options.component&&this._options.component.nativeInput){return this._options.component.nativeInput}return undefined},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"focused",{get:function(){return this._options.component.focused},enumerable:false,configurable:true});t.prototype.isValueEmpty=function(){return this.value===""||this.value===undefined||this.value===null};t.prototype.preventDefault=function(){if(this._options.event.preventDefault){this._options.event.preventDefault()}};t.prototype.stopPropagation=function(){this.preventDefault();if(this._options.event.stopPropagation){this._options.event.stopPropagation()}};t.prototype.submit=function(t,e){if(t===void 0){t="input"}return __awaiter(this,void 0,void 0,(function(){var a;return __generator(this,(function(i){if(this.target){this.target.value=this.value;if(t!=="blur"&&t!=="tab"){this.position.submit()}if(this._options.component){if(t==="input"||t==="tab"){this._options.component.balInput.emit(this.value)}if((t==="change"||t==="blur")&&e!==undefined){a=this._options.component.value!==e;if(a){this._options.component.value=e;this._options.component.balChange.emit(e)}}}}return[2]}))}))};return t}();var MaskClipboardContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"clipboardData",{get:function(){var t;return(t=this._options.event.clipboardData)===null||t===void 0?void 0:t.getData("text")},enumerable:false,configurable:true});return e}(MaskContext);var MaskFocusContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(MaskContext);var MaskKeyboardContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"key",{get:function(){return this._options.event.key},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isCtrlOrCommandKey",{get:function(){return this._options.event.metaKey||this._options.event.ctrlKey},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isBackspaceKey",{get:function(){return this._options.event.key==="Backspace"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isTabKey",{get:function(){return this._options.event.key==="Tab"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isWhiteSpaceKey",{get:function(){return this._options.event.key===" "},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isDeleteKey",{get:function(){return this._options.event.key==="Delete"||this._options.event.key==="Del"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isNumberKey",{get:function(){return e.NUMBER_KEYS.includes(this._options.event.key)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isNavigationKey",{get:function(){return e.NAVIGATION_KEYS.includes(this._options.event.key)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isSelectAllCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="a"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isCopyCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="c"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isPasteCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="v"},enumerable:false,configurable:true});e.prototype.getCharAt=function(t){if(t===void 0){t=this.position.value}return this.value.charAt(t)};e.prototype.getCharAtBackspacePosition=function(){return this.getCharAt(this.position.value-1)};e.prototype.setChar=function(t,e){if(t===void 0){t=this._options.event.key}if(e===void 0){e=this.position.value}this.value=this.value.substring(0,e)+t+this.value.substring(e+1)};return e}(MaskContext);MaskKeyboardContext.NUMBER_KEYS=["0","1","2","3","4","5","6","7","8","9"];MaskKeyboardContext.NAVIGATION_KEYS=["Home","End","ArrowLeft","Left","ArrowRight","Right","Tab","Enter","Esc","Escape"];var MaskLocaleContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"locale",{get:function(){return this._options.event.locale},enumerable:false,configurable:true});return e}(MaskContext);var MaskMouseContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(MaskContext);var MaskValueChangedContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"newValue",{get:function(){return this._options.event.newValue},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"oldValue",{get:function(){return this._options.event.oldValue},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"didValueChange",{get:function(){return this.newValue!==this.oldValue},enumerable:false,configurable:true});return e}(MaskContext);var MaskBlock=function(){function t(t){this._isSeparator=false;this._allowedKeys=[];this._locale="de-CH";this._from=t.from||0;this._to=t.to||0;this._isSeparator=t.isSeparator===undefined?false:t.isSeparator;this._mask=t.mask||"_";this._allowedKeys=t.allowedKeys?t.allowedKeys:this.allowedKeys;this._format=t.format}t.prototype.format=function(t){if(this._format){return this._format(t.replace(this.mask,""),this._locale,this.mask)}return t};Object.defineProperty(t.prototype,"isSeparator",{get:function(){return this._isSeparator},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"to",{get:function(){return this._to},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"from",{get:function(){return this._from},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"mask",{get:function(){if(typeof this._mask==="function"){return this._mask(this._locale)}return this._mask},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"allowedKeys",{get:function(){return this._allowedKeys},enumerable:false,configurable:true});t.prototype.onI18nChange=function(t){this._locale=t};t.prototype.getValueOfTheBlock=function(t){return t.slice(this._from,this._to)};t.prototype.isTouched=function(t){var e=this;var a=this.getValueOfTheBlock(t);return!a.split("").every((function(t){return t===e.mask}))};t.prototype.verifyAllowedKeyHits=function(t){if(this.isSeparator&&t===this.mask){return true}else if(this.allowedKeys.indexOf(t)>=0){return true}else{return false}};return t}();var MaskBlockList=function(){function t(t){if(t===void 0){t=[]}this._list=t}Object.defineProperty(t.prototype,"lastPosition",{get:function(){return this._list[this._list.length-1].to},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"list",{get:function(){return this._list},set:function(t){this._list=t},enumerable:false,configurable:true});t.prototype.clone=function(){return new t(__spreadArray([],this._list,true))};t.prototype.findByIndex=function(t,e){if(e===void 0){e=this.list}return e.find((function(e){return e.from<=t&&t<e.to}))};t.prototype.getPlaceholderMask=function(){var t=[];this.list.forEach((function(e){var a=e.to-e.from;for(var i=0;i<a;i++){t.push(e.mask)}}));return t.join("")};t.prototype.getRawValueWithoutMaskByContext=function(t){return this.getRawValueWithoutMask(t.value)};t.prototype.getRawValueWithoutMask=function(t){if(t){var e=[];var a=t.split("");for(var i=0;i<a.length;i++){var n=a[i];var r=this.findByIndex(i);if(r&&!r.isSeparator){e.push(n.replace(r.mask,""))}else{e.push(n)}}e=e.filter((function(t){return t}));var s=this.list.filter((function(t){return t.isSeparator})).length;if(s===e.length){return""}return e.join("")}return""};t.prototype.formatBlocks=function(t,e){var a="".concat(t);for(var i=0;i<this.list.length;i++){var n=this.list[i];if(e!==i&&!n.isSeparator&&n.isTouched(a)){var r=n.getValueOfTheBlock(a);var s=n.format(r);a=a.substring(0,n.from)+s+a.substring(n.to)}}return a};t.prototype.getBlockIndexFromPosition=function(t){var e=this.list.reduce((function(t,e){return t+e.to-e.from}),0);if(t===e){return this.list.length-1}var a=this.list.findIndex((function(e){return e.from<=t&&t<e.to}));return a<0?undefined:Math.min(e,a)};t.prototype.verifyCallOfNextSeparator=function(t,e){if(this.list.length-1>e){var a=this.list[e+1];if(a.isSeparator&&a.mask===t){return true}}return false};return t}();var AbstractMask=function(){function t(t){if(t===void 0){t=[]}this.inputMode="text";this.locale="de-CH";this.blocks=new MaskBlockList(t)}t.prototype.onLocaleChange=function(t,e,a){if(t.target){var i=t.value;var n=i.split("");for(var r=0;r<n.length;r++){var s=n[r];var l=this.blocks.findByIndex(r);var o=a.findByIndex(r);if(l&&o){if(l.isSeparator){n[r]=l.mask}else if(s===o.mask){n[r]=l.mask}}}t.value=n.join("")}};t.prototype.onFocus=function(t){};t.prototype.onBlur=function(t){};t.prototype.onChange=function(t){t.submit("change",this.onParseValue(t.value))};t.prototype.onNavigationDown=function(t,e,a){};t.prototype.onSelectAll=function(t,e,a){};t.prototype.onPaste=function(t,e,a){var i=t.clipboardData||"";t.value=i;t.position.toEnd()};t.prototype.onBlockChange=function(t,e,a){t.setChar();t.position.next();var i=this.blocks.list[a+1];if(t.position.value===e.to&&i&&i.isSeparator){t.position.next()}};t.prototype.onBackspaceDown=function(t,e,a){t.position.previous();if(!e.isSeparator){t.setChar(e.mask);var i=this.blocks.list[a-1];if(t.position.value===e.from&&i&&i.isSeparator){t.position.previous()}}};t.prototype.onDeleteDown=function(t,e,a){t.setChar(e.mask);t.position.next();var i=this.blocks.list[a+1];if(t.position.value===e.to&&i&&i.isSeparator){t.position.next()}};t.prototype.onValueChanged=function(t){var e=this.onFormatValue(t.newValue);var a=t.focused&&e===""?this.blocks.getPlaceholderMask():e;t.value=a;t.position.toEnd()};t.prototype.onParseValue=function(t,e){if(e===void 0){e={allowInvalidValue:false}}if(t){return t.trim()}return t||""};t.prototype.onFormatValue=function(t){if(t){return t.trim()}return t||""};t.prototype.toParsedValue=function(t){return this.onParseValue(t)};t.prototype.toFormattedValue=function(t){return this.onFormatValue(t)};t.prototype.fireI18nChange=function(t){var e=this.blocks.clone();var a="".concat(t.locale);this.locale=t.locale;this.blocks.list.forEach((function(e){return e.onI18nChange(t.locale)}));this.onLocaleChange(t,a,e)};t.prototype.fireValueChanged=function(t){if(t.didValueChange){this.onValueChanged(t)}};t.prototype.firePaste=function(t){var e=this.blocks.getBlockIndexFromPosition(t.position.value);if(e!==undefined){var a=this.blocks.list[e];this.onPaste(t,a,e);this.onChange(t)}};t.prototype.fireClick=function(t){var e=this.blocks.getPlaceholderMask();if(e===t.value){t.position.toStart()}};t.prototype.fireFocus=function(t){if(t.target&&t.isValueEmpty()){this.resetInputValueWithMask(t)}this.onFocus(t)};t.prototype.fireBlur=function(t){if(t.target){if(this.isValueEmptyMask(t)){this.emptyInputValue(t)}else{this.onBlur(t);t.submit("blur",this.onParseValue(t.value,{allowInvalidValue:t.component.allowInvalidValue}))}}};t.prototype.fireKeyDown=function(t){var e=t.isBackspaceKey?Math.max(0,t.position.value-1):t.position.value;var a=this.blocks.getBlockIndexFromPosition(e);if(e>=this.blocks.lastPosition&&!t.isNavigationKey&&!t.isSelectAllCommand){t.preventDefault();t.stopPropagation();return}if(a!==undefined&&!t.position.isRangeSelection){var i=this.blocks.list[a];if(t.isNavigationKey){this.onNavigationDown(t,i,a)}else if(t.isSelectAllCommand){this.onSelectAll(t,i,a)}else if(t.isCopyCommand);else if(t.isPasteCommand);else if(t.isBackspaceKey){t.preventDefault();this.onBackspaceDown(t,i,a)}else if(t.isDeleteKey){t.preventDefault();this.onDeleteDown(t,i,a)}else if(t.isWhiteSpaceKey){t.preventDefault();var n=t.value[t.position.value];if(n==="."){t.stopPropagation();var r=t.value;t.value=r.substring(0,t.position.value)+"_"+r.substring(t.position.value+1)}}else if(i.verifyAllowedKeyHits(t.key)){t.preventDefault();this.onBlockChange(t,i,a)}else if(this.blocks.verifyCallOfNextSeparator(t.key,a)){t.preventDefault();var s=this.blocks.list[a];if(t.position.value>s.from){var l=this.blocks.list[a+1];var r=t.value;var o=i.getValueOfTheBlock(r);var u=i.format(o);t.value=r.substring(0,i.from)+u+r.substring(i.to);t.position.value=l.to}}var d=this.blocks.getBlockIndexFromPosition(t.position.value);if(d&&!t.isBackspaceKey){var c=this.blocks.formatBlocks(t.value,d);var h=t.position.value;t.value=c;t.position.value=h}}else{if(!t.isTabKey){t.preventDefault()}if(t.isBackspaceKey||t.isDeleteKey){this.resetInputValueWithMask(t)}else if(this.blocks.list[0].verifyAllowedKeyHits(t.key)){this.onBlockChange(t,this.blocks.list[0],0)}}};t.prototype.resetInputValueWithMask=function(t){t.value=this.blocks.getPlaceholderMask();t.position.toStart()};t.prototype.isValueEmptyMask=function(t){var e=this.blocks.getPlaceholderMask();return e===t.value};t.prototype.emptyInputValue=function(t){t.value="";t.submit("blur",t.value)};return t}();var DateMask=function(t){__extends(e,t);function e(){var e=t.call(this,[new MaskBlock({from:0,to:2,allowedKeys:__spreadArray([],NUMBER_KEYS,true),format:function(t,e,a){if(Number.isNaN(parseInt(t,10))){return"".concat(a).concat(a)}return t.padStart(2,"0")},mask:function(t){return e.dayMask[t.split("-")[0]]||e.dayMask["de"]}}),new MaskBlock({from:2,to:3,mask:function(t){return dateSeparator(t)},isSeparator:true}),new MaskBlock({from:3,to:5,allowedKeys:__spreadArray([],NUMBER_KEYS,true),format:function(t,e,a){if(Number.isNaN(parseInt(t,10))){return"".concat(a).concat(a)}return t.padStart(2,"0")},mask:function(t){return e.monthMask[t.split("-")[0]]||e.monthMask["de"]}}),new MaskBlock({from:5,to:6,mask:function(t){return dateSeparator(t)},isSeparator:true}),new MaskBlock({from:6,to:10,allowedKeys:__spreadArray([],NUMBER_KEYS,true),mask:function(t){return e.yearMask[t.split("-")[0]]||e.yearMask["de"]}})])||this;e.maxLength=10;e.minLength=10;e.inputMode="decimal";e.dayMask={de:"T",en:"D",fr:"J",it:"G",nl:"D",es:"D",pl:"D",pt:"D",sv:"D",fi:"M"};e.monthMask={de:"M",en:"M",fr:"M",it:"M",nl:"M",es:"M",pl:"M",pt:"M",sv:"M",fi:"K"};e.yearMask={de:"J",en:"Y",fr:"A",it:"A",nl:"J",es:"A",pl:"R",pt:"A",sv:"Å",fi:"V"};return e}e.prototype.onParseValue=function(t,e){if(e===void 0){e={allowInvalidValue:false}}if(t){var a=BalDate.fromAnyFormat(this.blocks.getRawValueWithoutMask(t));if(a.isValid){return a.toISODate()}else if(e&&e.allowInvalidValue){return INVALID_VALUE}}return""};e.prototype.onFormatValue=function(t){if(t){var e=BalDate.fromISO(t);if(e.isValid){return e.toFormat()}}return""};e.prototype.onPaste=function(t,e,a){var i=t.clipboardData||"";var n=BalDate.fromAnyFormat(i);if(n.isValid){t.value=n.toFormat();t.position.toEnd()}};e.prototype.onBlur=function(t){var e=this.blocks.getRawValueWithoutMaskByContext(t);var a=BalDate.fromAnyFormat(e);if(a.isValid){var i=a.toFormat();if(i!==t.value){t.value=i}}else if(t.component.allowInvalidValue){if(e!==t.value){t.value=e}}};return e}(AbstractMask);var MaskComponentAdapter=function(){function t(t){this.mask=t}Object.defineProperty(t.prototype,"attributes",{get:function(){return{inputMode:this.mask.inputMode,maxLength:this.mask.maxLength,minLength:this.mask.minLength,type:"text",autoCapitalize:"off",autoCorrect:"off",spellcheck:false}},enumerable:false,configurable:true});t.prototype.bindComponent=function(t){this.component=t};t.prototype.bindComponentDidLoad=function(){if(this.component&&this.component.nativeInput){this.component.nativeInput.value=this.component.value||""}this.bindValueChanged(this.component.value,undefined)};t.prototype.bindConfigChanged=function(t){var e=this,a=e.component,i=e.mask;var n=new MaskLocaleContext({component:a,mask:i,event:{locale:"".concat(t.language,"-").concat(t.region)}});this.mask.fireI18nChange(n);n.submit()};t.prototype.bindValueChanged=function(t,e){var a=this,i=a.component,n=a.mask;var r=new MaskValueChangedContext({component:i,mask:n,event:{newValue:t,oldValue:e}});this.mask.fireValueChanged(r);r.submit("blur")};t.prototype.bindKeyDown=function(t){if(this.isComponentAccessible){var e=this,a=e.component,i=e.mask;var n=new MaskKeyboardContext({event:t,component:a,mask:i});this.mask.fireKeyDown(n);var r=t.key==="Tab";n.submit(r?"tab":"input");a.balKeyPress.emit(t)}};t.prototype.bindFocus=function(t){if(this.isComponentAccessible){var e=this,a=e.component,i=e.mask;a.focused=true;var n=new MaskFocusContext({event:t,component:a,mask:i});this.mask.fireFocus(n);n.submit();a.balFocus.emit(t)}};t.prototype.bindBlur=function(t){if(this.isComponentAccessible){var e=this,a=e.component,i=e.mask;a.focused=false;var n=new MaskFocusContext({event:t,component:a,mask:i});this.mask.fireBlur(n);n.submit("blur");a.balBlur.emit(t)}};t.prototype.bindPaste=function(t){if(this.isComponentAccessible){var e=this,a=e.component,i=e.mask;var n=new MaskClipboardContext({event:t,component:a,mask:i});this.mask.firePaste(n);n.submit()}};t.prototype.bindFormReset=function(t){var e=this;var a=t.target;if(a&&(a===this.component.el||a.contains(this.component.el))){this.component.value=this.component.initialValue;this.component.inputValue=this.component.initialValue;clearTimeout(this.resetHandlerTimer);this.resetHandlerTimer=setTimeout((function(){if(e.component.nativeInput){e.component.nativeInput.value=e.mask.toFormattedValue(e.component.value||"")}}))}};t.prototype.bindClick=function(t){if(this.isComponentAccessible){var e=this,a=e.component,i=e.mask;var n=new MaskMouseContext({event:t,component:a,mask:i});this.mask.fireClick(n);n.submit()}};t.prototype.bindHostClick=function(t){if(!this.isComponentAccessible){t.preventDefault();t.stopPropagation()}};t.prototype.bindGlobalClick=function(t){if(!this.isComponentAccessible){if(t.target&&t.target===this.component.el){t.preventDefault();t.stopPropagation()}}};Object.defineProperty(t.prototype,"isComponentAccessible",{get:function(){return!this.component.disabled&&!this.component.readonly},enumerable:false,configurable:true});return t}();var balInputDateCss=".bal-input-date{display:block;width:100%;-ms-flex:1;flex:1}.bal-input-date input:not(:-moz-placeholder-shown){letter-spacing:.4px}.bal-input-date input:not(:-ms-input-placeholder){letter-spacing:.4px}.bal-input-date input:not(:placeholder-shown){letter-spacing:.4px}.bal-input-date__native{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}";var BalInputDateStyle0=balInputDateCss;var InputDate=function(){function t(t){registerInstance(this,t);this.balKeyPress=createEvent(this,"balKeyPress",7);this.balChange=createEvent(this,"balChange",7);this.balInput=createEvent(this,"balInput",7);this.balBlur=createEvent(this,"balBlur",7);this.balFocus=createEvent(this,"balFocus",7);this.inputId="bal-i-date-".concat(inputDateIds++);this.inheritedAttributes={};this.maskAdapter=new MaskComponentAdapter(new DateMask);this.inputValue=this.value;this.initialValue=this.value||"";this.focused=false;this.isGrouped=false;this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.placeholder=undefined;this.clickable=false;this.min=undefined;this.max=undefined;this.autocomplete="off";this.hasIconRight=false;this.value=undefined;this.autoInvalidOff=false;this.allowInvalidValue=false}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(t,e){this.maskAdapter.bindValueChanged(t,e)};t.prototype.connectedCallback=function(){this.maskAdapter.bindComponent(this);this.isGrouped=hasParent("bal-input-group",this.el)};t.prototype.componentDidLoad=function(){this.maskAdapter.bindComponentDidLoad()};t.prototype.componentWillRender=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title"])};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.maskAdapter.bindConfigChanged(t);return[2]}))}))};t.prototype.resetHandler=function(t){this.maskAdapter.bindFormReset(t)};t.prototype.listenOnClick=function(t){this.maskAdapter.bindGlobalClick(t)};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){inputSetFocus(this);return[2]}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){inputSetBlur(this);return[2]}))}))};t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.ariaForm=Object.assign({},t);return[2]}))}))};t.prototype.render=function(){var t=this;var e=BEM.block("input-date");var a=e.element("native");return h(Host,{onClick:function(e){return t.maskAdapter.bindHostClick(e)},class:Object.assign({},e.class())},h("input",Object.assign({class:{input:true,"is-disabled":this.disabled||this.readonly,"is-danger":this.invalid,"is-clickable":this.clickable&&!(this.disabled||this.readonly),"bal-focusable":!this.disabled,"has-icon-right":this.hasIconRight},"data-testid":"bal-date-input",ref:function(e){return t.nativeInput=e},id:this.ariaForm.controlId||this.inputId,"aria-labelledby":this.ariaForm.labelId,"aria-describedby":this.ariaForm.messageId,"aria-invalid":this.invalid===true?"true":"false","aria-disabled":this.disabled?"true":null,required:this.required,disabled:this.disabled,readonly:this.readonly,autoComplete:this.autocomplete},this.maskAdapter.attributes,this.inheritedAttributes,{placeholder:this.placeholder,value:this.inputValue,onKeyDown:function(e){return t.maskAdapter.bindKeyDown(e)},onClick:function(e){return t.maskAdapter.bindClick(e)},onFocus:function(e){return t.maskAdapter.bindFocus(e)},onBlur:function(e){return t.maskAdapter.bindBlur(e)},onPaste:function(e){return t.maskAdapter.bindPaste(e)}})),h("input",{type:"date",class:Object.assign({},a.class()),name:this.name,min:this.min,max:this.max,value:this.value,tabindex:-1,"aria-hidden":"true"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-input-date"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],InputDate.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],InputDate.prototype,"configChanged",null);var inputDateIds=0;InputDate.style=BalInputDateStyle0;export{DateCalendar as bal_date_calendar,InputDate as bal_input_date};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-b6003bc7.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-654e2c24.js";import{e as isSpaceKey}from"./index.esm-83b1f9c4.js";import{a as autoUpdate,c as computePosition,o as offset,f as flip}from"./floating-ui.dom.esm-f1cf1077.js";import{B as BalDate,i as i18nBalDate}from"./date-38a0b208.js";import{B as BEM}from"./bem-8c7d2eb0.js";import{L as Logger}from"./log-dfd1c19f.js";import{i as inheritAttributes}from"./attributes-4fa7040f.js";import{s as stopEventBubbling}from"./form-input-28a08ec5.js";import{m as debounceEvent}from"./helpers-c201154e.js";import{d as defaultBalAriaForm}from"./form-fb8dd9f5.js";import{d as defaultConfig}from"./config.default-7efdc82d.js";import{L as ListenToConfig}from"./config.decorator-d18abfe1.js";import"./index-82aff103.js";import"./_commonjsHelpers-1c8beb5f.js";import"./config.utils-6ac6c9bd.js";import"./browser-a8073d92.js";import"./icons.constant-a7885631.js";var balDateCss=":root{--bal-date-popup-z-index:var(--bal-z-index-tooltip);--bal-date-popup-shadow:var(--bal-shadow-normal);--bal-date-popup-radius:var(--bal-radius-normal)}:root{--bal-z-index-tooltip:1300}.bal-date{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-date__icon--clickable{cursor:pointer}.bal-date__popup{display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;position:absolute;top:0;left:0;z-index:var(--bal-date-popup-z-index);-webkit-box-shadow:var(--bal-date-popup-shadow);box-shadow:var(--bal-date-popup-shadow);border-radius:var(--bal-date-popup-radius)}.bal-date__popup--visible{display:block}";var BalDateStyle0=balDateCss;var Date=function(){function t(t){var i=this;registerInstance(this,t);this.balInput=createEvent(this,"balInput",7);this.balChange=createEvent(this,"balChange",7);this.balWillAnimate=createEvent(this,"balWillAnimate",7);this.balDidAnimate=createEvent(this,"balDidAnimate",7);this.balBlur=createEvent(this,"balBlur",7);this.balFocus=createEvent(this,"balFocus",7);this.balInputClick=createEvent(this,"balInputClick",7);this.balIconClick=createEvent(this,"balIconClick",7);this.balPopoverPrepare=createEvent(this,"balPopoverPrepare",7);this.inputId="bal-da-".concat(dateIds++);this.inheritedAttributes={};this.onIconClick=function(t){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.triggerIcon)return[3,2];return[4,this.toggle()];case 1:t.sent();return[3,4];case 2:return[4,this.open()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};this.onInputClick=function(t){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!!this.triggerIcon)return[3,2];return[4,this.open()];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.onCalendarChange=function(t){stopEventBubbling(t);i.value=t.detail;i.balChange.emit(i.value);if(i.closeOnSelect){i.close()}};this.onInputInput=function(t){stopEventBubbling(t);i.balInput.emit(t.detail);if(t.detail){var e=BalDate.fromAnyFormat(t.detail);if(e.isValid){i.calendarValue=e.toISODate()}}};this.onInputChange=function(t){stopEventBubbling(t);i.value=t.detail;i.balChange.emit(i.value)};this.onInputFocus=function(t){stopEventBubbling(t);i.balFocus.emit(t.detail)};this.onInputBlur=function(t){stopEventBubbling(t);i.balBlur.emit(t.detail)};this.onKeyPress=function(t){var e=t.detail;return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(isSpaceKey(e)&&!this.triggerIcon))return[3,4];if(!this.isExpanded)return[3,2];return[4,this.close()];case 1:t.sent();return[3,4];case 2:return[4,this.open()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};this.isExpanded=false;this.language=defaultConfig.language;this.calendarValue=undefined;this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.freeSolo=false;this.placeholder=undefined;this.triggerIcon=false;this.closeOnSelect=true;this.value=undefined;this.min=undefined;this.max=undefined;this.minYearProp=undefined;this.maxYearProp=undefined;this.defaultDate=undefined;this.allowedDates=undefined;this.allowInvalidValue=false;this.debounce=0;this.autoInvalidOff=false}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(){this.calendarValue=this.value};t.prototype.debounceChanged=function(){this.balChange=debounceEvent(this.balChange,this.debounce)};t.prototype.connectedCallback=function(){this.valueChanged()};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title"])};t.prototype.listenToKeydown=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!(this.isExpanded&&(t.key==="Escape"||t.key==="Esc")))return[3,2];t.preventDefault();return[4,this.close()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.listenOnKeyup=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!(t.key==="Tab"&&!this.el.contains(document.activeElement)&&this.isExpanded))return[3,2];return[4,this.close()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.listenOnclick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!(this.isExpanded&&!this.el.contains(t.target)))return[3,2];return[4,this.close()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.listenOnPopoverPrepare=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!(this.inputId!==t.detail))return[3,2];return[4,this.close()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.language=t.language;return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.expand()]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.collapse()]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.isExpanded){return[2,this.collapse()]}else{return[2,this.expand()]}return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(e){i=BalDate.fromISO(t);if(i.isValid){this.value=i.toISODate();this.calendarValue=this.value}return[2]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){(t=this.inputEl)===null||t===void 0?void 0:t.setFocus();return[2]}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){(t=this.inputEl)===null||t===void 0?void 0:t.setBlur();return[2]}))}))};t.prototype.getInputElement=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){return[2,(t=this.inputEl)===null||t===void 0?void 0:t.getInputElement()]}))}))};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(e){this.ariaForm=Object.assign({},t);(i=this.inputEl)===null||i===void 0?void 0:i.setAriaForm(t);return[2]}))}))};t.prototype.expand=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){if(this.referenceEl&&this.floatingEl){this.balPopoverPrepare.emit(this.inputId);this.balWillAnimate.emit();this.isExpanded=true;this.popupCleanup=autoUpdate(this.referenceEl,this.floatingEl,(function(){t.updatePosition(t.referenceEl,t.floatingEl)}))}return[2,this.isExpanded]}))}))};t.prototype.collapse=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.floatingEl){this.balWillAnimate.emit();this.isExpanded=false;if(this.popupCleanup){this.popupCleanup()}this.balDidAnimate.emit()}return[2,this.isExpanded]}))}))};t.prototype.updatePosition=function(t,i){var e=this;computePosition(t,i,{placement:"bottom-start",middleware:[offset(4),flip({crossAxis:false})]}).then((function(t){var n=t.x,r=t.y;Object.assign(i.style,{left:"".concat(n,"px"),top:"".concat(r,"px")});e.balDidAnimate.emit()}))};t.prototype.render=function(){var t=this;var i=BEM.block("date");var e=i.element("icon");var n=i.element("popup");return h(Host,{id:this.inputId,class:Object.assign({},i.class())},h("bal-input-group",{invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,ref:function(i){return t.referenceEl=i}},h("bal-input-date",Object.assign({name:this.name,required:this.required,placeholder:this.placeholder,value:this.value,min:this.min,max:this.max,invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,allowInvalidValue:this.allowInvalidValue,onClick:this.onInputClick,onBalInput:this.onInputInput,onBalChange:this.onInputChange,onBalFocus:this.onInputFocus,onBalBlur:this.onInputBlur,onBalKeyPress:this.onKeyPress,ref:function(i){return t.inputEl=i}},this.inheritedAttributes)),!this.freeSolo?h("bal-icon",{name:"date",role:"button",tabindex:-1,class:Object.assign(Object.assign({},e.class()),e.modifier("clickable").class(!this.disabled&&!this.readonly)),"is-right":true,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",onClick:this.onIconClick,"aria-label":i18nBalDate[this.language].toggleDatepicker,"aria-haspopup":"true","aria-expanded":this.isExpanded?"true":"false"}):""),h("div",{role:"dialog",class:Object.assign(Object.assign({},n.class()),n.modifier("visible").class(this.isExpanded)),ref:function(i){return t.floatingEl=i},"aria-hidden":"".concat(this.isExpanded!==true),"aria-presented":"".concat(this.isExpanded===true)},h("bal-date-calendar",{value:this.calendarValue,min:this.min,max:this.max,minYearProp:this.minYearProp,maxYearProp:this.maxYearProp,defaultDate:this.defaultDate,allowedDates:this.allowedDates,onBalChange:this.onCalendarChange})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],debounce:["debounceChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-date"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Date.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Date.prototype,"configChanged",null);var dateIds=0;Date.style=BalDateStyle0;export{Date as bal_date};
|
|
1
|
+
import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-b6003bc7.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-654e2c24.js";import{e as isSpaceKey}from"./index.esm-76abd8e3.js";import{a as autoUpdate,c as computePosition,o as offset,f as flip}from"./floating-ui.dom.esm-f1cf1077.js";import{B as BalDate,i as i18nBalDate}from"./date-aba2d404.js";import{B as BEM}from"./bem-8c7d2eb0.js";import{L as Logger}from"./log-dfd1c19f.js";import{i as inheritAttributes}from"./attributes-4fa7040f.js";import{s as stopEventBubbling}from"./form-input-28a08ec5.js";import{m as debounceEvent}from"./helpers-c201154e.js";import{d as defaultBalAriaForm}from"./form-fb8dd9f5.js";import{d as defaultConfig}from"./config.default-7efdc82d.js";import{L as ListenToConfig}from"./config.decorator-d18abfe1.js";import"./index-82aff103.js";import"./_commonjsHelpers-1c8beb5f.js";import"./config.utils-6ac6c9bd.js";import"./browser-a8073d92.js";import"./icons.constant-a7885631.js";var balDateCss=":root{--bal-date-popup-z-index:var(--bal-z-index-tooltip);--bal-date-popup-shadow:var(--bal-shadow-normal);--bal-date-popup-radius:var(--bal-radius-normal)}:root{--bal-z-index-tooltip:1300}.bal-date{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-date__icon--clickable{cursor:pointer}.bal-date__popup{display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;position:absolute;top:0;left:0;z-index:var(--bal-date-popup-z-index);-webkit-box-shadow:var(--bal-date-popup-shadow);box-shadow:var(--bal-date-popup-shadow);border-radius:var(--bal-date-popup-radius)}.bal-date__popup--visible{display:block}";var BalDateStyle0=balDateCss;var Date=function(){function t(t){var i=this;registerInstance(this,t);this.balInput=createEvent(this,"balInput",7);this.balChange=createEvent(this,"balChange",7);this.balWillAnimate=createEvent(this,"balWillAnimate",7);this.balDidAnimate=createEvent(this,"balDidAnimate",7);this.balBlur=createEvent(this,"balBlur",7);this.balFocus=createEvent(this,"balFocus",7);this.balInputClick=createEvent(this,"balInputClick",7);this.balIconClick=createEvent(this,"balIconClick",7);this.balPopoverPrepare=createEvent(this,"balPopoverPrepare",7);this.inputId="bal-da-".concat(dateIds++);this.inheritedAttributes={};this.onIconClick=function(t){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.triggerIcon)return[3,2];return[4,this.toggle()];case 1:t.sent();return[3,4];case 2:return[4,this.open()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};this.onInputClick=function(t){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!!this.triggerIcon)return[3,2];return[4,this.open()];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.onCalendarChange=function(t){stopEventBubbling(t);i.value=t.detail;i.balChange.emit(i.value);if(i.closeOnSelect){i.close()}};this.onInputInput=function(t){stopEventBubbling(t);i.balInput.emit(t.detail);if(t.detail){var e=BalDate.fromAnyFormat(t.detail);if(e.isValid){i.calendarValue=e.toISODate()}}};this.onInputChange=function(t){stopEventBubbling(t);i.value=t.detail;i.balChange.emit(i.value)};this.onInputFocus=function(t){stopEventBubbling(t);i.balFocus.emit(t.detail)};this.onInputBlur=function(t){stopEventBubbling(t);i.balBlur.emit(t.detail)};this.onKeyPress=function(t){var e=t.detail;return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(isSpaceKey(e)&&!this.triggerIcon))return[3,4];if(!this.isExpanded)return[3,2];return[4,this.close()];case 1:t.sent();return[3,4];case 2:return[4,this.open()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};this.isExpanded=false;this.language=defaultConfig.language;this.calendarValue=undefined;this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.freeSolo=false;this.placeholder=undefined;this.triggerIcon=false;this.closeOnSelect=true;this.value=undefined;this.min=undefined;this.max=undefined;this.minYearProp=undefined;this.maxYearProp=undefined;this.defaultDate=undefined;this.allowedDates=undefined;this.allowInvalidValue=false;this.debounce=0;this.autoInvalidOff=false}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(){this.calendarValue=this.value};t.prototype.debounceChanged=function(){this.balChange=debounceEvent(this.balChange,this.debounce)};t.prototype.connectedCallback=function(){this.valueChanged()};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title"])};t.prototype.listenToKeydown=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!(this.isExpanded&&(t.key==="Escape"||t.key==="Esc")))return[3,2];t.preventDefault();return[4,this.close()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.listenOnKeyup=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!(t.key==="Tab"&&!this.el.contains(document.activeElement)&&this.isExpanded))return[3,2];return[4,this.close()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.listenOnclick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!(this.isExpanded&&!this.el.contains(t.target)))return[3,2];return[4,this.close()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.listenOnPopoverPrepare=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!(this.inputId!==t.detail))return[3,2];return[4,this.close()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.language=t.language;return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.expand()]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.collapse()]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.isExpanded){return[2,this.collapse()]}else{return[2,this.expand()]}return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(e){i=BalDate.fromISO(t);if(i.isValid){this.value=i.toISODate();this.calendarValue=this.value}return[2]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){(t=this.inputEl)===null||t===void 0?void 0:t.setFocus();return[2]}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){(t=this.inputEl)===null||t===void 0?void 0:t.setBlur();return[2]}))}))};t.prototype.getInputElement=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){return[2,(t=this.inputEl)===null||t===void 0?void 0:t.getInputElement()]}))}))};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(e){this.ariaForm=Object.assign({},t);(i=this.inputEl)===null||i===void 0?void 0:i.setAriaForm(t);return[2]}))}))};t.prototype.expand=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){if(this.referenceEl&&this.floatingEl){this.balPopoverPrepare.emit(this.inputId);this.balWillAnimate.emit();this.isExpanded=true;this.popupCleanup=autoUpdate(this.referenceEl,this.floatingEl,(function(){t.updatePosition(t.referenceEl,t.floatingEl)}))}return[2,this.isExpanded]}))}))};t.prototype.collapse=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.floatingEl){this.balWillAnimate.emit();this.isExpanded=false;if(this.popupCleanup){this.popupCleanup()}this.balDidAnimate.emit()}return[2,this.isExpanded]}))}))};t.prototype.updatePosition=function(t,i){var e=this;computePosition(t,i,{placement:"bottom-start",middleware:[offset(4),flip({crossAxis:false})]}).then((function(t){var n=t.x,r=t.y;Object.assign(i.style,{left:"".concat(n,"px"),top:"".concat(r,"px")});e.balDidAnimate.emit()}))};t.prototype.render=function(){var t=this;var i=BEM.block("date");var e=i.element("icon");var n=i.element("popup");return h(Host,{id:this.inputId,class:Object.assign({},i.class())},h("bal-input-group",{invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,ref:function(i){return t.referenceEl=i}},h("bal-input-date",Object.assign({name:this.name,required:this.required,placeholder:this.placeholder,value:this.value,min:this.min,max:this.max,invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,allowInvalidValue:this.allowInvalidValue,onClick:this.onInputClick,onBalInput:this.onInputInput,onBalChange:this.onInputChange,onBalFocus:this.onInputFocus,onBalBlur:this.onInputBlur,onBalKeyPress:this.onKeyPress,ref:function(i){return t.inputEl=i}},this.inheritedAttributes)),!this.freeSolo?h("bal-icon",{name:"date",role:"button",tabindex:-1,class:Object.assign(Object.assign({},e.class()),e.modifier("clickable").class(!this.disabled&&!this.readonly)),"is-right":true,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",onClick:this.onIconClick,"aria-label":i18nBalDate[this.language].toggleDatepicker,"aria-haspopup":"true","aria-expanded":this.isExpanded?"true":"false"}):""),h("div",{role:"dialog",class:Object.assign(Object.assign({},n.class()),n.modifier("visible").class(this.isExpanded)),ref:function(i){return t.floatingEl=i},"aria-hidden":"".concat(this.isExpanded!==true),"aria-presented":"".concat(this.isExpanded===true)},h("bal-date-calendar",{value:this.calendarValue,min:this.min,max:this.max,minYearProp:this.minYearProp,maxYearProp:this.maxYearProp,defaultDate:this.defaultDate,allowedDates:this.allowedDates,onBalChange:this.onCalendarChange})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],debounce:["debounceChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-date"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Date.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Date.prototype,"configChanged",null);var dateIds=0;Date.style=BalDateStyle0;export{Date as bal_date};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter,__generator,__spreadArray}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-b6003bc7.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-654e2c24.js";import{k as rIC,m as debounceEvent}from"./helpers-c201154e.js";import{i as inheritAttributes}from"./attributes-4fa7040f.js";import{r as requiredArgs,t as toDate,b as toInteger,g as getDefaultOptions,p as parse,f as formatDateString,i as isValidIsoString,c as format,e as isSpaceKey,h as isEnterKey,d as dateSeparator,j as getYear,n as now,k as getMonth,m as getDate}from"./index.esm-83b1f9c4.js";import{l as lodash_isnil}from"./index-82aff103.js";import{N as NUMBER_KEYS,A as ACTION_KEYS,i as isCtrlOrCommandKey}from"./keys.constant-0eb059e0.js";import{i as i18nBalDatepicker}from"./bal-datepicker.i18n-63a3cb67.js";import{s as stopEventBubbling,g as getInputTarget,i as inputHandleFocus,a as inputHandleHostClick,b as inputListenOnClick,c as inputSetFocus,d as inputSetBlur}from"./form-input-28a08ec5.js";import{p as preventDefault}from"./utils-9fbab1d3.js";import{B as BEM}from"./bem-8c7d2eb0.js";import{L as Logger}from"./log-dfd1c19f.js";import{d as defaultBalAriaForm}from"./form-fb8dd9f5.js";import{d as defaultConfig,a as defaultLocale}from"./config.default-7efdc82d.js";import{b as balBreakpoints}from"./breakpoints.subject-9ea7074e.js";import{g as useBalConfig}from"./config.utils-6ac6c9bd.js";import{L as ListenToBreakpoints}from"./breakpoints.decorator-f979fe5c.js";import{L as ListenToConfig}from"./config.decorator-d18abfe1.js";import"./browser-a8073d92.js";import"./icons.constant-a7885631.js";import"./_commonjsHelpers-1c8beb5f.js";import"./device-8c6d2881.js";import"./listener-04842ae9.js";import"./tokens.esm-7d2734e1.js";function addDays(t,e){requiredArgs(2,arguments);var i=toDate(t);var r=toInteger(e);if(isNaN(r)){return new Date(NaN)}if(!r){return i}i.setDate(i.getDate()+r);return i}function addMonths(t,e){requiredArgs(2,arguments);var i=toDate(t);var r=toInteger(e);if(isNaN(r)){return new Date(NaN)}if(!r){return i}var a=i.getDate();var n=new Date(i.getTime());n.setMonth(i.getMonth()+r+1,0);var s=n.getDate();if(a>=s){return n}else{i.setFullYear(n.getFullYear(),n.getMonth(),a);return i}}function startOfWeek(t,e){var i,r,a,n,s,o,l,d;requiredArgs(1,arguments);var c=getDefaultOptions();var u=toInteger((i=(r=(a=(n=e===null||e===void 0?void 0:e.weekStartsOn)!==null&&n!==void 0?n:e===null||e===void 0?void 0:(s=e.locale)===null||s===void 0?void 0:(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&a!==void 0?a:c.weekStartsOn)!==null&&r!==void 0?r:(l=c.locale)===null||l===void 0?void 0:(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&i!==void 0?i:0);if(!(u>=0&&u<=6)){throw new RangeError("weekStartsOn must be between 0 and 6 inclusively")}var h=toDate(t);var f=h.getDay();var p=(f<u?7:0)+f-u;h.setDate(h.getDate()-p);h.setHours(0,0,0,0);return h}function startOfDay(t){requiredArgs(1,arguments);var e=toDate(t);e.setHours(0,0,0,0);return e}function addYears(t,e){requiredArgs(2,arguments);var i=toInteger(e);return addMonths(t,i*12)}function isSameDay(t,e){requiredArgs(2,arguments);var i=startOfDay(t);var r=startOfDay(e);return i.getTime()===r.getTime()}function lastDayOfMonth(t){requiredArgs(1,arguments);var e=toDate(t);var i=e.getMonth();e.setFullYear(e.getFullYear(),i+1,0);e.setHours(0,0,0,0);return e}function isAfter(t,e){requiredArgs(2,arguments);var i=toDate(t);var r=toDate(e);return i.getTime()>r.getTime()}function isBefore(t,e){requiredArgs(2,arguments);var i=toDate(t);var r=toDate(e);return i.getTime()<r.getTime()}function isSameWeek(t,e,i){requiredArgs(2,arguments);var r=startOfWeek(t,i);var a=startOfWeek(e,i);return r.getTime()===a.getTime()}function isSameMonth(t,e){requiredArgs(2,arguments);var i=toDate(t);var r=toDate(e);return i.getFullYear()===r.getFullYear()&&i.getMonth()===r.getMonth()}function isWithinInterval(t,e){requiredArgs(2,arguments);var i=toDate(t).getTime();var r=toDate(e.start).getTime();var a=toDate(e.end).getTime();if(!(r<=a)){throw new RangeError("Invalid interval")}return i>=r&&i<=a}function subDays(t,e){requiredArgs(2,arguments);var i=toInteger(e);return addDays(t,-i)}function subYears(t,e){requiredArgs(2,arguments);var i=toInteger(e);return addYears(t,-i)}var balDatepickerCss=':root{--bal-datepicker-popover-background:var(--bal-color-grey-2);--bal-datepicker-cell-background:var(--bal-color-white);--bal-datepicker-cell-selected-background:var(--bal-color-primary);--bal-datepicker-cell-selected-today-background:var(--bal-color-white);--bal-datepicker-cell-today-background:var(--bal-color-primary);--bal-datepicker-cell-today-radius:var(--bal-radius-rounded)}.bal-datepicker{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-datepicker__native{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-datepicker__popup{padding:1rem;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--bal-datepicker-popover-background)}@media screen and (min-width: 769px),print{.bal-datepicker__popup{max-width:24.5rem}}.bal-datepicker__popup__body{max-width:22.5rem;margin:0 auto 0 auto;margin-top:.75rem}.bal-datepicker-pagination{max-width:22.5rem;margin:0 auto 0 auto}.bal-datepicker-pagination__inner{display:-ms-flexbox;display:flex;gap:.5rem}.bal-datepicker-pagination__month-and-year{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;gap:.5rem}.bal-datepicker-pagination__month-and-year__select{-ms-flex:1;flex:1}.bal-datepicker-pagination__month-and-year__select .select,.bal-datepicker-pagination__month-and-year__select .select select{padding-top:0 !important;padding-bottom:0 !important;text-align:center !important;min-height:2rem !important;height:2rem !important}@media screen and (min-width: 769px),print{.bal-datepicker-pagination__month-and-year__select .select,.bal-datepicker-pagination__month-and-year__select .select select{min-height:3rem !important;height:3rem !important}}.bal-datepicker-grid{display:table;border-collapse:collapse;width:100%;table-layout:fixed}.bal-datepicker-grid__body{display:table-row-group}.bal-datepicker-grid__row{display:table-row}.bal-datepicker-grid__row .bal-datepicker-grid__cell{margin-bottom:.25rem;margin-right:.25rem}.bal-datepicker-grid__row:last-child .bal-datepicker-grid__cell{margin-bottom:0}.bal-datepicker-grid__header{display:-ms-flexbox;display:flex;max-width:22.5rem;margin:0 auto 0 auto;gap:.25rem}.bal-datepicker-grid__header .bal-datepicker-grid__cell{background:rgba(0,0,0,0)}.bal-datepicker-grid__header .bal-datepicker-grid__cell span{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:100%;width:100%}.bal-datepicker-grid__cell{position:relative;text-align:center;vertical-align:middle;display:table-cell;width:13%;padding:0 !important;height:3rem;min-height:3rem;min-width:2.25rem;-webkit-appearance:auto !important;-moz-appearance:auto !important;appearance:auto !important;background:var(--bal-datepicker-cell-background)}.bal-datepicker-grid__cell--selected{background:var(--bal-datepicker-cell-selected-background) !important}.bal-datepicker-grid__cell--today:not(.bal-datepicker-grid__cell--outdated)>span{font-weight:var(--bal-font-weight-bold)}.bal-datepicker-grid__cell--today:not(.bal-datepicker-grid__cell--outdated)::after{content:"";position:absolute;display:block;width:.25rem;height:.25rem;background:var(--bal-datepicker-cell-today-background);border-radius:var(--bal-datepicker-cell-today-radius);margin-left:-2px;left:50%;bottom:.375rem}.bal-datepicker-grid__cell--today.bal-datepicker-grid__cell--selected:not(.bal-datepicker-grid__cell--outdated)::after{background:var(--bal-datepicker-cell-selected-today-background)}.bal-datepicker-grid__cell:last-child{margin-right:0}.bal-datepicker-grid__cell>span{font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular)}@media screen and (min-width: 769px),print{.bal-datepicker-grid__cell{min-width:3rem !important}}.bal-datepicker-grid__cell--disabled{border-color:rgba(0,0,0,0) !important;background:rgba(0,0,0,0) !important}.bal-datepicker-grid__cell--header>span{border:none;background:rgba(0,0,0,0);color:var(--bal-color-text-primary);font-weight:var(--bal-font-weight-bold);cursor:default}';var BalDatepickerStyle0=balDatepickerCss;var Datepicker=function(){function t(t){var e=this;registerInstance(this,t);this.balChange=createEvent(this,"balChange",7);this.balInput=createEvent(this,"balInput",7);this.balBlur=createEvent(this,"balBlur",7);this.balFocus=createEvent(this,"balFocus",7);this.balInputClick=createEvent(this,"balInputClick",7);this.balIconClick=createEvent(this,"balIconClick",7);this.inputId="bal-dp-".concat(datepickerIds++);this.inheritedAttributes={};this.inputValue=this.value;this.onIconClick=function(t){if(!e.disabled&&!e.readonly){e.popoverElement.toggle()}stopEventBubbling(t);e.balIconClick.emit(t)};this.onInputClick=function(t){if(!e.triggerIcon&&!e.disabled&&!e.readonly){e.popoverElement.toggle()}stopEventBubbling(t);if(!e.triggerIcon){e.balInputClick.emit(t)}};this.onPopoverChange=function(t){stopEventBubbling(t);if(e.isPopoverOpen!==t.detail){e.isPopoverOpen=t.detail;e.fireBlur(t)}};this.onInput=function(t){var i=getInputTarget(t);if(i){e.inputValue=i.value;if(i.value){e.nativeInput.value=e.formatDate(e.inputValue)}if(e.inputValue&&e.inputValue.length>=6){var r=parse(e.inputValue,e.getLocale());var a=formatDateString(r);if(isValidIsoString(a)){e.selectedDate=a;e.updatePointerDates()}}}e.balInput.emit(e.inputValue)};this.onInputChange=function(t){var i=t.target.value;var r=parse(i,e.getLocale());var a=formatDateString(r);var n=format(e.getLocale(),r);e.nativeInput.value=n;e.updateValue(a);e.updatePointerDates()};this.onClickDateCell=function(t){if(!t.isDisabled){e.select(t.dateString)}};this.onInputKeyUp=function(t){if(isSpaceKey(t)&&!e.triggerIcon){if(e.isPopoverOpen){e.close()}else{e.open()}}if(isEnterKey(t)&&!e.triggerIcon){var i=parse(e.nativeInput.value,e.getLocale());var r=formatDateString(i);if(e.isPopoverOpen){if(e.value===r){e.close()}}}};this.onInputKeyDown=function(t){var i=dateSeparator(e.getLocale());var r=__spreadArray(__spreadArray(__spreadArray([],NUMBER_KEYS,true),[i],false),ACTION_KEYS,true);if(!isCtrlOrCommandKey(t)&&r.indexOf(t.key)<0){t.preventDefault();t.stopPropagation()}if(t.key==="Tab"){e.close()}};this.onMonthSelect=function(t){var i=t.target.value;e.pointerDate=Object.assign(Object.assign({},e.pointerDate),{day:1,month:parseInt(i,10)})};this.onYearSelect=function(t){var i=t.target.value;var r=parseInt(i,10);var a=undefined;if(e.defaultDate){var n=parse(e.defaultDate);if(e.max){var s=parse(e.max);if(n.getMonth()>s.getMonth()){a=s.getMonth()}}if(e.min){var o=parse(e.min);if(n.getMonth()<o.getMonth()){a=o.getMonth()}}}e.pointerDate={day:1,year:r,month:a!==undefined?a:e.pointerDate.month}};this.onInputFocus=function(t){return inputHandleFocus(e,t)};this.onInputBlur=function(t){preventDefault(t);e.focused=false;e.fireBlur(t)};this.fireBlur=function(t){if(!e.isPopoverOpen&&!e.focused){rIC((function(){return e.balBlur.emit(t)}))}};this.handleClick=function(t){return inputHandleHostClick(e,t)};this.language=defaultConfig.language;this.region=defaultConfig.region;this.isMobile=balBreakpoints.isMobile;this.focused=false;this.isPopoverOpen=false;this.selectedDate="";this.pointerDate={year:getYear(now()),month:getMonth(now()),day:getDate(now())};this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.loading=false;this.placeholder=undefined;this.min=undefined;this.max=undefined;this.closeOnSelect=true;this.triggerIcon=false;this.minYearProp=undefined;this.maxYearProp=undefined;this.debounce=0;this.defaultDate=undefined;this.value=undefined;this.allowedDates=undefined;this.autoInvalidOff=false}t.prototype.createLogger=function(t){this.log=t};t.prototype.debounceChanged=function(){this.balChange=debounceEvent(this.balChange,this.debounce)};t.prototype.valueChanged=function(){this.selectedDate=this.value;this.updatePointerDates()};t.prototype.listenOnClick=function(t){inputListenOnClick(this,t)};t.prototype.resetHandler=function(t){var e=this;var i=t.target;if(i===null||i===void 0?void 0:i.contains(this.el)){if(this.resetHandlerTimer){clearTimeout(this.resetHandlerTimer)}this.resetHandlerTimer=setTimeout((function(){if(e.initialValue){e.nativeInput.value=format(e.getLocale(),parse(e.initialValue))}else{e.nativeInput.value=""}e.selectedDate=e.initialValue;e.updateValue(e.initialValue,false);e.updatePointerDates()}),0)}};t.prototype.breakpointListener=function(t){this.isMobile=t.mobile};t.prototype.connectedCallback=function(){this.debounceChanged();this.initialValue=this.value};t.prototype.componentDidLoad=function(){this.inputValue=this.value};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title"]);this.selectedDate=this.value;this.updatePointerDates();this.updateValue(this.value,false)};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;this.region=t.region;return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.disabled&&this.popoverElement){this.popoverElement.present()}return[2]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.disabled&&this.popoverElement){this.popoverElement.dismiss()}return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:this.nativeInput.value=format(this.getLocale(),parse(t));this.updateValue(t);this.updatePointerDates();if(!this.closeOnSelect)return[3,2];return[4,(e=this.popoverElement)===null||e===void 0?void 0:e.toggle()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){inputSetFocus(this);return[2]}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){inputSetBlur(this);return[2]}))}))};t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.ariaForm=Object.assign({},t);return[2]}))}))};t.prototype.updatePointerDates=function(){var t=now();t.setDate(1);if(this.selectedDate){t=parse(this.selectedDate)}else{if(this.defaultDate){t=parse(this.defaultDate)}}if(this.min){var e=parse(this.min);if(e&&t<e){t=e}}if(this.max){var i=parse(this.max);if(i&&t>i){t=i}}this.pointerDate={year:getYear(t),month:getMonth(t),day:getDate(t)}};t.prototype.updateValue=function(t,e){if(e===void 0){e=true}if(!isValidIsoString(t)){this.selectedDate=undefined;this.value=undefined;if(this.nativeInput){this.nativeInput.value=""}}if(this.value!==t){this.value=t;if(e&&(this.isDateInRange(parse(this.value))||this.value==="")){this.balChange.emit(this.value)}}};Object.defineProperty(t.prototype,"minYear",{get:function(){if(this.min){return parseInt(this.min.substring(0,4),10)}return this.minYearProp?this.minYearProp:getYear(subYears(now(),100))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxYear",{get:function(){if(this.max){return parseInt(this.max.substring(0,4),10)}return this.maxYearProp?this.maxYearProp:getYear(addYears(now(),100))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"years",{get:function(){var t=this;var e=Array.from({length:this.maxYear-this.minYear+1},(function(e,i){return t.minYear+i}));if(this.min&&this.pointerDate.month===getMonth(parse(this.min))){var i=getYear(parse(this.min));e=e.filter((function(t){return t>=i}))}if(this.max&&this.pointerDate.month===getMonth(parse(this.max))){var r=getYear(parse(this.max));e=e.filter((function(t){return t<=r}))}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"months",{get:function(){var t=i18nBalDatepicker[this.language].monthsShort;var e=t.map((function(t,e){return{name:t,index:e}}));if(this.min&&this.pointerDate.year===getYear(parse(this.min))){var i=parseInt(this.min.substring(5,7),10)-1;e=e.filter((function(t){return t.index>=i}))}if(this.max&&this.pointerDate.year===getYear(parse(this.max))){var r=parseInt(this.max.substring(5,7),10)-1;e=e.filter((function(t){return t.index<=r}))}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"weekDays",{get:function(){var t=__spreadArray([],i18nBalDatepicker[this.language].weekdaysMin,true);t.push(t.shift()||"");return t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"firstDateOfBox",{get:function(){var t=new Date(this.pointerDate.year,this.pointerDate.month,1);return startOfWeek(t,{weekStartsOn:1})},enumerable:false,configurable:true});t.prototype.getLocale=function(){var t=useBalConfig();return t&&t.locale||defaultLocale};Object.defineProperty(t.prototype,"calendarGrid",{get:function(){var t=this.firstDateOfBox;var e=this.firstDateOfBox;var i=[];do{var r=[];do{r=__spreadArray(__spreadArray([],r,true),[{date:new Date(e),display:format(this.getLocale(),e),dateString:formatDateString(e),label:getDate(e).toString(),isToday:isSameDay(e,now()),isSelected:parse(this.selectedDate)!==undefined&&isSameDay(e,parse(this.selectedDate)),isDisabled:!this.getAllowedDates(e)||!this.isDateInRange(e),isOutdated:this.pointerDate.month!==e.getMonth()||!this.isDateInRange(e)}],false);e.setDate(e.getDate()+1)}while(isSameWeek(e,t,{weekStartsOn:1}));i=__spreadArray(__spreadArray([],i,true),[r],false);t.setDate(t.getDate()+7)}while(isSameMonth(new Date(this.pointerDate.year,this.pointerDate.month,this.pointerDate.day),e));return i},enumerable:false,configurable:true});t.prototype.getAllowedDates=function(t){if(lodash_isnil(this.allowedDates)){return true}return this.allowedDates(formatDateString(t))};t.prototype.formatDate=function(t){var e=dateSeparator(this.getLocale());var i=t.length;var r=t.charAt(i-1);var a=t.charAt(i-2);if(r===e){if(i===1||a===e||t.split(e).filter((function(t){return t.length>0})).length>=3){return t.substring(0,i-1)}}if(i===5){if(t.split(e)[0].split("").length===1&&a!==e&&r!==e){return t.substring(0,i-1)+e+t.substring(i-1,i)}}if(i===3||i===6){if(r!==e&&a!==e&&t.split(e).length<=2){return t.substring(0,i-1)+e+t.substring(i-1,i)}}return t};t.prototype.render=function(){var t=this;var e=BEM.block("datepicker");var i=e.element("native");var r=e.element("popup");var a=r.element("body");var n=r.element("footer");return h(Host,{onClick:this.handleClick,"aria-disabled":this.disabled?"true":null,class:Object.assign(Object.assign({},e.class()),e.modifier("disabled").class(this.disabled||this.readonly))},h("input",{type:"date",class:Object.assign({},i.class()),name:this.name,min:this.min,max:this.max,value:this.value,tabindex:-1,"aria-hidden":"true"}),h("bal-popover",{onBalChange:this.onPopoverChange,ref:function(e){return t.popoverElement=e}},this.renderInput(),h("bal-popover-content",{spaceless:true,contentMinWidth:392},h("div",{class:Object.assign({},r.class())},this.renderHeader(),h("div",{class:Object.assign({},a.class())},this.renderGrid()),h("div",{class:Object.assign({},n.class())},h("slot",null))))))};t.prototype.renderInput=function(){var t=this;return h("div",{"bal-popover-trigger":true,class:"control"},h("bal-input-group",{disabled:this.disabled||this.readonly,invalid:this.invalid},h("input",Object.assign({class:{input:true,"data-test-input":true,"is-clickable":!this.disabled&&!this.triggerIcon&&!this.readonly,"is-disabled":this.disabled||this.readonly,"is-danger":this.invalid},"data-testid":"bal-datepicker-input",ref:function(e){return t.nativeInput=e},id:this.ariaForm.controlId||this.inputId,"aria-labelledby":this.ariaForm.labelId,"aria-describedby":this.ariaForm.messageId,"aria-invalid":this.invalid===true?"true":"false","aria-disabled":this.disabled?"true":null,type:"text",maxlength:"10",autoComplete:"off",value:format(this.getLocale(),parse(this.value||"")),required:this.required,disabled:this.disabled,readonly:this.readonly,placeholder:this.placeholder,onKeyDown:function(e){return t.onInputKeyDown(e)},onKeyUp:function(e){return t.onInputKeyUp(e)},onInput:this.onInput,onClick:this.onInputClick,onChange:this.onInputChange,onBlur:this.onInputBlur,onFocus:this.onInputFocus},this.inheritedAttributes)),!this.loading?h("bal-icon",{class:{"datepicker-trigger-icon":true,"is-clickable":!this.disabled&&!this.readonly},"is-right":true,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",name:"date",onClick:this.onIconClick}):""))};t.prototype.renderGrid=function(){var t=this;var e=BEM.block("datepicker-grid");var i=e.element("row");var r=e.element("cell");return h("div",null,this.renderWeekDayHeader(),h("div",{class:Object.assign({},e.class())},this.calendarGrid.map((function(e,a){return h("div",{key:a,class:Object.assign({},i.class())},e.map((function(e){return h("button",{key:e.dateString,type:"button","data-date":e.dateString,onClick:function(){return t.onClickDateCell(e)},disabled:e.isDisabled,class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r.class()),{button:true,"is-text":!e.isDisabled&&!e.isSelected,"is-primary":e.isSelected&&e.isSelected,"is-disabled":e.isDisabled||e.isOutdated}),r.modifier("today").class(e.isToday)),r.modifier("selectable").class(!e.isDisabled&&!e.isOutdated)),r.modifier("disabled").class(e.isDisabled||e.isOutdated)),r.modifier("outdated").class(e.isOutdated)),r.modifier("selected").class(e.isSelected))},h("span",null,e.label))})))}))))};t.prototype.renderWeekDayHeader=function(){var t=BEM.block("datepicker-grid");var e=t.element("header");var i=t.element("cell");return h("header",{class:Object.assign({},e.class())},this.weekDays.map((function(t){return h("div",{key:t,class:Object.assign(Object.assign({},i.class()),i.modifier("header").class())},h("span",null,t))})))};t.prototype.renderHeader=function(){var t=this;var e=BEM.block("datepicker-pagination");var i=e.element("inner");var r=e.element("month-and-year");var a=r.element("select");return h("header",{class:Object.assign({},e.class())},h("div",{class:Object.assign({},i.class())},h("bal-button",{square:true,size:this.isMobile?"small":"",color:"info",icon:"nav-go-left",disabled:this.isPreviousMonthDisabled,onClick:function(){return t.previousMonth()}}),h("div",{class:Object.assign({},r.class())},h("div",{class:Object.assign(Object.assign({},a.class()),a.modifier("month").class())},h("div",{class:"select"},h("select",{onInput:this.onMonthSelect},this.months.map((function(e){return h("option",{key:e.index,value:e.index,selected:t.pointerDate.month===e.index},e.name)}))))),h("div",{class:Object.assign(Object.assign({},a.class()),a.modifier("year").class())},h("div",{class:"select"},h("select",{onInput:this.onYearSelect},this.years.map((function(e){return h("option",{key:e,value:e,selected:t.pointerDate.year===e},e)})))))),h("bal-button",{square:true,size:this.isMobile?"small":"",color:"info",icon:"nav-go-right",disabled:this.isNextMonthDisabled,onClick:function(){return t.nextMonth()}})))};t.prototype.previousMonth=function(){if(!this.isPreviousMonthDisabled){if(this.pointerDate.year===this.minYear&&this.pointerDate.month===0){return}this.pointerDate=this.calcPreviousMonth()}};t.prototype.nextMonth=function(){if(!this.isNextMonthDisabled){if(this.pointerDate.year===this.maxYear&&this.pointerDate.month===11){return}this.pointerDate=this.calcNextMonth()}};t.prototype.calcPreviousMonth=function(){if(this.pointerDate.month===0){return Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year-1,month:11,day:1})}else{return Object.assign(Object.assign({},this.pointerDate),{month:this.pointerDate.month-1,day:1})}};t.prototype.calcNextMonth=function(){if(this.pointerDate.month===11){return Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year+1,month:0,day:1})}else{return Object.assign(Object.assign({},this.pointerDate),{month:this.pointerDate.month+1,day:1})}};t.prototype.lastDayOfMonth=function(t,e){var i=new Date(t,e+1,0);return getDate(i)};Object.defineProperty(t.prototype,"isPreviousMonthDisabled",{get:function(){if(this.min){var t=parse(this.min);var e=this.lastDayOfMonth(this.calcPreviousMonth().year,this.calcPreviousMonth().month);var i=new Date(this.calcPreviousMonth().year,this.calcPreviousMonth().month,e);return isBefore(i,subDays(t,1))}return false},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isNextMonthDisabled",{get:function(){if(this.max){var t=parse(this.max);var e=new Date(this.calcNextMonth().year,this.calcNextMonth().month,1);return isAfter(e,lastDayOfMonth(t)?t:addDays(t,1))}return false},enumerable:false,configurable:true});t.prototype.isDateInRange=function(t){var e=parse(formatDateString(t));if(this.min&&this.max&&this.max>this.min){return isWithinInterval(e,{start:parse(this.min),end:parse(this.max)})}if(this.min){return isAfter(e,parse(this.min))||isSameDay(e,parse(this.min))}if(this.max){return isBefore(e,addDays(parse(this.max),1))||isSameDay(e,parse(this.max))}return true};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{debounce:["debounceChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-datepicker"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Datepicker.prototype,"createLogger",null);__decorate([ListenToBreakpoints(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],Datepicker.prototype,"breakpointListener",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Datepicker.prototype,"configChanged",null);var datepickerIds=0;Datepicker.style=BalDatepickerStyle0;export{Datepicker as bal_datepicker};
|
|
1
|
+
import{__awaiter,__generator,__spreadArray}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-b6003bc7.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-654e2c24.js";import{k as rIC,m as debounceEvent}from"./helpers-c201154e.js";import{i as inheritAttributes}from"./attributes-4fa7040f.js";import{r as requiredArgs,t as toDate,b as toInteger,g as getDefaultOptions,p as parse,f as formatDateString,i as isValidIsoString,c as format,e as isSpaceKey,h as isEnterKey,d as dateSeparator,j as getYear,n as now,k as getMonth,m as getDate}from"./index.esm-76abd8e3.js";import{l as lodash_isnil}from"./index-82aff103.js";import{N as NUMBER_KEYS,A as ACTION_KEYS,i as isCtrlOrCommandKey}from"./keys.constant-0eb059e0.js";import{i as i18nBalDatepicker}from"./bal-datepicker.i18n-63a3cb67.js";import{s as stopEventBubbling,g as getInputTarget,i as inputHandleFocus,a as inputHandleHostClick,b as inputListenOnClick,c as inputSetFocus,d as inputSetBlur}from"./form-input-28a08ec5.js";import{p as preventDefault}from"./utils-9fbab1d3.js";import{B as BEM}from"./bem-8c7d2eb0.js";import{L as Logger}from"./log-dfd1c19f.js";import{d as defaultBalAriaForm}from"./form-fb8dd9f5.js";import{d as defaultConfig,a as defaultLocale}from"./config.default-7efdc82d.js";import{b as balBreakpoints}from"./breakpoints.subject-23463a68.js";import{g as useBalConfig}from"./config.utils-6ac6c9bd.js";import{L as ListenToBreakpoints}from"./breakpoints.decorator-35deac22.js";import{L as ListenToConfig}from"./config.decorator-d18abfe1.js";import"./browser-a8073d92.js";import"./icons.constant-a7885631.js";import"./_commonjsHelpers-1c8beb5f.js";import"./device-8c6d2881.js";import"./listener-04842ae9.js";import"./tokens.esm-225678ae.js";function addDays(t,e){requiredArgs(2,arguments);var i=toDate(t);var a=toInteger(e);if(isNaN(a)){return new Date(NaN)}if(!a){return i}i.setDate(i.getDate()+a);return i}function addMonths(t,e){requiredArgs(2,arguments);var i=toDate(t);var a=toInteger(e);if(isNaN(a)){return new Date(NaN)}if(!a){return i}var r=i.getDate();var n=new Date(i.getTime());n.setMonth(i.getMonth()+a+1,0);var s=n.getDate();if(r>=s){return n}else{i.setFullYear(n.getFullYear(),n.getMonth(),r);return i}}function startOfWeek(t,e){var i,a,r,n,s,o,l,d;requiredArgs(1,arguments);var c=getDefaultOptions();var u=toInteger((i=(a=(r=(n=e===null||e===void 0?void 0:e.weekStartsOn)!==null&&n!==void 0?n:e===null||e===void 0?void 0:(s=e.locale)===null||s===void 0?void 0:(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:c.weekStartsOn)!==null&&a!==void 0?a:(l=c.locale)===null||l===void 0?void 0:(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&i!==void 0?i:0);if(!(u>=0&&u<=6)){throw new RangeError("weekStartsOn must be between 0 and 6 inclusively")}var h=toDate(t);var f=h.getDay();var p=(f<u?7:0)+f-u;h.setDate(h.getDate()-p);h.setHours(0,0,0,0);return h}function startOfDay(t){requiredArgs(1,arguments);var e=toDate(t);e.setHours(0,0,0,0);return e}function addYears(t,e){requiredArgs(2,arguments);var i=toInteger(e);return addMonths(t,i*12)}function isSameDay(t,e){requiredArgs(2,arguments);var i=startOfDay(t);var a=startOfDay(e);return i.getTime()===a.getTime()}function lastDayOfMonth(t){requiredArgs(1,arguments);var e=toDate(t);var i=e.getMonth();e.setFullYear(e.getFullYear(),i+1,0);e.setHours(0,0,0,0);return e}function isAfter(t,e){requiredArgs(2,arguments);var i=toDate(t);var a=toDate(e);return i.getTime()>a.getTime()}function isBefore(t,e){requiredArgs(2,arguments);var i=toDate(t);var a=toDate(e);return i.getTime()<a.getTime()}function isSameWeek(t,e,i){requiredArgs(2,arguments);var a=startOfWeek(t,i);var r=startOfWeek(e,i);return a.getTime()===r.getTime()}function isSameMonth(t,e){requiredArgs(2,arguments);var i=toDate(t);var a=toDate(e);return i.getFullYear()===a.getFullYear()&&i.getMonth()===a.getMonth()}function isWithinInterval(t,e){requiredArgs(2,arguments);var i=toDate(t).getTime();var a=toDate(e.start).getTime();var r=toDate(e.end).getTime();if(!(a<=r)){throw new RangeError("Invalid interval")}return i>=a&&i<=r}function subDays(t,e){requiredArgs(2,arguments);var i=toInteger(e);return addDays(t,-i)}function subYears(t,e){requiredArgs(2,arguments);var i=toInteger(e);return addYears(t,-i)}var balDatepickerCss=':root{--bal-datepicker-popover-background:var(--bal-color-grey-2);--bal-datepicker-cell-background:var(--bal-color-white);--bal-datepicker-cell-selected-background:var(--bal-color-primary);--bal-datepicker-cell-selected-today-background:var(--bal-color-white);--bal-datepicker-cell-today-background:var(--bal-color-primary);--bal-datepicker-cell-today-radius:var(--bal-radius-rounded)}.bal-datepicker{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-datepicker__native{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-datepicker__popup{padding:1rem;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--bal-datepicker-popover-background)}@media screen and (min-width: 769px),print{.bal-datepicker__popup{max-width:24.5rem}}.bal-datepicker__popup__body{max-width:22.5rem;margin:0 auto 0 auto;margin-top:.75rem}.bal-datepicker-pagination{max-width:22.5rem;margin:0 auto 0 auto}.bal-datepicker-pagination__inner{display:-ms-flexbox;display:flex;gap:.5rem}.bal-datepicker-pagination__month-and-year{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;gap:.5rem}.bal-datepicker-pagination__month-and-year__select{-ms-flex:1;flex:1}.bal-datepicker-pagination__month-and-year__select .select,.bal-datepicker-pagination__month-and-year__select .select select{padding-top:0 !important;padding-bottom:0 !important;text-align:center !important;min-height:2rem !important;height:2rem !important}@media screen and (min-width: 769px),print{.bal-datepicker-pagination__month-and-year__select .select,.bal-datepicker-pagination__month-and-year__select .select select{min-height:3rem !important;height:3rem !important}}.bal-datepicker-grid{display:table;border-collapse:collapse;width:100%;table-layout:fixed}.bal-datepicker-grid__body{display:table-row-group}.bal-datepicker-grid__row{display:table-row}.bal-datepicker-grid__row .bal-datepicker-grid__cell{margin-bottom:.25rem;margin-right:.25rem}.bal-datepicker-grid__row:last-child .bal-datepicker-grid__cell{margin-bottom:0}.bal-datepicker-grid__header{display:-ms-flexbox;display:flex;max-width:22.5rem;margin:0 auto 0 auto;gap:.25rem}.bal-datepicker-grid__header .bal-datepicker-grid__cell{background:rgba(0,0,0,0)}.bal-datepicker-grid__header .bal-datepicker-grid__cell span{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:100%;width:100%}.bal-datepicker-grid__cell{position:relative;text-align:center;vertical-align:middle;display:table-cell;width:13%;padding:0 !important;height:3rem;min-height:3rem;min-width:2.25rem;-webkit-appearance:auto !important;-moz-appearance:auto !important;appearance:auto !important;background:var(--bal-datepicker-cell-background)}.bal-datepicker-grid__cell--selected{background:var(--bal-datepicker-cell-selected-background) !important}.bal-datepicker-grid__cell--today:not(.bal-datepicker-grid__cell--outdated)>span{font-weight:var(--bal-font-weight-bold)}.bal-datepicker-grid__cell--today:not(.bal-datepicker-grid__cell--outdated)::after{content:"";position:absolute;display:block;width:.25rem;height:.25rem;background:var(--bal-datepicker-cell-today-background);border-radius:var(--bal-datepicker-cell-today-radius);margin-left:-2px;left:50%;bottom:.375rem}.bal-datepicker-grid__cell--today.bal-datepicker-grid__cell--selected:not(.bal-datepicker-grid__cell--outdated)::after{background:var(--bal-datepicker-cell-selected-today-background)}.bal-datepicker-grid__cell:last-child{margin-right:0}.bal-datepicker-grid__cell>span{font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular)}@media screen and (min-width: 769px),print{.bal-datepicker-grid__cell{min-width:3rem !important}}.bal-datepicker-grid__cell--disabled{border-color:rgba(0,0,0,0) !important;background:rgba(0,0,0,0) !important}.bal-datepicker-grid__cell--header>span{border:none;background:rgba(0,0,0,0);color:var(--bal-color-text-primary);font-weight:var(--bal-font-weight-bold);cursor:default}';var BalDatepickerStyle0=balDatepickerCss;var Datepicker=function(){function t(t){var e=this;registerInstance(this,t);this.balChange=createEvent(this,"balChange",7);this.balInput=createEvent(this,"balInput",7);this.balBlur=createEvent(this,"balBlur",7);this.balFocus=createEvent(this,"balFocus",7);this.balInputClick=createEvent(this,"balInputClick",7);this.balIconClick=createEvent(this,"balIconClick",7);this.inputId="bal-dp-".concat(datepickerIds++);this.inheritedAttributes={};this.inputValue=this.value;this.onIconClick=function(t){if(!e.disabled&&!e.readonly){e.popoverElement.toggle()}stopEventBubbling(t);e.balIconClick.emit(t)};this.onInputClick=function(t){if(!e.triggerIcon&&!e.disabled&&!e.readonly){e.popoverElement.toggle()}stopEventBubbling(t);if(!e.triggerIcon){e.balInputClick.emit(t)}};this.onPopoverChange=function(t){stopEventBubbling(t);if(e.isPopoverOpen!==t.detail){e.isPopoverOpen=t.detail;e.fireBlur(t)}};this.onInput=function(t){var i=getInputTarget(t);if(i){e.inputValue=i.value;if(i.value){e.nativeInput.value=e.formatDate(e.inputValue)}if(e.inputValue&&e.inputValue.length>=6){var a=parse(e.inputValue,e.getLocale());var r=formatDateString(a);if(isValidIsoString(r)){e.selectedDate=r;e.updatePointerDates()}}}e.balInput.emit(e.inputValue)};this.onInputChange=function(t){var i=t.target.value;var a=parse(i,e.getLocale());var r=formatDateString(a);var n=format(e.getLocale(),a);e.nativeInput.value=n;e.updateValue(r);e.updatePointerDates()};this.onClickDateCell=function(t){if(!t.isDisabled){e.select(t.dateString)}};this.onInputKeyUp=function(t){if(isSpaceKey(t)&&!e.triggerIcon){if(e.isPopoverOpen){e.close()}else{e.open()}}if(isEnterKey(t)&&!e.triggerIcon){var i=parse(e.nativeInput.value,e.getLocale());var a=formatDateString(i);if(e.isPopoverOpen){if(e.value===a){e.close()}}}};this.onInputKeyDown=function(t){var i=dateSeparator(e.getLocale());var a=__spreadArray(__spreadArray(__spreadArray([],NUMBER_KEYS,true),[i],false),ACTION_KEYS,true);if(!isCtrlOrCommandKey(t)&&a.indexOf(t.key)<0){t.preventDefault();t.stopPropagation()}if(t.key==="Tab"){e.close()}};this.onMonthSelect=function(t){var i=t.target.value;e.pointerDate=Object.assign(Object.assign({},e.pointerDate),{day:1,month:parseInt(i,10)})};this.onYearSelect=function(t){var i=t.target.value;var a=parseInt(i,10);var r=undefined;if(e.defaultDate){var n=parse(e.defaultDate);if(e.max){var s=parse(e.max);if(n.getMonth()>s.getMonth()){r=s.getMonth()}}if(e.min){var o=parse(e.min);if(n.getMonth()<o.getMonth()){r=o.getMonth()}}}e.pointerDate={day:1,year:a,month:r!==undefined?r:e.pointerDate.month}};this.onInputFocus=function(t){return inputHandleFocus(e,t)};this.onInputBlur=function(t){preventDefault(t);e.focused=false;e.fireBlur(t)};this.fireBlur=function(t){if(!e.isPopoverOpen&&!e.focused){rIC((function(){return e.balBlur.emit(t)}))}};this.handleClick=function(t){return inputHandleHostClick(e,t)};this.language=defaultConfig.language;this.region=defaultConfig.region;this.isMobile=balBreakpoints.isMobile;this.focused=false;this.isPopoverOpen=false;this.selectedDate="";this.pointerDate={year:getYear(now()),month:getMonth(now()),day:getDate(now())};this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.loading=false;this.placeholder=undefined;this.min=undefined;this.max=undefined;this.closeOnSelect=true;this.triggerIcon=false;this.minYearProp=undefined;this.maxYearProp=undefined;this.debounce=0;this.defaultDate=undefined;this.value=undefined;this.allowedDates=undefined;this.autoInvalidOff=false}t.prototype.createLogger=function(t){this.log=t};t.prototype.debounceChanged=function(){this.balChange=debounceEvent(this.balChange,this.debounce)};t.prototype.valueChanged=function(){this.selectedDate=this.value;this.updatePointerDates()};t.prototype.listenOnClick=function(t){inputListenOnClick(this,t)};t.prototype.resetHandler=function(t){var e=this;var i=t.target;if(i===null||i===void 0?void 0:i.contains(this.el)){if(this.resetHandlerTimer){clearTimeout(this.resetHandlerTimer)}this.resetHandlerTimer=setTimeout((function(){if(e.initialValue){e.nativeInput.value=format(e.getLocale(),parse(e.initialValue))}else{e.nativeInput.value=""}e.selectedDate=e.initialValue;e.updateValue(e.initialValue,false);e.updatePointerDates()}),0)}};t.prototype.breakpointListener=function(t){this.isMobile=t.mobile};t.prototype.connectedCallback=function(){this.debounceChanged();this.initialValue=this.value};t.prototype.componentDidLoad=function(){this.inputValue=this.value};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title"]);this.selectedDate=this.value;this.updatePointerDates();this.updateValue(this.value,false)};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;this.region=t.region;return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.disabled&&this.popoverElement){this.popoverElement.present()}return[2]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.disabled&&this.popoverElement){this.popoverElement.dismiss()}return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:this.nativeInput.value=format(this.getLocale(),parse(t));this.updateValue(t);this.updatePointerDates();if(!this.closeOnSelect)return[3,2];return[4,(e=this.popoverElement)===null||e===void 0?void 0:e.toggle()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){inputSetFocus(this);return[2]}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){inputSetBlur(this);return[2]}))}))};t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.ariaForm=Object.assign({},t);return[2]}))}))};t.prototype.updatePointerDates=function(){var t=now();t.setDate(1);if(this.selectedDate){t=parse(this.selectedDate)}else{if(this.defaultDate){t=parse(this.defaultDate)}}if(this.min){var e=parse(this.min);if(e&&t<e){t=e}}if(this.max){var i=parse(this.max);if(i&&t>i){t=i}}this.pointerDate={year:getYear(t),month:getMonth(t),day:getDate(t)}};t.prototype.updateValue=function(t,e){if(e===void 0){e=true}if(!isValidIsoString(t)){this.selectedDate=undefined;this.value=undefined;if(this.nativeInput){this.nativeInput.value=""}}if(this.value!==t){this.value=t;if(e&&(this.isDateInRange(parse(this.value))||this.value==="")){this.balChange.emit(this.value)}}};Object.defineProperty(t.prototype,"minYear",{get:function(){if(this.min){return parseInt(this.min.substring(0,4),10)}return this.minYearProp?this.minYearProp:getYear(subYears(now(),100))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxYear",{get:function(){if(this.max){return parseInt(this.max.substring(0,4),10)}return this.maxYearProp?this.maxYearProp:getYear(addYears(now(),100))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"years",{get:function(){var t=this;var e=Array.from({length:this.maxYear-this.minYear+1},(function(e,i){return t.minYear+i}));if(this.min&&this.pointerDate.month===getMonth(parse(this.min))){var i=getYear(parse(this.min));e=e.filter((function(t){return t>=i}))}if(this.max&&this.pointerDate.month===getMonth(parse(this.max))){var a=getYear(parse(this.max));e=e.filter((function(t){return t<=a}))}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"months",{get:function(){var t=i18nBalDatepicker[this.language].monthsShort;var e=t.map((function(t,e){return{name:t,index:e}}));if(this.min&&this.pointerDate.year===getYear(parse(this.min))){var i=parseInt(this.min.substring(5,7),10)-1;e=e.filter((function(t){return t.index>=i}))}if(this.max&&this.pointerDate.year===getYear(parse(this.max))){var a=parseInt(this.max.substring(5,7),10)-1;e=e.filter((function(t){return t.index<=a}))}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"weekDays",{get:function(){var t=__spreadArray([],i18nBalDatepicker[this.language].weekdaysMin,true);t.push(t.shift()||"");return t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"firstDateOfBox",{get:function(){var t=new Date(this.pointerDate.year,this.pointerDate.month,1);return startOfWeek(t,{weekStartsOn:1})},enumerable:false,configurable:true});t.prototype.getLocale=function(){var t=useBalConfig();return t&&t.locale||defaultLocale};Object.defineProperty(t.prototype,"calendarGrid",{get:function(){var t=this.firstDateOfBox;var e=this.firstDateOfBox;var i=[];do{var a=[];do{a=__spreadArray(__spreadArray([],a,true),[{date:new Date(e),display:format(this.getLocale(),e),dateString:formatDateString(e),label:getDate(e).toString(),isToday:isSameDay(e,now()),isSelected:parse(this.selectedDate)!==undefined&&isSameDay(e,parse(this.selectedDate)),isDisabled:!this.getAllowedDates(e)||!this.isDateInRange(e),isOutdated:this.pointerDate.month!==e.getMonth()||!this.isDateInRange(e)}],false);e.setDate(e.getDate()+1)}while(isSameWeek(e,t,{weekStartsOn:1}));i=__spreadArray(__spreadArray([],i,true),[a],false);t.setDate(t.getDate()+7)}while(isSameMonth(new Date(this.pointerDate.year,this.pointerDate.month,this.pointerDate.day),e));return i},enumerable:false,configurable:true});t.prototype.getAllowedDates=function(t){if(lodash_isnil(this.allowedDates)){return true}return this.allowedDates(formatDateString(t))};t.prototype.formatDate=function(t){var e=dateSeparator(this.getLocale());var i=t.length;var a=t.charAt(i-1);var r=t.charAt(i-2);if(a===e){if(i===1||r===e||t.split(e).filter((function(t){return t.length>0})).length>=3){return t.substring(0,i-1)}}if(i===5){if(t.split(e)[0].split("").length===1&&r!==e&&a!==e){return t.substring(0,i-1)+e+t.substring(i-1,i)}}if(i===3||i===6){if(a!==e&&r!==e&&t.split(e).length<=2){return t.substring(0,i-1)+e+t.substring(i-1,i)}}return t};t.prototype.render=function(){var t=this;var e=BEM.block("datepicker");var i=e.element("native");var a=e.element("popup");var r=a.element("body");var n=a.element("footer");return h(Host,{onClick:this.handleClick,"aria-disabled":this.disabled?"true":null,class:Object.assign(Object.assign({},e.class()),e.modifier("disabled").class(this.disabled||this.readonly))},h("input",{type:"date",class:Object.assign({},i.class()),name:this.name,min:this.min,max:this.max,value:this.value,tabindex:-1,"aria-hidden":"true"}),h("bal-popover",{onBalChange:this.onPopoverChange,ref:function(e){return t.popoverElement=e}},this.renderInput(),h("bal-popover-content",{spaceless:true,contentMinWidth:392},h("div",{class:Object.assign({},a.class())},this.renderHeader(),h("div",{class:Object.assign({},r.class())},this.renderGrid()),h("div",{class:Object.assign({},n.class())},h("slot",null))))))};t.prototype.renderInput=function(){var t=this;return h("div",{"bal-popover-trigger":true,class:"control"},h("bal-input-group",{disabled:this.disabled||this.readonly,invalid:this.invalid},h("input",Object.assign({class:{input:true,"data-test-input":true,"is-clickable":!this.disabled&&!this.triggerIcon&&!this.readonly,"is-disabled":this.disabled||this.readonly,"is-danger":this.invalid},"data-testid":"bal-datepicker-input",ref:function(e){return t.nativeInput=e},id:this.ariaForm.controlId||this.inputId,"aria-labelledby":this.ariaForm.labelId,"aria-describedby":this.ariaForm.messageId,"aria-invalid":this.invalid===true?"true":"false","aria-disabled":this.disabled?"true":null,type:"text",maxlength:"10",autoComplete:"off",value:format(this.getLocale(),parse(this.value||"")),required:this.required,disabled:this.disabled,readonly:this.readonly,placeholder:this.placeholder,onKeyDown:function(e){return t.onInputKeyDown(e)},onKeyUp:function(e){return t.onInputKeyUp(e)},onInput:this.onInput,onClick:this.onInputClick,onChange:this.onInputChange,onBlur:this.onInputBlur,onFocus:this.onInputFocus},this.inheritedAttributes)),!this.loading?h("bal-icon",{class:{"datepicker-trigger-icon":true,"is-clickable":!this.disabled&&!this.readonly},"is-right":true,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",name:"date",onClick:this.onIconClick}):""))};t.prototype.renderGrid=function(){var t=this;var e=BEM.block("datepicker-grid");var i=e.element("row");var a=e.element("cell");return h("div",null,this.renderWeekDayHeader(),h("div",{class:Object.assign({},e.class())},this.calendarGrid.map((function(e,r){return h("div",{key:r,class:Object.assign({},i.class())},e.map((function(e){return h("button",{key:e.dateString,type:"button","data-date":e.dateString,onClick:function(){return t.onClickDateCell(e)},disabled:e.isDisabled,class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a.class()),{button:true,"is-text":!e.isDisabled&&!e.isSelected,"is-primary":e.isSelected&&e.isSelected,"is-disabled":e.isDisabled||e.isOutdated}),a.modifier("today").class(e.isToday)),a.modifier("selectable").class(!e.isDisabled&&!e.isOutdated)),a.modifier("disabled").class(e.isDisabled||e.isOutdated)),a.modifier("outdated").class(e.isOutdated)),a.modifier("selected").class(e.isSelected))},h("span",null,e.label))})))}))))};t.prototype.renderWeekDayHeader=function(){var t=BEM.block("datepicker-grid");var e=t.element("header");var i=t.element("cell");return h("header",{class:Object.assign({},e.class())},this.weekDays.map((function(t){return h("div",{key:t,class:Object.assign(Object.assign({},i.class()),i.modifier("header").class())},h("span",null,t))})))};t.prototype.renderHeader=function(){var t=this;var e=BEM.block("datepicker-pagination");var i=e.element("inner");var a=e.element("month-and-year");var r=a.element("select");return h("header",{class:Object.assign({},e.class())},h("div",{class:Object.assign({},i.class())},h("bal-button",{square:true,size:this.isMobile?"small":"",color:"info",icon:"nav-go-left",disabled:this.isPreviousMonthDisabled,onClick:function(){return t.previousMonth()}}),h("div",{class:Object.assign({},a.class())},h("div",{class:Object.assign(Object.assign({},r.class()),r.modifier("month").class())},h("div",{class:"select"},h("select",{onInput:this.onMonthSelect},this.months.map((function(e){return h("option",{key:e.index,value:e.index,selected:t.pointerDate.month===e.index},e.name)}))))),h("div",{class:Object.assign(Object.assign({},r.class()),r.modifier("year").class())},h("div",{class:"select"},h("select",{onInput:this.onYearSelect},this.years.map((function(e){return h("option",{key:e,value:e,selected:t.pointerDate.year===e},e)})))))),h("bal-button",{square:true,size:this.isMobile?"small":"",color:"info",icon:"nav-go-right",disabled:this.isNextMonthDisabled,onClick:function(){return t.nextMonth()}})))};t.prototype.previousMonth=function(){if(!this.isPreviousMonthDisabled){if(this.pointerDate.year===this.minYear&&this.pointerDate.month===0){return}this.pointerDate=this.calcPreviousMonth()}};t.prototype.nextMonth=function(){if(!this.isNextMonthDisabled){if(this.pointerDate.year===this.maxYear&&this.pointerDate.month===11){return}this.pointerDate=this.calcNextMonth()}};t.prototype.calcPreviousMonth=function(){if(this.pointerDate.month===0){return Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year-1,month:11,day:1})}else{return Object.assign(Object.assign({},this.pointerDate),{month:this.pointerDate.month-1,day:1})}};t.prototype.calcNextMonth=function(){if(this.pointerDate.month===11){return Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year+1,month:0,day:1})}else{return Object.assign(Object.assign({},this.pointerDate),{month:this.pointerDate.month+1,day:1})}};t.prototype.lastDayOfMonth=function(t,e){var i=new Date(t,e+1,0);return getDate(i)};Object.defineProperty(t.prototype,"isPreviousMonthDisabled",{get:function(){if(this.min){var t=parse(this.min);var e=this.lastDayOfMonth(this.calcPreviousMonth().year,this.calcPreviousMonth().month);var i=new Date(this.calcPreviousMonth().year,this.calcPreviousMonth().month,e);return isBefore(i,subDays(t,1))}return false},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isNextMonthDisabled",{get:function(){if(this.max){var t=parse(this.max);var e=new Date(this.calcNextMonth().year,this.calcNextMonth().month,1);return isAfter(e,lastDayOfMonth(t)?t:addDays(t,1))}return false},enumerable:false,configurable:true});t.prototype.isDateInRange=function(t){var e=parse(formatDateString(t));if(this.min&&this.max&&this.max>this.min){return isWithinInterval(e,{start:parse(this.min),end:parse(this.max)})}if(this.min){return isAfter(e,parse(this.min))||isSameDay(e,parse(this.min))}if(this.max){return isBefore(e,addDays(parse(this.max),1))||isSameDay(e,parse(this.max))}return true};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{debounce:["debounceChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-datepicker"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Datepicker.prototype,"createLogger",null);__decorate([ListenToBreakpoints(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],Datepicker.prototype,"breakpointListener",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Datepicker.prototype,"configChanged",null);var datepickerIds=0;Datepicker.style=BalDatepickerStyle0;export{Datepicker as bal_datepicker};
|