snice 2.1.4 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/snice-accordion-item.d.ts +25 -0
- package/dist/components/accordion/snice-accordion-item.js +255 -0
- package/dist/components/accordion/snice-accordion-item.js.map +1 -0
- package/dist/components/accordion/snice-accordion.d.ts +28 -0
- package/dist/components/accordion/snice-accordion.js +206 -0
- package/dist/components/accordion/snice-accordion.js.map +1 -0
- package/dist/components/accordion/snice-accordion.types.d.ts +29 -0
- package/dist/components/alert/snice-alert.d.ts +26 -0
- package/dist/components/alert/snice-alert.js +180 -0
- package/dist/components/alert/snice-alert.js.map +1 -0
- package/{components/alert/snice-alert.types.ts → dist/components/alert/snice-alert.types.d.ts} +8 -9
- package/dist/components/avatar/snice-avatar.d.ts +24 -0
- package/dist/components/avatar/snice-avatar.js +180 -0
- package/dist/components/avatar/snice-avatar.js.map +1 -0
- package/dist/components/avatar/snice-avatar.types.d.ts +12 -0
- package/dist/components/badge/snice-badge.d.ts +25 -0
- package/dist/components/badge/snice-badge.js +169 -0
- package/dist/components/badge/snice-badge.js.map +1 -0
- package/{components/badge/snice-badge.types.ts → dist/components/badge/snice-badge.types.d.ts} +11 -12
- package/dist/components/breadcrumbs/snice-breadcrumbs.d.ts +27 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.js +214 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.js.map +1 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.types.d.ts +23 -0
- package/dist/components/breadcrumbs/snice-crumb.d.ts +9 -0
- package/dist/components/breadcrumbs/snice-crumb.js +63 -0
- package/dist/components/breadcrumbs/snice-crumb.js.map +1 -0
- package/dist/components/button/snice-button.d.ts +32 -0
- package/dist/components/button/snice-button.js +232 -0
- package/dist/components/button/snice-button.js.map +1 -0
- package/dist/components/button/snice-button.types.d.ts +23 -0
- package/dist/components/card/snice-card.d.ts +19 -0
- package/dist/components/card/snice-card.js +136 -0
- package/dist/components/card/snice-card.js.map +1 -0
- package/{components/card/snice-card.types.ts → dist/components/card/snice-card.types.d.ts} +6 -7
- package/dist/components/checkbox/snice-checkbox.d.ts +34 -0
- package/dist/components/checkbox/snice-checkbox.js +286 -0
- package/dist/components/checkbox/snice-checkbox.js.map +1 -0
- package/dist/components/checkbox/snice-checkbox.types.d.ts +20 -0
- package/dist/components/chip/snice-chip.d.ts +28 -0
- package/dist/components/chip/snice-chip.js +199 -0
- package/dist/components/chip/snice-chip.js.map +1 -0
- package/dist/components/chip/snice-chip.types.d.ts +14 -0
- package/dist/components/date-picker/snice-date-picker.d.ts +82 -0
- package/dist/components/date-picker/snice-date-picker.js +847 -0
- package/dist/components/date-picker/snice-date-picker.js.map +1 -0
- package/dist/components/date-picker/snice-date-picker.types.d.ts +71 -0
- package/dist/components/divider/snice-divider.d.ts +17 -0
- package/dist/components/divider/snice-divider.js +122 -0
- package/dist/components/divider/snice-divider.js.map +1 -0
- package/{components/divider/snice-divider.types.ts → dist/components/divider/snice-divider.types.d.ts} +9 -10
- package/dist/components/drawer/snice-drawer.d.ts +37 -0
- package/dist/components/drawer/snice-drawer.js +337 -0
- package/dist/components/drawer/snice-drawer.js.map +1 -0
- package/dist/components/drawer/snice-drawer.types.d.ts +16 -0
- package/dist/components/input/snice-input.d.ts +65 -0
- package/dist/components/input/snice-input.js +567 -0
- package/dist/components/input/snice-input.js.map +1 -0
- package/dist/components/input/snice-input.types.d.ts +53 -0
- package/dist/components/layout/snice-layout-blog.d.ts +4 -0
- package/dist/components/layout/snice-layout-blog.js +67 -0
- package/dist/components/layout/snice-layout-blog.js.map +1 -0
- package/dist/components/layout/snice-layout-card.d.ts +6 -0
- package/dist/components/layout/snice-layout-card.js +64 -0
- package/dist/components/layout/snice-layout-card.js.map +1 -0
- package/dist/components/layout/snice-layout-centered.d.ts +5 -0
- package/dist/components/layout/snice-layout-centered.js +48 -0
- package/dist/components/layout/snice-layout-centered.js.map +1 -0
- package/dist/components/layout/snice-layout-dashboard.d.ts +4 -0
- package/dist/components/layout/snice-layout-dashboard.js +64 -0
- package/dist/components/layout/snice-layout-dashboard.js.map +1 -0
- package/dist/components/layout/snice-layout-fullscreen.d.ts +5 -0
- package/dist/components/layout/snice-layout-fullscreen.js +60 -0
- package/dist/components/layout/snice-layout-fullscreen.js.map +1 -0
- package/dist/components/layout/snice-layout-landing.d.ts +4 -0
- package/dist/components/layout/snice-layout-landing.js +66 -0
- package/dist/components/layout/snice-layout-landing.js.map +1 -0
- package/dist/components/layout/snice-layout-minimal.d.ts +4 -0
- package/dist/components/layout/snice-layout-minimal.js +38 -0
- package/dist/components/layout/snice-layout-minimal.js.map +1 -0
- package/dist/components/layout/snice-layout-sidebar.d.ts +5 -0
- package/dist/components/layout/snice-layout-sidebar.js +74 -0
- package/dist/components/layout/snice-layout-sidebar.js.map +1 -0
- package/dist/components/layout/snice-layout-split.d.ts +6 -0
- package/dist/components/layout/snice-layout-split.js +58 -0
- package/dist/components/layout/snice-layout-split.js.map +1 -0
- package/dist/components/layout/snice-layout.d.ts +4 -0
- package/dist/components/layout/snice-layout.js +54 -0
- package/dist/components/layout/snice-layout.js.map +1 -0
- package/{components/layout/snice-layout.types.ts → dist/components/layout/snice-layout.types.d.ts} +1 -3
- package/dist/components/login/snice-login.d.ts +44 -0
- package/dist/components/login/snice-login.js +382 -0
- package/dist/components/login/snice-login.js.map +1 -0
- package/dist/components/login/snice-login.types.d.ts +26 -0
- package/dist/components/modal/snice-modal.d.ts +32 -0
- package/dist/components/modal/snice-modal.js +280 -0
- package/dist/components/modal/snice-modal.js.map +1 -0
- package/dist/components/modal/snice-modal.types.d.ts +18 -0
- package/dist/components/pagination/snice-pagination.d.ts +26 -0
- package/dist/components/pagination/snice-pagination.js +373 -0
- package/dist/components/pagination/snice-pagination.js.map +1 -0
- package/dist/components/pagination/snice-pagination.types.d.ts +18 -0
- package/dist/components/progress/snice-progress.d.ts +35 -0
- package/dist/components/progress/snice-progress.js +305 -0
- package/dist/components/progress/snice-progress.js.map +1 -0
- package/dist/components/progress/snice-progress.types.d.ts +18 -0
- package/dist/components/radio/snice-radio.d.ts +33 -0
- package/dist/components/radio/snice-radio.js +279 -0
- package/dist/components/radio/snice-radio.js.map +1 -0
- package/dist/components/radio/snice-radio.types.d.ts +19 -0
- package/dist/components/select/snice-option.d.ts +17 -0
- package/dist/components/select/snice-option.js +88 -0
- package/dist/components/select/snice-option.js.map +1 -0
- package/{components/select/snice-option.types.ts → dist/components/select/snice-option.types.d.ts} +8 -8
- package/dist/components/select/snice-select.d.ts +89 -0
- package/dist/components/select/snice-select.js +864 -0
- package/dist/components/select/snice-select.js.map +1 -0
- package/dist/components/select/snice-select.types.d.ts +49 -0
- package/dist/components/skeleton/snice-skeleton.d.ts +16 -0
- package/dist/components/skeleton/snice-skeleton.js +166 -0
- package/dist/components/skeleton/snice-skeleton.js.map +1 -0
- package/{components/skeleton/snice-skeleton.types.ts → dist/components/skeleton/snice-skeleton.types.d.ts} +7 -8
- package/dist/components/snice-cell-C8aBfN72.js +4 -0
- package/dist/components/snice-cell-C8aBfN72.js.map +1 -0
- package/dist/components/switch/snice-switch.d.ts +38 -0
- package/dist/components/switch/snice-switch.js +305 -0
- package/dist/components/switch/snice-switch.js.map +1 -0
- package/dist/components/switch/snice-switch.types.d.ts +21 -0
- package/dist/components/symbols.d.ts +1 -0
- package/dist/components/symbols.js +22 -0
- package/dist/components/symbols.js.map +1 -0
- package/dist/components/table/snice-cell-boolean.d.ts +21 -0
- package/dist/components/table/snice-cell-boolean.js +164 -0
- package/dist/components/table/snice-cell-boolean.js.map +1 -0
- package/dist/components/table/snice-cell-date.d.ts +24 -0
- package/dist/components/table/snice-cell-date.js +253 -0
- package/dist/components/table/snice-cell-date.js.map +1 -0
- package/dist/components/table/snice-cell-duration.d.ts +16 -0
- package/dist/components/table/snice-cell-duration.js +130 -0
- package/dist/components/table/snice-cell-duration.js.map +1 -0
- package/dist/components/table/snice-cell-filesize.d.ts +16 -0
- package/dist/components/table/snice-cell-filesize.js +126 -0
- package/dist/components/table/snice-cell-filesize.js.map +1 -0
- package/dist/components/table/snice-cell-number.d.ts +23 -0
- package/dist/components/table/snice-cell-number.js +215 -0
- package/dist/components/table/snice-cell-number.js.map +1 -0
- package/dist/components/table/snice-cell-progress.d.ts +17 -0
- package/dist/components/table/snice-cell-progress.js +121 -0
- package/dist/components/table/snice-cell-progress.js.map +1 -0
- package/dist/components/table/snice-cell-rating.d.ts +17 -0
- package/dist/components/table/snice-cell-rating.js +120 -0
- package/dist/components/table/snice-cell-rating.js.map +1 -0
- package/dist/components/table/snice-cell-sparkline.d.ts +29 -0
- package/dist/components/table/snice-cell-sparkline.js +306 -0
- package/dist/components/table/snice-cell-sparkline.js.map +1 -0
- package/dist/components/table/snice-cell-text.d.ts +19 -0
- package/dist/components/table/snice-cell-text.js +161 -0
- package/dist/components/table/snice-cell-text.js.map +1 -0
- package/dist/components/table/snice-cell.d.ts +32 -0
- package/dist/components/table/snice-cell.js +458 -0
- package/dist/components/table/snice-cell.js.map +1 -0
- package/dist/components/table/snice-column.d.ts +62 -0
- package/dist/components/table/snice-column.js +506 -0
- package/dist/components/table/snice-column.js.map +1 -0
- package/dist/components/table/snice-header.d.ts +33 -0
- package/dist/components/table/snice-header.js +289 -0
- package/dist/components/table/snice-header.js.map +1 -0
- package/dist/components/table/snice-progress.d.ts +10 -0
- package/dist/components/table/snice-progress.js +105 -0
- package/dist/components/table/snice-progress.js.map +1 -0
- package/dist/components/table/snice-rating.d.ts +9 -0
- package/dist/components/table/snice-rating.js +81 -0
- package/dist/components/table/snice-rating.js.map +1 -0
- package/dist/components/table/snice-row.d.ts +43 -0
- package/dist/components/table/snice-row.js +353 -0
- package/dist/components/table/snice-row.js.map +1 -0
- package/dist/components/table/snice-table.d.ts +69 -0
- package/dist/components/table/snice-table.js +792 -0
- package/dist/components/table/snice-table.js.map +1 -0
- package/dist/components/table/snice-table.types.d.ts +137 -0
- package/dist/components/tabs/snice-tab-panel.d.ts +12 -0
- package/dist/components/tabs/snice-tab-panel.js +87 -0
- package/dist/components/tabs/snice-tab-panel.js.map +1 -0
- package/dist/components/tabs/snice-tab.d.ts +13 -0
- package/dist/components/tabs/snice-tab.js +98 -0
- package/dist/components/tabs/snice-tab.js.map +1 -0
- package/dist/components/tabs/snice-tabs.d.ts +34 -0
- package/dist/components/tabs/snice-tabs.js +375 -0
- package/dist/components/tabs/snice-tabs.js.map +1 -0
- package/dist/components/tabs/snice-tabs.types.d.ts +23 -0
- package/dist/components/toast/snice-toast-container.d.ts +25 -0
- package/dist/components/toast/snice-toast-container.js +252 -0
- package/dist/components/toast/snice-toast-container.js.map +1 -0
- package/dist/components/toast/snice-toast.d.ts +23 -0
- package/dist/components/toast/snice-toast.js +321 -0
- package/dist/components/toast/snice-toast.js.map +1 -0
- package/dist/components/toast/snice-toast.types.d.ts +30 -0
- package/dist/components/tooltip/snice-tooltip.d.ts +50 -0
- package/dist/components/tooltip/snice-tooltip.js +644 -0
- package/dist/components/tooltip/snice-tooltip.js.map +1 -0
- package/dist/components/tooltip/snice-tooltip.types.d.ts +18 -0
- package/dist/components/transitions.d.ts +11 -0
- package/dist/components/transitions.js +72 -0
- package/dist/components/transitions.js.map +1 -0
- package/dist/index.cjs +16 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.cjs.min.map +1 -1
- package/dist/index.esm.js +16 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +3 -3
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +16 -20
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +3 -3
- package/dist/index.iife.min.js.map +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/transitions.esm.js +1 -1
- package/package.json +10 -6
- package/components/accordion/demo.html +0 -403
- package/components/accordion/snice-accordion-item.css +0 -85
- package/components/accordion/snice-accordion-item.ts +0 -226
- package/components/accordion/snice-accordion.css +0 -31
- package/components/accordion/snice-accordion.ts +0 -182
- package/components/accordion/snice-accordion.types.ts +0 -32
- package/components/alert/demo.html +0 -445
- package/components/alert/snice-alert.css +0 -195
- package/components/alert/snice-alert.ts +0 -141
- package/components/avatar/demo.html +0 -598
- package/components/avatar/snice-avatar.css +0 -131
- package/components/avatar/snice-avatar.ts +0 -136
- package/components/avatar/snice-avatar.types.ts +0 -13
- package/components/badge/demo.html +0 -523
- package/components/badge/snice-badge.css +0 -161
- package/components/badge/snice-badge.ts +0 -117
- package/components/breadcrumbs/demo.html +0 -404
- package/components/breadcrumbs/snice-breadcrumbs.css +0 -133
- package/components/breadcrumbs/snice-breadcrumbs.ts +0 -191
- package/components/breadcrumbs/snice-breadcrumbs.types.ts +0 -26
- package/components/breadcrumbs/snice-crumb.ts +0 -26
- package/components/button/demo.html +0 -42
- package/components/button/snice-button.css +0 -230
- package/components/button/snice-button.ts +0 -169
- package/components/button/snice-button.types.ts +0 -25
- package/components/card/demo.html +0 -525
- package/components/card/snice-card.css +0 -140
- package/components/card/snice-card.ts +0 -102
- package/components/checkbox/demo.html +0 -253
- package/components/checkbox/snice-checkbox.css +0 -164
- package/components/checkbox/snice-checkbox.ts +0 -223
- package/components/checkbox/snice-checkbox.types.ts +0 -22
- package/components/chip/demo.html +0 -383
- package/components/chip/snice-chip.css +0 -195
- package/components/chip/snice-chip.ts +0 -139
- package/components/chip/snice-chip.types.ts +0 -15
- package/components/date-picker/README.md +0 -233
- package/components/date-picker/demo.html +0 -191
- package/components/date-picker/snice-date-picker.css +0 -330
- package/components/date-picker/snice-date-picker.ts +0 -777
- package/components/date-picker/snice-date-picker.types.ts +0 -83
- package/components/divider/demo.html +0 -233
- package/components/divider/snice-divider.css +0 -155
- package/components/divider/snice-divider.ts +0 -69
- package/components/drawer/demo.html +0 -328
- package/components/drawer/snice-drawer.css +0 -476
- package/components/drawer/snice-drawer.ts +0 -287
- package/components/drawer/snice-drawer.types.ts +0 -17
- package/components/global.d.ts +0 -14
- package/components/input/demo.html +0 -303
- package/components/input/snice-input.css +0 -257
- package/components/input/snice-input.ts +0 -442
- package/components/input/snice-input.types.ts +0 -59
- package/components/input/test.html +0 -77
- package/components/layout/README.md +0 -260
- package/components/layout/demo.html +0 -538
- package/components/layout/snice-layout-blog.css +0 -129
- package/components/layout/snice-layout-blog.ts +0 -48
- package/components/layout/snice-layout-card.css +0 -104
- package/components/layout/snice-layout-card.ts +0 -35
- package/components/layout/snice-layout-centered.css +0 -51
- package/components/layout/snice-layout-centered.ts +0 -22
- package/components/layout/snice-layout-dashboard.css +0 -98
- package/components/layout/snice-layout-dashboard.ts +0 -45
- package/components/layout/snice-layout-fullscreen.css +0 -72
- package/components/layout/snice-layout-fullscreen.ts +0 -34
- package/components/layout/snice-layout-landing.css +0 -92
- package/components/layout/snice-layout-landing.ts +0 -47
- package/components/layout/snice-layout-minimal.css +0 -16
- package/components/layout/snice-layout-minimal.ts +0 -19
- package/components/layout/snice-layout-sidebar.css +0 -117
- package/components/layout/snice-layout-sidebar.ts +0 -48
- package/components/layout/snice-layout-split.css +0 -103
- package/components/layout/snice-layout-split.ts +0 -29
- package/components/layout/snice-layout.css +0 -72
- package/components/layout/snice-layout.ts +0 -35
- package/components/login/demo-auth-controller.ts +0 -185
- package/components/login/demo.html +0 -470
- package/components/login/snice-login.css +0 -204
- package/components/login/snice-login.ts +0 -326
- package/components/login/snice-login.types.ts +0 -29
- package/components/modal/demo.html +0 -291
- package/components/modal/snice-modal.css +0 -203
- package/components/modal/snice-modal.ts +0 -233
- package/components/modal/snice-modal.types.ts +0 -21
- package/components/pagination/demo.html +0 -395
- package/components/pagination/snice-pagination.ts +0 -333
- package/components/pagination/snice-pagination.types.ts +0 -21
- package/components/progress/demo.html +0 -510
- package/components/progress/snice-progress.css +0 -267
- package/components/progress/snice-progress.ts +0 -247
- package/components/progress/snice-progress.types.ts +0 -19
- package/components/radio/demo.html +0 -287
- package/components/radio/snice-radio.css +0 -171
- package/components/radio/snice-radio.ts +0 -218
- package/components/radio/snice-radio.types.ts +0 -21
- package/components/select/demo.html +0 -511
- package/components/select/snice-option.ts +0 -52
- package/components/select/snice-select.css +0 -392
- package/components/select/snice-select.ts +0 -796
- package/components/select/snice-select.types.ts +0 -55
- package/components/skeleton/demo.html +0 -514
- package/components/skeleton/snice-skeleton.css +0 -109
- package/components/skeleton/snice-skeleton.ts +0 -126
- package/components/switch/demo.html +0 -284
- package/components/switch/snice-switch.css +0 -221
- package/components/switch/snice-switch.ts +0 -229
- package/components/switch/snice-switch.types.ts +0 -23
- package/components/symbols.ts +0 -23
- package/components/table/demo-table-controller.ts +0 -100
- package/components/table/demo.html +0 -480
- package/components/table/snice-cell-boolean.ts +0 -112
- package/components/table/snice-cell-date.ts +0 -210
- package/components/table/snice-cell-duration.ts +0 -91
- package/components/table/snice-cell-filesize.ts +0 -90
- package/components/table/snice-cell-number.ts +0 -165
- package/components/table/snice-cell-progress.ts +0 -83
- package/components/table/snice-cell-rating.ts +0 -82
- package/components/table/snice-cell-sparkline.ts +0 -253
- package/components/table/snice-cell-text.ts +0 -125
- package/components/table/snice-cell.css +0 -296
- package/components/table/snice-cell.ts +0 -473
- package/components/table/snice-column.ts +0 -353
- package/components/table/snice-header.css +0 -243
- package/components/table/snice-header.ts +0 -261
- package/components/table/snice-progress.ts +0 -66
- package/components/table/snice-rating.ts +0 -45
- package/components/table/snice-row.css +0 -255
- package/components/table/snice-row.ts +0 -331
- package/components/table/snice-table.css +0 -241
- package/components/table/snice-table.ts +0 -737
- package/components/table/snice-table.types.ts +0 -158
- package/components/tabs/demo.html +0 -487
- package/components/tabs/snice-tab-panel.css +0 -264
- package/components/tabs/snice-tab-panel.ts +0 -47
- package/components/tabs/snice-tab.css +0 -96
- package/components/tabs/snice-tab.ts +0 -65
- package/components/tabs/snice-tabs.css +0 -189
- package/components/tabs/snice-tabs.ts +0 -332
- package/components/tabs/snice-tabs.types.ts +0 -28
- package/components/theme/theme.css +0 -234
- package/components/toast/demo.html +0 -329
- package/components/toast/snice-toast-container.ts +0 -256
- package/components/toast/snice-toast.css +0 -213
- package/components/toast/snice-toast.ts +0 -276
- package/components/toast/snice-toast.types.ts +0 -35
- package/components/tooltip/demo.html +0 -350
- package/components/tooltip/snice-tooltip-portal.css +0 -79
- package/components/tooltip/snice-tooltip.css +0 -117
- package/components/tooltip/snice-tooltip.ts +0 -612
- package/components/tooltip/snice-tooltip.types.ts +0 -32
- package/components/transitions.ts +0 -94
- package/components/tsconfig.json +0 -18
|
@@ -0,0 +1,847 @@
|
|
|
1
|
+
import { __runInitializers, __esDecorate } from 'tslib';
|
|
2
|
+
import { element, property, query, ready, on, watch, dispatch } from 'snice';
|
|
3
|
+
|
|
4
|
+
var css = '';
|
|
5
|
+
|
|
6
|
+
let SniceDatePicker = (() => {
|
|
7
|
+
let _classDecorators = [element('snice-date-picker')];
|
|
8
|
+
let _classDescriptor;
|
|
9
|
+
let _classExtraInitializers = [];
|
|
10
|
+
let _classThis;
|
|
11
|
+
let _classSuper = HTMLElement;
|
|
12
|
+
let _instanceExtraInitializers = [];
|
|
13
|
+
let _size_decorators;
|
|
14
|
+
let _size_initializers = [];
|
|
15
|
+
let _size_extraInitializers = [];
|
|
16
|
+
let _variant_decorators;
|
|
17
|
+
let _variant_initializers = [];
|
|
18
|
+
let _variant_extraInitializers = [];
|
|
19
|
+
let _value_decorators;
|
|
20
|
+
let _value_initializers = [];
|
|
21
|
+
let _value_extraInitializers = [];
|
|
22
|
+
let _format_decorators;
|
|
23
|
+
let _format_initializers = [];
|
|
24
|
+
let _format_extraInitializers = [];
|
|
25
|
+
let _placeholder_decorators;
|
|
26
|
+
let _placeholder_initializers = [];
|
|
27
|
+
let _placeholder_extraInitializers = [];
|
|
28
|
+
let _label_decorators;
|
|
29
|
+
let _label_initializers = [];
|
|
30
|
+
let _label_extraInitializers = [];
|
|
31
|
+
let _helperText_decorators;
|
|
32
|
+
let _helperText_initializers = [];
|
|
33
|
+
let _helperText_extraInitializers = [];
|
|
34
|
+
let _errorText_decorators;
|
|
35
|
+
let _errorText_initializers = [];
|
|
36
|
+
let _errorText_extraInitializers = [];
|
|
37
|
+
let _disabled_decorators;
|
|
38
|
+
let _disabled_initializers = [];
|
|
39
|
+
let _disabled_extraInitializers = [];
|
|
40
|
+
let _readonly_decorators;
|
|
41
|
+
let _readonly_initializers = [];
|
|
42
|
+
let _readonly_extraInitializers = [];
|
|
43
|
+
let _required_decorators;
|
|
44
|
+
let _required_initializers = [];
|
|
45
|
+
let _required_extraInitializers = [];
|
|
46
|
+
let _invalid_decorators;
|
|
47
|
+
let _invalid_initializers = [];
|
|
48
|
+
let _invalid_extraInitializers = [];
|
|
49
|
+
let _clearable_decorators;
|
|
50
|
+
let _clearable_initializers = [];
|
|
51
|
+
let _clearable_extraInitializers = [];
|
|
52
|
+
let _min_decorators;
|
|
53
|
+
let _min_initializers = [];
|
|
54
|
+
let _min_extraInitializers = [];
|
|
55
|
+
let _max_decorators;
|
|
56
|
+
let _max_initializers = [];
|
|
57
|
+
let _max_extraInitializers = [];
|
|
58
|
+
let _name_decorators;
|
|
59
|
+
let _name_initializers = [];
|
|
60
|
+
let _name_extraInitializers = [];
|
|
61
|
+
let _showCalendar_decorators;
|
|
62
|
+
let _showCalendar_initializers = [];
|
|
63
|
+
let _showCalendar_extraInitializers = [];
|
|
64
|
+
let _firstDayOfWeek_decorators;
|
|
65
|
+
let _firstDayOfWeek_initializers = [];
|
|
66
|
+
let _firstDayOfWeek_extraInitializers = [];
|
|
67
|
+
let _input_decorators;
|
|
68
|
+
let _input_initializers = [];
|
|
69
|
+
let _input_extraInitializers = [];
|
|
70
|
+
let _calendar_decorators;
|
|
71
|
+
let _calendar_initializers = [];
|
|
72
|
+
let _calendar_extraInitializers = [];
|
|
73
|
+
let _clearButton_decorators;
|
|
74
|
+
let _clearButton_initializers = [];
|
|
75
|
+
let _clearButton_extraInitializers = [];
|
|
76
|
+
let _calendarToggle_decorators;
|
|
77
|
+
let _calendarToggle_initializers = [];
|
|
78
|
+
let _calendarToggle_extraInitializers = [];
|
|
79
|
+
let _selectedDayButton_decorators;
|
|
80
|
+
let _selectedDayButton_initializers = [];
|
|
81
|
+
let _selectedDayButton_extraInitializers = [];
|
|
82
|
+
let _firstDayButton_decorators;
|
|
83
|
+
let _firstDayButton_initializers = [];
|
|
84
|
+
let _firstDayButton_extraInitializers = [];
|
|
85
|
+
let _init_decorators;
|
|
86
|
+
let _handleInput_decorators;
|
|
87
|
+
let _handleChange_decorators;
|
|
88
|
+
let _handleFocus_decorators;
|
|
89
|
+
let _handleInputClick_decorators;
|
|
90
|
+
let _handleBlur_decorators;
|
|
91
|
+
let _handleCalendarToggle_decorators;
|
|
92
|
+
let _handleClear_decorators;
|
|
93
|
+
let _handleCalendarClick_decorators;
|
|
94
|
+
let _handleKeydown_decorators;
|
|
95
|
+
let _handleValueChange_decorators;
|
|
96
|
+
let _handleShowCalendarChange_decorators;
|
|
97
|
+
let _handleDisabledChange_decorators;
|
|
98
|
+
let _handleReadonlyChange_decorators;
|
|
99
|
+
let _handleInvalidChange_decorators;
|
|
100
|
+
let _handleFormatChange_decorators;
|
|
101
|
+
let _dispatchInputEvent_decorators;
|
|
102
|
+
let _dispatchChangeEvent_decorators;
|
|
103
|
+
let _dispatchFocusEvent_decorators;
|
|
104
|
+
let _dispatchBlurEvent_decorators;
|
|
105
|
+
let _dispatchOpenEvent_decorators;
|
|
106
|
+
let _dispatchCloseEvent_decorators;
|
|
107
|
+
let _dispatchClearEvent_decorators;
|
|
108
|
+
let _dispatchSelectEvent_decorators;
|
|
109
|
+
(class extends _classSuper {
|
|
110
|
+
static { _classThis = this; }
|
|
111
|
+
constructor() {
|
|
112
|
+
super(...arguments);
|
|
113
|
+
this.size = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _size_initializers, 'medium'));
|
|
114
|
+
this.variant = (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _variant_initializers, 'outlined'));
|
|
115
|
+
this.value = (__runInitializers(this, _variant_extraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
116
|
+
// Track input separately to prevent cursor jumps during typing
|
|
117
|
+
this.inputValue = (__runInitializers(this, _value_extraInitializers), '');
|
|
118
|
+
this.format = __runInitializers(this, _format_initializers, 'mm/dd/yyyy');
|
|
119
|
+
this.placeholder = (__runInitializers(this, _format_extraInitializers), __runInitializers(this, _placeholder_initializers, ''));
|
|
120
|
+
this.label = (__runInitializers(this, _placeholder_extraInitializers), __runInitializers(this, _label_initializers, ''));
|
|
121
|
+
this.helperText = (__runInitializers(this, _label_extraInitializers), __runInitializers(this, _helperText_initializers, ''));
|
|
122
|
+
this.errorText = (__runInitializers(this, _helperText_extraInitializers), __runInitializers(this, _errorText_initializers, ''));
|
|
123
|
+
this.disabled = (__runInitializers(this, _errorText_extraInitializers), __runInitializers(this, _disabled_initializers, false));
|
|
124
|
+
this.readonly = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _readonly_initializers, false));
|
|
125
|
+
this.required = (__runInitializers(this, _readonly_extraInitializers), __runInitializers(this, _required_initializers, false));
|
|
126
|
+
this.invalid = (__runInitializers(this, _required_extraInitializers), __runInitializers(this, _invalid_initializers, false));
|
|
127
|
+
this.clearable = (__runInitializers(this, _invalid_extraInitializers), __runInitializers(this, _clearable_initializers, false));
|
|
128
|
+
this.min = (__runInitializers(this, _clearable_extraInitializers), __runInitializers(this, _min_initializers, ''));
|
|
129
|
+
this.max = (__runInitializers(this, _min_extraInitializers), __runInitializers(this, _max_initializers, ''));
|
|
130
|
+
this.name = (__runInitializers(this, _max_extraInitializers), __runInitializers(this, _name_initializers, ''));
|
|
131
|
+
this.showCalendar = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _showCalendar_initializers, false));
|
|
132
|
+
this.firstDayOfWeek = (__runInitializers(this, _showCalendar_extraInitializers), __runInitializers(this, _firstDayOfWeek_initializers, 0)); // 0 = Sunday
|
|
133
|
+
this.input = (__runInitializers(this, _firstDayOfWeek_extraInitializers), __runInitializers(this, _input_initializers, void 0));
|
|
134
|
+
this.calendar = (__runInitializers(this, _input_extraInitializers), __runInitializers(this, _calendar_initializers, void 0));
|
|
135
|
+
this.clearButton = (__runInitializers(this, _calendar_extraInitializers), __runInitializers(this, _clearButton_initializers, void 0));
|
|
136
|
+
this.calendarToggle = (__runInitializers(this, _clearButton_extraInitializers), __runInitializers(this, _calendarToggle_initializers, void 0));
|
|
137
|
+
this.selectedDayButton = (__runInitializers(this, _calendarToggle_extraInitializers), __runInitializers(this, _selectedDayButton_initializers, void 0));
|
|
138
|
+
this.firstDayButton = (__runInitializers(this, _selectedDayButton_extraInitializers), __runInitializers(this, _firstDayButton_initializers, void 0));
|
|
139
|
+
this.selectedDate = (__runInitializers(this, _firstDayButton_extraInitializers), null);
|
|
140
|
+
this.viewDate = new Date();
|
|
141
|
+
this.monthNames = [
|
|
142
|
+
'January', 'February', 'March', 'April', 'May', 'June',
|
|
143
|
+
'July', 'August', 'September', 'October', 'November', 'December'
|
|
144
|
+
];
|
|
145
|
+
this.dayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
146
|
+
}
|
|
147
|
+
static {
|
|
148
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
149
|
+
_size_decorators = [property({ reflect: true })];
|
|
150
|
+
_variant_decorators = [property({ reflect: true })];
|
|
151
|
+
_value_decorators = [property({ reflect: true })];
|
|
152
|
+
_format_decorators = [property({ reflect: true })];
|
|
153
|
+
_placeholder_decorators = [property({ reflect: true })];
|
|
154
|
+
_label_decorators = [property({ reflect: true })];
|
|
155
|
+
_helperText_decorators = [property({ attribute: 'helper-text', reflect: true })];
|
|
156
|
+
_errorText_decorators = [property({ attribute: 'error-text', reflect: true })];
|
|
157
|
+
_disabled_decorators = [property({ type: Boolean, reflect: true })];
|
|
158
|
+
_readonly_decorators = [property({ type: Boolean, reflect: true })];
|
|
159
|
+
_required_decorators = [property({ type: Boolean, reflect: true })];
|
|
160
|
+
_invalid_decorators = [property({ type: Boolean, reflect: true })];
|
|
161
|
+
_clearable_decorators = [property({ type: Boolean, reflect: true })];
|
|
162
|
+
_min_decorators = [property({ reflect: true })];
|
|
163
|
+
_max_decorators = [property({ reflect: true })];
|
|
164
|
+
_name_decorators = [property({ reflect: true })];
|
|
165
|
+
_showCalendar_decorators = [property({ type: Boolean, attribute: 'show-calendar', reflect: true })];
|
|
166
|
+
_firstDayOfWeek_decorators = [property({ type: Number, attribute: 'first-day-of-week', reflect: true })];
|
|
167
|
+
_input_decorators = [query('.input')];
|
|
168
|
+
_calendar_decorators = [query('.calendar')];
|
|
169
|
+
_clearButton_decorators = [query('.clear-button')];
|
|
170
|
+
_calendarToggle_decorators = [query('.calendar-toggle')];
|
|
171
|
+
_selectedDayButton_decorators = [query('.day--selected')];
|
|
172
|
+
_firstDayButton_decorators = [query('.day:not(.day--empty):not(.day--disabled)')];
|
|
173
|
+
_init_decorators = [ready()];
|
|
174
|
+
_handleInput_decorators = [on('input', '.input')];
|
|
175
|
+
_handleChange_decorators = [on('change', '.input')];
|
|
176
|
+
_handleFocus_decorators = [on('focus', '.input')];
|
|
177
|
+
_handleInputClick_decorators = [on('click', '.input')];
|
|
178
|
+
_handleBlur_decorators = [on('blur', '.input')];
|
|
179
|
+
_handleCalendarToggle_decorators = [on('click', '.calendar-toggle')];
|
|
180
|
+
_handleClear_decorators = [on('click', '.clear-button')];
|
|
181
|
+
_handleCalendarClick_decorators = [on('click', '.calendar')];
|
|
182
|
+
_handleKeydown_decorators = [on('keydown', '.input')];
|
|
183
|
+
_handleValueChange_decorators = [watch('value')];
|
|
184
|
+
_handleShowCalendarChange_decorators = [watch('show-calendar')];
|
|
185
|
+
_handleDisabledChange_decorators = [watch('disabled')];
|
|
186
|
+
_handleReadonlyChange_decorators = [watch('readonly')];
|
|
187
|
+
_handleInvalidChange_decorators = [watch('invalid')];
|
|
188
|
+
_handleFormatChange_decorators = [watch('format')];
|
|
189
|
+
_dispatchInputEvent_decorators = [dispatch('@snice/datepicker-input', { bubbles: true, composed: true })];
|
|
190
|
+
_dispatchChangeEvent_decorators = [dispatch('@snice/datepicker-change', { bubbles: true, composed: true })];
|
|
191
|
+
_dispatchFocusEvent_decorators = [dispatch('@snice/datepicker-focus', { bubbles: true, composed: true })];
|
|
192
|
+
_dispatchBlurEvent_decorators = [dispatch('@snice/datepicker-blur', { bubbles: true, composed: true })];
|
|
193
|
+
_dispatchOpenEvent_decorators = [dispatch('@snice/datepicker-open', { bubbles: true, composed: true })];
|
|
194
|
+
_dispatchCloseEvent_decorators = [dispatch('@snice/datepicker-close', { bubbles: true, composed: true })];
|
|
195
|
+
_dispatchClearEvent_decorators = [dispatch('@snice/datepicker-clear', { bubbles: true, composed: true })];
|
|
196
|
+
_dispatchSelectEvent_decorators = [dispatch('@snice/datepicker-select', { bubbles: true, composed: true })];
|
|
197
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
198
|
+
__esDecorate(this, null, _handleInput_decorators, { kind: "method", name: "handleInput", static: false, private: false, access: { has: obj => "handleInput" in obj, get: obj => obj.handleInput }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
199
|
+
__esDecorate(this, null, _handleChange_decorators, { kind: "method", name: "handleChange", static: false, private: false, access: { has: obj => "handleChange" in obj, get: obj => obj.handleChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
200
|
+
__esDecorate(this, null, _handleFocus_decorators, { kind: "method", name: "handleFocus", static: false, private: false, access: { has: obj => "handleFocus" in obj, get: obj => obj.handleFocus }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
201
|
+
__esDecorate(this, null, _handleInputClick_decorators, { kind: "method", name: "handleInputClick", static: false, private: false, access: { has: obj => "handleInputClick" in obj, get: obj => obj.handleInputClick }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
202
|
+
__esDecorate(this, null, _handleBlur_decorators, { kind: "method", name: "handleBlur", static: false, private: false, access: { has: obj => "handleBlur" in obj, get: obj => obj.handleBlur }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
203
|
+
__esDecorate(this, null, _handleCalendarToggle_decorators, { kind: "method", name: "handleCalendarToggle", static: false, private: false, access: { has: obj => "handleCalendarToggle" in obj, get: obj => obj.handleCalendarToggle }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
204
|
+
__esDecorate(this, null, _handleClear_decorators, { kind: "method", name: "handleClear", static: false, private: false, access: { has: obj => "handleClear" in obj, get: obj => obj.handleClear }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
205
|
+
__esDecorate(this, null, _handleCalendarClick_decorators, { kind: "method", name: "handleCalendarClick", static: false, private: false, access: { has: obj => "handleCalendarClick" in obj, get: obj => obj.handleCalendarClick }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
206
|
+
__esDecorate(this, null, _handleKeydown_decorators, { kind: "method", name: "handleKeydown", static: false, private: false, access: { has: obj => "handleKeydown" in obj, get: obj => obj.handleKeydown }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
207
|
+
__esDecorate(this, null, _handleValueChange_decorators, { kind: "method", name: "handleValueChange", static: false, private: false, access: { has: obj => "handleValueChange" in obj, get: obj => obj.handleValueChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
208
|
+
__esDecorate(this, null, _handleShowCalendarChange_decorators, { kind: "method", name: "handleShowCalendarChange", static: false, private: false, access: { has: obj => "handleShowCalendarChange" in obj, get: obj => obj.handleShowCalendarChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
209
|
+
__esDecorate(this, null, _handleDisabledChange_decorators, { kind: "method", name: "handleDisabledChange", static: false, private: false, access: { has: obj => "handleDisabledChange" in obj, get: obj => obj.handleDisabledChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
210
|
+
__esDecorate(this, null, _handleReadonlyChange_decorators, { kind: "method", name: "handleReadonlyChange", static: false, private: false, access: { has: obj => "handleReadonlyChange" in obj, get: obj => obj.handleReadonlyChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
211
|
+
__esDecorate(this, null, _handleInvalidChange_decorators, { kind: "method", name: "handleInvalidChange", static: false, private: false, access: { has: obj => "handleInvalidChange" in obj, get: obj => obj.handleInvalidChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
212
|
+
__esDecorate(this, null, _handleFormatChange_decorators, { kind: "method", name: "handleFormatChange", static: false, private: false, access: { has: obj => "handleFormatChange" in obj, get: obj => obj.handleFormatChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
213
|
+
__esDecorate(this, null, _dispatchInputEvent_decorators, { kind: "method", name: "dispatchInputEvent", static: false, private: false, access: { has: obj => "dispatchInputEvent" in obj, get: obj => obj.dispatchInputEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
214
|
+
__esDecorate(this, null, _dispatchChangeEvent_decorators, { kind: "method", name: "dispatchChangeEvent", static: false, private: false, access: { has: obj => "dispatchChangeEvent" in obj, get: obj => obj.dispatchChangeEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
215
|
+
__esDecorate(this, null, _dispatchFocusEvent_decorators, { kind: "method", name: "dispatchFocusEvent", static: false, private: false, access: { has: obj => "dispatchFocusEvent" in obj, get: obj => obj.dispatchFocusEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
216
|
+
__esDecorate(this, null, _dispatchBlurEvent_decorators, { kind: "method", name: "dispatchBlurEvent", static: false, private: false, access: { has: obj => "dispatchBlurEvent" in obj, get: obj => obj.dispatchBlurEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
217
|
+
__esDecorate(this, null, _dispatchOpenEvent_decorators, { kind: "method", name: "dispatchOpenEvent", static: false, private: false, access: { has: obj => "dispatchOpenEvent" in obj, get: obj => obj.dispatchOpenEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
218
|
+
__esDecorate(this, null, _dispatchCloseEvent_decorators, { kind: "method", name: "dispatchCloseEvent", static: false, private: false, access: { has: obj => "dispatchCloseEvent" in obj, get: obj => obj.dispatchCloseEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
219
|
+
__esDecorate(this, null, _dispatchClearEvent_decorators, { kind: "method", name: "dispatchClearEvent", static: false, private: false, access: { has: obj => "dispatchClearEvent" in obj, get: obj => obj.dispatchClearEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
220
|
+
__esDecorate(this, null, _dispatchSelectEvent_decorators, { kind: "method", name: "dispatchSelectEvent", static: false, private: false, access: { has: obj => "dispatchSelectEvent" in obj, get: obj => obj.dispatchSelectEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
221
|
+
__esDecorate(null, null, _size_decorators, { kind: "field", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
222
|
+
__esDecorate(null, null, _variant_decorators, { kind: "field", name: "variant", static: false, private: false, access: { has: obj => "variant" in obj, get: obj => obj.variant, set: (obj, value) => { obj.variant = value; } }, metadata: _metadata }, _variant_initializers, _variant_extraInitializers);
|
|
223
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
224
|
+
__esDecorate(null, null, _format_decorators, { kind: "field", name: "format", static: false, private: false, access: { has: obj => "format" in obj, get: obj => obj.format, set: (obj, value) => { obj.format = value; } }, metadata: _metadata }, _format_initializers, _format_extraInitializers);
|
|
225
|
+
__esDecorate(null, null, _placeholder_decorators, { kind: "field", name: "placeholder", static: false, private: false, access: { has: obj => "placeholder" in obj, get: obj => obj.placeholder, set: (obj, value) => { obj.placeholder = value; } }, metadata: _metadata }, _placeholder_initializers, _placeholder_extraInitializers);
|
|
226
|
+
__esDecorate(null, null, _label_decorators, { kind: "field", name: "label", static: false, private: false, access: { has: obj => "label" in obj, get: obj => obj.label, set: (obj, value) => { obj.label = value; } }, metadata: _metadata }, _label_initializers, _label_extraInitializers);
|
|
227
|
+
__esDecorate(null, null, _helperText_decorators, { kind: "field", name: "helperText", static: false, private: false, access: { has: obj => "helperText" in obj, get: obj => obj.helperText, set: (obj, value) => { obj.helperText = value; } }, metadata: _metadata }, _helperText_initializers, _helperText_extraInitializers);
|
|
228
|
+
__esDecorate(null, null, _errorText_decorators, { kind: "field", name: "errorText", static: false, private: false, access: { has: obj => "errorText" in obj, get: obj => obj.errorText, set: (obj, value) => { obj.errorText = value; } }, metadata: _metadata }, _errorText_initializers, _errorText_extraInitializers);
|
|
229
|
+
__esDecorate(null, null, _disabled_decorators, { kind: "field", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, get: obj => obj.disabled, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, _disabled_initializers, _disabled_extraInitializers);
|
|
230
|
+
__esDecorate(null, null, _readonly_decorators, { kind: "field", name: "readonly", static: false, private: false, access: { has: obj => "readonly" in obj, get: obj => obj.readonly, set: (obj, value) => { obj.readonly = value; } }, metadata: _metadata }, _readonly_initializers, _readonly_extraInitializers);
|
|
231
|
+
__esDecorate(null, null, _required_decorators, { kind: "field", name: "required", static: false, private: false, access: { has: obj => "required" in obj, get: obj => obj.required, set: (obj, value) => { obj.required = value; } }, metadata: _metadata }, _required_initializers, _required_extraInitializers);
|
|
232
|
+
__esDecorate(null, null, _invalid_decorators, { kind: "field", name: "invalid", static: false, private: false, access: { has: obj => "invalid" in obj, get: obj => obj.invalid, set: (obj, value) => { obj.invalid = value; } }, metadata: _metadata }, _invalid_initializers, _invalid_extraInitializers);
|
|
233
|
+
__esDecorate(null, null, _clearable_decorators, { kind: "field", name: "clearable", static: false, private: false, access: { has: obj => "clearable" in obj, get: obj => obj.clearable, set: (obj, value) => { obj.clearable = value; } }, metadata: _metadata }, _clearable_initializers, _clearable_extraInitializers);
|
|
234
|
+
__esDecorate(null, null, _min_decorators, { kind: "field", name: "min", static: false, private: false, access: { has: obj => "min" in obj, get: obj => obj.min, set: (obj, value) => { obj.min = value; } }, metadata: _metadata }, _min_initializers, _min_extraInitializers);
|
|
235
|
+
__esDecorate(null, null, _max_decorators, { kind: "field", name: "max", static: false, private: false, access: { has: obj => "max" in obj, get: obj => obj.max, set: (obj, value) => { obj.max = value; } }, metadata: _metadata }, _max_initializers, _max_extraInitializers);
|
|
236
|
+
__esDecorate(null, null, _name_decorators, { kind: "field", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
237
|
+
__esDecorate(null, null, _showCalendar_decorators, { kind: "field", name: "showCalendar", static: false, private: false, access: { has: obj => "showCalendar" in obj, get: obj => obj.showCalendar, set: (obj, value) => { obj.showCalendar = value; } }, metadata: _metadata }, _showCalendar_initializers, _showCalendar_extraInitializers);
|
|
238
|
+
__esDecorate(null, null, _firstDayOfWeek_decorators, { kind: "field", name: "firstDayOfWeek", static: false, private: false, access: { has: obj => "firstDayOfWeek" in obj, get: obj => obj.firstDayOfWeek, set: (obj, value) => { obj.firstDayOfWeek = value; } }, metadata: _metadata }, _firstDayOfWeek_initializers, _firstDayOfWeek_extraInitializers);
|
|
239
|
+
__esDecorate(null, null, _input_decorators, { kind: "field", name: "input", static: false, private: false, access: { has: obj => "input" in obj, get: obj => obj.input, set: (obj, value) => { obj.input = value; } }, metadata: _metadata }, _input_initializers, _input_extraInitializers);
|
|
240
|
+
__esDecorate(null, null, _calendar_decorators, { kind: "field", name: "calendar", static: false, private: false, access: { has: obj => "calendar" in obj, get: obj => obj.calendar, set: (obj, value) => { obj.calendar = value; } }, metadata: _metadata }, _calendar_initializers, _calendar_extraInitializers);
|
|
241
|
+
__esDecorate(null, null, _clearButton_decorators, { kind: "field", name: "clearButton", static: false, private: false, access: { has: obj => "clearButton" in obj, get: obj => obj.clearButton, set: (obj, value) => { obj.clearButton = value; } }, metadata: _metadata }, _clearButton_initializers, _clearButton_extraInitializers);
|
|
242
|
+
__esDecorate(null, null, _calendarToggle_decorators, { kind: "field", name: "calendarToggle", static: false, private: false, access: { has: obj => "calendarToggle" in obj, get: obj => obj.calendarToggle, set: (obj, value) => { obj.calendarToggle = value; } }, metadata: _metadata }, _calendarToggle_initializers, _calendarToggle_extraInitializers);
|
|
243
|
+
__esDecorate(null, null, _selectedDayButton_decorators, { kind: "field", name: "selectedDayButton", static: false, private: false, access: { has: obj => "selectedDayButton" in obj, get: obj => obj.selectedDayButton, set: (obj, value) => { obj.selectedDayButton = value; } }, metadata: _metadata }, _selectedDayButton_initializers, _selectedDayButton_extraInitializers);
|
|
244
|
+
__esDecorate(null, null, _firstDayButton_decorators, { kind: "field", name: "firstDayButton", static: false, private: false, access: { has: obj => "firstDayButton" in obj, get: obj => obj.firstDayButton, set: (obj, value) => { obj.firstDayButton = value; } }, metadata: _metadata }, _firstDayButton_initializers, _firstDayButton_extraInitializers);
|
|
245
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
246
|
+
_classThis = _classDescriptor.value;
|
|
247
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
248
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
249
|
+
}
|
|
250
|
+
css() {
|
|
251
|
+
return css;
|
|
252
|
+
}
|
|
253
|
+
html() {
|
|
254
|
+
return /*html*/ `
|
|
255
|
+
<div class="date-picker-wrapper">
|
|
256
|
+
${this.label ? /*html*/ `
|
|
257
|
+
<label class="label ${this.required ? 'label--required' : ''}">
|
|
258
|
+
${this.label}
|
|
259
|
+
</label>
|
|
260
|
+
` : ''}
|
|
261
|
+
|
|
262
|
+
<div class="input-container">
|
|
263
|
+
<input
|
|
264
|
+
class="input
|
|
265
|
+
input--${this.size}
|
|
266
|
+
input--${this.variant}
|
|
267
|
+
${this.invalid ? 'input--invalid' : ''}
|
|
268
|
+
${this.clearable ? 'input--clearable' : ''}"
|
|
269
|
+
type="text"
|
|
270
|
+
value="${this.inputValue || this.getFormattedValue()}"
|
|
271
|
+
placeholder="${this.placeholder || this.getPlaceholderForFormat()}"
|
|
272
|
+
${this.disabled ? 'disabled' : ''}
|
|
273
|
+
${this.readonly ? 'readonly' : ''}
|
|
274
|
+
${this.required ? 'required' : ''}
|
|
275
|
+
${this.name ? `name="${this.name}"` : ''}
|
|
276
|
+
part="input"
|
|
277
|
+
autocomplete="off"
|
|
278
|
+
/>
|
|
279
|
+
|
|
280
|
+
<button
|
|
281
|
+
class="calendar-toggle"
|
|
282
|
+
type="button"
|
|
283
|
+
aria-label="Open calendar"
|
|
284
|
+
tabindex="-1"
|
|
285
|
+
part="calendar-toggle"
|
|
286
|
+
${this.disabled ? 'disabled' : ''}
|
|
287
|
+
>
|
|
288
|
+
<svg viewBox="0 0 24 24" width="18" height="18">
|
|
289
|
+
<path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z" fill="currentColor"/>
|
|
290
|
+
</svg>
|
|
291
|
+
</button>
|
|
292
|
+
|
|
293
|
+
<button
|
|
294
|
+
class="clear-button"
|
|
295
|
+
type="button"
|
|
296
|
+
aria-label="Clear"
|
|
297
|
+
tabindex="-1"
|
|
298
|
+
part="clear"
|
|
299
|
+
style="display: none;"
|
|
300
|
+
>
|
|
301
|
+
<svg viewBox="0 0 24 24" width="16" height="16">
|
|
302
|
+
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" fill="currentColor"/>
|
|
303
|
+
</svg>
|
|
304
|
+
</button>
|
|
305
|
+
|
|
306
|
+
<div class="calendar" part="calendar" hidden>
|
|
307
|
+
<div class="calendar-header">
|
|
308
|
+
<button class="nav-button" type="button" data-nav="prev-month" aria-label="Previous month">
|
|
309
|
+
<svg viewBox="0 0 24 24" width="20" height="20">
|
|
310
|
+
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" fill="currentColor"/>
|
|
311
|
+
</svg>
|
|
312
|
+
</button>
|
|
313
|
+
|
|
314
|
+
<div class="calendar-title">
|
|
315
|
+
<button class="month-button" type="button" data-nav="month-picker">
|
|
316
|
+
${this.monthNames[this.viewDate.getMonth()]} ${this.viewDate.getFullYear()}
|
|
317
|
+
</button>
|
|
318
|
+
</div>
|
|
319
|
+
|
|
320
|
+
<button class="nav-button" type="button" data-nav="next-month" aria-label="Next month">
|
|
321
|
+
<svg viewBox="0 0 24 24" width="20" height="20">
|
|
322
|
+
<path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" fill="currentColor"/>
|
|
323
|
+
</svg>
|
|
324
|
+
</button>
|
|
325
|
+
</div>
|
|
326
|
+
|
|
327
|
+
<div class="calendar-weekdays">
|
|
328
|
+
${this.getDayHeaders()}
|
|
329
|
+
</div>
|
|
330
|
+
|
|
331
|
+
<div class="calendar-days">
|
|
332
|
+
${this.getDaysGrid()}
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
<div class="calendar-footer">
|
|
336
|
+
<button class="today-button" type="button" data-nav="today">
|
|
337
|
+
Today
|
|
338
|
+
</button>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
|
|
343
|
+
${this.errorText ? /*html*/ `
|
|
344
|
+
<span class="error-text" part="error-text">${this.errorText}</span>
|
|
345
|
+
` : this.helperText ? /*html*/ `
|
|
346
|
+
<span class="helper-text" part="helper-text">${this.helperText}</span>
|
|
347
|
+
` : /*html*/ `
|
|
348
|
+
<span class="helper-text" part="helper-text"> </span>
|
|
349
|
+
`}
|
|
350
|
+
</div>
|
|
351
|
+
`;
|
|
352
|
+
}
|
|
353
|
+
init() {
|
|
354
|
+
this.parseInitialValue();
|
|
355
|
+
this.updateClearButton();
|
|
356
|
+
this.setupCalendarClickOutside();
|
|
357
|
+
if (this.input) {
|
|
358
|
+
this.input.disabled = this.disabled;
|
|
359
|
+
this.input.readOnly = this.readonly;
|
|
360
|
+
this.input.required = this.required;
|
|
361
|
+
if (this.invalid) {
|
|
362
|
+
this.input.setAttribute('aria-invalid', 'true');
|
|
363
|
+
this.input.classList.add('input--invalid');
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
parseInitialValue() {
|
|
368
|
+
if (this.value) {
|
|
369
|
+
const date = this.parseDate(this.value);
|
|
370
|
+
if (date) {
|
|
371
|
+
this.selectedDate = date;
|
|
372
|
+
this.viewDate = new Date(date);
|
|
373
|
+
this.inputValue = this.formatDate(date);
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
this.inputValue = this.value;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
parseDate(dateString) {
|
|
381
|
+
if (!dateString)
|
|
382
|
+
return null;
|
|
383
|
+
if (this.format === 'mmmm dd, yyyy') {
|
|
384
|
+
const monthNameRegex = /^([A-Za-z]+)\s+(\d{1,2}),\s+(\d{4})$/;
|
|
385
|
+
const match = dateString.match(monthNameRegex);
|
|
386
|
+
if (match) {
|
|
387
|
+
const [, monthName, day, year] = match;
|
|
388
|
+
const monthIndex = this.monthNames.findIndex(m => m.toLowerCase() === monthName.toLowerCase());
|
|
389
|
+
if (monthIndex >= 0) {
|
|
390
|
+
const date = new Date(parseInt(year), monthIndex, parseInt(day));
|
|
391
|
+
if (!isNaN(date.getTime())) {
|
|
392
|
+
return date;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
let date = new Date(dateString);
|
|
399
|
+
if (!isNaN(date.getTime())) {
|
|
400
|
+
return date;
|
|
401
|
+
}
|
|
402
|
+
const parts = dateString.split(/[-\/]/);
|
|
403
|
+
if (parts.length !== 3)
|
|
404
|
+
return null;
|
|
405
|
+
let year, month, day;
|
|
406
|
+
switch (this.format) {
|
|
407
|
+
case 'mm/dd/yyyy':
|
|
408
|
+
case 'mm-dd-yyyy':
|
|
409
|
+
[month, day, year] = parts.map(Number);
|
|
410
|
+
break;
|
|
411
|
+
case 'dd/mm/yyyy':
|
|
412
|
+
case 'dd-mm-yyyy':
|
|
413
|
+
[day, month, year] = parts.map(Number);
|
|
414
|
+
break;
|
|
415
|
+
case 'yyyy-mm-dd':
|
|
416
|
+
case 'yyyy/mm/dd':
|
|
417
|
+
[year, month, day] = parts.map(Number);
|
|
418
|
+
break;
|
|
419
|
+
default:
|
|
420
|
+
return null;
|
|
421
|
+
}
|
|
422
|
+
if (year && month && day) {
|
|
423
|
+
date = new Date(year, month - 1, day);
|
|
424
|
+
if (!isNaN(date.getTime())) {
|
|
425
|
+
return date;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
return null;
|
|
429
|
+
}
|
|
430
|
+
formatDate(date) {
|
|
431
|
+
if (!date)
|
|
432
|
+
return '';
|
|
433
|
+
const year = date.getFullYear();
|
|
434
|
+
const month = date.getMonth() + 1;
|
|
435
|
+
const day = date.getDate();
|
|
436
|
+
const mm = month.toString().padStart(2, '0');
|
|
437
|
+
const dd = day.toString().padStart(2, '0');
|
|
438
|
+
const yyyy = year.toString();
|
|
439
|
+
switch (this.format) {
|
|
440
|
+
case 'mm/dd/yyyy':
|
|
441
|
+
return `${mm}/${dd}/${yyyy}`;
|
|
442
|
+
case 'dd/mm/yyyy':
|
|
443
|
+
return `${dd}/${mm}/${yyyy}`;
|
|
444
|
+
case 'yyyy-mm-dd':
|
|
445
|
+
return `${yyyy}-${mm}-${dd}`;
|
|
446
|
+
case 'yyyy/mm/dd':
|
|
447
|
+
return `${yyyy}/${mm}/${dd}`;
|
|
448
|
+
case 'dd-mm-yyyy':
|
|
449
|
+
return `${dd}-${mm}-${yyyy}`;
|
|
450
|
+
case 'mm-dd-yyyy':
|
|
451
|
+
return `${mm}-${dd}-${yyyy}`;
|
|
452
|
+
case 'mmmm dd, yyyy':
|
|
453
|
+
return `${this.monthNames[date.getMonth()]} ${dd}, ${yyyy}`;
|
|
454
|
+
default:
|
|
455
|
+
return `${mm}/${dd}/${yyyy}`;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
getFormattedValue() {
|
|
459
|
+
return this.selectedDate ? this.formatDate(this.selectedDate) : this.value;
|
|
460
|
+
}
|
|
461
|
+
getPlaceholderForFormat() {
|
|
462
|
+
switch (this.format) {
|
|
463
|
+
case 'mm/dd/yyyy':
|
|
464
|
+
return 'MM/DD/YYYY';
|
|
465
|
+
case 'dd/mm/yyyy':
|
|
466
|
+
return 'DD/MM/YYYY';
|
|
467
|
+
case 'yyyy-mm-dd':
|
|
468
|
+
return 'YYYY-MM-DD';
|
|
469
|
+
case 'yyyy/mm/dd':
|
|
470
|
+
return 'YYYY/MM/DD';
|
|
471
|
+
case 'dd-mm-yyyy':
|
|
472
|
+
return 'DD-MM-YYYY';
|
|
473
|
+
case 'mm-dd-yyyy':
|
|
474
|
+
return 'MM-DD-YYYY';
|
|
475
|
+
case 'mmmm dd, yyyy':
|
|
476
|
+
return 'Month DD, YYYY';
|
|
477
|
+
default:
|
|
478
|
+
return 'MM/DD/YYYY';
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
getDayHeaders() {
|
|
482
|
+
const days = [...this.dayNames];
|
|
483
|
+
// Rotate array based on firstDayOfWeek (0=Sunday, 1=Monday, etc.)
|
|
484
|
+
for (let i = 0; i < this.firstDayOfWeek; i++) {
|
|
485
|
+
days.push(days.shift());
|
|
486
|
+
}
|
|
487
|
+
return days.map(day => `<div class="weekday">${day}</div>`).join('');
|
|
488
|
+
}
|
|
489
|
+
getDaysGrid() {
|
|
490
|
+
const year = this.viewDate.getFullYear();
|
|
491
|
+
const month = this.viewDate.getMonth();
|
|
492
|
+
// First day of the month
|
|
493
|
+
const firstDay = new Date(year, month, 1);
|
|
494
|
+
// Last day of the month
|
|
495
|
+
const lastDay = new Date(year, month + 1, 0);
|
|
496
|
+
// Calculate starting position based on first day of week preference
|
|
497
|
+
let startingDayOfWeek = firstDay.getDay() - this.firstDayOfWeek;
|
|
498
|
+
if (startingDayOfWeek < 0)
|
|
499
|
+
startingDayOfWeek += 7;
|
|
500
|
+
const daysInMonth = lastDay.getDate();
|
|
501
|
+
const today = new Date();
|
|
502
|
+
const isToday = (date) => date.getDate() === today.getDate() &&
|
|
503
|
+
date.getMonth() === today.getMonth() &&
|
|
504
|
+
date.getFullYear() === today.getFullYear();
|
|
505
|
+
const isSelected = (date) => this.selectedDate &&
|
|
506
|
+
date.getDate() === this.selectedDate.getDate() &&
|
|
507
|
+
date.getMonth() === this.selectedDate.getMonth() &&
|
|
508
|
+
date.getFullYear() === this.selectedDate.getFullYear();
|
|
509
|
+
const isDisabled = (date) => {
|
|
510
|
+
if (this.min) {
|
|
511
|
+
const minDate = this.parseDate(this.min);
|
|
512
|
+
if (minDate && date < minDate)
|
|
513
|
+
return true;
|
|
514
|
+
}
|
|
515
|
+
if (this.max) {
|
|
516
|
+
const maxDate = this.parseDate(this.max);
|
|
517
|
+
if (maxDate && date > maxDate)
|
|
518
|
+
return true;
|
|
519
|
+
}
|
|
520
|
+
return false;
|
|
521
|
+
};
|
|
522
|
+
let html = '';
|
|
523
|
+
// Empty cells for days before month starts
|
|
524
|
+
for (let i = 0; i < startingDayOfWeek; i++) {
|
|
525
|
+
html += '<div class="day day--empty"></div>';
|
|
526
|
+
}
|
|
527
|
+
// Days of the month
|
|
528
|
+
for (let day = 1; day <= daysInMonth; day++) {
|
|
529
|
+
const date = new Date(year, month, day);
|
|
530
|
+
const classes = ['day'];
|
|
531
|
+
if (isToday(date))
|
|
532
|
+
classes.push('day--today');
|
|
533
|
+
if (isSelected(date))
|
|
534
|
+
classes.push('day--selected');
|
|
535
|
+
if (isDisabled(date))
|
|
536
|
+
classes.push('day--disabled');
|
|
537
|
+
html += `
|
|
538
|
+
<button
|
|
539
|
+
class="${classes.join(' ')}"
|
|
540
|
+
type="button"
|
|
541
|
+
data-date="${year}-${(month + 1).toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}"
|
|
542
|
+
${isDisabled(date) ? 'disabled' : ''}
|
|
543
|
+
aria-label="${this.formatDate(date)}"
|
|
544
|
+
>
|
|
545
|
+
${day}
|
|
546
|
+
</button>
|
|
547
|
+
`;
|
|
548
|
+
}
|
|
549
|
+
return html;
|
|
550
|
+
}
|
|
551
|
+
updateInputValue() {
|
|
552
|
+
if (this.input && document.activeElement !== this.input) {
|
|
553
|
+
const displayValue = this.getFormattedValue();
|
|
554
|
+
this.input.value = displayValue;
|
|
555
|
+
this.inputValue = displayValue;
|
|
556
|
+
}
|
|
557
|
+
this.updateClearButton();
|
|
558
|
+
}
|
|
559
|
+
isCompleteDate(value) {
|
|
560
|
+
if (this.format === 'mmmm dd, yyyy') {
|
|
561
|
+
return /^[A-Za-z]+\s+\d{1,2},\s+\d{4}$/.test(value);
|
|
562
|
+
}
|
|
563
|
+
const separators = (value.match(/[\/\-]/g) || []).length;
|
|
564
|
+
return separators >= 2 && value.length >= 8;
|
|
565
|
+
}
|
|
566
|
+
updateClearButton() {
|
|
567
|
+
if (this.clearButton && this.clearable) {
|
|
568
|
+
const shouldShow = this.selectedDate && !this.disabled && !this.readonly;
|
|
569
|
+
this.clearButton.style.display = shouldShow ? '' : 'none';
|
|
570
|
+
this.clearButton.classList.toggle('clear-button--visible', !!shouldShow);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
updateCalendarGrid() {
|
|
574
|
+
const calendarDays = this.calendar?.querySelector('.calendar-days');
|
|
575
|
+
const calendarTitle = this.calendar?.querySelector('.month-button');
|
|
576
|
+
if (calendarDays) {
|
|
577
|
+
calendarDays.innerHTML = this.getDaysGrid();
|
|
578
|
+
}
|
|
579
|
+
if (calendarTitle) {
|
|
580
|
+
calendarTitle.textContent = `${this.monthNames[this.viewDate.getMonth()]} ${this.viewDate.getFullYear()}`;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
setupCalendarClickOutside() {
|
|
584
|
+
document.addEventListener('click', (e) => {
|
|
585
|
+
if (!this.contains(e.target) && this.showCalendar) {
|
|
586
|
+
this.close();
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
handleInput(e) {
|
|
591
|
+
const target = e.target;
|
|
592
|
+
this.inputValue = target.value;
|
|
593
|
+
const date = this.parseDate(target.value);
|
|
594
|
+
if (date && this.isCompleteDate(target.value)) {
|
|
595
|
+
this.selectedDate = date;
|
|
596
|
+
this.viewDate = new Date(date);
|
|
597
|
+
if (this.showCalendar) {
|
|
598
|
+
this.updateCalendarGrid();
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
this.updateClearButton();
|
|
602
|
+
this.dispatchInputEvent();
|
|
603
|
+
}
|
|
604
|
+
handleChange(e) {
|
|
605
|
+
const target = e.target;
|
|
606
|
+
const date = this.parseDate(target.value);
|
|
607
|
+
if (date) {
|
|
608
|
+
this.selectedDate = date;
|
|
609
|
+
this.value = this.formatDate(date);
|
|
610
|
+
this.inputValue = this.value;
|
|
611
|
+
if (this.input) {
|
|
612
|
+
this.input.value = this.value;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
else if (target.value) {
|
|
616
|
+
this.selectedDate = null;
|
|
617
|
+
this.value = target.value;
|
|
618
|
+
this.inputValue = target.value;
|
|
619
|
+
}
|
|
620
|
+
else {
|
|
621
|
+
this.selectedDate = null;
|
|
622
|
+
this.value = '';
|
|
623
|
+
this.inputValue = '';
|
|
624
|
+
}
|
|
625
|
+
this.updateClearButton();
|
|
626
|
+
this.dispatchChangeEvent();
|
|
627
|
+
}
|
|
628
|
+
handleFocus() {
|
|
629
|
+
this.dispatchFocusEvent();
|
|
630
|
+
}
|
|
631
|
+
handleInputClick() {
|
|
632
|
+
if (!this.showCalendar && !this.disabled && !this.readonly) {
|
|
633
|
+
this.open();
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
handleBlur() {
|
|
637
|
+
this.dispatchBlurEvent();
|
|
638
|
+
}
|
|
639
|
+
handleCalendarToggle() {
|
|
640
|
+
if (this.showCalendar) {
|
|
641
|
+
this.close();
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
this.open();
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
handleClear() {
|
|
648
|
+
this.clear();
|
|
649
|
+
}
|
|
650
|
+
handleCalendarClick(e) {
|
|
651
|
+
e.stopPropagation();
|
|
652
|
+
const target = e.target;
|
|
653
|
+
if (target.closest('[data-date]')) {
|
|
654
|
+
const dateString = target.closest('[data-date]')?.getAttribute('data-date');
|
|
655
|
+
if (dateString) {
|
|
656
|
+
const date = new Date(dateString);
|
|
657
|
+
this.selectDate(date);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
else if (target.closest('[data-nav]')) {
|
|
661
|
+
const nav = target.closest('[data-nav]')?.getAttribute('data-nav');
|
|
662
|
+
this.handleNavigation(nav);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
handleKeydown(e) {
|
|
666
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
667
|
+
e.preventDefault();
|
|
668
|
+
if (!this.showCalendar) {
|
|
669
|
+
this.open();
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
else if (e.key === 'Escape' && this.showCalendar) {
|
|
673
|
+
this.close();
|
|
674
|
+
this.focus();
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
handleNavigation(nav) {
|
|
678
|
+
switch (nav) {
|
|
679
|
+
case 'prev-month':
|
|
680
|
+
this.viewDate.setMonth(this.viewDate.getMonth() - 1);
|
|
681
|
+
this.updateCalendarGrid();
|
|
682
|
+
break;
|
|
683
|
+
case 'next-month':
|
|
684
|
+
this.viewDate.setMonth(this.viewDate.getMonth() + 1);
|
|
685
|
+
this.updateCalendarGrid();
|
|
686
|
+
break;
|
|
687
|
+
case 'today':
|
|
688
|
+
this.goToToday();
|
|
689
|
+
break;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
handleValueChange() {
|
|
693
|
+
const date = this.parseDate(this.value);
|
|
694
|
+
this.selectedDate = date;
|
|
695
|
+
if (date) {
|
|
696
|
+
this.viewDate = new Date(date);
|
|
697
|
+
}
|
|
698
|
+
this.updateInputValue();
|
|
699
|
+
if (this.showCalendar) {
|
|
700
|
+
this.updateCalendarGrid();
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
// Manual DOM manipulation required since Snice is imperative
|
|
704
|
+
handleShowCalendarChange() {
|
|
705
|
+
console.log('showCalendar changed:', this.calendar);
|
|
706
|
+
if (this.calendar) {
|
|
707
|
+
if (this.showCalendar) {
|
|
708
|
+
this.calendar.removeAttribute('hidden');
|
|
709
|
+
this.dispatchOpenEvent();
|
|
710
|
+
// Focus selected date or first available date for accessibility
|
|
711
|
+
setTimeout(() => {
|
|
712
|
+
(this.selectedDayButton || this.firstDayButton)?.focus();
|
|
713
|
+
}, 100);
|
|
714
|
+
}
|
|
715
|
+
else {
|
|
716
|
+
this.calendar.setAttribute('hidden', '');
|
|
717
|
+
this.dispatchCloseEvent();
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
handleDisabledChange() {
|
|
722
|
+
if (this.input) {
|
|
723
|
+
this.input.disabled = this.disabled;
|
|
724
|
+
}
|
|
725
|
+
if (this.calendarToggle) {
|
|
726
|
+
this.calendarToggle.disabled = this.disabled;
|
|
727
|
+
}
|
|
728
|
+
this.updateClearButton();
|
|
729
|
+
}
|
|
730
|
+
handleReadonlyChange() {
|
|
731
|
+
if (this.input) {
|
|
732
|
+
this.input.readOnly = this.readonly;
|
|
733
|
+
}
|
|
734
|
+
this.updateClearButton();
|
|
735
|
+
}
|
|
736
|
+
handleInvalidChange() {
|
|
737
|
+
if (this.input) {
|
|
738
|
+
this.input.setAttribute('aria-invalid', String(this.invalid));
|
|
739
|
+
this.input.classList.toggle('input--invalid', this.invalid);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
handleFormatChange() {
|
|
743
|
+
this.updateInputValue();
|
|
744
|
+
}
|
|
745
|
+
dispatchInputEvent() {
|
|
746
|
+
return { value: this.value, datePicker: this };
|
|
747
|
+
}
|
|
748
|
+
dispatchChangeEvent() {
|
|
749
|
+
return {
|
|
750
|
+
value: this.value,
|
|
751
|
+
date: this.selectedDate,
|
|
752
|
+
formatted: this.selectedDate ? this.formatDate(this.selectedDate) : '',
|
|
753
|
+
iso: this.selectedDate ? this.selectedDate.toISOString().split('T')[0] : '',
|
|
754
|
+
datePicker: this
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
dispatchFocusEvent() {
|
|
758
|
+
return { datePicker: this };
|
|
759
|
+
}
|
|
760
|
+
dispatchBlurEvent() {
|
|
761
|
+
return { datePicker: this };
|
|
762
|
+
}
|
|
763
|
+
dispatchOpenEvent() {
|
|
764
|
+
return { datePicker: this };
|
|
765
|
+
}
|
|
766
|
+
dispatchCloseEvent() {
|
|
767
|
+
return { datePicker: this };
|
|
768
|
+
}
|
|
769
|
+
dispatchClearEvent() {
|
|
770
|
+
return { datePicker: this };
|
|
771
|
+
}
|
|
772
|
+
dispatchSelectEvent(date) {
|
|
773
|
+
return {
|
|
774
|
+
date,
|
|
775
|
+
formatted: this.formatDate(date),
|
|
776
|
+
iso: date.toISOString().split('T')[0],
|
|
777
|
+
datePicker: this
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
focus() {
|
|
781
|
+
this.input?.focus();
|
|
782
|
+
}
|
|
783
|
+
blur() {
|
|
784
|
+
this.input?.blur();
|
|
785
|
+
}
|
|
786
|
+
clear() {
|
|
787
|
+
this.selectedDate = null;
|
|
788
|
+
this.value = '';
|
|
789
|
+
this.updateInputValue();
|
|
790
|
+
this.dispatchClearEvent();
|
|
791
|
+
this.dispatchChangeEvent();
|
|
792
|
+
this.focus();
|
|
793
|
+
}
|
|
794
|
+
open() {
|
|
795
|
+
if (!this.disabled && !this.readonly) {
|
|
796
|
+
this.showCalendar = true;
|
|
797
|
+
if (this.selectedDate) {
|
|
798
|
+
this.viewDate = new Date(this.selectedDate);
|
|
799
|
+
}
|
|
800
|
+
this.updateCalendarGrid();
|
|
801
|
+
if (this.calendar) {
|
|
802
|
+
this.calendar.removeAttribute('hidden');
|
|
803
|
+
}
|
|
804
|
+
this.dispatchOpenEvent();
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
close() {
|
|
808
|
+
this.showCalendar = false;
|
|
809
|
+
if (this.calendar) {
|
|
810
|
+
this.calendar.setAttribute('hidden', '');
|
|
811
|
+
}
|
|
812
|
+
this.dispatchCloseEvent();
|
|
813
|
+
}
|
|
814
|
+
selectDate(date) {
|
|
815
|
+
this.selectedDate = date;
|
|
816
|
+
this.value = this.formatDate(date);
|
|
817
|
+
this.viewDate = new Date(date);
|
|
818
|
+
this.updateInputValue();
|
|
819
|
+
this.updateCalendarGrid();
|
|
820
|
+
this.dispatchSelectEvent(date);
|
|
821
|
+
this.dispatchChangeEvent();
|
|
822
|
+
this.close();
|
|
823
|
+
this.focus();
|
|
824
|
+
}
|
|
825
|
+
goToMonth(year, month) {
|
|
826
|
+
this.viewDate = new Date(year, month, 1);
|
|
827
|
+
this.updateCalendarGrid();
|
|
828
|
+
}
|
|
829
|
+
goToToday() {
|
|
830
|
+
const today = new Date();
|
|
831
|
+
this.selectDate(today);
|
|
832
|
+
}
|
|
833
|
+
checkValidity() {
|
|
834
|
+
return this.input?.checkValidity() ?? true;
|
|
835
|
+
}
|
|
836
|
+
reportValidity() {
|
|
837
|
+
return this.input?.reportValidity() ?? true;
|
|
838
|
+
}
|
|
839
|
+
setCustomValidity(message) {
|
|
840
|
+
this.input?.setCustomValidity(message);
|
|
841
|
+
}
|
|
842
|
+
});
|
|
843
|
+
return _classThis;
|
|
844
|
+
})();
|
|
845
|
+
|
|
846
|
+
export { SniceDatePicker };
|
|
847
|
+
//# sourceMappingURL=snice-date-picker.js.map
|