@duetds/components 8.5.5 → 8.6.1
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/hydrate/index.js +315 -273
- package/lib/cjs/duet-action-button.cjs.entry.js +5 -6
- package/lib/cjs/duet-alert.cjs.entry.js +1 -1
- package/lib/cjs/duet-banner.cjs.entry.js +1 -1
- package/lib/cjs/duet-callout.cjs.entry.js +1 -1
- package/lib/cjs/duet-chip.cjs.entry.js +9 -2
- package/lib/cjs/duet-choice_2.cjs.entry.js +8 -1
- package/lib/cjs/duet-collapsible.cjs.entry.js +1 -1
- package/lib/cjs/duet-combobox.cjs.entry.js +260 -127
- package/lib/cjs/duet-date-picker.cjs.entry.js +1 -1
- package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
- package/lib/cjs/duet-hero.cjs.entry.js +1 -1
- package/lib/cjs/duet-input_2.cjs.entry.js +39 -3
- package/lib/cjs/duet-menu-bar-button.cjs.entry.js +2 -34
- package/lib/cjs/duet-menu-bar-dropdown.cjs.entry.js +2 -37
- package/lib/cjs/duet-menu-bar-link.cjs.entry.js +2 -37
- package/lib/cjs/duet-modal.cjs.entry.js +1 -1
- package/lib/cjs/duet-multiselect.cjs.entry.js +1 -1
- package/lib/cjs/duet-number-input.cjs.entry.js +1 -1
- package/lib/cjs/duet-promo-card.cjs.entry.js +1 -1
- package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-scrollable_3.cjs.entry.js +1 -1
- package/lib/cjs/duet-select.cjs.entry.js +1 -1
- package/lib/cjs/duet-slideout-panel.cjs.entry.js +1 -1
- package/lib/cjs/duet-slideout.cjs.entry.js +1 -1
- package/lib/cjs/duet-submenu-bar-dropdown.cjs.entry.js +2 -5
- package/lib/cjs/duet-submenu-bar-link.cjs.entry.js +2 -37
- package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +1 -1
- package/lib/cjs/loader.cjs.js +1 -1
- package/lib/cjs/{slot-utils-f5073417.js → slot-utils-03a40c78.js} +3 -1
- package/lib/collection/components/duet-action-button/duet-action-button.js +6 -8
- package/lib/collection/components/duet-chip/duet-chip.css +7 -0
- package/lib/collection/components/duet-chip/duet-chip.js +29 -2
- package/lib/collection/components/duet-choice-group/duet-choice-group.e2e.js +15 -0
- package/lib/collection/components/duet-choice-group/duet-choice-group.js +31 -0
- package/lib/collection/components/duet-combobox/duet-combobox-select-single.js +2 -2
- package/lib/collection/components/duet-combobox/duet-combobox.css +10 -2
- package/lib/collection/components/duet-combobox/duet-combobox.e2e.js +81 -51
- package/lib/collection/components/duet-combobox/duet-combobox.js +321 -142
- package/lib/collection/components/duet-input/duet-input.css +29 -0
- package/lib/collection/components/duet-input/duet-input.js +159 -3
- package/lib/collection/components/duet-menu-bar-button/duet-menu-bar-button.css +10 -0
- package/lib/collection/components/duet-menu-bar-button/duet-menu-bar-button.js +1 -38
- package/lib/collection/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.css +10 -0
- package/lib/collection/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.js +1 -41
- package/lib/collection/components/duet-menu-bar-link/duet-menu-bar-link.css +10 -0
- package/lib/collection/components/duet-menu-bar-link/duet-menu-bar-link.js +1 -41
- package/lib/collection/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.css +10 -0
- package/lib/collection/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.js +2 -6
- package/lib/collection/components/duet-submenu-bar-link/duet-submenu-bar-link.css +10 -0
- package/lib/collection/components/duet-submenu-bar-link/duet-submenu-bar-link.js +1 -41
- package/lib/collection/utils/slot-utils.js +3 -1
- package/lib/dist-custom-elements/duet-action-button.js +1 -1
- package/lib/dist-custom-elements/duet-alert.js +1 -1
- package/lib/dist-custom-elements/duet-banner.js +1 -1
- package/lib/dist-custom-elements/duet-breadcrumb.js +1 -1
- package/lib/dist-custom-elements/duet-callout.js +1 -1
- package/lib/dist-custom-elements/duet-card.js +1 -1
- package/lib/dist-custom-elements/duet-chip.js +1 -273
- package/lib/dist-custom-elements/duet-choice-group.js +14 -6
- package/lib/dist-custom-elements/duet-choice.js +2 -2
- package/lib/dist-custom-elements/duet-collapsible.js +2 -2
- package/lib/dist-custom-elements/duet-combobox.js +326 -132
- package/lib/dist-custom-elements/duet-cookie-consent.js +1 -1
- package/lib/dist-custom-elements/duet-date-picker.js +6 -6
- package/lib/dist-custom-elements/duet-editable-table.js +2 -2
- package/lib/dist-custom-elements/duet-fieldset.js +1 -1
- package/lib/dist-custom-elements/duet-footer.js +1 -1
- package/lib/dist-custom-elements/duet-header.js +1 -1
- package/lib/dist-custom-elements/duet-hero.js +1 -1
- package/lib/dist-custom-elements/duet-input.js +1 -1
- package/lib/dist-custom-elements/duet-menu-bar-button.js +2 -35
- package/lib/dist-custom-elements/duet-menu-bar-dropdown-link.js +1 -1
- package/lib/dist-custom-elements/duet-menu-bar-dropdown.js +3 -39
- package/lib/dist-custom-elements/duet-menu-bar-link.js +3 -39
- package/lib/dist-custom-elements/duet-modal.js +2 -2
- package/lib/dist-custom-elements/duet-multiselect.js +5 -5
- package/lib/dist-custom-elements/duet-notification-drawer.js +1 -1
- package/lib/dist-custom-elements/duet-notification.js +1 -1
- package/lib/dist-custom-elements/duet-number-input.js +6 -6
- package/lib/dist-custom-elements/duet-pagination.js +6 -6
- package/lib/dist-custom-elements/duet-popup-menu.js +1 -1
- package/lib/dist-custom-elements/duet-promo-card.js +1 -1
- package/lib/dist-custom-elements/duet-radio-group.js +5 -5
- package/lib/dist-custom-elements/duet-range-slider.js +1 -1
- package/lib/dist-custom-elements/duet-range-stepper.js +2 -2
- package/lib/dist-custom-elements/duet-scrollable.js +1 -1
- package/lib/dist-custom-elements/duet-select.js +1 -1
- package/lib/dist-custom-elements/duet-show-more.js +1 -1
- package/lib/dist-custom-elements/duet-slideout-panel.js +1 -1
- package/lib/dist-custom-elements/duet-slideout.js +2 -2
- package/lib/dist-custom-elements/duet-step.js +1 -1
- package/lib/dist-custom-elements/duet-submenu-bar-dropdown-link.js +1 -1
- package/lib/dist-custom-elements/duet-submenu-bar-dropdown.js +3 -7
- package/lib/dist-custom-elements/duet-submenu-bar-item.js +1 -1
- package/lib/dist-custom-elements/duet-submenu-bar-link.js +4 -40
- package/lib/dist-custom-elements/duet-tab-group.js +6 -6
- package/lib/dist-custom-elements/duet-tab.js +1 -1
- package/lib/dist-custom-elements/duet-textarea.js +4 -4
- package/lib/dist-custom-elements/duet-toggle.js +1 -1
- package/lib/dist-custom-elements/duet-toolbar-dropdown-link.js +1 -1
- package/lib/dist-custom-elements/duet-toolbar-dropdown.js +1 -1
- package/lib/dist-custom-elements/duet-tooltip-button.js +1 -1
- package/lib/dist-custom-elements/duet-tooltip-popup.js +1 -1
- package/lib/dist-custom-elements/duet-tooltip.js +1 -1
- package/lib/dist-custom-elements/duet-tray.js +1 -1
- package/lib/dist-custom-elements/duet-upload-item.js +1 -1
- package/lib/dist-custom-elements/duet-upload.js +5 -5
- package/lib/dist-custom-elements/{p-cff358b0.js → p-014c1177.js} +49 -8
- package/lib/dist-custom-elements/{p-d87f6dd5.js → p-06e608ae.js} +3 -1
- package/lib/dist-custom-elements/{p-9cdbc360.js → p-0cee8a12.js} +1 -1
- package/lib/dist-custom-elements/{p-9a833e56.js → p-28ec3461.js} +1 -1
- package/lib/dist-custom-elements/{p-d191ba9e.js → p-45fd4d84.js} +1 -1
- package/lib/dist-custom-elements/{p-89d58b60.js → p-6d366100.js} +3 -3
- package/lib/dist-custom-elements/p-755dd68f.js +285 -0
- package/lib/dist-custom-elements/{p-e44c0eff.js → p-785686e3.js} +1 -1
- package/lib/dist-custom-elements/{p-e00d43f3.js → p-92a16064.js} +1 -1
- package/lib/dist-custom-elements/{p-f9f9e33d.js → p-a02e62f3.js} +3 -3
- package/lib/dist-custom-elements/{p-0d5c0a22.js → p-c8415e2f.js} +1 -1
- package/lib/dist-custom-elements/{p-12a0876b.js → p-cb694530.js} +1 -1
- package/lib/dist-custom-elements/{p-d848b48d.js → p-e702eb52.js} +4 -4
- package/lib/dist-custom-elements/{p-c3d02eb2.js → p-f4ac6968.js} +6 -7
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/{p-88a46585.system.entry.js → p-061f4be0.system.entry.js} +1 -1
- package/lib/duet/p-06e608ae.js +4 -0
- package/lib/duet/{p-8ca813cb.system.entry.js → p-0778ccde.system.entry.js} +1 -1
- package/lib/duet/p-07ac7f3e.system.entry.js +4 -0
- package/lib/duet/p-15e24bf0.entry.js +4 -0
- package/lib/duet/{p-0dac34a4.system.entry.js → p-1ef0e5ca.system.entry.js} +1 -1
- package/lib/duet/{p-c9781f22.entry.js → p-2084a65f.entry.js} +1 -1
- package/lib/duet/{p-fd0bb0bf.entry.js → p-23cecf9f.entry.js} +1 -1
- package/lib/duet/p-25048bf8.system.entry.js +4 -0
- package/lib/duet/{p-09e4195f.system.entry.js → p-257800b7.system.entry.js} +1 -1
- package/lib/duet/{p-892a5644.system.entry.js → p-27363096.system.entry.js} +1 -1
- package/lib/duet/{p-1afd901a.entry.js → p-29491f9f.entry.js} +1 -1
- package/lib/duet/{p-3b5ff822.entry.js → p-3302d75d.entry.js} +1 -1
- package/lib/duet/{p-7629cd0a.entry.js → p-40375e30.entry.js} +1 -1
- package/lib/duet/{p-480f37b6.entry.js → p-436fcaf7.entry.js} +1 -1
- package/lib/duet/{p-ba4445cf.system.entry.js → p-45bb3cd0.system.entry.js} +1 -1
- package/lib/duet/p-4781cd58.entry.js +4 -0
- package/lib/duet/p-4cb5943c.entry.js +4 -0
- package/lib/duet/{p-b2f2992f.system.entry.js → p-4de910bd.system.entry.js} +1 -1
- package/lib/duet/p-51e3af7b.system.entry.js +4 -0
- package/lib/duet/p-6151635f.system.js +1 -1
- package/lib/duet/{p-d349dd93.entry.js → p-67382632.entry.js} +1 -1
- package/lib/duet/p-70b705ad.entry.js +4 -0
- package/lib/duet/{p-699a98b4.entry.js → p-76e54ff5.entry.js} +1 -1
- package/lib/duet/{p-4d2ef0e2.entry.js → p-7a161455.entry.js} +1 -1
- package/lib/duet/{p-3d38079c.entry.js → p-7ca15c93.entry.js} +1 -1
- package/lib/duet/{p-bb09fff0.system.entry.js → p-7de614df.system.entry.js} +1 -1
- package/lib/duet/p-82d1fd63.system.entry.js +4 -0
- package/lib/duet/{p-7c1db591.system.entry.js → p-8a4ba903.system.entry.js} +1 -1
- package/lib/duet/{p-4f32a7ee.entry.js → p-8ba91848.entry.js} +1 -1
- package/lib/duet/p-9065a864.entry.js +4 -0
- package/lib/duet/{p-708359ec.system.entry.js → p-999fff8d.system.entry.js} +1 -1
- package/lib/duet/p-9ac25886.system.entry.js +4 -0
- package/lib/duet/{p-9d91a1dd.system.entry.js → p-9e75e5d8.system.entry.js} +1 -1
- package/lib/duet/{p-343d037e.entry.js → p-a3afb1af.entry.js} +1 -1
- package/lib/duet/{p-2ca6a8a0.system.entry.js → p-a3e90064.system.entry.js} +1 -1
- package/lib/duet/{p-cd87960a.system.entry.js → p-a659cdb5.system.entry.js} +1 -1
- package/lib/duet/p-ae21ad57.system.js +4 -0
- package/lib/duet/p-b02ca265.entry.js +4 -0
- package/lib/duet/{p-ce05fe6d.system.entry.js → p-b2fc4b72.system.entry.js} +1 -1
- package/lib/duet/{p-84778369.entry.js → p-b5595969.entry.js} +1 -1
- package/lib/duet/p-c12d34fd.system.entry.js +4 -0
- package/lib/duet/{p-bf51f8a5.system.entry.js → p-c68602c9.system.entry.js} +1 -1
- package/lib/duet/p-c776e072.entry.js +4 -0
- package/lib/duet/p-d1d79e0c.entry.js +4 -0
- package/lib/duet/{p-f6530332.system.entry.js → p-d5721f0d.system.entry.js} +1 -1
- package/lib/duet/{p-c00fe4ed.entry.js → p-dc133655.entry.js} +1 -1
- package/lib/duet/p-de5054b6.system.entry.js +4 -0
- package/lib/duet/{p-61feb701.entry.js → p-df345202.entry.js} +1 -1
- package/lib/duet/{p-2628a322.entry.js → p-e0907f29.entry.js} +1 -1
- package/lib/duet/p-e333b9fc.system.entry.js +4 -0
- package/lib/duet/p-e411627f.entry.js +4 -0
- package/lib/duet/{p-da51c71f.system.entry.js → p-eafed149.system.entry.js} +1 -1
- package/lib/duet/p-f2279e1e.entry.js +4 -0
- package/lib/duet/{p-b1ab1664.system.entry.js → p-fa311641.system.entry.js} +1 -1
- package/lib/duet/{p-320318de.system.entry.js → p-fa72c79b.system.entry.js} +1 -1
- package/lib/duet/p-ffab115e.entry.js +4 -0
- package/lib/esm/duet-action-button.entry.js +5 -6
- package/lib/esm/duet-alert.entry.js +1 -1
- package/lib/esm/duet-banner.entry.js +1 -1
- package/lib/esm/duet-callout.entry.js +1 -1
- package/lib/esm/duet-chip.entry.js +9 -2
- package/lib/esm/duet-choice_2.entry.js +8 -1
- package/lib/esm/duet-collapsible.entry.js +1 -1
- package/lib/esm/duet-combobox.entry.js +261 -128
- package/lib/esm/duet-date-picker.entry.js +1 -1
- package/lib/esm/duet-fieldset.entry.js +1 -1
- package/lib/esm/duet-hero.entry.js +1 -1
- package/lib/esm/duet-input_2.entry.js +39 -3
- package/lib/esm/duet-menu-bar-button.entry.js +2 -34
- package/lib/esm/duet-menu-bar-dropdown.entry.js +2 -37
- package/lib/esm/duet-menu-bar-link.entry.js +2 -37
- package/lib/esm/duet-modal.entry.js +1 -1
- package/lib/esm/duet-multiselect.entry.js +1 -1
- package/lib/esm/duet-number-input.entry.js +1 -1
- package/lib/esm/duet-promo-card.entry.js +1 -1
- package/lib/esm/duet-radio_2.entry.js +1 -1
- package/lib/esm/duet-scrollable_3.entry.js +1 -1
- package/lib/esm/duet-select.entry.js +1 -1
- package/lib/esm/duet-slideout-panel.entry.js +1 -1
- package/lib/esm/duet-slideout.entry.js +1 -1
- package/lib/esm/duet-submenu-bar-dropdown.entry.js +2 -5
- package/lib/esm/duet-submenu-bar-link.entry.js +2 -37
- package/lib/esm/duet-textarea.entry.js +1 -1
- package/lib/esm/duet.js +1 -1
- package/lib/esm/loader.js +1 -1
- package/lib/esm/{slot-utils-1115a819.js → slot-utils-b50aaef5.js} +3 -1
- package/lib/esm-es5/duet-action-button.entry.js +1 -1
- package/lib/esm-es5/duet-alert.entry.js +1 -1
- package/lib/esm-es5/duet-banner.entry.js +1 -1
- package/lib/esm-es5/duet-callout.entry.js +1 -1
- package/lib/esm-es5/duet-chip.entry.js +1 -1
- package/lib/esm-es5/duet-choice_2.entry.js +1 -1
- package/lib/esm-es5/duet-collapsible.entry.js +1 -1
- package/lib/esm-es5/duet-combobox.entry.js +2 -2
- package/lib/esm-es5/duet-date-picker.entry.js +1 -1
- package/lib/esm-es5/duet-fieldset.entry.js +1 -1
- package/lib/esm-es5/duet-hero.entry.js +1 -1
- package/lib/esm-es5/duet-input_2.entry.js +2 -2
- package/lib/esm-es5/duet-menu-bar-button.entry.js +1 -1
- package/lib/esm-es5/duet-menu-bar-dropdown.entry.js +2 -2
- package/lib/esm-es5/duet-menu-bar-link.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +1 -1
- package/lib/esm-es5/duet-multiselect.entry.js +1 -1
- package/lib/esm-es5/duet-number-input.entry.js +2 -2
- package/lib/esm-es5/duet-promo-card.entry.js +2 -2
- package/lib/esm-es5/duet-radio_2.entry.js +1 -1
- package/lib/esm-es5/duet-scrollable_3.entry.js +1 -1
- package/lib/esm-es5/duet-select.entry.js +1 -1
- package/lib/esm-es5/duet-slideout-panel.entry.js +1 -1
- package/lib/esm-es5/duet-slideout.entry.js +1 -1
- package/lib/esm-es5/duet-submenu-bar-dropdown.entry.js +2 -2
- package/lib/esm-es5/duet-submenu-bar-link.entry.js +1 -1
- package/lib/esm-es5/duet-textarea.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/slot-utils-b50aaef5.js +4 -0
- package/lib/types/components/duet-chip/duet-chip.d.ts +4 -0
- package/lib/types/components/duet-choice-group/duet-choice-group.d.ts +5 -0
- package/lib/types/components/duet-combobox/duet-combobox.d.ts +49 -35
- package/lib/types/components/duet-input/duet-input.d.ts +30 -0
- package/lib/types/components/duet-menu-bar-button/duet-menu-bar-button.d.ts +1 -7
- package/lib/types/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.d.ts +1 -7
- package/lib/types/components/duet-menu-bar-link/duet-menu-bar-link.d.ts +1 -10
- package/lib/types/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.d.ts +1 -2
- package/lib/types/components/duet-submenu-bar-link/duet-submenu-bar-link.d.ts +1 -10
- package/lib/types/components.d.ts +45 -21
- package/package.json +2 -2
- package/lib/duet/p-0de8d0c0.system.entry.js +0 -4
- package/lib/duet/p-3f2d14e3.system.entry.js +0 -4
- package/lib/duet/p-7cf03aa8.system.js +0 -4
- package/lib/duet/p-8cc30578.entry.js +0 -4
- package/lib/duet/p-92e1181c.entry.js +0 -4
- package/lib/duet/p-9735b2f9.entry.js +0 -4
- package/lib/duet/p-985c0c67.system.entry.js +0 -4
- package/lib/duet/p-9be9b4d2.entry.js +0 -4
- package/lib/duet/p-9d27bc65.entry.js +0 -4
- package/lib/duet/p-afe29a3e.entry.js +0 -4
- package/lib/duet/p-bece15cd.system.entry.js +0 -4
- package/lib/duet/p-cba00852.entry.js +0 -4
- package/lib/duet/p-cc4a8964.entry.js +0 -4
- package/lib/duet/p-cc949a27.entry.js +0 -4
- package/lib/duet/p-d50ad3ed.entry.js +0 -4
- package/lib/duet/p-d87f6dd5.js +0 -4
- package/lib/duet/p-e614e39f.system.entry.js +0 -4
- package/lib/duet/p-e7fd0d14.entry.js +0 -4
- package/lib/duet/p-e86cafa6.system.entry.js +0 -4
- package/lib/duet/p-f1b01db9.system.entry.js +0 -4
- package/lib/duet/p-fa21a3b6.system.entry.js +0 -4
- package/lib/esm-es5/slot-utils-1115a819.js +0 -4
|
@@ -190,6 +190,9 @@ duet-caption:not(:last-of-type) {
|
|
|
190
190
|
.duet-input.is-date {
|
|
191
191
|
padding-right: 64px !important;
|
|
192
192
|
}
|
|
193
|
+
.duet-input.after-chip {
|
|
194
|
+
padding-left: 8px !important;
|
|
195
|
+
}
|
|
193
196
|
.has-error .duet-input {
|
|
194
197
|
border-color: rgb(222, 35, 98) !important;
|
|
195
198
|
}
|
|
@@ -446,4 +449,30 @@ duet-caption:not(:last-of-type) {
|
|
|
446
449
|
}
|
|
447
450
|
.duet-input-variation-revealable.duet-theme-turva.has-error:hover:not(.disabled) .duet-input-relative {
|
|
448
451
|
box-shadow: 0 0 0 1px #e55039;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.duet-input-container.has-chips .duet-input-relative {
|
|
455
|
+
display: flex;
|
|
456
|
+
flex-direction: row;
|
|
457
|
+
flex-wrap: wrap;
|
|
458
|
+
align-content: center;
|
|
459
|
+
align-items: center;
|
|
460
|
+
justify-content: flex-start;
|
|
461
|
+
width: auto;
|
|
462
|
+
border: 1px solid rgb(144, 149, 153);
|
|
463
|
+
border-radius: 4px;
|
|
464
|
+
box-shadow: initial;
|
|
465
|
+
transition: box-shadow 150ms ease, border 150ms ease;
|
|
466
|
+
}
|
|
467
|
+
.duet-theme-turva .duet-input-container.has-chips .duet-input-relative {
|
|
468
|
+
border-color: rgb(116, 116, 117);
|
|
469
|
+
}
|
|
470
|
+
.duet-input-container.has-chips .duet-input-relative .duet-input {
|
|
471
|
+
flex-basis: 4rem;
|
|
472
|
+
flex-grow: 1;
|
|
473
|
+
border-width: 0 !important;
|
|
474
|
+
}
|
|
475
|
+
.duet-input-container.has-chips .duet-input-relative .duet-input:focus, .duet-input-container.has-chips .duet-input-relative .duet-input:hover {
|
|
476
|
+
border-width: 0 !important;
|
|
477
|
+
box-shadow: none !important;
|
|
449
478
|
}
|
|
@@ -173,6 +173,7 @@ export class DuetInput {
|
|
|
173
173
|
this.required = false;
|
|
174
174
|
this.type = "text";
|
|
175
175
|
this.variation = "default";
|
|
176
|
+
this.chips = false;
|
|
176
177
|
this.label = "Label";
|
|
177
178
|
this.labelColor = undefined;
|
|
178
179
|
this.labelWeight = undefined;
|
|
@@ -201,7 +202,7 @@ export class DuetInput {
|
|
|
201
202
|
if (((_a = this === null || this === void 0 ? void 0 : this.nativeInput) === null || _a === void 0 ? void 0 : _a.value) !== this.value) {
|
|
202
203
|
const restoreCursor = resetCursor(this.nativeInput);
|
|
203
204
|
this.nativeInput.value = this.value;
|
|
204
|
-
// restore selection position after having set
|
|
205
|
+
// restore selection position after having set valuea
|
|
205
206
|
// (in webkit based browsers settings value trigger cursor position and will set it to EndOfText)
|
|
206
207
|
restoreCursor();
|
|
207
208
|
}
|
|
@@ -271,6 +272,39 @@ export class DuetInput {
|
|
|
271
272
|
this.value = "";
|
|
272
273
|
}
|
|
273
274
|
}
|
|
275
|
+
getAllChips() {
|
|
276
|
+
return Array.from(this.element.querySelectorAll(".duet-input-relative duet-chip"));
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* @internal
|
|
280
|
+
* Add a chip to the input
|
|
281
|
+
*/
|
|
282
|
+
async addChip(chip) {
|
|
283
|
+
const container = this.element.querySelector(".duet-input-relative");
|
|
284
|
+
const input = container.querySelector("input");
|
|
285
|
+
container.insertBefore(chip, input);
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* @internal
|
|
289
|
+
* Does the input have a chip with the given value and text
|
|
290
|
+
*/
|
|
291
|
+
async hasChip({ value, text }) {
|
|
292
|
+
return this.getAllChips().some(chip => chip.value === value && chip.textContent === text);
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* @internal
|
|
296
|
+
* Get all chips from the input
|
|
297
|
+
*/
|
|
298
|
+
async getChips() {
|
|
299
|
+
return this.getAllChips();
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* @internal
|
|
303
|
+
* Remove all chips from the input
|
|
304
|
+
*/
|
|
305
|
+
async clearChips() {
|
|
306
|
+
this.getAllChips().forEach(chip => chip.remove());
|
|
307
|
+
}
|
|
274
308
|
/**
|
|
275
309
|
* render() function
|
|
276
310
|
* Always the last one in the class.
|
|
@@ -317,6 +351,7 @@ export class DuetInput {
|
|
|
317
351
|
(!!this.icon ||
|
|
318
352
|
(this.type !== "text" && this.type !== "tel" && this.type !== "password" && this.type !== "time")),
|
|
319
353
|
"has-error": !!this.error,
|
|
354
|
+
"has-chips": this.chips,
|
|
320
355
|
"has-clear": this.clear,
|
|
321
356
|
"has-focus": this.isFocused,
|
|
322
357
|
disabled: this.disabled,
|
|
@@ -325,6 +360,7 @@ export class DuetInput {
|
|
|
325
360
|
disabled: this.disabled,
|
|
326
361
|
"is-number": this.component === "number",
|
|
327
362
|
"is-date": this.component === "date",
|
|
363
|
+
"after-chip": this.getAllChips().length > 0,
|
|
328
364
|
}, value: this.value, disabled: this.disabled, "aria-invalid": this.error ? "true" : "false", "aria-labelledby": this.accessibleLabelledBy ? `${this.labelId} ${this.accessibleLabelledBy}` : this.labelId, "aria-controls": this.accessibleControls, "aria-autocomplete": this.accessibleAutocomplete, "aria-activedescendant": this.accessibleActiveDescendant, "aria-details": this.accessibleDetails, "aria-description": this.accessibleDescription, "aria-expanded": this.accessibleExpanded, "aria-haspopup": this.accessibleHasPopup, "aria-owns": this.accessibleOwns, "aria-describedby": this.getDescribedBy(), placeholder: this.placeholder, spellcheck: "false", minlength: this.minlength, maxlength: this.maxlength, autocomplete: this.type === "password" ? "off" : this.autoComplete, required: this.required, role: this.role, name: this.name, id: identifier }, inputProps)), !this.value && hasInputIcon && (h("div", { class: "duet-input-icon" }, h("duet-icon", { margin: "none", size: "small", icon: icons[this.type].svg, color: "currentColor" }))), this.clear && this.value && (h("div", { class: {
|
|
329
365
|
"duet-input-clear-icon": true,
|
|
330
366
|
"duet-input-clear-icon-single": !hasInputIcon,
|
|
@@ -781,6 +817,27 @@ export class DuetInput {
|
|
|
781
817
|
"reflect": false,
|
|
782
818
|
"defaultValue": "\"default\""
|
|
783
819
|
},
|
|
820
|
+
"chips": {
|
|
821
|
+
"type": "boolean",
|
|
822
|
+
"mutable": false,
|
|
823
|
+
"complexType": {
|
|
824
|
+
"original": "boolean",
|
|
825
|
+
"resolved": "boolean",
|
|
826
|
+
"references": {}
|
|
827
|
+
},
|
|
828
|
+
"required": false,
|
|
829
|
+
"optional": false,
|
|
830
|
+
"docs": {
|
|
831
|
+
"tags": [{
|
|
832
|
+
"name": "internal",
|
|
833
|
+
"text": "Render a container for chips"
|
|
834
|
+
}],
|
|
835
|
+
"text": ""
|
|
836
|
+
},
|
|
837
|
+
"attribute": "chips",
|
|
838
|
+
"reflect": false,
|
|
839
|
+
"defaultValue": "false"
|
|
840
|
+
},
|
|
784
841
|
"label": {
|
|
785
842
|
"type": "string",
|
|
786
843
|
"mutable": true,
|
|
@@ -995,8 +1052,11 @@ export class DuetInput {
|
|
|
995
1052
|
"required": false,
|
|
996
1053
|
"optional": false,
|
|
997
1054
|
"docs": {
|
|
998
|
-
"tags": [
|
|
999
|
-
|
|
1055
|
+
"tags": [{
|
|
1056
|
+
"name": "internal",
|
|
1057
|
+
"text": "Used internally in Duet to adjust whether this component acts as e.g. number input."
|
|
1058
|
+
}],
|
|
1059
|
+
"text": ""
|
|
1000
1060
|
},
|
|
1001
1061
|
"attribute": "component",
|
|
1002
1062
|
"reflect": false,
|
|
@@ -1314,6 +1374,102 @@ export class DuetInput {
|
|
|
1314
1374
|
"text": "Reset the cursor position on the native element\n`input.resetCursor()`.",
|
|
1315
1375
|
"tags": []
|
|
1316
1376
|
}
|
|
1377
|
+
},
|
|
1378
|
+
"addChip": {
|
|
1379
|
+
"complexType": {
|
|
1380
|
+
"signature": "(chip: HTMLDuetChipElement) => Promise<void>",
|
|
1381
|
+
"parameters": [{
|
|
1382
|
+
"name": "chip",
|
|
1383
|
+
"type": "HTMLDuetChipElement",
|
|
1384
|
+
"docs": ""
|
|
1385
|
+
}],
|
|
1386
|
+
"references": {
|
|
1387
|
+
"Promise": {
|
|
1388
|
+
"location": "global",
|
|
1389
|
+
"id": "global::Promise"
|
|
1390
|
+
},
|
|
1391
|
+
"HTMLDuetChipElement": {
|
|
1392
|
+
"location": "global",
|
|
1393
|
+
"id": "global::HTMLDuetChipElement"
|
|
1394
|
+
}
|
|
1395
|
+
},
|
|
1396
|
+
"return": "Promise<void>"
|
|
1397
|
+
},
|
|
1398
|
+
"docs": {
|
|
1399
|
+
"text": "",
|
|
1400
|
+
"tags": [{
|
|
1401
|
+
"name": "internal",
|
|
1402
|
+
"text": "Add a chip to the input"
|
|
1403
|
+
}]
|
|
1404
|
+
}
|
|
1405
|
+
},
|
|
1406
|
+
"hasChip": {
|
|
1407
|
+
"complexType": {
|
|
1408
|
+
"signature": "({ value, text }: { value: string; text: string; }) => Promise<boolean>",
|
|
1409
|
+
"parameters": [{
|
|
1410
|
+
"name": "__0",
|
|
1411
|
+
"type": "{ value: string; text: string; }",
|
|
1412
|
+
"docs": ""
|
|
1413
|
+
}],
|
|
1414
|
+
"references": {
|
|
1415
|
+
"Promise": {
|
|
1416
|
+
"location": "global",
|
|
1417
|
+
"id": "global::Promise"
|
|
1418
|
+
}
|
|
1419
|
+
},
|
|
1420
|
+
"return": "Promise<boolean>"
|
|
1421
|
+
},
|
|
1422
|
+
"docs": {
|
|
1423
|
+
"text": "",
|
|
1424
|
+
"tags": [{
|
|
1425
|
+
"name": "internal",
|
|
1426
|
+
"text": "Does the input have a chip with the given value and text"
|
|
1427
|
+
}]
|
|
1428
|
+
}
|
|
1429
|
+
},
|
|
1430
|
+
"getChips": {
|
|
1431
|
+
"complexType": {
|
|
1432
|
+
"signature": "() => Promise<HTMLDuetChipElement[]>",
|
|
1433
|
+
"parameters": [],
|
|
1434
|
+
"references": {
|
|
1435
|
+
"Promise": {
|
|
1436
|
+
"location": "global",
|
|
1437
|
+
"id": "global::Promise"
|
|
1438
|
+
},
|
|
1439
|
+
"HTMLDuetChipElement": {
|
|
1440
|
+
"location": "global",
|
|
1441
|
+
"id": "global::HTMLDuetChipElement"
|
|
1442
|
+
}
|
|
1443
|
+
},
|
|
1444
|
+
"return": "Promise<HTMLDuetChipElement[]>"
|
|
1445
|
+
},
|
|
1446
|
+
"docs": {
|
|
1447
|
+
"text": "",
|
|
1448
|
+
"tags": [{
|
|
1449
|
+
"name": "internal",
|
|
1450
|
+
"text": "Get all chips from the input"
|
|
1451
|
+
}]
|
|
1452
|
+
}
|
|
1453
|
+
},
|
|
1454
|
+
"clearChips": {
|
|
1455
|
+
"complexType": {
|
|
1456
|
+
"signature": "() => Promise<void>",
|
|
1457
|
+
"parameters": [],
|
|
1458
|
+
"references": {
|
|
1459
|
+
"Promise": {
|
|
1460
|
+
"location": "global",
|
|
1461
|
+
"id": "global::Promise"
|
|
1462
|
+
}
|
|
1463
|
+
},
|
|
1464
|
+
"return": "Promise<void>"
|
|
1465
|
+
},
|
|
1466
|
+
"docs": {
|
|
1467
|
+
"text": "",
|
|
1468
|
+
"tags": [{
|
|
1469
|
+
"name": "internal",
|
|
1470
|
+
"text": "Remove all chips from the input"
|
|
1471
|
+
}]
|
|
1472
|
+
}
|
|
1317
1473
|
}
|
|
1318
1474
|
};
|
|
1319
1475
|
}
|
|
@@ -45,6 +45,16 @@
|
|
|
45
45
|
.duet-theme-turva .duet-menu-bar-button:focus, .duet-menu-bar-button:focus.duet-theme-turva {
|
|
46
46
|
box-shadow: 0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a;
|
|
47
47
|
}
|
|
48
|
+
.duet-menu-bar-button .menu-bar-button-icon {
|
|
49
|
+
width: 20px;
|
|
50
|
+
height: 20px;
|
|
51
|
+
}
|
|
52
|
+
@media (min-width: 62em) {
|
|
53
|
+
.duet-menu-bar-button .menu-bar-button-icon {
|
|
54
|
+
width: 16px;
|
|
55
|
+
height: 16px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
48
58
|
.duet-menu-bar-button.duet-theme-turva {
|
|
49
59
|
font-family: "turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
50
60
|
}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { media_query_large } from "@duetds/tokens/lib/tokens.json";
|
|
5
4
|
import { h, Host } from "@stencil/core";
|
|
6
5
|
import { inheritGlobalTheme } from "../../common/themeable-component";
|
|
7
6
|
export class DuetMenuBarButton {
|
|
8
7
|
constructor() {
|
|
9
|
-
this.mql = [window.matchMedia(media_query_large.replace(/'/g, ""))];
|
|
10
|
-
this.boundMqlFunctions = [];
|
|
11
|
-
this.changeIconSize = () => {
|
|
12
|
-
if (this.mql[0].matches) {
|
|
13
|
-
this.iconSize = "x-small";
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
this.iconSize = "small";
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
this.iconSize = "x-small";
|
|
20
8
|
this.accessibleLabel = undefined;
|
|
21
9
|
this.accessibleControls = undefined;
|
|
22
10
|
this.accessiblePopup = "false";
|
|
@@ -37,26 +25,6 @@ export class DuetMenuBarButton {
|
|
|
37
25
|
componentWillLoad() {
|
|
38
26
|
inheritGlobalTheme(this);
|
|
39
27
|
}
|
|
40
|
-
connectedCallback() {
|
|
41
|
-
this.changeIconSize();
|
|
42
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
43
|
-
// addEventListener is not available in Stencil hydrate
|
|
44
|
-
if (this.mql[i].addEventListener) {
|
|
45
|
-
const bound = this.changeIconSize.bind(this);
|
|
46
|
-
this.mql[i].addEventListener("change", bound);
|
|
47
|
-
this.boundMqlFunctions[i] = bound;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
disconnectedCallback() {
|
|
52
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
53
|
-
// removeEventListener is not available in Stencil hydrate
|
|
54
|
-
if (this.mql[i].removeEventListener) {
|
|
55
|
-
this.mql[i].removeEventListener("change", this.boundMqlFunctions[i]);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
this.boundMqlFunctions = [];
|
|
59
|
-
}
|
|
60
28
|
/**
|
|
61
29
|
* Sets focus on underlying button element.
|
|
62
30
|
*/
|
|
@@ -73,7 +41,7 @@ export class DuetMenuBarButton {
|
|
|
73
41
|
return (h(Host, { role: "listitem", onfocus: () => this.setFocus() }, h("button", { ref: button => (this.nativeButton = button), class: {
|
|
74
42
|
"duet-menu-bar-button": true,
|
|
75
43
|
"duet-theme-turva": this.theme === "turva",
|
|
76
|
-
}, "aria-controls": this.accessibleControls, "aria-label": this.accessibleLabel, "aria-expanded": this.accessibleExpanded != null ? this.accessibleExpanded.toString() : undefined, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": this.accessibleDescribedBy, "aria-labelledby": this.accessibleLabelledBy, "aria-details": this.accessibleDetails, "aria-description": this.accessibleDescription, "aria-pressed": this.accessiblePressed != null ? this.accessiblePressed.toString() : undefined, "aria-haspopup": this.accessiblePopup != null ? this.accessiblePopup.toString() : undefined }, this.icon && (h("duet-icon", { theme: this.theme, size:
|
|
44
|
+
}, "aria-controls": this.accessibleControls, "aria-label": this.accessibleLabel, "aria-expanded": this.accessibleExpanded != null ? this.accessibleExpanded.toString() : undefined, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": this.accessibleDescribedBy, "aria-labelledby": this.accessibleLabelledBy, "aria-details": this.accessibleDetails, "aria-description": this.accessibleDescription, "aria-pressed": this.accessiblePressed != null ? this.accessiblePressed.toString() : undefined, "aria-haspopup": this.accessiblePopup != null ? this.accessiblePopup.toString() : undefined }, this.icon && (h("duet-icon", { class: "menu-bar-button-icon", theme: this.theme, size: "auto", name: this.icon, margin: "none", color: "currentColor" })), h("slot", null))));
|
|
77
45
|
}
|
|
78
46
|
static get is() { return "duet-menu-bar-button"; }
|
|
79
47
|
static get encapsulation() { return "shadow"; }
|
|
@@ -324,11 +292,6 @@ export class DuetMenuBarButton {
|
|
|
324
292
|
}
|
|
325
293
|
};
|
|
326
294
|
}
|
|
327
|
-
static get states() {
|
|
328
|
-
return {
|
|
329
|
-
"iconSize": {}
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
295
|
static get methods() {
|
|
333
296
|
return {
|
|
334
297
|
"setFocus": {
|
|
@@ -103,6 +103,16 @@
|
|
|
103
103
|
.duet-theme-turva .duet-menu-bar-dropdown button.active::after {
|
|
104
104
|
background: rgb(198, 12, 48);
|
|
105
105
|
}
|
|
106
|
+
.duet-menu-bar-dropdown .menu-bar-dropdown-icon {
|
|
107
|
+
width: 20px;
|
|
108
|
+
height: 20px;
|
|
109
|
+
}
|
|
110
|
+
@media (min-width: 62em) {
|
|
111
|
+
.duet-menu-bar-dropdown .menu-bar-dropdown-icon {
|
|
112
|
+
width: 16px;
|
|
113
|
+
height: 16px;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
106
116
|
.duet-menu-bar-dropdown .items {
|
|
107
117
|
position: absolute;
|
|
108
118
|
top: 70%;
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { media_query_large } from "@duetds/tokens/lib/tokens.json";
|
|
5
4
|
import { h, Host } from "@stencil/core";
|
|
6
5
|
import { inheritGlobalTheme } from "../../common/themeable-component";
|
|
7
6
|
import { isEscapeKey } from "../../utils/keyboard-utils";
|
|
8
7
|
export class DuetMenuBarDropdown {
|
|
9
8
|
constructor() {
|
|
10
|
-
/**
|
|
11
|
-
* Own Properties.
|
|
12
|
-
*/
|
|
13
|
-
this.mql = [window.matchMedia(media_query_large.replace(/'/g, ""))];
|
|
14
|
-
this.boundMqlFunctions = [];
|
|
15
|
-
this.changeIconSize = () => {
|
|
16
|
-
if (this.mql[0].matches) {
|
|
17
|
-
this.iconSize = "x-small";
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
this.iconSize = "small";
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
9
|
this.onClick = () => {
|
|
24
10
|
this.open = !this.open;
|
|
25
11
|
};
|
|
@@ -34,7 +20,6 @@ export class DuetMenuBarDropdown {
|
|
|
34
20
|
return "right";
|
|
35
21
|
}
|
|
36
22
|
};
|
|
37
|
-
this.iconSize = "x-small";
|
|
38
23
|
this.accessibleLabel = undefined;
|
|
39
24
|
this.theme = "";
|
|
40
25
|
this.open = false;
|
|
@@ -52,26 +37,6 @@ export class DuetMenuBarDropdown {
|
|
|
52
37
|
componentWillLoad() {
|
|
53
38
|
inheritGlobalTheme(this);
|
|
54
39
|
}
|
|
55
|
-
connectedCallback() {
|
|
56
|
-
this.changeIconSize();
|
|
57
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
58
|
-
// addEventListener is not available in Stencil hydrate
|
|
59
|
-
if (this.mql[i].addEventListener) {
|
|
60
|
-
const bound = this.changeIconSize.bind(this);
|
|
61
|
-
this.mql[i].addEventListener("change", bound);
|
|
62
|
-
this.boundMqlFunctions[i] = bound;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
disconnectedCallback() {
|
|
67
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
68
|
-
// removeEventListener is not available in Stencil hydrate
|
|
69
|
-
if (this.mql[i].removeEventListener) {
|
|
70
|
-
this.mql[i].removeEventListener("change", this.boundMqlFunctions[i]);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
this.boundMqlFunctions = [];
|
|
74
|
-
}
|
|
75
40
|
handleEscape(e) {
|
|
76
41
|
if (isEscapeKey(e)) {
|
|
77
42
|
this.open = false;
|
|
@@ -96,7 +61,7 @@ export class DuetMenuBarDropdown {
|
|
|
96
61
|
[`duet-menu-bar-dropdown--slot-${this.getVariant()}`]: true,
|
|
97
62
|
} }, h("button", { ref: element => (this.button = element), "aria-label": this.accessibleLabel, "aria-haspopup": "menu", "aria-controls": "menu", "aria-expanded": this.open ? "true" : "false", id: "button", type: "button", class: {
|
|
98
63
|
active: this.open,
|
|
99
|
-
}, onClick: this.onClick, onKeyUp: e => this.handleEscape(e) }, this.icon && (h("duet-icon", { theme: this.theme, name: this.icon, size:
|
|
64
|
+
}, onClick: this.onClick, onKeyUp: e => this.handleEscape(e) }, this.icon && (h("duet-icon", { class: "menu-bar-dropdown-icon", theme: this.theme, name: this.icon, size: "auto", margin: "none", color: "currentColor" })), h("div", { class: "label" }, h("slot", { name: "label" }), h("duet-icon", { class: "caret", theme: this.theme, name: "action-arrow-down-small", margin: "none", size: "xxx-small", color: "currentColor" }))), h("div", { tabindex: "-1", role: "menu", id: "menu", "aria-labelledby": "button", class: {
|
|
100
65
|
items: true,
|
|
101
66
|
hidden: !this.open,
|
|
102
67
|
} }, h("slot", null)))));
|
|
@@ -194,11 +159,6 @@ export class DuetMenuBarDropdown {
|
|
|
194
159
|
}
|
|
195
160
|
};
|
|
196
161
|
}
|
|
197
|
-
static get states() {
|
|
198
|
-
return {
|
|
199
|
-
"iconSize": {}
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
162
|
static get methods() {
|
|
203
163
|
return {
|
|
204
164
|
"setFocus": {
|
|
@@ -44,6 +44,16 @@
|
|
|
44
44
|
.duet-theme-turva .duet-menu-bar-link:focus, .duet-menu-bar-link:focus.duet-theme-turva {
|
|
45
45
|
box-shadow: 0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a;
|
|
46
46
|
}
|
|
47
|
+
.duet-menu-bar-link .menu-bar-link-icon {
|
|
48
|
+
width: 20px;
|
|
49
|
+
height: 20px;
|
|
50
|
+
}
|
|
51
|
+
@media (min-width: 62em) {
|
|
52
|
+
.duet-menu-bar-link .menu-bar-link-icon {
|
|
53
|
+
width: 16px;
|
|
54
|
+
height: 16px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
47
57
|
.duet-menu-bar-link.duet-theme-turva {
|
|
48
58
|
font-family: "turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
49
59
|
}
|
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { media_query_large } from "@duetds/tokens/lib/tokens.json";
|
|
5
4
|
import { h, Host } from "@stencil/core";
|
|
6
5
|
import { inheritGlobalTheme } from "../../common/themeable-component";
|
|
7
6
|
export class DuetMenuBarLink {
|
|
8
7
|
constructor() {
|
|
9
|
-
/**
|
|
10
|
-
* Own Properties.
|
|
11
|
-
*/
|
|
12
|
-
this.mql = [window.matchMedia(media_query_large.replace(/'/g, ""))];
|
|
13
|
-
this.boundMqlFunctions = [];
|
|
14
|
-
this.changeIconSize = () => {
|
|
15
|
-
if (this.mql[0].matches) {
|
|
16
|
-
this.iconSize = "x-small";
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
this.iconSize = "small";
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
this.iconSize = "x-small";
|
|
23
8
|
this.theme = "";
|
|
24
9
|
this.active = false;
|
|
25
10
|
this.href = "#";
|
|
@@ -32,26 +17,6 @@ export class DuetMenuBarLink {
|
|
|
32
17
|
componentWillLoad() {
|
|
33
18
|
inheritGlobalTheme(this);
|
|
34
19
|
}
|
|
35
|
-
connectedCallback() {
|
|
36
|
-
this.changeIconSize();
|
|
37
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
38
|
-
// addEventListener is not available in Stencil hydrate
|
|
39
|
-
if (this.mql[i].addEventListener) {
|
|
40
|
-
const bound = this.changeIconSize.bind(this);
|
|
41
|
-
this.mql[i].addEventListener("change", bound);
|
|
42
|
-
this.boundMqlFunctions[i] = bound;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
disconnectedCallback() {
|
|
47
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
48
|
-
// removeEventListener is not available in Stencil hydrate
|
|
49
|
-
if (this.mql[i].removeEventListener) {
|
|
50
|
-
this.mql[i].removeEventListener("change", this.boundMqlFunctions[i]);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
this.boundMqlFunctions = [];
|
|
54
|
-
}
|
|
55
20
|
/**
|
|
56
21
|
* render() function
|
|
57
22
|
* Always the last one in the class.
|
|
@@ -61,7 +26,7 @@ export class DuetMenuBarLink {
|
|
|
61
26
|
"duet-menu-bar-link": true,
|
|
62
27
|
"duet-theme-turva": this.theme === "turva",
|
|
63
28
|
active: this.active,
|
|
64
|
-
}, href: this.href, "aria-current": this.active ? "true" : "false", "aria-label": this.accessibleLabel }, this.icon && (h("duet-icon", { theme: this.theme, size:
|
|
29
|
+
}, href: this.href, "aria-current": this.active ? "true" : "false", "aria-label": this.accessibleLabel }, this.icon && (h("duet-icon", { class: "menu-bar-link-icon", theme: this.theme, size: "auto", name: this.icon, margin: "none", color: "currentColor" })), h("slot", null))));
|
|
65
30
|
}
|
|
66
31
|
static get is() { return "duet-menu-bar-link"; }
|
|
67
32
|
static get encapsulation() { return "shadow"; }
|
|
@@ -174,10 +139,5 @@ export class DuetMenuBarLink {
|
|
|
174
139
|
}
|
|
175
140
|
};
|
|
176
141
|
}
|
|
177
|
-
static get states() {
|
|
178
|
-
return {
|
|
179
|
-
"iconSize": {}
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
142
|
static get elementRef() { return "element"; }
|
|
183
143
|
}
|
|
@@ -139,6 +139,16 @@
|
|
|
139
139
|
background: rgb(198, 12, 48);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
+
.duet-submenu-bar-dropdown .submenu-bar-dropdown-icon {
|
|
143
|
+
width: 20px;
|
|
144
|
+
height: 20px;
|
|
145
|
+
}
|
|
146
|
+
@media (min-width: 62em) {
|
|
147
|
+
.duet-submenu-bar-dropdown .submenu-bar-dropdown-icon {
|
|
148
|
+
width: 16px;
|
|
149
|
+
height: 16px;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
142
152
|
.duet-submenu-bar-dropdown .items {
|
|
143
153
|
display: flex;
|
|
144
154
|
flex-direction: column;
|
|
@@ -15,11 +15,9 @@ export class DuetSubmenuBarDropdown {
|
|
|
15
15
|
this.checkIsDesktop = () => {
|
|
16
16
|
if (this.mql[0].matches) {
|
|
17
17
|
this.isDesktop = true;
|
|
18
|
-
this.iconSize = "x-small";
|
|
19
18
|
}
|
|
20
19
|
else {
|
|
21
20
|
this.isDesktop = false;
|
|
22
|
-
this.iconSize = "small";
|
|
23
21
|
}
|
|
24
22
|
};
|
|
25
23
|
this.onClick = () => {
|
|
@@ -38,7 +36,6 @@ export class DuetSubmenuBarDropdown {
|
|
|
38
36
|
}
|
|
39
37
|
};
|
|
40
38
|
this.isDesktop = false;
|
|
41
|
-
this.iconSize = "small";
|
|
42
39
|
this.theme = "";
|
|
43
40
|
this.active = false;
|
|
44
41
|
this.open = false;
|
|
@@ -107,7 +104,7 @@ export class DuetSubmenuBarDropdown {
|
|
|
107
104
|
} }, h("button", { ref: element => (this.button = element), "aria-haspopup": "menu", "aria-controls": "menu", "aria-expanded": this.open ? "true" : "false", "aria-current": this.active ? "true" : "false", id: "button", type: "button", class: {
|
|
108
105
|
open: this.open,
|
|
109
106
|
active: this.active,
|
|
110
|
-
}, onClick: this.onClick, onKeyUp: e => this.handleEscape(e) }, this.icon && (h("duet-icon", { theme: this.theme, name: this.icon, size:
|
|
107
|
+
}, onClick: this.onClick, onKeyUp: e => this.handleEscape(e) }, this.icon && (h("duet-icon", { class: "submenu-bar-dropdown-icon", theme: this.theme, name: this.icon, size: "auto", margin: "none", color: "currentColor" })), h("div", { class: "label" }, h("span", { class: "label-text" }, h("slot", { name: "label" })), h("duet-icon", { class: "caret", theme: this.theme, name: "action-arrow-down-small", margin: "none", size: "xxx-small", color: "currentColor" }))), h("div", { tabindex: "-1", role: "menu", id: "menu", "aria-labelledby": "button", class: {
|
|
111
108
|
items: true,
|
|
112
109
|
hidden: !this.open,
|
|
113
110
|
} }, h("slot", null)))));
|
|
@@ -208,8 +205,7 @@ export class DuetSubmenuBarDropdown {
|
|
|
208
205
|
}
|
|
209
206
|
static get states() {
|
|
210
207
|
return {
|
|
211
|
-
"isDesktop": {}
|
|
212
|
-
"iconSize": {}
|
|
208
|
+
"isDesktop": {}
|
|
213
209
|
};
|
|
214
210
|
}
|
|
215
211
|
static get methods() {
|
|
@@ -52,6 +52,16 @@
|
|
|
52
52
|
.duet-theme-turva .duet-submenu-bar-link:focus, .duet-submenu-bar-link:focus.duet-theme-turva {
|
|
53
53
|
box-shadow: 0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a;
|
|
54
54
|
}
|
|
55
|
+
.duet-submenu-bar-link .submenu-bar-link-icon {
|
|
56
|
+
width: 20px;
|
|
57
|
+
height: 20px;
|
|
58
|
+
}
|
|
59
|
+
@media (min-width: 62em) {
|
|
60
|
+
.duet-submenu-bar-link .submenu-bar-link-icon {
|
|
61
|
+
width: 16px;
|
|
62
|
+
height: 16px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
55
65
|
@media (min-width: 62em) {
|
|
56
66
|
.duet-submenu-bar-link {
|
|
57
67
|
flex-direction: column;
|