@govtechsg/sgds-web-component 2.1.0 → 2.1.2
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/base/card-element.js +0 -1
- package/base/card-element.js.map +1 -1
- package/base/card.js +0 -1
- package/base/card.js.map +1 -1
- package/base/dropdown-element.js +0 -1
- package/base/dropdown-element.js.map +1 -1
- package/base/dropdown-list-element.js +0 -1
- package/base/dropdown-list-element.js.map +1 -1
- package/base/form-check-element.js +6 -5
- package/base/form-check-element.js.map +1 -1
- package/base/link-element.js +0 -1
- package/base/link-element.js.map +1 -1
- package/base/sgds-element.js +0 -1
- package/base/sgds-element.js.map +1 -1
- package/base/sgds-element2.js +0 -1
- package/base/sgds-element2.js.map +1 -1
- package/components/Accordion/accordion-item.js +0 -1
- package/components/Accordion/accordion-item.js.map +1 -1
- package/components/Accordion/accordion.js +0 -1
- package/components/Accordion/accordion.js.map +1 -1
- package/components/Accordion/sgds-accordion-item.js +0 -1
- package/components/Accordion/sgds-accordion-item.js.map +1 -1
- package/components/Accordion/sgds-accordion.js +0 -1
- package/components/Accordion/sgds-accordion.js.map +1 -1
- package/components/ActionCard/action-card.js +0 -1
- package/components/ActionCard/action-card.js.map +1 -1
- package/components/ActionCard/index.umd.js +9 -7
- package/components/ActionCard/index.umd.js.map +1 -1
- package/components/ActionCard/sgds-action-card.js +0 -1
- package/components/ActionCard/sgds-action-card.js.map +1 -1
- package/components/Alert/alert-link.js +0 -1
- package/components/Alert/alert-link.js.map +1 -1
- package/components/Alert/alert.js +0 -1
- package/components/Alert/alert.js.map +1 -1
- package/components/Alert/sgds-alert-heading.js +0 -1
- package/components/Alert/sgds-alert-heading.js.map +1 -1
- package/components/Alert/sgds-alert-link.js +0 -1
- package/components/Alert/sgds-alert-link.js.map +1 -1
- package/components/Alert/sgds-alert.js +0 -1
- package/components/Alert/sgds-alert.js.map +1 -1
- package/components/Badge/badge.js +0 -1
- package/components/Badge/badge.js.map +1 -1
- package/components/Badge/sgds-badge.js +0 -1
- package/components/Badge/sgds-badge.js.map +1 -1
- package/components/Breadcrumb/breadcrumb-item.js +0 -1
- package/components/Breadcrumb/breadcrumb-item.js.map +1 -1
- package/components/Breadcrumb/breadcrumb.js +0 -1
- package/components/Breadcrumb/breadcrumb.js.map +1 -1
- package/components/Breadcrumb/sgds-breadcrumb-item.js +0 -1
- package/components/Breadcrumb/sgds-breadcrumb-item.js.map +1 -1
- package/components/Breadcrumb/sgds-breadcrumb.js +0 -1
- package/components/Breadcrumb/sgds-breadcrumb.js.map +1 -1
- package/components/Button/button.js +0 -1
- package/components/Button/button.js.map +1 -1
- package/components/Button/sgds-button.js +0 -1
- package/components/Button/sgds-button.js.map +1 -1
- package/components/Card/card.js +0 -1
- package/components/Card/card.js.map +1 -1
- package/components/Card/sgds-card.js +0 -1
- package/components/Card/sgds-card.js.map +1 -1
- package/components/Checkbox/checkbox.js +1 -2
- package/components/Checkbox/checkbox.js.map +1 -1
- package/components/Checkbox/index.umd.js +8 -6
- package/components/Checkbox/index.umd.js.map +1 -1
- package/components/Checkbox/sgds-checkbox.js +0 -1
- package/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/components/ComboBox/combo-box.js +0 -1
- package/components/ComboBox/combo-box.js.map +1 -1
- package/components/ComboBox/index.umd.js +2 -2
- package/components/ComboBox/index.umd.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.js +0 -1
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Datepicker/datepicker-calendar.js +0 -1
- package/components/Datepicker/datepicker-calendar.js.map +1 -1
- package/components/Datepicker/datepicker-calendar2.js +0 -1
- package/components/Datepicker/datepicker-calendar2.js.map +1 -1
- package/components/Datepicker/datepicker-header.js +0 -1
- package/components/Datepicker/datepicker-header.js.map +1 -1
- package/components/Datepicker/datepicker-header2.js +0 -1
- package/components/Datepicker/datepicker-header2.js.map +1 -1
- package/components/Datepicker/datepicker-input.js +0 -1
- package/components/Datepicker/datepicker-input.js.map +1 -1
- package/components/Datepicker/datepicker-input2.js +0 -1
- package/components/Datepicker/datepicker-input2.js.map +1 -1
- package/components/Datepicker/datepicker.js +0 -1
- package/components/Datepicker/datepicker.js.map +1 -1
- package/components/Datepicker/index.umd.js +2 -2
- package/components/Datepicker/index.umd.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.js +0 -1
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/Drawer/drawer.js +0 -1
- package/components/Drawer/drawer.js.map +1 -1
- package/components/Drawer/sgds-drawer.js +0 -1
- package/components/Drawer/sgds-drawer.js.map +1 -1
- package/components/Dropdown/dropdown.js +0 -1
- package/components/Dropdown/dropdown.js.map +1 -1
- package/components/Dropdown/sgds-dropdown-item.js +0 -1
- package/components/Dropdown/sgds-dropdown-item.js.map +1 -1
- package/components/Dropdown/sgds-dropdown.js +0 -1
- package/components/Dropdown/sgds-dropdown.js.map +1 -1
- package/components/FileUpload/file-upload.js +0 -1
- package/components/FileUpload/file-upload.js.map +1 -1
- package/components/FileUpload/sgds-file-upload.js +0 -1
- package/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/components/Footer/footer.js +0 -1
- package/components/Footer/footer.js.map +1 -1
- package/components/Footer/sgds-footer.js +0 -1
- package/components/Footer/sgds-footer.js.map +1 -1
- package/components/Input/index.umd.js +2 -2
- package/components/Input/index.umd.js.map +1 -1
- package/components/Input/input.js +0 -1
- package/components/Input/input.js.map +1 -1
- package/components/Input/sgds-input.js +1 -2
- package/components/Input/sgds-input.js.map +1 -1
- package/components/Mainnav/mainnav-dropdown.js +0 -1
- package/components/Mainnav/mainnav-dropdown.js.map +1 -1
- package/components/Mainnav/mainnav-item.js +0 -1
- package/components/Mainnav/mainnav-item.js.map +1 -1
- package/components/Mainnav/mainnav.js +0 -1
- package/components/Mainnav/mainnav.js.map +1 -1
- package/components/Mainnav/sgds-mainnav-dropdown.js +0 -1
- package/components/Mainnav/sgds-mainnav-dropdown.js.map +1 -1
- package/components/Mainnav/sgds-mainnav-item.js +0 -1
- package/components/Mainnav/sgds-mainnav-item.js.map +1 -1
- package/components/Mainnav/sgds-mainnav.js +0 -1
- package/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/components/Masthead/masthead.js +0 -1
- package/components/Masthead/masthead.js.map +1 -1
- package/components/Masthead/sgds-masthead.js +0 -1
- package/components/Masthead/sgds-masthead.js.map +1 -1
- package/components/Modal/modal.js +0 -1
- package/components/Modal/modal.js.map +1 -1
- package/components/Modal/sgds-modal.js +0 -1
- package/components/Modal/sgds-modal.js.map +1 -1
- package/components/Pagination/pagination.js +0 -1
- package/components/Pagination/pagination.js.map +1 -1
- package/components/Pagination/sgds-pagination.js +0 -1
- package/components/Pagination/sgds-pagination.js.map +1 -1
- package/components/Progress/progress-bar.js +0 -1
- package/components/Progress/progress-bar.js.map +1 -1
- package/components/Progress/progress.js +0 -1
- package/components/Progress/progress.js.map +1 -1
- package/components/Progress/sgds-progress-bar.js +0 -1
- package/components/Progress/sgds-progress-bar.js.map +1 -1
- package/components/Progress/sgds-progress.js +0 -1
- package/components/Progress/sgds-progress.js.map +1 -1
- package/components/QuantityToggle/index.umd.js +2 -2
- package/components/QuantityToggle/index.umd.js.map +1 -1
- package/components/QuantityToggle/quantity-toggle.js +0 -1
- package/components/QuantityToggle/quantity-toggle.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.js +0 -1
- package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/components/Radio/index.umd.js +3 -3
- package/components/Radio/index.umd.js.map +1 -1
- package/components/Radio/radio-group.js +0 -1
- package/components/Radio/radio-group.js.map +1 -1
- package/components/Radio/radio.js +1 -2
- package/components/Radio/radio.js.map +1 -1
- package/components/Radio/sgds-radio-group.js +1 -2
- package/components/Radio/sgds-radio-group.js.map +1 -1
- package/components/Radio/sgds-radio.js +0 -1
- package/components/Radio/sgds-radio.js.map +1 -1
- package/components/Sidenav/sgds-sidenav-item.js +0 -1
- package/components/Sidenav/sgds-sidenav-item.js.map +1 -1
- package/components/Sidenav/sgds-sidenav-link.js +0 -1
- package/components/Sidenav/sgds-sidenav-link.js.map +1 -1
- package/components/Sidenav/sgds-sidenav.js +0 -1
- package/components/Sidenav/sgds-sidenav.js.map +1 -1
- package/components/Sidenav/sidenav-item.js +0 -1
- package/components/Sidenav/sidenav-item.js.map +1 -1
- package/components/Sidenav/sidenav-link.js +0 -1
- package/components/Sidenav/sidenav-link.js.map +1 -1
- package/components/Sidenav/sidenav.js +0 -1
- package/components/Sidenav/sidenav.js.map +1 -1
- package/components/Spinner/sgds-spinner.js +0 -1
- package/components/Spinner/sgds-spinner.js.map +1 -1
- package/components/Spinner/spinner.js +0 -1
- package/components/Spinner/spinner.js.map +1 -1
- package/components/Stepper/sgds-stepper.js +0 -1
- package/components/Stepper/sgds-stepper.js.map +1 -1
- package/components/Stepper/stepper.js +0 -1
- package/components/Stepper/stepper.js.map +1 -1
- package/components/Tab/sgds-tab-group.js +0 -1
- package/components/Tab/sgds-tab-group.js.map +1 -1
- package/components/Tab/sgds-tab-panel.js +0 -1
- package/components/Tab/sgds-tab-panel.js.map +1 -1
- package/components/Tab/sgds-tab.js +0 -1
- package/components/Tab/sgds-tab.js.map +1 -1
- package/components/Tab/tab-group.js +0 -1
- package/components/Tab/tab-group.js.map +1 -1
- package/components/Tab/tab-panel.js +0 -1
- package/components/Tab/tab-panel.js.map +1 -1
- package/components/Tab/tab.js +0 -1
- package/components/Tab/tab.js.map +1 -1
- package/components/Table/sgds-table.js +0 -1
- package/components/Table/sgds-table.js.map +1 -1
- package/components/Table/table.js +0 -1
- package/components/Table/table.js.map +1 -1
- package/components/Textarea/index.umd.js +2 -2
- package/components/Textarea/index.umd.js.map +1 -1
- package/components/Textarea/sgds-textarea.js +1 -2
- package/components/Textarea/sgds-textarea.js.map +1 -1
- package/components/Textarea/textarea.js +0 -1
- package/components/Textarea/textarea.js.map +1 -1
- package/components/Toast/sgds-toast-container.js +0 -1
- package/components/Toast/sgds-toast-container.js.map +1 -1
- package/components/Toast/sgds-toast.js +0 -1
- package/components/Toast/sgds-toast.js.map +1 -1
- package/components/Toast/toast-container.js +0 -1
- package/components/Toast/toast-container.js.map +1 -1
- package/components/Toast/toast.js +0 -1
- package/components/Toast/toast.js.map +1 -1
- package/components/Tooltip/sgds-tooltip.js +0 -1
- package/components/Tooltip/sgds-tooltip.js.map +1 -1
- package/components/Tooltip/tooltip.js +0 -1
- package/components/Tooltip/tooltip.js.map +1 -1
- package/components/index.umd.js +12 -10
- package/components/index.umd.js.map +1 -1
- package/index.umd.js +12 -10
- package/index.umd.js.map +1 -1
- package/internals/CloseButton/close-button.js +0 -1
- package/internals/CloseButton/close-button.js.map +1 -1
- package/internals/CloseButton/sgds-close-button.js +0 -1
- package/internals/CloseButton/sgds-close-button.js.map +1 -1
- package/package.json +1 -1
- package/react/accordion/index.cjs.js +1 -1
- package/react/accordion/index.js +1 -1
- package/react/accordion-item/index.cjs.js +1 -1
- package/react/accordion-item/index.js +1 -1
- package/react/action-card/index.cjs.js +1 -1
- package/react/action-card/index.js +1 -1
- package/react/alert/index.cjs.js +1 -1
- package/react/alert/index.js +1 -1
- package/react/alert-heading/index.cjs.js +1 -1
- package/react/alert-heading/index.js +1 -1
- package/react/alert-link/index.cjs.js +1 -1
- package/react/alert-link/index.js +1 -1
- package/react/badge/index.cjs.js +1 -1
- package/react/badge/index.js +1 -1
- package/react/base/card-element.cjs.js.map +1 -0
- package/react/base/card-element.js +26 -0
- package/react/base/card-element.js.map +1 -0
- package/react/base/card.js +7 -0
- package/react/base/card.js.map +1 -0
- package/react/base/dropdown-element.cjs.js.map +1 -0
- package/react/base/dropdown-element.js +174 -0
- package/react/base/dropdown-element.js.map +1 -0
- package/react/base/dropdown-list-element.cjs.js.map +1 -0
- package/react/base/dropdown-list-element.js +130 -0
- package/react/base/dropdown-list-element.js.map +1 -0
- package/{base → react/base}/form-check-element.cjs.js +6 -4
- package/react/base/form-check-element.cjs.js.map +1 -0
- package/react/base/form-check-element.js +169 -0
- package/react/base/form-check-element.js.map +1 -0
- package/react/base/link-element.cjs.js.map +1 -0
- package/react/base/link-element.js +53 -0
- package/react/base/link-element.js.map +1 -0
- package/react/base/sgds-element.cjs.js.map +1 -0
- package/react/base/sgds-element.js +24 -0
- package/react/base/sgds-element.js.map +1 -0
- package/react/base/sgds-element2.js +7 -0
- package/react/base/sgds-element2.js.map +1 -0
- package/react/breadcrumb/index.cjs.js +1 -1
- package/react/breadcrumb/index.js +1 -1
- package/react/breadcrumb-item/index.cjs.js +1 -1
- package/react/breadcrumb-item/index.js +1 -1
- package/react/button/index.cjs.js +1 -1
- package/react/button/index.js +1 -1
- package/react/card/index.cjs.js +1 -1
- package/react/card/index.js +1 -1
- package/react/checkbox/index.cjs.js +1 -1
- package/react/checkbox/index.js +1 -1
- package/react/combo-box/index.cjs.js +1 -1
- package/react/combo-box/index.js +1 -1
- package/react/components/Accordion/accordion-item.js +7 -0
- package/react/components/Accordion/accordion-item.js.map +1 -0
- package/react/components/Accordion/accordion.js +7 -0
- package/react/components/Accordion/accordion.js.map +1 -0
- package/react/components/Accordion/sgds-accordion-item.cjs.js.map +1 -0
- package/react/components/Accordion/sgds-accordion-item.js +204 -0
- package/react/components/Accordion/sgds-accordion-item.js.map +1 -0
- package/react/components/Accordion/sgds-accordion.cjs.js.map +1 -0
- package/react/components/Accordion/sgds-accordion.js +87 -0
- package/react/components/Accordion/sgds-accordion.js.map +1 -0
- package/react/components/ActionCard/action-card.js +7 -0
- package/react/components/ActionCard/action-card.js.map +1 -0
- package/react/components/ActionCard/sgds-action-card.cjs.js.map +1 -0
- package/react/components/ActionCard/sgds-action-card.js +155 -0
- package/react/components/ActionCard/sgds-action-card.js.map +1 -0
- package/react/components/Alert/alert-link.js +7 -0
- package/react/components/Alert/alert-link.js.map +1 -0
- package/react/components/Alert/alert.js +7 -0
- package/react/components/Alert/alert.js.map +1 -0
- package/react/components/Alert/sgds-alert-heading.cjs.js.map +1 -0
- package/react/components/Alert/sgds-alert-heading.js +33 -0
- package/react/components/Alert/sgds-alert-heading.js.map +1 -0
- package/react/components/Alert/sgds-alert-link.cjs.js.map +1 -0
- package/react/components/Alert/sgds-alert-link.js +32 -0
- package/react/components/Alert/sgds-alert-link.js.map +1 -0
- package/react/components/Alert/sgds-alert.cjs.js.map +1 -0
- package/react/components/Alert/sgds-alert.js +90 -0
- package/react/components/Alert/sgds-alert.js.map +1 -0
- package/react/components/Badge/badge.js +7 -0
- package/react/components/Badge/badge.js.map +1 -0
- package/react/components/Badge/sgds-badge.cjs.js.map +1 -0
- package/react/components/Badge/sgds-badge.js +53 -0
- package/react/components/Badge/sgds-badge.js.map +1 -0
- package/react/components/Breadcrumb/breadcrumb-item.js +7 -0
- package/react/components/Breadcrumb/breadcrumb-item.js.map +1 -0
- package/react/components/Breadcrumb/breadcrumb.js +7 -0
- package/react/components/Breadcrumb/breadcrumb.js.map +1 -0
- package/react/components/Breadcrumb/sgds-breadcrumb-item.cjs.js.map +1 -0
- package/react/components/Breadcrumb/sgds-breadcrumb-item.js +65 -0
- package/react/components/Breadcrumb/sgds-breadcrumb-item.js.map +1 -0
- package/react/components/Breadcrumb/sgds-breadcrumb.cjs.js.map +1 -0
- package/react/components/Breadcrumb/sgds-breadcrumb.js +82 -0
- package/react/components/Breadcrumb/sgds-breadcrumb.js.map +1 -0
- package/react/components/Button/button.js +7 -0
- package/react/components/Button/button.js.map +1 -0
- package/react/components/Button/sgds-button.cjs.js.map +1 -0
- package/react/components/Button/sgds-button.js +166 -0
- package/react/components/Button/sgds-button.js.map +1 -0
- package/react/components/Card/card.js +7 -0
- package/react/components/Card/card.js.map +1 -0
- package/react/components/Card/sgds-card.cjs.js.map +1 -0
- package/react/components/Card/sgds-card.js +76 -0
- package/react/components/Card/sgds-card.js.map +1 -0
- package/react/components/Checkbox/checkbox.cjs.js +11 -0
- package/react/components/Checkbox/checkbox.js +7 -0
- package/react/components/Checkbox/checkbox.js.map +1 -0
- package/react/components/Checkbox/sgds-checkbox.cjs.js.map +1 -0
- package/react/components/Checkbox/sgds-checkbox.js +26 -0
- package/react/components/Checkbox/sgds-checkbox.js.map +1 -0
- package/react/components/ComboBox/combo-box.js +7 -0
- package/react/components/ComboBox/combo-box.js.map +1 -0
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -0
- package/react/components/ComboBox/sgds-combo-box.js +194 -0
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -0
- package/react/components/Datepicker/datepicker-calendar.cjs.js.map +1 -0
- package/react/components/Datepicker/datepicker-calendar.js +458 -0
- package/react/components/Datepicker/datepicker-calendar.js.map +1 -0
- package/react/components/Datepicker/datepicker-calendar2.js +7 -0
- package/react/components/Datepicker/datepicker-calendar2.js.map +1 -0
- package/react/components/Datepicker/datepicker-header.cjs.js.map +1 -0
- package/react/components/Datepicker/datepicker-header.js +227 -0
- package/react/components/Datepicker/datepicker-header.js.map +1 -0
- package/react/components/Datepicker/datepicker-header2.js +7 -0
- package/react/components/Datepicker/datepicker-header2.js.map +1 -0
- package/react/components/Datepicker/datepicker-input.cjs.js.map +1 -0
- package/react/components/Datepicker/datepicker-input.js +150 -0
- package/react/components/Datepicker/datepicker-input.js.map +1 -0
- package/react/components/Datepicker/datepicker-input2.js +7 -0
- package/react/components/Datepicker/datepicker-input2.js.map +1 -0
- package/react/components/Datepicker/datepicker.js +7 -0
- package/react/components/Datepicker/datepicker.js.map +1 -0
- package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -0
- package/react/components/Datepicker/sgds-datepicker.js +484 -0
- package/react/components/Datepicker/sgds-datepicker.js.map +1 -0
- package/react/components/Drawer/drawer.js +7 -0
- package/react/components/Drawer/drawer.js.map +1 -0
- package/react/components/Drawer/sgds-drawer.cjs.js.map +1 -0
- package/react/components/Drawer/sgds-drawer.js +413 -0
- package/react/components/Drawer/sgds-drawer.js.map +1 -0
- package/react/components/Dropdown/dropdown.js +7 -0
- package/react/components/Dropdown/dropdown.js.map +1 -0
- package/react/components/Dropdown/sgds-dropdown-item.cjs.js.map +1 -0
- package/react/components/Dropdown/sgds-dropdown-item.js +47 -0
- package/react/components/Dropdown/sgds-dropdown-item.js.map +1 -0
- package/react/components/Dropdown/sgds-dropdown.cjs.js.map +1 -0
- package/react/components/Dropdown/sgds-dropdown.js +117 -0
- package/react/components/Dropdown/sgds-dropdown.js.map +1 -0
- package/react/components/FileUpload/file-upload.js +7 -0
- package/react/components/FileUpload/file-upload.js.map +1 -0
- package/react/components/FileUpload/sgds-file-upload.cjs.js.map +1 -0
- package/react/components/FileUpload/sgds-file-upload.js +208 -0
- package/react/components/FileUpload/sgds-file-upload.js.map +1 -0
- package/react/components/Footer/footer.js +7 -0
- package/react/components/Footer/footer.js.map +1 -0
- package/react/components/Footer/sgds-footer.cjs.js.map +1 -0
- package/react/components/Footer/sgds-footer.js +155 -0
- package/react/components/Footer/sgds-footer.js.map +1 -0
- package/react/components/Input/input.js +7 -0
- package/react/components/Input/input.js.map +1 -0
- package/{components → react/components}/Input/sgds-input.cjs.js +1 -1
- package/react/components/Input/sgds-input.cjs.js.map +1 -0
- package/react/components/Input/sgds-input.js +262 -0
- package/react/components/Input/sgds-input.js.map +1 -0
- package/react/components/Mainnav/mainnav-dropdown.js +7 -0
- package/react/components/Mainnav/mainnav-dropdown.js.map +1 -0
- package/react/components/Mainnav/mainnav-item.js +7 -0
- package/react/components/Mainnav/mainnav-item.js.map +1 -0
- package/react/components/Mainnav/mainnav.js +7 -0
- package/react/components/Mainnav/mainnav.js.map +1 -0
- package/react/components/Mainnav/sgds-mainnav-dropdown.cjs.js.map +1 -0
- package/react/components/Mainnav/sgds-mainnav-dropdown.js +85 -0
- package/react/components/Mainnav/sgds-mainnav-dropdown.js.map +1 -0
- package/react/components/Mainnav/sgds-mainnav-item.cjs.js.map +1 -0
- package/react/components/Mainnav/sgds-mainnav-item.js +14 -0
- package/react/components/Mainnav/sgds-mainnav-item.js.map +1 -0
- package/react/components/Mainnav/sgds-mainnav.cjs.js.map +1 -0
- package/react/components/Mainnav/sgds-mainnav.js +227 -0
- package/react/components/Mainnav/sgds-mainnav.js.map +1 -0
- package/react/components/Masthead/masthead.js +7 -0
- package/react/components/Masthead/masthead.js.map +1 -0
- package/react/components/Masthead/sgds-masthead.cjs.js.map +1 -0
- package/react/components/Masthead/sgds-masthead.js +182 -0
- package/react/components/Masthead/sgds-masthead.js.map +1 -0
- package/react/components/Modal/modal.js +7 -0
- package/react/components/Modal/modal.js.map +1 -0
- package/react/components/Modal/sgds-modal.cjs.js.map +1 -0
- package/react/components/Modal/sgds-modal.js +340 -0
- package/react/components/Modal/sgds-modal.js.map +1 -0
- package/react/components/Pagination/pagination.js +7 -0
- package/react/components/Pagination/pagination.js.map +1 -0
- package/react/components/Pagination/sgds-pagination.cjs.js.map +1 -0
- package/react/components/Pagination/sgds-pagination.js +364 -0
- package/react/components/Pagination/sgds-pagination.js.map +1 -0
- package/react/components/Progress/progress-bar.js +7 -0
- package/react/components/Progress/progress-bar.js.map +1 -0
- package/react/components/Progress/progress.js +7 -0
- package/react/components/Progress/progress.js.map +1 -0
- package/react/components/Progress/sgds-progress-bar.cjs.js.map +1 -0
- package/react/components/Progress/sgds-progress-bar.js +59 -0
- package/react/components/Progress/sgds-progress-bar.js.map +1 -0
- package/react/components/Progress/sgds-progress.cjs.js.map +1 -0
- package/react/components/Progress/sgds-progress.js +30 -0
- package/react/components/Progress/sgds-progress.js.map +1 -0
- package/react/components/QuantityToggle/quantity-toggle.js +7 -0
- package/react/components/QuantityToggle/quantity-toggle.js.map +1 -0
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -0
- package/react/components/QuantityToggle/sgds-quantity-toggle.js +210 -0
- package/react/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -0
- package/react/components/Radio/radio-group.js +7 -0
- package/react/components/Radio/radio-group.js.map +1 -0
- package/react/components/Radio/radio.cjs.js +11 -0
- package/react/components/Radio/radio.js +7 -0
- package/react/components/Radio/radio.js.map +1 -0
- package/{components → react/components}/Radio/sgds-radio-group.cjs.js +1 -1
- package/react/components/Radio/sgds-radio-group.cjs.js.map +1 -0
- package/react/components/Radio/sgds-radio-group.js +240 -0
- package/react/components/Radio/sgds-radio-group.js.map +1 -0
- package/react/components/Radio/sgds-radio.cjs.js.map +1 -0
- package/react/components/Radio/sgds-radio.js +138 -0
- package/react/components/Radio/sgds-radio.js.map +1 -0
- package/react/components/Sidenav/sgds-sidenav-item.cjs.js.map +1 -0
- package/react/components/Sidenav/sgds-sidenav-item.js +256 -0
- package/react/components/Sidenav/sgds-sidenav-item.js.map +1 -0
- package/react/components/Sidenav/sgds-sidenav-link.cjs.js.map +1 -0
- package/react/components/Sidenav/sgds-sidenav-link.js +18 -0
- package/react/components/Sidenav/sgds-sidenav-link.js.map +1 -0
- package/react/components/Sidenav/sgds-sidenav.cjs.js.map +1 -0
- package/react/components/Sidenav/sgds-sidenav.js +75 -0
- package/react/components/Sidenav/sgds-sidenav.js.map +1 -0
- package/react/components/Sidenav/sidenav-item.js +7 -0
- package/react/components/Sidenav/sidenav-item.js.map +1 -0
- package/react/components/Sidenav/sidenav-link.js +7 -0
- package/react/components/Sidenav/sidenav-link.js.map +1 -0
- package/react/components/Sidenav/sidenav.js +7 -0
- package/react/components/Sidenav/sidenav.js.map +1 -0
- package/react/components/Spinner/sgds-spinner.cjs.js.map +1 -0
- package/react/components/Spinner/sgds-spinner.js +38 -0
- package/react/components/Spinner/sgds-spinner.js.map +1 -0
- package/react/components/Spinner/spinner.js +8 -0
- package/react/components/Spinner/spinner.js.map +1 -0
- package/react/components/Stepper/sgds-stepper.cjs.js.map +1 -0
- package/react/components/Stepper/sgds-stepper.js +132 -0
- package/react/components/Stepper/sgds-stepper.js.map +1 -0
- package/react/components/Stepper/stepper.js +7 -0
- package/react/components/Stepper/stepper.js.map +1 -0
- package/react/components/Tab/sgds-tab-group.cjs.js.map +1 -0
- package/react/components/Tab/sgds-tab-group.js +233 -0
- package/react/components/Tab/sgds-tab-group.js.map +1 -0
- package/react/components/Tab/sgds-tab-panel.cjs.js.map +1 -0
- package/react/components/Tab/sgds-tab-panel.js +63 -0
- package/react/components/Tab/sgds-tab-panel.js.map +1 -0
- package/react/components/Tab/sgds-tab.cjs.js.map +1 -0
- package/react/components/Tab/sgds-tab.js +110 -0
- package/react/components/Tab/sgds-tab.js.map +1 -0
- package/react/components/Tab/tab-group.js +7 -0
- package/react/components/Tab/tab-group.js.map +1 -0
- package/react/components/Tab/tab-panel.js +7 -0
- package/react/components/Tab/tab-panel.js.map +1 -0
- package/react/components/Tab/tab.js +7 -0
- package/react/components/Tab/tab.js.map +1 -0
- package/react/components/Table/sgds-table.cjs.js.map +1 -0
- package/react/components/Table/sgds-table.js +267 -0
- package/react/components/Table/sgds-table.js.map +1 -0
- package/react/components/Table/table.js +7 -0
- package/react/components/Table/table.js.map +1 -0
- package/{components → react/components}/Textarea/sgds-textarea.cjs.js +1 -1
- package/react/components/Textarea/sgds-textarea.cjs.js.map +1 -0
- package/react/components/Textarea/sgds-textarea.js +252 -0
- package/react/components/Textarea/sgds-textarea.js.map +1 -0
- package/react/components/Textarea/textarea.js +7 -0
- package/react/components/Textarea/textarea.js.map +1 -0
- package/react/components/Toast/sgds-toast-container.cjs.js.map +1 -0
- package/react/components/Toast/sgds-toast-container.js +36 -0
- package/react/components/Toast/sgds-toast-container.js.map +1 -0
- package/react/components/Toast/sgds-toast.cjs.js.map +1 -0
- package/react/components/Toast/sgds-toast.js +152 -0
- package/react/components/Toast/sgds-toast.js.map +1 -0
- package/react/components/Toast/toast-container.js +7 -0
- package/react/components/Toast/toast-container.js.map +1 -0
- package/react/components/Toast/toast.js +7 -0
- package/react/components/Toast/toast.js.map +1 -0
- package/react/components/Tooltip/sgds-tooltip.cjs.js.map +1 -0
- package/react/components/Tooltip/sgds-tooltip.js +121 -0
- package/react/components/Tooltip/sgds-tooltip.js.map +1 -0
- package/react/components/Tooltip/tooltip.js +7 -0
- package/react/components/Tooltip/tooltip.js.map +1 -0
- package/react/datepicker/index.cjs.js +1 -1
- package/react/datepicker/index.js +1 -1
- package/react/drawer/index.cjs.js +1 -1
- package/react/drawer/index.js +1 -1
- package/react/dropdown/index.cjs.js +1 -1
- package/react/dropdown/index.js +1 -1
- package/react/dropdown-item/index.cjs.js +1 -1
- package/react/dropdown-item/index.js +1 -1
- package/react/file-upload/index.cjs.js +1 -1
- package/react/file-upload/index.js +1 -1
- package/react/footer/index.cjs.js +1 -1
- package/react/footer/index.js +1 -1
- package/react/input/index.cjs.js +1 -1
- package/react/input/index.js +1 -1
- package/react/internals/CloseButton/close-button.js +7 -0
- package/react/internals/CloseButton/close-button.js.map +1 -0
- package/react/internals/CloseButton/sgds-close-button.cjs.js.map +1 -0
- package/react/internals/CloseButton/sgds-close-button.js +55 -0
- package/react/internals/CloseButton/sgds-close-button.js.map +1 -0
- package/react/mainnav/index.cjs.js +1 -1
- package/react/mainnav/index.js +1 -1
- package/react/mainnav-dropdown/index.cjs.js +1 -1
- package/react/mainnav-dropdown/index.js +1 -1
- package/react/mainnav-item/index.cjs.js +1 -1
- package/react/mainnav-item/index.js +1 -1
- package/react/masthead/index.cjs.js +1 -1
- package/react/masthead/index.js +1 -1
- package/react/modal/index.cjs.js +1 -1
- package/react/modal/index.js +1 -1
- package/react/pagination/index.cjs.js +1 -1
- package/react/pagination/index.js +1 -1
- package/react/progress/index.cjs.js +1 -1
- package/react/progress/index.js +1 -1
- package/react/progress-bar/index.cjs.js +1 -1
- package/react/progress-bar/index.js +1 -1
- package/react/quantity-toggle/index.cjs.js +1 -1
- package/react/quantity-toggle/index.js +1 -1
- package/react/radio/index.cjs.js +1 -1
- package/react/radio/index.js +1 -1
- package/react/radio-group/index.cjs.js +1 -1
- package/react/radio-group/index.js +1 -1
- package/react/sidenav/index.cjs.js +1 -1
- package/react/sidenav/index.js +1 -1
- package/react/sidenav-item/index.cjs.js +1 -1
- package/react/sidenav-item/index.js +1 -1
- package/react/sidenav-link/index.cjs.js +1 -1
- package/react/sidenav-link/index.js +1 -1
- package/react/spinner/index.cjs.js +1 -1
- package/react/spinner/index.js +1 -1
- package/react/stepper/index.cjs.js +1 -1
- package/react/stepper/index.js +1 -1
- package/react/styles/anchor.js +7 -0
- package/react/styles/anchor.js.map +1 -0
- package/react/styles/bg-variants.js +7 -0
- package/react/styles/bg-variants.js.map +1 -0
- package/react/styles/border-variants.js +7 -0
- package/react/styles/border-variants.js.map +1 -0
- package/{styles → react/styles}/feedback.cjs.js +1 -1
- package/react/styles/feedback.js +7 -0
- package/react/styles/feedback.js.map +1 -0
- package/react/styles/form-hint.js +7 -0
- package/react/styles/form-hint.js.map +1 -0
- package/react/styles/form-label.js +7 -0
- package/react/styles/form-label.js.map +1 -0
- package/react/styles/header-class.js +7 -0
- package/react/styles/header-class.js.map +1 -0
- package/react/styles/paragraph.js +7 -0
- package/react/styles/paragraph.js.map +1 -0
- package/react/styles/svg.js +7 -0
- package/react/styles/svg.js.map +1 -0
- package/react/styles/text-variants.js +7 -0
- package/react/styles/text-variants.js.map +1 -0
- package/react/tab/index.cjs.js +1 -1
- package/react/tab/index.js +1 -1
- package/react/tab-group/index.cjs.js +1 -1
- package/react/tab-group/index.js +1 -1
- package/react/tab-panel/index.cjs.js +1 -1
- package/react/tab-panel/index.js +1 -1
- package/react/table/index.cjs.js +1 -1
- package/react/table/index.js +1 -1
- package/react/textarea/index.cjs.js +1 -1
- package/react/textarea/index.js +1 -1
- package/react/toast/index.cjs.js +1 -1
- package/react/toast/index.js +1 -1
- package/react/toast-container/index.cjs.js +1 -1
- package/react/toast-container/index.js +1 -1
- package/react/tooltip/index.cjs.js +1 -1
- package/react/tooltip/index.js +1 -1
- package/react/utils/animate.cjs.js.map +1 -0
- package/react/utils/animate.js +42 -0
- package/react/utils/animate.js.map +1 -0
- package/react/utils/animation-registry.cjs.js.map +1 -0
- package/react/utils/animation-registry.js +43 -0
- package/react/utils/animation-registry.js.map +1 -0
- package/react/utils/breakpoints.cjs.js.map +1 -0
- package/react/utils/breakpoints.js +9 -0
- package/react/utils/breakpoints.js.map +1 -0
- package/react/utils/defaultvalue.cjs.js.map +1 -0
- package/react/utils/defaultvalue.js +25 -0
- package/react/utils/defaultvalue.js.map +1 -0
- package/react/utils/event.cjs.js.map +1 -0
- package/react/utils/event.js +16 -0
- package/react/utils/event.js.map +1 -0
- package/react/utils/form.cjs.js.map +1 -0
- package/react/utils/form.js +133 -0
- package/react/utils/form.js.map +1 -0
- package/react/utils/generateId.cjs.js.map +1 -0
- package/react/utils/generateId.js +7 -0
- package/react/utils/generateId.js.map +1 -0
- package/react/utils/mergeDeep.cjs.js.map +1 -0
- package/react/utils/mergeDeep.js +26 -0
- package/react/utils/mergeDeep.js.map +1 -0
- package/react/utils/modal.cjs.js.map +1 -0
- package/react/utils/modal.js +56 -0
- package/react/utils/modal.js.map +1 -0
- package/react/utils/object.cjs.js.map +1 -0
- package/react/utils/object.js +7 -0
- package/react/utils/object.js.map +1 -0
- package/react/utils/scroll.cjs.js.map +1 -0
- package/react/utils/scroll.js +22 -0
- package/react/utils/scroll.js.map +1 -0
- package/react/utils/slot.cjs.js.map +1 -0
- package/react/utils/slot.js +53 -0
- package/react/utils/slot.js.map +1 -0
- package/react/utils/tabbable.cjs.js.map +1 -0
- package/react/utils/tabbable.js +69 -0
- package/react/utils/tabbable.js.map +1 -0
- package/react/utils/time.cjs.js.map +1 -0
- package/react/utils/time.js +75 -0
- package/react/utils/time.js.map +1 -0
- package/react/utils/watch.cjs.js.map +1 -0
- package/react/utils/watch.js +40 -0
- package/react/utils/watch.js.map +1 -0
- package/styles/anchor.js +0 -1
- package/styles/anchor.js.map +1 -1
- package/styles/bg-variants.js +0 -1
- package/styles/bg-variants.js.map +1 -1
- package/styles/border-variants.js +0 -1
- package/styles/border-variants.js.map +1 -1
- package/styles/feedback.js +1 -2
- package/styles/feedback.js.map +1 -1
- package/styles/form-hint.js +0 -1
- package/styles/form-hint.js.map +1 -1
- package/styles/form-label.js +0 -1
- package/styles/form-label.js.map +1 -1
- package/styles/header-class.js +0 -1
- package/styles/header-class.js.map +1 -1
- package/styles/paragraph.js +0 -1
- package/styles/paragraph.js.map +1 -1
- package/styles/svg.js +0 -1
- package/styles/svg.js.map +1 -1
- package/styles/text-variants.js +0 -1
- package/styles/text-variants.js.map +1 -1
- package/utils/animate.js +0 -1
- package/utils/animate.js.map +1 -1
- package/utils/animation-registry.js +0 -1
- package/utils/animation-registry.js.map +1 -1
- package/utils/breakpoints.js +0 -1
- package/utils/breakpoints.js.map +1 -1
- package/utils/defaultvalue.js +0 -1
- package/utils/defaultvalue.js.map +1 -1
- package/utils/event.js +0 -1
- package/utils/event.js.map +1 -1
- package/utils/form.js +0 -1
- package/utils/form.js.map +1 -1
- package/utils/generateId.js +0 -1
- package/utils/generateId.js.map +1 -1
- package/utils/mergeDeep.js +0 -1
- package/utils/mergeDeep.js.map +1 -1
- package/utils/modal.js +0 -1
- package/utils/modal.js.map +1 -1
- package/utils/object.js +0 -1
- package/utils/object.js.map +1 -1
- package/utils/scroll.js +0 -1
- package/utils/scroll.js.map +1 -1
- package/utils/slot.js +0 -1
- package/utils/slot.js.map +1 -1
- package/utils/tabbable.js +0 -1
- package/utils/tabbable.js.map +1 -1
- package/utils/time.js +0 -1
- package/utils/time.js.map +1 -1
- package/utils/watch.js +0 -1
- package/utils/watch.js.map +1 -1
- package/base/card-element.cjs.js.map +0 -1
- package/base/dropdown-element.cjs.js.map +0 -1
- package/base/dropdown-list-element.cjs.js.map +0 -1
- package/base/form-check-element.cjs.js.map +0 -1
- package/base/link-element.cjs.js.map +0 -1
- package/base/sgds-element.cjs.js.map +0 -1
- package/components/Accordion/sgds-accordion-item.cjs.js.map +0 -1
- package/components/Accordion/sgds-accordion.cjs.js.map +0 -1
- package/components/ActionCard/sgds-action-card.cjs.js.map +0 -1
- package/components/Alert/sgds-alert-heading.cjs.js.map +0 -1
- package/components/Alert/sgds-alert-link.cjs.js.map +0 -1
- package/components/Alert/sgds-alert.cjs.js.map +0 -1
- package/components/Badge/sgds-badge.cjs.js.map +0 -1
- package/components/Breadcrumb/sgds-breadcrumb-item.cjs.js.map +0 -1
- package/components/Breadcrumb/sgds-breadcrumb.cjs.js.map +0 -1
- package/components/Button/sgds-button.cjs.js.map +0 -1
- package/components/Card/sgds-card.cjs.js.map +0 -1
- package/components/Checkbox/checkbox.cjs.js +0 -11
- package/components/Checkbox/sgds-checkbox.cjs.js.map +0 -1
- package/components/ComboBox/sgds-combo-box.cjs.js.map +0 -1
- package/components/Datepicker/datepicker-calendar.cjs.js.map +0 -1
- package/components/Datepicker/datepicker-header.cjs.js.map +0 -1
- package/components/Datepicker/datepicker-input.cjs.js.map +0 -1
- package/components/Datepicker/sgds-datepicker.cjs.js.map +0 -1
- package/components/Drawer/sgds-drawer.cjs.js.map +0 -1
- package/components/Dropdown/sgds-dropdown-item.cjs.js.map +0 -1
- package/components/Dropdown/sgds-dropdown.cjs.js.map +0 -1
- package/components/FileUpload/sgds-file-upload.cjs.js.map +0 -1
- package/components/Footer/sgds-footer.cjs.js.map +0 -1
- package/components/Input/sgds-input.cjs.js.map +0 -1
- package/components/Mainnav/sgds-mainnav-dropdown.cjs.js.map +0 -1
- package/components/Mainnav/sgds-mainnav-item.cjs.js.map +0 -1
- package/components/Mainnav/sgds-mainnav.cjs.js.map +0 -1
- package/components/Masthead/sgds-masthead.cjs.js.map +0 -1
- package/components/Modal/sgds-modal.cjs.js.map +0 -1
- package/components/Pagination/sgds-pagination.cjs.js.map +0 -1
- package/components/Progress/sgds-progress-bar.cjs.js.map +0 -1
- package/components/Progress/sgds-progress.cjs.js.map +0 -1
- package/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +0 -1
- package/components/Radio/radio.cjs.js +0 -11
- package/components/Radio/sgds-radio-group.cjs.js.map +0 -1
- package/components/Radio/sgds-radio.cjs.js.map +0 -1
- package/components/Sidenav/sgds-sidenav-item.cjs.js.map +0 -1
- package/components/Sidenav/sgds-sidenav-link.cjs.js.map +0 -1
- package/components/Sidenav/sgds-sidenav.cjs.js.map +0 -1
- package/components/Spinner/sgds-spinner.cjs.js.map +0 -1
- package/components/Stepper/sgds-stepper.cjs.js.map +0 -1
- package/components/Tab/sgds-tab-group.cjs.js.map +0 -1
- package/components/Tab/sgds-tab-panel.cjs.js.map +0 -1
- package/components/Tab/sgds-tab.cjs.js.map +0 -1
- package/components/Table/sgds-table.cjs.js.map +0 -1
- package/components/Textarea/sgds-textarea.cjs.js.map +0 -1
- package/components/Toast/sgds-toast-container.cjs.js.map +0 -1
- package/components/Toast/sgds-toast.cjs.js.map +0 -1
- package/components/Tooltip/sgds-tooltip.cjs.js.map +0 -1
- package/internals/CloseButton/sgds-close-button.cjs.js.map +0 -1
- package/utils/animate.cjs.js.map +0 -1
- package/utils/animation-registry.cjs.js.map +0 -1
- package/utils/breakpoints.cjs.js.map +0 -1
- package/utils/defaultvalue.cjs.js.map +0 -1
- package/utils/event.cjs.js.map +0 -1
- package/utils/form.cjs.js.map +0 -1
- package/utils/generateId.cjs.js.map +0 -1
- package/utils/mergeDeep.cjs.js.map +0 -1
- package/utils/modal.cjs.js.map +0 -1
- package/utils/object.cjs.js.map +0 -1
- package/utils/scroll.cjs.js.map +0 -1
- package/utils/slot.cjs.js.map +0 -1
- package/utils/tabbable.cjs.js.map +0 -1
- package/utils/time.cjs.js.map +0 -1
- package/utils/watch.cjs.js.map +0 -1
- /package/{base → react/base}/card-element.cjs.js +0 -0
- /package/{base → react/base}/card.cjs.js +0 -0
- /package/{base → react/base}/card.cjs.js.map +0 -0
- /package/{base → react/base}/dropdown-element.cjs.js +0 -0
- /package/{base → react/base}/dropdown-list-element.cjs.js +0 -0
- /package/{base → react/base}/link-element.cjs.js +0 -0
- /package/{base → react/base}/sgds-element.cjs.js +0 -0
- /package/{base → react/base}/sgds-element.cjs2.js +0 -0
- /package/{base → react/base}/sgds-element.cjs2.js.map +0 -0
- /package/{components → react/components}/Accordion/accordion-item.cjs.js +0 -0
- /package/{components → react/components}/Accordion/accordion-item.cjs.js.map +0 -0
- /package/{components → react/components}/Accordion/accordion.cjs.js +0 -0
- /package/{components → react/components}/Accordion/accordion.cjs.js.map +0 -0
- /package/{components → react/components}/Accordion/sgds-accordion-item.cjs.js +0 -0
- /package/{components → react/components}/Accordion/sgds-accordion.cjs.js +0 -0
- /package/{components → react/components}/ActionCard/action-card.cjs.js +0 -0
- /package/{components → react/components}/ActionCard/action-card.cjs.js.map +0 -0
- /package/{components → react/components}/ActionCard/sgds-action-card.cjs.js +0 -0
- /package/{components → react/components}/Alert/alert-link.cjs.js +0 -0
- /package/{components → react/components}/Alert/alert-link.cjs.js.map +0 -0
- /package/{components → react/components}/Alert/alert.cjs.js +0 -0
- /package/{components → react/components}/Alert/alert.cjs.js.map +0 -0
- /package/{components → react/components}/Alert/sgds-alert-heading.cjs.js +0 -0
- /package/{components → react/components}/Alert/sgds-alert-link.cjs.js +0 -0
- /package/{components → react/components}/Alert/sgds-alert.cjs.js +0 -0
- /package/{components → react/components}/Badge/badge.cjs.js +0 -0
- /package/{components → react/components}/Badge/badge.cjs.js.map +0 -0
- /package/{components → react/components}/Badge/sgds-badge.cjs.js +0 -0
- /package/{components → react/components}/Breadcrumb/breadcrumb-item.cjs.js +0 -0
- /package/{components → react/components}/Breadcrumb/breadcrumb-item.cjs.js.map +0 -0
- /package/{components → react/components}/Breadcrumb/breadcrumb.cjs.js +0 -0
- /package/{components → react/components}/Breadcrumb/breadcrumb.cjs.js.map +0 -0
- /package/{components → react/components}/Breadcrumb/sgds-breadcrumb-item.cjs.js +0 -0
- /package/{components → react/components}/Breadcrumb/sgds-breadcrumb.cjs.js +0 -0
- /package/{components → react/components}/Button/button.cjs.js +0 -0
- /package/{components → react/components}/Button/button.cjs.js.map +0 -0
- /package/{components → react/components}/Button/sgds-button.cjs.js +0 -0
- /package/{components → react/components}/Card/card.cjs.js +0 -0
- /package/{components → react/components}/Card/card.cjs.js.map +0 -0
- /package/{components → react/components}/Card/sgds-card.cjs.js +0 -0
- /package/{components → react/components}/Checkbox/checkbox.cjs.js.map +0 -0
- /package/{components → react/components}/Checkbox/sgds-checkbox.cjs.js +0 -0
- /package/{components → react/components}/ComboBox/combo-box.cjs.js +0 -0
- /package/{components → react/components}/ComboBox/combo-box.cjs.js.map +0 -0
- /package/{components → react/components}/ComboBox/sgds-combo-box.cjs.js +0 -0
- /package/{components → react/components}/Datepicker/datepicker-calendar.cjs.js +0 -0
- /package/{components → react/components}/Datepicker/datepicker-calendar.cjs2.js +0 -0
- /package/{components → react/components}/Datepicker/datepicker-calendar.cjs2.js.map +0 -0
- /package/{components → react/components}/Datepicker/datepicker-header.cjs.js +0 -0
- /package/{components → react/components}/Datepicker/datepicker-header.cjs2.js +0 -0
- /package/{components → react/components}/Datepicker/datepicker-header.cjs2.js.map +0 -0
- /package/{components → react/components}/Datepicker/datepicker-input.cjs.js +0 -0
- /package/{components → react/components}/Datepicker/datepicker-input.cjs2.js +0 -0
- /package/{components → react/components}/Datepicker/datepicker-input.cjs2.js.map +0 -0
- /package/{components → react/components}/Datepicker/datepicker.cjs.js +0 -0
- /package/{components → react/components}/Datepicker/datepicker.cjs.js.map +0 -0
- /package/{components → react/components}/Datepicker/sgds-datepicker.cjs.js +0 -0
- /package/{components → react/components}/Drawer/drawer.cjs.js +0 -0
- /package/{components → react/components}/Drawer/drawer.cjs.js.map +0 -0
- /package/{components → react/components}/Drawer/sgds-drawer.cjs.js +0 -0
- /package/{components → react/components}/Dropdown/dropdown.cjs.js +0 -0
- /package/{components → react/components}/Dropdown/dropdown.cjs.js.map +0 -0
- /package/{components → react/components}/Dropdown/sgds-dropdown-item.cjs.js +0 -0
- /package/{components → react/components}/Dropdown/sgds-dropdown.cjs.js +0 -0
- /package/{components → react/components}/FileUpload/file-upload.cjs.js +0 -0
- /package/{components → react/components}/FileUpload/file-upload.cjs.js.map +0 -0
- /package/{components → react/components}/FileUpload/sgds-file-upload.cjs.js +0 -0
- /package/{components → react/components}/Footer/footer.cjs.js +0 -0
- /package/{components → react/components}/Footer/footer.cjs.js.map +0 -0
- /package/{components → react/components}/Footer/sgds-footer.cjs.js +0 -0
- /package/{components → react/components}/Input/input.cjs.js +0 -0
- /package/{components → react/components}/Input/input.cjs.js.map +0 -0
- /package/{components → react/components}/Mainnav/mainnav-dropdown.cjs.js +0 -0
- /package/{components → react/components}/Mainnav/mainnav-dropdown.cjs.js.map +0 -0
- /package/{components → react/components}/Mainnav/mainnav-item.cjs.js +0 -0
- /package/{components → react/components}/Mainnav/mainnav-item.cjs.js.map +0 -0
- /package/{components → react/components}/Mainnav/mainnav.cjs.js +0 -0
- /package/{components → react/components}/Mainnav/mainnav.cjs.js.map +0 -0
- /package/{components → react/components}/Mainnav/sgds-mainnav-dropdown.cjs.js +0 -0
- /package/{components → react/components}/Mainnav/sgds-mainnav-item.cjs.js +0 -0
- /package/{components → react/components}/Mainnav/sgds-mainnav.cjs.js +0 -0
- /package/{components → react/components}/Masthead/masthead.cjs.js +0 -0
- /package/{components → react/components}/Masthead/masthead.cjs.js.map +0 -0
- /package/{components → react/components}/Masthead/sgds-masthead.cjs.js +0 -0
- /package/{components → react/components}/Modal/modal.cjs.js +0 -0
- /package/{components → react/components}/Modal/modal.cjs.js.map +0 -0
- /package/{components → react/components}/Modal/sgds-modal.cjs.js +0 -0
- /package/{components → react/components}/Pagination/pagination.cjs.js +0 -0
- /package/{components → react/components}/Pagination/pagination.cjs.js.map +0 -0
- /package/{components → react/components}/Pagination/sgds-pagination.cjs.js +0 -0
- /package/{components → react/components}/Progress/progress-bar.cjs.js +0 -0
- /package/{components → react/components}/Progress/progress-bar.cjs.js.map +0 -0
- /package/{components → react/components}/Progress/progress.cjs.js +0 -0
- /package/{components → react/components}/Progress/progress.cjs.js.map +0 -0
- /package/{components → react/components}/Progress/sgds-progress-bar.cjs.js +0 -0
- /package/{components → react/components}/Progress/sgds-progress.cjs.js +0 -0
- /package/{components → react/components}/QuantityToggle/quantity-toggle.cjs.js +0 -0
- /package/{components → react/components}/QuantityToggle/quantity-toggle.cjs.js.map +0 -0
- /package/{components → react/components}/QuantityToggle/sgds-quantity-toggle.cjs.js +0 -0
- /package/{components → react/components}/Radio/radio-group.cjs.js +0 -0
- /package/{components → react/components}/Radio/radio-group.cjs.js.map +0 -0
- /package/{components → react/components}/Radio/radio.cjs.js.map +0 -0
- /package/{components → react/components}/Radio/sgds-radio.cjs.js +0 -0
- /package/{components → react/components}/Sidenav/sgds-sidenav-item.cjs.js +0 -0
- /package/{components → react/components}/Sidenav/sgds-sidenav-link.cjs.js +0 -0
- /package/{components → react/components}/Sidenav/sgds-sidenav.cjs.js +0 -0
- /package/{components → react/components}/Sidenav/sidenav-item.cjs.js +0 -0
- /package/{components → react/components}/Sidenav/sidenav-item.cjs.js.map +0 -0
- /package/{components → react/components}/Sidenav/sidenav-link.cjs.js +0 -0
- /package/{components → react/components}/Sidenav/sidenav-link.cjs.js.map +0 -0
- /package/{components → react/components}/Sidenav/sidenav.cjs.js +0 -0
- /package/{components → react/components}/Sidenav/sidenav.cjs.js.map +0 -0
- /package/{components → react/components}/Spinner/sgds-spinner.cjs.js +0 -0
- /package/{components → react/components}/Spinner/spinner.cjs.js +0 -0
- /package/{components → react/components}/Spinner/spinner.cjs.js.map +0 -0
- /package/{components → react/components}/Stepper/sgds-stepper.cjs.js +0 -0
- /package/{components → react/components}/Stepper/stepper.cjs.js +0 -0
- /package/{components → react/components}/Stepper/stepper.cjs.js.map +0 -0
- /package/{components → react/components}/Tab/sgds-tab-group.cjs.js +0 -0
- /package/{components → react/components}/Tab/sgds-tab-panel.cjs.js +0 -0
- /package/{components → react/components}/Tab/sgds-tab.cjs.js +0 -0
- /package/{components → react/components}/Tab/tab-group.cjs.js +0 -0
- /package/{components → react/components}/Tab/tab-group.cjs.js.map +0 -0
- /package/{components → react/components}/Tab/tab-panel.cjs.js +0 -0
- /package/{components → react/components}/Tab/tab-panel.cjs.js.map +0 -0
- /package/{components → react/components}/Tab/tab.cjs.js +0 -0
- /package/{components → react/components}/Tab/tab.cjs.js.map +0 -0
- /package/{components → react/components}/Table/sgds-table.cjs.js +0 -0
- /package/{components → react/components}/Table/table.cjs.js +0 -0
- /package/{components → react/components}/Table/table.cjs.js.map +0 -0
- /package/{components → react/components}/Textarea/textarea.cjs.js +0 -0
- /package/{components → react/components}/Textarea/textarea.cjs.js.map +0 -0
- /package/{components → react/components}/Toast/sgds-toast-container.cjs.js +0 -0
- /package/{components → react/components}/Toast/sgds-toast.cjs.js +0 -0
- /package/{components → react/components}/Toast/toast-container.cjs.js +0 -0
- /package/{components → react/components}/Toast/toast-container.cjs.js.map +0 -0
- /package/{components → react/components}/Toast/toast.cjs.js +0 -0
- /package/{components → react/components}/Toast/toast.cjs.js.map +0 -0
- /package/{components → react/components}/Tooltip/sgds-tooltip.cjs.js +0 -0
- /package/{components → react/components}/Tooltip/tooltip.cjs.js +0 -0
- /package/{components → react/components}/Tooltip/tooltip.cjs.js.map +0 -0
- /package/{internals → react/internals}/CloseButton/close-button.cjs.js +0 -0
- /package/{internals → react/internals}/CloseButton/close-button.cjs.js.map +0 -0
- /package/{internals → react/internals}/CloseButton/sgds-close-button.cjs.js +0 -0
- /package/{styles → react/styles}/anchor.cjs.js +0 -0
- /package/{styles → react/styles}/anchor.cjs.js.map +0 -0
- /package/{styles → react/styles}/bg-variants.cjs.js +0 -0
- /package/{styles → react/styles}/bg-variants.cjs.js.map +0 -0
- /package/{styles → react/styles}/border-variants.cjs.js +0 -0
- /package/{styles → react/styles}/border-variants.cjs.js.map +0 -0
- /package/{styles → react/styles}/feedback.cjs.js.map +0 -0
- /package/{styles → react/styles}/form-hint.cjs.js +0 -0
- /package/{styles → react/styles}/form-hint.cjs.js.map +0 -0
- /package/{styles → react/styles}/form-label.cjs.js +0 -0
- /package/{styles → react/styles}/form-label.cjs.js.map +0 -0
- /package/{styles → react/styles}/header-class.cjs.js +0 -0
- /package/{styles → react/styles}/header-class.cjs.js.map +0 -0
- /package/{styles → react/styles}/paragraph.cjs.js +0 -0
- /package/{styles → react/styles}/paragraph.cjs.js.map +0 -0
- /package/{styles → react/styles}/svg.cjs.js +0 -0
- /package/{styles → react/styles}/svg.cjs.js.map +0 -0
- /package/{styles → react/styles}/text-variants.cjs.js +0 -0
- /package/{styles → react/styles}/text-variants.cjs.js.map +0 -0
- /package/{utils → react/utils}/animate.cjs.js +0 -0
- /package/{utils → react/utils}/animation-registry.cjs.js +0 -0
- /package/{utils → react/utils}/breakpoints.cjs.js +0 -0
- /package/{utils → react/utils}/defaultvalue.cjs.js +0 -0
- /package/{utils → react/utils}/event.cjs.js +0 -0
- /package/{utils → react/utils}/form.cjs.js +0 -0
- /package/{utils → react/utils}/generateId.cjs.js +0 -0
- /package/{utils → react/utils}/mergeDeep.cjs.js +0 -0
- /package/{utils → react/utils}/modal.cjs.js +0 -0
- /package/{utils → react/utils}/object.cjs.js +0 -0
- /package/{utils → react/utils}/scroll.cjs.js +0 -0
- /package/{utils → react/utils}/slot.cjs.js +0 -0
- /package/{utils → react/utils}/tabbable.cjs.js +0 -0
- /package/{utils → react/utils}/time.cjs.js +0 -0
- /package/{utils → react/utils}/watch.cjs.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sgds-datepicker.cjs.js","sources":["../../../../src/components/Datepicker/sgds-datepicker.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { format, parse } from \"date-fns\";\nimport { html } from \"lit\";\nimport { property, query, queryAsync, state } from \"lit/decorators.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { DropdownElement } from \"../../base/dropdown-element\";\nimport { type SgdsFormControl } from \"../../utils/form\";\nimport { DATE_PATTERNS, setTimeToNoon } from \"../../utils/time\";\nimport { watch } from \"../../utils/watch\";\nimport { DatepickerCalendar } from \"./datepicker-calendar\";\nimport { DatepickerHeader } from \"./datepicker-header\";\nimport DatepickerInput from \"./datepicker-input\";\nimport { SgdsButton } from \"../Button/sgds-button\";\nimport { ViewEnum } from \"./types\";\nimport dropdownStyle from \"../Dropdown/dropdown.css\";\nimport datepickerStyle from \"./datepicker.css\";\n\nexport type DateFormat = \"MM/DD/YYYY\" | \"DD/MM/YYYY\" | \"YYYY/MM/DD\";\n\n/**\n * @summary The `DatePicker` Component is built using `Dropdown`, `Input` and `Button` components. By default, the Calendar points to today's date and input has no value. Users can either pick dates from the calendar or type dates through the input\n *\n * @event sgds-change-date - Emitted when the state of datepicker's input changes during first load, close button reset click & date click. Date values can be accessed via event.target.value\n *\n * @cssproperty --datepicker-theme-color - Datepicker's overall theme color\n * @cssproperty --datepicker-hover-bg - Datepicker's calendar menu hover color\n * @cssproperty --datepicker-bg - Datepicker's menu background color\n * @cssproperty --datepicker-close-button-bg - Datepicker's close button background color\n * @cssproperty --datepicker-close-button-hover-bg - Datepicker's close button hover background color\n * @cssproperty --datepicker-close-button-color - Datepicker's close button color\n * @cssproperty --datepicker-selected-date-bg - Selected date's background color\n * @cssproperty --datepicker-selected-date-color - Selected date's text color\n *\n * @description displayDate sets the month, year views of the calendar while focusedDate follows the focus which also directly changes\n * displayDate on certain occasions. Example, when keyboard moves up to the next month, it updates displayDate which then affect the current\n * date view of the calendar\n */\nexport class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) implements SgdsFormControl {\n static styles = [...DropdownElement.styles, dropdownStyle, datepickerStyle];\n /**@internal */\n static formAssociated = true;\n private _internals: ElementInternals;\n\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-datepicker-input\": DatepickerInput,\n \"sgds-datepicker-calendar\": DatepickerCalendar,\n \"sgds-datepicker-header\": DatepickerHeader,\n \"sgds-button\": SgdsButton\n };\n }\n\n /** When true, adds required attribute to input element */\n @property({ type: Boolean, reflect: true }) required = false;\n /**The datepicker input's name attribute */\n @property({ reflect: true }) name: string;\n /** When true, adds disabled attribute to input and button element */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The initial value of DatePicker on first load for single & range mode as array of string. eg.'[\"22/12/2023\"]' for single & '[\"22/12/2023\",\"25/12/2023\"]' for range respectively */\n @property({ type: Array, reflect: true }) initialValue: string[] = [];\n\n /** Date format reflected on input */\n @property({ type: String }) dateFormat: DateFormat = \"DD/MM/YYYY\";\n\n /** ISO date string to set the lowest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) minDate = \"\";\n\n /** ISO date string to set the highest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) maxDate = \"\";\n\n /** Changes DatePicker to single date selection or range date selection */\n @property({ type: String, reflect: true }) mode: \"single\" | \"range\" = \"single\";\n\n /**Feedback text for error state when date input is invalid */\n @property({ type: String, reflect: true }) invalidFeedback = \"Please enter a valid date\";\n\n /** The datepicker input's label */\n @property({ reflect: true }) label = \"\";\n\n /** The datepicker input's hint text below the label */\n @property({ reflect: true }) hintText = \"\";\n\n /** Controls auto-flipping of menu */\n @property({ type: Boolean, reflect: true, state: false })\n noFlip = false;\n\n /** The drop position of menu relative to the toggle button */\n @property({ type: String, reflect: true, state: false })\n drop: \"up\" | \"down\" = \"down\";\n\n /** Provides the date context for Calendar to present the appropriate view. Defaults to today's date */\n @property({ attribute: false }) displayDate: Date;\n /**@internal */\n @state() value = \"\";\n\n @state()\n private view: ViewEnum = \"days\";\n\n @state() private selectedDateRange: Date[] = [];\n\n @state() private focusedDate: Date;\n\n @state() private focusedTabIndex = 3;\n\n private initialDisplayDate: Date;\n\n @queryAsync(\"sgds-datepicker-calendar\")\n private calendar: Promise<DatepickerCalendar>;\n\n @queryAsync(\"sgds-datepicker-input\")\n private datepickerInputAsync: Promise<DatepickerInput>;\n\n @queryAsync(\"sgds-datepicker-header\")\n private datepickerHeaderAsync: Promise<DatepickerHeader>;\n\n @query(\"sgds-datepicker-input\")\n private datepickerInput: DatepickerInput;\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n public reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n constructor() {\n super();\n this._internals = this.attachInternals();\n /**@internal */\n this.modifierOpt = [\n {\n name: \"offset\",\n options: {\n offset: [0, 10]\n }\n }\n ];\n }\n\n async connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"sgds-view\", this._handleViewChanged);\n this.addEventListener(\"sgds-change-calendar\", this._handleDateChanged);\n this.addEventListener(\"sgds-update-focus\", this._handleFocusDateChanged);\n this.addEventListener(\"sgds-selectmonth\", this._handleSelectMonth);\n this.addEventListener(\"sgds-selectyear\", this._handleSelectYear);\n this.addEventListener(\"sgds-selectdates\", this._handleSelectDatesAndClose);\n this.addEventListener(\"sgds-selectdates-input\", this._handleSelectDatesInput);\n this.addEventListener(\"sgds-empty-input\", this._handleEmptyInput);\n this.addEventListener(\"keydown\", this._handleTab);\n this.addEventListener(\"sgds-hide\", this._handleCloseMenu);\n this.addEventListener(\"sgds-show\", this._handleOpenMenu);\n this.initialDisplayDate = this.displayDate || new Date();\n if (this.initialValue && this.initialValue.length > 0) {\n // Validate initialValue against the dateFormat regex\n const dateFormatRegex = new RegExp(this._getDateFormatRegex());\n // const startDateString = this.initialValue[0];\n const invalidDates = this.initialValue.filter(v => !dateFormatRegex.test(v));\n if (invalidDates.length > 0) {\n return console.error(\"Invalid date format in initialValue:\", invalidDates);\n } else {\n const initialSelectedDates = this.initialValue.map(v =>\n setTimeToNoon(parse(v, DATE_PATTERNS[this.dateFormat].fnsPattern, new Date()))\n );\n this._handleSelectDates(initialSelectedDates);\n }\n } else {\n this.displayDate = this.initialDisplayDate;\n }\n }\n\n async firstUpdated() {\n super.firstUpdated();\n if (this.menuIsOpen) {\n const input = await this.datepickerInputAsync;\n this.showMenu();\n const cal = await this.calendar;\n cal.focusOnCalendar(input);\n }\n\n const shadowInput = await this.datepickerInput.shadowInput;\n this._manageInternalsDefault(shadowInput);\n this._internals.setValidity(shadowInput.validity, shadowInput.validationMessage, shadowInput);\n }\n\n /** @internal */\n private _getDateFormatRegex(): string {\n // validate date strings and adhere to the specified date format\n return (\n this.dateFormat\n // Replace any special characters with their escaped version using \"\\\\$&\"\n .replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n // Replace 'MM' with '\\\\d{2}', which matches two digits representing the month (e.g., 01, 12)\n .replace(\"MM\", \"\\\\d{2}\")\n // Replace 'DD' with '\\\\d{2}', which matches two digits representing the day (e.g., 01, 31)\n .replace(\"DD\", \"\\\\d{2}\")\n // Replace 'YYYY' with '\\\\d{4}', which matches four digits representing the year (e.g., 2021)\n .replace(\"YYYY\", \"\\\\d{4}\")\n // Replace '/' with '\\\\/', which matches the forward slash character\n .replace(\"/\", \"\\\\/\")\n );\n }\n private _handleTab(event: KeyboardEvent) {\n if (!this.menuIsOpen) {\n return;\n }\n const tabIndexArray = Array(4);\n if (event.shiftKey && event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex - 1 + tabIndexArray.length) % tabIndexArray.length;\n } else if (event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex + 1 + tabIndexArray.length) % tabIndexArray.length;\n }\n }\n\n @watch(\"value\")\n _handleValueChange() {\n this.emit(\"sgds-change-date\");\n this._setInternalFormValue(this.value);\n }\n\n private async _handleCloseMenu() {\n //return focus to input when menu closes\n const input = await this.datepickerInputAsync;\n input.focus();\n\n if (this.selectedDateRange.length === 0) {\n this.displayDate = this.initialDisplayDate;\n } else {\n const selectedDatesLength = this.selectedDateRange.length;\n this.displayDate = this.selectedDateRange[selectedDatesLength - 1];\n const calendar = await this.calendar;\n calendar._updateFocusedDate();\n }\n }\n private async _handleOpenMenu() {\n const cal = await this.calendar;\n const input = await this.datepickerInputAsync;\n cal.focusOnCalendar(input);\n }\n\n private _makeInputValueString = (startDate: Date, endDate: Date, dateFormat: string) => {\n if (!startDate && !endDate) return this.value;\n const formatDate = (date: Date) => format(date, DATE_PATTERNS[dateFormat].fnsPattern);\n switch (this.mode) {\n case \"single\": {\n if (startDate) {\n this.value = formatDate(startDate);\n }\n break;\n }\n case \"range\": {\n if (startDate && endDate) {\n this.value = `${formatDate(startDate)} - ${formatDate(endDate)}`;\n }\n if (startDate && !endDate) {\n this.value = `${formatDate(startDate)} - ${this.dateFormat.toLowerCase()}`;\n }\n break;\n }\n }\n return this.value;\n };\n private _handleSelectDatesInput(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n this._manageInternalsDefault(this._shadowInput);\n }\n private async _handleSelectDates(newSelectedDates: Date[]) {\n newSelectedDates.sort((a: Date, b: Date) => a.getTime() - b.getTime());\n this.displayDate = newSelectedDates[0];\n this.focusedDate = newSelectedDates[0];\n this.selectedDateRange = newSelectedDates;\n\n // Get the formattedDate value for the selected dates\n const formattedDate = this._makeInputValueString(\n this.selectedDateRange[0],\n this.selectedDateRange[1],\n this.dateFormat\n );\n\n // Set formattedDate value as the new value for sgds-input\n this.value = formattedDate;\n const input = await this.datepickerInputAsync;\n input.updateMaskValue();\n }\n\n private get _shadowInput() {\n return this.datepickerInput.shadowRoot.querySelector(\"input\");\n }\n private _handleSelectDatesAndClose(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n\n if (this.mode === \"range\" && this.selectedDateRange.length === 2) {\n this.hideMenu();\n } else if (this.mode === \"single\" && this.selectedDateRange.length === 1) {\n this.hideMenu();\n }\n this._manageInternalsValid();\n }\n\n /** update latest view state from datepicker-header */\n private _handleViewChanged(event: CustomEvent<string>) {\n this.view = event.detail as ViewEnum;\n }\n\n private _handleDateChanged(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private _handleFocusDateChanged(event: CustomEvent<Date>) {\n this.focusedDate = event.detail;\n }\n\n private _handleSelectMonth(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n\n private _handleSelectYear(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private async _handleInvalidInput() {\n this.selectedDateRange = [];\n this.displayDate = this.initialDisplayDate;\n this._manageInternalsBadInput();\n }\n private async _handleButtonResetClick() {\n this.displayDate = this.initialDisplayDate;\n this.selectedDateRange = [];\n this.value = \"\";\n this.view = \"days\";\n this.hideMenu();\n const input = await this.datepickerInputAsync;\n input.setInvalid(false);\n input.destroyInputMask();\n await input.applyInputMask();\n\n this._manageInternalsRequired();\n }\n\n private async _handleEmptyInput() {\n this._manageInternalsRequired();\n }\n\n private _manageInternalsRequired() {\n this.required\n ? this._internals.setValidity(\n {\n valueMissing: true\n },\n \"Please fill in this field\",\n this._shadowInput\n )\n : this._internals.setValidity({});\n }\n private _manageInternalsBadInput() {\n this._internals.setValidity(\n {\n badInput: true\n },\n \"The chosen date(s) are invalid\",\n this._shadowInput\n );\n }\n\n private _manageInternalsValid() {\n this._internals.setValidity({});\n }\n\n private _manageInternalsDefault(inputEl: HTMLInputElement) {\n this._internals.setValidity(inputEl.validity, inputEl.validationMessage, inputEl);\n }\n\n private _setInternalFormValue(value: string) {\n this._internals.setFormValue(value);\n }\n\n private async _handleInputMaskChange(e: CustomEvent) {\n this.value = e.detail;\n }\n\n private _dialogAriaLabels = {\n days: \"Choose date\",\n months: \"Choose month\",\n years: \"Choose year\"\n };\n\n render() {\n const svgEl = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-x\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z\"\n />\n </svg>\n `;\n\n return html`\n <div>\n <sgds-datepicker-input\n .value=${live(this.value)}\n ?required=${this.required}\n ?disabled=${this.disabled}\n placeholder=\"\"\n ${ref(this.myDropdown)}\n mode=${this.mode}\n dateFormat=${this.dateFormat}\n invalidFeedback=${this.invalidFeedback}\n @sgds-mask-input-change=${this._handleInputMaskChange}\n @sgds-invalid-input=${this._handleInvalidInput}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n label=${this.label}\n hintText=${this.hintText}\n name=${this.name}\n >\n <sgds-button\n role=\"button\"\n slot=\"calendar-btn\"\n class=\"calendar-btn\"\n aria-expanded=\"${this.menuIsOpen}\"\n aria-haspopup=\"dialog\"\n aria-controls=${this.dropdownMenuId}\n @click=${() => this.toggleMenu()}\n ariaLabel=${this.menuIsOpen ? \"Close Calendar\" : \"Open Calendar\"}\n ?disabled=${this.disabled}\n variant=\"outlined\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-calendar\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z\"\n />\n </svg>\n </sgds-button>\n <sgds-button\n role=\"button\"\n slot=\"reset-btn\"\n variant=\"primary\"\n ?disabled=${this.disabled}\n class=\"reset-btn\"\n @click=${() => this._handleButtonResetClick()}\n ariaLabel=\"Reset Datepicker\"\n >\n ${svgEl}\n </sgds-button>\n </sgds-datepicker-input>\n\n <ul\n id=${this.dropdownMenuId}\n class=\"sgds datepicker dropdown-menu\"\n role=\"dialog\"\n part=\"menu\"\n aria-label=${this._dialogAriaLabels[this.view]}\n @click=${(event: MouseEvent) => event.stopPropagation()}\n >\n <sgds-datepicker-header\n .view=${this.view}\n .displayDate=${this.displayDate}\n .focusedDate=${this.focusedDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-header>\n <sgds-datepicker-calendar\n .show=${this.menuIsOpen}\n .view=${this.view}\n .displayDate=${this.displayDate}\n .mode=${this.mode}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-calendar>\n </ul>\n </div>\n `;\n }\n}\n\nexport default SgdsDatepicker;\n"],"names":["ScopedElementsMixin","DropdownElement","DatepickerInput","DatepickerCalendar","DatepickerHeader","SgdsButton","format","DATE_PATTERNS","setTimeToNoon","parse","html","live","ref","dropdownStyle","datepickerStyle","__decorate","property","state","queryAsync","query","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;;;AAiBG;MACU,cAAe,SAAQA,kCAAmB,CAACC,+BAAe,CAAC,CAAA;;AAOtE,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,uBAAuB,EAAEC,+BAAe;AACxC,YAAA,0BAA0B,EAAEC,qCAAkB;AAC9C,YAAA,wBAAwB,EAAEC,iCAAgB;AAC1C,YAAA,aAAa,EAAEC,qBAAU;SAC1B,CAAC;KACH;;IAsEM,cAAc,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;KACzC;AACD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE,CAAC;;QAvEkC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAIjB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAGnB,IAAY,CAAA,YAAA,GAAa,EAAE,CAAC;;QAG1C,IAAU,CAAA,UAAA,GAAe,YAAY,CAAC;;QAGtC,IAAO,CAAA,OAAA,GAAG,EAAE,CAAC;;QAGb,IAAO,CAAA,OAAA,GAAG,EAAE,CAAC;;QAGE,IAAI,CAAA,IAAA,GAAuB,QAAQ,CAAC;;QAGpC,IAAe,CAAA,eAAA,GAAG,2BAA2B,CAAC;;QAG5D,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAGX,IAAQ,CAAA,QAAA,GAAG,EAAE,CAAC;;QAI3C,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;;QAIf,IAAI,CAAA,IAAA,G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,EAAA,cAAA,CAAA,SAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGtCH,gBAAA,CAAA;IADPG,wBAAU,CAAC,uBAAuB,CAAC;AACmB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,sBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAG/CH,gBAAA,CAAA;IADPG,wBAAU,CAAC,wBAAwB,CAAC;AACoB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,uBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGjDH,gBAAA,CAAA;IADPI,mBAAK,CAAC,uBAAuB,CAAC;AACU,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAkGzCJ,gBAAA,CAAA;IADCK,WAAK,CAAC,OAAO,CAAC;AAId,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA;;;;;"}
|
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __decorate } from 'tslib';
|
|
3
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
4
|
+
import { parse, format } from 'date-fns';
|
|
5
|
+
import { html } from 'lit';
|
|
6
|
+
import { property, state, queryAsync, query } from 'lit/decorators.js';
|
|
7
|
+
import { live } from 'lit/directives/live.js';
|
|
8
|
+
import { ref } from 'lit/directives/ref.js';
|
|
9
|
+
import { DropdownElement } from '../../base/dropdown-element.js';
|
|
10
|
+
import { setTimeToNoon, DATE_PATTERNS } from '../../utils/time.js';
|
|
11
|
+
import { watch } from '../../utils/watch.js';
|
|
12
|
+
import { DatepickerCalendar } from './datepicker-calendar.js';
|
|
13
|
+
import { DatepickerHeader } from './datepicker-header.js';
|
|
14
|
+
import { DatepickerInput } from './datepicker-input.js';
|
|
15
|
+
import { SgdsButton } from '../Button/sgds-button.js';
|
|
16
|
+
import css_248z from '../Dropdown/dropdown.js';
|
|
17
|
+
import css_248z$1 from './datepicker.js';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @summary The `DatePicker` Component is built using `Dropdown`, `Input` and `Button` components. By default, the Calendar points to today's date and input has no value. Users can either pick dates from the calendar or type dates through the input
|
|
21
|
+
*
|
|
22
|
+
* @event sgds-change-date - Emitted when the state of datepicker's input changes during first load, close button reset click & date click. Date values can be accessed via event.target.value
|
|
23
|
+
*
|
|
24
|
+
* @cssproperty --datepicker-theme-color - Datepicker's overall theme color
|
|
25
|
+
* @cssproperty --datepicker-hover-bg - Datepicker's calendar menu hover color
|
|
26
|
+
* @cssproperty --datepicker-bg - Datepicker's menu background color
|
|
27
|
+
* @cssproperty --datepicker-close-button-bg - Datepicker's close button background color
|
|
28
|
+
* @cssproperty --datepicker-close-button-hover-bg - Datepicker's close button hover background color
|
|
29
|
+
* @cssproperty --datepicker-close-button-color - Datepicker's close button color
|
|
30
|
+
* @cssproperty --datepicker-selected-date-bg - Selected date's background color
|
|
31
|
+
* @cssproperty --datepicker-selected-date-color - Selected date's text color
|
|
32
|
+
*
|
|
33
|
+
* @description displayDate sets the month, year views of the calendar while focusedDate follows the focus which also directly changes
|
|
34
|
+
* displayDate on certain occasions. Example, when keyboard moves up to the next month, it updates displayDate which then affect the current
|
|
35
|
+
* date view of the calendar
|
|
36
|
+
*/
|
|
37
|
+
class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) {
|
|
38
|
+
/**@internal */
|
|
39
|
+
static get scopedElements() {
|
|
40
|
+
return {
|
|
41
|
+
"sgds-datepicker-input": DatepickerInput,
|
|
42
|
+
"sgds-datepicker-calendar": DatepickerCalendar,
|
|
43
|
+
"sgds-datepicker-header": DatepickerHeader,
|
|
44
|
+
"sgds-button": SgdsButton
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
48
|
+
reportValidity() {
|
|
49
|
+
return this._internals.reportValidity();
|
|
50
|
+
}
|
|
51
|
+
constructor() {
|
|
52
|
+
super();
|
|
53
|
+
/** When true, adds required attribute to input element */
|
|
54
|
+
this.required = false;
|
|
55
|
+
/** When true, adds disabled attribute to input and button element */
|
|
56
|
+
this.disabled = false;
|
|
57
|
+
/** The initial value of DatePicker on first load for single & range mode as array of string. eg.'["22/12/2023"]' for single & '["22/12/2023","25/12/2023"]' for range respectively */
|
|
58
|
+
this.initialValue = [];
|
|
59
|
+
/** Date format reflected on input */
|
|
60
|
+
this.dateFormat = "DD/MM/YYYY";
|
|
61
|
+
/** ISO date string to set the lowest allowable date value. e.g. "2016-05-19T12:00:00.000Z" */
|
|
62
|
+
this.minDate = "";
|
|
63
|
+
/** ISO date string to set the highest allowable date value. e.g. "2016-05-19T12:00:00.000Z" */
|
|
64
|
+
this.maxDate = "";
|
|
65
|
+
/** Changes DatePicker to single date selection or range date selection */
|
|
66
|
+
this.mode = "single";
|
|
67
|
+
/**Feedback text for error state when date input is invalid */
|
|
68
|
+
this.invalidFeedback = "Please enter a valid date";
|
|
69
|
+
/** The datepicker input's label */
|
|
70
|
+
this.label = "";
|
|
71
|
+
/** The datepicker input's hint text below the label */
|
|
72
|
+
this.hintText = "";
|
|
73
|
+
/** Controls auto-flipping of menu */
|
|
74
|
+
this.noFlip = false;
|
|
75
|
+
/** The drop position of menu relative to the toggle button */
|
|
76
|
+
this.drop = "down";
|
|
77
|
+
/**@internal */
|
|
78
|
+
this.value = "";
|
|
79
|
+
this.view = "days";
|
|
80
|
+
this.selectedDateRange = [];
|
|
81
|
+
this.focusedTabIndex = 3;
|
|
82
|
+
this._makeInputValueString = (startDate, endDate, dateFormat) => {
|
|
83
|
+
if (!startDate && !endDate)
|
|
84
|
+
return this.value;
|
|
85
|
+
const formatDate = (date) => format(date, DATE_PATTERNS[dateFormat].fnsPattern);
|
|
86
|
+
switch (this.mode) {
|
|
87
|
+
case "single": {
|
|
88
|
+
if (startDate) {
|
|
89
|
+
this.value = formatDate(startDate);
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
case "range": {
|
|
94
|
+
if (startDate && endDate) {
|
|
95
|
+
this.value = `${formatDate(startDate)} - ${formatDate(endDate)}`;
|
|
96
|
+
}
|
|
97
|
+
if (startDate && !endDate) {
|
|
98
|
+
this.value = `${formatDate(startDate)} - ${this.dateFormat.toLowerCase()}`;
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return this.value;
|
|
104
|
+
};
|
|
105
|
+
this._dialogAriaLabels = {
|
|
106
|
+
days: "Choose date",
|
|
107
|
+
months: "Choose month",
|
|
108
|
+
years: "Choose year"
|
|
109
|
+
};
|
|
110
|
+
this._internals = this.attachInternals();
|
|
111
|
+
/**@internal */
|
|
112
|
+
this.modifierOpt = [
|
|
113
|
+
{
|
|
114
|
+
name: "offset",
|
|
115
|
+
options: {
|
|
116
|
+
offset: [0, 10]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
async connectedCallback() {
|
|
122
|
+
super.connectedCallback();
|
|
123
|
+
this.addEventListener("sgds-view", this._handleViewChanged);
|
|
124
|
+
this.addEventListener("sgds-change-calendar", this._handleDateChanged);
|
|
125
|
+
this.addEventListener("sgds-update-focus", this._handleFocusDateChanged);
|
|
126
|
+
this.addEventListener("sgds-selectmonth", this._handleSelectMonth);
|
|
127
|
+
this.addEventListener("sgds-selectyear", this._handleSelectYear);
|
|
128
|
+
this.addEventListener("sgds-selectdates", this._handleSelectDatesAndClose);
|
|
129
|
+
this.addEventListener("sgds-selectdates-input", this._handleSelectDatesInput);
|
|
130
|
+
this.addEventListener("sgds-empty-input", this._handleEmptyInput);
|
|
131
|
+
this.addEventListener("keydown", this._handleTab);
|
|
132
|
+
this.addEventListener("sgds-hide", this._handleCloseMenu);
|
|
133
|
+
this.addEventListener("sgds-show", this._handleOpenMenu);
|
|
134
|
+
this.initialDisplayDate = this.displayDate || new Date();
|
|
135
|
+
if (this.initialValue && this.initialValue.length > 0) {
|
|
136
|
+
// Validate initialValue against the dateFormat regex
|
|
137
|
+
const dateFormatRegex = new RegExp(this._getDateFormatRegex());
|
|
138
|
+
// const startDateString = this.initialValue[0];
|
|
139
|
+
const invalidDates = this.initialValue.filter(v => !dateFormatRegex.test(v));
|
|
140
|
+
if (invalidDates.length > 0) {
|
|
141
|
+
return console.error("Invalid date format in initialValue:", invalidDates);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
const initialSelectedDates = this.initialValue.map(v => setTimeToNoon(parse(v, DATE_PATTERNS[this.dateFormat].fnsPattern, new Date())));
|
|
145
|
+
this._handleSelectDates(initialSelectedDates);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
this.displayDate = this.initialDisplayDate;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
async firstUpdated() {
|
|
153
|
+
super.firstUpdated();
|
|
154
|
+
if (this.menuIsOpen) {
|
|
155
|
+
const input = await this.datepickerInputAsync;
|
|
156
|
+
this.showMenu();
|
|
157
|
+
const cal = await this.calendar;
|
|
158
|
+
cal.focusOnCalendar(input);
|
|
159
|
+
}
|
|
160
|
+
const shadowInput = await this.datepickerInput.shadowInput;
|
|
161
|
+
this._manageInternalsDefault(shadowInput);
|
|
162
|
+
this._internals.setValidity(shadowInput.validity, shadowInput.validationMessage, shadowInput);
|
|
163
|
+
}
|
|
164
|
+
/** @internal */
|
|
165
|
+
_getDateFormatRegex() {
|
|
166
|
+
// validate date strings and adhere to the specified date format
|
|
167
|
+
return (this.dateFormat
|
|
168
|
+
// Replace any special characters with their escaped version using "\\$&"
|
|
169
|
+
.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
|
|
170
|
+
// Replace 'MM' with '\\d{2}', which matches two digits representing the month (e.g., 01, 12)
|
|
171
|
+
.replace("MM", "\\d{2}")
|
|
172
|
+
// Replace 'DD' with '\\d{2}', which matches two digits representing the day (e.g., 01, 31)
|
|
173
|
+
.replace("DD", "\\d{2}")
|
|
174
|
+
// Replace 'YYYY' with '\\d{4}', which matches four digits representing the year (e.g., 2021)
|
|
175
|
+
.replace("YYYY", "\\d{4}")
|
|
176
|
+
// Replace '/' with '\\/', which matches the forward slash character
|
|
177
|
+
.replace("/", "\\/"));
|
|
178
|
+
}
|
|
179
|
+
_handleTab(event) {
|
|
180
|
+
if (!this.menuIsOpen) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const tabIndexArray = Array(4);
|
|
184
|
+
if (event.shiftKey && event.key === "Tab") {
|
|
185
|
+
event.preventDefault();
|
|
186
|
+
this.focusedTabIndex = (this.focusedTabIndex - 1 + tabIndexArray.length) % tabIndexArray.length;
|
|
187
|
+
}
|
|
188
|
+
else if (event.key === "Tab") {
|
|
189
|
+
event.preventDefault();
|
|
190
|
+
this.focusedTabIndex = (this.focusedTabIndex + 1 + tabIndexArray.length) % tabIndexArray.length;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
_handleValueChange() {
|
|
194
|
+
this.emit("sgds-change-date");
|
|
195
|
+
this._setInternalFormValue(this.value);
|
|
196
|
+
}
|
|
197
|
+
async _handleCloseMenu() {
|
|
198
|
+
//return focus to input when menu closes
|
|
199
|
+
const input = await this.datepickerInputAsync;
|
|
200
|
+
input.focus();
|
|
201
|
+
if (this.selectedDateRange.length === 0) {
|
|
202
|
+
this.displayDate = this.initialDisplayDate;
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
const selectedDatesLength = this.selectedDateRange.length;
|
|
206
|
+
this.displayDate = this.selectedDateRange[selectedDatesLength - 1];
|
|
207
|
+
const calendar = await this.calendar;
|
|
208
|
+
calendar._updateFocusedDate();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
async _handleOpenMenu() {
|
|
212
|
+
const cal = await this.calendar;
|
|
213
|
+
const input = await this.datepickerInputAsync;
|
|
214
|
+
cal.focusOnCalendar(input);
|
|
215
|
+
}
|
|
216
|
+
_handleSelectDatesInput(event) {
|
|
217
|
+
this._handleSelectDates(event.detail);
|
|
218
|
+
this._manageInternalsDefault(this._shadowInput);
|
|
219
|
+
}
|
|
220
|
+
async _handleSelectDates(newSelectedDates) {
|
|
221
|
+
newSelectedDates.sort((a, b) => a.getTime() - b.getTime());
|
|
222
|
+
this.displayDate = newSelectedDates[0];
|
|
223
|
+
this.focusedDate = newSelectedDates[0];
|
|
224
|
+
this.selectedDateRange = newSelectedDates;
|
|
225
|
+
// Get the formattedDate value for the selected dates
|
|
226
|
+
const formattedDate = this._makeInputValueString(this.selectedDateRange[0], this.selectedDateRange[1], this.dateFormat);
|
|
227
|
+
// Set formattedDate value as the new value for sgds-input
|
|
228
|
+
this.value = formattedDate;
|
|
229
|
+
const input = await this.datepickerInputAsync;
|
|
230
|
+
input.updateMaskValue();
|
|
231
|
+
}
|
|
232
|
+
get _shadowInput() {
|
|
233
|
+
return this.datepickerInput.shadowRoot.querySelector("input");
|
|
234
|
+
}
|
|
235
|
+
_handleSelectDatesAndClose(event) {
|
|
236
|
+
this._handleSelectDates(event.detail);
|
|
237
|
+
if (this.mode === "range" && this.selectedDateRange.length === 2) {
|
|
238
|
+
this.hideMenu();
|
|
239
|
+
}
|
|
240
|
+
else if (this.mode === "single" && this.selectedDateRange.length === 1) {
|
|
241
|
+
this.hideMenu();
|
|
242
|
+
}
|
|
243
|
+
this._manageInternalsValid();
|
|
244
|
+
}
|
|
245
|
+
/** update latest view state from datepicker-header */
|
|
246
|
+
_handleViewChanged(event) {
|
|
247
|
+
this.view = event.detail;
|
|
248
|
+
}
|
|
249
|
+
_handleDateChanged(event) {
|
|
250
|
+
this.displayDate = event.detail;
|
|
251
|
+
}
|
|
252
|
+
_handleFocusDateChanged(event) {
|
|
253
|
+
this.focusedDate = event.detail;
|
|
254
|
+
}
|
|
255
|
+
_handleSelectMonth(event) {
|
|
256
|
+
this.displayDate = event.detail;
|
|
257
|
+
}
|
|
258
|
+
_handleSelectYear(event) {
|
|
259
|
+
this.displayDate = event.detail;
|
|
260
|
+
}
|
|
261
|
+
async _handleInvalidInput() {
|
|
262
|
+
this.selectedDateRange = [];
|
|
263
|
+
this.displayDate = this.initialDisplayDate;
|
|
264
|
+
this._manageInternalsBadInput();
|
|
265
|
+
}
|
|
266
|
+
async _handleButtonResetClick() {
|
|
267
|
+
this.displayDate = this.initialDisplayDate;
|
|
268
|
+
this.selectedDateRange = [];
|
|
269
|
+
this.value = "";
|
|
270
|
+
this.view = "days";
|
|
271
|
+
this.hideMenu();
|
|
272
|
+
const input = await this.datepickerInputAsync;
|
|
273
|
+
input.setInvalid(false);
|
|
274
|
+
input.destroyInputMask();
|
|
275
|
+
await input.applyInputMask();
|
|
276
|
+
this._manageInternalsRequired();
|
|
277
|
+
}
|
|
278
|
+
async _handleEmptyInput() {
|
|
279
|
+
this._manageInternalsRequired();
|
|
280
|
+
}
|
|
281
|
+
_manageInternalsRequired() {
|
|
282
|
+
this.required
|
|
283
|
+
? this._internals.setValidity({
|
|
284
|
+
valueMissing: true
|
|
285
|
+
}, "Please fill in this field", this._shadowInput)
|
|
286
|
+
: this._internals.setValidity({});
|
|
287
|
+
}
|
|
288
|
+
_manageInternalsBadInput() {
|
|
289
|
+
this._internals.setValidity({
|
|
290
|
+
badInput: true
|
|
291
|
+
}, "The chosen date(s) are invalid", this._shadowInput);
|
|
292
|
+
}
|
|
293
|
+
_manageInternalsValid() {
|
|
294
|
+
this._internals.setValidity({});
|
|
295
|
+
}
|
|
296
|
+
_manageInternalsDefault(inputEl) {
|
|
297
|
+
this._internals.setValidity(inputEl.validity, inputEl.validationMessage, inputEl);
|
|
298
|
+
}
|
|
299
|
+
_setInternalFormValue(value) {
|
|
300
|
+
this._internals.setFormValue(value);
|
|
301
|
+
}
|
|
302
|
+
async _handleInputMaskChange(e) {
|
|
303
|
+
this.value = e.detail;
|
|
304
|
+
}
|
|
305
|
+
render() {
|
|
306
|
+
const svgEl = html `
|
|
307
|
+
<svg
|
|
308
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
309
|
+
width="16"
|
|
310
|
+
height="16"
|
|
311
|
+
fill="currentColor"
|
|
312
|
+
class="bi bi-x"
|
|
313
|
+
viewBox="0 0 16 16"
|
|
314
|
+
>
|
|
315
|
+
<path
|
|
316
|
+
d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"
|
|
317
|
+
/>
|
|
318
|
+
</svg>
|
|
319
|
+
`;
|
|
320
|
+
return html `
|
|
321
|
+
<div>
|
|
322
|
+
<sgds-datepicker-input
|
|
323
|
+
.value=${live(this.value)}
|
|
324
|
+
?required=${this.required}
|
|
325
|
+
?disabled=${this.disabled}
|
|
326
|
+
placeholder=""
|
|
327
|
+
${ref(this.myDropdown)}
|
|
328
|
+
mode=${this.mode}
|
|
329
|
+
dateFormat=${this.dateFormat}
|
|
330
|
+
invalidFeedback=${this.invalidFeedback}
|
|
331
|
+
@sgds-mask-input-change=${this._handleInputMaskChange}
|
|
332
|
+
@sgds-invalid-input=${this._handleInvalidInput}
|
|
333
|
+
minDate=${this.minDate}
|
|
334
|
+
maxDate=${this.maxDate}
|
|
335
|
+
label=${this.label}
|
|
336
|
+
hintText=${this.hintText}
|
|
337
|
+
name=${this.name}
|
|
338
|
+
>
|
|
339
|
+
<sgds-button
|
|
340
|
+
role="button"
|
|
341
|
+
slot="calendar-btn"
|
|
342
|
+
class="calendar-btn"
|
|
343
|
+
aria-expanded="${this.menuIsOpen}"
|
|
344
|
+
aria-haspopup="dialog"
|
|
345
|
+
aria-controls=${this.dropdownMenuId}
|
|
346
|
+
@click=${() => this.toggleMenu()}
|
|
347
|
+
ariaLabel=${this.menuIsOpen ? "Close Calendar" : "Open Calendar"}
|
|
348
|
+
?disabled=${this.disabled}
|
|
349
|
+
variant="outlined"
|
|
350
|
+
>
|
|
351
|
+
<svg
|
|
352
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
353
|
+
width="16"
|
|
354
|
+
height="16"
|
|
355
|
+
fill="currentColor"
|
|
356
|
+
class="bi bi-calendar"
|
|
357
|
+
viewBox="0 0 16 16"
|
|
358
|
+
>
|
|
359
|
+
<path
|
|
360
|
+
d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z"
|
|
361
|
+
/>
|
|
362
|
+
</svg>
|
|
363
|
+
</sgds-button>
|
|
364
|
+
<sgds-button
|
|
365
|
+
role="button"
|
|
366
|
+
slot="reset-btn"
|
|
367
|
+
variant="primary"
|
|
368
|
+
?disabled=${this.disabled}
|
|
369
|
+
class="reset-btn"
|
|
370
|
+
@click=${() => this._handleButtonResetClick()}
|
|
371
|
+
ariaLabel="Reset Datepicker"
|
|
372
|
+
>
|
|
373
|
+
${svgEl}
|
|
374
|
+
</sgds-button>
|
|
375
|
+
</sgds-datepicker-input>
|
|
376
|
+
|
|
377
|
+
<ul
|
|
378
|
+
id=${this.dropdownMenuId}
|
|
379
|
+
class="sgds datepicker dropdown-menu"
|
|
380
|
+
role="dialog"
|
|
381
|
+
part="menu"
|
|
382
|
+
aria-label=${this._dialogAriaLabels[this.view]}
|
|
383
|
+
@click=${(event) => event.stopPropagation()}
|
|
384
|
+
>
|
|
385
|
+
<sgds-datepicker-header
|
|
386
|
+
.view=${this.view}
|
|
387
|
+
.displayDate=${this.displayDate}
|
|
388
|
+
.focusedDate=${this.focusedDate}
|
|
389
|
+
.selectedDate=${this.selectedDateRange}
|
|
390
|
+
.focusedTabIndex=${this.focusedTabIndex}
|
|
391
|
+
></sgds-datepicker-header>
|
|
392
|
+
<sgds-datepicker-calendar
|
|
393
|
+
.show=${this.menuIsOpen}
|
|
394
|
+
.view=${this.view}
|
|
395
|
+
.displayDate=${this.displayDate}
|
|
396
|
+
.mode=${this.mode}
|
|
397
|
+
minDate=${this.minDate}
|
|
398
|
+
maxDate=${this.maxDate}
|
|
399
|
+
.selectedDate=${this.selectedDateRange}
|
|
400
|
+
.focusedTabIndex=${this.focusedTabIndex}
|
|
401
|
+
></sgds-datepicker-calendar>
|
|
402
|
+
</ul>
|
|
403
|
+
</div>
|
|
404
|
+
`;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
SgdsDatepicker.styles = [...DropdownElement.styles, css_248z, css_248z$1];
|
|
408
|
+
/**@internal */
|
|
409
|
+
SgdsDatepicker.formAssociated = true;
|
|
410
|
+
__decorate([
|
|
411
|
+
property({ type: Boolean, reflect: true })
|
|
412
|
+
], SgdsDatepicker.prototype, "required", void 0);
|
|
413
|
+
__decorate([
|
|
414
|
+
property({ reflect: true })
|
|
415
|
+
], SgdsDatepicker.prototype, "name", void 0);
|
|
416
|
+
__decorate([
|
|
417
|
+
property({ type: Boolean, reflect: true })
|
|
418
|
+
], SgdsDatepicker.prototype, "disabled", void 0);
|
|
419
|
+
__decorate([
|
|
420
|
+
property({ type: Array, reflect: true })
|
|
421
|
+
], SgdsDatepicker.prototype, "initialValue", void 0);
|
|
422
|
+
__decorate([
|
|
423
|
+
property({ type: String })
|
|
424
|
+
], SgdsDatepicker.prototype, "dateFormat", void 0);
|
|
425
|
+
__decorate([
|
|
426
|
+
property({ type: String })
|
|
427
|
+
], SgdsDatepicker.prototype, "minDate", void 0);
|
|
428
|
+
__decorate([
|
|
429
|
+
property({ type: String })
|
|
430
|
+
], SgdsDatepicker.prototype, "maxDate", void 0);
|
|
431
|
+
__decorate([
|
|
432
|
+
property({ type: String, reflect: true })
|
|
433
|
+
], SgdsDatepicker.prototype, "mode", void 0);
|
|
434
|
+
__decorate([
|
|
435
|
+
property({ type: String, reflect: true })
|
|
436
|
+
], SgdsDatepicker.prototype, "invalidFeedback", void 0);
|
|
437
|
+
__decorate([
|
|
438
|
+
property({ reflect: true })
|
|
439
|
+
], SgdsDatepicker.prototype, "label", void 0);
|
|
440
|
+
__decorate([
|
|
441
|
+
property({ reflect: true })
|
|
442
|
+
], SgdsDatepicker.prototype, "hintText", void 0);
|
|
443
|
+
__decorate([
|
|
444
|
+
property({ type: Boolean, reflect: true, state: false })
|
|
445
|
+
], SgdsDatepicker.prototype, "noFlip", void 0);
|
|
446
|
+
__decorate([
|
|
447
|
+
property({ type: String, reflect: true, state: false })
|
|
448
|
+
], SgdsDatepicker.prototype, "drop", void 0);
|
|
449
|
+
__decorate([
|
|
450
|
+
property({ attribute: false })
|
|
451
|
+
], SgdsDatepicker.prototype, "displayDate", void 0);
|
|
452
|
+
__decorate([
|
|
453
|
+
state()
|
|
454
|
+
], SgdsDatepicker.prototype, "value", void 0);
|
|
455
|
+
__decorate([
|
|
456
|
+
state()
|
|
457
|
+
], SgdsDatepicker.prototype, "view", void 0);
|
|
458
|
+
__decorate([
|
|
459
|
+
state()
|
|
460
|
+
], SgdsDatepicker.prototype, "selectedDateRange", void 0);
|
|
461
|
+
__decorate([
|
|
462
|
+
state()
|
|
463
|
+
], SgdsDatepicker.prototype, "focusedDate", void 0);
|
|
464
|
+
__decorate([
|
|
465
|
+
state()
|
|
466
|
+
], SgdsDatepicker.prototype, "focusedTabIndex", void 0);
|
|
467
|
+
__decorate([
|
|
468
|
+
queryAsync("sgds-datepicker-calendar")
|
|
469
|
+
], SgdsDatepicker.prototype, "calendar", void 0);
|
|
470
|
+
__decorate([
|
|
471
|
+
queryAsync("sgds-datepicker-input")
|
|
472
|
+
], SgdsDatepicker.prototype, "datepickerInputAsync", void 0);
|
|
473
|
+
__decorate([
|
|
474
|
+
queryAsync("sgds-datepicker-header")
|
|
475
|
+
], SgdsDatepicker.prototype, "datepickerHeaderAsync", void 0);
|
|
476
|
+
__decorate([
|
|
477
|
+
query("sgds-datepicker-input")
|
|
478
|
+
], SgdsDatepicker.prototype, "datepickerInput", void 0);
|
|
479
|
+
__decorate([
|
|
480
|
+
watch("value")
|
|
481
|
+
], SgdsDatepicker.prototype, "_handleValueChange", null);
|
|
482
|
+
|
|
483
|
+
export { SgdsDatepicker, SgdsDatepicker as default };
|
|
484
|
+
//# sourceMappingURL=sgds-datepicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sgds-datepicker.js","sources":["../../../../src/components/Datepicker/sgds-datepicker.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { format, parse } from \"date-fns\";\nimport { html } from \"lit\";\nimport { property, query, queryAsync, state } from \"lit/decorators.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { DropdownElement } from \"../../base/dropdown-element\";\nimport { type SgdsFormControl } from \"../../utils/form\";\nimport { DATE_PATTERNS, setTimeToNoon } from \"../../utils/time\";\nimport { watch } from \"../../utils/watch\";\nimport { DatepickerCalendar } from \"./datepicker-calendar\";\nimport { DatepickerHeader } from \"./datepicker-header\";\nimport DatepickerInput from \"./datepicker-input\";\nimport { SgdsButton } from \"../Button/sgds-button\";\nimport { ViewEnum } from \"./types\";\nimport dropdownStyle from \"../Dropdown/dropdown.css\";\nimport datepickerStyle from \"./datepicker.css\";\n\nexport type DateFormat = \"MM/DD/YYYY\" | \"DD/MM/YYYY\" | \"YYYY/MM/DD\";\n\n/**\n * @summary The `DatePicker` Component is built using `Dropdown`, `Input` and `Button` components. By default, the Calendar points to today's date and input has no value. Users can either pick dates from the calendar or type dates through the input\n *\n * @event sgds-change-date - Emitted when the state of datepicker's input changes during first load, close button reset click & date click. Date values can be accessed via event.target.value\n *\n * @cssproperty --datepicker-theme-color - Datepicker's overall theme color\n * @cssproperty --datepicker-hover-bg - Datepicker's calendar menu hover color\n * @cssproperty --datepicker-bg - Datepicker's menu background color\n * @cssproperty --datepicker-close-button-bg - Datepicker's close button background color\n * @cssproperty --datepicker-close-button-hover-bg - Datepicker's close button hover background color\n * @cssproperty --datepicker-close-button-color - Datepicker's close button color\n * @cssproperty --datepicker-selected-date-bg - Selected date's background color\n * @cssproperty --datepicker-selected-date-color - Selected date's text color\n *\n * @description displayDate sets the month, year views of the calendar while focusedDate follows the focus which also directly changes\n * displayDate on certain occasions. Example, when keyboard moves up to the next month, it updates displayDate which then affect the current\n * date view of the calendar\n */\nexport class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) implements SgdsFormControl {\n static styles = [...DropdownElement.styles, dropdownStyle, datepickerStyle];\n /**@internal */\n static formAssociated = true;\n private _internals: ElementInternals;\n\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-datepicker-input\": DatepickerInput,\n \"sgds-datepicker-calendar\": DatepickerCalendar,\n \"sgds-datepicker-header\": DatepickerHeader,\n \"sgds-button\": SgdsButton\n };\n }\n\n /** When true, adds required attribute to input element */\n @property({ type: Boolean, reflect: true }) required = false;\n /**The datepicker input's name attribute */\n @property({ reflect: true }) name: string;\n /** When true, adds disabled attribute to input and button element */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The initial value of DatePicker on first load for single & range mode as array of string. eg.'[\"22/12/2023\"]' for single & '[\"22/12/2023\",\"25/12/2023\"]' for range respectively */\n @property({ type: Array, reflect: true }) initialValue: string[] = [];\n\n /** Date format reflected on input */\n @property({ type: String }) dateFormat: DateFormat = \"DD/MM/YYYY\";\n\n /** ISO date string to set the lowest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) minDate = \"\";\n\n /** ISO date string to set the highest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) maxDate = \"\";\n\n /** Changes DatePicker to single date selection or range date selection */\n @property({ type: String, reflect: true }) mode: \"single\" | \"range\" = \"single\";\n\n /**Feedback text for error state when date input is invalid */\n @property({ type: String, reflect: true }) invalidFeedback = \"Please enter a valid date\";\n\n /** The datepicker input's label */\n @property({ reflect: true }) label = \"\";\n\n /** The datepicker input's hint text below the label */\n @property({ reflect: true }) hintText = \"\";\n\n /** Controls auto-flipping of menu */\n @property({ type: Boolean, reflect: true, state: false })\n noFlip = false;\n\n /** The drop position of menu relative to the toggle button */\n @property({ type: String, reflect: true, state: false })\n drop: \"up\" | \"down\" = \"down\";\n\n /** Provides the date context for Calendar to present the appropriate view. Defaults to today's date */\n @property({ attribute: false }) displayDate: Date;\n /**@internal */\n @state() value = \"\";\n\n @state()\n private view: ViewEnum = \"days\";\n\n @state() private selectedDateRange: Date[] = [];\n\n @state() private focusedDate: Date;\n\n @state() private focusedTabIndex = 3;\n\n private initialDisplayDate: Date;\n\n @queryAsync(\"sgds-datepicker-calendar\")\n private calendar: Promise<DatepickerCalendar>;\n\n @queryAsync(\"sgds-datepicker-input\")\n private datepickerInputAsync: Promise<DatepickerInput>;\n\n @queryAsync(\"sgds-datepicker-header\")\n private datepickerHeaderAsync: Promise<DatepickerHeader>;\n\n @query(\"sgds-datepicker-input\")\n private datepickerInput: DatepickerInput;\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n public reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n constructor() {\n super();\n this._internals = this.attachInternals();\n /**@internal */\n this.modifierOpt = [\n {\n name: \"offset\",\n options: {\n offset: [0, 10]\n }\n }\n ];\n }\n\n async connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"sgds-view\", this._handleViewChanged);\n this.addEventListener(\"sgds-change-calendar\", this._handleDateChanged);\n this.addEventListener(\"sgds-update-focus\", this._handleFocusDateChanged);\n this.addEventListener(\"sgds-selectmonth\", this._handleSelectMonth);\n this.addEventListener(\"sgds-selectyear\", this._handleSelectYear);\n this.addEventListener(\"sgds-selectdates\", this._handleSelectDatesAndClose);\n this.addEventListener(\"sgds-selectdates-input\", this._handleSelectDatesInput);\n this.addEventListener(\"sgds-empty-input\", this._handleEmptyInput);\n this.addEventListener(\"keydown\", this._handleTab);\n this.addEventListener(\"sgds-hide\", this._handleCloseMenu);\n this.addEventListener(\"sgds-show\", this._handleOpenMenu);\n this.initialDisplayDate = this.displayDate || new Date();\n if (this.initialValue && this.initialValue.length > 0) {\n // Validate initialValue against the dateFormat regex\n const dateFormatRegex = new RegExp(this._getDateFormatRegex());\n // const startDateString = this.initialValue[0];\n const invalidDates = this.initialValue.filter(v => !dateFormatRegex.test(v));\n if (invalidDates.length > 0) {\n return console.error(\"Invalid date format in initialValue:\", invalidDates);\n } else {\n const initialSelectedDates = this.initialValue.map(v =>\n setTimeToNoon(parse(v, DATE_PATTERNS[this.dateFormat].fnsPattern, new Date()))\n );\n this._handleSelectDates(initialSelectedDates);\n }\n } else {\n this.displayDate = this.initialDisplayDate;\n }\n }\n\n async firstUpdated() {\n super.firstUpdated();\n if (this.menuIsOpen) {\n const input = await this.datepickerInputAsync;\n this.showMenu();\n const cal = await this.calendar;\n cal.focusOnCalendar(input);\n }\n\n const shadowInput = await this.datepickerInput.shadowInput;\n this._manageInternalsDefault(shadowInput);\n this._internals.setValidity(shadowInput.validity, shadowInput.validationMessage, shadowInput);\n }\n\n /** @internal */\n private _getDateFormatRegex(): string {\n // validate date strings and adhere to the specified date format\n return (\n this.dateFormat\n // Replace any special characters with their escaped version using \"\\\\$&\"\n .replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n // Replace 'MM' with '\\\\d{2}', which matches two digits representing the month (e.g., 01, 12)\n .replace(\"MM\", \"\\\\d{2}\")\n // Replace 'DD' with '\\\\d{2}', which matches two digits representing the day (e.g., 01, 31)\n .replace(\"DD\", \"\\\\d{2}\")\n // Replace 'YYYY' with '\\\\d{4}', which matches four digits representing the year (e.g., 2021)\n .replace(\"YYYY\", \"\\\\d{4}\")\n // Replace '/' with '\\\\/', which matches the forward slash character\n .replace(\"/\", \"\\\\/\")\n );\n }\n private _handleTab(event: KeyboardEvent) {\n if (!this.menuIsOpen) {\n return;\n }\n const tabIndexArray = Array(4);\n if (event.shiftKey && event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex - 1 + tabIndexArray.length) % tabIndexArray.length;\n } else if (event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex + 1 + tabIndexArray.length) % tabIndexArray.length;\n }\n }\n\n @watch(\"value\")\n _handleValueChange() {\n this.emit(\"sgds-change-date\");\n this._setInternalFormValue(this.value);\n }\n\n private async _handleCloseMenu() {\n //return focus to input when menu closes\n const input = await this.datepickerInputAsync;\n input.focus();\n\n if (this.selectedDateRange.length === 0) {\n this.displayDate = this.initialDisplayDate;\n } else {\n const selectedDatesLength = this.selectedDateRange.length;\n this.displayDate = this.selectedDateRange[selectedDatesLength - 1];\n const calendar = await this.calendar;\n calendar._updateFocusedDate();\n }\n }\n private async _handleOpenMenu() {\n const cal = await this.calendar;\n const input = await this.datepickerInputAsync;\n cal.focusOnCalendar(input);\n }\n\n private _makeInputValueString = (startDate: Date, endDate: Date, dateFormat: string) => {\n if (!startDate && !endDate) return this.value;\n const formatDate = (date: Date) => format(date, DATE_PATTERNS[dateFormat].fnsPattern);\n switch (this.mode) {\n case \"single\": {\n if (startDate) {\n this.value = formatDate(startDate);\n }\n break;\n }\n case \"range\": {\n if (startDate && endDate) {\n this.value = `${formatDate(startDate)} - ${formatDate(endDate)}`;\n }\n if (startDate && !endDate) {\n this.value = `${formatDate(startDate)} - ${this.dateFormat.toLowerCase()}`;\n }\n break;\n }\n }\n return this.value;\n };\n private _handleSelectDatesInput(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n this._manageInternalsDefault(this._shadowInput);\n }\n private async _handleSelectDates(newSelectedDates: Date[]) {\n newSelectedDates.sort((a: Date, b: Date) => a.getTime() - b.getTime());\n this.displayDate = newSelectedDates[0];\n this.focusedDate = newSelectedDates[0];\n this.selectedDateRange = newSelectedDates;\n\n // Get the formattedDate value for the selected dates\n const formattedDate = this._makeInputValueString(\n this.selectedDateRange[0],\n this.selectedDateRange[1],\n this.dateFormat\n );\n\n // Set formattedDate value as the new value for sgds-input\n this.value = formattedDate;\n const input = await this.datepickerInputAsync;\n input.updateMaskValue();\n }\n\n private get _shadowInput() {\n return this.datepickerInput.shadowRoot.querySelector(\"input\");\n }\n private _handleSelectDatesAndClose(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n\n if (this.mode === \"range\" && this.selectedDateRange.length === 2) {\n this.hideMenu();\n } else if (this.mode === \"single\" && this.selectedDateRange.length === 1) {\n this.hideMenu();\n }\n this._manageInternalsValid();\n }\n\n /** update latest view state from datepicker-header */\n private _handleViewChanged(event: CustomEvent<string>) {\n this.view = event.detail as ViewEnum;\n }\n\n private _handleDateChanged(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private _handleFocusDateChanged(event: CustomEvent<Date>) {\n this.focusedDate = event.detail;\n }\n\n private _handleSelectMonth(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n\n private _handleSelectYear(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private async _handleInvalidInput() {\n this.selectedDateRange = [];\n this.displayDate = this.initialDisplayDate;\n this._manageInternalsBadInput();\n }\n private async _handleButtonResetClick() {\n this.displayDate = this.initialDisplayDate;\n this.selectedDateRange = [];\n this.value = \"\";\n this.view = \"days\";\n this.hideMenu();\n const input = await this.datepickerInputAsync;\n input.setInvalid(false);\n input.destroyInputMask();\n await input.applyInputMask();\n\n this._manageInternalsRequired();\n }\n\n private async _handleEmptyInput() {\n this._manageInternalsRequired();\n }\n\n private _manageInternalsRequired() {\n this.required\n ? this._internals.setValidity(\n {\n valueMissing: true\n },\n \"Please fill in this field\",\n this._shadowInput\n )\n : this._internals.setValidity({});\n }\n private _manageInternalsBadInput() {\n this._internals.setValidity(\n {\n badInput: true\n },\n \"The chosen date(s) are invalid\",\n this._shadowInput\n );\n }\n\n private _manageInternalsValid() {\n this._internals.setValidity({});\n }\n\n private _manageInternalsDefault(inputEl: HTMLInputElement) {\n this._internals.setValidity(inputEl.validity, inputEl.validationMessage, inputEl);\n }\n\n private _setInternalFormValue(value: string) {\n this._internals.setFormValue(value);\n }\n\n private async _handleInputMaskChange(e: CustomEvent) {\n this.value = e.detail;\n }\n\n private _dialogAriaLabels = {\n days: \"Choose date\",\n months: \"Choose month\",\n years: \"Choose year\"\n };\n\n render() {\n const svgEl = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-x\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z\"\n />\n </svg>\n `;\n\n return html`\n <div>\n <sgds-datepicker-input\n .value=${live(this.value)}\n ?required=${this.required}\n ?disabled=${this.disabled}\n placeholder=\"\"\n ${ref(this.myDropdown)}\n mode=${this.mode}\n dateFormat=${this.dateFormat}\n invalidFeedback=${this.invalidFeedback}\n @sgds-mask-input-change=${this._handleInputMaskChange}\n @sgds-invalid-input=${this._handleInvalidInput}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n label=${this.label}\n hintText=${this.hintText}\n name=${this.name}\n >\n <sgds-button\n role=\"button\"\n slot=\"calendar-btn\"\n class=\"calendar-btn\"\n aria-expanded=\"${this.menuIsOpen}\"\n aria-haspopup=\"dialog\"\n aria-controls=${this.dropdownMenuId}\n @click=${() => this.toggleMenu()}\n ariaLabel=${this.menuIsOpen ? \"Close Calendar\" : \"Open Calendar\"}\n ?disabled=${this.disabled}\n variant=\"outlined\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-calendar\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z\"\n />\n </svg>\n </sgds-button>\n <sgds-button\n role=\"button\"\n slot=\"reset-btn\"\n variant=\"primary\"\n ?disabled=${this.disabled}\n class=\"reset-btn\"\n @click=${() => this._handleButtonResetClick()}\n ariaLabel=\"Reset Datepicker\"\n >\n ${svgEl}\n </sgds-button>\n </sgds-datepicker-input>\n\n <ul\n id=${this.dropdownMenuId}\n class=\"sgds datepicker dropdown-menu\"\n role=\"dialog\"\n part=\"menu\"\n aria-label=${this._dialogAriaLabels[this.view]}\n @click=${(event: MouseEvent) => event.stopPropagation()}\n >\n <sgds-datepicker-header\n .view=${this.view}\n .displayDate=${this.displayDate}\n .focusedDate=${this.focusedDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-header>\n <sgds-datepicker-calendar\n .show=${this.menuIsOpen}\n .view=${this.view}\n .displayDate=${this.displayDate}\n .mode=${this.mode}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-calendar>\n </ul>\n </div>\n `;\n }\n}\n\nexport default SgdsDatepicker;\n"],"names":["dropdownStyle","datepickerStyle"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;;;AAiBG;MACU,cAAe,SAAQ,mBAAmB,CAAC,eAAe,CAAC,CAAA;;AAOtE,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,uBAAuB,EAAE,eAAe;AACxC,YAAA,0BAA0B,EAAE,kBAAkB;AAC9C,YAAA,wBAAwB,EAAE,gBAAgB;AAC1C,YAAA,aAAa,EAAE,UAAU;SAC1B,CAAC;KACH;;I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{--drawer-padding:var(--sgds-spacer-4);--drawer-size:35rem;--drawer-bg:var(--sgds-body-bg);--drawer-button-gap:var(--sgds-spacer-2);display:contents}.drawer{height:100%;inset-inline-start:0;overflow:hidden;pointer-events:none;top:0;width:100%}.drawer-fixed{position:fixed;z-index:1055}.drawer-panel{background-color:var(--drawer-bg);box-shadow:0 2px 8px hsla(240,4%,46%,.12);display:flex;flex-direction:column;max-height:100%;max-width:100%;overflow:auto;pointer-events:all;position:absolute;z-index:2}.drawer-panel:focus{outline:none}.drawer-top .drawer-panel{bottom:auto;height:var(--drawer-size);inset-inline-end:auto;inset-inline-start:0;top:0;width:100%}.drawer-end .drawer-panel{bottom:auto;height:100%;inset-inline-end:0;inset-inline-start:auto;top:0;width:var(--drawer-size)}.drawer-bottom .drawer-panel{bottom:0;height:var(--drawer-size);inset-inline-end:auto;inset-inline-start:0;top:auto;width:100%}.drawer-start .drawer-panel{bottom:auto;height:100%;inset-inline-end:auto;inset-inline-start:0;top:0;width:var(--drawer-size)}.drawer-header{display:flex;padding:var(--drawer-padding)}.drawer-title{flex:1 1 auto;font:inherit;font-size:calc(1.275rem + .3vw);line-height:1.33;margin:0}.drawer-header-actions{cursor:pointer;display:flex;flex-shrink:0;flex-wrap:wrap;gap:var(--drawer-button-gap);justify-content:end;padding:0 var(--drawer-padding)}.drawer-header-actions .drawer-close{align-self:center;display:flex;flex:0 0 auto}.drawer-body{-webkit-overflow-scrolling:touch;display:block;flex:1 1 auto;overflow:auto}.drawer-body,.drawer-footer{padding:var(--drawer-padding)}.drawer-footer{text-align:right}.drawer-footer ::slotted(sgds-button:not(:last-of-type)){margin-inline-end:var(--drawer-button-gap)}.drawer:not(.drawer-has-footer) .drawer-footer{display:none}.drawer-overlay{background-color:rgba(0,0,0,.5);bottom:0;display:block;left:0;pointer-events:all;position:fixed;right:0;top:0}.drawer-contained .drawer-overlay{display:none}`;
|
|
5
|
+
|
|
6
|
+
export { css_248z as default };
|
|
7
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|