@maggioli-design-system/mds-input 7.1.0 → 7.3.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-c95e674c.js → index-279453d9.js} +169 -74
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mds-input.cjs.entry.js +60 -30
- package/dist/cjs/mds-input.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/common/floating-controller.js +180 -0
- package/dist/collection/common/slot.js +19 -4
- package/dist/collection/common/string.js +30 -0
- package/dist/collection/components/mds-input/mds-input.css +120 -0
- package/dist/collection/components/mds-input/mds-input.js +109 -29
- package/dist/collection/dictionary/keyboard.js +84 -0
- package/dist/collection/dictionary/tree.js +13 -0
- package/dist/collection/type/keyboard.js +1 -0
- package/dist/collection/type/tree.js +1 -0
- package/dist/components/mds-input.js +59 -29
- package/dist/documentation.d.ts +8 -0
- package/dist/documentation.json +77 -27
- package/dist/esm/{index-9586b9b3.js → index-74cbfd43.js} +169 -74
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mds-input.entry.js +60 -30
- package/dist/esm/mds-input.js +3 -3
- package/dist/esm-es5/index-74cbfd43.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-input.entry.js +2 -2
- 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-05a844b2.js +2 -0
- package/dist/mds-input/p-c0225d5c.system.js +2 -0
- package/dist/mds-input/p-c18e19f7.system.entry.js +6 -0
- package/dist/mds-input/{p-c145155a.system.js → p-dd17e0ac.system.js} +1 -1
- package/dist/mds-input/p-e1827ab0.entry.js +6 -0
- package/dist/stats.json +198 -82
- package/dist/types/common/floating-controller.d.ts +46 -0
- package/dist/types/common/slot.d.ts +3 -1
- package/dist/types/common/string.d.ts +4 -0
- package/dist/types/dictionary/keyboard.d.ts +2 -0
- package/dist/types/dictionary/tree.d.ts +4 -0
- package/dist/types/type/keyboard.d.ts +12 -0
- package/dist/types/type/tree.d.ts +3 -0
- package/documentation.json +122 -32
- package/package.json +7 -7
- package/src/common/floating-controller.ts +263 -0
- package/src/common/slot.ts +23 -3
- package/src/common/string.ts +42 -0
- package/src/components/mds-input/mds-input.css +2 -0
- package/src/dictionary/keyboard.ts +87 -0
- package/src/dictionary/tree.ts +21 -0
- package/src/fixtures/icons.json +38 -1
- package/src/fixtures/iconsauce.json +6 -0
- package/src/meta/keyboard/keys.json +83 -0
- package/src/tailwind/components.css +11 -0
- package/src/tailwind/fouc.css +118 -0
- package/src/type/keyboard.ts +93 -0
- package/src/type/tree.ts +12 -0
- package/www/build/mds-input.esm.js +1 -1
- package/www/build/mds-input.js +1 -1
- package/www/build/p-05a844b2.js +2 -0
- package/www/build/p-c0225d5c.system.js +2 -0
- package/www/build/p-c18e19f7.system.entry.js +6 -0
- package/www/build/{p-c145155a.system.js → p-dd17e0ac.system.js} +1 -1
- package/www/build/p-e1827ab0.entry.js +6 -0
- package/dist/esm-es5/index-9586b9b3.js +0 -1
- package/dist/mds-input/p-3d84499f.js +0 -2
- package/dist/mds-input/p-4170a3cf.system.entry.js +0 -6
- package/dist/mds-input/p-488e1579.entry.js +0 -6
- package/dist/mds-input/p-a2151c36.system.js +0 -2
- package/www/build/p-3d84499f.js +0 -2
- package/www/build/p-4170a3cf.system.entry.js +0 -6
- package/www/build/p-488e1579.entry.js +0 -6
- package/www/build/p-a2151c36.system.js +0 -2
|
@@ -21,19 +21,23 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'mds-input';
|
|
24
|
-
const BUILD = /* mds-input */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: true, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: true, hydratedClass: false, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
24
|
+
const BUILD = /* mds-input */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: true, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: true, hydratedClass: false, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
|
-
Stencil Client Platform v4.
|
|
27
|
+
Stencil Client Platform v4.25.1 | MIT Licensed | https://stenciljs.com
|
|
28
28
|
*/
|
|
29
29
|
var __defProp = Object.defineProperty;
|
|
30
30
|
var __export = (target, all) => {
|
|
31
31
|
for (var name in all)
|
|
32
32
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
33
33
|
};
|
|
34
|
+
|
|
35
|
+
// src/client/client-host-ref.ts
|
|
34
36
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
35
37
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
36
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
|
38
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
39
|
+
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
40
|
+
};
|
|
37
41
|
var registerHost = (hostElement, cmpMeta) => {
|
|
38
42
|
const hostRef = {
|
|
39
43
|
$flags$: 0,
|
|
@@ -49,7 +53,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
49
53
|
hostElement["s-p"] = [];
|
|
50
54
|
hostElement["s-rc"] = [];
|
|
51
55
|
}
|
|
52
|
-
|
|
56
|
+
const ref = hostRefs.set(hostElement, hostRef);
|
|
57
|
+
return ref;
|
|
53
58
|
};
|
|
54
59
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
55
60
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -86,16 +91,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
86
91
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
87
92
|
/* webpackMode: "lazy" */
|
|
88
93
|
`./${bundleId}.entry.js${""}`
|
|
89
|
-
)); }).then(
|
|
90
|
-
{
|
|
91
|
-
|
|
94
|
+
)); }).then(
|
|
95
|
+
(importedModule) => {
|
|
96
|
+
{
|
|
97
|
+
cmpModules.set(bundleId, importedModule);
|
|
98
|
+
}
|
|
99
|
+
return importedModule[exportName];
|
|
100
|
+
},
|
|
101
|
+
(e) => {
|
|
102
|
+
consoleError(e, hostRef.$hostElement$);
|
|
92
103
|
}
|
|
93
|
-
|
|
94
|
-
}, consoleError);
|
|
104
|
+
);
|
|
95
105
|
};
|
|
96
106
|
|
|
97
107
|
// src/client/client-style.ts
|
|
98
108
|
var styles = /* @__PURE__ */ new Map();
|
|
109
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
99
110
|
var HYDRATED_CSS = "{visibility:hidden}[hydrated]{visibility:inherit}";
|
|
100
111
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
101
112
|
var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
@@ -159,12 +170,6 @@ var flush = () => {
|
|
|
159
170
|
};
|
|
160
171
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
161
172
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
162
|
-
|
|
163
|
-
// src/utils/constants.ts
|
|
164
|
-
var EMPTY_OBJ = {};
|
|
165
|
-
|
|
166
|
-
// src/utils/helpers.ts
|
|
167
|
-
var isDef = (v) => v != null;
|
|
168
173
|
var isComplexType = (o) => {
|
|
169
174
|
o = typeof o;
|
|
170
175
|
return o === "object" || o === "function";
|
|
@@ -368,7 +373,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
368
373
|
}
|
|
369
374
|
if (!appliedStyles.has(scopeId2)) {
|
|
370
375
|
{
|
|
371
|
-
styleElm = doc.createElement("style");
|
|
376
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
372
377
|
styleElm.innerHTML = style;
|
|
373
378
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
374
379
|
if (nonce != null) {
|
|
@@ -378,7 +383,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
378
383
|
if (styleContainerNode.nodeName === "HEAD") {
|
|
379
384
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
380
385
|
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
381
|
-
styleContainerNode.insertBefore(
|
|
386
|
+
styleContainerNode.insertBefore(
|
|
387
|
+
styleElm,
|
|
388
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
389
|
+
);
|
|
382
390
|
} else if ("host" in styleContainerNode) {
|
|
383
391
|
if (supportsConstructableStylesheets) {
|
|
384
392
|
const stylesheet = new CSSStyleSheet();
|
|
@@ -428,16 +436,18 @@ var attachStyles = (hostRef) => {
|
|
|
428
436
|
endAttachStyles();
|
|
429
437
|
};
|
|
430
438
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
431
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
439
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
432
440
|
if (oldValue !== newValue) {
|
|
433
441
|
let isProp = isMemberInElement(elm, memberName);
|
|
434
442
|
let ln = memberName.toLowerCase();
|
|
435
443
|
if (memberName === "class") {
|
|
436
444
|
const classList = elm.classList;
|
|
437
445
|
const oldClasses = parseClassList(oldValue);
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
446
|
+
let newClasses = parseClassList(newValue);
|
|
447
|
+
{
|
|
448
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
449
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
450
|
+
}
|
|
441
451
|
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
442
452
|
if (newValue) {
|
|
443
453
|
newValue(elm);
|
|
@@ -475,7 +485,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
475
485
|
elm.setAttribute(memberName, n);
|
|
476
486
|
}
|
|
477
487
|
}
|
|
478
|
-
} else {
|
|
488
|
+
} else if (elm[memberName] !== newValue) {
|
|
479
489
|
elm[memberName] = newValue;
|
|
480
490
|
}
|
|
481
491
|
} catch (e) {
|
|
@@ -497,24 +507,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
497
507
|
}
|
|
498
508
|
};
|
|
499
509
|
var parseClassListRegex = /\s/;
|
|
500
|
-
var parseClassList = (value) =>
|
|
510
|
+
var parseClassList = (value) => {
|
|
511
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
512
|
+
value = value.baseVal;
|
|
513
|
+
}
|
|
514
|
+
if (!value || typeof value !== "string") {
|
|
515
|
+
return [];
|
|
516
|
+
}
|
|
517
|
+
return value.split(parseClassListRegex);
|
|
518
|
+
};
|
|
501
519
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
502
520
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
503
521
|
|
|
504
522
|
// src/runtime/vdom/update-element.ts
|
|
505
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
523
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
506
524
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
507
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
508
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
525
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
526
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
509
527
|
{
|
|
510
528
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
511
529
|
if (!(memberName in newVnodeAttrs)) {
|
|
512
|
-
setAccessor(
|
|
530
|
+
setAccessor(
|
|
531
|
+
elm,
|
|
532
|
+
memberName,
|
|
533
|
+
oldVnodeAttrs[memberName],
|
|
534
|
+
void 0,
|
|
535
|
+
isSvgMode2,
|
|
536
|
+
newVnode.$flags$);
|
|
513
537
|
}
|
|
514
538
|
}
|
|
515
539
|
}
|
|
516
540
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
517
|
-
setAccessor(
|
|
541
|
+
setAccessor(
|
|
542
|
+
elm,
|
|
543
|
+
memberName,
|
|
544
|
+
oldVnodeAttrs[memberName],
|
|
545
|
+
newVnodeAttrs[memberName],
|
|
546
|
+
isSvgMode2,
|
|
547
|
+
newVnode.$flags$);
|
|
518
548
|
}
|
|
519
549
|
};
|
|
520
550
|
function sortedAttrNames(attrNames) {
|
|
@@ -526,13 +556,10 @@ function sortedAttrNames(attrNames) {
|
|
|
526
556
|
attrNames
|
|
527
557
|
);
|
|
528
558
|
}
|
|
529
|
-
|
|
530
|
-
// src/runtime/vdom/vdom-render.ts
|
|
531
|
-
var scopeId;
|
|
532
559
|
var hostTagName;
|
|
533
560
|
var useNativeShadowDom = false;
|
|
534
561
|
var isSvgMode = false;
|
|
535
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
562
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
536
563
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
537
564
|
let i2 = 0;
|
|
538
565
|
let elm;
|
|
@@ -546,11 +573,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
546
573
|
{
|
|
547
574
|
updateElement(null, newVNode2, isSvgMode);
|
|
548
575
|
}
|
|
549
|
-
const rootNode = elm.getRootNode();
|
|
550
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
551
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
552
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
553
|
-
}
|
|
554
576
|
if (newVNode2.$children$) {
|
|
555
577
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
556
578
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -680,6 +702,9 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
680
702
|
if (!isInitialRender) {
|
|
681
703
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
682
704
|
}
|
|
705
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
706
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
707
|
+
}
|
|
683
708
|
return true;
|
|
684
709
|
}
|
|
685
710
|
return false;
|
|
@@ -719,8 +744,9 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
719
744
|
}
|
|
720
745
|
};
|
|
721
746
|
var insertBefore = (parent, newNode, reference) => {
|
|
722
|
-
|
|
723
|
-
|
|
747
|
+
{
|
|
748
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
749
|
+
}
|
|
724
750
|
};
|
|
725
751
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
726
752
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -745,9 +771,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
745
771
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
746
772
|
hostRef.$vnode$ = rootVnode;
|
|
747
773
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
748
|
-
{
|
|
749
|
-
scopeId = hostElm["s-sc"];
|
|
750
|
-
}
|
|
751
774
|
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
752
775
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
753
776
|
};
|
|
@@ -755,7 +778,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
755
778
|
// src/runtime/update-component.ts
|
|
756
779
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
757
780
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
758
|
-
ancestorComponent["s-p"].push(
|
|
781
|
+
const index = ancestorComponent["s-p"].push(
|
|
782
|
+
new Promise(
|
|
783
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
784
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
785
|
+
r();
|
|
786
|
+
}
|
|
787
|
+
)
|
|
788
|
+
);
|
|
759
789
|
}
|
|
760
790
|
};
|
|
761
791
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -782,11 +812,11 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
782
812
|
let maybePromise;
|
|
783
813
|
if (isInitialLoad) {
|
|
784
814
|
{
|
|
785
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
|
815
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
786
816
|
}
|
|
787
817
|
}
|
|
788
818
|
{
|
|
789
|
-
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
819
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
790
820
|
}
|
|
791
821
|
endSchedule();
|
|
792
822
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
@@ -887,12 +917,12 @@ var appDidLoad = (who) => {
|
|
|
887
917
|
}
|
|
888
918
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
889
919
|
};
|
|
890
|
-
var safeCall = (instance, method, arg) => {
|
|
920
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
891
921
|
if (instance && instance[method]) {
|
|
892
922
|
try {
|
|
893
923
|
return instance[method](arg);
|
|
894
924
|
} catch (e) {
|
|
895
|
-
consoleError(e);
|
|
925
|
+
consoleError(e, elm);
|
|
896
926
|
}
|
|
897
927
|
}
|
|
898
928
|
return void 0;
|
|
@@ -945,23 +975,23 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
945
975
|
var _a, _b;
|
|
946
976
|
const prototype = Cstr.prototype;
|
|
947
977
|
if (cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
948
|
-
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach(
|
|
949
|
-
|
|
978
|
+
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
979
|
+
Object.defineProperty(prototype, cbName, {
|
|
950
980
|
value(...args) {
|
|
951
981
|
const hostRef = getHostRef(this);
|
|
952
982
|
const instance = hostRef.$lazyInstance$ ;
|
|
953
983
|
if (!instance) {
|
|
954
|
-
hostRef.$onReadyPromise$.then((
|
|
955
|
-
const cb =
|
|
956
|
-
typeof cb === "function" && cb.call(
|
|
984
|
+
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
985
|
+
const cb = asyncInstance[cbName];
|
|
986
|
+
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
957
987
|
});
|
|
958
988
|
} else {
|
|
959
|
-
const cb = instance[cbName];
|
|
989
|
+
const cb = instance[cbName] ;
|
|
960
990
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
961
991
|
}
|
|
962
992
|
}
|
|
963
|
-
})
|
|
964
|
-
);
|
|
993
|
+
});
|
|
994
|
+
});
|
|
965
995
|
}
|
|
966
996
|
if (cmpMeta.$members$ || (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
967
997
|
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
@@ -970,15 +1000,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
970
1000
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
971
1001
|
members.map(([memberName, [memberFlags]]) => {
|
|
972
1002
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
1003
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
1004
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
1005
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
1006
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
1007
|
+
Object.defineProperty(prototype, memberName, {
|
|
1008
|
+
get() {
|
|
1009
|
+
{
|
|
1010
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
1011
|
+
return getValue(this, memberName);
|
|
1012
|
+
}
|
|
1013
|
+
const ref = getHostRef(this);
|
|
1014
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
1015
|
+
if (!instance) return;
|
|
1016
|
+
return instance[memberName];
|
|
1017
|
+
}
|
|
1018
|
+
},
|
|
1019
|
+
configurable: true,
|
|
1020
|
+
enumerable: true
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
973
1023
|
Object.defineProperty(prototype, memberName, {
|
|
974
|
-
get() {
|
|
975
|
-
return getValue(this, memberName);
|
|
976
|
-
},
|
|
977
1024
|
set(newValue) {
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
1025
|
+
const ref = getHostRef(this);
|
|
1026
|
+
if (origSetter) {
|
|
1027
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1028
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1029
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
1030
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1031
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1032
|
+
}
|
|
1033
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
1034
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1035
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
{
|
|
1039
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
1040
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1041
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
1042
|
+
ref.$onReadyPromise$.then(() => {
|
|
1043
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
1044
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
1045
|
+
}
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
const setterSetVal = () => {
|
|
1051
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
1052
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1053
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1054
|
+
}
|
|
1055
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
1056
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1057
|
+
};
|
|
1058
|
+
if (ref.$lazyInstance$) {
|
|
1059
|
+
setterSetVal();
|
|
1060
|
+
} else {
|
|
1061
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
982
1065
|
});
|
|
983
1066
|
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
984
1067
|
Object.defineProperty(prototype, memberName, {
|
|
@@ -999,7 +1082,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
999
1082
|
plt.jmp(() => {
|
|
1000
1083
|
var _a2;
|
|
1001
1084
|
const propName = attrNameToPropName.get(attrName);
|
|
1002
|
-
if (this.hasOwnProperty(propName)) {
|
|
1085
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
1003
1086
|
newValue = this[propName];
|
|
1004
1087
|
delete this[propName];
|
|
1005
1088
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -1019,7 +1102,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1019
1102
|
}
|
|
1020
1103
|
return;
|
|
1021
1104
|
}
|
|
1022
|
-
|
|
1105
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1106
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1107
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1108
|
+
this[propName] = newValue;
|
|
1109
|
+
}
|
|
1023
1110
|
});
|
|
1024
1111
|
};
|
|
1025
1112
|
Cstr.observedAttributes = Array.from(
|
|
@@ -1046,9 +1133,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1046
1133
|
let Cstr;
|
|
1047
1134
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1048
1135
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1136
|
+
{
|
|
1137
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
1052
1138
|
if (CstrImport && "then" in CstrImport) {
|
|
1053
1139
|
const endLoad = uniqueTime();
|
|
1054
1140
|
Cstr = await CstrImport;
|
|
@@ -1073,7 +1159,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1073
1159
|
try {
|
|
1074
1160
|
new Cstr(hostRef);
|
|
1075
1161
|
} catch (e) {
|
|
1076
|
-
consoleError(e);
|
|
1162
|
+
consoleError(e, elm);
|
|
1077
1163
|
}
|
|
1078
1164
|
{
|
|
1079
1165
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
@@ -1082,10 +1168,6 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1082
1168
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1083
1169
|
}
|
|
1084
1170
|
endNewInstance();
|
|
1085
|
-
} else {
|
|
1086
|
-
Cstr = elm.constructor;
|
|
1087
|
-
const cmpTag = elm.localName;
|
|
1088
|
-
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1089
1171
|
}
|
|
1090
1172
|
if (Cstr && Cstr.style) {
|
|
1091
1173
|
let style;
|
|
@@ -1108,7 +1190,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1108
1190
|
schedule();
|
|
1109
1191
|
}
|
|
1110
1192
|
};
|
|
1111
|
-
var fireConnectedCallback = (instance) => {
|
|
1193
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1112
1194
|
};
|
|
1113
1195
|
|
|
1114
1196
|
// src/runtime/connected-callback.ts
|
|
@@ -1148,7 +1230,7 @@ var connectedCallback = (elm) => {
|
|
|
1148
1230
|
endConnected();
|
|
1149
1231
|
}
|
|
1150
1232
|
};
|
|
1151
|
-
var disconnectInstance = (instance) => {
|
|
1233
|
+
var disconnectInstance = (instance, elm) => {
|
|
1152
1234
|
};
|
|
1153
1235
|
var disconnectedCallback = async (elm) => {
|
|
1154
1236
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1157,6 +1239,12 @@ var disconnectedCallback = async (elm) => {
|
|
|
1157
1239
|
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1158
1240
|
}
|
|
1159
1241
|
}
|
|
1242
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1243
|
+
rootAppliedStyles.delete(elm);
|
|
1244
|
+
}
|
|
1245
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1246
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1247
|
+
}
|
|
1160
1248
|
};
|
|
1161
1249
|
|
|
1162
1250
|
// src/runtime/bootstrap-lazy.ts
|
|
@@ -1237,6 +1325,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1237
1325
|
}
|
|
1238
1326
|
disconnectedCallback() {
|
|
1239
1327
|
plt.jmp(() => disconnectedCallback(this));
|
|
1328
|
+
plt.raf(() => {
|
|
1329
|
+
var _a3;
|
|
1330
|
+
const hostRef = getHostRef(this);
|
|
1331
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1332
|
+
delete hostRef.$vnode$.$elm$;
|
|
1333
|
+
}
|
|
1334
|
+
});
|
|
1240
1335
|
}
|
|
1241
1336
|
componentOnReady() {
|
|
1242
1337
|
return getHostRef(this).$onReadyPromise$;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -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-279453d9.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|