@maggioli-design-system/mds-input-select 3.4.4 → 3.5.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/{index-648a2952.js → index-18f29026.js} +13 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mds-input-select.cjs.entry.js +42 -20
- package/dist/cjs/mds-input-select.cjs.js +2 -2
- package/dist/collection/common/locale.js +10 -8
- package/dist/collection/common/number.js +5 -0
- package/dist/collection/common/slot.js +10 -1
- package/dist/collection/common/unit.js +16 -1
- package/dist/collection/components/mds-input-select/mds-input-select.css +7 -11
- package/dist/collection/components/mds-input-select/mds-input-select.js +60 -17
- package/dist/collection/components/mds-input-select/test/mds-input-select.stories.js +35 -20
- package/dist/collection/dictionary/button.js +20 -1
- package/dist/collection/dictionary/icon.js +1 -1
- package/dist/components/mds-input-select.js +44 -21
- package/dist/documentation.json +33 -1
- package/dist/esm/{index-e1f2fe2a.js → index-60887c04.js} +13 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mds-input-select.entry.js +42 -20
- package/dist/esm/mds-input-select.js +3 -3
- package/dist/esm-es5/index-60887c04.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-input-select.entry.js +1 -1
- package/dist/esm-es5/mds-input-select.js +1 -1
- package/dist/mds-input-select/mds-input-select.esm.js +1 -1
- package/dist/mds-input-select/mds-input-select.js +1 -1
- package/dist/mds-input-select/p-0760aca1.system.entry.js +1 -0
- package/dist/mds-input-select/p-39d143a4.system.js +1 -0
- package/dist/mds-input-select/p-41875927.js +2 -0
- package/dist/mds-input-select/p-9758de3c.entry.js +1 -0
- package/dist/mds-input-select/p-db5fddbf.system.js +2 -0
- package/dist/stats.json +85 -43
- package/dist/types/common/number.d.ts +2 -0
- package/dist/types/common/slot.d.ts +2 -1
- package/dist/types/common/unit.d.ts +3 -1
- package/dist/types/components/mds-input-select/mds-input-select.d.ts +14 -1
- package/dist/types/components/mds-input-select/test/mds-input-select.stories.d.ts +34 -6
- package/dist/types/components.d.ts +8 -0
- package/dist/types/dictionary/button.d.ts +4 -1
- package/dist/types/dictionary/icon.d.ts +1 -1
- package/dist/types/type/button.d.ts +2 -0
- package/documentation.json +59 -2
- package/package.json +1 -1
- package/readme.md +13 -12
- package/src/common/locale.ts +10 -8
- package/src/common/number.ts +8 -0
- package/src/common/slot.ts +12 -0
- package/src/common/unit.ts +23 -0
- package/src/components/mds-input-select/css/mds-input-select-pref-theme.css +6 -10
- package/src/components/mds-input-select/mds-input-select.css +3 -3
- package/src/components/mds-input-select/mds-input-select.tsx +45 -18
- package/src/components/mds-input-select/readme.md +13 -12
- package/src/components/mds-input-select/test/mds-input-select.mdx +7 -0
- package/src/components/mds-input-select/test/mds-input-select.stories.tsx +63 -31
- package/src/components.d.ts +8 -0
- package/src/dictionary/button.ts +25 -0
- package/src/dictionary/icon.ts +2 -1
- package/src/tailwind/components.css +1 -1
- package/src/type/button.ts +15 -0
- package/www/build/mds-input-select.esm.js +1 -1
- package/www/build/mds-input-select.js +1 -1
- package/www/build/p-0760aca1.system.entry.js +1 -0
- package/www/build/p-39d143a4.system.js +1 -0
- package/www/build/p-41875927.js +2 -0
- package/www/build/p-9758de3c.entry.js +1 -0
- package/www/build/p-db5fddbf.system.js +2 -0
- package/dist/esm-es5/index-e1f2fe2a.js +0 -1
- package/dist/mds-input-select/p-0a2b93c3.system.entry.js +0 -1
- package/dist/mds-input-select/p-48d4babb.entry.js +0 -1
- package/dist/mds-input-select/p-5f2a815f.system.js +0 -1
- package/dist/mds-input-select/p-bf3133aa.js +0 -2
- package/dist/mds-input-select/p-cbce7086.system.js +0 -2
- package/src/fixtures/icons.json +0 -465
- package/src/fixtures/iconsauce.json +0 -310
- package/www/build/p-0a2b93c3.system.entry.js +0 -1
- package/www/build/p-48d4babb.entry.js +0 -1
- package/www/build/p-5f2a815f.system.js +0 -1
- package/www/build/p-bf3133aa.js +0 -2
- package/www/build/p-cbce7086.system.js +0 -2
|
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'mds-input-select';
|
|
24
|
-
const BUILD = /* mds-input-select */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: true, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: true, hydratedClass: false, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef:
|
|
24
|
+
const BUILD = /* mds-input-select */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: true, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: true, hydratedClass: false, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
27
|
Stencil Client Platform v4.27.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -455,7 +455,11 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
455
455
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
456
456
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
457
457
|
}
|
|
458
|
-
} else if (memberName === "key") ; else if (
|
|
458
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
459
|
+
if (newValue) {
|
|
460
|
+
newValue(elm);
|
|
461
|
+
}
|
|
462
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
459
463
|
if (memberName[2] === "-") {
|
|
460
464
|
memberName = memberName.slice(3);
|
|
461
465
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -613,6 +617,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
613
617
|
const vnode = vnodes[index];
|
|
614
618
|
if (vnode) {
|
|
615
619
|
const elm = vnode.$elm$;
|
|
620
|
+
nullifyVNodeRefs(vnode);
|
|
616
621
|
if (elm) {
|
|
617
622
|
elm.remove();
|
|
618
623
|
}
|
|
@@ -741,6 +746,12 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
741
746
|
elm.data = text;
|
|
742
747
|
}
|
|
743
748
|
};
|
|
749
|
+
var nullifyVNodeRefs = (vNode) => {
|
|
750
|
+
{
|
|
751
|
+
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
752
|
+
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
753
|
+
}
|
|
754
|
+
};
|
|
744
755
|
var insertBefore = (parent, newNode, reference) => {
|
|
745
756
|
{
|
|
746
757
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-18f29026.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["mds-input-select.cjs",[[65,"mds-input-select",{"autocomplete":[513],"autoFocus":[516,"auto-focus"],"placeholder":[513],"name":[513],"disabled":[516],"required":[516],"multiple":[516],"size":[514],"value":[520],"
|
|
11
|
+
return index.bootstrapLazy([["mds-input-select.cjs",[[65,"mds-input-select",{"autocomplete":[513],"autoFocus":[516,"auto-focus"],"placeholder":[513],"name":[513],"disabled":[516],"required":[516],"multiple":[516],"size":[514],"value":[520],"defaultValue":[520,"default-value"],"variant":[513],"hasFocus":[32]},null,{"value":["valueChanged"],"disabled":["disabledChanged"],"placeholder":["placeholderChanged"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
|
|
7
|
-
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
5
|
+
const index = require('./index-18f29026.js');
|
|
8
6
|
|
|
9
7
|
const miBaselineKeyboardArrowDown = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6l-6-6l1.41-1.41z"/></svg>`;
|
|
10
8
|
|
|
11
|
-
const mdsInputSelectCss = "@tailwind components;\n\n\n:host{\n\n min-height: 1.5rem;\n\n font-family: Karla, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n\n font-size: 1rem;\n\n line-height: 1.5rem;\n\n -webkit-font-smoothing: antialiased;\n\n -moz-osx-font-smoothing: grayscale;\n\n --mds-input-select-variant-color: var(--tone-neutral-01);\n --mds-input-select-ring: 0 0 0 1px rgb(var(--mds-input-select-variant-color) / 0.1);\n --mds-input-select-shadow: 0 1px 3px 0 rgb(var(--mds-input-select-variant-color) / 0.1), 0 1px 2px 0 rgb(var(--mds-input-select-variant-color) / 0.06);\n --mds-input-select-arrow-icon-background-color: var(--mds-input-select-arrow-icon-blur-background-color);\n --mds-input-select-arrow-icon-blur-background-color: transparent;\n --mds-input-select-arrow-icon-blur-color: rgb(var(--mds-input-select-variant-color) / 0.5);\n --mds-input-select-arrow-icon-color: var(--mds-input-select-arrow-icon-blur-color);\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--mds-input-select-variant-color) / 0.5);\n --mds-input-select-arrow-icon-hover-color: rgb(var(--mds-input-select-variant-color));\n\n color: rgb(var(--tone-neutral-02));\n display: -ms-flexbox;\n display: flex;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n:host([required]:not([required=\"false\"]):focus-within) .icon {\n -webkit-transform: translate(0.375rem, 0.375rem);\n transform: translate(0.375rem, 0.375rem);\n}\n\n:host(:hover),\n:host(:focus-within) {\n --mds-input-select-variant-color: var(--variant-primary-03);\n --mds-input-select-ring: 0 0 0 3px rgb(var(--mds-input-select-variant-color) / 1);\n --mds-input-select-shadow: 0 4px 6px -1px rgb(var(--mds-input-select-variant-color) / 0.1), 0 2px 4px -1px rgb(var(--mds-input-select-variant-color) / 0.06);\n --mds-input-select-arrow-icon-background-color: var(--mds-input-select-arrow-icon-hover-background-color);\n --mds-input-select-arrow-icon-color: var(--mds-input-select-arrow-icon-hover-color);\n}\n\n.input{\n\n font-family: Karla, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n\n font-size: 1rem;\n\n line-height: 1.5rem;\n\n -webkit-font-smoothing: antialiased;\n\n -moz-osx-font-smoothing: grayscale;\n\n margin: 0rem;\n\n min-height: 3rem;\n\n width: 100%;\n\n border-radius: 0.5rem;\n\n padding-top: 0.75rem;\n\n padding-bottom: 0.75rem;\n\n padding-left: 1rem;\n\n padding-right: 3rem;\n\n -webkit-transition-duration: 300ms;\n\n transition-duration: 300ms;\n\n -webkit-transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);\n\n transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);\n\n -webkit-appearance: none;\n\n -moz-appearance: none;\n\n appearance: none;\n background-color: rgb(var(--tone-neutral));\n border: 0;\n -webkit-box-shadow: var(--mds-input-select-ring), var(--mds-input-select-shadow);\n box-shadow: var(--mds-input-select-ring), var(--mds-input-select-shadow);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: rgb(var(--tone-neutral-05));\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-transition-property: background-color, border-color, color, fill, -webkit-box-shadow;\n transition-property: background-color, border-color, color, fill, -webkit-box-shadow;\n transition-property: background-color, border-color, box-shadow, color, fill;\n transition-property: background-color, border-color, box-shadow, color, fill, -webkit-box-shadow;\n}\n\n.input:hover,\n.input:focus{\n\n outline: 2px solid transparent;\n\n outline-offset: 2px;\n\n -webkit-transition-duration: 300ms;\n\n transition-duration: 300ms;\n\n -webkit-transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);\n\n transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);\n\n color: rgb(var(--tone-neutral-03));\n}\n\n:host([value]:not([value=\"\"])) .input {\n color: rgb(var(--tone-neutral-03));\n}\n\n.input--mds-input-select-selected {\n color: rgb(var(--tone-neutral-02));\n}\n\n.input:disabled {\n background-color: rgb(var(--tone-neutral-09));\n opacity: 1;\n}\n\n:host([disabled]:not([disabled=\"false\"])) {\n pointer-events: none;\n}\n\n:host([disabled]:not([disabled=\"false\"])) .input {\n pointer-events: none;\n}\n\n:host([disabled]:not([disabled=\"false\"])) .icon {\n fill: rgb(var(--tone-neutral-06));\n -webkit-transform: translate(0.625rem, 0.5rem);\n transform: translate(0.625rem, 0.5rem);\n}\n\n.icon-container{\n\n right: 1rem;\n\n height: 3rem;\n\n -ms-flex-align: center;\n\n align-items: center;\n color: inherit;\n display: -ms-flexbox;\n display: flex;\n pointer-events: none;\n position: absolute;\n}\n\n.icon{\n\n display: -ms-flexbox;\n\n display: flex;\n}\n\n.icon svg{\n\n aspect-ratio: 1/1;\n\n height: 100%;\n\n width: 100%;\n}\n\n.icon{\n\n border-radius: 9999px;\n\n -webkit-transition-duration: 200ms;\n\n transition-duration: 200ms;\n\n background-color: var(--mds-input-select-arrow-icon-background-color, rgb(var(--variant-primary-09)));\n fill: var(--mds-input-select-arrow-icon-color, rgb(var(--variant-primary-04)));\n -webkit-transition-property: background-color, fill;\n transition-property: background-color, fill;\n}\n\n.option-container {\n display: none;\n}\n\n@container (max-width: 210px) {\n :host .tip__content,\n :host(:focus-within) .tip__content {\n grid-template-columns: 0fr;\n opacity: 0;\n }\n\n :host .tip {\n padding-left: 0;\n padding-right: 0;\n }\n\n :host {\n --mds-input-select-background: rgb(var(--variant-primary-07));\n }\n}\n\n:host {\n --mds-input-select-icon-color: var(--variant-primary-03);\n --mds-input-select-variant-color: 0 0 0;\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--variant-primary-09));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--variant-primary-08));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--variant-primary-06));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--variant-primary-04));\n}\n\n:host(:hover),\n:host(:focus-within) {\n --mds-input-select-variant-color: var(--variant-primary-04);\n}\n\n:host([variant=\"info\"]) {\n --mds-input-select-icon-color: var(--status-info-05);\n --mds-input-select-tip-background: var(--status-info-05);\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--status-info-09));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--status-info-08));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--status-info-06));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--status-info-04));\n --mds-input-select-variant-color: 0 0 0;\n}\n\n:host([variant=\"info\"]:hover),\n:host([variant=\"info\"]:focus-within) {\n --mds-input-select-icon-color: var(--status-info-04);\n --mds-input-select-variant-color: var(--status-info-05);\n}\n\n:host([variant=\"success\"]) {\n --mds-input-select-icon-color: var(--status-success-05);\n --mds-input-select-tip-background: var(--status-success-05);\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--status-success-09));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--status-success-08));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--status-success-06));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--status-success-04));\n --mds-input-select-variant-color: 0 0 0;\n}\n\n:host([variant=\"success\"]:hover),\n:host([variant=\"success\"]:focus-within) {\n --mds-input-select-icon-color: var(--status-success-04);\n --mds-input-select-variant-color: var(--status-success-05);\n}\n\n:host([variant=\"warning\"]) {\n --mds-input-select-icon-color: var(--status-warning-05);\n --mds-input-select-tip-background: var(--status-warning-05);\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--status-warning-09));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--status-warning-08));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--status-warning-06));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--status-warning-04));\n --mds-input-select-variant-color: 0 0 0;\n}\n\n:host([variant=\"warning\"]:hover),\n:host([variant=\"warning\"]:focus-within) {\n --mds-input-select-icon-color: var(--status-warning-04);\n --mds-input-select-variant-color: var(--status-warning-05);\n}\n\n:host([variant=\"error\"]) {\n --mds-input-select-icon-color: var(--status-error-05);\n --mds-input-select-tip-background: var(--status-error-05);\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--status-error-09));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--status-error-08));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--status-error-06));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--status-error-04));\n --mds-input-select-variant-color: 0 0 0;\n}\n\n:host([variant=\"error\"]:hover),\n:host([variant=\"error\"]:focus-within) {\n --mds-input-select-icon-color: var(--status-error-04);\n --mds-input-select-variant-color: var(--status-error-05);\n}\n\n:host-context(.pref-animation-reduce),\n:host-context(.pref-animation-reduce) .input,\n:host-context(.pref-animation-reduce) .input:hover,\n:host-context(.pref-animation-reduce) .input:focus,\n:host-context(.pref-animation-reduce) .icon {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n}\n\n@media (prefers-reduced-motion) {\n :host-context(.pref-animation-system),\n :host-context(.pref-animation-system) .input,\n :host-context(.pref-animation-system) .input:hover,\n :host-context(.pref-animation-system) .input:focus,\n :host-context(.pref-animation-system) .icon {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n\n:host-context(.pref-theme-dark) {\n --mds-input-select-ring: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.3);\n --mds-input-select-arrow-icon-background-color: var(--mds-input-select-arrow-icon-blur-background-color);\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--variant-primary-05));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--mds-input-select-variant-color));\n --mds-input-select-arrow-icon-color: var(--mds-input-select-arrow-icon-blur-color);\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--mds-input-select-variant-color));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--tone-neutral-10));\n}\n\n:host-context(.pref-theme-dark) .input {\n color: rgb(var(--tone-neutral-03));\n}\n\n@media (prefers-color-scheme: dark) {\n :host-context(.pref-theme-system) {\n --mds-input-select-ring: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.3);\n --mds-input-select-arrow-icon-background-color: var(--mds-input-select-arrow-icon-blur-background-color);\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--variant-primary-05));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--mds-input-select-variant-color));\n --mds-input-select-arrow-icon-color: var(--mds-input-select-arrow-icon-blur-color);\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--mds-input-select-variant-color));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--tone-neutral-10));\n }\n\n :host-context(.pref-theme-system) .input {\n color: rgb(var(--tone-neutral-03));\n }\n}\n\n:host-context(.pref-contrast-more) {\n --mds-input-select-ring: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.6);\n}\n\n:host-context(.pref-contrast-more) .input {\n color: rgb(var(--tone-neutral-01));\n}\n\n@media (prefers-contrast: more) {\n :host-context(.pref-contrast-system) {\n --mds-input-select-ring: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.6);\n }\n\n :host-context(.pref-contrast-system) .input {\n color: rgb(var(--tone-neutral-01));\n }\n}\n\n:host(:not(:is([hydrated], .hydrated))) {\n -webkit-animation-duration: 0s;\n animation-duration: 0s;\n border-color: transparent;\n -webkit-box-shadow: 0 0 0 transparent;\n box-shadow: 0 0 0 transparent;\n opacity: 0;\n outline-color: transparent;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n visibility: hidden;\n}\n\n/* TODO refact(stencil): Uses only used selector from parent shadowDOM component */\n\nmds-accordion:not(:is([hydrated], .hydrated)),\nmds-accordion-item:not(:is([hydrated], .hydrated)),\nmds-accordion-timer:not(:is([hydrated], .hydrated)),\nmds-accordion-timer-item:not(:is([hydrated], .hydrated)),\nmds-author:not(:is([hydrated], .hydrated)),\nmds-avatar:not(:is([hydrated], .hydrated)),\nmds-badge:not(:is([hydrated], .hydrated)),\nmds-banner:not(:is([hydrated], .hydrated)),\nmds-benchmark-bar:not(:is([hydrated], .hydrated)),\nmds-bibliography:not(:is([hydrated], .hydrated)),\nmds-breadcrumb:not(:is([hydrated], .hydrated)),\nmds-breadcrumb-item:not(:is([hydrated], .hydrated)),\nmds-button:not(:is([hydrated], .hydrated)),\nmds-card:not(:is([hydrated], .hydrated)),\nmds-card-content:not(:is([hydrated], .hydrated)),\nmds-card-footer:not(:is([hydrated], .hydrated)),\nmds-card-header:not(:is([hydrated], .hydrated)),\nmds-card-media:not(:is([hydrated], .hydrated)),\nmds-chip:not(:is([hydrated], .hydrated)),\nmds-details:not(:is([hydrated], .hydrated)),\nmds-dropdown:not(:is([hydrated], .hydrated)),\nmds-entity:not(:is([hydrated], .hydrated)),\nmds-file:not(:is([hydrated], .hydrated)),\nmds-file-preview:not(:is([hydrated], .hydrated)),\nmds-filter:not(:is([hydrated], .hydrated)),\nmds-filter-item:not(:is([hydrated], .hydrated)),\nmds-header:not(:is([hydrated], .hydrated)),\nmds-header-bar:not(:is([hydrated], .hydrated)),\nmds-help:not(:is([hydrated], .hydrated)),\nmds-horizontal-scroll:not(:is([hydrated], .hydrated)),\nmds-hr:not(:is([hydrated], .hydrated)),\nmds-icon:not(:is([hydrated], .hydrated)),\nmds-img:not(:is([hydrated], .hydrated)),\nmds-input:not(:is([hydrated], .hydrated)),\nmds-input-field:not(:is([hydrated], .hydrated)),\nmds-input-range:not(:is([hydrated], .hydrated)),\nmds-input-select:not(:is([hydrated], .hydrated)),\nmds-input-switch:not(:is([hydrated], .hydrated)),\nmds-input-tip:not(:is([hydrated], .hydrated)),\nmds-input-tip-item:not(:is([hydrated], .hydrated)),\nmds-input-upload:not(:is([hydrated], .hydrated)),\nmds-keyboard:not(:is([hydrated], .hydrated)),\nmds-keyboard-key:not(:is([hydrated], .hydrated)),\nmds-kpi:not(:is([hydrated], .hydrated)),\nmds-kpi-item:not(:is([hydrated], .hydrated)),\nmds-label:not(:is([hydrated], .hydrated)),\nmds-list:not(:is([hydrated], .hydrated)),\nmds-list-item:not(:is([hydrated], .hydrated)),\nmds-modal:not(:is([hydrated], .hydrated)),\nmds-note:not(:is([hydrated], .hydrated)),\nmds-notification:not(:is([hydrated], .hydrated)),\nmds-paginator:not(:is([hydrated], .hydrated)),\nmds-paginator-item:not(:is([hydrated], .hydrated)),\nmds-pref:not(:is([hydrated], .hydrated)),\nmds-pref-animation:not(:is([hydrated], .hydrated)),\nmds-pref-consumption:not(:is([hydrated], .hydrated)),\nmds-pref-contrast:not(:is([hydrated], .hydrated)),\nmds-pref-language:not(:is([hydrated], .hydrated)),\nmds-pref-language-item:not(:is([hydrated], .hydrated)),\nmds-pref-theme:not(:is([hydrated], .hydrated)),\nmds-price-table:not(:is([hydrated], .hydrated)),\nmds-price-table-features:not(:is([hydrated], .hydrated)),\nmds-price-table-features-cell:not(:is([hydrated], .hydrated)),\nmds-price-table-features-row:not(:is([hydrated], .hydrated)),\nmds-price-table-header:not(:is([hydrated], .hydrated)),\nmds-price-table-list:not(:is([hydrated], .hydrated)),\nmds-price-table-list-item:not(:is([hydrated], .hydrated)),\nmds-progress:not(:is([hydrated], .hydrated)),\nmds-push-notification:not(:is([hydrated], .hydrated)),\nmds-push-notifications:not(:is([hydrated], .hydrated)),\nmds-quote:not(:is([hydrated], .hydrated)),\nmds-separator:not(:is([hydrated], .hydrated)),\nmds-spinner:not(:is([hydrated], .hydrated)),\nmds-stepper-bar:not(:is([hydrated], .hydrated)),\nmds-stepper-bar-item:not(:is([hydrated], .hydrated)),\nmds-tab:not(:is([hydrated], .hydrated)),\nmds-tab-bar:not(:is([hydrated], .hydrated)),\nmds-tab-bar-item:not(:is([hydrated], .hydrated)),\nmds-tab-item:not(:is([hydrated], .hydrated)),\nmds-table:not(:is([hydrated], .hydrated)),\nmds-table-body:not(:is([hydrated], .hydrated)),\nmds-table-cell:not(:is([hydrated], .hydrated)),\nmds-table-footer:not(:is([hydrated], .hydrated)),\nmds-table-header:not(:is([hydrated], .hydrated)),\nmds-table-header-cell:not(:is([hydrated], .hydrated)),\nmds-table-row:not(:is([hydrated], .hydrated)),\nmds-text:not(:is([hydrated], .hydrated)),\nmds-toast:not(:is([hydrated], .hydrated)),\nmds-tooltip:not(:is([hydrated], .hydrated)),\nmds-tree:not(:is([hydrated], .hydrated)),\nmds-tree-item:not(:is([hydrated], .hydrated)),\nmds-url-view:not(:is([hydrated], .hydrated)),\nmds-usage:not(:is([hydrated], .hydrated)),\nmds-video-wall:not(:is([hydrated], .hydrated)),\nmds-zero:not(:is([hydrated], .hydrated))\n{\n -webkit-animation-duration: 0s;\n animation-duration: 0s;\n border-color: transparent;\n -webkit-box-shadow: 0 0 0 transparent;\n box-shadow: 0 0 0 transparent;\n opacity: 0;\n outline-color: transparent;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n visibility: hidden;\n}\n\n";
|
|
9
|
+
const mdsInputSelectCss = "@tailwind components;\n\n\n:host{\n\n min-height: 1.5rem;\n\n font-family: Karla, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n\n font-size: 1rem;\n\n line-height: 1.5rem;\n\n -webkit-font-smoothing: antialiased;\n\n -moz-osx-font-smoothing: grayscale;\n\n --mds-input-select-variant-color: var(--tone-neutral-01);\n --mds-input-select-ring: 0 0 0 1px rgb(var(--mds-input-select-variant-color) / 0.1);\n --mds-input-select-shadow: 0 1px 3px 0 rgb(var(--mds-input-select-variant-color) / 0.1), 0 1px 2px 0 rgb(var(--mds-input-select-variant-color) / 0.06);\n --mds-input-select-arrow-icon-background-color: var(--mds-input-select-arrow-icon-blur-background-color);\n --mds-input-select-arrow-icon-blur-background-color: transparent;\n --mds-input-select-arrow-icon-blur-color: rgb(var(--mds-input-select-variant-color) / 0.5);\n --mds-input-select-arrow-icon-color: var(--mds-input-select-arrow-icon-blur-color);\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--mds-input-select-variant-color) / 0.5);\n --mds-input-select-arrow-icon-hover-color: rgb(var(--mds-input-select-variant-color));\n\n color: rgb(var(--tone-neutral-02));\n display: -ms-flexbox;\n display: flex;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n:host([required]:not([required=\"false\"]):focus-within) .icon {\n -webkit-transform: translate(0.375rem, 0.375rem);\n transform: translate(0.375rem, 0.375rem);\n}\n\n:host(:hover),\n:host(:focus-within) {\n --mds-input-select-variant-color: var(--variant-primary-03);\n --mds-input-select-ring: 0 0 0 3px rgb(var(--mds-input-select-variant-color) / 1);\n --mds-input-select-shadow: 0 4px 6px -1px rgb(var(--mds-input-select-variant-color) / 0.1), 0 2px 4px -1px rgb(var(--mds-input-select-variant-color) / 0.06);\n --mds-input-select-arrow-icon-background-color: var(--mds-input-select-arrow-icon-hover-background-color);\n --mds-input-select-arrow-icon-color: var(--mds-input-select-arrow-icon-hover-color);\n}\n\n.input{\n\n font-family: Karla, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n\n font-size: 1rem;\n\n line-height: 1.5rem;\n\n -webkit-font-smoothing: antialiased;\n\n -moz-osx-font-smoothing: grayscale;\n\n margin: 0rem;\n\n min-height: 3rem;\n\n width: 100%;\n\n border-radius: 0.5rem;\n\n padding-top: 0.75rem;\n\n padding-bottom: 0.75rem;\n\n padding-left: 1rem;\n\n padding-right: 3rem;\n\n -webkit-transition-duration: 300ms;\n\n transition-duration: 300ms;\n\n -webkit-transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);\n\n transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);\n\n -webkit-appearance: none;\n\n -moz-appearance: none;\n\n appearance: none;\n background-color: rgb(var(--tone-neutral));\n border: 0;\n -webkit-box-shadow: var(--mds-input-select-ring), var(--mds-input-select-shadow);\n box-shadow: var(--mds-input-select-ring), var(--mds-input-select-shadow);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: rgb(var(--tone-neutral-02));\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-transition-property: background-color, border-color, color, fill, -webkit-box-shadow;\n transition-property: background-color, border-color, color, fill, -webkit-box-shadow;\n transition-property: background-color, border-color, box-shadow, color, fill;\n transition-property: background-color, border-color, box-shadow, color, fill, -webkit-box-shadow;\n}\n\n.input:hover,\n.input:focus{\n\n outline: 2px solid transparent;\n\n outline-offset: 2px;\n\n -webkit-transition-duration: 300ms;\n\n transition-duration: 300ms;\n\n -webkit-transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);\n\n transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);\n\n color: rgb(var(--tone-neutral-03));\n}\n\n:host([value]:not([value=\"\"])) .input {\n color: rgb(var(--tone-neutral-03));\n}\n\n:host([required]:not([required=\"false\"])) .input {\n color: rgb(var(--tone-neutral-05));\n}\n\n.input:disabled {\n background-color: rgb(var(--tone-neutral-09));\n opacity: 1;\n}\n\n:host([disabled]:not([disabled=\"false\"])) {\n pointer-events: none;\n}\n\n:host([disabled]:not([disabled=\"false\"])) .input {\n pointer-events: none;\n}\n\n:host([disabled]:not([disabled=\"false\"])) .icon {\n fill: rgb(var(--tone-neutral-06));\n -webkit-transform: translate(0.625rem, 0.5rem);\n transform: translate(0.625rem, 0.5rem);\n}\n\n.icon-container{\n\n right: 1rem;\n\n height: 3rem;\n\n -ms-flex-align: center;\n\n align-items: center;\n color: inherit;\n display: -ms-flexbox;\n display: flex;\n pointer-events: none;\n position: absolute;\n}\n\n.icon{\n\n display: -ms-flexbox;\n\n display: flex;\n}\n\n.icon svg{\n\n aspect-ratio: 1/1;\n\n height: 100%;\n\n width: 100%;\n}\n\n.icon{\n\n border-radius: 9999px;\n\n -webkit-transition-duration: 200ms;\n\n transition-duration: 200ms;\n\n background-color: var(--mds-input-select-arrow-icon-background-color, rgb(var(--variant-primary-09)));\n fill: var(--mds-input-select-arrow-icon-color, rgb(var(--variant-primary-04)));\n -webkit-transition-property: background-color, fill;\n transition-property: background-color, fill;\n}\n\n.option-container {\n display: none;\n}\n\n@container (max-width: 210px) {\n :host .tip__content,\n :host(:focus-within) .tip__content {\n grid-template-columns: 0fr;\n opacity: 0;\n }\n\n :host .tip {\n padding-left: 0;\n padding-right: 0;\n }\n\n :host {\n --mds-input-select-background: rgb(var(--variant-primary-07));\n }\n}\n\n:host {\n --mds-input-select-icon-color: var(--variant-primary-03);\n --mds-input-select-variant-color: 0 0 0;\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--variant-primary-09));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--variant-primary-08));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--variant-primary-06));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--variant-primary-04));\n}\n\n:host(:hover),\n:host(:focus-within) {\n --mds-input-select-variant-color: var(--variant-primary-04);\n}\n\n:host([variant=\"info\"]) {\n --mds-input-select-icon-color: var(--status-info-05);\n --mds-input-select-tip-background: var(--status-info-05);\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--status-info-09));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--status-info-08));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--status-info-06));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--status-info-04));\n --mds-input-select-variant-color: 0 0 0;\n}\n\n:host([variant=\"info\"]:hover),\n:host([variant=\"info\"]:focus-within) {\n --mds-input-select-icon-color: var(--status-info-04);\n --mds-input-select-variant-color: var(--status-info-05);\n}\n\n:host([variant=\"success\"]) {\n --mds-input-select-icon-color: var(--status-success-05);\n --mds-input-select-tip-background: var(--status-success-05);\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--status-success-09));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--status-success-08));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--status-success-06));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--status-success-04));\n --mds-input-select-variant-color: 0 0 0;\n}\n\n:host([variant=\"success\"]:hover),\n:host([variant=\"success\"]:focus-within) {\n --mds-input-select-icon-color: var(--status-success-04);\n --mds-input-select-variant-color: var(--status-success-05);\n}\n\n:host([variant=\"warning\"]) {\n --mds-input-select-icon-color: var(--status-warning-05);\n --mds-input-select-tip-background: var(--status-warning-05);\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--status-warning-09));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--status-warning-08));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--status-warning-06));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--status-warning-04));\n --mds-input-select-variant-color: 0 0 0;\n}\n\n:host([variant=\"warning\"]:hover),\n:host([variant=\"warning\"]:focus-within) {\n --mds-input-select-icon-color: var(--status-warning-04);\n --mds-input-select-variant-color: var(--status-warning-05);\n}\n\n:host([variant=\"error\"]) {\n --mds-input-select-icon-color: var(--status-error-05);\n --mds-input-select-tip-background: var(--status-error-05);\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--status-error-09));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--status-error-08));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--status-error-06));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--status-error-04));\n --mds-input-select-variant-color: 0 0 0;\n}\n\n:host([variant=\"error\"]:hover),\n:host([variant=\"error\"]:focus-within) {\n --mds-input-select-icon-color: var(--status-error-04);\n --mds-input-select-variant-color: var(--status-error-05);\n}\n\n:host-context(.pref-animation-reduce),\n:host-context(.pref-animation-reduce) .input,\n:host-context(.pref-animation-reduce) .input:hover,\n:host-context(.pref-animation-reduce) .input:focus,\n:host-context(.pref-animation-reduce) .icon {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n}\n\n@media (prefers-reduced-motion) {\n :host-context(.pref-animation-system),\n :host-context(.pref-animation-system) .input,\n :host-context(.pref-animation-system) .input:hover,\n :host-context(.pref-animation-system) .input:focus,\n :host-context(.pref-animation-system) .icon {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n\n:host-context(.pref-theme-dark) {\n --mds-input-select-ring: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.3);\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--variant-primary-05));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--mds-input-select-variant-color));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--variant-primary-04));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--variant-primary-08));\n}\n\n:host-context(.pref-theme-dark) .input {\n color: rgb(var(--tone-neutral-03));\n}\n\n@media (prefers-color-scheme: dark) {\n :host-context(.pref-theme-system) {\n --mds-input-select-ring: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.3);\n --mds-input-select-arrow-icon-blur-background-color: rgb(var(--variant-primary-05));\n --mds-input-select-arrow-icon-blur-color: rgb(var(--mds-input-select-variant-color));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--variant-primary-04));\n --mds-input-select-arrow-icon-hover-color: rgb(var(--variant-primary-08));\n }\n\n :host-context(.pref-theme-system) .input {\n color: rgb(var(--tone-neutral-03));\n }\n}\n\n:host-context(.pref-contrast-more) {\n --mds-input-select-ring: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.6);\n}\n\n:host-context(.pref-contrast-more) .input {\n color: rgb(var(--tone-neutral-01));\n}\n\n@media (prefers-contrast: more) {\n :host-context(.pref-contrast-system) {\n --mds-input-select-ring: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.6);\n }\n\n :host-context(.pref-contrast-system) .input {\n color: rgb(var(--tone-neutral-01));\n }\n}\n\n:host(:not(:is([hydrated], .hydrated))) {\n -webkit-animation-duration: 0s;\n animation-duration: 0s;\n border-color: transparent;\n -webkit-box-shadow: 0 0 0 transparent;\n box-shadow: 0 0 0 transparent;\n opacity: 0;\n outline-color: transparent;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n visibility: hidden;\n}\n\n/* TODO refact(stencil): Uses only used selector from parent shadowDOM component */\n\nmds-accordion:not(:is([hydrated], .hydrated)),\nmds-accordion-item:not(:is([hydrated], .hydrated)),\nmds-accordion-timer:not(:is([hydrated], .hydrated)),\nmds-accordion-timer-item:not(:is([hydrated], .hydrated)),\nmds-author:not(:is([hydrated], .hydrated)),\nmds-avatar:not(:is([hydrated], .hydrated)),\nmds-badge:not(:is([hydrated], .hydrated)),\nmds-banner:not(:is([hydrated], .hydrated)),\nmds-benchmark-bar:not(:is([hydrated], .hydrated)),\nmds-bibliography:not(:is([hydrated], .hydrated)),\nmds-breadcrumb:not(:is([hydrated], .hydrated)),\nmds-breadcrumb-item:not(:is([hydrated], .hydrated)),\nmds-button:not(:is([hydrated], .hydrated)),\nmds-card:not(:is([hydrated], .hydrated)),\nmds-card-content:not(:is([hydrated], .hydrated)),\nmds-card-footer:not(:is([hydrated], .hydrated)),\nmds-card-header:not(:is([hydrated], .hydrated)),\nmds-card-media:not(:is([hydrated], .hydrated)),\nmds-chip:not(:is([hydrated], .hydrated)),\nmds-details:not(:is([hydrated], .hydrated)),\nmds-dropdown:not(:is([hydrated], .hydrated)),\nmds-entity:not(:is([hydrated], .hydrated)),\nmds-file:not(:is([hydrated], .hydrated)),\nmds-file-preview:not(:is([hydrated], .hydrated)),\nmds-filter:not(:is([hydrated], .hydrated)),\nmds-filter-item:not(:is([hydrated], .hydrated)),\nmds-header:not(:is([hydrated], .hydrated)),\nmds-header-bar:not(:is([hydrated], .hydrated)),\nmds-help:not(:is([hydrated], .hydrated)),\nmds-horizontal-scroll:not(:is([hydrated], .hydrated)),\nmds-hr:not(:is([hydrated], .hydrated)),\nmds-icon:not(:is([hydrated], .hydrated)),\nmds-img:not(:is([hydrated], .hydrated)),\nmds-input:not(:is([hydrated], .hydrated)),\nmds-input-field:not(:is([hydrated], .hydrated)),\nmds-input-range:not(:is([hydrated], .hydrated)),\nmds-input-select:not(:is([hydrated], .hydrated)),\nmds-input-switch:not(:is([hydrated], .hydrated)),\nmds-input-tip:not(:is([hydrated], .hydrated)),\nmds-input-tip-item:not(:is([hydrated], .hydrated)),\nmds-input-upload:not(:is([hydrated], .hydrated)),\nmds-keyboard:not(:is([hydrated], .hydrated)),\nmds-keyboard-key:not(:is([hydrated], .hydrated)),\nmds-kpi:not(:is([hydrated], .hydrated)),\nmds-kpi-item:not(:is([hydrated], .hydrated)),\nmds-label:not(:is([hydrated], .hydrated)),\nmds-list:not(:is([hydrated], .hydrated)),\nmds-list-item:not(:is([hydrated], .hydrated)),\nmds-modal:not(:is([hydrated], .hydrated)),\nmds-note:not(:is([hydrated], .hydrated)),\nmds-notification:not(:is([hydrated], .hydrated)),\nmds-paginator:not(:is([hydrated], .hydrated)),\nmds-paginator-item:not(:is([hydrated], .hydrated)),\nmds-pref:not(:is([hydrated], .hydrated)),\nmds-pref-animation:not(:is([hydrated], .hydrated)),\nmds-pref-consumption:not(:is([hydrated], .hydrated)),\nmds-pref-contrast:not(:is([hydrated], .hydrated)),\nmds-pref-language:not(:is([hydrated], .hydrated)),\nmds-pref-language-item:not(:is([hydrated], .hydrated)),\nmds-pref-theme:not(:is([hydrated], .hydrated)),\nmds-price-table:not(:is([hydrated], .hydrated)),\nmds-price-table-features:not(:is([hydrated], .hydrated)),\nmds-price-table-features-cell:not(:is([hydrated], .hydrated)),\nmds-price-table-features-row:not(:is([hydrated], .hydrated)),\nmds-price-table-header:not(:is([hydrated], .hydrated)),\nmds-price-table-list:not(:is([hydrated], .hydrated)),\nmds-price-table-list-item:not(:is([hydrated], .hydrated)),\nmds-progress:not(:is([hydrated], .hydrated)),\nmds-push-notification:not(:is([hydrated], .hydrated)),\nmds-push-notifications:not(:is([hydrated], .hydrated)),\nmds-quote:not(:is([hydrated], .hydrated)),\nmds-separator:not(:is([hydrated], .hydrated)),\nmds-spinner:not(:is([hydrated], .hydrated)),\nmds-stepper-bar:not(:is([hydrated], .hydrated)),\nmds-stepper-bar-item:not(:is([hydrated], .hydrated)),\nmds-tab:not(:is([hydrated], .hydrated)),\nmds-tab-bar:not(:is([hydrated], .hydrated)),\nmds-tab-bar-item:not(:is([hydrated], .hydrated)),\nmds-tab-item:not(:is([hydrated], .hydrated)),\nmds-table:not(:is([hydrated], .hydrated)),\nmds-table-body:not(:is([hydrated], .hydrated)),\nmds-table-cell:not(:is([hydrated], .hydrated)),\nmds-table-footer:not(:is([hydrated], .hydrated)),\nmds-table-header:not(:is([hydrated], .hydrated)),\nmds-table-header-cell:not(:is([hydrated], .hydrated)),\nmds-table-row:not(:is([hydrated], .hydrated)),\nmds-text:not(:is([hydrated], .hydrated)),\nmds-toast:not(:is([hydrated], .hydrated)),\nmds-tooltip:not(:is([hydrated], .hydrated)),\nmds-tree:not(:is([hydrated], .hydrated)),\nmds-tree-item:not(:is([hydrated], .hydrated)),\nmds-url-view:not(:is([hydrated], .hydrated)),\nmds-usage:not(:is([hydrated], .hydrated)),\nmds-video-wall:not(:is([hydrated], .hydrated)),\nmds-zero:not(:is([hydrated], .hydrated))\n{\n -webkit-animation-duration: 0s;\n animation-duration: 0s;\n border-color: transparent;\n -webkit-box-shadow: 0 0 0 transparent;\n box-shadow: 0 0 0 transparent;\n opacity: 0;\n outline-color: transparent;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n visibility: hidden;\n}\n\n";
|
|
12
10
|
const MdsInputSelectStyle0 = mdsInputSelectCss;
|
|
13
11
|
|
|
14
12
|
const MdsInputSelect = class {
|
|
@@ -22,6 +20,7 @@ const MdsInputSelect = class {
|
|
|
22
20
|
this.internals = hostRef.$hostElement$.attachInternals();
|
|
23
21
|
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
24
22
|
}
|
|
23
|
+
// @State() selected: boolean
|
|
25
24
|
this.hasFocus = false;
|
|
26
25
|
/**
|
|
27
26
|
* If true, the element is displayed as disabled
|
|
@@ -72,10 +71,9 @@ const MdsInputSelect = class {
|
|
|
72
71
|
});
|
|
73
72
|
};
|
|
74
73
|
this.onSlotChangeHandler = () => {
|
|
75
|
-
var _a, _b, _c;
|
|
74
|
+
var _a, _b, _c, _d;
|
|
76
75
|
const elements = (_b = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('slot')[0]) === null || _b === void 0 ? void 0 : _b.assignedNodes();
|
|
77
|
-
const
|
|
78
|
-
const options = select === null || select === void 0 ? void 0 : select.querySelectorAll('option');
|
|
76
|
+
const options = (_c = this.selectEl) === null || _c === void 0 ? void 0 : _c.querySelectorAll('option');
|
|
79
77
|
if (!options) {
|
|
80
78
|
return;
|
|
81
79
|
}
|
|
@@ -86,19 +84,16 @@ const MdsInputSelect = class {
|
|
|
86
84
|
this.emptyOptions();
|
|
87
85
|
}
|
|
88
86
|
elements === null || elements === void 0 ? void 0 : elements.forEach((element) => {
|
|
89
|
-
|
|
87
|
+
var _a;
|
|
88
|
+
(_a = this.selectEl) === null || _a === void 0 ? void 0 : _a.appendChild(element.cloneNode(true));
|
|
90
89
|
});
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
* selected option that we wanted as a default
|
|
94
|
-
*/
|
|
95
|
-
if (this.value) {
|
|
96
|
-
select === null || select === void 0 ? void 0 : select.querySelectorAll('option').forEach((element) => {
|
|
90
|
+
if (this.value && this.selectEl) {
|
|
91
|
+
this.selectEl.querySelectorAll('option').forEach((element) => {
|
|
97
92
|
element.selected = element.value === this.value;
|
|
98
93
|
});
|
|
99
94
|
}
|
|
100
95
|
else if (!this.placeholder) {
|
|
101
|
-
this.value =
|
|
96
|
+
this.value = (_d = this.selectEl) === null || _d === void 0 ? void 0 : _d.querySelectorAll('option')[0].value;
|
|
102
97
|
}
|
|
103
98
|
};
|
|
104
99
|
}
|
|
@@ -107,7 +102,6 @@ const MdsInputSelect = class {
|
|
|
107
102
|
*/
|
|
108
103
|
valueChanged() {
|
|
109
104
|
var _a, _b, _c;
|
|
110
|
-
this.selected = this.value !== '';
|
|
111
105
|
this.changeEvent.emit({ value: (_a = this.value) === null || _a === void 0 ? void 0 : _a.toString() });
|
|
112
106
|
this.internals.setFormValue((_c = (_b = this.value) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : null);
|
|
113
107
|
}
|
|
@@ -121,24 +115,52 @@ const MdsInputSelect = class {
|
|
|
121
115
|
this.internals.setFormValue(null);
|
|
122
116
|
}
|
|
123
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* This is for the react component because placeholder is valued after didload
|
|
120
|
+
* and therefore the placeholder option is drawn as the last option.
|
|
121
|
+
* Here the option is brought back to the first position
|
|
122
|
+
* @param newValue placeholder new value
|
|
123
|
+
* @param oldValue placeholder old value
|
|
124
|
+
*/
|
|
125
|
+
placeholderChanged(newValue, oldValue) {
|
|
126
|
+
if (newValue && !oldValue) {
|
|
127
|
+
let defaultOption = document.querySelector('.placeholder-option');
|
|
128
|
+
if (defaultOption)
|
|
129
|
+
defaultOption.remove();
|
|
130
|
+
defaultOption = document.createElement('option');
|
|
131
|
+
this.selectEl.insertBefore(defaultOption, this.selectEl.firstChild);
|
|
132
|
+
defaultOption.value = '';
|
|
133
|
+
defaultOption.text = newValue;
|
|
134
|
+
if (!this.defaultValue)
|
|
135
|
+
defaultOption.selected = true;
|
|
136
|
+
if (this.required)
|
|
137
|
+
defaultOption.disabled = true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
124
140
|
formResetCallback() {
|
|
125
141
|
this.internals.setFormValue('');
|
|
126
142
|
}
|
|
143
|
+
componentWillLoad() {
|
|
144
|
+
// needed for react component, this prop should be used as default-value html attributo instead of defaultValue prop
|
|
145
|
+
if (this.defaultValue) {
|
|
146
|
+
this.value = this.defaultValue;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
127
149
|
componentDidLoad() {
|
|
128
150
|
if (this.value) {
|
|
129
|
-
this.selected = true;
|
|
130
151
|
this.internals.setFormValue(this.value.toString());
|
|
131
152
|
}
|
|
132
153
|
}
|
|
133
154
|
render() {
|
|
134
|
-
return (index.h(index.Host, { key: '
|
|
135
|
-
index.h("mds-input-tip-item", { key: '
|
|
155
|
+
return (index.h(index.Host, { key: '1e31a254cadf3141f66b003aeed3bbcb1912f748' }, index.h("select", { key: '0af51ed5c0daa0a5969d13edc7814e8f482eecea', class: 'input', onInput: this.onInput.bind(this), onBlur: this.onBlur, onFocus: this.onFocus, name: this.name, required: this.required, disabled: this.disabled, multiple: this.multiple, size: this.size, part: "select", ref: el => this.selectEl = el }, index.h("option", { key: '597095579dc1e50a927d14c111fb8ab82c7ac971', class: "placeholder-option", value: "", disabled: !this.required ? undefined : true, selected: this.defaultValue ? undefined : true }, this.placeholder)), index.h("div", { key: '3daf36535e69bf3909b184ea9658b7b7b4850a7d', class: "icon-container" }, index.h("i", { key: 'b98d5e916a2e050af8ed94066dcf51152b90738d', class: "icon", innerHTML: miBaselineKeyboardArrowDown })), index.h("div", { key: '964828e831559130e018cfc62e1fb076e0b2478b', class: "option-container" }, index.h("slot", { key: '394d87e522c0c6fceadcc829d39c9a277b014ae3', onSlotchange: this.onSlotChangeHandler })), index.h("mds-input-tip", { key: '019abf7e5d56dd4eb93864bd7fd0fa28446ba0b5', position: "top", active: this.hasFocus }, this.disabled && index.h("mds-input-tip-item", { key: '8fc9b96596eea2eb99adc0c0e7b580fa9f92a355', expanded: true, variant: "disabled" }), this.required &&
|
|
156
|
+
index.h("mds-input-tip-item", { key: '0eec9f0ade26adfba03eb3f3f38af1c1e831af55', expanded: this.hasFocus, variant: this.value === '' ? 'required' : 'required-success' }))));
|
|
136
157
|
}
|
|
137
158
|
static get formAssociated() { return true; }
|
|
138
159
|
get host() { return index.getElement(this); }
|
|
139
160
|
static get watchers() { return {
|
|
140
161
|
"value": ["valueChanged"],
|
|
141
|
-
"disabled": ["disabledChanged"]
|
|
162
|
+
"disabled": ["disabledChanged"],
|
|
163
|
+
"placeholder": ["placeholderChanged"]
|
|
142
164
|
}; }
|
|
143
165
|
};
|
|
144
166
|
MdsInputSelect.style = MdsInputSelectStyle0;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-18f29026.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["mds-input-select.cjs",[[65,"mds-input-select",{"autocomplete":[513],"autoFocus":[516,"auto-focus"],"placeholder":[513],"name":[513],"disabled":[516],"required":[516],"multiple":[516],"size":[514],"value":[520],"
|
|
22
|
+
return index.bootstrapLazy([["mds-input-select.cjs",[[65,"mds-input-select",{"autocomplete":[513],"autoFocus":[516,"auto-focus"],"placeholder":[513],"name":[513],"disabled":[516],"required":[516],"multiple":[516],"size":[514],"value":[520],"defaultValue":[520,"default-value"],"variant":[513],"hasFocus":[32]},null,{"value":["valueChanged"],"disabled":["disabledChanged"],"placeholder":["placeholderChanged"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -19,15 +19,17 @@ export class Locale {
|
|
|
19
19
|
};
|
|
20
20
|
this.update = (doc) => {
|
|
21
21
|
const context = doc !== null && doc !== void 0 ? doc : this.element.shadowRoot;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (context) {
|
|
23
|
+
context.querySelectorAll('*').forEach(el => {
|
|
24
|
+
if (el.tagName.toLowerCase().startsWith('mds-')) {
|
|
25
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
26
|
+
if (el && 'updateLang' in el) {
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
el.updateLang();
|
|
29
|
+
}
|
|
28
30
|
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
31
33
|
};
|
|
32
34
|
this.pluralize = (tag, context) => {
|
|
33
35
|
const languagePhrase = this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag];
|
|
@@ -25,4 +25,13 @@ const hasSlotted = (el, name) => {
|
|
|
25
25
|
}
|
|
26
26
|
return false;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
const hasSlottedContent = (el, name) => {
|
|
29
|
+
var _a;
|
|
30
|
+
const query = name ? `slot[name="${name}"]` : 'slot:not([name])';
|
|
31
|
+
const slot = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(query);
|
|
32
|
+
if (!slot)
|
|
33
|
+
return false;
|
|
34
|
+
const assignedNodes = slot.assignedNodes({ flatten: true });
|
|
35
|
+
return assignedNodes.some(node => { var _a; return node.nodeType === Node.TEXT_NODE && ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== ''; });
|
|
36
|
+
};
|
|
37
|
+
export { hasSlottedElements, hasSlottedNodes, hasSlottedContent, hasSlotted, };
|
|
@@ -7,6 +7,15 @@ const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
|
|
|
7
7
|
}
|
|
8
8
|
return defaultValue;
|
|
9
9
|
};
|
|
10
|
+
const cssDurationToSeconds = (duration, defaultValue = 1000) => {
|
|
11
|
+
if (duration.includes('ms')) {
|
|
12
|
+
return Number(duration.replace('ms', '')) / 1000;
|
|
13
|
+
}
|
|
14
|
+
if (duration.includes('s')) {
|
|
15
|
+
return Number(duration.replace('s', ''));
|
|
16
|
+
}
|
|
17
|
+
return defaultValue;
|
|
18
|
+
};
|
|
10
19
|
const cssSizeToNumber = (size, defaultValue = 0) => {
|
|
11
20
|
if (size.includes('px')) {
|
|
12
21
|
return Number(size.replace('px', ''));
|
|
@@ -19,4 +28,10 @@ const cssSizeToNumber = (size, defaultValue = 0) => {
|
|
|
19
28
|
}
|
|
20
29
|
return defaultValue;
|
|
21
30
|
};
|
|
22
|
-
|
|
31
|
+
const cssRotationToNumber = (size, defaultValue = 0) => {
|
|
32
|
+
if (size.includes('deg')) {
|
|
33
|
+
return Number(size.replace('deg', ''));
|
|
34
|
+
}
|
|
35
|
+
return defaultValue;
|
|
36
|
+
};
|
|
37
|
+
export { cssDurationToMilliseconds, cssDurationToSeconds, cssRotationToNumber, cssSizeToNumber, };
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
border: 0;
|
|
88
88
|
box-shadow: var(--mds-input-select-ring), var(--mds-input-select-shadow);
|
|
89
89
|
box-sizing: border-box;
|
|
90
|
-
color: rgb(var(--tone-neutral-
|
|
90
|
+
color: rgb(var(--tone-neutral-02));
|
|
91
91
|
cursor: pointer;
|
|
92
92
|
overflow: hidden;
|
|
93
93
|
text-overflow: ellipsis;
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
color: rgb(var(--tone-neutral-03));
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
.input
|
|
116
|
-
color: rgb(var(--tone-neutral-
|
|
115
|
+
:host([required]:not([required="false"])) .input {
|
|
116
|
+
color: rgb(var(--tone-neutral-05));
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.input:disabled {
|
|
@@ -291,12 +291,10 @@
|
|
|
291
291
|
|
|
292
292
|
:host-context(.pref-theme-dark) {
|
|
293
293
|
--mds-input-select-ring: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.3);
|
|
294
|
-
--mds-input-select-arrow-icon-background-color: var(--mds-input-select-arrow-icon-blur-background-color);
|
|
295
294
|
--mds-input-select-arrow-icon-blur-background-color: rgb(var(--variant-primary-05));
|
|
296
295
|
--mds-input-select-arrow-icon-blur-color: rgb(var(--mds-input-select-variant-color));
|
|
297
|
-
--mds-input-select-arrow-icon-color: var(--
|
|
298
|
-
--mds-input-select-arrow-icon-hover-
|
|
299
|
-
--mds-input-select-arrow-icon-hover-color: rgb(var(--tone-neutral-10));
|
|
296
|
+
--mds-input-select-arrow-icon-hover-background-color: rgb(var(--variant-primary-04));
|
|
297
|
+
--mds-input-select-arrow-icon-hover-color: rgb(var(--variant-primary-08));
|
|
300
298
|
}
|
|
301
299
|
|
|
302
300
|
:host-context(.pref-theme-dark) .input {
|
|
@@ -306,12 +304,10 @@
|
|
|
306
304
|
@media (prefers-color-scheme: dark) {
|
|
307
305
|
:host-context(.pref-theme-system) {
|
|
308
306
|
--mds-input-select-ring: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.3);
|
|
309
|
-
--mds-input-select-arrow-icon-background-color: var(--mds-input-select-arrow-icon-blur-background-color);
|
|
310
307
|
--mds-input-select-arrow-icon-blur-background-color: rgb(var(--variant-primary-05));
|
|
311
308
|
--mds-input-select-arrow-icon-blur-color: rgb(var(--mds-input-select-variant-color));
|
|
312
|
-
--mds-input-select-arrow-icon-color: var(--
|
|
313
|
-
--mds-input-select-arrow-icon-hover-
|
|
314
|
-
--mds-input-select-arrow-icon-hover-color: rgb(var(--tone-neutral-10));
|
|
309
|
+
--mds-input-select-arrow-icon-hover-background-color: rgb(var(--variant-primary-04));
|
|
310
|
+
--mds-input-select-arrow-icon-hover-color: rgb(var(--variant-primary-08));
|
|
315
311
|
}
|
|
316
312
|
|
|
317
313
|
:host-context(.pref-theme-system) .input {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
1
|
import miBaselineKeyboardArrowDown from "@icon/mi/baseline/keyboard-arrow-down.svg";
|
|
3
2
|
import { Host, h } from "@stencil/core";
|
|
4
3
|
/**
|
|
@@ -6,6 +5,7 @@ import { Host, h } from "@stencil/core";
|
|
|
6
5
|
*/
|
|
7
6
|
export class MdsInputSelect {
|
|
8
7
|
constructor() {
|
|
8
|
+
// @State() selected: boolean
|
|
9
9
|
this.hasFocus = false;
|
|
10
10
|
/**
|
|
11
11
|
* If true, the element is displayed as disabled
|
|
@@ -56,10 +56,9 @@ export class MdsInputSelect {
|
|
|
56
56
|
});
|
|
57
57
|
};
|
|
58
58
|
this.onSlotChangeHandler = () => {
|
|
59
|
-
var _a, _b, _c;
|
|
59
|
+
var _a, _b, _c, _d;
|
|
60
60
|
const elements = (_b = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('slot')[0]) === null || _b === void 0 ? void 0 : _b.assignedNodes();
|
|
61
|
-
const
|
|
62
|
-
const options = select === null || select === void 0 ? void 0 : select.querySelectorAll('option');
|
|
61
|
+
const options = (_c = this.selectEl) === null || _c === void 0 ? void 0 : _c.querySelectorAll('option');
|
|
63
62
|
if (!options) {
|
|
64
63
|
return;
|
|
65
64
|
}
|
|
@@ -70,19 +69,16 @@ export class MdsInputSelect {
|
|
|
70
69
|
this.emptyOptions();
|
|
71
70
|
}
|
|
72
71
|
elements === null || elements === void 0 ? void 0 : elements.forEach((element) => {
|
|
73
|
-
|
|
72
|
+
var _a;
|
|
73
|
+
(_a = this.selectEl) === null || _a === void 0 ? void 0 : _a.appendChild(element.cloneNode(true));
|
|
74
74
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
* selected option that we wanted as a default
|
|
78
|
-
*/
|
|
79
|
-
if (this.value) {
|
|
80
|
-
select === null || select === void 0 ? void 0 : select.querySelectorAll('option').forEach((element) => {
|
|
75
|
+
if (this.value && this.selectEl) {
|
|
76
|
+
this.selectEl.querySelectorAll('option').forEach((element) => {
|
|
81
77
|
element.selected = element.value === this.value;
|
|
82
78
|
});
|
|
83
79
|
}
|
|
84
80
|
else if (!this.placeholder) {
|
|
85
|
-
this.value =
|
|
81
|
+
this.value = (_d = this.selectEl) === null || _d === void 0 ? void 0 : _d.querySelectorAll('option')[0].value;
|
|
86
82
|
}
|
|
87
83
|
};
|
|
88
84
|
}
|
|
@@ -91,7 +87,6 @@ export class MdsInputSelect {
|
|
|
91
87
|
*/
|
|
92
88
|
valueChanged() {
|
|
93
89
|
var _a, _b, _c;
|
|
94
|
-
this.selected = this.value !== '';
|
|
95
90
|
this.changeEvent.emit({ value: (_a = this.value) === null || _a === void 0 ? void 0 : _a.toString() });
|
|
96
91
|
this.internals.setFormValue((_c = (_b = this.value) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : null);
|
|
97
92
|
}
|
|
@@ -105,18 +100,45 @@ export class MdsInputSelect {
|
|
|
105
100
|
this.internals.setFormValue(null);
|
|
106
101
|
}
|
|
107
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* This is for the react component because placeholder is valued after didload
|
|
105
|
+
* and therefore the placeholder option is drawn as the last option.
|
|
106
|
+
* Here the option is brought back to the first position
|
|
107
|
+
* @param newValue placeholder new value
|
|
108
|
+
* @param oldValue placeholder old value
|
|
109
|
+
*/
|
|
110
|
+
placeholderChanged(newValue, oldValue) {
|
|
111
|
+
if (newValue && !oldValue) {
|
|
112
|
+
let defaultOption = document.querySelector('.placeholder-option');
|
|
113
|
+
if (defaultOption)
|
|
114
|
+
defaultOption.remove();
|
|
115
|
+
defaultOption = document.createElement('option');
|
|
116
|
+
this.selectEl.insertBefore(defaultOption, this.selectEl.firstChild);
|
|
117
|
+
defaultOption.value = '';
|
|
118
|
+
defaultOption.text = newValue;
|
|
119
|
+
if (!this.defaultValue)
|
|
120
|
+
defaultOption.selected = true;
|
|
121
|
+
if (this.required)
|
|
122
|
+
defaultOption.disabled = true;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
108
125
|
formResetCallback() {
|
|
109
126
|
this.internals.setFormValue('');
|
|
110
127
|
}
|
|
128
|
+
componentWillLoad() {
|
|
129
|
+
// needed for react component, this prop should be used as default-value html attributo instead of defaultValue prop
|
|
130
|
+
if (this.defaultValue) {
|
|
131
|
+
this.value = this.defaultValue;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
111
134
|
componentDidLoad() {
|
|
112
135
|
if (this.value) {
|
|
113
|
-
this.selected = true;
|
|
114
136
|
this.internals.setFormValue(this.value.toString());
|
|
115
137
|
}
|
|
116
138
|
}
|
|
117
139
|
render() {
|
|
118
|
-
return (h(Host, { key: '
|
|
119
|
-
h("mds-input-tip-item", { key: '
|
|
140
|
+
return (h(Host, { key: '1e31a254cadf3141f66b003aeed3bbcb1912f748' }, h("select", { key: '0af51ed5c0daa0a5969d13edc7814e8f482eecea', class: 'input', onInput: this.onInput.bind(this), onBlur: this.onBlur, onFocus: this.onFocus, name: this.name, required: this.required, disabled: this.disabled, multiple: this.multiple, size: this.size, part: "select", ref: el => this.selectEl = el }, h("option", { key: '597095579dc1e50a927d14c111fb8ab82c7ac971', class: "placeholder-option", value: "", disabled: !this.required ? undefined : true, selected: this.defaultValue ? undefined : true }, this.placeholder)), h("div", { key: '3daf36535e69bf3909b184ea9658b7b7b4850a7d', class: "icon-container" }, h("i", { key: 'b98d5e916a2e050af8ed94066dcf51152b90738d', class: "icon", innerHTML: miBaselineKeyboardArrowDown })), h("div", { key: '964828e831559130e018cfc62e1fb076e0b2478b', class: "option-container" }, h("slot", { key: '394d87e522c0c6fceadcc829d39c9a277b014ae3', onSlotchange: this.onSlotChangeHandler })), h("mds-input-tip", { key: '019abf7e5d56dd4eb93864bd7fd0fa28446ba0b5', position: "top", active: this.hasFocus }, this.disabled && h("mds-input-tip-item", { key: '8fc9b96596eea2eb99adc0c0e7b580fa9f92a355', expanded: true, variant: "disabled" }), this.required &&
|
|
141
|
+
h("mds-input-tip-item", { key: '0eec9f0ade26adfba03eb3f3f38af1c1e831af55', expanded: this.hasFocus, variant: this.value === '' ? 'required' : 'required-success' }))));
|
|
120
142
|
}
|
|
121
143
|
static get is() { return "mds-input-select"; }
|
|
122
144
|
static get encapsulation() { return "shadow"; }
|
|
@@ -309,6 +331,25 @@ export class MdsInputSelect {
|
|
|
309
331
|
"reflect": true,
|
|
310
332
|
"defaultValue": "''"
|
|
311
333
|
},
|
|
334
|
+
"defaultValue": {
|
|
335
|
+
"type": "any",
|
|
336
|
+
"mutable": false,
|
|
337
|
+
"complexType": {
|
|
338
|
+
"original": "string | number | null",
|
|
339
|
+
"resolved": "null | number | string | undefined",
|
|
340
|
+
"references": {}
|
|
341
|
+
},
|
|
342
|
+
"required": false,
|
|
343
|
+
"optional": true,
|
|
344
|
+
"docs": {
|
|
345
|
+
"tags": [],
|
|
346
|
+
"text": "Specifies the default value of the component"
|
|
347
|
+
},
|
|
348
|
+
"getter": false,
|
|
349
|
+
"setter": false,
|
|
350
|
+
"attribute": "default-value",
|
|
351
|
+
"reflect": true
|
|
352
|
+
},
|
|
312
353
|
"variant": {
|
|
313
354
|
"type": "string",
|
|
314
355
|
"mutable": false,
|
|
@@ -338,7 +379,6 @@ export class MdsInputSelect {
|
|
|
338
379
|
}
|
|
339
380
|
static get states() {
|
|
340
381
|
return {
|
|
341
|
-
"selected": {},
|
|
342
382
|
"hasFocus": {}
|
|
343
383
|
};
|
|
344
384
|
}
|
|
@@ -374,6 +414,9 @@ export class MdsInputSelect {
|
|
|
374
414
|
}, {
|
|
375
415
|
"propName": "disabled",
|
|
376
416
|
"methodName": "disabledChanged"
|
|
417
|
+
}, {
|
|
418
|
+
"propName": "placeholder",
|
|
419
|
+
"methodName": "placeholderChanged"
|
|
377
420
|
}];
|
|
378
421
|
}
|
|
379
422
|
static get attachInternalsMemberName() { return "internals"; }
|