@siemens/ix-icons 3.2.0 → 3.3.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/components/index.js +92 -25
- package/components/index.js.map +1 -1
- package/dist/cjs/{index-DUsbo4-K.js → index-HU55KNQP.js} +78 -18
- package/dist/cjs/index-HU55KNQP.js.map +1 -0
- package/dist/cjs/index.cjs.js +31 -12
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/ix-icon.cjs.entry.js +1 -1
- package/dist/cjs/ix-icons.cjs.js +3 -3
- package/dist/cjs/ix-icons.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/icon/icon.js +35 -17
- package/dist/collection/components/icon/icon.js.map +1 -1
- package/dist/collection/components/icon/parser.js +1 -1
- package/dist/collection/components/icon/parser.js.map +1 -1
- package/dist/esm/{index-BiqddxKp.js → index-CyicTMfq.js} +78 -18
- package/dist/esm/index-CyicTMfq.js.map +1 -0
- package/dist/esm/index.js +32 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/ix-icon.entry.js +1 -1
- package/dist/esm/ix-icons.js +4 -4
- package/dist/esm/ix-icons.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/ix-icons/index.esm.js +1 -1
- package/dist/ix-icons/index.esm.js.map +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-9fcb498f.entry.js +2 -0
- package/dist/ix-icons/p-CyicTMfq.js +3 -0
- package/dist/ix-icons/p-CyicTMfq.js.map +1 -0
- package/dist/ix-icons/svg/command-line-filled.svg +1 -0
- package/dist/ix-icons/svg/command-line.svg +1 -0
- package/dist/ix-icons/svg/monitor-filled.svg +1 -1
- package/dist/ix-icons/svg/monitor.svg +1 -1
- package/dist/ix-icons/svg/operating-system-add.svg +1 -0
- package/dist/ix-icons/svg/operating-system-settings.svg +1 -0
- package/dist/ix-icons/svg/palette-filled.svg +1 -0
- package/dist/ix-icons/svg/palette.svg +1 -0
- package/dist/ix-icons/svg/screen-duplicate-filled.svg +1 -1
- package/dist/ix-icons/svg/screen-duplicate.svg +1 -1
- package/dist/ix-icons/svg/screen-filled.svg +1 -1
- package/dist/ix-icons/svg/screen-settings-filled.svg +1 -1
- package/dist/ix-icons/svg/screen-settings.svg +1 -1
- package/dist/ix-icons/svg/screen.svg +1 -1
- package/dist/ix-icons/svg/screens-filled.svg +1 -1
- package/dist/ix-icons/svg/theme-filled.svg +1 -0
- package/dist/ix-icons/svg/theme.svg +1 -0
- package/dist/sample.json +8 -0
- package/dist/types/stencil-public-runtime.d.ts +35 -11
- package/icons/index.d.ts +8 -0
- package/icons/index.js +17 -9
- package/icons/index.mjs +17 -9
- package/icons/package.json +1 -1
- package/package.json +4 -4
- package/svg/command-line-filled.svg +1 -0
- package/svg/command-line.svg +1 -0
- package/svg/monitor-filled.svg +1 -1
- package/svg/monitor.svg +1 -1
- package/svg/operating-system-add.svg +1 -0
- package/svg/operating-system-settings.svg +1 -0
- package/svg/palette-filled.svg +1 -0
- package/svg/palette.svg +1 -0
- package/svg/screen-duplicate-filled.svg +1 -1
- package/svg/screen-duplicate.svg +1 -1
- package/svg/screen-filled.svg +1 -1
- package/svg/screen-settings-filled.svg +1 -1
- package/svg/screen-settings.svg +1 -1
- package/svg/screen.svg +1 -1
- package/svg/screens-filled.svg +1 -1
- package/svg/theme-filled.svg +1 -0
- package/svg/theme.svg +1 -0
- package/dist/cjs/index-DUsbo4-K.js.map +0 -1
- package/dist/esm/index-BiqddxKp.js.map +0 -1
- package/dist/ix-icons/p-6b0af2cb.entry.js +0 -2
- package/dist/ix-icons/p-BiqddxKp.js +0 -3
- package/dist/ix-icons/p-BiqddxKp.js.map +0 -1
- /package/dist/ix-icons/{p-6b0af2cb.entry.js.map → p-9fcb498f.entry.js.map} +0 -0
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-HU55KNQP.js');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Provide custom SVG path for icons
|
|
@@ -33,7 +33,7 @@ function parseSVGDataContent(content, element) {
|
|
|
33
33
|
try {
|
|
34
34
|
content = decodeURI(content);
|
|
35
35
|
}
|
|
36
|
-
catch
|
|
36
|
+
catch {
|
|
37
37
|
// Content is not a valid URI component, which can happen if it's already decoded. Proceed with the original content.
|
|
38
38
|
}
|
|
39
39
|
const svgDocument = parser.parseFromString(content, 'text/html');
|
|
@@ -188,16 +188,36 @@ const iconCss = ":host{display:inline-flex;height:1.5rem;width:1.5rem;min-height
|
|
|
188
188
|
const Icon = class {
|
|
189
189
|
constructor(hostRef) {
|
|
190
190
|
index.registerInstance(this, hostRef);
|
|
191
|
-
/**
|
|
192
|
-
* Size of the icon
|
|
193
|
-
*/
|
|
194
|
-
this.size = '24';
|
|
195
|
-
/**
|
|
196
|
-
* Only fetch and parse svg data when icon is visible
|
|
197
|
-
*/
|
|
198
|
-
this.lazyLoading = false;
|
|
199
|
-
this.isVisible = false;
|
|
200
191
|
}
|
|
192
|
+
get hostElement() { return index.getElement(this); }
|
|
193
|
+
/**
|
|
194
|
+
* Size of the icon
|
|
195
|
+
*/
|
|
196
|
+
size = '24';
|
|
197
|
+
/**
|
|
198
|
+
* Color of the icon
|
|
199
|
+
*/
|
|
200
|
+
color;
|
|
201
|
+
/**
|
|
202
|
+
* Use one of our defined icon names e.g. `copy`
|
|
203
|
+
*
|
|
204
|
+
* https://ix.siemens.io/docs/icon-library/icons
|
|
205
|
+
*
|
|
206
|
+
* or the import variant
|
|
207
|
+
*
|
|
208
|
+
* ```
|
|
209
|
+
* import { rocket } from '@siemens/ix-icons/icons';
|
|
210
|
+
*
|
|
211
|
+
* <ix-icon name={rocket}></ix-icon>
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
name;
|
|
215
|
+
/**
|
|
216
|
+
* Only fetch and parse svg data when icon is visible
|
|
217
|
+
*/
|
|
218
|
+
lazyLoading = false;
|
|
219
|
+
svgContent;
|
|
220
|
+
isVisible = false;
|
|
201
221
|
componentWillLoad() {
|
|
202
222
|
this.waitForRendering(() => {
|
|
203
223
|
this.isVisible = true;
|
|
@@ -243,7 +263,6 @@ const Icon = class {
|
|
|
243
263
|
} }, index.h("div", { key: '570efdb71fcdd0c61b7c854c6ab3662508aae804', class: 'svg-container', innerHTML: this.svgContent, "aria-hidden": "true" })));
|
|
244
264
|
}
|
|
245
265
|
static get assetsDirs() { return ["svg"]; }
|
|
246
|
-
get hostElement() { return index.getElement(this); }
|
|
247
266
|
static get watchers() { return {
|
|
248
267
|
"name": ["loadIconContent"]
|
|
249
268
|
}; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["src/components/icon/meta-tag.ts","src/components/icon/parser.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 * COPYRIGHT (c) Siemens AG 2018-2025 ALL RIGHTS RESERVED.\n */\n\nlet parser: any = null;\n\nexport const errorSymbol =\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\nexport function parseSVGDataContent(content: string, element?: HTMLElement): string {\n if (typeof window['DOMParser'] === 'undefined') {\n console.error('DOMParser not supported by your browser.');\n return '';\n }\n\n if (parser === null) {\n parser = new window['DOMParser']();\n }\n\n // decode URI component if needed\n try {\n content = decodeURI(content);\n } catch {\n // Content is not a valid URI component, which can happen if it's already decoded. Proceed with the original content.\n }\n\n const svgDocument = parser.parseFromString(content, 'text/html');\n const svgElement = svgDocument.querySelector('svg') as HTMLElement;\n\n if (!svgElement) {\n if (element) {\n console.error('No valid svg data provided', element);\n } else {\n console.error('No valid svg data provided');\n }\n return '';\n }\n\n return svgElement.outerHTML;\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 } from '@stencil/core';\nimport { getCustomAssetUrl } from './meta-tag';\nimport { parseSVGDataContent } from './parser';\n\ndeclare global {\n interface Window {\n IxIcons: any;\n }\n}\n\nlet fetchCache: Map<string, string>;\nconst requests = new Map<string, Promise<string>>();\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\nasync function fetchSVG(url: string, element: HTMLIxIconElement) {\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)\n .then(async response => {\n const responseText = await response.text();\n\n let svgContent = '';\n if (response.ok) {\n svgContent = parseSVGDataContent(responseText, element);\n cache.set(url, svgContent);\n } else {\n console.error('Failed to request svg data from', url, 'with status code', response.status, element);\n }\n\n return svgContent;\n })\n .catch(() => {\n console.error('Failed to fetch svg data:', url, element);\n cache.set(url, '');\n return '';\n })\n .finally(() => {\n requests.delete(url);\n });\n\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, element: HTMLIxIconElement) {\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(`Could not load icon with name \"${name}\". Ensure that the icon is registered using addIcons or that the icon SVG data is passed directly to property.`, element);\n }\n\n return url;\n}\n\nexport async function resolveIcon(element: HTMLIxIconElement, iconName?: string): Promise<string> {\n if (!iconName) {\n console.warn('No icon was provided', element);\n return '';\n }\n\n if (isSvgDataUrl(iconName)) {\n const content = parseSVGDataContent(iconName, element);\n\n if (!content) {\n console.error('Failed to parse icon data', element);\n }\n return content;\n }\n\n return loadIcon(iconName, element);\n}\n\nasync function loadIcon(iconName: string, element: HTMLIxIconElement): Promise<string> {\n const cache = getIconCacheMap();\n\n if (cache.has(iconName)) {\n return cache.get(iconName)!;\n }\n\n if (isValidUrl(iconName)) {\n return fetchSVG(iconName, element);\n }\n\n const iconUrl = getIconUrl(iconName, element);\n\n if (!iconUrl) {\n return '';\n }\n\n return fetchSVG(iconUrl, element);\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 { resolveIcon } from './resolveIcon';\nimport { errorSymbol, parseSVGDataContent } from './parser';\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' = '24';\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 /**\n * Only fetch and parse svg data when icon is visible\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 const content = await resolveIcon(this.hostElement, this.name);\n\n if (!content) {\n this.svgContent = parseSVGDataContent(errorSymbol);\n return;\n }\n\n this.svgContent = content;\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 role=\"img\"\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} aria-hidden=\"true\"></div>\n </Host>\n );\n }\n}\n"],"names":["getAssetPath","h","Host"],"mappings":";;;;AAAA;;;;AAIG;SACa,iBAAiB,GAAA;IAC/B,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,4BAA4B,CAAC;IACtE,IAAI,SAAS,EAAE;QACb,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,SAAS,CAAC;AAC9C,QAAA,OAAO,IAAI;;AAGb,IAAA,OAAO,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;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["src/components/icon/meta-tag.ts","src/components/icon/parser.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 * COPYRIGHT (c) Siemens AG 2018-2025 ALL RIGHTS RESERVED.\n */\n\nlet parser: any = null;\n\nexport const errorSymbol =\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\nexport function parseSVGDataContent(content: string, element?: HTMLElement): string {\n if (typeof window['DOMParser'] === 'undefined') {\n console.error('DOMParser not supported by your browser.');\n return '';\n }\n\n if (parser === null) {\n parser = new window['DOMParser']();\n }\n\n // decode URI component if needed\n try {\n content = decodeURI(content);\n } catch {\n // Content is not a valid URI component, which can happen if it's already decoded. Proceed with the original content.\n }\n\n const svgDocument = parser.parseFromString(content, 'text/html');\n const svgElement = svgDocument.querySelector('svg') as HTMLElement;\n\n if (!svgElement) {\n if (element) {\n console.error('No valid svg data provided', element);\n } else {\n console.error('No valid svg data provided');\n }\n return '';\n }\n\n return svgElement.outerHTML;\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 } from '@stencil/core';\nimport { getCustomAssetUrl } from './meta-tag';\nimport { parseSVGDataContent } from './parser';\n\ndeclare global {\n interface Window {\n IxIcons: any;\n }\n}\n\nlet fetchCache: Map<string, string>;\nconst requests = new Map<string, Promise<string>>();\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\nasync function fetchSVG(url: string, element: HTMLIxIconElement) {\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)\n .then(async response => {\n const responseText = await response.text();\n\n let svgContent = '';\n if (response.ok) {\n svgContent = parseSVGDataContent(responseText, element);\n cache.set(url, svgContent);\n } else {\n console.error('Failed to request svg data from', url, 'with status code', response.status, element);\n }\n\n return svgContent;\n })\n .catch(() => {\n console.error('Failed to fetch svg data:', url, element);\n cache.set(url, '');\n return '';\n })\n .finally(() => {\n requests.delete(url);\n });\n\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, element: HTMLIxIconElement) {\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(`Could not load icon with name \"${name}\". Ensure that the icon is registered using addIcons or that the icon SVG data is passed directly to property.`, element);\n }\n\n return url;\n}\n\nexport async function resolveIcon(element: HTMLIxIconElement, iconName?: string): Promise<string> {\n if (!iconName) {\n console.warn('No icon was provided', element);\n return '';\n }\n\n if (isSvgDataUrl(iconName)) {\n const content = parseSVGDataContent(iconName, element);\n\n if (!content) {\n console.error('Failed to parse icon data', element);\n }\n return content;\n }\n\n return loadIcon(iconName, element);\n}\n\nasync function loadIcon(iconName: string, element: HTMLIxIconElement): Promise<string> {\n const cache = getIconCacheMap();\n\n if (cache.has(iconName)) {\n return cache.get(iconName)!;\n }\n\n if (isValidUrl(iconName)) {\n return fetchSVG(iconName, element);\n }\n\n const iconUrl = getIconUrl(iconName, element);\n\n if (!iconUrl) {\n return '';\n }\n\n return fetchSVG(iconUrl, element);\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 { resolveIcon } from './resolveIcon';\nimport { errorSymbol, parseSVGDataContent } from './parser';\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' = '24';\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 /**\n * Only fetch and parse svg data when icon is visible\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 const content = await resolveIcon(this.hostElement, this.name);\n\n if (!content) {\n this.svgContent = parseSVGDataContent(errorSymbol);\n return;\n }\n\n this.svgContent = content;\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 role=\"img\"\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} aria-hidden=\"true\"></div>\n </Host>\n );\n }\n}\n"],"names":["getAssetPath","h","Host"],"mappings":";;;;AAAA;;;;AAIG;SACa,iBAAiB,GAAA;IAC/B,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,4BAA4B,CAAC;IACtE,IAAI,SAAS,EAAE;QACb,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,SAAS,CAAC;AAC9C,QAAA,OAAO,IAAI;;AAGb,IAAA,OAAO,KAAK;AACd;;ACbA;;AAEG;AAEH,IAAI,MAAM,GAAQ,IAAI;AAEf,MAAM,WAAW,GACtB,gdAAgd;AAElc,SAAA,mBAAmB,CAAC,OAAe,EAAE,OAAqB,EAAA;IACxE,IAAI,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,WAAW,EAAE;AAC9C,QAAA,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC;AACzD,QAAA,OAAO,EAAE;;AAGX,IAAA,IAAI,MAAM,KAAK,IAAI,EAAE;AACnB,QAAA,MAAM,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC,EAAE;;;AAIpC,IAAA,IAAI;AACF,QAAA,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;;AAC5B,IAAA,MAAM;;;IAIR,MAAM,WAAW,GAAG,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC;IACh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IAAI,IAAI,CAAC,KAAK,EAAE;YACd,KAAK,CAAC,OAAO,CAAC,GAAG,eAAe,IAAI,CAAC,KAAK,CAAA,CAAA,CAAG;;AAG/C,QAAA,QACEC,OAAA,CAACC,UAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EACH,IAAI,EAAC,KAAK,EACV,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE;AACL,gBAAA,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI;AAC/B,gBAAA,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI;AAC/B,gBAAA,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI;AAC/B,gBAAA,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI;aAChC,EAAA,EAEDD,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,EAAc,aAAA,EAAA,MAAM,EAAO,CAAA,CAC7E;;;;;;;;;;;;;;"}
|
package/dist/cjs/ix-icons.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-HU55KNQP.js');
|
|
4
4
|
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
5
|
|
|
6
6
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser v4.
|
|
8
|
+
Stencil Client Patch Browser v4.38.3 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
var patchBrowser = () => {
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["ix-icon.cjs",[[
|
|
22
|
+
return index.bootstrapLazy([["ix-icon.cjs",[[769,"ix-icon",{"size":[1],"color":[1],"name":[1],"lazyLoading":[4,"lazy-loading"],"svgContent":[32],"isVisible":[32]},null,{"name":["loadIconContent"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ix-icons.cjs.js","sources":["node_modules/.pnpm/@stencil+core@4.
|
|
1
|
+
{"version":3,"file":"ix-icons.cjs.js","sources":["node_modules/.pnpm/@stencil+core@4.38.3/node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.38.3 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, H, promiseResolve, win } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? win.document && Array.from(win.document.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"names":["promiseResolve","globalScripts","bootstrapLazy"],"mappings":";;;;;;AAAA;AACA;AACA;;AAKA,IAAI,YAAY,GAAG,MAAM;AAUzB,EAAE,MAAM,UAAU,GAAG,iQAAe;AACpC,EAAE,MAAM,IAAI,GAAiE,EAAE;AAC/E,EAAE,IAAI,UAAU,KAAK,EAAE,EAAE;AACzB,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI;AACrD;AACA,EAAE,OAAOA,oBAAc,CAAC,IAAI,CAAC;AAC7B,CAAC;;ACnBD,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,OAAO,KAAK;AACvC,EAAE,MAAMC,wBAAa,EAAE;AACvB,EAAE,OAAOC,mBAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC;AAC7D,CAAC,CAAC;;;;","x_google_ignoreList":[0]}
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-HU55KNQP.js');
|
|
4
4
|
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
5
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["ix-icon.cjs",[[
|
|
9
|
+
return index.bootstrapLazy([["ix-icon.cjs",[[769,"ix-icon",{"size":[1],"color":[1],"name":[1],"lazyLoading":[4,"lazy-loading"],"svgContent":[32],"isVisible":[32]},null,{"name":["loadIconContent"]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -10,17 +10,35 @@ import { h, Host, Build } from "@stencil/core";
|
|
|
10
10
|
import { resolveIcon } from "./resolveIcon";
|
|
11
11
|
import { errorSymbol, parseSVGDataContent } from "./parser";
|
|
12
12
|
export class Icon {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
hostElement;
|
|
14
|
+
/**
|
|
15
|
+
* Size of the icon
|
|
16
|
+
*/
|
|
17
|
+
size = '24';
|
|
18
|
+
/**
|
|
19
|
+
* Color of the icon
|
|
20
|
+
*/
|
|
21
|
+
color;
|
|
22
|
+
/**
|
|
23
|
+
* Use one of our defined icon names e.g. `copy`
|
|
24
|
+
*
|
|
25
|
+
* https://ix.siemens.io/docs/icon-library/icons
|
|
26
|
+
*
|
|
27
|
+
* or the import variant
|
|
28
|
+
*
|
|
29
|
+
* ```
|
|
30
|
+
* import { rocket } from '@siemens/ix-icons/icons';
|
|
31
|
+
*
|
|
32
|
+
* <ix-icon name={rocket}></ix-icon>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
name;
|
|
36
|
+
/**
|
|
37
|
+
* Only fetch and parse svg data when icon is visible
|
|
38
|
+
*/
|
|
39
|
+
lazyLoading = false;
|
|
40
|
+
svgContent;
|
|
41
|
+
isVisible = false;
|
|
24
42
|
componentWillLoad() {
|
|
25
43
|
this.waitForRendering(() => {
|
|
26
44
|
this.isVisible = true;
|
|
@@ -82,7 +100,6 @@ export class Icon {
|
|
|
82
100
|
return {
|
|
83
101
|
"size": {
|
|
84
102
|
"type": "string",
|
|
85
|
-
"attribute": "size",
|
|
86
103
|
"mutable": false,
|
|
87
104
|
"complexType": {
|
|
88
105
|
"original": "'12' | '16' | '24' | '32'",
|
|
@@ -98,11 +115,11 @@ export class Icon {
|
|
|
98
115
|
"getter": false,
|
|
99
116
|
"setter": false,
|
|
100
117
|
"reflect": false,
|
|
118
|
+
"attribute": "size",
|
|
101
119
|
"defaultValue": "'24'"
|
|
102
120
|
},
|
|
103
121
|
"color": {
|
|
104
122
|
"type": "string",
|
|
105
|
-
"attribute": "color",
|
|
106
123
|
"mutable": false,
|
|
107
124
|
"complexType": {
|
|
108
125
|
"original": "string",
|
|
@@ -117,11 +134,11 @@ export class Icon {
|
|
|
117
134
|
},
|
|
118
135
|
"getter": false,
|
|
119
136
|
"setter": false,
|
|
120
|
-
"reflect": false
|
|
137
|
+
"reflect": false,
|
|
138
|
+
"attribute": "color"
|
|
121
139
|
},
|
|
122
140
|
"name": {
|
|
123
141
|
"type": "string",
|
|
124
|
-
"attribute": "name",
|
|
125
142
|
"mutable": false,
|
|
126
143
|
"complexType": {
|
|
127
144
|
"original": "string",
|
|
@@ -136,11 +153,11 @@ export class Icon {
|
|
|
136
153
|
},
|
|
137
154
|
"getter": false,
|
|
138
155
|
"setter": false,
|
|
139
|
-
"reflect": false
|
|
156
|
+
"reflect": false,
|
|
157
|
+
"attribute": "name"
|
|
140
158
|
},
|
|
141
159
|
"lazyLoading": {
|
|
142
160
|
"type": "boolean",
|
|
143
|
-
"attribute": "lazy-loading",
|
|
144
161
|
"mutable": false,
|
|
145
162
|
"complexType": {
|
|
146
163
|
"original": "boolean",
|
|
@@ -156,6 +173,7 @@ export class Icon {
|
|
|
156
173
|
"getter": false,
|
|
157
174
|
"setter": false,
|
|
158
175
|
"reflect": false,
|
|
176
|
+
"attribute": "lazy-loading",
|
|
159
177
|
"defaultValue": "false"
|
|
160
178
|
}
|
|
161
179
|
};
|
|
@@ -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,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAQ5D,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,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAQ5D,MAAM,OAAO,IAAI;IACJ,WAAW,CAAqB;IAE3C;;OAEG;IACK,IAAI,GAA8B,IAAI,CAAC;IAE/C;;OAEG;IACK,KAAK,CAAU;IAEvB;;;;;;;;;;;;OAYG;IACK,IAAI,CAAU;IAEtB;;OAEG;IACK,WAAW,GAAG,KAAK,CAAC;IAEnB,UAAU,CAAU;IACpB,SAAS,GAAG,KAAK,CAAC;IAE3B,iBAAiB;QACf,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;YACzB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAGD,KAAK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EAAE,IAAI,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,iBAAc,MAAM,GAAO,CAC7E,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 { resolveIcon } from './resolveIcon';\nimport { errorSymbol, parseSVGDataContent } from './parser';\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' = '24';\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 /**\n * Only fetch and parse svg data when icon is visible\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 const content = await resolveIcon(this.hostElement, this.name);\n\n if (!content) {\n this.svgContent = parseSVGDataContent(errorSymbol);\n return;\n }\n\n this.svgContent = content;\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 role=\"img\"\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} aria-hidden=\"true\"></div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -15,7 +15,7 @@ export function parseSVGDataContent(content, element) {
|
|
|
15
15
|
try {
|
|
16
16
|
content = decodeURI(content);
|
|
17
17
|
}
|
|
18
|
-
catch
|
|
18
|
+
catch {
|
|
19
19
|
// Content is not a valid URI component, which can happen if it's already decoded. Proceed with the original content.
|
|
20
20
|
}
|
|
21
21
|
const svgDocument = parser.parseFromString(content, 'text/html');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../src/components/icon/parser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,IAAI,MAAM,GAAQ,IAAI,CAAC;AAEvB,MAAM,CAAC,MAAM,WAAW,GACtB,gdAAgd,CAAC;AAEnd,MAAM,UAAU,mBAAmB,CAAC,OAAe,EAAE,OAAqB;IACxE,IAAI,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,WAAW,EAAE,CAAC;QAC/C,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC1D,OAAO,EAAE,CAAC;IACZ,CAAC;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;IACZ,CAAC;IAED,OAAO,UAAU,CAAC,SAAS,CAAC;AAC9B,CAAC","sourcesContent":["/*\n * COPYRIGHT (c) Siemens AG 2018-2025 ALL RIGHTS RESERVED.\n */\n\nlet parser: any = null;\n\nexport const errorSymbol =\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\nexport function parseSVGDataContent(content: string, element?: HTMLElement): string {\n if (typeof window['DOMParser'] === 'undefined') {\n console.error('DOMParser not supported by your browser.');\n return '';\n }\n\n if (parser === null) {\n parser = new window['DOMParser']();\n }\n\n // decode URI component if needed\n try {\n content = decodeURI(content);\n } catch {\n // Content is not a valid URI component, which can happen if it's already decoded. Proceed with the original content.\n }\n\n const svgDocument = parser.parseFromString(content, 'text/html');\n const svgElement = svgDocument.querySelector('svg') as HTMLElement;\n\n if (!svgElement) {\n if (element) {\n console.error('No valid svg data provided', element);\n } else {\n console.error('No valid svg data provided');\n }\n return '';\n }\n\n return svgElement.outerHTML;\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const NAMESPACE = 'ix-icons';
|
|
2
|
-
const BUILD = /* ix-icons */ { hydratedSelectorName: "hydrated", lazyLoad: true, updatable: true};
|
|
2
|
+
const BUILD = /* ix-icons */ { hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.38.3 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
@@ -13,6 +13,38 @@ var __export = (target, all) => {
|
|
|
13
13
|
// src/utils/constants.ts
|
|
14
14
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
15
15
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
16
|
+
var reWireGetterSetter = (instance, hostRef) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
19
|
+
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
20
|
+
members.map(([memberName, [memberFlags]]) => {
|
|
21
|
+
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
22
|
+
const ogValue = instance[memberName];
|
|
23
|
+
const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName) || Object.getOwnPropertyDescriptor(instance, memberName);
|
|
24
|
+
if (ogDescriptor) {
|
|
25
|
+
Object.defineProperty(instance, memberName, {
|
|
26
|
+
get() {
|
|
27
|
+
return ogDescriptor.get.call(this);
|
|
28
|
+
},
|
|
29
|
+
set(newValue) {
|
|
30
|
+
ogDescriptor.set.call(this, newValue);
|
|
31
|
+
},
|
|
32
|
+
configurable: true,
|
|
33
|
+
enumerable: true
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
function getPropertyDescriptor(obj, memberName) {
|
|
41
|
+
while (obj) {
|
|
42
|
+
const desc = Object.getOwnPropertyDescriptor(obj, memberName);
|
|
43
|
+
if (desc == null ? void 0 : desc.get) return desc;
|
|
44
|
+
obj = Object.getPrototypeOf(obj);
|
|
45
|
+
}
|
|
46
|
+
return void 0;
|
|
47
|
+
}
|
|
16
48
|
|
|
17
49
|
// src/client/client-host-ref.ts
|
|
18
50
|
var getHostRef = (ref) => {
|
|
@@ -25,19 +57,26 @@ var registerInstance = (lazyInstance, hostRef) => {
|
|
|
25
57
|
if (!hostRef) return;
|
|
26
58
|
lazyInstance.__stencil__getHostRef = () => hostRef;
|
|
27
59
|
hostRef.$lazyInstance$ = lazyInstance;
|
|
60
|
+
if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
|
|
61
|
+
reWireGetterSetter(lazyInstance, hostRef);
|
|
62
|
+
}
|
|
28
63
|
};
|
|
29
64
|
var registerHost = (hostElement, cmpMeta) => {
|
|
30
65
|
const hostRef = {
|
|
31
66
|
$flags$: 0,
|
|
32
67
|
$hostElement$: hostElement,
|
|
33
68
|
$cmpMeta$: cmpMeta,
|
|
34
|
-
$instanceValues$: /* @__PURE__ */ new Map()
|
|
69
|
+
$instanceValues$: /* @__PURE__ */ new Map(),
|
|
70
|
+
$serializerValues$: /* @__PURE__ */ new Map()
|
|
35
71
|
};
|
|
36
72
|
{
|
|
37
73
|
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
|
|
38
74
|
hostElement["s-p"] = [];
|
|
39
75
|
hostElement["s-rc"] = [];
|
|
40
76
|
}
|
|
77
|
+
{
|
|
78
|
+
hostRef.$fetchedCbList$ = [];
|
|
79
|
+
}
|
|
41
80
|
const ref = hostRef;
|
|
42
81
|
hostElement.__stencil__getHostRef = () => ref;
|
|
43
82
|
return ref;
|
|
@@ -837,6 +876,11 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
837
876
|
}
|
|
838
877
|
let maybePromise;
|
|
839
878
|
if (isInitialLoad) {
|
|
879
|
+
{
|
|
880
|
+
if (hostRef.$fetchedCbList$.length) {
|
|
881
|
+
hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
|
|
882
|
+
}
|
|
883
|
+
}
|
|
840
884
|
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
841
885
|
} else {
|
|
842
886
|
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
@@ -1006,9 +1050,17 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1006
1050
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1007
1051
|
var _a, _b;
|
|
1008
1052
|
const prototype = Cstr.prototype;
|
|
1009
|
-
if (cmpMeta.$members$ ||
|
|
1010
|
-
|
|
1011
|
-
cmpMeta.$watchers$
|
|
1053
|
+
if (cmpMeta.$members$ || BUILD.propChangeCallback) {
|
|
1054
|
+
{
|
|
1055
|
+
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
1056
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1057
|
+
}
|
|
1058
|
+
if (Cstr.deserializers && !cmpMeta.$deserializers$) {
|
|
1059
|
+
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
1060
|
+
}
|
|
1061
|
+
if (Cstr.serializers && !cmpMeta.$serializers$) {
|
|
1062
|
+
cmpMeta.$serializers$ = Cstr.serializers;
|
|
1063
|
+
}
|
|
1012
1064
|
}
|
|
1013
1065
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1014
1066
|
members.map(([memberName, [memberFlags]]) => {
|
|
@@ -1043,8 +1095,6 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1043
1095
|
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1044
1096
|
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1045
1097
|
newValue = ref.$instanceValues$.get(memberName);
|
|
1046
|
-
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1047
|
-
ref.$instanceValues$.set(memberName, currentValue);
|
|
1048
1098
|
}
|
|
1049
1099
|
origSetter.apply(this, [
|
|
1050
1100
|
parsePropertyValue(
|
|
@@ -1059,7 +1109,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1059
1109
|
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
1060
1110
|
setValue(this, memberName, newValue, cmpMeta);
|
|
1061
1111
|
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
1062
|
-
ref.$
|
|
1112
|
+
ref.$fetchedCbList$.push(() => {
|
|
1063
1113
|
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
1064
1114
|
ref.$lazyInstance$[memberName] = newValue;
|
|
1065
1115
|
}
|
|
@@ -1080,7 +1130,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1080
1130
|
if (ref.$lazyInstance$) {
|
|
1081
1131
|
setterSetVal();
|
|
1082
1132
|
} else {
|
|
1083
|
-
ref.$
|
|
1133
|
+
ref.$fetchedCbList$.push(() => {
|
|
1134
|
+
setterSetVal();
|
|
1135
|
+
});
|
|
1084
1136
|
}
|
|
1085
1137
|
}
|
|
1086
1138
|
}
|
|
@@ -1093,14 +1145,15 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1093
1145
|
plt.jmp(() => {
|
|
1094
1146
|
var _a2;
|
|
1095
1147
|
const propName = attrNameToPropName.get(attrName);
|
|
1148
|
+
const hostRef = getHostRef(this);
|
|
1096
1149
|
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
1097
1150
|
newValue = this[propName];
|
|
1098
1151
|
delete this[propName];
|
|
1099
|
-
}
|
|
1152
|
+
}
|
|
1153
|
+
if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
1100
1154
|
this[propName] == newValue) {
|
|
1101
1155
|
return;
|
|
1102
1156
|
} else if (propName == null) {
|
|
1103
|
-
const hostRef = getHostRef(this);
|
|
1104
1157
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
1105
1158
|
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
1106
1159
|
const instance = hostRef.$lazyInstance$ ;
|
|
@@ -1113,9 +1166,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1113
1166
|
}
|
|
1114
1167
|
return;
|
|
1115
1168
|
}
|
|
1169
|
+
const propFlags = members.find(([m]) => m === propName);
|
|
1170
|
+
if (propFlags && propFlags[1][0] & 4 /* Boolean */) {
|
|
1171
|
+
newValue = newValue === null || newValue === "false" ? false : true;
|
|
1172
|
+
}
|
|
1116
1173
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1117
|
-
|
|
1118
|
-
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1174
|
+
if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1119
1175
|
this[propName] = newValue;
|
|
1120
1176
|
}
|
|
1121
1177
|
});
|
|
@@ -1156,6 +1212,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1156
1212
|
if (!Cstr.isProxied) {
|
|
1157
1213
|
{
|
|
1158
1214
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1215
|
+
cmpMeta.$serializers$ = Cstr.serializers;
|
|
1216
|
+
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
1159
1217
|
}
|
|
1160
1218
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1161
1219
|
Cstr.isProxied = true;
|
|
@@ -1231,7 +1289,7 @@ var connectedCallback = (elm) => {
|
|
|
1231
1289
|
}
|
|
1232
1290
|
if (cmpMeta.$members$) {
|
|
1233
1291
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1234
|
-
if (memberFlags & 31 /* Prop */ && elm.
|
|
1292
|
+
if (memberFlags & 31 /* Prop */ && memberName in elm && elm[memberName] !== Object.prototype[memberName]) {
|
|
1235
1293
|
const value = elm[memberName];
|
|
1236
1294
|
delete elm[memberName];
|
|
1237
1295
|
elm[memberName] = value;
|
|
@@ -1295,7 +1353,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1295
1353
|
let hasSlotRelocation = false;
|
|
1296
1354
|
lazyBundles.map((lazyBundle) => {
|
|
1297
1355
|
lazyBundle[1].map((compactMeta) => {
|
|
1298
|
-
var _a2;
|
|
1356
|
+
var _a2, _b, _c;
|
|
1299
1357
|
const cmpMeta = {
|
|
1300
1358
|
$flags$: compactMeta[0],
|
|
1301
1359
|
$tagName$: compactMeta[1],
|
|
@@ -1310,6 +1368,8 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1310
1368
|
}
|
|
1311
1369
|
{
|
|
1312
1370
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
1371
|
+
cmpMeta.$serializers$ = (_b = compactMeta[5]) != null ? _b : {};
|
|
1372
|
+
cmpMeta.$deserializers$ = (_c = compactMeta[6]) != null ? _c : {};
|
|
1313
1373
|
}
|
|
1314
1374
|
const tagName = cmpMeta.$tagName$;
|
|
1315
1375
|
const HostElement = class extends HTMLElement {
|
|
@@ -1414,6 +1474,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1414
1474
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1415
1475
|
|
|
1416
1476
|
export { Host as H, getElement as a, bootstrapLazy as b, setAssetPath as c, getAssetPath as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1417
|
-
//# sourceMappingURL=index-
|
|
1477
|
+
//# sourceMappingURL=index-CyicTMfq.js.map
|
|
1418
1478
|
|
|
1419
|
-
//# sourceMappingURL=index-
|
|
1479
|
+
//# sourceMappingURL=index-CyicTMfq.js.map
|