@maggioli-design-system/mds-list 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-41114fc6.js +673 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/mds-list.cjs.entry.js +19 -0
- package/dist/cjs/mds-list.cjs.js +19 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/mds-list/mds-list.css +26 -0
- package/dist/collection/components/mds-list/mds-list.js +15 -0
- package/dist/collection/components/mds-list/test/mds-list.stories.js +22 -0
- package/dist/collection/dictionary/autocomplete.js +59 -0
- package/dist/collection/dictionary/button.js +26 -0
- package/dist/collection/dictionary/color.js +19 -0
- package/dist/collection/dictionary/icon.js +3 -0
- package/dist/collection/dictionary/input-text-type.js +13 -0
- package/dist/collection/dictionary/loading.js +5 -0
- package/dist/collection/dictionary/typography.js +37 -0
- package/dist/collection/dictionary/variant.js +65 -0
- package/dist/collection/fixtures/cities.js +110 -0
- package/dist/collection/interface/input-value.js +1 -0
- package/dist/collection/types/autocomplete.js +1 -0
- package/dist/collection/types/button.js +1 -0
- package/dist/collection/types/form-rel.js +1 -0
- package/dist/collection/types/input-text-type.js +1 -0
- package/dist/collection/types/input-value-type.js +1 -0
- package/dist/collection/types/loading.js +1 -0
- package/dist/collection/types/typography.js +1 -0
- package/dist/collection/types/variant.js +1 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/components/mds-list.d.ts +11 -0
- package/dist/components/mds-list.js +34 -0
- package/dist/esm/index-6230983e.js +647 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/mds-list.entry.js +15 -0
- package/dist/esm/mds-list.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm-es5/index-6230983e.js +1 -0
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/loader.js +1 -0
- package/dist/esm-es5/mds-list.entry.js +1 -0
- package/dist/esm-es5/mds-list.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/mds-list/index.esm.js +0 -0
- package/dist/mds-list/mds-list.esm.js +1 -0
- package/dist/mds-list/mds-list.js +130 -0
- package/dist/mds-list/p-233f72af.system.js +1 -0
- package/dist/mds-list/p-50ea2036.system.js +1 -0
- package/dist/mds-list/p-5b7327b3.js +1 -0
- package/dist/mds-list/p-9fd9e0ef.system.js +1 -0
- package/dist/mds-list/p-f2ee2e84.entry.js +1 -0
- package/dist/mds-list/p-f3960731.system.entry.js +1 -0
- package/dist/stats.json +349 -0
- package/dist/types/components/mds-list/mds-list.d.ts +3 -0
- package/dist/types/components.d.ts +37 -0
- package/dist/types/dictionary/autocomplete.d.ts +2 -0
- package/dist/types/dictionary/button.d.ts +5 -0
- package/dist/types/dictionary/color.d.ts +3 -0
- package/dist/types/dictionary/icon.d.ts +2 -0
- package/dist/types/dictionary/input-text-type.d.ts +2 -0
- package/dist/types/dictionary/loading.d.ts +2 -0
- package/dist/types/dictionary/typography.d.ts +5 -0
- package/dist/types/dictionary/variant.d.ts +9 -0
- package/dist/types/fixtures/cities.d.ts +2 -0
- package/dist/types/interface/input-value.d.ts +4 -0
- package/dist/types/stencil-public-runtime.d.ts +1563 -0
- package/dist/types/types/autocomplete.d.ts +2 -0
- package/dist/types/types/button.d.ts +4 -0
- package/dist/types/types/form-rel.d.ts +1 -0
- package/dist/types/types/input-text-type.d.ts +1 -0
- package/dist/types/types/input-value-type.d.ts +1 -0
- package/dist/types/types/loading.d.ts +1 -0
- package/dist/types/types/typography.d.ts +4 -0
- package/dist/types/types/variant.d.ts +10 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +44 -0
- package/readme.md +10 -0
- package/src/components/mds-list/mds-list.css +15 -0
- package/src/components/mds-list/mds-list.tsx +19 -0
- package/src/components/mds-list/readme.md +10 -0
- package/src/components/mds-list/test/mds-list.stories.js +22 -0
- package/src/components.d.ts +37 -0
- package/src/dictionary/autocomplete.ts +62 -0
- package/src/dictionary/button.ts +35 -0
- package/src/dictionary/color.ts +24 -0
- package/src/dictionary/icon.ts +5 -0
- package/src/dictionary/input-text-type.ts +17 -0
- package/src/dictionary/loading.ts +9 -0
- package/src/dictionary/typography.ts +46 -0
- package/src/dictionary/variant.ts +82 -0
- package/src/fixtures/cities.ts +116 -0
- package/src/interface/input-value.ts +5 -0
- package/src/types/autocomplete.ts +69 -0
- package/src/types/button.ts +24 -0
- package/src/types/form-rel.ts +11 -0
- package/src/types/input-text-type.ts +11 -0
- package/src/types/input-value-type.ts +5 -0
- package/src/types/loading.ts +3 -0
- package/src/types/typography.ts +35 -0
- package/src/types/variant.ts +73 -0
- package/www/build/index.esm.js +0 -0
- package/www/build/mds-list.esm.js +1 -0
- package/www/build/mds-list.js +130 -0
- package/www/build/p-233f72af.system.js +1 -0
- package/www/build/p-50ea2036.system.js +1 -0
- package/www/build/p-5b7327b3.js +1 -0
- package/www/build/p-9fd9e0ef.system.js +1 -0
- package/www/build/p-f2ee2e84.entry.js +1 -0
- package/www/build/p-f3960731.system.entry.js +1 -0
- package/www/host.config.json +15 -0
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _interopNamespace(e) {
|
|
4
|
+
if (e && e.__esModule) return e;
|
|
5
|
+
var n = Object.create(null);
|
|
6
|
+
if (e) {
|
|
7
|
+
Object.keys(e).forEach(function (k) {
|
|
8
|
+
if (k !== 'default') {
|
|
9
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return e[k];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n['default'] = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const NAMESPACE = 'mds-list';
|
|
24
|
+
|
|
25
|
+
let scopeId;
|
|
26
|
+
let hostTagName;
|
|
27
|
+
let queuePending = false;
|
|
28
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
29
|
+
const doc = win.document || { head: {} };
|
|
30
|
+
const plt = {
|
|
31
|
+
$flags$: 0,
|
|
32
|
+
$resourcesUrl$: '',
|
|
33
|
+
jmp: (h) => h(),
|
|
34
|
+
raf: (h) => requestAnimationFrame(h),
|
|
35
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
36
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
37
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
38
|
+
};
|
|
39
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
40
|
+
const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
41
|
+
try {
|
|
42
|
+
new CSSStyleSheet();
|
|
43
|
+
return typeof new CSSStyleSheet().replace === 'function';
|
|
44
|
+
}
|
|
45
|
+
catch (e) { }
|
|
46
|
+
return false;
|
|
47
|
+
})()
|
|
48
|
+
;
|
|
49
|
+
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
50
|
+
const createTime = (fnName, tagName = '') => {
|
|
51
|
+
{
|
|
52
|
+
return () => {
|
|
53
|
+
return;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const uniqueTime = (key, measureText) => {
|
|
58
|
+
{
|
|
59
|
+
return () => {
|
|
60
|
+
return;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const rootAppliedStyles = new WeakMap();
|
|
65
|
+
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
66
|
+
let style = styles.get(scopeId);
|
|
67
|
+
if (supportsConstructibleStylesheets && allowCS) {
|
|
68
|
+
style = (style || new CSSStyleSheet());
|
|
69
|
+
style.replace(cssText);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
style = cssText;
|
|
73
|
+
}
|
|
74
|
+
styles.set(scopeId, style);
|
|
75
|
+
};
|
|
76
|
+
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
77
|
+
let scopeId = getScopeId(cmpMeta);
|
|
78
|
+
let style = styles.get(scopeId);
|
|
79
|
+
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
80
|
+
// so the fallback is to always use the document for the root node in those cases
|
|
81
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
82
|
+
if (style) {
|
|
83
|
+
if (typeof style === 'string') {
|
|
84
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
85
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
86
|
+
let styleElm;
|
|
87
|
+
if (!appliedStyles) {
|
|
88
|
+
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
89
|
+
}
|
|
90
|
+
if (!appliedStyles.has(scopeId)) {
|
|
91
|
+
{
|
|
92
|
+
{
|
|
93
|
+
styleElm = doc.createElement('style');
|
|
94
|
+
styleElm.innerHTML = style;
|
|
95
|
+
}
|
|
96
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
97
|
+
}
|
|
98
|
+
if (appliedStyles) {
|
|
99
|
+
appliedStyles.add(scopeId);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
104
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return scopeId;
|
|
108
|
+
};
|
|
109
|
+
const attachStyles = (hostRef) => {
|
|
110
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
111
|
+
const elm = hostRef.$hostElement$;
|
|
112
|
+
const flags = cmpMeta.$flags$;
|
|
113
|
+
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
114
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
115
|
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
116
|
+
// only required when we're NOT using native shadow dom (slot)
|
|
117
|
+
// or this browser doesn't support native shadow dom
|
|
118
|
+
// and this host element was NOT created with SSR
|
|
119
|
+
// let's pick out the inner content for slot projection
|
|
120
|
+
// create a node to represent where the original
|
|
121
|
+
// content was first placed, which is useful later on
|
|
122
|
+
// DOM WRITE!!
|
|
123
|
+
elm['s-sc'] = scopeId;
|
|
124
|
+
elm.classList.add(scopeId + '-h');
|
|
125
|
+
}
|
|
126
|
+
endAttachStyles();
|
|
127
|
+
};
|
|
128
|
+
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
129
|
+
const isDef = (v) => v != null;
|
|
130
|
+
const isComplexType = (o) => {
|
|
131
|
+
// https://jsperf.com/typeof-fn-object/5
|
|
132
|
+
o = typeof o;
|
|
133
|
+
return o === 'object' || o === 'function';
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Production h() function based on Preact by
|
|
137
|
+
* Jason Miller (@developit)
|
|
138
|
+
* Licensed under the MIT License
|
|
139
|
+
* https://github.com/developit/preact/blob/master/LICENSE
|
|
140
|
+
*
|
|
141
|
+
* Modified for Stencil's compiler and vdom
|
|
142
|
+
*/
|
|
143
|
+
// const stack: any[] = [];
|
|
144
|
+
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
145
|
+
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
146
|
+
const h = (nodeName, vnodeData, ...children) => {
|
|
147
|
+
let child = null;
|
|
148
|
+
let simple = false;
|
|
149
|
+
let lastSimple = false;
|
|
150
|
+
let vNodeChildren = [];
|
|
151
|
+
const walk = (c) => {
|
|
152
|
+
for (let i = 0; i < c.length; i++) {
|
|
153
|
+
child = c[i];
|
|
154
|
+
if (Array.isArray(child)) {
|
|
155
|
+
walk(child);
|
|
156
|
+
}
|
|
157
|
+
else if (child != null && typeof child !== 'boolean') {
|
|
158
|
+
if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
|
|
159
|
+
child = String(child);
|
|
160
|
+
}
|
|
161
|
+
if (simple && lastSimple) {
|
|
162
|
+
// If the previous child was simple (string), we merge both
|
|
163
|
+
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
// Append a new vNode, if it's text, we create a text vNode
|
|
167
|
+
vNodeChildren.push(simple ? newVNode(null, child) : child);
|
|
168
|
+
}
|
|
169
|
+
lastSimple = simple;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
walk(children);
|
|
174
|
+
const vnode = newVNode(nodeName, null);
|
|
175
|
+
vnode.$attrs$ = vnodeData;
|
|
176
|
+
if (vNodeChildren.length > 0) {
|
|
177
|
+
vnode.$children$ = vNodeChildren;
|
|
178
|
+
}
|
|
179
|
+
return vnode;
|
|
180
|
+
};
|
|
181
|
+
const newVNode = (tag, text) => {
|
|
182
|
+
const vnode = {
|
|
183
|
+
$flags$: 0,
|
|
184
|
+
$tag$: tag,
|
|
185
|
+
$text$: text,
|
|
186
|
+
$elm$: null,
|
|
187
|
+
$children$: null,
|
|
188
|
+
};
|
|
189
|
+
return vnode;
|
|
190
|
+
};
|
|
191
|
+
const Host = {};
|
|
192
|
+
const isHost = (node) => node && node.$tag$ === Host;
|
|
193
|
+
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
194
|
+
// tslint:disable-next-line: prefer-const
|
|
195
|
+
let newVNode = newParentVNode.$children$[childIndex];
|
|
196
|
+
let i = 0;
|
|
197
|
+
let elm;
|
|
198
|
+
let childNode;
|
|
199
|
+
{
|
|
200
|
+
// create element
|
|
201
|
+
elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
|
|
202
|
+
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
|
203
|
+
// if there is a scopeId and this is the initial render
|
|
204
|
+
// then let's add the scopeId as a css class
|
|
205
|
+
elm.classList.add((elm['s-si'] = scopeId));
|
|
206
|
+
}
|
|
207
|
+
if (newVNode.$children$) {
|
|
208
|
+
for (i = 0; i < newVNode.$children$.length; ++i) {
|
|
209
|
+
// create the node
|
|
210
|
+
childNode = createElm(oldParentVNode, newVNode, i);
|
|
211
|
+
// return node could have been null
|
|
212
|
+
if (childNode) {
|
|
213
|
+
// append our new node
|
|
214
|
+
elm.appendChild(childNode);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return elm;
|
|
220
|
+
};
|
|
221
|
+
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
222
|
+
let containerElm = (parentElm);
|
|
223
|
+
let childNode;
|
|
224
|
+
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
225
|
+
containerElm = containerElm.shadowRoot;
|
|
226
|
+
}
|
|
227
|
+
for (; startIdx <= endIdx; ++startIdx) {
|
|
228
|
+
if (vnodes[startIdx]) {
|
|
229
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
230
|
+
if (childNode) {
|
|
231
|
+
vnodes[startIdx].$elm$ = childNode;
|
|
232
|
+
containerElm.insertBefore(childNode, before);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
const patch = (oldVNode, newVNode) => {
|
|
238
|
+
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
239
|
+
const newChildren = newVNode.$children$;
|
|
240
|
+
{
|
|
241
|
+
if (newChildren !== null) {
|
|
242
|
+
// add the new vnode children
|
|
243
|
+
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
|
244
|
+
}
|
|
245
|
+
else ;
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
const renderVdom = (hostRef, renderFnResults) => {
|
|
249
|
+
const hostElm = hostRef.$hostElement$;
|
|
250
|
+
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
251
|
+
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
252
|
+
hostTagName = hostElm.tagName;
|
|
253
|
+
rootVnode.$tag$ = null;
|
|
254
|
+
rootVnode.$flags$ |= 4 /* isHost */;
|
|
255
|
+
hostRef.$vnode$ = rootVnode;
|
|
256
|
+
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
257
|
+
{
|
|
258
|
+
scopeId = hostElm['s-sc'];
|
|
259
|
+
}
|
|
260
|
+
// synchronous patch
|
|
261
|
+
patch(oldVNode, rootVnode);
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* Helper function to create & dispatch a custom Event on a provided target
|
|
265
|
+
* @param elm the target of the Event
|
|
266
|
+
* @param name the name to give the custom Event
|
|
267
|
+
* @param opts options for configuring a custom Event
|
|
268
|
+
* @returns the custom Event
|
|
269
|
+
*/
|
|
270
|
+
const emitEvent = (elm, name, opts) => {
|
|
271
|
+
const ev = plt.ce(name, opts);
|
|
272
|
+
elm.dispatchEvent(ev);
|
|
273
|
+
return ev;
|
|
274
|
+
};
|
|
275
|
+
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
276
|
+
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
277
|
+
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
281
|
+
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
282
|
+
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
286
|
+
// there is no ancestor component or the ancestor component
|
|
287
|
+
// has already fired off its lifecycle update then
|
|
288
|
+
// fire off the initial update
|
|
289
|
+
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
290
|
+
return writeTask(dispatch) ;
|
|
291
|
+
};
|
|
292
|
+
const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
293
|
+
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
294
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
295
|
+
let promise;
|
|
296
|
+
endSchedule();
|
|
297
|
+
return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
298
|
+
};
|
|
299
|
+
const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
300
|
+
// updateComponent
|
|
301
|
+
const elm = hostRef.$hostElement$;
|
|
302
|
+
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
303
|
+
const rc = elm['s-rc'];
|
|
304
|
+
if (isInitialLoad) {
|
|
305
|
+
// DOM WRITE!
|
|
306
|
+
attachStyles(hostRef);
|
|
307
|
+
}
|
|
308
|
+
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
309
|
+
{
|
|
310
|
+
callRender(hostRef, instance);
|
|
311
|
+
}
|
|
312
|
+
if (rc) {
|
|
313
|
+
// ok, so turns out there are some child host elements
|
|
314
|
+
// waiting on this parent element to load
|
|
315
|
+
// let's fire off all update callbacks waiting
|
|
316
|
+
rc.map((cb) => cb());
|
|
317
|
+
elm['s-rc'] = undefined;
|
|
318
|
+
}
|
|
319
|
+
endRender();
|
|
320
|
+
endUpdate();
|
|
321
|
+
{
|
|
322
|
+
const childrenPromises = elm['s-p'];
|
|
323
|
+
const postUpdate = () => postUpdateComponent(hostRef);
|
|
324
|
+
if (childrenPromises.length === 0) {
|
|
325
|
+
postUpdate();
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
Promise.all(childrenPromises).then(postUpdate);
|
|
329
|
+
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
330
|
+
childrenPromises.length = 0;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
const callRender = (hostRef, instance, elm) => {
|
|
335
|
+
try {
|
|
336
|
+
instance = instance.render() ;
|
|
337
|
+
{
|
|
338
|
+
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
339
|
+
}
|
|
340
|
+
{
|
|
341
|
+
{
|
|
342
|
+
// looks like we've got child nodes to render into this host element
|
|
343
|
+
// or we need to update the css class/attrs on the host element
|
|
344
|
+
// DOM WRITE!
|
|
345
|
+
{
|
|
346
|
+
renderVdom(hostRef, instance);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
catch (e) {
|
|
352
|
+
consoleError(e, hostRef.$hostElement$);
|
|
353
|
+
}
|
|
354
|
+
return null;
|
|
355
|
+
};
|
|
356
|
+
const postUpdateComponent = (hostRef) => {
|
|
357
|
+
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
358
|
+
const elm = hostRef.$hostElement$;
|
|
359
|
+
const endPostUpdate = createTime('postUpdate', tagName);
|
|
360
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
361
|
+
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
362
|
+
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
363
|
+
{
|
|
364
|
+
// DOM WRITE!
|
|
365
|
+
addHydratedFlag(elm);
|
|
366
|
+
}
|
|
367
|
+
endPostUpdate();
|
|
368
|
+
{
|
|
369
|
+
hostRef.$onReadyResolve$(elm);
|
|
370
|
+
if (!ancestorComponent) {
|
|
371
|
+
appDidLoad();
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
endPostUpdate();
|
|
377
|
+
}
|
|
378
|
+
// load events fire from bottom to top
|
|
379
|
+
// the deepest elements load first then bubbles up
|
|
380
|
+
{
|
|
381
|
+
if (hostRef.$onRenderResolve$) {
|
|
382
|
+
hostRef.$onRenderResolve$();
|
|
383
|
+
hostRef.$onRenderResolve$ = undefined;
|
|
384
|
+
}
|
|
385
|
+
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
386
|
+
nextTick(() => scheduleUpdate(hostRef, false));
|
|
387
|
+
}
|
|
388
|
+
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
389
|
+
}
|
|
390
|
+
// ( •_•)
|
|
391
|
+
// ( •_•)>⌐■-■
|
|
392
|
+
// (⌐■_■)
|
|
393
|
+
};
|
|
394
|
+
const appDidLoad = (who) => {
|
|
395
|
+
// on appload
|
|
396
|
+
// we have finish the first big initial render
|
|
397
|
+
{
|
|
398
|
+
addHydratedFlag(doc.documentElement);
|
|
399
|
+
}
|
|
400
|
+
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
401
|
+
};
|
|
402
|
+
const then = (promise, thenFn) => {
|
|
403
|
+
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
404
|
+
};
|
|
405
|
+
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
406
|
+
;
|
|
407
|
+
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
408
|
+
return Cstr;
|
|
409
|
+
};
|
|
410
|
+
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
411
|
+
// initializeComponent
|
|
412
|
+
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
413
|
+
{
|
|
414
|
+
// we haven't initialized this element yet
|
|
415
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
416
|
+
// lazy loaded components
|
|
417
|
+
// request the component's implementation to be
|
|
418
|
+
// wired up with the host element
|
|
419
|
+
Cstr = loadModule(cmpMeta);
|
|
420
|
+
if (Cstr.then) {
|
|
421
|
+
// Await creates a micro-task avoid if possible
|
|
422
|
+
const endLoad = uniqueTime();
|
|
423
|
+
Cstr = await Cstr;
|
|
424
|
+
endLoad();
|
|
425
|
+
}
|
|
426
|
+
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
427
|
+
// construct the lazy-loaded component implementation
|
|
428
|
+
// passing the hostRef is very important during
|
|
429
|
+
// construction in order to directly wire together the
|
|
430
|
+
// host element and the lazy-loaded instance
|
|
431
|
+
try {
|
|
432
|
+
new Cstr(hostRef);
|
|
433
|
+
}
|
|
434
|
+
catch (e) {
|
|
435
|
+
consoleError(e);
|
|
436
|
+
}
|
|
437
|
+
endNewInstance();
|
|
438
|
+
}
|
|
439
|
+
if (Cstr.style) {
|
|
440
|
+
// this component has styles but we haven't registered them yet
|
|
441
|
+
let style = Cstr.style;
|
|
442
|
+
const scopeId = getScopeId(cmpMeta);
|
|
443
|
+
if (!styles.has(scopeId)) {
|
|
444
|
+
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
445
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
446
|
+
endRegisterStyles();
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
// we've successfully created a lazy instance
|
|
451
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
452
|
+
const schedule = () => scheduleUpdate(hostRef, true);
|
|
453
|
+
if (ancestorComponent && ancestorComponent['s-rc']) {
|
|
454
|
+
// this is the initial load and this component it has an ancestor component
|
|
455
|
+
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
456
|
+
// so let's just cool our jets and wait for the ancestor to continue first
|
|
457
|
+
// this will get fired off when the ancestor component
|
|
458
|
+
// finally gets around to rendering its lazy self
|
|
459
|
+
// fire off the initial update
|
|
460
|
+
ancestorComponent['s-rc'].push(schedule);
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
schedule();
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
const connectedCallback = (elm) => {
|
|
467
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
468
|
+
const hostRef = getHostRef(elm);
|
|
469
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
470
|
+
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
471
|
+
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
472
|
+
// first time this component has connected
|
|
473
|
+
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
474
|
+
{
|
|
475
|
+
// find the first ancestor component (if there is one) and register
|
|
476
|
+
// this component as one of the actively loading child components for its ancestor
|
|
477
|
+
let ancestorComponent = elm;
|
|
478
|
+
while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
|
|
479
|
+
// climb up the ancestors looking for the first
|
|
480
|
+
// component that hasn't finished its lifecycle update yet
|
|
481
|
+
if (ancestorComponent['s-p']) {
|
|
482
|
+
// we found this components first ancestor component
|
|
483
|
+
// keep a reference to this component's ancestor component
|
|
484
|
+
attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
|
|
485
|
+
break;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
{
|
|
490
|
+
initializeComponent(elm, hostRef, cmpMeta);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
endConnected();
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
const disconnectedCallback = (elm) => {
|
|
497
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
498
|
+
getHostRef(elm);
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
502
|
+
const endBootstrap = createTime();
|
|
503
|
+
const cmpTags = [];
|
|
504
|
+
const exclude = options.exclude || [];
|
|
505
|
+
const customElements = win.customElements;
|
|
506
|
+
const head = doc.head;
|
|
507
|
+
const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
|
|
508
|
+
const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
|
|
509
|
+
const deferredConnectedCallbacks = [];
|
|
510
|
+
let appLoadFallback;
|
|
511
|
+
let isBootstrapping = true;
|
|
512
|
+
Object.assign(plt, options);
|
|
513
|
+
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
514
|
+
lazyBundles.map((lazyBundle) => {
|
|
515
|
+
lazyBundle[1].map((compactMeta) => {
|
|
516
|
+
const cmpMeta = {
|
|
517
|
+
$flags$: compactMeta[0],
|
|
518
|
+
$tagName$: compactMeta[1],
|
|
519
|
+
$members$: compactMeta[2],
|
|
520
|
+
$listeners$: compactMeta[3],
|
|
521
|
+
};
|
|
522
|
+
const tagName = cmpMeta.$tagName$;
|
|
523
|
+
const HostElement = class extends HTMLElement {
|
|
524
|
+
// StencilLazyHost
|
|
525
|
+
constructor(self) {
|
|
526
|
+
// @ts-ignore
|
|
527
|
+
super(self);
|
|
528
|
+
self = this;
|
|
529
|
+
registerHost(self, cmpMeta);
|
|
530
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
531
|
+
// this component is using shadow dom
|
|
532
|
+
// and this browser supports shadow dom
|
|
533
|
+
// add the read-only property "shadowRoot" to the host element
|
|
534
|
+
// adding the shadow root build conditionals to minimize runtime
|
|
535
|
+
{
|
|
536
|
+
{
|
|
537
|
+
self.attachShadow({ mode: 'open' });
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
connectedCallback() {
|
|
543
|
+
if (appLoadFallback) {
|
|
544
|
+
clearTimeout(appLoadFallback);
|
|
545
|
+
appLoadFallback = null;
|
|
546
|
+
}
|
|
547
|
+
if (isBootstrapping) {
|
|
548
|
+
// connectedCallback will be processed once all components have been registered
|
|
549
|
+
deferredConnectedCallbacks.push(this);
|
|
550
|
+
}
|
|
551
|
+
else {
|
|
552
|
+
plt.jmp(() => connectedCallback(this));
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
disconnectedCallback() {
|
|
556
|
+
plt.jmp(() => disconnectedCallback(this));
|
|
557
|
+
}
|
|
558
|
+
componentOnReady() {
|
|
559
|
+
return getHostRef(this).$onReadyPromise$;
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
563
|
+
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
564
|
+
cmpTags.push(tagName);
|
|
565
|
+
customElements.define(tagName, proxyComponent(HostElement));
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
});
|
|
569
|
+
{
|
|
570
|
+
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
571
|
+
visibilityStyle.setAttribute('data-styles', '');
|
|
572
|
+
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
573
|
+
}
|
|
574
|
+
// Process deferred connectedCallbacks now all components have been registered
|
|
575
|
+
isBootstrapping = false;
|
|
576
|
+
if (deferredConnectedCallbacks.length) {
|
|
577
|
+
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
578
|
+
}
|
|
579
|
+
else {
|
|
580
|
+
{
|
|
581
|
+
plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
// Fallback appLoad event
|
|
585
|
+
endBootstrap();
|
|
586
|
+
};
|
|
587
|
+
const hostRefs = new WeakMap();
|
|
588
|
+
const getHostRef = (ref) => hostRefs.get(ref);
|
|
589
|
+
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
590
|
+
const registerHost = (elm, cmpMeta) => {
|
|
591
|
+
const hostRef = {
|
|
592
|
+
$flags$: 0,
|
|
593
|
+
$hostElement$: elm,
|
|
594
|
+
$cmpMeta$: cmpMeta,
|
|
595
|
+
$instanceValues$: new Map(),
|
|
596
|
+
};
|
|
597
|
+
{
|
|
598
|
+
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
599
|
+
elm['s-p'] = [];
|
|
600
|
+
elm['s-rc'] = [];
|
|
601
|
+
}
|
|
602
|
+
return hostRefs.set(elm, hostRef);
|
|
603
|
+
};
|
|
604
|
+
const consoleError = (e, el) => (0, console.error)(e, el);
|
|
605
|
+
const cmpModules = /*@__PURE__*/ new Map();
|
|
606
|
+
const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
607
|
+
// loadModuleImport
|
|
608
|
+
const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
|
|
609
|
+
const bundleId = cmpMeta.$lazyBundleId$;
|
|
610
|
+
const module = cmpModules.get(bundleId) ;
|
|
611
|
+
if (module) {
|
|
612
|
+
return module[exportName];
|
|
613
|
+
}
|
|
614
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
615
|
+
/* webpackInclude: /\.entry\.js$/ */
|
|
616
|
+
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
617
|
+
/* webpackMode: "lazy" */
|
|
618
|
+
`./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
|
|
619
|
+
{
|
|
620
|
+
cmpModules.set(bundleId, importedModule);
|
|
621
|
+
}
|
|
622
|
+
return importedModule[exportName];
|
|
623
|
+
}, consoleError);
|
|
624
|
+
};
|
|
625
|
+
const styles = new Map();
|
|
626
|
+
const queueDomReads = [];
|
|
627
|
+
const queueDomWrites = [];
|
|
628
|
+
const queueTask = (queue, write) => (cb) => {
|
|
629
|
+
queue.push(cb);
|
|
630
|
+
if (!queuePending) {
|
|
631
|
+
queuePending = true;
|
|
632
|
+
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
633
|
+
nextTick(flush);
|
|
634
|
+
}
|
|
635
|
+
else {
|
|
636
|
+
plt.raf(flush);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
const consume = (queue) => {
|
|
641
|
+
for (let i = 0; i < queue.length; i++) {
|
|
642
|
+
try {
|
|
643
|
+
queue[i](performance.now());
|
|
644
|
+
}
|
|
645
|
+
catch (e) {
|
|
646
|
+
consoleError(e);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
queue.length = 0;
|
|
650
|
+
};
|
|
651
|
+
const flush = () => {
|
|
652
|
+
// always force a bunch of medium callbacks to run, but still have
|
|
653
|
+
// a throttle on how many can run in a certain time
|
|
654
|
+
// DOM READS!!!
|
|
655
|
+
consume(queueDomReads);
|
|
656
|
+
// DOM WRITES!!!
|
|
657
|
+
{
|
|
658
|
+
consume(queueDomWrites);
|
|
659
|
+
if ((queuePending = queueDomReads.length > 0)) {
|
|
660
|
+
// still more to do yet, but we've run out of time
|
|
661
|
+
// let's let this thing cool off and try again in the next tick
|
|
662
|
+
plt.raf(flush);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
667
|
+
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
668
|
+
|
|
669
|
+
exports.Host = Host;
|
|
670
|
+
exports.bootstrapLazy = bootstrapLazy;
|
|
671
|
+
exports.h = h;
|
|
672
|
+
exports.promiseResolve = promiseResolve;
|
|
673
|
+
exports.registerInstance = registerInstance;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-41114fc6.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Esm v2.12.0 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchEsm = () => {
|
|
11
|
+
return index.promiseResolve();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const defineCustomElements = (win, options) => {
|
|
15
|
+
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
+
return patchEsm().then(() => {
|
|
17
|
+
return index.bootstrapLazy([["mds-list.cjs",[[1,"mds-list"]]]], options);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.defineCustomElements = defineCustomElements;
|