@amiceli/papierjs 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-028aee0a.js → index-1be60996.js} +398 -6
- package/dist/cjs/index-1be60996.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/p-alert.cjs.entry.js +3 -5
- package/dist/cjs/p-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/p-badge.cjs.entry.js +34 -0
- package/dist/cjs/p-badge.cjs.entry.js.map +1 -0
- package/dist/cjs/p-button.cjs.entry.js +3 -3
- package/dist/cjs/p-button.cjs.entry.js.map +1 -1
- package/dist/cjs/p-dropdown-item.cjs.entry.js +35 -0
- package/dist/cjs/p-dropdown-item.cjs.entry.js.map +1 -0
- package/dist/cjs/p-dropdown.cjs.entry.js +2469 -0
- package/dist/cjs/p-dropdown.cjs.entry.js.map +1 -0
- package/dist/cjs/p-input-text.cjs.entry.js +45 -0
- package/dist/cjs/p-input-text.cjs.entry.js.map +1 -0
- package/dist/cjs/p-leaf.cjs.entry.js +26 -0
- package/dist/cjs/p-leaf.cjs.entry.js.map +1 -0
- package/dist/cjs/p-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/p-progress-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/papierjs.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +5 -0
- package/dist/collection/components/alert/alert.css +870 -1088
- package/dist/collection/components/alert/alert.js +1 -4
- package/dist/collection/components/alert/alert.js.map +1 -1
- package/dist/collection/components/badge/badge.css +3222 -0
- package/dist/collection/components/badge/badge.js +82 -0
- package/dist/collection/components/badge/badge.js.map +1 -0
- package/dist/collection/components/button/button.css +870 -1088
- package/dist/collection/components/button/button.js +1 -2
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown.css +3301 -0
- package/dist/collection/components/dropdown/dropdown.js +145 -0
- package/dist/collection/components/dropdown/dropdown.js.map +1 -0
- package/dist/collection/components/dropdown-item/dropdown-item.js +114 -0
- package/dist/collection/components/dropdown-item/dropdown-item.js.map +1 -0
- package/dist/collection/components/input/input-text/input-text.css +3245 -0
- package/dist/collection/components/input/input-text/input-text.js +223 -0
- package/dist/collection/components/input/input-text/input-text.js.map +1 -0
- package/dist/collection/components/leaf/leaf.css +3219 -0
- package/dist/collection/components/leaf/leaf.js +48 -0
- package/dist/collection/components/leaf/leaf.js.map +1 -0
- package/dist/collection/components/progress-bar/progress-bar.css +870 -1088
- package/dist/collection/components/progress-bar/progress-bar.js +1 -2
- package/dist/collection/components/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-5ec03f76.js → p-81e1c3fa.js} +364 -7
- package/dist/components/p-81e1c3fa.js.map +1 -0
- package/dist/components/p-alert.js +3 -5
- package/dist/components/p-alert.js.map +1 -1
- package/dist/components/p-badge.d.ts +11 -0
- package/dist/components/p-badge.js +52 -0
- package/dist/components/p-badge.js.map +1 -0
- package/dist/components/p-button.js +3 -3
- package/dist/components/p-button.js.map +1 -1
- package/dist/components/p-dropdown-item.d.ts +11 -0
- package/dist/components/p-dropdown-item.js +54 -0
- package/dist/components/p-dropdown-item.js.map +1 -0
- package/dist/components/p-dropdown.d.ts +11 -0
- package/dist/components/p-dropdown.js +2489 -0
- package/dist/components/p-dropdown.js.map +1 -0
- package/dist/components/p-input-text.d.ts +11 -0
- package/dist/components/p-input-text.js +69 -0
- package/dist/components/p-input-text.js.map +1 -0
- package/dist/components/p-leaf.d.ts +11 -0
- package/dist/components/p-leaf.js +42 -0
- package/dist/components/p-leaf.js.map +1 -0
- package/dist/components/p-progress-bar.js +3 -3
- package/dist/components/p-progress-bar.js.map +1 -1
- package/dist/esm/{index-ad124052.js → index-a242df70.js} +398 -7
- package/dist/esm/index-a242df70.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/p-alert.entry.js +3 -5
- package/dist/esm/p-alert.entry.js.map +1 -1
- package/dist/esm/p-badge.entry.js +30 -0
- package/dist/esm/p-badge.entry.js.map +1 -0
- package/dist/esm/p-button.entry.js +3 -3
- package/dist/esm/p-button.entry.js.map +1 -1
- package/dist/esm/p-dropdown-item.entry.js +31 -0
- package/dist/esm/p-dropdown-item.entry.js.map +1 -0
- package/dist/esm/p-dropdown.entry.js +2465 -0
- package/dist/esm/p-dropdown.entry.js.map +1 -0
- package/dist/esm/p-input-text.entry.js +41 -0
- package/dist/esm/p-input-text.entry.js.map +1 -0
- package/dist/esm/p-leaf.entry.js +22 -0
- package/dist/esm/p-leaf.entry.js.map +1 -0
- package/dist/esm/p-progress-bar.entry.js +3 -3
- package/dist/esm/p-progress-bar.entry.js.map +1 -1
- package/dist/esm/papierjs.js +3 -3
- package/dist/papierjs/p-0feb5c6d.entry.js +2 -0
- package/dist/papierjs/p-0feb5c6d.entry.js.map +1 -0
- package/dist/papierjs/p-17353c7b.entry.js +2 -0
- package/dist/papierjs/p-17353c7b.entry.js.map +1 -0
- package/dist/papierjs/p-370e3431.entry.js +2 -0
- package/dist/papierjs/p-370e3431.entry.js.map +1 -0
- package/dist/papierjs/p-3c1781d8.js +3 -0
- package/dist/papierjs/p-3c1781d8.js.map +1 -0
- package/dist/papierjs/p-4199034f.entry.js +2 -0
- package/dist/papierjs/p-4199034f.entry.js.map +1 -0
- package/dist/papierjs/p-524777fc.entry.js +2 -0
- package/dist/papierjs/p-524777fc.entry.js.map +1 -0
- package/dist/papierjs/p-9cbdff58.entry.js +331 -0
- package/dist/papierjs/p-9cbdff58.entry.js.map +1 -0
- package/dist/papierjs/p-aa9cca5f.entry.js +2 -0
- package/dist/papierjs/p-aa9cca5f.entry.js.map +1 -0
- package/dist/papierjs/p-b1a06c34.entry.js +2 -0
- package/dist/papierjs/p-b1a06c34.entry.js.map +1 -0
- package/dist/papierjs/papierjs.esm.js +1 -1
- package/dist/papierjs/papierjs.esm.js.map +1 -1
- package/dist/types/components/badge/badge.d.ts +9 -0
- package/dist/types/components/dropdown/dropdown.d.ts +15 -0
- package/dist/types/components/dropdown-item/dropdown-item.d.ts +10 -0
- package/dist/types/components/input/input-text/input-text.d.ts +15 -0
- package/dist/types/components/leaf/leaf.d.ts +5 -0
- package/dist/types/components.d.ts +145 -0
- package/package.json +5 -3
- package/{README.md → readme.md} +22 -7
- package/dist/cjs/index-028aee0a.js.map +0 -1
- package/dist/components/p-5ec03f76.js.map +0 -1
- package/dist/esm/index-ad124052.js.map +0 -1
- package/dist/papierjs/p-14f67b19.entry.js +0 -2
- package/dist/papierjs/p-14f67b19.entry.js.map +0 -1
- package/dist/papierjs/p-8ae1632f.entry.js +0 -2
- package/dist/papierjs/p-8ae1632f.entry.js.map +0 -1
- package/dist/papierjs/p-be2fe2c0.js +0 -3
- package/dist/papierjs/p-be2fe2c0.js.map +0 -1
- package/dist/papierjs/p-d1c3c0ac.entry.js +0 -2
- package/dist/papierjs/p-d1c3c0ac.entry.js.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// biome-ignore lint/correctness/noUnusedImports: required for jsx
|
|
2
1
|
import { h } from "@stencil/core";
|
|
3
2
|
export class ProgressBar {
|
|
4
3
|
constructor() {
|
|
@@ -36,7 +35,7 @@ export class ProgressBar {
|
|
|
36
35
|
return cssClass;
|
|
37
36
|
}
|
|
38
37
|
render() {
|
|
39
|
-
return (h("div", { key: '
|
|
38
|
+
return (h("div", { key: 'a3a903b56dd7a216cd026067c6ab017ccac8896c', class: this.getParentClass() }, h("div", { key: '02567b1caa5e06b64f73000175215a0cbf9ebb6e', class: "progress" }, h("div", { key: '425f22fd262fa1b7022736db1e7c370dd51da643', class: this.getClass() }, h("slot", { key: 'eb83af0be2657e9b86bcd7aad422948f3c5e96e4' })))));
|
|
40
39
|
}
|
|
41
40
|
static get is() { return "p-progress-bar"; }
|
|
42
41
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.js","sourceRoot":"","sources":["../../../src/components/progress-bar/progress-bar.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"progress-bar.js","sourceRoot":"","sources":["../../../src/components/progress-bar/progress-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;AAelD,MAAM,OAAO,WAAW;IALxB;QAOI,SAAI,GAAsB,SAAS,CAAA;QAEnC,UAAK,GAAY,CAAC,CAAA;QAElB,YAAO,GAAa,KAAK,CAAA;QAEzB,SAAI,GAAa,KAAK,CAAA;KA+CzB;IA7CU,QAAQ;QACX,MAAM,KAAK,GAAG;YACV,WAAW;YACX,SAAS;YACT,SAAS;YACT,QAAQ;YACR,OAAO;YACP,SAAS;SACZ,CAAA;QACD,IAAI,QAAQ,GAAG,SAAS,IAAI,CAAC,KAAK,EAAE,CAAA;QAEpC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7B,QAAQ,GAAG,GAAG,QAAQ,UAAU,CAAA;QACpC,CAAC;aAAM,CAAC;YACJ,QAAQ,GAAG,GAAG,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAA;QACzC,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,QAAQ,GAAG,GAAG,QAAQ,UAAU,CAAA;QACpC,CAAC;QAED,OAAO,QAAQ,CAAA;IACnB,CAAC;IAEM,cAAc;QACjB,IAAI,QAAQ,GAAG,kBAAkB,CAAA;QAEjC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACZ,QAAQ,GAAG,GAAG,QAAQ,WAAW,CAAA;QACrC,CAAC;QAED,OAAO,QAAQ,CAAA;IACnB,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE;YAC7B,4DAAK,KAAK,EAAC,UAAU;gBACjB,4DAAK,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE;oBACvB,8DAAQ,CACN,CACJ,CACJ,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from '@stencil/core'\n\ntype ProgressBarColor =\n | 'secondary'\n | 'success'\n | 'warning'\n | 'danger'\n | 'muted'\n | 'primary'\n\n@Component({\n tag: 'p-progress-bar',\n styleUrl: 'progress-bar.scss',\n shadow: true,\n})\nexport class ProgressBar {\n @Prop()\n type?: ProgressBarColor = 'primary'\n @Prop()\n value?: number = 0\n @Prop()\n striped?: boolean = false\n @Prop()\n dark?: boolean = false\n\n public getClass(): string {\n const types = [\n 'secondary',\n 'success',\n 'warning',\n 'danger',\n 'muted',\n 'primary',\n ]\n let cssClass = `bar w-${this.value}`\n\n if (!types.includes(this.type)) {\n cssClass = `${cssClass} primary`\n } else {\n cssClass = `${cssClass} ${this.type}`\n }\n\n if (this.striped) {\n cssClass = `${cssClass} striped`\n }\n\n return cssClass\n }\n\n public getParentClass() {\n let cssClass = 'papier is--block'\n\n if (this.dark) {\n cssClass = `${cssClass} is--dark`\n }\n\n return cssClass\n }\n\n render() {\n return (\n <div class={this.getParentClass()}>\n <div class=\"progress\">\n <div class={this.getClass()}>\n <slot />\n </div>\n </div>\n </div>\n )\n }\n}\n"]}
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'papierjs';
|
|
2
|
-
const BUILD = /* papierjs */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad:
|
|
2
|
+
const BUILD = /* papierjs */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, 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: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: false, scoped: false, 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: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: false };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Platform v4.25.3 | MIT Licensed | https://stenciljs.com
|
|
@@ -49,6 +49,22 @@ var plt = {
|
|
|
49
49
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
50
50
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
51
51
|
};
|
|
52
|
+
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
53
|
+
let supportsListenerOptions2 = false;
|
|
54
|
+
try {
|
|
55
|
+
doc.addEventListener(
|
|
56
|
+
"e",
|
|
57
|
+
null,
|
|
58
|
+
Object.defineProperty({}, "passive", {
|
|
59
|
+
get() {
|
|
60
|
+
supportsListenerOptions2 = true;
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
);
|
|
64
|
+
} catch (e) {
|
|
65
|
+
}
|
|
66
|
+
return supportsListenerOptions2;
|
|
67
|
+
})();
|
|
52
68
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
53
69
|
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
54
70
|
try {
|
|
@@ -159,6 +175,63 @@ var unwrapErr = (result) => {
|
|
|
159
175
|
throw result.value;
|
|
160
176
|
}
|
|
161
177
|
};
|
|
178
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
179
|
+
const childNodes = elm.__childNodes || elm.childNodes;
|
|
180
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
181
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
182
|
+
var _a;
|
|
183
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
184
|
+
if ((_a = getHostSlotChildNodes(slotNode, slotNode["s-sn"], false)) == null ? void 0 : _a.length) {
|
|
185
|
+
slotNode.hidden = true;
|
|
186
|
+
} else {
|
|
187
|
+
slotNode.hidden = false;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
for (const childNode of childNodes) {
|
|
193
|
+
if (childNode.nodeType === 1 /* ElementNode */ && (childNode.__childNodes || childNode.childNodes).length) {
|
|
194
|
+
updateFallbackSlotVisibility(childNode);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
199
|
+
let i2 = 0;
|
|
200
|
+
let slottedNodes = [];
|
|
201
|
+
let childNode;
|
|
202
|
+
for (; i2 < childNodes.length; i2++) {
|
|
203
|
+
childNode = childNodes[i2];
|
|
204
|
+
if (childNode["s-sr"] && childNode["s-hn"] === hostName && (slotName === void 0 || childNode["s-sn"] === slotName)) {
|
|
205
|
+
slottedNodes.push(childNode);
|
|
206
|
+
if (typeof slotName !== "undefined") return slottedNodes;
|
|
207
|
+
}
|
|
208
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
209
|
+
}
|
|
210
|
+
return slottedNodes;
|
|
211
|
+
}
|
|
212
|
+
var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
|
|
213
|
+
const childNodes = [];
|
|
214
|
+
if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
|
|
215
|
+
while ((node = node.nextSibling) && node["s-sn"] === slotName) {
|
|
216
|
+
childNodes.push(node);
|
|
217
|
+
}
|
|
218
|
+
return childNodes;
|
|
219
|
+
};
|
|
220
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
221
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
222
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
return slotName === "";
|
|
234
|
+
};
|
|
162
235
|
var createTime = (fnName, tagName = "") => {
|
|
163
236
|
{
|
|
164
237
|
return () => {
|
|
@@ -169,6 +242,7 @@ var createTime = (fnName, tagName = "") => {
|
|
|
169
242
|
var h = (nodeName, vnodeData, ...children) => {
|
|
170
243
|
let child = null;
|
|
171
244
|
let key = null;
|
|
245
|
+
let slotName = null;
|
|
172
246
|
let simple = false;
|
|
173
247
|
let lastSimple = false;
|
|
174
248
|
const vNodeChildren = [];
|
|
@@ -195,6 +269,9 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
195
269
|
if (vnodeData.key) {
|
|
196
270
|
key = vnodeData.key;
|
|
197
271
|
}
|
|
272
|
+
if (vnodeData.name) {
|
|
273
|
+
slotName = vnodeData.name;
|
|
274
|
+
}
|
|
198
275
|
{
|
|
199
276
|
const classData = vnodeData.className || vnodeData.class;
|
|
200
277
|
if (classData) {
|
|
@@ -210,6 +287,9 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
210
287
|
{
|
|
211
288
|
vnode.$key$ = key;
|
|
212
289
|
}
|
|
290
|
+
{
|
|
291
|
+
vnode.$name$ = slotName;
|
|
292
|
+
}
|
|
213
293
|
return vnode;
|
|
214
294
|
};
|
|
215
295
|
var newVNode = (tag, text) => {
|
|
@@ -226,6 +306,9 @@ var newVNode = (tag, text) => {
|
|
|
226
306
|
{
|
|
227
307
|
vnode.$key$ = null;
|
|
228
308
|
}
|
|
309
|
+
{
|
|
310
|
+
vnode.$name$ = null;
|
|
311
|
+
}
|
|
229
312
|
return vnode;
|
|
230
313
|
};
|
|
231
314
|
var Host = {};
|
|
@@ -475,16 +558,38 @@ function sortedAttrNames(attrNames) {
|
|
|
475
558
|
attrNames
|
|
476
559
|
);
|
|
477
560
|
}
|
|
561
|
+
var contentRef;
|
|
478
562
|
var hostTagName;
|
|
479
563
|
var useNativeShadowDom = false;
|
|
564
|
+
var checkSlotFallbackVisibility = false;
|
|
565
|
+
var checkSlotRelocate = false;
|
|
480
566
|
var isSvgMode = false;
|
|
481
567
|
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
568
|
+
var _a;
|
|
482
569
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
483
570
|
let i2 = 0;
|
|
484
571
|
let elm;
|
|
485
572
|
let childNode;
|
|
573
|
+
let oldVNode;
|
|
574
|
+
if (!useNativeShadowDom) {
|
|
575
|
+
checkSlotRelocate = true;
|
|
576
|
+
if (newVNode2.$tag$ === "slot") {
|
|
577
|
+
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
578
|
+
// slot element has fallback content
|
|
579
|
+
// still create an element that "mocks" the slot element
|
|
580
|
+
2 /* isSlotFallback */
|
|
581
|
+
) : (
|
|
582
|
+
// slot element does not have fallback content
|
|
583
|
+
// create an html comment we'll use to always reference
|
|
584
|
+
// where actual slot content should sit next to
|
|
585
|
+
1 /* isSlotReference */
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
486
589
|
if (newVNode2.$text$ !== null) {
|
|
487
590
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
591
|
+
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
592
|
+
elm = newVNode2.$elm$ = doc.createTextNode("");
|
|
488
593
|
} else {
|
|
489
594
|
elm = newVNode2.$elm$ = doc.createElement(
|
|
490
595
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
@@ -502,10 +607,50 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
502
607
|
}
|
|
503
608
|
}
|
|
504
609
|
elm["s-hn"] = hostTagName;
|
|
610
|
+
{
|
|
611
|
+
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
612
|
+
elm["s-sr"] = true;
|
|
613
|
+
elm["s-cr"] = contentRef;
|
|
614
|
+
elm["s-sn"] = newVNode2.$name$ || "";
|
|
615
|
+
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
616
|
+
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
617
|
+
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
618
|
+
{
|
|
619
|
+
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
}
|
|
505
624
|
return elm;
|
|
506
625
|
};
|
|
626
|
+
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
627
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
628
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
629
|
+
if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
|
|
630
|
+
let node = parentElm;
|
|
631
|
+
while (node = node.nextSibling) {
|
|
632
|
+
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
633
|
+
oldSlotChildNodes.push(node);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
638
|
+
const childNode = oldSlotChildNodes[i2];
|
|
639
|
+
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
640
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
641
|
+
childNode["s-ol"].remove();
|
|
642
|
+
childNode["s-ol"] = void 0;
|
|
643
|
+
childNode["s-sh"] = void 0;
|
|
644
|
+
checkSlotRelocate = true;
|
|
645
|
+
}
|
|
646
|
+
if (recursive) {
|
|
647
|
+
putBackInOriginalLocation(childNode, recursive);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
651
|
+
};
|
|
507
652
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
508
|
-
let containerElm = parentElm;
|
|
653
|
+
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
509
654
|
let childNode;
|
|
510
655
|
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
511
656
|
containerElm = containerElm.shadowRoot;
|
|
@@ -515,7 +660,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
515
660
|
childNode = createElm(null, parentVNode, startIdx);
|
|
516
661
|
if (childNode) {
|
|
517
662
|
vnodes[startIdx].$elm$ = childNode;
|
|
518
|
-
insertBefore(containerElm, childNode, before);
|
|
663
|
+
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
519
664
|
}
|
|
520
665
|
}
|
|
521
666
|
}
|
|
@@ -526,6 +671,14 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
526
671
|
if (vnode) {
|
|
527
672
|
const elm = vnode.$elm$;
|
|
528
673
|
if (elm) {
|
|
674
|
+
{
|
|
675
|
+
checkSlotFallbackVisibility = true;
|
|
676
|
+
if (elm["s-ol"]) {
|
|
677
|
+
elm["s-ol"].remove();
|
|
678
|
+
} else {
|
|
679
|
+
putBackInOriginalLocation(elm, true);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
529
682
|
elm.remove();
|
|
530
683
|
}
|
|
531
684
|
}
|
|
@@ -562,11 +715,17 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
562
715
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
563
716
|
newEndVnode = newCh[--newEndIdx];
|
|
564
717
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
718
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
719
|
+
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
720
|
+
}
|
|
565
721
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
566
722
|
insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
567
723
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
568
724
|
newEndVnode = newCh[--newEndIdx];
|
|
569
725
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
726
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
727
|
+
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
728
|
+
}
|
|
570
729
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
571
730
|
insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
572
731
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
@@ -597,7 +756,11 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
597
756
|
}
|
|
598
757
|
if (node) {
|
|
599
758
|
{
|
|
600
|
-
insertBefore(
|
|
759
|
+
insertBefore(
|
|
760
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
761
|
+
node,
|
|
762
|
+
referenceNode(oldStartVnode.$elm$)
|
|
763
|
+
);
|
|
601
764
|
}
|
|
602
765
|
}
|
|
603
766
|
}
|
|
@@ -617,6 +780,9 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
617
780
|
};
|
|
618
781
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
619
782
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
783
|
+
if (leftVNode.$tag$ === "slot") {
|
|
784
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
785
|
+
}
|
|
620
786
|
if (!isInitialRender) {
|
|
621
787
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
622
788
|
}
|
|
@@ -627,12 +793,14 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
627
793
|
}
|
|
628
794
|
return false;
|
|
629
795
|
};
|
|
796
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
630
797
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
631
798
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
632
799
|
const oldChildren = oldVNode.$children$;
|
|
633
800
|
const newChildren = newVNode2.$children$;
|
|
634
801
|
const tag = newVNode2.$tag$;
|
|
635
802
|
const text = newVNode2.$text$;
|
|
803
|
+
let defaultHolder;
|
|
636
804
|
if (text === null) {
|
|
637
805
|
{
|
|
638
806
|
if (tag === "slot" && !useNativeShadowDom) ; else {
|
|
@@ -652,16 +820,69 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
652
820
|
) {
|
|
653
821
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
654
822
|
}
|
|
823
|
+
} else if ((defaultHolder = elm["s-cr"])) {
|
|
824
|
+
defaultHolder.parentNode.textContent = text;
|
|
655
825
|
} else if (oldVNode.$text$ !== text) {
|
|
656
826
|
elm.data = text;
|
|
657
827
|
}
|
|
658
828
|
};
|
|
829
|
+
var relocateNodes = [];
|
|
830
|
+
var markSlotContentForRelocation = (elm) => {
|
|
831
|
+
let node;
|
|
832
|
+
let hostContentNodes;
|
|
833
|
+
let j;
|
|
834
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
835
|
+
for (const childNode of children) {
|
|
836
|
+
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
837
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
838
|
+
const slotName = childNode["s-sn"];
|
|
839
|
+
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
840
|
+
node = hostContentNodes[j];
|
|
841
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD.experimentalSlotFixes )) {
|
|
842
|
+
if (isNodeLocatedInSlot(node, slotName)) {
|
|
843
|
+
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
844
|
+
checkSlotFallbackVisibility = true;
|
|
845
|
+
node["s-sn"] = node["s-sn"] || slotName;
|
|
846
|
+
if (relocateNodeData) {
|
|
847
|
+
relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
|
|
848
|
+
relocateNodeData.$slotRefNode$ = childNode;
|
|
849
|
+
} else {
|
|
850
|
+
node["s-sh"] = childNode["s-hn"];
|
|
851
|
+
relocateNodes.push({
|
|
852
|
+
$slotRefNode$: childNode,
|
|
853
|
+
$nodeToRelocate$: node
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
if (node["s-sr"]) {
|
|
857
|
+
relocateNodes.map((relocateNode) => {
|
|
858
|
+
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
|
|
859
|
+
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
860
|
+
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
|
861
|
+
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
} else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
867
|
+
relocateNodes.push({
|
|
868
|
+
$nodeToRelocate$: node
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
875
|
+
markSlotContentForRelocation(childNode);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
};
|
|
659
879
|
var insertBefore = (parent, newNode, reference) => {
|
|
660
880
|
{
|
|
661
881
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
662
882
|
}
|
|
663
883
|
};
|
|
664
884
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
885
|
+
var _a, _b, _c, _d;
|
|
665
886
|
const hostElm = hostRef.$hostElement$;
|
|
666
887
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
667
888
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
@@ -679,7 +900,77 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
679
900
|
hostRef.$vnode$ = rootVnode;
|
|
680
901
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
681
902
|
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
903
|
+
{
|
|
904
|
+
contentRef = hostElm["s-cr"];
|
|
905
|
+
checkSlotFallbackVisibility = false;
|
|
906
|
+
}
|
|
682
907
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
908
|
+
{
|
|
909
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
910
|
+
if (checkSlotRelocate) {
|
|
911
|
+
markSlotContentForRelocation(rootVnode.$elm$);
|
|
912
|
+
for (const relocateData of relocateNodes) {
|
|
913
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
914
|
+
if (!nodeToRelocate["s-ol"]) {
|
|
915
|
+
const orgLocationNode = doc.createTextNode("");
|
|
916
|
+
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
917
|
+
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
for (const relocateData of relocateNodes) {
|
|
921
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
922
|
+
const slotRefNode = relocateData.$slotRefNode$;
|
|
923
|
+
if (slotRefNode) {
|
|
924
|
+
const parentNodeRef = slotRefNode.parentNode;
|
|
925
|
+
let insertBeforeNode = slotRefNode.nextSibling;
|
|
926
|
+
{
|
|
927
|
+
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
928
|
+
while (orgLocationNode) {
|
|
929
|
+
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
930
|
+
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
|
|
931
|
+
refNode = refNode.nextSibling;
|
|
932
|
+
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
933
|
+
refNode = refNode == null ? void 0 : refNode.nextSibling;
|
|
934
|
+
}
|
|
935
|
+
if (!refNode || !refNode["s-nr"]) {
|
|
936
|
+
insertBeforeNode = refNode;
|
|
937
|
+
break;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
orgLocationNode = orgLocationNode.previousSibling;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
|
|
944
|
+
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
945
|
+
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
946
|
+
if (nodeToRelocate !== insertBeforeNode) {
|
|
947
|
+
if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
948
|
+
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
949
|
+
}
|
|
950
|
+
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
951
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
952
|
+
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](nodeToRelocate);
|
|
957
|
+
} else {
|
|
958
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
959
|
+
if (isInitialLoad) {
|
|
960
|
+
nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
|
|
961
|
+
}
|
|
962
|
+
nodeToRelocate.hidden = true;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
if (checkSlotFallbackVisibility) {
|
|
968
|
+
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
969
|
+
}
|
|
970
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
971
|
+
relocateNodes.length = 0;
|
|
972
|
+
}
|
|
973
|
+
contentRef = void 0;
|
|
683
974
|
};
|
|
684
975
|
|
|
685
976
|
// src/runtime/update-component.ts
|
|
@@ -780,12 +1071,16 @@ var postUpdateComponent = (hostRef) => {
|
|
|
780
1071
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
781
1072
|
const elm = hostRef.$hostElement$;
|
|
782
1073
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1074
|
+
const instance = elm;
|
|
783
1075
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
784
1076
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
785
1077
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
786
1078
|
{
|
|
787
1079
|
addHydratedFlag(elm);
|
|
788
1080
|
}
|
|
1081
|
+
{
|
|
1082
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
1083
|
+
}
|
|
789
1084
|
endPostUpdate();
|
|
790
1085
|
{
|
|
791
1086
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -810,6 +1105,16 @@ var postUpdateComponent = (hostRef) => {
|
|
|
810
1105
|
var appDidLoad = (who) => {
|
|
811
1106
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
812
1107
|
};
|
|
1108
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
1109
|
+
if (instance && instance[method]) {
|
|
1110
|
+
try {
|
|
1111
|
+
return instance[method](arg);
|
|
1112
|
+
} catch (e) {
|
|
1113
|
+
consoleError(e, elm);
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
return void 0;
|
|
1117
|
+
};
|
|
813
1118
|
var addHydratedFlag = (elm) => {
|
|
814
1119
|
var _a;
|
|
815
1120
|
return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
|
|
@@ -970,6 +1275,12 @@ var connectedCallback = (elm) => {
|
|
|
970
1275
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
971
1276
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
972
1277
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1278
|
+
{
|
|
1279
|
+
if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1280
|
+
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1281
|
+
setContentReference(elm);
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
973
1284
|
{
|
|
974
1285
|
let ancestorComponent = elm;
|
|
975
1286
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
@@ -992,6 +1303,7 @@ var connectedCallback = (elm) => {
|
|
|
992
1303
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
993
1304
|
}
|
|
994
1305
|
} else {
|
|
1306
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
995
1307
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
996
1308
|
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
997
1309
|
}
|
|
@@ -999,9 +1311,22 @@ var connectedCallback = (elm) => {
|
|
|
999
1311
|
endConnected();
|
|
1000
1312
|
}
|
|
1001
1313
|
};
|
|
1314
|
+
var setContentReference = (elm) => {
|
|
1315
|
+
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
1316
|
+
""
|
|
1317
|
+
);
|
|
1318
|
+
contentRefElm["s-cn"] = true;
|
|
1319
|
+
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
1320
|
+
};
|
|
1002
1321
|
var disconnectedCallback = async (elm) => {
|
|
1003
1322
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1004
|
-
getHostRef(elm);
|
|
1323
|
+
const hostRef = getHostRef(elm);
|
|
1324
|
+
{
|
|
1325
|
+
if (hostRef.$rmListeners$) {
|
|
1326
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1327
|
+
hostRef.$rmListeners$ = void 0;
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1005
1330
|
}
|
|
1006
1331
|
if (rootAppliedStyles.has(elm)) {
|
|
1007
1332
|
rootAppliedStyles.delete(elm);
|
|
@@ -1018,6 +1343,9 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1018
1343
|
{
|
|
1019
1344
|
cmpMeta.$members$ = compactMeta[2];
|
|
1020
1345
|
}
|
|
1346
|
+
{
|
|
1347
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1348
|
+
}
|
|
1021
1349
|
Object.assign(Cstr.prototype, {
|
|
1022
1350
|
__hasHostListenerAttached: false,
|
|
1023
1351
|
__registerHost() {
|
|
@@ -1025,7 +1353,8 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1025
1353
|
},
|
|
1026
1354
|
connectedCallback() {
|
|
1027
1355
|
if (!this.__hasHostListenerAttached) {
|
|
1028
|
-
getHostRef(this);
|
|
1356
|
+
const hostRef = getHostRef(this);
|
|
1357
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
1029
1358
|
this.__hasHostListenerAttached = true;
|
|
1030
1359
|
}
|
|
1031
1360
|
connectedCallback(this);
|
|
@@ -1062,6 +1391,34 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1062
1391
|
Cstr.is = cmpMeta.$tagName$;
|
|
1063
1392
|
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
1064
1393
|
};
|
|
1394
|
+
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1395
|
+
if (listeners) {
|
|
1396
|
+
listeners.map(([flags, name, method]) => {
|
|
1397
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
1398
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1399
|
+
const opts = hostListenerOpts(flags);
|
|
1400
|
+
plt.ael(target, name, handler, opts);
|
|
1401
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1404
|
+
};
|
|
1405
|
+
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1406
|
+
try {
|
|
1407
|
+
{
|
|
1408
|
+
hostRef.$hostElement$[methodName](ev);
|
|
1409
|
+
}
|
|
1410
|
+
} catch (e) {
|
|
1411
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
var getHostListenerTarget = (elm, flags) => {
|
|
1415
|
+
if (flags & 8 /* TargetWindow */) return win;
|
|
1416
|
+
return elm;
|
|
1417
|
+
};
|
|
1418
|
+
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
1419
|
+
passive: (flags & 1 /* Passive */) !== 0,
|
|
1420
|
+
capture: (flags & 2 /* Capture */) !== 0
|
|
1421
|
+
} : (flags & 2 /* Capture */) !== 0;
|
|
1065
1422
|
|
|
1066
1423
|
// src/runtime/nonce.ts
|
|
1067
1424
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
@@ -1071,4 +1428,4 @@ var setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
|
1071
1428
|
|
|
1072
1429
|
export { H, setNonce as a, setPlatformOptions as b, createEvent as c, getAssetPath as g, h, proxyCustomElement as p, setAssetPath as s };
|
|
1073
1430
|
|
|
1074
|
-
//# sourceMappingURL=p-
|
|
1431
|
+
//# sourceMappingURL=p-81e1c3fa.js.map
|