zova-module-a-icon 5.0.0 → 5.1.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/LICENSE +21 -0
- package/dist/index.js +369 -0
- package/dist/index.js.map +1 -0
- package/package.json +28 -23
- package/rest/component/icon.ts +8 -0
- package/rest/components.ts +1 -0
- package/rest/index.ts +1 -0
- package/src/.metadata/component/icon.ts +23 -0
- package/src/.metadata/index.ts +140 -0
- package/src/.metadata/this.ts +2 -0
- package/src/bean/sys.icon.ts +205 -0
- package/src/bean/tool.icon.ts +75 -0
- package/src/component/icon/controller.tsx +87 -0
- package/src/config/config.ts +10 -0
- package/src/index.ts +3 -0
- package/src/lib/iconGroup.ts +10 -0
- package/src/lib/index.ts +3 -0
- package/src/lib/useZovaIcon.ts +18 -0
- package/src/lib/utils.ts +20 -0
- package/src/monkeySys.ts +12 -0
- package/src/types/icon.ts +27 -0
- package/src/types/index.ts +1 -0
- package/README.md +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016-present Zova
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { BeanBase, BeanControllerBase, BeanInfo, BeanScopeBase, BeanSimple, StateLock, Use, convertToUnit, isHttpUrl, prepareComponentOptions, sys, useController } from "zova";
|
|
2
|
+
import { createVNode, defineComponent, reactive, ref, watchEffect } from "vue";
|
|
3
|
+
import { Controller, Scope, Sys, Tool } from "zova-module-a-bean";
|
|
4
|
+
//#region src/lib/iconGroup.ts
|
|
5
|
+
var IconGroup = class {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.svg = void 0;
|
|
8
|
+
this.loaded = void 0;
|
|
9
|
+
this.loaded = StateLock.create();
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/bean/sys.icon.ts
|
|
14
|
+
var _dec$3, _dec2$3, _class$3;
|
|
15
|
+
var XMLNS = "http://www.w3.org/2000/svg";
|
|
16
|
+
var XMLNS_LINK = "http://www.w3.org/1999/xlink";
|
|
17
|
+
var SysIcon = (_dec$3 = Sys(), _dec2$3 = BeanInfo({ module: "a-icon" }), _dec$3(_class$3 = _dec2$3(_class$3 = class SysIcon extends BeanBase {
|
|
18
|
+
constructor(...args) {
|
|
19
|
+
super(...args);
|
|
20
|
+
this._iconSymbols = reactive({});
|
|
21
|
+
this._iconMoudles = {};
|
|
22
|
+
}
|
|
23
|
+
parseIconInfoSync(iconName) {
|
|
24
|
+
const meta = this.parseIconMeta(iconName);
|
|
25
|
+
if (!meta) return void 0;
|
|
26
|
+
const iconEmpty = {
|
|
27
|
+
meta,
|
|
28
|
+
symbolId: ""
|
|
29
|
+
};
|
|
30
|
+
const iconOk = {
|
|
31
|
+
meta,
|
|
32
|
+
symbolId: meta.symbolId
|
|
33
|
+
};
|
|
34
|
+
if (this._iconSymbols[meta.fullName]) return iconOk;
|
|
35
|
+
if (process.env.CLIENT) {
|
|
36
|
+
if (document.getElementById(meta.symbolId)) return iconOk;
|
|
37
|
+
}
|
|
38
|
+
if (this._iconSymbols[meta.fullName] === void 0) {
|
|
39
|
+
this.parseIconInfo(iconName);
|
|
40
|
+
return iconEmpty;
|
|
41
|
+
} else if (this._iconSymbols[meta.fullName] === "") return iconEmpty;
|
|
42
|
+
}
|
|
43
|
+
async parseIconInfo(iconName) {
|
|
44
|
+
const meta = this.parseIconMeta(iconName);
|
|
45
|
+
if (!meta) return void 0;
|
|
46
|
+
if (this._iconSymbols[meta.fullName]) return {
|
|
47
|
+
meta,
|
|
48
|
+
symbolId: this._iconSymbols[meta.fullName]
|
|
49
|
+
};
|
|
50
|
+
this._iconSymbols[meta.fullName] = "";
|
|
51
|
+
if (!await this.parseIconGroup(meta.module, meta.group)) return void 0;
|
|
52
|
+
this._injectIconClient(meta);
|
|
53
|
+
return {
|
|
54
|
+
meta,
|
|
55
|
+
symbolId: this._iconSymbols[meta.fullName] = meta.symbolId
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
async parseIconGroup(moduleName, groupName) {
|
|
59
|
+
const iconModule = this.getIconModule(moduleName);
|
|
60
|
+
if (iconModule[groupName]) {
|
|
61
|
+
await iconModule[groupName].loaded.wait();
|
|
62
|
+
return iconModule[groupName].svg;
|
|
63
|
+
}
|
|
64
|
+
iconModule[groupName] = new IconGroup();
|
|
65
|
+
const svg = await this._parseIconGroupInner(moduleName, groupName);
|
|
66
|
+
iconModule[groupName].svg = svg;
|
|
67
|
+
iconModule[groupName].loaded.touch();
|
|
68
|
+
return iconModule[groupName].svg;
|
|
69
|
+
}
|
|
70
|
+
async _parseIconGroupInner(moduleName, groupName) {
|
|
71
|
+
const module = await this.sys.meta.module.use(moduleName);
|
|
72
|
+
if (!module) return;
|
|
73
|
+
let groupUrl = module.resource.icons[groupName];
|
|
74
|
+
if (!groupUrl) return;
|
|
75
|
+
if (groupUrl.startsWith("data:image/svg+xml")) throw new Error("inline svg not supported");
|
|
76
|
+
let svg;
|
|
77
|
+
if (process.env.SERVER) {
|
|
78
|
+
groupUrl = this.sys.util.getPagePathFromAbsoluteUrl(groupUrl);
|
|
79
|
+
const path = await import("node:path");
|
|
80
|
+
const fs = await import("node:fs/promises");
|
|
81
|
+
let filePath;
|
|
82
|
+
if (process.env.DEV) filePath = path.join(process.cwd(), groupUrl);
|
|
83
|
+
else {
|
|
84
|
+
const { fileURLToPath } = await import("node:url");
|
|
85
|
+
const rootFolder = fileURLToPath(new URL(
|
|
86
|
+
/* @vite-ignore */
|
|
87
|
+
".",
|
|
88
|
+
import.meta.url
|
|
89
|
+
));
|
|
90
|
+
filePath = path.join(rootFolder, "client", groupUrl);
|
|
91
|
+
}
|
|
92
|
+
svg = await fs.readFile(filePath, { encoding: "utf8" });
|
|
93
|
+
} else {
|
|
94
|
+
const res = await fetch(groupUrl);
|
|
95
|
+
if (!res.ok) return;
|
|
96
|
+
svg = await res.text();
|
|
97
|
+
}
|
|
98
|
+
return svg;
|
|
99
|
+
}
|
|
100
|
+
_injectIconClient(meta) {
|
|
101
|
+
if (process.env.SERVER) return;
|
|
102
|
+
const iconGroup = this.getIconModule(meta.module)[meta.group];
|
|
103
|
+
let domContainer = document.getElementById("zova-svg-container");
|
|
104
|
+
if (!domContainer) {
|
|
105
|
+
domContainer = document.createElement("div");
|
|
106
|
+
domContainer.style.position = "absolute";
|
|
107
|
+
domContainer.style.width = "0";
|
|
108
|
+
domContainer.style.height = "0";
|
|
109
|
+
domContainer.style.display = "none";
|
|
110
|
+
domContainer.id = "zova-svg-container";
|
|
111
|
+
document.body.appendChild(domContainer);
|
|
112
|
+
}
|
|
113
|
+
let domModule = document.getElementById(`zova-svg-module-${meta.module}`);
|
|
114
|
+
if (!domModule) {
|
|
115
|
+
domModule = document.createElement("div");
|
|
116
|
+
domModule.id = `zova-svg-module-${meta.module}`;
|
|
117
|
+
domContainer.appendChild(domModule);
|
|
118
|
+
}
|
|
119
|
+
let domGroup = document.getElementById(`zova-svg-group-${meta.module}-${meta.group}`);
|
|
120
|
+
if (!domGroup) {
|
|
121
|
+
domGroup = document.createElementNS(XMLNS, "svg");
|
|
122
|
+
domGroup.id = `zova-svg-group-${meta.module}-${meta.group}`;
|
|
123
|
+
domGroup.setAttribute("xmlns", XMLNS);
|
|
124
|
+
domGroup.setAttribute("xmlns:link", XMLNS_LINK);
|
|
125
|
+
domModule.appendChild(domGroup);
|
|
126
|
+
}
|
|
127
|
+
if (!document.getElementById(meta.symbolId)) {
|
|
128
|
+
const iconContent = this.extractIconContent(iconGroup.svg, meta.symbolId);
|
|
129
|
+
if (iconContent) domGroup.insertAdjacentHTML("beforeend", iconContent);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
extractIconContent(svg, symbolId) {
|
|
133
|
+
if (!svg) return void 0;
|
|
134
|
+
let pos = svg.indexOf(`'${symbolId}'`);
|
|
135
|
+
if (pos === -1) pos = svg.indexOf(`"${symbolId}"`);
|
|
136
|
+
if (pos === -1) return void 0;
|
|
137
|
+
const posB = svg.indexOf("</symbol>", pos);
|
|
138
|
+
const posA = svg.lastIndexOf("<symbol", pos);
|
|
139
|
+
return svg.substring(posA, posB + 9);
|
|
140
|
+
}
|
|
141
|
+
getIconModule(moduleName) {
|
|
142
|
+
if (!this._iconMoudles[moduleName]) this._iconMoudles[moduleName] = {};
|
|
143
|
+
return this._iconMoudles[moduleName];
|
|
144
|
+
}
|
|
145
|
+
parseIconMeta(iconName) {
|
|
146
|
+
if (!iconName) return;
|
|
147
|
+
const parts = iconName.split(":");
|
|
148
|
+
if (parts.length !== 3) return;
|
|
149
|
+
const module = parts[0] || this.scope.config.defaultModule;
|
|
150
|
+
const group = parts[1] || "default";
|
|
151
|
+
const name = parts[2] || "";
|
|
152
|
+
if (!module.includes("-") || !name) return;
|
|
153
|
+
return {
|
|
154
|
+
module,
|
|
155
|
+
group,
|
|
156
|
+
name,
|
|
157
|
+
fullName: this._getFullName(module, group, name),
|
|
158
|
+
symbolId: this._getSymbolId(module, group, name)
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
_getSymbolId(module, group, name) {
|
|
162
|
+
return `zova-svg-icon-${module}-${group}-${name}`;
|
|
163
|
+
}
|
|
164
|
+
_getFullName(module, group, name) {
|
|
165
|
+
return `${module}:${group}:${name}`;
|
|
166
|
+
}
|
|
167
|
+
}) || _class$3) || _class$3);
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/bean/tool.icon.ts
|
|
170
|
+
var _dec$2, _dec2$2, _dec3$1, _dec4$1, _class$2, _class2$1, _descriptor$1;
|
|
171
|
+
function _initializerDefineProperty$1(e, i, r, l) {
|
|
172
|
+
r && Object.defineProperty(e, i, {
|
|
173
|
+
enumerable: r.enumerable,
|
|
174
|
+
configurable: r.configurable,
|
|
175
|
+
writable: r.writable,
|
|
176
|
+
value: r.initializer ? r.initializer.call(l) : void 0
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function _applyDecoratedDescriptor$1(i, e, r, n, l) {
|
|
180
|
+
var a = {};
|
|
181
|
+
return Object.keys(n).forEach(function(i) {
|
|
182
|
+
a[i] = n[i];
|
|
183
|
+
}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function(r, n) {
|
|
184
|
+
return n(i, e, r) || r;
|
|
185
|
+
}, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
|
|
186
|
+
}
|
|
187
|
+
var ToolIcon = (_dec$2 = Tool(), _dec2$2 = BeanInfo({ module: "a-icon" }), _dec3$1 = Use(), _dec4$1 = Reflect.metadata("design:type", typeof SysIcon === "undefined" ? Object : SysIcon), _dec$2(_class$2 = _dec2$2(_class$2 = (_class2$1 = class ToolIcon extends BeanBase {
|
|
188
|
+
constructor(...args) {
|
|
189
|
+
super(...args);
|
|
190
|
+
this._iconSSR = {};
|
|
191
|
+
_initializerDefineProperty$1(this, "$$sysIcon", _descriptor$1, this);
|
|
192
|
+
}
|
|
193
|
+
async __init__() {
|
|
194
|
+
if (process.env.SERVER) this.ctx.meta.$ssr.context.onRendered((err) => {
|
|
195
|
+
if (err) return;
|
|
196
|
+
this._onRendered();
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
async parseIconInfo(iconName) {
|
|
200
|
+
const iconInfo = await this.$$sysIcon.parseIconInfo(iconName);
|
|
201
|
+
if (!iconInfo) return iconInfo;
|
|
202
|
+
this._injectIconSSR(iconInfo.meta);
|
|
203
|
+
return iconInfo;
|
|
204
|
+
}
|
|
205
|
+
_onRendered() {
|
|
206
|
+
this.ctx.meta.$ssr.context._meta.bodyTags += this._renderSSRContainer();
|
|
207
|
+
}
|
|
208
|
+
_renderSSRContainer() {
|
|
209
|
+
return `<div id="zova-svg-container" style="position: absolute; width: 0px; height: 0px; display: none;">${this._renderSSRModules()}</div>`;
|
|
210
|
+
}
|
|
211
|
+
_renderSSRModules() {
|
|
212
|
+
return Object.keys(this._iconSSR).map((moduleName) => {
|
|
213
|
+
return `<div id="${`zova-svg-module-${moduleName}`}">${this._renderSSRGroups(this._iconSSR[moduleName], moduleName)}</div>`;
|
|
214
|
+
}).join("");
|
|
215
|
+
}
|
|
216
|
+
_renderSSRGroups(iconSSRGroups, moduleName) {
|
|
217
|
+
return Object.keys(iconSSRGroups).map((groupName) => {
|
|
218
|
+
return `<svg id="${`zova-svg-group-${moduleName}-${groupName}`}" xmlns="http://www.w3.org/2000/svg" xmlns:link="http://www.w3.org/1999/xlink">${this._renderSSRIcons(iconSSRGroups[groupName])}</svg>`;
|
|
219
|
+
}).join("");
|
|
220
|
+
}
|
|
221
|
+
_renderSSRIcons(iconSSRIcons) {
|
|
222
|
+
return Object.keys(iconSSRIcons).map((symbolId) => {
|
|
223
|
+
return iconSSRIcons[symbolId];
|
|
224
|
+
}).join("");
|
|
225
|
+
}
|
|
226
|
+
_injectIconSSR(meta) {
|
|
227
|
+
if (process.env.CLIENT) return;
|
|
228
|
+
const iconGroup = this.$$sysIcon.getIconModule(meta.module)[meta.group];
|
|
229
|
+
if (!this._iconSSR[meta.module]) this._iconSSR[meta.module] = {};
|
|
230
|
+
if (!this._iconSSR[meta.module][meta.group]) this._iconSSR[meta.module][meta.group] = {};
|
|
231
|
+
this._iconSSR[meta.module][meta.group][meta.symbolId] = this.$$sysIcon.extractIconContent(iconGroup.svg, meta.symbolId);
|
|
232
|
+
}
|
|
233
|
+
}, _descriptor$1 = _applyDecoratedDescriptor$1(_class2$1.prototype, "$$sysIcon", [_dec3$1, _dec4$1], {
|
|
234
|
+
configurable: true,
|
|
235
|
+
enumerable: true,
|
|
236
|
+
writable: true,
|
|
237
|
+
initializer: null
|
|
238
|
+
}), _class2$1)) || _class$2) || _class$2);
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region src/lib/useZovaIcon.ts
|
|
241
|
+
function $getZovaIcon(iconName) {
|
|
242
|
+
return sys.meta.$icon.parseIconInfoSync(iconName);
|
|
243
|
+
}
|
|
244
|
+
function $useZovaIcon(iconGetter) {
|
|
245
|
+
const iconInfo = ref();
|
|
246
|
+
watchEffect(() => {
|
|
247
|
+
iconInfo.value = $getZovaIcon(iconGetter());
|
|
248
|
+
});
|
|
249
|
+
return { iconInfo };
|
|
250
|
+
}
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/component/icon/controller.tsx
|
|
253
|
+
var _dec$1, _dec2$1, _dec3, _dec4, _class$1, _class2, _descriptor, _ControllerIcon;
|
|
254
|
+
function _initializerDefineProperty(e, i, r, l) {
|
|
255
|
+
r && Object.defineProperty(e, i, {
|
|
256
|
+
enumerable: r.enumerable,
|
|
257
|
+
configurable: r.configurable,
|
|
258
|
+
writable: r.writable,
|
|
259
|
+
value: r.initializer ? r.initializer.call(l) : void 0
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
function _applyDecoratedDescriptor(i, e, r, n, l) {
|
|
263
|
+
var a = {};
|
|
264
|
+
return Object.keys(n).forEach(function(i) {
|
|
265
|
+
a[i] = n[i];
|
|
266
|
+
}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function(r, n) {
|
|
267
|
+
return n(i, e, r) || r;
|
|
268
|
+
}, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
|
|
269
|
+
}
|
|
270
|
+
var ControllerIcon = (_dec$1 = Controller(), _dec2$1 = BeanInfo({ module: "a-icon" }), _dec3 = Use(), _dec4 = Reflect.metadata("design:type", typeof ToolIcon === "undefined" ? Object : ToolIcon), _dec$1(_class$1 = _dec2$1(_class$1 = (_class2 = (_ControllerIcon = class ControllerIcon extends BeanControllerBase {
|
|
271
|
+
constructor(...args) {
|
|
272
|
+
super(...args);
|
|
273
|
+
_initializerDefineProperty(this, "$$toolIcon", _descriptor, this);
|
|
274
|
+
}
|
|
275
|
+
async __init__() {
|
|
276
|
+
await this._load();
|
|
277
|
+
}
|
|
278
|
+
async _load() {
|
|
279
|
+
const name = this.$props.name;
|
|
280
|
+
if (name === "none" || !name) return;
|
|
281
|
+
if (isHttpUrl(name)) return;
|
|
282
|
+
const promise = this.$$toolIcon.parseIconInfo(name);
|
|
283
|
+
if (process.env.SSR) await promise;
|
|
284
|
+
}
|
|
285
|
+
render() {
|
|
286
|
+
const defaultSize = this.scope.config.icon.size;
|
|
287
|
+
const width = this.$props.width ?? this.$props.height ?? defaultSize;
|
|
288
|
+
const height = this.$props.height ?? this.$props.width ?? defaultSize;
|
|
289
|
+
const href = this._parseHref();
|
|
290
|
+
if (isHttpUrl(href) && !href?.endsWith(".svg")) return createVNode("img", {
|
|
291
|
+
"class": "zova-icon__img",
|
|
292
|
+
"style": {
|
|
293
|
+
width: convertToUnit(width),
|
|
294
|
+
height: convertToUnit(height)
|
|
295
|
+
},
|
|
296
|
+
"src": href
|
|
297
|
+
}, null);
|
|
298
|
+
return createVNode("svg", {
|
|
299
|
+
"class": "zova-icon__svg",
|
|
300
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
301
|
+
"viewBox": "0 0 24 24",
|
|
302
|
+
"fill": "currentColor",
|
|
303
|
+
"role": "img",
|
|
304
|
+
"aria-hidden": "true",
|
|
305
|
+
"width": width,
|
|
306
|
+
"height": height,
|
|
307
|
+
"style": { color: this.$props.color }
|
|
308
|
+
}, [createVNode("use", { "xlink:href": href }, null)]);
|
|
309
|
+
}
|
|
310
|
+
_parseHref() {
|
|
311
|
+
let href = this.$props.href;
|
|
312
|
+
const name = this.$props.name;
|
|
313
|
+
if (href) return href;
|
|
314
|
+
if (isHttpUrl(name)) return name;
|
|
315
|
+
href = `#${$getZovaIcon(name)?.symbolId || ""}`;
|
|
316
|
+
return href;
|
|
317
|
+
}
|
|
318
|
+
}, _ControllerIcon.$propsDefault = {}, _ControllerIcon), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "$$toolIcon", [_dec3, _dec4], {
|
|
319
|
+
configurable: true,
|
|
320
|
+
enumerable: true,
|
|
321
|
+
writable: true,
|
|
322
|
+
initializer: null
|
|
323
|
+
}), _class2)) || _class$1) || _class$1);
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region src/.metadata/component/icon.ts
|
|
326
|
+
var ZIcon = defineComponent((_props) => {
|
|
327
|
+
useController(ControllerIcon, void 0, void 0);
|
|
328
|
+
return () => {};
|
|
329
|
+
}, prepareComponentOptions());
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region src/config/config.ts
|
|
332
|
+
var config = (_sys) => {
|
|
333
|
+
return {
|
|
334
|
+
defaultModule: "home-icon",
|
|
335
|
+
icon: { size: 24 }
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/monkeySys.ts
|
|
340
|
+
var MonkeySys = class extends BeanSimple {
|
|
341
|
+
async sysInitialize() {
|
|
342
|
+
this.sys.meta.$icon = await this.bean._getBean(SysIcon, false);
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/.metadata/index.ts
|
|
347
|
+
/** monkeySys: end */
|
|
348
|
+
/** scope: begin */
|
|
349
|
+
var _dec, _dec2, _class;
|
|
350
|
+
var components = { "icon": ZIcon };
|
|
351
|
+
var ScopeModuleAIcon = (_dec = Scope(), _dec2 = BeanInfo({ module: "a-icon" }), _dec(_class = _dec2(_class = class ScopeModuleAIcon extends BeanScopeBase {}) || _class) || _class);
|
|
352
|
+
/** scope: end */
|
|
353
|
+
//#endregion
|
|
354
|
+
//#region src/lib/utils.ts
|
|
355
|
+
function $icon(name, size, color) {
|
|
356
|
+
return createVNode(ZIcon, {
|
|
357
|
+
name,
|
|
358
|
+
color,
|
|
359
|
+
width: size,
|
|
360
|
+
height: size
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
function $iconName(name) {
|
|
364
|
+
return name;
|
|
365
|
+
}
|
|
366
|
+
//#endregion
|
|
367
|
+
export { $getZovaIcon, $icon, $iconName, $useZovaIcon, ControllerIcon, IconGroup, MonkeySys, ScopeModuleAIcon, SysIcon, ToolIcon, ZIcon, components, config };
|
|
368
|
+
|
|
369
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["BeanControllerBase","convertToUnit","isHttpUrl","Use","Controller","ToolIcon","$getZovaIcon","ControllerIcon","_dec","_dec2","__z_BeanInfo","module","_dec3","_dec4","Reflect","metadata","Object","_class","_class2","_ControllerIcon","constructor","args","_initializerDefineProperty","_descriptor","__init__","_load","name","$props","promise","$$toolIcon","parseIconInfo","process","env","SSR","render","defaultSize","scope","config","icon","size","width","height","href","_parseHref","endsWith","_createVNode","color","iconInfo","symbolId","$propsDefault","_applyDecoratedDescriptor","prototype","configurable","enumerable","writable","initializer"],"sources":["../src/lib/iconGroup.ts","../src/bean/sys.icon.ts","../src/bean/tool.icon.ts","../src/lib/useZovaIcon.ts","../src/component/icon/controller.tsx","../src/.metadata/component/icon.ts","../src/config/config.ts","../src/monkeySys.ts","../src/.metadata/index.ts","../src/lib/utils.ts"],"sourcesContent":["import { StateLock } from 'zova';\n\nexport class IconGroup {\n public svg: string | undefined;\n public loaded: StateLock;\n\n constructor() {\n this.loaded = StateLock.create();\n }\n}\n","import { reactive } from 'vue';\nimport { BeanBase } from 'zova';\nimport { Sys } from 'zova-module-a-bean';\n\nimport { IconGroup } from '../lib/iconGroup.js';\nimport { IIconInfo, IIconMeta, TypeIconModules, TypeIconSymbols } from '../types/icon.js';\n\nconst XMLNS = 'http://www.w3.org/2000/svg';\nconst XMLNS_LINK = 'http://www.w3.org/1999/xlink';\n\n@Sys()\nexport class SysIcon extends BeanBase {\n protected _iconSymbols: TypeIconSymbols = reactive({});\n protected _iconMoudles: TypeIconModules = {};\n\n // undefined: ignore\n // '': empty icon\n parseIconInfoSync(iconName?: string): IIconInfo | undefined {\n // parts\n const meta = this.parseIconMeta(iconName);\n if (!meta) return undefined;\n // empty\n const iconEmpty = { meta, symbolId: '' };\n // ok\n const iconOk = { meta, symbolId: meta.symbolId };\n // check if exists\n if (this._iconSymbols[meta.fullName]) return iconOk;\n // check if dom exists\n if (process.env.CLIENT) {\n const domIcon = document.getElementById(meta.symbolId) as unknown as SVGElement;\n if (domIcon) return iconOk;\n }\n // check if exists\n if (this._iconSymbols[meta.fullName] === undefined) {\n this.parseIconInfo(iconName);\n return iconEmpty;\n } else if (this._iconSymbols[meta.fullName] === '') {\n return iconEmpty;\n }\n }\n\n async parseIconInfo(iconName?: string): Promise<IIconInfo | undefined> {\n // parts\n const meta = this.parseIconMeta(iconName);\n if (!meta) return undefined;\n // check if exists\n if (this._iconSymbols[meta.fullName]) {\n return { meta, symbolId: this._iconSymbols[meta.fullName] };\n }\n // pre set\n this._iconSymbols[meta.fullName] = '';\n // icon group\n const iconGroup = await this.parseIconGroup(meta.module, meta.group);\n if (!iconGroup) return undefined;\n // icon inject\n this._injectIconClient(meta);\n const symbolId = (this._iconSymbols[meta.fullName] = meta.symbolId);\n // ok\n return { meta, symbolId };\n }\n\n public async parseIconGroup(moduleName: string, groupName: string): Promise<string | undefined> {\n // check if exists\n const iconModule = this.getIconModule(moduleName);\n if (iconModule[groupName]) {\n await iconModule[groupName].loaded.wait();\n return iconModule[groupName].svg;\n }\n // record\n iconModule[groupName] = new IconGroup();\n // parse\n const svg = await this._parseIconGroupInner(moduleName, groupName);\n // touch\n iconModule[groupName].svg = svg;\n iconModule[groupName].loaded.touch();\n // ok\n return iconModule[groupName].svg;\n }\n\n private async _parseIconGroupInner(moduleName: string, groupName: string): Promise<string | undefined> {\n // module\n const module = await this.sys.meta.module.use(moduleName);\n if (!module) return;\n // icons\n const icons = module.resource.icons;\n let groupUrl = icons[groupName];\n if (!groupUrl) return;\n // inline\n if (groupUrl.startsWith('data:image/svg+xml')) throw new Error('inline svg not supported');\n // fetch\n let svg;\n if (process.env.SERVER) {\n // publicPath\n groupUrl = this.sys.util.getPagePathFromAbsoluteUrl(groupUrl);\n const path = await import('node:path');\n const fs = await import('node:fs/promises');\n let filePath: string;\n if (process.env.DEV) {\n filePath = path.join(process.cwd(), groupUrl);\n } else {\n const { fileURLToPath } = await import('node:url');\n const rootFolder = fileURLToPath(new URL(/* @vite-ignore */ '.', import.meta.url));\n filePath = path.join(rootFolder, 'client', groupUrl);\n }\n svg = await fs.readFile(filePath, { encoding: 'utf8' });\n } else {\n const res = await fetch(groupUrl);\n if (!res.ok) return;\n svg = await res.text();\n }\n return svg;\n }\n\n private _injectIconClient(meta: IIconMeta) {\n if (process.env.SERVER) return;\n // client\n const iconModule = this.getIconModule(meta.module);\n const iconGroup = iconModule[meta.group];\n // inject container\n let domContainer = document.getElementById('zova-svg-container');\n if (!domContainer) {\n domContainer = document.createElement('div');\n domContainer.style.position = 'absolute';\n domContainer.style.width = '0';\n domContainer.style.height = '0';\n domContainer.style.display = 'none';\n domContainer.id = 'zova-svg-container';\n document.body.appendChild(domContainer);\n }\n // inject module\n let domModule = document.getElementById(`zova-svg-module-${meta.module}`);\n if (!domModule) {\n domModule = document.createElement('div');\n domModule.id = `zova-svg-module-${meta.module}`;\n domContainer.appendChild(domModule);\n }\n // inject group\n let domGroup = document.getElementById(`zova-svg-group-${meta.module}-${meta.group}`) as unknown as SVGSVGElement;\n if (!domGroup) {\n domGroup = document.createElementNS(XMLNS, 'svg');\n domGroup.id = `zova-svg-group-${meta.module}-${meta.group}`;\n domGroup.setAttribute('xmlns', XMLNS);\n domGroup.setAttribute('xmlns:link', XMLNS_LINK);\n domModule.appendChild(domGroup);\n }\n // inject icon\n const domIcon = document.getElementById(meta.symbolId) as unknown as SVGElement;\n if (!domIcon) {\n const iconContent = this.extractIconContent(iconGroup.svg, meta.symbolId);\n if (iconContent) {\n domGroup.insertAdjacentHTML('beforeend', iconContent);\n }\n }\n }\n\n extractIconContent(svg: string | undefined, symbolId: string) {\n if (!svg) return undefined;\n let pos = svg.indexOf(`'${symbolId}'`);\n if (pos === -1) pos = svg.indexOf(`\"${symbolId}\"`);\n if (pos === -1) return undefined;\n const posB = svg.indexOf('</symbol>', pos);\n const posA = svg.lastIndexOf('<symbol', pos);\n return svg.substring(posA, posB + '</symbol>'.length);\n // const symbolPattern = new RegExp(`<symbol.*?id=['\"]${symbolId}['\"].*?>.*?</symbol>`);\n // const matched = symbolPattern.exec(svg || '');\n // return matched && matched[0];\n }\n\n getIconModule(moduleName: string) {\n if (!this._iconMoudles[moduleName]) {\n this._iconMoudles[moduleName] = {};\n }\n return this._iconMoudles[moduleName];\n }\n\n parseIconMeta(iconName?: string): IIconMeta | undefined {\n if (!iconName) return;\n // split module:group:name\n const parts = iconName.split(':');\n if (parts.length !== 3) {\n return;\n }\n const module = parts[0] || this.scope.config.defaultModule;\n const group = parts[1] || 'default';\n const name = parts[2] || '';\n if (!module.includes('-') || !name) {\n return;\n }\n return {\n module,\n group,\n name,\n fullName: this._getFullName(module, group, name),\n symbolId: this._getSymbolId(module, group, name),\n };\n }\n\n private _getSymbolId(module: string, group: string, name: string) {\n return `zova-svg-icon-${module}-${group}-${name}`;\n }\n\n private _getFullName(module: string, group: string, name: string) {\n return `${module}:${group}:${name}`;\n }\n}\n","import { BeanBase, Use } from 'zova';\nimport { Tool } from 'zova-module-a-bean';\n\nimport { IIconInfo, IIconMeta } from '../types/icon.js';\nimport { SysIcon } from './sys.icon.js';\n\n@Tool()\nexport class ToolIcon extends BeanBase {\n private _iconSSR: Record<string, Record<string, Record<string, string>>> = {};\n\n @Use()\n private $$sysIcon: SysIcon;\n\n protected async __init__() {\n if (process.env.SERVER) {\n this.ctx.meta.$ssr.context.onRendered((err?: Error) => {\n if (err) return;\n this._onRendered();\n });\n }\n }\n\n async parseIconInfo(iconName?: string): Promise<IIconInfo | undefined> {\n const iconInfo = await this.$$sysIcon.parseIconInfo(iconName);\n if (!iconInfo) return iconInfo;\n this._injectIconSSR(iconInfo.meta);\n return iconInfo;\n }\n\n private _onRendered() {\n this.ctx.meta.$ssr.context._meta.bodyTags += this._renderSSRContainer();\n }\n\n private _renderSSRContainer() {\n const contentModules = this._renderSSRModules();\n return `<div id=\"zova-svg-container\" style=\"position: absolute; width: 0px; height: 0px; display: none;\">${contentModules}</div>`;\n }\n\n private _renderSSRModules() {\n return Object.keys(this._iconSSR)\n .map(moduleName => {\n const moduleId = `zova-svg-module-${moduleName}`;\n const contentGroups = this._renderSSRGroups(this._iconSSR[moduleName], moduleName);\n return `<div id=\"${moduleId}\">${contentGroups}</div>`;\n })\n .join('');\n }\n\n private _renderSSRGroups(iconSSRGroups: Record<string, Record<string, string>>, moduleName: string) {\n return Object.keys(iconSSRGroups)\n .map(groupName => {\n const groupId = `zova-svg-group-${moduleName}-${groupName}`;\n const contentIcons = this._renderSSRIcons(iconSSRGroups[groupName]);\n return `<svg id=\"${groupId}\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:link=\"http://www.w3.org/1999/xlink\">${contentIcons}</svg>`;\n })\n .join('');\n }\n\n private _renderSSRIcons(iconSSRIcons: Record<string, string>) {\n return Object.keys(iconSSRIcons)\n .map(symbolId => {\n return iconSSRIcons[symbolId];\n })\n .join('');\n }\n\n private _injectIconSSR(meta: IIconMeta) {\n if (process.env.CLIENT) return;\n const iconModule = this.$$sysIcon.getIconModule(meta.module);\n const iconGroup = iconModule[meta.group];\n if (!this._iconSSR[meta.module]) this._iconSSR[meta.module] = {};\n if (!this._iconSSR[meta.module][meta.group]) this._iconSSR[meta.module][meta.group] = {};\n this._iconSSR[meta.module][meta.group][meta.symbolId] = this.$$sysIcon.extractIconContent(iconGroup.svg, meta.symbolId)!;\n }\n}\n","import { ref, watchEffect } from 'vue';\nimport { sys } from 'zova';\n\nimport type { IIconInfo, IIconRecord } from '../types/icon.js';\n\nexport function $getZovaIcon(iconName?: keyof IIconRecord): IIconInfo | undefined {\n return sys.meta.$icon.parseIconInfoSync(iconName);\n}\n\nexport function $useZovaIcon(iconGetter: () => keyof IIconRecord | undefined) {\n const iconInfo = ref<IIconInfo>();\n\n watchEffect(() => {\n iconInfo.value = $getZovaIcon(iconGetter());\n });\n\n return { iconInfo };\n}\n","import { BeanControllerBase, convertToUnit, isHttpUrl, Use } from 'zova';\nimport { Controller } from 'zova-module-a-bean';\n\nimport { ToolIcon } from '../../bean/tool.icon.js';\nimport { $getZovaIcon } from '../../lib/useZovaIcon.js';\nimport { IIconRecord } from '../../types/icon.js';\n\nexport interface ControllerIconProps {\n name?: keyof IIconRecord;\n href?: string;\n width?: string | number;\n height?: string | number;\n color?: string;\n}\n\n@Controller()\nexport class ControllerIcon extends BeanControllerBase {\n static $propsDefault = {};\n\n @Use()\n $$toolIcon: ToolIcon;\n\n protected async __init__() {\n await this._load();\n }\n\n private async _load() {\n const name = this.$props.name;\n if (name === ('none' as any) || !name) {\n return;\n }\n if (isHttpUrl(name)) {\n return;\n }\n const promise = this.$$toolIcon.parseIconInfo(name);\n if (process.env.SSR) {\n await promise;\n }\n }\n\n protected render() {\n // width/height\n const defaultSize = this.scope.config.icon.size;\n const width = this.$props.width ?? this.$props.height ?? defaultSize;\n const height = this.$props.height ?? this.$props.width ?? defaultSize;\n const href = this._parseHref();\n if (isHttpUrl(href) && !href?.endsWith('.svg')) {\n return (\n <img\n class=\"zova-icon__img\"\n style={{\n width: convertToUnit(width),\n height: convertToUnit(height),\n }}\n src={href}\n ></img>\n );\n }\n return (\n <svg\n class=\"zova-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n role=\"img\"\n aria-hidden=\"true\"\n width={width}\n height={height}\n style={{ color: this.$props.color }}\n >\n <use xlinkHref={href}></use>\n </svg>\n );\n }\n\n private _parseHref() {\n let href = this.$props.href;\n const name = this.$props.name;\n if (href) return href;\n if (isHttpUrl(name)) return name;\n // icon info\n const iconInfo = $getZovaIcon(name);\n // href\n href = `#${iconInfo?.symbolId || ''}`;\n return href;\n }\n}\n","import type { TypeControllerInnerProps } from 'zova';\n\nimport { defineComponent } from 'vue';\nimport { prepareComponentOptions, useController } from 'zova';\n\nimport type { ControllerIconProps } from '../../component/icon/controller.jsx';\n\nimport { ControllerIcon } from '../../component/icon/controller.jsx';\nexport type TypeControllerIconPublicProps = {\n controllerRef?: (ref: ControllerIcon) => void;\n} & ControllerIconProps;\n\ntype ControllerInnerProps = TypeControllerInnerProps<ControllerIconProps, keyof typeof ControllerIcon.$propsDefault>;\ndeclare module 'zova-module-a-icon' {\n export interface ControllerIcon {\n $props: ControllerInnerProps;\n }\n}\n\nexport const ZIcon = defineComponent((_props: TypeControllerIconPublicProps) => {\n useController(ControllerIcon, undefined, undefined);\n return () => {};\n}, prepareComponentOptions());\n","import type { IBeanScopeRecord, ZovaSys } from 'zova';\n\nexport const config = (_sys: ZovaSys) => {\n return {\n defaultModule: 'home-icon' as keyof IBeanScopeRecord,\n icon: {\n size: 24,\n },\n };\n};\n","import type { IMonkeySysInitialize } from 'zova';\n\nimport { BeanSimple } from 'zova';\n\nimport { SysIcon } from './bean/sys.icon.js';\n\nexport class MonkeySys extends BeanSimple implements IMonkeySysInitialize {\n async sysInitialize() {\n // $icon\n this.sys.meta.$icon = await this.bean._getBean(SysIcon, false);\n }\n}\n","// eslint-disable\n/** sys: begin */\nexport * from '../bean/sys.icon.js';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-icon' {\n \n export interface SysIcon {\n /** @internal */\n get scope(): ScopeModuleAIcon;\n }\n\n export interface SysIcon {\n get $beanFullName(): 'a-icon.sys.icon';\n get $onionName(): 'a-icon:icon';\n \n } \n}\n/** sys: end */\n/** sys: begin */\nimport { SysIcon } from '../bean/sys.icon.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-icon.sys.icon': SysIcon;\n }\n}\n/** sys: end */\n/** tool: begin */\nexport * from '../bean/tool.icon.js';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-icon' {\n \n export interface ToolIcon {\n /** @internal */\n get scope(): ScopeModuleAIcon;\n }\n\n export interface ToolIcon {\n get $beanFullName(): 'a-icon.tool.icon';\n get $onionName(): 'a-icon:icon';\n \n } \n}\n/** tool: end */\n/** tool: begin */\nimport { ToolIcon } from '../bean/tool.icon.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-icon.tool.icon': ToolIcon;\n }\n}\n/** tool: end */\n/** controller: begin */\nexport * from '../component/icon/controller.jsx';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-icon' {\n \n export interface ControllerIcon {\n /** @internal */\n get scope(): ScopeModuleAIcon;\n } \n}\n/** controller: end */\n/** controller: begin */\nimport { ControllerIcon } from '../component/icon/controller.jsx';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordLocal {\n 'a-icon.controller.icon': ControllerIcon;\n }\n}\n/** controller: end */\n\n/** components: begin */\nexport * from './component/icon.js';\nimport { ZIcon } from './component/icon.js';\nexport const components = {\n 'icon': ZIcon,\n};\nimport 'zova';\ndeclare module 'zova' {\nexport interface IComponentRecord {\n 'a-icon:icon': ControllerIcon;\n}\nexport interface IZovaComponentRecord {\n 'a-icon:icon': typeof ZIcon;\n}\n}\n/** components: end */\n/** config: begin */\nexport * from '../config/config.js';\nimport { config } from '../config/config.js';\n/** config: end */\n/** monkeySys: begin */\nexport * from '../monkeySys.js';\n/** monkeySys: end */\n/** scope: begin */\nimport { BeanScopeBase, type BeanScopeUtil, TypeModuleConfig } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\n\n@Scope()\nexport class ScopeModuleAIcon extends BeanScopeBase {}\n\nexport interface ScopeModuleAIcon {\n util: BeanScopeUtil;\nconfig: TypeModuleConfig<typeof config>;\n}\n\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanScopeRecord {\n 'a-icon': ScopeModuleAIcon;\n }\n \n export interface IBeanScopeConfig {\n 'a-icon': ReturnType<typeof config>;\n }\n\n \n\n \n}\n \n/** scope: end */\n","import type { VNode } from 'vue';\n\nimport { createVNode } from 'vue';\n\nimport type { IIconRecord } from '../types/icon.js';\n\nimport { ZIcon } from '../.metadata/index.js';\n\nexport function $icon<K extends keyof IIconRecord>(name: K, size?: string | number, color?: string): VNode {\n return createVNode(ZIcon, {\n name,\n color,\n width: size,\n height: size,\n });\n}\n\nexport function $iconName<K extends keyof IIconRecord>(name: K): K {\n return name;\n}\n"],"mappings":";;;;;CAEA,cAAa;AACX,OAAO,MAAK,KAAM;AAClB,OAAO,SAAQ,KAAA;;;;;;ACJjB,IAAA,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A9B,kBAAAI,cAAA2B,0BAAAhC,QAAAiC,WAAA,cAAA,CAAAvC,OAAAC,MAAA,EAAA;CAAAuC,cAAA;CAAAC,YAAA;CAAAC,UAAA;CAAAC,aAAA;CAAA,CAAA,EAAArC,SAAA,IAAAD,SAAA,IAAAA;;;ACd3B,IAAS,QAAA,iBAAyB,WAAa;;AAE/C,cAAc;;;;ACLd,IAAa,UAAC,SAAgB;;EAE9B,eAAmB;EACjB,MAAO,EACL,MAAA,IACA;EACD;;;;ACJH,IAAS,YAAT,cAA4B,WAAK;;;;;;;;;ACFjC,IAAG,MAAO,OAAA;AA+BV,IAAa,aAAC,EACZ,QAAQ,OACV;AAYA,IAAQ,oBAAA,OAAA,OAAA,EAAA,QAAA,SAAA,EAAA,QAAA,UAEP,CAAC,EAAE,KAAI,SAAO,MAAS,SAAS,MAAC,yBAAA,cAAA,GAAA,IAAA,OAAA,IAAA;;;;AC7ClC,SAAS,MAAa,MAAM,MAAK,OAAA;;EAEjC;;EAEA,OAAS;;EAET,CAAA;;AAEA,SAAQ,UAAA,MAAA;AACN,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-icon",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Zova Module"
|
|
7
|
+
],
|
|
8
|
+
"author": "",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"mock",
|
|
12
|
+
"rest",
|
|
13
|
+
"src",
|
|
14
|
+
"icons",
|
|
15
|
+
"assets"
|
|
16
|
+
],
|
|
4
17
|
"type": "module",
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"access": "public"
|
|
7
|
-
},
|
|
8
18
|
"exports": {
|
|
9
19
|
".": {
|
|
10
20
|
"types": [
|
|
11
21
|
"./src/index.ts",
|
|
12
22
|
"./dist/index.d.ts"
|
|
13
23
|
],
|
|
14
|
-
"
|
|
15
|
-
"import": "./dist/index.js",
|
|
16
|
-
"default": "./src/index.ts"
|
|
24
|
+
"default": "./dist/index.js"
|
|
17
25
|
},
|
|
18
|
-
"
|
|
26
|
+
"./*": "./*"
|
|
19
27
|
},
|
|
20
|
-
"description": "",
|
|
21
|
-
"files": [
|
|
22
|
-
"dist",
|
|
23
|
-
"static",
|
|
24
|
-
"typings"
|
|
25
|
-
],
|
|
26
28
|
"scripts": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
29
|
+
"clean": "rimraf dist tsconfig.build.tsbuildinfo",
|
|
30
|
+
"tsc:publish": "npm run clean && zova :bin:buildModule --sourcemap",
|
|
31
|
+
"prepublishOnly": "npm run tsc:publish",
|
|
32
|
+
"prepack": "clean-package",
|
|
33
|
+
"postpack": "clean-package restore && npm run clean"
|
|
31
34
|
},
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
"title": "a-icon",
|
|
36
|
+
"zovaModule": {
|
|
37
|
+
"capabilities": {
|
|
38
|
+
"monkey": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"gitHead": "bf1ceb4582381c74ba41ccf11b89d3b9e7b73628"
|
|
37
42
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TypeRenderComponentJsxPropsPublic } from 'zova-jsx';
|
|
2
|
+
|
|
3
|
+
import type { ControllerIconProps } from '../../src/component/icon/controller.jsx';
|
|
4
|
+
|
|
5
|
+
type TypeControllerIconPublicProps = TypeRenderComponentJsxPropsPublic & ControllerIconProps;
|
|
6
|
+
export function ZZIcon(_props: TypeControllerIconPublicProps) {
|
|
7
|
+
return 'a-icon:icon';
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component/icon.js';
|
package/rest/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TypeControllerInnerProps } from 'zova';
|
|
2
|
+
|
|
3
|
+
import { defineComponent } from 'vue';
|
|
4
|
+
import { prepareComponentOptions, useController } from 'zova';
|
|
5
|
+
|
|
6
|
+
import type { ControllerIconProps } from '../../component/icon/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import { ControllerIcon } from '../../component/icon/controller.jsx';
|
|
9
|
+
export type TypeControllerIconPublicProps = {
|
|
10
|
+
controllerRef?: (ref: ControllerIcon) => void;
|
|
11
|
+
} & ControllerIconProps;
|
|
12
|
+
|
|
13
|
+
type ControllerInnerProps = TypeControllerInnerProps<ControllerIconProps, keyof typeof ControllerIcon.$propsDefault>;
|
|
14
|
+
declare module 'zova-module-a-icon' {
|
|
15
|
+
export interface ControllerIcon {
|
|
16
|
+
$props: ControllerInnerProps;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const ZIcon = defineComponent((_props: TypeControllerIconPublicProps) => {
|
|
21
|
+
useController(ControllerIcon, undefined, undefined);
|
|
22
|
+
return () => {};
|
|
23
|
+
}, prepareComponentOptions());
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// eslint-disable
|
|
2
|
+
/** sys: begin */
|
|
3
|
+
export * from '../bean/sys.icon.js';
|
|
4
|
+
|
|
5
|
+
import 'zova';
|
|
6
|
+
declare module 'zova' {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
declare module 'zova-module-a-icon' {
|
|
11
|
+
|
|
12
|
+
export interface SysIcon {
|
|
13
|
+
/** @internal */
|
|
14
|
+
get scope(): ScopeModuleAIcon;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface SysIcon {
|
|
18
|
+
get $beanFullName(): 'a-icon.sys.icon';
|
|
19
|
+
get $onionName(): 'a-icon:icon';
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** sys: end */
|
|
24
|
+
/** sys: begin */
|
|
25
|
+
import { SysIcon } from '../bean/sys.icon.js';
|
|
26
|
+
import 'zova';
|
|
27
|
+
declare module 'zova' {
|
|
28
|
+
export interface IBeanRecordGeneral {
|
|
29
|
+
'a-icon.sys.icon': SysIcon;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** sys: end */
|
|
33
|
+
/** tool: begin */
|
|
34
|
+
export * from '../bean/tool.icon.js';
|
|
35
|
+
|
|
36
|
+
import 'zova';
|
|
37
|
+
declare module 'zova' {
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
declare module 'zova-module-a-icon' {
|
|
42
|
+
|
|
43
|
+
export interface ToolIcon {
|
|
44
|
+
/** @internal */
|
|
45
|
+
get scope(): ScopeModuleAIcon;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ToolIcon {
|
|
49
|
+
get $beanFullName(): 'a-icon.tool.icon';
|
|
50
|
+
get $onionName(): 'a-icon:icon';
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** tool: end */
|
|
55
|
+
/** tool: begin */
|
|
56
|
+
import { ToolIcon } from '../bean/tool.icon.js';
|
|
57
|
+
import 'zova';
|
|
58
|
+
declare module 'zova' {
|
|
59
|
+
export interface IBeanRecordGeneral {
|
|
60
|
+
'a-icon.tool.icon': ToolIcon;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** tool: end */
|
|
64
|
+
/** controller: begin */
|
|
65
|
+
export * from '../component/icon/controller.jsx';
|
|
66
|
+
|
|
67
|
+
import 'zova';
|
|
68
|
+
declare module 'zova' {
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
declare module 'zova-module-a-icon' {
|
|
73
|
+
|
|
74
|
+
export interface ControllerIcon {
|
|
75
|
+
/** @internal */
|
|
76
|
+
get scope(): ScopeModuleAIcon;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** controller: end */
|
|
80
|
+
/** controller: begin */
|
|
81
|
+
import { ControllerIcon } from '../component/icon/controller.jsx';
|
|
82
|
+
import 'zova';
|
|
83
|
+
declare module 'zova' {
|
|
84
|
+
export interface IBeanRecordLocal {
|
|
85
|
+
'a-icon.controller.icon': ControllerIcon;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** controller: end */
|
|
89
|
+
|
|
90
|
+
/** components: begin */
|
|
91
|
+
export * from './component/icon.js';
|
|
92
|
+
import { ZIcon } from './component/icon.js';
|
|
93
|
+
export const components = {
|
|
94
|
+
'icon': ZIcon,
|
|
95
|
+
};
|
|
96
|
+
import 'zova';
|
|
97
|
+
declare module 'zova' {
|
|
98
|
+
export interface IComponentRecord {
|
|
99
|
+
'a-icon:icon': ControllerIcon;
|
|
100
|
+
}
|
|
101
|
+
export interface IZovaComponentRecord {
|
|
102
|
+
'a-icon:icon': typeof ZIcon;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** components: end */
|
|
106
|
+
/** config: begin */
|
|
107
|
+
export * from '../config/config.js';
|
|
108
|
+
import { config } from '../config/config.js';
|
|
109
|
+
/** config: end */
|
|
110
|
+
/** monkeySys: begin */
|
|
111
|
+
export * from '../monkeySys.js';
|
|
112
|
+
/** monkeySys: end */
|
|
113
|
+
/** scope: begin */
|
|
114
|
+
import { BeanScopeBase, type BeanScopeUtil, TypeModuleConfig } from 'zova';
|
|
115
|
+
import { Scope } from 'zova-module-a-bean';
|
|
116
|
+
|
|
117
|
+
@Scope()
|
|
118
|
+
export class ScopeModuleAIcon extends BeanScopeBase {}
|
|
119
|
+
|
|
120
|
+
export interface ScopeModuleAIcon {
|
|
121
|
+
util: BeanScopeUtil;
|
|
122
|
+
config: TypeModuleConfig<typeof config>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
import 'zova';
|
|
126
|
+
declare module 'zova' {
|
|
127
|
+
export interface IBeanScopeRecord {
|
|
128
|
+
'a-icon': ScopeModuleAIcon;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface IBeanScopeConfig {
|
|
132
|
+
'a-icon': ReturnType<typeof config>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** scope: end */
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { reactive } from 'vue';
|
|
2
|
+
import { BeanBase } from 'zova';
|
|
3
|
+
import { Sys } from 'zova-module-a-bean';
|
|
4
|
+
|
|
5
|
+
import { IconGroup } from '../lib/iconGroup.js';
|
|
6
|
+
import { IIconInfo, IIconMeta, TypeIconModules, TypeIconSymbols } from '../types/icon.js';
|
|
7
|
+
|
|
8
|
+
const XMLNS = 'http://www.w3.org/2000/svg';
|
|
9
|
+
const XMLNS_LINK = 'http://www.w3.org/1999/xlink';
|
|
10
|
+
|
|
11
|
+
@Sys()
|
|
12
|
+
export class SysIcon extends BeanBase {
|
|
13
|
+
protected _iconSymbols: TypeIconSymbols = reactive({});
|
|
14
|
+
protected _iconMoudles: TypeIconModules = {};
|
|
15
|
+
|
|
16
|
+
// undefined: ignore
|
|
17
|
+
// '': empty icon
|
|
18
|
+
parseIconInfoSync(iconName?: string): IIconInfo | undefined {
|
|
19
|
+
// parts
|
|
20
|
+
const meta = this.parseIconMeta(iconName);
|
|
21
|
+
if (!meta) return undefined;
|
|
22
|
+
// empty
|
|
23
|
+
const iconEmpty = { meta, symbolId: '' };
|
|
24
|
+
// ok
|
|
25
|
+
const iconOk = { meta, symbolId: meta.symbolId };
|
|
26
|
+
// check if exists
|
|
27
|
+
if (this._iconSymbols[meta.fullName]) return iconOk;
|
|
28
|
+
// check if dom exists
|
|
29
|
+
if (process.env.CLIENT) {
|
|
30
|
+
const domIcon = document.getElementById(meta.symbolId) as unknown as SVGElement;
|
|
31
|
+
if (domIcon) return iconOk;
|
|
32
|
+
}
|
|
33
|
+
// check if exists
|
|
34
|
+
if (this._iconSymbols[meta.fullName] === undefined) {
|
|
35
|
+
this.parseIconInfo(iconName);
|
|
36
|
+
return iconEmpty;
|
|
37
|
+
} else if (this._iconSymbols[meta.fullName] === '') {
|
|
38
|
+
return iconEmpty;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async parseIconInfo(iconName?: string): Promise<IIconInfo | undefined> {
|
|
43
|
+
// parts
|
|
44
|
+
const meta = this.parseIconMeta(iconName);
|
|
45
|
+
if (!meta) return undefined;
|
|
46
|
+
// check if exists
|
|
47
|
+
if (this._iconSymbols[meta.fullName]) {
|
|
48
|
+
return { meta, symbolId: this._iconSymbols[meta.fullName] };
|
|
49
|
+
}
|
|
50
|
+
// pre set
|
|
51
|
+
this._iconSymbols[meta.fullName] = '';
|
|
52
|
+
// icon group
|
|
53
|
+
const iconGroup = await this.parseIconGroup(meta.module, meta.group);
|
|
54
|
+
if (!iconGroup) return undefined;
|
|
55
|
+
// icon inject
|
|
56
|
+
this._injectIconClient(meta);
|
|
57
|
+
const symbolId = (this._iconSymbols[meta.fullName] = meta.symbolId);
|
|
58
|
+
// ok
|
|
59
|
+
return { meta, symbolId };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public async parseIconGroup(moduleName: string, groupName: string): Promise<string | undefined> {
|
|
63
|
+
// check if exists
|
|
64
|
+
const iconModule = this.getIconModule(moduleName);
|
|
65
|
+
if (iconModule[groupName]) {
|
|
66
|
+
await iconModule[groupName].loaded.wait();
|
|
67
|
+
return iconModule[groupName].svg;
|
|
68
|
+
}
|
|
69
|
+
// record
|
|
70
|
+
iconModule[groupName] = new IconGroup();
|
|
71
|
+
// parse
|
|
72
|
+
const svg = await this._parseIconGroupInner(moduleName, groupName);
|
|
73
|
+
// touch
|
|
74
|
+
iconModule[groupName].svg = svg;
|
|
75
|
+
iconModule[groupName].loaded.touch();
|
|
76
|
+
// ok
|
|
77
|
+
return iconModule[groupName].svg;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private async _parseIconGroupInner(moduleName: string, groupName: string): Promise<string | undefined> {
|
|
81
|
+
// module
|
|
82
|
+
const module = await this.sys.meta.module.use(moduleName);
|
|
83
|
+
if (!module) return;
|
|
84
|
+
// icons
|
|
85
|
+
const icons = module.resource.icons;
|
|
86
|
+
let groupUrl = icons[groupName];
|
|
87
|
+
if (!groupUrl) return;
|
|
88
|
+
// inline
|
|
89
|
+
if (groupUrl.startsWith('data:image/svg+xml')) throw new Error('inline svg not supported');
|
|
90
|
+
// fetch
|
|
91
|
+
let svg;
|
|
92
|
+
if (process.env.SERVER) {
|
|
93
|
+
// publicPath
|
|
94
|
+
groupUrl = this.sys.util.getPagePathFromAbsoluteUrl(groupUrl);
|
|
95
|
+
const path = await import('node:path');
|
|
96
|
+
const fs = await import('node:fs/promises');
|
|
97
|
+
let filePath: string;
|
|
98
|
+
if (process.env.DEV) {
|
|
99
|
+
filePath = path.join(process.cwd(), groupUrl);
|
|
100
|
+
} else {
|
|
101
|
+
const { fileURLToPath } = await import('node:url');
|
|
102
|
+
const rootFolder = fileURLToPath(new URL(/* @vite-ignore */ '.', import.meta.url));
|
|
103
|
+
filePath = path.join(rootFolder, 'client', groupUrl);
|
|
104
|
+
}
|
|
105
|
+
svg = await fs.readFile(filePath, { encoding: 'utf8' });
|
|
106
|
+
} else {
|
|
107
|
+
const res = await fetch(groupUrl);
|
|
108
|
+
if (!res.ok) return;
|
|
109
|
+
svg = await res.text();
|
|
110
|
+
}
|
|
111
|
+
return svg;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
private _injectIconClient(meta: IIconMeta) {
|
|
115
|
+
if (process.env.SERVER) return;
|
|
116
|
+
// client
|
|
117
|
+
const iconModule = this.getIconModule(meta.module);
|
|
118
|
+
const iconGroup = iconModule[meta.group];
|
|
119
|
+
// inject container
|
|
120
|
+
let domContainer = document.getElementById('zova-svg-container');
|
|
121
|
+
if (!domContainer) {
|
|
122
|
+
domContainer = document.createElement('div');
|
|
123
|
+
domContainer.style.position = 'absolute';
|
|
124
|
+
domContainer.style.width = '0';
|
|
125
|
+
domContainer.style.height = '0';
|
|
126
|
+
domContainer.style.display = 'none';
|
|
127
|
+
domContainer.id = 'zova-svg-container';
|
|
128
|
+
document.body.appendChild(domContainer);
|
|
129
|
+
}
|
|
130
|
+
// inject module
|
|
131
|
+
let domModule = document.getElementById(`zova-svg-module-${meta.module}`);
|
|
132
|
+
if (!domModule) {
|
|
133
|
+
domModule = document.createElement('div');
|
|
134
|
+
domModule.id = `zova-svg-module-${meta.module}`;
|
|
135
|
+
domContainer.appendChild(domModule);
|
|
136
|
+
}
|
|
137
|
+
// inject group
|
|
138
|
+
let domGroup = document.getElementById(`zova-svg-group-${meta.module}-${meta.group}`) as unknown as SVGSVGElement;
|
|
139
|
+
if (!domGroup) {
|
|
140
|
+
domGroup = document.createElementNS(XMLNS, 'svg');
|
|
141
|
+
domGroup.id = `zova-svg-group-${meta.module}-${meta.group}`;
|
|
142
|
+
domGroup.setAttribute('xmlns', XMLNS);
|
|
143
|
+
domGroup.setAttribute('xmlns:link', XMLNS_LINK);
|
|
144
|
+
domModule.appendChild(domGroup);
|
|
145
|
+
}
|
|
146
|
+
// inject icon
|
|
147
|
+
const domIcon = document.getElementById(meta.symbolId) as unknown as SVGElement;
|
|
148
|
+
if (!domIcon) {
|
|
149
|
+
const iconContent = this.extractIconContent(iconGroup.svg, meta.symbolId);
|
|
150
|
+
if (iconContent) {
|
|
151
|
+
domGroup.insertAdjacentHTML('beforeend', iconContent);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
extractIconContent(svg: string | undefined, symbolId: string) {
|
|
157
|
+
if (!svg) return undefined;
|
|
158
|
+
let pos = svg.indexOf(`'${symbolId}'`);
|
|
159
|
+
if (pos === -1) pos = svg.indexOf(`"${symbolId}"`);
|
|
160
|
+
if (pos === -1) return undefined;
|
|
161
|
+
const posB = svg.indexOf('</symbol>', pos);
|
|
162
|
+
const posA = svg.lastIndexOf('<symbol', pos);
|
|
163
|
+
return svg.substring(posA, posB + '</symbol>'.length);
|
|
164
|
+
// const symbolPattern = new RegExp(`<symbol.*?id=['"]${symbolId}['"].*?>.*?</symbol>`);
|
|
165
|
+
// const matched = symbolPattern.exec(svg || '');
|
|
166
|
+
// return matched && matched[0];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
getIconModule(moduleName: string) {
|
|
170
|
+
if (!this._iconMoudles[moduleName]) {
|
|
171
|
+
this._iconMoudles[moduleName] = {};
|
|
172
|
+
}
|
|
173
|
+
return this._iconMoudles[moduleName];
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
parseIconMeta(iconName?: string): IIconMeta | undefined {
|
|
177
|
+
if (!iconName) return;
|
|
178
|
+
// split module:group:name
|
|
179
|
+
const parts = iconName.split(':');
|
|
180
|
+
if (parts.length !== 3) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const module = parts[0] || this.scope.config.defaultModule;
|
|
184
|
+
const group = parts[1] || 'default';
|
|
185
|
+
const name = parts[2] || '';
|
|
186
|
+
if (!module.includes('-') || !name) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
module,
|
|
191
|
+
group,
|
|
192
|
+
name,
|
|
193
|
+
fullName: this._getFullName(module, group, name),
|
|
194
|
+
symbolId: this._getSymbolId(module, group, name),
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
private _getSymbolId(module: string, group: string, name: string) {
|
|
199
|
+
return `zova-svg-icon-${module}-${group}-${name}`;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
private _getFullName(module: string, group: string, name: string) {
|
|
203
|
+
return `${module}:${group}:${name}`;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { BeanBase, Use } from 'zova';
|
|
2
|
+
import { Tool } from 'zova-module-a-bean';
|
|
3
|
+
|
|
4
|
+
import { IIconInfo, IIconMeta } from '../types/icon.js';
|
|
5
|
+
import { SysIcon } from './sys.icon.js';
|
|
6
|
+
|
|
7
|
+
@Tool()
|
|
8
|
+
export class ToolIcon extends BeanBase {
|
|
9
|
+
private _iconSSR: Record<string, Record<string, Record<string, string>>> = {};
|
|
10
|
+
|
|
11
|
+
@Use()
|
|
12
|
+
private $$sysIcon: SysIcon;
|
|
13
|
+
|
|
14
|
+
protected async __init__() {
|
|
15
|
+
if (process.env.SERVER) {
|
|
16
|
+
this.ctx.meta.$ssr.context.onRendered((err?: Error) => {
|
|
17
|
+
if (err) return;
|
|
18
|
+
this._onRendered();
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async parseIconInfo(iconName?: string): Promise<IIconInfo | undefined> {
|
|
24
|
+
const iconInfo = await this.$$sysIcon.parseIconInfo(iconName);
|
|
25
|
+
if (!iconInfo) return iconInfo;
|
|
26
|
+
this._injectIconSSR(iconInfo.meta);
|
|
27
|
+
return iconInfo;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private _onRendered() {
|
|
31
|
+
this.ctx.meta.$ssr.context._meta.bodyTags += this._renderSSRContainer();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private _renderSSRContainer() {
|
|
35
|
+
const contentModules = this._renderSSRModules();
|
|
36
|
+
return `<div id="zova-svg-container" style="position: absolute; width: 0px; height: 0px; display: none;">${contentModules}</div>`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private _renderSSRModules() {
|
|
40
|
+
return Object.keys(this._iconSSR)
|
|
41
|
+
.map(moduleName => {
|
|
42
|
+
const moduleId = `zova-svg-module-${moduleName}`;
|
|
43
|
+
const contentGroups = this._renderSSRGroups(this._iconSSR[moduleName], moduleName);
|
|
44
|
+
return `<div id="${moduleId}">${contentGroups}</div>`;
|
|
45
|
+
})
|
|
46
|
+
.join('');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private _renderSSRGroups(iconSSRGroups: Record<string, Record<string, string>>, moduleName: string) {
|
|
50
|
+
return Object.keys(iconSSRGroups)
|
|
51
|
+
.map(groupName => {
|
|
52
|
+
const groupId = `zova-svg-group-${moduleName}-${groupName}`;
|
|
53
|
+
const contentIcons = this._renderSSRIcons(iconSSRGroups[groupName]);
|
|
54
|
+
return `<svg id="${groupId}" xmlns="http://www.w3.org/2000/svg" xmlns:link="http://www.w3.org/1999/xlink">${contentIcons}</svg>`;
|
|
55
|
+
})
|
|
56
|
+
.join('');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private _renderSSRIcons(iconSSRIcons: Record<string, string>) {
|
|
60
|
+
return Object.keys(iconSSRIcons)
|
|
61
|
+
.map(symbolId => {
|
|
62
|
+
return iconSSRIcons[symbolId];
|
|
63
|
+
})
|
|
64
|
+
.join('');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private _injectIconSSR(meta: IIconMeta) {
|
|
68
|
+
if (process.env.CLIENT) return;
|
|
69
|
+
const iconModule = this.$$sysIcon.getIconModule(meta.module);
|
|
70
|
+
const iconGroup = iconModule[meta.group];
|
|
71
|
+
if (!this._iconSSR[meta.module]) this._iconSSR[meta.module] = {};
|
|
72
|
+
if (!this._iconSSR[meta.module][meta.group]) this._iconSSR[meta.module][meta.group] = {};
|
|
73
|
+
this._iconSSR[meta.module][meta.group][meta.symbolId] = this.$$sysIcon.extractIconContent(iconGroup.svg, meta.symbolId)!;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { BeanControllerBase, convertToUnit, isHttpUrl, Use } from 'zova';
|
|
2
|
+
import { Controller } from 'zova-module-a-bean';
|
|
3
|
+
|
|
4
|
+
import { ToolIcon } from '../../bean/tool.icon.js';
|
|
5
|
+
import { $getZovaIcon } from '../../lib/useZovaIcon.js';
|
|
6
|
+
import { IIconRecord } from '../../types/icon.js';
|
|
7
|
+
|
|
8
|
+
export interface ControllerIconProps {
|
|
9
|
+
name?: keyof IIconRecord;
|
|
10
|
+
href?: string;
|
|
11
|
+
width?: string | number;
|
|
12
|
+
height?: string | number;
|
|
13
|
+
color?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Controller()
|
|
17
|
+
export class ControllerIcon extends BeanControllerBase {
|
|
18
|
+
static $propsDefault = {};
|
|
19
|
+
|
|
20
|
+
@Use()
|
|
21
|
+
$$toolIcon: ToolIcon;
|
|
22
|
+
|
|
23
|
+
protected async __init__() {
|
|
24
|
+
await this._load();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private async _load() {
|
|
28
|
+
const name = this.$props.name;
|
|
29
|
+
if (name === ('none' as any) || !name) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (isHttpUrl(name)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const promise = this.$$toolIcon.parseIconInfo(name);
|
|
36
|
+
if (process.env.SSR) {
|
|
37
|
+
await promise;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
protected render() {
|
|
42
|
+
// width/height
|
|
43
|
+
const defaultSize = this.scope.config.icon.size;
|
|
44
|
+
const width = this.$props.width ?? this.$props.height ?? defaultSize;
|
|
45
|
+
const height = this.$props.height ?? this.$props.width ?? defaultSize;
|
|
46
|
+
const href = this._parseHref();
|
|
47
|
+
if (isHttpUrl(href) && !href?.endsWith('.svg')) {
|
|
48
|
+
return (
|
|
49
|
+
<img
|
|
50
|
+
class="zova-icon__img"
|
|
51
|
+
style={{
|
|
52
|
+
width: convertToUnit(width),
|
|
53
|
+
height: convertToUnit(height),
|
|
54
|
+
}}
|
|
55
|
+
src={href}
|
|
56
|
+
></img>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
return (
|
|
60
|
+
<svg
|
|
61
|
+
class="zova-icon__svg"
|
|
62
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
63
|
+
viewBox="0 0 24 24"
|
|
64
|
+
fill="currentColor"
|
|
65
|
+
role="img"
|
|
66
|
+
aria-hidden="true"
|
|
67
|
+
width={width}
|
|
68
|
+
height={height}
|
|
69
|
+
style={{ color: this.$props.color }}
|
|
70
|
+
>
|
|
71
|
+
<use xlinkHref={href}></use>
|
|
72
|
+
</svg>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private _parseHref() {
|
|
77
|
+
let href = this.$props.href;
|
|
78
|
+
const name = this.$props.name;
|
|
79
|
+
if (href) return href;
|
|
80
|
+
if (isHttpUrl(name)) return name;
|
|
81
|
+
// icon info
|
|
82
|
+
const iconInfo = $getZovaIcon(name);
|
|
83
|
+
// href
|
|
84
|
+
href = `#${iconInfo?.symbolId || ''}`;
|
|
85
|
+
return href;
|
|
86
|
+
}
|
|
87
|
+
}
|
package/src/index.ts
ADDED
package/src/lib/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ref, watchEffect } from 'vue';
|
|
2
|
+
import { sys } from 'zova';
|
|
3
|
+
|
|
4
|
+
import type { IIconInfo, IIconRecord } from '../types/icon.js';
|
|
5
|
+
|
|
6
|
+
export function $getZovaIcon(iconName?: keyof IIconRecord): IIconInfo | undefined {
|
|
7
|
+
return sys.meta.$icon.parseIconInfoSync(iconName);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function $useZovaIcon(iconGetter: () => keyof IIconRecord | undefined) {
|
|
11
|
+
const iconInfo = ref<IIconInfo>();
|
|
12
|
+
|
|
13
|
+
watchEffect(() => {
|
|
14
|
+
iconInfo.value = $getZovaIcon(iconGetter());
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
return { iconInfo };
|
|
18
|
+
}
|
package/src/lib/utils.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
import { createVNode } from 'vue';
|
|
4
|
+
|
|
5
|
+
import type { IIconRecord } from '../types/icon.js';
|
|
6
|
+
|
|
7
|
+
import { ZIcon } from '../.metadata/index.js';
|
|
8
|
+
|
|
9
|
+
export function $icon<K extends keyof IIconRecord>(name: K, size?: string | number, color?: string): VNode {
|
|
10
|
+
return createVNode(ZIcon, {
|
|
11
|
+
name,
|
|
12
|
+
color,
|
|
13
|
+
width: size,
|
|
14
|
+
height: size,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function $iconName<K extends keyof IIconRecord>(name: K): K {
|
|
19
|
+
return name;
|
|
20
|
+
}
|
package/src/monkeySys.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IMonkeySysInitialize } from 'zova';
|
|
2
|
+
|
|
3
|
+
import { BeanSimple } from 'zova';
|
|
4
|
+
|
|
5
|
+
import { SysIcon } from './bean/sys.icon.js';
|
|
6
|
+
|
|
7
|
+
export class MonkeySys extends BeanSimple implements IMonkeySysInitialize {
|
|
8
|
+
async sysInitialize() {
|
|
9
|
+
// $icon
|
|
10
|
+
this.sys.meta.$icon = await this.bean._getBean(SysIcon, false);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SysIcon } from '../bean/sys.icon.js';
|
|
2
|
+
import type { IconGroup } from '../lib/iconGroup.js';
|
|
3
|
+
|
|
4
|
+
export interface IIconRecord {}
|
|
5
|
+
|
|
6
|
+
export interface IIconMeta {
|
|
7
|
+
module: string;
|
|
8
|
+
group: string;
|
|
9
|
+
name: string;
|
|
10
|
+
fullName: string;
|
|
11
|
+
symbolId: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface IIconInfo {
|
|
15
|
+
meta: IIconMeta;
|
|
16
|
+
symbolId: string; // '' or valid icon
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type TypeIconGroups = Record<string, IconGroup>;
|
|
20
|
+
export type TypeIconModules = Record<string, TypeIconGroups>;
|
|
21
|
+
export type TypeIconSymbols = Record<string, string>;
|
|
22
|
+
|
|
23
|
+
declare module 'zova' {
|
|
24
|
+
export interface SysMeta {
|
|
25
|
+
$icon: SysIcon;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './icon.js';
|
package/README.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# @cabloy/set
|