@govtechsg/sgds-web-component 3.2.0 → 3.3.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 +46 -15
- package/components/Badge/badge.js +1 -1
- package/components/Badge/index.umd.js +4532 -197
- package/components/Badge/index.umd.js.map +1 -1
- package/components/Badge/sgds-badge.js +70 -30
- package/components/Badge/sgds-badge.js.map +1 -1
- package/components/Breadcrumb/index.umd.js +3 -3
- package/components/Breadcrumb/index.umd.js.map +1 -1
- package/components/Card/index.umd.js +2 -2
- package/components/Card/index.umd.js.map +1 -1
- package/components/ComboBox/combo-box-item2.js +1 -1
- package/components/ComboBox/index.umd.js +1321 -174
- package/components/ComboBox/index.umd.js.map +1 -1
- package/components/Datepicker/index.umd.js +61 -17
- package/components/Datepicker/index.umd.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.js +29 -11
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/DescriptionList/index.umd.js.map +1 -1
- package/components/Dropdown/dropdown-item.js +1 -1
- package/components/Dropdown/index.umd.js +1 -1
- package/components/IconList/icon-list.js +1 -1
- package/components/IconList/index.umd.js +1 -1
- package/components/Input/index.umd.js +33 -6
- package/components/Input/index.umd.js.map +1 -1
- package/components/Input/input.js +1 -1
- package/components/Input/sgds-input.js +32 -5
- package/components/Input/sgds-input.js.map +1 -1
- package/components/Link/index.umd.js +2 -2
- package/components/Link/index.umd.js.map +1 -1
- package/components/Link/link.js +1 -1
- package/components/Link/sgds-link.js +1 -1
- package/components/Link/sgds-link.js.map +1 -1
- package/components/Mainnav/index.umd.js +4 -4
- package/components/Mainnav/index.umd.js.map +1 -1
- package/components/Mainnav/mainnav-item.js +1 -1
- package/components/Mainnav/mainnav.js +1 -1
- package/components/Mainnav/sgds-mainnav.js +1 -1
- package/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/components/Masthead/index.umd.js +46 -15
- package/components/Masthead/index.umd.js.map +1 -1
- package/components/Masthead/masthead.js +1 -1
- package/components/Masthead/sgds-masthead.js +45 -14
- package/components/Masthead/sgds-masthead.js.map +1 -1
- package/components/Modal/index.umd.js.map +1 -1
- package/components/QuantityToggle/index.umd.js +33 -6
- package/components/QuantityToggle/index.umd.js.map +1 -1
- package/components/Select/index.umd.js +1 -1
- package/components/Select/select-item2.js +1 -1
- package/components/Subnav/index.umd.js +1 -1
- package/components/Subnav/subnav.js +1 -1
- package/components/Switch/index.umd.js.map +1 -1
- package/components/Table/index.umd.js.map +1 -1
- package/components/Tooltip/index.umd.js +1 -1
- package/components/Tooltip/tooltip.js +1 -1
- package/components/index.umd.js +18901 -18771
- package/components/index.umd.js.map +1 -1
- package/css/reboot.css +0 -1
- package/index.umd.js +18885 -18755
- package/index.umd.js.map +1 -1
- package/package.json +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 +69 -29
- package/react/components/Badge/sgds-badge.cjs.js.map +1 -1
- package/react/components/Badge/sgds-badge.js +70 -30
- package/react/components/Badge/sgds-badge.js.map +1 -1
- package/react/components/ComboBox/combo-box-item.cjs2.js +1 -1
- package/react/components/ComboBox/combo-box-item2.js +1 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js +29 -11
- package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.js +29 -11
- package/react/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/react/components/Dropdown/dropdown-item.cjs.js +1 -1
- package/react/components/Dropdown/dropdown-item.js +1 -1
- package/react/components/IconList/icon-list.cjs.js +1 -1
- package/react/components/IconList/icon-list.js +1 -1
- package/react/components/Input/input.cjs.js +1 -1
- package/react/components/Input/input.js +1 -1
- package/react/components/Input/sgds-input.cjs.js +32 -5
- package/react/components/Input/sgds-input.cjs.js.map +1 -1
- package/react/components/Input/sgds-input.js +32 -5
- package/react/components/Input/sgds-input.js.map +1 -1
- package/react/components/Link/link.cjs.js +1 -1
- package/react/components/Link/link.js +1 -1
- package/react/components/Link/sgds-link.cjs.js +1 -1
- package/react/components/Link/sgds-link.cjs.js.map +1 -1
- package/react/components/Link/sgds-link.js +1 -1
- package/react/components/Link/sgds-link.js.map +1 -1
- package/react/components/Mainnav/mainnav-item.cjs.js +1 -1
- package/react/components/Mainnav/mainnav-item.js +1 -1
- package/react/components/Mainnav/mainnav.cjs.js +1 -1
- package/react/components/Mainnav/mainnav.js +1 -1
- package/react/components/Mainnav/sgds-mainnav.cjs.js +1 -1
- package/react/components/Mainnav/sgds-mainnav.cjs.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav.js +1 -1
- package/react/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/react/components/Masthead/masthead.cjs.js +1 -1
- package/react/components/Masthead/masthead.js +1 -1
- package/react/components/Masthead/sgds-masthead.cjs.js +45 -14
- package/react/components/Masthead/sgds-masthead.cjs.js.map +1 -1
- package/react/components/Masthead/sgds-masthead.js +45 -14
- package/react/components/Masthead/sgds-masthead.js.map +1 -1
- package/react/components/Select/select-item.cjs2.js +1 -1
- package/react/components/Select/select-item2.js +1 -1
- package/react/components/Subnav/subnav.cjs.js +1 -1
- package/react/components/Subnav/subnav.js +1 -1
- package/react/components/Tooltip/tooltip.cjs.js +1 -1
- package/react/components/Tooltip/tooltip.js +1 -1
- package/react/index.cjs.js +8 -8
- package/react/index.js +1 -1
- package/react/utils/slot.cjs.js +18 -0
- package/react/utils/slot.cjs.js.map +1 -1
- package/react/utils/slot.js +18 -1
- package/react/utils/slot.js.map +1 -1
- package/scripts/figma/sync-figma-to-tokens/__tests__/write-tokens-to-css-var.test.d.ts +0 -0
- package/scripts/figma/sync-figma-to-tokens/color.d.ts +8 -0
- package/scripts/figma/sync-figma-to-tokens/figma_api.d.ts +8 -0
- package/scripts/figma/sync-figma-to-tokens/sync-figma-to-tokens.d.ts +1 -0
- package/scripts/figma/sync-figma-to-tokens/token_export.d.ts +5 -0
- package/scripts/figma/sync-figma-to-tokens/token_types.d.ts +52 -0
- package/scripts/figma/sync-figma-to-tokens/utils.d.ts +3 -0
- package/scripts/figma/sync-figma-to-tokens/write-tokens-to-css-var.d.ts +8 -0
- package/{components → src/components}/Badge/sgds-badge.d.ts +11 -0
- package/{components → src/components}/Datepicker/sgds-datepicker.d.ts +13 -3
- package/{components → src/components}/Input/sgds-input.d.ts +5 -1
- package/{components → src/components}/Link/sgds-link.d.ts +2 -2
- package/themes/day.css +1 -0
- package/themes/night.css +1 -0
- package/themes/root.css +2 -0
- package/utils/slot.js +18 -1
- package/utils/slot.js.map +1 -1
- package/{base → src/base}/button-element.d.ts +0 -0
- package/{base → src/base}/card-element.d.ts +0 -0
- package/{base → src/base}/dropdown-element.d.ts +0 -0
- package/{base → src/base}/dropdown-list-element.d.ts +0 -0
- package/{base → src/base}/form-control-element.d.ts +0 -0
- package/{base → src/base}/link-element.d.ts +0 -0
- package/{base → src/base}/select-element.d.ts +0 -0
- package/{base → src/base}/sgds-element.d.ts +0 -0
- package/{components → src/components}/Accordion/index.d.ts +0 -0
- package/{components → src/components}/Accordion/sgds-accordion-item.d.ts +0 -0
- package/{components → src/components}/Accordion/sgds-accordion.d.ts +0 -0
- package/{components → src/components}/Alert/index.d.ts +0 -0
- package/{components → src/components}/Alert/sgds-alert-link.d.ts +0 -0
- package/{components → src/components}/Alert/sgds-alert.d.ts +0 -0
- package/{components → src/components}/Badge/index.d.ts +0 -0
- package/{components → src/components}/Breadcrumb/index.d.ts +0 -0
- package/{components → src/components}/Breadcrumb/sgds-breadcrumb-item.d.ts +0 -0
- package/{components → src/components}/Breadcrumb/sgds-breadcrumb.d.ts +0 -0
- package/{components → src/components}/Button/index.d.ts +0 -0
- package/{components → src/components}/Button/sgds-button.d.ts +0 -0
- package/{components → src/components}/Card/index.d.ts +0 -0
- package/{components → src/components}/Card/sgds-card.d.ts +0 -0
- package/{components → src/components}/Checkbox/index.d.ts +0 -0
- package/{components → src/components}/Checkbox/sgds-checkbox-group.d.ts +0 -0
- package/{components → src/components}/Checkbox/sgds-checkbox.d.ts +0 -0
- package/{components → src/components}/ComboBox/combo-box-item.d.ts +0 -0
- package/{components → src/components}/ComboBox/index.d.ts +0 -0
- package/{components → src/components}/ComboBox/sgds-combo-box.d.ts +0 -0
- package/{components → src/components}/Datepicker/datepicker-calendar.d.ts +0 -0
- package/{components → src/components}/Datepicker/datepicker-header.d.ts +0 -0
- package/{components → src/components}/Datepicker/datepicker-input.d.ts +0 -0
- package/{components → src/components}/Datepicker/index.d.ts +0 -0
- package/{components → src/components}/Datepicker/types.d.ts +0 -0
- package/{components → src/components}/DescriptionList/index.d.ts +0 -0
- package/{components → src/components}/DescriptionList/sgds-description-list-group.d.ts +0 -0
- package/{components → src/components}/DescriptionList/sgds-description-list.d.ts +0 -0
- package/{components → src/components}/Divider/index.d.ts +0 -0
- package/{components → src/components}/Divider/sgds-divider.d.ts +0 -0
- package/{components → src/components}/Drawer/index.d.ts +0 -0
- package/{components → src/components}/Drawer/sgds-drawer.d.ts +0 -0
- package/{components → src/components}/Dropdown/index.d.ts +0 -0
- package/{components → src/components}/Dropdown/sgds-dropdown-item.d.ts +0 -0
- package/{components → src/components}/Dropdown/sgds-dropdown.d.ts +0 -0
- package/{components → src/components}/FileUpload/index.d.ts +0 -0
- package/{components → src/components}/FileUpload/sgds-file-upload.d.ts +0 -0
- package/{components → src/components}/Footer/index.d.ts +0 -0
- package/{components → src/components}/Footer/sgds-footer-item.d.ts +0 -0
- package/{components → src/components}/Footer/sgds-footer.d.ts +0 -0
- package/{components → src/components}/Icon/icon-registry.d.ts +0 -0
- package/{components → src/components}/Icon/icons/archive.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-bar-down.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-bar-left.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-bar-right.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-bar-up.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-circle-down.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-circle-left.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-circle-right.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-circle-up.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-clockwise.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-down.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-left.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-repeat.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-right.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-square-down.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-square-left.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-square-right.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-square-up.d.ts +0 -0
- package/{components → src/components}/Icon/icons/arrow-up.d.ts +0 -0
- package/{components → src/components}/Icon/icons/bank-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/bell-slash.d.ts +0 -0
- package/{components → src/components}/Icon/icons/bell.d.ts +0 -0
- package/{components → src/components}/Icon/icons/bi-funnel.d.ts +0 -0
- package/{components → src/components}/Icon/icons/bookmark-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/bookmark.d.ts +0 -0
- package/{components → src/components}/Icon/icons/box-arrow-up-right.d.ts +0 -0
- package/{components → src/components}/Icon/icons/box-seam.d.ts +0 -0
- package/{components → src/components}/Icon/icons/building.d.ts +0 -0
- package/{components → src/components}/Icon/icons/bus.d.ts +0 -0
- package/{components → src/components}/Icon/icons/calculator.d.ts +0 -0
- package/{components → src/components}/Icon/icons/calendar-check.d.ts +0 -0
- package/{components → src/components}/Icon/icons/calendar-x.d.ts +0 -0
- package/{components → src/components}/Icon/icons/calendar.d.ts +0 -0
- package/{components → src/components}/Icon/icons/camera.d.ts +0 -0
- package/{components → src/components}/Icon/icons/car.d.ts +0 -0
- package/{components → src/components}/Icon/icons/chat-dots.d.ts +0 -0
- package/{components → src/components}/Icon/icons/chat-left-text.d.ts +0 -0
- package/{components → src/components}/Icon/icons/chat.d.ts +0 -0
- package/{components → src/components}/Icon/icons/check-circle-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/check-circle.d.ts +0 -0
- package/{components → src/components}/Icon/icons/check.d.ts +0 -0
- package/{components → src/components}/Icon/icons/chevron-down.d.ts +0 -0
- package/{components → src/components}/Icon/icons/chevron-left.d.ts +0 -0
- package/{components → src/components}/Icon/icons/chevron-right.d.ts +0 -0
- package/{components → src/components}/Icon/icons/chevron-selector-vertical.d.ts +0 -0
- package/{components → src/components}/Icon/icons/chevron-up.d.ts +0 -0
- package/{components → src/components}/Icon/icons/clock.d.ts +0 -0
- package/{components → src/components}/Icon/icons/cloud-check.d.ts +0 -0
- package/{components → src/components}/Icon/icons/cloud-download.d.ts +0 -0
- package/{components → src/components}/Icon/icons/cloud-upload.d.ts +0 -0
- package/{components → src/components}/Icon/icons/cloud.d.ts +0 -0
- package/{components → src/components}/Icon/icons/compass.d.ts +0 -0
- package/{components → src/components}/Icon/icons/cross.d.ts +0 -0
- package/{components → src/components}/Icon/icons/cursor-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/cursor.d.ts +0 -0
- package/{components → src/components}/Icon/icons/dash-circle.d.ts +0 -0
- package/{components → src/components}/Icon/icons/dash-square.d.ts +0 -0
- package/{components → src/components}/Icon/icons/dash.d.ts +0 -0
- package/{components → src/components}/Icon/icons/download.d.ts +0 -0
- package/{components → src/components}/Icon/icons/edit.d.ts +0 -0
- package/{components → src/components}/Icon/icons/exclamation-circle-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/exclamation-circle.d.ts +0 -0
- package/{components → src/components}/Icon/icons/exclamation-triangle-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/exclamation-triangle.d.ts +0 -0
- package/{components → src/components}/Icon/icons/exclamation.d.ts +0 -0
- package/{components → src/components}/Icon/icons/eye-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/eye-slash-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/eye-slash.d.ts +0 -0
- package/{components → src/components}/Icon/icons/eye.d.ts +0 -0
- package/{components → src/components}/Icon/icons/facebook.d.ts +0 -0
- package/{components → src/components}/Icon/icons/file-earmark-text.d.ts +0 -0
- package/{components → src/components}/Icon/icons/file-pdf.d.ts +0 -0
- package/{components → src/components}/Icon/icons/file-plus.d.ts +0 -0
- package/{components → src/components}/Icon/icons/file-text.d.ts +0 -0
- package/{components → src/components}/Icon/icons/file.d.ts +0 -0
- package/{components → src/components}/Icon/icons/files.d.ts +0 -0
- package/{components → src/components}/Icon/icons/folder-check.d.ts +0 -0
- package/{components → src/components}/Icon/icons/folder-minus.d.ts +0 -0
- package/{components → src/components}/Icon/icons/folder-plus.d.ts +0 -0
- package/{components → src/components}/Icon/icons/folder.d.ts +0 -0
- package/{components → src/components}/Icon/icons/gear.d.ts +0 -0
- package/{components → src/components}/Icon/icons/geo-alt.d.ts +0 -0
- package/{components → src/components}/Icon/icons/geo-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/geo.d.ts +0 -0
- package/{components → src/components}/Icon/icons/globe-alt.d.ts +0 -0
- package/{components → src/components}/Icon/icons/globe.d.ts +0 -0
- package/{components → src/components}/Icon/icons/google.d.ts +0 -0
- package/{components → src/components}/Icon/icons/grid-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/hand-thumbs-down.d.ts +0 -0
- package/{components → src/components}/Icon/icons/hand-thumbs-up.d.ts +0 -0
- package/{components → src/components}/Icon/icons/hard-drive.d.ts +0 -0
- package/{components → src/components}/Icon/icons/heart.d.ts +0 -0
- package/{components → src/components}/Icon/icons/house-door.d.ts +0 -0
- package/{components → src/components}/Icon/icons/house.d.ts +0 -0
- package/{components → src/components}/Icon/icons/image.d.ts +0 -0
- package/{components → src/components}/Icon/icons/in-box.d.ts +0 -0
- package/{components → src/components}/Icon/icons/info-circle-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/info-circle.d.ts +0 -0
- package/{components → src/components}/Icon/icons/instagram.d.ts +0 -0
- package/{components → src/components}/Icon/icons/laptop.d.ts +0 -0
- package/{components → src/components}/Icon/icons/layers.d.ts +0 -0
- package/{components → src/components}/Icon/icons/layout-text-window-reverse.d.ts +0 -0
- package/{components → src/components}/Icon/icons/layout-text-window.d.ts +0 -0
- package/{components → src/components}/Icon/icons/layout.d.ts +0 -0
- package/{components → src/components}/Icon/icons/lightbulb.d.ts +0 -0
- package/{components → src/components}/Icon/icons/link.d.ts +0 -0
- package/{components → src/components}/Icon/icons/linkedin.d.ts +0 -0
- package/{components → src/components}/Icon/icons/list.d.ts +0 -0
- package/{components → src/components}/Icon/icons/lock-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/lock.d.ts +0 -0
- package/{components → src/components}/Icon/icons/login.d.ts +0 -0
- package/{components → src/components}/Icon/icons/logout.d.ts +0 -0
- package/{components → src/components}/Icon/icons/luggage.d.ts +0 -0
- package/{components → src/components}/Icon/icons/mail.d.ts +0 -0
- package/{components → src/components}/Icon/icons/map.d.ts +0 -0
- package/{components → src/components}/Icon/icons/menu.d.ts +0 -0
- package/{components → src/components}/Icon/icons/microphone.d.ts +0 -0
- package/{components → src/components}/Icon/icons/monitor.d.ts +0 -0
- package/{components → src/components}/Icon/icons/paperclip.d.ts +0 -0
- package/{components → src/components}/Icon/icons/passport.d.ts +0 -0
- package/{components → src/components}/Icon/icons/pencil.d.ts +0 -0
- package/{components → src/components}/Icon/icons/pending-circle.d.ts +0 -0
- package/{components → src/components}/Icon/icons/person-dash.d.ts +0 -0
- package/{components → src/components}/Icon/icons/person-plus.d.ts +0 -0
- package/{components → src/components}/Icon/icons/person-x.d.ts +0 -0
- package/{components → src/components}/Icon/icons/person.d.ts +0 -0
- package/{components → src/components}/Icon/icons/phone.d.ts +0 -0
- package/{components → src/components}/Icon/icons/pin-map-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/pin.d.ts +0 -0
- package/{components → src/components}/Icon/icons/placeholder.d.ts +0 -0
- package/{components → src/components}/Icon/icons/plane.d.ts +0 -0
- package/{components → src/components}/Icon/icons/plus-circle.d.ts +0 -0
- package/{components → src/components}/Icon/icons/plus-square.d.ts +0 -0
- package/{components → src/components}/Icon/icons/plus.d.ts +0 -0
- package/{components → src/components}/Icon/icons/printer.d.ts +0 -0
- package/{components → src/components}/Icon/icons/question-circle.d.ts +0 -0
- package/{components → src/components}/Icon/icons/rocket.d.ts +0 -0
- package/{components → src/components}/Icon/icons/save.d.ts +0 -0
- package/{components → src/components}/Icon/icons/search.d.ts +0 -0
- package/{components → src/components}/Icon/icons/send.d.ts +0 -0
- package/{components → src/components}/Icon/icons/sg-crest.d.ts +0 -0
- package/{components → src/components}/Icon/icons/share.d.ts +0 -0
- package/{components → src/components}/Icon/icons/slash-circle.d.ts +0 -0
- package/{components → src/components}/Icon/icons/sliders.d.ts +0 -0
- package/{components → src/components}/Icon/icons/speedometer.d.ts +0 -0
- package/{components → src/components}/Icon/icons/star-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/star.d.ts +0 -0
- package/{components → src/components}/Icon/icons/stoplights.d.ts +0 -0
- package/{components → src/components}/Icon/icons/switch-horizontal.d.ts +0 -0
- package/{components → src/components}/Icon/icons/switch-vertical.d.ts +0 -0
- package/{components → src/components}/Icon/icons/tablet.d.ts +0 -0
- package/{components → src/components}/Icon/icons/telephone.d.ts +0 -0
- package/{components → src/components}/Icon/icons/three-dots-vertical.d.ts +0 -0
- package/{components → src/components}/Icon/icons/three-dots.d.ts +0 -0
- package/{components → src/components}/Icon/icons/ticket.d.ts +0 -0
- package/{components → src/components}/Icon/icons/toggle-off.d.ts +0 -0
- package/{components → src/components}/Icon/icons/toggle-on.d.ts +0 -0
- package/{components → src/components}/Icon/icons/train.d.ts +0 -0
- package/{components → src/components}/Icon/icons/translate.d.ts +0 -0
- package/{components → src/components}/Icon/icons/trash.d.ts +0 -0
- package/{components → src/components}/Icon/icons/truck.d.ts +0 -0
- package/{components → src/components}/Icon/icons/twitter-x.d.ts +0 -0
- package/{components → src/components}/Icon/icons/unlock.d.ts +0 -0
- package/{components → src/components}/Icon/icons/upload.d.ts +0 -0
- package/{components → src/components}/Icon/icons/user-circle.d.ts +0 -0
- package/{components → src/components}/Icon/icons/user-square.d.ts +0 -0
- package/{components → src/components}/Icon/icons/users.d.ts +0 -0
- package/{components → src/components}/Icon/icons/video-recorder.d.ts +0 -0
- package/{components → src/components}/Icon/icons/volume-max.d.ts +0 -0
- package/{components → src/components}/Icon/icons/volume-x.d.ts +0 -0
- package/{components → src/components}/Icon/icons/window-dash.d.ts +0 -0
- package/{components → src/components}/Icon/icons/window-desktop.d.ts +0 -0
- package/{components → src/components}/Icon/icons/window-dock.d.ts +0 -0
- package/{components → src/components}/Icon/icons/window-fullscreen.d.ts +0 -0
- package/{components → src/components}/Icon/icons/window-plus.d.ts +0 -0
- package/{components → src/components}/Icon/icons/window-sidebar.d.ts +0 -0
- package/{components → src/components}/Icon/icons/window-split.d.ts +0 -0
- package/{components → src/components}/Icon/icons/window-stack.d.ts +0 -0
- package/{components → src/components}/Icon/icons/window-x.d.ts +0 -0
- package/{components → src/components}/Icon/icons/window.d.ts +0 -0
- package/{components → src/components}/Icon/icons/xcircle-fill.d.ts +0 -0
- package/{components → src/components}/Icon/icons/xcircle.d.ts +0 -0
- package/{components → src/components}/Icon/icons/youtube.d.ts +0 -0
- package/{components → src/components}/Icon/icons/zoom-in.d.ts +0 -0
- package/{components → src/components}/Icon/icons/zoom-out.d.ts +0 -0
- package/{components → src/components}/Icon/index.d.ts +0 -0
- package/{components → src/components}/Icon/sgds-icon.d.ts +0 -0
- package/{components → src/components}/IconButton/index.d.ts +0 -0
- package/{components → src/components}/IconButton/sgds-icon-button.d.ts +0 -0
- package/{components → src/components}/IconList/index.d.ts +0 -0
- package/{components → src/components}/IconList/sgds-icon-list.d.ts +0 -0
- package/{components → src/components}/Input/index.d.ts +0 -0
- package/{components → src/components}/Link/index.d.ts +0 -0
- package/{components → src/components}/Mainnav/index.d.ts +0 -0
- package/{components → src/components}/Mainnav/mainnav-context.d.ts +0 -0
- package/{components → src/components}/Mainnav/sgds-mainnav-dropdown.d.ts +0 -0
- package/{components → src/components}/Mainnav/sgds-mainnav-item.d.ts +0 -0
- package/{components → src/components}/Mainnav/sgds-mainnav.d.ts +0 -0
- package/{components → src/components}/Masthead/index.d.ts +0 -0
- package/{components → src/components}/Masthead/sgds-masthead.d.ts +0 -0
- package/{components → src/components}/Modal/index.d.ts +0 -0
- package/{components → src/components}/Modal/sgds-modal.d.ts +0 -0
- package/{components → src/components}/Pagination/index.d.ts +0 -0
- package/{components → src/components}/Pagination/sgds-pagination.d.ts +0 -0
- package/{components → src/components}/ProgressBar/index.d.ts +0 -0
- package/{components → src/components}/ProgressBar/sgds-progress-bar.d.ts +0 -0
- package/{components → src/components}/QuantityToggle/index.d.ts +0 -0
- package/{components → src/components}/QuantityToggle/sgds-quantity-toggle.d.ts +0 -0
- package/{components → src/components}/Radio/index.d.ts +0 -0
- package/{components → src/components}/Radio/sgds-radio-group.d.ts +0 -0
- package/{components → src/components}/Radio/sgds-radio.d.ts +0 -0
- package/{components → src/components}/Select/index.d.ts +0 -0
- package/{components → src/components}/Select/select-item.d.ts +0 -0
- package/{components → src/components}/Select/sgds-select.d.ts +0 -0
- package/{components → src/components}/Sidenav/index.d.ts +0 -0
- package/{components → src/components}/Sidenav/sgds-sidenav-item.d.ts +0 -0
- package/{components → src/components}/Sidenav/sgds-sidenav-link.d.ts +0 -0
- package/{components → src/components}/Sidenav/sgds-sidenav.d.ts +0 -0
- package/{components → src/components}/Skeleton/index.d.ts +0 -0
- package/{components → src/components}/Skeleton/sgds-skeleton.d.ts +0 -0
- package/{components → src/components}/Spinner/index.d.ts +0 -0
- package/{components → src/components}/Spinner/sgds-spinner.d.ts +0 -0
- package/{components → src/components}/Stepper/index.d.ts +0 -0
- package/{components → src/components}/Stepper/sgds-stepper.d.ts +0 -0
- package/{components → src/components}/Subnav/index.d.ts +0 -0
- package/{components → src/components}/Subnav/sgds-subnav-item.d.ts +0 -0
- package/{components → src/components}/Subnav/sgds-subnav.d.ts +0 -0
- package/{components → src/components}/Switch/index.d.ts +0 -0
- package/{components → src/components}/Switch/sgds-switch.d.ts +0 -0
- package/{components → src/components}/Tab/index.d.ts +0 -0
- package/{components → src/components}/Tab/sgds-tab-group.d.ts +0 -0
- package/{components → src/components}/Tab/sgds-tab-panel.d.ts +0 -0
- package/{components → src/components}/Tab/sgds-tab.d.ts +0 -0
- package/{components → src/components}/Table/index.d.ts +0 -0
- package/{components → src/components}/Table/sgds-table-cell.d.ts +0 -0
- package/{components → src/components}/Table/sgds-table-head.d.ts +0 -0
- package/{components → src/components}/Table/sgds-table-row.d.ts +0 -0
- package/{components → src/components}/Table/sgds-table.d.ts +0 -0
- package/{components → src/components}/TableOfContents/index.d.ts +0 -0
- package/{components → src/components}/TableOfContents/sgds-table-of-contents.d.ts +0 -0
- package/{components → src/components}/Textarea/index.d.ts +0 -0
- package/{components → src/components}/Textarea/sgds-textarea.d.ts +0 -0
- package/{components → src/components}/Toast/index.d.ts +0 -0
- package/{components → src/components}/Toast/sgds-toast-container.d.ts +0 -0
- package/{components → src/components}/Toast/sgds-toast.d.ts +0 -0
- package/{components → src/components}/Tooltip/index.d.ts +0 -0
- package/{components → src/components}/Tooltip/sgds-tooltip.d.ts +0 -0
- package/{components → src/components}/index.d.ts +0 -0
- package/{index.d.ts → src/index.d.ts} +0 -0
- package/{internals → src/internals}/CloseButton/index.d.ts +0 -0
- package/{internals → src/internals}/CloseButton/sgds-close-button.d.ts +0 -0
- package/{internals → src/internals}/OverflowMenu/index.d.ts +0 -0
- package/{internals → src/internals}/OverflowMenu/sgds-overflow-menu.d.ts +0 -0
- package/{react → src/react}/accordion/index.d.ts +0 -0
- package/{react → src/react}/accordion-item/index.d.ts +0 -0
- package/{react → src/react}/alert/index.d.ts +0 -0
- package/{react → src/react}/alert-link/index.d.ts +0 -0
- package/{react → src/react}/badge/index.d.ts +0 -0
- package/{react → src/react}/breadcrumb/index.d.ts +0 -0
- package/{react → src/react}/breadcrumb-item/index.d.ts +0 -0
- package/{react → src/react}/button/index.d.ts +0 -0
- package/{react → src/react}/card/index.d.ts +0 -0
- package/{react → src/react}/checkbox/index.d.ts +0 -0
- package/{react → src/react}/checkbox-group/index.d.ts +0 -0
- package/{react → src/react}/combo-box/index.d.ts +0 -0
- package/{react → src/react}/datepicker/index.d.ts +0 -0
- package/{react → src/react}/description-list/index.d.ts +0 -0
- package/{react → src/react}/description-list-group/index.d.ts +0 -0
- package/{react → src/react}/divider/index.d.ts +0 -0
- package/{react → src/react}/drawer/index.d.ts +0 -0
- package/{react → src/react}/dropdown/index.d.ts +0 -0
- package/{react → src/react}/dropdown-item/index.d.ts +0 -0
- package/{react → src/react}/file-upload/index.d.ts +0 -0
- package/{react → src/react}/footer/index.d.ts +0 -0
- package/{react → src/react}/footer-item/index.d.ts +0 -0
- package/{react → src/react}/icon/index.d.ts +0 -0
- package/{react → src/react}/icon-button/index.d.ts +0 -0
- package/{react → src/react}/icon-list/index.d.ts +0 -0
- package/{react → src/react}/index.d.ts +1 -1
- /package/{react → src/react}/input/index.d.ts +0 -0
- /package/{react → src/react}/link/index.d.ts +0 -0
- /package/{react → src/react}/mainnav/index.d.ts +0 -0
- /package/{react → src/react}/mainnav-dropdown/index.d.ts +0 -0
- /package/{react → src/react}/mainnav-item/index.d.ts +0 -0
- /package/{react → src/react}/masthead/index.d.ts +0 -0
- /package/{react → src/react}/modal/index.d.ts +0 -0
- /package/{react → src/react}/pagination/index.d.ts +0 -0
- /package/{react → src/react}/progress-bar/index.d.ts +0 -0
- /package/{react → src/react}/quantity-toggle/index.d.ts +0 -0
- /package/{react → src/react}/radio/index.d.ts +0 -0
- /package/{react → src/react}/radio-group/index.d.ts +0 -0
- /package/{react → src/react}/select/index.d.ts +0 -0
- /package/{react → src/react}/sidenav/index.d.ts +0 -0
- /package/{react → src/react}/sidenav-item/index.d.ts +0 -0
- /package/{react → src/react}/sidenav-link/index.d.ts +0 -0
- /package/{react → src/react}/skeleton/index.d.ts +0 -0
- /package/{react → src/react}/spinner/index.d.ts +0 -0
- /package/{react → src/react}/stepper/index.d.ts +0 -0
- /package/{react → src/react}/subnav/index.d.ts +0 -0
- /package/{react → src/react}/subnav-item/index.d.ts +0 -0
- /package/{react → src/react}/switch/index.d.ts +0 -0
- /package/{react → src/react}/tab/index.d.ts +0 -0
- /package/{react → src/react}/tab-group/index.d.ts +0 -0
- /package/{react → src/react}/tab-panel/index.d.ts +0 -0
- /package/{react → src/react}/table/index.d.ts +0 -0
- /package/{react → src/react}/table-cell/index.d.ts +0 -0
- /package/{react → src/react}/table-head/index.d.ts +0 -0
- /package/{react → src/react}/table-of-contents/index.d.ts +0 -0
- /package/{react → src/react}/table-row/index.d.ts +0 -0
- /package/{react → src/react}/textarea/index.d.ts +0 -0
- /package/{react → src/react}/toast/index.d.ts +0 -0
- /package/{react → src/react}/toast-container/index.d.ts +0 -0
- /package/{react → src/react}/tooltip/index.d.ts +0 -0
- /package/{utils → src/utils}/animate.d.ts +0 -0
- /package/{utils → src/utils}/animation-registry.d.ts +0 -0
- /package/{utils → src/utils}/breakpoints.d.ts +0 -0
- /package/{utils → src/utils}/ce-registry.d.ts +0 -0
- /package/{utils → src/utils}/defaultvalue.d.ts +0 -0
- /package/{utils → src/utils}/event.d.ts +0 -0
- /package/{utils → src/utils}/formSubmitController.d.ts +0 -0
- /package/{utils → src/utils}/generateCustomElementName.d.ts +0 -0
- /package/{utils → src/utils}/generateId.d.ts +0 -0
- /package/{utils → src/utils}/inputValidationController.d.ts +0 -0
- /package/{utils → src/utils}/mergeDeep.d.ts +0 -0
- /package/{utils → src/utils}/modal.d.ts +0 -0
- /package/{utils → src/utils}/object.d.ts +0 -0
- /package/{utils → src/utils}/offset.d.ts +0 -0
- /package/{utils → src/utils}/scroll.d.ts +0 -0
- /package/{utils → src/utils}/slot.d.ts +0 -0
- /package/{utils → src/utils}/tabbable.d.ts +0 -0
- /package/{utils → src/utils}/test.d.ts +0 -0
- /package/{utils → src/utils}/time.d.ts +0 -0
- /package/{utils → src/utils}/validatorMixin.d.ts +0 -0
- /package/{utils → src/utils}/watch.d.ts +0 -0
|
@@ -4287,6 +4287,56 @@
|
|
|
4287
4287
|
});
|
|
4288
4288
|
}
|
|
4289
4289
|
|
|
4290
|
+
/**
|
|
4291
|
+
* @license
|
|
4292
|
+
* Copyright 2021 Google LLC
|
|
4293
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
4294
|
+
*/
|
|
4295
|
+
/**
|
|
4296
|
+
* A property decorator that converts a class property into a getter that
|
|
4297
|
+
* returns the `assignedElements` of the given `slot`. Provides a declarative
|
|
4298
|
+
* way to use
|
|
4299
|
+
* [`HTMLSlotElement.assignedElements`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSlotElement/assignedElements).
|
|
4300
|
+
*
|
|
4301
|
+
* Can be passed an optional {@linkcode QueryAssignedElementsOptions} object.
|
|
4302
|
+
*
|
|
4303
|
+
* Example usage:
|
|
4304
|
+
* ```ts
|
|
4305
|
+
* class MyElement {
|
|
4306
|
+
* @queryAssignedElements({ slot: 'list' })
|
|
4307
|
+
* listItems!: Array<HTMLElement>;
|
|
4308
|
+
* @queryAssignedElements()
|
|
4309
|
+
* unnamedSlotEls!: Array<HTMLElement>;
|
|
4310
|
+
*
|
|
4311
|
+
* render() {
|
|
4312
|
+
* return html`
|
|
4313
|
+
* <slot name="list"></slot>
|
|
4314
|
+
* <slot></slot>
|
|
4315
|
+
* `;
|
|
4316
|
+
* }
|
|
4317
|
+
* }
|
|
4318
|
+
* ```
|
|
4319
|
+
*
|
|
4320
|
+
* Note, the type of this property should be annotated as `Array<HTMLElement>`.
|
|
4321
|
+
*
|
|
4322
|
+
* @category Decorator
|
|
4323
|
+
*/
|
|
4324
|
+
function queryAssignedElements(options) {
|
|
4325
|
+
return ((obj, name) => {
|
|
4326
|
+
const { slot, selector } = options ?? {};
|
|
4327
|
+
const slotSelector = `slot${slot ? `[name=${slot}]` : ':not([name])'}`;
|
|
4328
|
+
return desc(obj, name, {
|
|
4329
|
+
get() {
|
|
4330
|
+
const slotEl = this.renderRoot?.querySelector(slotSelector);
|
|
4331
|
+
const elements = slotEl?.assignedElements(options) ?? [];
|
|
4332
|
+
return (selector === undefined
|
|
4333
|
+
? elements
|
|
4334
|
+
: elements.filter((node) => node.matches(selector)));
|
|
4335
|
+
},
|
|
4336
|
+
});
|
|
4337
|
+
});
|
|
4338
|
+
}
|
|
4339
|
+
|
|
4290
4340
|
/**
|
|
4291
4341
|
* @license
|
|
4292
4342
|
* Copyright 2017 Google LLC
|
|
@@ -4901,11 +4951,11 @@
|
|
|
4901
4951
|
*/
|
|
4902
4952
|
const ref = directive(RefDirective);
|
|
4903
4953
|
|
|
4904
|
-
var css_248z$
|
|
4954
|
+
var css_248z$c = css`.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-280);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:1000}.dropdown-menu.show{display:block}.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 .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`;
|
|
4905
4955
|
|
|
4906
|
-
var css_248z$
|
|
4956
|
+
var css_248z$b = css`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-min)}.invalid-feedback{font-size:var(--sgds-font-size-1);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`;
|
|
4907
4957
|
|
|
4908
|
-
var css_248z$
|
|
4958
|
+
var css_248z$a = css`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-1);line-height:var(--sgds-line-height-min)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`;
|
|
4909
4959
|
|
|
4910
4960
|
// @defaultValue decorator
|
|
4911
4961
|
const defaultValue = (propertyName = "value") => (proto, key) => {
|
|
@@ -7064,6 +7114,8 @@
|
|
|
7064
7114
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
7065
7115
|
* --------------------------------------------------------------------------
|
|
7066
7116
|
*/
|
|
7117
|
+
|
|
7118
|
+
const MAX_UID = 1_000_000;
|
|
7067
7119
|
const MILLISECONDS_MULTIPLIER = 1000;
|
|
7068
7120
|
const TRANSITION_END = 'transitionend';
|
|
7069
7121
|
|
|
@@ -7090,6 +7142,18 @@
|
|
|
7090
7142
|
return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase()
|
|
7091
7143
|
};
|
|
7092
7144
|
|
|
7145
|
+
/**
|
|
7146
|
+
* Public Util API
|
|
7147
|
+
*/
|
|
7148
|
+
|
|
7149
|
+
const getUID = prefix => {
|
|
7150
|
+
do {
|
|
7151
|
+
prefix += Math.floor(Math.random() * MAX_UID);
|
|
7152
|
+
} while (document.getElementById(prefix))
|
|
7153
|
+
|
|
7154
|
+
return prefix
|
|
7155
|
+
};
|
|
7156
|
+
|
|
7093
7157
|
const getTransitionDurationFromElement = element => {
|
|
7094
7158
|
if (!element) {
|
|
7095
7159
|
return 0
|
|
@@ -7185,6 +7249,29 @@
|
|
|
7185
7249
|
return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'
|
|
7186
7250
|
};
|
|
7187
7251
|
|
|
7252
|
+
const findShadowRoot = element => {
|
|
7253
|
+
if (!document.documentElement.attachShadow) {
|
|
7254
|
+
return null
|
|
7255
|
+
}
|
|
7256
|
+
|
|
7257
|
+
// Can find the shadow root otherwise it'll return the document
|
|
7258
|
+
if (typeof element.getRootNode === 'function') {
|
|
7259
|
+
const root = element.getRootNode();
|
|
7260
|
+
return root instanceof ShadowRoot ? root : null
|
|
7261
|
+
}
|
|
7262
|
+
|
|
7263
|
+
if (element instanceof ShadowRoot) {
|
|
7264
|
+
return element
|
|
7265
|
+
}
|
|
7266
|
+
|
|
7267
|
+
// when we don't find a shadow root
|
|
7268
|
+
if (!element.parentNode) {
|
|
7269
|
+
return null
|
|
7270
|
+
}
|
|
7271
|
+
|
|
7272
|
+
return findShadowRoot(element.parentNode)
|
|
7273
|
+
};
|
|
7274
|
+
|
|
7188
7275
|
const noop = () => {};
|
|
7189
7276
|
|
|
7190
7277
|
const getjQuery = () => {
|
|
@@ -7952,7 +8039,7 @@
|
|
|
7952
8039
|
* Constants
|
|
7953
8040
|
*/
|
|
7954
8041
|
|
|
7955
|
-
const NAME = 'dropdown';
|
|
8042
|
+
const NAME$2 = 'dropdown';
|
|
7956
8043
|
const DATA_KEY = 'bs.dropdown';
|
|
7957
8044
|
const EVENT_KEY = `.${DATA_KEY}`;
|
|
7958
8045
|
const DATA_API_KEY = '.data-api';
|
|
@@ -7963,15 +8050,15 @@
|
|
|
7963
8050
|
const ARROW_DOWN_KEY = 'ArrowDown';
|
|
7964
8051
|
const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
|
|
7965
8052
|
|
|
7966
|
-
const EVENT_HIDE = `hide${EVENT_KEY}`;
|
|
7967
|
-
const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
|
|
7968
|
-
const EVENT_SHOW = `show${EVENT_KEY}`;
|
|
7969
|
-
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
|
8053
|
+
const EVENT_HIDE$1 = `hide${EVENT_KEY}`;
|
|
8054
|
+
const EVENT_HIDDEN$1 = `hidden${EVENT_KEY}`;
|
|
8055
|
+
const EVENT_SHOW$1 = `show${EVENT_KEY}`;
|
|
8056
|
+
const EVENT_SHOWN$1 = `shown${EVENT_KEY}`;
|
|
7970
8057
|
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
|
|
7971
8058
|
const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`;
|
|
7972
8059
|
const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY}${DATA_API_KEY}`;
|
|
7973
8060
|
|
|
7974
|
-
const CLASS_NAME_SHOW = 'show';
|
|
8061
|
+
const CLASS_NAME_SHOW$1 = 'show';
|
|
7975
8062
|
const CLASS_NAME_DROPUP = 'dropup';
|
|
7976
8063
|
const CLASS_NAME_DROPEND = 'dropend';
|
|
7977
8064
|
const CLASS_NAME_DROPSTART = 'dropstart';
|
|
@@ -7979,7 +8066,7 @@
|
|
|
7979
8066
|
const CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center';
|
|
7980
8067
|
|
|
7981
8068
|
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)';
|
|
7982
|
-
const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE}.${CLASS_NAME_SHOW}`;
|
|
8069
|
+
const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE}.${CLASS_NAME_SHOW$1}`;
|
|
7983
8070
|
const SELECTOR_MENU = '.dropdown-menu';
|
|
7984
8071
|
const SELECTOR_NAVBAR = '.navbar';
|
|
7985
8072
|
const SELECTOR_NAVBAR_NAV = '.navbar-nav';
|
|
@@ -7994,7 +8081,7 @@
|
|
|
7994
8081
|
const PLACEMENT_TOPCENTER = 'top';
|
|
7995
8082
|
const PLACEMENT_BOTTOMCENTER = 'bottom';
|
|
7996
8083
|
|
|
7997
|
-
const Default = {
|
|
8084
|
+
const Default$2 = {
|
|
7998
8085
|
autoClose: true,
|
|
7999
8086
|
boundary: 'clippingParents',
|
|
8000
8087
|
display: 'dynamic',
|
|
@@ -8003,7 +8090,7 @@
|
|
|
8003
8090
|
reference: 'toggle'
|
|
8004
8091
|
};
|
|
8005
8092
|
|
|
8006
|
-
const DefaultType = {
|
|
8093
|
+
const DefaultType$2 = {
|
|
8007
8094
|
autoClose: '(boolean|string)',
|
|
8008
8095
|
boundary: '(string|element)',
|
|
8009
8096
|
display: 'string',
|
|
@@ -8031,15 +8118,15 @@
|
|
|
8031
8118
|
|
|
8032
8119
|
// Getters
|
|
8033
8120
|
static get Default() {
|
|
8034
|
-
return Default
|
|
8121
|
+
return Default$2
|
|
8035
8122
|
}
|
|
8036
8123
|
|
|
8037
8124
|
static get DefaultType() {
|
|
8038
|
-
return DefaultType
|
|
8125
|
+
return DefaultType$2
|
|
8039
8126
|
}
|
|
8040
8127
|
|
|
8041
8128
|
static get NAME() {
|
|
8042
|
-
return NAME
|
|
8129
|
+
return NAME$2
|
|
8043
8130
|
}
|
|
8044
8131
|
|
|
8045
8132
|
// Public
|
|
@@ -8056,7 +8143,7 @@
|
|
|
8056
8143
|
relatedTarget: this._element
|
|
8057
8144
|
};
|
|
8058
8145
|
|
|
8059
|
-
const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, relatedTarget);
|
|
8146
|
+
const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$1, relatedTarget);
|
|
8060
8147
|
|
|
8061
8148
|
if (showEvent.defaultPrevented) {
|
|
8062
8149
|
return
|
|
@@ -8077,9 +8164,9 @@
|
|
|
8077
8164
|
this._element.focus();
|
|
8078
8165
|
this._element.setAttribute('aria-expanded', true);
|
|
8079
8166
|
|
|
8080
|
-
this._menu.classList.add(CLASS_NAME_SHOW);
|
|
8081
|
-
this._element.classList.add(CLASS_NAME_SHOW);
|
|
8082
|
-
EventHandler.trigger(this._element, EVENT_SHOWN, relatedTarget);
|
|
8167
|
+
this._menu.classList.add(CLASS_NAME_SHOW$1);
|
|
8168
|
+
this._element.classList.add(CLASS_NAME_SHOW$1);
|
|
8169
|
+
EventHandler.trigger(this._element, EVENT_SHOWN$1, relatedTarget);
|
|
8083
8170
|
}
|
|
8084
8171
|
|
|
8085
8172
|
hide() {
|
|
@@ -8111,7 +8198,7 @@
|
|
|
8111
8198
|
|
|
8112
8199
|
// Private
|
|
8113
8200
|
_completeHide(relatedTarget) {
|
|
8114
|
-
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE, relatedTarget);
|
|
8201
|
+
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$1, relatedTarget);
|
|
8115
8202
|
if (hideEvent.defaultPrevented) {
|
|
8116
8203
|
return
|
|
8117
8204
|
}
|
|
@@ -8128,11 +8215,11 @@
|
|
|
8128
8215
|
this._popper.destroy();
|
|
8129
8216
|
}
|
|
8130
8217
|
|
|
8131
|
-
this._menu.classList.remove(CLASS_NAME_SHOW);
|
|
8132
|
-
this._element.classList.remove(CLASS_NAME_SHOW);
|
|
8218
|
+
this._menu.classList.remove(CLASS_NAME_SHOW$1);
|
|
8219
|
+
this._element.classList.remove(CLASS_NAME_SHOW$1);
|
|
8133
8220
|
this._element.setAttribute('aria-expanded', 'false');
|
|
8134
8221
|
Manipulator.removeDataAttribute(this._menu, 'popper');
|
|
8135
|
-
EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget);
|
|
8222
|
+
EventHandler.trigger(this._element, EVENT_HIDDEN$1, relatedTarget);
|
|
8136
8223
|
}
|
|
8137
8224
|
|
|
8138
8225
|
_getConfig(config) {
|
|
@@ -8142,7 +8229,7 @@
|
|
|
8142
8229
|
typeof config.reference.getBoundingClientRect !== 'function'
|
|
8143
8230
|
) {
|
|
8144
8231
|
// Popper virtual elements require a getBoundingClientRect method
|
|
8145
|
-
throw new TypeError(`${NAME.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`)
|
|
8232
|
+
throw new TypeError(`${NAME$2.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`)
|
|
8146
8233
|
}
|
|
8147
8234
|
|
|
8148
8235
|
return config
|
|
@@ -8168,7 +8255,7 @@
|
|
|
8168
8255
|
}
|
|
8169
8256
|
|
|
8170
8257
|
_isShown() {
|
|
8171
|
-
return this._menu.classList.contains(CLASS_NAME_SHOW)
|
|
8258
|
+
return this._menu.classList.contains(CLASS_NAME_SHOW$1)
|
|
8172
8259
|
}
|
|
8173
8260
|
|
|
8174
8261
|
_getPlacement() {
|
|
@@ -8403,7 +8490,7 @@
|
|
|
8403
8490
|
return target;
|
|
8404
8491
|
};
|
|
8405
8492
|
|
|
8406
|
-
var css_248z$
|
|
8493
|
+
var css_248z$9 = css`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);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-body);margin:0;*,:after,:before{box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}a[target=_blank]{align-items:center;display:flex;gap:var(--sgds-gap-2-xs)}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.274 3.9H9.3a.6.6 0 0 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.361 6.41c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v5.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h5.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.469-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.274c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.524-.042-1.175-.042-1.993V9.274c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C7.805 3.9 8.456 3.9 9.274 3.9Zm3.626.6a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V5.949l-5.976 5.975a.6.6 0 0 1-.848-.848L18.05 5.1H13.5a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.274 3.9H9.3a.6.6 0 0 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.361 6.41c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v5.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h5.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.469-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.274c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.524-.042-1.175-.042-1.993V9.274c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C7.805 3.9 8.456 3.9 9.274 3.9Zm3.626.6a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V5.949l-5.976 5.975a.6.6 0 0 1-.848-.848L18.05 5.1H13.5a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;padding:0 .45em}::slotted(svg){vertical-align:middle}}`;
|
|
8407
8494
|
|
|
8408
8495
|
/**
|
|
8409
8496
|
* @cssprop --sgds-{stateColor} - State colors in hexadecimal value
|
|
@@ -8460,7 +8547,7 @@
|
|
|
8460
8547
|
});
|
|
8461
8548
|
}
|
|
8462
8549
|
}
|
|
8463
|
-
SgdsElement.styles = [css_248z$
|
|
8550
|
+
SgdsElement.styles = [css_248z$9];
|
|
8464
8551
|
/** @internal */
|
|
8465
8552
|
SgdsElement.dependencies = {};
|
|
8466
8553
|
|
|
@@ -8900,7 +8987,7 @@
|
|
|
8900
8987
|
}
|
|
8901
8988
|
}
|
|
8902
8989
|
}
|
|
8903
|
-
SelectElement.styles = [...DropdownListElement.styles, css_248z$
|
|
8990
|
+
SelectElement.styles = [...DropdownListElement.styles, css_248z$c, css_248z$a, css_248z$b];
|
|
8904
8991
|
__decorate([
|
|
8905
8992
|
property({ reflect: true })
|
|
8906
8993
|
], SelectElement.prototype, "label", void 0);
|
|
@@ -8993,170 +9080,1218 @@
|
|
|
8993
9080
|
};
|
|
8994
9081
|
}
|
|
8995
9082
|
|
|
8996
|
-
var css_248z$
|
|
9083
|
+
var css_248z$8 = css`:host{cursor:default;display:inline-flex;max-width:100%}:host([variant=success]) .badge{background-color:var(--sgds-success-surface-default)}:host([variant=danger]) .badge{background-color:var(--sgds-danger-surface-default)}:host([variant=warning]) .badge{background-color:var(--sgds-warning-surface-default);color:var(--sgds-color-fixed-dark)}:host([variant=neutral]) .badge{background-color:var(--sgds-neutral-surface-default)}:host([variant=success][outlined]) .badge{background-color:var(--sgds-success-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-success-border-color-default)}:host([variant=danger][outlined]) .badge{background-color:var(--sgds-danger-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-danger-border-color-default)}:host([variant=warning][outlined]) .badge{background-color:var(--sgds-warning-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-warning-border-color-default)}:host([variant=neutral][outlined]) .badge{background-color:var(--sgds-neutral-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-neutral-border-color-default)}sgds-tooltip{display:block;max-width:100%}.badge{align-items:center;background-color:var(--sgds-primary-surface-default);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-border-radius-sm);color:var(--sgds-color-fixed-light);display:inline-flex;font-size:var(--sgds-font-size-1);height:var(--sgds-dimension-24,24px);justify-content:center;max-width:192px;min-width:var(--sgds-dimension-24);padding:var(--sgds-padding-none) var(--sgds-padding-2-xs)}.badge.outlined{background-color:var(--sgds-primary-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-primary-border-color-default);color:var(--sgds-color-fixed-dark)}.badge.full-width{max-width:100%}.badge-label{line-height:var(--sgds-line-height-min);padding:var(--sgds-padding-none) var(--sgds-padding-2-xs)}.badge-dismissible{padding-right:0}.badge-dimissible sgds-close-button{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm)}.badge.truncated .badge-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}slot::slotted(*){font-size:14px;font-weight:400}`;
|
|
9084
|
+
|
|
9085
|
+
/**
|
|
9086
|
+
* --------------------------------------------------------------------------
|
|
9087
|
+
* Bootstrap util/sanitizer.js
|
|
9088
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
9089
|
+
* --------------------------------------------------------------------------
|
|
9090
|
+
*/
|
|
9091
|
+
|
|
9092
|
+
// js-docs-start allow-list
|
|
9093
|
+
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
|
9094
|
+
|
|
9095
|
+
const DefaultAllowlist = {
|
|
9096
|
+
// Global attributes allowed on any supplied element below.
|
|
9097
|
+
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
|
9098
|
+
a: ['target', 'href', 'title', 'rel'],
|
|
9099
|
+
area: [],
|
|
9100
|
+
b: [],
|
|
9101
|
+
br: [],
|
|
9102
|
+
col: [],
|
|
9103
|
+
code: [],
|
|
9104
|
+
dd: [],
|
|
9105
|
+
div: [],
|
|
9106
|
+
dl: [],
|
|
9107
|
+
dt: [],
|
|
9108
|
+
em: [],
|
|
9109
|
+
hr: [],
|
|
9110
|
+
h1: [],
|
|
9111
|
+
h2: [],
|
|
9112
|
+
h3: [],
|
|
9113
|
+
h4: [],
|
|
9114
|
+
h5: [],
|
|
9115
|
+
h6: [],
|
|
9116
|
+
i: [],
|
|
9117
|
+
img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
|
|
9118
|
+
li: [],
|
|
9119
|
+
ol: [],
|
|
9120
|
+
p: [],
|
|
9121
|
+
pre: [],
|
|
9122
|
+
s: [],
|
|
9123
|
+
small: [],
|
|
9124
|
+
span: [],
|
|
9125
|
+
sub: [],
|
|
9126
|
+
sup: [],
|
|
9127
|
+
strong: [],
|
|
9128
|
+
u: [],
|
|
9129
|
+
ul: []
|
|
9130
|
+
};
|
|
9131
|
+
// js-docs-end allow-list
|
|
9132
|
+
|
|
9133
|
+
const uriAttributes = new Set([
|
|
9134
|
+
'background',
|
|
9135
|
+
'cite',
|
|
9136
|
+
'href',
|
|
9137
|
+
'itemtype',
|
|
9138
|
+
'longdesc',
|
|
9139
|
+
'poster',
|
|
9140
|
+
'src',
|
|
9141
|
+
'xlink:href'
|
|
9142
|
+
]);
|
|
8997
9143
|
|
|
8998
9144
|
/**
|
|
9145
|
+
* A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
|
|
9146
|
+
* contexts.
|
|
8999
9147
|
*
|
|
9000
|
-
*
|
|
9001
|
-
* @returns boolean
|
|
9148
|
+
* Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38
|
|
9002
9149
|
*/
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9150
|
+
// eslint-disable-next-line unicorn/better-regex
|
|
9151
|
+
const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;
|
|
9152
|
+
|
|
9153
|
+
const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
9154
|
+
const attributeName = attribute.nodeName.toLowerCase();
|
|
9155
|
+
|
|
9156
|
+
if (allowedAttributeList.includes(attributeName)) {
|
|
9157
|
+
if (uriAttributes.has(attributeName)) {
|
|
9158
|
+
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue))
|
|
9009
9159
|
}
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9160
|
+
|
|
9161
|
+
return true
|
|
9162
|
+
}
|
|
9163
|
+
|
|
9164
|
+
// Check if a regular expression validates the attribute.
|
|
9165
|
+
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)
|
|
9166
|
+
.some(regex => regex.test(attributeName))
|
|
9167
|
+
};
|
|
9168
|
+
|
|
9169
|
+
function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
|
|
9170
|
+
if (!unsafeHtml.length) {
|
|
9171
|
+
return unsafeHtml
|
|
9172
|
+
}
|
|
9173
|
+
|
|
9174
|
+
if (sanitizeFunction && typeof sanitizeFunction === 'function') {
|
|
9175
|
+
return sanitizeFunction(unsafeHtml)
|
|
9176
|
+
}
|
|
9177
|
+
|
|
9178
|
+
const domParser = new window.DOMParser();
|
|
9179
|
+
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
|
|
9180
|
+
const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
|
|
9181
|
+
|
|
9182
|
+
for (const element of elements) {
|
|
9183
|
+
const elementName = element.nodeName.toLowerCase();
|
|
9184
|
+
|
|
9185
|
+
if (!Object.keys(allowList).includes(elementName)) {
|
|
9186
|
+
element.remove();
|
|
9187
|
+
continue
|
|
9014
9188
|
}
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9189
|
+
|
|
9190
|
+
const attributeList = [].concat(...element.attributes);
|
|
9191
|
+
const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
|
|
9192
|
+
|
|
9193
|
+
for (const attribute of attributeList) {
|
|
9194
|
+
if (!allowedAttribute(attribute, allowedAttributes)) {
|
|
9195
|
+
element.removeAttribute(attribute.nodeName);
|
|
9196
|
+
}
|
|
9018
9197
|
}
|
|
9198
|
+
}
|
|
9199
|
+
|
|
9200
|
+
return createdDocument.body.innerHTML
|
|
9019
9201
|
}
|
|
9020
9202
|
|
|
9021
9203
|
/**
|
|
9022
|
-
*
|
|
9023
|
-
*
|
|
9024
|
-
*
|
|
9025
|
-
*
|
|
9204
|
+
* --------------------------------------------------------------------------
|
|
9205
|
+
* Bootstrap util/template-factory.js
|
|
9206
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
9207
|
+
* --------------------------------------------------------------------------
|
|
9026
9208
|
*/
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9209
|
+
|
|
9210
|
+
/**
|
|
9211
|
+
* Constants
|
|
9212
|
+
*/
|
|
9213
|
+
|
|
9214
|
+
const NAME$1 = 'TemplateFactory';
|
|
9215
|
+
|
|
9216
|
+
const Default$1 = {
|
|
9217
|
+
allowList: DefaultAllowlist,
|
|
9218
|
+
content: {}, // { selector : text , selector2 : text2 , }
|
|
9219
|
+
extraClass: '',
|
|
9220
|
+
html: false,
|
|
9221
|
+
sanitize: true,
|
|
9222
|
+
sanitizeFn: null,
|
|
9223
|
+
template: '<div></div>'
|
|
9224
|
+
};
|
|
9225
|
+
|
|
9226
|
+
const DefaultType$1 = {
|
|
9227
|
+
allowList: 'object',
|
|
9228
|
+
content: 'object',
|
|
9229
|
+
extraClass: '(string|function)',
|
|
9230
|
+
html: 'boolean',
|
|
9231
|
+
sanitize: 'boolean',
|
|
9232
|
+
sanitizeFn: '(null|function)',
|
|
9233
|
+
template: 'string'
|
|
9234
|
+
};
|
|
9235
|
+
|
|
9236
|
+
const DefaultContentType = {
|
|
9237
|
+
entry: '(string|element|function|null)',
|
|
9238
|
+
selector: '(string|element)'
|
|
9239
|
+
};
|
|
9240
|
+
|
|
9241
|
+
/**
|
|
9242
|
+
* Class definition
|
|
9243
|
+
*/
|
|
9244
|
+
|
|
9245
|
+
class TemplateFactory extends Config {
|
|
9246
|
+
constructor(config) {
|
|
9247
|
+
super();
|
|
9248
|
+
this._config = this._getConfig(config);
|
|
9249
|
+
}
|
|
9250
|
+
|
|
9251
|
+
// Getters
|
|
9252
|
+
static get Default() {
|
|
9253
|
+
return Default$1
|
|
9254
|
+
}
|
|
9255
|
+
|
|
9256
|
+
static get DefaultType() {
|
|
9257
|
+
return DefaultType$1
|
|
9258
|
+
}
|
|
9259
|
+
|
|
9260
|
+
static get NAME() {
|
|
9261
|
+
return NAME$1
|
|
9262
|
+
}
|
|
9263
|
+
|
|
9264
|
+
// Public
|
|
9265
|
+
getContent() {
|
|
9266
|
+
return Object.values(this._config.content)
|
|
9267
|
+
.map(config => this._resolvePossibleFunction(config))
|
|
9268
|
+
.filter(Boolean)
|
|
9269
|
+
}
|
|
9270
|
+
|
|
9271
|
+
hasContent() {
|
|
9272
|
+
return this.getContent().length > 0
|
|
9273
|
+
}
|
|
9274
|
+
|
|
9275
|
+
changeContent(content) {
|
|
9276
|
+
this._checkContent(content);
|
|
9277
|
+
this._config.content = { ...this._config.content, ...content };
|
|
9278
|
+
return this
|
|
9279
|
+
}
|
|
9280
|
+
|
|
9281
|
+
toHtml() {
|
|
9282
|
+
const templateWrapper = document.createElement('div');
|
|
9283
|
+
templateWrapper.innerHTML = this._maybeSanitize(this._config.template);
|
|
9284
|
+
|
|
9285
|
+
for (const [selector, text] of Object.entries(this._config.content)) {
|
|
9286
|
+
this._setContent(templateWrapper, text, selector);
|
|
9041
9287
|
}
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9288
|
+
|
|
9289
|
+
const template = templateWrapper.children[0];
|
|
9290
|
+
const extraClass = this._resolvePossibleFunction(this._config.extraClass);
|
|
9291
|
+
|
|
9292
|
+
if (extraClass) {
|
|
9293
|
+
template.classList.add(...extraClass.split(' '));
|
|
9045
9294
|
}
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
</button>
|
|
9060
|
-
`;
|
|
9295
|
+
|
|
9296
|
+
return template
|
|
9297
|
+
}
|
|
9298
|
+
|
|
9299
|
+
// Private
|
|
9300
|
+
_typeCheckConfig(config) {
|
|
9301
|
+
super._typeCheckConfig(config);
|
|
9302
|
+
this._checkContent(config.content);
|
|
9303
|
+
}
|
|
9304
|
+
|
|
9305
|
+
_checkContent(arg) {
|
|
9306
|
+
for (const [selector, content] of Object.entries(arg)) {
|
|
9307
|
+
super._typeCheckConfig({ selector, entry: content }, DefaultContentType);
|
|
9061
9308
|
}
|
|
9062
|
-
|
|
9063
|
-
SgdsCloseButton.styles = [...SgdsElement.styles, css_248z$7];
|
|
9064
|
-
__decorate([
|
|
9065
|
-
property({ type: String })
|
|
9066
|
-
], SgdsCloseButton.prototype, "ariaLabel", void 0);
|
|
9067
|
-
__decorate([
|
|
9068
|
-
property({ type: String, reflect: true })
|
|
9069
|
-
], SgdsCloseButton.prototype, "size", void 0);
|
|
9070
|
-
__decorate([
|
|
9071
|
-
property({ type: String, reflect: true })
|
|
9072
|
-
], SgdsCloseButton.prototype, "variant", void 0);
|
|
9309
|
+
}
|
|
9073
9310
|
|
|
9074
|
-
|
|
9311
|
+
_setContent(template, content, selector) {
|
|
9312
|
+
const templateElement = SelectorEngine.findOne(selector, template);
|
|
9075
9313
|
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
*
|
|
9079
|
-
* @slot default - slot for badge
|
|
9080
|
-
* @slot icon - The slot for icon to the left of the badge text
|
|
9081
|
-
*
|
|
9082
|
-
* @event sgds-show - Emitted when the badge appears.
|
|
9083
|
-
* @event sgds-hide - Emitted when the badge is starting to close but has not closed.
|
|
9084
|
-
* @event sgds-after-show - Emitted after the badge has appeared
|
|
9085
|
-
* @event sgds-after-hide - Emitted after the badge has closed
|
|
9086
|
-
*/
|
|
9087
|
-
class SgdsBadge extends SgdsElement {
|
|
9088
|
-
constructor() {
|
|
9089
|
-
super(...arguments);
|
|
9090
|
-
/** Controls the appearance of the dismissible badge. This prop only applies when dismissible is true */
|
|
9091
|
-
this.show = false;
|
|
9092
|
-
/** One or more button variant combinations buttons may be one of a variety of visual variants such as: `info`, `success`, `danger`, `warning`, 'neutral' */
|
|
9093
|
-
this.variant = "info";
|
|
9094
|
-
/** Manually set the outlined state to false */
|
|
9095
|
-
this.outlined = false;
|
|
9096
|
-
/** Manually set the dismissible state of the button to `false` */
|
|
9097
|
-
this.dismissible = false;
|
|
9314
|
+
if (!templateElement) {
|
|
9315
|
+
return
|
|
9098
9316
|
}
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9317
|
+
|
|
9318
|
+
content = this._resolvePossibleFunction(content);
|
|
9319
|
+
|
|
9320
|
+
if (!content) {
|
|
9321
|
+
templateElement.remove();
|
|
9322
|
+
return
|
|
9102
9323
|
}
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
if (sgdsShow.defaultPrevented) {
|
|
9108
|
-
this.show = false;
|
|
9109
|
-
return;
|
|
9110
|
-
}
|
|
9111
|
-
// animations if any go here
|
|
9112
|
-
this.emit("sgds-after-show");
|
|
9113
|
-
}
|
|
9114
|
-
else {
|
|
9115
|
-
const sgdsHide = this.emit("sgds-hide", { cancelable: true });
|
|
9116
|
-
if (sgdsHide.defaultPrevented) {
|
|
9117
|
-
this.show = true;
|
|
9118
|
-
return;
|
|
9119
|
-
}
|
|
9120
|
-
// animations if any go here
|
|
9121
|
-
this.emit("sgds-after-hide");
|
|
9122
|
-
}
|
|
9324
|
+
|
|
9325
|
+
if (isElement(content)) {
|
|
9326
|
+
this._putElementInTemplate(getElement(content), templateElement);
|
|
9327
|
+
return
|
|
9123
9328
|
}
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
class="
|
|
9129
|
-
${classMap({
|
|
9130
|
-
[`badge-dismissible`]: this.dismissible,
|
|
9131
|
-
badge: true,
|
|
9132
|
-
outlined: this.outlined
|
|
9133
|
-
})}
|
|
9134
|
-
"
|
|
9135
|
-
aria-hidden=${this.show ? "false" : "true"}
|
|
9136
|
-
>
|
|
9137
|
-
${!this.dismissible ? html `<slot name="icon"></slot>` : nothing}
|
|
9138
|
-
<span class="badge-label">
|
|
9139
|
-
<slot></slot>
|
|
9140
|
-
</span>
|
|
9141
|
-
|
|
9142
|
-
${this.dismissible
|
|
9143
|
-
? html `<sgds-close-button
|
|
9144
|
-
size="sm"
|
|
9145
|
-
aria-label="close the badge"
|
|
9146
|
-
@click=${this.close}
|
|
9147
|
-
variant=${this.outlined ? "dark" : "light"}
|
|
9148
|
-
></sgds-close-button>`
|
|
9149
|
-
: nothing}
|
|
9150
|
-
</div>
|
|
9151
|
-
`
|
|
9152
|
-
: nothing;
|
|
9329
|
+
|
|
9330
|
+
if (this._config.html) {
|
|
9331
|
+
templateElement.innerHTML = this._maybeSanitize(content);
|
|
9332
|
+
return
|
|
9153
9333
|
}
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9334
|
+
|
|
9335
|
+
templateElement.textContent = content;
|
|
9336
|
+
}
|
|
9337
|
+
|
|
9338
|
+
_maybeSanitize(arg) {
|
|
9339
|
+
return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg
|
|
9340
|
+
}
|
|
9341
|
+
|
|
9342
|
+
_resolvePossibleFunction(arg) {
|
|
9343
|
+
return execute(arg, [this])
|
|
9344
|
+
}
|
|
9345
|
+
|
|
9346
|
+
_putElementInTemplate(element, templateElement) {
|
|
9347
|
+
if (this._config.html) {
|
|
9348
|
+
templateElement.innerHTML = '';
|
|
9349
|
+
templateElement.append(element);
|
|
9350
|
+
return
|
|
9351
|
+
}
|
|
9352
|
+
|
|
9353
|
+
templateElement.textContent = element.textContent;
|
|
9354
|
+
}
|
|
9355
|
+
}
|
|
9356
|
+
|
|
9357
|
+
/**
|
|
9358
|
+
* --------------------------------------------------------------------------
|
|
9359
|
+
* Bootstrap tooltip.js
|
|
9360
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
9361
|
+
* --------------------------------------------------------------------------
|
|
9362
|
+
*/
|
|
9363
|
+
|
|
9364
|
+
/**
|
|
9365
|
+
* Constants
|
|
9366
|
+
*/
|
|
9367
|
+
|
|
9368
|
+
const NAME = 'tooltip';
|
|
9369
|
+
const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
|
|
9370
|
+
|
|
9371
|
+
const CLASS_NAME_FADE = 'fade';
|
|
9372
|
+
const CLASS_NAME_MODAL = 'modal';
|
|
9373
|
+
const CLASS_NAME_SHOW = 'show';
|
|
9374
|
+
|
|
9375
|
+
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
|
|
9376
|
+
const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
|
|
9377
|
+
|
|
9378
|
+
const EVENT_MODAL_HIDE = 'hide.bs.modal';
|
|
9379
|
+
|
|
9380
|
+
const TRIGGER_HOVER = 'hover';
|
|
9381
|
+
const TRIGGER_FOCUS = 'focus';
|
|
9382
|
+
const TRIGGER_CLICK = 'click';
|
|
9383
|
+
const TRIGGER_MANUAL = 'manual';
|
|
9384
|
+
|
|
9385
|
+
const EVENT_HIDE = 'hide';
|
|
9386
|
+
const EVENT_HIDDEN = 'hidden';
|
|
9387
|
+
const EVENT_SHOW = 'show';
|
|
9388
|
+
const EVENT_SHOWN = 'shown';
|
|
9389
|
+
const EVENT_INSERTED = 'inserted';
|
|
9390
|
+
const EVENT_CLICK = 'click';
|
|
9391
|
+
const EVENT_FOCUSIN = 'focusin';
|
|
9392
|
+
const EVENT_FOCUSOUT = 'focusout';
|
|
9393
|
+
const EVENT_MOUSEENTER = 'mouseenter';
|
|
9394
|
+
const EVENT_MOUSELEAVE = 'mouseleave';
|
|
9395
|
+
|
|
9396
|
+
const AttachmentMap = {
|
|
9397
|
+
AUTO: 'auto',
|
|
9398
|
+
TOP: 'top',
|
|
9399
|
+
RIGHT: isRTL() ? 'left' : 'right',
|
|
9400
|
+
BOTTOM: 'bottom',
|
|
9401
|
+
LEFT: isRTL() ? 'right' : 'left'
|
|
9402
|
+
};
|
|
9403
|
+
|
|
9404
|
+
const Default = {
|
|
9405
|
+
allowList: DefaultAllowlist,
|
|
9406
|
+
animation: true,
|
|
9407
|
+
boundary: 'clippingParents',
|
|
9408
|
+
container: false,
|
|
9409
|
+
customClass: '',
|
|
9410
|
+
delay: 0,
|
|
9411
|
+
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
|
|
9412
|
+
html: false,
|
|
9413
|
+
offset: [0, 6],
|
|
9414
|
+
placement: 'top',
|
|
9415
|
+
popperConfig: null,
|
|
9416
|
+
sanitize: true,
|
|
9417
|
+
sanitizeFn: null,
|
|
9418
|
+
selector: false,
|
|
9419
|
+
template: '<div class="tooltip" role="tooltip">' +
|
|
9420
|
+
'<div class="tooltip-arrow"></div>' +
|
|
9421
|
+
'<div class="tooltip-inner"></div>' +
|
|
9422
|
+
'</div>',
|
|
9423
|
+
title: '',
|
|
9424
|
+
trigger: 'hover focus'
|
|
9425
|
+
};
|
|
9426
|
+
|
|
9427
|
+
const DefaultType = {
|
|
9428
|
+
allowList: 'object',
|
|
9429
|
+
animation: 'boolean',
|
|
9430
|
+
boundary: '(string|element)',
|
|
9431
|
+
container: '(string|element|boolean)',
|
|
9432
|
+
customClass: '(string|function)',
|
|
9433
|
+
delay: '(number|object)',
|
|
9434
|
+
fallbackPlacements: 'array',
|
|
9435
|
+
html: 'boolean',
|
|
9436
|
+
offset: '(array|string|function)',
|
|
9437
|
+
placement: '(string|function)',
|
|
9438
|
+
popperConfig: '(null|object|function)',
|
|
9439
|
+
sanitize: 'boolean',
|
|
9440
|
+
sanitizeFn: '(null|function)',
|
|
9441
|
+
selector: '(string|boolean)',
|
|
9442
|
+
template: 'string',
|
|
9443
|
+
title: '(string|element|function)',
|
|
9444
|
+
trigger: 'string'
|
|
9445
|
+
};
|
|
9446
|
+
|
|
9447
|
+
/**
|
|
9448
|
+
* Class definition
|
|
9449
|
+
*/
|
|
9450
|
+
|
|
9451
|
+
class Tooltip extends BaseComponent {
|
|
9452
|
+
constructor(element, config) {
|
|
9453
|
+
if (typeof Popper === 'undefined') {
|
|
9454
|
+
throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)')
|
|
9455
|
+
}
|
|
9456
|
+
|
|
9457
|
+
super(element, config);
|
|
9458
|
+
|
|
9459
|
+
// Private
|
|
9460
|
+
this._isEnabled = true;
|
|
9461
|
+
this._timeout = 0;
|
|
9462
|
+
this._isHovered = null;
|
|
9463
|
+
this._activeTrigger = {};
|
|
9464
|
+
this._popper = null;
|
|
9465
|
+
this._templateFactory = null;
|
|
9466
|
+
this._newContent = null;
|
|
9467
|
+
|
|
9468
|
+
// Protected
|
|
9469
|
+
this.tip = null;
|
|
9470
|
+
|
|
9471
|
+
this._setListeners();
|
|
9472
|
+
|
|
9473
|
+
if (!this._config.selector) {
|
|
9474
|
+
this._fixTitle();
|
|
9475
|
+
}
|
|
9476
|
+
}
|
|
9477
|
+
|
|
9478
|
+
// Getters
|
|
9479
|
+
static get Default() {
|
|
9480
|
+
return Default
|
|
9481
|
+
}
|
|
9482
|
+
|
|
9483
|
+
static get DefaultType() {
|
|
9484
|
+
return DefaultType
|
|
9485
|
+
}
|
|
9486
|
+
|
|
9487
|
+
static get NAME() {
|
|
9488
|
+
return NAME
|
|
9489
|
+
}
|
|
9490
|
+
|
|
9491
|
+
// Public
|
|
9492
|
+
enable() {
|
|
9493
|
+
this._isEnabled = true;
|
|
9494
|
+
}
|
|
9495
|
+
|
|
9496
|
+
disable() {
|
|
9497
|
+
this._isEnabled = false;
|
|
9498
|
+
}
|
|
9499
|
+
|
|
9500
|
+
toggleEnabled() {
|
|
9501
|
+
this._isEnabled = !this._isEnabled;
|
|
9502
|
+
}
|
|
9503
|
+
|
|
9504
|
+
toggle() {
|
|
9505
|
+
if (!this._isEnabled) {
|
|
9506
|
+
return
|
|
9507
|
+
}
|
|
9508
|
+
|
|
9509
|
+
this._activeTrigger.click = !this._activeTrigger.click;
|
|
9510
|
+
if (this._isShown()) {
|
|
9511
|
+
this._leave();
|
|
9512
|
+
return
|
|
9513
|
+
}
|
|
9514
|
+
|
|
9515
|
+
this._enter();
|
|
9516
|
+
}
|
|
9517
|
+
|
|
9518
|
+
dispose() {
|
|
9519
|
+
clearTimeout(this._timeout);
|
|
9520
|
+
|
|
9521
|
+
EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
9522
|
+
|
|
9523
|
+
if (this._element.getAttribute('data-bs-original-title')) {
|
|
9524
|
+
this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'));
|
|
9525
|
+
}
|
|
9526
|
+
|
|
9527
|
+
this._disposePopper();
|
|
9528
|
+
super.dispose();
|
|
9529
|
+
}
|
|
9530
|
+
|
|
9531
|
+
show() {
|
|
9532
|
+
if (this._element.style.display === 'none') {
|
|
9533
|
+
throw new Error('Please use show on visible elements')
|
|
9534
|
+
}
|
|
9535
|
+
|
|
9536
|
+
if (!(this._isWithContent() && this._isEnabled)) {
|
|
9537
|
+
return
|
|
9538
|
+
}
|
|
9539
|
+
|
|
9540
|
+
const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW));
|
|
9541
|
+
const shadowRoot = findShadowRoot(this._element);
|
|
9542
|
+
const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element);
|
|
9543
|
+
|
|
9544
|
+
if (showEvent.defaultPrevented || !isInTheDom) {
|
|
9545
|
+
return
|
|
9546
|
+
}
|
|
9547
|
+
|
|
9548
|
+
// TODO: v6 remove this or make it optional
|
|
9549
|
+
this._disposePopper();
|
|
9550
|
+
|
|
9551
|
+
const tip = this._getTipElement();
|
|
9552
|
+
|
|
9553
|
+
this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
|
|
9554
|
+
|
|
9555
|
+
const { container } = this._config;
|
|
9556
|
+
|
|
9557
|
+
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
|
9558
|
+
container.append(tip);
|
|
9559
|
+
EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED));
|
|
9560
|
+
}
|
|
9561
|
+
|
|
9562
|
+
this._popper = this._createPopper(tip);
|
|
9563
|
+
|
|
9564
|
+
tip.classList.add(CLASS_NAME_SHOW);
|
|
9565
|
+
|
|
9566
|
+
// If this is a touch-enabled device we add extra
|
|
9567
|
+
// empty mouseover listeners to the body's immediate children;
|
|
9568
|
+
// only needed because of broken event delegation on iOS
|
|
9569
|
+
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
|
9570
|
+
if ('ontouchstart' in document.documentElement) {
|
|
9571
|
+
for (const element of [].concat(...document.body.children)) {
|
|
9572
|
+
EventHandler.on(element, 'mouseover', noop);
|
|
9573
|
+
}
|
|
9574
|
+
}
|
|
9575
|
+
|
|
9576
|
+
const complete = () => {
|
|
9577
|
+
EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN));
|
|
9578
|
+
|
|
9579
|
+
if (this._isHovered === false) {
|
|
9580
|
+
this._leave();
|
|
9581
|
+
}
|
|
9582
|
+
|
|
9583
|
+
this._isHovered = false;
|
|
9584
|
+
};
|
|
9585
|
+
|
|
9586
|
+
this._queueCallback(complete, this.tip, this._isAnimated());
|
|
9587
|
+
}
|
|
9588
|
+
|
|
9589
|
+
hide() {
|
|
9590
|
+
if (!this._isShown()) {
|
|
9591
|
+
return
|
|
9592
|
+
}
|
|
9593
|
+
|
|
9594
|
+
const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE));
|
|
9595
|
+
if (hideEvent.defaultPrevented) {
|
|
9596
|
+
return
|
|
9597
|
+
}
|
|
9598
|
+
|
|
9599
|
+
const tip = this._getTipElement();
|
|
9600
|
+
tip.classList.remove(CLASS_NAME_SHOW);
|
|
9601
|
+
|
|
9602
|
+
// If this is a touch-enabled device we remove the extra
|
|
9603
|
+
// empty mouseover listeners we added for iOS support
|
|
9604
|
+
if ('ontouchstart' in document.documentElement) {
|
|
9605
|
+
for (const element of [].concat(...document.body.children)) {
|
|
9606
|
+
EventHandler.off(element, 'mouseover', noop);
|
|
9607
|
+
}
|
|
9608
|
+
}
|
|
9609
|
+
|
|
9610
|
+
this._activeTrigger[TRIGGER_CLICK] = false;
|
|
9611
|
+
this._activeTrigger[TRIGGER_FOCUS] = false;
|
|
9612
|
+
this._activeTrigger[TRIGGER_HOVER] = false;
|
|
9613
|
+
this._isHovered = null; // it is a trick to support manual triggering
|
|
9614
|
+
|
|
9615
|
+
const complete = () => {
|
|
9616
|
+
if (this._isWithActiveTrigger()) {
|
|
9617
|
+
return
|
|
9618
|
+
}
|
|
9619
|
+
|
|
9620
|
+
if (!this._isHovered) {
|
|
9621
|
+
this._disposePopper();
|
|
9622
|
+
}
|
|
9623
|
+
|
|
9624
|
+
this._element.removeAttribute('aria-describedby');
|
|
9625
|
+
EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN));
|
|
9626
|
+
};
|
|
9627
|
+
|
|
9628
|
+
this._queueCallback(complete, this.tip, this._isAnimated());
|
|
9629
|
+
}
|
|
9630
|
+
|
|
9631
|
+
update() {
|
|
9632
|
+
if (this._popper) {
|
|
9633
|
+
this._popper.update();
|
|
9634
|
+
}
|
|
9635
|
+
}
|
|
9636
|
+
|
|
9637
|
+
// Protected
|
|
9638
|
+
_isWithContent() {
|
|
9639
|
+
return Boolean(this._getTitle())
|
|
9640
|
+
}
|
|
9641
|
+
|
|
9642
|
+
_getTipElement() {
|
|
9643
|
+
if (!this.tip) {
|
|
9644
|
+
this.tip = this._createTipElement(this._newContent || this._getContentForTemplate());
|
|
9645
|
+
}
|
|
9646
|
+
|
|
9647
|
+
return this.tip
|
|
9648
|
+
}
|
|
9649
|
+
|
|
9650
|
+
_createTipElement(content) {
|
|
9651
|
+
const tip = this._getTemplateFactory(content).toHtml();
|
|
9652
|
+
|
|
9653
|
+
// TODO: remove this check in v6
|
|
9654
|
+
if (!tip) {
|
|
9655
|
+
return null
|
|
9656
|
+
}
|
|
9657
|
+
|
|
9658
|
+
tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
|
|
9659
|
+
// TODO: v6 the following can be achieved with CSS only
|
|
9660
|
+
tip.classList.add(`bs-${this.constructor.NAME}-auto`);
|
|
9661
|
+
|
|
9662
|
+
const tipId = getUID(this.constructor.NAME).toString();
|
|
9663
|
+
|
|
9664
|
+
tip.setAttribute('id', tipId);
|
|
9665
|
+
|
|
9666
|
+
if (this._isAnimated()) {
|
|
9667
|
+
tip.classList.add(CLASS_NAME_FADE);
|
|
9668
|
+
}
|
|
9669
|
+
|
|
9670
|
+
return tip
|
|
9671
|
+
}
|
|
9672
|
+
|
|
9673
|
+
setContent(content) {
|
|
9674
|
+
this._newContent = content;
|
|
9675
|
+
if (this._isShown()) {
|
|
9676
|
+
this._disposePopper();
|
|
9677
|
+
this.show();
|
|
9678
|
+
}
|
|
9679
|
+
}
|
|
9680
|
+
|
|
9681
|
+
_getTemplateFactory(content) {
|
|
9682
|
+
if (this._templateFactory) {
|
|
9683
|
+
this._templateFactory.changeContent(content);
|
|
9684
|
+
} else {
|
|
9685
|
+
this._templateFactory = new TemplateFactory({
|
|
9686
|
+
...this._config,
|
|
9687
|
+
// the `content` var has to be after `this._config`
|
|
9688
|
+
// to override config.content in case of popover
|
|
9689
|
+
content,
|
|
9690
|
+
extraClass: this._resolvePossibleFunction(this._config.customClass)
|
|
9691
|
+
});
|
|
9692
|
+
}
|
|
9693
|
+
|
|
9694
|
+
return this._templateFactory
|
|
9695
|
+
}
|
|
9696
|
+
|
|
9697
|
+
_getContentForTemplate() {
|
|
9698
|
+
return {
|
|
9699
|
+
[SELECTOR_TOOLTIP_INNER]: this._getTitle()
|
|
9700
|
+
}
|
|
9701
|
+
}
|
|
9702
|
+
|
|
9703
|
+
_getTitle() {
|
|
9704
|
+
return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title')
|
|
9705
|
+
}
|
|
9706
|
+
|
|
9707
|
+
// Private
|
|
9708
|
+
_initializeOnDelegatedTarget(event) {
|
|
9709
|
+
return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig())
|
|
9710
|
+
}
|
|
9711
|
+
|
|
9712
|
+
_isAnimated() {
|
|
9713
|
+
return this._config.animation || (this.tip && this.tip.classList.contains(CLASS_NAME_FADE))
|
|
9714
|
+
}
|
|
9715
|
+
|
|
9716
|
+
_isShown() {
|
|
9717
|
+
return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW)
|
|
9718
|
+
}
|
|
9719
|
+
|
|
9720
|
+
_createPopper(tip) {
|
|
9721
|
+
const placement = execute(this._config.placement, [this, tip, this._element]);
|
|
9722
|
+
const attachment = AttachmentMap[placement.toUpperCase()];
|
|
9723
|
+
return createPopper(this._element, tip, this._getPopperConfig(attachment))
|
|
9724
|
+
}
|
|
9725
|
+
|
|
9726
|
+
_getOffset() {
|
|
9727
|
+
const { offset } = this._config;
|
|
9728
|
+
|
|
9729
|
+
if (typeof offset === 'string') {
|
|
9730
|
+
return offset.split(',').map(value => Number.parseInt(value, 10))
|
|
9731
|
+
}
|
|
9732
|
+
|
|
9733
|
+
if (typeof offset === 'function') {
|
|
9734
|
+
return popperData => offset(popperData, this._element)
|
|
9735
|
+
}
|
|
9736
|
+
|
|
9737
|
+
return offset
|
|
9738
|
+
}
|
|
9739
|
+
|
|
9740
|
+
_resolvePossibleFunction(arg) {
|
|
9741
|
+
return execute(arg, [this._element])
|
|
9742
|
+
}
|
|
9743
|
+
|
|
9744
|
+
_getPopperConfig(attachment) {
|
|
9745
|
+
const defaultBsPopperConfig = {
|
|
9746
|
+
placement: attachment,
|
|
9747
|
+
modifiers: [
|
|
9748
|
+
{
|
|
9749
|
+
name: 'flip',
|
|
9750
|
+
options: {
|
|
9751
|
+
fallbackPlacements: this._config.fallbackPlacements
|
|
9752
|
+
}
|
|
9753
|
+
},
|
|
9754
|
+
{
|
|
9755
|
+
name: 'offset',
|
|
9756
|
+
options: {
|
|
9757
|
+
offset: this._getOffset()
|
|
9758
|
+
}
|
|
9759
|
+
},
|
|
9760
|
+
{
|
|
9761
|
+
name: 'preventOverflow',
|
|
9762
|
+
options: {
|
|
9763
|
+
boundary: this._config.boundary
|
|
9764
|
+
}
|
|
9765
|
+
},
|
|
9766
|
+
{
|
|
9767
|
+
name: 'arrow',
|
|
9768
|
+
options: {
|
|
9769
|
+
element: `.${this.constructor.NAME}-arrow`
|
|
9770
|
+
}
|
|
9771
|
+
},
|
|
9772
|
+
{
|
|
9773
|
+
name: 'preSetPlacement',
|
|
9774
|
+
enabled: true,
|
|
9775
|
+
phase: 'beforeMain',
|
|
9776
|
+
fn: data => {
|
|
9777
|
+
// Pre-set Popper's placement attribute in order to read the arrow sizes properly.
|
|
9778
|
+
// Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement
|
|
9779
|
+
this._getTipElement().setAttribute('data-popper-placement', data.state.placement);
|
|
9780
|
+
}
|
|
9781
|
+
}
|
|
9782
|
+
]
|
|
9783
|
+
};
|
|
9784
|
+
|
|
9785
|
+
return {
|
|
9786
|
+
...defaultBsPopperConfig,
|
|
9787
|
+
...execute(this._config.popperConfig, [defaultBsPopperConfig])
|
|
9788
|
+
}
|
|
9789
|
+
}
|
|
9790
|
+
|
|
9791
|
+
_setListeners() {
|
|
9792
|
+
const triggers = this._config.trigger.split(' ');
|
|
9793
|
+
|
|
9794
|
+
for (const trigger of triggers) {
|
|
9795
|
+
if (trigger === 'click') {
|
|
9796
|
+
EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK), this._config.selector, event => {
|
|
9797
|
+
const context = this._initializeOnDelegatedTarget(event);
|
|
9798
|
+
context.toggle();
|
|
9799
|
+
});
|
|
9800
|
+
} else if (trigger !== TRIGGER_MANUAL) {
|
|
9801
|
+
const eventIn = trigger === TRIGGER_HOVER ?
|
|
9802
|
+
this.constructor.eventName(EVENT_MOUSEENTER) :
|
|
9803
|
+
this.constructor.eventName(EVENT_FOCUSIN);
|
|
9804
|
+
const eventOut = trigger === TRIGGER_HOVER ?
|
|
9805
|
+
this.constructor.eventName(EVENT_MOUSELEAVE) :
|
|
9806
|
+
this.constructor.eventName(EVENT_FOCUSOUT);
|
|
9807
|
+
|
|
9808
|
+
EventHandler.on(this._element, eventIn, this._config.selector, event => {
|
|
9809
|
+
const context = this._initializeOnDelegatedTarget(event);
|
|
9810
|
+
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
|
|
9811
|
+
context._enter();
|
|
9812
|
+
});
|
|
9813
|
+
EventHandler.on(this._element, eventOut, this._config.selector, event => {
|
|
9814
|
+
const context = this._initializeOnDelegatedTarget(event);
|
|
9815
|
+
context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] =
|
|
9816
|
+
context._element.contains(event.relatedTarget);
|
|
9817
|
+
|
|
9818
|
+
context._leave();
|
|
9819
|
+
});
|
|
9820
|
+
}
|
|
9821
|
+
}
|
|
9822
|
+
|
|
9823
|
+
this._hideModalHandler = () => {
|
|
9824
|
+
if (this._element) {
|
|
9825
|
+
this.hide();
|
|
9826
|
+
}
|
|
9827
|
+
};
|
|
9828
|
+
|
|
9829
|
+
EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
9830
|
+
}
|
|
9831
|
+
|
|
9832
|
+
_fixTitle() {
|
|
9833
|
+
const title = this._element.getAttribute('title');
|
|
9834
|
+
|
|
9835
|
+
if (!title) {
|
|
9836
|
+
return
|
|
9837
|
+
}
|
|
9838
|
+
|
|
9839
|
+
if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {
|
|
9840
|
+
this._element.setAttribute('aria-label', title);
|
|
9841
|
+
}
|
|
9842
|
+
|
|
9843
|
+
this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility
|
|
9844
|
+
this._element.removeAttribute('title');
|
|
9845
|
+
}
|
|
9846
|
+
|
|
9847
|
+
_enter() {
|
|
9848
|
+
if (this._isShown() || this._isHovered) {
|
|
9849
|
+
this._isHovered = true;
|
|
9850
|
+
return
|
|
9851
|
+
}
|
|
9852
|
+
|
|
9853
|
+
this._isHovered = true;
|
|
9854
|
+
|
|
9855
|
+
this._setTimeout(() => {
|
|
9856
|
+
if (this._isHovered) {
|
|
9857
|
+
this.show();
|
|
9858
|
+
}
|
|
9859
|
+
}, this._config.delay.show);
|
|
9860
|
+
}
|
|
9861
|
+
|
|
9862
|
+
_leave() {
|
|
9863
|
+
if (this._isWithActiveTrigger()) {
|
|
9864
|
+
return
|
|
9865
|
+
}
|
|
9866
|
+
|
|
9867
|
+
this._isHovered = false;
|
|
9868
|
+
|
|
9869
|
+
this._setTimeout(() => {
|
|
9870
|
+
if (!this._isHovered) {
|
|
9871
|
+
this.hide();
|
|
9872
|
+
}
|
|
9873
|
+
}, this._config.delay.hide);
|
|
9874
|
+
}
|
|
9875
|
+
|
|
9876
|
+
_setTimeout(handler, timeout) {
|
|
9877
|
+
clearTimeout(this._timeout);
|
|
9878
|
+
this._timeout = setTimeout(handler, timeout);
|
|
9879
|
+
}
|
|
9880
|
+
|
|
9881
|
+
_isWithActiveTrigger() {
|
|
9882
|
+
return Object.values(this._activeTrigger).includes(true)
|
|
9883
|
+
}
|
|
9884
|
+
|
|
9885
|
+
_getConfig(config) {
|
|
9886
|
+
const dataAttributes = Manipulator.getDataAttributes(this._element);
|
|
9887
|
+
|
|
9888
|
+
for (const dataAttribute of Object.keys(dataAttributes)) {
|
|
9889
|
+
if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {
|
|
9890
|
+
delete dataAttributes[dataAttribute];
|
|
9891
|
+
}
|
|
9892
|
+
}
|
|
9893
|
+
|
|
9894
|
+
config = {
|
|
9895
|
+
...dataAttributes,
|
|
9896
|
+
...(typeof config === 'object' && config ? config : {})
|
|
9897
|
+
};
|
|
9898
|
+
config = this._mergeConfigObj(config);
|
|
9899
|
+
config = this._configAfterMerge(config);
|
|
9900
|
+
this._typeCheckConfig(config);
|
|
9901
|
+
return config
|
|
9902
|
+
}
|
|
9903
|
+
|
|
9904
|
+
_configAfterMerge(config) {
|
|
9905
|
+
config.container = config.container === false ? document.body : getElement(config.container);
|
|
9906
|
+
|
|
9907
|
+
if (typeof config.delay === 'number') {
|
|
9908
|
+
config.delay = {
|
|
9909
|
+
show: config.delay,
|
|
9910
|
+
hide: config.delay
|
|
9911
|
+
};
|
|
9912
|
+
}
|
|
9913
|
+
|
|
9914
|
+
if (typeof config.title === 'number') {
|
|
9915
|
+
config.title = config.title.toString();
|
|
9916
|
+
}
|
|
9917
|
+
|
|
9918
|
+
if (typeof config.content === 'number') {
|
|
9919
|
+
config.content = config.content.toString();
|
|
9920
|
+
}
|
|
9921
|
+
|
|
9922
|
+
return config
|
|
9923
|
+
}
|
|
9924
|
+
|
|
9925
|
+
_getDelegateConfig() {
|
|
9926
|
+
const config = {};
|
|
9927
|
+
|
|
9928
|
+
for (const [key, value] of Object.entries(this._config)) {
|
|
9929
|
+
if (this.constructor.Default[key] !== value) {
|
|
9930
|
+
config[key] = value;
|
|
9931
|
+
}
|
|
9932
|
+
}
|
|
9933
|
+
|
|
9934
|
+
config.selector = false;
|
|
9935
|
+
config.trigger = 'manual';
|
|
9936
|
+
|
|
9937
|
+
// In the future can be replaced with:
|
|
9938
|
+
// const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
|
|
9939
|
+
// `Object.fromEntries(keysWithDifferentValues)`
|
|
9940
|
+
return config
|
|
9941
|
+
}
|
|
9942
|
+
|
|
9943
|
+
_disposePopper() {
|
|
9944
|
+
if (this._popper) {
|
|
9945
|
+
this._popper.destroy();
|
|
9946
|
+
this._popper = null;
|
|
9947
|
+
}
|
|
9948
|
+
|
|
9949
|
+
if (this.tip) {
|
|
9950
|
+
this.tip.remove();
|
|
9951
|
+
this.tip = null;
|
|
9952
|
+
}
|
|
9953
|
+
}
|
|
9954
|
+
|
|
9955
|
+
// Static
|
|
9956
|
+
static jQueryInterface(config) {
|
|
9957
|
+
return this.each(function () {
|
|
9958
|
+
const data = Tooltip.getOrCreateInstance(this, config);
|
|
9959
|
+
|
|
9960
|
+
if (typeof config !== 'string') {
|
|
9961
|
+
return
|
|
9962
|
+
}
|
|
9963
|
+
|
|
9964
|
+
if (typeof data[config] === 'undefined') {
|
|
9965
|
+
throw new TypeError(`No method named "${config}"`)
|
|
9966
|
+
}
|
|
9967
|
+
|
|
9968
|
+
data[config]();
|
|
9969
|
+
})
|
|
9970
|
+
}
|
|
9971
|
+
}
|
|
9972
|
+
|
|
9973
|
+
/**
|
|
9974
|
+
* jQuery
|
|
9975
|
+
*/
|
|
9976
|
+
|
|
9977
|
+
defineJQueryPlugin(Tooltip);
|
|
9978
|
+
|
|
9979
|
+
var css_248z$7 = css`:host{display:contents}.tooltip-placeholder{display:inline-block;max-width:100%}.tooltip{word-wrap:break-word;display:block;line-break:auto;opacity:0;text-align:left;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;z-index:1080}.tooltip.show{opacity:1}.tooltip-inner{background-color:var(--sgds-surface-fixed-dark);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 2px 0 rgba(0,0,0,.12),0 8px 16px 0 rgba(0,0,0,.14);color:var(--sgds-color-fixed-light);font-size:var(--sgds-font-size-1);max-width:var(--sgds-dimension-320);padding:var(--sgds-padding-xs) var(--sgds-padding-sm)}div{max-width:fit-content}`;
|
|
9980
|
+
|
|
9981
|
+
/**
|
|
9982
|
+
* @summary Tooltips display more information when users hover over, focus on, or interact with an element.
|
|
9983
|
+
* @slot default - The element to target the tooltip to.
|
|
9984
|
+
*
|
|
9985
|
+
*/
|
|
9986
|
+
class SgdsTooltip extends SgdsElement {
|
|
9987
|
+
constructor() {
|
|
9988
|
+
super(...arguments);
|
|
9989
|
+
this._myTooltip = createRef();
|
|
9990
|
+
this._bsTooltip = null;
|
|
9991
|
+
/** The tooltip's content. Content has to be textual */
|
|
9992
|
+
this.content = "";
|
|
9993
|
+
/** The placement of tooltip relative to its target */
|
|
9994
|
+
this.placement = "top";
|
|
9995
|
+
/** The method to invoke the tooltip. `hover focus` is the default value which allows tooltip to be triggered via mouse hover and keyboard focus. Add `tabindex=0 `for HTMLelements that are not tabbable. */
|
|
9996
|
+
this.trigger = "hover focus";
|
|
9997
|
+
}
|
|
9998
|
+
_handleSlotChange() {
|
|
9999
|
+
// For a11y purpose
|
|
10000
|
+
this._tooltipTargetElements.forEach(el => el.setAttribute("data-sgds-tooltip", this.content));
|
|
10001
|
+
}
|
|
10002
|
+
_handleClickOutOfElement(e, self) {
|
|
10003
|
+
if (!e.composedPath().includes(self)) {
|
|
10004
|
+
this.hide();
|
|
10005
|
+
}
|
|
10006
|
+
}
|
|
10007
|
+
connectedCallback() {
|
|
10008
|
+
super.connectedCallback();
|
|
10009
|
+
if (this.trigger === "click") {
|
|
10010
|
+
document.addEventListener("click", (event) => this._handleClickOutOfElement(event, this));
|
|
10011
|
+
document.addEventListener("touchstart", (event) => this._handleClickOutOfElement(event, this));
|
|
10012
|
+
}
|
|
10013
|
+
}
|
|
10014
|
+
disconnectedCallback() {
|
|
10015
|
+
super.disconnectedCallback();
|
|
10016
|
+
document.removeEventListener("click", (event) => this._handleClickOutOfElement(event, this));
|
|
10017
|
+
document.removeEventListener("touchstart", (event) => this._handleClickOutOfElement(event, this));
|
|
10018
|
+
}
|
|
10019
|
+
_initializeTooltip() {
|
|
10020
|
+
this.tooltipConfig = {
|
|
10021
|
+
popperConfig: (defaultConfig) => {
|
|
10022
|
+
this.popperConfig = defaultConfig;
|
|
10023
|
+
const defaultModifiers = defaultConfig.modifiers;
|
|
10024
|
+
const newModifiers = defaultModifiers.map(mod => {
|
|
10025
|
+
if (mod.name === "flip") {
|
|
10026
|
+
mod.options.fallbackPlacements = [];
|
|
10027
|
+
}
|
|
10028
|
+
return mod;
|
|
10029
|
+
});
|
|
10030
|
+
this.popperConfig.modifiers = newModifiers;
|
|
10031
|
+
return this.popperConfig;
|
|
10032
|
+
},
|
|
10033
|
+
placement: this.placement,
|
|
10034
|
+
trigger: this.trigger,
|
|
10035
|
+
title: this.content,
|
|
10036
|
+
html: true,
|
|
10037
|
+
container: this.shadowRoot.querySelector("div") // tooltip to appear inside the shadow root of sgds-tooltip instead of anywhere in the DOM, so that scoped styles can apply
|
|
10038
|
+
};
|
|
10039
|
+
this._bsTooltip = new Tooltip(this._myTooltip.value, this.tooltipConfig);
|
|
10040
|
+
}
|
|
10041
|
+
firstUpdated() {
|
|
10042
|
+
this._initializeTooltip();
|
|
10043
|
+
this._myTooltip.value.addEventListener("show.bs.tooltip", () => {
|
|
10044
|
+
this.emit("sgds-show");
|
|
10045
|
+
});
|
|
10046
|
+
this._myTooltip.value.addEventListener("shown.bs.tooltip", () => {
|
|
10047
|
+
this.emit("sgds-after-show");
|
|
10048
|
+
});
|
|
10049
|
+
this._myTooltip.value.addEventListener("hide.bs.tooltip", () => {
|
|
10050
|
+
this.emit("sgds-hide");
|
|
10051
|
+
});
|
|
10052
|
+
this._myTooltip.value.addEventListener("hidden.bs.tooltip", () => {
|
|
10053
|
+
this.emit("sgds-after-hide");
|
|
10054
|
+
});
|
|
10055
|
+
}
|
|
10056
|
+
/** Hides the Tooltip */
|
|
10057
|
+
hide() {
|
|
10058
|
+
this._bsTooltip.hide();
|
|
10059
|
+
}
|
|
10060
|
+
/** Shows the Tooltip */
|
|
10061
|
+
show() {
|
|
10062
|
+
this._bsTooltip.show();
|
|
10063
|
+
}
|
|
10064
|
+
render() {
|
|
10065
|
+
return html `
|
|
10066
|
+
<div ${ref(this._myTooltip)} class="tooltip-placeholder">
|
|
10067
|
+
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
10068
|
+
</div>
|
|
10069
|
+
`;
|
|
10070
|
+
}
|
|
10071
|
+
}
|
|
10072
|
+
SgdsTooltip.styles = [...SgdsElement.styles, css_248z$7];
|
|
10073
|
+
__decorate([
|
|
10074
|
+
property({ type: String })
|
|
10075
|
+
], SgdsTooltip.prototype, "content", void 0);
|
|
10076
|
+
__decorate([
|
|
10077
|
+
property({ type: String })
|
|
10078
|
+
], SgdsTooltip.prototype, "placement", void 0);
|
|
10079
|
+
__decorate([
|
|
10080
|
+
property({ type: String })
|
|
10081
|
+
], SgdsTooltip.prototype, "trigger", void 0);
|
|
10082
|
+
__decorate([
|
|
10083
|
+
state()
|
|
10084
|
+
], SgdsTooltip.prototype, "popperConfig", void 0);
|
|
10085
|
+
__decorate([
|
|
10086
|
+
queryAssignedElements()
|
|
10087
|
+
], SgdsTooltip.prototype, "_tooltipTargetElements", void 0);
|
|
10088
|
+
|
|
10089
|
+
var css_248z$6 = css`:host{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm);display:inline-flex}.btn-close{align-items:center;background-color:var(--sgds-bg-transparent);border:0;border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-close-btn-border-radius);cursor:pointer;display:flex;height:var(--sgds-dimension-32);justify-content:center;padding:0;position:relative;width:var(--sgds-dimension-32)}.btn-close-light{color:var(--sgds-color-fixed-light)}.btn-close-dark{color:var(--sgds-color-fixed-dark)}.btn-close:hover{background-color:var(--sgds-bg-translucent)}.btn-close:focus,.btn-close:focus-visible{background-color:var(--sgds-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{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}`;
|
|
10090
|
+
|
|
10091
|
+
/**
|
|
10092
|
+
*
|
|
10093
|
+
* @param name tagname of custom element
|
|
10094
|
+
* @returns boolean
|
|
10095
|
+
*/
|
|
10096
|
+
function isRegistered(name) {
|
|
10097
|
+
return !!customElements.get(name);
|
|
10098
|
+
}
|
|
10099
|
+
function register(name, constructor) {
|
|
10100
|
+
if (!customElements.get(name)) {
|
|
10101
|
+
customElements.define(name, constructor);
|
|
10102
|
+
}
|
|
10103
|
+
}
|
|
10104
|
+
function warnUnregisteredElements(name) {
|
|
10105
|
+
if (isRegistered(name)) {
|
|
10106
|
+
return true;
|
|
10107
|
+
}
|
|
10108
|
+
else {
|
|
10109
|
+
console.error(`Custom element of name : ${name} is not registered. Remember to import the component file for custom element registration`);
|
|
10110
|
+
return false;
|
|
10111
|
+
}
|
|
10112
|
+
}
|
|
10113
|
+
|
|
10114
|
+
/**
|
|
10115
|
+
* @summary Close button for closing actions. Used in Modal, Drawer, Alert and Toast.
|
|
10116
|
+
*
|
|
10117
|
+
* @cssprop --sgds-close-btn-border-radius - The border radius of close button border
|
|
10118
|
+
*
|
|
10119
|
+
*/
|
|
10120
|
+
class SgdsCloseButton extends SgdsElement {
|
|
10121
|
+
constructor() {
|
|
10122
|
+
super(...arguments);
|
|
10123
|
+
this.ariaLabel = "Close button";
|
|
10124
|
+
/** Specifies a large or small button */
|
|
10125
|
+
this.size = "md";
|
|
10126
|
+
this.variant = "default";
|
|
10127
|
+
this._clickHandler = () => {
|
|
10128
|
+
return;
|
|
10129
|
+
};
|
|
10130
|
+
}
|
|
10131
|
+
_handleClick() {
|
|
10132
|
+
this.removeEventListener("click", this._clickHandler);
|
|
10133
|
+
this.addEventListener("click", this._clickHandler);
|
|
10134
|
+
}
|
|
10135
|
+
firstUpdated() {
|
|
10136
|
+
/** Cannot register sgds-icon as dependency due to some circular dependencies, so we check and warn instead */
|
|
10137
|
+
warnUnregisteredElements("sgds-icon");
|
|
10138
|
+
}
|
|
10139
|
+
render() {
|
|
10140
|
+
return html `
|
|
10141
|
+
<button
|
|
10142
|
+
class=${classMap({
|
|
10143
|
+
"btn-close": true,
|
|
10144
|
+
[`btn-close-${this.size}`]: this.size,
|
|
10145
|
+
"btn-close-light": this.variant === "light",
|
|
10146
|
+
"btn-close-dark": this.variant === "dark"
|
|
10147
|
+
})}
|
|
10148
|
+
aria-label=${ifDefined(this.ariaLabel)}
|
|
10149
|
+
@click=${this._handleClick}
|
|
10150
|
+
>
|
|
10151
|
+
<sgds-icon name="cross" size=${this.size}></sgds-icon>
|
|
10152
|
+
</button>
|
|
10153
|
+
`;
|
|
10154
|
+
}
|
|
10155
|
+
}
|
|
10156
|
+
SgdsCloseButton.styles = [...SgdsElement.styles, css_248z$6];
|
|
10157
|
+
__decorate([
|
|
10158
|
+
property({ type: String })
|
|
10159
|
+
], SgdsCloseButton.prototype, "ariaLabel", void 0);
|
|
10160
|
+
__decorate([
|
|
10161
|
+
property({ type: String, reflect: true })
|
|
10162
|
+
], SgdsCloseButton.prototype, "size", void 0);
|
|
10163
|
+
__decorate([
|
|
10164
|
+
property({ type: String, reflect: true })
|
|
10165
|
+
], SgdsCloseButton.prototype, "variant", void 0);
|
|
10166
|
+
|
|
10167
|
+
/**
|
|
10168
|
+
* Given a slot, this function iterates over all of its assigned text nodes and returns the concatenated text as a
|
|
10169
|
+
* string. This is useful because we can't use slot.textContent as an alternative.
|
|
10170
|
+
*/
|
|
10171
|
+
function getTextContent(slot) {
|
|
10172
|
+
if (!slot) {
|
|
10173
|
+
return "";
|
|
10174
|
+
}
|
|
10175
|
+
const nodes = slot.assignedNodes({ flatten: true });
|
|
10176
|
+
let text = "";
|
|
10177
|
+
[...nodes].forEach(node => {
|
|
10178
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
10179
|
+
text += node.textContent.trim();
|
|
10180
|
+
}
|
|
10181
|
+
});
|
|
10182
|
+
return text;
|
|
10183
|
+
}
|
|
10184
|
+
|
|
10185
|
+
/**
|
|
10186
|
+
* @summary Badges can be used to highlight important bits of information such as labels, notifications & status.
|
|
10187
|
+
* When the text exceeds the width, it will be truncated with a tooltip that will be displayed on hover.
|
|
10188
|
+
*
|
|
10189
|
+
* @slot default - slot for badge
|
|
10190
|
+
* @slot icon - The slot for icon to the left of the badge text
|
|
10191
|
+
*
|
|
10192
|
+
* @event sgds-show - Emitted when the badge appears.
|
|
10193
|
+
* @event sgds-hide - Emitted when the badge is starting to close but has not closed.
|
|
10194
|
+
* @event sgds-after-show - Emitted after the badge has appeared
|
|
10195
|
+
* @event sgds-after-hide - Emitted after the badge has closed
|
|
10196
|
+
*/
|
|
10197
|
+
class SgdsBadge extends SgdsElement {
|
|
10198
|
+
constructor() {
|
|
10199
|
+
super(...arguments);
|
|
10200
|
+
/** Controls the appearance of the dismissible badge. This prop only applies when dismissible is true */
|
|
10201
|
+
this.show = false;
|
|
10202
|
+
/** One or more button variant combinations buttons may be one of a variety of visual variants such as: `info`, `success`, `danger`, `warning`, 'neutral' */
|
|
10203
|
+
this.variant = "info";
|
|
10204
|
+
/** Manually set the outlined state to false */
|
|
10205
|
+
this.outlined = false;
|
|
10206
|
+
/** Manually set the dismissible state of the button to `false` */
|
|
10207
|
+
this.dismissible = false;
|
|
10208
|
+
/** Manually enable full width */
|
|
10209
|
+
this.fullWidth = false;
|
|
10210
|
+
this.truncated = false;
|
|
10211
|
+
this.text = "";
|
|
10212
|
+
}
|
|
10213
|
+
/** Closes the badge */
|
|
10214
|
+
close() {
|
|
10215
|
+
this.show = false;
|
|
10216
|
+
}
|
|
10217
|
+
/**@internal */
|
|
10218
|
+
_handleShowChange() {
|
|
10219
|
+
if (this.show) {
|
|
10220
|
+
const sgdsShow = this.emit("sgds-show", { cancelable: true });
|
|
10221
|
+
if (sgdsShow.defaultPrevented) {
|
|
10222
|
+
this.show = false;
|
|
10223
|
+
return;
|
|
10224
|
+
}
|
|
10225
|
+
// animations if any go here
|
|
10226
|
+
this.emit("sgds-after-show");
|
|
10227
|
+
}
|
|
10228
|
+
else {
|
|
10229
|
+
const sgdsHide = this.emit("sgds-hide", { cancelable: true });
|
|
10230
|
+
if (sgdsHide.defaultPrevented) {
|
|
10231
|
+
this.show = true;
|
|
10232
|
+
return;
|
|
10233
|
+
}
|
|
10234
|
+
// animations if any go here
|
|
10235
|
+
this.emit("sgds-after-hide");
|
|
10236
|
+
}
|
|
10237
|
+
}
|
|
10238
|
+
/**@internal */
|
|
10239
|
+
_handleTruncation() {
|
|
10240
|
+
// checking of text height if its exceeding parent, it needs to be truncated
|
|
10241
|
+
const badge = this.shadowRoot.querySelector(".badge");
|
|
10242
|
+
const badgeLabel = this.shadowRoot.querySelector(".badge-label");
|
|
10243
|
+
if (badge && badgeLabel) {
|
|
10244
|
+
const labelHeight = badgeLabel.getBoundingClientRect().height;
|
|
10245
|
+
const badgeHeight = badge.getBoundingClientRect().height;
|
|
10246
|
+
this.truncated = labelHeight > badgeHeight;
|
|
10247
|
+
}
|
|
10248
|
+
}
|
|
10249
|
+
_handleLabelSlotChange(e) {
|
|
10250
|
+
this.text = getTextContent(e.target);
|
|
10251
|
+
return;
|
|
10252
|
+
}
|
|
10253
|
+
_renderBadge() {
|
|
10254
|
+
return html `<div
|
|
10255
|
+
class="
|
|
10256
|
+
${classMap({
|
|
10257
|
+
[`badge-dismissible`]: this.dismissible,
|
|
10258
|
+
badge: true,
|
|
10259
|
+
outlined: this.outlined,
|
|
10260
|
+
truncated: this.truncated,
|
|
10261
|
+
"full-width": this.fullWidth
|
|
10262
|
+
})}"
|
|
10263
|
+
aria-hidden=${this.show ? "false" : "true"}
|
|
10264
|
+
>
|
|
10265
|
+
${!this.dismissible ? html `<slot name="icon"></slot>` : nothing}
|
|
10266
|
+
|
|
10267
|
+
<span class="badge-label">
|
|
10268
|
+
<slot @slotchange=${this._handleLabelSlotChange}></slot>
|
|
10269
|
+
</span>
|
|
10270
|
+
|
|
10271
|
+
${this.dismissible
|
|
10272
|
+
? html `<sgds-close-button
|
|
10273
|
+
size="sm"
|
|
10274
|
+
aria-label="close the badge"
|
|
10275
|
+
@click=${this.close}
|
|
10276
|
+
variant=${this.outlined ? "dark" : "light"}
|
|
10277
|
+
></sgds-close-button>`
|
|
10278
|
+
: nothing}
|
|
10279
|
+
</div>`;
|
|
10280
|
+
}
|
|
10281
|
+
render() {
|
|
10282
|
+
return (this.dismissible && this.show) || !this.dismissible
|
|
10283
|
+
? this.truncated
|
|
10284
|
+
? html `<sgds-tooltip content=${this.text}>${this._renderBadge()}</sgds-tooltip>`
|
|
10285
|
+
: this._renderBadge()
|
|
10286
|
+
: nothing;
|
|
10287
|
+
}
|
|
10288
|
+
}
|
|
10289
|
+
SgdsBadge.styles = [...SgdsElement.styles, css_248z$8];
|
|
10290
|
+
/**@internal */
|
|
10291
|
+
SgdsBadge.dependencies = {
|
|
10292
|
+
"sgds-close-button": SgdsCloseButton,
|
|
10293
|
+
"sgds-tooltip": SgdsTooltip
|
|
10294
|
+
};
|
|
9160
10295
|
__decorate([
|
|
9161
10296
|
property({ type: Boolean, reflect: true })
|
|
9162
10297
|
], SgdsBadge.prototype, "show", void 0);
|
|
@@ -9169,9 +10304,21 @@
|
|
|
9169
10304
|
__decorate([
|
|
9170
10305
|
property({ type: Boolean, reflect: true })
|
|
9171
10306
|
], SgdsBadge.prototype, "dismissible", void 0);
|
|
10307
|
+
__decorate([
|
|
10308
|
+
property({ type: Boolean, reflect: true })
|
|
10309
|
+
], SgdsBadge.prototype, "fullWidth", void 0);
|
|
10310
|
+
__decorate([
|
|
10311
|
+
state()
|
|
10312
|
+
], SgdsBadge.prototype, "truncated", void 0);
|
|
10313
|
+
__decorate([
|
|
10314
|
+
state()
|
|
10315
|
+
], SgdsBadge.prototype, "text", void 0);
|
|
9172
10316
|
__decorate([
|
|
9173
10317
|
watch("show")
|
|
9174
10318
|
], SgdsBadge.prototype, "_handleShowChange", null);
|
|
10319
|
+
__decorate([
|
|
10320
|
+
watch("text")
|
|
10321
|
+
], SgdsBadge.prototype, "_handleTruncation", null);
|
|
9175
10322
|
|
|
9176
10323
|
var Archive = html `
|
|
9177
10324
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
|
@@ -11684,7 +12831,7 @@
|
|
|
11684
12831
|
}
|
|
11685
12832
|
}
|
|
11686
12833
|
}
|
|
11687
|
-
FormControlElement.styles = [...SgdsElement.styles, css_248z$
|
|
12834
|
+
FormControlElement.styles = [...SgdsElement.styles, css_248z$b, css_248z$a, css_248z$4, css_248z$3];
|
|
11688
12835
|
__decorate([
|
|
11689
12836
|
property({ reflect: true })
|
|
11690
12837
|
], FormControlElement.prototype, "label", void 0);
|
|
@@ -11897,7 +13044,7 @@
|
|
|
11897
13044
|
watch("_isTouched", { waitUntilFirstUpdate: true })
|
|
11898
13045
|
], SgdsCheckbox.prototype, "_handleIsTouched", null);
|
|
11899
13046
|
|
|
11900
|
-
var css_248z$1 = css`:host([active]) .dropdown-item{background-color:var(--sgds-primary-surface-translucent)}.dropdown-item{background-color:var(--sgds-bg-transparent);clear:both;color:var(--sgds-color-default);cursor:pointer;height:100%;padding:var(--sgds-padding-sm) var(--sgds-padding-lg);text-align:inherit
|
|
13047
|
+
var css_248z$1 = css`:host([active]) .dropdown-item{background-color:var(--sgds-primary-surface-translucent)}.dropdown-item{background-color:var(--sgds-bg-transparent);clear:both;color:var(--sgds-color-default);cursor:pointer;height:100%;padding:var(--sgds-padding-sm) var(--sgds-padding-lg);text-align:inherit}.dropdown-item .normal-item-content{align-items:center;display:flex;justify-content:space-between}:host([active]) .dropdown-item .normal-item-content{color:var(--sgds-primary-bg-default)}:host([active]) .dropdown-item .normal-item-content sgds-icon{fill:var(--sgds-primary-bg-default);color:var(--sgds-primary-bg-default)}.dropdown-item:hover{background:var(--sgds-bg-translucent-subtle)}.dropdown-item:focus,.dropdown-item:focus-visible{background:var(--sgds-bg-translucent-subtle);box-shadow:inset var(--sgds-form-box-shadow-focus);outline:0}`;
|
|
11901
13048
|
|
|
11902
13049
|
class ComboBoxItem extends SgdsElement {
|
|
11903
13050
|
constructor() {
|