@maggioli-design-system/mds-input 3.1.0 → 4.1.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 +14 -13
- package/dist/cjs/mds-input.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/common/aria.js +4 -2
- package/dist/collection/common/keyboard-manager.js +40 -0
- package/dist/collection/components/mds-input/mds-input.css +14 -13
- package/dist/collection/components/mds-input/mds-input.js +37 -35
- package/dist/collection/dictionary/icon.js +3 -1
- package/dist/collection/dictionary/typography.js +5 -1
- package/dist/components/mds-input.js +13 -12
- package/dist/documentation.d.ts +148 -0
- package/dist/documentation.json +538 -0
- 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 +14 -13
- 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/dist/mds-input/p-0ce87563.system.entry.js +1 -0
- package/dist/mds-input/{p-ea0e5d94.system.js → p-0df4ae5e.system.js} +1 -1
- package/dist/mds-input/p-ec40321d.entry.js +1 -0
- package/dist/stats.json +105 -100
- package/dist/types/common/keyboard-manager.d.ts +11 -0
- package/dist/types/components/mds-input/meta/interfaces.d.ts +1 -1
- package/dist/types/components.d.ts +10 -10
- package/dist/types/dictionary/icon.d.ts +2 -1
- package/dist/types/dictionary/typography.d.ts +2 -1
- package/dist/types/interface/input-value.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +11 -0
- package/dist/types/{types → type}/typography.d.ts +1 -0
- package/documentation.json +552 -0
- package/package.json +12 -6
- package/readme.md +27 -27
- package/src/common/aria.ts +2 -2
- package/src/common/keyboard-manager.ts +46 -0
- package/src/components/mds-input/css/mds-input-variant.css +10 -9
- package/src/components/mds-input/mds-input.tsx +17 -17
- package/src/components/mds-input/meta/interfaces.ts +1 -1
- package/src/components/mds-input/readme.md +27 -27
- package/src/components/mds-input/test/mds-input.stories.mdx +2 -3
- package/src/components/mds-input/test/mds-input.stories.tsx +4 -4
- package/src/components.d.ts +10 -10
- package/src/dictionary/icon.ts +4 -0
- package/src/dictionary/typography.ts +9 -3
- package/src/fixtures/icons.json +175 -0
- package/src/fixtures/iconsauce.json +175 -0
- package/src/interface/input-value.ts +1 -1
- 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/www/build/p-0ce87563.system.entry.js +1 -0
- package/www/build/{p-ea0e5d94.system.js → p-0df4ae5e.system.js} +1 -1
- package/www/build/p-ec40321d.entry.js +1 -0
- package/dist/mds-input/p-cd95c097.system.entry.js +0 -1
- package/dist/mds-input/p-d46ae44e.entry.js +0 -1
- package/www/build/p-cd95c097.system.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.3 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -2,23 +2,23 @@
|
|
|
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
|
|
|
9
|
-
const 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}.
|
|
9
|
+
const 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}.bottom-1{bottom:0.25rem}.top-1{top: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;}";
|
|
10
10
|
|
|
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) {
|
|
21
|
-
this.value = input.value
|
|
21
|
+
this.value = input.value;
|
|
22
22
|
}
|
|
23
23
|
this.keyDownEvent.emit(ev);
|
|
24
24
|
};
|
|
@@ -50,7 +50,7 @@ const MdsInput = class {
|
|
|
50
50
|
this.minlength = undefined;
|
|
51
51
|
this.name = undefined;
|
|
52
52
|
this.pattern = undefined;
|
|
53
|
-
this.placeholder =
|
|
53
|
+
this.placeholder = '';
|
|
54
54
|
this.readonly = false;
|
|
55
55
|
this.required = false;
|
|
56
56
|
this.variant = undefined;
|
|
@@ -73,7 +73,7 @@ const MdsInput = class {
|
|
|
73
73
|
* Emits the change event when the component value changes
|
|
74
74
|
*/
|
|
75
75
|
valueChanged() {
|
|
76
|
-
this.changeEvent.emit({ value: this.value
|
|
76
|
+
this.changeEvent.emit({ value: this.value });
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Sets focus on the specified `my-input`.
|
|
@@ -81,7 +81,7 @@ const MdsInput = class {
|
|
|
81
81
|
* of the global `input.focus()`.
|
|
82
82
|
*/
|
|
83
83
|
async setFocus() {
|
|
84
|
-
if (this.nativeInput
|
|
84
|
+
if (this.nativeInput) {
|
|
85
85
|
this.nativeInput.focus();
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -93,13 +93,14 @@ const MdsInput = class {
|
|
|
93
93
|
return Promise.resolve(this.nativeInput);
|
|
94
94
|
}
|
|
95
95
|
getValue() {
|
|
96
|
-
|
|
96
|
+
var _a;
|
|
97
|
+
return typeof this.value === 'number' ? this.value.toString() : (_a = this.value) !== null && _a !== void 0 ? _a : '';
|
|
97
98
|
}
|
|
98
99
|
render() {
|
|
99
100
|
const value = this.getValue();
|
|
100
101
|
return (index.h(index.Host, null, this.type === 'textarea'
|
|
101
|
-
? index.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
|
|
102
|
-
: index.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
|
|
102
|
+
? index.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: input => (this.nativeInput = input), required: this.required, tabIndex: this.tabindex, value: value })
|
|
103
|
+
: index.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: input => (this.nativeInput = input), required: this.required, step: this.step, tabIndex: this.tabindex, type: this.type, value: value }), this.disabled && index.h("mds-text", { typography: "option", class: "tip top-1 disabled" }, "Disabilitato"), this.readonly && !this.disabled && index.h("mds-text", { typography: "option", class: "tip top-1 read-only" }, "Sola lettura"), this.required && !this.disabled && !this.readonly && index.h("mds-text", { typography: "option", class: "tip top-1 required" }, "Obbligatorio"), this.tip && index.h("mds-text", { typography: "option", class: clsx('tip bottom-1', this.variant && 'tip-variant') }, this.tip), this.datalist &&
|
|
103
104
|
index.h("datalist", { id: "datalist", class: "datalist" }, this.datalist.forEach(element => {
|
|
104
105
|
index.h("option", { value: element });
|
|
105
106
|
})), this.icon && index.h("mds-icon", { class: clsx('icon', this.variant), name: this.icon })));
|
|
@@ -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.3 | 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));
|
|
@@ -6,11 +6,13 @@ const hash = (s) => {
|
|
|
6
6
|
return h.toString();
|
|
7
7
|
};
|
|
8
8
|
const unslugName = (name) => {
|
|
9
|
-
|
|
9
|
+
var _a, _b, _c;
|
|
10
|
+
return (_c = (_b = (_a = name.split('/')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.replace(/-/g, ' ')) !== null && _c !== void 0 ? _c : name;
|
|
10
11
|
};
|
|
11
12
|
const setAttributeIfEmpty = (element, attribute, value) => {
|
|
13
|
+
var _a;
|
|
12
14
|
if (element.hasAttribute(attribute)) {
|
|
13
|
-
return element.getAttribute(attribute);
|
|
15
|
+
return (_a = element.getAttribute(attribute)) !== null && _a !== void 0 ? _a : '';
|
|
14
16
|
}
|
|
15
17
|
element.setAttribute(attribute, value);
|
|
16
18
|
return value;
|
|
@@ -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 = () => { return; };
|
|
35
|
+
if (typeof window !== undefined) {
|
|
36
|
+
window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -421,14 +421,14 @@ textarea.input{
|
|
|
421
421
|
position: absolute;
|
|
422
422
|
}
|
|
423
423
|
|
|
424
|
-
.
|
|
424
|
+
.bottom-1{
|
|
425
425
|
|
|
426
|
-
|
|
426
|
+
bottom: 0.25rem;
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
-
.
|
|
429
|
+
.top-1{
|
|
430
430
|
|
|
431
|
-
|
|
431
|
+
top: 0.25rem;
|
|
432
432
|
}
|
|
433
433
|
|
|
434
434
|
.flex{
|
|
@@ -468,58 +468,59 @@ textarea.input{
|
|
|
468
468
|
}
|
|
469
469
|
|
|
470
470
|
:host {
|
|
471
|
+
|
|
471
472
|
--mds-input-icon-color: 10, 80, 212; /* brand-maggioli-03 */
|
|
472
473
|
--mds-input-variant-color: 0, 0, 0;
|
|
473
474
|
}
|
|
474
475
|
|
|
475
|
-
:host
|
|
476
|
+
:host( :focus ) {
|
|
476
477
|
|
|
477
478
|
--mds-input-variant-color: 31, 101, 232; /* brand-maggioli-04 */
|
|
478
479
|
}
|
|
479
480
|
|
|
480
|
-
:host
|
|
481
|
+
:host( [variant="info"] ) {
|
|
481
482
|
|
|
482
483
|
--mds-input-icon-color: 25, 143, 182; /* status-info-05 */
|
|
483
484
|
--mds-input-variant-color: 0, 0, 0;
|
|
484
485
|
}
|
|
485
486
|
|
|
486
|
-
:host
|
|
487
|
+
:host( [variant="info"]:focus ) {
|
|
487
488
|
|
|
488
489
|
--mds-input-icon-color: 21, 119, 151; /* status-info-04 */
|
|
489
490
|
--mds-input-variant-color: 25, 143, 182; /* status-info-05 */
|
|
490
491
|
}
|
|
491
492
|
|
|
492
|
-
:host
|
|
493
|
+
:host( [variant="success"] ) {
|
|
493
494
|
|
|
494
495
|
--mds-input-icon-color: 26, 151, 91; /* status-success-05 */
|
|
495
496
|
--mds-input-variant-color: 0, 0, 0;
|
|
496
497
|
}
|
|
497
498
|
|
|
498
|
-
:host
|
|
499
|
+
:host( [variant="success"]:focus ) {
|
|
499
500
|
|
|
500
501
|
--mds-input-icon-color: 22, 125, 76; /* status-success-04 */
|
|
501
502
|
--mds-input-variant-color: 26, 151, 91; /* status-success-05 */
|
|
502
503
|
}
|
|
503
504
|
|
|
504
|
-
:host
|
|
505
|
+
:host( [variant="warning"] ) {
|
|
505
506
|
|
|
506
507
|
--mds-input-icon-color: 168, 126, 0; /* status-warning-05 */
|
|
507
508
|
--mds-input-variant-color: 0, 0, 0;
|
|
508
509
|
}
|
|
509
510
|
|
|
510
|
-
:host
|
|
511
|
+
:host( [variant="warning"]:focus ) {
|
|
511
512
|
|
|
512
513
|
--mds-input-icon-color: 139, 104, 0; /* status-warning-04 */
|
|
513
514
|
--mds-input-variant-color: 168, 126, 0; /* status-warning-05 */
|
|
514
515
|
}
|
|
515
516
|
|
|
516
|
-
:host
|
|
517
|
+
:host( [variant="error"] ) {
|
|
517
518
|
|
|
518
519
|
--mds-input-icon-color: 234, 77, 73; /* status-error-05 */
|
|
519
520
|
--mds-input-variant-color: 0, 0, 0;
|
|
520
521
|
}
|
|
521
522
|
|
|
522
|
-
:host
|
|
523
|
+
:host( [variant="error"]:focus ) {
|
|
523
524
|
|
|
524
525
|
--mds-input-icon-color: 215, 29, 25; /* status-error-04 */
|
|
525
526
|
--mds-input-variant-color: 234, 77, 73; /* status-error-05 */
|