@siemens/ix-icons 0.0.0-pr-69-20250130132918 → 0.0.0-pr-69-20250203134847
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +46 -17
- package/components/icon.js +0 -4
- package/components/icon.js.map +1 -1
- package/dist/cjs/{icon-2c9dc943.js → icon-88309350.js} +2 -6
- package/dist/cjs/icon-88309350.js.map +1 -0
- package/dist/cjs/{index-ea94711c.js → index-f6043fa9.js} +178 -70
- package/dist/cjs/index-f6043fa9.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/ix-icon.cjs.entry.js +2 -2
- package/dist/cjs/ix-icons.cjs.js +2 -2
- package/dist/cjs/ix-icons.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/icon/icon.js +8 -4
- package/dist/collection/components/icon/icon.js.map +1 -1
- package/dist/esm/{icon-e3f6595d.js → icon-4feff534.js} +2 -6
- package/dist/esm/icon-4feff534.js.map +1 -0
- package/dist/esm/{index-050dd9d6.js → index-051cb4f1.js} +178 -70
- package/dist/esm/index-051cb4f1.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/ix-icon.entry.js +2 -2
- package/dist/esm/ix-icons.js +3 -3
- package/dist/esm/ix-icons.js.map +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/ix-icons/index.esm.js +1 -1
- package/dist/ix-icons/ix-icons.esm.js +1 -1
- package/dist/ix-icons/ix-icons.esm.js.map +1 -1
- package/dist/ix-icons/p-08f117ce.entry.js +2 -0
- package/dist/ix-icons/p-48b5ebf2.js +3 -0
- package/dist/ix-icons/p-48b5ebf2.js.map +1 -0
- package/dist/ix-icons/{p-196f504a.js → p-588f84dc.js} +2 -2
- package/dist/ix-icons/p-588f84dc.js.map +1 -0
- package/dist/sample.json +1259 -0
- package/dist/types/stencil-public-runtime.d.ts +6 -0
- package/icons/package.json +1 -1
- package/package.json +2 -2
- package/dist/cjs/icon-2c9dc943.js.map +0 -1
- package/dist/cjs/index-ea94711c.js.map +0 -1
- package/dist/esm/icon-e3f6595d.js.map +0 -1
- package/dist/esm/index-050dd9d6.js.map +0 -1
- package/dist/ix-icons/p-0194ffaa.js +0 -3
- package/dist/ix-icons/p-0194ffaa.js.map +0 -1
- package/dist/ix-icons/p-196f504a.js.map +0 -1
- package/dist/ix-icons/p-45457b43.entry.js +0 -2
- /package/dist/ix-icons/{p-45457b43.entry.js.map → p-08f117ce.entry.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/icon/icon.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjE,MAAM,iBAAiB,GACrB,gdAAgd,CAAC;AAQnd,MAAM,OAAO,IAAI
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/icon/icon.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjE,MAAM,iBAAiB,GACrB,gdAAgd,CAAC;AAQnd,MAAM,OAAO,IAAI;IANjB;QAkCU,gBAAW,GAAG,KAAK,CAAC;QAGnB,cAAS,GAAG,KAAK,CAAC;KA+D5B;IA7DC,iBAAiB;QACf,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;YACzB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,e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AAI,CAAC,IAAI,KAAK,IAAI;gBAC/B,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI;gBAC/B,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI;aAChC;YAED,4DAAK,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,GAAQ,CAC1D,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Component, h, Host, Prop, State, Watch, Element, Build } from '@stencil/core';\nimport { parseSVGDataContent, resolveIcon } from './resolveIcon';\n\nconst iconMissingSymbol =\n \"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='512' height='512' viewBox='0 0 512 512'><path fill-rule='evenodd' d='M384,0 L384,384 L0,384 L0,0 L384,0 Z M192,207.085 L57.751,341.333 L326.248,341.333 L192,207.085 Z M42.666,57.751 L42.666,326.248 L176.915,192 L42.666,57.751 Z M341.333,57.751 L207.085,192 L341.333,326.248 L341.333,57.751 Z M326.248,42.666 L57.751,42.666 L192,176.915 L326.248,42.666 Z' transform='translate(64 64)'/></svg>\";\n\n@Component({\n tag: 'ix-icon',\n styleUrl: 'icon.scss',\n shadow: true,\n assetsDirs: ['svg'],\n})\nexport class Icon {\n @Element() hostElement: HTMLIxIconElement;\n\n /**\n * Size of the icon\n */\n @Prop() size: '12' | '16' | '24' | '32';\n\n /**\n * Color of the icon\n */\n @Prop() color: string;\n\n /**\n * Use one of our defined icon names e.g. `copy`\n *\n * https://ix.siemens.io/docs/icon-library/icons\n *\n * or the import variant\n *\n * ```\n * import { rocket } from '@siemens/ix-icons/icons';\n *\n * <ix-icon name={rocket}></ix-icon>\n * ```\n */\n @Prop() name: string;\n\n @Prop() lazyLoading = false;\n\n @State() svgContent?: string;\n @State() isVisible = false;\n\n componentWillLoad() {\n this.waitForRendering(() => {\n this.isVisible = true;\n this.loadIconContent();\n });\n }\n\n @Watch('name')\n async loadIconContent() {\n try {\n this.svgContent = await resolveIcon(this.name);\n } catch (error) {\n this.svgContent = parseSVGDataContent(iconMissingSymbol);\n }\n }\n\n private waitForRendering(onRender: () => void) {\n if (Build.isBrowser && this.lazyLoading && typeof window !== 'undefined' && (window as any).IntersectionObserver) {\n const observer = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n onRender();\n observer.disconnect();\n }\n });\n },\n {\n rootMargin: '25px',\n },\n );\n\n observer.observe(this.hostElement);\n } else {\n onRender();\n }\n }\n\n render() {\n const style: {\n [key: string]: string;\n } = {};\n\n if (this.color) {\n style['color'] = `var(--theme-${this.color})`;\n }\n\n return (\n <Host\n style={style}\n class={{\n ['size-12']: this.size === '12',\n ['size-16']: this.size === '16',\n ['size-24']: this.size === '24',\n ['size-32']: this.size === '32',\n }}\n >\n <div class={'svg-container'} innerHTML={this.svgContent}></div>\n </Host>\n );\n }\n}\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { g as getAssetPath, a as setAssetPath, r as registerInstance, h, H as Host, c as getElement } from './index-
|
1
|
+
import { g as getAssetPath, a as setAssetPath, r as registerInstance, h, H as Host, c as getElement } from './index-051cb4f1.js';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Provide custom SVG path for icons
|
@@ -164,11 +164,7 @@ const iconMissingSymbol = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org
|
|
164
164
|
const Icon = class {
|
165
165
|
constructor(hostRef) {
|
166
166
|
registerInstance(this, hostRef);
|
167
|
-
this.size = undefined;
|
168
|
-
this.color = undefined;
|
169
|
-
this.name = undefined;
|
170
167
|
this.lazyLoading = false;
|
171
|
-
this.svgContent = undefined;
|
172
168
|
this.isVisible = false;
|
173
169
|
}
|
174
170
|
componentWillLoad() {
|
@@ -225,4 +221,4 @@ Icon.style = IxIconStyle0;
|
|
225
221
|
|
226
222
|
export { Icon as I, addIcons as a, addIconToCache as b };
|
227
223
|
|
228
|
-
//# sourceMappingURL=icon-
|
224
|
+
//# sourceMappingURL=icon-4feff534.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"icon-4feff534.js","mappings":";;AAAA;;;;;SAKgB,iBAAiB;IAC/B,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC;IACvE,IAAI,SAAS,EAAE;QACb,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf;;ACbA;;;;;;;;AAiBA,IAAI,UAA+B,CAAC;AACpC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA2B,CAAC;AACpD,IAAI,MAAM,GAAG,IAAI,CAAC;AAEX,MAAM,eAAe,GAAG;IAC7B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,IAAI,GAAG,EAAE,CAAC;KAClB;IAED,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;QACtC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,IAAI,GAAG,EAAE,CAAC;KACnE;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEK,MAAM,YAAY,GAAG,CAAC,GAAW;IACtC,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,KAAK,CAAC;KACd;IAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,OAAO,KAAK,CAAC;KACd;IAED,OAAO,GAAG,CAAC,U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iBACF,CAAC,CAAC;aACJ,EACD;gBACE,UAAU,EAAE,MAAM;aACnB,CACF,CAAC;YAEF,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACpC;aAAM;YACL,QAAQ,EAAE,CAAC;SACZ;KACF;IAED,MAAM;QACJ,MAAM,KAAK,GAEP,EAAE,CAAC;QAEP,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,KAAK,CAAC,OAAO,CAAC,GAAG,eAAe,IAAI,CAAC,KAAK,GAAG,CAAC;SAC/C;QAED,QACE,EAAC,IAAI,qDACH,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE;gBACL,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI;gBAC/B,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI;gBAC/B,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI;gBAC/B,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI;aAChC,IAED,4DAAK,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,GAAQ,CAC1D,EACP;KACH;;;;;;;;;;;","names":[],"sources":["src/components/icon/meta-tag.ts","src/components/icon/resolveIcon.ts","src/components/icon/icon.scss?tag=ix-icon&encapsulation=shadow","src/components/icon/icon.tsx"],"sourcesContent":["/**\n * Provide custom SVG path for icons\n *\n * <meta name=\"ix-icons:path\" content=\"/build/svg\" />\n */\nexport function getCustomAssetUrl() {\n const assetPath = document.querySelector(\"meta[name='ix-icons:path']\");\n if (assetPath) {\n const path = assetPath.getAttribute('content');\n return path;\n }\n\n return false;\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { getAssetPath, setAssetPath } from '@stencil/core';\nimport { getCustomAssetUrl } from './meta-tag';\n\ndeclare global {\n interface Window {\n IxIcons: any;\n }\n}\n\nlet fetchCache: Map<string, string>;\nconst requests = new Map<string, Promise<string>>();\nlet parser = null;\n\nexport const getIconCacheMap = (): Map<string, string> => {\n if (typeof window === 'undefined') {\n return new Map();\n }\n\n if (!fetchCache) {\n window.IxIcons = window.IxIcons || {};\n fetchCache = window.IxIcons.map = window.IxIcons.map || new Map();\n }\n\n return fetchCache;\n};\n\nexport const isSvgDataUrl = (url: string) => {\n if (!url) {\n return false;\n }\n\n if (typeof url !== 'string') {\n return false;\n }\n\n return url.startsWith('data:image/svg+xml');\n};\n\nexport function parseSVGDataContent(content: string) {\n if (typeof window['DOMParser'] === 'undefined') {\n console.warn('DOMParser not supported by your browser.');\n return;\n }\n\n if (parser === null) {\n parser = new window['DOMParser']();\n }\n\n const svgDocument = parser.parseFromString(content, 'text/html');\n const svgElement = svgDocument.querySelector('svg') as HTMLElement;\n\n if (!svgElement) {\n throw Error('No valid svg data provided');\n }\n\n return svgElement.outerHTML;\n}\n\nasync function fetchSVG(url: string) {\n const cache = getIconCacheMap();\n\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n if (requests.has(url)) {\n return requests.get(url);\n }\n\n const fetching = fetch(url).then(async response => {\n const responseText = await response.text();\n\n if (!response.ok) {\n console.error(responseText);\n throw Error(responseText);\n }\n\n const svgContent = parseSVGDataContent(responseText);\n cache.set(url, svgContent);\n\n requests.delete(url);\n\n return svgContent;\n });\n\n requests.set(url, fetching);\n return fetching;\n}\n\nconst urlRegex = /^(?:(?:https?|ftp):\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:www\\.)?(?:\\S+\\.\\S+)(?:\\S*)$/i;\n\nfunction isValidUrl(url: string) {\n return urlRegex.test(url);\n}\n\nexport function getIconUrl(name: string) {\n const customAssetUrl = getCustomAssetUrl();\n\n if (customAssetUrl) {\n return `${customAssetUrl}/${name}.svg`;\n }\n\n let url: string = `svg/${name}.svg`;\n\n try {\n url = getAssetPath(url);\n } catch (error) {\n console.warn(error);\n setAssetPath(`${window.location.origin}/`);\n url = getAssetPath(url);\n }\n\n return url;\n}\n\nexport async function resolveIcon(iconName: string) {\n if (!iconName) {\n throw Error('No icon name provided');\n }\n\n if (isSvgDataUrl(iconName)) {\n return parseSVGDataContent(iconName);\n }\n\n return await loadIcon(iconName);\n}\n\nasync function loadIcon(iconName: string) {\n const cache = getIconCacheMap();\n\n if (cache.has(iconName)) {\n return cache.get(iconName);\n }\n\n if (isValidUrl(iconName)) {\n try {\n return fetchSVG(iconName);\n } catch (error) {\n throw error;\n }\n }\n\n try {\n return fetchSVG(getIconUrl(iconName));\n } catch (error) {\n throw Error(`Could not resolve ${iconName}`);\n }\n}\n\nfunction removePrefix(name: string, prefix: string) {\n if (name.startsWith(prefix)) {\n name = name.slice(prefix.length);\n return name.replace(/^(\\w)/, (_match, p1) => p1.toLowerCase());\n }\n\n return name;\n}\n\nexport function addIcons(icons: { [name: string]: any }) {\n Object.keys(icons).forEach(name => {\n const icon = icons[name];\n name = removePrefix(name, 'icon');\n\n addIconToCache(name, icon);\n });\n}\n\nexport function addIconToCache(name: string, icon: string) {\n const cache = getIconCacheMap();\n\n if (cache.has(name)) {\n console.warn(`Icon name '${name}' already in cache. Overwritting with new icon data.`);\n }\n\n const svg = parseSVGDataContent(icon);\n\n cache.set(name, svg);\n\n const toKebabCase = name.replace(/([a-z0-9]|(?=[A-Z]))([A-Z0-9])/g, '$1-$2').toLowerCase();\n\n if (name != toKebabCase) {\n cache.set(toKebabCase, svg);\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n@mixin size($size) {\n height: $size;\n width: $size;\n min-height: $size;\n min-width: $size;\n}\n\n:host {\n display: inline-flex;\n @include size(1.5rem);\n color: inherit;\n\n .svg-container {\n display: block;\n position: relative;\n width: 100%;\n height: 100%;\n\n svg {\n display: block;\n position: relative;\n height: 100%;\n width: 100%;\n }\n\n svg,\n svg[fill],\n svg [fill] {\n fill: currentColor !important;\n }\n }\n}\n\n:host(.size-12) {\n @include size(0.75rem);\n}\n\n:host(.size-16) {\n @include size(1rem);\n}\n\n:host(.size-32) {\n @include size(2rem);\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Component, h, Host, Prop, State, Watch, Element, Build } from '@stencil/core';\nimport { parseSVGDataContent, resolveIcon } from './resolveIcon';\n\nconst iconMissingSymbol =\n \"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='512' height='512' viewBox='0 0 512 512'><path fill-rule='evenodd' d='M384,0 L384,384 L0,384 L0,0 L384,0 Z M192,207.085 L57.751,341.333 L326.248,341.333 L192,207.085 Z M42.666,57.751 L42.666,326.248 L176.915,192 L42.666,57.751 Z M341.333,57.751 L207.085,192 L341.333,326.248 L341.333,57.751 Z M326.248,42.666 L57.751,42.666 L192,176.915 L326.248,42.666 Z' transform='translate(64 64)'/></svg>\";\n\n@Component({\n tag: 'ix-icon',\n styleUrl: 'icon.scss',\n shadow: true,\n assetsDirs: ['svg'],\n})\nexport class Icon {\n @Element() hostElement: HTMLIxIconElement;\n\n /**\n * Size of the icon\n */\n @Prop() size: '12' | '16' | '24' | '32';\n\n /**\n * Color of the icon\n */\n @Prop() color: string;\n\n /**\n * Use one of our defined icon names e.g. `copy`\n *\n * https://ix.siemens.io/docs/icon-library/icons\n *\n * or the import variant\n *\n * ```\n * import { rocket } from '@siemens/ix-icons/icons';\n *\n * <ix-icon name={rocket}></ix-icon>\n * ```\n */\n @Prop() name: string;\n\n @Prop() lazyLoading = false;\n\n @State() svgContent?: string;\n @State() isVisible = false;\n\n componentWillLoad() {\n this.waitForRendering(() => {\n this.isVisible = true;\n this.loadIconContent();\n });\n }\n\n @Watch('name')\n async loadIconContent() {\n try {\n this.svgContent = await resolveIcon(this.name);\n } catch (error) {\n this.svgContent = parseSVGDataContent(iconMissingSymbol);\n }\n }\n\n private waitForRendering(onRender: () => void) {\n if (Build.isBrowser && this.lazyLoading && typeof window !== 'undefined' && (window as any).IntersectionObserver) {\n const observer = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n onRender();\n observer.disconnect();\n }\n });\n },\n {\n rootMargin: '25px',\n },\n );\n\n observer.observe(this.hostElement);\n } else {\n onRender();\n }\n }\n\n render() {\n const style: {\n [key: string]: string;\n } = {};\n\n if (this.color) {\n style['color'] = `var(--theme-${this.color})`;\n }\n\n return (\n <Host\n style={style}\n class={{\n ['size-12']: this.size === '12',\n ['size-16']: this.size === '16',\n ['size-24']: this.size === '24',\n ['size-32']: this.size === '32',\n }}\n >\n <div class={'svg-container'} innerHTML={this.svgContent}></div>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1,17 +1,25 @@
|
|
1
1
|
const NAMESPACE = 'ix-icons';
|
2
|
-
const BUILD = /* ix-icons */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: false, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: true, vdomText: false, vdomXlink: false, watchCallback: true };
|
2
|
+
const BUILD = /* ix-icons */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: false, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: true, vdomText: false, vdomXlink: false, watchCallback: true };
|
3
3
|
|
4
4
|
/*
|
5
|
-
Stencil Client Platform v4.
|
5
|
+
Stencil Client Platform v4.25.1 | MIT Licensed | https://stenciljs.com
|
6
6
|
*/
|
7
7
|
var __defProp = Object.defineProperty;
|
8
8
|
var __export = (target, all) => {
|
9
9
|
for (var name in all)
|
10
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
11
11
|
};
|
12
|
+
|
13
|
+
// src/utils/constants.ts
|
14
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
15
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
16
|
+
|
17
|
+
// src/client/client-host-ref.ts
|
12
18
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
13
19
|
var getHostRef = (ref) => hostRefs.get(ref);
|
14
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
20
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
21
|
+
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
22
|
+
};
|
15
23
|
var registerHost = (hostElement, cmpMeta) => {
|
16
24
|
const hostRef = {
|
17
25
|
$flags$: 0,
|
@@ -24,7 +32,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
24
32
|
hostElement["s-p"] = [];
|
25
33
|
hostElement["s-rc"] = [];
|
26
34
|
}
|
27
|
-
|
35
|
+
const ref = hostRefs.set(hostElement, hostRef);
|
36
|
+
return ref;
|
28
37
|
};
|
29
38
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
30
39
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
@@ -61,16 +70,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
61
70
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
62
71
|
/* webpackMode: "lazy" */
|
63
72
|
`./${bundleId}.entry.js${""}`
|
64
|
-
).then(
|
65
|
-
{
|
66
|
-
|
73
|
+
).then(
|
74
|
+
(importedModule) => {
|
75
|
+
{
|
76
|
+
cmpModules.set(bundleId, importedModule);
|
77
|
+
}
|
78
|
+
return importedModule[exportName];
|
79
|
+
},
|
80
|
+
(e) => {
|
81
|
+
consoleError(e, hostRef.$hostElement$);
|
67
82
|
}
|
68
|
-
|
69
|
-
}, consoleError);
|
83
|
+
);
|
70
84
|
};
|
71
85
|
|
72
86
|
// src/client/client-style.ts
|
73
87
|
var styles = /* @__PURE__ */ new Map();
|
88
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
74
89
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
75
90
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
76
91
|
var win = typeof window !== "undefined" ? window : {};
|
@@ -135,14 +150,6 @@ var getAssetPath = (path) => {
|
|
135
150
|
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
136
151
|
};
|
137
152
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
138
|
-
|
139
|
-
// src/utils/constants.ts
|
140
|
-
var EMPTY_OBJ = {};
|
141
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
142
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
143
|
-
|
144
|
-
// src/utils/helpers.ts
|
145
|
-
var isDef = (v) => v != null;
|
146
153
|
var isComplexType = (o) => {
|
147
154
|
o = typeof o;
|
148
155
|
return o === "object" || o === "function";
|
@@ -328,7 +335,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
328
335
|
}
|
329
336
|
if (!appliedStyles.has(scopeId2)) {
|
330
337
|
{
|
331
|
-
styleElm = doc.createElement("style");
|
338
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
332
339
|
styleElm.innerHTML = style;
|
333
340
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
334
341
|
if (nonce != null) {
|
@@ -337,10 +344,24 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
337
344
|
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
338
345
|
if (styleContainerNode.nodeName === "HEAD") {
|
339
346
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
340
|
-
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling :
|
341
|
-
styleContainerNode.insertBefore(
|
347
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
348
|
+
styleContainerNode.insertBefore(
|
349
|
+
styleElm,
|
350
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
351
|
+
);
|
342
352
|
} else if ("host" in styleContainerNode) {
|
343
|
-
|
353
|
+
if (supportsConstructableStylesheets) {
|
354
|
+
const stylesheet = new CSSStyleSheet();
|
355
|
+
stylesheet.replaceSync(style);
|
356
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
357
|
+
} else {
|
358
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
359
|
+
if (existingStyleContainer) {
|
360
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
361
|
+
} else {
|
362
|
+
styleContainerNode.prepend(styleElm);
|
363
|
+
}
|
364
|
+
}
|
344
365
|
} else {
|
345
366
|
styleContainerNode.append(styleElm);
|
346
367
|
}
|
@@ -377,16 +398,18 @@ var attachStyles = (hostRef) => {
|
|
377
398
|
endAttachStyles();
|
378
399
|
};
|
379
400
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
380
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
401
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
381
402
|
if (oldValue !== newValue) {
|
382
403
|
let isProp = isMemberInElement(elm, memberName);
|
383
404
|
memberName.toLowerCase();
|
384
405
|
if (memberName === "class") {
|
385
406
|
const classList = elm.classList;
|
386
407
|
const oldClasses = parseClassList(oldValue);
|
387
|
-
|
388
|
-
|
389
|
-
|
408
|
+
let newClasses = parseClassList(newValue);
|
409
|
+
{
|
410
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
411
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
412
|
+
}
|
390
413
|
} else if (memberName === "style") {
|
391
414
|
{
|
392
415
|
for (const prop in oldValue) {
|
@@ -423,7 +446,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
423
446
|
elm.setAttribute(memberName, n);
|
424
447
|
}
|
425
448
|
}
|
426
|
-
} else {
|
449
|
+
} else if (elm[memberName] !== newValue) {
|
427
450
|
elm[memberName] = newValue;
|
428
451
|
}
|
429
452
|
} catch (e) {
|
@@ -445,22 +468,42 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
445
468
|
}
|
446
469
|
};
|
447
470
|
var parseClassListRegex = /\s/;
|
448
|
-
var parseClassList = (value) =>
|
471
|
+
var parseClassList = (value) => {
|
472
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
473
|
+
value = value.baseVal;
|
474
|
+
}
|
475
|
+
if (!value || typeof value !== "string") {
|
476
|
+
return [];
|
477
|
+
}
|
478
|
+
return value.split(parseClassListRegex);
|
479
|
+
};
|
449
480
|
|
450
481
|
// src/runtime/vdom/update-element.ts
|
451
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
482
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
452
483
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
453
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
454
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
484
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
485
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
455
486
|
{
|
456
487
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
457
488
|
if (!(memberName in newVnodeAttrs)) {
|
458
|
-
setAccessor(
|
489
|
+
setAccessor(
|
490
|
+
elm,
|
491
|
+
memberName,
|
492
|
+
oldVnodeAttrs[memberName],
|
493
|
+
void 0,
|
494
|
+
isSvgMode2,
|
495
|
+
newVnode.$flags$);
|
459
496
|
}
|
460
497
|
}
|
461
498
|
}
|
462
499
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
463
|
-
setAccessor(
|
500
|
+
setAccessor(
|
501
|
+
elm,
|
502
|
+
memberName,
|
503
|
+
oldVnodeAttrs[memberName],
|
504
|
+
newVnodeAttrs[memberName],
|
505
|
+
isSvgMode2,
|
506
|
+
newVnode.$flags$);
|
464
507
|
}
|
465
508
|
};
|
466
509
|
function sortedAttrNames(attrNames) {
|
@@ -472,13 +515,10 @@ function sortedAttrNames(attrNames) {
|
|
472
515
|
attrNames
|
473
516
|
);
|
474
517
|
}
|
475
|
-
|
476
|
-
// src/runtime/vdom/vdom-render.ts
|
477
|
-
var scopeId;
|
478
518
|
var hostTagName;
|
479
519
|
var useNativeShadowDom = false;
|
480
520
|
var isSvgMode = false;
|
481
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
521
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
482
522
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
483
523
|
let i2 = 0;
|
484
524
|
let elm;
|
@@ -497,11 +537,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
497
537
|
{
|
498
538
|
updateElement(null, newVNode2, isSvgMode);
|
499
539
|
}
|
500
|
-
const rootNode = elm.getRootNode();
|
501
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
502
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
503
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
504
|
-
}
|
505
540
|
if (newVNode2.$children$) {
|
506
541
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
507
542
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
@@ -637,6 +672,9 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
637
672
|
if (!isInitialRender) {
|
638
673
|
return leftVNode.$key$ === rightVNode.$key$;
|
639
674
|
}
|
675
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
676
|
+
leftVNode.$key$ = rightVNode.$key$;
|
677
|
+
}
|
640
678
|
return true;
|
641
679
|
}
|
642
680
|
return false;
|
@@ -671,8 +709,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
671
709
|
}
|
672
710
|
};
|
673
711
|
var insertBefore = (parent, newNode, reference) => {
|
674
|
-
|
675
|
-
|
712
|
+
{
|
713
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
714
|
+
}
|
676
715
|
};
|
677
716
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
678
717
|
const hostElm = hostRef.$hostElement$;
|
@@ -691,9 +730,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
691
730
|
rootVnode.$flags$ |= 4 /* isHost */;
|
692
731
|
hostRef.$vnode$ = rootVnode;
|
693
732
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
694
|
-
{
|
695
|
-
scopeId = hostElm["s-sc"];
|
696
|
-
}
|
697
733
|
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
698
734
|
patch(oldVNode, rootVnode, isInitialLoad);
|
699
735
|
};
|
@@ -701,7 +737,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
701
737
|
// src/runtime/update-component.ts
|
702
738
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
703
739
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
704
|
-
ancestorComponent["s-p"].push(
|
740
|
+
const index = ancestorComponent["s-p"].push(
|
741
|
+
new Promise(
|
742
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
743
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
744
|
+
r();
|
745
|
+
}
|
746
|
+
)
|
747
|
+
);
|
705
748
|
}
|
706
749
|
};
|
707
750
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
@@ -728,7 +771,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
728
771
|
let maybePromise;
|
729
772
|
if (isInitialLoad) {
|
730
773
|
{
|
731
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
774
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
732
775
|
}
|
733
776
|
}
|
734
777
|
endSchedule();
|
@@ -827,12 +870,12 @@ var appDidLoad = (who) => {
|
|
827
870
|
}
|
828
871
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
829
872
|
};
|
830
|
-
var safeCall = (instance, method, arg) => {
|
873
|
+
var safeCall = (instance, method, arg, elm) => {
|
831
874
|
if (instance && instance[method]) {
|
832
875
|
try {
|
833
876
|
return instance[method](arg);
|
834
877
|
} catch (e) {
|
835
|
-
consoleError(e);
|
878
|
+
consoleError(e, elm);
|
836
879
|
}
|
837
880
|
}
|
838
881
|
return void 0;
|
@@ -891,15 +934,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
891
934
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
892
935
|
members.map(([memberName, [memberFlags]]) => {
|
893
936
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
937
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
938
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
939
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
940
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
941
|
+
Object.defineProperty(prototype, memberName, {
|
942
|
+
get() {
|
943
|
+
{
|
944
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
945
|
+
return getValue(this, memberName);
|
946
|
+
}
|
947
|
+
const ref = getHostRef(this);
|
948
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
949
|
+
if (!instance) return;
|
950
|
+
return instance[memberName];
|
951
|
+
}
|
952
|
+
},
|
953
|
+
configurable: true,
|
954
|
+
enumerable: true
|
955
|
+
});
|
956
|
+
}
|
894
957
|
Object.defineProperty(prototype, memberName, {
|
895
|
-
get() {
|
896
|
-
return getValue(this, memberName);
|
897
|
-
},
|
898
958
|
set(newValue) {
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
959
|
+
const ref = getHostRef(this);
|
960
|
+
if (origSetter) {
|
961
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
962
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
963
|
+
newValue = ref.$instanceValues$.get(memberName);
|
964
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
965
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
966
|
+
}
|
967
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
968
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
969
|
+
setValue(this, memberName, newValue, cmpMeta);
|
970
|
+
return;
|
971
|
+
}
|
972
|
+
{
|
973
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
974
|
+
setValue(this, memberName, newValue, cmpMeta);
|
975
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
976
|
+
ref.$onReadyPromise$.then(() => {
|
977
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
978
|
+
ref.$lazyInstance$[memberName] = newValue;
|
979
|
+
}
|
980
|
+
});
|
981
|
+
}
|
982
|
+
return;
|
983
|
+
}
|
984
|
+
const setterSetVal = () => {
|
985
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
986
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
987
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
988
|
+
}
|
989
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
990
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
991
|
+
};
|
992
|
+
if (ref.$lazyInstance$) {
|
993
|
+
setterSetVal();
|
994
|
+
} else {
|
995
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
996
|
+
}
|
997
|
+
}
|
998
|
+
}
|
903
999
|
});
|
904
1000
|
}
|
905
1001
|
});
|
@@ -909,7 +1005,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
909
1005
|
plt.jmp(() => {
|
910
1006
|
var _a2;
|
911
1007
|
const propName = attrNameToPropName.get(attrName);
|
912
|
-
if (this.hasOwnProperty(propName)) {
|
1008
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
913
1009
|
newValue = this[propName];
|
914
1010
|
delete this[propName];
|
915
1011
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
@@ -929,7 +1025,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
929
1025
|
}
|
930
1026
|
return;
|
931
1027
|
}
|
932
|
-
|
1028
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
1029
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
1030
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
1031
|
+
this[propName] = newValue;
|
1032
|
+
}
|
933
1033
|
});
|
934
1034
|
};
|
935
1035
|
Cstr.observedAttributes = Array.from(
|
@@ -952,9 +1052,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
952
1052
|
let Cstr;
|
953
1053
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
954
1054
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
955
|
-
|
956
|
-
|
957
|
-
const CstrImport = loadModule(cmpMeta);
|
1055
|
+
{
|
1056
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
958
1057
|
if (CstrImport && "then" in CstrImport) {
|
959
1058
|
const endLoad = uniqueTime();
|
960
1059
|
Cstr = await CstrImport;
|
@@ -979,7 +1078,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
979
1078
|
try {
|
980
1079
|
new Cstr(hostRef);
|
981
1080
|
} catch (e) {
|
982
|
-
consoleError(e);
|
1081
|
+
consoleError(e, elm);
|
983
1082
|
}
|
984
1083
|
{
|
985
1084
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
@@ -988,10 +1087,6 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
988
1087
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
989
1088
|
}
|
990
1089
|
endNewInstance();
|
991
|
-
} else {
|
992
|
-
Cstr = elm.constructor;
|
993
|
-
const cmpTag = elm.localName;
|
994
|
-
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
995
1090
|
}
|
996
1091
|
if (Cstr && Cstr.style) {
|
997
1092
|
let style;
|
@@ -1014,7 +1109,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1014
1109
|
schedule();
|
1015
1110
|
}
|
1016
1111
|
};
|
1017
|
-
var fireConnectedCallback = (instance) => {
|
1112
|
+
var fireConnectedCallback = (instance, elm) => {
|
1018
1113
|
};
|
1019
1114
|
|
1020
1115
|
// src/runtime/connected-callback.ts
|
@@ -1054,7 +1149,7 @@ var connectedCallback = (elm) => {
|
|
1054
1149
|
endConnected();
|
1055
1150
|
}
|
1056
1151
|
};
|
1057
|
-
var disconnectInstance = (instance) => {
|
1152
|
+
var disconnectInstance = (instance, elm) => {
|
1058
1153
|
};
|
1059
1154
|
var disconnectedCallback = async (elm) => {
|
1060
1155
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
@@ -1063,6 +1158,12 @@ var disconnectedCallback = async (elm) => {
|
|
1063
1158
|
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
1064
1159
|
}
|
1065
1160
|
}
|
1161
|
+
if (rootAppliedStyles.has(elm)) {
|
1162
|
+
rootAppliedStyles.delete(elm);
|
1163
|
+
}
|
1164
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
1165
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
1166
|
+
}
|
1066
1167
|
};
|
1067
1168
|
|
1068
1169
|
// src/runtime/bootstrap-lazy.ts
|
@@ -1140,6 +1241,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1140
1241
|
}
|
1141
1242
|
disconnectedCallback() {
|
1142
1243
|
plt.jmp(() => disconnectedCallback(this));
|
1244
|
+
plt.raf(() => {
|
1245
|
+
var _a3;
|
1246
|
+
const hostRef = getHostRef(this);
|
1247
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
1248
|
+
delete hostRef.$vnode$.$elm$;
|
1249
|
+
}
|
1250
|
+
});
|
1143
1251
|
}
|
1144
1252
|
componentOnReady() {
|
1145
1253
|
return getHostRef(this).$onReadyPromise$;
|
@@ -1187,4 +1295,4 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1187
1295
|
|
1188
1296
|
export { Host as H, setAssetPath as a, bootstrapLazy as b, getElement as c, getAssetPath as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
1189
1297
|
|
1190
|
-
//# sourceMappingURL=index-
|
1298
|
+
//# sourceMappingURL=index-051cb4f1.js.map
|