@maggioli-design-system/mds-input 3.1.0 → 4.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-673e91e1.js → index-e46754eb.js} +56 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mds-input.cjs.entry.js +5 -5
- package/dist/cjs/mds-input.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/common/keyboard-manager.js +40 -0
- package/dist/collection/components/mds-input/mds-input.js +8 -8
- package/dist/collection/dictionary/icon.js +3 -1
- package/dist/collection/dictionary/typography.js +5 -1
- package/dist/components/mds-input.js +4 -4
- package/dist/esm/{index-a525702b.js → index-9c3f6f0d.js} +56 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mds-input.entry.js +5 -5
- package/dist/esm/mds-input.js +3 -3
- 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/{www/build/p-cd95c097.system.entry.js → dist/mds-input/p-22e40cbc.system.entry.js} +1 -1
- package/dist/mds-input/p-620792a0.entry.js +1 -0
- package/dist/mds-input/{p-ea0e5d94.system.js → p-bd99984b.system.js} +1 -1
- package/dist/stats.json +69 -66
- package/dist/types/common/keyboard-manager.d.ts +11 -0
- package/dist/types/components.d.ts +8 -8
- package/dist/types/dictionary/icon.d.ts +2 -1
- package/dist/types/dictionary/typography.d.ts +2 -1
- package/dist/types/stencil-public-runtime.d.ts +11 -0
- package/dist/types/{types → type}/typography.d.ts +1 -0
- package/package.json +5 -5
- package/readme.md +7 -7
- package/src/common/keyboard-manager.ts +46 -0
- package/src/components/mds-input/mds-input.tsx +9 -9
- package/src/components/mds-input/readme.md +6 -6
- package/src/components.d.ts +8 -8
- package/src/dictionary/icon.ts +4 -0
- package/src/dictionary/typography.ts +9 -3
- package/src/fixtures/icons.json +174 -0
- package/src/fixtures/iconsauce.json +175 -0
- package/src/tailwind/components.css +1 -0
- package/src/{types → type}/typography.ts +4 -0
- package/www/build/mds-input.esm.js +1 -1
- package/www/build/mds-input.js +1 -1
- package/{dist/mds-input/p-cd95c097.system.entry.js → www/build/p-22e40cbc.system.entry.js} +1 -1
- package/www/build/p-620792a0.entry.js +1 -0
- package/www/build/{p-ea0e5d94.system.js → p-bd99984b.system.js} +1 -1
- package/dist/mds-input/p-d46ae44e.entry.js +0 -1
- package/www/build/p-d46ae44e.entry.js +0 -1
- /package/dist/collection/{types → type}/autocomplete.js +0 -0
- /package/dist/collection/{types → type}/button.js +0 -0
- /package/dist/collection/{types → type}/floating-ui.js +0 -0
- /package/dist/collection/{types → type}/form-rel.js +0 -0
- /package/dist/collection/{types → type}/input-text-type.js +0 -0
- /package/dist/collection/{types → type}/input-value-type.js +0 -0
- /package/dist/collection/{types → type}/loading.js +0 -0
- /package/dist/collection/{types → type}/typography.js +0 -0
- /package/dist/collection/{types → type}/variant.js +0 -0
- /package/dist/esm-es5/{index-a525702b.js → index-9c3f6f0d.js} +0 -0
- /package/dist/mds-input/{p-190e0588.js → p-4793cf7a.js} +0 -0
- /package/dist/mds-input/{p-a8418869.system.js → p-d37ad585.system.js} +0 -0
- /package/dist/types/{types → type}/autocomplete.d.ts +0 -0
- /package/dist/types/{types → type}/button.d.ts +0 -0
- /package/dist/types/{types → type}/floating-ui.d.ts +0 -0
- /package/dist/types/{types → type}/form-rel.d.ts +0 -0
- /package/dist/types/{types → type}/input-text-type.d.ts +0 -0
- /package/dist/types/{types → type}/input-value-type.d.ts +0 -0
- /package/dist/types/{types → type}/loading.d.ts +0 -0
- /package/dist/types/{types → type}/variant.d.ts +0 -0
- /package/src/{types → type}/autocomplete.ts +0 -0
- /package/src/{types → type}/button.ts +0 -0
- /package/src/{types → type}/floating-ui.ts +0 -0
- /package/src/{types → type}/form-rel.ts +0 -0
- /package/src/{types → type}/input-text-type.ts +0 -0
- /package/src/{types → type}/input-value-type.ts +0 -0
- /package/src/{types → type}/loading.ts +0 -0
- /package/src/{types → type}/variant.ts +0 -0
- /package/www/build/{p-190e0588.js → p-4793cf7a.js} +0 -0
- /package/www/build/{p-a8418869.system.js → p-d37ad585.system.js} +0 -0
|
@@ -133,6 +133,14 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
133
133
|
}
|
|
134
134
|
return vnode;
|
|
135
135
|
};
|
|
136
|
+
/**
|
|
137
|
+
* A utility function for creating a virtual DOM node from a tag and some
|
|
138
|
+
* possible text content.
|
|
139
|
+
*
|
|
140
|
+
* @param tag the tag for this element
|
|
141
|
+
* @param text possible text content for the node
|
|
142
|
+
* @returns a newly-minted virtual DOM node
|
|
143
|
+
*/
|
|
136
144
|
const newVNode = (tag, text) => {
|
|
137
145
|
const vnode = {
|
|
138
146
|
$flags$: 0,
|
|
@@ -147,6 +155,12 @@ const newVNode = (tag, text) => {
|
|
|
147
155
|
return vnode;
|
|
148
156
|
};
|
|
149
157
|
const Host = {};
|
|
158
|
+
/**
|
|
159
|
+
* Check whether a given node is a Host node or not
|
|
160
|
+
*
|
|
161
|
+
* @param node the virtual DOM node to check
|
|
162
|
+
* @returns whether it's a Host node or not
|
|
163
|
+
*/
|
|
150
164
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
151
165
|
/**
|
|
152
166
|
* Parse a new property value for a given property type.
|
|
@@ -468,6 +482,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
468
482
|
}
|
|
469
483
|
return elm;
|
|
470
484
|
};
|
|
485
|
+
/**
|
|
486
|
+
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
487
|
+
* add them to the DOM in the appropriate place.
|
|
488
|
+
*
|
|
489
|
+
* @param parentElm the DOM node which should be used as a parent for the new
|
|
490
|
+
* DOM nodes
|
|
491
|
+
* @param before a child of the `parentElm` which the new children should be
|
|
492
|
+
* inserted before (optional)
|
|
493
|
+
* @param parentVNode the parent virtual DOM node
|
|
494
|
+
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
495
|
+
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
496
|
+
* creating DOM nodes (inclusive)
|
|
497
|
+
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
498
|
+
* creating DOM nodes (inclusive)
|
|
499
|
+
*/
|
|
471
500
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
472
501
|
let containerElm = (parentElm);
|
|
473
502
|
let childNode;
|
|
@@ -484,6 +513,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
484
513
|
}
|
|
485
514
|
}
|
|
486
515
|
};
|
|
516
|
+
/**
|
|
517
|
+
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
|
518
|
+
* This can be used to, for instance, clean up after a list of children which
|
|
519
|
+
* should no longer be shown.
|
|
520
|
+
*
|
|
521
|
+
* This function also handles some of Stencil's slot relocation logic.
|
|
522
|
+
*
|
|
523
|
+
* @param vnodes a list of virtual DOM nodes to remove
|
|
524
|
+
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
525
|
+
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
526
|
+
* @param vnode a VNode
|
|
527
|
+
* @param elm an element
|
|
528
|
+
*/
|
|
487
529
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
488
530
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
489
531
|
if ((vnode = vnodes[startIdx])) {
|
|
@@ -676,7 +718,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
676
718
|
*
|
|
677
719
|
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
678
720
|
* changing order within a `children` array or something along those lines then
|
|
679
|
-
* we could obtain a false
|
|
721
|
+
* we could obtain a false negative and then have to do needless re-rendering
|
|
722
|
+
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
680
723
|
*
|
|
681
724
|
* @param leftVNode the first VNode to check
|
|
682
725
|
* @param rightVNode the second VNode to check
|
|
@@ -743,6 +786,18 @@ const callNodeRefs = (vNode) => {
|
|
|
743
786
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
744
787
|
}
|
|
745
788
|
};
|
|
789
|
+
/**
|
|
790
|
+
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
791
|
+
*
|
|
792
|
+
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
793
|
+
* function will handle creating a virtual DOM tree with a single root, patching
|
|
794
|
+
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
795
|
+
* relocation, and reflecting attributes.
|
|
796
|
+
*
|
|
797
|
+
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
798
|
+
* the DOM node into which it should be rendered.
|
|
799
|
+
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
800
|
+
*/
|
|
746
801
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
747
802
|
const hostElm = hostRef.$hostElement$;
|
|
748
803
|
const cmpMeta = hostRef.$cmpMeta$;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e46754eb.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.22.
|
|
8
|
+
Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -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-e46754eb.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))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
8
8
|
|
|
@@ -11,10 +11,10 @@ const mdsInputCss = "*,::before,::after{--tw-border-spacing-x:0;--tw-border-spac
|
|
|
11
11
|
const MdsInput = class {
|
|
12
12
|
constructor(hostRef) {
|
|
13
13
|
index.registerInstance(this, hostRef);
|
|
14
|
-
this.changeEvent = index.createEvent(this, "
|
|
15
|
-
this.keyDownEvent = index.createEvent(this, "
|
|
16
|
-
this.blurEvent = index.createEvent(this, "
|
|
17
|
-
this.focusEvent = index.createEvent(this, "
|
|
14
|
+
this.changeEvent = index.createEvent(this, "mdsInputChange", 7);
|
|
15
|
+
this.keyDownEvent = index.createEvent(this, "mdsInputKeydown", 7);
|
|
16
|
+
this.blurEvent = index.createEvent(this, "mdsInputBlur", 7);
|
|
17
|
+
this.focusEvent = index.createEvent(this, "mdsInputFocus", 7);
|
|
18
18
|
this.onInput = (ev) => {
|
|
19
19
|
const input = ev.target;
|
|
20
20
|
if (input) {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e46754eb.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser v2.22.
|
|
8
|
+
Stencil Client Patch Browser v2.22.2 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchBrowser = () => {
|
|
11
11
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-input.cjs.js', document.baseURI).href));
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export class KeyboardManager {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.elements = [];
|
|
4
|
+
this.handleClickBehaviorDispatchEvent = (event) => {
|
|
5
|
+
if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
|
|
6
|
+
event.target.click();
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
this.handleEscapeBehaviorDispatchEvent = (event) => {
|
|
10
|
+
if (event.code === 'Escape' && this.escapeCallback) {
|
|
11
|
+
this.escapeCallback();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
this.addElement = (el, name = 'element') => {
|
|
15
|
+
this.elements[name] = el;
|
|
16
|
+
};
|
|
17
|
+
this.attachClickBehavior = (name = 'element') => {
|
|
18
|
+
if (this.elements[name]) {
|
|
19
|
+
this.elements[name].addEventListener('keydown', this.handleClickBehaviorDispatchEvent);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
this.detachClickBehavior = (name = 'element') => {
|
|
23
|
+
if (this.elements[name]) {
|
|
24
|
+
this.elements[name].removeEventListener('keydown', this.handleClickBehaviorDispatchEvent);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
this.attachEscapeBehavior = (callBack) => {
|
|
28
|
+
this.escapeCallback = callBack;
|
|
29
|
+
if (typeof window !== undefined) {
|
|
30
|
+
window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
this.detachEscapeBehavior = () => {
|
|
34
|
+
this.escapeCallback = null;
|
|
35
|
+
if (typeof window !== undefined) {
|
|
36
|
+
window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -114,7 +114,7 @@ export class MdsInput {
|
|
|
114
114
|
"references": {
|
|
115
115
|
"AutocompleteType": {
|
|
116
116
|
"location": "import",
|
|
117
|
-
"path": "
|
|
117
|
+
"path": "@type/autocomplete"
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
},
|
|
@@ -360,7 +360,7 @@ export class MdsInput {
|
|
|
360
360
|
"references": {
|
|
361
361
|
"ThemeStatusVariantType": {
|
|
362
362
|
"location": "import",
|
|
363
|
-
"path": "
|
|
363
|
+
"path": "@type/variant"
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
},
|
|
@@ -416,7 +416,7 @@ export class MdsInput {
|
|
|
416
416
|
"references": {
|
|
417
417
|
"InputTextType": {
|
|
418
418
|
"location": "import",
|
|
419
|
-
"path": "
|
|
419
|
+
"path": "@type/input-text-type"
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
},
|
|
@@ -439,7 +439,7 @@ export class MdsInput {
|
|
|
439
439
|
"references": {
|
|
440
440
|
"InputValueType": {
|
|
441
441
|
"location": "import",
|
|
442
|
-
"path": "
|
|
442
|
+
"path": "@type/input-value-type"
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
},
|
|
@@ -463,7 +463,7 @@ export class MdsInput {
|
|
|
463
463
|
static get events() {
|
|
464
464
|
return [{
|
|
465
465
|
"method": "changeEvent",
|
|
466
|
-
"name": "
|
|
466
|
+
"name": "mdsInputChange",
|
|
467
467
|
"bubbles": true,
|
|
468
468
|
"cancelable": true,
|
|
469
469
|
"composed": true,
|
|
@@ -483,7 +483,7 @@ export class MdsInput {
|
|
|
483
483
|
}
|
|
484
484
|
}, {
|
|
485
485
|
"method": "keyDownEvent",
|
|
486
|
-
"name": "
|
|
486
|
+
"name": "mdsInputKeydown",
|
|
487
487
|
"bubbles": true,
|
|
488
488
|
"cancelable": true,
|
|
489
489
|
"composed": true,
|
|
@@ -502,7 +502,7 @@ export class MdsInput {
|
|
|
502
502
|
}
|
|
503
503
|
}, {
|
|
504
504
|
"method": "blurEvent",
|
|
505
|
-
"name": "
|
|
505
|
+
"name": "mdsInputBlur",
|
|
506
506
|
"bubbles": true,
|
|
507
507
|
"cancelable": true,
|
|
508
508
|
"composed": true,
|
|
@@ -517,7 +517,7 @@ export class MdsInput {
|
|
|
517
517
|
}
|
|
518
518
|
}, {
|
|
519
519
|
"method": "focusEvent",
|
|
520
|
-
"name": "
|
|
520
|
+
"name": "mdsInputFocus",
|
|
521
521
|
"bubbles": true,
|
|
522
522
|
"cancelable": true,
|
|
523
523
|
"composed": true,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import jsonIconsDictionary from '../fixtures/icons.json';
|
|
2
|
+
import jsonMggIconsDictionary from '../fixtures/iconsauce.json';
|
|
2
3
|
const iconsDictionary = jsonIconsDictionary;
|
|
3
|
-
|
|
4
|
+
const mggIconsDictionary = jsonMggIconsDictionary;
|
|
5
|
+
export { iconsDictionary, mggIconsDictionary, };
|
|
@@ -21,6 +21,10 @@ const typographyVariationsDictionary = [
|
|
|
21
21
|
'read',
|
|
22
22
|
'code',
|
|
23
23
|
];
|
|
24
|
+
const typographyReadingVariationsDictionary = [
|
|
25
|
+
'info',
|
|
26
|
+
'read',
|
|
27
|
+
];
|
|
24
28
|
const typographyMonoDictionary = [
|
|
25
29
|
'snippet',
|
|
26
30
|
'hack',
|
|
@@ -56,4 +60,4 @@ const typographyTooltipDictionary = [
|
|
|
56
60
|
'detail',
|
|
57
61
|
'tip',
|
|
58
62
|
];
|
|
59
|
-
export { typographyDictionary,
|
|
63
|
+
export { typographyDictionary, typographyInfoDictionary, typographyReadingVariationsDictionary, typographyMonoDictionary, typographyReadDictionary, typographySmallerDictionary, typographyTitleDictionary, typographyTooltipDictionary, typographyVariationsDictionary, };
|
|
@@ -9,10 +9,10 @@ const MdsInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
9
9
|
super();
|
|
10
10
|
this.__registerHost();
|
|
11
11
|
this.__attachShadow();
|
|
12
|
-
this.changeEvent = createEvent(this, "
|
|
13
|
-
this.keyDownEvent = createEvent(this, "
|
|
14
|
-
this.blurEvent = createEvent(this, "
|
|
15
|
-
this.focusEvent = createEvent(this, "
|
|
12
|
+
this.changeEvent = createEvent(this, "mdsInputChange", 7);
|
|
13
|
+
this.keyDownEvent = createEvent(this, "mdsInputKeydown", 7);
|
|
14
|
+
this.blurEvent = createEvent(this, "mdsInputBlur", 7);
|
|
15
|
+
this.focusEvent = createEvent(this, "mdsInputFocus", 7);
|
|
16
16
|
this.onInput = (ev) => {
|
|
17
17
|
const input = ev.target;
|
|
18
18
|
if (input) {
|
|
@@ -111,6 +111,14 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
111
111
|
}
|
|
112
112
|
return vnode;
|
|
113
113
|
};
|
|
114
|
+
/**
|
|
115
|
+
* A utility function for creating a virtual DOM node from a tag and some
|
|
116
|
+
* possible text content.
|
|
117
|
+
*
|
|
118
|
+
* @param tag the tag for this element
|
|
119
|
+
* @param text possible text content for the node
|
|
120
|
+
* @returns a newly-minted virtual DOM node
|
|
121
|
+
*/
|
|
114
122
|
const newVNode = (tag, text) => {
|
|
115
123
|
const vnode = {
|
|
116
124
|
$flags$: 0,
|
|
@@ -125,6 +133,12 @@ const newVNode = (tag, text) => {
|
|
|
125
133
|
return vnode;
|
|
126
134
|
};
|
|
127
135
|
const Host = {};
|
|
136
|
+
/**
|
|
137
|
+
* Check whether a given node is a Host node or not
|
|
138
|
+
*
|
|
139
|
+
* @param node the virtual DOM node to check
|
|
140
|
+
* @returns whether it's a Host node or not
|
|
141
|
+
*/
|
|
128
142
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
129
143
|
/**
|
|
130
144
|
* Parse a new property value for a given property type.
|
|
@@ -446,6 +460,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
446
460
|
}
|
|
447
461
|
return elm;
|
|
448
462
|
};
|
|
463
|
+
/**
|
|
464
|
+
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
465
|
+
* add them to the DOM in the appropriate place.
|
|
466
|
+
*
|
|
467
|
+
* @param parentElm the DOM node which should be used as a parent for the new
|
|
468
|
+
* DOM nodes
|
|
469
|
+
* @param before a child of the `parentElm` which the new children should be
|
|
470
|
+
* inserted before (optional)
|
|
471
|
+
* @param parentVNode the parent virtual DOM node
|
|
472
|
+
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
473
|
+
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
474
|
+
* creating DOM nodes (inclusive)
|
|
475
|
+
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
476
|
+
* creating DOM nodes (inclusive)
|
|
477
|
+
*/
|
|
449
478
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
450
479
|
let containerElm = (parentElm);
|
|
451
480
|
let childNode;
|
|
@@ -462,6 +491,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
462
491
|
}
|
|
463
492
|
}
|
|
464
493
|
};
|
|
494
|
+
/**
|
|
495
|
+
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
|
496
|
+
* This can be used to, for instance, clean up after a list of children which
|
|
497
|
+
* should no longer be shown.
|
|
498
|
+
*
|
|
499
|
+
* This function also handles some of Stencil's slot relocation logic.
|
|
500
|
+
*
|
|
501
|
+
* @param vnodes a list of virtual DOM nodes to remove
|
|
502
|
+
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
503
|
+
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
504
|
+
* @param vnode a VNode
|
|
505
|
+
* @param elm an element
|
|
506
|
+
*/
|
|
465
507
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
466
508
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
467
509
|
if ((vnode = vnodes[startIdx])) {
|
|
@@ -654,7 +696,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
654
696
|
*
|
|
655
697
|
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
656
698
|
* changing order within a `children` array or something along those lines then
|
|
657
|
-
* we could obtain a false
|
|
699
|
+
* we could obtain a false negative and then have to do needless re-rendering
|
|
700
|
+
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
658
701
|
*
|
|
659
702
|
* @param leftVNode the first VNode to check
|
|
660
703
|
* @param rightVNode the second VNode to check
|
|
@@ -721,6 +764,18 @@ const callNodeRefs = (vNode) => {
|
|
|
721
764
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
722
765
|
}
|
|
723
766
|
};
|
|
767
|
+
/**
|
|
768
|
+
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
769
|
+
*
|
|
770
|
+
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
771
|
+
* function will handle creating a virtual DOM tree with a single root, patching
|
|
772
|
+
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
773
|
+
* relocation, and reflecting attributes.
|
|
774
|
+
*
|
|
775
|
+
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
776
|
+
* the DOM node into which it should be rendered.
|
|
777
|
+
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
778
|
+
*/
|
|
724
779
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
725
780
|
const hostElm = hostRef.$hostElement$;
|
|
726
781
|
const cmpMeta = hostRef.$cmpMeta$;
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-9c3f6f0d.js';
|
|
2
|
+
export { s as setNonce } from './index-9c3f6f0d.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Patch Esm v2.22.
|
|
5
|
+
Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
const patchEsm = () => {
|
|
8
8
|
return promiseResolve();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-9c3f6f0d.js';
|
|
2
2
|
|
|
3
3
|
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))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
4
4
|
|
|
@@ -7,10 +7,10 @@ const mdsInputCss = "*,::before,::after{--tw-border-spacing-x:0;--tw-border-spac
|
|
|
7
7
|
const MdsInput = class {
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
registerInstance(this, hostRef);
|
|
10
|
-
this.changeEvent = createEvent(this, "
|
|
11
|
-
this.keyDownEvent = createEvent(this, "
|
|
12
|
-
this.blurEvent = createEvent(this, "
|
|
13
|
-
this.focusEvent = createEvent(this, "
|
|
10
|
+
this.changeEvent = createEvent(this, "mdsInputChange", 7);
|
|
11
|
+
this.keyDownEvent = createEvent(this, "mdsInputKeydown", 7);
|
|
12
|
+
this.blurEvent = createEvent(this, "mdsInputBlur", 7);
|
|
13
|
+
this.focusEvent = createEvent(this, "mdsInputFocus", 7);
|
|
14
14
|
this.onInput = (ev) => {
|
|
15
15
|
const input = ev.target;
|
|
16
16
|
if (input) {
|
package/dist/esm/mds-input.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-9c3f6f0d.js';
|
|
2
|
+
export { s as setNonce } from './index-9c3f6f0d.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Patch Browser v2.22.
|
|
5
|
+
Stencil Client Patch Browser v2.22.2 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
const patchBrowser = () => {
|
|
8
8
|
const importMeta = import.meta.url;
|
package/dist/esm-es5/loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as promiseResolve,b as bootstrapLazy}from"./index-
|
|
1
|
+
import{p as promiseResolve,b as bootstrapLazy}from"./index-9c3f6f0d.js";export{s as setNonce}from"./index-9c3f6f0d.js";var patchEsm=function(){return promiseResolve()};var defineCustomElements=function(e,t){if(typeof window==="undefined")return Promise.resolve();return patchEsm().then((function(){return bootstrapLazy([["mds-input",[[1,"mds-input",{autocomplete:[1],autofocus:[4],datalist:[16],disabled:[4],icon:[1],max:[2],maxlength:[2],min:[1],minlength:[2],name:[1],pattern:[1],placeholder:[1],readonly:[4],required:[4],variant:[513],tip:[1],step:[1],type:[1],value:[8],hasFocus:[32],setFocus:[64],getInputElement:[64]}]]]],t)}))};export{defineCustomElements};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,i,o,r){function n(t){return t instanceof o?t:new o((function(i){i(t)}))}return new(o||(o=Promise))((function(o,e){function a(t){try{c(r.next(t))}catch(t){e(t)}}function s(t){try{c(r["throw"](t))}catch(t){e(t)}}function c(t){t.done?o(t.value):n(t.value).then(a,s)}c((r=r.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var o={label:0,sent:function(){if(e[0]&1)throw e[1];return e[1]},trys:[],ops:[]},r,n,e,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(i){return c([t,i])}}function c(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(r=1,n&&(e=s[0]&2?n["return"]:s[0]?n["throw"]||((e=n["return"])&&e.call(n),0):n.next)&&!(e=e.call(n,s[1])).done)return e;if(n=0,e)s=[s[0]&2,e.value];switch(s[0]){case 0:case 1:e=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(e=o.trys,e=e.length>0&&e[e.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!e||s[1]>e[0]&&s[1]<e[3])){o.label=s[1];break}if(s[0]===6&&o.label<e[1]){o.label=e[1];e=s;break}if(e&&o.label<e[2]){o.label=e[2];o.ops.push(s);break}if(e[2])o.ops.pop();o.trys.pop();continue}s=i.call(t,o)}catch(t){s=[6,t];n=0}finally{r=e=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-a525702b.js";function r(t){var i,o,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t))for(i=0;i<t.length;i++)t[i]&&(o=r(t[i]))&&(n&&(n+=" "),n+=o);else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}function clsx(){for(var t,i,o=0,n="";o<arguments.length;)(t=arguments[o++])&&(i=r(t))&&(n&&(n+=" "),n+=i);return n}var mdsInputCss="*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}@tailwind utilities; :host{--mds-input-background:rgb(var(--tone-neutral));--mds-input-icon-color:var(--mds-input-variant-color);--mds-input-tip-background:84, 84, 84;--mds-input-ring:0 0 0 1px rgba(var(--mds-input-variant-color), 0.1);--mds-input-shadow:0 1px 3px 0 rgba(var(--mds-input-variant-color), 0.1), 0 1px 2px 0 rgba(var(--mds-input-variant-color), 0.06);--mds-input-variant-color:0, 0, 0;font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:relative;display:-ms-flexbox;display:flex}.input{font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0px;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:3rem;width:100%;overflow:hidden;text-overflow:ellipsis;border-radius:0.5rem;border-style:none;border-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;--tw-text-opacity:1;color:rgba(var(--tone-neutral-02), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);background-color:var(--mds-input-background);-webkit-box-shadow:var(--mds-input-ring), var(--mds-input-shadow);box-shadow:var(--mds-input-ring), var(--mds-input-shadow)}textarea.input:active{-webkit-transition-property:none;transition-property:none}textarea.input{max-height:16rem;min-height:6rem;border-bottom-right-radius:0px}.input:focus{outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);--mds-input-ring:0 0 0 3px rgba(var(--mds-input-variant-color), 1);--mds-input-shadow:0 4px 6px -1px rgba(var(--mds-input-variant-color), 0.1), 0 2px 4px -1px rgba(var(--mds-input-variant-color), 0.06)}.input:disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-10), var(--tw-bg-opacity))}.input:disabled::-moz-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled::-webkit-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled:-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled::-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled,.input:disabled::placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.has-icon{padding-left:2.75rem}.tip{pointer-events:none;position:absolute;right:0.25rem;height:0.75rem;-ms-flex-pack:center;justify-content:center;border-radius:9999px;padding-left:0.5rem;padding-right:0.5rem;text-align:center;--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);line-height:0.75rem;background-color:rgb(var(--mds-input-tip-background))}.tip-variant{--mds-input-tip-background:var(--mds-input-icon-color)}.read-only{--tw-bg-opacity:1;background-color:rgba(var(--status-info-05), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--status-info-09), var(--tw-text-opacity))}.required{width:0.75rem;--tw-bg-opacity:1;background-color:rgba(var(--status-error-05), var(--tw-bg-opacity));padding:0px;color:rgba(var(--tone-neutral), var(--tw-text-opacity));--tw-text-opacity:0}.disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-05), var(--tw-bg-opacity))}.input:focus+.required{width:6rem;--tw-text-opacity:1}.icon{position:absolute;left:0.75rem;top:0.75rem;fill:rgb(var(--mds-input-icon-color))}.fixed{position:fixed}.absolute{position:absolute}.top-1{top:0.25rem}.bottom-1{bottom:0.25rem}.flex{display:-ms-flexbox;display:flex}.w-min{width:-moz-min-content;width:-webkit-min-content;width:min-content}.flex-col{-ms-flex-direction:column;flex-direction:column}.gap-y-2{row-gap:0.5rem}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-input-icon-color:10, 80, 212;--mds-input-variant-color:0, 0, 0}:host(:focus){--mds-input-variant-color:31, 101, 232;}:host([variant=info]){--mds-input-icon-color:25, 143, 182;--mds-input-variant-color:0, 0, 0}:host([variant=info]:focus){--mds-input-icon-color:21, 119, 151;--mds-input-variant-color:25, 143, 182;}:host([variant=success]){--mds-input-icon-color:26, 151, 91;--mds-input-variant-color:0, 0, 0}:host([variant=success]:focus){--mds-input-icon-color:22, 125, 76;--mds-input-variant-color:26, 151, 91;}:host([variant=warning]){--mds-input-icon-color:168, 126, 0;--mds-input-variant-color:0, 0, 0}:host([variant=warning]:focus){--mds-input-icon-color:139, 104, 0;--mds-input-variant-color:168, 126, 0;}:host([variant=error]){--mds-input-icon-color:234, 77, 73;--mds-input-variant-color:0, 0, 0}:host([variant=error]:focus){--mds-input-icon-color:215, 29, 25;--mds-input-variant-color:234, 77, 73;}";var MdsInput=function(){function t(t){var i=this;registerInstance(this,t);this.changeEvent=createEvent(this,"changeEvent",7);this.keyDownEvent=createEvent(this,"keyDownEvent",7);this.blurEvent=createEvent(this,"blurEvent",7);this.focusEvent=createEvent(this,"focusEvent",7);this.onInput=function(t){var o=t.target;if(o){i.value=o.value||""}i.keyDownEvent.emit(t)};this.onBlur=function(){i.hasFocus=false;i.blurEvent.emit()};this.onFocus=function(t){var o=t.target;i.hasFocus=true;i.focusEvent.emit();if(i.readonly){setTimeout((function(){o.select()}),10)}};this.hasFocus=false;this.autocomplete="off";this.autofocus=false;this.datalist=undefined;this.disabled=false;this.icon=undefined;this.max=undefined;this.maxlength=undefined;this.min=undefined;this.minlength=undefined;this.name=undefined;this.pattern=undefined;this.placeholder=undefined;this.readonly=false;this.required=false;this.variant=undefined;this.tip=undefined;this.step=undefined;this.type="text";this.value=""}t.prototype.componentWillLoad=function(){if(this.el.hasAttribute("tabindex")){var t=this.el.getAttribute("tabindex");this.tabindex=t!==null?parseInt(t):undefined;this.el.removeAttribute("tabindex")}};t.prototype.valueChanged=function(){this.changeEvent.emit({value:this.value===null?this.value:this.value.toString()})};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.nativeInput!==null){this.nativeInput.focus()}return[2]}))}))};t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)};t.prototype.getValue=function(){return typeof this.value==="number"?this.value.toString():(this.value||"").toString()};t.prototype.render=function(){var t=this;var i=this.getValue();return h(Host,null,this.type==="textarea"?h("textarea",{class:clsx("input",this.icon&&"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,placeholder:this.placeholder||"",readOnly:this.readonly,ref:function(i){return t.nativeInput=i},required:this.required,tabIndex:this.tabindex,value:i}):h("input",{class:clsx("input",this.icon&&"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",placeholder:this.placeholder||"",readOnly:this.readonly,ref:function(i){return t.nativeInput=i},required:this.required,step:this.step,tabIndex:this.tabindex,type:this.type,value:i}),this.disabled&&h("mds-text",{typography:"option",class:"tip top-1 disabled"},"Disabilitato"),this.readonly&&!this.disabled&&h("mds-text",{typography:"option",class:"tip top-1 read-only"},"Sola lettura"),this.required&&!this.disabled&&!this.readonly&&h("mds-text",{typography:"option",class:"tip top-1 required"},"Obbligatorio"),this.tip&&h("mds-text",{typography:"option",class:clsx("tip bottom-1",this.variant&&"tip-variant")},this.tip),this.datalist&&h("datalist",{id:"datalist",class:"datalist"},this.datalist.forEach((function(t){h("option",{value:t})}))),this.icon&&h("mds-icon",{class:clsx("icon",this.variant),name:this.icon}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return t}();MdsInput.style=mdsInputCss;export{MdsInput as mds_input};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,i,o,r){function n(t){return t instanceof o?t:new o((function(i){i(t)}))}return new(o||(o=Promise))((function(o,e){function a(t){try{c(r.next(t))}catch(t){e(t)}}function s(t){try{c(r["throw"](t))}catch(t){e(t)}}function c(t){t.done?o(t.value):n(t.value).then(a,s)}c((r=r.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var o={label:0,sent:function(){if(e[0]&1)throw e[1];return e[1]},trys:[],ops:[]},r,n,e,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(i){return c([t,i])}}function c(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(r=1,n&&(e=s[0]&2?n["return"]:s[0]?n["throw"]||((e=n["return"])&&e.call(n),0):n.next)&&!(e=e.call(n,s[1])).done)return e;if(n=0,e)s=[s[0]&2,e.value];switch(s[0]){case 0:case 1:e=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(e=o.trys,e=e.length>0&&e[e.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!e||s[1]>e[0]&&s[1]<e[3])){o.label=s[1];break}if(s[0]===6&&o.label<e[1]){o.label=e[1];e=s;break}if(e&&o.label<e[2]){o.label=e[2];o.ops.push(s);break}if(e[2])o.ops.pop();o.trys.pop();continue}s=i.call(t,o)}catch(t){s=[6,t];n=0}finally{r=e=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-9c3f6f0d.js";function r(t){var i,o,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t))for(i=0;i<t.length;i++)t[i]&&(o=r(t[i]))&&(n&&(n+=" "),n+=o);else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}function clsx(){for(var t,i,o=0,n="";o<arguments.length;)(t=arguments[o++])&&(i=r(t))&&(n&&(n+=" "),n+=i);return n}var mdsInputCss="*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}@tailwind utilities; :host{--mds-input-background:rgb(var(--tone-neutral));--mds-input-icon-color:var(--mds-input-variant-color);--mds-input-tip-background:84, 84, 84;--mds-input-ring:0 0 0 1px rgba(var(--mds-input-variant-color), 0.1);--mds-input-shadow:0 1px 3px 0 rgba(var(--mds-input-variant-color), 0.1), 0 1px 2px 0 rgba(var(--mds-input-variant-color), 0.06);--mds-input-variant-color:0, 0, 0;font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:relative;display:-ms-flexbox;display:flex}.input{font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0px;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:3rem;width:100%;overflow:hidden;text-overflow:ellipsis;border-radius:0.5rem;border-style:none;border-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;--tw-text-opacity:1;color:rgba(var(--tone-neutral-02), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);background-color:var(--mds-input-background);-webkit-box-shadow:var(--mds-input-ring), var(--mds-input-shadow);box-shadow:var(--mds-input-ring), var(--mds-input-shadow)}textarea.input:active{-webkit-transition-property:none;transition-property:none}textarea.input{max-height:16rem;min-height:6rem;border-bottom-right-radius:0px}.input:focus{outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);--mds-input-ring:0 0 0 3px rgba(var(--mds-input-variant-color), 1);--mds-input-shadow:0 4px 6px -1px rgba(var(--mds-input-variant-color), 0.1), 0 2px 4px -1px rgba(var(--mds-input-variant-color), 0.06)}.input:disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-10), var(--tw-bg-opacity))}.input:disabled::-moz-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled::-webkit-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled:-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled::-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled,.input:disabled::placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.has-icon{padding-left:2.75rem}.tip{pointer-events:none;position:absolute;right:0.25rem;height:0.75rem;-ms-flex-pack:center;justify-content:center;border-radius:9999px;padding-left:0.5rem;padding-right:0.5rem;text-align:center;--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);line-height:0.75rem;background-color:rgb(var(--mds-input-tip-background))}.tip-variant{--mds-input-tip-background:var(--mds-input-icon-color)}.read-only{--tw-bg-opacity:1;background-color:rgba(var(--status-info-05), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--status-info-09), var(--tw-text-opacity))}.required{width:0.75rem;--tw-bg-opacity:1;background-color:rgba(var(--status-error-05), var(--tw-bg-opacity));padding:0px;color:rgba(var(--tone-neutral), var(--tw-text-opacity));--tw-text-opacity:0}.disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-05), var(--tw-bg-opacity))}.input:focus+.required{width:6rem;--tw-text-opacity:1}.icon{position:absolute;left:0.75rem;top:0.75rem;fill:rgb(var(--mds-input-icon-color))}.fixed{position:fixed}.absolute{position:absolute}.top-1{top:0.25rem}.bottom-1{bottom:0.25rem}.flex{display:-ms-flexbox;display:flex}.w-min{width:-moz-min-content;width:-webkit-min-content;width:min-content}.flex-col{-ms-flex-direction:column;flex-direction:column}.gap-y-2{row-gap:0.5rem}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-input-icon-color:10, 80, 212;--mds-input-variant-color:0, 0, 0}:host(:focus){--mds-input-variant-color:31, 101, 232;}:host([variant=info]){--mds-input-icon-color:25, 143, 182;--mds-input-variant-color:0, 0, 0}:host([variant=info]:focus){--mds-input-icon-color:21, 119, 151;--mds-input-variant-color:25, 143, 182;}:host([variant=success]){--mds-input-icon-color:26, 151, 91;--mds-input-variant-color:0, 0, 0}:host([variant=success]:focus){--mds-input-icon-color:22, 125, 76;--mds-input-variant-color:26, 151, 91;}:host([variant=warning]){--mds-input-icon-color:168, 126, 0;--mds-input-variant-color:0, 0, 0}:host([variant=warning]:focus){--mds-input-icon-color:139, 104, 0;--mds-input-variant-color:168, 126, 0;}:host([variant=error]){--mds-input-icon-color:234, 77, 73;--mds-input-variant-color:0, 0, 0}:host([variant=error]:focus){--mds-input-icon-color:215, 29, 25;--mds-input-variant-color:234, 77, 73;}";var MdsInput=function(){function t(t){var i=this;registerInstance(this,t);this.changeEvent=createEvent(this,"mdsInputChange",7);this.keyDownEvent=createEvent(this,"mdsInputKeydown",7);this.blurEvent=createEvent(this,"mdsInputBlur",7);this.focusEvent=createEvent(this,"mdsInputFocus",7);this.onInput=function(t){var o=t.target;if(o){i.value=o.value||""}i.keyDownEvent.emit(t)};this.onBlur=function(){i.hasFocus=false;i.blurEvent.emit()};this.onFocus=function(t){var o=t.target;i.hasFocus=true;i.focusEvent.emit();if(i.readonly){setTimeout((function(){o.select()}),10)}};this.hasFocus=false;this.autocomplete="off";this.autofocus=false;this.datalist=undefined;this.disabled=false;this.icon=undefined;this.max=undefined;this.maxlength=undefined;this.min=undefined;this.minlength=undefined;this.name=undefined;this.pattern=undefined;this.placeholder=undefined;this.readonly=false;this.required=false;this.variant=undefined;this.tip=undefined;this.step=undefined;this.type="text";this.value=""}t.prototype.componentWillLoad=function(){if(this.el.hasAttribute("tabindex")){var t=this.el.getAttribute("tabindex");this.tabindex=t!==null?parseInt(t):undefined;this.el.removeAttribute("tabindex")}};t.prototype.valueChanged=function(){this.changeEvent.emit({value:this.value===null?this.value:this.value.toString()})};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.nativeInput!==null){this.nativeInput.focus()}return[2]}))}))};t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)};t.prototype.getValue=function(){return typeof this.value==="number"?this.value.toString():(this.value||"").toString()};t.prototype.render=function(){var t=this;var i=this.getValue();return h(Host,null,this.type==="textarea"?h("textarea",{class:clsx("input",this.icon&&"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,placeholder:this.placeholder||"",readOnly:this.readonly,ref:function(i){return t.nativeInput=i},required:this.required,tabIndex:this.tabindex,value:i}):h("input",{class:clsx("input",this.icon&&"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",placeholder:this.placeholder||"",readOnly:this.readonly,ref:function(i){return t.nativeInput=i},required:this.required,step:this.step,tabIndex:this.tabindex,type:this.type,value:i}),this.disabled&&h("mds-text",{typography:"option",class:"tip top-1 disabled"},"Disabilitato"),this.readonly&&!this.disabled&&h("mds-text",{typography:"option",class:"tip top-1 read-only"},"Sola lettura"),this.required&&!this.disabled&&!this.readonly&&h("mds-text",{typography:"option",class:"tip top-1 required"},"Obbligatorio"),this.tip&&h("mds-text",{typography:"option",class:clsx("tip bottom-1",this.variant&&"tip-variant")},this.tip),this.datalist&&h("datalist",{id:"datalist",class:"datalist"},this.datalist.forEach((function(t){h("option",{value:t})}))),this.icon&&h("mds-icon",{class:clsx("icon",this.variant),name:this.icon}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return t}();MdsInput.style=mdsInputCss;export{MdsInput as mds_input};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as promiseResolve,b as bootstrapLazy}from"./index-
|
|
1
|
+
import{p as promiseResolve,b as bootstrapLazy}from"./index-9c3f6f0d.js";export{s as setNonce}from"./index-9c3f6f0d.js";var patchBrowser=function(){var e=import.meta.url;var t={};if(e!==""){t.resourcesUrl=new URL(".",e).href}return promiseResolve(t)};patchBrowser().then((function(e){return bootstrapLazy([["mds-input",[[1,"mds-input",{autocomplete:[1],autofocus:[4],datalist:[16],disabled:[4],icon:[1],max:[2],maxlength:[2],min:[1],minlength:[2],name:[1],pattern:[1],placeholder:[1],readonly:[4],required:[4],variant:[513],tip:[1],step:[1],type:[1],value:[8],hasFocus:[32],setFocus:[64],getInputElement:[64]}]]]],e)}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-
|
|
1
|
+
import{p as e,b as t}from"./p-4793cf7a.js";export{s as setNonce}from"./p-4793cf7a.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-620792a0",[[1,"mds-input",{autocomplete:[1],autofocus:[4],datalist:[16],disabled:[4],icon:[1],max:[2],maxlength:[2],min:[1],minlength:[2],name:[1],pattern:[1],placeholder:[1],readonly:[4],required:[4],variant:[513],tip:[1],step:[1],type:[1],value:[8],hasFocus:[32],setFocus:[64],getInputElement:[64]}]]]],e)));
|
|
@@ -115,7 +115,7 @@ DOMTokenList
|
|
|
115
115
|
var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
|
|
116
116
|
var start = function() {
|
|
117
117
|
// if src is not present then origin is "null", and new URL() throws TypeError: Failed to construct 'URL': Invalid base URL
|
|
118
|
-
var url = new URL('./p-
|
|
118
|
+
var url = new URL('./p-bd99984b.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
|
|
119
119
|
System.import(url.href);
|
|
120
120
|
};
|
|
121
121
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,i,o,r){function n(t){return t instanceof o?t:new o((function(i){i(t)}))}return new(o||(o=Promise))((function(o,e){function a(t){try{c(r.next(t))}catch(t){e(t)}}function s(t){try{c(r["throw"](t))}catch(t){e(t)}}function c(t){t.done?o(t.value):n(t.value).then(a,s)}c((r=r.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var o={label:0,sent:function(){if(e[0]&1)throw e[1];return e[1]},trys:[],ops:[]},r,n,e,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(i){return c([t,i])}}function c(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(r=1,n&&(e=s[0]&2?n["return"]:s[0]?n["throw"]||((e=n["return"])&&e.call(n),0):n.next)&&!(e=e.call(n,s[1])).done)return e;if(n=0,e)s=[s[0]&2,e.value];switch(s[0]){case 0:case 1:e=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(e=o.trys,e=e.length>0&&e[e.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!e||s[1]>e[0]&&s[1]<e[3])){o.label=s[1];break}if(s[0]===6&&o.label<e[1]){o.label=e[1];e=s;break}if(e&&o.label<e[2]){o.label=e[2];o.ops.push(s);break}if(e[2])o.ops.pop();o.trys.pop();continue}s=i.call(t,o)}catch(t){s=[6,t];n=0}finally{r=e=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-a8418869.system.js"],(function(t){"use strict";var i,o,r,n,e;return{setters:[function(t){i=t.r;o=t.c;r=t.h;n=t.H;e=t.g}],execute:function(){function a(t){var i,o,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(i=0;i<t.length;i++)t[i]&&(o=a(t[i]))&&(r&&(r+=" "),r+=o);else for(i in t)t[i]&&(r&&(r+=" "),r+=i);return r}function s(){for(var t,i,o=0,r="";o<arguments.length;)(t=arguments[o++])&&(i=a(t))&&(r&&(r+=" "),r+=i);return r}var c="*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}@tailwind utilities; :host{--mds-input-background:rgb(var(--tone-neutral));--mds-input-icon-color:var(--mds-input-variant-color);--mds-input-tip-background:84, 84, 84;--mds-input-ring:0 0 0 1px rgba(var(--mds-input-variant-color), 0.1);--mds-input-shadow:0 1px 3px 0 rgba(var(--mds-input-variant-color), 0.1), 0 1px 2px 0 rgba(var(--mds-input-variant-color), 0.06);--mds-input-variant-color:0, 0, 0;font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:relative;display:-ms-flexbox;display:flex}.input{font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0px;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:3rem;width:100%;overflow:hidden;text-overflow:ellipsis;border-radius:0.5rem;border-style:none;border-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;--tw-text-opacity:1;color:rgba(var(--tone-neutral-02), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);background-color:var(--mds-input-background);-webkit-box-shadow:var(--mds-input-ring), var(--mds-input-shadow);box-shadow:var(--mds-input-ring), var(--mds-input-shadow)}textarea.input:active{-webkit-transition-property:none;transition-property:none}textarea.input{max-height:16rem;min-height:6rem;border-bottom-right-radius:0px}.input:focus{outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);--mds-input-ring:0 0 0 3px rgba(var(--mds-input-variant-color), 1);--mds-input-shadow:0 4px 6px -1px rgba(var(--mds-input-variant-color), 0.1), 0 2px 4px -1px rgba(var(--mds-input-variant-color), 0.06)}.input:disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-10), var(--tw-bg-opacity))}.input:disabled::-moz-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled::-webkit-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled:-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled::-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled,.input:disabled::placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.has-icon{padding-left:2.75rem}.tip{pointer-events:none;position:absolute;right:0.25rem;height:0.75rem;-ms-flex-pack:center;justify-content:center;border-radius:9999px;padding-left:0.5rem;padding-right:0.5rem;text-align:center;--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);line-height:0.75rem;background-color:rgb(var(--mds-input-tip-background))}.tip-variant{--mds-input-tip-background:var(--mds-input-icon-color)}.read-only{--tw-bg-opacity:1;background-color:rgba(var(--status-info-05), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--status-info-09), var(--tw-text-opacity))}.required{width:0.75rem;--tw-bg-opacity:1;background-color:rgba(var(--status-error-05), var(--tw-bg-opacity));padding:0px;color:rgba(var(--tone-neutral), var(--tw-text-opacity));--tw-text-opacity:0}.disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-05), var(--tw-bg-opacity))}.input:focus+.required{width:6rem;--tw-text-opacity:1}.icon{position:absolute;left:0.75rem;top:0.75rem;fill:rgb(var(--mds-input-icon-color))}.fixed{position:fixed}.absolute{position:absolute}.top-1{top:0.25rem}.bottom-1{bottom:0.25rem}.flex{display:-ms-flexbox;display:flex}.w-min{width:-moz-min-content;width:-webkit-min-content;width:min-content}.flex-col{-ms-flex-direction:column;flex-direction:column}.gap-y-2{row-gap:0.5rem}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-input-icon-color:10, 80, 212;--mds-input-variant-color:0, 0, 0}:host(:focus){--mds-input-variant-color:31, 101, 232;}:host([variant=info]){--mds-input-icon-color:25, 143, 182;--mds-input-variant-color:0, 0, 0}:host([variant=info]:focus){--mds-input-icon-color:21, 119, 151;--mds-input-variant-color:25, 143, 182;}:host([variant=success]){--mds-input-icon-color:26, 151, 91;--mds-input-variant-color:0, 0, 0}:host([variant=success]:focus){--mds-input-icon-color:22, 125, 76;--mds-input-variant-color:26, 151, 91;}:host([variant=warning]){--mds-input-icon-color:168, 126, 0;--mds-input-variant-color:0, 0, 0}:host([variant=warning]:focus){--mds-input-icon-color:139, 104, 0;--mds-input-variant-color:168, 126, 0;}:host([variant=error]){--mds-input-icon-color:234, 77, 73;--mds-input-variant-color:0, 0, 0}:host([variant=error]:focus){--mds-input-icon-color:215, 29, 25;--mds-input-variant-color:234, 77, 73;}";var l=t("mds_input",function(){function t(t){var r=this;i(this,t);this.changeEvent=o(this,"changeEvent",7);this.keyDownEvent=o(this,"keyDownEvent",7);this.blurEvent=o(this,"blurEvent",7);this.focusEvent=o(this,"focusEvent",7);this.onInput=function(t){var i=t.target;if(i){r.value=i.value||""}r.keyDownEvent.emit(t)};this.onBlur=function(){r.hasFocus=false;r.blurEvent.emit()};this.onFocus=function(t){var i=t.target;r.hasFocus=true;r.focusEvent.emit();if(r.readonly){setTimeout((function(){i.select()}),10)}};this.hasFocus=false;this.autocomplete="off";this.autofocus=false;this.datalist=undefined;this.disabled=false;this.icon=undefined;this.max=undefined;this.maxlength=undefined;this.min=undefined;this.minlength=undefined;this.name=undefined;this.pattern=undefined;this.placeholder=undefined;this.readonly=false;this.required=false;this.variant=undefined;this.tip=undefined;this.step=undefined;this.type="text";this.value=""}t.prototype.componentWillLoad=function(){if(this.el.hasAttribute("tabindex")){var t=this.el.getAttribute("tabindex");this.tabindex=t!==null?parseInt(t):undefined;this.el.removeAttribute("tabindex")}};t.prototype.valueChanged=function(){this.changeEvent.emit({value:this.value===null?this.value:this.value.toString()})};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.nativeInput!==null){this.nativeInput.focus()}return[2]}))}))};t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)};t.prototype.getValue=function(){return typeof this.value==="number"?this.value.toString():(this.value||"").toString()};t.prototype.render=function(){var t=this;var i=this.getValue();return r(n,null,this.type==="textarea"?r("textarea",{class:s("input",this.icon&&"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,placeholder:this.placeholder||"",readOnly:this.readonly,ref:function(i){return t.nativeInput=i},required:this.required,tabIndex:this.tabindex,value:i}):r("input",{class:s("input",this.icon&&"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",placeholder:this.placeholder||"",readOnly:this.readonly,ref:function(i){return t.nativeInput=i},required:this.required,step:this.step,tabIndex:this.tabindex,type:this.type,value:i}),this.disabled&&r("mds-text",{typography:"option",class:"tip top-1 disabled"},"Disabilitato"),this.readonly&&!this.disabled&&r("mds-text",{typography:"option",class:"tip top-1 read-only"},"Sola lettura"),this.required&&!this.disabled&&!this.readonly&&r("mds-text",{typography:"option",class:"tip top-1 required"},"Obbligatorio"),this.tip&&r("mds-text",{typography:"option",class:s("tip bottom-1",this.variant&&"tip-variant")},this.tip),this.datalist&&r("datalist",{id:"datalist",class:"datalist"},this.datalist.forEach((function(t){r("option",{value:t})}))),this.icon&&r("mds-icon",{class:s("icon",this.variant),name:this.icon}))};Object.defineProperty(t.prototype,"el",{get:function(){return e(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return t}());l.style=c}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,i,o,r){function n(t){return t instanceof o?t:new o((function(i){i(t)}))}return new(o||(o=Promise))((function(o,e){function a(t){try{c(r.next(t))}catch(t){e(t)}}function s(t){try{c(r["throw"](t))}catch(t){e(t)}}function c(t){t.done?o(t.value):n(t.value).then(a,s)}c((r=r.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var o={label:0,sent:function(){if(e[0]&1)throw e[1];return e[1]},trys:[],ops:[]},r,n,e,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(i){return c([t,i])}}function c(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(r=1,n&&(e=s[0]&2?n["return"]:s[0]?n["throw"]||((e=n["return"])&&e.call(n),0):n.next)&&!(e=e.call(n,s[1])).done)return e;if(n=0,e)s=[s[0]&2,e.value];switch(s[0]){case 0:case 1:e=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(e=o.trys,e=e.length>0&&e[e.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!e||s[1]>e[0]&&s[1]<e[3])){o.label=s[1];break}if(s[0]===6&&o.label<e[1]){o.label=e[1];e=s;break}if(e&&o.label<e[2]){o.label=e[2];o.ops.push(s);break}if(e[2])o.ops.pop();o.trys.pop();continue}s=i.call(t,o)}catch(t){s=[6,t];n=0}finally{r=e=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-d37ad585.system.js"],(function(t){"use strict";var i,o,r,n,e;return{setters:[function(t){i=t.r;o=t.c;r=t.h;n=t.H;e=t.g}],execute:function(){function a(t){var i,o,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(i=0;i<t.length;i++)t[i]&&(o=a(t[i]))&&(r&&(r+=" "),r+=o);else for(i in t)t[i]&&(r&&(r+=" "),r+=i);return r}function s(){for(var t,i,o=0,r="";o<arguments.length;)(t=arguments[o++])&&(i=a(t))&&(r&&(r+=" "),r+=i);return r}var c="*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}@tailwind utilities; :host{--mds-input-background:rgb(var(--tone-neutral));--mds-input-icon-color:var(--mds-input-variant-color);--mds-input-tip-background:84, 84, 84;--mds-input-ring:0 0 0 1px rgba(var(--mds-input-variant-color), 0.1);--mds-input-shadow:0 1px 3px 0 rgba(var(--mds-input-variant-color), 0.1), 0 1px 2px 0 rgba(var(--mds-input-variant-color), 0.06);--mds-input-variant-color:0, 0, 0;font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:relative;display:-ms-flexbox;display:flex}.input{font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0px;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:3rem;width:100%;overflow:hidden;text-overflow:ellipsis;border-radius:0.5rem;border-style:none;border-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;--tw-text-opacity:1;color:rgba(var(--tone-neutral-02), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);background-color:var(--mds-input-background);-webkit-box-shadow:var(--mds-input-ring), var(--mds-input-shadow);box-shadow:var(--mds-input-ring), var(--mds-input-shadow)}textarea.input:active{-webkit-transition-property:none;transition-property:none}textarea.input{max-height:16rem;min-height:6rem;border-bottom-right-radius:0px}.input:focus{outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);--mds-input-ring:0 0 0 3px rgba(var(--mds-input-variant-color), 1);--mds-input-shadow:0 4px 6px -1px rgba(var(--mds-input-variant-color), 0.1), 0 2px 4px -1px rgba(var(--mds-input-variant-color), 0.06)}.input:disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-10), var(--tw-bg-opacity))}.input:disabled::-moz-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled::-webkit-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled:-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled::-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled,.input:disabled::placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.has-icon{padding-left:2.75rem}.tip{pointer-events:none;position:absolute;right:0.25rem;height:0.75rem;-ms-flex-pack:center;justify-content:center;border-radius:9999px;padding-left:0.5rem;padding-right:0.5rem;text-align:center;--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);line-height:0.75rem;background-color:rgb(var(--mds-input-tip-background))}.tip-variant{--mds-input-tip-background:var(--mds-input-icon-color)}.read-only{--tw-bg-opacity:1;background-color:rgba(var(--status-info-05), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--status-info-09), var(--tw-text-opacity))}.required{width:0.75rem;--tw-bg-opacity:1;background-color:rgba(var(--status-error-05), var(--tw-bg-opacity));padding:0px;color:rgba(var(--tone-neutral), var(--tw-text-opacity));--tw-text-opacity:0}.disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-05), var(--tw-bg-opacity))}.input:focus+.required{width:6rem;--tw-text-opacity:1}.icon{position:absolute;left:0.75rem;top:0.75rem;fill:rgb(var(--mds-input-icon-color))}.fixed{position:fixed}.absolute{position:absolute}.top-1{top:0.25rem}.bottom-1{bottom:0.25rem}.flex{display:-ms-flexbox;display:flex}.w-min{width:-moz-min-content;width:-webkit-min-content;width:min-content}.flex-col{-ms-flex-direction:column;flex-direction:column}.gap-y-2{row-gap:0.5rem}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-input-icon-color:10, 80, 212;--mds-input-variant-color:0, 0, 0}:host(:focus){--mds-input-variant-color:31, 101, 232;}:host([variant=info]){--mds-input-icon-color:25, 143, 182;--mds-input-variant-color:0, 0, 0}:host([variant=info]:focus){--mds-input-icon-color:21, 119, 151;--mds-input-variant-color:25, 143, 182;}:host([variant=success]){--mds-input-icon-color:26, 151, 91;--mds-input-variant-color:0, 0, 0}:host([variant=success]:focus){--mds-input-icon-color:22, 125, 76;--mds-input-variant-color:26, 151, 91;}:host([variant=warning]){--mds-input-icon-color:168, 126, 0;--mds-input-variant-color:0, 0, 0}:host([variant=warning]:focus){--mds-input-icon-color:139, 104, 0;--mds-input-variant-color:168, 126, 0;}:host([variant=error]){--mds-input-icon-color:234, 77, 73;--mds-input-variant-color:0, 0, 0}:host([variant=error]:focus){--mds-input-icon-color:215, 29, 25;--mds-input-variant-color:234, 77, 73;}";var l=t("mds_input",function(){function t(t){var r=this;i(this,t);this.changeEvent=o(this,"mdsInputChange",7);this.keyDownEvent=o(this,"mdsInputKeydown",7);this.blurEvent=o(this,"mdsInputBlur",7);this.focusEvent=o(this,"mdsInputFocus",7);this.onInput=function(t){var i=t.target;if(i){r.value=i.value||""}r.keyDownEvent.emit(t)};this.onBlur=function(){r.hasFocus=false;r.blurEvent.emit()};this.onFocus=function(t){var i=t.target;r.hasFocus=true;r.focusEvent.emit();if(r.readonly){setTimeout((function(){i.select()}),10)}};this.hasFocus=false;this.autocomplete="off";this.autofocus=false;this.datalist=undefined;this.disabled=false;this.icon=undefined;this.max=undefined;this.maxlength=undefined;this.min=undefined;this.minlength=undefined;this.name=undefined;this.pattern=undefined;this.placeholder=undefined;this.readonly=false;this.required=false;this.variant=undefined;this.tip=undefined;this.step=undefined;this.type="text";this.value=""}t.prototype.componentWillLoad=function(){if(this.el.hasAttribute("tabindex")){var t=this.el.getAttribute("tabindex");this.tabindex=t!==null?parseInt(t):undefined;this.el.removeAttribute("tabindex")}};t.prototype.valueChanged=function(){this.changeEvent.emit({value:this.value===null?this.value:this.value.toString()})};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.nativeInput!==null){this.nativeInput.focus()}return[2]}))}))};t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)};t.prototype.getValue=function(){return typeof this.value==="number"?this.value.toString():(this.value||"").toString()};t.prototype.render=function(){var t=this;var i=this.getValue();return r(n,null,this.type==="textarea"?r("textarea",{class:s("input",this.icon&&"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,placeholder:this.placeholder||"",readOnly:this.readonly,ref:function(i){return t.nativeInput=i},required:this.required,tabIndex:this.tabindex,value:i}):r("input",{class:s("input",this.icon&&"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",placeholder:this.placeholder||"",readOnly:this.readonly,ref:function(i){return t.nativeInput=i},required:this.required,step:this.step,tabIndex:this.tabindex,type:this.type,value:i}),this.disabled&&r("mds-text",{typography:"option",class:"tip top-1 disabled"},"Disabilitato"),this.readonly&&!this.disabled&&r("mds-text",{typography:"option",class:"tip top-1 read-only"},"Sola lettura"),this.required&&!this.disabled&&!this.readonly&&r("mds-text",{typography:"option",class:"tip top-1 required"},"Obbligatorio"),this.tip&&r("mds-text",{typography:"option",class:s("tip bottom-1",this.variant&&"tip-variant")},this.tip),this.datalist&&r("datalist",{id:"datalist",class:"datalist"},this.datalist.forEach((function(t){r("option",{value:t})}))),this.icon&&r("mds-icon",{class:s("icon",this.variant),name:this.icon}))};Object.defineProperty(t.prototype,"el",{get:function(){return e(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return t}());l.style=c}}}));
|