@watermarkinsights/ripple 5.6.0-8 → 5.7.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/{global-9662b435.js → global-b4e48f66.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/priv-option-list.cjs.entry.js +32 -6
- package/dist/cjs/ripple.cjs.js +2 -2
- package/dist/cjs/wm-line-chart.cjs.entry.js +7 -22
- package/dist/cjs/wm-modal.cjs.entry.js +1 -1
- package/dist/cjs/wm-nested-select.cjs.entry.js +45 -34
- package/dist/cjs/wm-optgroup.cjs.entry.js +12 -10
- package/dist/cjs/wm-option_2.cjs.entry.js +9 -9
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +7 -22
- package/dist/collection/components/selects/priv-option-list/priv-option-list.css +32 -5
- package/dist/collection/components/selects/priv-option-list/priv-option-list.js +76 -5
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +16 -4
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +46 -41
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +0 -26
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +20 -9
- package/dist/collection/components/{wm-option → selects/wm-option}/wm-option.css +1 -1
- package/dist/collection/components/{wm-option → selects/wm-option}/wm-option.js +4 -9
- package/dist/collection/components/{wm-option → selects/wm-option}/wm-option.spec.js +1 -1
- package/dist/collection/components/selects/wm-select/wm-select.css +7 -0
- package/dist/collection/components/selects/wm-select/wm-select.js +6 -6
- package/dist/collection/components/selects/wm-select/wm-select.spec.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal.js +1 -1
- package/dist/collection/dev/nested-select.js +31 -57
- package/dist/esm/{global-f1582c2f.js → global-8a4502dd.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/priv-option-list.entry.js +32 -6
- package/dist/esm/ripple.js +2 -2
- package/dist/esm/wm-line-chart.entry.js +7 -22
- package/dist/esm/wm-modal.entry.js +1 -1
- package/dist/esm/wm-nested-select.entry.js +46 -35
- package/dist/esm/wm-optgroup.entry.js +12 -10
- package/dist/esm/wm-option_2.entry.js +9 -9
- package/dist/esm-es5/{global-f1582c2f.js → global-8a4502dd.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-option-list.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-line-chart.entry.js +1 -1
- package/dist/esm-es5/wm-modal.entry.js +1 -1
- package/dist/esm-es5/wm-nested-select.entry.js +1 -1
- package/dist/esm-es5/wm-optgroup.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/ripple/p-01addccd.entry.js +1 -0
- package/dist/ripple/{p-bfeb6ef8.system.js → p-01e29a2a.system.js} +1 -1
- package/dist/ripple/p-0c259c1a.system.entry.js +1 -0
- package/dist/ripple/p-1796b85d.entry.js +1 -0
- package/dist/ripple/p-1c170fb3.entry.js +1 -0
- package/dist/ripple/p-3d02b293.system.entry.js +1 -0
- package/dist/ripple/p-45dc49e8.entry.js +1 -0
- package/dist/ripple/p-54f7d3d4.system.entry.js +1 -0
- package/dist/ripple/p-725230dd.system.entry.js +1 -0
- package/dist/ripple/{p-465d44f0.system.entry.js → p-84603f1f.system.entry.js} +1 -1
- package/dist/ripple/p-947f8f0d.system.entry.js +1 -0
- package/dist/ripple/p-99058787.entry.js +1 -0
- package/dist/ripple/p-db9f8841.system.js +1 -0
- package/dist/ripple/{p-cf55659f.js → p-de8f5e92.js} +1 -1
- package/dist/ripple/p-e687176d.entry.js +1 -0
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/charts/wm-line-chart/wm-line-chart.d.ts +1 -1
- package/dist/types/components/selects/priv-option-list/priv-option-list.d.ts +73 -0
- package/dist/types/components/selects/wm-nested-select/wm-nested-select.d.ts +58 -0
- package/dist/types/components/selects/wm-optgroup/wm-optgroup.d.ts +17 -0
- package/dist/types/components/selects/wm-option/wm-option.d.ts +40 -0
- package/dist/types/components/selects/wm-select/wm-select.d.ts +1 -0
- package/dist/types/components.d.ts +8 -2
- package/package.json +2 -2
- package/dist/ripple/p-104c0e9b.system.entry.js +0 -1
- package/dist/ripple/p-17c8aac1.system.entry.js +0 -1
- package/dist/ripple/p-24ba754f.entry.js +0 -1
- package/dist/ripple/p-2fb58947.entry.js +0 -1
- package/dist/ripple/p-4564a101.system.entry.js +0 -1
- package/dist/ripple/p-4ca5ed96.entry.js +0 -1
- package/dist/ripple/p-5b9babd9.system.entry.js +0 -1
- package/dist/ripple/p-8835adfb.entry.js +0 -1
- package/dist/ripple/p-885c3527.entry.js +0 -1
- package/dist/ripple/p-ba422994.entry.js +0 -1
- package/dist/ripple/p-cf2121f3.system.entry.js +0 -1
- package/dist/ripple/p-f6fd623f.system.js +0 -1
- /package/dist/collection/components/{wm-option → selects/wm-option}/wm-option.e2e.js +0 -0
|
@@ -6,12 +6,13 @@ const index = require('./index-e86c28b6.js');
|
|
|
6
6
|
const functions = require('./functions-e24249e6.js');
|
|
7
7
|
const intl = require('./intl-5aeba788.js');
|
|
8
8
|
|
|
9
|
-
const wmNestedSelectCss = ":host{--wmcolor-select-background:var(--wmcolor-background);--wmcolor-select-border:var(--wmcolor-input-border);--wmcolor-select-option-background-disabled:var(--wmcolor-option-background-disabled);--wmcolor-select-option-background-focus:var(--wmcolor-option-background-focus);--wmcolor-select-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-select-option-background-selected:var(--wmcolor-option-background-selected);--wmcolor-select-option-background:var(--wmcolor-option-background);--wmcolor-select-option-border:var(--wmcolor-option-border);--wmcolor-select-option-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-select-option-text:var(--wmcolor-option-text);--wmcolor-select-search-border:var(--wmcolor-input-border);--wmcolor-select-search-icon:var(--wmcolor-icon-accent);--wmcolor-select-searchresults-text:var(--wmcolor-text);--wmcolor-select-selectall-background:var(--wmcolor-select-option-background);--wmcolor-select-selectall-border:var(--wmcolor-select-option-border);--wmcolor-select-selectall-text:var(--wmcolor-interactive);--wmcolor-select-text:var(--wmcolor-interactive);position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit}.wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}.wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}.wrapper .label .required{color:var(--wmcolor-text-required)}.wrapper.label-left{-ms-flex-direction:row;flex-direction:row}.wrapper.label-left .label-wrapper{line-height:2.5rem}.wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}.wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.wrapper.invalid .label{color:var(--wmcolor-text-error)}.wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f026\";margin-left:0.3125rem}[dir=RTL] .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}.wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}.button-wrapper{position:relative;-ms-flex:1;flex:1;font-size:1.125rem;color:var(--wmcolor-select-text);min-width:8.75rem}.button-wrapper .displayedoption{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;background:var(--wmcolor-select-background);width:100%;border:solid 1px;border-color:var(--wmcolor-select-border);padding:0 1.875rem 0 0.9375rem;cursor:pointer;height:2.5rem;line-height:normal;font-family:inherit;color:var(--wmcolor-select-text);font-weight:400;font-size:0.875rem;text-transform:none;text-align:left}@media only screen and (max-width: 768px){.button-wrapper .displayedoption{height:2.75rem}}.button-wrapper .displayedoption:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f140\";position:absolute;right:0.5625rem;pointer-events:none;font-size:1.12rem}.button-wrapper .displayedoption:hover:not(:disabled):not(.-disabled):not(.-raised){background:var(--wmcolor-select-background);text-decoration:none}.button-wrapper .displayedoption:active{-ms-transform:scale(1, 1) !important;-webkit-transform:scale(1, 1) !important;transform:scale(1, 1) !important}.button-wrapper .displayedoption:focus{outline:none}.button-wrapper .displayedoption::-moz-focus-inner{border:0}.button-wrapper .displayedoption:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}.button-wrapper .displayedoption .overflowcontrol{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-ms-flex:1;flex:1}.button-wrapper .displayedoption .overflowcontrol.hassubinfo{display:-ms-flexbox;display:flex}.button-wrapper .displayedoption .overflowcontrol.hassubinfo .button-text{-ms-flex:1;flex:1;text-overflow:ellipsis;overflow:hidden;min-width:0}.button-wrapper .displayedoption .overflowcontrol.hassubinfo .subinfo{-ms-flex:none;flex:none;font-style:italic}.button-wrapper .displayedoption .overflow-counter{font-weight:bold;margin-left:0.5rem}.button-wrapper>.displayedoption[disabled]{color:#6b6b6b;border-color:#8a8a8a;background:#f0f0f0;cursor:default}.wrapper.invalid .button-wrapper .displayedoption{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}.wrapper .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:0.25rem;top:100%;left:0}.wrapper .error-message:not(:empty){margin-top:0.25rem}.dropdown{overflow-x:hidden;overflow-y:auto;-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;transform:scale(1, 0);-webkit-overflow-scrolling:touch;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;transition:transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:40;right:0;background:var(--wmcolor-select-option-background);z-index:100;width:100%;font-size:0.875rem}.dropdown.upwards{top:unset;bottom:
|
|
9
|
+
const wmNestedSelectCss = ":host{--wmcolor-select-background:var(--wmcolor-background);--wmcolor-select-border:var(--wmcolor-input-border);--wmcolor-select-option-background-disabled:var(--wmcolor-option-background-disabled);--wmcolor-select-option-background-focus:var(--wmcolor-option-background-focus);--wmcolor-select-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-select-option-background-selected:var(--wmcolor-option-background-selected);--wmcolor-select-option-background:var(--wmcolor-option-background);--wmcolor-select-option-border:var(--wmcolor-option-border);--wmcolor-select-option-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-select-option-text:var(--wmcolor-option-text);--wmcolor-select-search-border:var(--wmcolor-input-border);--wmcolor-select-search-icon:var(--wmcolor-icon-accent);--wmcolor-select-searchresults-text:var(--wmcolor-text);--wmcolor-select-selectall-background:var(--wmcolor-select-option-background);--wmcolor-select-selectall-border:var(--wmcolor-select-option-border);--wmcolor-select-selectall-text:var(--wmcolor-interactive);--wmcolor-select-text:var(--wmcolor-interactive);position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit}.wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}.wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}.wrapper .label .required{color:var(--wmcolor-text-required)}.wrapper.label-left{-ms-flex-direction:row;flex-direction:row}.wrapper.label-left .label-wrapper{line-height:2.5rem}.wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}.wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.wrapper.invalid .label{color:var(--wmcolor-text-error)}.wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f026\";margin-left:0.3125rem}[dir=RTL] .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}.wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}.button-wrapper{position:relative;-ms-flex:1;flex:1;font-size:1.125rem;color:var(--wmcolor-select-text);min-width:8.75rem}.button-wrapper .displayedoption{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;background:var(--wmcolor-select-background);width:100%;border:solid 1px;border-color:var(--wmcolor-select-border);padding:0 1.875rem 0 0.9375rem;cursor:pointer;height:2.5rem;line-height:normal;font-family:inherit;color:var(--wmcolor-select-text);font-weight:400;font-size:0.875rem;text-transform:none;text-align:left}@media only screen and (max-width: 768px){.button-wrapper .displayedoption{height:2.75rem}}.button-wrapper .displayedoption:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f140\";position:absolute;right:0.5625rem;pointer-events:none;font-size:1.12rem}.button-wrapper .displayedoption.expanded:before{content:\"\\f143\"}.button-wrapper .displayedoption:hover:not(:disabled):not(.-disabled):not(.-raised){background:var(--wmcolor-select-background);text-decoration:none}.button-wrapper .displayedoption:active{-ms-transform:scale(1, 1) !important;-webkit-transform:scale(1, 1) !important;transform:scale(1, 1) !important}.button-wrapper .displayedoption:focus{outline:none}.button-wrapper .displayedoption::-moz-focus-inner{border:0}.button-wrapper .displayedoption:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}.button-wrapper .displayedoption .overflowcontrol{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-ms-flex:1;flex:1}.button-wrapper .displayedoption .overflowcontrol.hassubinfo{display:-ms-flexbox;display:flex}.button-wrapper .displayedoption .overflowcontrol.hassubinfo .button-text{-ms-flex:1;flex:1;text-overflow:ellipsis;overflow:hidden;min-width:0}.button-wrapper .displayedoption .overflowcontrol.hassubinfo .subinfo{-ms-flex:none;flex:none;font-style:italic}.button-wrapper .displayedoption .overflow-counter{font-weight:bold;margin-left:0.5rem}.button-wrapper>.displayedoption[disabled]{color:#6b6b6b;border-color:#8a8a8a;background:#f0f0f0;cursor:default}.wrapper.invalid .button-wrapper .displayedoption{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}.wrapper .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:0.25rem;top:100%;left:0}.wrapper .error-message:not(:empty){margin-top:0.25rem}.dropdown{overflow-x:hidden;overflow-y:auto;-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;transform:scale(1, 0);-webkit-overflow-scrolling:touch;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;transition:transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:40;right:0;background:var(--wmcolor-select-option-background);z-index:100;width:100%;font-size:0.875rem}.dropdown.upwards{top:unset;bottom:100%;-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.dropdown.hidden{visibility:hidden}.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}.menu{width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.menu.hidden{position:absolute}.menu .menuitem{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;cursor:pointer;position:relative;padding:1.25rem;background:var(--wmcolor-select-option-background);font-family:inherit;list-style:none;color:var(--wmcolor-select-option-text);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:none;font-weight:600}.menu .menuitem:not(:last-child){border-bottom:2px solid;border-color:var(--wmcolor-select-option-border)}.menu :focus{outline:none;background:var(--wmcolor-interactive-background-focus)}.menu :hover{background:var(--wmcolor-select-option-background-hover);outline:none}.group-btn:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f142\";position:absolute;right:1.25rem;pointer-events:none;font-size:1.12rem}.selection-count{margin-right:20px;font-weight:400;font-style:italic}.option-list-wrapper{background:white;width:100%;-webkit-transform:translateX(0%);transform:translateX(0%);-webkit-transition:-webkit-transform 0.2s cubic-bezier(0.04, 0, 0.2, 1);transition:-webkit-transform 0.2s cubic-bezier(0.04, 0, 0.2, 1);transition:transform 0.2s cubic-bezier(0.04, 0, 0.2, 1);transition:transform 0.2s cubic-bezier(0.04, 0, 0.2, 1), -webkit-transform 0.2s cubic-bezier(0.04, 0, 0.2, 1)}.option-list-wrapper.hidden{-webkit-transform:translateX(100%);transform:translateX(100%);position:absolute;top:0px}.measurement-area{position:absolute;visibility:hidden;height:0px;pointer-events:none}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}";
|
|
10
10
|
|
|
11
11
|
const NestedSelect = class {
|
|
12
12
|
constructor(hostRef) {
|
|
13
13
|
index.registerInstance(this, hostRef);
|
|
14
14
|
this.wmNestedSelectBlurred = index.createEvent(this, "wmNestedSelectBlurred", 7);
|
|
15
|
+
this.openUp = false;
|
|
15
16
|
this.overflowCount = 0;
|
|
16
17
|
this.displayedOptions = [];
|
|
17
18
|
this.clearSelectionMessage = this.multiple
|
|
@@ -56,7 +57,7 @@ const NestedSelect = class {
|
|
|
56
57
|
description: "Text displayed when all options are selected",
|
|
57
58
|
});
|
|
58
59
|
this.isExpanded = false;
|
|
59
|
-
this.
|
|
60
|
+
this.showClearSelectionButton = false;
|
|
60
61
|
}
|
|
61
62
|
get isDisabled() {
|
|
62
63
|
// string "false" needs to be treated as bool False because react wrappers convert bool to string.
|
|
@@ -85,7 +86,6 @@ const NestedSelect = class {
|
|
|
85
86
|
}
|
|
86
87
|
componentDidLoad() {
|
|
87
88
|
if (this.maxHeight) {
|
|
88
|
-
// this.listboxEl.style.maxHeight = this.maxHeight;
|
|
89
89
|
this.dropdownEl.style.maxHeight = this.maxHeight;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -106,14 +106,14 @@ const NestedSelect = class {
|
|
|
106
106
|
const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
|
|
107
107
|
const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
|
|
108
108
|
const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
|
|
109
|
-
let optionsWidths = this.displayedOptions.map((x) => x.shadowRoot.querySelector(".option-text").clientWidth);
|
|
110
|
-
let optionsTotalWidth = optionsWidths.reduce((acc, x) => acc + x, 0);
|
|
111
109
|
this.overflowCount = 0;
|
|
110
|
+
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
111
|
+
let optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
112
112
|
while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
|
|
113
113
|
this.overflowCount++;
|
|
114
|
-
optionsTotalWidth -= optionsWidths[optionsWidths.length - 1];
|
|
115
|
-
optionsWidths.pop();
|
|
116
114
|
this.displayedOptions.pop();
|
|
115
|
+
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
116
|
+
optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
@@ -133,17 +133,12 @@ const NestedSelect = class {
|
|
|
133
133
|
closePopupOnEscape() {
|
|
134
134
|
this.close();
|
|
135
135
|
}
|
|
136
|
-
handleOptionKeyLeft(ev) {
|
|
137
|
-
const parentOptgroup = ev.detail.parentElement;
|
|
138
|
-
parentOptgroup.isExpanded = false;
|
|
139
|
-
this.focusFirstMenuitem();
|
|
140
|
-
}
|
|
141
136
|
close(returnFocus = true) {
|
|
142
137
|
if (this.isExpanded) {
|
|
143
138
|
this.isExpanded = false;
|
|
144
|
-
this.
|
|
139
|
+
this.dropdownEl.classList.remove("open");
|
|
145
140
|
window.setTimeout(() => {
|
|
146
|
-
this.
|
|
141
|
+
this.optgroupEls.forEach((optgroupEl) => (optgroupEl.isExpanded = false));
|
|
147
142
|
if (returnFocus) {
|
|
148
143
|
this.buttonEl.focus();
|
|
149
144
|
}
|
|
@@ -151,12 +146,16 @@ const NestedSelect = class {
|
|
|
151
146
|
}
|
|
152
147
|
}
|
|
153
148
|
open() {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
this.
|
|
159
|
-
|
|
149
|
+
if (!this.isDisabled) {
|
|
150
|
+
this.showClearSelectionButton = this.childOptions.some((o) => o.selected);
|
|
151
|
+
this.isExpanded = true;
|
|
152
|
+
this.dropdownEl.classList.add("open");
|
|
153
|
+
const elHeight = this.el.clientHeight;
|
|
154
|
+
this.openUp = functions.shouldOpenUp(this.el, this.dropdownEl.clientHeight, elHeight, 0);
|
|
155
|
+
window.requestAnimationFrame(() => {
|
|
156
|
+
this.focusFirstMenuitem();
|
|
157
|
+
});
|
|
158
|
+
}
|
|
160
159
|
}
|
|
161
160
|
focusFirstMenuitem() {
|
|
162
161
|
if (this.menuitemEls.length > 0) {
|
|
@@ -224,10 +223,16 @@ const NestedSelect = class {
|
|
|
224
223
|
}
|
|
225
224
|
}
|
|
226
225
|
handleOptgroupExpanded() {
|
|
227
|
-
this.
|
|
226
|
+
this.menuEl.classList.add("hidden");
|
|
227
|
+
this.optListWrapperEl.classList.remove("hidden");
|
|
228
228
|
}
|
|
229
|
-
handleOptgroupHidden() {
|
|
230
|
-
this.
|
|
229
|
+
handleOptgroupHidden(ev) {
|
|
230
|
+
this.showClearSelectionButton = this.childOptions.some((o) => o.selected);
|
|
231
|
+
this.menuEl.classList.remove("hidden");
|
|
232
|
+
this.optListWrapperEl.classList.add("hidden");
|
|
233
|
+
// focus back to nested select
|
|
234
|
+
const elToFocus = this.el.shadowRoot.querySelector(`button[data-label=${ev.detail}]`);
|
|
235
|
+
elToFocus.focus();
|
|
231
236
|
}
|
|
232
237
|
renderButtonText() {
|
|
233
238
|
if (this.displayedOptions.length < 1) {
|
|
@@ -241,29 +246,35 @@ const NestedSelect = class {
|
|
|
241
246
|
}
|
|
242
247
|
}
|
|
243
248
|
renderOverflowCount() {
|
|
244
|
-
// TODO overflow count not appearing due to refactor, in both regular select and nested select
|
|
245
249
|
if (this.overflowCount > 0) {
|
|
246
250
|
return (index.h("span", null, index.h("span", { class: "overflow-counter" }, "+", this.overflowCount)));
|
|
247
251
|
}
|
|
248
252
|
}
|
|
249
253
|
handleClearSelection() {
|
|
250
254
|
this.optgroupEls.forEach((optgroupEl) => optgroupEl.emitDeselection());
|
|
255
|
+
if (!this.multiple) {
|
|
256
|
+
this.close();
|
|
257
|
+
}
|
|
251
258
|
}
|
|
252
259
|
renderClearSelectionButton() {
|
|
253
|
-
|
|
254
|
-
if (selectedCount) {
|
|
260
|
+
if (this.showClearSelectionButton) {
|
|
255
261
|
return (index.h("button", { class: "menuitem", onClick: () => this.handleClearSelection(), tabindex: -1, onKeyDown: (ev) => this.handleMenuitemKeydown(ev) }, this.clearSelectionMessage));
|
|
256
262
|
}
|
|
257
263
|
}
|
|
258
264
|
renderSelectionCount(optgroupEl) {
|
|
259
265
|
const selectionCount = this.countOptgroupSelected(optgroupEl);
|
|
260
266
|
if (selectionCount) {
|
|
261
|
-
const
|
|
262
|
-
id: "select.
|
|
263
|
-
defaultMessage: "
|
|
264
|
-
description: "Text indicating number of selected in a group.",
|
|
267
|
+
const singleSelectionCountMessage = functions.intl.formatMessage({
|
|
268
|
+
id: "select.optgroupSingleSelectionCount",
|
|
269
|
+
defaultMessage: "Item Selected",
|
|
270
|
+
description: "Text indicating number of selected in a group, where only a single selection is possible.",
|
|
271
|
+
}, { numSelected: selectionCount });
|
|
272
|
+
const multipleSelectionCountMessage = functions.intl.formatMessage({
|
|
273
|
+
id: "select.optgroupMultipleSelectionCount",
|
|
274
|
+
defaultMessage: "{numSelected} Selected",
|
|
275
|
+
description: "Text indicating number of selected in a group, where multiple selections are possible.",
|
|
265
276
|
}, { numSelected: selectionCount });
|
|
266
|
-
return (index.h("div", { class: "selection-count" }, index.h("span", null,
|
|
277
|
+
return (index.h("div", { class: "selection-count" }, index.h("span", null, this.multiple ? multipleSelectionCountMessage : singleSelectionCountMessage)));
|
|
267
278
|
}
|
|
268
279
|
}
|
|
269
280
|
render() {
|
|
@@ -280,12 +291,12 @@ const NestedSelect = class {
|
|
|
280
291
|
};
|
|
281
292
|
return (index.h(index.Host, { onBlur: (ev) => this.handleComponentBlur(ev) }, index.h("div", { class: `wrapper ${functions.getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, index.h("div", { class: "label-wrapper" }, index.h("label", { class: "label", id: "label", htmlFor: "selectbtn" }, this.label,
|
|
282
293
|
// we can't use aria-required or required attributes because it's invalid on the elements we're using (button controlling a listbox)
|
|
283
|
-
this.requiredField ? (index.h("span", { class: "required" }, index.h("span", { class: "sr-only" }, intl.globalMessages.requiredField), index.h("span", { "aria-hidden": "true" }, "*"))) : (""))), index.h("div", { class: "button-wrapper" }, index.h("button", Object.assign({}, buttonProps, { class:
|
|
284
|
-
return (index.h("button", { class: "menuitem group-btn", role: "menuitem", tabindex: -1, onClick: () => {
|
|
294
|
+
this.requiredField ? (index.h("span", { class: "required" }, index.h("span", { class: "sr-only" }, intl.globalMessages.requiredField), index.h("span", { "aria-hidden": "true" }, "*"))) : (""))), index.h("div", { class: "button-wrapper" }, index.h("button", Object.assign({}, buttonProps, { class: `displayedoption ${this.isExpanded ? "expanded" : ""}`, ref: (el) => (this.buttonEl = el), onBlur: (ev) => this.handleButtonBlur(ev), onFocus: () => this.close() }), index.h("span", { class: "overflowcontrol" }, index.h("span", { class: "button-text" }, this.renderButtonText())), this.renderOverflowCount(), index.h("div", { ref: (el) => (this.measurementAreaEl = el), class: "measurement-area", "aria-hidden": "true" })), index.h("div", { class: `dropdown ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, index.h("div", { ref: (el) => (this.menuEl = el), class: "menu" }, this.renderClearSelectionButton(), this.optgroupEls.map((optgroupEl) => {
|
|
295
|
+
return (index.h("button", { class: "menuitem group-btn", role: "menuitem", "data-label": optgroupEl.label, tabindex: -1, onClick: () => {
|
|
285
296
|
optgroupEl.isExpanded = !optgroupEl.isExpanded;
|
|
286
297
|
index.forceUpdate(this.el);
|
|
287
298
|
}, onKeyDown: (ev) => this.handleMenuitemKeydown(ev) }, index.h("span", null, optgroupEl.label), this.renderSelectionCount(optgroupEl)));
|
|
288
|
-
})), index.h("div", {
|
|
299
|
+
})), index.h("div", { ref: (el) => (this.optListWrapperEl = el), class: "option-list-wrapper hidden" }, index.h("slot", null))), index.h("div", { id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage)))));
|
|
289
300
|
}
|
|
290
301
|
static get delegatesFocus() { return true; }
|
|
291
302
|
get el() { return index.getElement(this); }
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-e86c28b6.js');
|
|
6
6
|
|
|
7
|
-
const wmOptgroupCss = ":host{width:100%;display:none}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host(.visible){display:unset}
|
|
7
|
+
const wmOptgroupCss = ":host{width:100%;display:none}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host(.visible){display:unset}";
|
|
8
8
|
|
|
9
9
|
const Optgroup = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -22,6 +22,7 @@ const Optgroup = class {
|
|
|
22
22
|
}
|
|
23
23
|
isExpandedChanged() {
|
|
24
24
|
if (this.isExpanded) {
|
|
25
|
+
this.el.classList.add("visible");
|
|
25
26
|
this.optgroupExpanded.emit();
|
|
26
27
|
window.setTimeout(() => {
|
|
27
28
|
// wait for slide in animation to complete before assigning focus
|
|
@@ -29,21 +30,22 @@ const Optgroup = class {
|
|
|
29
30
|
}, 250);
|
|
30
31
|
}
|
|
31
32
|
else {
|
|
32
|
-
this.optgroupHidden.emit();
|
|
33
|
+
this.optgroupHidden.emit(this.label);
|
|
34
|
+
this.optionListEl.clearSearch();
|
|
35
|
+
window.setTimeout(() => {
|
|
36
|
+
// wait for slide out animation to complete before hiding
|
|
37
|
+
this.el.classList.remove("visible");
|
|
38
|
+
}, 250);
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
41
|
async emitDeselection() {
|
|
36
42
|
this.wmOptgroupAllDeselected.emit();
|
|
37
43
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
*/
|
|
44
|
+
handleOptionKeyLeft() {
|
|
45
|
+
this.isExpanded = false;
|
|
46
|
+
}
|
|
43
47
|
render() {
|
|
44
|
-
return (index.h(index.Host,
|
|
45
|
-
this.isExpanded = false;
|
|
46
|
-
} }, this.label), index.h("div", { class: `list-wrapper` }, index.h("priv-option-list", { ref: (el) => (this.optionListEl = el), multiple: this.parentNestedSelect.multiple, search: this.parentNestedSelect.search, searchPlaceholder: this.parentNestedSelect.searchPlaceholder, selectAll: this.parentNestedSelect.selectAll, onOptionListAllSelected: () => this.wmOptgroupAllSelected.emit(), onOptionListAllDeselected: () => this.wmOptgroupAllDeselected.emit() }, index.h("slot", null)))));
|
|
48
|
+
return (index.h(index.Host, null, index.h("div", { class: `list-wrapper` }, index.h("priv-option-list", { ref: (el) => (this.optionListEl = el), multiple: this.parentNestedSelect.multiple, search: this.parentNestedSelect.search, searchPlaceholder: this.parentNestedSelect.searchPlaceholder, optgroupLabel: this.label, selectAll: this.parentNestedSelect.selectAll, onOptionListAllSelected: () => this.wmOptgroupAllSelected.emit(), onOptionListAllDeselected: () => this.wmOptgroupAllDeselected.emit() }, index.h("slot", null)))));
|
|
47
49
|
}
|
|
48
50
|
static get delegatesFocus() { return true; }
|
|
49
51
|
get el() { return index.getElement(this); }
|
|
@@ -6,7 +6,7 @@ const index = require('./index-e86c28b6.js');
|
|
|
6
6
|
const functions = require('./functions-e24249e6.js');
|
|
7
7
|
const intl = require('./intl-5aeba788.js');
|
|
8
8
|
|
|
9
|
-
const wmOptionCss = ":host(:not(:last-child)){border-bottom:2px solid;border-color:var(--wmcolor-select-option-border)}:host{display:block;cursor:pointer;position:relative;padding:1.25rem;background:var(--wmcolor-select-option-background);font-family:inherit;list-style:none;color:var(--wmcolor-select-option-text);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host:focus,:host.focus{outline:none;background:var(--wmcolor-select-option-background-focus)}:host.icon{color:var(--wmcolor-interactive)}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.checkbox:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f131\";display:inline-block;margin-right:0.25rem;color:var(--wmcolor-interactive)}:host([aria-selected=true]){background:var(--wmcolor-select-option-background-selected);font-weight:500}:host([aria-selected=true]) .checkbox:before{content:\"\\f132\"}:host([aria-disabled=true]){color:var(--wmcolor-select-option-text-disabled);background:var(--wmcolor-select-option-background-disabled);cursor:default}:host([aria-disabled=true]) .checkbox:before{color:var(--wmcolor-select-option-text-disabled)}:host([aria-disabled=true]) .subinfo{color:var(--wmcolor-select-option-text-disabled)}:host(.multi-option){background:unset}:host(.clone.last){border-bottom:12px solid;border-color:var(--wmcolor-select-option-border)}:host(.hassubinfo){display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;gap:16px}:host(.hidden),:host(.filtered-out){display:none}.subinfo{font-style:italic}.option-wrapper{display:-ms-flexbox;display:flex}.option-text{display:inline-block}::slotted{font-family:inherit}::slotted(i){font-size:0.875rem}::slotted(i):before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:0.625rem;pointer-events:none}:host(:focus){outline:none;background:var(--wmcolor-select-option-background-
|
|
9
|
+
const wmOptionCss = ":host(:not(:last-child)){border-bottom:2px solid;border-color:var(--wmcolor-select-option-border)}:host{display:block;cursor:pointer;position:relative;padding:1.25rem;background:var(--wmcolor-select-option-background);font-family:inherit;list-style:none;color:var(--wmcolor-select-option-text);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host:focus,:host.focus{outline:none;background:var(--wmcolor-select-option-background-focus)}:host.icon{color:var(--wmcolor-interactive)}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.checkbox:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f131\";display:inline-block;margin-right:0.25rem;color:var(--wmcolor-interactive)}:host([aria-selected=true]){background:var(--wmcolor-select-option-background-selected);font-weight:500}:host([aria-selected=true]) .checkbox:before{content:\"\\f132\"}:host([aria-disabled=true]){color:var(--wmcolor-select-option-text-disabled);background:var(--wmcolor-select-option-background-disabled);cursor:default}:host([aria-disabled=true]) .checkbox:before{color:var(--wmcolor-select-option-text-disabled)}:host([aria-disabled=true]) .subinfo{color:var(--wmcolor-select-option-text-disabled)}:host(.multi-option){background:unset}:host(.clone.last){border-bottom:12px solid;border-color:var(--wmcolor-select-option-border)}:host(.hassubinfo){display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;gap:16px}:host(.hidden),:host(.filtered-out){display:none}.subinfo{font-style:italic}.option-wrapper{display:-ms-flexbox;display:flex}.option-text{display:inline-block}::slotted{font-family:inherit}::slotted(i){font-size:0.875rem}::slotted(i):before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:0.625rem;pointer-events:none}:host(:focus){outline:none;background:var(--wmcolor-select-option-background-focus)}:host(:hover){background:var(--wmcolor-select-option-background-hover);outline:none}";
|
|
10
10
|
|
|
11
11
|
const Option = class {
|
|
12
12
|
constructor(hostRef) {
|
|
@@ -83,7 +83,7 @@ const Option = class {
|
|
|
83
83
|
break;
|
|
84
84
|
case "ArrowLeft":
|
|
85
85
|
ev.preventDefault();
|
|
86
|
-
this.wmKeyLeftPressed.emit(
|
|
86
|
+
this.wmKeyLeftPressed.emit();
|
|
87
87
|
break;
|
|
88
88
|
default:
|
|
89
89
|
if (ev.key.length === 1) {
|
|
@@ -175,7 +175,7 @@ const Option = class {
|
|
|
175
175
|
};
|
|
176
176
|
Option.style = wmOptionCss;
|
|
177
177
|
|
|
178
|
-
const wmSelectCss = ":host{--wmcolor-select-background:var(--wmcolor-background);--wmcolor-select-border:var(--wmcolor-input-border);--wmcolor-select-option-background-disabled:var(--wmcolor-option-background-disabled);--wmcolor-select-option-background-focus:var(--wmcolor-option-background-focus);--wmcolor-select-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-select-option-background-selected:var(--wmcolor-option-background-selected);--wmcolor-select-option-background:var(--wmcolor-option-background);--wmcolor-select-option-border:var(--wmcolor-option-border);--wmcolor-select-option-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-select-option-text:var(--wmcolor-option-text);--wmcolor-select-search-border:var(--wmcolor-input-border);--wmcolor-select-search-icon:var(--wmcolor-icon-accent);--wmcolor-select-searchresults-text:var(--wmcolor-text);--wmcolor-select-selectall-background:var(--wmcolor-select-option-background);--wmcolor-select-selectall-border:var(--wmcolor-select-option-border);--wmcolor-select-selectall-text:var(--wmcolor-interactive);--wmcolor-select-text:var(--wmcolor-interactive);position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}.wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}.wrapper .label .required{color:var(--wmcolor-text-required)}.wrapper.label-left{-ms-flex-direction:row;flex-direction:row}.wrapper.label-left .label-wrapper{line-height:2.5rem}.wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}.wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.wrapper.invalid .label{color:var(--wmcolor-text-error)}.wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f026\";margin-left:0.3125rem}[dir=RTL] .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}.wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}.wrapper .button-wrapper{position:relative;-ms-flex:1;flex:1;font-size:1.125rem;color:var(--wmcolor-select-text);min-width:8.75rem}.wrapper .button-wrapper .displayedoption{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;background:var(--wmcolor-select-background);width:100%;border:solid 1px;border-color:var(--wmcolor-select-border);padding:0 1.875rem 0 0.9375rem;cursor:pointer;height:2.5rem;line-height:normal;font-family:inherit;color:var(--wmcolor-select-text);font-weight:400;font-size:0.875rem;text-transform:none;text-align:left}@media only screen and (max-width: 768px){.wrapper .button-wrapper .displayedoption{height:2.75rem}}.wrapper .button-wrapper .displayedoption:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f140\";position:absolute;right:0.5625rem;pointer-events:none;font-size:1.12rem}.wrapper .button-wrapper .displayedoption:hover:not(:disabled):not(.-disabled):not(.-raised){background:var(--wmcolor-select-background);text-decoration:none}.wrapper .button-wrapper .displayedoption:active{-ms-transform:scale(1, 1) !important;-webkit-transform:scale(1, 1) !important;transform:scale(1, 1) !important}.wrapper .button-wrapper .displayedoption:focus{outline:none}.wrapper .button-wrapper .displayedoption::-moz-focus-inner{border:0}.wrapper .button-wrapper .displayedoption:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}.wrapper .button-wrapper .displayedoption .overflowcontrol{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-ms-flex:1;flex:1}.wrapper .button-wrapper .displayedoption .overflowcontrol.hassubinfo{display:-ms-flexbox;display:flex}.wrapper .button-wrapper .displayedoption .overflowcontrol.hassubinfo .button-text{-ms-flex:1;flex:1;text-overflow:ellipsis;overflow:hidden;min-width:0}.wrapper .button-wrapper .displayedoption .overflowcontrol.hassubinfo .subinfo{-ms-flex:none;flex:none;font-style:italic}.wrapper .button-wrapper .displayedoption .overflow-counter{font-weight:bold;margin-left:0.5rem}.wrapper .button-wrapper>.displayedoption[disabled]{color:#6b6b6b;border-color:#8a8a8a;background:#f0f0f0;cursor:default}.wrapper .button-wrapper>.dropdown{-webkit-overflow-scrolling:touch;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:0;right:0;background:var(--wmcolor-select-option-background);z-index:100;width:100%;font-size:0.875rem}.wrapper .button-wrapper>.dropdown.upwards{top:unset;bottom:calc(100% - 2.5rem);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.wrapper .button-wrapper>.dropdown.hidden{visibility:hidden}.wrapper .button-wrapper>.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}.wrapper.invalid .button-wrapper .displayedoption{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}.wrapper .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:0.25rem;top:100%;left:0}.wrapper .error-message:not(:empty){margin-top:0.25rem}.options-wrapper{max-height:12.5rem;overflow:auto}.rtl>.dropdown{-ms-transform-origin:left top;-webkit-transform-origin:left top;-moz-transform-origin:left top;transform-origin:left top;left:0;right:auto}.rtl>.dropdown .option{padding-left:3rem;padding-right:1.25rem}.rtl>.displayedoption{padding:0 0.9375rem 0 1.875rem;text-align:right}.rtl>.displayedoption:before{right:auto;left:0.5625rem}";
|
|
178
|
+
const wmSelectCss = ":host{--wmcolor-select-background:var(--wmcolor-background);--wmcolor-select-border:var(--wmcolor-input-border);--wmcolor-select-option-background-disabled:var(--wmcolor-option-background-disabled);--wmcolor-select-option-background-focus:var(--wmcolor-option-background-focus);--wmcolor-select-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-select-option-background-selected:var(--wmcolor-option-background-selected);--wmcolor-select-option-background:var(--wmcolor-option-background);--wmcolor-select-option-border:var(--wmcolor-option-border);--wmcolor-select-option-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-select-option-text:var(--wmcolor-option-text);--wmcolor-select-search-border:var(--wmcolor-input-border);--wmcolor-select-search-icon:var(--wmcolor-icon-accent);--wmcolor-select-searchresults-text:var(--wmcolor-text);--wmcolor-select-selectall-background:var(--wmcolor-select-option-background);--wmcolor-select-selectall-border:var(--wmcolor-select-option-border);--wmcolor-select-selectall-text:var(--wmcolor-interactive);--wmcolor-select-text:var(--wmcolor-interactive);position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}.wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}.wrapper .label .required{color:var(--wmcolor-text-required)}.wrapper.label-left{-ms-flex-direction:row;flex-direction:row}.wrapper.label-left .label-wrapper{line-height:2.5rem}.wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}.wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.wrapper.invalid .label{color:var(--wmcolor-text-error)}.wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f026\";margin-left:0.3125rem}[dir=RTL] .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}.wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}.wrapper .button-wrapper{position:relative;-ms-flex:1;flex:1;font-size:1.125rem;color:var(--wmcolor-select-text);min-width:8.75rem}.wrapper .button-wrapper .displayedoption{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;background:var(--wmcolor-select-background);width:100%;border:solid 1px;border-color:var(--wmcolor-select-border);padding:0 1.875rem 0 0.9375rem;cursor:pointer;height:2.5rem;line-height:normal;font-family:inherit;color:var(--wmcolor-select-text);font-weight:400;font-size:0.875rem;text-transform:none;text-align:left}@media only screen and (max-width: 768px){.wrapper .button-wrapper .displayedoption{height:2.75rem}}.wrapper .button-wrapper .displayedoption:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f140\";position:absolute;right:0.5625rem;pointer-events:none;font-size:1.12rem}.wrapper .button-wrapper .displayedoption:hover:not(:disabled):not(.-disabled):not(.-raised){background:var(--wmcolor-select-background);text-decoration:none}.wrapper .button-wrapper .displayedoption:active{-ms-transform:scale(1, 1) !important;-webkit-transform:scale(1, 1) !important;transform:scale(1, 1) !important}.wrapper .button-wrapper .displayedoption:focus{outline:none}.wrapper .button-wrapper .displayedoption::-moz-focus-inner{border:0}.wrapper .button-wrapper .displayedoption:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}.wrapper .button-wrapper .displayedoption .overflowcontrol{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-ms-flex:1;flex:1}.wrapper .button-wrapper .displayedoption .overflowcontrol.hassubinfo{display:-ms-flexbox;display:flex}.wrapper .button-wrapper .displayedoption .overflowcontrol.hassubinfo .button-text{-ms-flex:1;flex:1;text-overflow:ellipsis;overflow:hidden;min-width:0}.wrapper .button-wrapper .displayedoption .overflowcontrol.hassubinfo .subinfo{-ms-flex:none;flex:none;font-style:italic}.wrapper .button-wrapper .displayedoption .overflow-counter{font-weight:bold;margin-left:0.5rem}.wrapper .button-wrapper>.displayedoption[disabled]{color:#6b6b6b;border-color:#8a8a8a;background:#f0f0f0;cursor:default}.wrapper .button-wrapper>.dropdown{-webkit-overflow-scrolling:touch;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:0;right:0;background:var(--wmcolor-select-option-background);z-index:100;width:100%;font-size:0.875rem}.wrapper .button-wrapper>.dropdown.upwards{top:unset;bottom:calc(100% - 2.5rem);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.wrapper .button-wrapper>.dropdown.hidden{visibility:hidden}.wrapper .button-wrapper>.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}.wrapper.invalid .button-wrapper .displayedoption{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}.wrapper .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:0.25rem;top:100%;left:0}.wrapper .error-message:not(:empty){margin-top:0.25rem}.options-wrapper{max-height:12.5rem;overflow:auto}.measurement-area{position:absolute;visibility:hidden;height:0px;pointer-events:none}.rtl>.dropdown{-ms-transform-origin:left top;-webkit-transform-origin:left top;-moz-transform-origin:left top;transform-origin:left top;left:0;right:auto}.rtl>.dropdown .option{padding-left:3rem;padding-right:1.25rem}.rtl>.displayedoption{padding:0 0.9375rem 0 1.875rem;text-align:right}.rtl>.displayedoption:before{right:auto;left:0.5625rem}";
|
|
179
179
|
|
|
180
180
|
const Select = class {
|
|
181
181
|
constructor(hostRef) {
|
|
@@ -298,8 +298,8 @@ const Select = class {
|
|
|
298
298
|
handleChildChange(_) {
|
|
299
299
|
// on update of children or children selected state, reset button text and rerender
|
|
300
300
|
this.setButtonText();
|
|
301
|
-
index.forceUpdate(this.el);
|
|
302
301
|
this.optionListEl.handleChildChange(_);
|
|
302
|
+
index.forceUpdate(this.el);
|
|
303
303
|
}
|
|
304
304
|
componentDidLoad() {
|
|
305
305
|
this.wmSelectDidLoad.emit();
|
|
@@ -377,14 +377,14 @@ const Select = class {
|
|
|
377
377
|
const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
|
|
378
378
|
const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
|
|
379
379
|
const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
|
|
380
|
-
let optionsWidths = this.displayedOptions.map((x) => x.shadowRoot.querySelector(".option-text").clientWidth);
|
|
381
|
-
let optionsTotalWidth = optionsWidths.reduce((acc, x) => acc + x, 0);
|
|
382
380
|
this.overflowCount = 0;
|
|
381
|
+
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
382
|
+
let optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
383
383
|
while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
|
|
384
384
|
this.overflowCount++;
|
|
385
|
-
optionsTotalWidth -= optionsWidths[optionsWidths.length - 1];
|
|
386
|
-
optionsWidths.pop();
|
|
387
385
|
this.displayedOptions.pop();
|
|
386
|
+
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
387
|
+
optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
}
|
|
@@ -424,7 +424,7 @@ const Select = class {
|
|
|
424
424
|
};
|
|
425
425
|
return (index.h(index.Host, { onBlur: (ev) => this.handleComponentBlur(ev) }, index.h("div", { class: `wrapper ${functions.getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, index.h("div", { class: "label-wrapper" }, index.h("label", { class: "label", id: "label", htmlFor: "selectbtn" }, this.label,
|
|
426
426
|
// we can't use aria-required or required attributes because it's invalid on the elements we're using (button controlling a listbox)
|
|
427
|
-
this.requiredField ? (index.h("span", { class: "required" }, index.h("span", { class: "sr-only" }, intl.globalMessages.requiredField), index.h("span", { "aria-hidden": "true" }, "*"))) : (""))), index.h("div", { class: "button-wrapper" }, index.h("button", Object.assign({}, buttonProps, { class: "displayedoption", ref: (el) => (this.buttonEl = el), onBlur: (ev) => this.handleButtonBlur(ev), onFocus: () => this.close() }), index.h("span", { class: `overflowcontrol ${showSubinfo ? "hassubinfo" : ""}` }, index.h("span", { class: "button-text" }, this.renderButtonText()), showSubinfo && index.h("span", { class: "subinfo" }, this.selectedOptions[0].subinfo)), this.renderOverflowCount()), index.h("div", { class: `dropdown ${this.isExpanded ? "open" : ""} ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, index.h("priv-option-list", { ref: (el) => (this.optionListEl = el), multiple: this.multiple, search: this.search, selectAll: this.selectAll, searchPlaceholder: this.searchPlaceholder, onOptionListCloseRequested: () => this.close(), onOptionListAllSelected: () => this.wmSelectAllSelected.emit(), onOptionListAllDeselected: () => this.wmSelectAllDeselected.emit() }, index.h("slot", null))), index.h("div", { id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage), index.h("div", { id: "announcement", "aria-live": "polite", "aria-atomic": "true", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
|
|
427
|
+
this.requiredField ? (index.h("span", { class: "required" }, index.h("span", { class: "sr-only" }, intl.globalMessages.requiredField), index.h("span", { "aria-hidden": "true" }, "*"))) : (""))), index.h("div", { class: "button-wrapper" }, index.h("button", Object.assign({}, buttonProps, { class: "displayedoption", ref: (el) => (this.buttonEl = el), onBlur: (ev) => this.handleButtonBlur(ev), onFocus: () => this.close() }), index.h("span", { class: `overflowcontrol ${showSubinfo ? "hassubinfo" : ""}` }, index.h("span", { class: "button-text" }, this.renderButtonText()), showSubinfo && index.h("span", { class: "subinfo" }, this.selectedOptions[0].subinfo)), this.renderOverflowCount(), index.h("div", { ref: (el) => (this.measurementAreaEl = el), class: "measurement-area", "aria-hidden": "true" })), index.h("div", { class: `dropdown ${this.isExpanded ? "open" : ""} ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, index.h("priv-option-list", { ref: (el) => (this.optionListEl = el), multiple: this.multiple, search: this.search, selectAll: this.selectAll, searchPlaceholder: this.searchPlaceholder, onOptionListCloseRequested: () => this.close(), onOptionListAllSelected: () => this.wmSelectAllSelected.emit(), onOptionListAllDeselected: () => this.wmSelectAllDeselected.emit() }, index.h("slot", null))), index.h("div", { id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage), index.h("div", { id: "announcement", "aria-live": "polite", "aria-atomic": "true", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
|
|
428
428
|
}
|
|
429
429
|
static get delegatesFocus() { return true; }
|
|
430
430
|
get el() { return index.getElement(this); }
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"components/selects/priv-option-list/priv-option-list.js",
|
|
14
14
|
"components/selects/wm-nested-select/wm-nested-select.js",
|
|
15
15
|
"components/selects/wm-optgroup/wm-optgroup.js",
|
|
16
|
+
"components/selects/wm-option/wm-option.js",
|
|
16
17
|
"components/selects/wm-select/wm-select.js",
|
|
17
|
-
"components/wm-option/wm-option.js",
|
|
18
18
|
"components/wm-action-menu/wm-action-menu.js",
|
|
19
19
|
"components/wm-menuitem/wm-menuitem.js",
|
|
20
20
|
"components/wm-button/wm-button.js",
|
|
@@ -120,7 +120,7 @@ export class LineChart {
|
|
|
120
120
|
}
|
|
121
121
|
handleDataPointKeydown(ev) {
|
|
122
122
|
const [lineIdx, pointIdx] = this.focusedDataPoint;
|
|
123
|
-
const
|
|
123
|
+
const lineLength = this.lineEls[lineIdx].querySelectorAll(".point").length;
|
|
124
124
|
const numLines = this.dataPointMatrix.length;
|
|
125
125
|
switch (ev.key) {
|
|
126
126
|
case "Tab":
|
|
@@ -149,17 +149,13 @@ export class LineChart {
|
|
|
149
149
|
break;
|
|
150
150
|
case "ArrowLeft":
|
|
151
151
|
ev.preventDefault();
|
|
152
|
-
const
|
|
153
|
-
const prevPointIdx = isFirstInLine
|
|
154
|
-
? parseInt(linePoints[linePoints.length - 1].dataset.pointidx)
|
|
155
|
-
: pointIdx - 1;
|
|
152
|
+
const prevPointIdx = wrapAround(pointIdx, -1, lineLength - 1);
|
|
156
153
|
this.focusDataPoint(lineIdx, prevPointIdx);
|
|
157
154
|
break;
|
|
158
155
|
case "ArrowRight":
|
|
159
156
|
ev.preventDefault();
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
this.focusDataPoint(lineIdx, nextPointIdx, true);
|
|
157
|
+
const nextPointIdx = wrapAround(pointIdx, 1, lineLength - 1);
|
|
158
|
+
this.focusDataPoint(lineIdx, nextPointIdx);
|
|
163
159
|
break;
|
|
164
160
|
}
|
|
165
161
|
}
|
|
@@ -175,20 +171,9 @@ export class LineChart {
|
|
|
175
171
|
const numDataPoints = this.dataPointMatrix[lineIdx].filter((datapoint) => datapoint.yValue !== null).length;
|
|
176
172
|
return `${label}, line ${lineIdx + 1} of ${this.dataPointMatrix.length} with ${numDataPoints} data points`;
|
|
177
173
|
}
|
|
178
|
-
focusDataPoint(lineIdx, pointIdx
|
|
174
|
+
focusDataPoint(lineIdx, pointIdx) {
|
|
179
175
|
const lineEl = this.lineEls[lineIdx];
|
|
180
|
-
|
|
181
|
-
while (!linePointEl) {
|
|
182
|
-
pointIdx += deferRight ? 1 : -1;
|
|
183
|
-
if (pointIdx < 0) {
|
|
184
|
-
// wrap around
|
|
185
|
-
linePointEl = lineEl.querySelectorAll(".point")[lineEl.querySelectorAll(".point").length - 1];
|
|
186
|
-
pointIdx = parseInt(linePointEl.dataset.pointidx);
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
linePointEl = lineEl.querySelector(`[data-pointidx='${pointIdx}']`);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
176
|
+
const linePointEl = lineEl.querySelectorAll(".point")[pointIdx];
|
|
192
177
|
this.pointEls.forEach((point) => (point.tabIndex = -1));
|
|
193
178
|
linePointEl.tabIndex = 0;
|
|
194
179
|
linePointEl.focus();
|
|
@@ -373,7 +358,7 @@ export class LineChart {
|
|
|
373
358
|
const changeSinceMessage = lineChartMessages.getChangeSince(prevDataPoint.xValue);
|
|
374
359
|
ariaLabel += `, ${changeSinceMessage} ${this.calcDelta(dataPoint, prevDataPoint)}`;
|
|
375
360
|
}
|
|
376
|
-
return (h("span", { id: `${lineLabel}-${pointIdx}`, role: "img", "aria-label": ariaLabel, tabIndex: firstPointTabIndex, class: "point icon", style: iconStyle, "data-lineidx": lineIdx, "data-
|
|
361
|
+
return (h("span", { id: `${lineLabel}-${pointIdx}`, role: "img", "aria-label": ariaLabel, tabIndex: firstPointTabIndex, class: "point icon", style: iconStyle, "data-lineidx": lineIdx, "data-xvalue": xValue, onKeyDown: (ev) => this.handleDataPointKeydown(ev), onFocus: () => (this.popoverIndex = pointIdx), onClick: (ev) => this.focusDataPointByEl(ev.target), onMouseEnter: () => (this.popoverIndex = pointIdx) }));
|
|
377
362
|
}
|
|
378
363
|
})));
|
|
379
364
|
}
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
font-style: italic;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
.return-btn,
|
|
84
85
|
.select-all {
|
|
85
86
|
width: 100%;
|
|
86
87
|
cursor: pointer;
|
|
@@ -88,17 +89,43 @@
|
|
|
88
89
|
border: none;
|
|
89
90
|
margin: 0;
|
|
90
91
|
border-bottom: 2px solid;
|
|
91
|
-
border-color: var(--wmcolor-select-
|
|
92
|
-
background: var(--wmcolor-select-
|
|
92
|
+
border-color: var(--wmcolor-select-option-border);
|
|
93
|
+
background: var(--wmcolor-select-option-background);
|
|
93
94
|
font-family: inherit;
|
|
94
95
|
font-size: inherit;
|
|
95
96
|
text-align: left;
|
|
96
97
|
text-align: start;
|
|
97
98
|
font-weight: 500;
|
|
98
|
-
color: var(--wmcolor-select-
|
|
99
|
+
color: var(--wmcolor-select-option-text);
|
|
99
100
|
user-select: none;
|
|
100
101
|
}
|
|
101
|
-
.
|
|
102
|
+
.return-btn:hover,
|
|
103
|
+
.select-all:hover {
|
|
104
|
+
outline: none;
|
|
105
|
+
background: var(--wmcolor-select-option-background-hover);
|
|
106
|
+
}
|
|
107
|
+
.return-btn:focus,
|
|
108
|
+
.select-all:focus {
|
|
102
109
|
outline: none;
|
|
103
|
-
background:
|
|
110
|
+
background: var(--wmcolor-select-option-background-focus);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.return-btn {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
font-weight: 600;
|
|
117
|
+
font-size: 0.875rem;
|
|
118
|
+
border-bottom: 1px solid #4a4a4a;
|
|
119
|
+
}
|
|
120
|
+
.return-btn:before {
|
|
121
|
+
display: inline-block;
|
|
122
|
+
font: normal normal normal 24px/1 "Material Design Icons";
|
|
123
|
+
font-size: inherit;
|
|
124
|
+
text-rendering: auto;
|
|
125
|
+
line-height: inherit;
|
|
126
|
+
-webkit-font-smoothing: antialiased;
|
|
127
|
+
-moz-osx-font-smoothing: grayscale;
|
|
128
|
+
content: "\f141";
|
|
129
|
+
pointer-events: none;
|
|
130
|
+
font-size: 1.28rem;
|
|
104
131
|
}
|