@govtechsg/sgds-web-component 3.0.0-rc.1 → 3.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/base/button.js +1 -1
- package/base/form-control-element.d.ts +4 -11
- package/base/form-control-element.js +13 -23
- package/base/form-control-element.js.map +1 -1
- package/components/Accordion/accordion-item.js +1 -1
- package/components/Accordion/index.umd.js +7 -19
- package/components/Accordion/index.umd.js.map +1 -1
- package/components/Accordion/sgds-accordion-item.d.ts +3 -7
- package/components/Accordion/sgds-accordion-item.js +6 -18
- package/components/Accordion/sgds-accordion-item.js.map +1 -1
- package/components/ActionCard/index.umd.js +407 -329
- package/components/ActionCard/index.umd.js.map +1 -1
- package/components/Alert/alert.js +1 -1
- package/components/Alert/index.umd.js +553 -485
- package/components/Alert/index.umd.js.map +1 -1
- package/components/Alert/sgds-alert.d.ts +2 -2
- package/components/Alert/sgds-alert.js +6 -13
- package/components/Alert/sgds-alert.js.map +1 -1
- package/components/Badge/badge.js +1 -1
- package/components/Badge/index.umd.js +8 -9
- package/components/Badge/index.umd.js.map +1 -1
- package/components/Badge/sgds-badge.d.ts +4 -5
- package/components/Badge/sgds-badge.js +5 -6
- package/components/Badge/sgds-badge.js.map +1 -1
- package/components/Button/index.umd.js +8 -81
- package/components/Button/index.umd.js.map +1 -1
- package/components/Button/sgds-button.js +1 -1
- package/components/Button/sgds-button.js.map +1 -1
- package/components/Checkbox/checkbox.js +1 -1
- package/components/Checkbox/index.umd.js +541 -475
- package/components/Checkbox/index.umd.js.map +1 -1
- package/components/Checkbox/sgds-checkbox-group.d.ts +7 -1
- package/components/Checkbox/sgds-checkbox-group.js +15 -4
- package/components/Checkbox/sgds-checkbox-group.js.map +1 -1
- package/components/Checkbox/sgds-checkbox.d.ts +30 -21
- package/components/Checkbox/sgds-checkbox.js +77 -60
- package/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/components/ComboBox/index.umd.js +385 -216
- package/components/ComboBox/index.umd.js.map +1 -1
- package/components/Datepicker/datepicker-input.d.ts +4 -2
- package/components/Datepicker/datepicker-input.js +24 -7
- package/components/Datepicker/datepicker-input.js.map +1 -1
- package/components/Datepicker/index.umd.js +433 -244
- package/components/Datepicker/index.umd.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.d.ts +1 -1
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/Drawer/index.umd.js +2 -2
- package/components/Drawer/index.umd.js.map +1 -1
- package/components/Dropdown/index.umd.js +8 -81
- package/components/Dropdown/index.umd.js.map +1 -1
- package/components/FileUpload/file-upload.js +1 -1
- package/components/FileUpload/index.umd.js +579 -272
- package/components/FileUpload/index.umd.js.map +1 -1
- package/components/FileUpload/sgds-file-upload.d.ts +42 -30
- package/components/FileUpload/sgds-file-upload.js +147 -103
- package/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/components/Footer/footer-item.js +6 -0
- package/components/Footer/footer-item.js.map +1 -0
- package/components/Footer/footer.js +1 -1
- package/components/Footer/index.d.ts +2 -0
- package/components/Footer/index.js +2 -0
- package/components/Footer/index.js.map +1 -1
- package/components/Footer/index.umd.js +93 -94
- package/components/Footer/index.umd.js.map +1 -1
- package/components/Footer/sgds-footer-item.d.ts +13 -0
- package/components/Footer/sgds-footer-item.js +27 -0
- package/components/Footer/sgds-footer-item.js.map +1 -0
- package/components/Footer/sgds-footer.d.ts +9 -30
- package/components/Footer/sgds-footer.js +65 -90
- package/components/Footer/sgds-footer.js.map +1 -1
- package/components/Icon/icon.js +6 -0
- package/components/Icon/icon.js.map +1 -0
- package/components/Icon/index.d.ts +6 -0
- package/components/Icon/index.js +4 -0
- package/components/Icon/index.js.map +1 -0
- package/components/Icon/index.umd.js +4389 -0
- package/components/Icon/index.umd.js.map +1 -0
- package/components/Icon/sgds-icon.d.ts +21 -0
- package/components/Icon/sgds-icon.js +64 -0
- package/components/Icon/sgds-icon.js.map +1 -0
- package/components/IconButton/icon-button.js +1 -1
- package/components/IconButton/index.umd.js +6 -9
- package/components/IconButton/index.umd.js.map +1 -1
- package/components/IconButton/sgds-icon-button.d.ts +2 -2
- package/components/IconButton/sgds-icon-button.js +4 -9
- package/components/IconButton/sgds-icon-button.js.map +1 -1
- package/components/Input/index.umd.js +1734 -1376
- package/components/Input/index.umd.js.map +1 -1
- package/components/Input/sgds-input.d.ts +41 -21
- package/components/Input/sgds-input.js +103 -66
- package/components/Input/sgds-input.js.map +1 -1
- package/components/Modal/index.umd.js +2 -2
- package/components/Modal/index.umd.js.map +1 -1
- package/components/QuantityToggle/index.umd.js +894 -316
- package/components/QuantityToggle/index.umd.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.d.ts +42 -15
- package/components/QuantityToggle/sgds-quantity-toggle.js +129 -62
- package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/components/Radio/index.umd.js +516 -203
- package/components/Radio/index.umd.js.map +1 -1
- package/components/Radio/sgds-radio-group.d.ts +38 -27
- package/components/Radio/sgds-radio-group.js +100 -84
- package/components/Radio/sgds-radio-group.js.map +1 -1
- package/components/Radio/sgds-radio.js +1 -1
- package/components/Radio/sgds-radio.js.map +1 -1
- package/components/Stepper/index.umd.js +1 -0
- package/components/Stepper/index.umd.js.map +1 -1
- package/components/Stepper/sgds-stepper.d.ts +1 -0
- package/components/Stepper/sgds-stepper.js +1 -0
- package/components/Stepper/sgds-stepper.js.map +1 -1
- package/components/Switch/index.umd.js +21 -321
- package/components/Switch/index.umd.js.map +1 -1
- package/components/Switch/sgds-switch.js +1 -2
- package/components/Switch/sgds-switch.js.map +1 -1
- package/components/Textarea/index.umd.js +1554 -1336
- package/components/Textarea/index.umd.js.map +1 -1
- package/components/Textarea/sgds-textarea.d.ts +33 -22
- package/components/Textarea/sgds-textarea.js +78 -75
- package/components/Textarea/sgds-textarea.js.map +1 -1
- package/components/Textarea/textarea.js +1 -1
- package/components/Toast/index.umd.js +9 -21
- package/components/Toast/index.umd.js.map +1 -1
- package/components/Toast/sgds-toast.d.ts +2 -1
- package/components/Toast/sgds-toast.js +6 -18
- package/components/Toast/sgds-toast.js.map +1 -1
- package/components/Toast/toast.js +1 -1
- package/components/Tooltip/index.umd.js +14 -14
- package/components/Tooltip/index.umd.js.map +1 -1
- package/components/Tooltip/sgds-tooltip.d.ts +4 -7
- package/components/Tooltip/sgds-tooltip.js +14 -14
- package/components/Tooltip/sgds-tooltip.js.map +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/components/index.umd.js +1318 -1124
- package/components/index.umd.js.map +1 -1
- package/icons/arrow-bar-down.svg +3 -0
- package/icons/arrow-bar-left.svg +3 -0
- package/icons/arrow-bar-right.svg +3 -0
- package/icons/arrow-bar-up.svg +3 -0
- package/icons/arrow-clockwise.svg +3 -0
- package/icons/arrow-down.svg +3 -0
- package/icons/arrow-left.svg +3 -0
- package/icons/arrow-repeat.svg +3 -0
- package/icons/arrow-right.svg +3 -0
- package/icons/arrow-up.svg +3 -0
- package/icons/bank-fill.svg +3 -0
- package/icons/bell-slash.svg +3 -0
- package/icons/bell.svg +3 -0
- package/icons/bi-funnel.svg +3 -0
- package/icons/bookmark-fill.svg +3 -0
- package/icons/bookmark.svg +3 -0
- package/icons/box-arrow-up-right.svg +3 -0
- package/icons/box-seam.svg +3 -0
- package/icons/building.svg +3 -0
- package/icons/calculator.svg +3 -0
- package/icons/calendar-check.svg +4 -0
- package/icons/calendar-x.svg +4 -0
- package/icons/calendar.svg +3 -0
- package/icons/camera.svg +3 -0
- package/icons/chat-left-text.svg +3 -0
- package/icons/check-circle-fill.svg +3 -0
- package/icons/check-circle.svg +3 -0
- package/icons/check.svg +3 -0
- package/icons/chevron-down.svg +3 -0
- package/icons/chevron-left.svg +3 -0
- package/icons/chevron-right.svg +3 -0
- package/icons/chevron-up .svg +3 -0
- package/icons/clock.svg +4 -0
- package/icons/cloud-check.svg +4 -0
- package/icons/cloud-download.svg +3 -0
- package/icons/cloud-upload.svg +3 -0
- package/icons/cloud.svg +3 -0
- package/icons/compass.svg +4 -0
- package/icons/cross.svg +3 -0
- package/icons/cursor-fill.svg +3 -0
- package/icons/cursor.svg +3 -0
- package/icons/dash-circle.svg +3 -0
- package/icons/dash-square.svg +3 -0
- package/icons/dash.svg +3 -0
- package/icons/download.svg +3 -0
- package/icons/exclamation-circle-fill.svg +3 -0
- package/icons/exclamation-circle.svg +4 -0
- package/icons/exclamation-triangle-fill.svg +3 -0
- package/icons/exclamation-triangle.svg +4 -0
- package/icons/exclamation.svg +4 -0
- package/icons/eye-fill.svg +3 -0
- package/icons/eye-slash-fill.svg +4 -0
- package/icons/eye-slash.svg +3 -0
- package/icons/eye.svg +3 -0
- package/icons/facebook.svg +3 -0
- package/icons/file-earmark-text.svg +3 -0
- package/icons/file-pdf.svg +4 -0
- package/icons/file-plus.svg +4 -0
- package/icons/file-text.svg +3 -0
- package/icons/file.svg +3 -0
- package/icons/files.svg +4 -0
- package/icons/folder-check.svg +4 -0
- package/icons/folder-minus.svg +4 -0
- package/icons/folder-plus.svg +4 -0
- package/icons/folder.svg +3 -0
- package/icons/gear.svg +3 -0
- package/icons/geo-alt.svg +4 -0
- package/icons/geo-fill.svg +4 -0
- package/icons/geo.svg +4 -0
- package/icons/google.svg +3 -0
- package/icons/grid-fill.svg +3 -0
- package/icons/hand-thumbs-down.svg +3 -0
- package/icons/hand-thumbs-up.svg +3 -0
- package/icons/hdd.svg +3 -0
- package/icons/house-door.svg +3 -0
- package/icons/house.svg +3 -0
- package/icons/image.svg +3 -0
- package/icons/inbox.svg +3 -0
- package/icons/info-circle-fill.svg +3 -0
- package/icons/info-circle.svg +4 -0
- package/icons/instagram.svg +3 -0
- package/icons/layers.svg +3 -0
- package/icons/layout-text-window-reverse.svg +3 -0
- package/icons/layout-text-window.svg +3 -0
- package/icons/layout.svg +3 -0
- package/icons/link.svg +3 -0
- package/icons/linkedin.svg +3 -0
- package/icons/list.svg +3 -0
- package/icons/lock-fill.svg +3 -0
- package/icons/lock.svg +3 -0
- package/icons/mail.svg +3 -0
- package/icons/map.svg +3 -0
- package/icons/paperclip.svg +3 -0
- package/icons/pencil.svg +3 -0
- package/icons/pending-circle.svg +3 -0
- package/icons/person-dash.svg +3 -0
- package/icons/person-plus.svg +3 -0
- package/icons/person-x.svg +3 -0
- package/icons/person.svg +3 -0
- package/icons/pin-map-fill.svg +3 -0
- package/icons/pin.svg +3 -0
- package/icons/placeholder.svg +3 -0
- package/icons/plus-circle.svg +3 -0
- package/icons/plus-square.svg +3 -0
- package/icons/plus.svg +3 -0
- package/icons/printer.svg +3 -0
- package/icons/question-circle.svg +4 -0
- package/icons/save.svg +3 -0
- package/icons/search.svg +3 -0
- package/icons/share.svg +3 -0
- package/icons/slash-circle.svg +3 -0
- package/icons/sliders.svg +3 -0
- package/icons/speedometer.svg +3 -0
- package/icons/star-fill.svg +3 -0
- package/icons/star.svg +3 -0
- package/icons/stoplights.svg +4 -0
- package/icons/telephone.svg +3 -0
- package/icons/three-dots-vertical.svg +3 -0
- package/icons/three-dots.svg +3 -0
- package/icons/toggle-off.svg +3 -0
- package/icons/toggle-on.svg +3 -0
- package/icons/trash.svg +3 -0
- package/icons/twitter-x.svg +3 -0
- package/icons/unlock.svg +3 -0
- package/icons/upload.svg +3 -0
- package/icons/window-dash.svg +4 -0
- package/icons/window-desktop.svg +4 -0
- package/icons/window-dock.svg +4 -0
- package/icons/window-fullscreen.svg +3 -0
- package/icons/window-plus.svg +4 -0
- package/icons/window-sidebar.svg +3 -0
- package/icons/window-split.svg +3 -0
- package/icons/window-stack.svg +3 -0
- package/icons/window-x.svg +4 -0
- package/icons/window.svg +3 -0
- package/icons/x-circle-fill.svg +3 -0
- package/icons/x-circle.svg +3 -0
- package/icons/youtube.svg +3 -0
- package/icons/zoom-in.svg +3 -0
- package/icons/zoom-out.svg +3 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/index.umd.js +1338 -1119
- package/index.umd.js.map +1 -1
- package/internals/CloseButton/close-button.js +1 -1
- package/internals/CloseButton/sgds-close-button.js +1 -1
- package/internals/CloseButton/sgds-close-button.js.map +1 -1
- package/package.json +1 -1
- package/react/base/button.cjs.js +1 -1
- package/react/base/button.js +1 -1
- package/react/base/form-control-element.cjs.js +13 -23
- package/react/base/form-control-element.cjs.js.map +1 -1
- package/react/base/form-control-element.js +13 -23
- package/react/base/form-control-element.js.map +1 -1
- package/react/checkbox/index.cjs.js +2 -0
- package/react/checkbox/index.cjs.js.map +1 -1
- package/react/checkbox/index.d.ts +2 -0
- package/react/checkbox/index.js +2 -0
- package/react/checkbox/index.js.map +1 -1
- package/react/components/Accordion/accordion-item.cjs.js +1 -1
- package/react/components/Accordion/accordion-item.js +1 -1
- package/react/components/Accordion/sgds-accordion-item.cjs.js +6 -18
- package/react/components/Accordion/sgds-accordion-item.cjs.js.map +1 -1
- package/react/components/Accordion/sgds-accordion-item.js +6 -18
- package/react/components/Accordion/sgds-accordion-item.js.map +1 -1
- package/react/components/Alert/alert.cjs.js +1 -1
- package/react/components/Alert/alert.js +1 -1
- package/react/components/Alert/sgds-alert.cjs.js +5 -12
- package/react/components/Alert/sgds-alert.cjs.js.map +1 -1
- package/react/components/Alert/sgds-alert.js +6 -13
- package/react/components/Alert/sgds-alert.js.map +1 -1
- package/react/components/Badge/badge.cjs.js +1 -1
- package/react/components/Badge/badge.js +1 -1
- package/react/components/Badge/sgds-badge.cjs.js +5 -6
- package/react/components/Badge/sgds-badge.cjs.js.map +1 -1
- package/react/components/Badge/sgds-badge.js +5 -6
- package/react/components/Badge/sgds-badge.js.map +1 -1
- package/react/components/Button/sgds-button.cjs.js +2 -2
- package/react/components/Button/sgds-button.cjs.js.map +1 -1
- package/react/components/Button/sgds-button.js +1 -1
- package/react/components/Button/sgds-button.js.map +1 -1
- package/react/components/Checkbox/checkbox.cjs.js +1 -1
- package/react/components/Checkbox/checkbox.js +1 -1
- package/react/components/Checkbox/sgds-checkbox-group.cjs.js +15 -4
- package/react/components/Checkbox/sgds-checkbox-group.cjs.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox-group.js +15 -4
- package/react/components/Checkbox/sgds-checkbox-group.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox.cjs.js +77 -60
- package/react/components/Checkbox/sgds-checkbox.cjs.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox.js +77 -60
- package/react/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/react/components/Datepicker/datepicker-input.cjs.js +24 -7
- package/react/components/Datepicker/datepicker-input.cjs.js.map +1 -1
- package/react/components/Datepicker/datepicker-input.js +24 -7
- package/react/components/Datepicker/datepicker-input.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/react/components/FileUpload/file-upload.cjs.js +1 -1
- package/react/components/FileUpload/file-upload.js +1 -1
- package/react/components/FileUpload/sgds-file-upload.cjs.js +145 -101
- package/react/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
- package/react/components/FileUpload/sgds-file-upload.js +147 -103
- package/react/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/react/components/Footer/footer-item.cjs.js +11 -0
- package/react/components/Footer/footer-item.cjs.js.map +1 -0
- package/react/components/Footer/footer-item.js +7 -0
- package/react/components/Footer/footer-item.js.map +1 -0
- package/react/components/Footer/footer.cjs.js +1 -1
- package/react/components/Footer/footer.js +1 -1
- package/react/components/Footer/sgds-footer-item.cjs.js +33 -0
- package/react/components/Footer/sgds-footer-item.cjs.js.map +1 -0
- package/react/components/Footer/sgds-footer-item.js +28 -0
- package/react/components/Footer/sgds-footer-item.js.map +1 -0
- package/react/components/Footer/sgds-footer.cjs.js +65 -90
- package/react/components/Footer/sgds-footer.cjs.js.map +1 -1
- package/react/components/Footer/sgds-footer.js +65 -90
- package/react/components/Footer/sgds-footer.js.map +1 -1
- package/react/components/Icon/icon.cjs.js +11 -0
- package/react/components/Icon/icon.cjs.js.map +1 -0
- package/react/components/Icon/icon.js +7 -0
- package/react/components/Icon/icon.js.map +1 -0
- package/react/components/Icon/sgds-icon.cjs.js +70 -0
- package/react/components/Icon/sgds-icon.cjs.js.map +1 -0
- package/react/components/Icon/sgds-icon.js +65 -0
- package/react/components/Icon/sgds-icon.js.map +1 -0
- package/react/components/IconButton/icon-button.cjs.js +1 -1
- package/react/components/IconButton/icon-button.js +1 -1
- package/react/components/IconButton/sgds-icon-button.cjs.js +4 -9
- package/react/components/IconButton/sgds-icon-button.cjs.js.map +1 -1
- package/react/components/IconButton/sgds-icon-button.js +4 -9
- package/react/components/IconButton/sgds-icon-button.js.map +1 -1
- package/react/components/Input/sgds-input.cjs.js +101 -64
- package/react/components/Input/sgds-input.cjs.js.map +1 -1
- package/react/components/Input/sgds-input.js +103 -66
- package/react/components/Input/sgds-input.js.map +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js +128 -61
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.js +129 -62
- package/react/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/react/components/Radio/sgds-radio-group.cjs.js +99 -83
- package/react/components/Radio/sgds-radio-group.cjs.js.map +1 -1
- package/react/components/Radio/sgds-radio-group.js +100 -84
- package/react/components/Radio/sgds-radio-group.js.map +1 -1
- package/react/components/Radio/sgds-radio.cjs.js +1 -1
- package/react/components/Radio/sgds-radio.cjs.js.map +1 -1
- package/react/components/Radio/sgds-radio.js +1 -1
- package/react/components/Radio/sgds-radio.js.map +1 -1
- package/react/components/Stepper/sgds-stepper.cjs.js +1 -0
- package/react/components/Stepper/sgds-stepper.cjs.js.map +1 -1
- package/react/components/Stepper/sgds-stepper.js +1 -0
- package/react/components/Stepper/sgds-stepper.js.map +1 -1
- package/react/components/Switch/sgds-switch.cjs.js +1 -2
- package/react/components/Switch/sgds-switch.cjs.js.map +1 -1
- package/react/components/Switch/sgds-switch.js +1 -2
- package/react/components/Switch/sgds-switch.js.map +1 -1
- package/react/components/Textarea/sgds-textarea.cjs.js +76 -73
- package/react/components/Textarea/sgds-textarea.cjs.js.map +1 -1
- package/react/components/Textarea/sgds-textarea.js +78 -75
- package/react/components/Textarea/sgds-textarea.js.map +1 -1
- package/react/components/Textarea/textarea.cjs.js +1 -1
- package/react/components/Textarea/textarea.js +1 -1
- package/react/components/Toast/sgds-toast.cjs.js +6 -18
- package/react/components/Toast/sgds-toast.cjs.js.map +1 -1
- package/react/components/Toast/sgds-toast.js +6 -18
- package/react/components/Toast/sgds-toast.js.map +1 -1
- package/react/components/Toast/toast.cjs.js +1 -1
- package/react/components/Toast/toast.js +1 -1
- package/react/components/Tooltip/sgds-tooltip.cjs.js +14 -14
- package/react/components/Tooltip/sgds-tooltip.cjs.js.map +1 -1
- package/react/components/Tooltip/sgds-tooltip.js +14 -14
- package/react/components/Tooltip/sgds-tooltip.js.map +1 -1
- package/react/footer-item/index.cjs.js +39 -0
- package/react/footer-item/index.cjs.js.map +1 -0
- package/react/footer-item/index.d.ts +3 -0
- package/react/footer-item/index.js +15 -0
- package/react/footer-item/index.js.map +1 -0
- package/react/icon/index.cjs.js +42 -0
- package/react/icon/index.cjs.js.map +1 -0
- package/react/icon/index.d.ts +6 -0
- package/react/icon/index.js +18 -0
- package/react/icon/index.js.map +1 -0
- package/react/index.cjs.js +64 -60
- package/react/index.cjs.js.map +1 -1
- package/react/index.d.ts +2 -0
- package/react/index.js +2 -0
- package/react/index.js.map +1 -1
- package/react/input/index.cjs.js +3 -1
- package/react/input/index.cjs.js.map +1 -1
- package/react/input/index.d.ts +2 -0
- package/react/input/index.js +3 -1
- package/react/input/index.js.map +1 -1
- package/react/internals/CloseButton/close-button.cjs.js +1 -1
- package/react/internals/CloseButton/close-button.js +1 -1
- package/react/internals/CloseButton/sgds-close-button.cjs.js +1 -1
- package/react/internals/CloseButton/sgds-close-button.cjs.js.map +1 -1
- package/react/internals/CloseButton/sgds-close-button.js +1 -1
- package/react/internals/CloseButton/sgds-close-button.js.map +1 -1
- package/react/styles/form-hint.cjs.js +1 -1
- package/react/styles/form-hint.js +1 -1
- package/react/styles/form-label.cjs.js +1 -1
- package/react/styles/form-label.js +1 -1
- package/react/utils/formSubmitController.cjs.js +64 -0
- package/react/utils/formSubmitController.cjs.js.map +1 -0
- package/react/utils/formSubmitController.js +60 -0
- package/react/utils/formSubmitController.js.map +1 -0
- package/react/utils/inputValidationController.cjs.js +130 -0
- package/react/utils/inputValidationController.cjs.js.map +1 -0
- package/react/utils/inputValidationController.js +126 -0
- package/react/utils/inputValidationController.js.map +1 -0
- package/react/utils/validatorMixin.cjs.js +108 -0
- package/react/utils/validatorMixin.cjs.js.map +1 -0
- package/react/utils/validatorMixin.js +104 -0
- package/react/utils/validatorMixin.js.map +1 -0
- package/styles/form-hint.js +1 -1
- package/styles/form-label.js +1 -1
- package/themes/day.css +1 -1
- package/themes/night.css +3 -2
- package/themes/root.css +1 -0
- package/utils/{form.d.ts → formSubmitController.d.ts} +10 -20
- package/utils/formSubmitController.js +59 -0
- package/utils/formSubmitController.js.map +1 -0
- package/utils/inputValidationController.d.ts +70 -0
- package/utils/inputValidationController.js +125 -0
- package/utils/inputValidationController.js.map +1 -0
- package/utils/validatorMixin.d.ts +24 -0
- package/utils/validatorMixin.js +103 -0
- package/utils/validatorMixin.js.map +1 -0
- package/base/form-check-element.d.ts +0 -50
- package/base/form-check-element.js +0 -169
- package/base/form-check-element.js.map +0 -1
- package/react/base/form-check-element.cjs.js +0 -175
- package/react/base/form-check-element.cjs.js.map +0 -1
- package/react/base/form-check-element.js +0 -170
- package/react/base/form-check-element.js.map +0 -1
- package/react/utils/form.cjs.js +0 -137
- package/react/utils/form.cjs.js.map +0 -1
- package/react/utils/form.js +0 -133
- package/react/utils/form.js.map +0 -1
- package/utils/form.js +0 -132
- package/utils/form.js.map +0 -1
|
@@ -30,270 +30,6 @@
|
|
|
30
30
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const appliedClassMixins = new WeakMap();
|
|
34
|
-
|
|
35
|
-
/** Vefify if the Mixin was previously applyed
|
|
36
|
-
* @private
|
|
37
|
-
* @param {function} mixin Mixin being applyed
|
|
38
|
-
* @param {object} superClass Class receiving the new mixin
|
|
39
|
-
* @returns {boolean}
|
|
40
|
-
*/
|
|
41
|
-
function wasMixinPreviouslyApplied(mixin, superClass) {
|
|
42
|
-
let klass = superClass;
|
|
43
|
-
while (klass) {
|
|
44
|
-
if (appliedClassMixins.get(klass) === mixin) {
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
klass = Object.getPrototypeOf(klass);
|
|
48
|
-
}
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** Apply each mixin in the chain to make sure they are not applied more than once to the final class.
|
|
53
|
-
* @export
|
|
54
|
-
* @param {function} mixin Mixin to be applyed
|
|
55
|
-
* @returns {object} Mixed class with mixin applied
|
|
56
|
-
*/
|
|
57
|
-
function dedupeMixin(mixin) {
|
|
58
|
-
return superClass => {
|
|
59
|
-
if (wasMixinPreviouslyApplied(mixin, superClass)) {
|
|
60
|
-
return superClass;
|
|
61
|
-
}
|
|
62
|
-
const mixedClass = mixin(superClass);
|
|
63
|
-
appliedClassMixins.set(mixedClass, mixin);
|
|
64
|
-
return mixedClass;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @license
|
|
70
|
-
* Copyright 2019 Google LLC
|
|
71
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
72
|
-
*/
|
|
73
|
-
const global$5 = window;
|
|
74
|
-
/**
|
|
75
|
-
* Whether the current browser supports `adoptedStyleSheets`.
|
|
76
|
-
*/
|
|
77
|
-
const supportsAdoptingStyleSheets$2 = global$5.ShadowRoot &&
|
|
78
|
-
(global$5.ShadyCSS === undefined || global$5.ShadyCSS.nativeShadow) &&
|
|
79
|
-
'adoptedStyleSheets' in Document.prototype &&
|
|
80
|
-
'replace' in CSSStyleSheet.prototype;
|
|
81
|
-
/**
|
|
82
|
-
* Applies the given styles to a `shadowRoot`. When Shadow DOM is
|
|
83
|
-
* available but `adoptedStyleSheets` is not, styles are appended to the
|
|
84
|
-
* `shadowRoot` to [mimic spec behavior](https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets).
|
|
85
|
-
* Note, when shimming is used, any styles that are subsequently placed into
|
|
86
|
-
* the shadowRoot should be placed *before* any shimmed adopted styles. This
|
|
87
|
-
* will match spec behavior that gives adopted sheets precedence over styles in
|
|
88
|
-
* shadowRoot.
|
|
89
|
-
*/
|
|
90
|
-
const adoptStyles$2 = (renderRoot, styles) => {
|
|
91
|
-
if (supportsAdoptingStyleSheets$2) {
|
|
92
|
-
renderRoot.adoptedStyleSheets = styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
styles.forEach((s) => {
|
|
96
|
-
const style = document.createElement('style');
|
|
97
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
|
-
const nonce = global$5['litNonce'];
|
|
99
|
-
if (nonce !== undefined) {
|
|
100
|
-
style.setAttribute('nonce', nonce);
|
|
101
|
-
}
|
|
102
|
-
style.textContent = s.cssText;
|
|
103
|
-
renderRoot.appendChild(style);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* @typedef {import('./types').RenderOptions} RenderOptions
|
|
110
|
-
* @typedef {import('./types').ScopedElementsMixin} ScopedElementsMixin
|
|
111
|
-
* @typedef {import('./types').ScopedElementsHost} ScopedElementsHost
|
|
112
|
-
* @typedef {import('./types').ScopedElementsMap} ScopedElementsMap
|
|
113
|
-
* @typedef {import('@lit/reactive-element').CSSResultOrNative} CSSResultOrNative
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
// @ts-ignore
|
|
117
|
-
const supportsScopedRegistry = !!ShadowRoot.prototype.createElement;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* @template {import('./types').Constructor<HTMLElement>} T
|
|
121
|
-
* @param {T} superclass
|
|
122
|
-
* @return {T & import('./types').Constructor<ScopedElementsHost>}
|
|
123
|
-
*/
|
|
124
|
-
const ScopedElementsMixinImplementation = superclass =>
|
|
125
|
-
/** @type {ScopedElementsHost} */
|
|
126
|
-
class ScopedElementsHost extends superclass {
|
|
127
|
-
/**
|
|
128
|
-
* Obtains the scoped elements definitions map if specified.
|
|
129
|
-
*
|
|
130
|
-
* @returns {ScopedElementsMap}
|
|
131
|
-
*/
|
|
132
|
-
static get scopedElements() {
|
|
133
|
-
return {};
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Obtains the ShadowRoot options.
|
|
138
|
-
*
|
|
139
|
-
* @type {ShadowRootInit}
|
|
140
|
-
*/
|
|
141
|
-
static get shadowRootOptions() {
|
|
142
|
-
return this.__shadowRootOptions;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Set the shadowRoot options.
|
|
147
|
-
*
|
|
148
|
-
* @param {ShadowRootInit} value
|
|
149
|
-
*/
|
|
150
|
-
static set shadowRootOptions(value) {
|
|
151
|
-
this.__shadowRootOptions = value;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Obtains the element styles.
|
|
156
|
-
*
|
|
157
|
-
* @returns {CSSResultOrNative[]}
|
|
158
|
-
*/
|
|
159
|
-
static get elementStyles() {
|
|
160
|
-
return this.__elementStyles;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
static set elementStyles(styles) {
|
|
164
|
-
this.__elementStyles = styles;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// either TS or ESLint will complain here
|
|
168
|
-
// eslint-disable-next-line no-unused-vars
|
|
169
|
-
constructor(..._args) {
|
|
170
|
-
super();
|
|
171
|
-
/** @type {RenderOptions} */
|
|
172
|
-
this.renderOptions = this.renderOptions || undefined;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Obtains the CustomElementRegistry associated to the ShadowRoot.
|
|
177
|
-
*
|
|
178
|
-
* @returns {CustomElementRegistry}
|
|
179
|
-
*/
|
|
180
|
-
get registry() {
|
|
181
|
-
// @ts-ignore
|
|
182
|
-
return this.constructor.__registry;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Set the CustomElementRegistry associated to the ShadowRoot
|
|
187
|
-
*
|
|
188
|
-
* @param {CustomElementRegistry} registry
|
|
189
|
-
*/
|
|
190
|
-
set registry(registry) {
|
|
191
|
-
// @ts-ignore
|
|
192
|
-
this.constructor.__registry = registry;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
createRenderRoot() {
|
|
196
|
-
const { scopedElements, shadowRootOptions, elementStyles } =
|
|
197
|
-
/** @type {typeof ScopedElementsHost} */ (this.constructor);
|
|
198
|
-
|
|
199
|
-
const shouldCreateRegistry =
|
|
200
|
-
!this.registry ||
|
|
201
|
-
// @ts-ignore
|
|
202
|
-
(this.registry === this.constructor.__registry &&
|
|
203
|
-
!Object.prototype.hasOwnProperty.call(this.constructor, '__registry'));
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Create a new registry if:
|
|
207
|
-
* - the registry is not defined
|
|
208
|
-
* - this class doesn't have its own registry *AND* has no shared registry
|
|
209
|
-
*/
|
|
210
|
-
if (shouldCreateRegistry) {
|
|
211
|
-
this.registry = supportsScopedRegistry ? new CustomElementRegistry() : customElements;
|
|
212
|
-
for (const [tagName, klass] of Object.entries(scopedElements)) {
|
|
213
|
-
this.defineScopedElement(tagName, klass);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/** @type {ShadowRootInit} */
|
|
218
|
-
const options = {
|
|
219
|
-
mode: 'open',
|
|
220
|
-
...shadowRootOptions,
|
|
221
|
-
customElements: this.registry,
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
const createdRoot = this.attachShadow(options);
|
|
225
|
-
if (supportsScopedRegistry) {
|
|
226
|
-
this.renderOptions.creationScope = createdRoot;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
if (createdRoot instanceof ShadowRoot) {
|
|
230
|
-
adoptStyles$2(createdRoot, elementStyles);
|
|
231
|
-
this.renderOptions.renderBefore = this.renderOptions.renderBefore || createdRoot.firstChild;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
return createdRoot;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
createScopedElement(tagName) {
|
|
238
|
-
const root = supportsScopedRegistry ? this.shadowRoot : document;
|
|
239
|
-
// @ts-ignore polyfill to support createElement on shadowRoot is loaded
|
|
240
|
-
return root.createElement(tagName);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Defines a scoped element.
|
|
245
|
-
*
|
|
246
|
-
* @param {string} tagName
|
|
247
|
-
* @param {typeof HTMLElement} klass
|
|
248
|
-
*/
|
|
249
|
-
defineScopedElement(tagName, klass) {
|
|
250
|
-
const registeredClass = this.registry.get(tagName);
|
|
251
|
-
if (registeredClass && supportsScopedRegistry === false && registeredClass !== klass) {
|
|
252
|
-
// eslint-disable-next-line no-console
|
|
253
|
-
console.error(
|
|
254
|
-
[
|
|
255
|
-
`You are trying to re-register the "${tagName}" custom element with a different class via ScopedElementsMixin.`,
|
|
256
|
-
'This is only possible with a CustomElementRegistry.',
|
|
257
|
-
'Your browser does not support this feature so you will need to load a polyfill for it.',
|
|
258
|
-
'Load "@webcomponents/scoped-custom-element-registry" before you register ANY web component to the global customElements registry.',
|
|
259
|
-
'e.g. add "<script src="/node_modules/@webcomponents/scoped-custom-element-registry/scoped-custom-element-registry.min.js"></script>" as your first script tag.',
|
|
260
|
-
'For more details you can visit https://open-wc.org/docs/development/scoped-elements/',
|
|
261
|
-
].join('\n'),
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
if (!registeredClass) {
|
|
265
|
-
return this.registry.define(tagName, klass);
|
|
266
|
-
}
|
|
267
|
-
return this.registry.get(tagName);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* @deprecated use the native el.tagName instead
|
|
272
|
-
*
|
|
273
|
-
* @param {string} tagName
|
|
274
|
-
* @returns {string} the tag name
|
|
275
|
-
*/
|
|
276
|
-
// eslint-disable-next-line class-methods-use-this
|
|
277
|
-
getScopedTagName(tagName) {
|
|
278
|
-
// @ts-ignore
|
|
279
|
-
return this.constructor.getScopedTagName(tagName);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* @deprecated use the native el.tagName instead
|
|
284
|
-
*
|
|
285
|
-
* @param {string} tagName
|
|
286
|
-
* @returns {string} the tag name
|
|
287
|
-
*/
|
|
288
|
-
// eslint-disable-next-line class-methods-use-this
|
|
289
|
-
static getScopedTagName(tagName) {
|
|
290
|
-
// @ts-ignore
|
|
291
|
-
return this.__registry.get(tagName) ? tagName : undefined;
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
const ScopedElementsMixin = dedupeMixin(ScopedElementsMixinImplementation);
|
|
296
|
-
|
|
297
33
|
/**
|
|
298
34
|
* @license
|
|
299
35
|
* Copyright 2019 Google LLC
|
|
@@ -301,12 +37,12 @@
|
|
|
301
37
|
*/
|
|
302
38
|
const NODE_MODE$1 = false;
|
|
303
39
|
// Allows minifiers to rename references to globalThis
|
|
304
|
-
const global$
|
|
40
|
+
const global$5 = globalThis;
|
|
305
41
|
/**
|
|
306
42
|
* Whether the current browser supports `adoptedStyleSheets`.
|
|
307
43
|
*/
|
|
308
|
-
const supportsAdoptingStyleSheets$
|
|
309
|
-
(global$
|
|
44
|
+
const supportsAdoptingStyleSheets$2 = global$5.ShadowRoot &&
|
|
45
|
+
(global$5.ShadyCSS === undefined || global$5.ShadyCSS.nativeShadow) &&
|
|
310
46
|
'adoptedStyleSheets' in Document.prototype &&
|
|
311
47
|
'replace' in CSSStyleSheet.prototype;
|
|
312
48
|
const constructionToken$1 = Symbol();
|
|
@@ -335,7 +71,7 @@
|
|
|
335
71
|
// constructable.
|
|
336
72
|
let styleSheet = this._styleSheet;
|
|
337
73
|
const strings = this._strings;
|
|
338
|
-
if (supportsAdoptingStyleSheets$
|
|
74
|
+
if (supportsAdoptingStyleSheets$2 && styleSheet === undefined) {
|
|
339
75
|
const cacheable = strings !== undefined && strings.length === 1;
|
|
340
76
|
if (cacheable) {
|
|
341
77
|
styleSheet = cssTagCache$1.get(strings);
|
|
@@ -370,15 +106,15 @@
|
|
|
370
106
|
* will match spec behavior that gives adopted sheets precedence over styles in
|
|
371
107
|
* shadowRoot.
|
|
372
108
|
*/
|
|
373
|
-
const adoptStyles$
|
|
374
|
-
if (supportsAdoptingStyleSheets$
|
|
109
|
+
const adoptStyles$2 = (renderRoot, styles) => {
|
|
110
|
+
if (supportsAdoptingStyleSheets$2) {
|
|
375
111
|
renderRoot.adoptedStyleSheets = styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
|
|
376
112
|
}
|
|
377
113
|
else {
|
|
378
114
|
for (const s of styles) {
|
|
379
115
|
const style = document.createElement('style');
|
|
380
116
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
381
|
-
const nonce = global$
|
|
117
|
+
const nonce = global$5['litNonce'];
|
|
382
118
|
if (nonce !== undefined) {
|
|
383
119
|
style.setAttribute('nonce', nonce);
|
|
384
120
|
}
|
|
@@ -394,7 +130,7 @@
|
|
|
394
130
|
}
|
|
395
131
|
return unsafeCSS$1(cssText);
|
|
396
132
|
};
|
|
397
|
-
const getCompatibleStyle$1 = supportsAdoptingStyleSheets$
|
|
133
|
+
const getCompatibleStyle$1 = supportsAdoptingStyleSheets$2 ||
|
|
398
134
|
(NODE_MODE$1 )
|
|
399
135
|
? (s) => s
|
|
400
136
|
: (s) => s instanceof CSSStyleSheet ? cssResultFromStyleSheet$1(s) : s;
|
|
@@ -407,9 +143,9 @@
|
|
|
407
143
|
// TODO (justinfagnani): Add `hasOwn` here when we ship ES2022
|
|
408
144
|
const { is: is$1, defineProperty: defineProperty$1, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getOwnPropertySymbols: getOwnPropertySymbols$1, getPrototypeOf: getPrototypeOf$1, } = Object;
|
|
409
145
|
// Lets a minifier replace globalThis references with a minified name
|
|
410
|
-
const global$
|
|
146
|
+
const global$4 = globalThis;
|
|
411
147
|
let issueWarning$4;
|
|
412
|
-
const trustedTypes$2 = global$
|
|
148
|
+
const trustedTypes$2 = global$4
|
|
413
149
|
.trustedTypes;
|
|
414
150
|
// Temporary workaround for https://crbug.com/993268
|
|
415
151
|
// Currently, any attribute starting with "on" is considered to be a
|
|
@@ -418,12 +154,12 @@
|
|
|
418
154
|
const emptyStringForBooleanAttribute$1 = trustedTypes$2
|
|
419
155
|
? trustedTypes$2.emptyScript
|
|
420
156
|
: '';
|
|
421
|
-
const polyfillSupport$3 = global$
|
|
157
|
+
const polyfillSupport$3 = global$4.reactiveElementPolyfillSupportDevMode
|
|
422
158
|
;
|
|
423
159
|
{
|
|
424
160
|
// Ensure warnings are issued only 1x, even if multiple versions of Lit
|
|
425
161
|
// are loaded.
|
|
426
|
-
const issuedWarnings = (global$
|
|
162
|
+
const issuedWarnings = (global$4.litIssuedWarnings ??=
|
|
427
163
|
new Set());
|
|
428
164
|
// Issue a warning, if we haven't already.
|
|
429
165
|
issueWarning$4 = (code, warning) => {
|
|
@@ -435,7 +171,7 @@
|
|
|
435
171
|
};
|
|
436
172
|
issueWarning$4('dev-mode', `Lit is in dev mode. Not recommended for production!`);
|
|
437
173
|
// Issue polyfill support warning.
|
|
438
|
-
if (global$
|
|
174
|
+
if (global$4.ShadyDOM?.inUse && polyfillSupport$3 === undefined) {
|
|
439
175
|
issueWarning$4('polyfill-support-missing', `Shadow DOM is being polyfilled via \`ShadyDOM\` but ` +
|
|
440
176
|
`the \`polyfill-support\` module has not been loaded.`);
|
|
441
177
|
}
|
|
@@ -446,12 +182,12 @@
|
|
|
446
182
|
* Compiled out of prod mode builds.
|
|
447
183
|
*/
|
|
448
184
|
const debugLogEvent$2 = (event) => {
|
|
449
|
-
const shouldEmit = global$
|
|
185
|
+
const shouldEmit = global$4
|
|
450
186
|
.emitLitDebugLogEvents;
|
|
451
187
|
if (!shouldEmit) {
|
|
452
188
|
return;
|
|
453
189
|
}
|
|
454
|
-
global$
|
|
190
|
+
global$4.dispatchEvent(new CustomEvent('lit-debug', {
|
|
455
191
|
detail: event,
|
|
456
192
|
}));
|
|
457
193
|
}
|
|
@@ -523,7 +259,7 @@
|
|
|
523
259
|
// Map from a class's metadata object to property options
|
|
524
260
|
// Note that we must use nullish-coalescing assignment so that we only use one
|
|
525
261
|
// map even if we load multiple version of this module.
|
|
526
|
-
global$
|
|
262
|
+
global$4.litPropertyMetadata ??= new WeakMap();
|
|
527
263
|
/**
|
|
528
264
|
* Base element class which manages element properties and attributes. When
|
|
529
265
|
* properties change, the `update` method is asynchronously called. This method
|
|
@@ -943,7 +679,7 @@
|
|
|
943
679
|
createRenderRoot() {
|
|
944
680
|
const renderRoot = this.shadowRoot ??
|
|
945
681
|
this.attachShadow(this.constructor.shadowRootOptions);
|
|
946
|
-
adoptStyles$
|
|
682
|
+
adoptStyles$2(renderRoot, this.constructor.elementStyles);
|
|
947
683
|
return renderRoot;
|
|
948
684
|
}
|
|
949
685
|
/**
|
|
@@ -1450,8 +1186,8 @@
|
|
|
1450
1186
|
}
|
|
1451
1187
|
// IMPORTANT: do not change the property name or the assignment expression.
|
|
1452
1188
|
// This line will be used in regexes to search for ReactiveElement usage.
|
|
1453
|
-
(global$
|
|
1454
|
-
if (global$
|
|
1189
|
+
(global$4.reactiveElementVersions ??= []).push('2.0.4');
|
|
1190
|
+
if (global$4.reactiveElementVersions.length > 1) {
|
|
1455
1191
|
issueWarning$4('multiple-versions', `Multiple versions of Lit loaded. Loading multiple versions ` +
|
|
1456
1192
|
`is not recommended.`);
|
|
1457
1193
|
}
|
|
@@ -1462,19 +1198,19 @@
|
|
|
1462
1198
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1463
1199
|
*/
|
|
1464
1200
|
// Allows minifiers to rename references to globalThis
|
|
1465
|
-
const global$
|
|
1201
|
+
const global$3 = globalThis;
|
|
1466
1202
|
/**
|
|
1467
1203
|
* Useful for visualizing and logging insights into what the Lit template system is doing.
|
|
1468
1204
|
*
|
|
1469
1205
|
* Compiled out of prod mode builds.
|
|
1470
1206
|
*/
|
|
1471
1207
|
const debugLogEvent$1 = (event) => {
|
|
1472
|
-
const shouldEmit = global$
|
|
1208
|
+
const shouldEmit = global$3
|
|
1473
1209
|
.emitLitDebugLogEvents;
|
|
1474
1210
|
if (!shouldEmit) {
|
|
1475
1211
|
return;
|
|
1476
1212
|
}
|
|
1477
|
-
global$
|
|
1213
|
+
global$3.dispatchEvent(new CustomEvent('lit-debug', {
|
|
1478
1214
|
detail: event,
|
|
1479
1215
|
}));
|
|
1480
1216
|
}
|
|
@@ -1485,24 +1221,24 @@
|
|
|
1485
1221
|
let debugLogRenderId = 0;
|
|
1486
1222
|
let issueWarning$3;
|
|
1487
1223
|
{
|
|
1488
|
-
global$
|
|
1224
|
+
global$3.litIssuedWarnings ??= new Set();
|
|
1489
1225
|
// Issue a warning, if we haven't already.
|
|
1490
1226
|
issueWarning$3 = (code, warning) => {
|
|
1491
1227
|
warning += code
|
|
1492
1228
|
? ` See https://lit.dev/msg/${code} for more information.`
|
|
1493
1229
|
: '';
|
|
1494
|
-
if (!global$
|
|
1230
|
+
if (!global$3.litIssuedWarnings.has(warning)) {
|
|
1495
1231
|
console.warn(warning);
|
|
1496
|
-
global$
|
|
1232
|
+
global$3.litIssuedWarnings.add(warning);
|
|
1497
1233
|
}
|
|
1498
1234
|
};
|
|
1499
1235
|
issueWarning$3('dev-mode', `Lit is in dev mode. Not recommended for production!`);
|
|
1500
1236
|
}
|
|
1501
|
-
const wrap = global$
|
|
1502
|
-
global$
|
|
1503
|
-
? global$
|
|
1237
|
+
const wrap = global$3.ShadyDOM?.inUse &&
|
|
1238
|
+
global$3.ShadyDOM?.noPatch === true
|
|
1239
|
+
? global$3.ShadyDOM.wrap
|
|
1504
1240
|
: (node) => node;
|
|
1505
|
-
const trustedTypes$1 = global$
|
|
1241
|
+
const trustedTypes$1 = global$3.trustedTypes;
|
|
1506
1242
|
/**
|
|
1507
1243
|
* Our TrustedTypePolicy for HTML which is declared using the html template
|
|
1508
1244
|
* tag function.
|
|
@@ -1617,9 +1353,9 @@
|
|
|
1617
1353
|
* text content for marker strings.
|
|
1618
1354
|
*/
|
|
1619
1355
|
const rawTextElement = /^(?:script|style|textarea|title)$/i;
|
|
1620
|
-
/** TemplateResult types */
|
|
1621
|
-
const HTML_RESULT = 1;
|
|
1622
|
-
const SVG_RESULT = 2;
|
|
1356
|
+
/** TemplateResult types */
|
|
1357
|
+
const HTML_RESULT$1 = 1;
|
|
1358
|
+
const SVG_RESULT$1 = 2;
|
|
1623
1359
|
const MATHML_RESULT = 3;
|
|
1624
1360
|
// TemplatePart types
|
|
1625
1361
|
// IMPORTANT: these must match the values in PartType
|
|
@@ -1671,7 +1407,7 @@
|
|
|
1671
1407
|
* if a template comes from the same expression as a previously rendered result,
|
|
1672
1408
|
* it's efficiently updated instead of replaced.
|
|
1673
1409
|
*/
|
|
1674
|
-
const html$1 = tag(HTML_RESULT);
|
|
1410
|
+
const html$1 = tag(HTML_RESULT$1);
|
|
1675
1411
|
/**
|
|
1676
1412
|
* A sentinel value that signals that a value was handled by a directive and
|
|
1677
1413
|
* should not be written to the DOM.
|
|
@@ -1760,7 +1496,7 @@
|
|
|
1760
1496
|
// parts. ElementParts are also reflected in this array as undefined
|
|
1761
1497
|
// rather than a string, to disambiguate from attribute bindings.
|
|
1762
1498
|
const attrNames = [];
|
|
1763
|
-
let html = type === SVG_RESULT ? '<svg>' : type === MATHML_RESULT ? '<math>' : '';
|
|
1499
|
+
let html = type === SVG_RESULT$1 ? '<svg>' : type === MATHML_RESULT ? '<math>' : '';
|
|
1764
1500
|
// When we're inside a raw text tag (not it's text content), the regex
|
|
1765
1501
|
// will still be tagRegex so we can find attributes, but will switch to
|
|
1766
1502
|
// this regex when the tag ends.
|
|
@@ -1886,7 +1622,7 @@
|
|
|
1886
1622
|
}
|
|
1887
1623
|
const htmlResult = html +
|
|
1888
1624
|
(strings[l] || '<?>') +
|
|
1889
|
-
(type === SVG_RESULT ? '</svg>' : type === MATHML_RESULT ? '</math>' : '');
|
|
1625
|
+
(type === SVG_RESULT$1 ? '</svg>' : type === MATHML_RESULT ? '</math>' : '');
|
|
1890
1626
|
// Returned as an array for terseness
|
|
1891
1627
|
return [trustFromTemplateString(strings, htmlResult), attrNames];
|
|
1892
1628
|
};
|
|
@@ -1905,7 +1641,7 @@
|
|
|
1905
1641
|
this.el = Template.createElement(html, options);
|
|
1906
1642
|
walker.currentNode = this.el.content;
|
|
1907
1643
|
// Re-parent SVG or MathML nodes into template root
|
|
1908
|
-
if (type === SVG_RESULT || type === MATHML_RESULT) {
|
|
1644
|
+
if (type === SVG_RESULT$1 || type === MATHML_RESULT) {
|
|
1909
1645
|
const wrapper = this.el.content.firstChild;
|
|
1910
1646
|
wrapper.replaceWith(...wrapper.childNodes);
|
|
1911
1647
|
}
|
|
@@ -2766,13 +2502,13 @@
|
|
|
2766
2502
|
}
|
|
2767
2503
|
}
|
|
2768
2504
|
// Apply polyfills if available
|
|
2769
|
-
const polyfillSupport$2 = global$
|
|
2505
|
+
const polyfillSupport$2 = global$3.litHtmlPolyfillSupportDevMode
|
|
2770
2506
|
;
|
|
2771
2507
|
polyfillSupport$2?.(Template, ChildPart);
|
|
2772
2508
|
// IMPORTANT: do not change the property name or the assignment expression.
|
|
2773
2509
|
// This line will be used in regexes to search for lit-html usage.
|
|
2774
|
-
(global$
|
|
2775
|
-
if (global$
|
|
2510
|
+
(global$3.litHtmlVersions ??= []).push('3.2.0');
|
|
2511
|
+
if (global$3.litHtmlVersions.length > 1) {
|
|
2776
2512
|
issueWarning$3('multiple-versions', `Multiple versions of Lit loaded. ` +
|
|
2777
2513
|
`Loading multiple versions is not recommended.`);
|
|
2778
2514
|
}
|
|
@@ -2857,12 +2593,12 @@
|
|
|
2857
2593
|
*/
|
|
2858
2594
|
const NODE_MODE = false;
|
|
2859
2595
|
// Allows minifiers to rename references to globalThis
|
|
2860
|
-
const global$
|
|
2596
|
+
const global$2 = globalThis;
|
|
2861
2597
|
/**
|
|
2862
2598
|
* Whether the current browser supports `adoptedStyleSheets`.
|
|
2863
2599
|
*/
|
|
2864
|
-
const supportsAdoptingStyleSheets = global$
|
|
2865
|
-
(global$
|
|
2600
|
+
const supportsAdoptingStyleSheets$1 = global$2.ShadowRoot &&
|
|
2601
|
+
(global$2.ShadyCSS === undefined || global$2.ShadyCSS.nativeShadow) &&
|
|
2866
2602
|
'adoptedStyleSheets' in Document.prototype &&
|
|
2867
2603
|
'replace' in CSSStyleSheet.prototype;
|
|
2868
2604
|
const constructionToken = Symbol();
|
|
@@ -2891,7 +2627,7 @@
|
|
|
2891
2627
|
// constructable.
|
|
2892
2628
|
let styleSheet = this._styleSheet;
|
|
2893
2629
|
const strings = this._strings;
|
|
2894
|
-
if (supportsAdoptingStyleSheets && styleSheet === undefined) {
|
|
2630
|
+
if (supportsAdoptingStyleSheets$1 && styleSheet === undefined) {
|
|
2895
2631
|
const cacheable = strings !== undefined && strings.length === 1;
|
|
2896
2632
|
if (cacheable) {
|
|
2897
2633
|
styleSheet = cssTagCache.get(strings);
|
|
@@ -2954,15 +2690,15 @@
|
|
|
2954
2690
|
* will match spec behavior that gives adopted sheets precedence over styles in
|
|
2955
2691
|
* shadowRoot.
|
|
2956
2692
|
*/
|
|
2957
|
-
const adoptStyles = (renderRoot, styles) => {
|
|
2958
|
-
if (supportsAdoptingStyleSheets) {
|
|
2693
|
+
const adoptStyles$1 = (renderRoot, styles) => {
|
|
2694
|
+
if (supportsAdoptingStyleSheets$1) {
|
|
2959
2695
|
renderRoot.adoptedStyleSheets = styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
|
|
2960
2696
|
}
|
|
2961
2697
|
else {
|
|
2962
2698
|
for (const s of styles) {
|
|
2963
2699
|
const style = document.createElement('style');
|
|
2964
2700
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2965
|
-
const nonce = global$
|
|
2701
|
+
const nonce = global$2['litNonce'];
|
|
2966
2702
|
if (nonce !== undefined) {
|
|
2967
2703
|
style.setAttribute('nonce', nonce);
|
|
2968
2704
|
}
|
|
@@ -2978,7 +2714,7 @@
|
|
|
2978
2714
|
}
|
|
2979
2715
|
return unsafeCSS(cssText);
|
|
2980
2716
|
};
|
|
2981
|
-
const getCompatibleStyle = supportsAdoptingStyleSheets ||
|
|
2717
|
+
const getCompatibleStyle = supportsAdoptingStyleSheets$1 ||
|
|
2982
2718
|
(NODE_MODE )
|
|
2983
2719
|
? (s) => s
|
|
2984
2720
|
: (s) => s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;
|
|
@@ -2991,9 +2727,9 @@
|
|
|
2991
2727
|
// TODO (justinfagnani): Add `hasOwn` here when we ship ES2022
|
|
2992
2728
|
const { is, defineProperty, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, } = Object;
|
|
2993
2729
|
// Lets a minifier replace globalThis references with a minified name
|
|
2994
|
-
const global = globalThis;
|
|
2730
|
+
const global$1 = globalThis;
|
|
2995
2731
|
let issueWarning$2;
|
|
2996
|
-
const trustedTypes = global
|
|
2732
|
+
const trustedTypes = global$1
|
|
2997
2733
|
.trustedTypes;
|
|
2998
2734
|
// Temporary workaround for https://crbug.com/993268
|
|
2999
2735
|
// Currently, any attribute starting with "on" is considered to be a
|
|
@@ -3002,12 +2738,12 @@
|
|
|
3002
2738
|
const emptyStringForBooleanAttribute = trustedTypes
|
|
3003
2739
|
? trustedTypes.emptyScript
|
|
3004
2740
|
: '';
|
|
3005
|
-
const polyfillSupport$1 = global.reactiveElementPolyfillSupportDevMode
|
|
2741
|
+
const polyfillSupport$1 = global$1.reactiveElementPolyfillSupportDevMode
|
|
3006
2742
|
;
|
|
3007
2743
|
{
|
|
3008
2744
|
// Ensure warnings are issued only 1x, even if multiple versions of Lit
|
|
3009
2745
|
// are loaded.
|
|
3010
|
-
const issuedWarnings = (global.litIssuedWarnings ??=
|
|
2746
|
+
const issuedWarnings = (global$1.litIssuedWarnings ??=
|
|
3011
2747
|
new Set());
|
|
3012
2748
|
// Issue a warning, if we haven't already.
|
|
3013
2749
|
issueWarning$2 = (code, warning) => {
|
|
@@ -3019,7 +2755,7 @@
|
|
|
3019
2755
|
};
|
|
3020
2756
|
issueWarning$2('dev-mode', `Lit is in dev mode. Not recommended for production!`);
|
|
3021
2757
|
// Issue polyfill support warning.
|
|
3022
|
-
if (global.ShadyDOM?.inUse && polyfillSupport$1 === undefined) {
|
|
2758
|
+
if (global$1.ShadyDOM?.inUse && polyfillSupport$1 === undefined) {
|
|
3023
2759
|
issueWarning$2('polyfill-support-missing', `Shadow DOM is being polyfilled via \`ShadyDOM\` but ` +
|
|
3024
2760
|
`the \`polyfill-support\` module has not been loaded.`);
|
|
3025
2761
|
}
|
|
@@ -3030,12 +2766,12 @@
|
|
|
3030
2766
|
* Compiled out of prod mode builds.
|
|
3031
2767
|
*/
|
|
3032
2768
|
const debugLogEvent = (event) => {
|
|
3033
|
-
const shouldEmit = global
|
|
2769
|
+
const shouldEmit = global$1
|
|
3034
2770
|
.emitLitDebugLogEvents;
|
|
3035
2771
|
if (!shouldEmit) {
|
|
3036
2772
|
return;
|
|
3037
2773
|
}
|
|
3038
|
-
global.dispatchEvent(new CustomEvent('lit-debug', {
|
|
2774
|
+
global$1.dispatchEvent(new CustomEvent('lit-debug', {
|
|
3039
2775
|
detail: event,
|
|
3040
2776
|
}));
|
|
3041
2777
|
}
|
|
@@ -3107,7 +2843,7 @@
|
|
|
3107
2843
|
// Map from a class's metadata object to property options
|
|
3108
2844
|
// Note that we must use nullish-coalescing assignment so that we only use one
|
|
3109
2845
|
// map even if we load multiple version of this module.
|
|
3110
|
-
global.litPropertyMetadata ??= new WeakMap();
|
|
2846
|
+
global$1.litPropertyMetadata ??= new WeakMap();
|
|
3111
2847
|
/**
|
|
3112
2848
|
* Base element class which manages element properties and attributes. When
|
|
3113
2849
|
* properties change, the `update` method is asynchronously called. This method
|
|
@@ -3527,7 +3263,7 @@
|
|
|
3527
3263
|
createRenderRoot() {
|
|
3528
3264
|
const renderRoot = this.shadowRoot ??
|
|
3529
3265
|
this.attachShadow(this.constructor.shadowRootOptions);
|
|
3530
|
-
adoptStyles(renderRoot, this.constructor.elementStyles);
|
|
3266
|
+
adoptStyles$1(renderRoot, this.constructor.elementStyles);
|
|
3531
3267
|
return renderRoot;
|
|
3532
3268
|
}
|
|
3533
3269
|
/**
|
|
@@ -4034,8 +3770,8 @@
|
|
|
4034
3770
|
}
|
|
4035
3771
|
// IMPORTANT: do not change the property name or the assignment expression.
|
|
4036
3772
|
// This line will be used in regexes to search for ReactiveElement usage.
|
|
4037
|
-
(global.reactiveElementVersions ??= []).push('2.0.4');
|
|
4038
|
-
if (global.reactiveElementVersions.length > 1) {
|
|
3773
|
+
(global$1.reactiveElementVersions ??= []).push('2.0.4');
|
|
3774
|
+
if (global$1.reactiveElementVersions.length > 1) {
|
|
4039
3775
|
issueWarning$2('multiple-versions', `Multiple versions of Lit loaded. Loading multiple versions ` +
|
|
4040
3776
|
`is not recommended.`);
|
|
4041
3777
|
}
|
|
@@ -4105,98 +3841,362 @@
|
|
|
4105
3841
|
* @param changedProperties Map of changed properties with old values
|
|
4106
3842
|
* @category updates
|
|
4107
3843
|
*/
|
|
4108
|
-
update(changedProperties) {
|
|
4109
|
-
// Setting properties in `render` should not trigger an update. Since
|
|
4110
|
-
// updates are allowed after super.update, it's important to call `render`
|
|
4111
|
-
// before that.
|
|
4112
|
-
const value = this.render();
|
|
4113
|
-
if (!this.hasUpdated) {
|
|
4114
|
-
this.renderOptions.isConnected = this.isConnected;
|
|
3844
|
+
update(changedProperties) {
|
|
3845
|
+
// Setting properties in `render` should not trigger an update. Since
|
|
3846
|
+
// updates are allowed after super.update, it's important to call `render`
|
|
3847
|
+
// before that.
|
|
3848
|
+
const value = this.render();
|
|
3849
|
+
if (!this.hasUpdated) {
|
|
3850
|
+
this.renderOptions.isConnected = this.isConnected;
|
|
3851
|
+
}
|
|
3852
|
+
super.update(changedProperties);
|
|
3853
|
+
this.__childPart = render(value, this.renderRoot, this.renderOptions);
|
|
3854
|
+
}
|
|
3855
|
+
/**
|
|
3856
|
+
* Invoked when the component is added to the document's DOM.
|
|
3857
|
+
*
|
|
3858
|
+
* In `connectedCallback()` you should setup tasks that should only occur when
|
|
3859
|
+
* the element is connected to the document. The most common of these is
|
|
3860
|
+
* adding event listeners to nodes external to the element, like a keydown
|
|
3861
|
+
* event handler added to the window.
|
|
3862
|
+
*
|
|
3863
|
+
* ```ts
|
|
3864
|
+
* connectedCallback() {
|
|
3865
|
+
* super.connectedCallback();
|
|
3866
|
+
* addEventListener('keydown', this._handleKeydown);
|
|
3867
|
+
* }
|
|
3868
|
+
* ```
|
|
3869
|
+
*
|
|
3870
|
+
* Typically, anything done in `connectedCallback()` should be undone when the
|
|
3871
|
+
* element is disconnected, in `disconnectedCallback()`.
|
|
3872
|
+
*
|
|
3873
|
+
* @category lifecycle
|
|
3874
|
+
*/
|
|
3875
|
+
connectedCallback() {
|
|
3876
|
+
super.connectedCallback();
|
|
3877
|
+
this.__childPart?.setConnected(true);
|
|
3878
|
+
}
|
|
3879
|
+
/**
|
|
3880
|
+
* Invoked when the component is removed from the document's DOM.
|
|
3881
|
+
*
|
|
3882
|
+
* This callback is the main signal to the element that it may no longer be
|
|
3883
|
+
* used. `disconnectedCallback()` should ensure that nothing is holding a
|
|
3884
|
+
* reference to the element (such as event listeners added to nodes external
|
|
3885
|
+
* to the element), so that it is free to be garbage collected.
|
|
3886
|
+
*
|
|
3887
|
+
* ```ts
|
|
3888
|
+
* disconnectedCallback() {
|
|
3889
|
+
* super.disconnectedCallback();
|
|
3890
|
+
* window.removeEventListener('keydown', this._handleKeydown);
|
|
3891
|
+
* }
|
|
3892
|
+
* ```
|
|
3893
|
+
*
|
|
3894
|
+
* An element may be re-connected after being disconnected.
|
|
3895
|
+
*
|
|
3896
|
+
* @category lifecycle
|
|
3897
|
+
*/
|
|
3898
|
+
disconnectedCallback() {
|
|
3899
|
+
super.disconnectedCallback();
|
|
3900
|
+
this.__childPart?.setConnected(false);
|
|
3901
|
+
}
|
|
3902
|
+
/**
|
|
3903
|
+
* Invoked on each update to perform rendering tasks. This method may return
|
|
3904
|
+
* any value renderable by lit-html's `ChildPart` - typically a
|
|
3905
|
+
* `TemplateResult`. Setting properties inside this method will *not* trigger
|
|
3906
|
+
* the element to update.
|
|
3907
|
+
* @category rendering
|
|
3908
|
+
*/
|
|
3909
|
+
render() {
|
|
3910
|
+
return noChange;
|
|
3911
|
+
}
|
|
3912
|
+
}
|
|
3913
|
+
// This property needs to remain unminified.
|
|
3914
|
+
LitElement['_$litElement$'] = true;
|
|
3915
|
+
/**
|
|
3916
|
+
* Ensure this class is marked as `finalized` as an optimization ensuring
|
|
3917
|
+
* it will not needlessly try to `finalize`.
|
|
3918
|
+
*
|
|
3919
|
+
* Note this property name is a string to prevent breaking Closure JS Compiler
|
|
3920
|
+
* optimizations. See @lit/reactive-element for more information.
|
|
3921
|
+
*/
|
|
3922
|
+
LitElement[JSCompiler_renameProperty('finalized')] = true;
|
|
3923
|
+
// Install hydration if available
|
|
3924
|
+
globalThis.litElementHydrateSupport?.({ LitElement });
|
|
3925
|
+
// Apply polyfills if available
|
|
3926
|
+
const polyfillSupport = globalThis.litElementPolyfillSupportDevMode
|
|
3927
|
+
;
|
|
3928
|
+
polyfillSupport?.({ LitElement });
|
|
3929
|
+
// IMPORTANT: do not change the property name or the assignment expression.
|
|
3930
|
+
// This line will be used in regexes to search for LitElement usage.
|
|
3931
|
+
(globalThis.litElementVersions ??= []).push('4.1.0');
|
|
3932
|
+
if (globalThis.litElementVersions.length > 1) {
|
|
3933
|
+
issueWarning$1('multiple-versions', `Multiple versions of Lit loaded. Loading multiple versions ` +
|
|
3934
|
+
`is not recommended.`);
|
|
3935
|
+
}
|
|
3936
|
+
|
|
3937
|
+
const appliedClassMixins = new WeakMap();
|
|
3938
|
+
|
|
3939
|
+
/** Vefify if the Mixin was previously applyed
|
|
3940
|
+
* @private
|
|
3941
|
+
* @param {function} mixin Mixin being applyed
|
|
3942
|
+
* @param {object} superClass Class receiving the new mixin
|
|
3943
|
+
* @returns {boolean}
|
|
3944
|
+
*/
|
|
3945
|
+
function wasMixinPreviouslyApplied(mixin, superClass) {
|
|
3946
|
+
let klass = superClass;
|
|
3947
|
+
while (klass) {
|
|
3948
|
+
if (appliedClassMixins.get(klass) === mixin) {
|
|
3949
|
+
return true;
|
|
3950
|
+
}
|
|
3951
|
+
klass = Object.getPrototypeOf(klass);
|
|
3952
|
+
}
|
|
3953
|
+
return false;
|
|
3954
|
+
}
|
|
3955
|
+
|
|
3956
|
+
/** Apply each mixin in the chain to make sure they are not applied more than once to the final class.
|
|
3957
|
+
* @export
|
|
3958
|
+
* @param {function} mixin Mixin to be applyed
|
|
3959
|
+
* @returns {object} Mixed class with mixin applied
|
|
3960
|
+
*/
|
|
3961
|
+
function dedupeMixin(mixin) {
|
|
3962
|
+
return superClass => {
|
|
3963
|
+
if (wasMixinPreviouslyApplied(mixin, superClass)) {
|
|
3964
|
+
return superClass;
|
|
3965
|
+
}
|
|
3966
|
+
const mixedClass = mixin(superClass);
|
|
3967
|
+
appliedClassMixins.set(mixedClass, mixin);
|
|
3968
|
+
return mixedClass;
|
|
3969
|
+
};
|
|
3970
|
+
}
|
|
3971
|
+
|
|
3972
|
+
/**
|
|
3973
|
+
* @license
|
|
3974
|
+
* Copyright 2019 Google LLC
|
|
3975
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
3976
|
+
*/
|
|
3977
|
+
const global = window;
|
|
3978
|
+
/**
|
|
3979
|
+
* Whether the current browser supports `adoptedStyleSheets`.
|
|
3980
|
+
*/
|
|
3981
|
+
const supportsAdoptingStyleSheets = global.ShadowRoot &&
|
|
3982
|
+
(global.ShadyCSS === undefined || global.ShadyCSS.nativeShadow) &&
|
|
3983
|
+
'adoptedStyleSheets' in Document.prototype &&
|
|
3984
|
+
'replace' in CSSStyleSheet.prototype;
|
|
3985
|
+
/**
|
|
3986
|
+
* Applies the given styles to a `shadowRoot`. When Shadow DOM is
|
|
3987
|
+
* available but `adoptedStyleSheets` is not, styles are appended to the
|
|
3988
|
+
* `shadowRoot` to [mimic spec behavior](https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets).
|
|
3989
|
+
* Note, when shimming is used, any styles that are subsequently placed into
|
|
3990
|
+
* the shadowRoot should be placed *before* any shimmed adopted styles. This
|
|
3991
|
+
* will match spec behavior that gives adopted sheets precedence over styles in
|
|
3992
|
+
* shadowRoot.
|
|
3993
|
+
*/
|
|
3994
|
+
const adoptStyles = (renderRoot, styles) => {
|
|
3995
|
+
if (supportsAdoptingStyleSheets) {
|
|
3996
|
+
renderRoot.adoptedStyleSheets = styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
|
|
3997
|
+
}
|
|
3998
|
+
else {
|
|
3999
|
+
styles.forEach((s) => {
|
|
4000
|
+
const style = document.createElement('style');
|
|
4001
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4002
|
+
const nonce = global['litNonce'];
|
|
4003
|
+
if (nonce !== undefined) {
|
|
4004
|
+
style.setAttribute('nonce', nonce);
|
|
4005
|
+
}
|
|
4006
|
+
style.textContent = s.cssText;
|
|
4007
|
+
renderRoot.appendChild(style);
|
|
4008
|
+
});
|
|
4009
|
+
}
|
|
4010
|
+
};
|
|
4011
|
+
|
|
4012
|
+
/**
|
|
4013
|
+
* @typedef {import('./types').RenderOptions} RenderOptions
|
|
4014
|
+
* @typedef {import('./types').ScopedElementsMixin} ScopedElementsMixin
|
|
4015
|
+
* @typedef {import('./types').ScopedElementsHost} ScopedElementsHost
|
|
4016
|
+
* @typedef {import('./types').ScopedElementsMap} ScopedElementsMap
|
|
4017
|
+
* @typedef {import('@lit/reactive-element').CSSResultOrNative} CSSResultOrNative
|
|
4018
|
+
*/
|
|
4019
|
+
|
|
4020
|
+
// @ts-ignore
|
|
4021
|
+
const supportsScopedRegistry = !!ShadowRoot.prototype.createElement;
|
|
4022
|
+
|
|
4023
|
+
/**
|
|
4024
|
+
* @template {import('./types').Constructor<HTMLElement>} T
|
|
4025
|
+
* @param {T} superclass
|
|
4026
|
+
* @return {T & import('./types').Constructor<ScopedElementsHost>}
|
|
4027
|
+
*/
|
|
4028
|
+
const ScopedElementsMixinImplementation = superclass =>
|
|
4029
|
+
/** @type {ScopedElementsHost} */
|
|
4030
|
+
class ScopedElementsHost extends superclass {
|
|
4031
|
+
/**
|
|
4032
|
+
* Obtains the scoped elements definitions map if specified.
|
|
4033
|
+
*
|
|
4034
|
+
* @returns {ScopedElementsMap}
|
|
4035
|
+
*/
|
|
4036
|
+
static get scopedElements() {
|
|
4037
|
+
return {};
|
|
4038
|
+
}
|
|
4039
|
+
|
|
4040
|
+
/**
|
|
4041
|
+
* Obtains the ShadowRoot options.
|
|
4042
|
+
*
|
|
4043
|
+
* @type {ShadowRootInit}
|
|
4044
|
+
*/
|
|
4045
|
+
static get shadowRootOptions() {
|
|
4046
|
+
return this.__shadowRootOptions;
|
|
4047
|
+
}
|
|
4048
|
+
|
|
4049
|
+
/**
|
|
4050
|
+
* Set the shadowRoot options.
|
|
4051
|
+
*
|
|
4052
|
+
* @param {ShadowRootInit} value
|
|
4053
|
+
*/
|
|
4054
|
+
static set shadowRootOptions(value) {
|
|
4055
|
+
this.__shadowRootOptions = value;
|
|
4056
|
+
}
|
|
4057
|
+
|
|
4058
|
+
/**
|
|
4059
|
+
* Obtains the element styles.
|
|
4060
|
+
*
|
|
4061
|
+
* @returns {CSSResultOrNative[]}
|
|
4062
|
+
*/
|
|
4063
|
+
static get elementStyles() {
|
|
4064
|
+
return this.__elementStyles;
|
|
4065
|
+
}
|
|
4066
|
+
|
|
4067
|
+
static set elementStyles(styles) {
|
|
4068
|
+
this.__elementStyles = styles;
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
// either TS or ESLint will complain here
|
|
4072
|
+
// eslint-disable-next-line no-unused-vars
|
|
4073
|
+
constructor(..._args) {
|
|
4074
|
+
super();
|
|
4075
|
+
/** @type {RenderOptions} */
|
|
4076
|
+
this.renderOptions = this.renderOptions || undefined;
|
|
4077
|
+
}
|
|
4078
|
+
|
|
4079
|
+
/**
|
|
4080
|
+
* Obtains the CustomElementRegistry associated to the ShadowRoot.
|
|
4081
|
+
*
|
|
4082
|
+
* @returns {CustomElementRegistry}
|
|
4083
|
+
*/
|
|
4084
|
+
get registry() {
|
|
4085
|
+
// @ts-ignore
|
|
4086
|
+
return this.constructor.__registry;
|
|
4087
|
+
}
|
|
4088
|
+
|
|
4089
|
+
/**
|
|
4090
|
+
* Set the CustomElementRegistry associated to the ShadowRoot
|
|
4091
|
+
*
|
|
4092
|
+
* @param {CustomElementRegistry} registry
|
|
4093
|
+
*/
|
|
4094
|
+
set registry(registry) {
|
|
4095
|
+
// @ts-ignore
|
|
4096
|
+
this.constructor.__registry = registry;
|
|
4097
|
+
}
|
|
4098
|
+
|
|
4099
|
+
createRenderRoot() {
|
|
4100
|
+
const { scopedElements, shadowRootOptions, elementStyles } =
|
|
4101
|
+
/** @type {typeof ScopedElementsHost} */ (this.constructor);
|
|
4102
|
+
|
|
4103
|
+
const shouldCreateRegistry =
|
|
4104
|
+
!this.registry ||
|
|
4105
|
+
// @ts-ignore
|
|
4106
|
+
(this.registry === this.constructor.__registry &&
|
|
4107
|
+
!Object.prototype.hasOwnProperty.call(this.constructor, '__registry'));
|
|
4108
|
+
|
|
4109
|
+
/**
|
|
4110
|
+
* Create a new registry if:
|
|
4111
|
+
* - the registry is not defined
|
|
4112
|
+
* - this class doesn't have its own registry *AND* has no shared registry
|
|
4113
|
+
*/
|
|
4114
|
+
if (shouldCreateRegistry) {
|
|
4115
|
+
this.registry = supportsScopedRegistry ? new CustomElementRegistry() : customElements;
|
|
4116
|
+
for (const [tagName, klass] of Object.entries(scopedElements)) {
|
|
4117
|
+
this.defineScopedElement(tagName, klass);
|
|
4115
4118
|
}
|
|
4116
|
-
|
|
4117
|
-
|
|
4119
|
+
}
|
|
4120
|
+
|
|
4121
|
+
/** @type {ShadowRootInit} */
|
|
4122
|
+
const options = {
|
|
4123
|
+
mode: 'open',
|
|
4124
|
+
...shadowRootOptions,
|
|
4125
|
+
customElements: this.registry,
|
|
4126
|
+
};
|
|
4127
|
+
|
|
4128
|
+
const createdRoot = this.attachShadow(options);
|
|
4129
|
+
if (supportsScopedRegistry) {
|
|
4130
|
+
this.renderOptions.creationScope = createdRoot;
|
|
4131
|
+
}
|
|
4132
|
+
|
|
4133
|
+
if (createdRoot instanceof ShadowRoot) {
|
|
4134
|
+
adoptStyles(createdRoot, elementStyles);
|
|
4135
|
+
this.renderOptions.renderBefore = this.renderOptions.renderBefore || createdRoot.firstChild;
|
|
4136
|
+
}
|
|
4137
|
+
|
|
4138
|
+
return createdRoot;
|
|
4139
|
+
}
|
|
4140
|
+
|
|
4141
|
+
createScopedElement(tagName) {
|
|
4142
|
+
const root = supportsScopedRegistry ? this.shadowRoot : document;
|
|
4143
|
+
// @ts-ignore polyfill to support createElement on shadowRoot is loaded
|
|
4144
|
+
return root.createElement(tagName);
|
|
4118
4145
|
}
|
|
4146
|
+
|
|
4119
4147
|
/**
|
|
4120
|
-
*
|
|
4121
|
-
*
|
|
4122
|
-
* In `connectedCallback()` you should setup tasks that should only occur when
|
|
4123
|
-
* the element is connected to the document. The most common of these is
|
|
4124
|
-
* adding event listeners to nodes external to the element, like a keydown
|
|
4125
|
-
* event handler added to the window.
|
|
4126
|
-
*
|
|
4127
|
-
* ```ts
|
|
4128
|
-
* connectedCallback() {
|
|
4129
|
-
* super.connectedCallback();
|
|
4130
|
-
* addEventListener('keydown', this._handleKeydown);
|
|
4131
|
-
* }
|
|
4132
|
-
* ```
|
|
4133
|
-
*
|
|
4134
|
-
* Typically, anything done in `connectedCallback()` should be undone when the
|
|
4135
|
-
* element is disconnected, in `disconnectedCallback()`.
|
|
4148
|
+
* Defines a scoped element.
|
|
4136
4149
|
*
|
|
4137
|
-
* @
|
|
4150
|
+
* @param {string} tagName
|
|
4151
|
+
* @param {typeof HTMLElement} klass
|
|
4138
4152
|
*/
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4153
|
+
defineScopedElement(tagName, klass) {
|
|
4154
|
+
const registeredClass = this.registry.get(tagName);
|
|
4155
|
+
if (registeredClass && supportsScopedRegistry === false && registeredClass !== klass) {
|
|
4156
|
+
// eslint-disable-next-line no-console
|
|
4157
|
+
console.error(
|
|
4158
|
+
[
|
|
4159
|
+
`You are trying to re-register the "${tagName}" custom element with a different class via ScopedElementsMixin.`,
|
|
4160
|
+
'This is only possible with a CustomElementRegistry.',
|
|
4161
|
+
'Your browser does not support this feature so you will need to load a polyfill for it.',
|
|
4162
|
+
'Load "@webcomponents/scoped-custom-element-registry" before you register ANY web component to the global customElements registry.',
|
|
4163
|
+
'e.g. add "<script src="/node_modules/@webcomponents/scoped-custom-element-registry/scoped-custom-element-registry.min.js"></script>" as your first script tag.',
|
|
4164
|
+
'For more details you can visit https://open-wc.org/docs/development/scoped-elements/',
|
|
4165
|
+
].join('\n'),
|
|
4166
|
+
);
|
|
4167
|
+
}
|
|
4168
|
+
if (!registeredClass) {
|
|
4169
|
+
return this.registry.define(tagName, klass);
|
|
4170
|
+
}
|
|
4171
|
+
return this.registry.get(tagName);
|
|
4142
4172
|
}
|
|
4173
|
+
|
|
4143
4174
|
/**
|
|
4144
|
-
*
|
|
4145
|
-
*
|
|
4146
|
-
* This callback is the main signal to the element that it may no longer be
|
|
4147
|
-
* used. `disconnectedCallback()` should ensure that nothing is holding a
|
|
4148
|
-
* reference to the element (such as event listeners added to nodes external
|
|
4149
|
-
* to the element), so that it is free to be garbage collected.
|
|
4150
|
-
*
|
|
4151
|
-
* ```ts
|
|
4152
|
-
* disconnectedCallback() {
|
|
4153
|
-
* super.disconnectedCallback();
|
|
4154
|
-
* window.removeEventListener('keydown', this._handleKeydown);
|
|
4155
|
-
* }
|
|
4156
|
-
* ```
|
|
4157
|
-
*
|
|
4158
|
-
* An element may be re-connected after being disconnected.
|
|
4175
|
+
* @deprecated use the native el.tagName instead
|
|
4159
4176
|
*
|
|
4160
|
-
* @
|
|
4177
|
+
* @param {string} tagName
|
|
4178
|
+
* @returns {string} the tag name
|
|
4161
4179
|
*/
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4180
|
+
// eslint-disable-next-line class-methods-use-this
|
|
4181
|
+
getScopedTagName(tagName) {
|
|
4182
|
+
// @ts-ignore
|
|
4183
|
+
return this.constructor.getScopedTagName(tagName);
|
|
4165
4184
|
}
|
|
4185
|
+
|
|
4166
4186
|
/**
|
|
4167
|
-
*
|
|
4168
|
-
*
|
|
4169
|
-
*
|
|
4170
|
-
* the
|
|
4171
|
-
* @category rendering
|
|
4187
|
+
* @deprecated use the native el.tagName instead
|
|
4188
|
+
*
|
|
4189
|
+
* @param {string} tagName
|
|
4190
|
+
* @returns {string} the tag name
|
|
4172
4191
|
*/
|
|
4173
|
-
|
|
4174
|
-
|
|
4192
|
+
// eslint-disable-next-line class-methods-use-this
|
|
4193
|
+
static getScopedTagName(tagName) {
|
|
4194
|
+
// @ts-ignore
|
|
4195
|
+
return this.__registry.get(tagName) ? tagName : undefined;
|
|
4175
4196
|
}
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
/**
|
|
4180
|
-
* Ensure this class is marked as `finalized` as an optimization ensuring
|
|
4181
|
-
* it will not needlessly try to `finalize`.
|
|
4182
|
-
*
|
|
4183
|
-
* Note this property name is a string to prevent breaking Closure JS Compiler
|
|
4184
|
-
* optimizations. See @lit/reactive-element for more information.
|
|
4185
|
-
*/
|
|
4186
|
-
LitElement[JSCompiler_renameProperty('finalized')] = true;
|
|
4187
|
-
// Install hydration if available
|
|
4188
|
-
globalThis.litElementHydrateSupport?.({ LitElement });
|
|
4189
|
-
// Apply polyfills if available
|
|
4190
|
-
const polyfillSupport = globalThis.litElementPolyfillSupportDevMode
|
|
4191
|
-
;
|
|
4192
|
-
polyfillSupport?.({ LitElement });
|
|
4193
|
-
// IMPORTANT: do not change the property name or the assignment expression.
|
|
4194
|
-
// This line will be used in regexes to search for LitElement usage.
|
|
4195
|
-
(globalThis.litElementVersions ??= []).push('4.1.0');
|
|
4196
|
-
if (globalThis.litElementVersions.length > 1) {
|
|
4197
|
-
issueWarning$1('multiple-versions', `Multiple versions of Lit loaded. Loading multiple versions ` +
|
|
4198
|
-
`is not recommended.`);
|
|
4199
|
-
}
|
|
4197
|
+
};
|
|
4198
|
+
|
|
4199
|
+
const ScopedElementsMixin = dedupeMixin(ScopedElementsMixinImplementation);
|
|
4200
4200
|
|
|
4201
4201
|
/**
|
|
4202
4202
|
* @license
|
|
@@ -4334,31 +4334,25 @@
|
|
|
4334
4334
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
4335
4335
|
*/
|
|
4336
4336
|
/**
|
|
4337
|
-
*
|
|
4338
|
-
*
|
|
4339
|
-
*
|
|
4340
|
-
* Marks the defined property as configurable, and enumerable, and handles
|
|
4341
|
-
* the case where we have a busted Reflect.decorate zombiefill (e.g. in Angular
|
|
4342
|
-
* apps).
|
|
4337
|
+
* Declares a private or protected reactive property that still triggers
|
|
4338
|
+
* updates to the element when it changes. It does not reflect from the
|
|
4339
|
+
* corresponding attribute.
|
|
4343
4340
|
*
|
|
4344
|
-
*
|
|
4341
|
+
* Properties declared this way must not be used from HTML or HTML templating
|
|
4342
|
+
* systems, they're solely for properties internal to the element. These
|
|
4343
|
+
* properties may be renamed by optimization tools like closure compiler.
|
|
4344
|
+
* @category Decorator
|
|
4345
4345
|
*/
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
// then we have no guarantees that the returned descriptor will be
|
|
4357
|
-
// defined on the class, so we must apply it directly ourselves.
|
|
4358
|
-
Object.defineProperty(obj, name, descriptor);
|
|
4359
|
-
}
|
|
4360
|
-
return descriptor;
|
|
4361
|
-
};
|
|
4346
|
+
function state(options) {
|
|
4347
|
+
return property({
|
|
4348
|
+
...options,
|
|
4349
|
+
// Add both `state` and `attribute` because we found a third party
|
|
4350
|
+
// controller that is keying off of PropertyOptions.state to determine
|
|
4351
|
+
// whether a field is a private internal property or not.
|
|
4352
|
+
state: true,
|
|
4353
|
+
attribute: false,
|
|
4354
|
+
});
|
|
4355
|
+
}
|
|
4362
4356
|
|
|
4363
4357
|
/**
|
|
4364
4358
|
* @license
|
|
@@ -4371,51 +4365,6 @@
|
|
|
4371
4365
|
(globalThis.litIssuedWarnings ??= new Set());
|
|
4372
4366
|
}
|
|
4373
4367
|
|
|
4374
|
-
/**
|
|
4375
|
-
* @license
|
|
4376
|
-
* Copyright 2017 Google LLC
|
|
4377
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
4378
|
-
*/
|
|
4379
|
-
/**
|
|
4380
|
-
* A property decorator that converts a class property into a getter that
|
|
4381
|
-
* returns the `assignedNodes` of the given `slot`.
|
|
4382
|
-
*
|
|
4383
|
-
* Can be passed an optional {@linkcode QueryAssignedNodesOptions} object.
|
|
4384
|
-
*
|
|
4385
|
-
* Example usage:
|
|
4386
|
-
* ```ts
|
|
4387
|
-
* class MyElement {
|
|
4388
|
-
* @queryAssignedNodes({slot: 'list', flatten: true})
|
|
4389
|
-
* listItems!: Array<Node>;
|
|
4390
|
-
*
|
|
4391
|
-
* render() {
|
|
4392
|
-
* return html`
|
|
4393
|
-
* <slot name="list"></slot>
|
|
4394
|
-
* `;
|
|
4395
|
-
* }
|
|
4396
|
-
* }
|
|
4397
|
-
* ```
|
|
4398
|
-
*
|
|
4399
|
-
* Note the type of this property should be annotated as `Array<Node>`. Use the
|
|
4400
|
-
* queryAssignedElements decorator to list only elements, and optionally filter
|
|
4401
|
-
* the element list using a CSS selector.
|
|
4402
|
-
*
|
|
4403
|
-
* @category Decorator
|
|
4404
|
-
*/
|
|
4405
|
-
function queryAssignedNodes(options) {
|
|
4406
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4407
|
-
return ((obj, name) => {
|
|
4408
|
-
const { slot } = options ?? {};
|
|
4409
|
-
const slotSelector = `slot${slot ? `[name=${slot}]` : ':not([name])'}`;
|
|
4410
|
-
return desc(obj, name, {
|
|
4411
|
-
get() {
|
|
4412
|
-
const slotEl = this.renderRoot?.querySelector(slotSelector);
|
|
4413
|
-
return (slotEl?.assignedNodes(options) ?? []);
|
|
4414
|
-
},
|
|
4415
|
-
});
|
|
4416
|
-
});
|
|
4417
|
-
}
|
|
4418
|
-
|
|
4419
4368
|
/**
|
|
4420
4369
|
* @license
|
|
4421
4370
|
* Copyright 2017 Google LLC
|
|
@@ -4635,7 +4584,7 @@
|
|
|
4635
4584
|
*/
|
|
4636
4585
|
const html = withStatic(html$1);
|
|
4637
4586
|
|
|
4638
|
-
var css_248z$
|
|
4587
|
+
var css_248z$5 = css`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-heading);margin:0;*,:after,:before{box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::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}::slotted(a){color:var(--sgds-link);text-decoration:var(--sgds-link-decoration)}::slotted(a:hover){color:var(--sgds-link-hover-color)}::slotted(svg){vertical-align:middle}}`;
|
|
4639
4588
|
|
|
4640
4589
|
/**
|
|
4641
4590
|
* @cssprop --sgds-{stateColor} - State colors in hexadecimal value
|
|
@@ -4653,7 +4602,7 @@
|
|
|
4653
4602
|
return event;
|
|
4654
4603
|
}
|
|
4655
4604
|
}
|
|
4656
|
-
SgdsElement.styles = [css_248z$
|
|
4605
|
+
SgdsElement.styles = [css_248z$5];
|
|
4657
4606
|
|
|
4658
4607
|
// @watch decorator
|
|
4659
4608
|
//
|
|
@@ -4705,7 +4654,7 @@
|
|
|
4705
4654
|
*/
|
|
4706
4655
|
const ifDefined = (value) => value ?? nothing;
|
|
4707
4656
|
|
|
4708
|
-
var css_248z$
|
|
4657
|
+
var css_248z$4 = css`:host{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm);display:inline-flex}.btn-close{background-color:var(--sgds-default-bg-transparent);border:0;border:var(--sgds-border-width-1) solid var(--sgds-default-border-color-transparent);border-radius:var(--sgds-close-btn-border-radius);cursor:pointer;height:var(--sgds-dimension-32);padding:0;position:relative;width:var(--sgds-dimension-32)}.btn-close:before{background-color:currentColor;border-radius:var(--sgds-border-radius);box-sizing:content-box;color:var(--sgds-default-color);content:"";height:var(--sgds-icon-size-md);left:50%;mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M5.614 5.614a.75.75 0 0 1 1.06 0l5.304 5.303 5.303-5.303a.75.75 0 0 1 1.06 1.06l-5.302 5.304 5.303 5.303a.75.75 0 0 1-1.06 1.06l-5.304-5.302-5.303 5.303a.75.75 0 0 1-1.061-1.06l5.303-5.304-5.303-5.303a.75.75 0 0 1 0-1.061Z'/%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M5.614 5.614a.75.75 0 0 1 1.06 0l5.304 5.303 5.303-5.303a.75.75 0 0 1 1.06 1.06l-5.302 5.304 5.303 5.303a.75.75 0 0 1-1.06 1.06l-5.304-5.302-5.303 5.303a.75.75 0 0 1-1.061-1.06l5.303-5.304-5.303-5.303a.75.75 0 0 1 0-1.061Z'/%3E%3C/svg%3E");mask-position:center;-webkit-mask-position:center;mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--sgds-icon-size-md)}.btn-close-light:before{color:var(--sgds-default-color-on-dark)}.btn-close-dark:before{color:var(--sgds-default-color-on-light)}.btn-close:hover{background-color:var(--sgds-default-bg-translucent)}.btn-close:focus,.btn-close:focus-visible{background-color:var(--sgds-default-bg-translucent);box-shadow:var(--sgds-box-shadow-focus);outline:0}.btn-close-sm{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.btn-close.btn-close-sm:before{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}`;
|
|
4709
4658
|
|
|
4710
4659
|
/**
|
|
4711
4660
|
* @summary Close button for closing actions. Used in Modal, Drawer, Alert and Toast.
|
|
@@ -4743,7 +4692,7 @@
|
|
|
4743
4692
|
`;
|
|
4744
4693
|
}
|
|
4745
4694
|
}
|
|
4746
|
-
SgdsCloseButton.styles = [css_248z$
|
|
4695
|
+
SgdsCloseButton.styles = [...SgdsElement.styles, css_248z$4];
|
|
4747
4696
|
__decorate([
|
|
4748
4697
|
property({ type: String })
|
|
4749
4698
|
], SgdsCloseButton.prototype, "ariaLabel", void 0);
|
|
@@ -4754,7 +4703,134 @@
|
|
|
4754
4703
|
property({ type: String, reflect: true })
|
|
4755
4704
|
], SgdsCloseButton.prototype, "variant", void 0);
|
|
4756
4705
|
|
|
4757
|
-
|
|
4706
|
+
/**
|
|
4707
|
+
* @license
|
|
4708
|
+
* Copyright 2017 Google LLC
|
|
4709
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
4710
|
+
*/
|
|
4711
|
+
const HTML_RESULT = 1;
|
|
4712
|
+
class UnsafeHTMLDirective extends Directive {
|
|
4713
|
+
constructor(partInfo) {
|
|
4714
|
+
super(partInfo);
|
|
4715
|
+
this._value = nothing;
|
|
4716
|
+
if (partInfo.type !== PartType.CHILD) {
|
|
4717
|
+
throw new Error(`${this.constructor.directiveName}() can only be used in child bindings`);
|
|
4718
|
+
}
|
|
4719
|
+
}
|
|
4720
|
+
render(value) {
|
|
4721
|
+
if (value === nothing || value == null) {
|
|
4722
|
+
this._templateResult = undefined;
|
|
4723
|
+
return (this._value = value);
|
|
4724
|
+
}
|
|
4725
|
+
if (value === noChange) {
|
|
4726
|
+
return value;
|
|
4727
|
+
}
|
|
4728
|
+
if (typeof value != 'string') {
|
|
4729
|
+
throw new Error(`${this.constructor.directiveName}() called with a non-string value`);
|
|
4730
|
+
}
|
|
4731
|
+
if (value === this._value) {
|
|
4732
|
+
return this._templateResult;
|
|
4733
|
+
}
|
|
4734
|
+
this._value = value;
|
|
4735
|
+
const strings = [value];
|
|
4736
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4737
|
+
strings.raw = strings;
|
|
4738
|
+
// WARNING: impersonating a TemplateResult like this is extremely
|
|
4739
|
+
// dangerous. Third-party directives should not do this.
|
|
4740
|
+
return (this._templateResult = {
|
|
4741
|
+
// Cast to a known set of integers that satisfy ResultType so that we
|
|
4742
|
+
// don't have to export ResultType and possibly encourage this pattern.
|
|
4743
|
+
// This property needs to remain unminified.
|
|
4744
|
+
['_$litType$']: this.constructor
|
|
4745
|
+
.resultType,
|
|
4746
|
+
strings,
|
|
4747
|
+
values: [],
|
|
4748
|
+
});
|
|
4749
|
+
}
|
|
4750
|
+
}
|
|
4751
|
+
UnsafeHTMLDirective.directiveName = 'unsafeHTML';
|
|
4752
|
+
UnsafeHTMLDirective.resultType = HTML_RESULT;
|
|
4753
|
+
|
|
4754
|
+
/**
|
|
4755
|
+
* @license
|
|
4756
|
+
* Copyright 2017 Google LLC
|
|
4757
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
4758
|
+
*/
|
|
4759
|
+
const SVG_RESULT = 2;
|
|
4760
|
+
class UnsafeSVGDirective extends UnsafeHTMLDirective {
|
|
4761
|
+
}
|
|
4762
|
+
UnsafeSVGDirective.directiveName = 'unsafeSVG';
|
|
4763
|
+
UnsafeSVGDirective.resultType = SVG_RESULT;
|
|
4764
|
+
/**
|
|
4765
|
+
* Renders the result as SVG, rather than text.
|
|
4766
|
+
*
|
|
4767
|
+
* The values `undefined`, `null`, and `nothing`, will all result in no content
|
|
4768
|
+
* (empty string) being rendered.
|
|
4769
|
+
*
|
|
4770
|
+
* Note, this is unsafe to use with any user-provided input that hasn't been
|
|
4771
|
+
* sanitized or escaped, as it may lead to cross-site-scripting
|
|
4772
|
+
* vulnerabilities.
|
|
4773
|
+
*/
|
|
4774
|
+
const unsafeSVG = directive(UnsafeSVGDirective);
|
|
4775
|
+
|
|
4776
|
+
var css_248z$3 = css`:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;
|
|
4777
|
+
|
|
4778
|
+
/**
|
|
4779
|
+
* @summary Icons offer a form of visual shorthand that we are all familiar with. They can label, inform and aid navigation quickly and effectively in minimal space. Icons must first and foremost communicate meaning. By default, the icon component renders icons form SgdsIcon library set
|
|
4780
|
+
*
|
|
4781
|
+
* @event sgds-blur - Emitted when the button is blurred.
|
|
4782
|
+
* @event sgds-focus - Emitted when the button is focused.
|
|
4783
|
+
*/
|
|
4784
|
+
class SgdsIcon extends SgdsElement {
|
|
4785
|
+
constructor() {
|
|
4786
|
+
super(...arguments);
|
|
4787
|
+
/** Specifies a small, medium or large icon, the size is medium by default. */
|
|
4788
|
+
this.size = "lg";
|
|
4789
|
+
/** @internal */
|
|
4790
|
+
this._svgContent = null;
|
|
4791
|
+
}
|
|
4792
|
+
async firstUpdated() {
|
|
4793
|
+
if (this.name) {
|
|
4794
|
+
this.loadSvg(this.name);
|
|
4795
|
+
}
|
|
4796
|
+
}
|
|
4797
|
+
updated() {
|
|
4798
|
+
this.style.display = this._svgContent ? "flex" : "none";
|
|
4799
|
+
}
|
|
4800
|
+
async loadSvg(name) {
|
|
4801
|
+
if (name) {
|
|
4802
|
+
// Dynamically import the SVG if not cached
|
|
4803
|
+
try {
|
|
4804
|
+
//TODO: This path is too specific to our repo, it won't work for users
|
|
4805
|
+
const response = await fetch(`/src/icons/${name}.svg`);
|
|
4806
|
+
if (response.ok) {
|
|
4807
|
+
const svgContent = await response.text();
|
|
4808
|
+
// Render the SVG
|
|
4809
|
+
// this.renderSvg(svgContent);
|
|
4810
|
+
this._svgContent = svgContent;
|
|
4811
|
+
}
|
|
4812
|
+
}
|
|
4813
|
+
catch (error) {
|
|
4814
|
+
console.error(`Error loading SVG: ${name}`, error);
|
|
4815
|
+
}
|
|
4816
|
+
}
|
|
4817
|
+
}
|
|
4818
|
+
render() {
|
|
4819
|
+
return html `${unsafeSVG(this._svgContent)}`;
|
|
4820
|
+
}
|
|
4821
|
+
}
|
|
4822
|
+
SgdsIcon.styles = [...SgdsElement.styles, css_248z$3];
|
|
4823
|
+
__decorate([
|
|
4824
|
+
property({ type: String, reflect: true })
|
|
4825
|
+
], SgdsIcon.prototype, "name", void 0);
|
|
4826
|
+
__decorate([
|
|
4827
|
+
property({ type: String, reflect: true })
|
|
4828
|
+
], SgdsIcon.prototype, "size", void 0);
|
|
4829
|
+
__decorate([
|
|
4830
|
+
state()
|
|
4831
|
+
], SgdsIcon.prototype, "_svgContent", void 0);
|
|
4832
|
+
|
|
4833
|
+
var css_248z$2 = css`:host{--sgds-alert-bg:var(--sgds-primary-bg);--sgds-alert-color:var(--sgds-default-color-on-dark);--sgds-alert-border-radius:var(--sgds-border-radius-md)}:host([variant=success]){--sgds-alert-bg:var(--sgds-success-bg)}:host([variant=warning]){--sgds-alert-bg:var(--sgds-warning-bg)}:host([variant=danger]){--sgds-alert-bg:var(--sgds-danger-bg)}:host([variant=neutral]){--sgds-alert-bg:var(--sgds-neutral-bg)}:host([outlined]){--sgds-alert-color:var(--sgds-default-color-on-light)}:host([variant=info][outlined]){--sgds-alert-bg:var(--sgds-primary-bg-subtle);--sgds-alert-border-color:var(--sgds-primary-border-color-subtle)}:host([variant=success][outlined]){--sgds-alert-bg:var(--sgds-success-bg-subtle);--sgds-alert-border-color:var(--sgds-success-border-color-subtle)}:host([variant=warning][outlined]){--sgds-alert-bg:var(--sgds-warning-bg-subtle);--sgds-alert-border-color:var(--sgds-warning-border-color-subtle)}:host([variant=danger][outlined]){--sgds-alert-bg:var(--sgds-danger-bg-subtle);--sgds-alert-border-color:var(--sgds-danger-border-color-subtle)}:host([variant=neutral][outlined]){--sgds-alert-bg:var(--sgds-neutral-bg-subtle);--sgds-alert-border-color:var(--sgds-neutral-border-color-subtle)}slot[name=icon]::slotted(*){color:var(--sgds-alert-color)}.alert{background-color:var(--sgds-alert-bg);border:var(--sgds-border-width-1) solid var(--sgds-default-border-color-transparent);border-radius:var(--sgds-alert-border-radius);color:var(--sgds-alert-color);display:flex;flex-direction:row;gap:var(--sgds-gap-sm);padding:var(--sgds-padding-lg)}.alert.outlined{border:var(--sgds-border-width-1) solid var(--sgds-alert-border-color)}.alert-content{align-items:flex-start;display:flex;flex:1 0 0;flex-direction:column;gap:var(--sgds-gap-2-xs);justify-content:center;padding-right:var(--sgds-padding-2-xl)}.alert-title{font-weight:var(--sgds-font-weight-semibold)}`;
|
|
4758
4834
|
|
|
4759
4835
|
/**
|
|
4760
4836
|
* @summary Alerts provide short, timely, and relevant information for your users. It can be a simple text message or customised HTML content with paragraphs, headings and links.
|
|
@@ -4781,7 +4857,8 @@
|
|
|
4781
4857
|
/**@internal */
|
|
4782
4858
|
static get scopedElements() {
|
|
4783
4859
|
return {
|
|
4784
|
-
"sgds-close-button": SgdsCloseButton
|
|
4860
|
+
"sgds-close-button": SgdsCloseButton,
|
|
4861
|
+
"sgds-icon": SgdsIcon
|
|
4785
4862
|
};
|
|
4786
4863
|
}
|
|
4787
4864
|
/** Closes the alert */
|
|
@@ -4792,14 +4869,8 @@
|
|
|
4792
4869
|
_handleShowChange() {
|
|
4793
4870
|
this.show ? this.emit("sgds-show") : this.emit("sgds-hide");
|
|
4794
4871
|
}
|
|
4795
|
-
firstUpdated() {
|
|
4796
|
-
var _a;
|
|
4797
|
-
if (this._iconNodes.length === 0) {
|
|
4798
|
-
return (_a = this.shadowRoot.querySelector("slot[name='icon']")) === null || _a === void 0 ? void 0 : _a.classList.add("d-none");
|
|
4799
|
-
}
|
|
4800
|
-
}
|
|
4801
4872
|
render() {
|
|
4802
|
-
return this.show
|
|
4873
|
+
return (this.dismissible && this.show) || !this.dismissible
|
|
4803
4874
|
? html `
|
|
4804
4875
|
<div
|
|
4805
4876
|
class="${classMap({
|
|
@@ -4847,9 +4918,6 @@
|
|
|
4847
4918
|
__decorate([
|
|
4848
4919
|
watch("show")
|
|
4849
4920
|
], SgdsAlert.prototype, "_handleShowChange", null);
|
|
4850
|
-
__decorate([
|
|
4851
|
-
queryAssignedNodes({ slot: "icon", flatten: true })
|
|
4852
|
-
], SgdsAlert.prototype, "_iconNodes", void 0);
|
|
4853
4921
|
|
|
4854
4922
|
var css_248z$1 = css`:host{cursor:pointer;display:inline-block}.alert-link,.alert-link:hover{color:var(--sgds-alert-color);text-decoration-line:underline}.alert-link:focus,.alert-link:focus-visible{box-shadow:var(--sgds-box-shadow-focus);outline:0}`;
|
|
4855
4923
|
|