@fangzhongya/icons 0.0.32 → 0.0.34

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.
@@ -3,23 +3,23 @@ import {
3
3
  } from "./chunk-MOHILOKE.js";
4
4
 
5
5
  // packages/icon/index.ts
6
- import { h, defineComponent, resolveComponent, computed, Fragment } from "vue";
6
+ import { h, defineComponent, resolveComponent, computed } from "vue";
7
7
 
8
8
  // node_modules/.pnpm/@fangzhongya+utils@0.0.73/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
9
- function humpToLine(name) {
9
+ function humpToLine(name2) {
10
10
  const reg3 = /(([A-Z])([^A-Z]*))/g;
11
11
  let result;
12
12
  const arr = [];
13
13
  let i = 0;
14
- while ((result = reg3.exec(name)) !== null) {
14
+ while ((result = reg3.exec(name2)) !== null) {
15
15
  if (i == 0 && result.index != 0) {
16
- arr.push(name.substring(0, result.index));
16
+ arr.push(name2.substring(0, result.index));
17
17
  }
18
18
  i++;
19
19
  arr.push(result[1].toLowerCase());
20
20
  }
21
21
  if (arr.length == 0) {
22
- return name;
22
+ return name2;
23
23
  } else {
24
24
  let a = arr.join("-");
25
25
  a = a.replace(/[-]{2,}/g, "-");
@@ -34,9 +34,9 @@ var reg2 = /<g([^>]*)>((.|\n|\r|\t)*)<\/g>/g;
34
34
  var prefix = humpToLine(defaultPrefix) + "-";
35
35
  var className = "icon";
36
36
  var directory = "/svg";
37
- var isImg = (name) => {
38
- if (name) {
39
- if (name.startsWith("data:") || name.startsWith("/") || name.startsWith("./") || name.startsWith("../") || name.includes("://")) {
37
+ var isImg = (name2) => {
38
+ if (name2) {
39
+ if (name2.startsWith("data:") || name2.startsWith("/") || name2.startsWith("./") || name2.startsWith("../") || name2.includes("://")) {
40
40
  return true;
41
41
  }
42
42
  }
@@ -65,7 +65,7 @@ var svgStyle = {
65
65
  color: "var(--color)",
66
66
  "font-size": "inherit"
67
67
  };
68
- var icon_default = defineComponent({
68
+ var component = defineComponent({
69
69
  name: "Icon",
70
70
  props: {
71
71
  /**
@@ -133,22 +133,22 @@ var icon_default = defineComponent({
133
133
  if (props.type) {
134
134
  return props.type;
135
135
  } else {
136
- const name = props.name || "";
137
- if (typeof name == "object") {
136
+ const name2 = props.name || "";
137
+ if (typeof name2 == "object") {
138
138
  return "vue";
139
- } else if (reg.test(name) || reg1.test(name) || reg2.test(name)) {
139
+ } else if (reg.test(name2) || reg1.test(name2) || reg2.test(name2)) {
140
140
  return "svg";
141
- } else if (isImg(name)) {
141
+ } else if (isImg(name2)) {
142
142
  return "img";
143
143
  }
144
144
  return props.default;
145
145
  }
146
146
  });
147
- const setPrefix = (name) => {
148
- if (name.startsWith(props.prefix)) {
149
- return name;
147
+ const setPrefix = (name2) => {
148
+ if (name2.startsWith(props.prefix)) {
149
+ return name2;
150
150
  } else {
151
- return props.prefix + name;
151
+ return props.prefix + name2;
152
152
  }
153
153
  };
154
154
  const transformStyle = computed(() => {
@@ -188,41 +188,35 @@ var icon_default = defineComponent({
188
188
  return styleObj;
189
189
  });
190
190
  const outputName = computed(() => {
191
- const name = props.name;
192
- if (typeof name == "string") {
191
+ const name2 = props.name;
192
+ if (typeof name2 == "string") {
193
193
  switch (outputType.value) {
194
194
  case "svg":
195
- const rs = reg.exec(name);
196
- const rs1 = reg1.exec(name) || reg2.exec(name);
195
+ const rs = reg.exec(name2);
196
+ const rs1 = reg1.exec(name2) || reg2.exec(name2);
197
197
  if (rs && rs.length > 0) {
198
198
  return rs[1];
199
199
  } else if (rs1 && rs1.length > 0) {
200
200
  return rs1[0];
201
201
  } else {
202
- return name;
202
+ return name2;
203
203
  }
204
204
  case "css":
205
- return setPrefix(name);
205
+ return setPrefix(name2);
206
206
  case "id":
207
- return setPrefix(name);
207
+ return setPrefix(name2);
208
208
  case "font":
209
- return setPrefix(name);
209
+ return setPrefix(name2);
210
210
  default:
211
- return name;
211
+ return name2;
212
212
  }
213
213
  }
214
- return name;
214
+ return name2;
215
215
  });
216
216
  const arr = computed(() => {
217
217
  var _a, _b, _c, _d, _e;
218
- if (slots.default) {
219
- return h(
220
- Fragment,
221
- slots.default({
222
- class: [props.iconClass],
223
- style: contStyle
224
- })
225
- );
218
+ if (Object.keys(slots).length > 0) {
219
+ return slots;
226
220
  } else if (!outputName.value) {
227
221
  return void 0;
228
222
  } else if (outputType.value === "pub") {
@@ -317,7 +311,13 @@ var icon_default = defineComponent({
317
311
  );
318
312
  }
319
313
  });
314
+ var name = "FangIcon";
315
+ var install = (app) => {
316
+ app.component(name, component);
317
+ };
318
+ var icon_default = component;
320
319
 
321
320
  export {
321
+ install,
322
322
  icon_default
323
323
  };
@@ -2,7 +2,7 @@
2
2
  var index_default = {
3
3
  prefix: "fang-icons",
4
4
  info: {},
5
- lastModified: 1767925097356,
5
+ lastModified: 1767929843933,
6
6
  icons: {
7
7
  bar: {
8
8
  body: '<path d="M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z"></path>'
@@ -2,7 +2,7 @@
2
2
  var index_default = {
3
3
  prefix: "fang-icons",
4
4
  info: {},
5
- lastModified: 1767925097356,
5
+ lastModified: 1767929843933,
6
6
  icons: {
7
7
  bar: {
8
8
  body: '<path d="M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z"></path>'
@@ -6,20 +6,20 @@ var _chunkIIVF4KK5cjs = require('./chunk-IIVF4KK5.cjs');
6
6
  var _vue = require('vue');
7
7
 
8
8
  // node_modules/.pnpm/@fangzhongya+utils@0.0.73/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
9
- function humpToLine(name) {
9
+ function humpToLine(name2) {
10
10
  const reg3 = /(([A-Z])([^A-Z]*))/g;
11
11
  let result;
12
12
  const arr = [];
13
13
  let i = 0;
14
- while ((result = reg3.exec(name)) !== null) {
14
+ while ((result = reg3.exec(name2)) !== null) {
15
15
  if (i == 0 && result.index != 0) {
16
- arr.push(name.substring(0, result.index));
16
+ arr.push(name2.substring(0, result.index));
17
17
  }
18
18
  i++;
19
19
  arr.push(result[1].toLowerCase());
20
20
  }
21
21
  if (arr.length == 0) {
22
- return name;
22
+ return name2;
23
23
  } else {
24
24
  let a = arr.join("-");
25
25
  a = a.replace(/[-]{2,}/g, "-");
@@ -34,9 +34,9 @@ var reg2 = /<g([^>]*)>((.|\n|\r|\t)*)<\/g>/g;
34
34
  var prefix = humpToLine(_chunkIIVF4KK5cjs.defaultPrefix) + "-";
35
35
  var className = "icon";
36
36
  var directory = "/svg";
37
- var isImg = (name) => {
38
- if (name) {
39
- if (name.startsWith("data:") || name.startsWith("/") || name.startsWith("./") || name.startsWith("../") || name.includes("://")) {
37
+ var isImg = (name2) => {
38
+ if (name2) {
39
+ if (name2.startsWith("data:") || name2.startsWith("/") || name2.startsWith("./") || name2.startsWith("../") || name2.includes("://")) {
40
40
  return true;
41
41
  }
42
42
  }
@@ -65,7 +65,7 @@ var svgStyle = {
65
65
  color: "var(--color)",
66
66
  "font-size": "inherit"
67
67
  };
68
- var icon_default = _vue.defineComponent.call(void 0, {
68
+ var component = _vue.defineComponent.call(void 0, {
69
69
  name: "Icon",
70
70
  props: {
71
71
  /**
@@ -133,22 +133,22 @@ var icon_default = _vue.defineComponent.call(void 0, {
133
133
  if (props.type) {
134
134
  return props.type;
135
135
  } else {
136
- const name = props.name || "";
137
- if (typeof name == "object") {
136
+ const name2 = props.name || "";
137
+ if (typeof name2 == "object") {
138
138
  return "vue";
139
- } else if (reg.test(name) || reg1.test(name) || reg2.test(name)) {
139
+ } else if (reg.test(name2) || reg1.test(name2) || reg2.test(name2)) {
140
140
  return "svg";
141
- } else if (isImg(name)) {
141
+ } else if (isImg(name2)) {
142
142
  return "img";
143
143
  }
144
144
  return props.default;
145
145
  }
146
146
  });
147
- const setPrefix = (name) => {
148
- if (name.startsWith(props.prefix)) {
149
- return name;
147
+ const setPrefix = (name2) => {
148
+ if (name2.startsWith(props.prefix)) {
149
+ return name2;
150
150
  } else {
151
- return props.prefix + name;
151
+ return props.prefix + name2;
152
152
  }
153
153
  };
154
154
  const transformStyle = _vue.computed.call(void 0, () => {
@@ -188,41 +188,35 @@ var icon_default = _vue.defineComponent.call(void 0, {
188
188
  return styleObj;
189
189
  });
190
190
  const outputName = _vue.computed.call(void 0, () => {
191
- const name = props.name;
192
- if (typeof name == "string") {
191
+ const name2 = props.name;
192
+ if (typeof name2 == "string") {
193
193
  switch (outputType.value) {
194
194
  case "svg":
195
- const rs = reg.exec(name);
196
- const rs1 = reg1.exec(name) || reg2.exec(name);
195
+ const rs = reg.exec(name2);
196
+ const rs1 = reg1.exec(name2) || reg2.exec(name2);
197
197
  if (rs && rs.length > 0) {
198
198
  return rs[1];
199
199
  } else if (rs1 && rs1.length > 0) {
200
200
  return rs1[0];
201
201
  } else {
202
- return name;
202
+ return name2;
203
203
  }
204
204
  case "css":
205
- return setPrefix(name);
205
+ return setPrefix(name2);
206
206
  case "id":
207
- return setPrefix(name);
207
+ return setPrefix(name2);
208
208
  case "font":
209
- return setPrefix(name);
209
+ return setPrefix(name2);
210
210
  default:
211
- return name;
211
+ return name2;
212
212
  }
213
213
  }
214
- return name;
214
+ return name2;
215
215
  });
216
216
  const arr = _vue.computed.call(void 0, () => {
217
217
  var _a, _b, _c, _d, _e;
218
- if (slots.default) {
219
- return _vue.h.call(void 0,
220
- _vue.Fragment,
221
- slots.default({
222
- class: [props.iconClass],
223
- style: contStyle
224
- })
225
- );
218
+ if (Object.keys(slots).length > 0) {
219
+ return slots;
226
220
  } else if (!outputName.value) {
227
221
  return void 0;
228
222
  } else if (outputType.value === "pub") {
@@ -317,7 +311,13 @@ var icon_default = _vue.defineComponent.call(void 0, {
317
311
  );
318
312
  }
319
313
  });
314
+ var name = "FangIcon";
315
+ var install = (app) => {
316
+ app.component(name, component);
317
+ };
318
+ var icon_default = component;
319
+
320
320
 
321
321
 
322
322
 
323
- exports.icon_default = icon_default;
323
+ exports.install = install; exports.icon_default = icon_default;
@@ -1,9 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkPUWPNLDYcjs = require('../chunk-PUWPNLDY.cjs');
3
+
4
+ var _chunkVT6RFBVMcjs = require('../chunk-VT6RFBVM.cjs');
4
5
  require('../chunk-IIVF4KK5.cjs');
5
6
  require('../chunk-3376ZTRC.cjs');
6
7
  require('../chunk-75ZPJI57.cjs');
7
8
 
8
9
 
9
- exports.default = _chunkPUWPNLDYcjs.icon_default;
10
+
11
+ exports.default = _chunkVT6RFBVMcjs.icon_default; exports.install = _chunkVT6RFBVMcjs.install;
@@ -1,8 +1,9 @@
1
1
  import * as vue from 'vue';
2
+ import { App } from 'vue';
2
3
 
3
4
  type Flip = 'horizontal' | 'vertical' | 'both' | '';
4
5
  type IconType = 'css' | 'id' | 'img' | 'font' | 'svg' | 'vue' | 'pub';
5
- declare const _default: vue.DefineComponent<vue.ExtractPropTypes<{
6
+ declare const component: vue.DefineComponent<vue.ExtractPropTypes<{
6
7
  /**
7
8
  * @props { String, Object } name= ( )
8
9
  * 图标名称
@@ -131,5 +132,6 @@ declare const _default: vue.DefineComponent<vue.ExtractPropTypes<{
131
132
  directory: string;
132
133
  prefix: string;
133
134
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
135
+ declare const install: (app: App) => void;
134
136
 
135
- export { type Flip, type IconType, _default as default };
137
+ export { type Flip, type IconType, component as default, install };
@@ -1,8 +1,9 @@
1
1
  import * as vue from 'vue';
2
+ import { App } from 'vue';
2
3
 
3
4
  type Flip = 'horizontal' | 'vertical' | 'both' | '';
4
5
  type IconType = 'css' | 'id' | 'img' | 'font' | 'svg' | 'vue' | 'pub';
5
- declare const _default: vue.DefineComponent<vue.ExtractPropTypes<{
6
+ declare const component: vue.DefineComponent<vue.ExtractPropTypes<{
6
7
  /**
7
8
  * @props { String, Object } name= ( )
8
9
  * 图标名称
@@ -131,5 +132,6 @@ declare const _default: vue.DefineComponent<vue.ExtractPropTypes<{
131
132
  directory: string;
132
133
  prefix: string;
133
134
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
135
+ declare const install: (app: App) => void;
134
136
 
135
- export { type Flip, type IconType, _default as default };
137
+ export { type Flip, type IconType, component as default, install };
@@ -1,9 +1,11 @@
1
1
  import {
2
- icon_default
3
- } from "../chunk-WBRCD7JF.js";
2
+ icon_default,
3
+ install
4
+ } from "../chunk-7RAANNNN.js";
4
5
  import "../chunk-MOHILOKE.js";
5
6
  import "../chunk-BYXBJQAS.js";
6
7
  import "../chunk-MLKGABMK.js";
7
8
  export {
8
- icon_default as default
9
+ icon_default as default,
10
+ install
9
11
  };
package/dist/index.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "prefix": "fang-icons",
3
3
  "info": {},
4
- "lastModified": 1767925097356,
4
+ "lastModified": 1767929843933,
5
5
  "icons": {
6
6
  "bar": {
7
7
  "body": "<path d=\"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z\"></path>"
package/dist/json.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk6HCIF5VPcjs = require('./chunk-6HCIF5VP.cjs');
3
+ var _chunkKKEXBY5Bcjs = require('./chunk-KKEXBY5B.cjs');
4
4
  require('./chunk-75ZPJI57.cjs');
5
5
 
6
6
 
7
- exports.default = _chunk6HCIF5VPcjs.json_default;
7
+ exports.default = _chunkKKEXBY5Bcjs.json_default;
package/dist/json.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  var prefix = "fang-icons";
2
2
  var info = {
3
3
  };
4
- var lastModified = 1767925097356;
4
+ var lastModified = 1767929843933;
5
5
  var icons = {
6
6
  bar: {
7
7
  body: "<path d=\"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z\"></path>"
package/dist/json.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  var prefix = "fang-icons";
2
2
  var info = {
3
3
  };
4
- var lastModified = 1767925097356;
4
+ var lastModified = 1767929843933;
5
5
  var icons = {
6
6
  bar: {
7
7
  body: "<path d=\"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z\"></path>"
package/dist/json.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  json_default
3
- } from "./chunk-I2Y4XRQV.js";
3
+ } from "./chunk-UX5LDTMC.js";
4
4
  import "./chunk-MLKGABMK.js";
5
5
  export {
6
6
  json_default as default
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkPUWPNLDYcjs = require('../chunk-PUWPNLDY.cjs');
3
+ var _chunkVT6RFBVMcjs = require('../chunk-VT6RFBVM.cjs');
4
4
  require('../chunk-IIVF4KK5.cjs');
5
5
  require('../chunk-3376ZTRC.cjs');
6
6
 
@@ -84,7 +84,7 @@ var picker_default = _vue.defineComponent.call(void 0, {
84
84
  return props.icon;
85
85
  }
86
86
  } else {
87
- return _chunkPUWPNLDYcjs.icon_default;
87
+ return _chunkVT6RFBVMcjs.icon_default;
88
88
  }
89
89
  });
90
90
  const dialogVue = _vue.computed.call(void 0, () => {
@@ -299,7 +299,7 @@ var picker_default = _vue.defineComponent.call(void 0, {
299
299
  }
300
300
  },
301
301
  [
302
- _vue.h.call(void 0, _chunkPUWPNLDYcjs.icon_default, {
302
+ _vue.h.call(void 0, _chunkVT6RFBVMcjs.icon_default, {
303
303
  style: {
304
304
  margin: "5px",
305
305
  marginBottom: 0,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  icon_default
3
- } from "../chunk-WBRCD7JF.js";
3
+ } from "../chunk-7RAANNNN.js";
4
4
  import "../chunk-MOHILOKE.js";
5
5
  import "../chunk-BYXBJQAS.js";
6
6
  import {
@@ -3,7 +3,7 @@
3
3
  var _chunkYJVFENGGcjs = require('../chunk-YJVFENGG.cjs');
4
4
 
5
5
 
6
- var _chunk6HCIF5VPcjs = require('../chunk-6HCIF5VP.cjs');
6
+ var _chunkKKEXBY5Bcjs = require('../chunk-KKEXBY5B.cjs');
7
7
 
8
8
 
9
9
  var _chunkBXEIRESQcjs = require('../chunk-BXEIRESQ.cjs');
@@ -1222,9 +1222,9 @@ function findComponents(code, name) {
1222
1222
  return components;
1223
1223
  }
1224
1224
  function getText(iconName, match) {
1225
- const svg = _chunkYJVFENGGcjs.getIconifySVG.call(void 0, _chunk6HCIF5VPcjs.json_default, iconName, 'v-bind="scope"');
1225
+ const svg = _chunkYJVFENGGcjs.getIconifySVG.call(void 0, _chunkKKEXBY5Bcjs.json_default, iconName);
1226
1226
  const s = match.fullMatch.replace(`name="${iconName}"`, "").replace(`</${match.componentName}>`, "");
1227
- const text = `${s}<template #default="scope">${svg}</template></${match.componentName}>`;
1227
+ const text = `${s}${svg}</${match.componentName}>`;
1228
1228
  return { text, imptext: "" };
1229
1229
  }
1230
1230
  function getImportName(iconName) {
@@ -1248,7 +1248,7 @@ function replaceComponent(match, type, dynamic, customReplacement) {
1248
1248
  if (customReplacement) {
1249
1249
  return customReplacement(iconName, attributes);
1250
1250
  }
1251
- let svgContent = _chunk6HCIF5VPcjs.json_default.icons[iconName];
1251
+ let svgContent = _chunkKKEXBY5Bcjs.json_default.icons[iconName];
1252
1252
  if (!svgContent) {
1253
1253
  return { text: match.fullMatch, imptext: "" };
1254
1254
  }
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-YGLV5TML.js";
4
4
  import {
5
5
  json_default
6
- } from "../chunk-I2Y4XRQV.js";
6
+ } from "../chunk-UX5LDTMC.js";
7
7
  import {
8
8
  lineToLargeHump
9
9
  } from "../chunk-J4G2OFZ4.js";
@@ -1222,9 +1222,9 @@ function findComponents(code, name) {
1222
1222
  return components;
1223
1223
  }
1224
1224
  function getText(iconName, match) {
1225
- const svg = getIconifySVG(json_default, iconName, 'v-bind="scope"');
1225
+ const svg = getIconifySVG(json_default, iconName);
1226
1226
  const s = match.fullMatch.replace(`name="${iconName}"`, "").replace(`</${match.componentName}>`, "");
1227
- const text = `${s}<template #default="scope">${svg}</template></${match.componentName}>`;
1227
+ const text = `${s}${svg}</${match.componentName}>`;
1228
1228
  return { text, imptext: "" };
1229
1229
  }
1230
1230
  function getImportName(iconName) {
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.32",
5
+ "version": "0.0.34",
6
6
  "description ": "个人图标库",
7
7
  "author": "fangzhongya ",
8
8
  "license": "MIT",