@maggioli-design-system/mds-input 5.8.1 → 6.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/{index-d13bd48d.js → index-a4879d20.js} +3 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mds-input.cjs.entry.js +47 -13
- package/dist/cjs/mds-input.cjs.js +2 -2
- package/dist/collection/common/locale.js +20 -0
- package/dist/collection/components/mds-input/mds-input.css +0 -178
- package/dist/collection/components/mds-input/mds-input.js +15 -66
- package/dist/collection/components/mds-input/test/mds-input.stories.js +0 -30
- package/dist/collection/type/variant-file-format.js +20 -11
- package/dist/components/mds-input.js +46 -15
- package/dist/documentation.json +2 -77
- package/dist/esm/{index-0e58948f.js → index-cbead100.js} +3 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mds-input.entry.js +47 -13
- package/dist/esm/mds-input.js +3 -3
- package/dist/esm-es5/{index-0e58948f.js → index-cbead100.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-input.entry.js +1 -1
- package/dist/esm-es5/mds-input.js +1 -1
- package/dist/mds-input/mds-input.esm.js +1 -1
- package/dist/mds-input/mds-input.js +1 -1
- package/dist/mds-input/p-0a932600.js +2 -0
- package/dist/mds-input/p-32144fd2.system.entry.js +1 -0
- package/dist/mds-input/p-7a54a700.entry.js +1 -0
- package/dist/mds-input/p-d1c65089.system.js +2 -0
- package/dist/mds-input/p-fef7d795.system.js +1 -0
- package/dist/stats.json +50 -162
- package/dist/types/common/locale.d.ts +14 -0
- package/dist/types/components/mds-input/test/mds-input.stories.d.ts +0 -21
- package/dist/types/components.d.ts +1 -25
- package/documentation.json +49 -79
- package/package.json +5 -4
- package/readme.md +38 -38
- package/src/common/locale.ts +31 -0
- package/src/components/mds-input/mds-input.css +0 -1
- package/src/components/mds-input/mds-input.tsx +48 -77
- package/src/components/mds-input/meta/locale.en.json +4 -0
- package/src/components/mds-input/meta/locale.it.json +4 -0
- package/src/components/mds-input/readme.md +33 -36
- package/src/components/mds-input/test/mds-input.stories.tsx +0 -33
- package/src/components.d.ts +1 -25
- package/src/fixtures/icons.json +17 -0
- package/src/fixtures/iconsauce.json +9 -0
- package/src/type/variant-file-format.ts +20 -11
- package/www/build/mds-input.esm.js +1 -1
- package/www/build/mds-input.js +1 -1
- package/www/build/p-0a932600.js +2 -0
- package/www/build/p-32144fd2.system.entry.js +1 -0
- package/www/build/p-7a54a700.entry.js +1 -0
- package/www/build/p-d1c65089.system.js +2 -0
- package/www/build/p-fef7d795.system.js +1 -0
- package/dist/mds-input/p-43934a8d.entry.js +0 -1
- package/dist/mds-input/p-534509b0.js +0 -2
- package/dist/mds-input/p-92707e12.system.js +0 -1
- package/dist/mds-input/p-b99c7250.system.js +0 -2
- package/dist/mds-input/p-c02f60bd.system.entry.js +0 -1
- package/src/components/mds-input/css/mds-input-tip.css +0 -149
- package/www/build/p-43934a8d.entry.js +0 -1
- package/www/build/p-534509b0.js +0 -2
- package/www/build/p-92707e12.system.js +0 -1
- package/www/build/p-b99c7250.system.js +0 -2
- package/www/build/p-c02f60bd.system.entry.js +0 -1
|
@@ -972,6 +972,9 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
972
972
|
maybePromise = safeCall(instance, 'componentWillLoad');
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
|
+
{
|
|
976
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
|
|
977
|
+
}
|
|
975
978
|
endSchedule();
|
|
976
979
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
977
980
|
};
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-a4879d20.js');
|
|
6
6
|
|
|
7
7
|
const defineCustomElements = (win, options) => {
|
|
8
8
|
if (typeof window === 'undefined') return undefined;
|
|
9
|
-
return index.bootstrapLazy([["mds-input.cjs",[[65,"mds-input",{"autocomplete":[513],"autofocus":[516],"await":[516],"controlsLayout":[513,"controls-layout"],"controlsIcon":[513,"controls-icon"],"controlIncreaseLabel":[513,"control-increase-label"],"controlDecreaseLabel":[513,"control-decrease-label"],"datalist":[16],"disabled":[516],"
|
|
9
|
+
return index.bootstrapLazy([["mds-input.cjs",[[65,"mds-input",{"autocomplete":[513],"autofocus":[516],"await":[516],"controlsLayout":[513,"controls-layout"],"controlsIcon":[513,"controls-icon"],"controlIncreaseLabel":[513,"control-increase-label"],"controlDecreaseLabel":[513,"control-decrease-label"],"datalist":[16],"disabled":[516],"icon":[513],"max":[513],"maxlength":[514],"min":[520],"minlength":[514],"name":[513],"pattern":[513],"placeholder":[513],"readonly":[516],"required":[516],"variant":[513],"tip":[513],"step":[513],"type":[513],"typography":[513],"value":[1537],"hasFocus":[32],"setFocus":[64],"getInputElement":[64]},null,{"value":["valueChanged"]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -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-a4879d20.js');
|
|
6
6
|
|
|
7
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}
|
|
8
8
|
|
|
@@ -14,9 +14,42 @@ const miBaselineArrowUp = `<svg xmlns="http://www.w3.org/2000/svg" width="24" he
|
|
|
14
14
|
|
|
15
15
|
const miBaselineRemove = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>`;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
class Locale {
|
|
18
|
+
constructor(configData) {
|
|
19
|
+
this.defaultLanguage = 'en';
|
|
20
|
+
this.lang = (element) => {
|
|
21
|
+
const closestElement = element.closest('[lang]');
|
|
22
|
+
if (closestElement) {
|
|
23
|
+
if (closestElement.lang) {
|
|
24
|
+
this.language = closestElement.lang;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
this.language = this.defaultLanguage;
|
|
29
|
+
};
|
|
30
|
+
this.get = (tag) => {
|
|
31
|
+
var _a;
|
|
32
|
+
return (_a = this.config[this.language][tag]) !== null && _a !== void 0 ? _a : this.config[this.defaultLanguage][tag];
|
|
33
|
+
};
|
|
34
|
+
this.config = configData;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
18
37
|
|
|
19
|
-
const mdsInputCss = "*, ::before, ::after{\n\n --tw-border-spacing-x: 0;\n\n --tw-border-spacing-y: 0;\n\n --tw-translate-x: 0;\n\n --tw-translate-y: 0;\n\n --tw-rotate: 0;\n\n --tw-skew-x: 0;\n\n --tw-skew-y: 0;\n\n --tw-scale-x: 1;\n\n --tw-scale-y: 1;\n\n --tw-pan-x: ;\n\n --tw-pan-y: ;\n\n --tw-pinch-zoom: ;\n\n --tw-scroll-snap-strictness: proximity;\n\n --tw-gradient-from-position: ;\n\n --tw-gradient-via-position: ;\n\n --tw-gradient-to-position: ;\n\n --tw-ordinal: ;\n\n --tw-slashed-zero: ;\n\n --tw-numeric-figure: ;\n\n --tw-numeric-spacing: ;\n\n --tw-numeric-fraction: ;\n\n --tw-ring-inset: ;\n\n --tw-ring-offset-width: 0px;\n\n --tw-ring-offset-color: #fff;\n\n --tw-ring-color: rgb(59 130 246 / 0.5);\n\n --tw-ring-offset-shadow: 0 0 #0000;\n\n --tw-ring-shadow: 0 0 #0000;\n\n --tw-shadow: 0 0 #0000;\n\n --tw-shadow-colored: 0 0 #0000;\n\n --tw-blur: ;\n\n --tw-brightness: ;\n\n --tw-contrast: ;\n\n --tw-grayscale: ;\n\n --tw-hue-rotate: ;\n\n --tw-invert: ;\n\n --tw-saturate: ;\n\n --tw-sepia: ;\n\n --tw-drop-shadow: ;\n\n --tw-backdrop-blur: ;\n\n --tw-backdrop-brightness: ;\n\n --tw-backdrop-contrast: ;\n\n --tw-backdrop-grayscale: ;\n\n --tw-backdrop-hue-rotate: ;\n\n --tw-backdrop-invert: ;\n\n --tw-backdrop-opacity: ;\n\n --tw-backdrop-saturate: ;\n\n --tw-backdrop-sepia: ;\n}\n\n::-webkit-backdrop{\n\n --tw-border-spacing-x: 0;\n\n --tw-border-spacing-y: 0;\n\n --tw-translate-x: 0;\n\n --tw-translate-y: 0;\n\n --tw-rotate: 0;\n\n --tw-skew-x: 0;\n\n --tw-skew-y: 0;\n\n --tw-scale-x: 1;\n\n --tw-scale-y: 1;\n\n --tw-pan-x: ;\n\n --tw-pan-y: ;\n\n --tw-pinch-zoom: ;\n\n --tw-scroll-snap-strictness: proximity;\n\n --tw-gradient-from-position: ;\n\n --tw-gradient-via-position: ;\n\n --tw-gradient-to-position: ;\n\n --tw-ordinal: ;\n\n --tw-slashed-zero: ;\n\n --tw-numeric-figure: ;\n\n --tw-numeric-spacing: ;\n\n --tw-numeric-fraction: ;\n\n --tw-ring-inset: ;\n\n --tw-ring-offset-width: 0px;\n\n --tw-ring-offset-color: #fff;\n\n --tw-ring-color: rgb(59 130 246 / 0.5);\n\n --tw-ring-offset-shadow: 0 0 #0000;\n\n --tw-ring-shadow: 0 0 #0000;\n\n --tw-shadow: 0 0 #0000;\n\n --tw-shadow-colored: 0 0 #0000;\n\n --tw-blur: ;\n\n --tw-brightness: ;\n\n --tw-contrast: ;\n\n --tw-grayscale: ;\n\n --tw-hue-rotate: ;\n\n --tw-invert: ;\n\n --tw-saturate: ;\n\n --tw-sepia: ;\n\n --tw-drop-shadow: ;\n\n --tw-backdrop-blur: ;\n\n --tw-backdrop-brightness: ;\n\n --tw-backdrop-contrast: ;\n\n --tw-backdrop-grayscale: ;\n\n --tw-backdrop-hue-rotate: ;\n\n --tw-backdrop-invert: ;\n\n --tw-backdrop-opacity: ;\n\n --tw-backdrop-saturate: ;\n\n --tw-backdrop-sepia: ;\n}\n\n::-ms-backdrop{\n\n --tw-border-spacing-x: 0;\n\n --tw-border-spacing-y: 0;\n\n --tw-translate-x: 0;\n\n --tw-translate-y: 0;\n\n --tw-rotate: 0;\n\n --tw-skew-x: 0;\n\n --tw-skew-y: 0;\n\n --tw-scale-x: 1;\n\n --tw-scale-y: 1;\n\n --tw-pan-x: ;\n\n --tw-pan-y: ;\n\n --tw-pinch-zoom: ;\n\n --tw-scroll-snap-strictness: proximity;\n\n --tw-gradient-from-position: ;\n\n --tw-gradient-via-position: ;\n\n --tw-gradient-to-position: ;\n\n --tw-ordinal: ;\n\n --tw-slashed-zero: ;\n\n --tw-numeric-figure: ;\n\n --tw-numeric-spacing: ;\n\n --tw-numeric-fraction: ;\n\n --tw-ring-inset: ;\n\n --tw-ring-offset-width: 0px;\n\n --tw-ring-offset-color: #fff;\n\n --tw-ring-color: rgb(59 130 246 / 0.5);\n\n --tw-ring-offset-shadow: 0 0 #0000;\n\n --tw-ring-shadow: 0 0 #0000;\n\n --tw-shadow: 0 0 #0000;\n\n --tw-shadow-colored: 0 0 #0000;\n\n --tw-blur: ;\n\n --tw-brightness: ;\n\n --tw-contrast: ;\n\n --tw-grayscale: ;\n\n --tw-hue-rotate: ;\n\n --tw-invert: ;\n\n --tw-saturate: ;\n\n --tw-sepia: ;\n\n --tw-drop-shadow: ;\n\n --tw-backdrop-blur: ;\n\n --tw-backdrop-brightness: ;\n\n --tw-backdrop-contrast: ;\n\n --tw-backdrop-grayscale: ;\n\n --tw-backdrop-hue-rotate: ;\n\n --tw-backdrop-invert: ;\n\n --tw-backdrop-opacity: ;\n\n --tw-backdrop-saturate: ;\n\n --tw-backdrop-sepia: ;\n}\n\n::backdrop{\n\n --tw-border-spacing-x: 0;\n\n --tw-border-spacing-y: 0;\n\n --tw-translate-x: 0;\n\n --tw-translate-y: 0;\n\n --tw-rotate: 0;\n\n --tw-skew-x: 0;\n\n --tw-skew-y: 0;\n\n --tw-scale-x: 1;\n\n --tw-scale-y: 1;\n\n --tw-pan-x: ;\n\n --tw-pan-y: ;\n\n --tw-pinch-zoom: ;\n\n --tw-scroll-snap-strictness: proximity;\n\n --tw-gradient-from-position: ;\n\n --tw-gradient-via-position: ;\n\n --tw-gradient-to-position: ;\n\n --tw-ordinal: ;\n\n --tw-slashed-zero: ;\n\n --tw-numeric-figure: ;\n\n --tw-numeric-spacing: ;\n\n --tw-numeric-fraction: ;\n\n --tw-ring-inset: ;\n\n --tw-ring-offset-width: 0px;\n\n --tw-ring-offset-color: #fff;\n\n --tw-ring-color: rgb(59 130 246 / 0.5);\n\n --tw-ring-offset-shadow: 0 0 #0000;\n\n --tw-ring-shadow: 0 0 #0000;\n\n --tw-shadow: 0 0 #0000;\n\n --tw-shadow-colored: 0 0 #0000;\n\n --tw-blur: ;\n\n --tw-brightness: ;\n\n --tw-contrast: ;\n\n --tw-grayscale: ;\n\n --tw-hue-rotate: ;\n\n --tw-invert: ;\n\n --tw-saturate: ;\n\n --tw-sepia: ;\n\n --tw-drop-shadow: ;\n\n --tw-backdrop-blur: ;\n\n --tw-backdrop-brightness: ;\n\n --tw-backdrop-contrast: ;\n\n --tw-backdrop-grayscale: ;\n\n --tw-backdrop-hue-rotate: ;\n\n --tw-backdrop-invert: ;\n\n --tw-backdrop-opacity: ;\n\n --tw-backdrop-saturate: ;\n\n --tw-backdrop-sepia: ;\n}\n@tailwind utilities;\n\n/**\n * @prop --mds-input-background: Sets the background-color of the component\n * @prop --mds-input-icon-color: Sets the icon color of the component\n * @prop --mds-input-ring: Sets the box-shadow of the component's input\n * @prop --mds-input-shadow: Sets the box-shadow of the component's input\n * @prop --mds-input-textarea-field-sizing: Sets the height of the textarea automatically, this is an EXPERIMENTAL css property, so it couldn't work in every browser \n * @prop --mds-input-textarea-max-height: Sets the `max-height` of the component when attribute `type` is set to `textarea`\n * @prop --mds-input-textarea-min-height: Sets the `min-height` of the component when attribute `type` is set to `textarea`\n * @prop --mds-input-tip-background: Sets the background color of the tip message at the bottom right of the component\n * @prop --mds-input-variant-color: Sets the variant colors of the component\n */\n\n:host {\n\n --mds-input-background: rgb(var(--tone-neutral));\n --mds-input-icon-color: var(--mds-input-variant-color);\n --mds-input-tip-background: 84 84 84;\n --mds-input-ring: 0 0 0 1px rgb(var(--mds-input-variant-color) / 0.1);\n --mds-input-shadow: 0 1px 3px 0 rgb(var(--mds-input-variant-color) / 0.1), 0 1px 2px 0 rgb(var(--mds-input-variant-color) / 0.06);\n --mds-input-variant-color: 0 0 0;\n --mds-input-controls-color: rgb(var(--tone-neutral-04));\n --mds-input-controls-border: 2px solid rgb(var(--tone-neutral-09));\n --mds-input-textarea-min-height: 6rem;\n --mds-input-textarea-max-height: 16rem;\n --mds-input-textarea-field-sizing: content;\n min-height: 1.5rem;\n font-family: Karla, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n font-size: 1rem;\n line-height: 1.5rem;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n gap: 0.5rem;\n\n container-type: inline-size;\n display: -ms-flexbox;\n display: flex;\n position: relative;\n}\n\n:host( [typography=\"detail\"] ) .input{\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\n:host( [typography=\"snippet\"] ) .input{\n\n min-height: 1.5rem;\n\n font-family: 'Roboto Mono', 'Courier New', monospace;\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\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 border-radius: 0.5rem;\n\n padding-left: 1rem;\n\n padding-right: 1rem;\n\n padding-top: 0.75rem;\n\n padding-bottom: 0.75rem;\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 background-color: var(--mds-input-background);\n border: 0;\n -webkit-box-shadow: var(--mds-input-ring), var(--mds-input-shadow);\n box-shadow: var(--mds-input-ring), var(--mds-input-shadow);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: rgb(var(--tone-neutral-02));\n min-height: 3rem;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-transition-property: background-color, border-color, color, fill, margin, opacity, padding, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, color, fill, margin, opacity, padding, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, box-shadow, color, fill, margin, opacity, padding, transform;\n transition-property: background-color, border-color, box-shadow, color, fill, margin, opacity, padding, transform, -webkit-box-shadow, -webkit-transform;\n width: 100%;\n}\n\n.input::-webkit-outer-spin-button,\n.input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n appearance: none;\n display: none;\n margin: 0;\n}\n\ntextarea.input{\n\n resize: vertical;\n\n border-bottom-right-radius: 0;\n\n field-sizing: var(--mds-input-textarea-field-sizing);\n max-height: var(--mds-input-textarea-max-height);\n min-height: var(--mds-input-textarea-min-height);\n overflow: auto;\n}\n\n.input:focus{\n\n outline: 2px solid transparent;\n\n outline-offset: 2px;\n\n -webkit-transition-property: background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;\n\n transition-property: background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;\n\n transition-property: background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;\n\n transition-property: background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;\n\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\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 --mds-input-ring: 0 0 0 3px rgb(var(--mds-input-variant-color) / 1);\n --mds-input-shadow: 0 4px 6px 3px rgb(var(--mds-input-variant-color) / 0.1), 0 2px 4px -1px rgb(var(--mds-input-variant-color) / 0.06);\n}\n\n.input:disabled {\n background-color: rgb(var(--tone-neutral-10));\n}\n\n.input:disabled::-moz-placeholder {\n color: rgb(var(--tone-neutral-05));\n}\n\n.input:disabled::-webkit-input-placeholder {\n color: rgb(var(--tone-neutral-05));\n}\n\n.input:disabled:-ms-input-placeholder {\n color: rgb(var(--tone-neutral-05));\n}\n\n.input:disabled::-ms-input-placeholder {\n color: rgb(var(--tone-neutral-05));\n}\n\n.input:disabled,\n.input:disabled::placeholder {\n color: rgb(var(--tone-neutral-05));\n}\n\n.input.has-icon{\n\n padding-left: 2.75rem;\n}\n\n\n.await,\n.icon{\n\n left: 0.75rem;\n\n top: 0.75rem;\n\n fill: rgb(var(--mds-input-icon-color));\n position: absolute;\n}\n\n.await {\n color: rgb(var(--mds-input-icon-color));\n height: 24px;\n width: 24px;\n}\n\n.counter {\n border-left: var(--mds-input-controls-border);\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n gap: 0;\n position: absolute;\n right: 0;\n}\n\n.counter-button{\n\n height: 1.5rem;\n\n width: 1.75rem;\n\n border-radius: 0.5rem;\n\n --mds-button-background: transparent;\n --mds-button-icon-color: var(--mds-input-controls-color);\n\n border: 0;\n min-height: 0;\n padding: 0;\n}\n\n.counter-button:hover {\n\n --mds-button-background: rgb(var(--tone-neutral-09));\n}\n\n.counter .counter-button:first-child {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: 0;\n}\n\n.counter .counter-button:last-child {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n}\n\n.counter-button--horizontal{\n\n height: 3rem;\n\n width: 3rem;\n\n bottom: 0;\n position: absolute;\n top: 0;\n}\n\n.counter-button--decrease {\n border-bottom-right-radius: 0;\n border-right: var(--mds-input-controls-border);\n border-top-right-radius: 0;\n left: 0;\n}\n\n.counter-button--increase {\n border-bottom-left-radius: 0;\n border-left: var(--mds-input-controls-border);\n border-top-left-radius: 0;\n right: 0;\n}\n\n:host( [type=\"number\"] ) .input{\n\n padding-right: 2rem;\n}\n\n:host( [type=\"number\"][controls-layout=\"horizontal\"] ) .input{\n\n padding-left: 3.5rem;\n\n padding-right: 3.5rem;\n\n text-align: center;\n}\n\n:host( [type=\"number\"][controls-layout=\"horizontal\"][icon] ) .input{\n\n padding-left: 6rem;\n\n text-align: left;\n}\n\n\n:host( [type=\"number\"][controls-layout=\"horizontal\"] ) .icon{\n\n left: 3.75rem;\n}\n\n.static{\n\n position: static;\n}\n\n.fixed{\n\n position: fixed;\n}\n\n.absolute{\n\n position: absolute;\n}\n\n.grid{\n\n display: grid;\n}\n\n.w-min{\n\n width: -moz-min-content;\n\n width: -webkit-min-content;\n\n width: min-content;\n}\n\n.gap-400{\n\n gap: 1rem;\n}\n\n.gap-600{\n\n gap: 1.5rem;\n}\n\n.truncate{\n\n overflow: hidden;\n\n text-overflow: ellipsis;\n\n white-space: nowrap;\n}\n\n.rounded{\n\n border-radius: 0.25rem;\n}\n\n.border{\n\n border-width: 1px;\n}\n\n.bg-label-amaranth-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-amaranth-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-aqua-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-aqua-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-blue-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-blue-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-green-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-green-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-lime-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-lime-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-orange-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-orange-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-orchid-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-orchid-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-violet-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-violet-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-yellow-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-yellow-10) / var(--tw-bg-opacity));\n}\n\n.bg-tone-neutral-08{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--tone-neutral-08) / var(--tw-bg-opacity));\n}\n\n.bg-tone-neutral-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--tone-neutral-10) / var(--tw-bg-opacity));\n}\n\n.fill-label-amaranth-04{\n\n fill: rgb(var(--label-amaranth-04));\n}\n\n.fill-label-aqua-04{\n\n fill: rgb(var(--label-aqua-04));\n}\n\n.fill-label-blue-04{\n\n fill: rgb(var(--label-blue-04));\n}\n\n.fill-label-green-04{\n\n fill: rgb(var(--label-green-04));\n}\n\n.fill-label-lime-04{\n\n fill: rgb(var(--label-lime-04));\n}\n\n.fill-label-orange-04{\n\n fill: rgb(var(--label-orange-04));\n}\n\n.fill-label-orchid-04{\n\n fill: rgb(var(--label-orchid-04));\n}\n\n.fill-label-violet-04{\n\n fill: rgb(var(--label-violet-04));\n}\n\n.fill-label-yellow-04{\n\n fill: rgb(var(--label-yellow-04));\n}\n\n.fill-tone-neutral-04{\n\n fill: rgb(var(--tone-neutral-04));\n}\n\n.text-label-amaranth-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-amaranth-04) / var(--tw-text-opacity));\n}\n\n.text-label-aqua-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-aqua-04) / var(--tw-text-opacity));\n}\n\n.text-label-blue-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-blue-04) / var(--tw-text-opacity));\n}\n\n.text-label-green-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-green-04) / var(--tw-text-opacity));\n}\n\n.text-label-lime-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-lime-04) / var(--tw-text-opacity));\n}\n\n.text-label-orange-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-orange-04) / var(--tw-text-opacity));\n}\n\n.text-label-orchid-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-orchid-04) / var(--tw-text-opacity));\n}\n\n.text-label-violet-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-violet-04) / var(--tw-text-opacity));\n}\n\n.text-label-yellow-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-yellow-04) / var(--tw-text-opacity));\n}\n\n.text-tone-neutral-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--tone-neutral-04) / var(--tw-text-opacity));\n}\n\n.shadow{\n\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n\n -webkit-box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n:host {\n\n --mds-input-icon-color: var(--brand-maggioli-03);\n --mds-input-variant-color: 0 0 0;\n}\n\n:host( :focus ) {\n\n --mds-input-variant-color: var(--brand-maggioli-04);\n}\n\n:host( [variant=\"info\"] ) {\n\n --mds-input-icon-color: var(--status-info-05);\n --mds-input-tip-background: var(--status-info-05);\n --mds-input-variant-color: 0 0 0;\n}\n\n:host( [variant=\"info\"]:focus ) {\n\n --mds-input-icon-color: var(--status-info-04);\n --mds-input-variant-color: var(--status-info-05);\n}\n\n:host( [variant=\"success\"] ) {\n\n --mds-input-icon-color: var(--status-success-05);\n --mds-input-tip-background: var(--status-success-05);\n --mds-input-variant-color: 0 0 0;\n}\n\n:host( [variant=\"success\"]:focus ) {\n\n --mds-input-icon-color: var(--status-success-04);\n --mds-input-variant-color: var(--status-success-05);\n}\n\n:host( [variant=\"warning\"] ) {\n\n --mds-input-icon-color: var(--status-warning-05);\n --mds-input-tip-background: var(--status-warning-05);\n --mds-input-variant-color: 0 0 0;\n}\n\n:host( [variant=\"warning\"]:focus ) {\n\n --mds-input-icon-color: var(--status-warning-04);\n --mds-input-variant-color: var(--status-warning-05);\n}\n\n:host( [variant=\"error\"] ) {\n\n --mds-input-icon-color: var(--status-error-05);\n --mds-input-tip-background: var(--status-error-05);\n --mds-input-variant-color: 0 0 0;\n}\n\n:host( [variant=\"error\"]:focus ) {\n\n --mds-input-icon-color: var(--status-error-04);\n --mds-input-variant-color: var(--status-error-05);\n}\n\n.tip-container{\n\n left: 0.25rem;\n\n right: 0.25rem;\n\n gap: 0.25rem;\n\n -webkit-transition-property: background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;\n\n transition-property: background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;\n\n transition-property: background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;\n\n transition-property: background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;\n\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\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 display: -ms-flexbox;\n\n display: flex;\n -ms-flex-pack: end;\n justify-content: flex-end;\n pointer-events: none;\n position: absolute;\n}\n\n.tip-container:empty {\n display: none;\n}\n\n.tip-container--top {\n top: 0.25rem;\n}\n\n.tip-container--bottom {\n bottom: 0.25rem;\n}\n\n.tip{\n\n height: 0.75rem;\n\n border-radius: 0.375rem;\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 -ms-flex-align: center;\n\n align-items: center;\n background-color: rgb(var(--mds-input-tip-background));\n color: transparent;\n color: rgb(var(--tone-neutral));\n display: -ms-flexbox;\n display: flex;\n fill: rgb(var(--tone-neutral));\n -ms-flex-pack: center;\n justify-content: center;\n min-width: 0.75rem;\n padding: 0;\n pointer-events: none;\n position: static;\n text-align: center;\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0);\n -webkit-transition-property: background-color, border-radius, color, padding-left, padding-right, -webkit-transform;\n transition-property: background-color, border-radius, color, padding-left, padding-right, -webkit-transform;\n transition-property: background-color, border-radius, color, padding-left, padding-right, transform;\n transition-property: background-color, border-radius, color, padding-left, padding-right, transform, -webkit-transform;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.tip__content{\n\n height: 0.75rem;\n\n -webkit-transition-duration: 200ms;\n\n transition-duration: 200ms;\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 display: grid;\n grid-template-columns: 0fr;\n opacity: 0;\n overflow: hidden;\n -webkit-transition-property: grid-template-columns, opacity;\n transition-property: grid-template-columns, opacity;\n transition-property: grid-template-columns, opacity, -ms-grid-columns;\n}\n\n.tip__text {\n -webkit-transform: translate(0, 1px);\n transform: translate(0, 1px);\n}\n\n.tip__icon{\n\n height: 0.75rem;\n\n width: 0.75rem;\n\n display: none;\n}\n\n:host(:focus-within) .tip-container--top {\n -webkit-transform: translate(calc(0.25rem * -1), calc(0.25rem * -1));\n transform: translate(calc(0.25rem * -1), calc(0.25rem * -1));\n}\n\n:host(:focus-within) .tip-container--bottom {\n -webkit-transform: translate(calc(0.25rem * -1), 0.25rem);\n transform: translate(calc(0.25rem * -1), 0.25rem);\n}\n\n:host(:focus-within) .tip-container--top .tip {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n}\n\n:host(:focus-within) .tip-container--bottom .tip {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.tip--expanded,\n:host(:focus-within) .tip--expand{\n\n padding-left: 0.5rem;\n\n padding-right: 0.5rem;\n}\n\n.tip--expanded .tip__content,\n:host(:focus-within) .tip--expand .tip__content,\n:host( [value]:not([value=\"\"]) ) .tip--expand .tip__content {\n grid-template-columns: 1fr;\n opacity: 1;\n}\n\n:host( [value]:not([value=\"\"]) ) .tip--expand .tip__text {\n display: none;\n}\n\n:host( [value]:not([value=\"\"]) ) .tip__icon {\n display: -ms-flexbox;\n display: flex;\n}\n\n:host([value]:not([value=\"\"]):focus-within) .tip--expand {\n padding-left: 0;\n padding-right: 0;\n}\n\n:host( [type=\"number\"] ) .tip-container{\n\n right: 2.25rem;\n}\n\n:host( [type=\"number\"][controls-layout=\"horizontal\"] ) .tip-container{\n\n left: 3.5rem;\n\n right: 3.5rem;\n}\n\n:host( [value]:not([value=\"\"]) ) .tip--required {\n\n --mds-input-tip-background: var(--status-success-05);\n}\n\n.tip--required {\n\n --mds-input-tip-background: var(--status-error-05);\n}\n\n.tip--read-only {\n\n --mds-input-tip-background: var(--status-info-05);\n}\n\n.tip--disabled {\n\n --mds-input-tip-background: var(--tone-neutral-05);\n}\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\n --mds-input-background: rgb(var(--brand-maggioli-07));\n }\n}\n";
|
|
38
|
+
const increase$1 = "Increase";
|
|
39
|
+
const decrease$1 = "Decrease";
|
|
40
|
+
const localeEn = {
|
|
41
|
+
increase: increase$1,
|
|
42
|
+
decrease: decrease$1
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const increase = "Aumenta";
|
|
46
|
+
const decrease = "Diminuisci";
|
|
47
|
+
const localeIt = {
|
|
48
|
+
increase: increase,
|
|
49
|
+
decrease: decrease
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const mdsInputCss = "*, ::before, ::after{\n\n --tw-border-spacing-x: 0;\n\n --tw-border-spacing-y: 0;\n\n --tw-translate-x: 0;\n\n --tw-translate-y: 0;\n\n --tw-rotate: 0;\n\n --tw-skew-x: 0;\n\n --tw-skew-y: 0;\n\n --tw-scale-x: 1;\n\n --tw-scale-y: 1;\n\n --tw-pan-x: ;\n\n --tw-pan-y: ;\n\n --tw-pinch-zoom: ;\n\n --tw-scroll-snap-strictness: proximity;\n\n --tw-gradient-from-position: ;\n\n --tw-gradient-via-position: ;\n\n --tw-gradient-to-position: ;\n\n --tw-ordinal: ;\n\n --tw-slashed-zero: ;\n\n --tw-numeric-figure: ;\n\n --tw-numeric-spacing: ;\n\n --tw-numeric-fraction: ;\n\n --tw-ring-inset: ;\n\n --tw-ring-offset-width: 0px;\n\n --tw-ring-offset-color: #fff;\n\n --tw-ring-color: rgb(59 130 246 / 0.5);\n\n --tw-ring-offset-shadow: 0 0 #0000;\n\n --tw-ring-shadow: 0 0 #0000;\n\n --tw-shadow: 0 0 #0000;\n\n --tw-shadow-colored: 0 0 #0000;\n\n --tw-blur: ;\n\n --tw-brightness: ;\n\n --tw-contrast: ;\n\n --tw-grayscale: ;\n\n --tw-hue-rotate: ;\n\n --tw-invert: ;\n\n --tw-saturate: ;\n\n --tw-sepia: ;\n\n --tw-drop-shadow: ;\n\n --tw-backdrop-blur: ;\n\n --tw-backdrop-brightness: ;\n\n --tw-backdrop-contrast: ;\n\n --tw-backdrop-grayscale: ;\n\n --tw-backdrop-hue-rotate: ;\n\n --tw-backdrop-invert: ;\n\n --tw-backdrop-opacity: ;\n\n --tw-backdrop-saturate: ;\n\n --tw-backdrop-sepia: ;\n}\n\n::-webkit-backdrop{\n\n --tw-border-spacing-x: 0;\n\n --tw-border-spacing-y: 0;\n\n --tw-translate-x: 0;\n\n --tw-translate-y: 0;\n\n --tw-rotate: 0;\n\n --tw-skew-x: 0;\n\n --tw-skew-y: 0;\n\n --tw-scale-x: 1;\n\n --tw-scale-y: 1;\n\n --tw-pan-x: ;\n\n --tw-pan-y: ;\n\n --tw-pinch-zoom: ;\n\n --tw-scroll-snap-strictness: proximity;\n\n --tw-gradient-from-position: ;\n\n --tw-gradient-via-position: ;\n\n --tw-gradient-to-position: ;\n\n --tw-ordinal: ;\n\n --tw-slashed-zero: ;\n\n --tw-numeric-figure: ;\n\n --tw-numeric-spacing: ;\n\n --tw-numeric-fraction: ;\n\n --tw-ring-inset: ;\n\n --tw-ring-offset-width: 0px;\n\n --tw-ring-offset-color: #fff;\n\n --tw-ring-color: rgb(59 130 246 / 0.5);\n\n --tw-ring-offset-shadow: 0 0 #0000;\n\n --tw-ring-shadow: 0 0 #0000;\n\n --tw-shadow: 0 0 #0000;\n\n --tw-shadow-colored: 0 0 #0000;\n\n --tw-blur: ;\n\n --tw-brightness: ;\n\n --tw-contrast: ;\n\n --tw-grayscale: ;\n\n --tw-hue-rotate: ;\n\n --tw-invert: ;\n\n --tw-saturate: ;\n\n --tw-sepia: ;\n\n --tw-drop-shadow: ;\n\n --tw-backdrop-blur: ;\n\n --tw-backdrop-brightness: ;\n\n --tw-backdrop-contrast: ;\n\n --tw-backdrop-grayscale: ;\n\n --tw-backdrop-hue-rotate: ;\n\n --tw-backdrop-invert: ;\n\n --tw-backdrop-opacity: ;\n\n --tw-backdrop-saturate: ;\n\n --tw-backdrop-sepia: ;\n}\n\n::-ms-backdrop{\n\n --tw-border-spacing-x: 0;\n\n --tw-border-spacing-y: 0;\n\n --tw-translate-x: 0;\n\n --tw-translate-y: 0;\n\n --tw-rotate: 0;\n\n --tw-skew-x: 0;\n\n --tw-skew-y: 0;\n\n --tw-scale-x: 1;\n\n --tw-scale-y: 1;\n\n --tw-pan-x: ;\n\n --tw-pan-y: ;\n\n --tw-pinch-zoom: ;\n\n --tw-scroll-snap-strictness: proximity;\n\n --tw-gradient-from-position: ;\n\n --tw-gradient-via-position: ;\n\n --tw-gradient-to-position: ;\n\n --tw-ordinal: ;\n\n --tw-slashed-zero: ;\n\n --tw-numeric-figure: ;\n\n --tw-numeric-spacing: ;\n\n --tw-numeric-fraction: ;\n\n --tw-ring-inset: ;\n\n --tw-ring-offset-width: 0px;\n\n --tw-ring-offset-color: #fff;\n\n --tw-ring-color: rgb(59 130 246 / 0.5);\n\n --tw-ring-offset-shadow: 0 0 #0000;\n\n --tw-ring-shadow: 0 0 #0000;\n\n --tw-shadow: 0 0 #0000;\n\n --tw-shadow-colored: 0 0 #0000;\n\n --tw-blur: ;\n\n --tw-brightness: ;\n\n --tw-contrast: ;\n\n --tw-grayscale: ;\n\n --tw-hue-rotate: ;\n\n --tw-invert: ;\n\n --tw-saturate: ;\n\n --tw-sepia: ;\n\n --tw-drop-shadow: ;\n\n --tw-backdrop-blur: ;\n\n --tw-backdrop-brightness: ;\n\n --tw-backdrop-contrast: ;\n\n --tw-backdrop-grayscale: ;\n\n --tw-backdrop-hue-rotate: ;\n\n --tw-backdrop-invert: ;\n\n --tw-backdrop-opacity: ;\n\n --tw-backdrop-saturate: ;\n\n --tw-backdrop-sepia: ;\n}\n\n::backdrop{\n\n --tw-border-spacing-x: 0;\n\n --tw-border-spacing-y: 0;\n\n --tw-translate-x: 0;\n\n --tw-translate-y: 0;\n\n --tw-rotate: 0;\n\n --tw-skew-x: 0;\n\n --tw-skew-y: 0;\n\n --tw-scale-x: 1;\n\n --tw-scale-y: 1;\n\n --tw-pan-x: ;\n\n --tw-pan-y: ;\n\n --tw-pinch-zoom: ;\n\n --tw-scroll-snap-strictness: proximity;\n\n --tw-gradient-from-position: ;\n\n --tw-gradient-via-position: ;\n\n --tw-gradient-to-position: ;\n\n --tw-ordinal: ;\n\n --tw-slashed-zero: ;\n\n --tw-numeric-figure: ;\n\n --tw-numeric-spacing: ;\n\n --tw-numeric-fraction: ;\n\n --tw-ring-inset: ;\n\n --tw-ring-offset-width: 0px;\n\n --tw-ring-offset-color: #fff;\n\n --tw-ring-color: rgb(59 130 246 / 0.5);\n\n --tw-ring-offset-shadow: 0 0 #0000;\n\n --tw-ring-shadow: 0 0 #0000;\n\n --tw-shadow: 0 0 #0000;\n\n --tw-shadow-colored: 0 0 #0000;\n\n --tw-blur: ;\n\n --tw-brightness: ;\n\n --tw-contrast: ;\n\n --tw-grayscale: ;\n\n --tw-hue-rotate: ;\n\n --tw-invert: ;\n\n --tw-saturate: ;\n\n --tw-sepia: ;\n\n --tw-drop-shadow: ;\n\n --tw-backdrop-blur: ;\n\n --tw-backdrop-brightness: ;\n\n --tw-backdrop-contrast: ;\n\n --tw-backdrop-grayscale: ;\n\n --tw-backdrop-hue-rotate: ;\n\n --tw-backdrop-invert: ;\n\n --tw-backdrop-opacity: ;\n\n --tw-backdrop-saturate: ;\n\n --tw-backdrop-sepia: ;\n}\n@tailwind utilities;\n\n/**\n * @prop --mds-input-background: Sets the background-color of the component\n * @prop --mds-input-icon-color: Sets the icon color of the component\n * @prop --mds-input-ring: Sets the box-shadow of the component's input\n * @prop --mds-input-shadow: Sets the box-shadow of the component's input\n * @prop --mds-input-textarea-field-sizing: Sets the height of the textarea automatically, this is an EXPERIMENTAL css property, so it couldn't work in every browser \n * @prop --mds-input-textarea-max-height: Sets the `max-height` of the component when attribute `type` is set to `textarea`\n * @prop --mds-input-textarea-min-height: Sets the `min-height` of the component when attribute `type` is set to `textarea`\n * @prop --mds-input-tip-background: Sets the background color of the tip message at the bottom right of the component\n * @prop --mds-input-variant-color: Sets the variant colors of the component\n */\n\n:host {\n\n --mds-input-background: rgb(var(--tone-neutral));\n --mds-input-icon-color: var(--mds-input-variant-color);\n --mds-input-tip-background: 84 84 84;\n --mds-input-ring: 0 0 0 1px rgb(var(--mds-input-variant-color) / 0.1);\n --mds-input-shadow: 0 1px 3px 0 rgb(var(--mds-input-variant-color) / 0.1), 0 1px 2px 0 rgb(var(--mds-input-variant-color) / 0.06);\n --mds-input-variant-color: 0 0 0;\n --mds-input-controls-color: rgb(var(--tone-neutral-04));\n --mds-input-controls-border: 2px solid rgb(var(--tone-neutral-09));\n --mds-input-textarea-min-height: 6rem;\n --mds-input-textarea-max-height: 16rem;\n --mds-input-textarea-field-sizing: content;\n min-height: 1.5rem;\n font-family: Karla, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n font-size: 1rem;\n line-height: 1.5rem;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n gap: 0.5rem;\n\n container-type: inline-size;\n display: -ms-flexbox;\n display: flex;\n position: relative;\n}\n\n:host( [typography=\"detail\"] ) .input{\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\n:host( [typography=\"snippet\"] ) .input{\n\n min-height: 1.5rem;\n\n font-family: 'Roboto Mono', 'Courier New', monospace;\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\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 border-radius: 0.5rem;\n\n padding-left: 1rem;\n\n padding-right: 1rem;\n\n padding-top: 0.75rem;\n\n padding-bottom: 0.75rem;\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 background-color: var(--mds-input-background);\n border: 0;\n -webkit-box-shadow: var(--mds-input-ring), var(--mds-input-shadow);\n box-shadow: var(--mds-input-ring), var(--mds-input-shadow);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: rgb(var(--tone-neutral-02));\n min-height: 3rem;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-transition-property: background-color, border-color, color, fill, margin, opacity, padding, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, color, fill, margin, opacity, padding, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, box-shadow, color, fill, margin, opacity, padding, transform;\n transition-property: background-color, border-color, box-shadow, color, fill, margin, opacity, padding, transform, -webkit-box-shadow, -webkit-transform;\n width: 100%;\n}\n\n.input::-webkit-outer-spin-button,\n.input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n appearance: none;\n display: none;\n margin: 0;\n}\n\ntextarea.input{\n\n resize: vertical;\n\n border-bottom-right-radius: 0;\n\n field-sizing: var(--mds-input-textarea-field-sizing);\n max-height: var(--mds-input-textarea-max-height);\n min-height: var(--mds-input-textarea-min-height);\n overflow: auto;\n}\n\n.input:focus{\n\n outline: 2px solid transparent;\n\n outline-offset: 2px;\n\n -webkit-transition-property: background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;\n\n transition-property: background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;\n\n transition-property: background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;\n\n transition-property: background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;\n\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\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 --mds-input-ring: 0 0 0 3px rgb(var(--mds-input-variant-color) / 1);\n --mds-input-shadow: 0 4px 6px 3px rgb(var(--mds-input-variant-color) / 0.1), 0 2px 4px -1px rgb(var(--mds-input-variant-color) / 0.06);\n}\n\n.input:disabled {\n background-color: rgb(var(--tone-neutral-10));\n}\n\n.input:disabled::-moz-placeholder {\n color: rgb(var(--tone-neutral-05));\n}\n\n.input:disabled::-webkit-input-placeholder {\n color: rgb(var(--tone-neutral-05));\n}\n\n.input:disabled:-ms-input-placeholder {\n color: rgb(var(--tone-neutral-05));\n}\n\n.input:disabled::-ms-input-placeholder {\n color: rgb(var(--tone-neutral-05));\n}\n\n.input:disabled,\n.input:disabled::placeholder {\n color: rgb(var(--tone-neutral-05));\n}\n\n.input.has-icon{\n\n padding-left: 2.75rem;\n}\n\n\n.await,\n.icon{\n\n left: 0.75rem;\n\n top: 0.75rem;\n\n fill: rgb(var(--mds-input-icon-color));\n position: absolute;\n}\n\n.await {\n color: rgb(var(--mds-input-icon-color));\n height: 24px;\n width: 24px;\n}\n\n.counter {\n border-left: var(--mds-input-controls-border);\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n gap: 0;\n position: absolute;\n right: 0;\n}\n\n.counter-button{\n\n height: 1.5rem;\n\n width: 1.75rem;\n\n border-radius: 0.5rem;\n\n --mds-button-background: transparent;\n --mds-button-icon-color: var(--mds-input-controls-color);\n\n border: 0;\n min-height: 0;\n padding: 0;\n}\n\n.counter-button:hover {\n\n --mds-button-background: rgb(var(--tone-neutral-09));\n}\n\n.counter .counter-button:first-child {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: 0;\n}\n\n.counter .counter-button:last-child {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n}\n\n.counter-button--horizontal{\n\n height: 3rem;\n\n width: 3rem;\n\n bottom: 0;\n position: absolute;\n top: 0;\n}\n\n.counter-button--decrease {\n border-bottom-right-radius: 0;\n border-right: var(--mds-input-controls-border);\n border-top-right-radius: 0;\n left: 0;\n}\n\n.counter-button--increase {\n border-bottom-left-radius: 0;\n border-left: var(--mds-input-controls-border);\n border-top-left-radius: 0;\n right: 0;\n}\n\n:host( [type=\"number\"] ) .input{\n\n padding-right: 2rem;\n}\n\n:host( [type=\"number\"][controls-layout=\"horizontal\"] ) .input{\n\n padding-left: 3.5rem;\n\n padding-right: 3.5rem;\n\n text-align: center;\n}\n\n:host( [type=\"number\"][controls-layout=\"horizontal\"][icon] ) .input{\n\n padding-left: 6rem;\n\n text-align: left;\n}\n\n\n:host( [type=\"number\"][controls-layout=\"horizontal\"] ) .icon{\n\n left: 3.75rem;\n}\n\n.static{\n\n position: static;\n}\n\n.fixed{\n\n position: fixed;\n}\n\n.absolute{\n\n position: absolute;\n}\n\n.grid{\n\n display: grid;\n}\n\n.w-min{\n\n width: -moz-min-content;\n\n width: -webkit-min-content;\n\n width: min-content;\n}\n\n.gap-400{\n\n gap: 1rem;\n}\n\n.gap-600{\n\n gap: 1.5rem;\n}\n\n.rounded{\n\n border-radius: 0.25rem;\n}\n\n.border{\n\n border-width: 1px;\n}\n\n.bg-label-amaranth-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-amaranth-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-aqua-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-aqua-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-blue-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-blue-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-green-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-green-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-lime-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-lime-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-orange-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-orange-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-orchid-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-orchid-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-violet-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-violet-10) / var(--tw-bg-opacity));\n}\n\n.bg-label-yellow-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--label-yellow-10) / var(--tw-bg-opacity));\n}\n\n.bg-tone-neutral-08{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--tone-neutral-08) / var(--tw-bg-opacity));\n}\n\n.bg-tone-neutral-10{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(var(--tone-neutral-10) / var(--tw-bg-opacity));\n}\n\n.fill-label-amaranth-04{\n\n fill: rgb(var(--label-amaranth-04));\n}\n\n.fill-label-aqua-04{\n\n fill: rgb(var(--label-aqua-04));\n}\n\n.fill-label-blue-04{\n\n fill: rgb(var(--label-blue-04));\n}\n\n.fill-label-green-04{\n\n fill: rgb(var(--label-green-04));\n}\n\n.fill-label-lime-04{\n\n fill: rgb(var(--label-lime-04));\n}\n\n.fill-label-orange-04{\n\n fill: rgb(var(--label-orange-04));\n}\n\n.fill-label-orchid-04{\n\n fill: rgb(var(--label-orchid-04));\n}\n\n.fill-label-violet-04{\n\n fill: rgb(var(--label-violet-04));\n}\n\n.fill-label-yellow-04{\n\n fill: rgb(var(--label-yellow-04));\n}\n\n.fill-tone-neutral-04{\n\n fill: rgb(var(--tone-neutral-04));\n}\n\n.text-label-amaranth-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-amaranth-04) / var(--tw-text-opacity));\n}\n\n.text-label-aqua-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-aqua-04) / var(--tw-text-opacity));\n}\n\n.text-label-blue-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-blue-04) / var(--tw-text-opacity));\n}\n\n.text-label-green-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-green-04) / var(--tw-text-opacity));\n}\n\n.text-label-lime-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-lime-04) / var(--tw-text-opacity));\n}\n\n.text-label-orange-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-orange-04) / var(--tw-text-opacity));\n}\n\n.text-label-orchid-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-orchid-04) / var(--tw-text-opacity));\n}\n\n.text-label-violet-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-violet-04) / var(--tw-text-opacity));\n}\n\n.text-label-yellow-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--label-yellow-04) / var(--tw-text-opacity));\n}\n\n.text-tone-neutral-04{\n\n --tw-text-opacity: 1;\n\n color: rgb(var(--tone-neutral-04) / var(--tw-text-opacity));\n}\n\n.shadow{\n\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n\n -webkit-box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n:host {\n\n --mds-input-icon-color: var(--brand-maggioli-03);\n --mds-input-variant-color: 0 0 0;\n}\n\n:host( :focus ) {\n\n --mds-input-variant-color: var(--brand-maggioli-04);\n}\n\n:host( [variant=\"info\"] ) {\n\n --mds-input-icon-color: var(--status-info-05);\n --mds-input-tip-background: var(--status-info-05);\n --mds-input-variant-color: 0 0 0;\n}\n\n:host( [variant=\"info\"]:focus ) {\n\n --mds-input-icon-color: var(--status-info-04);\n --mds-input-variant-color: var(--status-info-05);\n}\n\n:host( [variant=\"success\"] ) {\n\n --mds-input-icon-color: var(--status-success-05);\n --mds-input-tip-background: var(--status-success-05);\n --mds-input-variant-color: 0 0 0;\n}\n\n:host( [variant=\"success\"]:focus ) {\n\n --mds-input-icon-color: var(--status-success-04);\n --mds-input-variant-color: var(--status-success-05);\n}\n\n:host( [variant=\"warning\"] ) {\n\n --mds-input-icon-color: var(--status-warning-05);\n --mds-input-tip-background: var(--status-warning-05);\n --mds-input-variant-color: 0 0 0;\n}\n\n:host( [variant=\"warning\"]:focus ) {\n\n --mds-input-icon-color: var(--status-warning-04);\n --mds-input-variant-color: var(--status-warning-05);\n}\n\n:host( [variant=\"error\"] ) {\n\n --mds-input-icon-color: var(--status-error-05);\n --mds-input-tip-background: var(--status-error-05);\n --mds-input-variant-color: 0 0 0;\n}\n\n:host( [variant=\"error\"]:focus ) {\n\n --mds-input-icon-color: var(--status-error-04);\n --mds-input-variant-color: var(--status-error-05);\n}\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\n --mds-input-background: rgb(var(--brand-maggioli-07));\n }\n}\n";
|
|
20
53
|
|
|
21
54
|
const MdsInput = class {
|
|
22
55
|
constructor(hostRef) {
|
|
@@ -32,6 +65,10 @@ const MdsInput = class {
|
|
|
32
65
|
this.internals = hostRef.$hostElement$.attachInternals();
|
|
33
66
|
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
34
67
|
}
|
|
68
|
+
this.t = new Locale({
|
|
69
|
+
en: localeEn,
|
|
70
|
+
it: localeIt,
|
|
71
|
+
});
|
|
35
72
|
this.onInput = (ev) => {
|
|
36
73
|
const input = ev.target;
|
|
37
74
|
if (input) {
|
|
@@ -78,7 +115,6 @@ const MdsInput = class {
|
|
|
78
115
|
this.controlDecreaseLabel = 'Riduci';
|
|
79
116
|
this.datalist = undefined;
|
|
80
117
|
this.disabled = false;
|
|
81
|
-
this.disabledLabel = 'disattivato';
|
|
82
118
|
this.icon = undefined;
|
|
83
119
|
this.max = undefined;
|
|
84
120
|
this.maxlength = undefined;
|
|
@@ -88,9 +124,7 @@ const MdsInput = class {
|
|
|
88
124
|
this.pattern = undefined;
|
|
89
125
|
this.placeholder = '';
|
|
90
126
|
this.readonly = false;
|
|
91
|
-
this.readonlyLabel = 'sola lettura';
|
|
92
127
|
this.required = false;
|
|
93
|
-
this.requiredLabel = 'obbligatorio';
|
|
94
128
|
this.variant = undefined;
|
|
95
129
|
this.tip = undefined;
|
|
96
130
|
this.step = undefined;
|
|
@@ -135,21 +169,21 @@ const MdsInput = class {
|
|
|
135
169
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
136
170
|
return Promise.resolve(this.nativeInput);
|
|
137
171
|
}
|
|
172
|
+
componentWillRender() {
|
|
173
|
+
this.t.lang(this.el);
|
|
174
|
+
}
|
|
138
175
|
render() {
|
|
139
176
|
var _a, _b;
|
|
140
177
|
return (index.h(index.Host, null, this.type === 'number'
|
|
141
178
|
&& this.controlsLayout === 'horizontal'
|
|
142
|
-
&& index.h("mds-button", { class: "counter-button counter-button--horizontal counter-button--decrease", icon: this.controlsIcon === 'arrow' ? miBaselineArrowDown : miBaselineRemove, onClick: this.stepDown, role: "button", tabindex: "0", title: this.
|
|
179
|
+
&& index.h("mds-button", { class: "counter-button counter-button--horizontal counter-button--decrease", icon: this.controlsIcon === 'arrow' ? miBaselineArrowDown : miBaselineRemove, onClick: this.stepDown, role: "button", tabindex: "0", title: this.t.get('decrease'), part: "counter-button-decrease" }), this.type === 'textarea'
|
|
143
180
|
? index.h("textarea", { class: clsx('input', ((_a = this.icon) !== null && _a !== void 0 ? _a : this.await) && 'has-icon'), autoFocus: this.autofocus, disabled: this.disabled, maxLength: this.maxlength, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, part: "field", placeholder: this.placeholder, readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, tabIndex: this.tabindex, value: this.value })
|
|
144
181
|
: index.h("input", { class: clsx('input', ((_b = this.icon) !== null && _b !== void 0 ? _b : this.await) && 'has-icon'), autoComplete: this.autocomplete, autoFocus: this.autofocus, disabled: this.disabled, max: this.max, maxLength: this.maxlength, min: this.min, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, pattern: this.pattern, list: this.datalist && 'datalist', part: "field", placeholder: this.placeholder, readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, step: this.step, tabIndex: this.tabindex, type: this.type, value: this.value }), this.type === 'number'
|
|
145
182
|
&& this.controlsLayout === 'vertical'
|
|
146
|
-
&& index.h("div", { class: "counter counter--vertical" }, index.h("mds-button", { class: "counter-button", icon: this.controlsIcon === 'arrow' ? miBaselineArrowUp : miBaselineAdd, onClick: this.stepUp, role: "button", tabindex: "0", title: this.
|
|
183
|
+
&& index.h("div", { class: "counter counter--vertical" }, index.h("mds-button", { class: "counter-button", icon: this.controlsIcon === 'arrow' ? miBaselineArrowUp : miBaselineAdd, onClick: this.stepUp, role: "button", tabindex: "0", title: this.t.get('increase'), part: "counter-button-increase" }), index.h("mds-button", { class: "counter-button", icon: this.controlsIcon === 'arrow' ? miBaselineArrowDown : miBaselineRemove, onClick: this.stepDown, role: "button", tabindex: "0", title: this.t.get('decrease'), part: "counter-button-decrease" })), this.type === 'number'
|
|
147
184
|
&& this.controlsLayout === 'horizontal'
|
|
148
|
-
&& index.h("mds-button", { class: "counter-button counter-button--horizontal counter-button--increase", icon: this.controlsIcon === 'arrow' ? miBaselineArrowUp : miBaselineAdd, onClick: this.stepUp, role: "button", tabindex: "0", title: this.
|
|
149
|
-
index.h("
|
|
150
|
-
index.h("div", { class: "tip tip--expanded tip--read-only" }, index.h("div", { class: "tip__content" }, index.h("mds-text", { typography: "option", truncate: "word" }, index.h("span", { class: "tip__text" }, this.readonlyLabel)))), this.required &&
|
|
151
|
-
index.h("div", { class: "tip tip--expand tip--required" }, index.h("div", { class: "tip__content" }, index.h("mds-text", { typography: "option", truncate: "word" }, index.h("span", { class: "tip__text" }, this.requiredLabel), index.h("span", { class: "tip__icon svg", innerHTML: miBaselineDone }))))), index.h("div", { class: "tip-container tip-container--bottom" }, this.tip &&
|
|
152
|
-
index.h("div", { class: "tip tip--expanded tip--variant" }, index.h("div", { class: "tip__content" }, index.h("mds-text", { typography: "option", truncate: "word" }, index.h("span", { class: "tip__text" }, this.tip))))), this.datalist &&
|
|
185
|
+
&& index.h("mds-button", { class: "counter-button counter-button--horizontal counter-button--increase", icon: this.controlsIcon === 'arrow' ? miBaselineArrowUp : miBaselineAdd, onClick: this.stepUp, role: "button", tabindex: "0", title: this.t.get('increase'), part: "counter-button-increase" }), index.h("mds-input-tip", { position: "top", active: this.hasFocus }, this.disabled && index.h("mds-input-tip-item", { expanded: true, variant: "disabled" }), this.readonly && index.h("mds-input-tip-item", { expanded: true, variant: "readonly" }), this.required &&
|
|
186
|
+
index.h("mds-input-tip-item", { expanded: this.hasFocus, variant: this.value === '' ? 'required' : 'required-success' })), index.h("mds-input-tip", { position: "bottom", active: this.hasFocus }, this.tip && index.h("mds-input-tip-item", { expanded: true, variant: "text" }, this.tip)), this.datalist &&
|
|
153
187
|
index.h("datalist", { id: "datalist", class: "datalist" }, this.datalist.forEach(element => {
|
|
154
188
|
index.h("option", { value: element });
|
|
155
189
|
})), this.icon && !this.await && index.h("mds-icon", { class: clsx('icon', this.variant), name: this.icon }), index.h("mds-spinner", { running: this.await, class: clsx('await', this.variant) })));
|
|
@@ -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-a4879d20.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Browser v4.10.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["mds-input.cjs",[[65,"mds-input",{"autocomplete":[513],"autofocus":[516],"await":[516],"controlsLayout":[513,"controls-layout"],"controlsIcon":[513,"controls-icon"],"controlIncreaseLabel":[513,"control-increase-label"],"controlDecreaseLabel":[513,"control-decrease-label"],"datalist":[16],"disabled":[516],"
|
|
20
|
+
return index.bootstrapLazy([["mds-input.cjs",[[65,"mds-input",{"autocomplete":[513],"autofocus":[516],"await":[516],"controlsLayout":[513,"controls-layout"],"controlsIcon":[513,"controls-icon"],"controlIncreaseLabel":[513,"control-increase-label"],"controlDecreaseLabel":[513,"control-decrease-label"],"datalist":[16],"disabled":[516],"icon":[513],"max":[513],"maxlength":[514],"min":[520],"minlength":[514],"name":[513],"pattern":[513],"placeholder":[513],"readonly":[516],"required":[516],"variant":[513],"tip":[513],"step":[513],"type":[513],"typography":[513],"value":[1537],"hasFocus":[32],"setFocus":[64],"getInputElement":[64]},null,{"value":["valueChanged"]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class Locale {
|
|
2
|
+
constructor(configData) {
|
|
3
|
+
this.defaultLanguage = 'en';
|
|
4
|
+
this.lang = (element) => {
|
|
5
|
+
const closestElement = element.closest('[lang]');
|
|
6
|
+
if (closestElement) {
|
|
7
|
+
if (closestElement.lang) {
|
|
8
|
+
this.language = closestElement.lang;
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
this.language = this.defaultLanguage;
|
|
13
|
+
};
|
|
14
|
+
this.get = (tag) => {
|
|
15
|
+
var _a;
|
|
16
|
+
return (_a = this.config[this.language][tag]) !== null && _a !== void 0 ? _a : this.config[this.defaultLanguage][tag];
|
|
17
|
+
};
|
|
18
|
+
this.config = configData;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -506,15 +506,6 @@ textarea.input{
|
|
|
506
506
|
gap: 1.5rem;
|
|
507
507
|
}
|
|
508
508
|
|
|
509
|
-
.truncate{
|
|
510
|
-
|
|
511
|
-
overflow: hidden;
|
|
512
|
-
|
|
513
|
-
text-overflow: ellipsis;
|
|
514
|
-
|
|
515
|
-
white-space: nowrap;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
509
|
.rounded{
|
|
519
510
|
|
|
520
511
|
border-radius: 0.25rem;
|
|
@@ -794,175 +785,6 @@ textarea.input{
|
|
|
794
785
|
--mds-input-variant-color: var(--status-error-05);
|
|
795
786
|
}
|
|
796
787
|
|
|
797
|
-
.tip-container{
|
|
798
|
-
|
|
799
|
-
left: 0.25rem;
|
|
800
|
-
|
|
801
|
-
right: 0.25rem;
|
|
802
|
-
|
|
803
|
-
gap: 0.25rem;
|
|
804
|
-
|
|
805
|
-
transition-property: background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;
|
|
806
|
-
|
|
807
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
808
|
-
|
|
809
|
-
transition-duration: 300ms;
|
|
810
|
-
|
|
811
|
-
transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
|
|
812
|
-
|
|
813
|
-
display: flex;
|
|
814
|
-
justify-content: flex-end;
|
|
815
|
-
pointer-events: none;
|
|
816
|
-
position: absolute;
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
.tip-container:empty {
|
|
820
|
-
display: none;
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
.tip-container--top {
|
|
824
|
-
top: 0.25rem;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
.tip-container--bottom {
|
|
828
|
-
bottom: 0.25rem;
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
.tip{
|
|
832
|
-
|
|
833
|
-
height: 0.75rem;
|
|
834
|
-
|
|
835
|
-
border-radius: 0.375rem;
|
|
836
|
-
|
|
837
|
-
transition-duration: 300ms;
|
|
838
|
-
|
|
839
|
-
transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
|
|
840
|
-
|
|
841
|
-
align-items: center;
|
|
842
|
-
background-color: rgb(var(--mds-input-tip-background));
|
|
843
|
-
color: transparent;
|
|
844
|
-
color: rgb(var(--tone-neutral));
|
|
845
|
-
display: flex;
|
|
846
|
-
fill: rgb(var(--tone-neutral));
|
|
847
|
-
justify-content: center;
|
|
848
|
-
min-width: 0.75rem;
|
|
849
|
-
padding: 0;
|
|
850
|
-
pointer-events: none;
|
|
851
|
-
position: static;
|
|
852
|
-
text-align: center;
|
|
853
|
-
transform: translate(0, 0);
|
|
854
|
-
transition-property: background-color, border-radius, color, padding-left, padding-right, transform;
|
|
855
|
-
-webkit-user-select: none;
|
|
856
|
-
-moz-user-select: none;
|
|
857
|
-
user-select: none;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
.tip__content{
|
|
861
|
-
|
|
862
|
-
height: 0.75rem;
|
|
863
|
-
|
|
864
|
-
transition-duration: 200ms;
|
|
865
|
-
|
|
866
|
-
transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
|
|
867
|
-
|
|
868
|
-
display: grid;
|
|
869
|
-
grid-template-columns: 0fr;
|
|
870
|
-
opacity: 0;
|
|
871
|
-
overflow: hidden;
|
|
872
|
-
transition-property: grid-template-columns, opacity;
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
.tip__text {
|
|
876
|
-
transform: translate(0, 1px);
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
.tip__icon{
|
|
880
|
-
|
|
881
|
-
height: 0.75rem;
|
|
882
|
-
|
|
883
|
-
width: 0.75rem;
|
|
884
|
-
|
|
885
|
-
display: none;
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
:host(:focus-within) .tip-container--top {
|
|
889
|
-
transform: translate(calc(0.25rem * -1), calc(0.25rem * -1));
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
:host(:focus-within) .tip-container--bottom {
|
|
893
|
-
transform: translate(calc(0.25rem * -1), 0.25rem);
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
:host(:focus-within) .tip-container--top .tip {
|
|
897
|
-
border-top-left-radius: 0;
|
|
898
|
-
border-top-right-radius: 0;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
:host(:focus-within) .tip-container--bottom .tip {
|
|
902
|
-
border-bottom-left-radius: 0;
|
|
903
|
-
border-bottom-right-radius: 0;
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
.tip--expanded,
|
|
907
|
-
:host(:focus-within) .tip--expand{
|
|
908
|
-
|
|
909
|
-
padding-left: 0.5rem;
|
|
910
|
-
|
|
911
|
-
padding-right: 0.5rem;
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
.tip--expanded .tip__content,
|
|
915
|
-
:host(:focus-within) .tip--expand .tip__content,
|
|
916
|
-
:host( [value]:not([value=""]) ) .tip--expand .tip__content {
|
|
917
|
-
grid-template-columns: 1fr;
|
|
918
|
-
opacity: 1;
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
:host( [value]:not([value=""]) ) .tip--expand .tip__text {
|
|
922
|
-
display: none;
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
:host( [value]:not([value=""]) ) .tip__icon {
|
|
926
|
-
display: flex;
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
:host([value]:not([value=""]):focus-within) .tip--expand {
|
|
930
|
-
padding-left: 0;
|
|
931
|
-
padding-right: 0;
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
:host( [type="number"] ) .tip-container{
|
|
935
|
-
|
|
936
|
-
right: 2.25rem;
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
:host( [type="number"][controls-layout="horizontal"] ) .tip-container{
|
|
940
|
-
|
|
941
|
-
left: 3.5rem;
|
|
942
|
-
|
|
943
|
-
right: 3.5rem;
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
:host( [value]:not([value=""]) ) .tip--required {
|
|
947
|
-
|
|
948
|
-
--mds-input-tip-background: var(--status-success-05);
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
.tip--required {
|
|
952
|
-
|
|
953
|
-
--mds-input-tip-background: var(--status-error-05);
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
.tip--read-only {
|
|
957
|
-
|
|
958
|
-
--mds-input-tip-background: var(--status-info-05);
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
.tip--disabled {
|
|
962
|
-
|
|
963
|
-
--mds-input-tip-background: var(--tone-neutral-05);
|
|
964
|
-
}
|
|
965
|
-
|
|
966
788
|
|
|
967
789
|
@container (max-width: 210px) {
|
|
968
790
|
:host .tip__content,
|
|
@@ -3,10 +3,16 @@ import miBaselineAdd from "@icon/mi/baseline/add.svg";
|
|
|
3
3
|
import miBaselineArrowDown from "@icon/mi/baseline/keyboard-arrow-down.svg";
|
|
4
4
|
import miBaselineArrowUp from "@icon/mi/baseline/keyboard-arrow-up.svg";
|
|
5
5
|
import miBaselineRemove from "@icon/mi/baseline/remove.svg";
|
|
6
|
-
import miBaselineDone from "@icon/mi/baseline/done.svg";
|
|
7
6
|
import { Host, h } from "@stencil/core";
|
|
7
|
+
import { Locale } from "../../common/locale";
|
|
8
|
+
import localeEn from "./meta/locale.en.json";
|
|
9
|
+
import localeIt from "./meta/locale.it.json";
|
|
8
10
|
export class MdsInput {
|
|
9
11
|
constructor() {
|
|
12
|
+
this.t = new Locale({
|
|
13
|
+
en: localeEn,
|
|
14
|
+
it: localeIt,
|
|
15
|
+
});
|
|
10
16
|
this.onInput = (ev) => {
|
|
11
17
|
const input = ev.target;
|
|
12
18
|
if (input) {
|
|
@@ -53,7 +59,6 @@ export class MdsInput {
|
|
|
53
59
|
this.controlDecreaseLabel = 'Riduci';
|
|
54
60
|
this.datalist = undefined;
|
|
55
61
|
this.disabled = false;
|
|
56
|
-
this.disabledLabel = 'disattivato';
|
|
57
62
|
this.icon = undefined;
|
|
58
63
|
this.max = undefined;
|
|
59
64
|
this.maxlength = undefined;
|
|
@@ -63,9 +68,7 @@ export class MdsInput {
|
|
|
63
68
|
this.pattern = undefined;
|
|
64
69
|
this.placeholder = '';
|
|
65
70
|
this.readonly = false;
|
|
66
|
-
this.readonlyLabel = 'sola lettura';
|
|
67
71
|
this.required = false;
|
|
68
|
-
this.requiredLabel = 'obbligatorio';
|
|
69
72
|
this.variant = undefined;
|
|
70
73
|
this.tip = undefined;
|
|
71
74
|
this.step = undefined;
|
|
@@ -110,21 +113,21 @@ export class MdsInput {
|
|
|
110
113
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
111
114
|
return Promise.resolve(this.nativeInput);
|
|
112
115
|
}
|
|
116
|
+
componentWillRender() {
|
|
117
|
+
this.t.lang(this.el);
|
|
118
|
+
}
|
|
113
119
|
render() {
|
|
114
120
|
var _a, _b;
|
|
115
121
|
return (h(Host, null, this.type === 'number'
|
|
116
122
|
&& this.controlsLayout === 'horizontal'
|
|
117
|
-
&& h("mds-button", { class: "counter-button counter-button--horizontal counter-button--decrease", icon: this.controlsIcon === 'arrow' ? miBaselineArrowDown : miBaselineRemove, onClick: this.stepDown, role: "button", tabindex: "0", title: this.
|
|
123
|
+
&& h("mds-button", { class: "counter-button counter-button--horizontal counter-button--decrease", icon: this.controlsIcon === 'arrow' ? miBaselineArrowDown : miBaselineRemove, onClick: this.stepDown, role: "button", tabindex: "0", title: this.t.get('decrease'), part: "counter-button-decrease" }), this.type === 'textarea'
|
|
118
124
|
? h("textarea", { class: clsx('input', ((_a = this.icon) !== null && _a !== void 0 ? _a : this.await) && 'has-icon'), autoFocus: this.autofocus, disabled: this.disabled, maxLength: this.maxlength, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, part: "field", placeholder: this.placeholder, readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, tabIndex: this.tabindex, value: this.value })
|
|
119
125
|
: h("input", { class: clsx('input', ((_b = this.icon) !== null && _b !== void 0 ? _b : this.await) && 'has-icon'), autoComplete: this.autocomplete, autoFocus: this.autofocus, disabled: this.disabled, max: this.max, maxLength: this.maxlength, min: this.min, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, pattern: this.pattern, list: this.datalist && 'datalist', part: "field", placeholder: this.placeholder, readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, step: this.step, tabIndex: this.tabindex, type: this.type, value: this.value }), this.type === 'number'
|
|
120
126
|
&& this.controlsLayout === 'vertical'
|
|
121
|
-
&& h("div", { class: "counter counter--vertical" }, h("mds-button", { class: "counter-button", icon: this.controlsIcon === 'arrow' ? miBaselineArrowUp : miBaselineAdd, onClick: this.stepUp, role: "button", tabindex: "0", title: this.
|
|
127
|
+
&& h("div", { class: "counter counter--vertical" }, h("mds-button", { class: "counter-button", icon: this.controlsIcon === 'arrow' ? miBaselineArrowUp : miBaselineAdd, onClick: this.stepUp, role: "button", tabindex: "0", title: this.t.get('increase'), part: "counter-button-increase" }), h("mds-button", { class: "counter-button", icon: this.controlsIcon === 'arrow' ? miBaselineArrowDown : miBaselineRemove, onClick: this.stepDown, role: "button", tabindex: "0", title: this.t.get('decrease'), part: "counter-button-decrease" })), this.type === 'number'
|
|
122
128
|
&& this.controlsLayout === 'horizontal'
|
|
123
|
-
&& h("mds-button", { class: "counter-button counter-button--horizontal counter-button--increase", icon: this.controlsIcon === 'arrow' ? miBaselineArrowUp : miBaselineAdd, onClick: this.stepUp, role: "button", tabindex: "0", title: this.
|
|
124
|
-
h("
|
|
125
|
-
h("div", { class: "tip tip--expanded tip--read-only" }, h("div", { class: "tip__content" }, h("mds-text", { typography: "option", truncate: "word" }, h("span", { class: "tip__text" }, this.readonlyLabel)))), this.required &&
|
|
126
|
-
h("div", { class: "tip tip--expand tip--required" }, h("div", { class: "tip__content" }, h("mds-text", { typography: "option", truncate: "word" }, h("span", { class: "tip__text" }, this.requiredLabel), h("span", { class: "tip__icon svg", innerHTML: miBaselineDone }))))), h("div", { class: "tip-container tip-container--bottom" }, this.tip &&
|
|
127
|
-
h("div", { class: "tip tip--expanded tip--variant" }, h("div", { class: "tip__content" }, h("mds-text", { typography: "option", truncate: "word" }, h("span", { class: "tip__text" }, this.tip))))), this.datalist &&
|
|
129
|
+
&& h("mds-button", { class: "counter-button counter-button--horizontal counter-button--increase", icon: this.controlsIcon === 'arrow' ? miBaselineArrowUp : miBaselineAdd, onClick: this.stepUp, role: "button", tabindex: "0", title: this.t.get('increase'), part: "counter-button-increase" }), h("mds-input-tip", { position: "top", active: this.hasFocus }, this.disabled && h("mds-input-tip-item", { expanded: true, variant: "disabled" }), this.readonly && h("mds-input-tip-item", { expanded: true, variant: "readonly" }), this.required &&
|
|
130
|
+
h("mds-input-tip-item", { expanded: this.hasFocus, variant: this.value === '' ? 'required' : 'required-success' })), h("mds-input-tip", { position: "bottom", active: this.hasFocus }, this.tip && h("mds-input-tip-item", { expanded: true, variant: "text" }, this.tip)), this.datalist &&
|
|
128
131
|
h("datalist", { id: "datalist", class: "datalist" }, this.datalist.forEach(element => {
|
|
129
132
|
h("option", { value: element });
|
|
130
133
|
})), this.icon && !this.await && h("mds-icon", { class: clsx('icon', this.variant), name: this.icon }), h("mds-spinner", { running: this.await, class: clsx('await', this.variant) })));
|
|
@@ -321,24 +324,6 @@ export class MdsInput {
|
|
|
321
324
|
"reflect": true,
|
|
322
325
|
"defaultValue": "false"
|
|
323
326
|
},
|
|
324
|
-
"disabledLabel": {
|
|
325
|
-
"type": "string",
|
|
326
|
-
"mutable": false,
|
|
327
|
-
"complexType": {
|
|
328
|
-
"original": "string",
|
|
329
|
-
"resolved": "string | undefined",
|
|
330
|
-
"references": {}
|
|
331
|
-
},
|
|
332
|
-
"required": false,
|
|
333
|
-
"optional": true,
|
|
334
|
-
"docs": {
|
|
335
|
-
"tags": [],
|
|
336
|
-
"text": "Specifies the label for the displayed state disabled"
|
|
337
|
-
},
|
|
338
|
-
"attribute": "disabled-label",
|
|
339
|
-
"reflect": true,
|
|
340
|
-
"defaultValue": "'disattivato'"
|
|
341
|
-
},
|
|
342
327
|
"icon": {
|
|
343
328
|
"type": "string",
|
|
344
329
|
"mutable": false,
|
|
@@ -494,24 +479,6 @@ export class MdsInput {
|
|
|
494
479
|
"reflect": true,
|
|
495
480
|
"defaultValue": "false"
|
|
496
481
|
},
|
|
497
|
-
"readonlyLabel": {
|
|
498
|
-
"type": "string",
|
|
499
|
-
"mutable": false,
|
|
500
|
-
"complexType": {
|
|
501
|
-
"original": "string",
|
|
502
|
-
"resolved": "string | undefined",
|
|
503
|
-
"references": {}
|
|
504
|
-
},
|
|
505
|
-
"required": false,
|
|
506
|
-
"optional": true,
|
|
507
|
-
"docs": {
|
|
508
|
-
"tags": [],
|
|
509
|
-
"text": "Specifies the label for the displayed state read-only"
|
|
510
|
-
},
|
|
511
|
-
"attribute": "readonly-label",
|
|
512
|
-
"reflect": true,
|
|
513
|
-
"defaultValue": "'sola lettura'"
|
|
514
|
-
},
|
|
515
482
|
"required": {
|
|
516
483
|
"type": "boolean",
|
|
517
484
|
"mutable": false,
|
|
@@ -530,24 +497,6 @@ export class MdsInput {
|
|
|
530
497
|
"reflect": true,
|
|
531
498
|
"defaultValue": "false"
|
|
532
499
|
},
|
|
533
|
-
"requiredLabel": {
|
|
534
|
-
"type": "string",
|
|
535
|
-
"mutable": false,
|
|
536
|
-
"complexType": {
|
|
537
|
-
"original": "string",
|
|
538
|
-
"resolved": "string | undefined",
|
|
539
|
-
"references": {}
|
|
540
|
-
},
|
|
541
|
-
"required": false,
|
|
542
|
-
"optional": true,
|
|
543
|
-
"docs": {
|
|
544
|
-
"tags": [],
|
|
545
|
-
"text": "Specifies the label for the displayed state required"
|
|
546
|
-
},
|
|
547
|
-
"attribute": "required-label",
|
|
548
|
-
"reflect": true,
|
|
549
|
-
"defaultValue": "'obbligatorio'"
|
|
550
|
-
},
|
|
551
500
|
"variant": {
|
|
552
501
|
"type": "string",
|
|
553
502
|
"mutable": false,
|
|
@@ -708,7 +657,7 @@ export class MdsInput {
|
|
|
708
657
|
"composed": true,
|
|
709
658
|
"docs": {
|
|
710
659
|
"tags": [],
|
|
711
|
-
"text": "Emits a KeyboardEvent when a
|
|
660
|
+
"text": "Emits a KeyboardEvent when a keyboard key is pressed on the focused input element"
|
|
712
661
|
},
|
|
713
662
|
"complexType": {
|
|
714
663
|
"original": "KeyboardEvent",
|