@milaboratories/uikit 2.2.85 → 2.2.86
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/CHANGELOG.md +6 -0
- package/dist/pl-uikit.js +725 -725
- package/dist/pl-uikit.js.map +1 -1
- package/dist/src/components/PlSvg/registry.d.ts +1 -1
- package/dist/src/components/PlSvg/registry.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/PlSvg/PlSvg.vue +1 -1
- package/src/components/PlSvg/registry.ts +4 -2
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ const uri = computedAsync(async () => {
|
|
|
18
18
|
if (typeof props.name === 'string') return import(`../../assets/icons/icon-assets-min/${props.name}.svg?raw`).then((m) => m.default);
|
|
19
19
|
return undefined;
|
|
20
20
|
});
|
|
21
|
-
const svgMeta = computed(() => (uri.value == null ? undefined : registerSvg(uri.value)));
|
|
21
|
+
const svgMeta = computed(() => (uri.value == null ? undefined : registerSvg(uri.value, props.name)));
|
|
22
22
|
const styleSize = computed(() =>
|
|
23
23
|
svgMeta.value == null
|
|
24
24
|
? undefined
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { uniqueId } from '@milaboratories/helpers';
|
|
2
|
+
|
|
1
3
|
let defs: SVGDefsElement | null = null;
|
|
2
4
|
export type SvgMeta = {
|
|
3
5
|
spriteId: string;
|
|
@@ -16,9 +18,9 @@ function ensureSpriteContainer() {
|
|
|
16
18
|
document.body.prepend(defs);
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
export function registerSvg(raw: string): SvgMeta {
|
|
21
|
+
export function registerSvg(raw: string, name?: string): SvgMeta {
|
|
20
22
|
if (!registeredRaw.has(raw)) {
|
|
21
|
-
const id = `svg-${
|
|
23
|
+
const id = `svg-${name ? `${name}-` : ''}${uniqueId()}`;
|
|
22
24
|
|
|
23
25
|
ensureSpriteContainer();
|
|
24
26
|
|