@maggioli-design-system/mds-input 4.0.0 → 4.2.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-e46754eb.js → index-3097681c.js} +182 -36
- package/dist/cjs/loader.cjs.js +2 -11
- package/dist/cjs/mds-input.cjs.entry.js +10 -9
- package/dist/cjs/mds-input.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/common/aria.js +4 -2
- package/dist/collection/common/keyboard-manager.js +1 -1
- package/dist/collection/common/unit.js +10 -0
- package/dist/collection/components/mds-input/mds-input.css +28 -15
- package/dist/collection/components/mds-input/mds-input.js +51 -39
- package/dist/collection/components/mds-input/test/mds-input.e2e.js +10 -0
- package/dist/collection/components/mds-input/test/mds-input.stories.js +6 -6
- package/dist/collection/dictionary/button.js +5 -1
- package/dist/collection/dictionary/icon.js +2 -2
- package/dist/collection/dictionary/variant.js +9 -1
- package/dist/components/index.d.ts +5 -3
- package/dist/components/index.js +1 -2
- package/dist/components/mds-input.js +10 -9
- package/dist/documentation.d.ts +421 -0
- package/dist/documentation.json +745 -0
- package/dist/esm/{index-9c3f6f0d.js → index-e22ac7e3.js} +182 -36
- package/dist/esm/loader.js +3 -12
- package/dist/esm/mds-input.entry.js +10 -9
- package/dist/esm/mds-input.js +3 -3
- package/dist/esm-es5/index-e22ac7e3.js +2 -0
- 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 +2 -6
- package/dist/mds-input/p-228b0fab.system.js +2 -0
- package/dist/mds-input/p-2ccb5a3f.system.entry.js +1 -0
- package/dist/mds-input/{p-bd99984b.system.js → p-34c8c829.system.js} +1 -1
- package/dist/mds-input/{p-620792a0.entry.js → p-4111271f.entry.js} +1 -1
- package/dist/mds-input/p-c226a52a.js +2 -0
- package/dist/stats.json +116 -94
- package/dist/types/common/unit.d.ts +2 -0
- package/dist/types/components/mds-input/meta/interfaces.d.ts +1 -1
- package/dist/types/components.d.ts +7 -2
- package/dist/types/dictionary/button.d.ts +2 -1
- package/dist/types/dictionary/variant.d.ts +2 -1
- package/dist/types/interface/input-value.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +32 -17
- package/dist/types/type/button.d.ts +1 -0
- package/dist/types/type/variant.d.ts +1 -0
- package/documentation.json +1074 -0
- package/loader/index.d.ts +2 -2
- package/package.json +12 -6
- package/readme.md +21 -21
- package/src/common/aria.ts +2 -2
- package/src/common/keyboard-manager.ts +1 -1
- package/src/common/unit.ts +14 -0
- package/src/components/mds-input/css/mds-input-variant.css +10 -9
- package/src/components/mds-input/mds-input.tsx +8 -8
- package/src/components/mds-input/meta/interfaces.ts +1 -1
- package/src/components/mds-input/readme.md +21 -21
- 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 +7 -2
- package/src/dictionary/button.ts +7 -1
- package/src/dictionary/variant.ts +10 -0
- package/src/fixtures/icons.json +40 -0
- package/src/fixtures/iconsauce.json +38 -0
- package/src/interface/input-value.ts +1 -1
- package/src/type/button.ts +4 -0
- package/src/type/variant.ts +9 -0
- package/www/build/mds-input.esm.js +1 -1
- package/www/build/mds-input.js +2 -6
- package/www/build/p-228b0fab.system.js +2 -0
- package/www/build/p-2ccb5a3f.system.entry.js +1 -0
- package/www/build/{p-bd99984b.system.js → p-34c8c829.system.js} +1 -1
- package/www/build/{p-620792a0.entry.js → p-4111271f.entry.js} +1 -1
- package/www/build/p-c226a52a.js +2 -0
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm-es5/index-9c3f6f0d.js +0 -2
- package/dist/mds-input/p-22e40cbc.system.entry.js +0 -1
- package/dist/mds-input/p-4793cf7a.js +0 -2
- package/dist/mds-input/p-d37ad585.system.js +0 -2
- package/src/components/mds-input/test/mds-input.spec.tsx +0 -19
- package/www/build/p-22e40cbc.system.entry.js +0 -1
- package/www/build/p-4793cf7a.js +0 -2
- package/www/build/p-d37ad585.system.js +0 -2
|
@@ -58,6 +58,13 @@ const HYDRATED_CSS = '{visibility:hidden}[hydrated]{visibility:inherit}';
|
|
|
58
58
|
*/
|
|
59
59
|
const EMPTY_OBJ = {};
|
|
60
60
|
const isDef = (v) => v != null;
|
|
61
|
+
/**
|
|
62
|
+
* Check whether a value is a 'complex type', defined here as an object or a
|
|
63
|
+
* function.
|
|
64
|
+
*
|
|
65
|
+
* @param o the value to check
|
|
66
|
+
* @returns whether it's a complex type or not
|
|
67
|
+
*/
|
|
61
68
|
const isComplexType = (o) => {
|
|
62
69
|
// https://jsperf.com/typeof-fn-object/5
|
|
63
70
|
o = typeof o;
|
|
@@ -114,6 +121,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
114
121
|
};
|
|
115
122
|
walk(children);
|
|
116
123
|
if (vnodeData) {
|
|
124
|
+
// normalize class / className attributes
|
|
117
125
|
{
|
|
118
126
|
const classData = vnodeData.className || vnodeData.class;
|
|
119
127
|
if (classData) {
|
|
@@ -252,9 +260,9 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
252
260
|
}
|
|
253
261
|
styles.set(scopeId, style);
|
|
254
262
|
};
|
|
255
|
-
const addStyle = (styleContainerNode, cmpMeta, mode
|
|
263
|
+
const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
256
264
|
var _a;
|
|
257
|
-
|
|
265
|
+
const scopeId = getScopeId(cmpMeta);
|
|
258
266
|
const style = styles.get(scopeId);
|
|
259
267
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
260
268
|
// so the fallback is to always use the document for the root node in those cases
|
|
@@ -269,10 +277,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
269
277
|
}
|
|
270
278
|
if (!appliedStyles.has(scopeId)) {
|
|
271
279
|
{
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
styleElm.innerHTML = style;
|
|
275
|
-
}
|
|
280
|
+
styleElm = doc.createElement('style');
|
|
281
|
+
styleElm.innerHTML = style;
|
|
276
282
|
// Apply CSP nonce to the style tag if it exists
|
|
277
283
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
278
284
|
if (nonce != null) {
|
|
@@ -319,6 +325,21 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
|
319
325
|
*
|
|
320
326
|
* Modified for Stencil's compiler and vdom
|
|
321
327
|
*/
|
|
328
|
+
/**
|
|
329
|
+
* When running a VDom render set properties present on a VDom node onto the
|
|
330
|
+
* corresponding HTML element.
|
|
331
|
+
*
|
|
332
|
+
* Note that this function has special functionality for the `class`,
|
|
333
|
+
* `style`, `key`, and `ref` attributes, as well as event handlers (like
|
|
334
|
+
* `onClick`, etc). All others are just passed through as-is.
|
|
335
|
+
*
|
|
336
|
+
* @param elm the HTMLElement onto which attributes should be set
|
|
337
|
+
* @param memberName the name of the attribute to set
|
|
338
|
+
* @param oldValue the old value for the attribute
|
|
339
|
+
* @param newValue the new value for the attribute
|
|
340
|
+
* @param isSvg whether we're in an svg context or not
|
|
341
|
+
* @param flags bitflags for Vdom variables
|
|
342
|
+
*/
|
|
322
343
|
const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
323
344
|
if (oldValue !== newValue) {
|
|
324
345
|
let isProp = isMemberInElement(elm, memberName);
|
|
@@ -523,16 +544,17 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
523
544
|
* @param vnodes a list of virtual DOM nodes to remove
|
|
524
545
|
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
525
546
|
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
526
|
-
* @param vnode a VNode
|
|
527
|
-
* @param elm an element
|
|
528
547
|
*/
|
|
529
|
-
const removeVnodes = (vnodes, startIdx, endIdx
|
|
530
|
-
for (
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
elm
|
|
548
|
+
const removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
549
|
+
for (let index = startIdx; index <= endIdx; ++index) {
|
|
550
|
+
const vnode = vnodes[index];
|
|
551
|
+
if (vnode) {
|
|
552
|
+
const elm = vnode.$elm$;
|
|
553
|
+
nullifyVNodeRefs(vnode);
|
|
554
|
+
if (elm) {
|
|
555
|
+
// remove the vnode's element from the dom
|
|
556
|
+
elm.remove();
|
|
557
|
+
}
|
|
536
558
|
}
|
|
537
559
|
}
|
|
538
560
|
};
|
|
@@ -780,10 +802,17 @@ const patch = (oldVNode, newVNode) => {
|
|
|
780
802
|
elm.data = text;
|
|
781
803
|
}
|
|
782
804
|
};
|
|
783
|
-
|
|
805
|
+
/**
|
|
806
|
+
* 'Nullify' any VDom `ref` callbacks on a VDom node or its children by
|
|
807
|
+
* calling them with `null`. This signals that the DOM element corresponding to
|
|
808
|
+
* the VDom node has been removed from the DOM.
|
|
809
|
+
*
|
|
810
|
+
* @param vNode a virtual DOM node
|
|
811
|
+
*/
|
|
812
|
+
const nullifyVNodeRefs = (vNode) => {
|
|
784
813
|
{
|
|
785
814
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
786
|
-
vNode.$children$ && vNode.$children$.map(
|
|
815
|
+
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
787
816
|
}
|
|
788
817
|
};
|
|
789
818
|
/**
|
|
@@ -797,17 +826,44 @@ const callNodeRefs = (vNode) => {
|
|
|
797
826
|
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
798
827
|
* the DOM node into which it should be rendered.
|
|
799
828
|
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
829
|
+
* @param isInitialLoad whether or not this is the first call after page load
|
|
800
830
|
*/
|
|
801
|
-
const renderVdom = (hostRef, renderFnResults) => {
|
|
831
|
+
const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
802
832
|
const hostElm = hostRef.$hostElement$;
|
|
803
833
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
804
834
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
835
|
+
// if `renderFnResults` is a Host node then we can use it directly. If not,
|
|
836
|
+
// we need to call `h` again to wrap the children of our component in a
|
|
837
|
+
// 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
|
|
838
|
+
// implicitly that the top-level vdom node is 1) an only child and 2)
|
|
839
|
+
// contains attrs that need to be set on the host element.
|
|
805
840
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
806
841
|
hostTagName = hostElm.tagName;
|
|
807
842
|
if (cmpMeta.$attrsToReflect$) {
|
|
808
843
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
809
844
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
810
845
|
}
|
|
846
|
+
// On the first render and *only* on the first render we want to check for
|
|
847
|
+
// any attributes set on the host element which are also set on the vdom
|
|
848
|
+
// node. If we find them, we override the value on the VDom node attrs with
|
|
849
|
+
// the value from the host element, which allows developers building apps
|
|
850
|
+
// with Stencil components to override e.g. the `role` attribute on a
|
|
851
|
+
// component even if it's already set on the `Host`.
|
|
852
|
+
if (isInitialLoad && rootVnode.$attrs$) {
|
|
853
|
+
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
854
|
+
// We have a special implementation in `setAccessor` for `style` and
|
|
855
|
+
// `class` which reconciles values coming from the VDom with values
|
|
856
|
+
// already present on the DOM element, so we don't want to override those
|
|
857
|
+
// attributes on the VDom tree with values from the host element if they
|
|
858
|
+
// are present.
|
|
859
|
+
//
|
|
860
|
+
// Likewise, `ref` and `key` are special internal values for the Stencil
|
|
861
|
+
// runtime and we don't want to override those either.
|
|
862
|
+
if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
|
|
863
|
+
rootVnode.$attrs$[key] = hostElm[key];
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
811
867
|
rootVnode.$tag$ = null;
|
|
812
868
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
813
869
|
hostRef.$vnode$ = rootVnode;
|
|
@@ -838,20 +894,86 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
838
894
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
839
895
|
return writeTask(dispatch) ;
|
|
840
896
|
};
|
|
897
|
+
/**
|
|
898
|
+
* Dispatch initial-render and update lifecycle hooks, enqueuing calls to
|
|
899
|
+
* component lifecycle methods like `componentWillLoad` as well as
|
|
900
|
+
* {@link updateComponent}, which will kick off the virtual DOM re-render.
|
|
901
|
+
*
|
|
902
|
+
* @param hostRef a reference to a host DOM node
|
|
903
|
+
* @param isInitialLoad whether we're on the initial load or not
|
|
904
|
+
* @returns an empty Promise which is used to enqueue a series of operations for
|
|
905
|
+
* the component
|
|
906
|
+
*/
|
|
841
907
|
const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
842
908
|
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
843
909
|
const instance = hostRef.$lazyInstance$ ;
|
|
844
|
-
|
|
910
|
+
// We're going to use this variable together with `enqueue` to implement a
|
|
911
|
+
// little promise-based queue. We start out with it `undefined`. When we add
|
|
912
|
+
// the first function to the queue we'll set this variable to be that
|
|
913
|
+
// function's return value. When we attempt to add subsequent values to the
|
|
914
|
+
// queue we'll check that value and, if it was a `Promise`, we'll then chain
|
|
915
|
+
// the new function off of that `Promise` using `.then()`. This will give our
|
|
916
|
+
// queue two nice properties:
|
|
917
|
+
//
|
|
918
|
+
// 1. If all functions added to the queue are synchronous they'll be called
|
|
919
|
+
// synchronously right away.
|
|
920
|
+
// 2. If all functions added to the queue are asynchronous they'll all be
|
|
921
|
+
// called in order after `dispatchHooks` exits.
|
|
922
|
+
let maybePromise;
|
|
845
923
|
if (isInitialLoad) {
|
|
846
924
|
{
|
|
847
|
-
|
|
925
|
+
// If `componentWillLoad` returns a `Promise` then we want to wait on
|
|
926
|
+
// whatever's going on in that `Promise` before we launch into
|
|
927
|
+
// rendering the component, doing other lifecycle stuff, etc. So
|
|
928
|
+
// in that case we assign the returned promise to the variable we
|
|
929
|
+
// declared above to hold a possible 'queueing' Promise
|
|
930
|
+
maybePromise = safeCall(instance, 'componentWillLoad');
|
|
848
931
|
}
|
|
849
932
|
}
|
|
850
933
|
endSchedule();
|
|
851
|
-
return
|
|
934
|
+
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
852
935
|
};
|
|
936
|
+
/**
|
|
937
|
+
* This function uses a Promise to implement a simple first-in, first-out queue
|
|
938
|
+
* of functions to be called.
|
|
939
|
+
*
|
|
940
|
+
* The queue is ordered on the basis of the first argument. If it's
|
|
941
|
+
* `undefined`, then nothing is on the queue yet, so the provided function can
|
|
942
|
+
* be called synchronously (although note that this function may return a
|
|
943
|
+
* `Promise`). The idea is that then the return value of that enqueueing
|
|
944
|
+
* operation is kept around, so that if it was a `Promise` then subsequent
|
|
945
|
+
* functions can be enqueued by calling this function again with that `Promise`
|
|
946
|
+
* as the first argument.
|
|
947
|
+
*
|
|
948
|
+
* @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
|
|
949
|
+
* @param fn a function to enqueue
|
|
950
|
+
* @returns either a `Promise` or the return value of the provided function
|
|
951
|
+
*/
|
|
952
|
+
const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
|
|
953
|
+
/**
|
|
954
|
+
* Check that a value is a `Promise`. To check, we first see if the value is an
|
|
955
|
+
* instance of the `Promise` global. In a few circumstances, in particular if
|
|
956
|
+
* the global has been overwritten, this is could be misleading, so we also do
|
|
957
|
+
* a little 'duck typing' check to see if the `.then` property of the value is
|
|
958
|
+
* defined and a function.
|
|
959
|
+
*
|
|
960
|
+
* @param maybePromise it might be a promise!
|
|
961
|
+
* @returns whether it is or not
|
|
962
|
+
*/
|
|
963
|
+
const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
|
|
964
|
+
(maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
|
|
965
|
+
/**
|
|
966
|
+
* Update a component given reference to its host elements and so on.
|
|
967
|
+
*
|
|
968
|
+
* @param hostRef an object containing references to the element's host node,
|
|
969
|
+
* VDom nodes, and other metadata
|
|
970
|
+
* @param instance a reference to the underlying host element where it will be
|
|
971
|
+
* rendered
|
|
972
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
973
|
+
* the first render cycle
|
|
974
|
+
*/
|
|
853
975
|
const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
854
|
-
|
|
976
|
+
var _a;
|
|
855
977
|
const elm = hostRef.$hostElement$;
|
|
856
978
|
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
857
979
|
const rc = elm['s-rc'];
|
|
@@ -861,7 +983,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
861
983
|
}
|
|
862
984
|
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
863
985
|
{
|
|
864
|
-
callRender(hostRef, instance);
|
|
986
|
+
callRender(hostRef, instance, elm, isInitialLoad);
|
|
865
987
|
}
|
|
866
988
|
if (rc) {
|
|
867
989
|
// ok, so turns out there are some child host elements
|
|
@@ -873,7 +995,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
873
995
|
endRender();
|
|
874
996
|
endUpdate();
|
|
875
997
|
{
|
|
876
|
-
const childrenPromises = elm['s-p'];
|
|
998
|
+
const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
|
|
877
999
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
878
1000
|
if (childrenPromises.length === 0) {
|
|
879
1001
|
postUpdate();
|
|
@@ -885,7 +1007,19 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
885
1007
|
}
|
|
886
1008
|
}
|
|
887
1009
|
};
|
|
888
|
-
|
|
1010
|
+
/**
|
|
1011
|
+
* Handle making the call to the VDom renderer with the proper context given
|
|
1012
|
+
* various build variables
|
|
1013
|
+
*
|
|
1014
|
+
* @param hostRef an object containing references to the element's host node,
|
|
1015
|
+
* VDom nodes, and other metadata
|
|
1016
|
+
* @param instance a reference to the underlying host element where it will be
|
|
1017
|
+
* rendered
|
|
1018
|
+
* @param elm the Host element for the component
|
|
1019
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
1020
|
+
* @returns an empty promise
|
|
1021
|
+
*/
|
|
1022
|
+
const callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
889
1023
|
try {
|
|
890
1024
|
instance = instance.render() ;
|
|
891
1025
|
{
|
|
@@ -900,7 +1034,7 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
900
1034
|
// or we need to update the css class/attrs on the host element
|
|
901
1035
|
// DOM WRITE!
|
|
902
1036
|
{
|
|
903
|
-
renderVdom(hostRef, instance);
|
|
1037
|
+
renderVdom(hostRef, instance, isInitialLoad);
|
|
904
1038
|
}
|
|
905
1039
|
}
|
|
906
1040
|
}
|
|
@@ -970,9 +1104,6 @@ const safeCall = (instance, method, arg) => {
|
|
|
970
1104
|
}
|
|
971
1105
|
return undefined;
|
|
972
1106
|
};
|
|
973
|
-
const then = (promise, thenFn) => {
|
|
974
|
-
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
975
|
-
};
|
|
976
1107
|
const addHydratedFlag = (elm) => elm.setAttribute('hydrated', '')
|
|
977
1108
|
;
|
|
978
1109
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
@@ -1089,12 +1220,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1089
1220
|
// customElements.define('my-component', MyComponent);
|
|
1090
1221
|
// </script>
|
|
1091
1222
|
// ```
|
|
1092
|
-
// In this case if we do not
|
|
1223
|
+
// In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1093
1224
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1094
1225
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1095
|
-
// the connectedCallback attempts to
|
|
1226
|
+
// the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
|
|
1096
1227
|
//
|
|
1097
|
-
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/
|
|
1228
|
+
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
|
|
1098
1229
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
1099
1230
|
//
|
|
1100
1231
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
@@ -1136,9 +1267,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1136
1267
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1137
1268
|
// initializeComponent
|
|
1138
1269
|
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1270
|
+
// Let the runtime know that the component has been initialized
|
|
1271
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1139
1272
|
{
|
|
1140
|
-
// we haven't initialized this element yet
|
|
1141
|
-
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1142
1273
|
// lazy loaded components
|
|
1143
1274
|
// request the component's implementation to be
|
|
1144
1275
|
// wired up with the host element
|
|
@@ -1211,6 +1342,8 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1211
1342
|
schedule();
|
|
1212
1343
|
}
|
|
1213
1344
|
};
|
|
1345
|
+
const fireConnectedCallback = (instance) => {
|
|
1346
|
+
};
|
|
1214
1347
|
const connectedCallback = (elm) => {
|
|
1215
1348
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1216
1349
|
const hostRef = getHostRef(elm);
|
|
@@ -1249,12 +1382,25 @@ const connectedCallback = (elm) => {
|
|
|
1249
1382
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1250
1383
|
}
|
|
1251
1384
|
}
|
|
1385
|
+
else {
|
|
1386
|
+
// fire off connectedCallback() on component instance
|
|
1387
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
1388
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
1389
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1252
1392
|
endConnected();
|
|
1253
1393
|
}
|
|
1254
1394
|
};
|
|
1255
|
-
const
|
|
1395
|
+
const disconnectInstance = (instance) => {
|
|
1396
|
+
};
|
|
1397
|
+
const disconnectedCallback = async (elm) => {
|
|
1256
1398
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1257
|
-
getHostRef(elm);
|
|
1399
|
+
const hostRef = getHostRef(elm);
|
|
1400
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
1401
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
1402
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1403
|
+
}
|
|
1258
1404
|
}
|
|
1259
1405
|
};
|
|
1260
1406
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,20 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
|
|
9
|
-
*/
|
|
10
|
-
const patchEsm = () => {
|
|
11
|
-
return index.promiseResolve();
|
|
12
|
-
};
|
|
5
|
+
const index = require('./index-3097681c.js');
|
|
13
6
|
|
|
14
7
|
const defineCustomElements = (win, options) => {
|
|
15
|
-
if (typeof window === 'undefined') return
|
|
16
|
-
return patchEsm().then(() => {
|
|
8
|
+
if (typeof window === 'undefined') return undefined;
|
|
17
9
|
return index.bootstrapLazy([["mds-input.cjs",[[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]}]]]], options);
|
|
18
|
-
});
|
|
19
10
|
};
|
|
20
11
|
|
|
21
12
|
exports.setNonce = index.setNonce;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-3097681c.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:
|
|
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;}::-ms-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:16px;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:16px;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) {
|
|
@@ -18,7 +18,7 @@ const MdsInput = class {
|
|
|
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-3097681c.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser
|
|
8
|
+
Stencil Client Patch Browser v4.2.1 | 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));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
-
"
|
|
3
|
+
"components/mds-input/mds-input.js"
|
|
4
4
|
],
|
|
5
5
|
"compiler": {
|
|
6
6
|
"name": "@stencil/core",
|
|
7
|
-
"version": "2.
|
|
8
|
-
"typescriptVersion": "
|
|
7
|
+
"version": "4.2.1",
|
|
8
|
+
"typescriptVersion": "5.1.6"
|
|
9
9
|
},
|
|
10
10
|
"collections": [],
|
|
11
11
|
"bundles": []
|
|
@@ -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;
|
|
@@ -31,7 +31,7 @@ export class KeyboardManager {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
this.detachEscapeBehavior = () => {
|
|
34
|
-
this.escapeCallback =
|
|
34
|
+
this.escapeCallback = () => { return; };
|
|
35
35
|
if (typeof window !== undefined) {
|
|
36
36
|
window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
37
37
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
|
|
2
|
+
if (duration.includes('s')) {
|
|
3
|
+
return Number(duration.replace('s', '')) * 1000;
|
|
4
|
+
}
|
|
5
|
+
if (duration.includes('ms')) {
|
|
6
|
+
return Number(duration.replace('s', ''));
|
|
7
|
+
}
|
|
8
|
+
return defaultValue;
|
|
9
|
+
};
|
|
10
|
+
export { cssDurationToMilliseconds, };
|