@uh-design-system/component-library 0.4.0 → 0.4.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/cjs/component-library.cjs.js +3 -3
- package/dist/cjs/controlUtils-041de0fd.js +7 -0
- package/dist/cjs/ds-accordion_3.cjs.entry.js +27 -20
- package/dist/cjs/ds-checkbox-group.cjs.entry.js +156 -0
- package/dist/cjs/ds-checkbox.cjs.entry.js +153 -0
- package/dist/cjs/ds-input-validity.cjs.entry.js +38 -0
- package/dist/cjs/ds-link-with-arrow.cjs.entry.js +8 -7
- package/dist/cjs/ds-link.cjs.entry.js +11 -8
- package/dist/cjs/ds-text-input.cjs.entry.js +30 -6
- package/dist/cjs/ds-visually-hidden.cjs.entry.js +2 -2
- package/dist/cjs/{index-bfa0f441.js → index-b2bddcf4.js} +326 -125
- package/dist/cjs/{linkUtils-695da37c.js → linkUtils-e911e899.js} +10 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/utils-c9113835.js +18 -0
- package/dist/collection/accessibility/accessibility.stories.js +10 -0
- package/dist/collection/accessibility/stories/ariaLabel.stories.js +19 -0
- package/dist/collection/accessibility/stories/ariaLabelledBy.stories.js +49 -0
- package/dist/collection/accessibility/stories/naming.stories.js +39 -0
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/00-foundations/icons/categories/information.js +4 -0
- package/dist/collection/components/00-foundations/typography/stories/typography.stories.js +133 -48
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.css +1 -1
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.js +6 -6
- package/dist/collection/components/01-base-components/ds-button/ds-button.css +9 -9
- package/dist/collection/components/01-base-components/ds-button/ds-button.js +2 -2
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.examples.stories.js +53 -12
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.features.stories.js +88 -55
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.stories.js +1 -1
- package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.css +144 -0
- package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.js +429 -0
- package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.features.stories.js +115 -0
- package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.stories.js +37 -0
- package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.css +38 -0
- package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.js +445 -0
- package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.js +89 -0
- package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.stories.js +47 -0
- package/dist/collection/components/01-base-components/ds-icon/ds-icon.js +1 -1
- package/dist/collection/components/01-base-components/ds-icon/{ds-icon.stories.js → stories/ds-icon.stories.js} +12 -2
- package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.css +31 -0
- package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.js +114 -0
- package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.features.stories.js +17 -0
- package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.stories.js +21 -0
- package/dist/collection/components/01-base-components/ds-link/ds-link.css +19 -139
- package/dist/collection/components/01-base-components/ds-link/ds-link.js +68 -8
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.examples.stories.js +6 -2
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.features.stories.js +2 -2
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.stories.js +15 -4
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +1 -139
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +25 -5
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/{ds-arrow-link.examples.stories.js → ds-link-with-arrow.examples.stories.js} +26 -3
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/{ds-arrow-link.stories.js → ds-link-with-arrow.stories.js} +5 -4
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.css +8 -11
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.js +30 -5
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.examples.stories.js +29 -7
- package/dist/collection/components/01-base-components/ds-text-input/utils.js +0 -6
- package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.js +1 -1
- package/dist/collection/utils/controls/controlUtils.js +2 -0
- package/dist/collection/utils/link/linkUtils.js +9 -0
- package/dist/collection/utils/typography/typographyUtils.js +39 -0
- package/dist/collection/utils/utils.js +24 -6
- package/dist/component-library/component-library.css +1 -1
- package/dist/component-library/component-library.esm.js +1 -1
- package/dist/component-library/controlUtils-9ca4087b.js +1 -0
- package/dist/component-library/ds-accordion_3.entry.js +1 -1
- package/dist/component-library/ds-checkbox-group.entry.js +1 -0
- package/dist/component-library/ds-checkbox.entry.js +1 -0
- package/dist/component-library/ds-input-validity.entry.js +1 -0
- package/dist/component-library/ds-link-with-arrow.entry.js +1 -1
- package/dist/component-library/ds-link.entry.js +1 -1
- package/dist/component-library/ds-text-input.entry.js +1 -1
- package/dist/component-library/ds-visually-hidden.entry.js +1 -1
- package/dist/component-library/index-50783b0c.js +2 -0
- package/dist/component-library/{linkUtils-3d1b28cf.js → linkUtils-fe63ff72.js} +1 -1
- package/dist/component-library/utils-b5843ae1.js +1 -0
- package/dist/components/attributes.js +1 -80
- package/dist/components/controlUtils.js +4 -0
- package/dist/components/ds-accordion.js +8 -8
- package/dist/components/ds-button2.js +4 -3
- package/dist/components/ds-checkbox-group.d.ts +11 -0
- package/dist/components/ds-checkbox-group.js +206 -0
- package/dist/components/ds-checkbox.d.ts +11 -0
- package/dist/components/ds-checkbox.js +6 -0
- package/dist/components/ds-checkbox2.js +185 -0
- package/dist/components/ds-icon2.js +24 -4
- package/dist/components/ds-input-validity.d.ts +11 -0
- package/dist/components/ds-input-validity.js +6 -0
- package/dist/components/ds-input-validity2.js +59 -0
- package/dist/components/ds-link-with-arrow.js +10 -8
- package/dist/components/ds-link.js +15 -9
- package/dist/components/ds-text-input.js +30 -7
- package/dist/components/ds-visually-hidden2.js +1 -1
- package/dist/components/index2.js +298 -130
- package/dist/components/index3.js +80 -0
- package/dist/components/linkUtils.js +10 -1
- package/dist/esm/component-library.js +4 -4
- package/dist/esm/controlUtils-9ca4087b.js +4 -0
- package/dist/esm/ds-accordion_3.entry.js +25 -18
- package/dist/esm/ds-checkbox-group.entry.js +152 -0
- package/dist/esm/ds-checkbox.entry.js +149 -0
- package/dist/esm/ds-input-validity.entry.js +34 -0
- package/dist/esm/ds-link-with-arrow.entry.js +8 -7
- package/dist/esm/ds-link.entry.js +11 -8
- package/dist/esm/ds-text-input.entry.js +30 -6
- package/dist/esm/ds-visually-hidden.entry.js +2 -2
- package/dist/esm/{index-42701395.js → index-50783b0c.js} +326 -126
- package/dist/esm/{linkUtils-3d1b28cf.js → linkUtils-fe63ff72.js} +10 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/utils-b5843ae1.js +15 -0
- package/dist/types/accessibility/accessibility.stories.d.ts +3 -0
- package/dist/types/accessibility/stories/ariaLabel.stories.d.ts +5 -0
- package/dist/types/accessibility/stories/ariaLabelledBy.stories.d.ts +4 -0
- package/dist/types/accessibility/stories/naming.stories.d.ts +4 -0
- package/dist/types/components/00-foundations/typography/stories/typography.stories.d.ts +1 -0
- package/dist/types/components/01-base-components/ds-button/stories/ds-button.examples.stories.d.ts +2 -0
- package/dist/types/components/01-base-components/ds-button/stories/ds-button.features.stories.d.ts +4 -1
- package/dist/types/components/01-base-components/ds-checkbox/ds-checkbox.d.ts +49 -0
- package/dist/types/components/01-base-components/ds-checkbox/stories/ds-checkbox.features.stories.d.ts +13 -0
- package/dist/types/components/01-base-components/ds-checkbox/stories/ds-checkbox.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-checkbox-group/ds-checkbox-group.d.ts +56 -0
- package/dist/types/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.d.ts +11 -0
- package/dist/types/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-icon/{ds-icon.stories.d.ts → stories/ds-icon.stories.d.ts} +2 -1
- package/dist/types/components/01-base-components/ds-input-validity/ds-input-validity.d.ts +12 -0
- package/dist/types/components/01-base-components/ds-input-validity/stories/ds-input-validity.features.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-input-validity/stories/ds-input-validity.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-link/ds-link.d.ts +4 -1
- package/dist/types/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.d.ts +1 -0
- package/dist/types/components/01-base-components/ds-text-input/ds-text-input.d.ts +5 -0
- package/dist/types/components/01-base-components/ds-text-input/utils.d.ts +0 -1
- package/dist/types/components.d.ts +142 -2
- package/dist/types/utils/controls/controlUtils.d.ts +2 -0
- package/dist/types/utils/link/linkUtils.d.ts +1 -0
- package/dist/types/utils/typography/typographyUtils.d.ts +5 -0
- package/dist/types/utils/utils.d.ts +10 -3
- package/package.json +19 -18
- package/dist/cjs/utils-8b73aa91.js +0 -10
- package/dist/collection/components/00-foundations/typography/typography.stories.js +0 -68
- package/dist/component-library/index-42701395.js +0 -2
- package/dist/component-library/utils-cca2a41a.js +0 -1
- package/dist/components/utils.js +0 -8
- package/dist/esm/utils-cca2a41a.js +0 -8
- package/dist/types/components/00-foundations/typography/typography.stories.d.ts +0 -7
- /package/dist/cjs/{attributes-f7831329.js → attributes-5f5b58be.js} +0 -0
- /package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/{ds-arrow-link.features.stories.js → ds-link-with-arrow.features.stories.js} +0 -0
- /package/dist/collection/utils/{attributes.js → attributes/attributes.js} +0 -0
- /package/dist/component-library/{attributes-9419ac39.js → attributes-7d09be1b.js} +0 -0
- /package/dist/esm/{attributes-9419ac39.js → attributes-7d09be1b.js} +0 -0
- /package/dist/types/components/01-base-components/ds-link-with-arrow/stories/{ds-arrow-link.examples.stories.d.ts → ds-link-with-arrow.examples.stories.d.ts} +0 -0
- /package/dist/types/components/01-base-components/ds-link-with-arrow/stories/{ds-arrow-link.features.stories.d.ts → ds-link-with-arrow.features.stories.d.ts} +0 -0
- /package/dist/types/components/01-base-components/ds-link-with-arrow/stories/{ds-arrow-link.stories.d.ts → ds-link-with-arrow.stories.d.ts} +0 -0
- /package/dist/types/utils/{attributes.d.ts → attributes/attributes.d.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const NAMESPACE = 'component-library';
|
|
2
|
-
const BUILD = /* component-library */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false,
|
|
2
|
+
const BUILD = /* component-library */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: true, hasRenderFn: true, hostListener: true, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: false, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: true, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: false, taskQueue: true, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.27.2 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
@@ -35,9 +35,12 @@ var reWireGetterSetter = (instance, hostRef) => {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
// src/client/client-host-ref.ts
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
var getHostRef = (ref) => {
|
|
39
|
+
if (ref.__stencil__getHostRef) {
|
|
40
|
+
return ref.__stencil__getHostRef();
|
|
41
|
+
}
|
|
42
|
+
return void 0;
|
|
43
|
+
};
|
|
41
44
|
var registerHost = (hostElement, cmpMeta) => {
|
|
42
45
|
const hostRef = {
|
|
43
46
|
$flags$: 0,
|
|
@@ -50,7 +53,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
50
53
|
hostElement["s-p"] = [];
|
|
51
54
|
hostElement["s-rc"] = [];
|
|
52
55
|
}
|
|
53
|
-
const ref =
|
|
56
|
+
const ref = hostRef;
|
|
57
|
+
hostElement.__stencil__getHostRef = () => ref;
|
|
54
58
|
{
|
|
55
59
|
reWireGetterSetter(hostElement, hostRef);
|
|
56
60
|
}
|
|
@@ -64,8 +68,13 @@ var styles = /* @__PURE__ */ new Map();
|
|
|
64
68
|
var HYDRATED_STYLE_ID = "sty-id";
|
|
65
69
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
66
70
|
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
71
|
+
var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
72
|
+
"formAssociatedCallback",
|
|
73
|
+
"formResetCallback",
|
|
74
|
+
"formDisabledCallback",
|
|
75
|
+
"formStateRestoreCallback"
|
|
76
|
+
];
|
|
67
77
|
var win = typeof window !== "undefined" ? window : {};
|
|
68
|
-
var doc = win.document || { head: {} };
|
|
69
78
|
var H = win.HTMLElement || class {
|
|
70
79
|
};
|
|
71
80
|
var plt = {
|
|
@@ -77,6 +86,23 @@ var plt = {
|
|
|
77
86
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
78
87
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
79
88
|
};
|
|
89
|
+
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
90
|
+
var _a;
|
|
91
|
+
let supportsListenerOptions2 = false;
|
|
92
|
+
try {
|
|
93
|
+
(_a = win.document) == null ? void 0 : _a.addEventListener(
|
|
94
|
+
"e",
|
|
95
|
+
null,
|
|
96
|
+
Object.defineProperty({}, "passive", {
|
|
97
|
+
get() {
|
|
98
|
+
supportsListenerOptions2 = true;
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
);
|
|
102
|
+
} catch (e) {
|
|
103
|
+
}
|
|
104
|
+
return supportsListenerOptions2;
|
|
105
|
+
})();
|
|
80
106
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
81
107
|
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
82
108
|
try {
|
|
@@ -137,9 +163,9 @@ var isComplexType = (o) => {
|
|
|
137
163
|
};
|
|
138
164
|
|
|
139
165
|
// src/utils/query-nonce-meta-tag-content.ts
|
|
140
|
-
function queryNonceMetaTagContent(
|
|
166
|
+
function queryNonceMetaTagContent(doc) {
|
|
141
167
|
var _a, _b, _c;
|
|
142
|
-
return (_c = (_b = (_a =
|
|
168
|
+
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;
|
|
143
169
|
}
|
|
144
170
|
|
|
145
171
|
// src/utils/result.ts
|
|
@@ -191,12 +217,11 @@ var unwrapErr = (result) => {
|
|
|
191
217
|
}
|
|
192
218
|
};
|
|
193
219
|
var updateFallbackSlotVisibility = (elm) => {
|
|
194
|
-
const childNodes = elm
|
|
220
|
+
const childNodes = internalCall(elm, "childNodes");
|
|
195
221
|
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
196
222
|
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
197
|
-
var _a;
|
|
198
223
|
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
199
|
-
if ((
|
|
224
|
+
if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
|
|
200
225
|
slotNode.hidden = true;
|
|
201
226
|
} else {
|
|
202
227
|
slotNode.hidden = false;
|
|
@@ -204,19 +229,31 @@ var updateFallbackSlotVisibility = (elm) => {
|
|
|
204
229
|
}
|
|
205
230
|
});
|
|
206
231
|
}
|
|
207
|
-
|
|
208
|
-
|
|
232
|
+
let i2 = 0;
|
|
233
|
+
for (i2 = 0; i2 < childNodes.length; i2++) {
|
|
234
|
+
const childNode = childNodes[i2];
|
|
235
|
+
if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
|
|
209
236
|
updateFallbackSlotVisibility(childNode);
|
|
210
237
|
}
|
|
211
238
|
}
|
|
212
239
|
};
|
|
240
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
241
|
+
const result = [];
|
|
242
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
243
|
+
const slottedNode = childNodes[i2]["s-nr"] || void 0;
|
|
244
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
245
|
+
result.push(slottedNode);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return result;
|
|
249
|
+
};
|
|
213
250
|
function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
214
251
|
let i2 = 0;
|
|
215
252
|
let slottedNodes = [];
|
|
216
253
|
let childNode;
|
|
217
254
|
for (; i2 < childNodes.length; i2++) {
|
|
218
255
|
childNode = childNodes[i2];
|
|
219
|
-
if (childNode["s-sr"] && childNode["s-hn"] === hostName && (slotName === void 0 || childNode
|
|
256
|
+
if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0 || getSlotName(childNode) === slotName)) {
|
|
220
257
|
slottedNodes.push(childNode);
|
|
221
258
|
if (typeof slotName !== "undefined") return slottedNodes;
|
|
222
259
|
}
|
|
@@ -224,11 +261,12 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
|
224
261
|
}
|
|
225
262
|
return slottedNodes;
|
|
226
263
|
}
|
|
227
|
-
var
|
|
264
|
+
var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
|
|
228
265
|
const childNodes = [];
|
|
229
|
-
if (includeSlot &&
|
|
230
|
-
|
|
231
|
-
|
|
266
|
+
if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
|
|
267
|
+
let node = slot;
|
|
268
|
+
while (node = node.nextSibling) {
|
|
269
|
+
if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
|
|
232
270
|
}
|
|
233
271
|
return childNodes;
|
|
234
272
|
};
|
|
@@ -247,6 +285,44 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
|
247
285
|
}
|
|
248
286
|
return slotName === "";
|
|
249
287
|
};
|
|
288
|
+
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
289
|
+
function patchSlotNode(node) {
|
|
290
|
+
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
291
|
+
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
292
|
+
const toReturn = [];
|
|
293
|
+
const slotName = this["s-sn"];
|
|
294
|
+
if (opts == null ? void 0 : opts.flatten) {
|
|
295
|
+
console.error(`
|
|
296
|
+
Flattening is not supported for Stencil non-shadow slots.
|
|
297
|
+
You can use \`.childNodes\` to nested slot fallback content.
|
|
298
|
+
If you have a particular use case, please open an issue on the Stencil repo.
|
|
299
|
+
`);
|
|
300
|
+
}
|
|
301
|
+
const parent = this["s-cr"].parentElement;
|
|
302
|
+
const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
|
|
303
|
+
slottedNodes.forEach((n) => {
|
|
304
|
+
if (slotName === getSlotName(n)) {
|
|
305
|
+
toReturn.push(n);
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
if (elementsOnly) {
|
|
309
|
+
return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
|
|
310
|
+
}
|
|
311
|
+
return toReturn;
|
|
312
|
+
}).bind(node);
|
|
313
|
+
node.assignedElements = assignedFactory(true);
|
|
314
|
+
node.assignedNodes = assignedFactory(false);
|
|
315
|
+
}
|
|
316
|
+
function internalCall(node, method) {
|
|
317
|
+
if ("__" + method in node) {
|
|
318
|
+
const toReturn = node["__" + method];
|
|
319
|
+
if (typeof toReturn !== "function") return toReturn;
|
|
320
|
+
return toReturn.bind(node);
|
|
321
|
+
} else {
|
|
322
|
+
if (typeof node[method] !== "function") return node[method];
|
|
323
|
+
return node[method].bind(node);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
250
326
|
var createTime = (fnName, tagName = "") => {
|
|
251
327
|
{
|
|
252
328
|
return () => {
|
|
@@ -380,6 +456,22 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
380
456
|
}
|
|
381
457
|
return propValue;
|
|
382
458
|
};
|
|
459
|
+
var getElement = (ref) => ref;
|
|
460
|
+
|
|
461
|
+
// src/runtime/event-emitter.ts
|
|
462
|
+
var createEvent = (ref, name, flags) => {
|
|
463
|
+
const elm = getElement(ref);
|
|
464
|
+
return {
|
|
465
|
+
emit: (detail) => {
|
|
466
|
+
return emitEvent(elm, name, {
|
|
467
|
+
bubbles: !!(flags & 4 /* Bubbles */),
|
|
468
|
+
composed: !!(flags & 2 /* Composed */),
|
|
469
|
+
cancelable: !!(flags & 1 /* Cancellable */),
|
|
470
|
+
detail
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
};
|
|
383
475
|
var emitEvent = (elm, name, opts) => {
|
|
384
476
|
const ev = plt.ce(name, opts);
|
|
385
477
|
elm.dispatchEvent(ev);
|
|
@@ -404,7 +496,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
404
496
|
var _a;
|
|
405
497
|
const scopeId2 = getScopeId(cmpMeta);
|
|
406
498
|
const style = styles.get(scopeId2);
|
|
407
|
-
|
|
499
|
+
if (!win.document) {
|
|
500
|
+
return scopeId2;
|
|
501
|
+
}
|
|
502
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
408
503
|
if (style) {
|
|
409
504
|
if (typeof style === "string") {
|
|
410
505
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
@@ -415,9 +510,9 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
415
510
|
}
|
|
416
511
|
if (!appliedStyles.has(scopeId2)) {
|
|
417
512
|
{
|
|
418
|
-
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) ||
|
|
513
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
|
419
514
|
styleElm.innerHTML = style;
|
|
420
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
|
515
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
421
516
|
if (nonce != null) {
|
|
422
517
|
styleElm.setAttribute("nonce", nonce);
|
|
423
518
|
}
|
|
@@ -479,104 +574,105 @@ var attachStyles = (hostRef) => {
|
|
|
479
574
|
};
|
|
480
575
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
481
576
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
482
|
-
if (oldValue
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
} else {
|
|
500
|
-
elm.style[prop] = "";
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
for (const prop in newValue) {
|
|
506
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
577
|
+
if (oldValue === newValue) {
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
581
|
+
let ln = memberName.toLowerCase();
|
|
582
|
+
if (memberName === "class") {
|
|
583
|
+
const classList = elm.classList;
|
|
584
|
+
const oldClasses = parseClassList(oldValue);
|
|
585
|
+
let newClasses = parseClassList(newValue);
|
|
586
|
+
{
|
|
587
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
588
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
589
|
+
}
|
|
590
|
+
} else if (memberName === "style") {
|
|
591
|
+
{
|
|
592
|
+
for (const prop in oldValue) {
|
|
593
|
+
if (!newValue || newValue[prop] == null) {
|
|
507
594
|
if (prop.includes("-")) {
|
|
508
|
-
elm.style.
|
|
595
|
+
elm.style.removeProperty(prop);
|
|
509
596
|
} else {
|
|
510
|
-
elm.style[prop] =
|
|
597
|
+
elm.style[prop] = "";
|
|
511
598
|
}
|
|
512
599
|
}
|
|
513
600
|
}
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
} else if (isMemberInElement(win, ln)) {
|
|
522
|
-
memberName = ln.slice(2);
|
|
523
|
-
} else {
|
|
524
|
-
memberName = ln[2] + memberName.slice(3);
|
|
525
|
-
}
|
|
526
|
-
if (oldValue || newValue) {
|
|
527
|
-
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
528
|
-
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
529
|
-
if (oldValue) {
|
|
530
|
-
plt.rel(elm, memberName, oldValue, capture);
|
|
531
|
-
}
|
|
532
|
-
if (newValue) {
|
|
533
|
-
plt.ael(elm, memberName, newValue, capture);
|
|
601
|
+
}
|
|
602
|
+
for (const prop in newValue) {
|
|
603
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
604
|
+
if (prop.includes("-")) {
|
|
605
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
606
|
+
} else {
|
|
607
|
+
elm.style[prop] = newValue[prop];
|
|
534
608
|
}
|
|
535
609
|
}
|
|
610
|
+
}
|
|
611
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
612
|
+
if (newValue) {
|
|
613
|
+
newValue(elm);
|
|
614
|
+
}
|
|
615
|
+
} else if ((!elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
616
|
+
if (memberName[2] === "-") {
|
|
617
|
+
memberName = memberName.slice(3);
|
|
618
|
+
} else if (isMemberInElement(win, ln)) {
|
|
619
|
+
memberName = ln.slice(2);
|
|
536
620
|
} else {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
621
|
+
memberName = ln[2] + memberName.slice(3);
|
|
622
|
+
}
|
|
623
|
+
if (oldValue || newValue) {
|
|
624
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
625
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
626
|
+
if (oldValue) {
|
|
627
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
628
|
+
}
|
|
629
|
+
if (newValue) {
|
|
630
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
} else {
|
|
634
|
+
const isComplex = isComplexType(newValue);
|
|
635
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
636
|
+
try {
|
|
637
|
+
if (!elm.tagName.includes("-")) {
|
|
638
|
+
const n = newValue == null ? "" : newValue;
|
|
639
|
+
if (memberName === "list") {
|
|
640
|
+
isProp = false;
|
|
641
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
|
642
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
643
|
+
elm[memberName] = n;
|
|
644
|
+
} else {
|
|
645
|
+
elm.setAttribute(memberName, n);
|
|
550
646
|
}
|
|
551
|
-
} else if (elm[memberName] !== newValue) {
|
|
552
|
-
elm[memberName] = newValue;
|
|
553
647
|
}
|
|
554
|
-
}
|
|
648
|
+
} else if (elm[memberName] !== newValue) {
|
|
649
|
+
elm[memberName] = newValue;
|
|
555
650
|
}
|
|
651
|
+
} catch (e) {
|
|
556
652
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
653
|
+
}
|
|
654
|
+
let xlink = false;
|
|
655
|
+
{
|
|
656
|
+
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
657
|
+
memberName = ln;
|
|
658
|
+
xlink = true;
|
|
563
659
|
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
568
|
-
} else {
|
|
569
|
-
elm.removeAttribute(memberName);
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
573
|
-
newValue = newValue === true ? "" : newValue;
|
|
660
|
+
}
|
|
661
|
+
if (newValue == null || newValue === false) {
|
|
662
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
574
663
|
if (xlink) {
|
|
575
|
-
elm.
|
|
664
|
+
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
576
665
|
} else {
|
|
577
|
-
elm.
|
|
666
|
+
elm.removeAttribute(memberName);
|
|
578
667
|
}
|
|
579
668
|
}
|
|
669
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
|
670
|
+
newValue = newValue === true ? "" : newValue;
|
|
671
|
+
if (xlink) {
|
|
672
|
+
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
673
|
+
} else {
|
|
674
|
+
elm.setAttribute(memberName, newValue);
|
|
675
|
+
}
|
|
580
676
|
}
|
|
581
677
|
}
|
|
582
678
|
};
|
|
@@ -662,11 +758,19 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
662
758
|
}
|
|
663
759
|
}
|
|
664
760
|
if (newVNode2.$text$ !== null) {
|
|
665
|
-
elm = newVNode2.$elm$ =
|
|
761
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
666
762
|
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
667
|
-
elm = newVNode2.$elm$ =
|
|
763
|
+
elm = newVNode2.$elm$ = win.document.createTextNode("");
|
|
764
|
+
{
|
|
765
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
766
|
+
}
|
|
668
767
|
} else {
|
|
669
|
-
|
|
768
|
+
if (!win.document) {
|
|
769
|
+
throw new Error(
|
|
770
|
+
"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."
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
elm = newVNode2.$elm$ = win.document.createElement(
|
|
670
774
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
671
775
|
);
|
|
672
776
|
{
|
|
@@ -691,6 +795,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
691
795
|
elm["s-cr"] = contentRef;
|
|
692
796
|
elm["s-sn"] = newVNode2.$name$ || "";
|
|
693
797
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
798
|
+
patchSlotNode(elm);
|
|
694
799
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
695
800
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
696
801
|
{
|
|
@@ -880,14 +985,11 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
880
985
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
881
986
|
const oldChildren = oldVNode.$children$;
|
|
882
987
|
const newChildren = newVNode2.$children$;
|
|
883
|
-
const tag = newVNode2.$tag$;
|
|
884
988
|
const text = newVNode2.$text$;
|
|
885
989
|
let defaultHolder;
|
|
886
990
|
if (text === null) {
|
|
887
991
|
{
|
|
888
|
-
|
|
889
|
-
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
890
|
-
}
|
|
992
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
891
993
|
}
|
|
892
994
|
if (oldChildren !== null && newChildren !== null) {
|
|
893
995
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
@@ -1026,8 +1128,8 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1026
1128
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1027
1129
|
for (const relocateData of relocateNodes) {
|
|
1028
1130
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1029
|
-
if (!nodeToRelocate["s-ol"]) {
|
|
1030
|
-
const orgLocationNode =
|
|
1131
|
+
if (!nodeToRelocate["s-ol"] && win.document) {
|
|
1132
|
+
const orgLocationNode = win.document.createTextNode("");
|
|
1031
1133
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1032
1134
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1033
1135
|
}
|
|
@@ -1068,7 +1170,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1068
1170
|
}
|
|
1069
1171
|
}
|
|
1070
1172
|
}
|
|
1071
|
-
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](
|
|
1173
|
+
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
|
|
1072
1174
|
} else {
|
|
1073
1175
|
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1074
1176
|
if (isInitialLoad) {
|
|
@@ -1124,10 +1226,11 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1124
1226
|
}
|
|
1125
1227
|
let maybePromise;
|
|
1126
1228
|
if (isInitialLoad) {
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1229
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
1230
|
+
} else {
|
|
1231
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
1130
1232
|
}
|
|
1233
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
1131
1234
|
endSchedule();
|
|
1132
1235
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1133
1236
|
};
|
|
@@ -1191,12 +1294,15 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1191
1294
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1192
1295
|
const elm = hostRef.$hostElement$;
|
|
1193
1296
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1297
|
+
const instance = elm;
|
|
1194
1298
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1299
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
1195
1300
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1196
1301
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1197
1302
|
{
|
|
1198
1303
|
addHydratedFlag(elm);
|
|
1199
1304
|
}
|
|
1305
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
1200
1306
|
endPostUpdate();
|
|
1201
1307
|
{
|
|
1202
1308
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -1205,6 +1311,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1205
1311
|
}
|
|
1206
1312
|
}
|
|
1207
1313
|
} else {
|
|
1314
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
1208
1315
|
endPostUpdate();
|
|
1209
1316
|
}
|
|
1210
1317
|
{
|
|
@@ -1263,6 +1370,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1263
1370
|
}
|
|
1264
1371
|
}
|
|
1265
1372
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1373
|
+
if (instance.componentShouldUpdate) {
|
|
1374
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1375
|
+
return;
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1266
1378
|
scheduleUpdate(hostRef, false);
|
|
1267
1379
|
}
|
|
1268
1380
|
}
|
|
@@ -1273,6 +1385,26 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1273
1385
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1274
1386
|
var _a, _b;
|
|
1275
1387
|
const prototype = Cstr.prototype;
|
|
1388
|
+
if (cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
1389
|
+
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
1390
|
+
const originalFormAssociatedCallback = prototype[cbName];
|
|
1391
|
+
Object.defineProperty(prototype, cbName, {
|
|
1392
|
+
value(...args) {
|
|
1393
|
+
const hostRef = getHostRef(this);
|
|
1394
|
+
const instance = this;
|
|
1395
|
+
if (!instance) {
|
|
1396
|
+
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
1397
|
+
const cb = asyncInstance[cbName];
|
|
1398
|
+
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
1399
|
+
});
|
|
1400
|
+
} else {
|
|
1401
|
+
const cb = originalFormAssociatedCallback;
|
|
1402
|
+
typeof cb === "function" && cb.call(instance, ...args);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
});
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1276
1408
|
if (cmpMeta.$members$ || (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
1277
1409
|
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
1278
1410
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
@@ -1436,6 +1568,7 @@ var connectedCallback = (elm) => {
|
|
|
1436
1568
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1437
1569
|
}
|
|
1438
1570
|
} else {
|
|
1571
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1439
1572
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1440
1573
|
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
1441
1574
|
}
|
|
@@ -1444,7 +1577,10 @@ var connectedCallback = (elm) => {
|
|
|
1444
1577
|
}
|
|
1445
1578
|
};
|
|
1446
1579
|
var setContentReference = (elm) => {
|
|
1447
|
-
|
|
1580
|
+
if (!win.document) {
|
|
1581
|
+
return;
|
|
1582
|
+
}
|
|
1583
|
+
const contentRefElm = elm["s-cr"] = win.document.createComment(
|
|
1448
1584
|
""
|
|
1449
1585
|
);
|
|
1450
1586
|
contentRefElm["s-cn"] = true;
|
|
@@ -1452,7 +1588,13 @@ var setContentReference = (elm) => {
|
|
|
1452
1588
|
};
|
|
1453
1589
|
var disconnectedCallback = async (elm) => {
|
|
1454
1590
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1455
|
-
getHostRef(elm);
|
|
1591
|
+
const hostRef = getHostRef(elm);
|
|
1592
|
+
{
|
|
1593
|
+
if (hostRef.$rmListeners$) {
|
|
1594
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1595
|
+
hostRef.$rmListeners$ = void 0;
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1456
1598
|
}
|
|
1457
1599
|
if (rootAppliedStyles.has(elm)) {
|
|
1458
1600
|
rootAppliedStyles.delete(elm);
|
|
@@ -1469,9 +1611,14 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1469
1611
|
{
|
|
1470
1612
|
cmpMeta.$members$ = compactMeta[2];
|
|
1471
1613
|
}
|
|
1614
|
+
{
|
|
1615
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1616
|
+
}
|
|
1472
1617
|
{
|
|
1473
1618
|
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
1474
1619
|
}
|
|
1620
|
+
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
1621
|
+
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
1475
1622
|
Object.assign(Cstr.prototype, {
|
|
1476
1623
|
__hasHostListenerAttached: false,
|
|
1477
1624
|
__registerHost() {
|
|
@@ -1479,23 +1626,20 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1479
1626
|
},
|
|
1480
1627
|
connectedCallback() {
|
|
1481
1628
|
if (!this.__hasHostListenerAttached) {
|
|
1482
|
-
getHostRef(this);
|
|
1629
|
+
const hostRef = getHostRef(this);
|
|
1630
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
1483
1631
|
this.__hasHostListenerAttached = true;
|
|
1484
1632
|
}
|
|
1485
1633
|
connectedCallback(this);
|
|
1634
|
+
if (originalConnectedCallback) {
|
|
1635
|
+
originalConnectedCallback.call(this);
|
|
1636
|
+
}
|
|
1486
1637
|
},
|
|
1487
1638
|
disconnectedCallback() {
|
|
1488
1639
|
disconnectedCallback(this);
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
if (((_a = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1493
|
-
delete hostRef.$vnode$;
|
|
1494
|
-
}
|
|
1495
|
-
if (this instanceof Node && !this.isConnected) {
|
|
1496
|
-
deleteHostRef(this);
|
|
1497
|
-
}
|
|
1498
|
-
});
|
|
1640
|
+
if (originalDisconnectedCallback) {
|
|
1641
|
+
originalDisconnectedCallback.call(this);
|
|
1642
|
+
}
|
|
1499
1643
|
},
|
|
1500
1644
|
__attachShadow() {
|
|
1501
1645
|
{
|
|
@@ -1519,6 +1663,30 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1519
1663
|
|
|
1520
1664
|
// src/runtime/fragment.ts
|
|
1521
1665
|
var Fragment = (_, children) => children;
|
|
1666
|
+
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1667
|
+
if (listeners && win.document) {
|
|
1668
|
+
listeners.map(([flags, name, method]) => {
|
|
1669
|
+
const target = elm;
|
|
1670
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1671
|
+
const opts = hostListenerOpts(flags);
|
|
1672
|
+
plt.ael(target, name, handler, opts);
|
|
1673
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1674
|
+
});
|
|
1675
|
+
}
|
|
1676
|
+
};
|
|
1677
|
+
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1678
|
+
try {
|
|
1679
|
+
{
|
|
1680
|
+
hostRef.$hostElement$[methodName](ev);
|
|
1681
|
+
}
|
|
1682
|
+
} catch (e) {
|
|
1683
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1684
|
+
}
|
|
1685
|
+
};
|
|
1686
|
+
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
1687
|
+
passive: (flags & 1 /* Passive */) !== 0,
|
|
1688
|
+
capture: (flags & 2 /* Capture */) !== 0
|
|
1689
|
+
} : (flags & 2 /* Capture */) !== 0;
|
|
1522
1690
|
|
|
1523
1691
|
// src/runtime/nonce.ts
|
|
1524
1692
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
@@ -1526,4 +1694,4 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
|
1526
1694
|
// src/runtime/platform-options.ts
|
|
1527
1695
|
var setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
1528
1696
|
|
|
1529
|
-
export { Fragment as F, H, setNonce as a, setPlatformOptions as b, getAssetPath as g, h, proxyCustomElement as p, setAssetPath as s };
|
|
1697
|
+
export { Fragment as F, H, setNonce as a, setPlatformOptions as b, createEvent as c, getAssetPath as g, h, proxyCustomElement as p, setAssetPath as s };
|