@fangzhongya/icons 0.0.10 → 0.0.12
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/{chunk-HOVIIPWX.js → chunk-2GZYNEO5.js} +4 -1
- package/dist/{chunk-S2UC3QOV.cjs → chunk-TKXFLY5V.cjs} +4 -1
- package/dist/icon/index.cjs +2 -2
- package/dist/icon/index.js +1 -1
- package/dist/iconify.cjs +25 -1
- package/dist/iconify.d.cts +2 -1
- package/dist/iconify.d.ts +2 -1
- package/dist/iconify.js +24 -0
- package/dist/index.json +1 -1
- package/dist/picker/index.cjs +4 -4
- package/dist/picker/index.js +1 -1
- package/dist/vite/index.cjs +93 -32
- package/dist/vite/index.d.cts +2 -0
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/index.js +93 -32
- package/package.json +1 -1
|
@@ -187,7 +187,10 @@ var icon_default = defineComponent({
|
|
|
187
187
|
const arr = computed(() => {
|
|
188
188
|
var _a, _b, _c;
|
|
189
189
|
if (slots.default) {
|
|
190
|
-
return slots.default(
|
|
190
|
+
return slots.default({
|
|
191
|
+
class: [props.iconClass],
|
|
192
|
+
style: contStyle
|
|
193
|
+
});
|
|
191
194
|
} else if (!outputName.value) {
|
|
192
195
|
return void 0;
|
|
193
196
|
} else if (outputType.value === "svg") {
|
|
@@ -187,7 +187,10 @@ var icon_default = _vue.defineComponent.call(void 0, {
|
|
|
187
187
|
const arr = _vue.computed.call(void 0, () => {
|
|
188
188
|
var _a, _b, _c;
|
|
189
189
|
if (slots.default) {
|
|
190
|
-
return slots.default(
|
|
190
|
+
return slots.default({
|
|
191
|
+
class: [props.iconClass],
|
|
192
|
+
style: contStyle
|
|
193
|
+
});
|
|
191
194
|
} else if (!outputName.value) {
|
|
192
195
|
return void 0;
|
|
193
196
|
} else if (outputType.value === "svg") {
|
package/dist/icon/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkTKXFLY5Vcjs = require('../chunk-TKXFLY5V.cjs');
|
|
4
4
|
require('../chunk-75ZPJI57.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.default =
|
|
7
|
+
exports.default = _chunkTKXFLY5Vcjs.icon_default;
|
package/dist/icon/index.js
CHANGED
package/dist/iconify.cjs
CHANGED
|
@@ -93,7 +93,31 @@ function iconifySVG(obj, name) {
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
+
function getIconifySVG(obj, name) {
|
|
97
|
+
var _a;
|
|
98
|
+
const icons = obj.icons;
|
|
99
|
+
const aliases = obj.aliases;
|
|
100
|
+
const ap = (_a = aliases[name]) == null ? void 0 : _a.parent;
|
|
101
|
+
const n = _nullishCoalesce(icons[name], () => ( (ap ? icons[ap] : void 0)));
|
|
102
|
+
if (n) {
|
|
103
|
+
const v = {
|
|
104
|
+
prefix: obj.prefix,
|
|
105
|
+
name,
|
|
106
|
+
width: obj.width,
|
|
107
|
+
height: obj.height,
|
|
108
|
+
...n
|
|
109
|
+
};
|
|
110
|
+
const viewBox = [
|
|
111
|
+
v.left || 0,
|
|
112
|
+
v.top || 0,
|
|
113
|
+
v.width || 1024,
|
|
114
|
+
v.height || 1024
|
|
115
|
+
].join(" ");
|
|
116
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${viewBox}">${n.body}</svg>`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
96
120
|
|
|
97
121
|
|
|
98
122
|
|
|
99
|
-
exports.iconify = iconify; exports.iconifySVG = iconifySVG;
|
|
123
|
+
exports.getIconifySVG = getIconifySVG; exports.iconify = iconify; exports.iconifySVG = iconifySVG;
|
package/dist/iconify.d.cts
CHANGED
|
@@ -37,5 +37,6 @@ type Iconify = {
|
|
|
37
37
|
* @returns 返回一个Vue组件实例,用于渲染SVG图标
|
|
38
38
|
*/
|
|
39
39
|
declare function iconifySVG(obj: Iconify, name: string): vue.DefineComponent<{}, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
40
|
+
declare function getIconifySVG(obj: Iconify, name: string): string;
|
|
40
41
|
|
|
41
|
-
export { iconify, iconifySVG };
|
|
42
|
+
export { getIconifySVG, iconify, iconifySVG };
|
package/dist/iconify.d.ts
CHANGED
|
@@ -37,5 +37,6 @@ type Iconify = {
|
|
|
37
37
|
* @returns 返回一个Vue组件实例,用于渲染SVG图标
|
|
38
38
|
*/
|
|
39
39
|
declare function iconifySVG(obj: Iconify, name: string): vue.DefineComponent<{}, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
40
|
+
declare function getIconifySVG(obj: Iconify, name: string): string;
|
|
40
41
|
|
|
41
|
-
export { iconify, iconifySVG };
|
|
42
|
+
export { getIconifySVG, iconify, iconifySVG };
|
package/dist/iconify.js
CHANGED
|
@@ -93,7 +93,31 @@ function iconifySVG(obj, name) {
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
+
function getIconifySVG(obj, name) {
|
|
97
|
+
var _a;
|
|
98
|
+
const icons = obj.icons;
|
|
99
|
+
const aliases = obj.aliases;
|
|
100
|
+
const ap = (_a = aliases[name]) == null ? void 0 : _a.parent;
|
|
101
|
+
const n = icons[name] ?? (ap ? icons[ap] : void 0);
|
|
102
|
+
if (n) {
|
|
103
|
+
const v = {
|
|
104
|
+
prefix: obj.prefix,
|
|
105
|
+
name,
|
|
106
|
+
width: obj.width,
|
|
107
|
+
height: obj.height,
|
|
108
|
+
...n
|
|
109
|
+
};
|
|
110
|
+
const viewBox = [
|
|
111
|
+
v.left || 0,
|
|
112
|
+
v.top || 0,
|
|
113
|
+
v.width || 1024,
|
|
114
|
+
v.height || 1024
|
|
115
|
+
].join(" ");
|
|
116
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${viewBox}">${n.body}</svg>`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
96
119
|
export {
|
|
120
|
+
getIconifySVG,
|
|
97
121
|
iconify,
|
|
98
122
|
iconifySVG
|
|
99
123
|
};
|
package/dist/index.json
CHANGED
package/dist/picker/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkTKXFLY5Vcjs = require('../chunk-TKXFLY5V.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkEEMF44IHcjs = require('../chunk-EEMF44IH.cjs');
|
|
@@ -107,7 +107,7 @@ var picker_default = _vue.defineComponent.call(void 0, {
|
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
109
|
[
|
|
110
|
-
_vue.h.call(void 0,
|
|
110
|
+
_vue.h.call(void 0, _chunkTKXFLY5Vcjs.icon_default, {
|
|
111
111
|
type: props.type,
|
|
112
112
|
size: props.size,
|
|
113
113
|
name: props.modelValue,
|
|
@@ -189,7 +189,7 @@ var picker_default = _vue.defineComponent.call(void 0, {
|
|
|
189
189
|
},
|
|
190
190
|
name.value
|
|
191
191
|
),
|
|
192
|
-
_vue.h.call(void 0,
|
|
192
|
+
_vue.h.call(void 0, _chunkTKXFLY5Vcjs.icon_default, {
|
|
193
193
|
type: props.type,
|
|
194
194
|
size: props.size,
|
|
195
195
|
name: name.value,
|
|
@@ -241,7 +241,7 @@ var picker_default = _vue.defineComponent.call(void 0, {
|
|
|
241
241
|
}
|
|
242
242
|
},
|
|
243
243
|
[
|
|
244
|
-
_vue.h.call(void 0,
|
|
244
|
+
_vue.h.call(void 0, _chunkTKXFLY5Vcjs.icon_default, {
|
|
245
245
|
style: {
|
|
246
246
|
margin: "5px",
|
|
247
247
|
marginBottom: 0,
|
package/dist/picker/index.js
CHANGED
package/dist/vite/index.cjs
CHANGED
|
@@ -907,22 +907,111 @@ function runDev(config, configCallback, callback) {
|
|
|
907
907
|
}
|
|
908
908
|
|
|
909
909
|
// packages/vite/index.ts
|
|
910
|
+
|
|
910
911
|
var virtualModuleId = "virtual:fang-icon";
|
|
911
912
|
function simpleFangIcon(options = {}) {
|
|
912
|
-
const { type = "svg", directory = "./svg" } = options;
|
|
913
|
+
const { name = "FangIcon", type = "svg", directory = "./svg" } = options;
|
|
913
914
|
const resolvedVirtualModuleId = "\0" + virtualModuleId;
|
|
914
915
|
if (type === "pub" && options.mobile) {
|
|
915
|
-
|
|
916
|
+
const outDir = _path.join.call(void 0, "./public/", directory);
|
|
917
|
+
console.log("outDir", outDir);
|
|
916
918
|
runDev({
|
|
917
919
|
issort: true,
|
|
918
920
|
dir: "./node_modules/@fangzhongya/icons/dist/svg",
|
|
919
|
-
outDir
|
|
921
|
+
outDir,
|
|
920
922
|
extensions: ["svg"],
|
|
921
923
|
read: true,
|
|
922
924
|
fileCover: true,
|
|
923
925
|
isNeader: false
|
|
924
926
|
});
|
|
925
927
|
}
|
|
928
|
+
const pub = `
|
|
929
|
+
import { defineComponent, h,} from 'vue'
|
|
930
|
+
import FangIcon from '@fangzhongya/icons/icon/index'
|
|
931
|
+
const component = defineComponent({
|
|
932
|
+
name: '${name}',
|
|
933
|
+
props: {
|
|
934
|
+
name: {
|
|
935
|
+
type: [String, Object],
|
|
936
|
+
},
|
|
937
|
+
default: {
|
|
938
|
+
type: String,
|
|
939
|
+
default: '${type}'
|
|
940
|
+
},
|
|
941
|
+
directory: {
|
|
942
|
+
type: String,
|
|
943
|
+
default: '${directory}'
|
|
944
|
+
}
|
|
945
|
+
},
|
|
946
|
+
setup(props, { attrs }) {
|
|
947
|
+
return () => {
|
|
948
|
+
return h(FangIcon, {
|
|
949
|
+
...attrs,
|
|
950
|
+
name: props.name,
|
|
951
|
+
default: props.default,
|
|
952
|
+
directory: props.directory
|
|
953
|
+
});
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
// \u5BFC\u51FA\u5B89\u88C5\u51FD\u6570
|
|
958
|
+
export const install = (app) => {
|
|
959
|
+
app.component('${name}', component)
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
export default component;`;
|
|
963
|
+
const svg = `
|
|
964
|
+
import { defineComponent, h, computed} from 'vue'
|
|
965
|
+
import FangIcon from '@fangzhongya/icons/icon/index'
|
|
966
|
+
import { icons } from '@fangzhongya/icons/vue'
|
|
967
|
+
const component = defineComponent({
|
|
968
|
+
name: '${name}',
|
|
969
|
+
props: {
|
|
970
|
+
name: {
|
|
971
|
+
type: [String, Object],
|
|
972
|
+
},
|
|
973
|
+
type: {
|
|
974
|
+
type: String,
|
|
975
|
+
},
|
|
976
|
+
default: {
|
|
977
|
+
type: String,
|
|
978
|
+
default: '${type}'
|
|
979
|
+
},
|
|
980
|
+
directory: {
|
|
981
|
+
type: String,
|
|
982
|
+
default: '${directory}'
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
setup(props, { attrs }) {
|
|
986
|
+
const iconName = computed(() => {
|
|
987
|
+
const name = props.name;
|
|
988
|
+
if (typeof name === 'string' && (props.type === 'svg' ||
|
|
989
|
+
(props.type === undefined && props.default === 'svg'))) {
|
|
990
|
+
const icon = icons[name];
|
|
991
|
+
if(icon){
|
|
992
|
+
return icon;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
return name;
|
|
996
|
+
});
|
|
997
|
+
return () => {
|
|
998
|
+
return h(FangIcon, {
|
|
999
|
+
...attrs,
|
|
1000
|
+
name: iconName.value,
|
|
1001
|
+
type: props.type,
|
|
1002
|
+
default: props.default,
|
|
1003
|
+
directory: props.directory
|
|
1004
|
+
});
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
});
|
|
1008
|
+
// \u5BFC\u51FA\u5B89\u88C5\u51FD\u6570
|
|
1009
|
+
export const install = (app) => {
|
|
1010
|
+
app.component('${name}', component)
|
|
1011
|
+
};
|
|
1012
|
+
|
|
1013
|
+
export default component;`;
|
|
1014
|
+
const text = type === "svg" ? svg : pub;
|
|
926
1015
|
return {
|
|
927
1016
|
name: "simple-fang-icon",
|
|
928
1017
|
resolveId(id) {
|
|
@@ -933,35 +1022,7 @@ function simpleFangIcon(options = {}) {
|
|
|
933
1022
|
},
|
|
934
1023
|
load(id) {
|
|
935
1024
|
if (id === resolvedVirtualModuleId) {
|
|
936
|
-
return
|
|
937
|
-
import { defineComponent, h,} from 'vue'
|
|
938
|
-
import FangIcon from '@fangzhongya/icons/icon/index'
|
|
939
|
-
export default defineComponent({
|
|
940
|
-
props: {
|
|
941
|
-
name: {
|
|
942
|
-
type: [String, Object],
|
|
943
|
-
},
|
|
944
|
-
type: {
|
|
945
|
-
type: String,
|
|
946
|
-
default: '${type}'
|
|
947
|
-
},
|
|
948
|
-
directory: {
|
|
949
|
-
type: String,
|
|
950
|
-
default: '${directory}'
|
|
951
|
-
}
|
|
952
|
-
},
|
|
953
|
-
setup(props, { attrs }) {
|
|
954
|
-
return () => {
|
|
955
|
-
return h(FangIcon, {
|
|
956
|
-
...attrs,
|
|
957
|
-
type: props.type,
|
|
958
|
-
name: props.name,
|
|
959
|
-
directory: props.directory
|
|
960
|
-
});
|
|
961
|
-
};
|
|
962
|
-
}
|
|
963
|
-
})
|
|
964
|
-
`;
|
|
1025
|
+
return text;
|
|
965
1026
|
}
|
|
966
1027
|
return null;
|
|
967
1028
|
}
|
package/dist/vite/index.d.cts
CHANGED
package/dist/vite/index.d.ts
CHANGED
package/dist/vite/index.js
CHANGED
|
@@ -907,22 +907,111 @@ function runDev(config, configCallback, callback) {
|
|
|
907
907
|
}
|
|
908
908
|
|
|
909
909
|
// packages/vite/index.ts
|
|
910
|
+
import { join as join5 } from "path";
|
|
910
911
|
var virtualModuleId = "virtual:fang-icon";
|
|
911
912
|
function simpleFangIcon(options = {}) {
|
|
912
|
-
const { type = "svg", directory = "./svg" } = options;
|
|
913
|
+
const { name = "FangIcon", type = "svg", directory = "./svg" } = options;
|
|
913
914
|
const resolvedVirtualModuleId = "\0" + virtualModuleId;
|
|
914
915
|
if (type === "pub" && options.mobile) {
|
|
915
|
-
|
|
916
|
+
const outDir = join5("./public/", directory);
|
|
917
|
+
console.log("outDir", outDir);
|
|
916
918
|
runDev({
|
|
917
919
|
issort: true,
|
|
918
920
|
dir: "./node_modules/@fangzhongya/icons/dist/svg",
|
|
919
|
-
outDir
|
|
921
|
+
outDir,
|
|
920
922
|
extensions: ["svg"],
|
|
921
923
|
read: true,
|
|
922
924
|
fileCover: true,
|
|
923
925
|
isNeader: false
|
|
924
926
|
});
|
|
925
927
|
}
|
|
928
|
+
const pub = `
|
|
929
|
+
import { defineComponent, h,} from 'vue'
|
|
930
|
+
import FangIcon from '@fangzhongya/icons/icon/index'
|
|
931
|
+
const component = defineComponent({
|
|
932
|
+
name: '${name}',
|
|
933
|
+
props: {
|
|
934
|
+
name: {
|
|
935
|
+
type: [String, Object],
|
|
936
|
+
},
|
|
937
|
+
default: {
|
|
938
|
+
type: String,
|
|
939
|
+
default: '${type}'
|
|
940
|
+
},
|
|
941
|
+
directory: {
|
|
942
|
+
type: String,
|
|
943
|
+
default: '${directory}'
|
|
944
|
+
}
|
|
945
|
+
},
|
|
946
|
+
setup(props, { attrs }) {
|
|
947
|
+
return () => {
|
|
948
|
+
return h(FangIcon, {
|
|
949
|
+
...attrs,
|
|
950
|
+
name: props.name,
|
|
951
|
+
default: props.default,
|
|
952
|
+
directory: props.directory
|
|
953
|
+
});
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
// \u5BFC\u51FA\u5B89\u88C5\u51FD\u6570
|
|
958
|
+
export const install = (app) => {
|
|
959
|
+
app.component('${name}', component)
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
export default component;`;
|
|
963
|
+
const svg = `
|
|
964
|
+
import { defineComponent, h, computed} from 'vue'
|
|
965
|
+
import FangIcon from '@fangzhongya/icons/icon/index'
|
|
966
|
+
import { icons } from '@fangzhongya/icons/vue'
|
|
967
|
+
const component = defineComponent({
|
|
968
|
+
name: '${name}',
|
|
969
|
+
props: {
|
|
970
|
+
name: {
|
|
971
|
+
type: [String, Object],
|
|
972
|
+
},
|
|
973
|
+
type: {
|
|
974
|
+
type: String,
|
|
975
|
+
},
|
|
976
|
+
default: {
|
|
977
|
+
type: String,
|
|
978
|
+
default: '${type}'
|
|
979
|
+
},
|
|
980
|
+
directory: {
|
|
981
|
+
type: String,
|
|
982
|
+
default: '${directory}'
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
setup(props, { attrs }) {
|
|
986
|
+
const iconName = computed(() => {
|
|
987
|
+
const name = props.name;
|
|
988
|
+
if (typeof name === 'string' && (props.type === 'svg' ||
|
|
989
|
+
(props.type === undefined && props.default === 'svg'))) {
|
|
990
|
+
const icon = icons[name];
|
|
991
|
+
if(icon){
|
|
992
|
+
return icon;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
return name;
|
|
996
|
+
});
|
|
997
|
+
return () => {
|
|
998
|
+
return h(FangIcon, {
|
|
999
|
+
...attrs,
|
|
1000
|
+
name: iconName.value,
|
|
1001
|
+
type: props.type,
|
|
1002
|
+
default: props.default,
|
|
1003
|
+
directory: props.directory
|
|
1004
|
+
});
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
});
|
|
1008
|
+
// \u5BFC\u51FA\u5B89\u88C5\u51FD\u6570
|
|
1009
|
+
export const install = (app) => {
|
|
1010
|
+
app.component('${name}', component)
|
|
1011
|
+
};
|
|
1012
|
+
|
|
1013
|
+
export default component;`;
|
|
1014
|
+
const text = type === "svg" ? svg : pub;
|
|
926
1015
|
return {
|
|
927
1016
|
name: "simple-fang-icon",
|
|
928
1017
|
resolveId(id) {
|
|
@@ -933,35 +1022,7 @@ function simpleFangIcon(options = {}) {
|
|
|
933
1022
|
},
|
|
934
1023
|
load(id) {
|
|
935
1024
|
if (id === resolvedVirtualModuleId) {
|
|
936
|
-
return
|
|
937
|
-
import { defineComponent, h,} from 'vue'
|
|
938
|
-
import FangIcon from '@fangzhongya/icons/icon/index'
|
|
939
|
-
export default defineComponent({
|
|
940
|
-
props: {
|
|
941
|
-
name: {
|
|
942
|
-
type: [String, Object],
|
|
943
|
-
},
|
|
944
|
-
type: {
|
|
945
|
-
type: String,
|
|
946
|
-
default: '${type}'
|
|
947
|
-
},
|
|
948
|
-
directory: {
|
|
949
|
-
type: String,
|
|
950
|
-
default: '${directory}'
|
|
951
|
-
}
|
|
952
|
-
},
|
|
953
|
-
setup(props, { attrs }) {
|
|
954
|
-
return () => {
|
|
955
|
-
return h(FangIcon, {
|
|
956
|
-
...attrs,
|
|
957
|
-
type: props.type,
|
|
958
|
-
name: props.name,
|
|
959
|
-
directory: props.directory
|
|
960
|
-
});
|
|
961
|
-
};
|
|
962
|
-
}
|
|
963
|
-
})
|
|
964
|
-
`;
|
|
1025
|
+
return text;
|
|
965
1026
|
}
|
|
966
1027
|
return null;
|
|
967
1028
|
}
|