@watermarkinsights/ripple 5.6.0-1 → 5.6.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-5caee80b.js → app-globals-2eb5411e.js} +1 -1
- package/dist/cjs/{chartFunctions-878f8139.js → chartFunctions-800ea87d.js} +1 -1
- package/dist/cjs/{functions-05e7ad5a.js → functions-c6e27c75.js} +6 -0
- package/dist/cjs/index-788526f5.js +12 -0
- package/dist/cjs/{intl-2b550151.js → intl-9f836d29.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/priv-calendar.cjs.entry.js +1 -1
- package/dist/cjs/priv-chart-popover.cjs.entry.js +1 -1
- package/dist/cjs/priv-navigator-button.cjs.entry.js +1 -1
- package/dist/cjs/priv-navigator-item.cjs.entry.js +1 -1
- package/dist/cjs/priv-option-list.cjs.entry.js +385 -0
- package/dist/cjs/ripple.cjs.js +2 -2
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +3 -3
- package/dist/cjs/wm-button.cjs.entry.js +2 -2
- package/dist/cjs/wm-chart.cjs.entry.js +3 -3
- package/dist/cjs/wm-date-range.cjs.entry.js +1 -1
- package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-file-list.cjs.entry.js +1 -1
- package/dist/cjs/wm-file.cjs.entry.js +2 -2
- package/dist/cjs/wm-input.cjs.entry.js +3 -3
- package/dist/cjs/wm-line-chart.cjs.entry.js +3 -3
- package/dist/cjs/wm-modal-footer.cjs.entry.js +1 -1
- package/dist/cjs/wm-modal-header.cjs.entry.js +3 -3
- package/dist/cjs/wm-modal.cjs.entry.js +3 -3
- package/dist/cjs/wm-navigation_3.cjs.entry.js +6 -6
- package/dist/cjs/wm-navigator.cjs.entry.js +1 -1
- package/dist/cjs/wm-nested-select.cjs.entry.js +296 -0
- package/dist/cjs/wm-optgroup.cjs.entry.js +57 -0
- package/dist/cjs/wm-option_2.cjs.entry.js +34 -339
- package/dist/cjs/wm-pagination.cjs.entry.js +2 -2
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +2 -2
- package/dist/cjs/wm-search.cjs.entry.js +4 -4
- package/dist/cjs/wm-snackbar.cjs.entry.js +4 -4
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +4 -4
- package/dist/cjs/wm-tag-input.cjs.entry.js +5 -5
- package/dist/cjs/wm-tag-option.cjs.entry.js +1 -1
- package/dist/cjs/wm-textarea.cjs.entry.js +3 -3
- package/dist/cjs/wm-timepicker.cjs.entry.js +3 -3
- package/dist/cjs/wm-toggletip.cjs.entry.js +3 -3
- package/dist/cjs/wm-uploader.cjs.entry.js +4 -4
- package/dist/collection/collection-manifest.json +5 -2
- package/dist/collection/components/selects/priv-option-list/priv-option-list.css +104 -0
- package/dist/collection/components/selects/priv-option-list/priv-option-list.js +717 -0
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +378 -0
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +581 -0
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +77 -0
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +197 -0
- package/dist/collection/components/{wm-select → selects/wm-select}/wm-select.css +0 -74
- package/dist/collection/components/{wm-select → selects/wm-select}/wm-select.js +17 -384
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +1 -1
- package/dist/collection/components/wm-button/wm-button.js +1 -1
- package/dist/collection/components/wm-file/wm-file.js +1 -1
- package/dist/collection/components/wm-file-list/wm-file-list.js +1 -1
- package/dist/collection/components/wm-input/wm-input.js +1 -1
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal-footer.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal-header.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal.js +2 -2
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +1 -1
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +1 -1
- package/dist/collection/components/wm-navigation/wm-navigation.js +2 -2
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +1 -1
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +1 -1
- package/dist/collection/components/wm-option/wm-option.js +35 -9
- package/dist/collection/components/wm-pagination/wm-pagination.js +1 -1
- package/dist/collection/components/wm-search/wm-search.js +2 -2
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +2 -2
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +1 -1
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +1 -1
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +1 -1
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +3 -3
- package/dist/collection/components/wm-textarea/wm-textarea.js +1 -1
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +2 -2
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +2 -2
- package/dist/collection/components/wm-uploader/wm-uploader.js +2 -2
- package/dist/collection/dev/nested-select.js +62 -0
- package/dist/collection/global/functions.js +5 -0
- package/dist/esm/{app-globals-8a702f67.js → app-globals-bbc3f842.js} +1 -1
- package/dist/esm/{chartFunctions-00fd6f23.js → chartFunctions-7e5619f6.js} +1 -1
- package/dist/esm/{functions-25781571.js → functions-046fc5a3.js} +6 -1
- package/dist/esm/index-130e07bb.js +12 -0
- package/dist/esm/{intl-df3d34d1.js → intl-0822738a.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/priv-calendar.entry.js +1 -1
- package/dist/esm/priv-chart-popover.entry.js +1 -1
- package/dist/esm/priv-navigator-button.entry.js +1 -1
- package/dist/esm/priv-navigator-item.entry.js +1 -1
- package/dist/esm/priv-option-list.entry.js +381 -0
- package/dist/esm/ripple.js +2 -2
- package/dist/esm/wm-action-menu_2.entry.js +3 -3
- package/dist/esm/wm-button.entry.js +2 -2
- package/dist/esm/wm-chart.entry.js +3 -3
- package/dist/esm/wm-date-range.entry.js +1 -1
- package/dist/esm/wm-datepicker.entry.js +1 -1
- package/dist/esm/wm-file-list.entry.js +1 -1
- package/dist/esm/wm-file.entry.js +2 -2
- package/dist/esm/wm-input.entry.js +3 -3
- package/dist/esm/wm-line-chart.entry.js +3 -3
- package/dist/esm/wm-modal-footer.entry.js +1 -1
- package/dist/esm/wm-modal-header.entry.js +3 -3
- package/dist/esm/wm-modal.entry.js +3 -3
- package/dist/esm/wm-navigation_3.entry.js +6 -6
- package/dist/esm/wm-navigator.entry.js +1 -1
- package/dist/esm/wm-nested-select.entry.js +292 -0
- package/dist/esm/wm-optgroup.entry.js +53 -0
- package/dist/esm/wm-option_2.entry.js +34 -339
- package/dist/esm/wm-pagination.entry.js +2 -2
- package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
- package/dist/esm/wm-search.entry.js +4 -4
- package/dist/esm/wm-snackbar.entry.js +4 -4
- package/dist/esm/wm-tab-item_3.entry.js +4 -4
- package/dist/esm/wm-tag-input.entry.js +5 -5
- package/dist/esm/wm-tag-option.entry.js +1 -1
- package/dist/esm/wm-textarea.entry.js +3 -3
- package/dist/esm/wm-timepicker.entry.js +3 -3
- package/dist/esm/wm-toggletip.entry.js +3 -3
- package/dist/esm/wm-uploader.entry.js +4 -4
- package/dist/esm-es5/{app-globals-8a702f67.js → app-globals-bbc3f842.js} +1 -1
- package/dist/esm-es5/{chartFunctions-00fd6f23.js → chartFunctions-7e5619f6.js} +1 -1
- package/dist/esm-es5/{functions-25781571.js → functions-046fc5a3.js} +1 -1
- package/dist/esm-es5/index-130e07bb.js +1 -1
- package/dist/esm-es5/{intl-df3d34d1.js → intl-0822738a.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-calendar.entry.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
- package/dist/esm-es5/priv-option-list.entry.js +1 -0
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-chart.entry.js +1 -1
- package/dist/esm-es5/wm-date-range.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-file-list.entry.js +1 -1
- package/dist/esm-es5/wm-file.entry.js +1 -1
- package/dist/esm-es5/wm-input.entry.js +1 -1
- package/dist/esm-es5/wm-line-chart.entry.js +1 -1
- package/dist/esm-es5/wm-modal-footer.entry.js +1 -1
- package/dist/esm-es5/wm-modal-header.entry.js +1 -1
- package/dist/esm-es5/wm-modal.entry.js +1 -1
- package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/esm-es5/wm-nested-select.entry.js +1 -0
- package/dist/esm-es5/wm-optgroup.entry.js +1 -0
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-pagination.entry.js +1 -1
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
- package/dist/esm-es5/wm-search.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-tag-option.entry.js +1 -1
- package/dist/esm-es5/wm-textarea.entry.js +1 -1
- package/dist/esm-es5/wm-timepicker.entry.js +1 -1
- package/dist/esm-es5/wm-toggletip.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/ripple/{p-041e579b.entry.js → p-05f0f2e9.entry.js} +1 -1
- package/dist/ripple/{p-a1a2f8c9.system.entry.js → p-06792553.system.entry.js} +1 -1
- package/dist/ripple/{p-b80d9402.system.entry.js → p-0b7a64cd.system.entry.js} +1 -1
- package/dist/ripple/{p-d5ba9de1.system.entry.js → p-0db47768.system.entry.js} +1 -1
- package/dist/ripple/{p-67a7f0b0.entry.js → p-1123b0fd.entry.js} +1 -1
- package/dist/ripple/{p-3423a9b6.system.entry.js → p-140d2dad.system.entry.js} +1 -1
- package/dist/ripple/{p-56766bb2.entry.js → p-1727c66e.entry.js} +1 -1
- package/dist/ripple/{p-2d619f83.entry.js → p-179e4aee.entry.js} +1 -1
- package/dist/ripple/{p-6e60631a.entry.js → p-18d3ad51.entry.js} +1 -1
- package/dist/ripple/{p-bcff8b3a.entry.js → p-1a474fb3.entry.js} +1 -1
- package/dist/ripple/p-1ed0a315.system.entry.js +1 -0
- package/dist/ripple/{p-376efca9.entry.js → p-200298b3.entry.js} +1 -1
- package/dist/ripple/{p-3b4045f8.system.entry.js → p-22704516.system.entry.js} +1 -1
- package/dist/ripple/{p-f54e9ed0.js → p-28169294.js} +1 -1
- package/dist/ripple/p-28a88d69.entry.js +1 -0
- package/dist/ripple/{p-13fc2164.entry.js → p-28a89430.entry.js} +1 -1
- package/dist/ripple/{p-298c2675.entry.js → p-29388a85.entry.js} +1 -1
- package/dist/ripple/{p-1f09134c.entry.js → p-2952dc73.entry.js} +1 -1
- package/dist/ripple/p-2ec551cc.entry.js +1 -0
- package/dist/ripple/{p-e85b1f40.entry.js → p-30aa965a.entry.js} +1 -1
- package/dist/ripple/{p-155224a2.system.entry.js → p-341d27c6.system.entry.js} +1 -1
- package/dist/ripple/p-354a97f2.entry.js +1 -0
- package/dist/ripple/{p-3b5f4364.system.entry.js → p-35f78ec6.system.entry.js} +1 -1
- package/dist/ripple/{p-417c8e46.system.entry.js → p-381d004e.system.entry.js} +1 -1
- package/dist/ripple/{p-b41ef3db.entry.js → p-39de670a.entry.js} +1 -1
- package/dist/ripple/{p-b7307be6.system.entry.js → p-3ad563c4.system.entry.js} +1 -1
- package/dist/ripple/{p-0ff41567.system.entry.js → p-3ea3db64.system.entry.js} +1 -1
- package/dist/ripple/p-42925871.entry.js +1 -0
- package/dist/ripple/p-46f449d2.system.js +1 -0
- package/dist/ripple/{p-e2fe86a7.system.entry.js → p-540f74b1.system.entry.js} +1 -1
- package/dist/ripple/{p-a88bf1c5.js → p-58a073f2.js} +1 -1
- package/dist/ripple/{p-7fb95b89.entry.js → p-61666258.entry.js} +1 -1
- package/dist/ripple/p-64449b64.entry.js +1 -0
- package/dist/ripple/p-68fc8da3.system.entry.js +1 -0
- package/dist/ripple/p-6e95e98c.system.js +1 -0
- package/dist/ripple/{p-aab56a37.system.entry.js → p-7135f074.system.entry.js} +1 -1
- package/dist/ripple/{p-58988291.system.js → p-71ddeb97.system.js} +1 -1
- package/dist/ripple/{p-d93c51dd.system.entry.js → p-772c4fd2.system.entry.js} +1 -1
- package/dist/ripple/{p-e4918449.js → p-7b5be38a.js} +1 -1
- package/dist/ripple/{p-eb14b354.entry.js → p-833c05ca.entry.js} +1 -1
- package/dist/ripple/{p-88cfd58d.js → p-8789b4c9.js} +1 -1
- package/dist/ripple/{p-fc529ba1.system.entry.js → p-8dd54304.system.entry.js} +1 -1
- package/dist/ripple/{p-830f8b3f.entry.js → p-9420679d.entry.js} +1 -1
- package/dist/ripple/{p-8b56f9d8.system.entry.js → p-96697a65.system.entry.js} +1 -1
- package/dist/ripple/p-974ca7a4.system.entry.js +1 -0
- package/dist/ripple/{p-b8168f35.system.entry.js → p-97e62c9d.system.entry.js} +1 -1
- package/dist/ripple/{p-a9d89ac8.system.js → p-98bf2ccb.system.js} +1 -1
- package/dist/ripple/{p-6fe35d1e.system.entry.js → p-ac47e6f5.system.entry.js} +1 -1
- package/dist/ripple/{p-5051034b.entry.js → p-b116fb2d.entry.js} +1 -1
- package/dist/ripple/{p-03708b88.system.js → p-b6df0519.system.js} +1 -1
- package/dist/ripple/{p-6d0e5159.system.entry.js → p-bb28c2c7.system.entry.js} +1 -1
- package/dist/ripple/{p-672ae2cb.entry.js → p-c171f37b.entry.js} +1 -1
- package/dist/ripple/{p-41eb6a2e.system.entry.js → p-c2fc7204.system.entry.js} +1 -1
- package/dist/ripple/{p-4ea1e503.entry.js → p-c9dc5cfa.entry.js} +1 -1
- package/dist/ripple/{p-17bb1157.system.entry.js → p-ca6bbd68.system.entry.js} +1 -1
- package/dist/ripple/{p-f17fd62b.entry.js → p-cb85c4a7.entry.js} +1 -1
- package/dist/ripple/{p-6d56676e.system.entry.js → p-cc5b07b1.system.entry.js} +1 -1
- package/dist/ripple/{p-f09e2c22.entry.js → p-d6502e2e.entry.js} +1 -1
- package/dist/ripple/{p-c2181de0.entry.js → p-d78dad3d.entry.js} +1 -1
- package/dist/ripple/{p-a62e7532.entry.js → p-d7b7c350.entry.js} +1 -1
- package/dist/ripple/{p-2fd12dd9.entry.js → p-dde32280.entry.js} +1 -1
- package/dist/ripple/{p-7eab6bea.system.entry.js → p-dfaa6a61.system.entry.js} +1 -1
- package/dist/ripple/{p-5ece78e5.system.entry.js → p-e25e8ed7.system.entry.js} +1 -1
- package/dist/ripple/{p-b0c566b5.system.entry.js → p-e2c9204d.system.entry.js} +1 -1
- package/dist/ripple/p-e2de8541.system.entry.js +1 -0
- package/dist/ripple/{p-ac40417b.system.entry.js → p-e562e32d.system.entry.js} +1 -1
- package/dist/ripple/{p-ecb6c756.entry.js → p-ea407923.entry.js} +1 -1
- package/dist/ripple/p-ea9c152f.entry.js +1 -0
- package/dist/ripple/{p-748f8a97.system.entry.js → p-f02dce0f.system.entry.js} +1 -1
- package/dist/ripple/{p-ea0dfadf.system.entry.js → p-f38622dc.system.entry.js} +1 -1
- package/dist/ripple/{p-5caaf651.system.entry.js → p-f8c7adab.system.entry.js} +1 -1
- package/dist/ripple/{p-298bde1b.entry.js → p-fb3cfb8b.entry.js} +1 -1
- package/dist/ripple/{p-86fd68b3.system.entry.js → p-fdb4cf9e.system.entry.js} +1 -1
- package/dist/ripple/{p-0af94825.entry.js → p-feb80dd1.entry.js} +1 -1
- package/dist/ripple/{p-2ef49c84.entry.js → p-ff0e05e4.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/{wm-select/wm-select.d.ts → selects/priv-option-list/priv-option-list.d.ts} +37 -65
- package/dist/types/components/selects/wm-nested-select/wm-nested-select.d.ts +55 -0
- package/dist/types/components/selects/wm-optgroup/wm-optgroup.d.ts +16 -0
- package/dist/types/components/selects/wm-select/wm-select.d.ts +53 -0
- package/dist/types/components/wm-option/wm-option.d.ts +2 -1
- package/dist/types/components.d.ts +148 -2
- package/dist/types/global/functions.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ripple/p-418ed08c.system.entry.js +0 -1
- package/dist/ripple/p-4670ccb4.system.js +0 -1
- package/dist/ripple/p-4baaf026.entry.js +0 -1
- package/dist/ripple/p-8e72de50.entry.js +0 -1
- package/dist/ripple/p-ddff380b.system.js +0 -1
- package/dist/ripple/p-fabe4ca4.entry.js +0 -1
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
import { h, Host, forceUpdate } from "@stencil/core";
|
|
2
|
+
import { getTextDir, intl, isElOrChild, toBool } from "../../../global/functions";
|
|
3
|
+
import { globalMessages } from "../../../global/intl";
|
|
4
|
+
export class NestedSelect {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.overflowCount = 0;
|
|
7
|
+
this.displayedOptions = [];
|
|
8
|
+
this.clearSelectionMessage = this.multiple
|
|
9
|
+
? intl.formatMessage({
|
|
10
|
+
id: "select.multiClearSelection",
|
|
11
|
+
defaultMessage: "Clear all Selections",
|
|
12
|
+
description: "Button text to clear selection. Use imperative",
|
|
13
|
+
})
|
|
14
|
+
: intl.formatMessage({
|
|
15
|
+
id: "select.singleClearSelection",
|
|
16
|
+
defaultMessage: "Clear Selection",
|
|
17
|
+
description: "Button text to clear selection. Use imperative",
|
|
18
|
+
});
|
|
19
|
+
this.disabled = false;
|
|
20
|
+
this.maxHeight = undefined;
|
|
21
|
+
this.label = undefined;
|
|
22
|
+
this.labelPosition = "top";
|
|
23
|
+
this.requiredField = false;
|
|
24
|
+
this.errorMessage = undefined;
|
|
25
|
+
this.multiple = false;
|
|
26
|
+
this.search = false;
|
|
27
|
+
this.selectAll = false;
|
|
28
|
+
this.placeholder = this.multiple
|
|
29
|
+
? intl.formatMessage({
|
|
30
|
+
id: "select.multiPlaceholder",
|
|
31
|
+
defaultMessage: "Make a selection",
|
|
32
|
+
description: "Placeholder text for multiple select. Use imperative",
|
|
33
|
+
})
|
|
34
|
+
: intl.formatMessage({
|
|
35
|
+
id: "select.singlePlaceholder",
|
|
36
|
+
defaultMessage: "Select an Option",
|
|
37
|
+
description: "Placeholder text for single select. Use imperative",
|
|
38
|
+
});
|
|
39
|
+
this.searchPlaceholder = intl.formatMessage({
|
|
40
|
+
id: "select.searchPlaceholder",
|
|
41
|
+
defaultMessage: "Search",
|
|
42
|
+
description: "Placeholder text. Use imperative",
|
|
43
|
+
});
|
|
44
|
+
this.allSelectedMessage = intl.formatMessage({
|
|
45
|
+
id: "select.allSelected",
|
|
46
|
+
defaultMessage: "All selected",
|
|
47
|
+
description: "Text displayed when all options are selected",
|
|
48
|
+
});
|
|
49
|
+
this.isExpanded = false;
|
|
50
|
+
this.optgroupExpanded = false;
|
|
51
|
+
}
|
|
52
|
+
get isDisabled() {
|
|
53
|
+
// string "false" needs to be treated as bool False because react wrappers convert bool to string.
|
|
54
|
+
return toBool(this.disabled);
|
|
55
|
+
}
|
|
56
|
+
get childOptions() {
|
|
57
|
+
return Array.from(this.el.querySelectorAll("wm-option"));
|
|
58
|
+
}
|
|
59
|
+
get optgroupEls() {
|
|
60
|
+
return Array.from(this.el.querySelectorAll("wm-optgroup"));
|
|
61
|
+
}
|
|
62
|
+
get menuitemEls() {
|
|
63
|
+
return Array.from(this.el.shadowRoot.querySelectorAll(".menuitem"));
|
|
64
|
+
}
|
|
65
|
+
get allSelected() {
|
|
66
|
+
return this.childOptions.every((option) => option.selected);
|
|
67
|
+
}
|
|
68
|
+
componentWillLoad() {
|
|
69
|
+
const mutationObserver = new MutationObserver((mutationRecordList) => mutationRecordList.forEach((mutationRecord) => this.handleChildChange(mutationRecord)));
|
|
70
|
+
mutationObserver.observe(this.el, {
|
|
71
|
+
childList: true,
|
|
72
|
+
attributes: true,
|
|
73
|
+
subtree: true,
|
|
74
|
+
attributeFilter: ["selected"],
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
componentDidLoad() {
|
|
78
|
+
if (this.maxHeight) {
|
|
79
|
+
// this.listboxEl.style.maxHeight = this.maxHeight;
|
|
80
|
+
this.dropdownEl.style.maxHeight = this.maxHeight;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
handleChildChange(_) {
|
|
84
|
+
// on update of children or children selected state, reset button text and rerender
|
|
85
|
+
this.setButtonText();
|
|
86
|
+
forceUpdate(this.el);
|
|
87
|
+
// this.optionListEl.handleChildChange(_);
|
|
88
|
+
}
|
|
89
|
+
setButtonText() {
|
|
90
|
+
this.displayedOptions = this.childOptions.filter((x) => x.selected);
|
|
91
|
+
// handle overflow + counter for multiselect
|
|
92
|
+
if (this.multiple) {
|
|
93
|
+
// this is a fixed measurement accounting for the max width of a 3 character overflow counter
|
|
94
|
+
const overflowCounterWidth = 38;
|
|
95
|
+
const computedStyle = window.getComputedStyle(this.buttonEl);
|
|
96
|
+
// there seems to be no quick way to get an elements width without padding, except for subtracting padding manually
|
|
97
|
+
const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
|
|
98
|
+
const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
|
|
99
|
+
const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
|
|
100
|
+
let optionsWidths = this.displayedOptions.map((x) => x.shadowRoot.querySelector(".option-text").clientWidth);
|
|
101
|
+
let optionsTotalWidth = optionsWidths.reduce((acc, x) => acc + x, 0);
|
|
102
|
+
this.overflowCount = 0;
|
|
103
|
+
while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
|
|
104
|
+
this.overflowCount++;
|
|
105
|
+
optionsTotalWidth -= optionsWidths[optionsWidths.length - 1];
|
|
106
|
+
optionsWidths.pop();
|
|
107
|
+
this.displayedOptions.pop();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
countOptgroupSelected(optgroupEl) {
|
|
112
|
+
let selectedOptions = Array.from(optgroupEl.querySelectorAll("wm-option")).filter((option) => option.selected);
|
|
113
|
+
return selectedOptions.length;
|
|
114
|
+
}
|
|
115
|
+
handleOptionSelection() {
|
|
116
|
+
if (!this.multiple) {
|
|
117
|
+
this.close();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
handleChildEnter() {
|
|
121
|
+
// only occurs for multiselects. handle the click, then close
|
|
122
|
+
this.close();
|
|
123
|
+
}
|
|
124
|
+
closePopupOnEscape() {
|
|
125
|
+
this.close();
|
|
126
|
+
}
|
|
127
|
+
handleOptionKeyLeft(ev) {
|
|
128
|
+
const parentOptgroup = ev.detail.parentElement;
|
|
129
|
+
parentOptgroup.isExpanded = false;
|
|
130
|
+
this.focusFirstMenuitem();
|
|
131
|
+
}
|
|
132
|
+
close(returnFocus = true) {
|
|
133
|
+
if (this.isExpanded) {
|
|
134
|
+
this.isExpanded = false;
|
|
135
|
+
this.optgroupEls.forEach((optgroupEl) => (optgroupEl.isExpanded = false));
|
|
136
|
+
window.setTimeout(() => {
|
|
137
|
+
this.dropdownEl.classList.remove("open");
|
|
138
|
+
if (returnFocus) {
|
|
139
|
+
this.buttonEl.focus();
|
|
140
|
+
}
|
|
141
|
+
}, 150);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
open() {
|
|
145
|
+
// TODO implement opening upwards if not enough space below
|
|
146
|
+
this.isExpanded = true;
|
|
147
|
+
this.dropdownEl.classList.add("open");
|
|
148
|
+
window.requestAnimationFrame(() => {
|
|
149
|
+
this.focusFirstMenuitem();
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
focusFirstMenuitem() {
|
|
153
|
+
if (this.menuitemEls.length > 0) {
|
|
154
|
+
this.menuitemEls[0].focus();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
moveDown(menuitemEl) {
|
|
158
|
+
const currentIndex = this.menuitemEls.indexOf(menuitemEl);
|
|
159
|
+
if (currentIndex == this.menuitemEls.length - 1) {
|
|
160
|
+
this.menuitemEls[0].focus();
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
this.menuitemEls[currentIndex + 1].focus();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
moveUp(menuitemEl) {
|
|
167
|
+
const currentIndex = this.menuitemEls.indexOf(menuitemEl);
|
|
168
|
+
if (currentIndex == 0) {
|
|
169
|
+
this.menuitemEls[this.menuitemEls.length - 1].focus();
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
this.menuitemEls[currentIndex - 1].focus();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
handleButtonBlur(ev) {
|
|
176
|
+
if (isElOrChild(this.el, ev.relatedTarget)) {
|
|
177
|
+
// do not emit a blur event when opening the dropdown and focusing the Options
|
|
178
|
+
ev.stopPropagation();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
handleClick(ev) {
|
|
182
|
+
if (!isElOrChild(this.el, ev.target)) {
|
|
183
|
+
this.close();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
handleMenuitemKeydown(ev) {
|
|
187
|
+
switch (ev.key) {
|
|
188
|
+
case "ArrowDown":
|
|
189
|
+
ev.preventDefault();
|
|
190
|
+
// focus next
|
|
191
|
+
this.moveDown(ev.target);
|
|
192
|
+
break;
|
|
193
|
+
case "ArrowUp":
|
|
194
|
+
ev.preventDefault();
|
|
195
|
+
this.moveUp(ev.target);
|
|
196
|
+
// focus previous
|
|
197
|
+
break;
|
|
198
|
+
case "ArrowRight":
|
|
199
|
+
if (ev.target.classList.contains("group-btn")) {
|
|
200
|
+
ev.preventDefault();
|
|
201
|
+
ev.target.click();
|
|
202
|
+
}
|
|
203
|
+
break;
|
|
204
|
+
case "Escape":
|
|
205
|
+
ev.preventDefault();
|
|
206
|
+
this.close();
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
handleComponentBlur(ev) {
|
|
211
|
+
// Do not close or emit custom blur event when blurring to an element inside (wm-option)
|
|
212
|
+
if (!this.el.contains(ev.relatedTarget)) {
|
|
213
|
+
this.close(false);
|
|
214
|
+
this.wmNestedSelectBlurred.emit();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
handleOptgroupExpanded() {
|
|
218
|
+
this.optgroupExpanded = true;
|
|
219
|
+
}
|
|
220
|
+
handleOptgroupHidden() {
|
|
221
|
+
this.optgroupExpanded = false;
|
|
222
|
+
}
|
|
223
|
+
renderButtonText() {
|
|
224
|
+
if (this.displayedOptions.length < 1) {
|
|
225
|
+
return h("span", null, this.placeholder);
|
|
226
|
+
}
|
|
227
|
+
else if (this.multiple && this.allSelected && this.overflowCount > 0) {
|
|
228
|
+
return this.allSelectedMessage;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
return this.displayedOptions.map((x, idx) => (h("span", null, idx > 0 ? ", " : "", x.textContent)));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
renderOverflowCount() {
|
|
235
|
+
// TODO overflow count not appearing due to refactor, in both regular select and nested select
|
|
236
|
+
if (this.overflowCount > 0) {
|
|
237
|
+
return (h("span", null, h("span", { class: "overflow-counter" }, "+", this.overflowCount)));
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
handleClearSelection() {
|
|
241
|
+
this.optgroupEls.forEach((optgroupEl) => optgroupEl.emitDeselection());
|
|
242
|
+
}
|
|
243
|
+
renderClearSelectionButton() {
|
|
244
|
+
let selectedCount = this.childOptions.some((o) => o.selected);
|
|
245
|
+
if (selectedCount) {
|
|
246
|
+
return (h("button", { class: "menuitem", onClick: () => this.handleClearSelection(), tabindex: -1, onKeyDown: (ev) => this.handleMenuitemKeydown(ev) }, this.clearSelectionMessage));
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
renderSelectionCount(optgroupEl) {
|
|
250
|
+
const selectionCount = this.countOptgroupSelected(optgroupEl);
|
|
251
|
+
if (selectionCount) {
|
|
252
|
+
const selectionCountMessage = intl.formatMessage({
|
|
253
|
+
id: "select.optgroupSelectionCount",
|
|
254
|
+
defaultMessage: "{numSelected, plural, one {Item} other {#}} Selected",
|
|
255
|
+
description: "Text indicating number of selected in a group.",
|
|
256
|
+
}, { numSelected: selectionCount });
|
|
257
|
+
return (h("div", { class: "selection-count" }, h("span", null, selectionCountMessage)));
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
render() {
|
|
261
|
+
const buttonProps = {
|
|
262
|
+
id: "selectbtn",
|
|
263
|
+
["disabled"]: this.isDisabled,
|
|
264
|
+
["aria-controls"]: "list",
|
|
265
|
+
["aria-labelledby"]: "label selectbtn",
|
|
266
|
+
["aria-describedby"]: "error",
|
|
267
|
+
["aria-expanded"]: this.isExpanded ? "true" : "false",
|
|
268
|
+
onClick: () => {
|
|
269
|
+
this.isExpanded ? this.close() : this.open();
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
return (h(Host, { key: '8771f6abb8cc9ed2657d0f6ec31b837352cdb4d0', onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { key: 'fb64f235e8ce911df58f04a426cf4149c9ea818e', class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: '86a40eefed2fe8b0113d2887dcca0453ac6a984a', class: "label-wrapper" }, h("label", { key: '296a84604f95f4446d06f1618879786a89e98902', class: "label", id: "label", htmlFor: "selectbtn" }, this.label,
|
|
273
|
+
// we can't use aria-required or required attributes because it's invalid on the elements we're using (button controlling a listbox)
|
|
274
|
+
this.requiredField ? (h("span", { class: "required" }, h("span", { class: "sr-only" }, globalMessages.requiredField), h("span", { "aria-hidden": "true" }, "*"))) : (""))), h("div", { key: '212227342d050b279d589ea2c3dde05019ab166f', class: "button-wrapper" }, h("button", Object.assign({ key: 'f239aa90bdd30c10cdfdc8a355899b02c8c4ea94' }, buttonProps, { class: "displayedoption", ref: (el) => (this.buttonEl = el), onBlur: (ev) => this.handleButtonBlur(ev), onFocus: () => this.close() }), h("span", { key: 'f73375b774c2d940cf5afae37225ffaf4255486e', class: "overflowcontrol" }, h("span", { key: 'a9ae2f27508a9c69feeeea0345f825394c06c918', class: "button-text" }, this.renderButtonText())), this.renderOverflowCount()), h("div", { key: '714a38674ca3011e57e25ade678f7d7b4203f5f2', class: "dropdown", ref: (el) => (this.dropdownEl = el) }, h("div", { key: '532dd17d04d7fbee57b53ed3f911e785321f6edf', class: `menu ${this.optgroupExpanded ? "hidden" : ""}` }, this.renderClearSelectionButton(), this.optgroupEls.map((optgroupEl) => {
|
|
275
|
+
return (h("button", { class: "menuitem group-btn", role: "menuitem", tabindex: -1, onClick: () => {
|
|
276
|
+
optgroupEl.isExpanded = !optgroupEl.isExpanded;
|
|
277
|
+
forceUpdate(this.el);
|
|
278
|
+
}, onKeyDown: (ev) => this.handleMenuitemKeydown(ev) }, h("span", null, optgroupEl.label), this.renderSelectionCount(optgroupEl)));
|
|
279
|
+
})), h("div", { key: '9f65293fb3514808a7afc99f9ccf7be3c76854fb', class: `option-list-wrapper ${this.optgroupExpanded ? "visible" : ""}` }, h("slot", { key: 'ff01236e84136b637fe4dc6bbf4075ff655f661d' }))), h("div", { key: '49a965130ab5e5ebadc94b0661dbb97000f3621d', id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage)))));
|
|
280
|
+
}
|
|
281
|
+
static get is() { return "wm-nested-select"; }
|
|
282
|
+
static get encapsulation() { return "shadow"; }
|
|
283
|
+
static get delegatesFocus() { return true; }
|
|
284
|
+
static get originalStyleUrls() {
|
|
285
|
+
return {
|
|
286
|
+
"$": ["wm-nested-select.scss"]
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
static get styleUrls() {
|
|
290
|
+
return {
|
|
291
|
+
"$": ["wm-nested-select.css"]
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
static get properties() {
|
|
295
|
+
return {
|
|
296
|
+
"disabled": {
|
|
297
|
+
"type": "boolean",
|
|
298
|
+
"mutable": false,
|
|
299
|
+
"complexType": {
|
|
300
|
+
"original": "boolean",
|
|
301
|
+
"resolved": "boolean",
|
|
302
|
+
"references": {}
|
|
303
|
+
},
|
|
304
|
+
"required": false,
|
|
305
|
+
"optional": false,
|
|
306
|
+
"docs": {
|
|
307
|
+
"tags": [],
|
|
308
|
+
"text": ""
|
|
309
|
+
},
|
|
310
|
+
"attribute": "disabled",
|
|
311
|
+
"reflect": true,
|
|
312
|
+
"defaultValue": "false"
|
|
313
|
+
},
|
|
314
|
+
"maxHeight": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"mutable": false,
|
|
317
|
+
"complexType": {
|
|
318
|
+
"original": "string",
|
|
319
|
+
"resolved": "string | undefined",
|
|
320
|
+
"references": {}
|
|
321
|
+
},
|
|
322
|
+
"required": false,
|
|
323
|
+
"optional": true,
|
|
324
|
+
"docs": {
|
|
325
|
+
"tags": [],
|
|
326
|
+
"text": ""
|
|
327
|
+
},
|
|
328
|
+
"attribute": "max-height",
|
|
329
|
+
"reflect": false
|
|
330
|
+
},
|
|
331
|
+
"label": {
|
|
332
|
+
"type": "string",
|
|
333
|
+
"mutable": true,
|
|
334
|
+
"complexType": {
|
|
335
|
+
"original": "string",
|
|
336
|
+
"resolved": "string | undefined",
|
|
337
|
+
"references": {}
|
|
338
|
+
},
|
|
339
|
+
"required": false,
|
|
340
|
+
"optional": true,
|
|
341
|
+
"docs": {
|
|
342
|
+
"tags": [],
|
|
343
|
+
"text": ""
|
|
344
|
+
},
|
|
345
|
+
"attribute": "label",
|
|
346
|
+
"reflect": false
|
|
347
|
+
},
|
|
348
|
+
"labelPosition": {
|
|
349
|
+
"type": "string",
|
|
350
|
+
"mutable": false,
|
|
351
|
+
"complexType": {
|
|
352
|
+
"original": "\"top\" | \"left\" | \"none\"",
|
|
353
|
+
"resolved": "\"left\" | \"none\" | \"top\"",
|
|
354
|
+
"references": {}
|
|
355
|
+
},
|
|
356
|
+
"required": false,
|
|
357
|
+
"optional": false,
|
|
358
|
+
"docs": {
|
|
359
|
+
"tags": [],
|
|
360
|
+
"text": ""
|
|
361
|
+
},
|
|
362
|
+
"attribute": "label-position",
|
|
363
|
+
"reflect": false,
|
|
364
|
+
"defaultValue": "\"top\""
|
|
365
|
+
},
|
|
366
|
+
"requiredField": {
|
|
367
|
+
"type": "boolean",
|
|
368
|
+
"mutable": false,
|
|
369
|
+
"complexType": {
|
|
370
|
+
"original": "boolean",
|
|
371
|
+
"resolved": "boolean",
|
|
372
|
+
"references": {}
|
|
373
|
+
},
|
|
374
|
+
"required": false,
|
|
375
|
+
"optional": false,
|
|
376
|
+
"docs": {
|
|
377
|
+
"tags": [],
|
|
378
|
+
"text": ""
|
|
379
|
+
},
|
|
380
|
+
"attribute": "required-field",
|
|
381
|
+
"reflect": false,
|
|
382
|
+
"defaultValue": "false"
|
|
383
|
+
},
|
|
384
|
+
"errorMessage": {
|
|
385
|
+
"type": "string",
|
|
386
|
+
"mutable": true,
|
|
387
|
+
"complexType": {
|
|
388
|
+
"original": "string",
|
|
389
|
+
"resolved": "string | undefined",
|
|
390
|
+
"references": {}
|
|
391
|
+
},
|
|
392
|
+
"required": false,
|
|
393
|
+
"optional": true,
|
|
394
|
+
"docs": {
|
|
395
|
+
"tags": [],
|
|
396
|
+
"text": ""
|
|
397
|
+
},
|
|
398
|
+
"attribute": "error-message",
|
|
399
|
+
"reflect": false
|
|
400
|
+
},
|
|
401
|
+
"multiple": {
|
|
402
|
+
"type": "boolean",
|
|
403
|
+
"mutable": false,
|
|
404
|
+
"complexType": {
|
|
405
|
+
"original": "boolean",
|
|
406
|
+
"resolved": "boolean",
|
|
407
|
+
"references": {}
|
|
408
|
+
},
|
|
409
|
+
"required": false,
|
|
410
|
+
"optional": false,
|
|
411
|
+
"docs": {
|
|
412
|
+
"tags": [],
|
|
413
|
+
"text": ""
|
|
414
|
+
},
|
|
415
|
+
"attribute": "multiple",
|
|
416
|
+
"reflect": false,
|
|
417
|
+
"defaultValue": "false"
|
|
418
|
+
},
|
|
419
|
+
"search": {
|
|
420
|
+
"type": "boolean",
|
|
421
|
+
"mutable": false,
|
|
422
|
+
"complexType": {
|
|
423
|
+
"original": "boolean",
|
|
424
|
+
"resolved": "boolean",
|
|
425
|
+
"references": {}
|
|
426
|
+
},
|
|
427
|
+
"required": false,
|
|
428
|
+
"optional": false,
|
|
429
|
+
"docs": {
|
|
430
|
+
"tags": [],
|
|
431
|
+
"text": ""
|
|
432
|
+
},
|
|
433
|
+
"attribute": "search",
|
|
434
|
+
"reflect": false,
|
|
435
|
+
"defaultValue": "false"
|
|
436
|
+
},
|
|
437
|
+
"selectAll": {
|
|
438
|
+
"type": "boolean",
|
|
439
|
+
"mutable": false,
|
|
440
|
+
"complexType": {
|
|
441
|
+
"original": "boolean",
|
|
442
|
+
"resolved": "boolean",
|
|
443
|
+
"references": {}
|
|
444
|
+
},
|
|
445
|
+
"required": false,
|
|
446
|
+
"optional": false,
|
|
447
|
+
"docs": {
|
|
448
|
+
"tags": [],
|
|
449
|
+
"text": ""
|
|
450
|
+
},
|
|
451
|
+
"attribute": "select-all",
|
|
452
|
+
"reflect": false,
|
|
453
|
+
"defaultValue": "false"
|
|
454
|
+
},
|
|
455
|
+
"placeholder": {
|
|
456
|
+
"type": "string",
|
|
457
|
+
"mutable": false,
|
|
458
|
+
"complexType": {
|
|
459
|
+
"original": "string",
|
|
460
|
+
"resolved": "string",
|
|
461
|
+
"references": {}
|
|
462
|
+
},
|
|
463
|
+
"required": false,
|
|
464
|
+
"optional": false,
|
|
465
|
+
"docs": {
|
|
466
|
+
"tags": [],
|
|
467
|
+
"text": ""
|
|
468
|
+
},
|
|
469
|
+
"attribute": "placeholder",
|
|
470
|
+
"reflect": false,
|
|
471
|
+
"defaultValue": "this.multiple\n ? intl.formatMessage({\n id: \"select.multiPlaceholder\",\n defaultMessage: \"Make a selection\",\n description: \"Placeholder text for multiple select. Use imperative\",\n })\n : intl.formatMessage({\n id: \"select.singlePlaceholder\",\n defaultMessage: \"Select an Option\",\n description: \"Placeholder text for single select. Use imperative\",\n })"
|
|
472
|
+
},
|
|
473
|
+
"searchPlaceholder": {
|
|
474
|
+
"type": "string",
|
|
475
|
+
"mutable": false,
|
|
476
|
+
"complexType": {
|
|
477
|
+
"original": "string",
|
|
478
|
+
"resolved": "string",
|
|
479
|
+
"references": {}
|
|
480
|
+
},
|
|
481
|
+
"required": false,
|
|
482
|
+
"optional": false,
|
|
483
|
+
"docs": {
|
|
484
|
+
"tags": [],
|
|
485
|
+
"text": ""
|
|
486
|
+
},
|
|
487
|
+
"attribute": "search-placeholder",
|
|
488
|
+
"reflect": false,
|
|
489
|
+
"defaultValue": "intl.formatMessage({\n id: \"select.searchPlaceholder\",\n defaultMessage: \"Search\",\n description: \"Placeholder text. Use imperative\",\n })"
|
|
490
|
+
},
|
|
491
|
+
"allSelectedMessage": {
|
|
492
|
+
"type": "string",
|
|
493
|
+
"mutable": false,
|
|
494
|
+
"complexType": {
|
|
495
|
+
"original": "string",
|
|
496
|
+
"resolved": "string",
|
|
497
|
+
"references": {}
|
|
498
|
+
},
|
|
499
|
+
"required": false,
|
|
500
|
+
"optional": false,
|
|
501
|
+
"docs": {
|
|
502
|
+
"tags": [],
|
|
503
|
+
"text": ""
|
|
504
|
+
},
|
|
505
|
+
"attribute": "all-selected-message",
|
|
506
|
+
"reflect": false,
|
|
507
|
+
"defaultValue": "intl.formatMessage({\n id: \"select.allSelected\",\n defaultMessage: \"All selected\",\n description: \"Text displayed when all options are selected\",\n })"
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
static get states() {
|
|
512
|
+
return {
|
|
513
|
+
"isExpanded": {},
|
|
514
|
+
"optgroupExpanded": {}
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
static get events() {
|
|
518
|
+
return [{
|
|
519
|
+
"method": "wmNestedSelectBlurred",
|
|
520
|
+
"name": "wmNestedSelectBlurred",
|
|
521
|
+
"bubbles": true,
|
|
522
|
+
"cancelable": true,
|
|
523
|
+
"composed": true,
|
|
524
|
+
"docs": {
|
|
525
|
+
"tags": [],
|
|
526
|
+
"text": ""
|
|
527
|
+
},
|
|
528
|
+
"complexType": {
|
|
529
|
+
"original": "void",
|
|
530
|
+
"resolved": "void",
|
|
531
|
+
"references": {}
|
|
532
|
+
}
|
|
533
|
+
}];
|
|
534
|
+
}
|
|
535
|
+
static get elementRef() { return "el"; }
|
|
536
|
+
static get listeners() {
|
|
537
|
+
return [{
|
|
538
|
+
"name": "wmOptionSelected",
|
|
539
|
+
"method": "handleOptionSelection",
|
|
540
|
+
"target": undefined,
|
|
541
|
+
"capture": false,
|
|
542
|
+
"passive": false
|
|
543
|
+
}, {
|
|
544
|
+
"name": "wmEnterKeyPressed",
|
|
545
|
+
"method": "handleChildEnter",
|
|
546
|
+
"target": undefined,
|
|
547
|
+
"capture": false,
|
|
548
|
+
"passive": false
|
|
549
|
+
}, {
|
|
550
|
+
"name": "wmEscKeyPressed",
|
|
551
|
+
"method": "closePopupOnEscape",
|
|
552
|
+
"target": undefined,
|
|
553
|
+
"capture": false,
|
|
554
|
+
"passive": false
|
|
555
|
+
}, {
|
|
556
|
+
"name": "wmKeyLeftPressed",
|
|
557
|
+
"method": "handleOptionKeyLeft",
|
|
558
|
+
"target": undefined,
|
|
559
|
+
"capture": false,
|
|
560
|
+
"passive": false
|
|
561
|
+
}, {
|
|
562
|
+
"name": "click",
|
|
563
|
+
"method": "handleClick",
|
|
564
|
+
"target": "document",
|
|
565
|
+
"capture": true,
|
|
566
|
+
"passive": false
|
|
567
|
+
}, {
|
|
568
|
+
"name": "optgroupExpanded",
|
|
569
|
+
"method": "handleOptgroupExpanded",
|
|
570
|
+
"target": undefined,
|
|
571
|
+
"capture": false,
|
|
572
|
+
"passive": false
|
|
573
|
+
}, {
|
|
574
|
+
"name": "optgroupHidden",
|
|
575
|
+
"method": "handleOptgroupHidden",
|
|
576
|
+
"target": undefined,
|
|
577
|
+
"capture": false,
|
|
578
|
+
"passive": false
|
|
579
|
+
}];
|
|
580
|
+
}
|
|
581
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/* --------------------------------------
|
|
2
|
+
1. Box-shadow
|
|
3
|
+
-------------------------------------- */
|
|
4
|
+
/* --------------------------------------
|
|
5
|
+
2. Border-radius
|
|
6
|
+
-------------------------------------- */
|
|
7
|
+
/* --------------------------------------
|
|
8
|
+
3. Transforms
|
|
9
|
+
-------------------------------------- */
|
|
10
|
+
/* --------------------------------------
|
|
11
|
+
4. Button Focus
|
|
12
|
+
-------------------------------------- */
|
|
13
|
+
/* --------------------------------------
|
|
14
|
+
5. Flex
|
|
15
|
+
-------------------------------------- */
|
|
16
|
+
/* --------------------------------------
|
|
17
|
+
7. Screen Reader Only
|
|
18
|
+
-------------------------------------- */
|
|
19
|
+
/* --------------------------------------
|
|
20
|
+
8. Label styles
|
|
21
|
+
this mixin includes all the styles for the label
|
|
22
|
+
+ flex rules on the parent container to switch between top and left position
|
|
23
|
+
+ srOnly when label is hidden
|
|
24
|
+
Assumes the following markup:
|
|
25
|
+
div.wrapper[.label-left.invalid] > div.label-wrapper > label.label > span.required
|
|
26
|
+
.wrapper is for the flex rules
|
|
27
|
+
.label-wrapper is to set the height of the label when positioned left so it's the same height as
|
|
28
|
+
the input. It can't be done directly on .label because of possible line wrapping.
|
|
29
|
+
When the label is on top there's no line wrapping at all to ensure proper alignment of inlined elements
|
|
30
|
+
(they can't be aligned on the baseline because of possible description text and error message)
|
|
31
|
+
-------------------------------------- */
|
|
32
|
+
:host {
|
|
33
|
+
width: 100%;
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
:host .sr-only {
|
|
37
|
+
position: absolute !important;
|
|
38
|
+
width: 1px !important;
|
|
39
|
+
height: 1px !important;
|
|
40
|
+
padding: 0 !important;
|
|
41
|
+
border: 0 !important;
|
|
42
|
+
overflow: hidden !important;
|
|
43
|
+
clip: rect(0, 0, 0, 0) !important;
|
|
44
|
+
clip-path: inset(50%) !important;
|
|
45
|
+
white-space: nowrap !important;
|
|
46
|
+
margin: -1px !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host(.visible) {
|
|
50
|
+
display: unset;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.return-btn {
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
padding: 1.25rem;
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
font-weight: 600;
|
|
59
|
+
font-size: 0.875rem;
|
|
60
|
+
border-bottom: 1px solid #4a4a4a;
|
|
61
|
+
}
|
|
62
|
+
.return-btn:before {
|
|
63
|
+
display: inline-block;
|
|
64
|
+
font: normal normal normal 24px/1 "Material Design Icons";
|
|
65
|
+
font-size: inherit;
|
|
66
|
+
text-rendering: auto;
|
|
67
|
+
line-height: inherit;
|
|
68
|
+
-webkit-font-smoothing: antialiased;
|
|
69
|
+
-moz-osx-font-smoothing: grayscale;
|
|
70
|
+
content: "\f141";
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
font-size: 1.12rem;
|
|
73
|
+
}
|
|
74
|
+
.return-btn:hover {
|
|
75
|
+
background: var(--wmcolor-select-option-background-hover);
|
|
76
|
+
outline: none;
|
|
77
|
+
}
|