@fangzhongya/icons 0.0.15 → 0.0.16
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} +19 -19
- package/dist/{vue.d.cts → async.d.cts} +18 -18
- package/dist/{vue.d.ts → async.d.ts} +18 -18
- package/dist/{vue.js → async.js} +19 -19
- package/dist/{chunk-6UMRW5ES.cjs → chunk-5NH4G6UJ.cjs} +5 -124
- package/dist/chunk-BKYM5ZD6.js +909 -0
- package/dist/chunk-HSJ3RNOH.js +124 -0
- package/dist/chunk-OSHAEKZL.cjs +124 -0
- package/dist/{chunk-Y2JUP3JH.js → chunk-RDKCKIKJ.js} +4 -123
- 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 +9 -9
- package/dist/index.js +9 -9
- 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 +208 -906
- package/dist/vite/index.d.cts +18 -1
- package/dist/vite/index.d.ts +18 -1
- package/dist/vite/index.js +213 -911
- 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 +8 -8
- package/dist/vue/index.js +9 -9
- package/package.json +2 -2
- package/dist/{chunk-BWFROGEZ.cjs → chunk-5ATJRRFS.cjs} +7 -7
- package/dist/{chunk-3YRVWHZK.js → chunk-SRJ74PQ7.js} +8 -8
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 _chunk5NH4G6UJcjs = require('../chunk-5NH4G6UJ.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, _chunk5NH4G6UJcjs.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 = _chunk5NH4G6UJcjs.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-RDKCKIKJ.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,7 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkWOAJW7OBcjs = require('../chunk-WOAJW7OB.cjs');
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-5ATJRRFS.cjs');
|
|
5
2
|
|
|
6
3
|
|
|
7
4
|
var _chunkY2W7MENXcjs = require('../chunk-Y2W7MENX.cjs');
|
|
@@ -22,9 +19,6 @@ var _chunk53VWOQDNcjs = require('../chunk-53VWOQDN.cjs');
|
|
|
22
19
|
var _chunkESPY25SVcjs = require('../chunk-ESPY25SV.cjs');
|
|
23
20
|
|
|
24
21
|
|
|
25
|
-
var _chunkIPHYXYU4cjs = require('../chunk-IPHYXYU4.cjs');
|
|
26
|
-
|
|
27
|
-
|
|
28
22
|
var _chunk32F77IBUcjs = require('../chunk-32F77IBU.cjs');
|
|
29
23
|
|
|
30
24
|
|
|
@@ -43,7 +37,7 @@ var _chunkIBTK77R3cjs = require('../chunk-IBTK77R3.cjs');
|
|
|
43
37
|
var _chunkI3A3AEAAcjs = require('../chunk-I3A3AEAA.cjs');
|
|
44
38
|
|
|
45
39
|
|
|
46
|
-
var
|
|
40
|
+
var _chunkWOAJW7OBcjs = require('../chunk-WOAJW7OB.cjs');
|
|
47
41
|
|
|
48
42
|
|
|
49
43
|
var _chunkVDTZORF6cjs = require('../chunk-VDTZORF6.cjs');
|
|
@@ -67,6 +61,9 @@ var _chunkL7KCN6DVcjs = require('../chunk-L7KCN6DV.cjs');
|
|
|
67
61
|
var _chunkDOKVIYQPcjs = require('../chunk-DOKVIYQP.cjs');
|
|
68
62
|
|
|
69
63
|
|
|
64
|
+
var _chunkIPHYXYU4cjs = require('../chunk-IPHYXYU4.cjs');
|
|
65
|
+
|
|
66
|
+
|
|
70
67
|
var _chunkH4PA2G3Ncjs = require('../chunk-H4PA2G3N.cjs');
|
|
71
68
|
|
|
72
69
|
|
|
@@ -86,6 +83,9 @@ var _chunk76TLDMR4cjs = require('../chunk-76TLDMR4.cjs');
|
|
|
86
83
|
|
|
87
84
|
|
|
88
85
|
var _chunk2TQQMTHZcjs = require('../chunk-2TQQMTHZ.cjs');
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
var _chunkKDGKC2ADcjs = require('../chunk-KDGKC2AD.cjs');
|
|
89
89
|
require('../chunk-75ZPJI57.cjs');
|
|
90
90
|
|
|
91
91
|
|
package/dist/vue/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import "../chunk-
|
|
2
|
-
import {
|
|
3
|
-
plus_default
|
|
4
|
-
} from "../chunk-7IBXEWY5.js";
|
|
1
|
+
import "../chunk-SRJ74PQ7.js";
|
|
5
2
|
import {
|
|
6
3
|
retreat_default
|
|
7
4
|
} from "../chunk-WLDTS6EO.js";
|
|
@@ -20,9 +17,6 @@ import {
|
|
|
20
17
|
import {
|
|
21
18
|
views_default
|
|
22
19
|
} from "../chunk-3AMDUJDV.js";
|
|
23
|
-
import {
|
|
24
|
-
edit_default
|
|
25
|
-
} from "../chunk-BEQYH4ZH.js";
|
|
26
20
|
import {
|
|
27
21
|
enter_default
|
|
28
22
|
} from "../chunk-YSDDIRK3.js";
|
|
@@ -42,8 +36,8 @@ import {
|
|
|
42
36
|
play_default
|
|
43
37
|
} from "../chunk-T7E6HY2F.js";
|
|
44
38
|
import {
|
|
45
|
-
|
|
46
|
-
} from "../chunk-
|
|
39
|
+
plus_default
|
|
40
|
+
} from "../chunk-7IBXEWY5.js";
|
|
47
41
|
import {
|
|
48
42
|
clear_default
|
|
49
43
|
} from "../chunk-Z7LHYEQW.js";
|
|
@@ -65,6 +59,9 @@ import {
|
|
|
65
59
|
import {
|
|
66
60
|
download_default
|
|
67
61
|
} from "../chunk-5PXZNWE4.js";
|
|
62
|
+
import {
|
|
63
|
+
edit_default
|
|
64
|
+
} from "../chunk-BEQYH4ZH.js";
|
|
68
65
|
import {
|
|
69
66
|
bar_default
|
|
70
67
|
} from "../chunk-NEHQ24EP.js";
|
|
@@ -86,6 +83,9 @@ import {
|
|
|
86
83
|
import {
|
|
87
84
|
cascader_field_default
|
|
88
85
|
} from "../chunk-VQ54VGY3.js";
|
|
86
|
+
import {
|
|
87
|
+
catalogue_default
|
|
88
|
+
} from "../chunk-BMEJLYYZ.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.16",
|
|
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
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _chunkWOAJW7OBcjs = require('./chunk-WOAJW7OB.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
var _chunkY2W7MENXcjs = require('./chunk-Y2W7MENX.cjs');
|
|
7
4
|
|
|
8
5
|
|
|
@@ -21,9 +18,6 @@ var _chunk53VWOQDNcjs = require('./chunk-53VWOQDN.cjs');
|
|
|
21
18
|
var _chunkESPY25SVcjs = require('./chunk-ESPY25SV.cjs');
|
|
22
19
|
|
|
23
20
|
|
|
24
|
-
var _chunkIPHYXYU4cjs = require('./chunk-IPHYXYU4.cjs');
|
|
25
|
-
|
|
26
|
-
|
|
27
21
|
var _chunk32F77IBUcjs = require('./chunk-32F77IBU.cjs');
|
|
28
22
|
|
|
29
23
|
|
|
@@ -42,7 +36,7 @@ var _chunkIBTK77R3cjs = require('./chunk-IBTK77R3.cjs');
|
|
|
42
36
|
var _chunkI3A3AEAAcjs = require('./chunk-I3A3AEAA.cjs');
|
|
43
37
|
|
|
44
38
|
|
|
45
|
-
var
|
|
39
|
+
var _chunkWOAJW7OBcjs = require('./chunk-WOAJW7OB.cjs');
|
|
46
40
|
|
|
47
41
|
|
|
48
42
|
var _chunkVDTZORF6cjs = require('./chunk-VDTZORF6.cjs');
|
|
@@ -66,6 +60,9 @@ var _chunkL7KCN6DVcjs = require('./chunk-L7KCN6DV.cjs');
|
|
|
66
60
|
var _chunkDOKVIYQPcjs = require('./chunk-DOKVIYQP.cjs');
|
|
67
61
|
|
|
68
62
|
|
|
63
|
+
var _chunkIPHYXYU4cjs = require('./chunk-IPHYXYU4.cjs');
|
|
64
|
+
|
|
65
|
+
|
|
69
66
|
var _chunkH4PA2G3Ncjs = require('./chunk-H4PA2G3N.cjs');
|
|
70
67
|
|
|
71
68
|
|
|
@@ -87,6 +84,9 @@ var _chunk76TLDMR4cjs = require('./chunk-76TLDMR4.cjs');
|
|
|
87
84
|
var _chunk2TQQMTHZcjs = require('./chunk-2TQQMTHZ.cjs');
|
|
88
85
|
|
|
89
86
|
|
|
87
|
+
var _chunkKDGKC2ADcjs = require('./chunk-KDGKC2AD.cjs');
|
|
88
|
+
|
|
89
|
+
|
|
90
90
|
var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
|
|
91
91
|
|
|
92
92
|
// packages/vue/index.ts
|