@ganpatiinfo/gids-core-web 0.0.7 → 2.0.2
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/custom-elements.json +16 -0
- package/dist/elements.css +3 -2
- package/dist/elements.css.map +1 -1
- package/dist/gids-toggle-button.d.ts +11 -0
- package/dist/gids-toggle-button.js +130 -0
- package/dist/gids-toggle-button.js.map +1 -0
- package/dist/index.css +731 -5
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -332
- package/dist/index.js.map +1 -1
- package/dist/p-C7NwBdoN.js +1227 -0
- package/dist/p-C7NwBdoN.js.map +1 -0
- package/dist/p-DXWsIVvG.js +1227 -0
- package/dist/p-DXWsIVvG.js.map +1 -0
- package/dist/p-Dl9wTOvC.js +748 -0
- package/dist/p-Dl9wTOvC.js.map +1 -0
- package/dist/types/components/gids-toggle-button/gids-toggle-button.d.ts +3 -0
- package/dist/types/components/html/GidsButton/GidsButton.d.ts +24 -0
- package/dist/types/components/html/GidsIcon/GidsIcon.d.ts +5 -0
- package/dist/types/components/html/GidsSpinner/GidsSpinner.d.ts +4 -0
- package/dist/types/components/html/_GidsSpinnerControl/GidsSpinnerControl.d.ts +6 -0
- package/dist/types/components/webComponents/GidsToggleButton/GidsToggleButton.d.ts +58 -0
- package/dist/types/components.d.ts +91 -0
- package/dist/types/index.d.ts +10 -0
- package/package.json +21 -11
|
@@ -0,0 +1,748 @@
|
|
|
1
|
+
const NAMESPACE = 'web-stencil';
|
|
2
|
+
const BUILD = /* web-stencil */ { hydratedSelectorName: "hydrated"};
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
Stencil Client Platform v4.31.0 | MIT Licensed | https://stenciljs.com
|
|
6
|
+
*/
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// src/client/client-host-ref.ts
|
|
14
|
+
var getHostRef = (ref) => {
|
|
15
|
+
if (ref.__stencil__getHostRef) {
|
|
16
|
+
return ref.__stencil__getHostRef();
|
|
17
|
+
}
|
|
18
|
+
return void 0;
|
|
19
|
+
};
|
|
20
|
+
var registerHost = (hostElement, cmpMeta) => {
|
|
21
|
+
const hostRef = {
|
|
22
|
+
$flags$: 0,
|
|
23
|
+
$hostElement$: hostElement,
|
|
24
|
+
$cmpMeta$: cmpMeta,
|
|
25
|
+
$instanceValues$: /* @__PURE__ */ new Map()
|
|
26
|
+
};
|
|
27
|
+
{
|
|
28
|
+
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
|
|
29
|
+
hostElement["s-p"] = [];
|
|
30
|
+
hostElement["s-rc"] = [];
|
|
31
|
+
}
|
|
32
|
+
const ref = hostRef;
|
|
33
|
+
hostElement.__stencil__getHostRef = () => ref;
|
|
34
|
+
return ref;
|
|
35
|
+
};
|
|
36
|
+
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
37
|
+
|
|
38
|
+
// src/client/client-style.ts
|
|
39
|
+
var styles = /* @__PURE__ */ new Map();
|
|
40
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
41
|
+
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
42
|
+
var win = typeof window !== "undefined" ? window : {};
|
|
43
|
+
var H = win.HTMLElement || class {
|
|
44
|
+
};
|
|
45
|
+
var plt = {
|
|
46
|
+
$flags$: 0,
|
|
47
|
+
$resourcesUrl$: "",
|
|
48
|
+
jmp: (h2) => h2(),
|
|
49
|
+
raf: (h2) => requestAnimationFrame(h2),
|
|
50
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
51
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
52
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
53
|
+
};
|
|
54
|
+
var promiseResolve = (v) => Promise.resolve(v);
|
|
55
|
+
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
56
|
+
try {
|
|
57
|
+
new CSSStyleSheet();
|
|
58
|
+
return typeof new CSSStyleSheet().replaceSync === "function";
|
|
59
|
+
} catch (e) {
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
})() ;
|
|
63
|
+
var queuePending = false;
|
|
64
|
+
var queueDomReads = [];
|
|
65
|
+
var queueDomWrites = [];
|
|
66
|
+
var queueTask = (queue, write) => (cb) => {
|
|
67
|
+
queue.push(cb);
|
|
68
|
+
if (!queuePending) {
|
|
69
|
+
queuePending = true;
|
|
70
|
+
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
71
|
+
nextTick(flush);
|
|
72
|
+
} else {
|
|
73
|
+
plt.raf(flush);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var consume = (queue) => {
|
|
78
|
+
for (let i2 = 0; i2 < queue.length; i2++) {
|
|
79
|
+
try {
|
|
80
|
+
queue[i2](performance.now());
|
|
81
|
+
} catch (e) {
|
|
82
|
+
consoleError(e);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
queue.length = 0;
|
|
86
|
+
};
|
|
87
|
+
var flush = () => {
|
|
88
|
+
consume(queueDomReads);
|
|
89
|
+
{
|
|
90
|
+
consume(queueDomWrites);
|
|
91
|
+
if (queuePending = queueDomReads.length > 0) {
|
|
92
|
+
plt.raf(flush);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var nextTick = (cb) => promiseResolve().then(cb);
|
|
97
|
+
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
98
|
+
|
|
99
|
+
// src/runtime/asset-path.ts
|
|
100
|
+
var getAssetPath = (path) => {
|
|
101
|
+
const assetUrl = new URL(path, plt.$resourcesUrl$);
|
|
102
|
+
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
103
|
+
};
|
|
104
|
+
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
105
|
+
var isComplexType = (o) => {
|
|
106
|
+
o = typeof o;
|
|
107
|
+
return o === "object" || o === "function";
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// src/utils/query-nonce-meta-tag-content.ts
|
|
111
|
+
function queryNonceMetaTagContent(doc) {
|
|
112
|
+
var _a, _b, _c;
|
|
113
|
+
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// src/utils/regular-expression.ts
|
|
117
|
+
var escapeRegExpSpecialCharacters = (text) => {
|
|
118
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// src/utils/result.ts
|
|
122
|
+
var result_exports = {};
|
|
123
|
+
__export(result_exports, {
|
|
124
|
+
err: () => err,
|
|
125
|
+
map: () => map,
|
|
126
|
+
ok: () => ok,
|
|
127
|
+
unwrap: () => unwrap,
|
|
128
|
+
unwrapErr: () => unwrapErr
|
|
129
|
+
});
|
|
130
|
+
var ok = (value) => ({
|
|
131
|
+
isOk: true,
|
|
132
|
+
isErr: false,
|
|
133
|
+
value
|
|
134
|
+
});
|
|
135
|
+
var err = (value) => ({
|
|
136
|
+
isOk: false,
|
|
137
|
+
isErr: true,
|
|
138
|
+
value
|
|
139
|
+
});
|
|
140
|
+
function map(result, fn) {
|
|
141
|
+
if (result.isOk) {
|
|
142
|
+
const val = fn(result.value);
|
|
143
|
+
if (val instanceof Promise) {
|
|
144
|
+
return val.then((newVal) => ok(newVal));
|
|
145
|
+
} else {
|
|
146
|
+
return ok(val);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (result.isErr) {
|
|
150
|
+
const value = result.value;
|
|
151
|
+
return err(value);
|
|
152
|
+
}
|
|
153
|
+
throw "should never get here";
|
|
154
|
+
}
|
|
155
|
+
var unwrap = (result) => {
|
|
156
|
+
if (result.isOk) {
|
|
157
|
+
return result.value;
|
|
158
|
+
} else {
|
|
159
|
+
throw result.value;
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
var unwrapErr = (result) => {
|
|
163
|
+
if (result.isErr) {
|
|
164
|
+
return result.value;
|
|
165
|
+
} else {
|
|
166
|
+
throw result.value;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
var createTime = (fnName, tagName = "") => {
|
|
170
|
+
{
|
|
171
|
+
return () => {
|
|
172
|
+
return;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
var h = (nodeName, vnodeData, ...children) => {
|
|
177
|
+
let child = null;
|
|
178
|
+
let key = null;
|
|
179
|
+
let simple = false;
|
|
180
|
+
let lastSimple = false;
|
|
181
|
+
const vNodeChildren = [];
|
|
182
|
+
const walk = (c) => {
|
|
183
|
+
for (let i2 = 0; i2 < c.length; i2++) {
|
|
184
|
+
child = c[i2];
|
|
185
|
+
if (Array.isArray(child)) {
|
|
186
|
+
walk(child);
|
|
187
|
+
} else if (child != null && typeof child !== "boolean") {
|
|
188
|
+
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
189
|
+
child = String(child);
|
|
190
|
+
}
|
|
191
|
+
if (simple && lastSimple) {
|
|
192
|
+
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
193
|
+
} else {
|
|
194
|
+
vNodeChildren.push(simple ? newVNode(null, child) : child);
|
|
195
|
+
}
|
|
196
|
+
lastSimple = simple;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
walk(children);
|
|
201
|
+
if (vnodeData) {
|
|
202
|
+
if (vnodeData.key) {
|
|
203
|
+
key = vnodeData.key;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const vnode = newVNode(nodeName, null);
|
|
207
|
+
vnode.$attrs$ = vnodeData;
|
|
208
|
+
if (vNodeChildren.length > 0) {
|
|
209
|
+
vnode.$children$ = vNodeChildren;
|
|
210
|
+
}
|
|
211
|
+
{
|
|
212
|
+
vnode.$key$ = key;
|
|
213
|
+
}
|
|
214
|
+
return vnode;
|
|
215
|
+
};
|
|
216
|
+
var newVNode = (tag, text) => {
|
|
217
|
+
const vnode = {
|
|
218
|
+
$flags$: 0,
|
|
219
|
+
$tag$: tag,
|
|
220
|
+
$text$: text,
|
|
221
|
+
$elm$: null,
|
|
222
|
+
$children$: null
|
|
223
|
+
};
|
|
224
|
+
{
|
|
225
|
+
vnode.$attrs$ = null;
|
|
226
|
+
}
|
|
227
|
+
{
|
|
228
|
+
vnode.$key$ = null;
|
|
229
|
+
}
|
|
230
|
+
return vnode;
|
|
231
|
+
};
|
|
232
|
+
var Host = {};
|
|
233
|
+
var isHost = (node) => node && node.$tag$ === Host;
|
|
234
|
+
var createSupportsRuleRe = (selector) => {
|
|
235
|
+
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
236
|
+
return new RegExp(
|
|
237
|
+
// First capture group: match any context before the selector that's not inside @supports selector()
|
|
238
|
+
// Using negative lookahead to avoid matching inside @supports selector(...) condition
|
|
239
|
+
`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
|
|
240
|
+
"g"
|
|
241
|
+
);
|
|
242
|
+
};
|
|
243
|
+
createSupportsRuleRe("::slotted");
|
|
244
|
+
createSupportsRuleRe(":host");
|
|
245
|
+
createSupportsRuleRe(":host-context");
|
|
246
|
+
var emitEvent = (elm, name, opts) => {
|
|
247
|
+
const ev = plt.ce(name, opts);
|
|
248
|
+
elm.dispatchEvent(ev);
|
|
249
|
+
return ev;
|
|
250
|
+
};
|
|
251
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
252
|
+
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
253
|
+
let style = styles.get(scopeId2);
|
|
254
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
255
|
+
style = style || new CSSStyleSheet();
|
|
256
|
+
if (typeof style === "string") {
|
|
257
|
+
style = cssText;
|
|
258
|
+
} else {
|
|
259
|
+
style.replaceSync(cssText);
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
style = cssText;
|
|
263
|
+
}
|
|
264
|
+
styles.set(scopeId2, style);
|
|
265
|
+
};
|
|
266
|
+
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
267
|
+
var _a;
|
|
268
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
269
|
+
const style = styles.get(scopeId2);
|
|
270
|
+
if (!win.document) {
|
|
271
|
+
return scopeId2;
|
|
272
|
+
}
|
|
273
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
274
|
+
if (style) {
|
|
275
|
+
if (typeof style === "string") {
|
|
276
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
277
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
278
|
+
let styleElm;
|
|
279
|
+
if (!appliedStyles) {
|
|
280
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
281
|
+
}
|
|
282
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
283
|
+
{
|
|
284
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
|
285
|
+
styleElm.innerHTML = style;
|
|
286
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
287
|
+
if (nonce != null) {
|
|
288
|
+
styleElm.setAttribute("nonce", nonce);
|
|
289
|
+
}
|
|
290
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
291
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
292
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
293
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
294
|
+
styleContainerNode.insertBefore(
|
|
295
|
+
styleElm,
|
|
296
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
297
|
+
);
|
|
298
|
+
} else if ("host" in styleContainerNode) {
|
|
299
|
+
if (supportsConstructableStylesheets) {
|
|
300
|
+
const stylesheet = new CSSStyleSheet();
|
|
301
|
+
stylesheet.replaceSync(style);
|
|
302
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
303
|
+
} else {
|
|
304
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
305
|
+
if (existingStyleContainer) {
|
|
306
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
307
|
+
} else {
|
|
308
|
+
styleContainerNode.prepend(styleElm);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
} else {
|
|
312
|
+
styleContainerNode.append(styleElm);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
316
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
320
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
321
|
+
}
|
|
322
|
+
if (appliedStyles) {
|
|
323
|
+
appliedStyles.add(scopeId2);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
} else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
327
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return scopeId2;
|
|
331
|
+
};
|
|
332
|
+
var attachStyles = (hostRef) => {
|
|
333
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
334
|
+
const elm = hostRef.$hostElement$;
|
|
335
|
+
const flags = cmpMeta.$flags$;
|
|
336
|
+
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
337
|
+
const scopeId2 = addStyle(
|
|
338
|
+
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
339
|
+
cmpMeta);
|
|
340
|
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
341
|
+
elm["s-sc"] = scopeId2;
|
|
342
|
+
elm.classList.add(scopeId2 + "-h");
|
|
343
|
+
}
|
|
344
|
+
endAttachStyles();
|
|
345
|
+
};
|
|
346
|
+
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
347
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
348
|
+
if (oldValue === newValue) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
memberName.toLowerCase();
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
// src/runtime/vdom/update-element.ts
|
|
355
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
356
|
+
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
357
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
358
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
359
|
+
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
360
|
+
setAccessor(
|
|
361
|
+
elm,
|
|
362
|
+
memberName,
|
|
363
|
+
oldVnodeAttrs[memberName],
|
|
364
|
+
newVnodeAttrs[memberName]);
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
function sortedAttrNames(attrNames) {
|
|
368
|
+
return attrNames.includes("ref") ? (
|
|
369
|
+
// we need to sort these to ensure that `'ref'` is the last attr
|
|
370
|
+
[...attrNames.filter((attr) => attr !== "ref"), "ref"]
|
|
371
|
+
) : (
|
|
372
|
+
// no need to sort, return the original array
|
|
373
|
+
attrNames
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
var hostTagName;
|
|
377
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
378
|
+
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
379
|
+
let i2 = 0;
|
|
380
|
+
let elm;
|
|
381
|
+
let childNode;
|
|
382
|
+
{
|
|
383
|
+
if (!win.document) {
|
|
384
|
+
throw new Error(
|
|
385
|
+
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
elm = newVNode2.$elm$ = win.document.createElement(
|
|
389
|
+
newVNode2.$tag$
|
|
390
|
+
);
|
|
391
|
+
{
|
|
392
|
+
updateElement(null, newVNode2);
|
|
393
|
+
}
|
|
394
|
+
if (newVNode2.$children$) {
|
|
395
|
+
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
396
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
397
|
+
if (childNode) {
|
|
398
|
+
elm.appendChild(childNode);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
elm["s-hn"] = hostTagName;
|
|
404
|
+
return elm;
|
|
405
|
+
};
|
|
406
|
+
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
407
|
+
let containerElm = parentElm;
|
|
408
|
+
let childNode;
|
|
409
|
+
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
410
|
+
containerElm = containerElm.shadowRoot;
|
|
411
|
+
}
|
|
412
|
+
for (; startIdx <= endIdx; ++startIdx) {
|
|
413
|
+
if (vnodes[startIdx]) {
|
|
414
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
415
|
+
if (childNode) {
|
|
416
|
+
vnodes[startIdx].$elm$ = childNode;
|
|
417
|
+
insertBefore(containerElm, childNode, before);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
423
|
+
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
424
|
+
const newChildren = newVNode2.$children$;
|
|
425
|
+
{
|
|
426
|
+
{
|
|
427
|
+
updateElement(oldVNode, newVNode2);
|
|
428
|
+
}
|
|
429
|
+
if (newChildren !== null) {
|
|
430
|
+
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
431
|
+
} else ;
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
var insertBefore = (parent, newNode, reference) => {
|
|
435
|
+
{
|
|
436
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
440
|
+
const hostElm = hostRef.$hostElement$;
|
|
441
|
+
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
442
|
+
const isHostElement = isHost(renderFnResults);
|
|
443
|
+
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
444
|
+
hostTagName = hostElm.tagName;
|
|
445
|
+
if (isInitialLoad && rootVnode.$attrs$) {
|
|
446
|
+
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
447
|
+
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
448
|
+
rootVnode.$attrs$[key] = hostElm[key];
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
rootVnode.$tag$ = null;
|
|
453
|
+
rootVnode.$flags$ |= 4 /* isHost */;
|
|
454
|
+
hostRef.$vnode$ = rootVnode;
|
|
455
|
+
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
456
|
+
patch(oldVNode, rootVnode, isInitialLoad);
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
// src/runtime/update-component.ts
|
|
460
|
+
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
461
|
+
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
462
|
+
const index = ancestorComponent["s-p"].push(
|
|
463
|
+
new Promise(
|
|
464
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
465
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
466
|
+
r();
|
|
467
|
+
}
|
|
468
|
+
)
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
473
|
+
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
474
|
+
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
478
|
+
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
479
|
+
return writeTask(dispatch) ;
|
|
480
|
+
};
|
|
481
|
+
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
482
|
+
const elm = hostRef.$hostElement$;
|
|
483
|
+
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
484
|
+
const instance = elm;
|
|
485
|
+
if (!instance) {
|
|
486
|
+
throw new Error(
|
|
487
|
+
`Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
let maybePromise;
|
|
491
|
+
if (isInitialLoad) {
|
|
492
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
493
|
+
} else {
|
|
494
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
495
|
+
}
|
|
496
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
497
|
+
endSchedule();
|
|
498
|
+
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
499
|
+
};
|
|
500
|
+
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
|
|
501
|
+
console.error(err2);
|
|
502
|
+
fn();
|
|
503
|
+
}) : fn();
|
|
504
|
+
var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
|
|
505
|
+
var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
506
|
+
var _a;
|
|
507
|
+
const elm = hostRef.$hostElement$;
|
|
508
|
+
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
509
|
+
const rc = elm["s-rc"];
|
|
510
|
+
if (isInitialLoad) {
|
|
511
|
+
attachStyles(hostRef);
|
|
512
|
+
}
|
|
513
|
+
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
514
|
+
{
|
|
515
|
+
callRender(hostRef, instance, elm, isInitialLoad);
|
|
516
|
+
}
|
|
517
|
+
if (rc) {
|
|
518
|
+
rc.map((cb) => cb());
|
|
519
|
+
elm["s-rc"] = void 0;
|
|
520
|
+
}
|
|
521
|
+
endRender();
|
|
522
|
+
endUpdate();
|
|
523
|
+
{
|
|
524
|
+
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
525
|
+
const postUpdate = () => postUpdateComponent(hostRef);
|
|
526
|
+
if (childrenPromises.length === 0) {
|
|
527
|
+
postUpdate();
|
|
528
|
+
} else {
|
|
529
|
+
Promise.all(childrenPromises).then(postUpdate);
|
|
530
|
+
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
531
|
+
childrenPromises.length = 0;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
536
|
+
try {
|
|
537
|
+
instance = instance.render() ;
|
|
538
|
+
{
|
|
539
|
+
{
|
|
540
|
+
{
|
|
541
|
+
renderVdom(hostRef, instance, isInitialLoad);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
} catch (e) {
|
|
546
|
+
consoleError(e, hostRef.$hostElement$);
|
|
547
|
+
}
|
|
548
|
+
return null;
|
|
549
|
+
};
|
|
550
|
+
var postUpdateComponent = (hostRef) => {
|
|
551
|
+
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
552
|
+
const elm = hostRef.$hostElement$;
|
|
553
|
+
const endPostUpdate = createTime("postUpdate", tagName);
|
|
554
|
+
const instance = elm;
|
|
555
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
556
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
557
|
+
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
558
|
+
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
559
|
+
{
|
|
560
|
+
addHydratedFlag(elm);
|
|
561
|
+
}
|
|
562
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
563
|
+
endPostUpdate();
|
|
564
|
+
{
|
|
565
|
+
hostRef.$onReadyResolve$(elm);
|
|
566
|
+
if (!ancestorComponent) {
|
|
567
|
+
appDidLoad();
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
} else {
|
|
571
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
572
|
+
endPostUpdate();
|
|
573
|
+
}
|
|
574
|
+
{
|
|
575
|
+
if (hostRef.$onRenderResolve$) {
|
|
576
|
+
hostRef.$onRenderResolve$();
|
|
577
|
+
hostRef.$onRenderResolve$ = void 0;
|
|
578
|
+
}
|
|
579
|
+
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
580
|
+
nextTick(() => scheduleUpdate(hostRef, false));
|
|
581
|
+
}
|
|
582
|
+
hostRef.$flags$ &= -517;
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
var appDidLoad = (who) => {
|
|
586
|
+
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
587
|
+
};
|
|
588
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
589
|
+
if (instance && instance[method]) {
|
|
590
|
+
try {
|
|
591
|
+
return instance[method](arg);
|
|
592
|
+
} catch (e) {
|
|
593
|
+
consoleError(e, elm);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
return void 0;
|
|
597
|
+
};
|
|
598
|
+
var addHydratedFlag = (elm) => {
|
|
599
|
+
var _a;
|
|
600
|
+
return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
// src/runtime/proxy-component.ts
|
|
604
|
+
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
605
|
+
return Cstr;
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
// src/runtime/initialize-component.ts
|
|
609
|
+
var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
610
|
+
let Cstr;
|
|
611
|
+
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
612
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
613
|
+
{
|
|
614
|
+
Cstr = elm.constructor;
|
|
615
|
+
const cmpTag = elm.localName;
|
|
616
|
+
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
617
|
+
}
|
|
618
|
+
if (Cstr && Cstr.style) {
|
|
619
|
+
let style;
|
|
620
|
+
if (typeof Cstr.style === "string") {
|
|
621
|
+
style = Cstr.style;
|
|
622
|
+
}
|
|
623
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
624
|
+
if (!styles.has(scopeId2)) {
|
|
625
|
+
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
626
|
+
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
627
|
+
endRegisterStyles();
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
632
|
+
const schedule = () => scheduleUpdate(hostRef, true);
|
|
633
|
+
if (ancestorComponent && ancestorComponent["s-rc"]) {
|
|
634
|
+
ancestorComponent["s-rc"].push(schedule);
|
|
635
|
+
} else {
|
|
636
|
+
schedule();
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
// src/runtime/connected-callback.ts
|
|
643
|
+
var connectedCallback = (elm) => {
|
|
644
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
645
|
+
const hostRef = getHostRef(elm);
|
|
646
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
647
|
+
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
648
|
+
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
649
|
+
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
650
|
+
{
|
|
651
|
+
let ancestorComponent = elm;
|
|
652
|
+
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
653
|
+
if (ancestorComponent["s-p"]) {
|
|
654
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
if (BUILD.initializeNextTick) {
|
|
660
|
+
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
661
|
+
} else {
|
|
662
|
+
initializeComponent(elm, hostRef, cmpMeta);
|
|
663
|
+
}
|
|
664
|
+
} else {
|
|
665
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
666
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
endConnected();
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
var disconnectedCallback = async (elm) => {
|
|
673
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
674
|
+
getHostRef(elm);
|
|
675
|
+
}
|
|
676
|
+
if (rootAppliedStyles.has(elm)) {
|
|
677
|
+
rootAppliedStyles.delete(elm);
|
|
678
|
+
}
|
|
679
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
680
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
var proxyCustomElement = (Cstr, compactMeta) => {
|
|
684
|
+
const cmpMeta = {
|
|
685
|
+
$flags$: compactMeta[0],
|
|
686
|
+
$tagName$: compactMeta[1]
|
|
687
|
+
};
|
|
688
|
+
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
689
|
+
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
690
|
+
Object.assign(Cstr.prototype, {
|
|
691
|
+
__hasHostListenerAttached: false,
|
|
692
|
+
__registerHost() {
|
|
693
|
+
registerHost(this, cmpMeta);
|
|
694
|
+
},
|
|
695
|
+
connectedCallback() {
|
|
696
|
+
if (!this.__hasHostListenerAttached) {
|
|
697
|
+
getHostRef(this);
|
|
698
|
+
this.__hasHostListenerAttached = true;
|
|
699
|
+
}
|
|
700
|
+
connectedCallback(this);
|
|
701
|
+
if (originalConnectedCallback) {
|
|
702
|
+
originalConnectedCallback.call(this);
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
disconnectedCallback() {
|
|
706
|
+
disconnectedCallback(this);
|
|
707
|
+
if (originalDisconnectedCallback) {
|
|
708
|
+
originalDisconnectedCallback.call(this);
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
__attachShadow() {
|
|
712
|
+
{
|
|
713
|
+
if (!this.shadowRoot) {
|
|
714
|
+
{
|
|
715
|
+
this.attachShadow({ mode: "open" });
|
|
716
|
+
}
|
|
717
|
+
} else {
|
|
718
|
+
if (this.shadowRoot.mode !== "open") {
|
|
719
|
+
throw new Error(
|
|
720
|
+
`Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
|
|
721
|
+
);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
Cstr.is = cmpMeta.$tagName$;
|
|
728
|
+
return proxyComponent(Cstr);
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
// src/runtime/nonce.ts
|
|
732
|
+
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
733
|
+
|
|
734
|
+
// src/runtime/platform-options.ts
|
|
735
|
+
var setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
736
|
+
|
|
737
|
+
// src/runtime/render.ts
|
|
738
|
+
function render(vnode, container) {
|
|
739
|
+
const ref = {
|
|
740
|
+
$hostElement$: container
|
|
741
|
+
};
|
|
742
|
+
renderVdom(ref, vnode);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
export { H, setNonce as a, setPlatformOptions as b, Host as c, getAssetPath as g, h, proxyCustomElement as p, render as r, setAssetPath as s };
|
|
746
|
+
//# sourceMappingURL=p-Dl9wTOvC.js.map
|
|
747
|
+
|
|
748
|
+
//# sourceMappingURL=p-Dl9wTOvC.js.map
|