@esportsplus/template 0.19.6 → 0.19.7
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/build/svg.d.ts +1 -1
- package/build/svg.js +4 -4
- package/package.json +1 -1
- package/src/svg.ts +5 -5
package/build/svg.d.ts
CHANGED
package/build/svg.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import html from './html/index.js';
|
|
2
2
|
const svg = html.bind(null);
|
|
3
|
-
svg.sprite = (
|
|
4
|
-
if (
|
|
5
|
-
|
|
3
|
+
svg.sprite = (href) => {
|
|
4
|
+
if (href[0] !== '#') {
|
|
5
|
+
href = '#' + href;
|
|
6
6
|
}
|
|
7
|
-
return html `<svg><use
|
|
7
|
+
return html `<svg><use ${{ ['href']: href }} /></svg>`;
|
|
8
8
|
};
|
|
9
9
|
export default svg;
|
package/package.json
CHANGED
package/src/svg.ts
CHANGED
|
@@ -2,15 +2,15 @@ import html from './html';
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
const svg = html.bind(null) as typeof html & {
|
|
5
|
-
sprite: (
|
|
5
|
+
sprite: (href: string) => ReturnType<typeof html>
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
svg.sprite = (
|
|
9
|
-
if (
|
|
10
|
-
|
|
8
|
+
svg.sprite = (href: string) => {
|
|
9
|
+
if (href[0] !== '#') {
|
|
10
|
+
href = '#' + href;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
return html`<svg><use
|
|
13
|
+
return html`<svg><use ${{ ['href']: href }} /></svg>`;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
|