@skf-design-system/ui-components 1.0.0-alpha.34 → 1.0.0-alpha.35
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 +20 -27
- package/dist/components/accordion/accordion-item.component.d.ts +36 -0
- package/dist/components/accordion/accordion-item.component.js +98 -0
- package/dist/components/accordion/accordion-item.d.ts +3 -3
- package/dist/components/accordion/accordion-item.js +4 -5
- package/dist/components/accordion/accordion-item.styles.js +77 -0
- package/dist/components/accordion/accordion.component.d.ts +9 -13
- package/dist/components/accordion/accordion.component.js +8 -9
- package/dist/components/accordion/accordion.d.ts +0 -1
- package/dist/components/accordion/accordion.js +0 -2
- package/dist/components/alert/alert.component.d.ts +12 -12
- package/dist/components/alert/alert.component.js +57 -55
- package/dist/components/alert/alert.styles.js +50 -51
- package/dist/components/breadcrumb/breadcrumb-item.component.js +60 -0
- package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.js +6 -0
- package/dist/components/breadcrumb/breadcrumb-item.styles.js +63 -0
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +7 -4
- package/dist/components/breadcrumb/breadcrumb.component.js +65 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +6 -0
- package/dist/components/breadcrumb/breadcrumb.styles.js +25 -0
- package/dist/components/button/button.component.d.ts +17 -14
- package/dist/components/button/button.component.js +73 -61
- package/dist/components/button/button.styles.d.ts +1 -2
- package/dist/components/button/button.styles.js +13 -3
- package/dist/components/card/card.component.d.ts +4 -1
- package/dist/components/card/card.component.js +46 -36
- package/dist/components/card/card.styles.js +36 -23
- package/dist/components/checkbox/checkbox.component.d.ts +17 -13
- package/dist/components/checkbox/checkbox.component.js +74 -61
- package/dist/components/checkbox/checkbox.styles.d.ts +1 -2
- package/dist/components/checkbox/checkbox.styles.js +1 -5
- package/dist/components/datepicker/datepicker-calendar.component.d.ts +80 -0
- package/dist/components/datepicker/datepicker-calendar.component.js +415 -0
- package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
- package/dist/components/datepicker/datepicker-calendar.js +6 -0
- package/dist/components/datepicker/datepicker-calendar.styles.js +202 -0
- package/dist/components/datepicker/datepicker-popup.component.d.ts +64 -0
- package/dist/components/datepicker/datepicker-popup.component.js +261 -0
- package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
- package/dist/components/datepicker/datepicker-popup.helpers.d.ts +41 -0
- package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
- package/dist/components/datepicker/datepicker-popup.js +6 -0
- package/dist/components/datepicker/datepicker-popup.styles.js +87 -0
- package/dist/components/datepicker/datepicker.component.d.ts +121 -0
- package/dist/components/datepicker/datepicker.component.js +455 -0
- package/dist/components/datepicker/datepicker.d.ts +8 -0
- package/dist/components/datepicker/datepicker.helpers.d.ts +38 -0
- package/dist/components/datepicker/datepicker.helpers.js +31 -0
- package/dist/components/datepicker/datepicker.js +6 -0
- package/dist/components/datepicker/datepicker.styles.d.ts +1 -0
- package/dist/components/datepicker/datepicker.styles.js +18 -0
- package/dist/components/dialog/dialog.component.d.ts +20 -29
- package/dist/components/dialog/dialog.component.js +85 -75
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/dialog/dialog.styles.js +4 -4
- package/dist/components/divider/divider.component.d.ts +4 -8
- package/dist/components/divider/divider.component.js +24 -46
- package/dist/components/divider/divider.styles.js +34 -30
- package/dist/components/drawer/drawer.component.d.ts +61 -0
- package/dist/components/drawer/drawer.component.js +125 -0
- package/dist/components/drawer/drawer.d.ts +8 -0
- package/dist/components/drawer/drawer.js +6 -0
- package/dist/components/drawer/drawer.styles.js +71 -0
- package/dist/components/header/header.component.d.ts +46 -0
- package/dist/components/header/header.component.js +116 -0
- package/dist/components/header/header.d.ts +8 -0
- package/dist/components/header/header.js +6 -0
- package/dist/components/header/header.styles.js +68 -0
- package/dist/components/heading/heading.component.d.ts +8 -12
- package/dist/components/heading/heading.component.js +52 -24
- package/dist/components/heading/heading.styles.d.ts +1 -2
- package/dist/components/heading/heading.styles.js +35 -37
- package/dist/components/icon/icon.component.d.ts +19 -18
- package/dist/components/icon/icon.component.js +64 -43
- package/dist/components/icon/icon.styles.d.ts +1 -2
- package/dist/components/icon/icon.styles.js +61 -60
- package/dist/components/input/input.component.d.ts +31 -31
- package/dist/components/input/input.component.js +166 -146
- package/dist/components/input/input.controllers.d.ts +20 -6
- package/dist/components/input/input.controllers.js +14 -10
- package/dist/components/link/link.component.d.ts +12 -14
- package/dist/components/link/link.component.js +35 -34
- package/dist/components/link/link.styles.d.ts +1 -2
- package/dist/components/link/link.styles.js +24 -20
- package/dist/components/loader/loader.component.d.ts +1 -1
- package/dist/components/loader/loader.component.js +36 -40
- package/dist/components/loader/loader.styles.d.ts +1 -2
- package/dist/components/loader/loader.styles.js +40 -32
- package/dist/components/logo/logo.component.d.ts +8 -6
- package/dist/components/logo/logo.component.js +55 -51
- package/dist/components/logo/logo.styles.js +26 -16
- package/dist/components/menu/menu-item.component.d.ts +13 -0
- package/dist/components/{menu-item → menu}/menu-item.component.js +3 -3
- package/dist/components/{menu-item → menu}/menu-item.d.ts +2 -2
- package/dist/components/menu/menu.component.d.ts +10 -8
- package/dist/components/menu/menu.component.js +8 -10
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/nav/nav-item.component.d.ts +18 -0
- package/dist/components/nav/nav-item.component.js +38 -0
- package/dist/components/nav/nav-item.d.ts +8 -0
- package/dist/components/nav/nav-item.js +6 -0
- package/dist/components/nav/nav-item.styles.js +39 -0
- package/dist/components/nav/nav.component.d.ts +17 -0
- package/dist/components/nav/nav.component.js +34 -0
- package/dist/components/nav/nav.d.ts +8 -0
- package/dist/components/nav/nav.js +6 -0
- package/dist/components/nav/nav.styles.js +17 -0
- package/dist/components/popover/popover.component.d.ts +11 -8
- package/dist/components/popover/popover.component.js +24 -26
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/progress/progress.component.d.ts +2 -2
- package/dist/components/progress/progress.component.js +31 -37
- package/dist/components/progress/progress.d.ts +2 -2
- package/dist/components/progress/progress.styles.js +42 -35
- package/dist/components/radio/radio.component.d.ts +19 -13
- package/dist/components/radio/radio.component.js +12 -12
- package/dist/components/radio/radio.styles.d.ts +1 -2
- package/dist/components/radio/radio.styles.js +1 -1
- package/dist/components/segmented-button/segmented-button-item.component.d.ts +36 -0
- package/dist/components/segmented-button/segmented-button-item.component.js +56 -0
- package/dist/components/segmented-button/segmented-button-item.d.ts +8 -0
- package/dist/components/segmented-button/segmented-button-item.js +6 -0
- package/dist/components/segmented-button/segmented-button-item.styles.d.ts +1 -0
- package/dist/components/segmented-button/segmented-button-item.styles.js +62 -0
- package/dist/components/segmented-button/segmented-button.component.d.ts +30 -0
- package/dist/components/segmented-button/segmented-button.component.js +73 -0
- package/dist/components/segmented-button/segmented-button.d.ts +8 -0
- package/dist/components/segmented-button/segmented-button.js +6 -0
- package/dist/components/segmented-button/segmented-button.styles.d.ts +1 -0
- package/dist/components/segmented-button/segmented-button.styles.js +16 -0
- package/dist/components/{select-option-group → select}/select-option-group.component.js +1 -1
- package/dist/components/{select-option-group → select}/select-option-group.d.ts +2 -2
- package/dist/components/select/select-option-group.style.d.ts +1 -0
- package/dist/components/{select-option → select}/select-option.component.d.ts +9 -10
- package/dist/components/{select-option → select}/select-option.component.js +23 -23
- package/dist/components/select/select-option.controllers.d.ts +15 -0
- package/dist/components/select/select-option.styles.d.ts +1 -0
- package/dist/components/select/select.component.d.ts +18 -17
- package/dist/components/select/select.component.js +22 -23
- package/dist/components/select/select.controllers.d.ts +21 -10
- package/dist/components/select/select.controllers.js +27 -22
- package/dist/components/select/stories/select.stories.icons.d.ts +7 -0
- package/dist/components/{stepper-item → stepper}/stepper-item.component.js +48 -48
- package/dist/components/{stepper-item → stepper}/stepper-item.d.ts +2 -2
- package/dist/components/stepper/stepper-item.styles.d.ts +1 -0
- package/dist/components/stepper/stepper.component.d.ts +4 -3
- package/dist/components/stepper/stepper.component.js +15 -15
- package/dist/components/stepper/stepper.d.ts +2 -2
- package/dist/components/stepper/stepper.helpers.d.ts +1 -1
- package/dist/components/switch/switch.component.d.ts +7 -6
- package/dist/components/switch/switch.component.js +21 -21
- package/dist/components/switch/switch.d.ts +2 -2
- package/dist/components/{tab-panel → tabs}/tab-panel.component.js +1 -1
- package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
- package/dist/components/tabs/tab-panel.styles.d.ts +1 -0
- package/dist/components/{tab → tabs}/tab.component.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.component.js +1 -1
- package/dist/components/{tab → tabs}/tab.d.ts +2 -2
- package/dist/components/tabs/tab.styles.d.ts +1 -0
- package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
- package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +36 -37
- package/dist/components/tabs/tabs.d.ts +8 -0
- package/dist/components/tabs/tabs.js +6 -0
- package/dist/components/tabs/tabs.styles.d.ts +1 -0
- package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
- package/dist/components/tag/tag.component.d.ts +20 -17
- package/dist/components/tag/tag.component.js +68 -67
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.styles.js +63 -50
- package/dist/components/textarea/textarea.component.d.ts +10 -11
- package/dist/components/textarea/textarea.component.js +65 -67
- package/dist/components/{toast-item → toast}/toast-item.component.js +15 -15
- package/dist/components/{toast-item → toast}/toast-item.d.ts +2 -0
- package/dist/components/{toast-item → toast}/toast-item.js +4 -0
- package/dist/components/toast/toast-item.styles.js +18 -0
- package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.js +1 -1
- package/dist/components/toast/toast-wrapper.styles.d.ts +1 -0
- package/dist/components/toast/toast.component.d.ts +9 -5
- package/dist/components/toast/toast.component.js +32 -28
- package/dist/components/toast/toast.singleton.d.ts +6 -11
- package/dist/components/toast/toast.singleton.js +23 -23
- package/dist/components/tooltip/tooltip.component.d.ts +7 -7
- package/dist/components/tooltip/tooltip.component.js +16 -11
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/custom-elements.json +4091 -2539
- package/dist/index.d.ts +22 -9
- package/dist/index.js +111 -74
- package/dist/internal/base-classes/popover/popover.base.d.ts +24 -9
- package/dist/internal/base-classes/popover/popover.base.js +138 -77
- package/dist/internal/base-classes/popover/popover.styles.js +14 -1
- package/dist/internal/components/hint/hint.component.d.ts +2 -2
- package/dist/internal/components/hint/hint.component.js +2 -2
- package/dist/internal/components/hint/hint.styles.d.ts +1 -2
- package/dist/internal/components/hint/hint.styles.js +1 -1
- package/dist/internal/components/skf-element.d.ts +1 -3
- package/dist/internal/components/skf-element.js +4 -9
- package/dist/internal/constants/iconSeverity.d.ts +3 -2
- package/dist/internal/constants/iconSeverity.js +2 -3
- package/dist/internal/controllers/elementOverflowController.d.ts +13 -0
- package/dist/internal/controllers/popover.controller.d.ts +12 -6
- package/dist/internal/controllers/popover.controller.js +9 -14
- package/dist/internal/helpers/dateFormatter.d.ts +2 -0
- package/dist/internal/helpers/hintSeverity.d.ts +2 -2
- package/dist/internal/helpers/hintSeverity.js +1 -1
- package/dist/internal/helpers/stateMap.d.ts +14 -0
- package/dist/internal/helpers/stateMap.js +68 -0
- package/dist/internal/helpers/utilityTypes.d.ts +22 -0
- package/dist/internal/helpers/uuid.d.ts +15 -0
- package/dist/internal/helpers/uuid.js +14 -0
- package/dist/internal/helpers/watch.d.ts +1 -1
- package/dist/internal/helpers/watch.js +12 -12
- package/dist/internal/storybook/styles.d.ts +1 -0
- package/dist/internal/types/formField.d.ts +1 -1
- package/dist/internal/types.d.ts +18 -0
- package/dist/styles/component.styles.d.ts +1 -2
- package/dist/styles/component.styles.js +38 -37
- package/dist/styles/form-field.styles.js +11 -6
- package/dist/styles/global-alt.css +1 -0
- package/dist/styles/global.css +1 -1
- package/dist/types/jsx/custom-element-jsx.d.ts +740 -1294
- package/dist/types/vue/index.d.ts +543 -322
- package/dist/vscode.html-custom-data.json +526 -1076
- package/dist/web-types.json +1237 -761
- package/package.json +45 -61
- package/dist/components/accordion/accordion.test.d.ts +0 -1
- package/dist/components/checkbox/checkbox.test.d.ts +0 -1
- package/dist/components/collapse/collapse.component.d.ts +0 -40
- package/dist/components/collapse/collapse.component.js +0 -86
- package/dist/components/collapse/collapse.d.ts +0 -8
- package/dist/components/collapse/collapse.js +0 -6
- package/dist/components/collapse/collapse.styles.d.ts +0 -2
- package/dist/components/collapse/collapse.styles.js +0 -77
- package/dist/components/collapse/collapse.test.d.ts +0 -1
- package/dist/components/input/input.test.d.ts +0 -1
- package/dist/components/menu-item/menu-item.component.d.ts +0 -25
- package/dist/components/radio/radio.test.d.ts +0 -1
- package/dist/components/select-option/select-option.controllers.d.ts +0 -9
- package/dist/components/switch/switch.test.d.ts +0 -1
- package/dist/components/tab-group/tab-group.d.ts +0 -8
- package/dist/components/tab-group/tab-group.js +0 -6
- package/dist/components/toast-item/toast-item.styles.js +0 -16
- package/dist/internal/constants/heading.d.ts +0 -2
- package/dist/internal/playwright/index.d.ts +0 -1
- package/dist/react/index.d.ts +0 -35
- package/dist/react/index.js +0 -35
- package/dist/react/skf-accordion/index.d.ts +0 -3
- package/dist/react/skf-accordion/index.js +0 -13
- package/dist/react/skf-alert/index.d.ts +0 -9
- package/dist/react/skf-alert/index.js +0 -17
- package/dist/react/skf-breadcrumb/index.d.ts +0 -9
- package/dist/react/skf-breadcrumb/index.js +0 -17
- package/dist/react/skf-breadcrumb-item/index.d.ts +0 -3
- package/dist/react/skf-breadcrumb-item/index.js +0 -13
- package/dist/react/skf-button/index.d.ts +0 -9
- package/dist/react/skf-button/index.js +0 -17
- package/dist/react/skf-card/index.d.ts +0 -3
- package/dist/react/skf-card/index.js +0 -13
- package/dist/react/skf-checkbox/index.d.ts +0 -9
- package/dist/react/skf-checkbox/index.js +0 -17
- package/dist/react/skf-collapse/index.d.ts +0 -9
- package/dist/react/skf-collapse/index.js +0 -17
- package/dist/react/skf-dialog/index.d.ts +0 -15
- package/dist/react/skf-dialog/index.js +0 -19
- package/dist/react/skf-divider/index.d.ts +0 -3
- package/dist/react/skf-divider/index.js +0 -13
- package/dist/react/skf-heading/index.d.ts +0 -3
- package/dist/react/skf-heading/index.js +0 -13
- package/dist/react/skf-icon/index.d.ts +0 -3
- package/dist/react/skf-icon/index.js +0 -13
- package/dist/react/skf-input/index.d.ts +0 -12
- package/dist/react/skf-input/index.js +0 -18
- package/dist/react/skf-link/index.d.ts +0 -3
- package/dist/react/skf-link/index.js +0 -13
- package/dist/react/skf-loader/index.d.ts +0 -3
- package/dist/react/skf-loader/index.js +0 -13
- package/dist/react/skf-logo/index.d.ts +0 -3
- package/dist/react/skf-logo/index.js +0 -13
- package/dist/react/skf-menu/index.d.ts +0 -12
- package/dist/react/skf-menu/index.js +0 -18
- package/dist/react/skf-menu-item/index.d.ts +0 -27
- package/dist/react/skf-menu-item/index.js +0 -23
- package/dist/react/skf-popover/index.d.ts +0 -12
- package/dist/react/skf-popover/index.js +0 -18
- package/dist/react/skf-progress/index.d.ts +0 -3
- package/dist/react/skf-progress/index.js +0 -13
- package/dist/react/skf-radio/index.d.ts +0 -9
- package/dist/react/skf-radio/index.js +0 -17
- package/dist/react/skf-select/index.d.ts +0 -21
- package/dist/react/skf-select/index.js +0 -21
- package/dist/react/skf-select-option/index.d.ts +0 -9
- package/dist/react/skf-select-option/index.js +0 -17
- package/dist/react/skf-select-option-group/index.d.ts +0 -3
- package/dist/react/skf-select-option-group/index.js +0 -13
- package/dist/react/skf-stepper/index.d.ts +0 -9
- package/dist/react/skf-stepper/index.js +0 -17
- package/dist/react/skf-stepper-item/index.d.ts +0 -9
- package/dist/react/skf-stepper-item/index.js +0 -17
- package/dist/react/skf-switch/index.d.ts +0 -3
- package/dist/react/skf-switch/index.js +0 -13
- package/dist/react/skf-tab/index.d.ts +0 -12
- package/dist/react/skf-tab/index.js +0 -18
- package/dist/react/skf-tab-group/index.d.ts +0 -3
- package/dist/react/skf-tab-group/index.js +0 -13
- package/dist/react/skf-tab-panel/index.d.ts +0 -3
- package/dist/react/skf-tab-panel/index.js +0 -13
- package/dist/react/skf-tag/index.d.ts +0 -3
- package/dist/react/skf-tag/index.js +0 -13
- package/dist/react/skf-textarea/index.d.ts +0 -12
- package/dist/react/skf-textarea/index.js +0 -18
- package/dist/react/skf-toast/index.d.ts +0 -3
- package/dist/react/skf-toast/index.js +0 -13
- package/dist/react/skf-toast-wrapper/index.d.ts +0 -3
- package/dist/react/skf-toast-wrapper/index.js +0 -13
- package/dist/react/skf-tooltip/index.d.ts +0 -12
- package/dist/react/skf-tooltip/index.js +0 -18
- /package/dist/components/{breadcrumb-item/breadcrumb-item.styles.d.ts → accordion/accordion-item.styles.d.ts} +0 -0
- /package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.component.d.ts +0 -0
- /package/dist/components/{menu-item/menu-item.styles.d.ts → breadcrumb/breadcrumb-item.styles.d.ts} +0 -0
- /package/dist/components/{select-option-group/select-option-group.style.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
- /package/dist/components/{select-option/select-option.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
- /package/dist/components/{stepper-item/stepper-item.styles.d.ts → drawer/drawer.styles.d.ts} +0 -0
- /package/dist/components/{tab-group/tab-group.styles.d.ts → header/header.styles.d.ts} +0 -0
- /package/dist/components/{menu-item → menu}/menu-item.js +0 -0
- /package/dist/components/{tab-panel/tab-panel.styles.d.ts → menu/menu-item.styles.d.ts} +0 -0
- /package/dist/components/{menu-item → menu}/menu-item.styles.js +0 -0
- /package/dist/components/{tab/tab.styles.d.ts → nav/nav-item.styles.d.ts} +0 -0
- /package/dist/components/{toast-wrapper/toast-wrapper.styles.d.ts → nav/nav.styles.d.ts} +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.component.d.ts +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.js +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.style.js +0 -0
- /package/dist/components/{select-option → select}/select-option.d.ts +0 -0
- /package/dist/components/{select-option → select}/select-option.js +0 -0
- /package/dist/components/{select-option → select}/select-option.styles.js +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.component.d.ts +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.js +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.styles.js +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
- /package/dist/components/{tab → tabs}/tab.js +0 -0
- /package/dist/components/{tab → tabs}/tab.styles.js +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.component.d.ts +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.styles.d.ts +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.d.ts +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.d.ts +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.js +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.styles.js +0 -0
@@ -0,0 +1,261 @@
|
|
1
|
+
import "../button/button.js";
|
2
|
+
import { SkfElement as v } from "../../internal/components/skf-element.js";
|
3
|
+
import { watch as p } from "../../internal/helpers/watch.js";
|
4
|
+
import { componentStyles as R } from "../../styles/component.styles.js";
|
5
|
+
import { html as D } from "lit";
|
6
|
+
import { property as o, state as m } from "lit/decorators.js";
|
7
|
+
import "./datepicker-calendar.js";
|
8
|
+
import { getDateParts as g, assertISODate as S, earliestDate as $, latestDate as T, compareDates as c, doAnimate as b } from "./datepicker-popup.helpers.js";
|
9
|
+
import { styles as C } from "./datepicker-popup.styles.js";
|
10
|
+
import { dateFormatter as l, is as k } from "./datepicker.helpers.js";
|
11
|
+
var F = Object.defineProperty, E = Object.getOwnPropertyDescriptor, n = (w, e, t, a) => {
|
12
|
+
for (var s = a > 1 ? void 0 : a ? E(e, t) : e, r = w.length - 1, d; r >= 0; r--)
|
13
|
+
(d = w[r]) && (s = (a ? d(e, t, s) : d(s)) || s);
|
14
|
+
return a && s && F(e, t, s), s;
|
15
|
+
};
|
16
|
+
const y = class y extends v {
|
17
|
+
constructor() {
|
18
|
+
super(...arguments), this.locale = "en-CA", this.date = (/* @__PURE__ */ new Date()).toLocaleDateString(this.locale), this.id = "", this.range = !1, this.selectedDate = void 0, this.selectedDateRange = {
|
19
|
+
start: null,
|
20
|
+
end: null
|
21
|
+
}, this._datePlusOneMonth = new Date(
|
22
|
+
new Date(this.date).getFullYear(),
|
23
|
+
new Date(this.date).getMonth() + 1,
|
24
|
+
1
|
25
|
+
), this._handleCalendarView = (e) => {
|
26
|
+
this._handleChangeCalendarView(e.detail);
|
27
|
+
}, this._handleSelectedDate = (e) => {
|
28
|
+
var t;
|
29
|
+
if (this.selectedDate = e.detail.date, console.log("selectedDate", this.selectedDate), this.range) {
|
30
|
+
const a = (t = this.shadowRoot) == null ? void 0 : t.querySelectorAll("skf-datepicker-calendar"), s = this.selectedDateRange, r = s.start && this.selectedDate < s.start;
|
31
|
+
if (!!(s.start && s.end) || r)
|
32
|
+
this.selectedDateRange = {
|
33
|
+
start: this.selectedDate,
|
34
|
+
end: null
|
35
|
+
};
|
36
|
+
else {
|
37
|
+
const f = !!s.start ? { end: e.detail.date } : { start: e.detail.date };
|
38
|
+
this.selectedDateRange = {
|
39
|
+
...s,
|
40
|
+
...f
|
41
|
+
};
|
42
|
+
}
|
43
|
+
this._onRangeCompleteEmitEvent(), a != null && a.length && [...a].forEach((h) => {
|
44
|
+
h.selectedDateRange = this.selectedDateRange;
|
45
|
+
});
|
46
|
+
}
|
47
|
+
this.emit("skf-datepicker-selected", {
|
48
|
+
detail: { date: this.range ? this.selectedDateRange : this.selectedDate }
|
49
|
+
}), this.requestUpdate();
|
50
|
+
}, this._handleTodayClick = () => {
|
51
|
+
const { month: e, year: t } = g(), { month: a, year: s } = g(this.date);
|
52
|
+
if (a === e && s === t && (this.selectedDateRange.start || this.selectedDate)) {
|
53
|
+
this.date = l(this.selectedDateRange.start ?? this.selectedDate), this.emit("update-calendar-view", {
|
54
|
+
detail: this.date
|
55
|
+
});
|
56
|
+
return;
|
57
|
+
}
|
58
|
+
if (this.range) {
|
59
|
+
this.emit("update-calendar-view", {
|
60
|
+
detail: l(/* @__PURE__ */ new Date())
|
61
|
+
});
|
62
|
+
return;
|
63
|
+
}
|
64
|
+
this.date = l(/* @__PURE__ */ new Date());
|
65
|
+
};
|
66
|
+
}
|
67
|
+
connectedCallback() {
|
68
|
+
super.connectedCallback(), this.addEventListener("update-calendar-view", this._handleCalendarView), this.addEventListener("selected-date-changed", this._handleSelectedDate);
|
69
|
+
}
|
70
|
+
firstUpdated() {
|
71
|
+
(this.selectedDateRange.start ?? this.selectedDate) && this._onRangeCompleteEmitEvent();
|
72
|
+
const t = this.selectedDate ?? this.selectedDateRange.start;
|
73
|
+
t instanceof Date && this.gotoDate(t);
|
74
|
+
}
|
75
|
+
clearSelection() {
|
76
|
+
this.selectedDateRange = {
|
77
|
+
start: null,
|
78
|
+
end: null
|
79
|
+
}, this.selectedDate = void 0;
|
80
|
+
}
|
81
|
+
/** @internal */
|
82
|
+
_onRangeCompleteEmitEvent() {
|
83
|
+
if (!this.selectedDateRange.start || !this.selectedDateRange.end) return;
|
84
|
+
const e = Math.abs(
|
85
|
+
this.selectedDateRange.end.getTime() - this.selectedDateRange.start.getTime()
|
86
|
+
), t = Math.ceil(e / (1e3 * 60 * 60 * 24)) + 1;
|
87
|
+
this.emit("selected-date-range-changed", {
|
88
|
+
detail: {
|
89
|
+
...this.selectedDateRange,
|
90
|
+
days: t,
|
91
|
+
id: this.id
|
92
|
+
}
|
93
|
+
});
|
94
|
+
}
|
95
|
+
_handleRangeChange() {
|
96
|
+
this.style.setProperty("--max-width", this.range ? "43em" : "21em");
|
97
|
+
}
|
98
|
+
_handleDateChange() {
|
99
|
+
console.log("%cdate changed", "color:red", this.date), this.date = this.date && S(this.date) ? this.date : l(/* @__PURE__ */ new Date()), this.date = $(
|
100
|
+
T(this.date, this.selectableFrom ?? this.date),
|
101
|
+
this.selectableTo ?? this.date
|
102
|
+
), this._date = new Date(this.date), this._datePlusOneMonth = new Date(this._date.getFullYear(), this._date.getMonth() + 1, 1);
|
103
|
+
}
|
104
|
+
_handleSelectedDateRangeChange() {
|
105
|
+
}
|
106
|
+
_handleSelectedDateChange() {
|
107
|
+
console.log("selected date changed", this.selectedDate);
|
108
|
+
}
|
109
|
+
/**
|
110
|
+
* Navigates to the given date.
|
111
|
+
* @param date - The date to navigate to, either a Date object or a string in the format 'yyyy-mm-dd'
|
112
|
+
*/
|
113
|
+
gotoDate(e) {
|
114
|
+
if (e instanceof Date)
|
115
|
+
this.date = l(e);
|
116
|
+
else if (k(e).dateISO())
|
117
|
+
this.date = e;
|
118
|
+
else
|
119
|
+
throw new Error("Invalid date format");
|
120
|
+
this.emit("update-calendar-view", {
|
121
|
+
detail: e
|
122
|
+
});
|
123
|
+
}
|
124
|
+
render() {
|
125
|
+
return D`
|
126
|
+
<div class="calendar-container">
|
127
|
+
<skf-datepicker-calendar
|
128
|
+
.date=${this._date ?? /* @__PURE__ */ new Date()}
|
129
|
+
.eventid="${this.id}"
|
130
|
+
.range=${this.range}
|
131
|
+
.selectedDate=${this.selectedDate}
|
132
|
+
.selectedDateRange=${this.selectedDateRange}
|
133
|
+
.selectableFrom=${this.selectableFrom}
|
134
|
+
.selectableTo=${this.selectableTo}
|
135
|
+
.invalidDates=${this.invalidDates}
|
136
|
+
class="start"
|
137
|
+
id=${this.id}
|
138
|
+
locale="${this.locale}"
|
139
|
+
></skf-datepicker-calendar>
|
140
|
+
<skf-datepicker-calendar
|
141
|
+
?hidden=${!this.range}
|
142
|
+
.date=${this._datePlusOneMonth}
|
143
|
+
.eventid="${this.id}"
|
144
|
+
.range=${!0}
|
145
|
+
.selectedDate="${this.selectedDate}"
|
146
|
+
.selectedDateRange=${this.selectedDateRange}
|
147
|
+
.selectableFrom=${this.selectableFrom}
|
148
|
+
.selectableTo=${this.selectableTo}
|
149
|
+
.invalidDates=${this.invalidDates}
|
150
|
+
class="end"
|
151
|
+
id=${`${this.id}-range-end`}
|
152
|
+
locale="${this.locale}"
|
153
|
+
></skf-datepicker-calendar>
|
154
|
+
</div>
|
155
|
+
${this._renderTodayBtn()}
|
156
|
+
<slot></slot>
|
157
|
+
<div class="triangle"></div>
|
158
|
+
`;
|
159
|
+
}
|
160
|
+
/** @internal */
|
161
|
+
_renderTodayBtn() {
|
162
|
+
let e = !1;
|
163
|
+
if (this.selectableTo && c(this.selectableTo, l(/* @__PURE__ */ new Date())) === -1)
|
164
|
+
return D``;
|
165
|
+
if (this.selectableFrom && c(this.selectableFrom, l(/* @__PURE__ */ new Date())) === 1)
|
166
|
+
return D``;
|
167
|
+
const { month: t, year: a } = g(), { month: s, year: r } = g(this.date), d = this.selectedDate ?? this.selectedDateRange.start, h = t === s && a === r, f = d && c(l(/* @__PURE__ */ new Date()), l(d), "months") === 0;
|
168
|
+
return (h && !d || f && h) && (e = !0), D`
|
169
|
+
<div class="today">
|
170
|
+
<skf-button
|
171
|
+
@click=${this._handleTodayClick}
|
172
|
+
?disabled=${e}
|
173
|
+
variant="tertiary"
|
174
|
+
size="sm"
|
175
|
+
>
|
176
|
+
${_(this.date) && (this.selectedDate || this.selectedDateRange.start) && !e ? "Selected date" : "Today"}
|
177
|
+
</skf-button>
|
178
|
+
</div>
|
179
|
+
`;
|
180
|
+
function _(u) {
|
181
|
+
return c(u, l(/* @__PURE__ */ new Date()), "months") === 0;
|
182
|
+
}
|
183
|
+
}
|
184
|
+
/** @internal */
|
185
|
+
_handleChangeCalendarView(e) {
|
186
|
+
const t = c(this.date, e);
|
187
|
+
this._animateView(t, () => {
|
188
|
+
this.date = e;
|
189
|
+
}).then(() => {
|
190
|
+
}).catch((a) => {
|
191
|
+
console.error(a);
|
192
|
+
});
|
193
|
+
}
|
194
|
+
/** @internal */
|
195
|
+
async _animateView(e, t) {
|
196
|
+
if (!this.shadowRoot) return;
|
197
|
+
const a = [...this.shadowRoot.querySelectorAll("skf-datepicker-calendar")];
|
198
|
+
return a.length ? (await b(
|
199
|
+
a,
|
200
|
+
[{ opacity: 0, transform: `translateX(calc(16px * ${e.toString()}))` }],
|
201
|
+
{ duration: 100, easing: "ease-in", fill: "backwards" }
|
202
|
+
), t(), await b(
|
203
|
+
a,
|
204
|
+
[
|
205
|
+
{ opacity: 0, transform: `translateX(${(-16 * e).toString()}px)` },
|
206
|
+
{ opacity: 1, transform: "translateX(0)" }
|
207
|
+
],
|
208
|
+
{ duration: 100, easing: "ease-out", fill: "backwards" }
|
209
|
+
)) : Promise.resolve();
|
210
|
+
}
|
211
|
+
};
|
212
|
+
y.styles = [R, C];
|
213
|
+
let i = y;
|
214
|
+
n([
|
215
|
+
o({ reflect: !0 })
|
216
|
+
], i.prototype, "locale", 2);
|
217
|
+
n([
|
218
|
+
o({ type: String, reflect: !0 })
|
219
|
+
], i.prototype, "date", 2);
|
220
|
+
n([
|
221
|
+
o({ type: String })
|
222
|
+
], i.prototype, "id", 2);
|
223
|
+
n([
|
224
|
+
o({ attribute: "invalid-dates" })
|
225
|
+
], i.prototype, "invalidDates", 2);
|
226
|
+
n([
|
227
|
+
o({ type: Boolean })
|
228
|
+
], i.prototype, "range", 2);
|
229
|
+
n([
|
230
|
+
m()
|
231
|
+
], i.prototype, "selectedDate", 2);
|
232
|
+
n([
|
233
|
+
o({ attribute: "selectable-from" })
|
234
|
+
], i.prototype, "selectableFrom", 2);
|
235
|
+
n([
|
236
|
+
o({ attribute: "selectable-to" })
|
237
|
+
], i.prototype, "selectableTo", 2);
|
238
|
+
n([
|
239
|
+
m()
|
240
|
+
], i.prototype, "selectedDateRange", 2);
|
241
|
+
n([
|
242
|
+
m()
|
243
|
+
], i.prototype, "_date", 2);
|
244
|
+
n([
|
245
|
+
m()
|
246
|
+
], i.prototype, "_datePlusOneMonth", 2);
|
247
|
+
n([
|
248
|
+
p("range")
|
249
|
+
], i.prototype, "_handleRangeChange", 1);
|
250
|
+
n([
|
251
|
+
p("date")
|
252
|
+
], i.prototype, "_handleDateChange", 1);
|
253
|
+
n([
|
254
|
+
p("selectedDateRange")
|
255
|
+
], i.prototype, "_handleSelectedDateRangeChange", 1);
|
256
|
+
n([
|
257
|
+
p("selectedDate")
|
258
|
+
], i.prototype, "_handleSelectedDateChange", 1);
|
259
|
+
export {
|
260
|
+
i as SkfDatepickerPopup
|
261
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { SkfDatepickerPopup } from './datepicker-popup.component.js';
|
2
|
+
export * from './datepicker-popup.component.js';
|
3
|
+
export default SkfDatepickerPopup;
|
4
|
+
declare global {
|
5
|
+
interface HTMLElementTagNameMap {
|
6
|
+
'skf-datepicker-popup': SkfDatepickerPopup;
|
7
|
+
}
|
8
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
2
|
+
/**
|
3
|
+
* A nifty little waapi wrapper helper that
|
4
|
+
* mainly turns the onfinished callback to a promise.
|
5
|
+
* But also allows animations on multiple targets.
|
6
|
+
*/
|
7
|
+
export declare function doAnimate(target: Element | Element[] | HTMLElement | HTMLElement[], keyframes: Keyframe | Keyframe[], options: KeyframeAnimationOptions): Promise<PromiseSettledResult<any>[]>;
|
8
|
+
/**
|
9
|
+
* @param date - optional date to get parts from, uses todays date if not provided
|
10
|
+
* @returns destructable object with year, month and day. NB: month is 0 based.
|
11
|
+
*/
|
12
|
+
export declare function getDateParts(date?: undefined | string | Date | Temporal.PlainDate): {
|
13
|
+
year: number;
|
14
|
+
month: number;
|
15
|
+
day: number;
|
16
|
+
};
|
17
|
+
/**
|
18
|
+
* @param dateOne - first date to compare as string
|
19
|
+
* @param dateTwo - second date to compare as string
|
20
|
+
* @param granularity - the unit to compare the dates by [days, months, years], defaults to days
|
21
|
+
* @returns - 0 if the dates are the same, 1 if dateOne is after dateTwo, -1 if dateOne is before dateTwo
|
22
|
+
*/
|
23
|
+
export declare function compareDates(dateOne: Temporal.PlainDate | string, dateTwo: Temporal.PlainDate | string, granularity?: 'days' | 'months' | 'years'): 0 | 1 | -1;
|
24
|
+
/**
|
25
|
+
* @param dateOne - first date to compare as string (accepts Date and Temporal.PlainDate too)
|
26
|
+
* @param dateTwo - second date to compare as string (accepts Date and Temporal.PlainDate too)
|
27
|
+
* @param unit - the unit to compare the dates by [days, months, years]
|
28
|
+
* @returns the difference between the two dates in the specified unit
|
29
|
+
*/
|
30
|
+
export declare function timeBetween(dateOne: Temporal.PlainDate | Date | string, dateTwo: Temporal.PlainDate | Date | string, unit?: 'days' | 'months' | 'years'): number;
|
31
|
+
/**
|
32
|
+
* @param dates - a list of dates to compare
|
33
|
+
* @returns - the earliest date of the list
|
34
|
+
*/
|
35
|
+
export declare function earliestDate(...dates: (string | Date)[]): string;
|
36
|
+
/**
|
37
|
+
* @param dates - a list of dates to compare
|
38
|
+
* @returns the latest date of the list
|
39
|
+
*/
|
40
|
+
export declare function latestDate(...dates: (string | Date)[]): string;
|
41
|
+
export declare function assertISODate(date: string | Temporal.PlainDate | Date, throwErr?: boolean): string;
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { Temporal as a } from "@js-temporal/polyfill";
|
2
|
+
import { is as c } from "./datepicker.helpers.js";
|
3
|
+
function I(t, n, i) {
|
4
|
+
const s = (o) => Array.isArray(o) ? o : [o], r = s(t);
|
5
|
+
n = s(n);
|
6
|
+
const l = [];
|
7
|
+
for (const o of r) {
|
8
|
+
const { promise: e, resolve: m, reject: p } = Promise.withResolvers(), f = o.animate(n, {
|
9
|
+
fill: "forwards",
|
10
|
+
duration: 300,
|
11
|
+
iterations: 1,
|
12
|
+
...i
|
13
|
+
});
|
14
|
+
f.onfinish = () => m("finished"), f.oncancel = () => p("canceled"), l.push(e);
|
15
|
+
}
|
16
|
+
return Promise.allSettled(l);
|
17
|
+
}
|
18
|
+
function P(t = a.Now.plainDateISO()) {
|
19
|
+
return t ?? (t = a.Now.plainDateISO()), t instanceof Date && (t = a.PlainDate.from(t.toISOString())), typeof t == "string" && (t = a.PlainDate.from(g(t, !0))), {
|
20
|
+
year: t.year,
|
21
|
+
month: t.month - 1,
|
22
|
+
// new Date is 0 based
|
23
|
+
day: t.day
|
24
|
+
};
|
25
|
+
}
|
26
|
+
function v(t, n, i = "days") {
|
27
|
+
console.assert(c(t, n).plainISO(), "Invalid dates passed to compareDates()"), typeof t == "string" && (t = a.PlainDate.from(t)), typeof n == "string" && (n = a.PlainDate.from(n)), console.assert(
|
28
|
+
c(t, n).plain(),
|
29
|
+
`Invalid date was sent to helper function compareDates(). Got ${JSON.stringify(t)} and ${JSON.stringify(n)} passed in`
|
30
|
+
);
|
31
|
+
const s = u(t, n, i);
|
32
|
+
return r(s);
|
33
|
+
function r(l) {
|
34
|
+
return Math.max(-1, Math.min(l, 1));
|
35
|
+
}
|
36
|
+
}
|
37
|
+
function u(t, n, i = "days") {
|
38
|
+
if (t = s(t), n = s(n), console.assert(
|
39
|
+
t instanceof a.PlainDate && n instanceof a.PlainDate,
|
40
|
+
`Invalid date was sent to helper function timeBetween(). Got ${JSON.stringify(t)} and ${JSON.stringify(n)} passed in`
|
41
|
+
), i === "months")
|
42
|
+
return n.until(t, { largestUnit: "months" }).months;
|
43
|
+
if (i === "years")
|
44
|
+
return n.until(t, { largestUnit: "years" }).years;
|
45
|
+
return n.until(t, { largestUnit: "days" }).days;
|
46
|
+
function s(r) {
|
47
|
+
return r instanceof Date ? a.PlainDate.from(r.toISOString().split("T")[0]) : typeof r == "string" ? a.PlainDate.from(r.includes("T") ? r.split("T")[0] : r) : r;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
function D(...t) {
|
51
|
+
if (t.length === 0)
|
52
|
+
throw new Error("At least one date must be provided");
|
53
|
+
const n = (e) => e instanceof Date, i = t.map((e) => n(e) ? e : new Date(e));
|
54
|
+
if (i.length === 1)
|
55
|
+
return i[0].toISOString().split("T")[0];
|
56
|
+
const [s, ...r] = i, l = D(...r), o = new Date(l);
|
57
|
+
return s < o ? s.toISOString().split("T")[0] : o.toISOString().split("T")[0];
|
58
|
+
}
|
59
|
+
function S(...t) {
|
60
|
+
if (t.length === 0)
|
61
|
+
throw new Error("At least one date must be provided");
|
62
|
+
const n = (e) => e instanceof Date, i = t.map((e) => n(e) ? e : new Date(e));
|
63
|
+
if (i.length === 1)
|
64
|
+
return i[0].toISOString().split("T")[0];
|
65
|
+
const [s, ...r] = i, l = S(...r), o = new Date(l);
|
66
|
+
return s > o ? s.toISOString().split("T")[0] : o.toISOString().split("T")[0];
|
67
|
+
}
|
68
|
+
function g(t, n = !1) {
|
69
|
+
t instanceof Date && (t = a.PlainDate.from(t.toISOString().split("T")[0])), typeof t != "string" && (t = t.toString());
|
70
|
+
const i = /^\d{4}-\d{2}-\d{2}$/;
|
71
|
+
if (!i.test(t) && n)
|
72
|
+
throw new Error(`Invalid date format. Got ${t} passed in.`);
|
73
|
+
return i.test(t) ? t : "";
|
74
|
+
}
|
75
|
+
export {
|
76
|
+
g as assertISODate,
|
77
|
+
v as compareDates,
|
78
|
+
I as doAnimate,
|
79
|
+
D as earliestDate,
|
80
|
+
P as getDateParts,
|
81
|
+
S as latestDate,
|
82
|
+
u as timeBetween
|
83
|
+
};
|
@@ -0,0 +1,87 @@
|
|
1
|
+
import { css as r } from "lit";
|
2
|
+
const e = r`
|
3
|
+
@layer components {
|
4
|
+
:host {
|
5
|
+
--max-width: 21em;
|
6
|
+
--day-outline: transparent;
|
7
|
+
|
8
|
+
background-color: var(--skf-bg-color-neutral-1);
|
9
|
+
border: solid 1px var(--skf-border-color-primary);
|
10
|
+
border-radius: 3px;
|
11
|
+
box-shadow: 0 0 10px rgb(0 0 0 / 30%);
|
12
|
+
box-sizing: border-box;
|
13
|
+
display: block;
|
14
|
+
font-family: Helvetica, sans-serif;
|
15
|
+
font-size: 0.7rem;
|
16
|
+
max-width: var(--max-width);
|
17
|
+
position: relative;
|
18
|
+
}
|
19
|
+
|
20
|
+
.triangle {
|
21
|
+
border: 10px solid transparent;
|
22
|
+
border-bottom-color: #fff;
|
23
|
+
border-top: 0;
|
24
|
+
display: block;
|
25
|
+
height: 0;
|
26
|
+
left: 50%;
|
27
|
+
margin-left: -10px;
|
28
|
+
position: absolute;
|
29
|
+
top: -10px;
|
30
|
+
width: 0;
|
31
|
+
}
|
32
|
+
|
33
|
+
:host([hidden]) {
|
34
|
+
display: none !important;
|
35
|
+
}
|
36
|
+
|
37
|
+
.calendar-container {
|
38
|
+
display: flex;
|
39
|
+
flex-direction: row;
|
40
|
+
gap: var(--skf-text-color-primary);
|
41
|
+
justify-content: space-between;
|
42
|
+
overflow: hidden;
|
43
|
+
padding: var(--skf-spacing-50);
|
44
|
+
}
|
45
|
+
|
46
|
+
skf-datepicker-calendar {
|
47
|
+
margin: var(--skf-spacing-50) var(--skf-spacing-50) 0 var(--skf-spacing-50);
|
48
|
+
}
|
49
|
+
|
50
|
+
.today {
|
51
|
+
border-top: 1px solid var(--skf-border-color-primary);
|
52
|
+
margin-bottom: 0.5rem;
|
53
|
+
padding-top: 0.5rem;
|
54
|
+
text-align: center;
|
55
|
+
|
56
|
+
button {
|
57
|
+
background-color: #333;
|
58
|
+
border-radius: 4px;
|
59
|
+
color: white;
|
60
|
+
padding-inline: 0.7em;
|
61
|
+
transition: background-color 0.2s;
|
62
|
+
|
63
|
+
&[disabled] {
|
64
|
+
opacity: 0.5;
|
65
|
+
pointer-events: none;
|
66
|
+
}
|
67
|
+
|
68
|
+
&:hover {
|
69
|
+
background-color: var(--skf-interactive-bg-color-primary);
|
70
|
+
}
|
71
|
+
|
72
|
+
&:active {
|
73
|
+
background-color: lch(from var(--skf-interactive-bg-color-primary) calc(l - 5) c h);
|
74
|
+
}
|
75
|
+
|
76
|
+
&:focus-visible {
|
77
|
+
border-radius: 0.2em;
|
78
|
+
outline: 2px solid #469;
|
79
|
+
outline-offset: 2px;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
84
|
+
`;
|
85
|
+
export {
|
86
|
+
e as styles
|
87
|
+
};
|
@@ -0,0 +1,121 @@
|
|
1
|
+
import '../icon/icon.js';
|
2
|
+
import { FormBase } from '../../internal/components/formBase.js';
|
3
|
+
import '../../internal/components/hint/hint.js';
|
4
|
+
import { PopoverController } from '../../internal/controllers/popover.controller.js';
|
5
|
+
import type { FormFieldBaseProps } from '../../internal/types/formField.js';
|
6
|
+
import { type CSSResultGroup } from 'lit';
|
7
|
+
import type { SkfDatepickerPopup, SkfDatepickerPopupDateRange } from './datepicker-popup.component.js';
|
8
|
+
import './datepicker-popup.js';
|
9
|
+
/**
|
10
|
+
* @tagname skf-datepicker
|
11
|
+
*/
|
12
|
+
export declare class SkfDatepicker extends FormBase {
|
13
|
+
/** @internal */
|
14
|
+
static styles: CSSResultGroup;
|
15
|
+
/** @inernal */
|
16
|
+
focusTimeoutId: ReturnType<typeof setTimeout> | undefined;
|
17
|
+
/** @internal */
|
18
|
+
private customError;
|
19
|
+
/** @internal */
|
20
|
+
popoverController: PopoverController;
|
21
|
+
/** If defined, forces component to invalid state until removed. Its value is used as hint text. */
|
22
|
+
set customInvalid(value: string | undefined);
|
23
|
+
get customInvalid(): string | undefined;
|
24
|
+
id: string;
|
25
|
+
/** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
|
26
|
+
label?: string;
|
27
|
+
/** If true, hides the label visually */
|
28
|
+
hideLabel?: boolean;
|
29
|
+
/** If defined, displays informational text below the field */
|
30
|
+
hint?: string;
|
31
|
+
/**
|
32
|
+
* A comma-separated list of dates (yyyy-mm-dd format) that are not selectable.
|
33
|
+
*/
|
34
|
+
invalidDates?: string;
|
35
|
+
/** If defined, adds name to the input-element */
|
36
|
+
name?: string;
|
37
|
+
placeholder: string;
|
38
|
+
range: boolean;
|
39
|
+
/** If true, makes the element not mutable, meaning the user can not edit the control */
|
40
|
+
readonly?: boolean;
|
41
|
+
/** If defined, renders an alternative A11y text for the asterisk */
|
42
|
+
requiredLabel?: string;
|
43
|
+
/**
|
44
|
+
* Earliest selectable date. (yyyy-mm-dd format)
|
45
|
+
*/
|
46
|
+
selectableFrom?: string;
|
47
|
+
/**
|
48
|
+
* Latest selectable date. (yyyy-mm-dd format)
|
49
|
+
*/
|
50
|
+
selectableTo?: string;
|
51
|
+
/**
|
52
|
+
* If defined, displays provided severity state
|
53
|
+
* @type { "alert" | "success" | "info" | "warning" }
|
54
|
+
*/
|
55
|
+
severity?: FormFieldBaseProps['severity'];
|
56
|
+
/** Size of the input */
|
57
|
+
size: 'sm' | 'md';
|
58
|
+
/** Sets validation start */
|
59
|
+
validateOn: 'input' | 'change' | 'submit';
|
60
|
+
/** The current value of the input field */
|
61
|
+
value?: string;
|
62
|
+
private _init_date?;
|
63
|
+
/** @internal */
|
64
|
+
/** true if the internal state is invalid */
|
65
|
+
invalid: boolean;
|
66
|
+
/** @internal */
|
67
|
+
selectedRangeDates: SkfDatepickerPopupDateRange;
|
68
|
+
/** @internal */
|
69
|
+
private showClearbutton;
|
70
|
+
/** @internal */
|
71
|
+
$popover: HTMLElement;
|
72
|
+
/** @internal */
|
73
|
+
$anchor: HTMLDivElement;
|
74
|
+
/** @internal */
|
75
|
+
$input: HTMLInputElement;
|
76
|
+
/** @internal */
|
77
|
+
$input_range_end: HTMLInputElement;
|
78
|
+
/** @internal */
|
79
|
+
$datepickerPopup: SkfDatepickerPopup;
|
80
|
+
/** @internal */
|
81
|
+
_defaultSlot: Node[];
|
82
|
+
/** @internal */
|
83
|
+
private abortController;
|
84
|
+
/** @internal */
|
85
|
+
private abortSignal;
|
86
|
+
constructor();
|
87
|
+
connectedCallback(): void;
|
88
|
+
disconnectedCallback(): void;
|
89
|
+
private _handleSelectedDate;
|
90
|
+
protected firstUpdated(): void;
|
91
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
92
|
+
_handleValueChange(): void;
|
93
|
+
private _handleDateSelected;
|
94
|
+
/** @internal */
|
95
|
+
_handleKeyboardEvents: (e: KeyboardEvent) => void;
|
96
|
+
/** @internal */
|
97
|
+
private _handleFocus;
|
98
|
+
showPopover(): void;
|
99
|
+
hidePopover(): void;
|
100
|
+
/** @internal */
|
101
|
+
_handleBlur: (event: FocusEvent) => void;
|
102
|
+
/** @internal */
|
103
|
+
private _handleClose;
|
104
|
+
/** @internal */
|
105
|
+
private clearInput;
|
106
|
+
/**
|
107
|
+
* Clears the input field
|
108
|
+
*/
|
109
|
+
clear(): void;
|
110
|
+
/** @internal although called on input its only triggered once value is valid date */
|
111
|
+
_handleInput: (event: Event) => void;
|
112
|
+
/** @internal */
|
113
|
+
_toggleClearButton: (show?: boolean) => void;
|
114
|
+
/** @internal */
|
115
|
+
private _animatePopover;
|
116
|
+
/** @internal consider sharing this functionality with input */
|
117
|
+
validateInput(): void;
|
118
|
+
/** @internal */
|
119
|
+
reposition: () => Promise<void>;
|
120
|
+
render(): import("lit").TemplateResult<1>;
|
121
|
+
}
|