@govtechsg/sgds-web-component 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Masthead/index.js +21 -23
- package/README.md +1 -1
- package/base/card-element.cjs.js +1 -0
- package/base/card-element.cjs.js.map +1 -1
- package/base/card-element.js +1 -0
- package/base/card-element.js.map +1 -1
- package/base/card.cjs.js +1 -0
- package/base/card.cjs.js.map +1 -1
- package/base/card.js +1 -0
- package/base/card.js.map +1 -1
- package/base/dropdown-element.cjs.js +1 -0
- package/base/dropdown-element.cjs.js.map +1 -1
- package/base/dropdown-element.js +1 -0
- package/base/dropdown-element.js.map +1 -1
- package/base/dropdown-list-element.cjs.js +1 -0
- package/base/dropdown-list-element.cjs.js.map +1 -1
- package/base/dropdown-list-element.js +1 -0
- package/base/dropdown-list-element.js.map +1 -1
- package/base/form-check-element.cjs.js +1 -0
- package/base/form-check-element.cjs.js.map +1 -1
- package/base/form-check-element.js +1 -0
- package/base/form-check-element.js.map +1 -1
- package/base/link-element.cjs.js +1 -0
- package/base/link-element.cjs.js.map +1 -1
- package/base/link-element.js +1 -0
- package/base/link-element.js.map +1 -1
- package/base/sgds-element.cjs.js +1 -0
- package/base/sgds-element.cjs.js.map +1 -1
- package/base/sgds-element.cjs2.js +2 -1
- package/base/sgds-element.cjs2.js.map +1 -1
- package/base/sgds-element.js +1 -0
- package/base/sgds-element.js.map +1 -1
- package/base/sgds-element2.js +2 -1
- package/base/sgds-element2.js.map +1 -1
- package/components/Accordion/accordion-item.cjs.js +1 -0
- package/components/Accordion/accordion-item.cjs.js.map +1 -1
- package/components/Accordion/accordion-item.js +1 -0
- package/components/Accordion/accordion-item.js.map +1 -1
- package/components/Accordion/accordion.cjs.js +1 -0
- package/components/Accordion/accordion.cjs.js.map +1 -1
- package/components/Accordion/accordion.js +1 -0
- package/components/Accordion/accordion.js.map +1 -1
- package/components/Accordion/index.umd.js +1 -1
- package/components/Accordion/sgds-accordion-item.cjs.js +1 -0
- package/components/Accordion/sgds-accordion-item.cjs.js.map +1 -1
- package/components/Accordion/sgds-accordion-item.js +1 -0
- package/components/Accordion/sgds-accordion-item.js.map +1 -1
- package/components/Accordion/sgds-accordion.cjs.js +1 -0
- package/components/Accordion/sgds-accordion.cjs.js.map +1 -1
- package/components/Accordion/sgds-accordion.js +1 -0
- package/components/Accordion/sgds-accordion.js.map +1 -1
- package/components/ActionCard/action-card.cjs.js +1 -0
- package/components/ActionCard/action-card.cjs.js.map +1 -1
- package/components/ActionCard/action-card.js +1 -0
- package/components/ActionCard/action-card.js.map +1 -1
- package/components/ActionCard/index.umd.js +1 -1
- package/components/ActionCard/sgds-action-card.cjs.js +1 -0
- package/components/ActionCard/sgds-action-card.cjs.js.map +1 -1
- package/components/ActionCard/sgds-action-card.js +1 -0
- package/components/ActionCard/sgds-action-card.js.map +1 -1
- package/components/Alert/alert-link.cjs.js +1 -0
- package/components/Alert/alert-link.cjs.js.map +1 -1
- package/components/Alert/alert-link.js +1 -0
- package/components/Alert/alert-link.js.map +1 -1
- package/components/Alert/alert.cjs.js +1 -0
- package/components/Alert/alert.cjs.js.map +1 -1
- package/components/Alert/alert.js +1 -0
- package/components/Alert/alert.js.map +1 -1
- package/components/Alert/index.umd.js +1 -1
- package/components/Alert/sgds-alert-heading.cjs.js +1 -0
- package/components/Alert/sgds-alert-heading.cjs.js.map +1 -1
- package/components/Alert/sgds-alert-heading.js +1 -0
- package/components/Alert/sgds-alert-heading.js.map +1 -1
- package/components/Alert/sgds-alert-link.cjs.js +1 -0
- package/components/Alert/sgds-alert-link.cjs.js.map +1 -1
- package/components/Alert/sgds-alert-link.js +1 -0
- package/components/Alert/sgds-alert-link.js.map +1 -1
- package/components/Alert/sgds-alert.cjs.js +1 -0
- package/components/Alert/sgds-alert.cjs.js.map +1 -1
- package/components/Alert/sgds-alert.js +1 -0
- package/components/Alert/sgds-alert.js.map +1 -1
- package/components/Badge/badge.cjs.js +1 -0
- package/components/Badge/badge.cjs.js.map +1 -1
- package/components/Badge/badge.js +1 -0
- package/components/Badge/badge.js.map +1 -1
- package/components/Badge/index.umd.js +1 -1
- package/components/Badge/sgds-badge.cjs.js +1 -0
- package/components/Badge/sgds-badge.cjs.js.map +1 -1
- package/components/Badge/sgds-badge.js +1 -0
- package/components/Badge/sgds-badge.js.map +1 -1
- package/components/Breadcrumb/breadcrumb-item.cjs.js +1 -0
- package/components/Breadcrumb/breadcrumb-item.cjs.js.map +1 -1
- package/components/Breadcrumb/breadcrumb-item.js +1 -0
- package/components/Breadcrumb/breadcrumb-item.js.map +1 -1
- package/components/Breadcrumb/breadcrumb.cjs.js +1 -0
- package/components/Breadcrumb/breadcrumb.cjs.js.map +1 -1
- package/components/Breadcrumb/breadcrumb.js +1 -0
- package/components/Breadcrumb/breadcrumb.js.map +1 -1
- package/components/Breadcrumb/index.umd.js +1 -1
- package/components/Breadcrumb/sgds-breadcrumb-item.cjs.js +1 -0
- package/components/Breadcrumb/sgds-breadcrumb-item.cjs.js.map +1 -1
- package/components/Breadcrumb/sgds-breadcrumb-item.js +1 -0
- package/components/Breadcrumb/sgds-breadcrumb-item.js.map +1 -1
- package/components/Breadcrumb/sgds-breadcrumb.cjs.js +1 -0
- package/components/Breadcrumb/sgds-breadcrumb.cjs.js.map +1 -1
- package/components/Breadcrumb/sgds-breadcrumb.js +1 -0
- package/components/Breadcrumb/sgds-breadcrumb.js.map +1 -1
- package/components/Button/button.cjs.js +1 -0
- package/components/Button/button.cjs.js.map +1 -1
- package/components/Button/button.js +1 -0
- package/components/Button/button.js.map +1 -1
- package/components/Button/index.umd.js +1 -1
- package/components/Button/sgds-button.cjs.js +1 -0
- package/components/Button/sgds-button.cjs.js.map +1 -1
- package/components/Button/sgds-button.js +1 -0
- package/components/Button/sgds-button.js.map +1 -1
- package/components/Card/card.cjs.js +1 -0
- package/components/Card/card.cjs.js.map +1 -1
- package/components/Card/card.js +1 -0
- package/components/Card/card.js.map +1 -1
- package/components/Card/index.umd.js +1 -1
- package/components/Card/sgds-card.cjs.js +1 -0
- package/components/Card/sgds-card.cjs.js.map +1 -1
- package/components/Card/sgds-card.js +1 -0
- package/components/Card/sgds-card.js.map +1 -1
- package/components/Checkbox/checkbox.cjs.js +1 -0
- package/components/Checkbox/checkbox.cjs.js.map +1 -1
- package/components/Checkbox/checkbox.js +1 -0
- package/components/Checkbox/checkbox.js.map +1 -1
- package/components/Checkbox/index.umd.js +1 -1
- package/components/Checkbox/sgds-checkbox.cjs.js +1 -0
- package/components/Checkbox/sgds-checkbox.cjs.js.map +1 -1
- package/components/Checkbox/sgds-checkbox.js +1 -0
- package/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/components/ComboBox/combo-box.cjs.js +1 -0
- package/components/ComboBox/combo-box.cjs.js.map +1 -1
- package/components/ComboBox/combo-box.js +1 -0
- package/components/ComboBox/combo-box.js.map +1 -1
- package/components/ComboBox/index.umd.js +1 -1
- package/components/ComboBox/sgds-combo-box.cjs.js +1 -0
- package/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.js +1 -0
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Datepicker/datepicker-calendar.cjs.js +1 -0
- package/components/Datepicker/datepicker-calendar.cjs.js.map +1 -1
- package/components/Datepicker/datepicker-calendar.cjs2.js +1 -0
- package/components/Datepicker/datepicker-calendar.cjs2.js.map +1 -1
- package/components/Datepicker/datepicker-calendar.js +1 -0
- package/components/Datepicker/datepicker-calendar.js.map +1 -1
- package/components/Datepicker/datepicker-calendar2.js +1 -0
- package/components/Datepicker/datepicker-calendar2.js.map +1 -1
- package/components/Datepicker/datepicker-header.cjs.js +1 -0
- package/components/Datepicker/datepicker-header.cjs.js.map +1 -1
- package/components/Datepicker/datepicker-header.cjs2.js +1 -0
- package/components/Datepicker/datepicker-header.cjs2.js.map +1 -1
- package/components/Datepicker/datepicker-header.js +1 -0
- package/components/Datepicker/datepicker-header.js.map +1 -1
- package/components/Datepicker/datepicker-header2.js +1 -0
- package/components/Datepicker/datepicker-header2.js.map +1 -1
- package/components/Datepicker/datepicker-input.cjs.js +1 -0
- package/components/Datepicker/datepicker-input.cjs.js.map +1 -1
- package/components/Datepicker/datepicker-input.cjs2.js +1 -0
- package/components/Datepicker/datepicker-input.cjs2.js.map +1 -1
- package/components/Datepicker/datepicker-input.js +1 -0
- package/components/Datepicker/datepicker-input.js.map +1 -1
- package/components/Datepicker/datepicker-input2.js +1 -0
- package/components/Datepicker/datepicker-input2.js.map +1 -1
- package/components/Datepicker/datepicker.cjs.js +1 -0
- package/components/Datepicker/datepicker.cjs.js.map +1 -1
- package/components/Datepicker/datepicker.js +1 -0
- package/components/Datepicker/datepicker.js.map +1 -1
- package/components/Datepicker/index.umd.js +1 -1
- package/components/Datepicker/sgds-datepicker.cjs.js +1 -0
- package/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.js +1 -0
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/Drawer/drawer.cjs.js +1 -0
- package/components/Drawer/drawer.cjs.js.map +1 -1
- package/components/Drawer/drawer.js +1 -0
- package/components/Drawer/drawer.js.map +1 -1
- package/components/Drawer/index.umd.js +1 -1
- package/components/Drawer/sgds-drawer.cjs.js +1 -0
- package/components/Drawer/sgds-drawer.cjs.js.map +1 -1
- package/components/Drawer/sgds-drawer.js +1 -0
- package/components/Drawer/sgds-drawer.js.map +1 -1
- package/components/Dropdown/dropdown.cjs.js +1 -0
- package/components/Dropdown/dropdown.cjs.js.map +1 -1
- package/components/Dropdown/dropdown.js +1 -0
- package/components/Dropdown/dropdown.js.map +1 -1
- package/components/Dropdown/index.umd.js +1 -1
- package/components/Dropdown/sgds-dropdown-item.cjs.js +1 -0
- package/components/Dropdown/sgds-dropdown-item.cjs.js.map +1 -1
- package/components/Dropdown/sgds-dropdown-item.js +1 -0
- package/components/Dropdown/sgds-dropdown-item.js.map +1 -1
- package/components/Dropdown/sgds-dropdown.cjs.js +1 -0
- package/components/Dropdown/sgds-dropdown.cjs.js.map +1 -1
- package/components/Dropdown/sgds-dropdown.js +1 -0
- package/components/Dropdown/sgds-dropdown.js.map +1 -1
- package/components/FileUpload/file-upload.cjs.js +1 -0
- package/components/FileUpload/file-upload.cjs.js.map +1 -1
- package/components/FileUpload/file-upload.js +1 -0
- package/components/FileUpload/file-upload.js.map +1 -1
- package/components/FileUpload/index.umd.js +1 -1
- package/components/FileUpload/sgds-file-upload.cjs.js +1 -0
- package/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
- package/components/FileUpload/sgds-file-upload.js +1 -0
- package/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/components/Footer/footer.cjs.js +1 -0
- package/components/Footer/footer.cjs.js.map +1 -1
- package/components/Footer/footer.js +1 -0
- package/components/Footer/footer.js.map +1 -1
- package/components/Footer/index.umd.js +1 -1
- package/components/Footer/sgds-footer.cjs.js +1 -0
- package/components/Footer/sgds-footer.cjs.js.map +1 -1
- package/components/Footer/sgds-footer.js +1 -0
- package/components/Footer/sgds-footer.js.map +1 -1
- package/components/Input/index.umd.js +1 -1
- package/components/Input/input.cjs.js +1 -0
- package/components/Input/input.cjs.js.map +1 -1
- package/components/Input/input.js +1 -0
- package/components/Input/input.js.map +1 -1
- package/components/Input/sgds-input.cjs.js +1 -0
- package/components/Input/sgds-input.cjs.js.map +1 -1
- package/components/Input/sgds-input.js +1 -0
- package/components/Input/sgds-input.js.map +1 -1
- package/components/Mainnav/index.umd.js +1 -1
- package/components/Mainnav/mainnav-dropdown.cjs.js +1 -0
- package/components/Mainnav/mainnav-dropdown.cjs.js.map +1 -1
- package/components/Mainnav/mainnav-dropdown.js +1 -0
- package/components/Mainnav/mainnav-dropdown.js.map +1 -1
- package/components/Mainnav/mainnav-item.cjs.js +1 -0
- package/components/Mainnav/mainnav-item.cjs.js.map +1 -1
- package/components/Mainnav/mainnav-item.js +1 -0
- package/components/Mainnav/mainnav-item.js.map +1 -1
- package/components/Mainnav/mainnav.cjs.js +1 -0
- package/components/Mainnav/mainnav.cjs.js.map +1 -1
- package/components/Mainnav/mainnav.js +1 -0
- package/components/Mainnav/mainnav.js.map +1 -1
- package/components/Mainnav/sgds-mainnav-dropdown.cjs.js +1 -0
- package/components/Mainnav/sgds-mainnav-dropdown.cjs.js.map +1 -1
- package/components/Mainnav/sgds-mainnav-dropdown.js +1 -0
- package/components/Mainnav/sgds-mainnav-dropdown.js.map +1 -1
- package/components/Mainnav/sgds-mainnav-item.cjs.js +1 -0
- package/components/Mainnav/sgds-mainnav-item.cjs.js.map +1 -1
- package/components/Mainnav/sgds-mainnav-item.js +1 -0
- package/components/Mainnav/sgds-mainnav-item.js.map +1 -1
- package/components/Mainnav/sgds-mainnav.cjs.js +1 -0
- package/components/Mainnav/sgds-mainnav.cjs.js.map +1 -1
- package/components/Mainnav/sgds-mainnav.js +1 -0
- package/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/components/Masthead/index.umd.js +21 -23
- package/components/Masthead/index.umd.js.map +1 -1
- package/components/Masthead/masthead.cjs.js +2 -2
- package/components/Masthead/masthead.js +2 -2
- package/components/Masthead/sgds-masthead.cjs.js +20 -20
- package/components/Masthead/sgds-masthead.cjs.js.map +1 -1
- package/components/Masthead/sgds-masthead.js +20 -20
- package/components/Masthead/sgds-masthead.js.map +1 -1
- package/components/Modal/index.umd.js +1 -1
- package/components/Modal/modal.cjs.js +1 -0
- package/components/Modal/modal.cjs.js.map +1 -1
- package/components/Modal/modal.js +1 -0
- package/components/Modal/modal.js.map +1 -1
- package/components/Modal/sgds-modal.cjs.js +1 -0
- package/components/Modal/sgds-modal.cjs.js.map +1 -1
- package/components/Modal/sgds-modal.js +1 -0
- package/components/Modal/sgds-modal.js.map +1 -1
- package/components/Pagination/index.umd.js +1 -1
- package/components/Pagination/pagination.cjs.js +1 -0
- package/components/Pagination/pagination.cjs.js.map +1 -1
- package/components/Pagination/pagination.js +1 -0
- package/components/Pagination/pagination.js.map +1 -1
- package/components/Pagination/sgds-pagination.cjs.js +1 -0
- package/components/Pagination/sgds-pagination.cjs.js.map +1 -1
- package/components/Pagination/sgds-pagination.js +1 -0
- package/components/Pagination/sgds-pagination.js.map +1 -1
- package/components/Progress/index.umd.js +1 -1
- package/components/Progress/progress-bar.cjs.js +1 -0
- package/components/Progress/progress-bar.cjs.js.map +1 -1
- package/components/Progress/progress-bar.js +1 -0
- package/components/Progress/progress-bar.js.map +1 -1
- package/components/Progress/progress.cjs.js +1 -0
- package/components/Progress/progress.cjs.js.map +1 -1
- package/components/Progress/progress.js +1 -0
- package/components/Progress/progress.js.map +1 -1
- package/components/Progress/sgds-progress-bar.cjs.js +1 -0
- package/components/Progress/sgds-progress-bar.cjs.js.map +1 -1
- package/components/Progress/sgds-progress-bar.js +1 -0
- package/components/Progress/sgds-progress-bar.js.map +1 -1
- package/components/Progress/sgds-progress.cjs.js +1 -0
- package/components/Progress/sgds-progress.cjs.js.map +1 -1
- package/components/Progress/sgds-progress.js +1 -0
- package/components/Progress/sgds-progress.js.map +1 -1
- package/components/QuantityToggle/index.umd.js +1 -1
- package/components/QuantityToggle/quantity-toggle.cjs.js +1 -0
- package/components/QuantityToggle/quantity-toggle.cjs.js.map +1 -1
- package/components/QuantityToggle/quantity-toggle.js +1 -0
- package/components/QuantityToggle/quantity-toggle.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.cjs.js +1 -0
- package/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.js +1 -0
- package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/components/Radio/index.umd.js +1 -1
- package/components/Radio/radio-group.cjs.js +1 -0
- package/components/Radio/radio-group.cjs.js.map +1 -1
- package/components/Radio/radio-group.js +1 -0
- package/components/Radio/radio-group.js.map +1 -1
- package/components/Radio/radio.cjs.js +1 -0
- package/components/Radio/radio.cjs.js.map +1 -1
- package/components/Radio/radio.js +1 -0
- package/components/Radio/radio.js.map +1 -1
- package/components/Radio/sgds-radio-group.cjs.js +1 -0
- package/components/Radio/sgds-radio-group.cjs.js.map +1 -1
- package/components/Radio/sgds-radio-group.js +1 -0
- package/components/Radio/sgds-radio-group.js.map +1 -1
- package/components/Radio/sgds-radio.cjs.js +1 -0
- package/components/Radio/sgds-radio.cjs.js.map +1 -1
- package/components/Radio/sgds-radio.js +1 -0
- package/components/Radio/sgds-radio.js.map +1 -1
- package/components/Sidenav/index.umd.js +1 -1
- package/components/Sidenav/sgds-sidenav-item.cjs.js +1 -0
- package/components/Sidenav/sgds-sidenav-item.cjs.js.map +1 -1
- package/components/Sidenav/sgds-sidenav-item.js +1 -0
- package/components/Sidenav/sgds-sidenav-item.js.map +1 -1
- package/components/Sidenav/sgds-sidenav-link.cjs.js +1 -0
- package/components/Sidenav/sgds-sidenav-link.cjs.js.map +1 -1
- package/components/Sidenav/sgds-sidenav-link.js +1 -0
- package/components/Sidenav/sgds-sidenav-link.js.map +1 -1
- package/components/Sidenav/sgds-sidenav.cjs.js +1 -0
- package/components/Sidenav/sgds-sidenav.cjs.js.map +1 -1
- package/components/Sidenav/sgds-sidenav.js +1 -0
- package/components/Sidenav/sgds-sidenav.js.map +1 -1
- package/components/Sidenav/sidenav-item.cjs.js +1 -0
- package/components/Sidenav/sidenav-item.cjs.js.map +1 -1
- package/components/Sidenav/sidenav-item.js +1 -0
- package/components/Sidenav/sidenav-item.js.map +1 -1
- package/components/Sidenav/sidenav-link.cjs.js +1 -0
- package/components/Sidenav/sidenav-link.cjs.js.map +1 -1
- package/components/Sidenav/sidenav-link.js +1 -0
- package/components/Sidenav/sidenav-link.js.map +1 -1
- package/components/Sidenav/sidenav.cjs.js +1 -0
- package/components/Sidenav/sidenav.cjs.js.map +1 -1
- package/components/Sidenav/sidenav.js +1 -0
- package/components/Sidenav/sidenav.js.map +1 -1
- package/components/Spinner/index.umd.js +1 -1
- package/components/Spinner/sgds-spinner.cjs.js +1 -0
- package/components/Spinner/sgds-spinner.cjs.js.map +1 -1
- package/components/Spinner/sgds-spinner.js +1 -0
- package/components/Spinner/sgds-spinner.js.map +1 -1
- package/components/Spinner/spinner.cjs.js +1 -0
- package/components/Spinner/spinner.cjs.js.map +1 -1
- package/components/Spinner/spinner.js +1 -0
- package/components/Spinner/spinner.js.map +1 -1
- package/components/Stepper/index.umd.js +1 -1
- package/components/Stepper/sgds-stepper.cjs.js +1 -0
- package/components/Stepper/sgds-stepper.cjs.js.map +1 -1
- package/components/Stepper/sgds-stepper.js +1 -0
- package/components/Stepper/sgds-stepper.js.map +1 -1
- package/components/Stepper/stepper.cjs.js +1 -0
- package/components/Stepper/stepper.cjs.js.map +1 -1
- package/components/Stepper/stepper.js +1 -0
- package/components/Stepper/stepper.js.map +1 -1
- package/components/Tab/index.umd.js +1 -1
- package/components/Tab/sgds-tab-group.cjs.js +1 -0
- package/components/Tab/sgds-tab-group.cjs.js.map +1 -1
- package/components/Tab/sgds-tab-group.js +1 -0
- package/components/Tab/sgds-tab-group.js.map +1 -1
- package/components/Tab/sgds-tab-panel.cjs.js +1 -0
- package/components/Tab/sgds-tab-panel.cjs.js.map +1 -1
- package/components/Tab/sgds-tab-panel.js +1 -0
- package/components/Tab/sgds-tab-panel.js.map +1 -1
- package/components/Tab/sgds-tab.cjs.js +1 -0
- package/components/Tab/sgds-tab.cjs.js.map +1 -1
- package/components/Tab/sgds-tab.js +1 -0
- package/components/Tab/sgds-tab.js.map +1 -1
- package/components/Tab/tab-group.cjs.js +1 -0
- package/components/Tab/tab-group.cjs.js.map +1 -1
- package/components/Tab/tab-group.js +1 -0
- package/components/Tab/tab-group.js.map +1 -1
- package/components/Tab/tab-panel.cjs.js +1 -0
- package/components/Tab/tab-panel.cjs.js.map +1 -1
- package/components/Tab/tab-panel.js +1 -0
- package/components/Tab/tab-panel.js.map +1 -1
- package/components/Tab/tab.cjs.js +1 -0
- package/components/Tab/tab.cjs.js.map +1 -1
- package/components/Tab/tab.js +1 -0
- package/components/Tab/tab.js.map +1 -1
- package/components/Table/index.umd.js +1 -1
- package/components/Table/sgds-table.cjs.js +1 -0
- package/components/Table/sgds-table.cjs.js.map +1 -1
- package/components/Table/sgds-table.js +1 -0
- package/components/Table/sgds-table.js.map +1 -1
- package/components/Table/table.cjs.js +1 -0
- package/components/Table/table.cjs.js.map +1 -1
- package/components/Table/table.js +1 -0
- package/components/Table/table.js.map +1 -1
- package/components/Textarea/index.umd.js +1 -1
- package/components/Textarea/sgds-textarea.cjs.js +1 -0
- package/components/Textarea/sgds-textarea.cjs.js.map +1 -1
- package/components/Textarea/sgds-textarea.js +1 -0
- package/components/Textarea/sgds-textarea.js.map +1 -1
- package/components/Textarea/textarea.cjs.js +1 -0
- package/components/Textarea/textarea.cjs.js.map +1 -1
- package/components/Textarea/textarea.js +1 -0
- package/components/Textarea/textarea.js.map +1 -1
- package/components/Toast/index.umd.js +1 -1
- package/components/Toast/sgds-toast-container.cjs.js +1 -0
- package/components/Toast/sgds-toast-container.cjs.js.map +1 -1
- package/components/Toast/sgds-toast-container.js +1 -0
- package/components/Toast/sgds-toast-container.js.map +1 -1
- package/components/Toast/sgds-toast.cjs.js +1 -0
- package/components/Toast/sgds-toast.cjs.js.map +1 -1
- package/components/Toast/sgds-toast.js +1 -0
- package/components/Toast/sgds-toast.js.map +1 -1
- package/components/Toast/toast-container.cjs.js +1 -0
- package/components/Toast/toast-container.cjs.js.map +1 -1
- package/components/Toast/toast-container.js +1 -0
- package/components/Toast/toast-container.js.map +1 -1
- package/components/Toast/toast.cjs.js +1 -0
- package/components/Toast/toast.cjs.js.map +1 -1
- package/components/Toast/toast.js +1 -0
- package/components/Toast/toast.js.map +1 -1
- package/components/Tooltip/index.umd.js +1 -1
- package/components/Tooltip/sgds-tooltip.cjs.js +1 -0
- package/components/Tooltip/sgds-tooltip.cjs.js.map +1 -1
- package/components/Tooltip/sgds-tooltip.js +1 -0
- package/components/Tooltip/sgds-tooltip.js.map +1 -1
- package/components/Tooltip/tooltip.cjs.js +1 -0
- package/components/Tooltip/tooltip.cjs.js.map +1 -1
- package/components/Tooltip/tooltip.js +1 -0
- package/components/Tooltip/tooltip.js.map +1 -1
- package/components/index.umd.js +21 -23
- package/components/index.umd.js.map +1 -1
- package/index.umd.js +21 -23
- package/index.umd.js.map +1 -1
- package/internals/CloseButton/close-button.cjs.js +1 -0
- package/internals/CloseButton/close-button.cjs.js.map +1 -1
- package/internals/CloseButton/close-button.js +1 -0
- package/internals/CloseButton/close-button.js.map +1 -1
- package/internals/CloseButton/sgds-close-button.cjs.js +1 -0
- package/internals/CloseButton/sgds-close-button.cjs.js.map +1 -1
- package/internals/CloseButton/sgds-close-button.js +1 -0
- package/internals/CloseButton/sgds-close-button.js.map +1 -1
- package/package.json +1 -1
- package/react/accordion/index.cjs.js +1 -0
- package/react/accordion/index.cjs.js.map +1 -1
- package/react/accordion/index.js +1 -0
- package/react/accordion/index.js.map +1 -1
- package/react/accordion-item/index.cjs.js +1 -0
- package/react/accordion-item/index.cjs.js.map +1 -1
- package/react/accordion-item/index.js +1 -0
- package/react/accordion-item/index.js.map +1 -1
- package/react/action-card/index.cjs.js +1 -0
- package/react/action-card/index.cjs.js.map +1 -1
- package/react/action-card/index.js +1 -0
- package/react/action-card/index.js.map +1 -1
- package/react/alert/index.cjs.js +1 -0
- package/react/alert/index.cjs.js.map +1 -1
- package/react/alert/index.js +1 -0
- package/react/alert/index.js.map +1 -1
- package/react/alert-heading/index.cjs.js +1 -0
- package/react/alert-heading/index.cjs.js.map +1 -1
- package/react/alert-heading/index.js +1 -0
- package/react/alert-heading/index.js.map +1 -1
- package/react/alert-link/index.cjs.js +1 -0
- package/react/alert-link/index.cjs.js.map +1 -1
- package/react/alert-link/index.js +1 -0
- package/react/alert-link/index.js.map +1 -1
- package/react/badge/index.cjs.js +1 -0
- package/react/badge/index.cjs.js.map +1 -1
- package/react/badge/index.js +1 -0
- package/react/badge/index.js.map +1 -1
- package/react/breadcrumb/index.cjs.js +1 -0
- package/react/breadcrumb/index.cjs.js.map +1 -1
- package/react/breadcrumb/index.js +1 -0
- package/react/breadcrumb/index.js.map +1 -1
- package/react/breadcrumb-item/index.cjs.js +1 -0
- package/react/breadcrumb-item/index.cjs.js.map +1 -1
- package/react/breadcrumb-item/index.js +1 -0
- package/react/breadcrumb-item/index.js.map +1 -1
- package/react/button/index.cjs.js +1 -0
- package/react/button/index.cjs.js.map +1 -1
- package/react/button/index.js +1 -0
- package/react/button/index.js.map +1 -1
- package/react/card/index.cjs.js +1 -0
- package/react/card/index.cjs.js.map +1 -1
- package/react/card/index.js +1 -0
- package/react/card/index.js.map +1 -1
- package/react/checkbox/index.cjs.js +1 -0
- package/react/checkbox/index.cjs.js.map +1 -1
- package/react/checkbox/index.js +1 -0
- package/react/checkbox/index.js.map +1 -1
- package/react/combo-box/index.cjs.js +1 -0
- package/react/combo-box/index.cjs.js.map +1 -1
- package/react/combo-box/index.js +1 -0
- package/react/combo-box/index.js.map +1 -1
- package/react/datepicker/index.cjs.js +1 -0
- package/react/datepicker/index.cjs.js.map +1 -1
- package/react/datepicker/index.js +1 -0
- package/react/datepicker/index.js.map +1 -1
- package/react/drawer/index.cjs.js +1 -0
- package/react/drawer/index.cjs.js.map +1 -1
- package/react/drawer/index.js +1 -0
- package/react/drawer/index.js.map +1 -1
- package/react/dropdown/index.cjs.js +1 -0
- package/react/dropdown/index.cjs.js.map +1 -1
- package/react/dropdown/index.js +1 -0
- package/react/dropdown/index.js.map +1 -1
- package/react/dropdown-item/index.cjs.js +1 -0
- package/react/dropdown-item/index.cjs.js.map +1 -1
- package/react/dropdown-item/index.js +1 -0
- package/react/dropdown-item/index.js.map +1 -1
- package/react/file-upload/index.cjs.js +1 -0
- package/react/file-upload/index.cjs.js.map +1 -1
- package/react/file-upload/index.js +1 -0
- package/react/file-upload/index.js.map +1 -1
- package/react/footer/index.cjs.js +1 -0
- package/react/footer/index.cjs.js.map +1 -1
- package/react/footer/index.js +1 -0
- package/react/footer/index.js.map +1 -1
- package/react/index.cjs.js +1 -0
- package/react/index.cjs.js.map +1 -1
- package/react/index.js +1 -0
- package/react/index.js.map +1 -1
- package/react/input/index.cjs.js +1 -0
- package/react/input/index.cjs.js.map +1 -1
- package/react/input/index.js +1 -0
- package/react/input/index.js.map +1 -1
- package/react/mainnav/index.cjs.js +1 -0
- package/react/mainnav/index.cjs.js.map +1 -1
- package/react/mainnav/index.js +1 -0
- package/react/mainnav/index.js.map +1 -1
- package/react/mainnav-dropdown/index.cjs.js +1 -0
- package/react/mainnav-dropdown/index.cjs.js.map +1 -1
- package/react/mainnav-dropdown/index.js +1 -0
- package/react/mainnav-dropdown/index.js.map +1 -1
- package/react/mainnav-item/index.cjs.js +1 -0
- package/react/mainnav-item/index.cjs.js.map +1 -1
- package/react/mainnav-item/index.js +1 -0
- package/react/mainnav-item/index.js.map +1 -1
- package/react/masthead/index.cjs.js +1 -0
- package/react/masthead/index.cjs.js.map +1 -1
- package/react/masthead/index.js +1 -0
- package/react/masthead/index.js.map +1 -1
- package/react/modal/index.cjs.js +1 -0
- package/react/modal/index.cjs.js.map +1 -1
- package/react/modal/index.js +1 -0
- package/react/modal/index.js.map +1 -1
- package/react/pagination/index.cjs.js +1 -0
- package/react/pagination/index.cjs.js.map +1 -1
- package/react/pagination/index.js +1 -0
- package/react/pagination/index.js.map +1 -1
- package/react/progress/index.cjs.js +1 -0
- package/react/progress/index.cjs.js.map +1 -1
- package/react/progress/index.js +1 -0
- package/react/progress/index.js.map +1 -1
- package/react/progress-bar/index.cjs.js +1 -0
- package/react/progress-bar/index.cjs.js.map +1 -1
- package/react/progress-bar/index.js +1 -0
- package/react/progress-bar/index.js.map +1 -1
- package/react/quantity-toggle/index.cjs.js +1 -0
- package/react/quantity-toggle/index.cjs.js.map +1 -1
- package/react/quantity-toggle/index.js +1 -0
- package/react/quantity-toggle/index.js.map +1 -1
- package/react/radio/index.cjs.js +1 -0
- package/react/radio/index.cjs.js.map +1 -1
- package/react/radio/index.js +1 -0
- package/react/radio/index.js.map +1 -1
- package/react/radio-group/index.cjs.js +1 -0
- package/react/radio-group/index.cjs.js.map +1 -1
- package/react/radio-group/index.js +1 -0
- package/react/radio-group/index.js.map +1 -1
- package/react/sidenav/index.cjs.js +1 -0
- package/react/sidenav/index.cjs.js.map +1 -1
- package/react/sidenav/index.js +1 -0
- package/react/sidenav/index.js.map +1 -1
- package/react/sidenav-item/index.cjs.js +1 -0
- package/react/sidenav-item/index.cjs.js.map +1 -1
- package/react/sidenav-item/index.js +1 -0
- package/react/sidenav-item/index.js.map +1 -1
- package/react/sidenav-link/index.cjs.js +1 -0
- package/react/sidenav-link/index.cjs.js.map +1 -1
- package/react/sidenav-link/index.js +1 -0
- package/react/sidenav-link/index.js.map +1 -1
- package/react/spinner/index.cjs.js +1 -0
- package/react/spinner/index.cjs.js.map +1 -1
- package/react/spinner/index.js +1 -0
- package/react/spinner/index.js.map +1 -1
- package/react/stepper/index.cjs.js +1 -0
- package/react/stepper/index.cjs.js.map +1 -1
- package/react/stepper/index.js +1 -0
- package/react/stepper/index.js.map +1 -1
- package/react/tab/index.cjs.js +1 -0
- package/react/tab/index.cjs.js.map +1 -1
- package/react/tab/index.js +1 -0
- package/react/tab/index.js.map +1 -1
- package/react/tab-group/index.cjs.js +1 -0
- package/react/tab-group/index.cjs.js.map +1 -1
- package/react/tab-group/index.js +1 -0
- package/react/tab-group/index.js.map +1 -1
- package/react/tab-panel/index.cjs.js +1 -0
- package/react/tab-panel/index.cjs.js.map +1 -1
- package/react/tab-panel/index.js +1 -0
- package/react/tab-panel/index.js.map +1 -1
- package/react/table/index.cjs.js +1 -0
- package/react/table/index.cjs.js.map +1 -1
- package/react/table/index.js +1 -0
- package/react/table/index.js.map +1 -1
- package/react/textarea/index.cjs.js +1 -0
- package/react/textarea/index.cjs.js.map +1 -1
- package/react/textarea/index.js +1 -0
- package/react/textarea/index.js.map +1 -1
- package/react/toast/index.cjs.js +1 -0
- package/react/toast/index.cjs.js.map +1 -1
- package/react/toast/index.js +1 -0
- package/react/toast/index.js.map +1 -1
- package/react/toast-container/index.cjs.js +1 -0
- package/react/toast-container/index.cjs.js.map +1 -1
- package/react/toast-container/index.js +1 -0
- package/react/toast-container/index.js.map +1 -1
- package/react/tooltip/index.cjs.js +1 -0
- package/react/tooltip/index.cjs.js.map +1 -1
- package/react/tooltip/index.js +1 -0
- package/react/tooltip/index.js.map +1 -1
- package/styles/anchor.cjs.js +1 -0
- package/styles/anchor.cjs.js.map +1 -1
- package/styles/anchor.js +1 -0
- package/styles/anchor.js.map +1 -1
- package/styles/bg-variants.cjs.js +1 -0
- package/styles/bg-variants.cjs.js.map +1 -1
- package/styles/bg-variants.js +1 -0
- package/styles/bg-variants.js.map +1 -1
- package/styles/border-variants.cjs.js +1 -0
- package/styles/border-variants.cjs.js.map +1 -1
- package/styles/border-variants.js +1 -0
- package/styles/border-variants.js.map +1 -1
- package/styles/feedback.cjs.js +1 -0
- package/styles/feedback.cjs.js.map +1 -1
- package/styles/feedback.js +1 -0
- package/styles/feedback.js.map +1 -1
- package/styles/form-hint.cjs.js +1 -0
- package/styles/form-hint.cjs.js.map +1 -1
- package/styles/form-hint.js +1 -0
- package/styles/form-hint.js.map +1 -1
- package/styles/form-label.cjs.js +1 -0
- package/styles/form-label.cjs.js.map +1 -1
- package/styles/form-label.js +1 -0
- package/styles/form-label.js.map +1 -1
- package/styles/header-class.cjs.js +1 -0
- package/styles/header-class.cjs.js.map +1 -1
- package/styles/header-class.js +1 -0
- package/styles/header-class.js.map +1 -1
- package/styles/paragraph.cjs.js +1 -0
- package/styles/paragraph.cjs.js.map +1 -1
- package/styles/paragraph.js +1 -0
- package/styles/paragraph.js.map +1 -1
- package/styles/svg.cjs.js +1 -0
- package/styles/svg.cjs.js.map +1 -1
- package/styles/svg.js +1 -0
- package/styles/svg.js.map +1 -1
- package/styles/text-variants.cjs.js +1 -0
- package/styles/text-variants.cjs.js.map +1 -1
- package/styles/text-variants.js +1 -0
- package/styles/text-variants.js.map +1 -1
- package/utils/animate.cjs.js +1 -0
- package/utils/animate.cjs.js.map +1 -1
- package/utils/animate.js +1 -0
- package/utils/animate.js.map +1 -1
- package/utils/animation-registry.cjs.js +1 -0
- package/utils/animation-registry.cjs.js.map +1 -1
- package/utils/animation-registry.js +1 -0
- package/utils/animation-registry.js.map +1 -1
- package/utils/breakpoints.cjs.js +1 -0
- package/utils/breakpoints.cjs.js.map +1 -1
- package/utils/breakpoints.js +1 -0
- package/utils/breakpoints.js.map +1 -1
- package/utils/defaultvalue.cjs.js +1 -0
- package/utils/defaultvalue.cjs.js.map +1 -1
- package/utils/defaultvalue.js +1 -0
- package/utils/defaultvalue.js.map +1 -1
- package/utils/event.cjs.js +1 -0
- package/utils/event.cjs.js.map +1 -1
- package/utils/event.js +1 -0
- package/utils/event.js.map +1 -1
- package/utils/form.cjs.js +1 -0
- package/utils/form.cjs.js.map +1 -1
- package/utils/form.js +1 -0
- package/utils/form.js.map +1 -1
- package/utils/generateId.cjs.js +1 -0
- package/utils/generateId.cjs.js.map +1 -1
- package/utils/generateId.js +1 -0
- package/utils/generateId.js.map +1 -1
- package/utils/mergeDeep.cjs.js +1 -0
- package/utils/mergeDeep.cjs.js.map +1 -1
- package/utils/mergeDeep.js +1 -0
- package/utils/mergeDeep.js.map +1 -1
- package/utils/modal.cjs.js +1 -0
- package/utils/modal.cjs.js.map +1 -1
- package/utils/modal.js +1 -0
- package/utils/modal.js.map +1 -1
- package/utils/object.cjs.js +1 -0
- package/utils/object.cjs.js.map +1 -1
- package/utils/object.js +1 -0
- package/utils/object.js.map +1 -1
- package/utils/scroll.cjs.js +1 -0
- package/utils/scroll.cjs.js.map +1 -1
- package/utils/scroll.js +1 -0
- package/utils/scroll.js.map +1 -1
- package/utils/slot.cjs.js +1 -0
- package/utils/slot.cjs.js.map +1 -1
- package/utils/slot.js +1 -0
- package/utils/slot.js.map +1 -1
- package/utils/tabbable.cjs.js +1 -0
- package/utils/tabbable.cjs.js.map +1 -1
- package/utils/tabbable.js +1 -0
- package/utils/tabbable.js.map +1 -1
- package/utils/time.cjs.js +1 -0
- package/utils/time.cjs.js.map +1 -1
- package/utils/time.js +1 -0
- package/utils/time.js.map +1 -1
- package/utils/watch.cjs.js +1 -0
- package/utils/watch.cjs.js.map +1 -1
- package/utils/watch.js +1 -0
- package/utils/watch.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-drawer.cjs.js","sources":["../../../src/components/Drawer/sgds-drawer.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { animateTo, stopAnimations } from \"../../utils/animate.js\";\nimport { getAnimation, setDefaultAnimation } from \"../../utils/animation-registry.js\";\nimport { waitForEvent } from \"../../utils/event.js\";\nimport { lockBodyScrolling, unlockBodyScrolling } from \"../../utils/scroll.js\";\nimport { HasSlotController } from \"../../utils/slot.js\";\nimport { watch } from \"../../utils/watch.js\";\nimport drawerStyles from \"./drawer.css\";\nimport SgdsCloseButton from \"../../internals/CloseButton/sgds-close-button\";\nimport { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\n\n/**\n * @summary Drawers slide in from a container to expose additional options and information.\n *\n * @slot - The drawer's main content.\n * @slot label - The drawer's label. Alternatively, you can use the `label` attribute.\n * @slot header-actions - Optional actions to add to the header.\n * @slot footer - The drawer's footer, usually one or more buttons representing various options.\n *\n * @event sgds-show - Emitted when the drawer opens.\n * @event sgds-after-show - Emitted after the drawer opens and all animations are complete.\n * @event sgds-hide - Emitted when the drawer closes.\n * @event sgds-after-hide - Emitted after the drawer closes and all animations are complete.\n * @event sgds-initial-focus - Emitted when the drawer opens and is ready to receive focus. Calling\n * `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.\n * @event {{ source: 'close-button' | 'keyboard' | 'overlay' }} sgds-request-close - Emitted when the user attempts to\n * close the drawer by clicking the close button, clicking the overlay, or pressing escape. Calling\n * `event.preventDefault()` will keep the drawer open. Avoid using this unless closing the drawer will result in\n * destructive behavior such as data loss.\n *\n * @csspart base - The component's base wrapper.\n * @csspart overlay - The overlay that covers the screen behind the drawer.\n * @csspart panel - The drawer's panel (where the drawer and its content are rendered).\n * @csspart header - The drawer's header. This element wraps the title and header actions.\n * @csspart header-actions - Optional actions to add to the header.\n * @csspart title - The drawer's title.\n * @csspart close-button - The close button.\n * @csspart body - The drawer's body.\n * @csspart footer - The drawer's footer.\n *\n * @cssproperty --drawer-size - The preferred size of the drawer. This will be applied to the drawer's width or height\n * depending on its `placement`. Note that the drawer will shrink to accommodate smaller screens.\n * @cssproperty --drawer-padding - The amount of padding to use for the header, body and footer\n * @cssproperty --drawer-bg - The drawer's background color.\n * @cssproperty --drawer-button-gap - The drawer's flex gap between buttons.\n *\n */\nexport class SgdsDrawer extends ScopedElementsMixin(SgdsElement) {\n static styles = [...SgdsElement.styles, drawerStyles];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-close-button\": SgdsCloseButton\n };\n }\n /** @internal */\n private readonly hasSlotController = new HasSlotController(this, \"footer\");\n /** @internal */\n private originalTrigger: HTMLElement | null;\n /** @internal */\n @query(\".drawer\") drawer: HTMLElement;\n /** @internal */\n @query(\".drawer-panel\") panel: HTMLElement;\n /** @internal */\n @query(\".drawer-overlay\") overlay: HTMLElement;\n\n /**\n * Indicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can\n * use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * The drawer's label as displayed in the header. You should always include a relevant label even when using\n * `noHeader`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.\n */\n @property({ type: String, reflect: true }) label = \"\";\n\n /** The direction from which the drawer will open. */\n @property({ type: String, reflect: true }) placement: \"top\" | \"end\" | \"bottom\" | \"start\" = \"end\";\n\n /**\n * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\n * its parent element, set this attribute and add `position: relative` to the parent.\n */\n @property({ type: Boolean, reflect: true }) contained = false;\n\n /**\n * Removes the header. This will also remove the default close button, so please ensure you provide an easy,\n * accessible way for users to dismiss the drawer.\n */\n @property({ type: Boolean, reflect: true }) noHeader = false;\n\n firstUpdated() {\n this.drawer.hidden = !this.open;\n\n if (this.open) {\n this.addOpenListeners();\n\n if (!this.contained) {\n lockBodyScrolling(this);\n }\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n unlockBodyScrolling(this);\n }\n\n private uppercaseFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n\n private requestClose(source: \"close-button\" | \"keyboard\" | \"overlay\") {\n const slRequestClose = this.emit(\"sgds-request-close\", {\n cancelable: true,\n detail: { source }\n });\n\n if (slRequestClose.defaultPrevented) {\n const animation = getAnimation(this, \"drawer.denyClose\");\n animateTo(this.panel, animation.keyframes, animation.options);\n return;\n }\n\n this.hide();\n }\n\n private addOpenListeners() {\n document.addEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n private removeOpenListeners() {\n document.removeEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n private handleDocumentKeyDown = (event: KeyboardEvent) => {\n if (this.open && !this.contained && event.key === \"Escape\") {\n event.stopPropagation();\n this.requestClose(\"keyboard\");\n }\n };\n\n @watch(\"open\", { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n // Show\n this.emit(\"sgds-show\");\n this.addOpenListeners();\n this.originalTrigger = document.activeElement as HTMLElement;\n\n // Lock body scrolling only if the drawer isn't contained\n if (!this.contained) {\n lockBodyScrolling(this);\n }\n\n // When the drawer is shown, Safari will attempt to set focus on whatever element has autofocus. This causes the\n // drawer's animation to jitter, so we'll temporarily remove the attribute, call `focus({ preventScroll: true })`\n // ourselves, and add the attribute back afterwards.\n //\n // Related: https://github.com/shoelace-style/shoelace/issues/693\n //\n const autoFocusTarget = this.querySelector(\"[autofocus]\");\n if (autoFocusTarget) {\n autoFocusTarget.removeAttribute(\"autofocus\");\n }\n\n await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);\n this.drawer.hidden = false;\n\n // Set initial focus\n requestAnimationFrame(() => {\n const slInitialFocus = this.emit(\"sgds-initial-focus\", { cancelable: true });\n\n if (!slInitialFocus.defaultPrevented) {\n // Set focus to the autofocus target and restore the attribute\n if (autoFocusTarget) {\n (autoFocusTarget as HTMLInputElement).focus({ preventScroll: true });\n } else {\n this.panel.focus({ preventScroll: true });\n }\n }\n\n // Restore the autofocus attribute\n if (autoFocusTarget) {\n autoFocusTarget.setAttribute(\"autofocus\", \"\");\n }\n });\n\n const panelAnimation = getAnimation(this, `drawer.show${this.uppercaseFirstLetter(this.placement)}`);\n const overlayAnimation = getAnimation(this, \"drawer.overlay.show\");\n await Promise.all([\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)\n ]);\n\n this.emit(\"sgds-after-show\");\n } else {\n // Hide\n this.emit(\"sgds-hide\");\n this.removeOpenListeners();\n\n if (!this.contained) {\n unlockBodyScrolling(this);\n }\n\n await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);\n const panelAnimation = getAnimation(this, `drawer.hide${this.uppercaseFirstLetter(this.placement)}`);\n const overlayAnimation = getAnimation(this, \"drawer.overlay.hide\");\n\n // Animate the overlay and the panel at the same time. Because animation durations might be different, we need to\n // hide each one individually when the animation finishes, otherwise the first one that finishes will reappear\n // unexpectedly. We'll unhide them after all animations have completed.\n await Promise.all([\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {\n this.overlay.hidden = true;\n }),\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {\n this.panel.hidden = true;\n })\n ]);\n\n this.drawer.hidden = true;\n\n // Now that the dialog is hidden, restore the overlay and panel for next time\n this.overlay.hidden = false;\n this.panel.hidden = false;\n\n // Restore focus to the original trigger\n const trigger = this.originalTrigger;\n if (typeof trigger?.focus === \"function\") {\n setTimeout(() => trigger.focus());\n }\n\n this.emit(\"sgds-after-hide\");\n }\n }\n\n @watch(\"contained\", { waitUntilFirstUpdate: true })\n handleNoModalChange() {\n if (this.open && !this.contained) {\n lockBodyScrolling(this);\n }\n\n if (this.open && this.contained) {\n unlockBodyScrolling(this);\n }\n }\n\n /** Shows the drawer. */\n public async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, \"sgds-after-show\");\n }\n\n /** Hides the drawer */\n public async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, \"sgds-after-hide\");\n }\n\n render() {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n drawer: true,\n \"drawer-open\": this.open,\n \"drawer-top\": this.placement === \"top\",\n \"drawer-end\": this.placement === \"end\",\n \"drawer-bottom\": this.placement === \"bottom\",\n \"drawer-start\": this.placement === \"start\",\n \"drawer-contained\": this.contained,\n \"drawer-fixed\": !this.contained,\n \"drawer-has-footer\": this.hasSlotController.test(\"footer\")\n })}\n >\n <div part=\"overlay\" class=\"drawer-overlay\" @click=${() => this.requestClose(\"overlay\")} tabindex=\"-1\"></div>\n\n <div\n part=\"panel\"\n class=\"drawer-panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden=${this.open ? \"false\" : \"true\"}\n aria-label=${ifDefined(this.noHeader ? this.label : undefined)}\n aria-labelledby=${ifDefined(!this.noHeader ? \"title\" : undefined)}\n tabindex=\"0\"\n >\n ${!this.noHeader\n ? html`\n <header part=\"header\" class=\"drawer-header\">\n <h2 part=\"title\" class=\"drawer-title\" id=\"title\">\n <!-- If there's no label, use an invisible character to prevent the header from collapsing -->\n <slot name=\"label\"> ${this.label.length > 0 ? this.label : String.fromCharCode(65279)} </slot>\n </h2>\n <div part=\"header-actions\" class=\"drawer-header-actions\">\n <slot name=\"header-actions\"></slot>\n <sgds-close-button\n part=\"close-button\"\n class=\"drawer-close\"\n aria-label=\"close drawer\"\n @click=\"${() => this.requestClose(\"close-button\")}\"\n ></sgds-close-button>\n </div>\n </header>\n `\n : nothing}\n\n <slot part=\"body\" class=\"drawer-body\"></slot>\n\n <footer part=\"footer\" class=\"drawer-footer\">\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n </div>\n `;\n }\n}\n\n// Top\nsetDefaultAnimation(\"drawer.showTop\", {\n keyframes: [\n { opacity: 0, translate: \"0 -100%\" },\n { opacity: 1, translate: \"0 0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideTop\", {\n keyframes: [\n { opacity: 1, translate: \"0 0\" },\n { opacity: 0, translate: \"0 -100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// End\nsetDefaultAnimation(\"drawer.showEnd\", {\n keyframes: [\n { opacity: 0, translate: \"100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n rtlKeyframes: [\n { opacity: 0, translate: \"-100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideEnd\", {\n keyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"100%\" }\n ],\n rtlKeyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"-100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Bottom\nsetDefaultAnimation(\"drawer.showBottom\", {\n keyframes: [\n { opacity: 0, translate: \"0 100%\" },\n { opacity: 1, translate: \"0 0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideBottom\", {\n keyframes: [\n { opacity: 1, translate: \"0 0\" },\n { opacity: 0, translate: \"0 100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Start\nsetDefaultAnimation(\"drawer.showStart\", {\n keyframes: [\n { opacity: 0, translate: \"-100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n rtlKeyframes: [\n { opacity: 0, translate: \"100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideStart\", {\n keyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"-100%\" }\n ],\n rtlKeyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Deny close\nsetDefaultAnimation(\"drawer.denyClose\", {\n keyframes: [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }],\n options: { duration: 250 }\n});\n\n// Overlay\nsetDefaultAnimation(\"drawer.overlay.show\", {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 250 }\n});\n\nsetDefaultAnimation(\"drawer.overlay.hide\", {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 250 }\n});\n\nexport default SgdsDrawer;\n"],"names":["ScopedElementsMixin","SgdsElement","HasSlotController","SgdsCloseButton","lockBodyScrolling","unlockBodyScrolling","getAnimation","animateTo","stopAnimations","waitForEvent","html","classMap","ifDefined","nothing","drawerStyles","__decorate","query","property","watch","setDefaultAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCG;MACU,UAAW,SAAQA,kCAAmB,CAACC,sBAAW,CAAC,CAAA;AAAhE,IAAA,WAAA,GAAA;;;QASmB,IAAiB,CAAA,iBAAA,GAAG,IAAIC,sBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAU3E;;;AAGG;QACyC,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;AAEzD;;;AAGG;QACwC,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAGX,IAAS,CAAA,SAAA,GAAuC,KAAK,CAAC;AAEjG;;;AAGG;QACyC,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;AAE9D;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AAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC;;;;;"}
|
|
1
|
+
{"version":3,"file":"sgds-drawer.cjs.js","sources":["../../../src/components/Drawer/sgds-drawer.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { animateTo, stopAnimations } from \"../../utils/animate.js\";\nimport { getAnimation, setDefaultAnimation } from \"../../utils/animation-registry.js\";\nimport { waitForEvent } from \"../../utils/event.js\";\nimport { lockBodyScrolling, unlockBodyScrolling } from \"../../utils/scroll.js\";\nimport { HasSlotController } from \"../../utils/slot.js\";\nimport { watch } from \"../../utils/watch.js\";\nimport drawerStyles from \"./drawer.css\";\nimport SgdsCloseButton from \"../../internals/CloseButton/sgds-close-button\";\nimport { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\n\n/**\n * @summary Drawers slide in from a container to expose additional options and information.\n *\n * @slot - The drawer's main content.\n * @slot label - The drawer's label. Alternatively, you can use the `label` attribute.\n * @slot header-actions - Optional actions to add to the header.\n * @slot footer - The drawer's footer, usually one or more buttons representing various options.\n *\n * @event sgds-show - Emitted when the drawer opens.\n * @event sgds-after-show - Emitted after the drawer opens and all animations are complete.\n * @event sgds-hide - Emitted when the drawer closes.\n * @event sgds-after-hide - Emitted after the drawer closes and all animations are complete.\n * @event sgds-initial-focus - Emitted when the drawer opens and is ready to receive focus. Calling\n * `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.\n * @event {{ source: 'close-button' | 'keyboard' | 'overlay' }} sgds-request-close - Emitted when the user attempts to\n * close the drawer by clicking the close button, clicking the overlay, or pressing escape. Calling\n * `event.preventDefault()` will keep the drawer open. Avoid using this unless closing the drawer will result in\n * destructive behavior such as data loss.\n *\n * @csspart base - The component's base wrapper.\n * @csspart overlay - The overlay that covers the screen behind the drawer.\n * @csspart panel - The drawer's panel (where the drawer and its content are rendered).\n * @csspart header - The drawer's header. This element wraps the title and header actions.\n * @csspart header-actions - Optional actions to add to the header.\n * @csspart title - The drawer's title.\n * @csspart close-button - The close button.\n * @csspart body - The drawer's body.\n * @csspart footer - The drawer's footer.\n *\n * @cssproperty --drawer-size - The preferred size of the drawer. This will be applied to the drawer's width or height\n * depending on its `placement`. Note that the drawer will shrink to accommodate smaller screens.\n * @cssproperty --drawer-padding - The amount of padding to use for the header, body and footer\n * @cssproperty --drawer-bg - The drawer's background color.\n * @cssproperty --drawer-button-gap - The drawer's flex gap between buttons.\n *\n */\nexport class SgdsDrawer extends ScopedElementsMixin(SgdsElement) {\n static styles = [...SgdsElement.styles, drawerStyles];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-close-button\": SgdsCloseButton\n };\n }\n /** @internal */\n private readonly hasSlotController = new HasSlotController(this, \"footer\");\n /** @internal */\n private originalTrigger: HTMLElement | null;\n /** @internal */\n @query(\".drawer\") drawer: HTMLElement;\n /** @internal */\n @query(\".drawer-panel\") panel: HTMLElement;\n /** @internal */\n @query(\".drawer-overlay\") overlay: HTMLElement;\n\n /**\n * Indicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can\n * use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * The drawer's label as displayed in the header. You should always include a relevant label even when using\n * `noHeader`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.\n */\n @property({ type: String, reflect: true }) label = \"\";\n\n /** The direction from which the drawer will open. */\n @property({ type: String, reflect: true }) placement: \"top\" | \"end\" | \"bottom\" | \"start\" = \"end\";\n\n /**\n * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\n * its parent element, set this attribute and add `position: relative` to the parent.\n */\n @property({ type: Boolean, reflect: true }) contained = false;\n\n /**\n * Removes the header. This will also remove the default close button, so please ensure you provide an easy,\n * accessible way for users to dismiss the drawer.\n */\n @property({ type: Boolean, reflect: true }) noHeader = false;\n\n firstUpdated() {\n this.drawer.hidden = !this.open;\n\n if (this.open) {\n this.addOpenListeners();\n\n if (!this.contained) {\n lockBodyScrolling(this);\n }\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n unlockBodyScrolling(this);\n }\n\n private uppercaseFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n\n private requestClose(source: \"close-button\" | \"keyboard\" | \"overlay\") {\n const slRequestClose = this.emit(\"sgds-request-close\", {\n cancelable: true,\n detail: { source }\n });\n\n if (slRequestClose.defaultPrevented) {\n const animation = getAnimation(this, \"drawer.denyClose\");\n animateTo(this.panel, animation.keyframes, animation.options);\n return;\n }\n\n this.hide();\n }\n\n private addOpenListeners() {\n document.addEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n private removeOpenListeners() {\n document.removeEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n private handleDocumentKeyDown = (event: KeyboardEvent) => {\n if (this.open && !this.contained && event.key === \"Escape\") {\n event.stopPropagation();\n this.requestClose(\"keyboard\");\n }\n };\n\n @watch(\"open\", { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n // Show\n this.emit(\"sgds-show\");\n this.addOpenListeners();\n this.originalTrigger = document.activeElement as HTMLElement;\n\n // Lock body scrolling only if the drawer isn't contained\n if (!this.contained) {\n lockBodyScrolling(this);\n }\n\n // When the drawer is shown, Safari will attempt to set focus on whatever element has autofocus. This causes the\n // drawer's animation to jitter, so we'll temporarily remove the attribute, call `focus({ preventScroll: true })`\n // ourselves, and add the attribute back afterwards.\n //\n // Related: https://github.com/shoelace-style/shoelace/issues/693\n //\n const autoFocusTarget = this.querySelector(\"[autofocus]\");\n if (autoFocusTarget) {\n autoFocusTarget.removeAttribute(\"autofocus\");\n }\n\n await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);\n this.drawer.hidden = false;\n\n // Set initial focus\n requestAnimationFrame(() => {\n const slInitialFocus = this.emit(\"sgds-initial-focus\", { cancelable: true });\n\n if (!slInitialFocus.defaultPrevented) {\n // Set focus to the autofocus target and restore the attribute\n if (autoFocusTarget) {\n (autoFocusTarget as HTMLInputElement).focus({ preventScroll: true });\n } else {\n this.panel.focus({ preventScroll: true });\n }\n }\n\n // Restore the autofocus attribute\n if (autoFocusTarget) {\n autoFocusTarget.setAttribute(\"autofocus\", \"\");\n }\n });\n\n const panelAnimation = getAnimation(this, `drawer.show${this.uppercaseFirstLetter(this.placement)}`);\n const overlayAnimation = getAnimation(this, \"drawer.overlay.show\");\n await Promise.all([\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)\n ]);\n\n this.emit(\"sgds-after-show\");\n } else {\n // Hide\n this.emit(\"sgds-hide\");\n this.removeOpenListeners();\n\n if (!this.contained) {\n unlockBodyScrolling(this);\n }\n\n await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);\n const panelAnimation = getAnimation(this, `drawer.hide${this.uppercaseFirstLetter(this.placement)}`);\n const overlayAnimation = getAnimation(this, \"drawer.overlay.hide\");\n\n // Animate the overlay and the panel at the same time. Because animation durations might be different, we need to\n // hide each one individually when the animation finishes, otherwise the first one that finishes will reappear\n // unexpectedly. We'll unhide them after all animations have completed.\n await Promise.all([\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {\n this.overlay.hidden = true;\n }),\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {\n this.panel.hidden = true;\n })\n ]);\n\n this.drawer.hidden = true;\n\n // Now that the dialog is hidden, restore the overlay and panel for next time\n this.overlay.hidden = false;\n this.panel.hidden = false;\n\n // Restore focus to the original trigger\n const trigger = this.originalTrigger;\n if (typeof trigger?.focus === \"function\") {\n setTimeout(() => trigger.focus());\n }\n\n this.emit(\"sgds-after-hide\");\n }\n }\n\n @watch(\"contained\", { waitUntilFirstUpdate: true })\n handleNoModalChange() {\n if (this.open && !this.contained) {\n lockBodyScrolling(this);\n }\n\n if (this.open && this.contained) {\n unlockBodyScrolling(this);\n }\n }\n\n /** Shows the drawer. */\n public async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, \"sgds-after-show\");\n }\n\n /** Hides the drawer */\n public async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, \"sgds-after-hide\");\n }\n\n render() {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n drawer: true,\n \"drawer-open\": this.open,\n \"drawer-top\": this.placement === \"top\",\n \"drawer-end\": this.placement === \"end\",\n \"drawer-bottom\": this.placement === \"bottom\",\n \"drawer-start\": this.placement === \"start\",\n \"drawer-contained\": this.contained,\n \"drawer-fixed\": !this.contained,\n \"drawer-has-footer\": this.hasSlotController.test(\"footer\")\n })}\n >\n <div part=\"overlay\" class=\"drawer-overlay\" @click=${() => this.requestClose(\"overlay\")} tabindex=\"-1\"></div>\n\n <div\n part=\"panel\"\n class=\"drawer-panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden=${this.open ? \"false\" : \"true\"}\n aria-label=${ifDefined(this.noHeader ? this.label : undefined)}\n aria-labelledby=${ifDefined(!this.noHeader ? \"title\" : undefined)}\n tabindex=\"0\"\n >\n ${!this.noHeader\n ? html`\n <header part=\"header\" class=\"drawer-header\">\n <h2 part=\"title\" class=\"drawer-title\" id=\"title\">\n <!-- If there's no label, use an invisible character to prevent the header from collapsing -->\n <slot name=\"label\"> ${this.label.length > 0 ? this.label : String.fromCharCode(65279)} </slot>\n </h2>\n <div part=\"header-actions\" class=\"drawer-header-actions\">\n <slot name=\"header-actions\"></slot>\n <sgds-close-button\n part=\"close-button\"\n class=\"drawer-close\"\n aria-label=\"close drawer\"\n @click=\"${() => this.requestClose(\"close-button\")}\"\n ></sgds-close-button>\n </div>\n </header>\n `\n : nothing}\n\n <slot part=\"body\" class=\"drawer-body\"></slot>\n\n <footer part=\"footer\" class=\"drawer-footer\">\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n </div>\n `;\n }\n}\n\n// Top\nsetDefaultAnimation(\"drawer.showTop\", {\n keyframes: [\n { opacity: 0, translate: \"0 -100%\" },\n { opacity: 1, translate: \"0 0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideTop\", {\n keyframes: [\n { opacity: 1, translate: \"0 0\" },\n { opacity: 0, translate: \"0 -100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// End\nsetDefaultAnimation(\"drawer.showEnd\", {\n keyframes: [\n { opacity: 0, translate: \"100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n rtlKeyframes: [\n { opacity: 0, translate: \"-100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideEnd\", {\n keyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"100%\" }\n ],\n rtlKeyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"-100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Bottom\nsetDefaultAnimation(\"drawer.showBottom\", {\n keyframes: [\n { opacity: 0, translate: \"0 100%\" },\n { opacity: 1, translate: \"0 0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideBottom\", {\n keyframes: [\n { opacity: 1, translate: \"0 0\" },\n { opacity: 0, translate: \"0 100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Start\nsetDefaultAnimation(\"drawer.showStart\", {\n keyframes: [\n { opacity: 0, translate: \"-100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n rtlKeyframes: [\n { opacity: 0, translate: \"100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideStart\", {\n keyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"-100%\" }\n ],\n rtlKeyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Deny close\nsetDefaultAnimation(\"drawer.denyClose\", {\n keyframes: [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }],\n options: { duration: 250 }\n});\n\n// Overlay\nsetDefaultAnimation(\"drawer.overlay.show\", {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 250 }\n});\n\nsetDefaultAnimation(\"drawer.overlay.hide\", {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 250 }\n});\n\nexport default SgdsDrawer;\n"],"names":["ScopedElementsMixin","SgdsElement","HasSlotController","SgdsCloseButton","lockBodyScrolling","unlockBodyScrolling","getAnimation","animateTo","stopAnimations","waitForEvent","html","classMap","ifDefined","nothing","drawerStyles","__decorate","query","property","watch","setDefaultAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCG;MACU,UAAW,SAAQA,kCAAmB,CAACC,sBAAW,CAAC,CAAA;AAAhE,IAAA,WAAA,GAAA;;;QASmB,IAAiB,CAAA,iBAAA,GAAG,IAAIC,sBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAU3E;;;AAGG;QACyC,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;AAEzD;;;AAGG;QACwC,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAGX,IAAS,CAAA,SAAA,GAAuC,KAAK,CAAC;AAEjG;;;AAGG;QACyC,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;AAE9D;;;AAGG;QACyC,IAAQ,CAAA,QA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AAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-drawer.js","sources":["../../../src/components/Drawer/sgds-drawer.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { animateTo, stopAnimations } from \"../../utils/animate.js\";\nimport { getAnimation, setDefaultAnimation } from \"../../utils/animation-registry.js\";\nimport { waitForEvent } from \"../../utils/event.js\";\nimport { lockBodyScrolling, unlockBodyScrolling } from \"../../utils/scroll.js\";\nimport { HasSlotController } from \"../../utils/slot.js\";\nimport { watch } from \"../../utils/watch.js\";\nimport drawerStyles from \"./drawer.css\";\nimport SgdsCloseButton from \"../../internals/CloseButton/sgds-close-button\";\nimport { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\n\n/**\n * @summary Drawers slide in from a container to expose additional options and information.\n *\n * @slot - The drawer's main content.\n * @slot label - The drawer's label. Alternatively, you can use the `label` attribute.\n * @slot header-actions - Optional actions to add to the header.\n * @slot footer - The drawer's footer, usually one or more buttons representing various options.\n *\n * @event sgds-show - Emitted when the drawer opens.\n * @event sgds-after-show - Emitted after the drawer opens and all animations are complete.\n * @event sgds-hide - Emitted when the drawer closes.\n * @event sgds-after-hide - Emitted after the drawer closes and all animations are complete.\n * @event sgds-initial-focus - Emitted when the drawer opens and is ready to receive focus. Calling\n * `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.\n * @event {{ source: 'close-button' | 'keyboard' | 'overlay' }} sgds-request-close - Emitted when the user attempts to\n * close the drawer by clicking the close button, clicking the overlay, or pressing escape. Calling\n * `event.preventDefault()` will keep the drawer open. Avoid using this unless closing the drawer will result in\n * destructive behavior such as data loss.\n *\n * @csspart base - The component's base wrapper.\n * @csspart overlay - The overlay that covers the screen behind the drawer.\n * @csspart panel - The drawer's panel (where the drawer and its content are rendered).\n * @csspart header - The drawer's header. This element wraps the title and header actions.\n * @csspart header-actions - Optional actions to add to the header.\n * @csspart title - The drawer's title.\n * @csspart close-button - The close button.\n * @csspart body - The drawer's body.\n * @csspart footer - The drawer's footer.\n *\n * @cssproperty --drawer-size - The preferred size of the drawer. This will be applied to the drawer's width or height\n * depending on its `placement`. Note that the drawer will shrink to accommodate smaller screens.\n * @cssproperty --drawer-padding - The amount of padding to use for the header, body and footer\n * @cssproperty --drawer-bg - The drawer's background color.\n * @cssproperty --drawer-button-gap - The drawer's flex gap between buttons.\n *\n */\nexport class SgdsDrawer extends ScopedElementsMixin(SgdsElement) {\n static styles = [...SgdsElement.styles, drawerStyles];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-close-button\": SgdsCloseButton\n };\n }\n /** @internal */\n private readonly hasSlotController = new HasSlotController(this, \"footer\");\n /** @internal */\n private originalTrigger: HTMLElement | null;\n /** @internal */\n @query(\".drawer\") drawer: HTMLElement;\n /** @internal */\n @query(\".drawer-panel\") panel: HTMLElement;\n /** @internal */\n @query(\".drawer-overlay\") overlay: HTMLElement;\n\n /**\n * Indicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can\n * use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * The drawer's label as displayed in the header. You should always include a relevant label even when using\n * `noHeader`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.\n */\n @property({ type: String, reflect: true }) label = \"\";\n\n /** The direction from which the drawer will open. */\n @property({ type: String, reflect: true }) placement: \"top\" | \"end\" | \"bottom\" | \"start\" = \"end\";\n\n /**\n * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\n * its parent element, set this attribute and add `position: relative` to the parent.\n */\n @property({ type: Boolean, reflect: true }) contained = false;\n\n /**\n * Removes the header. This will also remove the default close button, so please ensure you provide an easy,\n * accessible way for users to dismiss the drawer.\n */\n @property({ type: Boolean, reflect: true }) noHeader = false;\n\n firstUpdated() {\n this.drawer.hidden = !this.open;\n\n if (this.open) {\n this.addOpenListeners();\n\n if (!this.contained) {\n lockBodyScrolling(this);\n }\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n unlockBodyScrolling(this);\n }\n\n private uppercaseFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n\n private requestClose(source: \"close-button\" | \"keyboard\" | \"overlay\") {\n const slRequestClose = this.emit(\"sgds-request-close\", {\n cancelable: true,\n detail: { source }\n });\n\n if (slRequestClose.defaultPrevented) {\n const animation = getAnimation(this, \"drawer.denyClose\");\n animateTo(this.panel, animation.keyframes, animation.options);\n return;\n }\n\n this.hide();\n }\n\n private addOpenListeners() {\n document.addEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n private removeOpenListeners() {\n document.removeEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n private handleDocumentKeyDown = (event: KeyboardEvent) => {\n if (this.open && !this.contained && event.key === \"Escape\") {\n event.stopPropagation();\n this.requestClose(\"keyboard\");\n }\n };\n\n @watch(\"open\", { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n // Show\n this.emit(\"sgds-show\");\n this.addOpenListeners();\n this.originalTrigger = document.activeElement as HTMLElement;\n\n // Lock body scrolling only if the drawer isn't contained\n if (!this.contained) {\n lockBodyScrolling(this);\n }\n\n // When the drawer is shown, Safari will attempt to set focus on whatever element has autofocus. This causes the\n // drawer's animation to jitter, so we'll temporarily remove the attribute, call `focus({ preventScroll: true })`\n // ourselves, and add the attribute back afterwards.\n //\n // Related: https://github.com/shoelace-style/shoelace/issues/693\n //\n const autoFocusTarget = this.querySelector(\"[autofocus]\");\n if (autoFocusTarget) {\n autoFocusTarget.removeAttribute(\"autofocus\");\n }\n\n await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);\n this.drawer.hidden = false;\n\n // Set initial focus\n requestAnimationFrame(() => {\n const slInitialFocus = this.emit(\"sgds-initial-focus\", { cancelable: true });\n\n if (!slInitialFocus.defaultPrevented) {\n // Set focus to the autofocus target and restore the attribute\n if (autoFocusTarget) {\n (autoFocusTarget as HTMLInputElement).focus({ preventScroll: true });\n } else {\n this.panel.focus({ preventScroll: true });\n }\n }\n\n // Restore the autofocus attribute\n if (autoFocusTarget) {\n autoFocusTarget.setAttribute(\"autofocus\", \"\");\n }\n });\n\n const panelAnimation = getAnimation(this, `drawer.show${this.uppercaseFirstLetter(this.placement)}`);\n const overlayAnimation = getAnimation(this, \"drawer.overlay.show\");\n await Promise.all([\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)\n ]);\n\n this.emit(\"sgds-after-show\");\n } else {\n // Hide\n this.emit(\"sgds-hide\");\n this.removeOpenListeners();\n\n if (!this.contained) {\n unlockBodyScrolling(this);\n }\n\n await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);\n const panelAnimation = getAnimation(this, `drawer.hide${this.uppercaseFirstLetter(this.placement)}`);\n const overlayAnimation = getAnimation(this, \"drawer.overlay.hide\");\n\n // Animate the overlay and the panel at the same time. Because animation durations might be different, we need to\n // hide each one individually when the animation finishes, otherwise the first one that finishes will reappear\n // unexpectedly. We'll unhide them after all animations have completed.\n await Promise.all([\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {\n this.overlay.hidden = true;\n }),\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {\n this.panel.hidden = true;\n })\n ]);\n\n this.drawer.hidden = true;\n\n // Now that the dialog is hidden, restore the overlay and panel for next time\n this.overlay.hidden = false;\n this.panel.hidden = false;\n\n // Restore focus to the original trigger\n const trigger = this.originalTrigger;\n if (typeof trigger?.focus === \"function\") {\n setTimeout(() => trigger.focus());\n }\n\n this.emit(\"sgds-after-hide\");\n }\n }\n\n @watch(\"contained\", { waitUntilFirstUpdate: true })\n handleNoModalChange() {\n if (this.open && !this.contained) {\n lockBodyScrolling(this);\n }\n\n if (this.open && this.contained) {\n unlockBodyScrolling(this);\n }\n }\n\n /** Shows the drawer. */\n public async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, \"sgds-after-show\");\n }\n\n /** Hides the drawer */\n public async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, \"sgds-after-hide\");\n }\n\n render() {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n drawer: true,\n \"drawer-open\": this.open,\n \"drawer-top\": this.placement === \"top\",\n \"drawer-end\": this.placement === \"end\",\n \"drawer-bottom\": this.placement === \"bottom\",\n \"drawer-start\": this.placement === \"start\",\n \"drawer-contained\": this.contained,\n \"drawer-fixed\": !this.contained,\n \"drawer-has-footer\": this.hasSlotController.test(\"footer\")\n })}\n >\n <div part=\"overlay\" class=\"drawer-overlay\" @click=${() => this.requestClose(\"overlay\")} tabindex=\"-1\"></div>\n\n <div\n part=\"panel\"\n class=\"drawer-panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden=${this.open ? \"false\" : \"true\"}\n aria-label=${ifDefined(this.noHeader ? this.label : undefined)}\n aria-labelledby=${ifDefined(!this.noHeader ? \"title\" : undefined)}\n tabindex=\"0\"\n >\n ${!this.noHeader\n ? html`\n <header part=\"header\" class=\"drawer-header\">\n <h2 part=\"title\" class=\"drawer-title\" id=\"title\">\n <!-- If there's no label, use an invisible character to prevent the header from collapsing -->\n <slot name=\"label\"> ${this.label.length > 0 ? this.label : String.fromCharCode(65279)} </slot>\n </h2>\n <div part=\"header-actions\" class=\"drawer-header-actions\">\n <slot name=\"header-actions\"></slot>\n <sgds-close-button\n part=\"close-button\"\n class=\"drawer-close\"\n aria-label=\"close drawer\"\n @click=\"${() => this.requestClose(\"close-button\")}\"\n ></sgds-close-button>\n </div>\n </header>\n `\n : nothing}\n\n <slot part=\"body\" class=\"drawer-body\"></slot>\n\n <footer part=\"footer\" class=\"drawer-footer\">\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n </div>\n `;\n }\n}\n\n// Top\nsetDefaultAnimation(\"drawer.showTop\", {\n keyframes: [\n { opacity: 0, translate: \"0 -100%\" },\n { opacity: 1, translate: \"0 0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideTop\", {\n keyframes: [\n { opacity: 1, translate: \"0 0\" },\n { opacity: 0, translate: \"0 -100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// End\nsetDefaultAnimation(\"drawer.showEnd\", {\n keyframes: [\n { opacity: 0, translate: \"100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n rtlKeyframes: [\n { opacity: 0, translate: \"-100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideEnd\", {\n keyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"100%\" }\n ],\n rtlKeyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"-100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Bottom\nsetDefaultAnimation(\"drawer.showBottom\", {\n keyframes: [\n { opacity: 0, translate: \"0 100%\" },\n { opacity: 1, translate: \"0 0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideBottom\", {\n keyframes: [\n { opacity: 1, translate: \"0 0\" },\n { opacity: 0, translate: \"0 100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Start\nsetDefaultAnimation(\"drawer.showStart\", {\n keyframes: [\n { opacity: 0, translate: \"-100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n rtlKeyframes: [\n { opacity: 0, translate: \"100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideStart\", {\n keyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"-100%\" }\n ],\n rtlKeyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Deny close\nsetDefaultAnimation(\"drawer.denyClose\", {\n keyframes: [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }],\n options: { duration: 250 }\n});\n\n// Overlay\nsetDefaultAnimation(\"drawer.overlay.show\", {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 250 }\n});\n\nsetDefaultAnimation(\"drawer.overlay.hide\", {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 250 }\n});\n\nexport default SgdsDrawer;\n"],"names":["drawerStyles"],"mappings":";;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCG;MACU,UAAW,SAAQ,mBAAmB,CAAC,WAAW,CAAC,CAAA;AAAhE,IAAA,WAAA,GAAA;;;QASmB,IAAiB,CAAA,iBAAA,GAAG,IAAI,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAU3E;;;AAGG;QACyC,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;AAEzD;;;AAGG;QACwC,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAGX,IAAS,CAAA,SAAA,GAAuC,KAAK,CAAC;AAEjG;;;AAGG;QACyC,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;AAE9D;;;AAGG;QACyC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AA8CrD,QAAA,IAAA,CAAA,qBAAqB,GAAG,CAAC,KAAoB,KAAI;AACvD,YAAA,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC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EAAE,SAAS,EAAE,GAAG,EAAE;AAC9B,QAAA,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE;AACnC,KAAA;AACD,IAAA,YAAY,EAAE;AACZ,QAAA,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;AAC9B,QAAA,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE;AAClC,KAAA;IACD,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;AAC3C,CAAA,CAAC,CAAC;AAEH;AACA,mBAAmB,CAAC,kBAAkB,EAAE;AACtC,IAAA,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AACxD,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC,CAAC;AAEH;AACA,mBAAmB,CAAC,qBAAqB,EAAE;AACzC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC,CAAC;AAEH,mBAAmB,CAAC,qBAAqB,EAAE;AACzC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"sgds-drawer.js","sources":["../../../src/components/Drawer/sgds-drawer.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { animateTo, stopAnimations } from \"../../utils/animate.js\";\nimport { getAnimation, setDefaultAnimation } from \"../../utils/animation-registry.js\";\nimport { waitForEvent } from \"../../utils/event.js\";\nimport { lockBodyScrolling, unlockBodyScrolling } from \"../../utils/scroll.js\";\nimport { HasSlotController } from \"../../utils/slot.js\";\nimport { watch } from \"../../utils/watch.js\";\nimport drawerStyles from \"./drawer.css\";\nimport SgdsCloseButton from \"../../internals/CloseButton/sgds-close-button\";\nimport { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\n\n/**\n * @summary Drawers slide in from a container to expose additional options and information.\n *\n * @slot - The drawer's main content.\n * @slot label - The drawer's label. Alternatively, you can use the `label` attribute.\n * @slot header-actions - Optional actions to add to the header.\n * @slot footer - The drawer's footer, usually one or more buttons representing various options.\n *\n * @event sgds-show - Emitted when the drawer opens.\n * @event sgds-after-show - Emitted after the drawer opens and all animations are complete.\n * @event sgds-hide - Emitted when the drawer closes.\n * @event sgds-after-hide - Emitted after the drawer closes and all animations are complete.\n * @event sgds-initial-focus - Emitted when the drawer opens and is ready to receive focus. Calling\n * `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.\n * @event {{ source: 'close-button' | 'keyboard' | 'overlay' }} sgds-request-close - Emitted when the user attempts to\n * close the drawer by clicking the close button, clicking the overlay, or pressing escape. Calling\n * `event.preventDefault()` will keep the drawer open. Avoid using this unless closing the drawer will result in\n * destructive behavior such as data loss.\n *\n * @csspart base - The component's base wrapper.\n * @csspart overlay - The overlay that covers the screen behind the drawer.\n * @csspart panel - The drawer's panel (where the drawer and its content are rendered).\n * @csspart header - The drawer's header. This element wraps the title and header actions.\n * @csspart header-actions - Optional actions to add to the header.\n * @csspart title - The drawer's title.\n * @csspart close-button - The close button.\n * @csspart body - The drawer's body.\n * @csspart footer - The drawer's footer.\n *\n * @cssproperty --drawer-size - The preferred size of the drawer. This will be applied to the drawer's width or height\n * depending on its `placement`. Note that the drawer will shrink to accommodate smaller screens.\n * @cssproperty --drawer-padding - The amount of padding to use for the header, body and footer\n * @cssproperty --drawer-bg - The drawer's background color.\n * @cssproperty --drawer-button-gap - The drawer's flex gap between buttons.\n *\n */\nexport class SgdsDrawer extends ScopedElementsMixin(SgdsElement) {\n static styles = [...SgdsElement.styles, drawerStyles];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-close-button\": SgdsCloseButton\n };\n }\n /** @internal */\n private readonly hasSlotController = new HasSlotController(this, \"footer\");\n /** @internal */\n private originalTrigger: HTMLElement | null;\n /** @internal */\n @query(\".drawer\") drawer: HTMLElement;\n /** @internal */\n @query(\".drawer-panel\") panel: HTMLElement;\n /** @internal */\n @query(\".drawer-overlay\") overlay: HTMLElement;\n\n /**\n * Indicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can\n * use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * The drawer's label as displayed in the header. You should always include a relevant label even when using\n * `noHeader`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.\n */\n @property({ type: String, reflect: true }) label = \"\";\n\n /** The direction from which the drawer will open. */\n @property({ type: String, reflect: true }) placement: \"top\" | \"end\" | \"bottom\" | \"start\" = \"end\";\n\n /**\n * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\n * its parent element, set this attribute and add `position: relative` to the parent.\n */\n @property({ type: Boolean, reflect: true }) contained = false;\n\n /**\n * Removes the header. This will also remove the default close button, so please ensure you provide an easy,\n * accessible way for users to dismiss the drawer.\n */\n @property({ type: Boolean, reflect: true }) noHeader = false;\n\n firstUpdated() {\n this.drawer.hidden = !this.open;\n\n if (this.open) {\n this.addOpenListeners();\n\n if (!this.contained) {\n lockBodyScrolling(this);\n }\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n unlockBodyScrolling(this);\n }\n\n private uppercaseFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n\n private requestClose(source: \"close-button\" | \"keyboard\" | \"overlay\") {\n const slRequestClose = this.emit(\"sgds-request-close\", {\n cancelable: true,\n detail: { source }\n });\n\n if (slRequestClose.defaultPrevented) {\n const animation = getAnimation(this, \"drawer.denyClose\");\n animateTo(this.panel, animation.keyframes, animation.options);\n return;\n }\n\n this.hide();\n }\n\n private addOpenListeners() {\n document.addEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n private removeOpenListeners() {\n document.removeEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n private handleDocumentKeyDown = (event: KeyboardEvent) => {\n if (this.open && !this.contained && event.key === \"Escape\") {\n event.stopPropagation();\n this.requestClose(\"keyboard\");\n }\n };\n\n @watch(\"open\", { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n // Show\n this.emit(\"sgds-show\");\n this.addOpenListeners();\n this.originalTrigger = document.activeElement as HTMLElement;\n\n // Lock body scrolling only if the drawer isn't contained\n if (!this.contained) {\n lockBodyScrolling(this);\n }\n\n // When the drawer is shown, Safari will attempt to set focus on whatever element has autofocus. This causes the\n // drawer's animation to jitter, so we'll temporarily remove the attribute, call `focus({ preventScroll: true })`\n // ourselves, and add the attribute back afterwards.\n //\n // Related: https://github.com/shoelace-style/shoelace/issues/693\n //\n const autoFocusTarget = this.querySelector(\"[autofocus]\");\n if (autoFocusTarget) {\n autoFocusTarget.removeAttribute(\"autofocus\");\n }\n\n await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);\n this.drawer.hidden = false;\n\n // Set initial focus\n requestAnimationFrame(() => {\n const slInitialFocus = this.emit(\"sgds-initial-focus\", { cancelable: true });\n\n if (!slInitialFocus.defaultPrevented) {\n // Set focus to the autofocus target and restore the attribute\n if (autoFocusTarget) {\n (autoFocusTarget as HTMLInputElement).focus({ preventScroll: true });\n } else {\n this.panel.focus({ preventScroll: true });\n }\n }\n\n // Restore the autofocus attribute\n if (autoFocusTarget) {\n autoFocusTarget.setAttribute(\"autofocus\", \"\");\n }\n });\n\n const panelAnimation = getAnimation(this, `drawer.show${this.uppercaseFirstLetter(this.placement)}`);\n const overlayAnimation = getAnimation(this, \"drawer.overlay.show\");\n await Promise.all([\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)\n ]);\n\n this.emit(\"sgds-after-show\");\n } else {\n // Hide\n this.emit(\"sgds-hide\");\n this.removeOpenListeners();\n\n if (!this.contained) {\n unlockBodyScrolling(this);\n }\n\n await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);\n const panelAnimation = getAnimation(this, `drawer.hide${this.uppercaseFirstLetter(this.placement)}`);\n const overlayAnimation = getAnimation(this, \"drawer.overlay.hide\");\n\n // Animate the overlay and the panel at the same time. Because animation durations might be different, we need to\n // hide each one individually when the animation finishes, otherwise the first one that finishes will reappear\n // unexpectedly. We'll unhide them after all animations have completed.\n await Promise.all([\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {\n this.overlay.hidden = true;\n }),\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {\n this.panel.hidden = true;\n })\n ]);\n\n this.drawer.hidden = true;\n\n // Now that the dialog is hidden, restore the overlay and panel for next time\n this.overlay.hidden = false;\n this.panel.hidden = false;\n\n // Restore focus to the original trigger\n const trigger = this.originalTrigger;\n if (typeof trigger?.focus === \"function\") {\n setTimeout(() => trigger.focus());\n }\n\n this.emit(\"sgds-after-hide\");\n }\n }\n\n @watch(\"contained\", { waitUntilFirstUpdate: true })\n handleNoModalChange() {\n if (this.open && !this.contained) {\n lockBodyScrolling(this);\n }\n\n if (this.open && this.contained) {\n unlockBodyScrolling(this);\n }\n }\n\n /** Shows the drawer. */\n public async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, \"sgds-after-show\");\n }\n\n /** Hides the drawer */\n public async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, \"sgds-after-hide\");\n }\n\n render() {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n drawer: true,\n \"drawer-open\": this.open,\n \"drawer-top\": this.placement === \"top\",\n \"drawer-end\": this.placement === \"end\",\n \"drawer-bottom\": this.placement === \"bottom\",\n \"drawer-start\": this.placement === \"start\",\n \"drawer-contained\": this.contained,\n \"drawer-fixed\": !this.contained,\n \"drawer-has-footer\": this.hasSlotController.test(\"footer\")\n })}\n >\n <div part=\"overlay\" class=\"drawer-overlay\" @click=${() => this.requestClose(\"overlay\")} tabindex=\"-1\"></div>\n\n <div\n part=\"panel\"\n class=\"drawer-panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden=${this.open ? \"false\" : \"true\"}\n aria-label=${ifDefined(this.noHeader ? this.label : undefined)}\n aria-labelledby=${ifDefined(!this.noHeader ? \"title\" : undefined)}\n tabindex=\"0\"\n >\n ${!this.noHeader\n ? html`\n <header part=\"header\" class=\"drawer-header\">\n <h2 part=\"title\" class=\"drawer-title\" id=\"title\">\n <!-- If there's no label, use an invisible character to prevent the header from collapsing -->\n <slot name=\"label\"> ${this.label.length > 0 ? this.label : String.fromCharCode(65279)} </slot>\n </h2>\n <div part=\"header-actions\" class=\"drawer-header-actions\">\n <slot name=\"header-actions\"></slot>\n <sgds-close-button\n part=\"close-button\"\n class=\"drawer-close\"\n aria-label=\"close drawer\"\n @click=\"${() => this.requestClose(\"close-button\")}\"\n ></sgds-close-button>\n </div>\n </header>\n `\n : nothing}\n\n <slot part=\"body\" class=\"drawer-body\"></slot>\n\n <footer part=\"footer\" class=\"drawer-footer\">\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n </div>\n `;\n }\n}\n\n// Top\nsetDefaultAnimation(\"drawer.showTop\", {\n keyframes: [\n { opacity: 0, translate: \"0 -100%\" },\n { opacity: 1, translate: \"0 0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideTop\", {\n keyframes: [\n { opacity: 1, translate: \"0 0\" },\n { opacity: 0, translate: \"0 -100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// End\nsetDefaultAnimation(\"drawer.showEnd\", {\n keyframes: [\n { opacity: 0, translate: \"100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n rtlKeyframes: [\n { opacity: 0, translate: \"-100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideEnd\", {\n keyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"100%\" }\n ],\n rtlKeyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"-100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Bottom\nsetDefaultAnimation(\"drawer.showBottom\", {\n keyframes: [\n { opacity: 0, translate: \"0 100%\" },\n { opacity: 1, translate: \"0 0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideBottom\", {\n keyframes: [\n { opacity: 1, translate: \"0 0\" },\n { opacity: 0, translate: \"0 100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Start\nsetDefaultAnimation(\"drawer.showStart\", {\n keyframes: [\n { opacity: 0, translate: \"-100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n rtlKeyframes: [\n { opacity: 0, translate: \"100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideStart\", {\n keyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"-100%\" }\n ],\n rtlKeyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Deny close\nsetDefaultAnimation(\"drawer.denyClose\", {\n keyframes: [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }],\n options: { duration: 250 }\n});\n\n// Overlay\nsetDefaultAnimation(\"drawer.overlay.show\", {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 250 }\n});\n\nsetDefaultAnimation(\"drawer.overlay.hide\", {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 250 }\n});\n\nexport default SgdsDrawer;\n"],"names":["drawerStyles"],"mappings":";;;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCG;MACU,UAAW,SAAQ,mBAAmB,CAAC,WAAW,CAAC,CAAA;AAAhE,IAAA,WAAA,GAAA;;;QASmB,IAAiB,CAAA,iBAAA,GAAG,IAAI,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAU3E;;;AAGG;QACyC,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;AAEzD;;;AAGG;QACwC,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAGX,IAAS,CAAA,SAAA,GAAuC,KAAK,CAAC;AAEjG;;;AAGG;QACyC,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;AAE9D;;;AAGG;QACyC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AA8CrD,QAAA,IAAA,CAAA,qBAAqB,GAAG,CAAC,KAAoB,KAAI;AACvD,YAAA,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE;gBAC1D,KAAK,CAAC,eAAe,EAAE,CAAC;AACxB,gBAAA,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;aAC/B;AACH,SAAC,CAAC;KAyLH;;AArRC,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,mBAAmB,EAAE,eAAe;SACrC,CAAC;KACH;IAuCD,YAAY,GAAA;QACV,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CA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,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;AAC3C,CAAA,CAAC,CAAC;AAEH;AACA,mBAAmB,CAAC,kBAAkB,EAAE;AACtC,IAAA,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AACxD,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC,CAAC;AAEH;AACA,mBAAmB,CAAC,qBAAqB,EAAE;AACzC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC,CAAC;AAEH,mBAAmB,CAAC,qBAAqB,EAAE;AACzC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdown.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { css } from 'lit';
|
|
2
3
|
|
|
3
4
|
var css_248z = css`.input-group.has-validation>.dropdown-toggle:nth-last-child(n+4),.input-group.has-validation>:nth-last-child(n+3):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),.input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),.input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating){border-bottom-right-radius:0;border-top-right-radius:0}.input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}.dropdown,.dropdown-center{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle:after{border-bottom:0;border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.3em solid;content:"";display:inline-block;margin-left:.255em;vertical-align:.255em}.dropdown-toggle:empty:after{margin-left:0}.dropdown-menu{--sgds-dropdown-z-index:1000;--sgds-dropdown-min-width:10rem;--sgds-dropdown-padding-x:0;--sgds-dropdown-padding-y:0.5rem;--sgds-dropdown-font-size:1rem;--sgds-dropdown-bg:var(--sgds-body-bg);--sgds-dropdown-color:var(--sgds-body-color);--sgds-dropdown-border-color:var(--sgds-border-color-translucent);--sgds-dropdown-border-radius:var(--sgds-border-radius);--sgds-dropdown-border-width:var(--sgds-border-width);background-clip:padding-box;background-color:var(--sgds-dropdown-bg);border:var(--sgds-dropdown-border-width) solid var(--sgds-dropdown-border-color);border-radius:var(--sgds-dropdown-border-radius);color:var(--sgds-dropdown-color);display:none;font-size:var(--sgds-dropdown-font-size);list-style:none;margin:0;min-width:var(--sgds-dropdown-min-width);padding:var(--sgds-dropdown-padding-y) var(--sgds-dropdown-padding-x);position:absolute;text-align:left;z-index:var(--sgds-dropdown-z-index)}.dropdown-divider{--sgds-dropdown-divider-bg:var(--sgds-border-color-translucent);--sgds-dropdown-divider-margin-y:0.5rem;border-top:1px solid var(--sgds-dropdown-divider-bg);height:0;margin:var(--sgds-dropdown-divider-margin-y) 0;opacity:1;overflow:hidden}.dropdown-item{--sgds-dropdown-item-color:var(--sgds-body-color);--sgds-dropdown-item-hover-color:var(--sgds-body-color);--sgds-dropdown-item-hover-bg:var(--sgds-gray-200);--sgds-dropdown-item-active-color:#fff;--sgds-dropdown-item-active-bg:var(--sgds-info);--sgds-dropdown-item-disabled-color:var(--sgds-gray-500);--sgds-dropdown-item-padding-x:1rem;--sgds-dropdown-item-padding-y:0.25rem;background-color:transparent;border:0;border-radius:var(--sgds-dropdown-item-border-radius,0);clear:both;color:var(--sgds-dropdown-item-color);display:block;font-weight:400;padding:var(--sgds-dropdown-item-padding-y) var(--sgds-dropdown-item-padding-x);text-align:inherit;text-decoration:none;white-space:nowrap}.dropdown-item:focus,.dropdown-item:hover{background-color:var(--sgds-dropdown-item-hover-bg);color:var(--sgds-dropdown-item-hover-color)}.dropdown-item.active,.dropdown-item:active{background-color:var(--sgds-dropdown-item-active-bg);color:var(--sgds-dropdown-item-active-color);text-decoration:none}.dropdown-item.disabled,.dropdown-item:disabled{background-color:transparent;color:var(--sgds-dropdown-item-disabled-color);pointer-events:none}.dropdown-menu.show{display:block}.dropdown-header{--sgds-dropdown-header-color:#5d5d5d;--sgds-dropdown-header-padding-x:1rem;--sgds-dropdown-header-padding-y:0.5rem;color:var(--sgds-dropdown-header-color);display:block;font-size:.875rem;margin-bottom:0;padding:var(--sgds-dropdown-header-padding-y) var(--sgds-dropdown-header-padding-x);white-space:nowrap}.sgds.dropdown .dropdown-toggle{align-items:center;gap:.5rem;justify-content:space-between}.sgds.dropdown .dropdown-toggle:after{content:none}.sgds.dropdown-menu{border:1px solid #909090;padding:0}.sgds.dropdown-menu li a.dropdown-item{padding:1rem}.sgds.dropdown-menu li a.dropdown-item.active,.sgds.dropdown-menu li a.dropdown-item:hover{background-color:#0950df;color:#fff}.btn-group>.btn.dropdown-toggle-split:first-child,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.dropdown-toggle-split{padding-left:.75rem;padding-right:.75rem}.dropdown-toggle-split:after{margin-left:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-left:.375rem;padding-right:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-left:.75rem;padding-right:.75rem}.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-left-radius:0;border-bottom-right-radius:0}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:576px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:992px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1200px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1400px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .nav-item a.nav-link.dropdown-toggle{gap:.75rem}.sgds.navbar .nav-item a.nav-link.dropdown-toggle.show{border-bottom:.125rem solid #9182e8;color:#9182e8}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -7054,7 +7054,7 @@
|
|
|
7054
7054
|
return target;
|
|
7055
7055
|
};
|
|
7056
7056
|
|
|
7057
|
-
var css_248z$3 = css`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);background-color:var(--sgds-body-bg);color:var(--sgds-body-color);font-family:var(--sgds-body-font-family);font-size:var(--sgds-body-font-size);font-weight:var(--sgds-body-font-weight);line-height:var(--sgds-body-line-height);margin:0;text-align:var(--sgds-body-text-align)
|
|
7057
|
+
var css_248z$3 = css`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);background-color:var(--sgds-body-bg);color:var(--sgds-body-color);font-family:var(--sgds-body-font-family);font-size:var(--sgds-body-font-size);font-weight:var(--sgds-body-font-weight);line-height:var(--sgds-body-line-height);margin:0;text-align:var(--sgds-body-text-align)}:host *,:host :after,:host :before{box-sizing:border-box}:host :disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:host :root{scroll-behavior:smooth}}:host ::slotted(a[target=_blank]):after{background-color:currentColor;content:"/";display:inline-block;margin:0 .125rem;-webkit-mask-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-up-right"><path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z"/><path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z"/></svg>');mask-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-up-right"><path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z"/><path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z"/></svg>');-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;mask-size:73%;-webkit-mask-size:73%;padding:0 .45em}:host ::slotted(a){color:var(--sgds-link);text-decoration:var(--sgds-link-decoration)}:host ::slotted(a:hover){color:var(--sgds-link-hover-color)}:host ::slotted(svg){vertical-align:middle}`;
|
|
7058
7058
|
|
|
7059
7059
|
/**
|
|
7060
7060
|
* @cssprop --sgds-{stateColor} - State colors in hexadecimal value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-dropdown-item.cjs.js","sources":["../../../src/components/Dropdown/sgds-dropdown-item.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport LinkElement from \"../../base/link-element\";\nimport dropdownStyle from \"./dropdown.css\";\n/**\n * @summary `SgdsDropdownItem` are navigation links built with `HTMLAnchorElement`. It should be used in the default slot of `SgdsDropdown`\n */\nexport class SgdsDropdownItem extends LinkElement {\n static styles = [dropdownStyle];\n\n /**@internal */\n @query(\"a\")\n private anchor: HTMLElement;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (e.key === \"Enter\") {\n this.anchor.click();\n }\n });\n }\n\n render() {\n return html`\n <div>\n <a\n href=\"${this.href}\"\n class=\"dropdown-item ${classMap({\n disabled: this.disabled,\n active: this.active\n })}\"\n ?disabled=${this.disabled}\n aria-disabled=${this.disabled ? \"true\" : \"false\"}\n role=\"menuitem\"\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n target=${this.target}\n ><slot></slot\n ></a>\n </div>\n `;\n }\n}\n\nexport default SgdsDropdownItem;\n"],"names":["LinkElement","html","classMap","dropdownStyle","__decorate","query"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sgds-dropdown-item.cjs.js","sources":["../../../src/components/Dropdown/sgds-dropdown-item.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport LinkElement from \"../../base/link-element\";\nimport dropdownStyle from \"./dropdown.css\";\n/**\n * @summary `SgdsDropdownItem` are navigation links built with `HTMLAnchorElement`. It should be used in the default slot of `SgdsDropdown`\n */\nexport class SgdsDropdownItem extends LinkElement {\n static styles = [dropdownStyle];\n\n /**@internal */\n @query(\"a\")\n private anchor: HTMLElement;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (e.key === \"Enter\") {\n this.anchor.click();\n }\n });\n }\n\n render() {\n return html`\n <div>\n <a\n href=\"${this.href}\"\n class=\"dropdown-item ${classMap({\n disabled: this.disabled,\n active: this.active\n })}\"\n ?disabled=${this.disabled}\n aria-disabled=${this.disabled ? \"true\" : \"false\"}\n role=\"menuitem\"\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n target=${this.target}\n ><slot></slot\n ></a>\n </div>\n `;\n }\n}\n\nexport default SgdsDropdownItem;\n"],"names":["LinkElement","html","classMap","dropdownStyle","__decorate","query"],"mappings":";;;;;;;;;;;;AAKA;;AAEG;AACG,MAAO,gBAAiB,SAAQA,sBAAW,CAAA;IAO/C,iBAAiB,GAAA;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAgB,KAAI;AACpD,YAAA,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE;AACrB,gBAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;aACrB;AACH,SAAC,CAAC,CAAC;KACJ;IAED,MAAM,GAAA;AACJ,QAAA,OAAOC,QAAI,CAAA,CAAA;;;AAGG,gBAAA,EAAA,IAAI,CAAC,IAAI,CAAA;AACM,+BAAA,EAAAC,oBAAQ,CAAC;YAC9B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAA;AACU,oBAAA,EAAA,IAAI,CAAC,QAAQ,CAAA;0BACT,IAAI,CAAC,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;;qBAErC,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,GAAG,CAAA;AAC5B,iBAAA,EAAA,IAAI,CAAC,MAAM,CAAA;;;;KAIzB,CAAC;KACH;;AAjCM,gBAAA,CAAA,MAAM,GAAG,CAACC,mBAAa,CAAC,CAAC;AAIxBC,gBAAA,CAAA;IADPC,mBAAK,CAAC,GAAG,CAAC;AACiB,CAAA,EAAA,gBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-dropdown-item.js","sources":["../../../src/components/Dropdown/sgds-dropdown-item.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport LinkElement from \"../../base/link-element\";\nimport dropdownStyle from \"./dropdown.css\";\n/**\n * @summary `SgdsDropdownItem` are navigation links built with `HTMLAnchorElement`. It should be used in the default slot of `SgdsDropdown`\n */\nexport class SgdsDropdownItem extends LinkElement {\n static styles = [dropdownStyle];\n\n /**@internal */\n @query(\"a\")\n private anchor: HTMLElement;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (e.key === \"Enter\") {\n this.anchor.click();\n }\n });\n }\n\n render() {\n return html`\n <div>\n <a\n href=\"${this.href}\"\n class=\"dropdown-item ${classMap({\n disabled: this.disabled,\n active: this.active\n })}\"\n ?disabled=${this.disabled}\n aria-disabled=${this.disabled ? \"true\" : \"false\"}\n role=\"menuitem\"\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n target=${this.target}\n ><slot></slot\n ></a>\n </div>\n `;\n }\n}\n\nexport default SgdsDropdownItem;\n"],"names":["dropdownStyle"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sgds-dropdown-item.js","sources":["../../../src/components/Dropdown/sgds-dropdown-item.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport LinkElement from \"../../base/link-element\";\nimport dropdownStyle from \"./dropdown.css\";\n/**\n * @summary `SgdsDropdownItem` are navigation links built with `HTMLAnchorElement`. It should be used in the default slot of `SgdsDropdown`\n */\nexport class SgdsDropdownItem extends LinkElement {\n static styles = [dropdownStyle];\n\n /**@internal */\n @query(\"a\")\n private anchor: HTMLElement;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (e.key === \"Enter\") {\n this.anchor.click();\n }\n });\n }\n\n render() {\n return html`\n <div>\n <a\n href=\"${this.href}\"\n class=\"dropdown-item ${classMap({\n disabled: this.disabled,\n active: this.active\n })}\"\n ?disabled=${this.disabled}\n aria-disabled=${this.disabled ? \"true\" : \"false\"}\n role=\"menuitem\"\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n target=${this.target}\n ><slot></slot\n ></a>\n </div>\n `;\n }\n}\n\nexport default SgdsDropdownItem;\n"],"names":["dropdownStyle"],"mappings":";;;;;;;;AAKA;;AAEG;AACG,MAAO,gBAAiB,SAAQ,WAAW,CAAA;IAO/C,iBAAiB,GAAA;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAgB,KAAI;AACpD,YAAA,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE;AACrB,gBAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;aACrB;AACH,SAAC,CAAC,CAAC;KACJ;IAED,MAAM,GAAA;AACJ,QAAA,OAAO,IAAI,CAAA,CAAA;;;AAGG,gBAAA,EAAA,IAAI,CAAC,IAAI,CAAA;AACM,+BAAA,EAAA,QAAQ,CAAC;YAC9B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAA;AACU,oBAAA,EAAA,IAAI,CAAC,QAAQ,CAAA;0BACT,IAAI,CAAC,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;;qBAErC,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,GAAG,CAAA;AAC5B,iBAAA,EAAA,IAAI,CAAC,MAAM,CAAA;;;;KAIzB,CAAC;KACH;;AAjCM,gBAAA,CAAA,MAAM,GAAG,CAACA,QAAa,CAAC,CAAC;AAIxB,UAAA,CAAA;IADP,KAAK,CAAC,GAAG,CAAC;AACiB,CAAA,EAAA,gBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-dropdown.cjs.js","sources":["../../../src/components/Dropdown/sgds-dropdown.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { html } from \"lit\";\nimport { property, queryAsync } from \"lit/decorators.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { DropdownListElement } from \"../../base/dropdown-list-element\";\nimport genId from \"../../utils/generateId\";\nimport { SgdsButton } from \"../Button/sgds-button\";\nimport dropdownStyle from \"./dropdown.css\";\nexport type DropDirection = \"left\" | \"right\" | \"up\" | \"down\";\nexport type DropdownButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"danger\"\n | \"warning\"\n | \"info\"\n | \"light\"\n | \"dark\";\n\n/**\n * @summary `SgdsDropdown` toggles contextual overlays for displaying lists of links.\n * @slot default - slot for sgds-dropdown-item passed into dropdown's menu\n *\n * @csspart menu - The dropdown's menu (ul element)\n *\n */\nexport class SgdsDropdown extends ScopedElementsMixin(DropdownListElement) {\n static styles = [...DropdownListElement.styles, dropdownStyle];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-button\": SgdsButton\n };\n }\n constructor() {\n super();\n /**@internal */\n this.modifierOpt = [\n {\n name: \"offset\",\n options: {\n offset: [0, 10]\n }\n }\n ];\n }\n @property({ type: String })\n /** Forwards value to id attribute of toggle button of Dropdown. An unique id generated by default */\n togglerId: string = genId(\"dropdown\", \"button\");\n\n /** Sets the text content of Dropdown button */\n @property({ type: String })\n togglerText = \"\";\n\n /** Controls auto-flipping of menu */\n @property({ type: Boolean, reflect: true, state: false })\n noFlip = false;\n\n /** When true, aligns right edge of menu with right edge of button */\n @property({ type: Boolean, reflect: true, state: false })\n menuAlignRight = false;\n\n /** The drop position of menu relative to the toggle button */\n @property({ type: String, reflect: true, state: false })\n drop: DropDirection = \"down\";\n\n /** Sets color of Dropdown button */\n @property({ type: String, reflect: true })\n variant: DropdownButtonVariant = \"secondary\";\n\n /**@internal */\n @queryAsync(\"sgds-button\")\n private dropdownRef: Promise<SgdsButton>;\n\n async firstUpdated() {\n super.firstUpdated();\n if (this.menuIsOpen) {\n await this.dropdownRef;\n this.showMenu();\n }\n }\n render() {\n return html`\n <div>\n <sgds-button\n outlined\n role=\"button\"\n variant=${this.variant}\n ?disabled=${this.disabled}\n aria-expanded=\"${this.menuIsOpen}\"\n aria-haspopup=\"menu\"\n ${ref(this.myDropdown)}\n @click=${() => this.toggleMenu()}\n id=${this.togglerId}\n >\n ${this.togglerText}\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-chevron-down\"\n viewBox=\"0 0 16 16\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z\"\n />\n </svg>\n </sgds-button>\n <div class=\"dropdown-menu\" role=\"menu\" part=\"menu\">\n <slot id=\"default\" @click=${this.handleSelectSlot}></slot>\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsDropdown;\n"],"names":["ScopedElementsMixin","DropdownListElement","SgdsButton","genId","html","ref","dropdownStyle","__decorate","property","queryAsync"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sgds-dropdown.cjs.js","sources":["../../../src/components/Dropdown/sgds-dropdown.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { html } from \"lit\";\nimport { property, queryAsync } from \"lit/decorators.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { DropdownListElement } from \"../../base/dropdown-list-element\";\nimport genId from \"../../utils/generateId\";\nimport { SgdsButton } from \"../Button/sgds-button\";\nimport dropdownStyle from \"./dropdown.css\";\nexport type DropDirection = \"left\" | \"right\" | \"up\" | \"down\";\nexport type DropdownButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"danger\"\n | \"warning\"\n | \"info\"\n | \"light\"\n | \"dark\";\n\n/**\n * @summary `SgdsDropdown` toggles contextual overlays for displaying lists of links.\n * @slot default - slot for sgds-dropdown-item passed into dropdown's menu\n *\n * @csspart menu - The dropdown's menu (ul element)\n *\n */\nexport class SgdsDropdown extends ScopedElementsMixin(DropdownListElement) {\n static styles = [...DropdownListElement.styles, dropdownStyle];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-button\": SgdsButton\n };\n }\n constructor() {\n super();\n /**@internal */\n this.modifierOpt = [\n {\n name: \"offset\",\n options: {\n offset: [0, 10]\n }\n }\n ];\n }\n @property({ type: String })\n /** Forwards value to id attribute of toggle button of Dropdown. An unique id generated by default */\n togglerId: string = genId(\"dropdown\", \"button\");\n\n /** Sets the text content of Dropdown button */\n @property({ type: String })\n togglerText = \"\";\n\n /** Controls auto-flipping of menu */\n @property({ type: Boolean, reflect: true, state: false })\n noFlip = false;\n\n /** When true, aligns right edge of menu with right edge of button */\n @property({ type: Boolean, reflect: true, state: false })\n menuAlignRight = false;\n\n /** The drop position of menu relative to the toggle button */\n @property({ type: String, reflect: true, state: false })\n drop: DropDirection = \"down\";\n\n /** Sets color of Dropdown button */\n @property({ type: String, reflect: true })\n variant: DropdownButtonVariant = \"secondary\";\n\n /**@internal */\n @queryAsync(\"sgds-button\")\n private dropdownRef: Promise<SgdsButton>;\n\n async firstUpdated() {\n super.firstUpdated();\n if (this.menuIsOpen) {\n await this.dropdownRef;\n this.showMenu();\n }\n }\n render() {\n return html`\n <div>\n <sgds-button\n outlined\n role=\"button\"\n variant=${this.variant}\n ?disabled=${this.disabled}\n aria-expanded=\"${this.menuIsOpen}\"\n aria-haspopup=\"menu\"\n ${ref(this.myDropdown)}\n @click=${() => this.toggleMenu()}\n id=${this.togglerId}\n >\n ${this.togglerText}\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-chevron-down\"\n viewBox=\"0 0 16 16\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z\"\n />\n </svg>\n </sgds-button>\n <div class=\"dropdown-menu\" role=\"menu\" part=\"menu\">\n <slot id=\"default\" @click=${this.handleSelectSlot}></slot>\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsDropdown;\n"],"names":["ScopedElementsMixin","DropdownListElement","SgdsButton","genId","html","ref","dropdownStyle","__decorate","property","queryAsync"],"mappings":";;;;;;;;;;;;;;;AAmBA;;;;;;AAMG;MACU,YAAa,SAAQA,kCAAmB,CAACC,uCAAmB,CAAC,CAAA;;AAGxE,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,aAAa,EAAEC,qBAAU;SAC1B,CAAC;KACH;AACD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE,CAAC;AAaV,QAAA,IAAA,CAAA,SAAS,GAAWC,qBAAK,CA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EAAA,KAAA,CAAA,CAAA;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-dropdown.js","sources":["../../../src/components/Dropdown/sgds-dropdown.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { html } from \"lit\";\nimport { property, queryAsync } from \"lit/decorators.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { DropdownListElement } from \"../../base/dropdown-list-element\";\nimport genId from \"../../utils/generateId\";\nimport { SgdsButton } from \"../Button/sgds-button\";\nimport dropdownStyle from \"./dropdown.css\";\nexport type DropDirection = \"left\" | \"right\" | \"up\" | \"down\";\nexport type DropdownButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"danger\"\n | \"warning\"\n | \"info\"\n | \"light\"\n | \"dark\";\n\n/**\n * @summary `SgdsDropdown` toggles contextual overlays for displaying lists of links.\n * @slot default - slot for sgds-dropdown-item passed into dropdown's menu\n *\n * @csspart menu - The dropdown's menu (ul element)\n *\n */\nexport class SgdsDropdown extends ScopedElementsMixin(DropdownListElement) {\n static styles = [...DropdownListElement.styles, dropdownStyle];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-button\": SgdsButton\n };\n }\n constructor() {\n super();\n /**@internal */\n this.modifierOpt = [\n {\n name: \"offset\",\n options: {\n offset: [0, 10]\n }\n }\n ];\n }\n @property({ type: String })\n /** Forwards value to id attribute of toggle button of Dropdown. An unique id generated by default */\n togglerId: string = genId(\"dropdown\", \"button\");\n\n /** Sets the text content of Dropdown button */\n @property({ type: String })\n togglerText = \"\";\n\n /** Controls auto-flipping of menu */\n @property({ type: Boolean, reflect: true, state: false })\n noFlip = false;\n\n /** When true, aligns right edge of menu with right edge of button */\n @property({ type: Boolean, reflect: true, state: false })\n menuAlignRight = false;\n\n /** The drop position of menu relative to the toggle button */\n @property({ type: String, reflect: true, state: false })\n drop: DropDirection = \"down\";\n\n /** Sets color of Dropdown button */\n @property({ type: String, reflect: true })\n variant: DropdownButtonVariant = \"secondary\";\n\n /**@internal */\n @queryAsync(\"sgds-button\")\n private dropdownRef: Promise<SgdsButton>;\n\n async firstUpdated() {\n super.firstUpdated();\n if (this.menuIsOpen) {\n await this.dropdownRef;\n this.showMenu();\n }\n }\n render() {\n return html`\n <div>\n <sgds-button\n outlined\n role=\"button\"\n variant=${this.variant}\n ?disabled=${this.disabled}\n aria-expanded=\"${this.menuIsOpen}\"\n aria-haspopup=\"menu\"\n ${ref(this.myDropdown)}\n @click=${() => this.toggleMenu()}\n id=${this.togglerId}\n >\n ${this.togglerText}\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-chevron-down\"\n viewBox=\"0 0 16 16\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z\"\n />\n </svg>\n </sgds-button>\n <div class=\"dropdown-menu\" role=\"menu\" part=\"menu\">\n <slot id=\"default\" @click=${this.handleSelectSlot}></slot>\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsDropdown;\n"],"names":["dropdownStyle"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sgds-dropdown.js","sources":["../../../src/components/Dropdown/sgds-dropdown.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { html } from \"lit\";\nimport { property, queryAsync } from \"lit/decorators.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { DropdownListElement } from \"../../base/dropdown-list-element\";\nimport genId from \"../../utils/generateId\";\nimport { SgdsButton } from \"../Button/sgds-button\";\nimport dropdownStyle from \"./dropdown.css\";\nexport type DropDirection = \"left\" | \"right\" | \"up\" | \"down\";\nexport type DropdownButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"danger\"\n | \"warning\"\n | \"info\"\n | \"light\"\n | \"dark\";\n\n/**\n * @summary `SgdsDropdown` toggles contextual overlays for displaying lists of links.\n * @slot default - slot for sgds-dropdown-item passed into dropdown's menu\n *\n * @csspart menu - The dropdown's menu (ul element)\n *\n */\nexport class SgdsDropdown extends ScopedElementsMixin(DropdownListElement) {\n static styles = [...DropdownListElement.styles, dropdownStyle];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-button\": SgdsButton\n };\n }\n constructor() {\n super();\n /**@internal */\n this.modifierOpt = [\n {\n name: \"offset\",\n options: {\n offset: [0, 10]\n }\n }\n ];\n }\n @property({ type: String })\n /** Forwards value to id attribute of toggle button of Dropdown. An unique id generated by default */\n togglerId: string = genId(\"dropdown\", \"button\");\n\n /** Sets the text content of Dropdown button */\n @property({ type: String })\n togglerText = \"\";\n\n /** Controls auto-flipping of menu */\n @property({ type: Boolean, reflect: true, state: false })\n noFlip = false;\n\n /** When true, aligns right edge of menu with right edge of button */\n @property({ type: Boolean, reflect: true, state: false })\n menuAlignRight = false;\n\n /** The drop position of menu relative to the toggle button */\n @property({ type: String, reflect: true, state: false })\n drop: DropDirection = \"down\";\n\n /** Sets color of Dropdown button */\n @property({ type: String, reflect: true })\n variant: DropdownButtonVariant = \"secondary\";\n\n /**@internal */\n @queryAsync(\"sgds-button\")\n private dropdownRef: Promise<SgdsButton>;\n\n async firstUpdated() {\n super.firstUpdated();\n if (this.menuIsOpen) {\n await this.dropdownRef;\n this.showMenu();\n }\n }\n render() {\n return html`\n <div>\n <sgds-button\n outlined\n role=\"button\"\n variant=${this.variant}\n ?disabled=${this.disabled}\n aria-expanded=\"${this.menuIsOpen}\"\n aria-haspopup=\"menu\"\n ${ref(this.myDropdown)}\n @click=${() => this.toggleMenu()}\n id=${this.togglerId}\n >\n ${this.togglerText}\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-chevron-down\"\n viewBox=\"0 0 16 16\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z\"\n />\n </svg>\n </sgds-button>\n <div class=\"dropdown-menu\" role=\"menu\" part=\"menu\">\n <slot id=\"default\" @click=${this.handleSelectSlot}></slot>\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsDropdown;\n"],"names":["dropdownStyle"],"mappings":";;;;;;;;;;;AAmBA;;;;;;AAMG;MACU,YAAa,SAAQ,mBAAmB,CAAC,mBAAmB,CAAC,CAAA;;AAGxE,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,aAAa,EAAE,UAAU;SAC1B,CAAC;KACH;AACD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE,CAAC;AAaV,QAAA,IAAA,CAAA,SAAS,GAAW,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;;QAIhD,IAAW,CAAA,WAAA,GAAG,EAAE,CAAC;;QAIjB,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;;QAIf,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;;QAIvB,IAAI,CAAA,IAAA,GAAkB,MAAM,CAAC;;QAI7B,IAAO,CAAA,OAAA,GAA0B,WAAW,CAAC;;QA/B3C,IAAI,CAAC,WAAW,GAAG;AACjB,YAAA;AACE,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,OAAO,EAAE;AACP,oBAAA,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;AAChB,iBAAA;AACF,aAAA;SACF,CAAC;KACH;AA6BD,IAAA,MAAM,YAAY,GAAA;QAChB,KAAK,CAAC,YAAY,EAAE,CAAC;AACrB,QAAA,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,MAAM,IAAI,CAAC,WAAW,CAAC;YACvB,IAAI,CAAC,QAAQ,EAAE,CAAC;S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AClC,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAIvB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAI7B,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACG,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAIrC,UAAA,CAAA;IADP,UAAU,CAAC,aAAa,CAAC;AACe,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-upload.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { css } from 'lit';
|
|
2
3
|
|
|
3
4
|
var css_248z = css`:host{--file-upload-left-icon-color:var(--sgds-success);--file-upload-remove-icon-color:var(--sgds-body-color);--file-upload-remove-icon-hover-color: }.fileupload-list-item{display:flex;gap:var(--sgds-spacer-2)}.fileupload-list-item span:not(:first-of-type){cursor:pointer}.fileupload-list-item span:first-of-type svg{color:var(--file-upload-left-icon-color)}.fileupload-list-item span:last-of-type svg{color:var(--file-upload-remove-icon-color)}.fileupload-list-item span:last-of-type svg:hover{color:var(--file-upload-remove-icon-hover-color)}.file-upload-label{align-items:center;display:flex;gap:var(--sgds-spacer-2)}ul{margin:0;padding:0}.sgds.fileupload-list{display:flex;flex-direction:column;gap:var(--sgds-spacer-3);list-style-type:none}.sgds.fileupload-list .fileupload-list-item .filename{color:var(--sgds-link);text-decoration:underline;text-underline-offset:.25rem}input{display:none}label,sgds-button{cursor:pointer}.fileupload-container{display:flex;flex-direction:column;gap:var(--sgds-spacer-3)}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-upload.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -3805,7 +3805,7 @@
|
|
|
3805
3805
|
*/
|
|
3806
3806
|
const unsafeSVG = directive(UnsafeSVGDirective);
|
|
3807
3807
|
|
|
3808
|
-
var css_248z$5 = css`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);background-color:var(--sgds-body-bg);color:var(--sgds-body-color);font-family:var(--sgds-body-font-family);font-size:var(--sgds-body-font-size);font-weight:var(--sgds-body-font-weight);line-height:var(--sgds-body-line-height);margin:0;text-align:var(--sgds-body-text-align)
|
|
3808
|
+
var css_248z$5 = css`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);background-color:var(--sgds-body-bg);color:var(--sgds-body-color);font-family:var(--sgds-body-font-family);font-size:var(--sgds-body-font-size);font-weight:var(--sgds-body-font-weight);line-height:var(--sgds-body-line-height);margin:0;text-align:var(--sgds-body-text-align)}:host *,:host :after,:host :before{box-sizing:border-box}:host :disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:host :root{scroll-behavior:smooth}}:host ::slotted(a[target=_blank]):after{background-color:currentColor;content:"/";display:inline-block;margin:0 .125rem;-webkit-mask-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-up-right"><path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z"/><path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z"/></svg>');mask-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-up-right"><path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z"/><path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z"/></svg>');-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;mask-size:73%;-webkit-mask-size:73%;padding:0 .45em}:host ::slotted(a){color:var(--sgds-link);text-decoration:var(--sgds-link-decoration)}:host ::slotted(a:hover){color:var(--sgds-link-hover-color)}:host ::slotted(svg){vertical-align:middle}`;
|
|
3809
3809
|
|
|
3810
3810
|
/**
|
|
3811
3811
|
* @cssprop --sgds-{stateColor} - State colors in hexadecimal value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-file-upload.cjs.js","sources":["../../../src/components/FileUpload/sgds-file-upload.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { unsafeSVG } from \"lit/directives/unsafe-svg.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { SgdsButton, type ButtonVariant } from \"../Button/sgds-button\";\nimport fileUploadStyle from \"./file-upload.css\";\nimport genId from \"../../utils/generateId\";\nimport svgStyles from \"../../styles/svg.css\";\nimport formHintStyles from \"../../styles/form-hint.css\";\nexport type FileUploadButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"danger\"\n | \"warning\"\n | \"info\"\n | \"light\"\n | \"dark\"\n | \"link\"\n | \"outline-primary\"\n | \"outline-secondary\"\n | \"outline-success\"\n | \"outline-danger\"\n | \"outline-warning\"\n | \"outline-info\"\n | \"outline-light\"\n | \"outline-dark\";\n\n/**\n * @summary Allows users to upload files of various sizes and formats\n * @slot default - Label for file upload button\n *\n * @event sgds-files-selected - Emitted when files are selected for uploading\n *\n * @cssproperty --file-upload-file-icon-color - Left icon color\n * @cssproperty --file-upload-remove-icon-color - Remove icon color\n * @cssproperty --file-upload-remove-icon-hover-color - Remove icon hover color\n */\n\nexport class SgdsFileUpload extends ScopedElementsMixin(SgdsElement) {\n static styles = [...SgdsElement.styles, svgStyles, formHintStyles, fileUploadStyle];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-button\": SgdsButton\n };\n }\n /** The button's variant. */\n @property({ reflect: true }) variant: FileUploadButtonVariant = \"primary\";\n\n //** Disable the fileuploader button */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /** Allows multiple files to be listed for uploading */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /** Specify the acceptable file type */\n @property({ type: String, reflect: true })\n accept = \"\";\n\n /** Specifies a large or small button */\n @property({ reflect: true }) size: \"sm\" | \"lg\";\n\n /** Customize the check icon with SVG */\n @property({ type: String })\n checkedIcon = \"\";\n\n /** Customize the cancel icon with SVG */\n @property({ type: String })\n cancelIcon = \"\";\n\n /** The input's hint text below the label */\n @property({ reflect: true }) hintText = \"\";\n\n /** @internal */\n @property({ type: Object, state: true })\n private files: FileList | undefined;\n\n /** @internal */\n @property({ type: Array })\n private selectedFiles: File[] = [];\n\n private _setFileList(files: FileList) {\n this.files = files;\n this.emit(\"sgds-files-selected\");\n //Possible to pass in the files\n }\n\n // Create a ref to the input element\n /** @internal */\n private inputRef = createRef<HTMLInputElement>();\n\n /** @internal */\n private handleClick(event: Event) {\n event.preventDefault();\n if (!this.disabled) {\n // Get a reference to the input element using the inputRef\n const inputElement = this.inputRef.value;\n // Do something with the input element\n inputElement.click();\n }\n }\n\n /** @internal */\n private handleInputChange(event: Event) {\n const inputElement = event.target as HTMLInputElement;\n const files = inputElement.files as FileList;\n\n if (files.length > 0) {\n this.selectedFiles = Array.from(files);\n }\n // Trigger a re-render of the component to update the list of selected files\n this._setFileList(files);\n this.requestUpdate();\n }\n\n private _removeFileHandler(index: number) {\n const inputElement = this.inputRef.value;\n const attachments = inputElement.files;\n\n const fileBuffer = new DataTransfer();\n for (let i = 0; i < attachments.length; i++) {\n if (index !== i) fileBuffer.items.add(attachments[i]);\n }\n\n // Assign buffer to file input\n inputElement.files = fileBuffer.files;\n // Re-populate selected files to the lists\n this._setFileList(fileBuffer.files);\n this.selectedFiles = Array.from(fileBuffer.files);\n\n // Trigger a re-render of the component to update the list of selected files\n this.requestUpdate();\n }\n\n /**@internal */\n protected inputId: string = genId(\"input\", \"file\");\n\n protected _renderHintText() {\n const hintTextTemplate = html` <small id=\"${this.inputId}Help\" class=\"form-text\">${this.hintText}</small> `;\n return this.hintText && hintTextTemplate;\n }\n\n private _sanitizeVariant(variant: FileUploadButtonVariant) {\n return variant.replace(\"outline-\", \"\") as ButtonVariant;\n }\n render() {\n const getCheckedIcon = (checkedIcon: string) => {\n if (checkedIcon) {\n return html`${unsafeSVG(checkedIcon)}`;\n }\n return html` <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-check-lg\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z\"\n />\n </svg>`;\n };\n\n const getCancelIcon = (cancelIcon: string) => {\n if (cancelIcon) {\n return html`${unsafeSVG(cancelIcon)}`;\n }\n return html`<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-x-circle\"\n viewBox=\"0 0 16 16\"\n >\n <path d=\"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z\" />\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 const listItems = this.selectedFiles.map(\n (file, index) => html`\n <li key=${index} class=\"fileupload-list-item\">\n <span>${getCheckedIcon(this.checkedIcon)}</span>\n <span class=\"filename\">${file.name}</span>\n <span @click=${() => this._removeFileHandler(index)}>${getCancelIcon(this.cancelIcon)}</span>\n </li>\n `\n );\n\n return html`\n <input\n ${ref(this.inputRef)}\n type=\"file\"\n @change=${this.handleInputChange}\n ?multiple=${this.multiple}\n accept=${this.accept}\n id=${this.inputId}\n />\n <div class=\"fileupload-container\">\n <sgds-button\n size=${this.size}\n variant=${this._sanitizeVariant(this.variant)}\n ?outlined=${this.variant.includes(\"outline\")}\n ?disabled=${this.disabled}\n @click=${this.handleClick}\n >\n <label for=${this.inputId} class=\"file-upload-label\"><slot></slot></label>\n </sgds-button>\n ${this._renderHintText()}\n <ul class=\"sgds fileupload-list\">\n ${listItems}\n </ul>\n </div>\n `;\n }\n}\n\nexport default SgdsFileUpload;\n"],"names":["ScopedElementsMixin","SgdsElement","createRef","genId","SgdsButton","html","unsafeSVG","ref","svgStyles","formHintStyles","fileUploadStyle","__decorate","property"],"mappings":";;;;;;;;;;;;;;;;;AA8BA;;;;;;;;;AASG;MAEU,cAAe,SAAQA,kCAAmB,CAACC,sBAAW,CAAC,CAAA;AAApE,IAAA,WAAA,GAAA;;;QAS+B,IAAO,CAAA,OAAA,GAA4B,SAAS,CAAC;;QAI1E,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAIjB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAIjB,IAAM,CAAA,MAAA,GAAG,EAAE,CAAC;;QAOZ,IAAW,CAAA,WAAA,GAAG,EAAE,CAAC;;QAIjB,IAAU,CAAA,UAAA,GAAG,EAAE,CAAC;;QAGa,IAAQ,CAAA,QAAA,GAAG,EAAE,CAAC;;QAQnC,IAAa,CAAA,aAAA,GAAW,EAAE,CAAC;;;QAU3B,IAAQ,CAAA,QAAA,GAAGC,gBAAS,EAAoB,CAAC;;AA8CvC,QAAA,IAAA,CAAA,OAAO,GAAWC,qBAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAoFpD;;AApLC,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,aAAa,EAAEC,qBAAU;SAC1B,CAAC;KACH;AAsCO,IAAA,YAAY,CAAC,KAAe,EAAA;AAClC,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACnB,QAAA,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;;KAElC;;AAOO,IAAA,WAAW,CAAC,KAAY,EAAA;QAC9B,KAAK,CAAC,cAAc,EAAE,CAAC;AACvB,QAAA,IAAI,CAA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;;"}
|
|
1
|
+
{"version":3,"file":"sgds-file-upload.cjs.js","sources":["../../../src/components/FileUpload/sgds-file-upload.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { unsafeSVG } from \"lit/directives/unsafe-svg.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { SgdsButton, type ButtonVariant } from \"../Button/sgds-button\";\nimport fileUploadStyle from \"./file-upload.css\";\nimport genId from \"../../utils/generateId\";\nimport svgStyles from \"../../styles/svg.css\";\nimport formHintStyles from \"../../styles/form-hint.css\";\nexport type FileUploadButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"danger\"\n | \"warning\"\n | \"info\"\n | \"light\"\n | \"dark\"\n | \"link\"\n | \"outline-primary\"\n | \"outline-secondary\"\n | \"outline-success\"\n | \"outline-danger\"\n | \"outline-warning\"\n | \"outline-info\"\n | \"outline-light\"\n | \"outline-dark\";\n\n/**\n * @summary Allows users to upload files of various sizes and formats\n * @slot default - Label for file upload button\n *\n * @event sgds-files-selected - Emitted when files are selected for uploading\n *\n * @cssproperty --file-upload-file-icon-color - Left icon color\n * @cssproperty --file-upload-remove-icon-color - Remove icon color\n * @cssproperty --file-upload-remove-icon-hover-color - Remove icon hover color\n */\n\nexport class SgdsFileUpload extends ScopedElementsMixin(SgdsElement) {\n static styles = [...SgdsElement.styles, svgStyles, formHintStyles, fileUploadStyle];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-button\": SgdsButton\n };\n }\n /** The button's variant. */\n @property({ reflect: true }) variant: FileUploadButtonVariant = \"primary\";\n\n //** Disable the fileuploader button */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /** Allows multiple files to be listed for uploading */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /** Specify the acceptable file type */\n @property({ type: String, reflect: true })\n accept = \"\";\n\n /** Specifies a large or small button */\n @property({ reflect: true }) size: \"sm\" | \"lg\";\n\n /** Customize the check icon with SVG */\n @property({ type: String })\n checkedIcon = \"\";\n\n /** Customize the cancel icon with SVG */\n @property({ type: String })\n cancelIcon = \"\";\n\n /** The input's hint text below the label */\n @property({ reflect: true }) hintText = \"\";\n\n /** @internal */\n @property({ type: Object, state: true })\n private files: FileList | undefined;\n\n /** @internal */\n @property({ type: Array })\n private selectedFiles: File[] = [];\n\n private _setFileList(files: FileList) {\n this.files = files;\n this.emit(\"sgds-files-selected\");\n //Possible to pass in the files\n }\n\n // Create a ref to the input element\n /** @internal */\n private inputRef = createRef<HTMLInputElement>();\n\n /** @internal */\n private handleClick(event: Event) {\n event.preventDefault();\n if (!this.disabled) {\n // Get a reference to the input element using the inputRef\n const inputElement = this.inputRef.value;\n // Do something with the input element\n inputElement.click();\n }\n }\n\n /** @internal */\n private handleInputChange(event: Event) {\n const inputElement = event.target as HTMLInputElement;\n const files = inputElement.files as FileList;\n\n if (files.length > 0) {\n this.selectedFiles = Array.from(files);\n }\n // Trigger a re-render of the component to update the list of selected files\n this._setFileList(files);\n this.requestUpdate();\n }\n\n private _removeFileHandler(index: number) {\n const inputElement = this.inputRef.value;\n const attachments = inputElement.files;\n\n const fileBuffer = new DataTransfer();\n for (let i = 0; i < attachments.length; i++) {\n if (index !== i) fileBuffer.items.add(attachments[i]);\n }\n\n // Assign buffer to file input\n inputElement.files = fileBuffer.files;\n // Re-populate selected files to the lists\n this._setFileList(fileBuffer.files);\n this.selectedFiles = Array.from(fileBuffer.files);\n\n // Trigger a re-render of the component to update the list of selected files\n this.requestUpdate();\n }\n\n /**@internal */\n protected inputId: string = genId(\"input\", \"file\");\n\n protected _renderHintText() {\n const hintTextTemplate = html` <small id=\"${this.inputId}Help\" class=\"form-text\">${this.hintText}</small> `;\n return this.hintText && hintTextTemplate;\n }\n\n private _sanitizeVariant(variant: FileUploadButtonVariant) {\n return variant.replace(\"outline-\", \"\") as ButtonVariant;\n }\n render() {\n const getCheckedIcon = (checkedIcon: string) => {\n if (checkedIcon) {\n return html`${unsafeSVG(checkedIcon)}`;\n }\n return html` <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-check-lg\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z\"\n />\n </svg>`;\n };\n\n const getCancelIcon = (cancelIcon: string) => {\n if (cancelIcon) {\n return html`${unsafeSVG(cancelIcon)}`;\n }\n return html`<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-x-circle\"\n viewBox=\"0 0 16 16\"\n >\n <path d=\"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z\" />\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 const listItems = this.selectedFiles.map(\n (file, index) => html`\n <li key=${index} class=\"fileupload-list-item\">\n <span>${getCheckedIcon(this.checkedIcon)}</span>\n <span class=\"filename\">${file.name}</span>\n <span @click=${() => this._removeFileHandler(index)}>${getCancelIcon(this.cancelIcon)}</span>\n </li>\n `\n );\n\n return html`\n <input\n ${ref(this.inputRef)}\n type=\"file\"\n @change=${this.handleInputChange}\n ?multiple=${this.multiple}\n accept=${this.accept}\n id=${this.inputId}\n />\n <div class=\"fileupload-container\">\n <sgds-button\n size=${this.size}\n variant=${this._sanitizeVariant(this.variant)}\n ?outlined=${this.variant.includes(\"outline\")}\n ?disabled=${this.disabled}\n @click=${this.handleClick}\n >\n <label for=${this.inputId} class=\"file-upload-label\"><slot></slot></label>\n </sgds-button>\n ${this._renderHintText()}\n <ul class=\"sgds fileupload-list\">\n ${listItems}\n </ul>\n </div>\n `;\n }\n}\n\nexport default SgdsFileUpload;\n"],"names":["ScopedElementsMixin","SgdsElement","createRef","genId","SgdsButton","html","unsafeSVG","ref","svgStyles","formHintStyles","fileUploadStyle","__decorate","property"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA;;;;;;;;;AASG;MAEU,cAAe,SAAQA,kCAAmB,CAACC,sBAAW,CAAC,CAAA;AAApE,IAAA,WAAA,GAAA;;;QAS+B,IAAO,CAAA,OAAA,GAA4B,SAAS,CAAC;;QAI1E,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAIjB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAIjB,IAAM,CAAA,MAAA,GAAG,EAAE,CAAC;;QAOZ,IAAW,CAAA,WAAA,GAAG,EAAE,CAAC;;QAIjB,IAAU,CAAA,UAAA,GAAG,EAAE,CAAC;;QAGa,IAAQ,CAAA,QAAA,GAAG,EAAE,CAAC;;QAQnC,IAAa,CAAA,aAAA,GAAW,EAAE,CAAC;;;QAU3B,IAAQ,CAAA,QAAA,GAAGC,gBAAS,EAAoB,CAAC;;AA8CvC,QAAA,IAAA,CAAA,OAAO,GAAWC,qBAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAoFpD;;AApLC,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,aAAa,EAAEC,qBAAU;SAC1B,CAAC;KACH;AAsCO,IAAA,YAAY,CAAC,KAAe,EAAA;AAClC,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACnB,QAAA,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;;KAElC;;AAOO,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