@db-ux/wc-core-components 2.0.0-0-custom-select-16b8cce → 2.0.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/dist/cjs/db-accordion-item.cjs.entry.js +42 -8
- package/dist/cjs/db-accordion-item.cjs.entry.js.map +1 -1
- package/dist/cjs/db-accordion-item.entry.cjs.js.map +1 -1
- package/dist/cjs/db-accordion.cjs.entry.js +12 -12
- package/dist/cjs/db-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/db-accordion.entry.cjs.js.map +1 -1
- package/dist/cjs/db-badge.cjs.entry.js +3 -3
- package/dist/cjs/db-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/db-badge.entry.cjs.js.map +1 -1
- package/dist/cjs/db-brand.cjs.entry.js +3 -3
- package/dist/cjs/db-brand.cjs.entry.js.map +1 -1
- package/dist/cjs/db-brand.entry.cjs.js.map +1 -1
- package/dist/cjs/db-button.cjs.entry.js +7 -7
- package/dist/cjs/db-button.cjs.entry.js.map +1 -1
- package/dist/cjs/db-button.entry.cjs.js.map +1 -1
- package/dist/cjs/db-card.cjs.entry.js +7 -7
- package/dist/cjs/db-card.cjs.entry.js.map +1 -1
- package/dist/cjs/db-card.entry.cjs.js.map +1 -1
- package/dist/cjs/db-checkbox.cjs.entry.js +59 -44
- package/dist/cjs/db-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/db-checkbox.entry.cjs.js.map +1 -1
- package/dist/cjs/db-custom-select-dropdown.db-custom-select-list.db-custom-select-list-item.db-input.db-tag.db-tooltip.entry.cjs.js.map +1 -1
- package/dist/cjs/db-custom-select-dropdown_6.cjs.entry.js +78 -64
- package/dist/cjs/db-custom-select-dropdown_6.cjs.entry.js.map +1 -1
- package/dist/cjs/db-custom-select-form-field.cjs.entry.js +4 -4
- package/dist/cjs/db-custom-select-form-field.cjs.entry.js.map +1 -1
- package/dist/cjs/db-custom-select-form-field.entry.cjs.js.map +1 -1
- package/dist/cjs/db-custom-select.cjs.entry.js +203 -189
- package/dist/cjs/db-custom-select.cjs.entry.js.map +1 -1
- package/dist/cjs/db-custom-select.entry.cjs.js.map +1 -1
- package/dist/cjs/db-divider.cjs.entry.js +3 -3
- package/dist/cjs/db-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/db-divider.entry.cjs.js.map +1 -1
- package/dist/cjs/db-drawer.cjs.entry.js +8 -9
- package/dist/cjs/db-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/db-drawer.entry.cjs.js.map +1 -1
- package/dist/cjs/db-header.cjs.entry.js +13 -11
- package/dist/cjs/db-header.cjs.entry.js.map +1 -1
- package/dist/cjs/db-header.entry.cjs.js.map +1 -1
- package/dist/cjs/db-icon.cjs.entry.js +3 -3
- package/dist/cjs/db-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/db-icon.entry.cjs.js.map +1 -1
- package/dist/cjs/db-infotext.cjs.entry.js +3 -3
- package/dist/cjs/db-infotext.cjs.entry.js.map +1 -1
- package/dist/cjs/db-infotext.entry.cjs.js.map +1 -1
- package/dist/cjs/db-link.cjs.entry.js +7 -7
- package/dist/cjs/db-link.cjs.entry.js.map +1 -1
- package/dist/cjs/db-link.entry.cjs.js.map +1 -1
- package/dist/cjs/db-navigation-item.cjs.entry.js +26 -28
- package/dist/cjs/db-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/db-navigation-item.entry.cjs.js.map +1 -1
- package/dist/cjs/db-navigation.cjs.entry.js +4 -4
- package/dist/cjs/db-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/db-navigation.entry.cjs.js.map +1 -1
- package/dist/cjs/db-notification.cjs.entry.js +7 -7
- package/dist/cjs/db-notification.cjs.entry.js.map +1 -1
- package/dist/cjs/db-notification.entry.cjs.js.map +1 -1
- package/dist/cjs/db-page.cjs.entry.js +4 -4
- package/dist/cjs/db-page.cjs.entry.js.map +1 -1
- package/dist/cjs/db-page.entry.cjs.js.map +1 -1
- package/dist/cjs/db-popover.cjs.entry.js +4 -4
- package/dist/cjs/db-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/db-popover.entry.cjs.js.map +1 -1
- package/dist/cjs/db-radio.cjs.entry.js +10 -19
- package/dist/cjs/db-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/db-radio.entry.cjs.js.map +1 -1
- package/dist/cjs/db-section.cjs.entry.js +4 -4
- package/dist/cjs/db-section.cjs.entry.js.map +1 -1
- package/dist/cjs/db-section.entry.cjs.js.map +1 -1
- package/dist/cjs/db-select.cjs.entry.js +70 -57
- package/dist/cjs/db-select.cjs.entry.js.map +1 -1
- package/dist/cjs/db-select.entry.cjs.js.map +1 -1
- package/dist/cjs/db-stack.cjs.entry.js +4 -4
- package/dist/cjs/db-stack.cjs.entry.js.map +1 -1
- package/dist/cjs/db-stack.entry.cjs.js.map +1 -1
- package/dist/cjs/db-switch.cjs.entry.js +11 -20
- package/dist/cjs/db-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/db-switch.entry.cjs.js.map +1 -1
- package/dist/cjs/db-tab-item.db-tab-list.db-tab-panel.entry.cjs.js.map +1 -1
- package/dist/cjs/db-tab-item_3.cjs.entry.js +38 -17
- package/dist/cjs/db-tab-item_3.cjs.entry.js.map +1 -1
- package/dist/cjs/db-tabs.cjs.entry.js +24 -23
- package/dist/cjs/db-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/db-tabs.entry.cjs.js.map +1 -1
- package/dist/cjs/db-textarea.cjs.entry.js +60 -45
- package/dist/cjs/db-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/db-textarea.entry.cjs.js.map +1 -1
- package/dist/cjs/db-ux.cjs.js +3 -3
- package/dist/cjs/db-ux.cjs.js.map +1 -1
- package/dist/cjs/document-click-listener-CrbHspH2.js +37 -0
- package/dist/cjs/document-click-listener-CrbHspH2.js.map +1 -0
- package/dist/cjs/{index-DeqKGVDx.js → index-9h8KqOUd.js} +25 -7
- package/dist/cjs/index-9h8KqOUd.js.map +1 -0
- package/dist/cjs/{index-DBEtsnky.js → index-w2CAlvjJ.js} +6 -5
- package/dist/cjs/index-w2CAlvjJ.js.map +1 -0
- package/dist/cjs/index.cjs.js +6 -5
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{navigation-Cfm1OFWB.js → navigation-DjZJIxIq.js} +3 -3
- package/dist/cjs/{navigation-Cfm1OFWB.js.map → navigation-DjZJIxIq.js.map} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/accordion/accordion.js +26 -25
- package/dist/collection/components/accordion/accordion.js.map +1 -1
- package/dist/collection/components/accordion/model.js.map +1 -1
- package/dist/collection/components/accordion-item/accordion-item.js +87 -17
- package/dist/collection/components/accordion-item/accordion-item.js.map +1 -1
- package/dist/collection/components/accordion-item/model.js.map +1 -1
- package/dist/collection/components/badge/badge.js +10 -10
- package/dist/collection/components/badge/badge.js.map +1 -1
- package/dist/collection/components/badge/model.js.map +1 -1
- package/dist/collection/components/brand/brand.js +9 -9
- package/dist/collection/components/brand/brand.js.map +1 -1
- package/dist/collection/components/button/button.js +57 -32
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/button/model.js.map +1 -1
- package/dist/collection/components/card/card.js +12 -12
- package/dist/collection/components/card/card.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox.js +118 -166
- package/dist/collection/components/checkbox/checkbox.js.map +1 -1
- package/dist/collection/components/checkbox/model.js.map +1 -1
- package/dist/collection/components/custom-select/custom-select.js +340 -335
- package/dist/collection/components/custom-select/custom-select.js.map +1 -1
- package/dist/collection/components/custom-select/model.js.map +1 -1
- package/dist/collection/components/custom-select-dropdown/custom-select-dropdown.js +5 -5
- package/dist/collection/components/custom-select-dropdown/custom-select-dropdown.js.map +1 -1
- package/dist/collection/components/custom-select-form-field/custom-select-form-field.js +4 -4
- package/dist/collection/components/custom-select-form-field/custom-select-form-field.js.map +1 -1
- package/dist/collection/components/custom-select-list/custom-select-list.js +6 -6
- package/dist/collection/components/custom-select-list/custom-select-list.js.map +1 -1
- package/dist/collection/components/custom-select-list-item/custom-select-list-item.js +27 -52
- package/dist/collection/components/custom-select-list-item/custom-select-list-item.js.map +1 -1
- package/dist/collection/components/divider/divider.js +7 -7
- package/dist/collection/components/divider/divider.js.map +1 -1
- package/dist/collection/components/drawer/drawer.js +23 -24
- package/dist/collection/components/drawer/drawer.js.map +1 -1
- package/dist/collection/components/drawer/model.js.map +1 -1
- package/dist/collection/components/header/header.js +22 -20
- package/dist/collection/components/header/header.js.map +1 -1
- package/dist/collection/components/header/model.js.map +1 -1
- package/dist/collection/components/icon/icon.js +7 -7
- package/dist/collection/components/icon/icon.js.map +1 -1
- package/dist/collection/components/infotext/infotext.js +10 -10
- package/dist/collection/components/infotext/infotext.js.map +1 -1
- package/dist/collection/components/input/input.js +218 -213
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/input/model.js.map +1 -1
- package/dist/collection/components/link/link.js +29 -29
- package/dist/collection/components/link/link.js.map +1 -1
- package/dist/collection/components/navigation/navigation.js +5 -5
- package/dist/collection/components/navigation/navigation.js.map +1 -1
- package/dist/collection/components/navigation-item/model.js.map +1 -1
- package/dist/collection/components/navigation-item/navigation-item.js +43 -43
- package/dist/collection/components/navigation-item/navigation-item.js.map +1 -1
- package/dist/collection/components/notification/model.js.map +1 -1
- package/dist/collection/components/notification/notification.js +32 -32
- package/dist/collection/components/notification/notification.js.map +1 -1
- package/dist/collection/components/page/model.js.map +1 -1
- package/dist/collection/components/page/page.js +10 -10
- package/dist/collection/components/page/page.js.map +1 -1
- package/dist/collection/components/popover/model.js.map +1 -1
- package/dist/collection/components/popover/popover.js +17 -17
- package/dist/collection/components/popover/popover.js.map +1 -1
- package/dist/collection/components/radio/radio.js +32 -110
- package/dist/collection/components/radio/radio.js.map +1 -1
- package/dist/collection/components/section/section.js +6 -6
- package/dist/collection/components/section/section.js.map +1 -1
- package/dist/collection/components/select/model.js.map +1 -1
- package/dist/collection/components/select/select.js +130 -203
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/collection/components/stack/model.js.map +1 -1
- package/dist/collection/components/stack/stack.js +12 -12
- package/dist/collection/components/stack/stack.js.map +1 -1
- package/dist/collection/components/switch/model.js.map +1 -1
- package/dist/collection/components/switch/switch.js +39 -117
- package/dist/collection/components/switch/switch.js.map +1 -1
- package/dist/collection/components/tab-item/model.js.map +1 -1
- package/dist/collection/components/tab-item/tab-item.js +66 -40
- package/dist/collection/components/tab-item/tab-item.js.map +1 -1
- package/dist/collection/components/tab-list/tab-list.js +4 -4
- package/dist/collection/components/tab-list/tab-list.js.map +1 -1
- package/dist/collection/components/tab-panel/tab-panel.js +6 -6
- package/dist/collection/components/tab-panel/tab-panel.js.map +1 -1
- package/dist/collection/components/tabs/model.js.map +1 -1
- package/dist/collection/components/tabs/tabs.js +63 -62
- package/dist/collection/components/tabs/tabs.js.map +1 -1
- package/dist/collection/components/tag/model.js.map +1 -1
- package/dist/collection/components/tag/tag.js +27 -27
- package/dist/collection/components/tag/tag.js.map +1 -1
- package/dist/collection/components/textarea/model.js.map +1 -1
- package/dist/collection/components/textarea/textarea.js +171 -168
- package/dist/collection/components/textarea/textarea.js.map +1 -1
- package/dist/collection/components/tooltip/model.js.map +1 -1
- package/dist/collection/components/tooltip/tooltip.js +14 -14
- package/dist/collection/components/tooltip/tooltip.js.map +1 -1
- package/dist/collection/shared/model.js +0 -1
- package/dist/collection/shared/model.js.map +1 -1
- package/dist/collection/utils/document-click-listener.js +30 -0
- package/dist/collection/utils/document-click-listener.js.map +1 -0
- package/dist/collection/utils/index.js +21 -21
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/custom-elements.json +2629 -1698
- package/dist/db-ux/db-accordion-item.entry.esm.js.map +1 -1
- package/dist/db-ux/db-accordion.entry.esm.js.map +1 -1
- package/dist/db-ux/db-badge.entry.esm.js.map +1 -1
- package/dist/db-ux/db-brand.entry.esm.js.map +1 -1
- package/dist/db-ux/db-button.entry.esm.js.map +1 -1
- package/dist/db-ux/db-card.entry.esm.js.map +1 -1
- package/dist/db-ux/db-checkbox.entry.esm.js.map +1 -1
- package/dist/db-ux/db-custom-select-dropdown.db-custom-select-list.db-custom-select-list-item.db-input.db-tag.db-tooltip.entry.esm.js.map +1 -1
- package/dist/db-ux/db-custom-select-form-field.entry.esm.js.map +1 -1
- package/dist/db-ux/db-custom-select.entry.esm.js.map +1 -1
- package/dist/db-ux/db-divider.entry.esm.js.map +1 -1
- package/dist/db-ux/db-drawer.entry.esm.js.map +1 -1
- package/dist/db-ux/db-header.entry.esm.js.map +1 -1
- package/dist/db-ux/db-icon.entry.esm.js.map +1 -1
- package/dist/db-ux/db-infotext.entry.esm.js.map +1 -1
- package/dist/db-ux/db-link.entry.esm.js.map +1 -1
- package/dist/db-ux/db-navigation-item.entry.esm.js.map +1 -1
- package/dist/db-ux/db-navigation.entry.esm.js.map +1 -1
- package/dist/db-ux/db-notification.entry.esm.js.map +1 -1
- package/dist/db-ux/db-page.entry.esm.js.map +1 -1
- package/dist/db-ux/db-popover.entry.esm.js.map +1 -1
- package/dist/db-ux/db-radio.entry.esm.js.map +1 -1
- package/dist/db-ux/db-section.entry.esm.js.map +1 -1
- package/dist/db-ux/db-select.entry.esm.js.map +1 -1
- package/dist/db-ux/db-stack.entry.esm.js.map +1 -1
- package/dist/db-ux/db-switch.entry.esm.js.map +1 -1
- package/dist/db-ux/db-tab-item.db-tab-list.db-tab-panel.entry.esm.js.map +1 -1
- package/dist/db-ux/db-tabs.entry.esm.js.map +1 -1
- package/dist/db-ux/db-textarea.entry.esm.js.map +1 -1
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/db-ux.esm.js.map +1 -1
- package/dist/db-ux/index.esm.js +1 -1
- package/dist/db-ux/index.esm.js.map +1 -1
- package/dist/db-ux/p-0c1b4216.entry.js +2 -0
- package/dist/db-ux/p-0c1b4216.entry.js.map +1 -0
- package/dist/db-ux/p-19ebdb92.entry.js +2 -0
- package/dist/db-ux/p-19ebdb92.entry.js.map +1 -0
- package/dist/db-ux/p-20f2efec.entry.js +2 -0
- package/dist/db-ux/p-20f2efec.entry.js.map +1 -0
- package/dist/db-ux/p-2ea85ed3.entry.js +2 -0
- package/dist/db-ux/p-2ea85ed3.entry.js.map +1 -0
- package/dist/db-ux/p-3d9cfe8d.entry.js +2 -0
- package/dist/db-ux/p-3d9cfe8d.entry.js.map +1 -0
- package/dist/db-ux/p-56fa0857.entry.js +2 -0
- package/dist/db-ux/p-56fa0857.entry.js.map +1 -0
- package/dist/db-ux/p-6f9de31b.entry.js +2 -0
- package/dist/db-ux/p-6f9de31b.entry.js.map +1 -0
- package/dist/db-ux/p-797ccaa9.entry.js +2 -0
- package/dist/db-ux/p-797ccaa9.entry.js.map +1 -0
- package/dist/db-ux/{p-0b9779be.entry.js → p-7bc56311.entry.js} +2 -2
- package/dist/db-ux/p-7bc56311.entry.js.map +1 -0
- package/dist/db-ux/p-828bb611.entry.js +2 -0
- package/dist/db-ux/p-828bb611.entry.js.map +1 -0
- package/dist/db-ux/{p-d10ee6dc.entry.js → p-84136093.entry.js} +2 -2
- package/dist/db-ux/p-84136093.entry.js.map +1 -0
- package/dist/db-ux/p-861c92ee.entry.js +2 -0
- package/dist/db-ux/p-861c92ee.entry.js.map +1 -0
- package/dist/db-ux/{p-0414dab3.entry.js → p-924110bd.entry.js} +2 -2
- package/dist/db-ux/p-924110bd.entry.js.map +1 -0
- package/dist/db-ux/p-96a0c7de.entry.js +2 -0
- package/dist/db-ux/p-96a0c7de.entry.js.map +1 -0
- package/dist/db-ux/p-B_W_wePN.js +2 -0
- package/dist/db-ux/p-B_W_wePN.js.map +1 -0
- package/dist/db-ux/p-BkYjDIed.js +3 -0
- package/dist/db-ux/p-BkYjDIed.js.map +1 -0
- package/dist/db-ux/{p-VkX3SW7K.js → p-Duz60W3r.js} +2 -2
- package/dist/db-ux/{p-VkX3SW7K.js.map → p-Duz60W3r.js.map} +1 -1
- package/dist/db-ux/p-TU0pfK1i.js +2 -0
- package/dist/db-ux/p-TU0pfK1i.js.map +1 -0
- package/dist/db-ux/p-a20f9b38.entry.js +2 -0
- package/dist/db-ux/p-a20f9b38.entry.js.map +1 -0
- package/dist/db-ux/{p-9a3c9ffe.entry.js → p-aad2b065.entry.js} +2 -2
- package/dist/db-ux/p-aad2b065.entry.js.map +1 -0
- package/dist/db-ux/p-abc1afa7.entry.js +2 -0
- package/dist/db-ux/p-abc1afa7.entry.js.map +1 -0
- package/dist/db-ux/p-b074eb7f.entry.js +2 -0
- package/dist/db-ux/p-b074eb7f.entry.js.map +1 -0
- package/dist/db-ux/p-b6821ac2.entry.js +2 -0
- package/dist/db-ux/p-b6821ac2.entry.js.map +1 -0
- package/dist/db-ux/p-b7cd9e31.entry.js +2 -0
- package/dist/db-ux/p-b7cd9e31.entry.js.map +1 -0
- package/dist/db-ux/p-b92bbd61.entry.js +2 -0
- package/dist/db-ux/p-b92bbd61.entry.js.map +1 -0
- package/dist/db-ux/p-bcb3d891.entry.js +2 -0
- package/dist/db-ux/p-bcb3d891.entry.js.map +1 -0
- package/dist/db-ux/{p-65983b83.entry.js → p-be35b5b4.entry.js} +2 -2
- package/dist/db-ux/p-be35b5b4.entry.js.map +1 -0
- package/dist/db-ux/p-d60822ce.entry.js +2 -0
- package/dist/db-ux/p-d60822ce.entry.js.map +1 -0
- package/dist/db-ux/p-dc71d000.entry.js +2 -0
- package/dist/db-ux/p-dc71d000.entry.js.map +1 -0
- package/dist/db-ux/p-e397a44c.entry.js +2 -0
- package/dist/db-ux/p-e397a44c.entry.js.map +1 -0
- package/dist/db-ux/p-e4f73b24.entry.js +2 -0
- package/dist/db-ux/p-e4f73b24.entry.js.map +1 -0
- package/dist/db-ux/p-e72a0bfe.entry.js +2 -0
- package/dist/db-ux/p-e72a0bfe.entry.js.map +1 -0
- package/dist/db-ux/p-fba19a3f.entry.js +2 -0
- package/dist/db-ux/p-fba19a3f.entry.js.map +1 -0
- package/dist/esm/db-accordion-item.entry.js +42 -8
- package/dist/esm/db-accordion-item.entry.js.map +1 -1
- package/dist/esm/db-accordion.entry.js +12 -12
- package/dist/esm/db-accordion.entry.js.map +1 -1
- package/dist/esm/db-badge.entry.js +3 -3
- package/dist/esm/db-badge.entry.js.map +1 -1
- package/dist/esm/db-brand.entry.js +3 -3
- package/dist/esm/db-brand.entry.js.map +1 -1
- package/dist/esm/db-button.entry.js +7 -7
- package/dist/esm/db-button.entry.js.map +1 -1
- package/dist/esm/db-card.entry.js +7 -7
- package/dist/esm/db-card.entry.js.map +1 -1
- package/dist/esm/db-checkbox.entry.js +60 -45
- package/dist/esm/db-checkbox.entry.js.map +1 -1
- package/dist/esm/db-custom-select-dropdown.db-custom-select-list.db-custom-select-list-item.db-input.db-tag.db-tooltip.entry.js.map +1 -1
- package/dist/esm/db-custom-select-dropdown_6.entry.js +79 -65
- package/dist/esm/db-custom-select-dropdown_6.entry.js.map +1 -1
- package/dist/esm/db-custom-select-form-field.entry.js +4 -4
- package/dist/esm/db-custom-select-form-field.entry.js.map +1 -1
- package/dist/esm/db-custom-select.entry.js +204 -190
- package/dist/esm/db-custom-select.entry.js.map +1 -1
- package/dist/esm/db-divider.entry.js +3 -3
- package/dist/esm/db-divider.entry.js.map +1 -1
- package/dist/esm/db-drawer.entry.js +8 -9
- package/dist/esm/db-drawer.entry.js.map +1 -1
- package/dist/esm/db-header.entry.js +13 -11
- package/dist/esm/db-header.entry.js.map +1 -1
- package/dist/esm/db-icon.entry.js +3 -3
- package/dist/esm/db-icon.entry.js.map +1 -1
- package/dist/esm/db-infotext.entry.js +3 -3
- package/dist/esm/db-infotext.entry.js.map +1 -1
- package/dist/esm/db-link.entry.js +7 -7
- package/dist/esm/db-link.entry.js.map +1 -1
- package/dist/esm/db-navigation-item.entry.js +26 -28
- package/dist/esm/db-navigation-item.entry.js.map +1 -1
- package/dist/esm/db-navigation.entry.js +4 -4
- package/dist/esm/db-navigation.entry.js.map +1 -1
- package/dist/esm/db-notification.entry.js +7 -7
- package/dist/esm/db-notification.entry.js.map +1 -1
- package/dist/esm/db-page.entry.js +4 -4
- package/dist/esm/db-page.entry.js.map +1 -1
- package/dist/esm/db-popover.entry.js +4 -4
- package/dist/esm/db-popover.entry.js.map +1 -1
- package/dist/esm/db-radio.entry.js +10 -19
- package/dist/esm/db-radio.entry.js.map +1 -1
- package/dist/esm/db-section.entry.js +4 -4
- package/dist/esm/db-section.entry.js.map +1 -1
- package/dist/esm/db-select.entry.js +71 -58
- package/dist/esm/db-select.entry.js.map +1 -1
- package/dist/esm/db-stack.entry.js +4 -4
- package/dist/esm/db-stack.entry.js.map +1 -1
- package/dist/esm/db-switch.entry.js +11 -20
- package/dist/esm/db-switch.entry.js.map +1 -1
- package/dist/esm/db-tab-item.db-tab-list.db-tab-panel.entry.js.map +1 -1
- package/dist/esm/db-tab-item_3.entry.js +38 -17
- package/dist/esm/db-tab-item_3.entry.js.map +1 -1
- package/dist/esm/db-tabs.entry.js +24 -23
- package/dist/esm/db-tabs.entry.js.map +1 -1
- package/dist/esm/db-textarea.entry.js +61 -46
- package/dist/esm/db-textarea.entry.js.map +1 -1
- package/dist/esm/db-ux.js +4 -4
- package/dist/esm/db-ux.js.map +1 -1
- package/dist/esm/document-click-listener-B2jDrCt8.js +35 -0
- package/dist/esm/document-click-listener-B2jDrCt8.js.map +1 -0
- package/dist/esm/{index-D-D8lQAG.js → index-BkYjDIed.js} +6 -5
- package/dist/esm/index-BkYjDIed.js.map +1 -0
- package/dist/esm/{index-fw8E73KY.js → index-TU0pfK1i.js} +24 -8
- package/dist/esm/index-TU0pfK1i.js.map +1 -0
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{navigation-1ba3zvi0.js → navigation-BjeAmWrQ.js} +3 -3
- package/dist/esm/{navigation-1ba3zvi0.js.map → navigation-BjeAmWrQ.js.map} +1 -1
- package/dist/types/components/accordion/accordion.d.ts +2 -2
- package/dist/types/components/accordion/model.d.ts +2 -2
- package/dist/types/components/accordion-item/accordion-item.d.ts +11 -2
- package/dist/types/components/accordion-item/model.d.ts +5 -5
- package/dist/types/components/badge/model.d.ts +2 -2
- package/dist/types/components/button/button.d.ts +3 -1
- package/dist/types/components/button/model.d.ts +11 -7
- package/dist/types/components/card/card.d.ts +2 -1
- package/dist/types/components/checkbox/checkbox.d.ts +13 -10
- package/dist/types/components/checkbox/model.d.ts +3 -3
- package/dist/types/components/custom-select/custom-select.d.ts +18 -15
- package/dist/types/components/custom-select/model.d.ts +49 -29
- package/dist/types/components/custom-select-list-item/custom-select-list-item.d.ts +2 -2
- package/dist/types/components/drawer/drawer.d.ts +2 -1
- package/dist/types/components/drawer/model.d.ts +2 -2
- package/dist/types/components/header/header.d.ts +3 -2
- package/dist/types/components/header/model.d.ts +2 -2
- package/dist/types/components/input/input.d.ts +19 -14
- package/dist/types/components/input/model.d.ts +3 -3
- package/dist/types/components/link/link.d.ts +2 -1
- package/dist/types/components/navigation-item/model.d.ts +2 -3
- package/dist/types/components/navigation-item/navigation-item.d.ts +4 -4
- package/dist/types/components/notification/model.d.ts +3 -3
- package/dist/types/components/notification/notification.d.ts +3 -2
- package/dist/types/components/page/model.d.ts +1 -1
- package/dist/types/components/popover/model.d.ts +1 -1
- package/dist/types/components/radio/radio.d.ts +7 -9
- package/dist/types/components/select/model.d.ts +2 -2
- package/dist/types/components/select/select.d.ts +18 -16
- package/dist/types/components/stack/model.d.ts +1 -1
- package/dist/types/components/switch/model.d.ts +2 -2
- package/dist/types/components/switch/switch.d.ts +4 -6
- package/dist/types/components/tab-item/model.d.ts +6 -6
- package/dist/types/components/tab-item/tab-item.d.ts +8 -3
- package/dist/types/components/tabs/model.d.ts +11 -3
- package/dist/types/components/tabs/tabs.d.ts +5 -4
- package/dist/types/components/tag/model.d.ts +9 -5
- package/dist/types/components/tag/tag.d.ts +2 -1
- package/dist/types/components/textarea/model.d.ts +4 -4
- package/dist/types/components/textarea/textarea.d.ts +17 -12
- package/dist/types/components/tooltip/model.d.ts +1 -1
- package/dist/types/components.d.ts +96 -124
- package/dist/types/shared/model.d.ts +56 -31
- package/dist/types/stencil-public-runtime.d.ts +2 -0
- package/dist/types/utils/document-click-listener.d.ts +8 -0
- package/dist/types/utils/index.d.ts +5 -28
- package/dist/vscode.html-custom-data.json +143 -122
- package/dist/web-types.json +803 -475
- package/package.json +4 -4
- package/dist/cjs/index-DBEtsnky.js.map +0 -1
- package/dist/cjs/index-DeqKGVDx.js.map +0 -1
- package/dist/db-ux/p-0414dab3.entry.js.map +0 -1
- package/dist/db-ux/p-05505797.entry.js +0 -2
- package/dist/db-ux/p-05505797.entry.js.map +0 -1
- package/dist/db-ux/p-0b9779be.entry.js.map +0 -1
- package/dist/db-ux/p-1799c085.entry.js +0 -2
- package/dist/db-ux/p-1799c085.entry.js.map +0 -1
- package/dist/db-ux/p-30261cf0.entry.js +0 -2
- package/dist/db-ux/p-30261cf0.entry.js.map +0 -1
- package/dist/db-ux/p-43f2df95.entry.js +0 -2
- package/dist/db-ux/p-43f2df95.entry.js.map +0 -1
- package/dist/db-ux/p-463c100b.entry.js +0 -2
- package/dist/db-ux/p-463c100b.entry.js.map +0 -1
- package/dist/db-ux/p-4cf2c595.entry.js +0 -2
- package/dist/db-ux/p-4cf2c595.entry.js.map +0 -1
- package/dist/db-ux/p-56a39c64.entry.js +0 -2
- package/dist/db-ux/p-56a39c64.entry.js.map +0 -1
- package/dist/db-ux/p-5ceb34d7.entry.js +0 -2
- package/dist/db-ux/p-5ceb34d7.entry.js.map +0 -1
- package/dist/db-ux/p-65983b83.entry.js.map +0 -1
- package/dist/db-ux/p-6e1aa320.entry.js +0 -2
- package/dist/db-ux/p-6e1aa320.entry.js.map +0 -1
- package/dist/db-ux/p-70b6a633.entry.js +0 -2
- package/dist/db-ux/p-70b6a633.entry.js.map +0 -1
- package/dist/db-ux/p-72cbf9ff.entry.js +0 -2
- package/dist/db-ux/p-72cbf9ff.entry.js.map +0 -1
- package/dist/db-ux/p-7346f78f.entry.js +0 -2
- package/dist/db-ux/p-7346f78f.entry.js.map +0 -1
- package/dist/db-ux/p-7b3689ea.entry.js +0 -2
- package/dist/db-ux/p-7b3689ea.entry.js.map +0 -1
- package/dist/db-ux/p-93ee59f3.entry.js +0 -2
- package/dist/db-ux/p-93ee59f3.entry.js.map +0 -1
- package/dist/db-ux/p-969ce4ec.entry.js +0 -2
- package/dist/db-ux/p-969ce4ec.entry.js.map +0 -1
- package/dist/db-ux/p-97cfc836.entry.js +0 -2
- package/dist/db-ux/p-97cfc836.entry.js.map +0 -1
- package/dist/db-ux/p-9a3c9ffe.entry.js.map +0 -1
- package/dist/db-ux/p-D-D8lQAG.js +0 -3
- package/dist/db-ux/p-D-D8lQAG.js.map +0 -1
- package/dist/db-ux/p-a2f461ee.entry.js +0 -2
- package/dist/db-ux/p-a2f461ee.entry.js.map +0 -1
- package/dist/db-ux/p-acca879a.entry.js +0 -2
- package/dist/db-ux/p-acca879a.entry.js.map +0 -1
- package/dist/db-ux/p-b09d7817.entry.js +0 -2
- package/dist/db-ux/p-b09d7817.entry.js.map +0 -1
- package/dist/db-ux/p-b858ced9.entry.js +0 -2
- package/dist/db-ux/p-b858ced9.entry.js.map +0 -1
- package/dist/db-ux/p-bb06aac0.entry.js +0 -2
- package/dist/db-ux/p-bb06aac0.entry.js.map +0 -1
- package/dist/db-ux/p-d10ee6dc.entry.js.map +0 -1
- package/dist/db-ux/p-d4d01646.entry.js +0 -2
- package/dist/db-ux/p-d4d01646.entry.js.map +0 -1
- package/dist/db-ux/p-e393938c.entry.js +0 -2
- package/dist/db-ux/p-e393938c.entry.js.map +0 -1
- package/dist/db-ux/p-ea7da771.entry.js +0 -2
- package/dist/db-ux/p-ea7da771.entry.js.map +0 -1
- package/dist/db-ux/p-fw8E73KY.js +0 -2
- package/dist/db-ux/p-fw8E73KY.js.map +0 -1
- package/dist/esm/index-D-D8lQAG.js.map +0 -1
- package/dist/esm/index-fw8E73KY.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/components/textarea/textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,GAAG,EACH,KAAK,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,IAAI,GACL,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,aAAa,EACb,yBAAyB,EACzB,mBAAmB,EACnB,YAAY,EACZ,qBAAqB,EACrB,+BAA+B,GAChC,MAAM,wBAAwB,CAAC;AAOhC,OAAO,EACL,SAAS,EACT,CAAC,EAED,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,GACN,MAAM,eAAe,CAAC;AAGvB;;;GAGG;AAIH,MAAM,OAAO,UAAU;IAHtB;QAuCU,QAAG,GAAG,SAAS,CAAC;QAChB,eAAU,GAAG,SAAS,CAAC;QACvB,oBAAe,GAAG,SAAS,CAAC;QAC5B,sBAAiB,GAAG,SAAS,CAAC;QAC9B,eAAU,GAAG,EAAE,CAAC;QAChB,WAAM,GAAG,EAAE,CAAC;QACZ,uBAAkB,GAAG,EAAE,CAAC;KA2MlC;IAzMC,WAAW,CAAC,KAAsC;QAChD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IACD,YAAY,CAAC,KAAuC;;QAClD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QACD,2EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { DBTextareaProps, DBTextareaState } from \"./model\";\nimport { DBInfotext } from \"../infotext/infotext\";\nimport {\n cls,\n delay,\n getHideProp,\n hasVoiceOver,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport {\n DEFAULT_INVALID_MESSAGE,\n DEFAULT_INVALID_MESSAGE_ID_SUFFIX,\n DEFAULT_LABEL,\n DEFAULT_MESSAGE_ID_SUFFIX,\n DEFAULT_PLACEHOLDER,\n DEFAULT_ROWS,\n DEFAULT_VALID_MESSAGE,\n DEFAULT_VALID_MESSAGE_ID_SUFFIX,\n} from \"../../shared/constants\";\nimport { ChangeEvent, InputEvent, InteractionEvent } from \"../../shared/model\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-textarea\",\n})\nexport class DBTextarea {\n private _ref!: HTMLTextAreaElement | null;\n @Prop() id: DBTextareaProps[\"id\"];\n @Prop() message: DBTextareaProps[\"message\"];\n @Prop() showMessage: DBTextareaProps[\"showMessage\"];\n @Prop() value: DBTextareaProps[\"value\"];\n @Event() onInput: any;\n @Prop() input: DBTextareaProps[\"input\"];\n @Event() onChange: any;\n @Prop() change: DBTextareaProps[\"change\"];\n @Prop() validation: DBTextareaProps[\"validation\"];\n @Prop() invalidMessage: DBTextareaProps[\"invalidMessage\"];\n @Prop() required: DBTextareaProps[\"required\"];\n @Prop() minLength: DBTextareaProps[\"minLength\"];\n @Prop() maxLength: DBTextareaProps[\"maxLength\"];\n @Prop() validMessage: DBTextareaProps[\"validMessage\"];\n @Event() onBlur: any;\n @Prop() blur: DBTextareaProps[\"blur\"];\n @Event() onFocus: any;\n @Prop() focus: DBTextareaProps[\"focus\"];\n @Prop({attribute: \"classname\"}) className: DBTextareaProps[\"className\"];\n @Prop() variant: DBTextareaProps[\"variant\"];\n @Prop() showLabel: DBTextareaProps[\"showLabel\"];\n @Prop() label: DBTextareaProps[\"label\"];\n @Prop() resize: DBTextareaProps[\"resize\"];\n @Prop() disabled: DBTextareaProps[\"disabled\"];\n @Prop() readOnly: DBTextareaProps[\"readOnly\"];\n @Prop() form: DBTextareaProps[\"form\"];\n @Prop() name: DBTextareaProps[\"name\"];\n @Prop() wrap: DBTextareaProps[\"wrap\"];\n @Prop() spellCheck: DBTextareaProps[\"spellCheck\"];\n @Prop() autocomplete: DBTextareaProps[\"autocomplete\"];\n @Prop() placeholder: DBTextareaProps[\"placeholder\"];\n @Prop() rows: DBTextareaProps[\"rows\"];\n @Prop() cols: DBTextareaProps[\"cols\"];\n @Prop() messageIcon: DBTextareaProps[\"messageIcon\"];\n @State() _id = undefined;\n @State() _messageId = undefined;\n @State() _validMessageId = undefined;\n @State() _invalidMessageId = undefined;\n @State() _descByIds = \"\";\n @State() _value = \"\";\n @State() _voiceOverFallback = \"\";\n\n handleInput(event: InputEvent<HTMLTextAreaElement>) {\n if (this.onInput) {\n this.onInput.emit(event);\n }\n if (this.input) {\n this.input(event);\n }\n }\n handleChange(event: ChangeEvent<HTMLTextAreaElement>) {\n if (this.onChange) {\n this.onChange.emit(event);\n }\n if (this.change) {\n this.change(event);\n }\n /* For a11y reasons we need to map the correct message with the textarea */\n if (!this._ref?.validity.valid || this.validation === \"invalid\") {\n this._descByIds = this._invalidMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback =\n this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.validation === \"valid\" ||\n (this._ref?.validity.valid &&\n (this.required || this.minLength || this.maxLength))\n ) {\n this._descByIds = this._validMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this.validMessage ?? DEFAULT_VALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = this._messageId;\n } else {\n this._descByIds = \"\";\n }\n }\n handleBlur(event: InteractionEvent<HTMLTextAreaElement>) {\n if (this.onBlur) {\n this.onBlur.emit(event);\n }\n if (this.blur) {\n this.blur(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLTextAreaElement>) {\n if (this.onFocus) {\n this.onFocus.emit(event);\n }\n if (this.focus) {\n this.focus(event);\n }\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLTextAreaElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n if (this._id) {\n const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;\n this._messageId = messageId;\n this._validMessageId = this._id + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = this._id + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = messageId;\n }\n }\n }\n\n @Watch(\"_id\")\n watch0() {\n this.watch0Fn();\n }\n\n watch1Fn() {\n this._value = this.value;\n }\n\n @Watch(\"value\")\n watch1() {\n this.watch1Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-textarea\");\n const mId = this.id ?? `textarea-${uuid()}`;\n this._id = mId;\n this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;\n this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this.watch0Fn();\n this.watch1Fn();\n }\n\n render() {\n return (\n <div\n class={cls(\"db-textarea\", this.className)}\n data-variant={this.variant}\n data-hide-label={getHideProp(this.showLabel)}\n >\n <label htmlFor={this._id}>{this.label ?? DEFAULT_LABEL}</label>\n <textarea\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n data-resize={this.resize}\n disabled={this.disabled}\n required={this.required}\n readOnly={this.readOnly}\n form={this.form}\n maxLength={this.maxLength}\n minLength={this.minLength}\n name={this.name}\n wrap={this.wrap}\n spellcheck={this.spellCheck}\n autocomplete={this.autocomplete}\n onInput={(event) => this.handleInput(event)}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n value={this.value ?? this._value}\n aria-describedby={this._descByIds}\n placeholder={this.placeholder ?? DEFAULT_PLACEHOLDER}\n rows={this.rows ?? DEFAULT_ROWS}\n cols={this.cols}\n ></textarea>\n {stringPropVisible(this.message, this.showMessage) ? (\n <db-infotext\n size=\"small\"\n icon={this.messageIcon}\n id={this._messageId}\n >\n {this.message}\n </db-infotext>\n ) : null}\n <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage ?? DEFAULT_VALID_MESSAGE}\n </db-infotext>\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this.invalidMessage ??\n (this._ref?.validationMessage || DEFAULT_INVALID_MESSAGE)}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/components/textarea/textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,GAAG,EACH,KAAK,EACL,UAAU,EACV,WAAW,EACX,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,IAAI,GACL,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,aAAa,EACb,yBAAyB,EACzB,mBAAmB,EACnB,YAAY,EACZ,qBAAqB,EACrB,+BAA+B,GAChC,MAAM,wBAAwB,CAAC;AAOhC,OAAO,EACL,SAAS,EACT,CAAC,EAED,KAAK,EACL,KAAK,EAEL,IAAI,EACJ,KAAK,GACN,MAAM,eAAe,CAAC;AAGvB;;;GAGG;AAIH,MAAM,OAAO,UAAU;IAHtB;QA8CU,QAAG,GAAG,SAAS,CAAC;QAChB,eAAU,GAAG,SAAS,CAAC;QACvB,oBAAe,GAAG,SAAS,CAAC;QAC5B,sBAAiB,GAAG,SAAS,CAAC;QAC9B,oBAAe,GAAG,SAAS,CAAC;QAC5B,eAAU,GAAG,EAAE,CAAC;QAChB,WAAM,GAAG,EAAE,CAAC;QACZ,uBAAkB,GAAG,EAAE,CAAC;KA0NlC;IAxNC,aAAa;;QACX,OAAO,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,YAAY,mCAAI,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC;IAC9D,CAAC;IACD,gBAAgB;;QACd,2EAA2E;QAC3E,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,CAAC,KAAK,CAAA,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACh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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { DBTextareaProps, DBTextareaState } from \"./model\";\nimport { DBInfotext } from \"../infotext/infotext\";\nimport {\n cls,\n delay,\n getBoolean,\n getHideProp,\n getNumber,\n hasVoiceOver,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport {\n DEFAULT_INVALID_MESSAGE,\n DEFAULT_INVALID_MESSAGE_ID_SUFFIX,\n DEFAULT_LABEL,\n DEFAULT_MESSAGE_ID_SUFFIX,\n DEFAULT_PLACEHOLDER,\n DEFAULT_ROWS,\n DEFAULT_VALID_MESSAGE,\n DEFAULT_VALID_MESSAGE_ID_SUFFIX,\n} from \"../../shared/constants\";\nimport { ChangeEvent, InputEvent, InteractionEvent } from \"../../shared/model\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n EventEmitter,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-textarea\",\n})\nexport class DBTextarea {\n private _ref!: HTMLTextAreaElement | any;\n @Prop() id: DBTextareaProps[\"id\"];\n @Prop() invalidMessage: DBTextareaProps[\"invalidMessage\"];\n @Prop() message: DBTextareaProps[\"message\"];\n @Prop() showMessage: DBTextareaProps[\"showMessage\"];\n @Prop() value: DBTextareaProps[\"value\"];\n @Prop() validMessage: DBTextareaProps[\"validMessage\"];\n @Prop() validation: DBTextareaProps[\"validation\"];\n @Prop() required: DBTextareaProps[\"required\"];\n @Prop() minLength: DBTextareaProps[\"minLength\"];\n @Prop() maxLength: DBTextareaProps[\"maxLength\"];\n @Event() input: EventEmitter<\n Parameters<Required<DBTextareaProps>[\"onInput\"]>[number]\n > | void;\n @Event() change: EventEmitter<\n Parameters<Required<DBTextareaProps>[\"onChange\"]>[number]\n > | void;\n @Event() blur: EventEmitter<\n Parameters<Required<DBTextareaProps>[\"onBlur\"]>[number]\n > | void;\n @Event() focus: EventEmitter<\n Parameters<Required<DBTextareaProps>[\"onFocus\"]>[number]\n > | void;\n @Prop({attribute: \"classname\"}) className: DBTextareaProps[\"className\"];\n @Prop() variant: DBTextareaProps[\"variant\"];\n @Prop() showLabel: DBTextareaProps[\"showLabel\"];\n @Prop() label: DBTextareaProps[\"label\"];\n @Prop() resize: DBTextareaProps[\"resize\"];\n @Prop() disabled: DBTextareaProps[\"disabled\"];\n @Prop() readOnly: DBTextareaProps[\"readOnly\"];\n @Prop() readonly: DBTextareaProps[\"readonly\"];\n @Prop() form: DBTextareaProps[\"form\"];\n @Prop() maxlength: DBTextareaProps[\"maxlength\"];\n @Prop() minlength: DBTextareaProps[\"minlength\"];\n @Prop() name: DBTextareaProps[\"name\"];\n @Prop() wrap: DBTextareaProps[\"wrap\"];\n @Prop() spellCheck: DBTextareaProps[\"spellCheck\"];\n @Prop() autocomplete: DBTextareaProps[\"autocomplete\"];\n @Prop() placeholder: DBTextareaProps[\"placeholder\"];\n @Prop() rows: DBTextareaProps[\"rows\"];\n @Prop() cols: DBTextareaProps[\"cols\"];\n @Prop() messageIcon: DBTextareaProps[\"messageIcon\"];\n @State() _id = undefined;\n @State() _messageId = undefined;\n @State() _validMessageId = undefined;\n @State() _invalidMessageId = undefined;\n @State() _invalidMessage = undefined;\n @State() _descByIds = \"\";\n @State() _value = \"\";\n @State() _voiceOverFallback = \"\";\n\n hasValidState() {\n return !!(this.validMessage ?? this.validation === \"valid\");\n }\n handleValidation() {\n /* For a11y reasons we need to map the correct message with the textarea */\n if (!this._ref?.validity.valid || this.validation === \"invalid\") {\n this._descByIds = this._invalidMessageId;\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this._invalidMessage;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.hasValidState() &&\n this._ref?.validity.valid &&\n (this.required || this.minLength || this.maxLength)\n ) {\n this._descByIds = this._validMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this.validMessage ?? DEFAULT_VALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = this._messageId;\n } else {\n this._descByIds = \"\";\n }\n }\n handleInput(event: InputEvent<HTMLTextAreaElement>) {\n if (this.input) {\n this.input.emit(event);\n }\n this.handleValidation();\n }\n handleChange(event: ChangeEvent<HTMLTextAreaElement>) {\n if (this.change) {\n this.change.emit(event);\n }\n this.handleValidation();\n }\n handleBlur(event: InteractionEvent<HTMLTextAreaElement> | any) {\n if (this.blur) {\n this.blur.emit(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLTextAreaElement> | any) {\n if (this.focus) {\n this.focus.emit(event);\n }\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLTextAreaElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n }\n\n @Watch(\"_ref\")\n @Watch(\"invalidMessage\")\n watch0() {\n this.watch0Fn();\n }\n\n watch1Fn() {\n if (this._id) {\n const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;\n this._messageId = messageId;\n this._validMessageId = this._id + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = this._id + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = messageId;\n }\n }\n }\n\n @Watch(\"_id\")\n watch1() {\n this.watch1Fn();\n }\n\n watch2Fn() {\n this._value = this.value;\n }\n\n @Watch(\"value\")\n watch2() {\n this.watch2Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-textarea\");\n const mId = this.id ?? `textarea-${uuid()}`;\n this._id = mId;\n this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;\n this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;\n this.watch0Fn();\n this.watch1Fn();\n this.watch2Fn();\n }\n\n render() {\n return (\n <div\n class={cls(\"db-textarea\", this.className)}\n data-variant={this.variant}\n data-hide-label={getHideProp(this.showLabel)}\n >\n <label htmlFor={this._id}>{this.label ?? DEFAULT_LABEL}</label>\n <textarea\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n data-resize={this.resize}\n disabled={getBoolean(this.disabled, \"disabled\")}\n required={getBoolean(this.required, \"required\")}\n readOnly={\n getBoolean(this.readOnly, \"readOnly\") ||\n getBoolean(this.readonly, \"readonly\")\n }\n form={this.form}\n maxLength={getNumber(this.maxLength, this.maxlength)}\n minLength={getNumber(this.minLength, this.minlength)}\n name={this.name}\n wrap={this.wrap}\n spellcheck={this.spellCheck}\n autocomplete={this.autocomplete}\n onInput={(event) => this.handleInput(event)}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n value={this.value ?? this._value}\n aria-describedby={this._descByIds}\n placeholder={this.placeholder ?? DEFAULT_PLACEHOLDER}\n rows={getNumber(this.rows, DEFAULT_ROWS)}\n cols={getNumber(this.cols)}\n ></textarea>\n {stringPropVisible(this.message, this.showMessage) ? (\n <db-infotext\n size=\"small\"\n icon={this.messageIcon}\n id={this._messageId}\n >\n {this.message}\n </db-infotext>\n ) : null}\n {this.hasValidState() ? (\n <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage || DEFAULT_VALID_MESSAGE}\n </db-infotext>\n ) : null}\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this._invalidMessage}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/components/tooltip/model.ts"],"names":[],"mappings":"","sourcesContent":["import { ClickEventState, EmphasisProps, GlobalProps, GlobalState, InitializedState, PlacementProps, PopoverProps, PopoverState } from '../../shared/model';\nexport type DBTooltipDefaultProps = {\n showArrow?: boolean;\n};\nexport type DBTooltipProps = DBTooltipDefaultProps & GlobalProps & EmphasisProps & PlacementProps & PopoverProps;\nexport type DBTooltipDefaultState = {};\nexport type DBTooltipState = DBTooltipDefaultState & GlobalState & ClickEventState<HTMLElement> & PopoverState & InitializedState"]}
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/components/tooltip/model.ts"],"names":[],"mappings":"","sourcesContent":["import { ClickEventState, EmphasisProps, GlobalProps, GlobalState, InitializedState, PlacementProps, PopoverProps, PopoverState } from '../../shared/model';\nexport type DBTooltipDefaultProps = {\n showArrow?: boolean | string;\n};\nexport type DBTooltipProps = DBTooltipDefaultProps & GlobalProps & EmphasisProps & PlacementProps & PopoverProps;\nexport type DBTooltipDefaultState = {};\nexport type DBTooltipState = DBTooltipDefaultState & GlobalState & ClickEventState<HTMLElement> & PopoverState & InitializedState"]}
|
|
@@ -77,15 +77,16 @@ export class DBTooltip {
|
|
|
77
77
|
}
|
|
78
78
|
render() {
|
|
79
79
|
var _a, _b;
|
|
80
|
-
return (h("i", { key: '
|
|
80
|
+
return (h("i", { key: 'ca896b62cc647f7303c58a2c1f3b34c54aa36196', class: cls("db-tooltip", this.className), role: "tooltip", "aria-hidden": "true", "data-gap": "true", ref: (el) => {
|
|
81
81
|
this._ref = el;
|
|
82
|
-
}, id: this._id, "data-emphasis": this.emphasis, "data-animation": getBooleanAsString((_a = this.animation) !== null && _a !== void 0 ? _a : true), "data-delay": this.delay, "data-width": this.width, "data-show-arrow": getBooleanAsString((_b = this.showArrow) !== null && _b !== void 0 ? _b : true), "data-placement": this.placement, onClick: (event) => this.handleClick(event) }, h("slot", { key: '
|
|
82
|
+
}, id: this._id, "data-emphasis": this.emphasis, "data-animation": getBooleanAsString((_a = this.animation) !== null && _a !== void 0 ? _a : true), "data-delay": this.delay, "data-width": this.width, "data-show-arrow": getBooleanAsString((_b = this.showArrow) !== null && _b !== void 0 ? _b : true), "data-placement": this.placement, onClick: (event) => this.handleClick(event) }, h("slot", { key: '2e261348a396edfd6f000d0f14ea19dfba822e00' })));
|
|
83
83
|
}
|
|
84
84
|
static get is() { return "db-tooltip"; }
|
|
85
85
|
static get properties() {
|
|
86
86
|
return {
|
|
87
87
|
"id": {
|
|
88
88
|
"type": "string",
|
|
89
|
+
"attribute": "id",
|
|
89
90
|
"mutable": false,
|
|
90
91
|
"complexType": {
|
|
91
92
|
"original": "DBTooltipProps[\"id\"]",
|
|
@@ -106,11 +107,11 @@ export class DBTooltip {
|
|
|
106
107
|
},
|
|
107
108
|
"getter": false,
|
|
108
109
|
"setter": false,
|
|
109
|
-
"attribute": "id",
|
|
110
110
|
"reflect": false
|
|
111
111
|
},
|
|
112
112
|
"className": {
|
|
113
113
|
"type": "string",
|
|
114
|
+
"attribute": "classname",
|
|
114
115
|
"mutable": false,
|
|
115
116
|
"complexType": {
|
|
116
117
|
"original": "DBTooltipProps[\"className\"]",
|
|
@@ -131,11 +132,11 @@ export class DBTooltip {
|
|
|
131
132
|
},
|
|
132
133
|
"getter": false,
|
|
133
134
|
"setter": false,
|
|
134
|
-
"attribute": "classname",
|
|
135
135
|
"reflect": false
|
|
136
136
|
},
|
|
137
137
|
"emphasis": {
|
|
138
138
|
"type": "string",
|
|
139
|
+
"attribute": "emphasis",
|
|
139
140
|
"mutable": false,
|
|
140
141
|
"complexType": {
|
|
141
142
|
"original": "DBTooltipProps[\"emphasis\"]",
|
|
@@ -156,15 +157,15 @@ export class DBTooltip {
|
|
|
156
157
|
},
|
|
157
158
|
"getter": false,
|
|
158
159
|
"setter": false,
|
|
159
|
-
"attribute": "emphasis",
|
|
160
160
|
"reflect": false
|
|
161
161
|
},
|
|
162
162
|
"animation": {
|
|
163
|
-
"type": "
|
|
163
|
+
"type": "any",
|
|
164
|
+
"attribute": "animation",
|
|
164
165
|
"mutable": false,
|
|
165
166
|
"complexType": {
|
|
166
167
|
"original": "DBTooltipProps[\"animation\"]",
|
|
167
|
-
"resolved": "boolean",
|
|
168
|
+
"resolved": "boolean | string",
|
|
168
169
|
"references": {
|
|
169
170
|
"DBTooltipProps": {
|
|
170
171
|
"location": "import",
|
|
@@ -181,11 +182,11 @@ export class DBTooltip {
|
|
|
181
182
|
},
|
|
182
183
|
"getter": false,
|
|
183
184
|
"setter": false,
|
|
184
|
-
"attribute": "animation",
|
|
185
185
|
"reflect": false
|
|
186
186
|
},
|
|
187
187
|
"delay": {
|
|
188
188
|
"type": "string",
|
|
189
|
+
"attribute": "delay",
|
|
189
190
|
"mutable": false,
|
|
190
191
|
"complexType": {
|
|
191
192
|
"original": "DBTooltipProps[\"delay\"]",
|
|
@@ -206,11 +207,11 @@ export class DBTooltip {
|
|
|
206
207
|
},
|
|
207
208
|
"getter": false,
|
|
208
209
|
"setter": false,
|
|
209
|
-
"attribute": "delay",
|
|
210
210
|
"reflect": false
|
|
211
211
|
},
|
|
212
212
|
"width": {
|
|
213
213
|
"type": "string",
|
|
214
|
+
"attribute": "width",
|
|
214
215
|
"mutable": false,
|
|
215
216
|
"complexType": {
|
|
216
217
|
"original": "DBTooltipProps[\"width\"]",
|
|
@@ -231,15 +232,15 @@ export class DBTooltip {
|
|
|
231
232
|
},
|
|
232
233
|
"getter": false,
|
|
233
234
|
"setter": false,
|
|
234
|
-
"attribute": "width",
|
|
235
235
|
"reflect": false
|
|
236
236
|
},
|
|
237
237
|
"showArrow": {
|
|
238
|
-
"type": "
|
|
238
|
+
"type": "any",
|
|
239
|
+
"attribute": "show-arrow",
|
|
239
240
|
"mutable": false,
|
|
240
241
|
"complexType": {
|
|
241
242
|
"original": "DBTooltipProps[\"showArrow\"]",
|
|
242
|
-
"resolved": "boolean",
|
|
243
|
+
"resolved": "boolean | string",
|
|
243
244
|
"references": {
|
|
244
245
|
"DBTooltipProps": {
|
|
245
246
|
"location": "import",
|
|
@@ -256,11 +257,11 @@ export class DBTooltip {
|
|
|
256
257
|
},
|
|
257
258
|
"getter": false,
|
|
258
259
|
"setter": false,
|
|
259
|
-
"attribute": "show-arrow",
|
|
260
260
|
"reflect": false
|
|
261
261
|
},
|
|
262
262
|
"placement": {
|
|
263
263
|
"type": "string",
|
|
264
|
+
"attribute": "placement",
|
|
264
265
|
"mutable": false,
|
|
265
266
|
"complexType": {
|
|
266
267
|
"original": "DBTooltipProps[\"placement\"]",
|
|
@@ -281,7 +282,6 @@ export class DBTooltip {
|
|
|
281
282
|
},
|
|
282
283
|
"getter": false,
|
|
283
284
|
"setter": false,
|
|
284
|
-
"attribute": "placement",
|
|
285
285
|
"reflect": false
|
|
286
286
|
}
|
|
287
287
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,CAAC,EAAY,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3E;;;GAGG;AAIH,MAAM,OAAO,SAAS;IAHrB;
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE/E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { DBTooltipProps, DBTooltipState } from \"./model\";\nimport { cls, getBooleanAsString, handleDataOutside, uuid } from \"../../utils\";\nimport { ClickEvent } from \"../../shared/model\";\nimport { DEFAULT_ID } from \"../../shared/constants\";\n\nimport { Component, h, Fragment, Watch, Prop, State } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-tooltip\",\n})\nexport class DBTooltip {\n private _ref!: HTMLDivElement | any;\n @Prop() id: DBTooltipProps[\"id\"];\n @Prop({attribute: \"classname\"}) className: DBTooltipProps[\"className\"];\n @Prop() emphasis: DBTooltipProps[\"emphasis\"];\n @Prop() animation: DBTooltipProps[\"animation\"];\n @Prop() delay: DBTooltipProps[\"delay\"];\n @Prop() width: DBTooltipProps[\"width\"];\n @Prop() showArrow: DBTooltipProps[\"showArrow\"];\n @Prop() placement: DBTooltipProps[\"placement\"];\n @State() _id = DEFAULT_ID;\n @State() initialized = false;\n\n handleClick(event: ClickEvent<HTMLElement>) {\n event.stopPropagation();\n }\n handleAutoPlacement() {\n if (this._ref) handleDataOutside(this._ref);\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n if (this._ref && this.initialized && this._id) {\n let parent = this._ref.parentElement;\n if (parent && parent.localName.includes(\"tooltip\")) {\n // Angular workaround\n parent = parent.parentElement;\n }\n if (parent) {\n [\"mouseenter\", \"focus\"].forEach((event) => {\n parent.addEventListener(event, () => this.handleAutoPlacement());\n });\n parent.setAttribute(\"data-has-tooltip\", \"true\");\n parent.setAttribute(\"aria-describedby\", this._id);\n }\n this.initialized = false;\n }\n }\n\n @Watch(\"_ref\")\n @Watch(\"initialized\")\n watch0() {\n this.watch0Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-tooltip\");\n this._id = this.id || \"tooltip-\" + uuid();\n this.initialized = true;\n this.watch0Fn();\n }\n\n render() {\n return (\n <i\n class={cls(\"db-tooltip\", this.className)}\n role=\"tooltip\"\n aria-hidden=\"true\"\n data-gap=\"true\"\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n data-emphasis={this.emphasis}\n data-animation={getBooleanAsString(this.animation ?? true)}\n data-delay={this.delay}\n data-width={this.width}\n data-show-arrow={getBooleanAsString(this.showArrow ?? true)}\n data-placement={this.placement}\n onClick={(event) => this.handleClick(event)}\n >\n <slot></slot>\n </i>\n );\n }\n}\n"]}
|
|
@@ -13,7 +13,6 @@ export const PopoverDelayList = ['none', 'slow', 'fast'];
|
|
|
13
13
|
export const PopoverWidthList = ['auto', 'fixed'];
|
|
14
14
|
export const SizeList = ['small', 'medium'];
|
|
15
15
|
export const EmphasisList = ['weak', 'strong'];
|
|
16
|
-
export const TagEmphasisList = [...EmphasisList, 'origin'];
|
|
17
16
|
export const ValidationList = ['invalid', 'valid', 'no-validation'];
|
|
18
17
|
export const LabelVariantList = ['above', 'floating'];
|
|
19
18
|
export const AutoCompleteList = ['off', 'on', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'email', 'username', 'new-password', 'current-password', 'one-time-code', 'organization-title', 'organization', 'street-address', 'shipping', 'billing', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-extension', 'impp', 'url', 'photo', 'webauthn'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/shared/model.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAsCvD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,CAAU,CAAC;AA2BnH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAQzE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAQxE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,CAAU,CAAC;AAExH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,QAAQ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* default slot\n */\n\n children?: any;\n\n /**\n * React specific for adding className to the component.\n */\n className?: string;\n\n /**\n * Workaround for TypeScript using class for all components.\n */\n class?: string | any;\n\n /**\n * [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) is used to link to the elements that describe the element with the set attribute.\n */\n describedbyid?: string;\n\n /**\n * [ID](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) of the component, generated automatically for some components as a fallback if unset.\n */\n id?: string;\n\n /**\n * Before using please check for the [accessibility concerns](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_concerns)\n */\n autofocus?: boolean;\n};\nexport type GlobalState = {\n _id?: string;\n};\nexport const SemanticList = ['adaptive', 'neutral', 'critical', 'informational', 'warning', 'successful'] as const;\nexport type SemanticType = (typeof SemanticList)[number];\nexport type SemanticProps = {\n /**\n * The semantic defines the default variants for most components.\n */\n semantic?: SemanticType;\n};\nexport type IconProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n icon?: IconTypes;\n};\nexport type ShowIconProps = {\n /**\n * Enables or disables the visibility of the icon. The default value depends on the component.\n * For many components this property is optional to reflect Figma properties.\n */\n showIcon?: boolean;\n};\nexport type IconAfterProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n iconAfter?: IconTypes;\n};\nexport const SpacingList = ['medium', 'small', 'large', 'none'] as const;\nexport type SpacingType = (typeof SpacingList)[number];\nexport type SpacingProps = {\n /**\n * The spacing attribute changes the padding of the component.\n */\n spacing?: SpacingType | string;\n};\nexport const MarginList = ['medium', 'small', 'large', 'none'] as const;\nexport type MarginType = (typeof MarginList)[number];\nexport type MarginProps = {\n /**\n * The margin attribute changes the margin of the component.\n */\n margin?: MarginType;\n};\nexport const PlacementHorizontalList = ['left', 'right', 'left-start', 'left-end', 'right-start', 'right-end'] as const;\nexport type PlacementHorizontalType = (typeof PlacementHorizontalList)[number];\nexport const PlacementVerticalList = ['top', 'bottom', 'top-start', 'top-end', 'bottom-start', 'bottom-end'] as const;\nexport type PlacementVerticalType = (typeof PlacementVerticalList)[number];\nexport const PlacementList = [...PlacementHorizontalList, ...PlacementVerticalList] as const;\nexport type PlacementType = (typeof PlacementList)[number];\nexport type PlacementProps = {\n /**\n * The `placement` attributes values change the position to absolute and adds a transform based on the placement.\n */\n placement?: PlacementType;\n};\nexport type NavigationBehaviorState = {\n handleNavigationItemClick: (event: unknown) => void;\n};\nexport type GapProps = {\n /**\n * If the absolute element should have a gap between the parent element.\n */\n gap?: boolean;\n};\nexport const GapSpacingList = ['none', '3x-large', '2x-large', 'x-large', 'large', 'medium', 'small', 'x-small', '2x-small', '3x-small'] as const;\nexport type GapSpacingType = (typeof GapSpacingList)[number];\nexport type GapSpacingProps = {\n /**\n * Set the gap/spacing between elements\n */\n gap?: GapSpacingType;\n};\nexport type OverflowProps = {\n /**\n * The overflow attribute sets a max-width and longer text will be dotted.\n */\n overflow?: boolean;\n};\nexport const OrientationList = ['horizontal', 'vertical'] as const;\nexport type OrientationType = (typeof OrientationList)[number];\nexport type OrientationProps = {\n /**\n * Change the orientation. Defaults to horizontal.\n */\n orientation?: OrientationType;\n};\nexport const WidthList = ['full', 'auto'] as const;\nexport type WidthType = (typeof WidthList)[number];\nexport type WidthProps = {\n /**\n * Width of the component. Auto width based on children size, full width based on parent elements width.\n */\n width?: WidthType | string;\n};\nexport const MaxWidthList = ['full', 'medium', 'large', 'small'] as const;\nexport type MaxWidthType = (typeof MaxWidthList)[number];\nexport type ContainerWidthProps = {\n /**\n * Set max width for the component\n */\n width?: MaxWidthType;\n};\nexport const PopoverDelayList = ['none', 'slow', 'fast'] as const;\nexport type PopoverDelayType = (typeof PopoverDelayList)[number];\nexport const PopoverWidthList = ['auto', 'fixed'] as const;\nexport type PopoverWidthType = (typeof PopoverWidthList)[number];\nexport type PopoverProps = {\n /**\n * Add a delay before showing the tooltip\n */\n delay?: PopoverDelayType;\n /**\n * Disable animation\n */\n animation?: boolean;\n /**\n * Use fixed with for default max-width\n */\n width?: PopoverWidthType;\n};\nexport type PopoverState = {\n handleAutoPlacement: () => void;\n};\nexport type ContentSlotProps = {\n /**\n * Default slot which is used to pass in additional content.\n */\n content?: any;\n};\nexport const SizeList = ['small', 'medium'] as const;\nexport type SizeType = (typeof SizeList)[number];\nexport type SizeProps = {\n /**\n * The size attribute changes the font-size and other related sizes of the component.\n */\n size?: SizeType;\n};\nexport const EmphasisList = ['weak', 'strong'] as const;\nexport type EmphasisType = (typeof EmphasisList)[number];\nexport type EmphasisProps = {\n /**\n * The emphasis attribute divides in between a weak or strong importance.\n */\n emphasis?: EmphasisType;\n};\nexport const TagEmphasisList = [...EmphasisList, 'origin'] as const;\nexport type TagEmphasisType = (typeof TagEmphasisList)[number];\nexport type TagEmphasisProps = {\n /**\n * The emphasis attribute divides in between a weak, strong or origin appearance.\n */\n emphasis?: TagEmphasisType;\n};\nexport const ValidationList = ['invalid', 'valid', 'no-validation'] as const;\nexport type ValidationType = (typeof ValidationList)[number];\nexport type RequiredProps = {\n /**\n * When the required attribute specified, the user will be required to fill the form element before submitting the form.\n */\n required?: boolean;\n};\nexport type ShowLabelProps = {\n /**\n * Enables/disables the visibility of the label\n */\n showLabel?: boolean;\n};\nexport type ValueProps = {\n /**\n * The value property is to receive results from the native form element.\n */\n value?: any;\n};\nexport type BaseFormProps = {\n /**\n * The disabled attribute can be set to keep a user from clicking on the form element.\n */\n disabled?: boolean;\n /**\n * The label attribute specifies the caption of the form element.\n */\n label?: string;\n\n /**\n * The name attribute gives the name of the form control, as used in form submission and in the form element's elements object.\n */\n name?: string;\n};\nexport type CustomFormProps = {\n /**\n * Overwrites auto handling for aria-describedby.\n */\n ariaDescribedBy?: string;\n /**\n * \tAssociates the control with a form element\n */\n form?: string;\n\n /**\n * Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector.\n */\n validation?: ValidationType;\n};\nexport type FormProps = CustomFormProps & BaseFormProps & RequiredProps & ShowLabelProps & ValueProps;\nexport type FormTextProps = {\n /**\n * Maximum length (number of characters) of value\n */\n maxLength?: number;\n /**\n * Minimum length (number of characters) of value\n */\n minLength?: number;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readOnly?: boolean;\n};\nexport type FormSizeProps = {\n /**\n * Size of the control\n */\n size?: number;\n};\nexport type FormCheckProps = {\n /**\n * Define the radio or checkbox elements checked state\n */\n checked?: boolean;\n};\nexport const LabelVariantList = ['above', 'floating'] as const;\nexport type LabelVariantType = (typeof LabelVariantList)[number];\nexport const AutoCompleteList = ['off', 'on', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'email', 'username', 'new-password', 'current-password', 'one-time-code', 'organization-title', 'organization', 'street-address', 'shipping', 'billing', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-extension', 'impp', 'url', 'photo', 'webauthn'] as const;\nexport type AutoCompleteType = (typeof AutoCompleteList)[number];\nexport type FormMessageProps = {\n /**\n * Change the variant of the label to float or hidden\n */\n variant?: LabelVariantType;\n /**\n * Text that appears in the form control when it has no value set\n */\n placeholder?: string;\n /**\n * Optional helper message for form components\n */\n message?: string;\n\n /**\n * Helper message for valid form components\n */\n validMessage?: string;\n\n /**\n * Helper message for invalid form components\n */\n invalidMessage?: string;\n\n /**\n * Set/overwrite icon for helper message for form components\n */\n messageIcon?: IconTypes;\n\n /**\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autocomplete?: string | AutoCompleteType;\n\n /**\n * Enables or disables the visibility of the message.\n */\n showMessage?: boolean;\n};\nexport type FormState = {\n _messageId?: string;\n _validMessageId?: string;\n _invalidMessageId?: string;\n _descByIds?: string;\n _value?: string;\n\n /**\n * https://www.davidmacd.com/blog/test-aria-describedby-errormessage-aria-live.html\n * Currently VoiceOver isn't supporting changes from aria-describedby.\n * This is an internal Fallback\n */\n _voiceOverFallback?: string;\n};\nexport type InitializedState = {\n initialized: boolean;\n};\nexport const LinkCurrentList = ['time', 'true', 'false', 'date', 'page', 'step', 'location'] as const;\nexport type LinkCurrentType = (typeof LinkCurrentList)[number];\nexport const LinkTargetList = ['_self', '_blank', '_parent', '_top'] as const;\nexport type LinkTargetType = (typeof LinkTargetList)[number];\nexport const LinkReferrerPolicyList = ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'] as const;\nexport type LinkReferrerPolicyType = (typeof LinkReferrerPolicyList)[number];\nexport type LinkProps = {\n /**\n * Sets aria attribute based on [`aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current).\n */\n current?: boolean | LinkCurrentType;\n /**\n * Disables the link.\n */\n disabled?: boolean;\n /**\n * The [URL that the hyperlink points to](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).\n */\n href?: string;\n /**\n * Hints for the human [language of the linked page or document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).\n */\n hreflang?: string;\n /**\n * Sets aria attribute based on [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label).\n */\n label?: string;\n /**\n * Where to open the linked URL, as the name for a [browsing context](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).\n */\n target?: LinkTargetType;\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n rel?: string;\n /**\n * Sets aria role based on [`aria-role`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles).\n */\n role?: string;\n /**\n * How much of the referrer to send when following the link.\n */\n referrerpolicy?: LinkReferrerPolicyType;\n /**\n * Sets aria role based on [`aria-selected`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected).\n */\n selected?: boolean;\n};\nexport type TextProps = {\n /**\n * Alternative for default slot/children.\n */\n text?: string;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type ClickEvent<T> = MouseEvent;\nexport type ClickEventProps<T> = {\n /**\n * React specific onClick to pass to forward ref.\n */\n onClick?: (event: ClickEvent<T>) => void;\n};\nexport type ClickEventState<T> = {\n handleClick: (event: ClickEvent<T>) => void;\n};\nexport type ToggleEventProps = {\n onToggle?: (open: boolean) => void;\n};\nexport type ToggleEventState<T> = {\n toggle: (event?: ClickEvent<T>) => void;\n};\nexport type CloseEventProps = {\n /**\n * Function to handle button click (close).\n */\n onClose?: (event?: any) => void;\n};\nexport type CloseEventState = {\n handleClose: (event: any) => void;\n};\nexport const AlignmentList = ['start', 'center'] as const;\nexport type AlignmentType = (typeof AlignmentList)[number];\nexport type AlignmentProps = {\n /**\n * Define the content alignment in full width\n */\n alignment?: AlignmentType | string;\n};\nexport type ActiveProps = {\n /**\n * If the tab is checked/active.\n */\n active?: boolean;\n};\nexport type InputEvent<T> = Event;\nexport type InputEventProps<T> = {\n input?: (event: InputEvent<T>) => void;\n onInput?: (event: InputEvent<T>) => void;\n};\nexport type InputEventState<T> = {\n handleInput: (event: InputEvent<T>) => void;\n};\nexport type ChangeEvent<T> = Event;\nexport type ChangeEventProps<T> = {\n change?: (event: ChangeEvent<T>) => void;\n onChange?: (event: ChangeEvent<T>) => void;\n};\nexport type ChangeEventState<T> = {\n handleChange: (event: ChangeEvent<T>) => void;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type InteractionEvent<T> = FocusEvent;\nexport type FocusEventProps<T> = {\n blur?: (event: InteractionEvent<T>) => void;\n onBlur?: (event: InteractionEvent<T>) => void;\n focus?: (event: InteractionEvent<T>) => void;\n onFocus?: (event: InteractionEvent<T>) => void;\n};\nexport type FocusEventState<T> = {\n handleBlur: (event: InteractionEvent<T>) => void;\n handleFocus: (event: InteractionEvent<T>) => void;\n};\nexport type InnerCloseButtonProps = {\n /**\n * The closeButtonId attribute changes the id inside the close button.\n */\n closeButtonId?: string;\n /**\n * The closeButtonText attribute changes the text inside the close button.\n */\n closeButtonText?: string;\n};\nexport type NavigationBackButtonProps = {\n /**\n * The backButtonId attribute changes the id inside the back button.\n */\n backButtonId?: string;\n /**\n * The backButtonText attribute changes the text inside the back button.\n */\n backButtonText?: string;\n};\nexport type AriaLabelledByProps = {\n /**\n * Pass aria-labelledby to inner element\n */\n labelledBy?: string;\n};\nexport type AriaControlsProps = {\n /**\n * Pass aria-controls to inner element\n */\n controls?: string;\n};\nexport type ValueLabelType = {\n value: string;\n label?: string;\n}"]}
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/shared/model.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAsCvD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,CAAU,CAAC;AA2BnH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAQzE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAQxE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,CAAU,CAAC;AAExH,MAAM,CAAC,MAAM,q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,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAU,CAAC;AA+D91B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAU,CAAC;AAEtG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAU,CAAC;AAE9E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,aAAa,EAAE,4BAA4B,EAAE,QAAQ,EAAE,0BAA0B,EAAE,aAAa,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY,CAAU,CAAC;AAkFpN,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { IconTypes } from '@db-ux/core-foundations';\nexport type GlobalProps = {\n /**\n * default slot\n */\n\n children?: any;\n\n /**\n * React specific for adding className to the component.\n */\n className?: string;\n\n /**\n * Workaround for TypeScript using class for all components.\n */\n class?: string | any;\n\n /**\n * [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) is used to link to the elements that describe the element with the set attribute.\n */\n describedbyid?: string;\n\n /**\n * [ID](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) of the component, generated automatically for some components as a fallback if unset.\n */\n id?: string;\n\n /**\n * Before using please check for the [accessibility concerns](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_concerns)\n */\n autofocus?: boolean | string;\n};\nexport type GlobalState = {\n _id?: string;\n};\nexport const SemanticList = ['adaptive', 'neutral', 'critical', 'informational', 'warning', 'successful'] as const;\nexport type SemanticType = (typeof SemanticList)[number];\nexport type SemanticProps = {\n /**\n * The semantic defines the default variants for most components.\n */\n semantic?: SemanticType;\n};\nexport type IconProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n icon?: IconTypes;\n};\nexport type ShowIconProps = {\n /**\n * Enables or disables the visibility of the icon. The default value depends on the component.\n * For many components this property is optional to reflect Figma properties.\n */\n showIcon?: boolean | string;\n};\nexport type IconAfterProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n iconAfter?: IconTypes;\n};\nexport const SpacingList = ['medium', 'small', 'large', 'none'] as const;\nexport type SpacingType = (typeof SpacingList)[number];\nexport type SpacingProps = {\n /**\n * The spacing attribute changes the padding of the component.\n */\n spacing?: SpacingType | string;\n};\nexport const MarginList = ['medium', 'small', 'large', 'none'] as const;\nexport type MarginType = (typeof MarginList)[number];\nexport type MarginProps = {\n /**\n * The margin attribute changes the margin of the component.\n */\n margin?: MarginType;\n};\nexport const PlacementHorizontalList = ['left', 'right', 'left-start', 'left-end', 'right-start', 'right-end'] as const;\nexport type PlacementHorizontalType = (typeof PlacementHorizontalList)[number];\nexport const PlacementVerticalList = ['top', 'bottom', 'top-start', 'top-end', 'bottom-start', 'bottom-end'] as const;\nexport type PlacementVerticalType = (typeof PlacementVerticalList)[number];\nexport const PlacementList = [...PlacementHorizontalList, ...PlacementVerticalList] as const;\nexport type PlacementType = (typeof PlacementList)[number];\nexport type PlacementProps = {\n /**\n * The `placement` attributes values change the position to absolute and adds a transform based on the placement.\n */\n placement?: PlacementType;\n};\nexport type NavigationBehaviorState = {\n handleNavigationItemClick: (event: unknown) => void;\n};\nexport type GapProps = {\n /**\n * If the absolute element should have a gap between the parent element.\n */\n gap?: boolean | string;\n};\nexport const GapSpacingList = ['none', '3x-large', '2x-large', 'x-large', 'large', 'medium', 'small', 'x-small', '2x-small', '3x-small'] as const;\nexport type GapSpacingType = (typeof GapSpacingList)[number];\nexport type GapSpacingProps = {\n /**\n * Set the gap/spacing between elements\n */\n gap?: GapSpacingType;\n};\nexport type OverflowProps = {\n /**\n * The overflow attribute sets a max-width and longer text will be dotted.\n */\n overflow?: boolean | string;\n};\nexport const OrientationList = ['horizontal', 'vertical'] as const;\nexport type OrientationType = (typeof OrientationList)[number];\nexport type OrientationProps = {\n /**\n * Change the orientation. Defaults to horizontal.\n */\n orientation?: OrientationType;\n};\nexport const WidthList = ['full', 'auto'] as const;\nexport type WidthType = (typeof WidthList)[number];\nexport type WidthProps = {\n /**\n * Width of the component. Auto width based on children size, full width based on parent elements width.\n */\n width?: WidthType | string;\n};\nexport const MaxWidthList = ['full', 'medium', 'large', 'small'] as const;\nexport type MaxWidthType = (typeof MaxWidthList)[number];\nexport type ContainerWidthProps = {\n /**\n * Set max width for the component\n */\n width?: MaxWidthType;\n};\nexport const PopoverDelayList = ['none', 'slow', 'fast'] as const;\nexport type PopoverDelayType = (typeof PopoverDelayList)[number];\nexport const PopoverWidthList = ['auto', 'fixed'] as const;\nexport type PopoverWidthType = (typeof PopoverWidthList)[number];\nexport type PopoverProps = {\n /**\n * Add a delay before showing the tooltip\n */\n delay?: PopoverDelayType;\n /**\n * Disable animation\n */\n animation?: boolean | string;\n /**\n * Use fixed with for default max-width\n */\n width?: PopoverWidthType;\n};\nexport type PopoverState = {\n handleAutoPlacement: () => void;\n};\nexport type NameProps = {\n /**\n * The name attribute gives the name of the element to group it.\n */\n name?: string;\n};\nexport type NameState = {\n _name?: string;\n handleNameAttribute: () => void;\n};\nexport type ContentSlotProps = {\n /**\n * Default slot which is used to pass in additional content.\n */\n content?: any;\n};\nexport const SizeList = ['small', 'medium'] as const;\nexport type SizeType = (typeof SizeList)[number];\nexport type SizeProps = {\n /**\n * The size attribute changes the font-size and other related sizes of the component.\n */\n size?: SizeType;\n};\nexport const EmphasisList = ['weak', 'strong'] as const;\nexport type EmphasisType = (typeof EmphasisList)[number];\nexport type EmphasisProps = {\n /**\n * The emphasis attribute divides in between a weak or strong importance.\n */\n emphasis?: EmphasisType;\n};\nexport const ValidationList = ['invalid', 'valid', 'no-validation'] as const;\nexport type ValidationType = (typeof ValidationList)[number];\nexport type RequiredProps = {\n /**\n * When the required attribute specified, the user will be required to fill the form element before submitting the form.\n */\n required?: boolean | string;\n};\nexport type ShowLabelProps = {\n /**\n * Enables/disables the visibility of the label\n */\n showLabel?: boolean | string;\n};\nexport type ValueProps = {\n /**\n * The value property is to receive results from the native form element.\n */\n value?: any;\n};\nexport type BaseFormProps = {\n /**\n * The disabled attribute can be set to keep a user from clicking on the form element.\n */\n disabled?: boolean | string;\n /**\n * The label attribute specifies the caption of the form element.\n */\n label?: string;\n\n /**\n * The name attribute gives the name of the form control, as used in form submission and in the form element's elements object.\n */\n name?: string;\n};\nexport type CustomFormProps = {\n /**\n * Overwrites auto handling for aria-describedby.\n */\n ariaDescribedBy?: string;\n /**\n * \tAssociates the control with a form element\n */\n form?: string;\n\n /**\n * Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector.\n */\n validation?: ValidationType;\n};\nexport type FormProps = CustomFormProps & BaseFormProps & RequiredProps & ShowLabelProps & ValueProps;\nexport type FormTextProps = {\n /**\n * Maximum length (number of characters) of value\n */\n maxLength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minLength?: number | string;\n /**\n * Maximum length (number of characters) of value\n */\n maxlength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minlength?: number | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readOnly?: boolean | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readonly?: boolean | string;\n};\nexport type FormSizeProps = {\n /**\n * Size of the control\n */\n size?: number;\n};\nexport type FormCheckProps = {\n /**\n * Define the radio or checkbox elements checked state\n */\n checked?: boolean | string;\n};\nexport const LabelVariantList = ['above', 'floating'] as const;\nexport type LabelVariantType = (typeof LabelVariantList)[number];\nexport const AutoCompleteList = ['off', 'on', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'email', 'username', 'new-password', 'current-password', 'one-time-code', 'organization-title', 'organization', 'street-address', 'shipping', 'billing', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-extension', 'impp', 'url', 'photo', 'webauthn'] as const;\nexport type AutoCompleteType = (typeof AutoCompleteList)[number];\nexport type FormMessageProps = {\n /**\n * Change the variant of the label to float or hidden\n */\n variant?: LabelVariantType;\n /**\n * Text that appears in the form control when it has no value set\n */\n placeholder?: string;\n /**\n * Optional helper message for form components\n */\n message?: string;\n\n /**\n * Helper message for valid form components\n */\n validMessage?: string;\n\n /**\n * Helper message for invalid form components\n */\n invalidMessage?: string;\n\n /**\n * Set/overwrite icon for helper message for form components\n */\n messageIcon?: IconTypes;\n\n /**\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autocomplete?: string | AutoCompleteType;\n\n /**\n * Enables or disables the visibility of the message.\n */\n showMessage?: boolean | string;\n};\nexport type FromValidState = {\n hasValidState: () => boolean;\n handleValidation: () => void;\n _invalidMessage?: string;\n};\nexport type FormState = {\n _messageId?: string;\n _validMessageId?: string;\n _invalidMessageId?: string;\n _descByIds?: string;\n _value?: string;\n _invalidMessage?: string;\n /**\n * https://www.davidmacd.com/blog/test-aria-describedby-errormessage-aria-live.html\n * Currently VoiceOver isn't supporting changes from aria-describedby.\n * This is an internal Fallback\n */\n _voiceOverFallback?: string;\n};\nexport type InitializedState = {\n initialized: boolean;\n};\nexport const LinkCurrentList = ['time', 'true', 'false', 'date', 'page', 'step', 'location'] as const;\nexport type LinkCurrentType = (typeof LinkCurrentList)[number];\nexport const LinkTargetList = ['_self', '_blank', '_parent', '_top'] as const;\nexport type LinkTargetType = (typeof LinkTargetList)[number];\nexport const LinkReferrerPolicyList = ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'] as const;\nexport type LinkReferrerPolicyType = (typeof LinkReferrerPolicyList)[number];\nexport type LinkProps = {\n /**\n * Sets aria attribute based on [`aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current).\n */\n current?: boolean | LinkCurrentType;\n /**\n * Disables the link.\n */\n disabled?: boolean | string;\n /**\n * The [URL that the hyperlink points to](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).\n */\n href?: string;\n /**\n * Hints for the human [language of the linked page or document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).\n */\n hreflang?: string;\n /**\n * Sets aria attribute based on [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label).\n */\n label?: string;\n /**\n * Where to open the linked URL, as the name for a [browsing context](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).\n */\n target?: LinkTargetType;\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n rel?: string;\n /**\n * Sets aria role based on [`aria-role`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles).\n */\n role?: string;\n /**\n * How much of the referrer to send when following the link.\n */\n referrerpolicy?: LinkReferrerPolicyType;\n /**\n * Sets aria role based on [`aria-selected`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected).\n */\n selected?: boolean | string;\n};\nexport type TextProps = {\n /**\n * Alternative for default slot/children.\n */\n text?: string;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type ClickEvent<T> = MouseEvent;\nexport type ClickEventProps<T> = {\n /**\n * React specific onClick to pass to forward ref.\n */\n onClick?: (event: ClickEvent<T>) => void;\n};\nexport type ClickEventState<T> = {\n handleClick: (event: ClickEvent<T> | any) => void;\n};\nexport type ToggleEventProps = {\n toggle?: (open: boolean | any) => void;\n onToggle?: (open: boolean | any) => void;\n};\nexport type ToggleEventState<T> = {\n handleToggle: (event?: ClickEvent<T> | any) => void;\n};\nexport type CloseEventProps = {\n /**\n * Function to handle button click (close).\n */\n onClose?: (event?: any) => void;\n /**\n * Function to handle button click (close).\n */\n close?: (event?: any) => void;\n};\nexport type CloseEventState = {\n handleClose: (event: any) => void;\n};\nexport const AlignmentList = ['start', 'center'] as const;\nexport type AlignmentType = (typeof AlignmentList)[number];\nexport type AlignmentProps = {\n /**\n * Define the content alignment in full width\n */\n alignment?: AlignmentType | string;\n};\nexport type ActiveProps = {\n /**\n * If the tab is checked/active.\n */\n active?: boolean | string;\n};\nexport type InputEvent<T> = Event;\nexport type InputEventProps<T> = {\n input?: (event: InputEvent<T>) => void;\n onInput?: (event: InputEvent<T>) => void;\n};\nexport type InputEventState<T> = {\n handleInput: (event: InputEvent<T> | any) => void;\n};\nexport type ChangeEvent<T> = Event;\nexport type ChangeEventProps<T> = {\n change?: (event: ChangeEvent<T>) => void;\n onChange?: (event: ChangeEvent<T>) => void;\n};\nexport type ChangeEventState<T> = {\n handleChange: (event: ChangeEvent<T> | any) => void;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type InteractionEvent<T> = FocusEvent;\nexport type FocusEventProps<T> = {\n blur?: (event: InteractionEvent<T>) => void;\n onBlur?: (event: InteractionEvent<T>) => void;\n focus?: (event: InteractionEvent<T>) => void;\n onFocus?: (event: InteractionEvent<T>) => void;\n};\nexport type FocusEventState<T> = {\n handleBlur: (event: InteractionEvent<T> | any) => void;\n handleFocus: (event: InteractionEvent<T> | any) => void;\n};\nexport type InnerCloseButtonProps = {\n /**\n * The closeButtonId attribute changes the id inside the close button.\n */\n closeButtonId?: string;\n /**\n * The closeButtonText attribute changes the text inside the close button.\n */\n closeButtonText?: string;\n};\nexport type NavigationBackButtonProps = {\n /**\n * The backButtonId attribute changes the id inside the back button.\n */\n backButtonId?: string;\n /**\n * The backButtonText attribute changes the text inside the back button.\n */\n backButtonText?: string;\n};\nexport type AriaLabelledByProps = {\n /**\n * Pass aria-labelledby to inner element\n */\n labelledBy?: string;\n};\nexport type AriaControlsProps = {\n /**\n * Pass aria-controls to inner element\n */\n controls?: string;\n};\nexport type ValueLabelType = {\n value: string;\n label?: string;\n}"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { uuid } from "./index";
|
|
2
|
+
export class DocumentClickListener {
|
|
3
|
+
static runCallbacks(event) {
|
|
4
|
+
Object.values(DocumentClickListener.callbacks).forEach(callback => {
|
|
5
|
+
if (typeof callback === 'function') {
|
|
6
|
+
callback(event);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
constructor() {
|
|
11
|
+
if (DocumentClickListener._instance) {
|
|
12
|
+
return DocumentClickListener._instance;
|
|
13
|
+
}
|
|
14
|
+
DocumentClickListener._instance = this;
|
|
15
|
+
if (document) {
|
|
16
|
+
document.addEventListener('click', event => DocumentClickListener.runCallbacks(event));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
addCallback(callback) {
|
|
20
|
+
const callbackID = uuid();
|
|
21
|
+
DocumentClickListener.callbacks[callbackID] = callback;
|
|
22
|
+
return callbackID;
|
|
23
|
+
}
|
|
24
|
+
removeCallback(id) {
|
|
25
|
+
delete DocumentClickListener.callbacks[id];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
DocumentClickListener.callbacks = {};
|
|
29
|
+
DocumentClickListener._instance = null;
|
|
30
|
+
//# sourceMappingURL=document-click-listener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-click-listener.js","sourceRoot":"","sources":["../../src/utils/document-click-listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,MAAM,OAAO,qBAAqB;IAGxB,MAAM,CAAC,YAAY,CAAC,KAAU;QACpC,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAChE,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;gBACnC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACD;QACE,IAAI,qBAAqB,CAAC,SAAS,EAAE,CAAC;YACpC,OAAO,qBAAqB,CAAC,SAAS,CAAC;QACzC,CAAC;QACD,qBAAqB,CAAC,SAAS,GAAG,IAAI,CAAC;QACvC,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;IACM,WAAW,CAAC,QAA8B;QAC/C,MAAM,UAAU,GAAG,IAAI,EAAE,CAAC;QAC1B,qBAAqB,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;QACvD,OAAO,UAAU,CAAC;IACpB,CAAC;IACM,cAAc,CAAC,EAAU;QAC9B,OAAO,qBAAqB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC;;AAzBc,+BAAS,GAAyC,EAAE,CAAC;AACrD,+BAAS,GAAiC,IAAI,CAAC","sourcesContent":["import { uuid } from './index';\nexport class DocumentClickListener {\n private static callbacks: Record<string, (event: any) => void> = {};\n private static _instance: DocumentClickListener | null = null;\n private static runCallbacks(event: any) {\n Object.values(DocumentClickListener.callbacks).forEach(callback => {\n if (typeof callback === 'function') {\n callback(event);\n }\n });\n }\n constructor() {\n if (DocumentClickListener._instance) {\n return DocumentClickListener._instance;\n }\n DocumentClickListener._instance = this;\n if (document) {\n document.addEventListener('click', event => DocumentClickListener.runCallbacks(event));\n }\n }\n public addCallback(callback: (event: any) => void) {\n const callbackID = uuid();\n DocumentClickListener.callbacks[callbackID] = callback;\n return callbackID;\n }\n public removeCallback(id: string) {\n delete DocumentClickListener.callbacks[id];\n }\n}"]}
|
|
@@ -118,41 +118,41 @@ export const delay = (fn, ms) => new Promise(() => setTimeout(fn, ms));
|
|
|
118
118
|
*/
|
|
119
119
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
120
120
|
export const getBooleanAsString = (originBool) => {
|
|
121
|
-
if (originBool)
|
|
122
|
-
return
|
|
121
|
+
if (originBool === undefined || originBool === null)
|
|
122
|
+
return;
|
|
123
|
+
if (typeof originBool === 'string') {
|
|
124
|
+
return String(Boolean(originBool));
|
|
123
125
|
}
|
|
124
|
-
return originBool;
|
|
126
|
+
return String(originBool);
|
|
127
|
+
};
|
|
128
|
+
export const getBoolean = (originBool, propertyName) => {
|
|
129
|
+
if (originBool === undefined || originBool === null)
|
|
130
|
+
return;
|
|
131
|
+
if (typeof originBool === 'string' && propertyName) {
|
|
132
|
+
return Boolean(propertyName === originBool || originBool);
|
|
133
|
+
}
|
|
134
|
+
return Boolean(originBool);
|
|
135
|
+
};
|
|
136
|
+
export const getNumber = (originNumber, alternativeNumber) => {
|
|
137
|
+
if ((originNumber === undefined || originNumber === null) && (alternativeNumber === undefined || alternativeNumber === null)) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
return Number(originNumber !== null && originNumber !== void 0 ? originNumber : alternativeNumber);
|
|
125
141
|
};
|
|
126
142
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
127
143
|
export const getHideProp = (show) => {
|
|
128
144
|
if (show === undefined || show === null) {
|
|
129
145
|
return undefined;
|
|
130
146
|
}
|
|
131
|
-
return getBooleanAsString(!show);
|
|
147
|
+
return getBooleanAsString(!Boolean(show));
|
|
132
148
|
};
|
|
133
149
|
export const stringPropVisible = (givenString, showString) => {
|
|
134
150
|
if (showString === undefined) {
|
|
135
151
|
return !!givenString;
|
|
136
152
|
}
|
|
137
153
|
else {
|
|
138
|
-
return showString && givenString;
|
|
154
|
+
return Boolean(showString) && Boolean(givenString);
|
|
139
155
|
}
|
|
140
156
|
};
|
|
141
157
|
export const getSearchInput = (element) => element.querySelector(`input[type="search"]`);
|
|
142
|
-
export default {
|
|
143
|
-
getSearchInput,
|
|
144
|
-
cls,
|
|
145
|
-
addAttributeToChildren,
|
|
146
|
-
uuid,
|
|
147
|
-
visibleInVX,
|
|
148
|
-
visibleInVY,
|
|
149
|
-
isInView,
|
|
150
|
-
handleDataOutside,
|
|
151
|
-
isArrayOfStrings,
|
|
152
|
-
hasVoiceOver,
|
|
153
|
-
delay,
|
|
154
|
-
getBooleanAsString,
|
|
155
|
-
getHideProp,
|
|
156
|
-
stringPropVisible
|
|
157
|
-
};
|
|
158
158
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.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B;IAChB,YAAY;IACZ,KAAK;IACL,kBAAkB;IAClB,WAAW;IACX,iBAAiB;CAClB,CAAA","sourcesContent":["export const uuid = () => {\n if (typeof window !== 'undefined') {\n if (window.crypto?.randomUUID) {\n return window.crypto.randomUUID();\n } else if (window.crypto?.getRandomValues) {\n return window.crypto.getRandomValues(new Uint32Array(3)).join('-');\n }\n }\n return Math.random().toString().substring(2);\n};\nexport const addAttributeToChildren = (element: Element, attribute: {\n key: string;\n value: string;\n}) => {\n const children = element.children;\n Object.values(children).forEach((child: Element) => {\n child.setAttribute(attribute.key, attribute.value);\n if (child.children.length > 0) {\n addAttributeToChildren(child, attribute);\n }\n });\n};\nexport type ClassNameArg = string | {\n [key: string]: boolean | undefined;\n} | undefined;\nexport const cls = (...args: ClassNameArg[]) => {\n let result = '';\n for (const arg of args) {\n if (arg) {\n if (typeof arg === 'string') {\n result += `${arg} `;\n } else {\n for (const key in arg) {\n if (arg[key]) {\n result += `${key} `;\n }\n }\n }\n }\n }\n return result.trim();\n};\nexport const visibleInVX = (el: Element) => {\n const {\n left,\n right\n } = el.getBoundingClientRect();\n const {\n innerWidth\n } = window;\n return left >= 0 && right <= innerWidth;\n};\nexport const visibleInVY = (el: Element) => {\n const {\n top,\n bottom\n } = el.getBoundingClientRect();\n const {\n innerHeight\n } = window;\n return top >= 0 && bottom <= innerHeight;\n};\nexport const isInView = (el: Element) => {\n const {\n top,\n bottom,\n left,\n right\n } = el.getBoundingClientRect();\n const {\n innerHeight,\n innerWidth\n } = window;\n let outTop = top < 0;\n let outBottom = bottom > innerHeight;\n let outLeft = left < 0;\n let outRight = right > innerWidth;\n\n // We need to check if it was already outside\n const outsideY = el.hasAttribute('data-outside-vy');\n const outsideX = el.hasAttribute('data-outside-vx');\n const parentRect = el?.parentElement?.getBoundingClientRect();\n if (parentRect) {\n if (outsideY) {\n const position = el.getAttribute('data-outside-vy');\n if (position === 'top') {\n outTop = parentRect.top - (bottom - parentRect.bottom) < 0;\n } else {\n outBottom = parentRect.bottom + (parentRect.top - top) > innerHeight;\n }\n }\n if (outsideX) {\n const position = el.getAttribute('data-outside-vx');\n if (position === 'left') {\n outLeft = parentRect.left - (right - parentRect.right) < 0;\n } else {\n outRight = parentRect.right + (parentRect.left - left) > innerWidth;\n }\n }\n }\n return {\n outTop,\n outBottom,\n outLeft,\n outRight\n };\n};\nexport interface DBDataOutsidePair {\n vx?: 'left' | 'right';\n vy?: 'top' | 'bottom';\n}\nexport const handleDataOutside = (el: Element): DBDataOutsidePair => {\n const {\n outTop,\n outBottom,\n outLeft,\n outRight\n } = isInView(el);\n let dataOutsidePair: DBDataOutsidePair = {};\n if (outTop || outBottom) {\n dataOutsidePair = {\n vy: outTop ? 'top' : 'bottom'\n };\n el.setAttribute('data-outside-vy', dataOutsidePair.vy!);\n } else {\n el.removeAttribute('data-outside-vy');\n }\n if (outLeft || outRight) {\n dataOutsidePair = {\n ...dataOutsidePair,\n vx: outRight ? 'right' : 'left'\n };\n el.setAttribute('data-outside-vx', dataOutsidePair.vx!);\n } else {\n el.removeAttribute('data-outside-vx');\n }\n return dataOutsidePair;\n};\nexport const isArrayOfStrings = (value: unknown): value is string[] => Array.isArray(value) && value.every(item => typeof item === 'string');\nconst appleOs = ['Mac', 'iPhone', 'iPad', 'iPod'];\nexport const hasVoiceOver = (): boolean => typeof window !== 'undefined' && appleOs.some(os => window.navigator.userAgent.includes(os));\nexport const delay = (fn: () => void, ms: number) => new Promise(() => setTimeout(fn, ms));\n\n/**\n * Some frameworks like stencil would not add \"true\" as value for a prop\n * if it is used in a framework like angular e.g.: [disabled]=\"myDisabledProp\"\n * @param originBool Some boolean to convert to string\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getBooleanAsString = (originBool?: boolean): any => {\n if (originBool) {\n return String(originBool);\n }\n return originBool;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getHideProp = (show?: boolean): any => {\n if (show === undefined || show === null) {\n return undefined;\n }\n return getBooleanAsString(!show);\n};\nexport const stringPropVisible = (givenString?: string, showString?: boolean) => {\n if (showString === undefined) {\n return !!givenString;\n } else {\n return showString && givenString;\n }\n};\nexport const getSearchInput = (element: HTMLElement): HTMLInputElement | null => element.querySelector<HTMLInputElement>(`input[type=\"search\"]`);\nexport default {\n getSearchInput,\n cls,\n addAttributeToChildren,\n uuid,\n visibleInVX,\n visibleInVY,\n isInView,\n handleDataOutside,\n isArrayOfStrings,\n hasVoiceOver,\n delay,\n getBooleanAsString,\n getHideProp,\n stringPropVisible\n}"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE;;IACvB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,IAAI,MAAA,MAAM,CAAC,MAAM,0CAAE,UAAU,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACpC,CAAC;aAAM,IAAI,MAAA,MAAM,CAAC,MAAM,0CAAE,eAAe,EAAE,CAAC;YAC1C,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAgB,EAAE,SAGxD,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,KAAc,EAAE,EAAE;QACjD,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,CA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AO,OAAO,CAAC,YAAY,KAAK,UAAU,IAAI,UAAU,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;AAC7B,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,YAA8B,EAAE,iBAAmC,EAAsB,EAAE;IACnH,IAAI,CAAC,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,IAAI,CAAC,EAAE,CAAC;QAC7H,OAAO;IACT,CAAC;IACD,OAAO,MAAM,CAAC,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,iBAAiB,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAuB,EAAO,EAAE;IAC1D,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,kBAAkB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,WAAoB,EAAE,UAA6B,EAAE,EAAE;IACvF,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,CAAC,CAAC,WAAW,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC;AACH,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAoB,EAA2B,EAAE,CAAC,OAAO,CAAC,aAAa,CAAmB,sBAAsB,CAAC,CAAA","sourcesContent":["export const uuid = () => {\n if (typeof window !== 'undefined') {\n if (window.crypto?.randomUUID) {\n return window.crypto.randomUUID();\n } else if (window.crypto?.getRandomValues) {\n return window.crypto.getRandomValues(new Uint32Array(3)).join('-');\n }\n }\n return Math.random().toString().substring(2);\n};\nexport const addAttributeToChildren = (element: Element, attribute: {\n key: string;\n value: string;\n}) => {\n const children = element.children;\n Object.values(children).forEach((child: Element) => {\n child.setAttribute(attribute.key, attribute.value);\n if (child.children.length > 0) {\n addAttributeToChildren(child, attribute);\n }\n });\n};\nexport type ClassNameArg = string | {\n [key: string]: boolean | undefined;\n} | undefined;\nexport const cls = (...args: ClassNameArg[]) => {\n let result = '';\n for (const arg of args) {\n if (arg) {\n if (typeof arg === 'string') {\n result += `${arg} `;\n } else {\n for (const key in arg) {\n if (arg[key]) {\n result += `${key} `;\n }\n }\n }\n }\n }\n return result.trim();\n};\nexport const visibleInVX = (el: Element) => {\n const {\n left,\n right\n } = el.getBoundingClientRect();\n const {\n innerWidth\n } = window;\n return left >= 0 && right <= innerWidth;\n};\nexport const visibleInVY = (el: Element) => {\n const {\n top,\n bottom\n } = el.getBoundingClientRect();\n const {\n innerHeight\n } = window;\n return top >= 0 && bottom <= innerHeight;\n};\nexport const isInView = (el: Element) => {\n const {\n top,\n bottom,\n left,\n right\n } = el.getBoundingClientRect();\n const {\n innerHeight,\n innerWidth\n } = window;\n let outTop = top < 0;\n let outBottom = bottom > innerHeight;\n let outLeft = left < 0;\n let outRight = right > innerWidth;\n\n // We need to check if it was already outside\n const outsideY = el.hasAttribute('data-outside-vy');\n const outsideX = el.hasAttribute('data-outside-vx');\n const parentRect = el?.parentElement?.getBoundingClientRect();\n if (parentRect) {\n if (outsideY) {\n const position = el.getAttribute('data-outside-vy');\n if (position === 'top') {\n outTop = parentRect.top - (bottom - parentRect.bottom) < 0;\n } else {\n outBottom = parentRect.bottom + (parentRect.top - top) > innerHeight;\n }\n }\n if (outsideX) {\n const position = el.getAttribute('data-outside-vx');\n if (position === 'left') {\n outLeft = parentRect.left - (right - parentRect.right) < 0;\n } else {\n outRight = parentRect.right + (parentRect.left - left) > innerWidth;\n }\n }\n }\n return {\n outTop,\n outBottom,\n outLeft,\n outRight\n };\n};\nexport interface DBDataOutsidePair {\n vx?: 'left' | 'right';\n vy?: 'top' | 'bottom';\n}\nexport const handleDataOutside = (el: Element): DBDataOutsidePair => {\n const {\n outTop,\n outBottom,\n outLeft,\n outRight\n } = isInView(el);\n let dataOutsidePair: DBDataOutsidePair = {};\n if (outTop || outBottom) {\n dataOutsidePair = {\n vy: outTop ? 'top' : 'bottom'\n };\n el.setAttribute('data-outside-vy', dataOutsidePair.vy!);\n } else {\n el.removeAttribute('data-outside-vy');\n }\n if (outLeft || outRight) {\n dataOutsidePair = {\n ...dataOutsidePair,\n vx: outRight ? 'right' : 'left'\n };\n el.setAttribute('data-outside-vx', dataOutsidePair.vx!);\n } else {\n el.removeAttribute('data-outside-vx');\n }\n return dataOutsidePair;\n};\nexport const isArrayOfStrings = (value: unknown): value is string[] => Array.isArray(value) && value.every(item => typeof item === 'string');\nconst appleOs = ['Mac', 'iPhone', 'iPad', 'iPod'];\nexport const hasVoiceOver = (): boolean => typeof window !== 'undefined' && appleOs.some(os => window.navigator.userAgent.includes(os));\nexport const delay = (fn: () => void, ms: number) => new Promise(() => setTimeout(fn, ms));\n\n/**\n * Some frameworks like stencil would not add \"true\" as value for a prop\n * if it is used in a framework like angular e.g.: [disabled]=\"myDisabledProp\"\n * @param originBool Some boolean to convert to string\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getBooleanAsString = (originBool?: boolean | string): any => {\n if (originBool === undefined || originBool === null) return;\n if (typeof originBool === 'string') {\n return String(Boolean(originBool));\n }\n return String(originBool);\n};\nexport const getBoolean = (originBool?: boolean | string, propertyName?: string): boolean | undefined => {\n if (originBool === undefined || originBool === null) return;\n if (typeof originBool === 'string' && propertyName) {\n return Boolean(propertyName === originBool || originBool);\n }\n return Boolean(originBool);\n};\nexport const getNumber = (originNumber?: number | string, alternativeNumber?: number | string): number | undefined => {\n if ((originNumber === undefined || originNumber === null) && (alternativeNumber === undefined || alternativeNumber === null)) {\n return;\n }\n return Number(originNumber ?? alternativeNumber);\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getHideProp = (show?: boolean | string): any => {\n if (show === undefined || show === null) {\n return undefined;\n }\n return getBooleanAsString(!Boolean(show));\n};\nexport const stringPropVisible = (givenString?: string, showString?: boolean | string) => {\n if (showString === undefined) {\n return !!givenString;\n } else {\n return Boolean(showString) && Boolean(givenString);\n }\n};\nexport const getSearchInput = (element: HTMLElement): HTMLInputElement | null => element.querySelector<HTMLInputElement>(`input[type=\"search\"]`)"]}
|