@sula-tech/webcomponents 0.3.3 → 0.4.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-87eec792.js → index-BtkenDV1.js} +205 -156
- package/dist/cjs/index-BtkenDV1.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +4 -6
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-icon.sula-loader.sula-menu-select-list.sula-radio-button.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.entry.cjs.js.map +1 -0
- package/dist/cjs/sula-avatar_14.cjs.entry.js +28270 -0
- package/dist/cjs/sula-avatar_14.cjs.entry.js.map +1 -0
- package/dist/cjs/webcomponents.cjs.js +8 -8
- package/dist/cjs/webcomponents.cjs.js.map +1 -1
- package/dist/collection/assets/lottie/loader.json +1 -0
- package/dist/collection/collection-manifest.json +7 -2
- package/dist/collection/components/sula-avatar/sula-avatar.css +1 -1
- package/dist/collection/components/sula-avatar/sula-avatar.js +4 -4
- package/dist/collection/components/sula-avatar/sula-avatar.stories.js +7 -0
- package/dist/collection/components/sula-avatar/sula-avatar.stories.js.map +1 -1
- package/dist/collection/components/sula-badge/sula-badge.css +1 -1
- package/dist/collection/components/sula-badge/sula-badge.js +5 -5
- package/dist/collection/components/sula-badge/sula-badge.stories.js +7 -0
- package/dist/collection/components/sula-badge/sula-badge.stories.js.map +1 -1
- package/dist/collection/components/sula-button/sula-button.css +1 -1
- package/dist/collection/components/sula-button/sula-button.js +8 -8
- package/dist/collection/components/sula-button/sula-button.stories.js +7 -0
- package/dist/collection/components/sula-button/sula-button.stories.js.map +1 -1
- package/dist/collection/components/sula-checkbox/sula-checkbox.css +1 -1
- package/dist/collection/components/sula-checkbox/sula-checkbox.js +5 -5
- package/dist/collection/components/sula-checkbox/sula-checkbox.stories.js +7 -0
- package/dist/collection/components/sula-checkbox/sula-checkbox.stories.js.map +1 -1
- package/dist/collection/components/sula-chip/model/sula-chip.model.js +6 -0
- package/dist/collection/components/sula-chip/model/sula-chip.model.js.map +1 -0
- package/dist/collection/components/sula-chip/sula-chip.css +1 -0
- package/dist/collection/components/sula-chip/sula-chip.js +243 -0
- package/dist/collection/components/sula-chip/sula-chip.js.map +1 -0
- package/dist/collection/components/sula-chip/sula-chip.stories.js +125 -0
- package/dist/collection/components/sula-chip/sula-chip.stories.js.map +1 -0
- package/dist/collection/components/sula-icon/sula-icon.css +1 -1
- package/dist/collection/components/sula-icon/sula-icon.js +3 -3
- package/dist/collection/components/sula-loader/model/sula-loader.model.js +7 -0
- package/dist/collection/components/sula-loader/model/sula-loader.model.js.map +1 -0
- package/dist/collection/components/sula-loader/sula-loader.css +1 -0
- package/dist/collection/components/sula-loader/sula-loader.js +102 -0
- package/dist/collection/components/sula-loader/sula-loader.js.map +1 -0
- package/dist/collection/components/sula-loader/sula-loader.stories.js +48 -0
- package/dist/collection/components/sula-loader/sula-loader.stories.js.map +1 -0
- package/dist/collection/components/sula-loader/test/__mocks__/lottie-web.js +10 -0
- package/dist/collection/components/sula-loader/test/__mocks__/lottie-web.js.map +1 -0
- package/dist/collection/components/sula-menu-select-list/model/sula-menu-select-list.model.js +2 -0
- package/dist/collection/components/sula-menu-select-list/model/sula-menu-select-list.model.js.map +1 -0
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.css +1 -0
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js +81 -0
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js.map +1 -0
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.stories.js +91 -0
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.stories.js.map +1 -0
- package/dist/collection/components/sula-radio-button/sula-radio-button.css +1 -0
- package/dist/collection/components/sula-radio-button/sula-radio-button.js +176 -0
- package/dist/collection/components/sula-radio-button/sula-radio-button.js.map +1 -0
- package/dist/collection/components/sula-radio-button/sula-radio-button.stories.js +123 -0
- package/dist/collection/components/sula-radio-button/sula-radio-button.stories.js.map +1 -0
- package/dist/collection/components/sula-switch/sula-switch.css +1 -1
- package/dist/collection/components/sula-switch/sula-switch.js +9 -9
- package/dist/collection/components/sula-switch/sula-switch.stories.js +7 -0
- package/dist/collection/components/sula-switch/sula-switch.stories.js.map +1 -1
- package/dist/collection/components/sula-tag/sula-tag.css +1 -1
- package/dist/collection/components/sula-tag/sula-tag.js +9 -9
- package/dist/collection/components/sula-tag/sula-tag.stories.js +7 -0
- package/dist/collection/components/sula-tag/sula-tag.stories.js.map +1 -1
- package/dist/collection/components/sula-textarea/sula-textarea.css +1 -1
- package/dist/collection/components/sula-textarea/sula-textarea.js +14 -14
- package/dist/collection/components/sula-textarea/sula-textarea.js.map +1 -1
- package/dist/collection/components/sula-textarea/sula-textarea.stories.js +7 -0
- package/dist/collection/components/sula-textarea/sula-textarea.stories.js.map +1 -1
- package/dist/collection/components/sula-textfield/sula-textfield.css +1 -1
- package/dist/collection/components/sula-textfield/sula-textfield.js +12 -12
- package/dist/collection/components/sula-textfield/sula-textfield.js.map +1 -1
- package/dist/collection/components/sula-textfield/sula-textfield.stories.js +7 -0
- package/dist/collection/components/sula-textfield/sula-textfield.stories.js.map +1 -1
- package/dist/collection/components/sula-tiles/model/sula-tiles.model.js +11 -0
- package/dist/collection/components/sula-tiles/model/sula-tiles.model.js.map +1 -0
- package/dist/collection/components/sula-tiles/sula-tiles.css +1 -0
- package/dist/collection/components/sula-tiles/sula-tiles.js +316 -0
- package/dist/collection/components/sula-tiles/sula-tiles.js.map +1 -0
- package/dist/collection/components/sula-tiles/sula-tiles.stories.js +420 -0
- package/dist/collection/components/sula-tiles/sula-tiles.stories.js.map +1 -0
- package/dist/components/index.js +1251 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-b0d1214f.js → p-CEU3PNQs.js} +6 -6
- package/dist/components/p-CEU3PNQs.js.map +1 -0
- package/dist/components/p-DJGFqp8r.js +44 -0
- package/dist/components/p-DJGFqp8r.js.map +1 -0
- package/dist/components/sula-avatar.js +5 -5
- package/dist/components/sula-avatar.js.map +1 -1
- package/dist/components/sula-badge.js +5 -5
- package/dist/components/sula-badge.js.map +1 -1
- package/dist/components/sula-button.js +6 -6
- package/dist/components/sula-button.js.map +1 -1
- package/dist/components/sula-checkbox.js +8 -8
- package/dist/components/sula-checkbox.js.map +1 -1
- package/dist/components/sula-chip.d.ts +11 -0
- package/dist/components/sula-chip.js +136 -0
- package/dist/components/sula-chip.js.map +1 -0
- package/dist/components/sula-icon.js +2 -1
- package/dist/components/sula-loader.d.ts +11 -0
- package/dist/components/sula-loader.js +27132 -0
- package/dist/components/sula-loader.js.map +1 -0
- package/dist/components/sula-menu-select-list.d.ts +11 -0
- package/dist/components/sula-menu-select-list.js +9 -0
- package/dist/components/sula-menu-select-list.js.map +1 -0
- package/dist/components/sula-radio-button.d.ts +11 -0
- package/dist/components/sula-radio-button.js +83 -0
- package/dist/components/sula-radio-button.js.map +1 -0
- package/dist/components/sula-switch.js +11 -11
- package/dist/components/sula-switch.js.map +1 -1
- package/dist/components/sula-tag.js +8 -8
- package/dist/components/sula-tag.js.map +1 -1
- package/dist/components/sula-textarea.js +13 -13
- package/dist/components/sula-textarea.js.map +1 -1
- package/dist/components/sula-textfield.js +11 -11
- package/dist/components/sula-textfield.js.map +1 -1
- package/dist/components/sula-tiles.d.ts +11 -0
- package/dist/components/sula-tiles.js +180 -0
- package/dist/components/sula-tiles.js.map +1 -0
- package/dist/esm/{index-aa1c5f36.js → index-Yyeke16a.js} +203 -135
- package/dist/esm/index-Yyeke16a.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +4 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-icon.sula-loader.sula-menu-select-list.sula-radio-button.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.entry.js.map +1 -0
- package/dist/esm/sula-avatar_14.entry.js +28255 -0
- package/dist/esm/sula-avatar_14.entry.js.map +1 -0
- package/dist/esm/webcomponents.js +6 -5
- package/dist/esm/webcomponents.js.map +1 -1
- package/dist/types/components/sula-avatar/sula-avatar.stories.d.ts +7 -0
- package/dist/types/components/sula-badge/sula-badge.stories.d.ts +7 -0
- package/dist/types/components/sula-button/sula-button.stories.d.ts +7 -0
- package/dist/types/components/sula-checkbox/sula-checkbox.stories.d.ts +7 -0
- package/dist/types/components/sula-chip/model/sula-chip.model.d.ts +4 -0
- package/dist/types/components/sula-chip/sula-chip.d.ts +40 -0
- package/dist/types/components/sula-chip/sula-chip.stories.d.ts +64 -0
- package/dist/types/components/sula-loader/model/sula-loader.model.d.ts +5 -0
- package/dist/types/components/sula-loader/sula-loader.d.ts +19 -0
- package/dist/types/components/sula-loader/sula-loader.stories.d.ts +29 -0
- package/dist/types/components/sula-loader/test/__mocks__/lottie-web.d.ts +4 -0
- package/dist/types/components/sula-menu-select-list/model/sula-menu-select-list.model.d.ts +4 -0
- package/dist/types/components/sula-menu-select-list/sula-menu-select-list.d.ts +14 -0
- package/dist/types/components/sula-menu-select-list/sula-menu-select-list.stories.d.ts +32 -0
- package/dist/types/components/sula-radio-button/sula-radio-button.d.ts +32 -0
- package/dist/types/components/sula-radio-button/sula-radio-button.stories.d.ts +57 -0
- package/dist/types/components/sula-switch/sula-switch.stories.d.ts +7 -0
- package/dist/types/components/sula-tag/sula-tag.stories.d.ts +7 -0
- package/dist/types/components/sula-textarea/sula-textarea.stories.d.ts +7 -0
- package/dist/types/components/sula-textfield/sula-textfield.stories.d.ts +7 -0
- package/dist/types/components/sula-tiles/model/sula-tiles.model.d.ts +8 -0
- package/dist/types/components/sula-tiles/sula-tiles.d.ts +54 -0
- package/dist/types/components/sula-tiles/sula-tiles.stories.d.ts +99 -0
- package/dist/types/components.d.ts +383 -0
- package/dist/types/stencil-public-runtime.d.ts +23 -1
- package/dist/webcomponents/assets/lottie/loader.json +1 -0
- package/dist/webcomponents/index.esm.js +1 -0
- package/dist/webcomponents/index.esm.js.map +1 -1
- package/dist/webcomponents/loader.esm.js.map +1 -0
- package/dist/webcomponents/p-67f9fa90.entry.js +21628 -0
- package/dist/webcomponents/p-67f9fa90.entry.js.map +1 -0
- package/dist/webcomponents/p-Yyeke16a.js +1469 -0
- package/dist/webcomponents/p-Yyeke16a.js.map +1 -0
- package/dist/webcomponents/sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-icon.sula-loader.sula-menu-select-list.sula-radio-button.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.entry.esm.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +33 -9
- package/dist/webcomponents/webcomponents.esm.js.map +1 -1
- package/package.json +5 -2
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/index-87eec792.js.map +0 -1
- package/dist/cjs/sula-avatar_9.cjs.entry.js +0 -865
- package/dist/cjs/sula-avatar_9.cjs.entry.js.map +0 -1
- package/dist/components/p-881c6b35.js +0 -1198
- package/dist/components/p-881c6b35.js.map +0 -1
- package/dist/components/p-b0d1214f.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/index-aa1c5f36.js.map +0 -1
- package/dist/esm/sula-avatar_9.entry.js +0 -853
- package/dist/esm/sula-avatar_9.entry.js.map +0 -1
- package/dist/webcomponents/p-5a36af0f.js +0 -1492
- package/dist/webcomponents/p-5a36af0f.js.map +0 -1
- package/dist/webcomponents/p-7cde1edf.entry.js +0 -1123
- package/dist/webcomponents/p-7cde1edf.entry.js.map +0 -1
- package/dist/webcomponents/p-e1255160.js +0 -4
- package/dist/webcomponents/p-e1255160.js.map +0 -1
- package/loader/package.json +0 -11
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
const NAMESPACE = 'webcomponents';
|
|
2
|
-
const BUILD = /* webcomponents */ {
|
|
2
|
+
const BUILD = /* webcomponents */ { hydratedSelectorName: "hydrated", lazyLoad: true, updatable: true, watchCallback: false };
|
|
3
|
+
|
|
4
|
+
const globalScripts = () => {};
|
|
5
|
+
const globalStyles = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box }:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4 }body{line-height:inherit;margin:0 }hr{border-top-width:1px;color:inherit;height:0 }abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal }small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0 }button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0 }button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none }:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px }::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit }summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1 }[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle }img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{text-rendering:optimizeLegibility}";
|
|
3
6
|
|
|
4
7
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
8
|
+
Stencil Client Platform v4.35.1 | MIT Licensed | https://stenciljs.com
|
|
6
9
|
*/
|
|
7
10
|
var __defProp = Object.defineProperty;
|
|
8
11
|
var __export = (target, all) => {
|
|
@@ -11,10 +14,15 @@ var __export = (target, all) => {
|
|
|
11
14
|
};
|
|
12
15
|
|
|
13
16
|
// src/client/client-host-ref.ts
|
|
14
|
-
var
|
|
15
|
-
|
|
17
|
+
var getHostRef = (ref) => {
|
|
18
|
+
if (ref.__stencil__getHostRef) {
|
|
19
|
+
return ref.__stencil__getHostRef();
|
|
20
|
+
}
|
|
21
|
+
return void 0;
|
|
22
|
+
};
|
|
16
23
|
var registerInstance = (lazyInstance, hostRef) => {
|
|
17
|
-
|
|
24
|
+
lazyInstance.__stencil__getHostRef = () => hostRef;
|
|
25
|
+
hostRef.$lazyInstance$ = lazyInstance;
|
|
18
26
|
};
|
|
19
27
|
var registerHost = (hostElement, cmpMeta) => {
|
|
20
28
|
const hostRef = {
|
|
@@ -28,7 +36,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
28
36
|
hostElement["s-p"] = [];
|
|
29
37
|
hostElement["s-rc"] = [];
|
|
30
38
|
}
|
|
31
|
-
const ref =
|
|
39
|
+
const ref = hostRef;
|
|
40
|
+
hostElement.__stencil__getHostRef = () => ref;
|
|
32
41
|
return ref;
|
|
33
42
|
};
|
|
34
43
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
@@ -68,11 +77,9 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
68
77
|
|
|
69
78
|
// src/client/client-style.ts
|
|
70
79
|
var styles = /* @__PURE__ */ new Map();
|
|
71
|
-
var HYDRATED_STYLE_ID = "sty-id";
|
|
72
80
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
73
81
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
74
82
|
var win = typeof window !== "undefined" ? window : {};
|
|
75
|
-
var doc = win.document || { head: {} };
|
|
76
83
|
var plt = {
|
|
77
84
|
$flags$: 0,
|
|
78
85
|
$resourcesUrl$: "",
|
|
@@ -83,9 +90,10 @@ var plt = {
|
|
|
83
90
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
84
91
|
};
|
|
85
92
|
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
93
|
+
var _a;
|
|
86
94
|
let supportsListenerOptions2 = false;
|
|
87
95
|
try {
|
|
88
|
-
|
|
96
|
+
(_a = win.document) == null ? void 0 : _a.addEventListener(
|
|
89
97
|
"e",
|
|
90
98
|
null,
|
|
91
99
|
Object.defineProperty({}, "passive", {
|
|
@@ -148,11 +156,16 @@ var isComplexType = (o) => {
|
|
|
148
156
|
};
|
|
149
157
|
|
|
150
158
|
// src/utils/query-nonce-meta-tag-content.ts
|
|
151
|
-
function queryNonceMetaTagContent(
|
|
159
|
+
function queryNonceMetaTagContent(doc) {
|
|
152
160
|
var _a, _b, _c;
|
|
153
|
-
return (_c = (_b = (_a =
|
|
161
|
+
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;
|
|
154
162
|
}
|
|
155
163
|
|
|
164
|
+
// src/utils/regular-expression.ts
|
|
165
|
+
var escapeRegExpSpecialCharacters = (text) => {
|
|
166
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
167
|
+
};
|
|
168
|
+
|
|
156
169
|
// src/utils/result.ts
|
|
157
170
|
var result_exports = {};
|
|
158
171
|
__export(result_exports, {
|
|
@@ -201,6 +214,14 @@ var unwrapErr = (result) => {
|
|
|
201
214
|
throw result.value;
|
|
202
215
|
}
|
|
203
216
|
};
|
|
217
|
+
function createShadowRoot(cmpMeta) {
|
|
218
|
+
const shadowRoot = this.attachShadow({ mode: "open" });
|
|
219
|
+
if (supportsConstructableStylesheets) {
|
|
220
|
+
const sheet = new CSSStyleSheet();
|
|
221
|
+
sheet.replaceSync(globalStyles);
|
|
222
|
+
shadowRoot.adoptedStyleSheets.push(sheet);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
204
225
|
var createTime = (fnName, tagName = "") => {
|
|
205
226
|
{
|
|
206
227
|
return () => {
|
|
@@ -279,13 +300,27 @@ var newVNode = (tag, text) => {
|
|
|
279
300
|
};
|
|
280
301
|
var Host = {};
|
|
281
302
|
var isHost = (node) => node && node.$tag$ === Host;
|
|
282
|
-
var
|
|
303
|
+
var createSupportsRuleRe = (selector) => {
|
|
304
|
+
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
305
|
+
return new RegExp(
|
|
306
|
+
// First capture group: match any context before the selector that's not inside @supports selector()
|
|
307
|
+
// Using negative lookahead to avoid matching inside @supports selector(...) condition
|
|
308
|
+
`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
|
|
309
|
+
"g"
|
|
310
|
+
);
|
|
311
|
+
};
|
|
312
|
+
createSupportsRuleRe("::slotted");
|
|
313
|
+
createSupportsRuleRe(":host");
|
|
314
|
+
createSupportsRuleRe(":host-context");
|
|
315
|
+
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
283
316
|
if (propValue != null && !isComplexType(propValue)) {
|
|
284
317
|
if (propType & 4 /* Boolean */) {
|
|
285
|
-
|
|
318
|
+
{
|
|
319
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
320
|
+
}
|
|
286
321
|
}
|
|
287
322
|
if (propType & 2 /* Number */) {
|
|
288
|
-
return parseFloat(propValue);
|
|
323
|
+
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
289
324
|
}
|
|
290
325
|
if (propType & 1 /* String */) {
|
|
291
326
|
return String(propValue);
|
|
@@ -302,9 +337,9 @@ var createEvent = (ref, name, flags) => {
|
|
|
302
337
|
return {
|
|
303
338
|
emit: (detail) => {
|
|
304
339
|
return emitEvent(elm, name, {
|
|
305
|
-
bubbles:
|
|
306
|
-
composed:
|
|
307
|
-
cancelable:
|
|
340
|
+
bubbles: true,
|
|
341
|
+
composed: true,
|
|
342
|
+
cancelable: true,
|
|
308
343
|
detail
|
|
309
344
|
});
|
|
310
345
|
}
|
|
@@ -334,7 +369,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
334
369
|
var _a;
|
|
335
370
|
const scopeId2 = getScopeId(cmpMeta);
|
|
336
371
|
const style = styles.get(scopeId2);
|
|
337
|
-
|
|
372
|
+
if (!win.document) {
|
|
373
|
+
return scopeId2;
|
|
374
|
+
}
|
|
375
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
338
376
|
if (style) {
|
|
339
377
|
if (typeof style === "string") {
|
|
340
378
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
@@ -345,9 +383,9 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
345
383
|
}
|
|
346
384
|
if (!appliedStyles.has(scopeId2)) {
|
|
347
385
|
{
|
|
348
|
-
styleElm = document.
|
|
386
|
+
styleElm = win.document.createElement("style");
|
|
349
387
|
styleElm.innerHTML = style;
|
|
350
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
|
388
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
351
389
|
if (nonce != null) {
|
|
352
390
|
styleElm.setAttribute("nonce", nonce);
|
|
353
391
|
}
|
|
@@ -401,7 +439,7 @@ var attachStyles = (hostRef) => {
|
|
|
401
439
|
const scopeId2 = addStyle(
|
|
402
440
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
403
441
|
cmpMeta);
|
|
404
|
-
if (
|
|
442
|
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
405
443
|
elm["s-sc"] = scopeId2;
|
|
406
444
|
elm.classList.add(scopeId2 + "-h");
|
|
407
445
|
}
|
|
@@ -409,93 +447,94 @@ var attachStyles = (hostRef) => {
|
|
|
409
447
|
};
|
|
410
448
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
411
449
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
412
|
-
if (oldValue
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
} else {
|
|
430
|
-
elm.style[prop] = "";
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
for (const prop in newValue) {
|
|
436
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
450
|
+
if (oldValue === newValue) {
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
454
|
+
let ln = memberName.toLowerCase();
|
|
455
|
+
if (memberName === "class") {
|
|
456
|
+
const classList = elm.classList;
|
|
457
|
+
const oldClasses = parseClassList(oldValue);
|
|
458
|
+
let newClasses = parseClassList(newValue);
|
|
459
|
+
{
|
|
460
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
461
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
462
|
+
}
|
|
463
|
+
} else if (memberName === "style") {
|
|
464
|
+
{
|
|
465
|
+
for (const prop in oldValue) {
|
|
466
|
+
if (!newValue || newValue[prop] == null) {
|
|
437
467
|
if (prop.includes("-")) {
|
|
438
|
-
elm.style.
|
|
468
|
+
elm.style.removeProperty(prop);
|
|
439
469
|
} else {
|
|
440
|
-
elm.style[prop] =
|
|
470
|
+
elm.style[prop] = "";
|
|
441
471
|
}
|
|
442
472
|
}
|
|
443
473
|
}
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
} else if (isMemberInElement(win, ln)) {
|
|
452
|
-
memberName = ln.slice(2);
|
|
453
|
-
} else {
|
|
454
|
-
memberName = ln[2] + memberName.slice(3);
|
|
455
|
-
}
|
|
456
|
-
if (oldValue || newValue) {
|
|
457
|
-
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
458
|
-
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
459
|
-
if (oldValue) {
|
|
460
|
-
plt.rel(elm, memberName, oldValue, capture);
|
|
461
|
-
}
|
|
462
|
-
if (newValue) {
|
|
463
|
-
plt.ael(elm, memberName, newValue, capture);
|
|
474
|
+
}
|
|
475
|
+
for (const prop in newValue) {
|
|
476
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
477
|
+
if (prop.includes("-")) {
|
|
478
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
479
|
+
} else {
|
|
480
|
+
elm.style[prop] = newValue[prop];
|
|
464
481
|
}
|
|
465
482
|
}
|
|
483
|
+
}
|
|
484
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
485
|
+
if (newValue) {
|
|
486
|
+
newValue(elm);
|
|
487
|
+
}
|
|
488
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
489
|
+
if (memberName[2] === "-") {
|
|
490
|
+
memberName = memberName.slice(3);
|
|
491
|
+
} else if (isMemberInElement(win, ln)) {
|
|
492
|
+
memberName = ln.slice(2);
|
|
466
493
|
} else {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
494
|
+
memberName = ln[2] + memberName.slice(3);
|
|
495
|
+
}
|
|
496
|
+
if (oldValue || newValue) {
|
|
497
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
498
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
499
|
+
if (oldValue) {
|
|
500
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
501
|
+
}
|
|
502
|
+
if (newValue) {
|
|
503
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
} else {
|
|
507
|
+
const isComplex = isComplexType(newValue);
|
|
508
|
+
if ((isProp || isComplex && newValue !== null) && true) {
|
|
509
|
+
try {
|
|
510
|
+
if (!elm.tagName.includes("-")) {
|
|
511
|
+
const n = newValue == null ? "" : newValue;
|
|
512
|
+
if (memberName === "list") {
|
|
513
|
+
isProp = false;
|
|
514
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
|
515
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
516
|
+
elm[memberName] = n;
|
|
517
|
+
} else {
|
|
518
|
+
elm.setAttribute(memberName, n);
|
|
480
519
|
}
|
|
481
|
-
} else if (elm[memberName] !== newValue) {
|
|
482
|
-
elm[memberName] = newValue;
|
|
483
520
|
}
|
|
484
|
-
}
|
|
521
|
+
} else if (elm[memberName] !== newValue) {
|
|
522
|
+
elm[memberName] = newValue;
|
|
485
523
|
}
|
|
524
|
+
} catch (e) {
|
|
486
525
|
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
elm.removeAttribute(memberName);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
494
|
-
newValue = newValue === true ? "" : newValue;
|
|
526
|
+
}
|
|
527
|
+
if (newValue == null || newValue === false) {
|
|
528
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
495
529
|
{
|
|
496
|
-
elm.
|
|
530
|
+
elm.removeAttribute(memberName);
|
|
497
531
|
}
|
|
498
532
|
}
|
|
533
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
|
534
|
+
newValue = newValue === true ? "" : newValue;
|
|
535
|
+
{
|
|
536
|
+
elm.setAttribute(memberName, newValue);
|
|
537
|
+
}
|
|
499
538
|
}
|
|
500
539
|
}
|
|
501
540
|
};
|
|
@@ -550,7 +589,6 @@ function sortedAttrNames(attrNames) {
|
|
|
550
589
|
);
|
|
551
590
|
}
|
|
552
591
|
var hostTagName;
|
|
553
|
-
var useNativeShadowDom = false;
|
|
554
592
|
var isSvgMode = false;
|
|
555
593
|
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
556
594
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
@@ -558,10 +596,15 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
558
596
|
let elm;
|
|
559
597
|
let childNode;
|
|
560
598
|
if (newVNode2.$text$ !== null) {
|
|
561
|
-
elm = newVNode2.$elm$ =
|
|
599
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
562
600
|
} else {
|
|
563
|
-
|
|
564
|
-
|
|
601
|
+
if (!win.document) {
|
|
602
|
+
throw new Error(
|
|
603
|
+
"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."
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
elm = newVNode2.$elm$ = win.document.createElement(
|
|
607
|
+
newVNode2.$tag$
|
|
565
608
|
);
|
|
566
609
|
{
|
|
567
610
|
updateElement(null, newVNode2, isSvgMode);
|
|
@@ -706,13 +749,10 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
706
749
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
707
750
|
const oldChildren = oldVNode.$children$;
|
|
708
751
|
const newChildren = newVNode2.$children$;
|
|
709
|
-
const tag = newVNode2.$tag$;
|
|
710
752
|
const text = newVNode2.$text$;
|
|
711
753
|
if (text === null) {
|
|
712
754
|
{
|
|
713
|
-
|
|
714
|
-
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
715
|
-
}
|
|
755
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
716
756
|
}
|
|
717
757
|
if (oldChildren !== null && newChildren !== null) {
|
|
718
758
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
@@ -744,9 +784,9 @@ var insertBefore = (parent, newNode, reference) => {
|
|
|
744
784
|
};
|
|
745
785
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
746
786
|
const hostElm = hostRef.$hostElement$;
|
|
747
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
748
787
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
749
|
-
const
|
|
788
|
+
const isHostElement = isHost(renderFnResults);
|
|
789
|
+
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
750
790
|
hostTagName = hostElm.tagName;
|
|
751
791
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
752
792
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
@@ -759,7 +799,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
759
799
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
760
800
|
hostRef.$vnode$ = rootVnode;
|
|
761
801
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
762
|
-
useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
|
|
763
802
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
764
803
|
};
|
|
765
804
|
|
|
@@ -807,13 +846,13 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
807
846
|
}
|
|
808
847
|
}
|
|
809
848
|
emitLifecycleEvent(elm, "componentWillLoad");
|
|
810
|
-
|
|
811
|
-
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
812
|
-
}
|
|
849
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
813
850
|
} else {
|
|
814
851
|
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
852
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
815
853
|
}
|
|
816
854
|
emitLifecycleEvent(elm, "componentWillRender");
|
|
855
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
817
856
|
endSchedule();
|
|
818
857
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
819
858
|
};
|
|
@@ -856,7 +895,7 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
856
895
|
try {
|
|
857
896
|
instance = instance.render() ;
|
|
858
897
|
{
|
|
859
|
-
hostRef.$flags$ &=
|
|
898
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
|
860
899
|
}
|
|
861
900
|
{
|
|
862
901
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
@@ -879,15 +918,14 @@ var postUpdateComponent = (hostRef) => {
|
|
|
879
918
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
880
919
|
const instance = hostRef.$lazyInstance$ ;
|
|
881
920
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
921
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
882
922
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
883
923
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
884
924
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
885
925
|
{
|
|
886
926
|
addHydratedFlag(elm);
|
|
887
927
|
}
|
|
888
|
-
|
|
889
|
-
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
890
|
-
}
|
|
928
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
891
929
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
892
930
|
endPostUpdate();
|
|
893
931
|
{
|
|
@@ -897,6 +935,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
897
935
|
}
|
|
898
936
|
}
|
|
899
937
|
} else {
|
|
938
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
900
939
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
901
940
|
endPostUpdate();
|
|
902
941
|
}
|
|
@@ -908,7 +947,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
908
947
|
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
909
948
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
910
949
|
}
|
|
911
|
-
hostRef.$flags$ &=
|
|
950
|
+
hostRef.$flags$ &= -517;
|
|
912
951
|
}
|
|
913
952
|
};
|
|
914
953
|
var appDidLoad = (who) => {
|
|
@@ -946,19 +985,26 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
946
985
|
const hostRef = getHostRef(ref);
|
|
947
986
|
if (!hostRef) {
|
|
948
987
|
throw new Error(
|
|
949
|
-
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/
|
|
988
|
+
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
|
|
950
989
|
);
|
|
951
990
|
}
|
|
952
991
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
953
992
|
const flags = hostRef.$flags$;
|
|
954
993
|
const instance = hostRef.$lazyInstance$ ;
|
|
955
|
-
newVal = parsePropertyValue(
|
|
994
|
+
newVal = parsePropertyValue(
|
|
995
|
+
newVal,
|
|
996
|
+
cmpMeta.$members$[propName][0]);
|
|
956
997
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
957
998
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
958
999
|
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
959
1000
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
960
1001
|
if (instance) {
|
|
961
1002
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1003
|
+
if (instance.componentShouldUpdate) {
|
|
1004
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
962
1008
|
scheduleUpdate(hostRef, false);
|
|
963
1009
|
}
|
|
964
1010
|
}
|
|
@@ -969,7 +1015,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
969
1015
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
970
1016
|
var _a, _b;
|
|
971
1017
|
const prototype = Cstr.prototype;
|
|
972
|
-
if (cmpMeta.$members$ || BUILD.watchCallback
|
|
1018
|
+
if (cmpMeta.$members$ || BUILD.watchCallback) {
|
|
973
1019
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
974
1020
|
members.map(([memberName, [memberFlags]]) => {
|
|
975
1021
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
@@ -1003,7 +1049,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1003
1049
|
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1004
1050
|
ref.$instanceValues$.set(memberName, currentValue);
|
|
1005
1051
|
}
|
|
1006
|
-
origSetter.apply(this, [
|
|
1052
|
+
origSetter.apply(this, [
|
|
1053
|
+
parsePropertyValue(
|
|
1054
|
+
newValue,
|
|
1055
|
+
memberFlags)
|
|
1056
|
+
]);
|
|
1007
1057
|
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1008
1058
|
setValue(this, memberName, newValue, cmpMeta);
|
|
1009
1059
|
return;
|
|
@@ -1025,7 +1075,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1025
1075
|
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1026
1076
|
ref.$instanceValues$.set(memberName, currentValue);
|
|
1027
1077
|
}
|
|
1028
|
-
ref.$lazyInstance$[memberName] = parsePropertyValue(
|
|
1078
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(
|
|
1079
|
+
newValue,
|
|
1080
|
+
memberFlags);
|
|
1029
1081
|
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1030
1082
|
};
|
|
1031
1083
|
if (ref.$lazyInstance$) {
|
|
@@ -1118,9 +1170,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1118
1170
|
consoleError(e, elm);
|
|
1119
1171
|
}
|
|
1120
1172
|
{
|
|
1121
|
-
hostRef.$flags$ &=
|
|
1173
|
+
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
1122
1174
|
}
|
|
1123
1175
|
endNewInstance();
|
|
1176
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1124
1177
|
} else {
|
|
1125
1178
|
Cstr = elm.constructor;
|
|
1126
1179
|
const cmpTag = elm.localName;
|
|
@@ -1148,6 +1201,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1148
1201
|
}
|
|
1149
1202
|
};
|
|
1150
1203
|
var fireConnectedCallback = (instance, elm) => {
|
|
1204
|
+
{
|
|
1205
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
|
1206
|
+
}
|
|
1151
1207
|
};
|
|
1152
1208
|
|
|
1153
1209
|
// src/runtime/connected-callback.ts
|
|
@@ -1181,14 +1237,19 @@ var connectedCallback = (elm) => {
|
|
|
1181
1237
|
}
|
|
1182
1238
|
} else {
|
|
1183
1239
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1184
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$)
|
|
1185
|
-
hostRef.$
|
|
1240
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1241
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1242
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1243
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
1186
1244
|
}
|
|
1187
1245
|
}
|
|
1188
1246
|
endConnected();
|
|
1189
1247
|
}
|
|
1190
1248
|
};
|
|
1191
1249
|
var disconnectInstance = (instance, elm) => {
|
|
1250
|
+
{
|
|
1251
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
1252
|
+
}
|
|
1192
1253
|
};
|
|
1193
1254
|
var disconnectedCallback = async (elm) => {
|
|
1194
1255
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1199,8 +1260,10 @@ var disconnectedCallback = async (elm) => {
|
|
|
1199
1260
|
hostRef.$rmListeners$ = void 0;
|
|
1200
1261
|
}
|
|
1201
1262
|
}
|
|
1202
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$)
|
|
1203
|
-
hostRef.$
|
|
1263
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1264
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
1265
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1266
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
|
1204
1267
|
}
|
|
1205
1268
|
}
|
|
1206
1269
|
if (rootAppliedStyles.has(elm)) {
|
|
@@ -1214,18 +1277,22 @@ var disconnectedCallback = async (elm) => {
|
|
|
1214
1277
|
// src/runtime/bootstrap-lazy.ts
|
|
1215
1278
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1216
1279
|
var _a;
|
|
1280
|
+
if (!win.document) {
|
|
1281
|
+
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1217
1284
|
const endBootstrap = createTime();
|
|
1218
1285
|
const cmpTags = [];
|
|
1219
1286
|
const exclude = options.exclude || [];
|
|
1220
1287
|
const customElements2 = win.customElements;
|
|
1221
|
-
const head =
|
|
1288
|
+
const head = win.document.head;
|
|
1222
1289
|
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
|
|
1223
|
-
const dataStyles = /* @__PURE__ */
|
|
1290
|
+
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
|
|
1224
1291
|
const deferredConnectedCallbacks = [];
|
|
1225
1292
|
let appLoadFallback;
|
|
1226
1293
|
let isBootstrapping = true;
|
|
1227
1294
|
Object.assign(plt, options);
|
|
1228
|
-
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./",
|
|
1295
|
+
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
1229
1296
|
let hasSlotRelocation = false;
|
|
1230
1297
|
lazyBundles.map((lazyBundle) => {
|
|
1231
1298
|
lazyBundle[1].map((compactMeta) => {
|
|
@@ -1255,9 +1322,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1255
1322
|
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1256
1323
|
{
|
|
1257
1324
|
if (!self.shadowRoot) {
|
|
1258
|
-
|
|
1259
|
-
self.attachShadow({ mode: "open" });
|
|
1260
|
-
}
|
|
1325
|
+
createShadowRoot.call(self, cmpMeta);
|
|
1261
1326
|
} else {
|
|
1262
1327
|
if (self.shadowRoot.mode !== "open") {
|
|
1263
1328
|
throw new Error(
|
|
@@ -1321,7 +1386,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1321
1386
|
}
|
|
1322
1387
|
if (dataStyles.innerHTML.length) {
|
|
1323
1388
|
dataStyles.setAttribute("data-styles", "");
|
|
1324
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
|
1389
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
1325
1390
|
if (nonce != null) {
|
|
1326
1391
|
dataStyles.setAttribute("nonce", nonce);
|
|
1327
1392
|
}
|
|
@@ -1339,9 +1404,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1339
1404
|
endBootstrap();
|
|
1340
1405
|
};
|
|
1341
1406
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1342
|
-
if (listeners) {
|
|
1407
|
+
if (listeners && win.document) {
|
|
1343
1408
|
listeners.map(([flags, name, method]) => {
|
|
1344
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
1409
|
+
const target = getHostListenerTarget(win.document, elm, flags) ;
|
|
1345
1410
|
const handler = hostListenerProxy(hostRef, method);
|
|
1346
1411
|
const opts = hostListenerOpts(flags);
|
|
1347
1412
|
plt.ael(target, name, handler, opts);
|
|
@@ -1363,8 +1428,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1363
1428
|
consoleError(e, hostRef.$hostElement$);
|
|
1364
1429
|
}
|
|
1365
1430
|
};
|
|
1366
|
-
var getHostListenerTarget = (elm, flags) => {
|
|
1367
|
-
if (flags & 4 /* TargetDocument */)
|
|
1431
|
+
var getHostListenerTarget = (doc, elm, flags) => {
|
|
1432
|
+
if (flags & 4 /* TargetDocument */) {
|
|
1433
|
+
return doc;
|
|
1434
|
+
}
|
|
1368
1435
|
return elm;
|
|
1369
1436
|
};
|
|
1370
1437
|
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
@@ -1375,6 +1442,7 @@ var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
|
1375
1442
|
// src/runtime/nonce.ts
|
|
1376
1443
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1377
1444
|
|
|
1378
|
-
export { Host as H, bootstrapLazy as b, createEvent as c,
|
|
1445
|
+
export { Host as H, getElement as a, bootstrapLazy as b, createEvent as c, globalScripts as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1446
|
+
//# sourceMappingURL=index-Yyeke16a.js.map
|
|
1379
1447
|
|
|
1380
|
-
//# sourceMappingURL=index-
|
|
1448
|
+
//# sourceMappingURL=index-Yyeke16a.js.map
|