@fangzhongya/icons 0.0.15 → 0.0.17
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/dist/{vue.cjs → async.cjs} +23 -23
- package/dist/{vue.d.cts → async.d.cts} +20 -20
- package/dist/{vue.d.ts → async.d.ts} +20 -20
- package/dist/{vue.js → async.js} +23 -23
- package/dist/chunk-BKYM5ZD6.js +909 -0
- package/dist/{chunk-Y2JUP3JH.js → chunk-CDXRU53D.js} +4 -123
- package/dist/chunk-HSJ3RNOH.js +124 -0
- package/dist/chunk-OSHAEKZL.cjs +124 -0
- package/dist/{chunk-6UMRW5ES.cjs → chunk-P3DB3N7Y.cjs} +5 -124
- package/dist/chunk-V6F7B2R3.cjs +909 -0
- package/dist/iconify.cjs +2 -4
- package/dist/iconify.d.cts +1 -100
- package/dist/iconify.d.ts +1 -100
- package/dist/iconify.js +3 -5
- package/dist/index.cjs +17 -17
- package/dist/index.js +19 -19
- package/dist/index.json +1 -1
- package/dist/json.cjs +7 -0
- package/dist/json.d.cts +110 -0
- package/dist/json.d.ts +110 -0
- package/dist/json.js +7 -0
- package/dist/vite/index.cjs +293 -988
- package/dist/vite/index.d.cts +20 -1
- package/dist/vite/index.d.ts +20 -1
- package/dist/vite/index.js +298 -993
- package/dist/vite/index2.cjs +31 -9
- package/dist/vite/index2.d.cts +8 -7
- package/dist/vite/index2.d.ts +8 -7
- package/dist/vite/index2.js +32 -10
- package/dist/vite/index3.cjs +130 -0
- package/dist/vite/index3.d.cts +12 -0
- package/dist/vite/index3.d.ts +12 -0
- package/dist/vite/index3.js +130 -0
- package/dist/vue/index.cjs +16 -16
- package/dist/vue/index.js +19 -19
- package/package.json +2 -2
- package/dist/{chunk-3YRVWHZK.js → chunk-54HT4HDM.js} +18 -18
- package/dist/{chunk-BWFROGEZ.cjs → chunk-KXZN54UH.cjs} +15 -15
package/dist/vite/index2.cjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkOSHAEKZLcjs = require('../chunk-OSHAEKZL.cjs');
|
|
5
5
|
require('../chunk-IIVF4KK5.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkP3DB3N7Ycjs = require('../chunk-P3DB3N7Y.cjs');
|
|
6
9
|
require('../chunk-75ZPJI57.cjs');
|
|
7
10
|
|
|
8
11
|
// packages/vite/index2.ts
|
|
@@ -93,26 +96,38 @@ function findComponents(code, name) {
|
|
|
93
96
|
return components;
|
|
94
97
|
}
|
|
95
98
|
function getText(iconName, match) {
|
|
96
|
-
const svg =
|
|
99
|
+
const svg = _chunkOSHAEKZLcjs.getIconifySVG.call(void 0, _chunkP3DB3N7Ycjs.json_default, iconName, 'v-bind="scope"');
|
|
97
100
|
const s = match.fullMatch.replace(`name="${iconName}"`, "").replace(`name='${iconName}'`, "").replace(`</${match.componentName}>`, "");
|
|
98
101
|
const text = `${s}<template #default="scope">${svg}</template></${match.componentName}>`;
|
|
99
102
|
return { text, imptext: "" };
|
|
100
103
|
}
|
|
101
|
-
function
|
|
104
|
+
function getImportName(iconName) {
|
|
105
|
+
return _chunkOSHAEKZLcjs.lineToLargeHump.call(void 0, "fang-icon-" + iconName);
|
|
106
|
+
}
|
|
107
|
+
function getVue(iconName, match) {
|
|
108
|
+
const text = match.fullMatch.replace(`name="${iconName}"`, `:name="${getImportName(iconName)}"`).replace(`name='${iconName}'`, `:name='${getImportName(iconName)}'`);
|
|
109
|
+
return {
|
|
110
|
+
text,
|
|
111
|
+
imptext: `import ${getImportName(
|
|
112
|
+
iconName
|
|
113
|
+
)} from '@fangzhongya/icons/vue/${iconName}'`
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function replaceComponent(match, type, dynamic, customReplacement) {
|
|
102
117
|
const { attributes } = match;
|
|
103
118
|
const iconName = attributes.name;
|
|
104
119
|
if (customReplacement) {
|
|
105
120
|
return customReplacement(iconName, attributes);
|
|
106
121
|
}
|
|
107
|
-
let svgContent =
|
|
122
|
+
let svgContent = _chunkP3DB3N7Ycjs.json_default.icons[iconName];
|
|
108
123
|
if (!svgContent) {
|
|
109
124
|
return { text: match.fullMatch, imptext: "" };
|
|
110
125
|
}
|
|
111
|
-
if (!attributes.type || attributes.type === "svg") {
|
|
112
|
-
if (
|
|
113
|
-
return getText(iconName, match);
|
|
114
|
-
} else {
|
|
126
|
+
if (!attributes.type && type == "svg" || attributes.type === "svg") {
|
|
127
|
+
if (dynamic) {
|
|
115
128
|
return getVue(iconName, match);
|
|
129
|
+
} else {
|
|
130
|
+
return getText(iconName, match);
|
|
116
131
|
}
|
|
117
132
|
}
|
|
118
133
|
return { text: match.fullMatch, imptext: "" };
|
|
@@ -125,7 +140,12 @@ function shouldProcess(id) {
|
|
|
125
140
|
return true;
|
|
126
141
|
}
|
|
127
142
|
function simpleFangIcon(options) {
|
|
128
|
-
const {
|
|
143
|
+
const {
|
|
144
|
+
name = "FangIcon",
|
|
145
|
+
type = "svg",
|
|
146
|
+
dynamic = true,
|
|
147
|
+
customReplacement
|
|
148
|
+
} = options;
|
|
129
149
|
const targetComponents = Array.isArray(name) ? name : [name];
|
|
130
150
|
return {
|
|
131
151
|
name: "vite-plugin-fang-icon-replacer",
|
|
@@ -149,6 +169,8 @@ function simpleFangIcon(options) {
|
|
|
149
169
|
if (component) {
|
|
150
170
|
const { text, imptext } = replaceComponent(
|
|
151
171
|
component,
|
|
172
|
+
type,
|
|
173
|
+
dynamic,
|
|
152
174
|
customReplacement
|
|
153
175
|
);
|
|
154
176
|
imports.add(imptext);
|
package/dist/vite/index2.d.cts
CHANGED
|
@@ -16,13 +16,14 @@ type IconReplacement = (iconName: string, attributes: ComponentAttributes) => {
|
|
|
16
16
|
text: string;
|
|
17
17
|
imptext: string;
|
|
18
18
|
};
|
|
19
|
-
interface
|
|
20
|
-
name?: string
|
|
19
|
+
interface PluginOptions {
|
|
20
|
+
name?: string;
|
|
21
|
+
type?: string;
|
|
21
22
|
customReplacement?: IconReplacement;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
directory?: string;
|
|
24
|
+
mobile?: boolean;
|
|
25
|
+
dynamic?: boolean;
|
|
25
26
|
}
|
|
26
|
-
declare function simpleFangIcon(options:
|
|
27
|
+
declare function simpleFangIcon(options: PluginOptions): Plugin;
|
|
27
28
|
|
|
28
|
-
export { type ComponentAttributes, type ComponentMatchInfo, type
|
|
29
|
+
export { type ComponentAttributes, type ComponentMatchInfo, type IconReplacement, type PluginOptions, simpleFangIcon };
|
package/dist/vite/index2.d.ts
CHANGED
|
@@ -16,13 +16,14 @@ type IconReplacement = (iconName: string, attributes: ComponentAttributes) => {
|
|
|
16
16
|
text: string;
|
|
17
17
|
imptext: string;
|
|
18
18
|
};
|
|
19
|
-
interface
|
|
20
|
-
name?: string
|
|
19
|
+
interface PluginOptions {
|
|
20
|
+
name?: string;
|
|
21
|
+
type?: string;
|
|
21
22
|
customReplacement?: IconReplacement;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
directory?: string;
|
|
24
|
+
mobile?: boolean;
|
|
25
|
+
dynamic?: boolean;
|
|
25
26
|
}
|
|
26
|
-
declare function simpleFangIcon(options:
|
|
27
|
+
declare function simpleFangIcon(options: PluginOptions): Plugin;
|
|
27
28
|
|
|
28
|
-
export { type ComponentAttributes, type ComponentMatchInfo, type
|
|
29
|
+
export { type ComponentAttributes, type ComponentMatchInfo, type IconReplacement, type PluginOptions, simpleFangIcon };
|
package/dist/vite/index2.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getIconifySVG,
|
|
3
|
-
|
|
4
|
-
} from "../chunk-
|
|
3
|
+
lineToLargeHump
|
|
4
|
+
} from "../chunk-HSJ3RNOH.js";
|
|
5
5
|
import "../chunk-MOHILOKE.js";
|
|
6
|
+
import {
|
|
7
|
+
json_default
|
|
8
|
+
} from "../chunk-CDXRU53D.js";
|
|
6
9
|
import "../chunk-MLKGABMK.js";
|
|
7
10
|
|
|
8
11
|
// packages/vite/index2.ts
|
|
@@ -93,26 +96,38 @@ function findComponents(code, name) {
|
|
|
93
96
|
return components;
|
|
94
97
|
}
|
|
95
98
|
function getText(iconName, match) {
|
|
96
|
-
const svg = getIconifySVG(
|
|
99
|
+
const svg = getIconifySVG(json_default, iconName, 'v-bind="scope"');
|
|
97
100
|
const s = match.fullMatch.replace(`name="${iconName}"`, "").replace(`name='${iconName}'`, "").replace(`</${match.componentName}>`, "");
|
|
98
101
|
const text = `${s}<template #default="scope">${svg}</template></${match.componentName}>`;
|
|
99
102
|
return { text, imptext: "" };
|
|
100
103
|
}
|
|
101
|
-
function
|
|
104
|
+
function getImportName(iconName) {
|
|
105
|
+
return lineToLargeHump("fang-icon-" + iconName);
|
|
106
|
+
}
|
|
107
|
+
function getVue(iconName, match) {
|
|
108
|
+
const text = match.fullMatch.replace(`name="${iconName}"`, `:name="${getImportName(iconName)}"`).replace(`name='${iconName}'`, `:name='${getImportName(iconName)}'`);
|
|
109
|
+
return {
|
|
110
|
+
text,
|
|
111
|
+
imptext: `import ${getImportName(
|
|
112
|
+
iconName
|
|
113
|
+
)} from '@fangzhongya/icons/vue/${iconName}'`
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function replaceComponent(match, type, dynamic, customReplacement) {
|
|
102
117
|
const { attributes } = match;
|
|
103
118
|
const iconName = attributes.name;
|
|
104
119
|
if (customReplacement) {
|
|
105
120
|
return customReplacement(iconName, attributes);
|
|
106
121
|
}
|
|
107
|
-
let svgContent =
|
|
122
|
+
let svgContent = json_default.icons[iconName];
|
|
108
123
|
if (!svgContent) {
|
|
109
124
|
return { text: match.fullMatch, imptext: "" };
|
|
110
125
|
}
|
|
111
|
-
if (!attributes.type || attributes.type === "svg") {
|
|
112
|
-
if (
|
|
113
|
-
return getText(iconName, match);
|
|
114
|
-
} else {
|
|
126
|
+
if (!attributes.type && type == "svg" || attributes.type === "svg") {
|
|
127
|
+
if (dynamic) {
|
|
115
128
|
return getVue(iconName, match);
|
|
129
|
+
} else {
|
|
130
|
+
return getText(iconName, match);
|
|
116
131
|
}
|
|
117
132
|
}
|
|
118
133
|
return { text: match.fullMatch, imptext: "" };
|
|
@@ -125,7 +140,12 @@ function shouldProcess(id) {
|
|
|
125
140
|
return true;
|
|
126
141
|
}
|
|
127
142
|
function simpleFangIcon(options) {
|
|
128
|
-
const {
|
|
143
|
+
const {
|
|
144
|
+
name = "FangIcon",
|
|
145
|
+
type = "svg",
|
|
146
|
+
dynamic = true,
|
|
147
|
+
customReplacement
|
|
148
|
+
} = options;
|
|
129
149
|
const targetComponents = Array.isArray(name) ? name : [name];
|
|
130
150
|
return {
|
|
131
151
|
name: "vite-plugin-fang-icon-replacer",
|
|
@@ -149,6 +169,8 @@ function simpleFangIcon(options) {
|
|
|
149
169
|
if (component) {
|
|
150
170
|
const { text, imptext } = replaceComponent(
|
|
151
171
|
component,
|
|
172
|
+
type,
|
|
173
|
+
dynamic,
|
|
152
174
|
customReplacement
|
|
153
175
|
);
|
|
154
176
|
imports.add(imptext);
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkV6F7B2R3cjs = require('../chunk-V6F7B2R3.cjs');
|
|
4
|
+
require('../chunk-75ZPJI57.cjs');
|
|
5
|
+
|
|
6
|
+
// packages/vite/index3.ts
|
|
7
|
+
var _path = require('path');
|
|
8
|
+
var virtualModuleId = "virtual:fang-icon";
|
|
9
|
+
function simpleFangIcon(options = {}) {
|
|
10
|
+
const { name = "FangIcon", type = "svg", directory = "./svg" } = options;
|
|
11
|
+
const resolvedVirtualModuleId = "\0" + virtualModuleId;
|
|
12
|
+
if (type === "pub" && options.mobile) {
|
|
13
|
+
const outDir = _path.join.call(void 0, "./public/", directory);
|
|
14
|
+
console.log("outDir", outDir);
|
|
15
|
+
_chunkV6F7B2R3cjs.runDev.call(void 0, {
|
|
16
|
+
issort: true,
|
|
17
|
+
dir: "./node_modules/@fangzhongya/icons/dist/svg",
|
|
18
|
+
outDir,
|
|
19
|
+
extensions: ["svg"],
|
|
20
|
+
read: true,
|
|
21
|
+
fileCover: true,
|
|
22
|
+
isNeader: false
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const pub = `
|
|
26
|
+
import { defineComponent, h,} from 'vue'
|
|
27
|
+
import FangIcon from '@fangzhongya/icons/icon/index'
|
|
28
|
+
const component = defineComponent({
|
|
29
|
+
name: '${name}',
|
|
30
|
+
props: {
|
|
31
|
+
name: {
|
|
32
|
+
type: [String, Object],
|
|
33
|
+
},
|
|
34
|
+
default: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: '${type}'
|
|
37
|
+
},
|
|
38
|
+
directory: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: '${directory}'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
setup(props, { attrs }) {
|
|
44
|
+
return () => {
|
|
45
|
+
return h(FangIcon, {
|
|
46
|
+
...attrs,
|
|
47
|
+
name: props.name,
|
|
48
|
+
default: props.default,
|
|
49
|
+
directory: props.directory
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
// \u5BFC\u51FA\u5B89\u88C5\u51FD\u6570
|
|
55
|
+
export const install = (app) => {
|
|
56
|
+
app.component('${name}', component)
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default component;`;
|
|
60
|
+
const svg = `
|
|
61
|
+
import { defineComponent, h, computed} from 'vue'
|
|
62
|
+
import FangIcon from '@fangzhongya/icons/icon/index'
|
|
63
|
+
import icons from '@fangzhongya/icons/async'
|
|
64
|
+
const component = defineComponent({
|
|
65
|
+
name: '${name}',
|
|
66
|
+
props: {
|
|
67
|
+
name: {
|
|
68
|
+
type: [String, Object],
|
|
69
|
+
},
|
|
70
|
+
type: {
|
|
71
|
+
type: String,
|
|
72
|
+
},
|
|
73
|
+
default: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: '${type}'
|
|
76
|
+
},
|
|
77
|
+
directory: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: '${directory}'
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
setup(props, { attrs }) {
|
|
83
|
+
const iconName = computed(() => {
|
|
84
|
+
const name = props.name;
|
|
85
|
+
if (typeof name === 'string' && (props.type === 'svg' ||
|
|
86
|
+
(!props.type && props.default === 'svg'))) {
|
|
87
|
+
const icon = icons[name];
|
|
88
|
+
if(icon){
|
|
89
|
+
return icon;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return name;
|
|
93
|
+
});
|
|
94
|
+
return () => {
|
|
95
|
+
return h(FangIcon, {
|
|
96
|
+
...attrs,
|
|
97
|
+
name: iconName.value,
|
|
98
|
+
type: props.type,
|
|
99
|
+
default: props.default,
|
|
100
|
+
directory: props.directory
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
// \u5BFC\u51FA\u5B89\u88C5\u51FD\u6570
|
|
106
|
+
export const install = (app) => {
|
|
107
|
+
app.component('${name}', component)
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export default component;`;
|
|
111
|
+
const text = type === "svg" ? svg : pub;
|
|
112
|
+
return {
|
|
113
|
+
name: "simple-fang-icon",
|
|
114
|
+
resolveId(id) {
|
|
115
|
+
if (id === virtualModuleId) {
|
|
116
|
+
return resolvedVirtualModuleId;
|
|
117
|
+
}
|
|
118
|
+
return void 0;
|
|
119
|
+
},
|
|
120
|
+
load(id) {
|
|
121
|
+
if (id === resolvedVirtualModuleId) {
|
|
122
|
+
return text;
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
exports.simpleFangIcon = simpleFangIcon;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
interface PluginOptions {
|
|
4
|
+
name?: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
directory?: string;
|
|
7
|
+
mobile?: boolean;
|
|
8
|
+
dynamic?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function simpleFangIcon(options?: PluginOptions): Plugin;
|
|
11
|
+
|
|
12
|
+
export { simpleFangIcon };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
interface PluginOptions {
|
|
4
|
+
name?: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
directory?: string;
|
|
7
|
+
mobile?: boolean;
|
|
8
|
+
dynamic?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function simpleFangIcon(options?: PluginOptions): Plugin;
|
|
11
|
+
|
|
12
|
+
export { simpleFangIcon };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runDev
|
|
3
|
+
} from "../chunk-BKYM5ZD6.js";
|
|
4
|
+
import "../chunk-MLKGABMK.js";
|
|
5
|
+
|
|
6
|
+
// packages/vite/index3.ts
|
|
7
|
+
import { join } from "path";
|
|
8
|
+
var virtualModuleId = "virtual:fang-icon";
|
|
9
|
+
function simpleFangIcon(options = {}) {
|
|
10
|
+
const { name = "FangIcon", type = "svg", directory = "./svg" } = options;
|
|
11
|
+
const resolvedVirtualModuleId = "\0" + virtualModuleId;
|
|
12
|
+
if (type === "pub" && options.mobile) {
|
|
13
|
+
const outDir = join("./public/", directory);
|
|
14
|
+
console.log("outDir", outDir);
|
|
15
|
+
runDev({
|
|
16
|
+
issort: true,
|
|
17
|
+
dir: "./node_modules/@fangzhongya/icons/dist/svg",
|
|
18
|
+
outDir,
|
|
19
|
+
extensions: ["svg"],
|
|
20
|
+
read: true,
|
|
21
|
+
fileCover: true,
|
|
22
|
+
isNeader: false
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const pub = `
|
|
26
|
+
import { defineComponent, h,} from 'vue'
|
|
27
|
+
import FangIcon from '@fangzhongya/icons/icon/index'
|
|
28
|
+
const component = defineComponent({
|
|
29
|
+
name: '${name}',
|
|
30
|
+
props: {
|
|
31
|
+
name: {
|
|
32
|
+
type: [String, Object],
|
|
33
|
+
},
|
|
34
|
+
default: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: '${type}'
|
|
37
|
+
},
|
|
38
|
+
directory: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: '${directory}'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
setup(props, { attrs }) {
|
|
44
|
+
return () => {
|
|
45
|
+
return h(FangIcon, {
|
|
46
|
+
...attrs,
|
|
47
|
+
name: props.name,
|
|
48
|
+
default: props.default,
|
|
49
|
+
directory: props.directory
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
// \u5BFC\u51FA\u5B89\u88C5\u51FD\u6570
|
|
55
|
+
export const install = (app) => {
|
|
56
|
+
app.component('${name}', component)
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default component;`;
|
|
60
|
+
const svg = `
|
|
61
|
+
import { defineComponent, h, computed} from 'vue'
|
|
62
|
+
import FangIcon from '@fangzhongya/icons/icon/index'
|
|
63
|
+
import icons from '@fangzhongya/icons/async'
|
|
64
|
+
const component = defineComponent({
|
|
65
|
+
name: '${name}',
|
|
66
|
+
props: {
|
|
67
|
+
name: {
|
|
68
|
+
type: [String, Object],
|
|
69
|
+
},
|
|
70
|
+
type: {
|
|
71
|
+
type: String,
|
|
72
|
+
},
|
|
73
|
+
default: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: '${type}'
|
|
76
|
+
},
|
|
77
|
+
directory: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: '${directory}'
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
setup(props, { attrs }) {
|
|
83
|
+
const iconName = computed(() => {
|
|
84
|
+
const name = props.name;
|
|
85
|
+
if (typeof name === 'string' && (props.type === 'svg' ||
|
|
86
|
+
(!props.type && props.default === 'svg'))) {
|
|
87
|
+
const icon = icons[name];
|
|
88
|
+
if(icon){
|
|
89
|
+
return icon;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return name;
|
|
93
|
+
});
|
|
94
|
+
return () => {
|
|
95
|
+
return h(FangIcon, {
|
|
96
|
+
...attrs,
|
|
97
|
+
name: iconName.value,
|
|
98
|
+
type: props.type,
|
|
99
|
+
default: props.default,
|
|
100
|
+
directory: props.directory
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
// \u5BFC\u51FA\u5B89\u88C5\u51FD\u6570
|
|
106
|
+
export const install = (app) => {
|
|
107
|
+
app.component('${name}', component)
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export default component;`;
|
|
111
|
+
const text = type === "svg" ? svg : pub;
|
|
112
|
+
return {
|
|
113
|
+
name: "simple-fang-icon",
|
|
114
|
+
resolveId(id) {
|
|
115
|
+
if (id === virtualModuleId) {
|
|
116
|
+
return resolvedVirtualModuleId;
|
|
117
|
+
}
|
|
118
|
+
return void 0;
|
|
119
|
+
},
|
|
120
|
+
load(id) {
|
|
121
|
+
if (id === resolvedVirtualModuleId) {
|
|
122
|
+
return text;
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
export {
|
|
129
|
+
simpleFangIcon
|
|
130
|
+
};
|
package/dist/vue/index.cjs
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-KXZN54UH.cjs');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkESPY25SVcjs = require('../chunk-ESPY25SV.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkIBTK77R3cjs = require('../chunk-IBTK77R3.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkI3A3AEAAcjs = require('../chunk-I3A3AEAA.cjs');
|
|
2
11
|
|
|
3
12
|
|
|
4
13
|
var _chunkWOAJW7OBcjs = require('../chunk-WOAJW7OB.cjs');
|
|
@@ -19,7 +28,10 @@ var _chunkYBGWOI5Bcjs = require('../chunk-YBGWOI5B.cjs');
|
|
|
19
28
|
var _chunk53VWOQDNcjs = require('../chunk-53VWOQDN.cjs');
|
|
20
29
|
|
|
21
30
|
|
|
22
|
-
var
|
|
31
|
+
var _chunkL7KCN6DVcjs = require('../chunk-L7KCN6DV.cjs');
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
var _chunkDOKVIYQPcjs = require('../chunk-DOKVIYQP.cjs');
|
|
23
35
|
|
|
24
36
|
|
|
25
37
|
var _chunkIPHYXYU4cjs = require('../chunk-IPHYXYU4.cjs');
|
|
@@ -37,10 +49,10 @@ var _chunkFEFTZ7TTcjs = require('../chunk-FEFTZ7TT.cjs');
|
|
|
37
49
|
var _chunkAQDYWFIEcjs = require('../chunk-AQDYWFIE.cjs');
|
|
38
50
|
|
|
39
51
|
|
|
40
|
-
var
|
|
52
|
+
var _chunk76TLDMR4cjs = require('../chunk-76TLDMR4.cjs');
|
|
41
53
|
|
|
42
54
|
|
|
43
|
-
var
|
|
55
|
+
var _chunk2TQQMTHZcjs = require('../chunk-2TQQMTHZ.cjs');
|
|
44
56
|
|
|
45
57
|
|
|
46
58
|
var _chunkKDGKC2ADcjs = require('../chunk-KDGKC2AD.cjs');
|
|
@@ -61,12 +73,6 @@ var _chunkTCP7WBEZcjs = require('../chunk-TCP7WBEZ.cjs');
|
|
|
61
73
|
var _chunkRHPG3BCQcjs = require('../chunk-RHPG3BCQ.cjs');
|
|
62
74
|
|
|
63
75
|
|
|
64
|
-
var _chunkL7KCN6DVcjs = require('../chunk-L7KCN6DV.cjs');
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var _chunkDOKVIYQPcjs = require('../chunk-DOKVIYQP.cjs');
|
|
68
|
-
|
|
69
|
-
|
|
70
76
|
var _chunkH4PA2G3Ncjs = require('../chunk-H4PA2G3N.cjs');
|
|
71
77
|
|
|
72
78
|
|
|
@@ -80,12 +86,6 @@ var _chunkRENPHZI7cjs = require('../chunk-RENPHZI7.cjs');
|
|
|
80
86
|
|
|
81
87
|
|
|
82
88
|
var _chunkS7LOBBW2cjs = require('../chunk-S7LOBBW2.cjs');
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
var _chunk76TLDMR4cjs = require('../chunk-76TLDMR4.cjs');
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
var _chunk2TQQMTHZcjs = require('../chunk-2TQQMTHZ.cjs');
|
|
89
89
|
require('../chunk-75ZPJI57.cjs');
|
|
90
90
|
|
|
91
91
|
|
package/dist/vue/index.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-54HT4HDM.js";
|
|
2
|
+
import {
|
|
3
|
+
views_default
|
|
4
|
+
} from "../chunk-3AMDUJDV.js";
|
|
5
|
+
import {
|
|
6
|
+
pause_default
|
|
7
|
+
} from "../chunk-2D4VSAJ2.js";
|
|
8
|
+
import {
|
|
9
|
+
play_default
|
|
10
|
+
} from "../chunk-T7E6HY2F.js";
|
|
2
11
|
import {
|
|
3
12
|
plus_default
|
|
4
13
|
} from "../chunk-7IBXEWY5.js";
|
|
@@ -18,8 +27,11 @@ import {
|
|
|
18
27
|
up_default
|
|
19
28
|
} from "../chunk-XUPJ3XJL.js";
|
|
20
29
|
import {
|
|
21
|
-
|
|
22
|
-
} from "../chunk-
|
|
30
|
+
down_default
|
|
31
|
+
} from "../chunk-LBBA76TA.js";
|
|
32
|
+
import {
|
|
33
|
+
download_default
|
|
34
|
+
} from "../chunk-5PXZNWE4.js";
|
|
23
35
|
import {
|
|
24
36
|
edit_default
|
|
25
37
|
} from "../chunk-BEQYH4ZH.js";
|
|
@@ -36,11 +48,11 @@ import {
|
|
|
36
48
|
mute_default
|
|
37
49
|
} from "../chunk-JT3V6FP7.js";
|
|
38
50
|
import {
|
|
39
|
-
|
|
40
|
-
} from "../chunk-
|
|
51
|
+
bottom_default
|
|
52
|
+
} from "../chunk-JJXGNEQB.js";
|
|
41
53
|
import {
|
|
42
|
-
|
|
43
|
-
} from "../chunk-
|
|
54
|
+
cascader_field_default
|
|
55
|
+
} from "../chunk-VQ54VGY3.js";
|
|
44
56
|
import {
|
|
45
57
|
catalogue_default
|
|
46
58
|
} from "../chunk-BMEJLYYZ.js";
|
|
@@ -59,12 +71,6 @@ import {
|
|
|
59
71
|
import {
|
|
60
72
|
document_default
|
|
61
73
|
} from "../chunk-OIX6AEOH.js";
|
|
62
|
-
import {
|
|
63
|
-
down_default
|
|
64
|
-
} from "../chunk-LBBA76TA.js";
|
|
65
|
-
import {
|
|
66
|
-
download_default
|
|
67
|
-
} from "../chunk-5PXZNWE4.js";
|
|
68
74
|
import {
|
|
69
75
|
bar_default
|
|
70
76
|
} from "../chunk-NEHQ24EP.js";
|
|
@@ -80,12 +86,6 @@ import {
|
|
|
80
86
|
import {
|
|
81
87
|
bottom_right_default
|
|
82
88
|
} from "../chunk-YJLFP6SE.js";
|
|
83
|
-
import {
|
|
84
|
-
bottom_default
|
|
85
|
-
} from "../chunk-JJXGNEQB.js";
|
|
86
|
-
import {
|
|
87
|
-
cascader_field_default
|
|
88
|
-
} from "../chunk-VQ54VGY3.js";
|
|
89
89
|
import "../chunk-MLKGABMK.js";
|
|
90
90
|
export {
|
|
91
91
|
bar_default as Bar,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fangzhongya/icons",
|
|
3
3
|
"private": false,
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.17",
|
|
6
6
|
"description ": "个人图标库",
|
|
7
7
|
"author": "fangzhongya ",
|
|
8
8
|
"license": "MIT",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"dev:v": "node --loader ts-node/esm node/version.ts",
|
|
75
75
|
"dev:c": "node --loader ts-node/esm node/compons.ts",
|
|
76
76
|
"pub": "pnpm publish --access public --no-git-checks",
|
|
77
|
-
"build:all": "pnpm dev:i & pnpm build & pnpm dev:b",
|
|
77
|
+
"build:all": "pnpm dev:i & pnpm build & pnpm dev:b & pnpm dev:c",
|
|
78
78
|
"all": "pnpm build:all & pnpm dev:v & pnpm pub",
|
|
79
79
|
"preview": "vite preview"
|
|
80
80
|
}
|