@sellmate/design-system 0.0.6 → 0.0.7
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/design-system.cjs.js +1 -1
- package/dist/cjs/{index-eJV9DRUN.js → index-D3QUS1Eb.js} +647 -9
- package/dist/cjs/index-D3QUS1Eb.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sd-button_4.cjs.entry.js +1 -1
- package/dist/cjs/sd-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/sd-date-box_2.cjs.entry.js +1 -1
- package/dist/cjs/sd-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/sd-date-range-picker.cjs.entry.js +1 -1
- package/dist/cjs/sd-pagination_2.cjs.entry.js +2 -2
- package/dist/cjs/sd-popover.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-option.cjs.entry.js +1 -1
- package/dist/cjs/sd-select.cjs.entry.js +1 -1
- package/dist/cjs/sd-table.cjs.entry.js +1 -1
- package/dist/cjs/sd-tag.cjs.entry.js +1 -1
- package/dist/cjs/sd-tooltip-portal.cjs.entry.js +1 -1
- package/dist/cjs/{tooltipArrow-nBURRjhe.js → tooltipArrow-DKQk16So.js} +3 -3
- package/dist/cjs/{tooltipArrow-nBURRjhe.js.map → tooltipArrow-DKQk16So.js.map} +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-BMMcpjI2.js → p-BBcRxAHQ.js} +3 -3
- package/dist/components/{p-BMMcpjI2.js.map → p-BBcRxAHQ.js.map} +1 -1
- package/dist/components/{p-1fnLZFBF.js → p-BJe9kiv9.js} +4 -4
- package/dist/components/{p-1fnLZFBF.js.map → p-BJe9kiv9.js.map} +1 -1
- package/dist/components/{p-CMr_MjLT.js → p-BKNkY07K.js} +4 -4
- package/dist/components/{p-CMr_MjLT.js.map → p-BKNkY07K.js.map} +1 -1
- package/dist/components/{p-CCUdSU7s.js → p-CIPoof7_.js} +4 -4
- package/dist/components/{p-CCUdSU7s.js.map → p-CIPoof7_.js.map} +1 -1
- package/dist/components/{p-bMRGc2ya.js → p-CR_d0Wrj.js} +7 -7
- package/dist/components/{p-bMRGc2ya.js.map → p-CR_d0Wrj.js.map} +1 -1
- package/dist/components/{p-_COe-BX-.js → p-C_ZLFIzZ.js} +644 -9
- package/dist/components/p-C_ZLFIzZ.js.map +1 -0
- package/dist/components/{p-7h5r3_Oi.js → p-CcIaxZWu.js} +3 -3
- package/dist/components/{p-7h5r3_Oi.js.map → p-CcIaxZWu.js.map} +1 -1
- package/dist/components/{p-ZmqQTYnw.js → p-D7GkmGX3.js} +4 -4
- package/dist/components/{p-ZmqQTYnw.js.map → p-D7GkmGX3.js.map} +1 -1
- package/dist/components/{p-BTFW7ae2.js → p-DeANT-RC.js} +3 -3
- package/dist/components/{p-BTFW7ae2.js.map → p-DeANT-RC.js.map} +1 -1
- package/dist/components/{p-DDCjT-Wn.js → p-Dk7pK8T6.js} +3 -3
- package/dist/components/{p-DDCjT-Wn.js.map → p-Dk7pK8T6.js.map} +1 -1
- package/dist/components/{p-BFDQPvRY.js → p-DmNaQwtz.js} +5 -5
- package/dist/components/{p-BFDQPvRY.js.map → p-DmNaQwtz.js.map} +1 -1
- package/dist/components/{p-BTvDxJlL.js → p-DqOQpFv5.js} +3 -3
- package/dist/components/{p-BTvDxJlL.js.map → p-DqOQpFv5.js.map} +1 -1
- package/dist/components/sd-button.js +1 -1
- package/dist/components/sd-checkbox.js +1 -1
- package/dist/components/sd-date-box.js +1 -1
- package/dist/components/sd-date-picker.js +5 -5
- package/dist/components/sd-date-range-picker.js +5 -5
- package/dist/components/sd-guide.js +4 -4
- package/dist/components/sd-icon.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +5 -5
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-select-option.js +1 -1
- package/dist/components/sd-select.js +6 -6
- package/dist/components/sd-table.js +7 -7
- package/dist/components/sd-tag.js +1 -1
- package/dist/components/sd-tooltip-portal.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/{p-48b56d5a.entry.js → p-0366ba33.entry.js} +2 -2
- package/dist/design-system/{p-7d7eed25.entry.js → p-0bdf567e.entry.js} +2 -2
- package/dist/design-system/{p-978b5165.entry.js → p-10264e8e.entry.js} +2 -2
- package/dist/design-system/{p-7353d0bb.entry.js → p-24f6b072.entry.js} +2 -2
- package/dist/design-system/{p-6d7ade66.entry.js → p-329d3532.entry.js} +2 -2
- package/dist/design-system/{p-5b9b8671.entry.js → p-764e14ea.entry.js} +2 -2
- package/dist/design-system/{p-0f158e53.entry.js → p-8844ec3b.entry.js} +2 -2
- package/dist/design-system/{p-4bc173bc.entry.js → p-94f7e066.entry.js} +2 -2
- package/dist/design-system/p-B9LQNxjd.js +2 -0
- package/dist/design-system/{p-Di8dUbCh.js.map → p-B9LQNxjd.js.map} +1 -1
- package/dist/design-system/p-DzM-iWij.js +3 -0
- package/dist/design-system/p-DzM-iWij.js.map +1 -0
- package/dist/design-system/{p-6f114a26.entry.js → p-a24a9772.entry.js} +2 -2
- package/dist/design-system/{p-a8ff23ce.entry.js → p-a9713309.entry.js} +2 -2
- package/dist/design-system/{p-21022434.entry.js → p-bc64ffa7.entry.js} +2 -2
- package/dist/design-system/{p-1959dd61.entry.js → p-df03331a.entry.js} +2 -2
- package/dist/esm/design-system.js +2 -2
- package/dist/esm/{index-KauK5hO3.js → index-DzM-iWij.js} +647 -9
- package/dist/esm/index-DzM-iWij.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sd-button_4.entry.js +1 -1
- package/dist/esm/sd-checkbox.entry.js +1 -1
- package/dist/esm/sd-date-box_2.entry.js +1 -1
- package/dist/esm/sd-date-picker.entry.js +1 -1
- package/dist/esm/sd-date-range-picker.entry.js +1 -1
- package/dist/esm/sd-pagination_2.entry.js +2 -2
- package/dist/esm/sd-popover.entry.js +2 -2
- package/dist/esm/sd-select-option.entry.js +1 -1
- package/dist/esm/sd-select.entry.js +1 -1
- package/dist/esm/sd-table.entry.js +1 -1
- package/dist/esm/sd-tag.entry.js +1 -1
- package/dist/esm/sd-tooltip-portal.entry.js +1 -1
- package/dist/esm/{tooltipArrow-BlfIbijp.js → tooltipArrow-Dybd-1up.js} +3 -3
- package/dist/esm/{tooltipArrow-BlfIbijp.js.map → tooltipArrow-Dybd-1up.js.map} +1 -1
- package/package.json +2 -2
- package/dist/cjs/index-eJV9DRUN.js.map +0 -1
- package/dist/components/p-_COe-BX-.js.map +0 -1
- package/dist/design-system/p-Di8dUbCh.js +0 -2
- package/dist/design-system/p-KauK5hO3.js +0 -3
- package/dist/design-system/p-KauK5hO3.js.map +0 -1
- package/dist/esm/index-KauK5hO3.js.map +0 -1
- /package/dist/design-system/{p-48b56d5a.entry.js.map → p-0366ba33.entry.js.map} +0 -0
- /package/dist/design-system/{p-7d7eed25.entry.js.map → p-0bdf567e.entry.js.map} +0 -0
- /package/dist/design-system/{p-978b5165.entry.js.map → p-10264e8e.entry.js.map} +0 -0
- /package/dist/design-system/{p-7353d0bb.entry.js.map → p-24f6b072.entry.js.map} +0 -0
- /package/dist/design-system/{p-6d7ade66.entry.js.map → p-329d3532.entry.js.map} +0 -0
- /package/dist/design-system/{p-5b9b8671.entry.js.map → p-764e14ea.entry.js.map} +0 -0
- /package/dist/design-system/{p-0f158e53.entry.js.map → p-8844ec3b.entry.js.map} +0 -0
- /package/dist/design-system/{p-4bc173bc.entry.js.map → p-94f7e066.entry.js.map} +0 -0
- /package/dist/design-system/{p-6f114a26.entry.js.map → p-a24a9772.entry.js.map} +0 -0
- /package/dist/design-system/{p-a8ff23ce.entry.js.map → p-a9713309.entry.js.map} +0 -0
- /package/dist/design-system/{p-21022434.entry.js.map → p-bc64ffa7.entry.js.map} +0 -0
- /package/dist/design-system/{p-1959dd61.entry.js.map → p-df03331a.entry.js.map} +0 -0
|
@@ -18,6 +18,30 @@ var __export = (target, all) => {
|
|
|
18
18
|
// src/utils/constants.ts
|
|
19
19
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
20
20
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
21
|
+
var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
|
|
22
|
+
PrimitiveType2["Undefined"] = "undefined";
|
|
23
|
+
PrimitiveType2["Null"] = "null";
|
|
24
|
+
PrimitiveType2["String"] = "string";
|
|
25
|
+
PrimitiveType2["Number"] = "number";
|
|
26
|
+
PrimitiveType2["SpecialNumber"] = "number";
|
|
27
|
+
PrimitiveType2["Boolean"] = "boolean";
|
|
28
|
+
PrimitiveType2["BigInt"] = "bigint";
|
|
29
|
+
return PrimitiveType2;
|
|
30
|
+
})(PrimitiveType || {});
|
|
31
|
+
var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
|
|
32
|
+
NonPrimitiveType2["Array"] = "array";
|
|
33
|
+
NonPrimitiveType2["Date"] = "date";
|
|
34
|
+
NonPrimitiveType2["Map"] = "map";
|
|
35
|
+
NonPrimitiveType2["Object"] = "object";
|
|
36
|
+
NonPrimitiveType2["RegularExpression"] = "regexp";
|
|
37
|
+
NonPrimitiveType2["Set"] = "set";
|
|
38
|
+
NonPrimitiveType2["Channel"] = "channel";
|
|
39
|
+
NonPrimitiveType2["Symbol"] = "symbol";
|
|
40
|
+
return NonPrimitiveType2;
|
|
41
|
+
})(NonPrimitiveType || {});
|
|
42
|
+
var TYPE_CONSTANT = "type";
|
|
43
|
+
var VALUE_CONSTANT = "value";
|
|
44
|
+
var SERIALIZED_PREFIX = "serialized:";
|
|
21
45
|
|
|
22
46
|
// src/utils/es2022-rewire-class-members.ts
|
|
23
47
|
var reWireGetterSetter = (instance, hostRef) => {
|
|
@@ -128,6 +152,16 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
128
152
|
|
|
129
153
|
// src/client/client-style.ts
|
|
130
154
|
var styles = /* @__PURE__ */ new Map();
|
|
155
|
+
|
|
156
|
+
// src/runtime/runtime-constants.ts
|
|
157
|
+
var CONTENT_REF_ID = "r";
|
|
158
|
+
var ORG_LOCATION_ID = "o";
|
|
159
|
+
var SLOT_NODE_ID = "s";
|
|
160
|
+
var TEXT_NODE_ID = "t";
|
|
161
|
+
var COMMENT_NODE_ID = "c";
|
|
162
|
+
var HYDRATE_ID = "s-id";
|
|
163
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
164
|
+
var HYDRATE_CHILD_ID = "c-id";
|
|
131
165
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
132
166
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
133
167
|
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
@@ -222,6 +256,101 @@ var escapeRegExpSpecialCharacters = (text) => {
|
|
|
222
256
|
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
223
257
|
};
|
|
224
258
|
|
|
259
|
+
// src/utils/remote-value.ts
|
|
260
|
+
var RemoteValue = class _RemoteValue {
|
|
261
|
+
/**
|
|
262
|
+
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
263
|
+
*
|
|
264
|
+
* @param serialized The serialized LocalValue object
|
|
265
|
+
* @returns The original JavaScript value/object
|
|
266
|
+
*/
|
|
267
|
+
static fromLocalValue(serialized) {
|
|
268
|
+
const type = serialized[TYPE_CONSTANT];
|
|
269
|
+
const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
270
|
+
switch (type) {
|
|
271
|
+
case "string" /* String */:
|
|
272
|
+
return value;
|
|
273
|
+
case "boolean" /* Boolean */:
|
|
274
|
+
return value;
|
|
275
|
+
case "bigint" /* BigInt */:
|
|
276
|
+
return BigInt(value);
|
|
277
|
+
case "undefined" /* Undefined */:
|
|
278
|
+
return void 0;
|
|
279
|
+
case "null" /* Null */:
|
|
280
|
+
return null;
|
|
281
|
+
case "number" /* Number */:
|
|
282
|
+
if (value === "NaN") return NaN;
|
|
283
|
+
if (value === "-0") return -0;
|
|
284
|
+
if (value === "Infinity") return Infinity;
|
|
285
|
+
if (value === "-Infinity") return -Infinity;
|
|
286
|
+
return value;
|
|
287
|
+
case "array" /* Array */:
|
|
288
|
+
return value.map((item) => _RemoteValue.fromLocalValue(item));
|
|
289
|
+
case "date" /* Date */:
|
|
290
|
+
return new Date(value);
|
|
291
|
+
case "map" /* Map */:
|
|
292
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
293
|
+
for (const [key, val] of value) {
|
|
294
|
+
const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
|
|
295
|
+
const deserializedValue = _RemoteValue.fromLocalValue(val);
|
|
296
|
+
map2.set(deserializedKey, deserializedValue);
|
|
297
|
+
}
|
|
298
|
+
return map2;
|
|
299
|
+
case "object" /* Object */:
|
|
300
|
+
const obj = {};
|
|
301
|
+
for (const [key, val] of value) {
|
|
302
|
+
obj[key] = _RemoteValue.fromLocalValue(val);
|
|
303
|
+
}
|
|
304
|
+
return obj;
|
|
305
|
+
case "regexp" /* RegularExpression */:
|
|
306
|
+
const { pattern, flags } = value;
|
|
307
|
+
return new RegExp(pattern, flags);
|
|
308
|
+
case "set" /* Set */:
|
|
309
|
+
const set = /* @__PURE__ */ new Set();
|
|
310
|
+
for (const item of value) {
|
|
311
|
+
set.add(_RemoteValue.fromLocalValue(item));
|
|
312
|
+
}
|
|
313
|
+
return set;
|
|
314
|
+
case "symbol" /* Symbol */:
|
|
315
|
+
return Symbol(value);
|
|
316
|
+
default:
|
|
317
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Utility method to deserialize multiple LocalValues at once
|
|
322
|
+
*
|
|
323
|
+
* @param serializedValues Array of serialized LocalValue objects
|
|
324
|
+
* @returns Array of deserialized JavaScript values
|
|
325
|
+
*/
|
|
326
|
+
static fromLocalValueArray(serializedValues) {
|
|
327
|
+
return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
331
|
+
*
|
|
332
|
+
* @param obj Object to verify
|
|
333
|
+
* @returns boolean indicating if the object has LocalValue structure
|
|
334
|
+
*/
|
|
335
|
+
static isLocalValueObject(obj) {
|
|
336
|
+
if (typeof obj !== "object" || obj === null) {
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
const type = obj[TYPE_CONSTANT];
|
|
343
|
+
const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
|
|
344
|
+
if (!hasTypeProperty) {
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
|
|
348
|
+
return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
349
|
+
}
|
|
350
|
+
return true;
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
|
|
225
354
|
// src/utils/result.ts
|
|
226
355
|
var result_exports = {};
|
|
227
356
|
__export(result_exports, {
|
|
@@ -271,6 +400,14 @@ var unwrapErr = (result) => {
|
|
|
271
400
|
}
|
|
272
401
|
};
|
|
273
402
|
|
|
403
|
+
// src/utils/serialize.ts
|
|
404
|
+
function deserializeProperty(value) {
|
|
405
|
+
if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
|
|
406
|
+
return value;
|
|
407
|
+
}
|
|
408
|
+
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
|
|
409
|
+
}
|
|
410
|
+
|
|
274
411
|
// src/utils/style.ts
|
|
275
412
|
function createStyleSheetIfNeededAndSupported(styles2) {
|
|
276
413
|
if (!supportsConstructableStylesheets) return void 0;
|
|
@@ -361,6 +498,34 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
|
361
498
|
}
|
|
362
499
|
return slotName === "";
|
|
363
500
|
};
|
|
501
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
502
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
const slottedNodeLocation = document.createTextNode("");
|
|
506
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
507
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
508
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
509
|
+
const appendMethod = internalCall(parent, "appendChild");
|
|
510
|
+
if (typeof position !== "undefined") {
|
|
511
|
+
slottedNodeLocation["s-oo"] = position;
|
|
512
|
+
const childNodes = internalCall(parent, "childNodes");
|
|
513
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
514
|
+
childNodes.forEach((n) => {
|
|
515
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
516
|
+
});
|
|
517
|
+
slotRelocateNodes.sort((a, b) => {
|
|
518
|
+
if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
|
|
519
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
520
|
+
return 0;
|
|
521
|
+
});
|
|
522
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
523
|
+
} else {
|
|
524
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
525
|
+
}
|
|
526
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
527
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
528
|
+
};
|
|
364
529
|
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
365
530
|
function patchSlotNode(node) {
|
|
366
531
|
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
@@ -445,7 +610,9 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
445
610
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
446
611
|
}
|
|
447
612
|
if (!appliedStyles.has(scopeId2)) {
|
|
448
|
-
{
|
|
613
|
+
if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
614
|
+
styleElm.innerHTML = style;
|
|
615
|
+
} else {
|
|
449
616
|
styleElm = win.document.createElement("style");
|
|
450
617
|
styleElm.innerHTML = style;
|
|
451
618
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
@@ -517,6 +684,17 @@ var attachStyles = (hostRef) => {
|
|
|
517
684
|
endAttachStyles();
|
|
518
685
|
};
|
|
519
686
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
687
|
+
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
688
|
+
var hydrateScopedToShadow = () => {
|
|
689
|
+
if (!win.document) {
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
693
|
+
let i2 = 0;
|
|
694
|
+
for (; i2 < styles2.length; i2++) {
|
|
695
|
+
registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
|
|
696
|
+
}
|
|
697
|
+
};
|
|
520
698
|
var h = (nodeName, vnodeData, ...children) => {
|
|
521
699
|
let child = null;
|
|
522
700
|
let key = null;
|
|
@@ -628,6 +806,422 @@ var convertToPrivate = (node) => {
|
|
|
628
806
|
vnode.$name$ = node.vname;
|
|
629
807
|
return vnode;
|
|
630
808
|
};
|
|
809
|
+
|
|
810
|
+
// src/runtime/client-hydrate.ts
|
|
811
|
+
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
812
|
+
var _a, _b;
|
|
813
|
+
const endHydrate = createTime("hydrateClient", tagName);
|
|
814
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
815
|
+
const childRenderNodes = [];
|
|
816
|
+
const slotNodes = [];
|
|
817
|
+
const slottedNodes = [];
|
|
818
|
+
const shadowRootNodes = shadowRoot ? [] : null;
|
|
819
|
+
const vnode = newVNode(tagName, null);
|
|
820
|
+
vnode.$elm$ = hostElm;
|
|
821
|
+
let scopeId2;
|
|
822
|
+
{
|
|
823
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
824
|
+
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
825
|
+
scopeId2 = hostElm["s-sc"];
|
|
826
|
+
hostElm.classList.add(scopeId2 + "-h");
|
|
827
|
+
} else if (hostElm["s-sc"]) {
|
|
828
|
+
delete hostElm["s-sc"];
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
|
|
832
|
+
initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
833
|
+
}
|
|
834
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
835
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
836
|
+
hostRef.$vnode$ = clientHydrate(
|
|
837
|
+
vnode,
|
|
838
|
+
childRenderNodes,
|
|
839
|
+
slotNodes,
|
|
840
|
+
shadowRootNodes,
|
|
841
|
+
hostElm,
|
|
842
|
+
hostElm,
|
|
843
|
+
hostId,
|
|
844
|
+
slottedNodes
|
|
845
|
+
);
|
|
846
|
+
let crIndex = 0;
|
|
847
|
+
const crLength = childRenderNodes.length;
|
|
848
|
+
let childRenderNode;
|
|
849
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
|
850
|
+
childRenderNode = childRenderNodes[crIndex];
|
|
851
|
+
const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
|
|
852
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
853
|
+
const node = childRenderNode.$elm$;
|
|
854
|
+
if (!shadowRoot) {
|
|
855
|
+
node["s-hn"] = tagName.toUpperCase();
|
|
856
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
857
|
+
node["s-cr"] = hostElm["s-cr"];
|
|
858
|
+
}
|
|
859
|
+
} else if (((_a = childRenderNode.$tag$) == null ? void 0 : _a.toString().includes("-")) && childRenderNode.$tag$ !== "slot-fb" && !childRenderNode.$elm$.shadowRoot) {
|
|
860
|
+
const cmpMeta = getHostRef(childRenderNode.$elm$);
|
|
861
|
+
if (cmpMeta) {
|
|
862
|
+
const scopeId3 = getScopeId(
|
|
863
|
+
cmpMeta.$cmpMeta$);
|
|
864
|
+
const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
|
|
865
|
+
if (styleSheet) {
|
|
866
|
+
hostElm.shadowRoot.append(styleSheet.cloneNode(true));
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
871
|
+
childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
|
|
872
|
+
if (childRenderNode.$children$) {
|
|
873
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
874
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
875
|
+
childRenderNode.$children$.forEach((c) => {
|
|
876
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
} else {
|
|
880
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
884
|
+
if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
|
|
885
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
886
|
+
}
|
|
887
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
888
|
+
if (!shadowRoot) {
|
|
889
|
+
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
if (orgLocationNode && !orgLocationNode["s-id"]) {
|
|
893
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
const hosts = [];
|
|
897
|
+
const snLen = slottedNodes.length;
|
|
898
|
+
let snIndex = 0;
|
|
899
|
+
let slotGroup;
|
|
900
|
+
let snGroupIdx;
|
|
901
|
+
let snGroupLen;
|
|
902
|
+
let slottedItem;
|
|
903
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
|
904
|
+
slotGroup = slottedNodes[snIndex];
|
|
905
|
+
if (!slotGroup || !slotGroup.length) continue;
|
|
906
|
+
snGroupLen = slotGroup.length;
|
|
907
|
+
snGroupIdx = 0;
|
|
908
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
909
|
+
slottedItem = slotGroup[snGroupIdx];
|
|
910
|
+
if (!hosts[slottedItem.hostId]) {
|
|
911
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
912
|
+
}
|
|
913
|
+
if (!hosts[slottedItem.hostId]) continue;
|
|
914
|
+
const hostEle = hosts[slottedItem.hostId];
|
|
915
|
+
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
916
|
+
hostEle.appendChild(slottedItem.node);
|
|
917
|
+
}
|
|
918
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
919
|
+
if (!slottedItem.slot["s-cr"]) {
|
|
920
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
921
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
922
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
923
|
+
} else {
|
|
924
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
928
|
+
if (((_b = slottedItem.node.parentElement) == null ? void 0 : _b.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
|
|
929
|
+
slottedItem.node.removeAttribute("slot");
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
if (scopeId2 && slotNodes.length) {
|
|
935
|
+
slotNodes.forEach((slot) => {
|
|
936
|
+
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
if (shadowRoot) {
|
|
940
|
+
let rnIdex = 0;
|
|
941
|
+
const rnLen = shadowRootNodes.length;
|
|
942
|
+
if (rnLen) {
|
|
943
|
+
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
944
|
+
const node = shadowRootNodes[rnIdex];
|
|
945
|
+
if (node) {
|
|
946
|
+
shadowRoot.appendChild(node);
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
Array.from(hostElm.childNodes).forEach((node) => {
|
|
950
|
+
if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
|
|
951
|
+
if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
|
|
952
|
+
node.removeAttribute("hidden");
|
|
953
|
+
} else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
954
|
+
node.parentNode.removeChild(node);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
hostRef.$hostElement$ = hostElm;
|
|
961
|
+
endHydrate();
|
|
962
|
+
};
|
|
963
|
+
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
|
964
|
+
let childNodeType;
|
|
965
|
+
let childIdSplt;
|
|
966
|
+
let childVNode;
|
|
967
|
+
let i2;
|
|
968
|
+
const scopeId2 = hostElm["s-sc"];
|
|
969
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
970
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
971
|
+
if (childNodeType) {
|
|
972
|
+
childIdSplt = childNodeType.split(".");
|
|
973
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
974
|
+
childVNode = createSimpleVNode({
|
|
975
|
+
$flags$: 0,
|
|
976
|
+
$hostId$: childIdSplt[0],
|
|
977
|
+
$nodeId$: childIdSplt[1],
|
|
978
|
+
$depth$: childIdSplt[2],
|
|
979
|
+
$index$: childIdSplt[3],
|
|
980
|
+
$tag$: node.tagName.toLowerCase(),
|
|
981
|
+
$elm$: node,
|
|
982
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
983
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
984
|
+
$attrs$: { class: node.className || "" }
|
|
985
|
+
});
|
|
986
|
+
childRenderNodes.push(childVNode);
|
|
987
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
988
|
+
if (!parentVNode.$children$) {
|
|
989
|
+
parentVNode.$children$ = [];
|
|
990
|
+
}
|
|
991
|
+
if (scopeId2 && childIdSplt[0] === hostId) {
|
|
992
|
+
node["s-si"] = scopeId2;
|
|
993
|
+
childVNode.$attrs$.class += " " + scopeId2;
|
|
994
|
+
}
|
|
995
|
+
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
996
|
+
if (typeof slotName === "string") {
|
|
997
|
+
if (childVNode.$tag$ === "slot-fb") {
|
|
998
|
+
addSlot(
|
|
999
|
+
slotName,
|
|
1000
|
+
childIdSplt[2],
|
|
1001
|
+
childVNode,
|
|
1002
|
+
node,
|
|
1003
|
+
parentVNode,
|
|
1004
|
+
childRenderNodes,
|
|
1005
|
+
slotNodes,
|
|
1006
|
+
shadowRootNodes,
|
|
1007
|
+
slottedNodes
|
|
1008
|
+
);
|
|
1009
|
+
if (scopeId2) {
|
|
1010
|
+
node.classList.add(scopeId2);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
childVNode.$elm$["s-sn"] = slotName;
|
|
1014
|
+
childVNode.$elm$.removeAttribute("s-sn");
|
|
1015
|
+
}
|
|
1016
|
+
if (childVNode.$index$ !== void 0) {
|
|
1017
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1018
|
+
}
|
|
1019
|
+
parentVNode = childVNode;
|
|
1020
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1021
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
if (node.shadowRoot) {
|
|
1026
|
+
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
1027
|
+
clientHydrate(
|
|
1028
|
+
parentVNode,
|
|
1029
|
+
childRenderNodes,
|
|
1030
|
+
slotNodes,
|
|
1031
|
+
shadowRootNodes,
|
|
1032
|
+
hostElm,
|
|
1033
|
+
node.shadowRoot.childNodes[i2],
|
|
1034
|
+
hostId,
|
|
1035
|
+
slottedNodes
|
|
1036
|
+
);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
1040
|
+
for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
|
|
1041
|
+
clientHydrate(
|
|
1042
|
+
parentVNode,
|
|
1043
|
+
childRenderNodes,
|
|
1044
|
+
slotNodes,
|
|
1045
|
+
shadowRootNodes,
|
|
1046
|
+
hostElm,
|
|
1047
|
+
nonShadowNodes[i2],
|
|
1048
|
+
hostId,
|
|
1049
|
+
slottedNodes
|
|
1050
|
+
);
|
|
1051
|
+
}
|
|
1052
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
1053
|
+
childIdSplt = node.nodeValue.split(".");
|
|
1054
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
1055
|
+
childNodeType = childIdSplt[0];
|
|
1056
|
+
childVNode = createSimpleVNode({
|
|
1057
|
+
$hostId$: childIdSplt[1],
|
|
1058
|
+
$nodeId$: childIdSplt[2],
|
|
1059
|
+
$depth$: childIdSplt[3],
|
|
1060
|
+
$index$: childIdSplt[4] || "0",
|
|
1061
|
+
$elm$: node,
|
|
1062
|
+
$attrs$: null,
|
|
1063
|
+
$children$: null,
|
|
1064
|
+
$key$: null,
|
|
1065
|
+
$name$: null,
|
|
1066
|
+
$tag$: null,
|
|
1067
|
+
$text$: null
|
|
1068
|
+
});
|
|
1069
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
1070
|
+
childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
|
|
1071
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
1072
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
1073
|
+
childRenderNodes.push(childVNode);
|
|
1074
|
+
node.remove();
|
|
1075
|
+
if (hostId === childVNode.$hostId$) {
|
|
1076
|
+
if (!parentVNode.$children$) {
|
|
1077
|
+
parentVNode.$children$ = [];
|
|
1078
|
+
}
|
|
1079
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1080
|
+
}
|
|
1081
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1082
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
} else if (childNodeType === COMMENT_NODE_ID) {
|
|
1086
|
+
childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
|
|
1087
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
|
|
1088
|
+
childRenderNodes.push(childVNode);
|
|
1089
|
+
node.remove();
|
|
1090
|
+
}
|
|
1091
|
+
} else if (childVNode.$hostId$ === hostId) {
|
|
1092
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
1093
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
1094
|
+
addSlot(
|
|
1095
|
+
slotName,
|
|
1096
|
+
childIdSplt[2],
|
|
1097
|
+
childVNode,
|
|
1098
|
+
node,
|
|
1099
|
+
parentVNode,
|
|
1100
|
+
childRenderNodes,
|
|
1101
|
+
slotNodes,
|
|
1102
|
+
shadowRootNodes,
|
|
1103
|
+
slottedNodes
|
|
1104
|
+
);
|
|
1105
|
+
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1106
|
+
if (shadowRootNodes) {
|
|
1107
|
+
node.remove();
|
|
1108
|
+
} else {
|
|
1109
|
+
hostElm["s-cr"] = node;
|
|
1110
|
+
node["s-cn"] = true;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
1116
|
+
const vnode = newVNode(null, node.textContent);
|
|
1117
|
+
vnode.$elm$ = node;
|
|
1118
|
+
vnode.$index$ = "0";
|
|
1119
|
+
parentVNode.$children$ = [vnode];
|
|
1120
|
+
} else {
|
|
1121
|
+
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim() && !node["s-nr"]) {
|
|
1122
|
+
node.remove();
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
return parentVNode;
|
|
1126
|
+
};
|
|
1127
|
+
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
1128
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
1129
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
|
1130
|
+
if (componentId) {
|
|
1131
|
+
orgLocNodes.set(componentId, node);
|
|
1132
|
+
}
|
|
1133
|
+
let i2 = 0;
|
|
1134
|
+
if (node.shadowRoot) {
|
|
1135
|
+
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
1136
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
1140
|
+
for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
|
|
1141
|
+
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
1142
|
+
}
|
|
1143
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
1144
|
+
const childIdSplt = node.nodeValue.split(".");
|
|
1145
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
1146
|
+
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
1147
|
+
node.nodeValue = "";
|
|
1148
|
+
node["s-en"] = childIdSplt[3];
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
};
|
|
1152
|
+
var createSimpleVNode = (vnode) => {
|
|
1153
|
+
const defaultVNode = {
|
|
1154
|
+
$flags$: 0,
|
|
1155
|
+
$hostId$: null,
|
|
1156
|
+
$nodeId$: null,
|
|
1157
|
+
$depth$: null,
|
|
1158
|
+
$index$: "0",
|
|
1159
|
+
$elm$: null,
|
|
1160
|
+
$attrs$: null,
|
|
1161
|
+
$children$: null,
|
|
1162
|
+
$key$: null,
|
|
1163
|
+
$name$: null,
|
|
1164
|
+
$tag$: null,
|
|
1165
|
+
$text$: null
|
|
1166
|
+
};
|
|
1167
|
+
return { ...defaultVNode, ...vnode };
|
|
1168
|
+
};
|
|
1169
|
+
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
1170
|
+
node["s-sr"] = true;
|
|
1171
|
+
childVNode.$name$ = slotName || null;
|
|
1172
|
+
childVNode.$tag$ = "slot";
|
|
1173
|
+
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1174
|
+
if (shadowRootNodes && win.document) {
|
|
1175
|
+
const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
|
|
1176
|
+
if (childVNode.$name$) {
|
|
1177
|
+
childVNode.$elm$.setAttribute("name", slotName);
|
|
1178
|
+
}
|
|
1179
|
+
if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
1180
|
+
internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
|
|
1181
|
+
} else {
|
|
1182
|
+
internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
|
|
1183
|
+
}
|
|
1184
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
1185
|
+
node.remove();
|
|
1186
|
+
if (childVNode.$depth$ === "0") {
|
|
1187
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1188
|
+
}
|
|
1189
|
+
} else {
|
|
1190
|
+
const slot = childVNode.$elm$;
|
|
1191
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
1192
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
1193
|
+
patchSlotNode(node);
|
|
1194
|
+
if (shouldMove) {
|
|
1195
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
childRenderNodes.push(childVNode);
|
|
1199
|
+
slotNodes.push(childVNode);
|
|
1200
|
+
if (!parentVNode.$children$) {
|
|
1201
|
+
parentVNode.$children$ = [];
|
|
1202
|
+
}
|
|
1203
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1204
|
+
}
|
|
1205
|
+
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
1206
|
+
var _a, _b;
|
|
1207
|
+
let slottedNode = slotNode.nextSibling;
|
|
1208
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
1209
|
+
if (!slottedNode || ((_a = slottedNode.nodeValue) == null ? void 0 : _a.startsWith(SLOT_NODE_ID + "."))) return;
|
|
1210
|
+
do {
|
|
1211
|
+
if (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (!slottedNode["getAttribute"] || !slottedNode.getAttribute("slot")) && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */))) {
|
|
1212
|
+
slottedNode["s-sn"] = slotName;
|
|
1213
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
1214
|
+
}
|
|
1215
|
+
slottedNode = slottedNode == null ? void 0 : slottedNode.nextSibling;
|
|
1216
|
+
} while (slottedNode && !((_b = slottedNode.nodeValue) == null ? void 0 : _b.startsWith(SLOT_NODE_ID + ".")));
|
|
1217
|
+
};
|
|
1218
|
+
var findCorrespondingNode = (node, type) => {
|
|
1219
|
+
let sibling = node;
|
|
1220
|
+
do {
|
|
1221
|
+
sibling = sibling.nextSibling;
|
|
1222
|
+
} while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
|
|
1223
|
+
return sibling;
|
|
1224
|
+
};
|
|
631
1225
|
var createSupportsRuleRe = (selector) => {
|
|
632
1226
|
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
633
1227
|
return new RegExp(
|
|
@@ -641,6 +1235,10 @@ createSupportsRuleRe("::slotted");
|
|
|
641
1235
|
createSupportsRuleRe(":host");
|
|
642
1236
|
createSupportsRuleRe(":host-context");
|
|
643
1237
|
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
1238
|
+
if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
1239
|
+
propValue = deserializeProperty(propValue);
|
|
1240
|
+
return propValue;
|
|
1241
|
+
}
|
|
644
1242
|
if (propValue != null && !isComplexType(propValue)) {
|
|
645
1243
|
if (propType & 4 /* Boolean */) {
|
|
646
1244
|
{
|
|
@@ -691,7 +1289,15 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
691
1289
|
const classList = elm.classList;
|
|
692
1290
|
const oldClasses = parseClassList(oldValue);
|
|
693
1291
|
let newClasses = parseClassList(newValue);
|
|
694
|
-
{
|
|
1292
|
+
if ((elm["s-si"] || elm["s-sc"]) && initialRender) {
|
|
1293
|
+
const scopeId2 = elm["s-sc"] || elm["s-si"];
|
|
1294
|
+
newClasses.push(scopeId2);
|
|
1295
|
+
oldClasses.forEach((c) => {
|
|
1296
|
+
if (c.startsWith(scopeId2)) newClasses.push(c);
|
|
1297
|
+
});
|
|
1298
|
+
newClasses = [...new Set(newClasses)].filter((c) => c);
|
|
1299
|
+
classList.add(...newClasses);
|
|
1300
|
+
} else {
|
|
695
1301
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
696
1302
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
697
1303
|
}
|
|
@@ -811,7 +1417,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
811
1417
|
oldVnodeAttrs[memberName],
|
|
812
1418
|
void 0,
|
|
813
1419
|
isSvgMode2,
|
|
814
|
-
newVnode.$flags
|
|
1420
|
+
newVnode.$flags$,
|
|
1421
|
+
isInitialRender
|
|
1422
|
+
);
|
|
815
1423
|
}
|
|
816
1424
|
}
|
|
817
1425
|
}
|
|
@@ -822,7 +1430,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
822
1430
|
oldVnodeAttrs[memberName],
|
|
823
1431
|
newVnodeAttrs[memberName],
|
|
824
1432
|
isSvgMode2,
|
|
825
|
-
newVnode.$flags
|
|
1433
|
+
newVnode.$flags$,
|
|
1434
|
+
isInitialRender
|
|
1435
|
+
);
|
|
826
1436
|
}
|
|
827
1437
|
};
|
|
828
1438
|
function sortedAttrNames(attrNames) {
|
|
@@ -1107,7 +1717,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1107
1717
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1108
1718
|
}
|
|
1109
1719
|
{
|
|
1110
|
-
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
1720
|
+
updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
|
|
1111
1721
|
}
|
|
1112
1722
|
if (oldChildren !== null && newChildren !== null) {
|
|
1113
1723
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
@@ -1121,7 +1731,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1121
1731
|
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
1122
1732
|
) {
|
|
1123
1733
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1124
|
-
} else
|
|
1734
|
+
} else if (isInitialRender && BUILD.updatable && oldChildren !== null && newChildren === null) {
|
|
1735
|
+
newVNode2.$children$ = oldChildren;
|
|
1736
|
+
}
|
|
1125
1737
|
if (isSvgMode && tag === "svg") {
|
|
1126
1738
|
isSvgMode = false;
|
|
1127
1739
|
}
|
|
@@ -1477,7 +2089,13 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1477
2089
|
}
|
|
1478
2090
|
};
|
|
1479
2091
|
var appDidLoad = (who) => {
|
|
2092
|
+
var _a;
|
|
1480
2093
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
2094
|
+
{
|
|
2095
|
+
if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
|
|
2096
|
+
plt.$orgLocNodes$.clear();
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
1481
2099
|
};
|
|
1482
2100
|
var safeCall = (instance, method, arg, elm) => {
|
|
1483
2101
|
if (instance && instance[method]) {
|
|
@@ -1789,7 +2407,21 @@ var connectedCallback = (elm) => {
|
|
|
1789
2407
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1790
2408
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1791
2409
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2410
|
+
let hostId;
|
|
1792
2411
|
{
|
|
2412
|
+
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2413
|
+
if (hostId) {
|
|
2414
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2415
|
+
const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
|
|
2416
|
+
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2417
|
+
} else if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2418
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
2419
|
+
elm["s-sc"] = scopeId2;
|
|
2420
|
+
}
|
|
2421
|
+
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
if (!hostId) {
|
|
1793
2425
|
if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1794
2426
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1795
2427
|
setContentReference(elm);
|
|
@@ -1798,7 +2430,7 @@ var connectedCallback = (elm) => {
|
|
|
1798
2430
|
{
|
|
1799
2431
|
let ancestorComponent = elm;
|
|
1800
2432
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
1801
|
-
if (ancestorComponent["s-p"]) {
|
|
2433
|
+
if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
1802
2434
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
1803
2435
|
break;
|
|
1804
2436
|
}
|
|
@@ -1884,6 +2516,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1884
2516
|
let isBootstrapping = true;
|
|
1885
2517
|
Object.assign(plt, options);
|
|
1886
2518
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
2519
|
+
{
|
|
2520
|
+
plt.$flags$ |= 2 /* appLoaded */;
|
|
2521
|
+
}
|
|
2522
|
+
{
|
|
2523
|
+
hydrateScopedToShadow();
|
|
2524
|
+
}
|
|
1887
2525
|
let hasSlotRelocation = false;
|
|
1888
2526
|
lazyBundles.map((lazyBundle) => {
|
|
1889
2527
|
lazyBundle[1].map((compactMeta) => {
|
|
@@ -2062,6 +2700,6 @@ exports.h = h;
|
|
|
2062
2700
|
exports.promiseResolve = promiseResolve;
|
|
2063
2701
|
exports.registerInstance = registerInstance;
|
|
2064
2702
|
exports.setNonce = setNonce;
|
|
2065
|
-
//# sourceMappingURL=index-
|
|
2703
|
+
//# sourceMappingURL=index-D3QUS1Eb.js.map
|
|
2066
2704
|
|
|
2067
|
-
//# sourceMappingURL=index-
|
|
2705
|
+
//# sourceMappingURL=index-D3QUS1Eb.js.map
|