@94ai/nf-svg-icon 3.2.48 → 3.2.51

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.
@@ -64,11 +64,11 @@ declare const _default: import("vue-demi").DefineComponent<{
64
64
  default: string;
65
65
  };
66
66
  }>>, {
67
- prefix: string;
68
67
  color: string;
68
+ cursor: string;
69
+ prefix: string;
69
70
  bgColor: string;
70
71
  outerSize: string;
71
72
  innerSize: string;
72
- cursor: string;
73
73
  }>;
74
74
  export default _default;
@@ -19,7 +19,7 @@ import { defineComponent, computed } from 'vue-demi'
19
19
  import {
20
20
  getDarkColor,
21
21
  getLightColor
22
- } from './utils'
22
+ } from '@94ai/common-utils'
23
23
 
24
24
  export default defineComponent({
25
25
  name: 'nf-svg-icon',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-svg-icon",
3
- "version": "3.2.48",
3
+ "version": "3.2.51",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -14,7 +14,8 @@
14
14
  "url": "http://94ai.gitlab.com/ui/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/nf-theme-chalk": "^3.2.48",
17
+ "@94ai/common-utils": "^3.2.51",
18
+ "@94ai/nf-theme-chalk": "^3.2.51",
18
19
  "vue-demi": "^0.14.5"
19
20
  },
20
21
  "peerDependenciesMeta": {
@@ -30,5 +31,5 @@
30
31
  "types": "lib/index.d.ts",
31
32
  "main": "lib/nf-svg-icon.cjs.js",
32
33
  "module": "lib/nf-svg-icon.esm-bundler.js",
33
- "gitHead": "91145bb7df8dad2c0cb3eefb101c6158ec854269"
34
+ "gitHead": "1c4b9d8c3b8c416274a210124bf9f5f75ce01c73"
34
35
  }
package/lib/utils.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export declare function HexToRgb(str: string): RegExpMatchArray | null | undefined;
2
- export declare function RgbToHex(a: number, b: number, c: number): string | undefined;
3
- export declare function getDarkColor(color: string, level: number): string | undefined;
4
- export declare function getLightColor(color: string, level: number): string | undefined;
package/package/utils.ts DELETED
@@ -1,69 +0,0 @@
1
- /**
2
- * hex颜色转rgb颜色
3
- * @param str
4
- * @constructor
5
- */
6
- export function HexToRgb (str: string) {
7
- const r = /^#?[0-9A-Fa-f]{6}$/
8
- // test方法检查在字符串中是否存在一个模式,如果存在则返回true,否则返回false
9
- if (!r.test(str)) return
10
- // replace替换查找的到的字符串
11
- str = str.replace('#', '')
12
- // match得到查询数组
13
- const hxs = str.match(/../g)
14
- // alert('bf:'+hxs)
15
- for (let i = 0; i < 3; i++) { // @ts-ignore
16
- hxs[i] = parseInt(hxs[i], 16)
17
- }
18
- // alert(parseInt(80, 16))
19
- // console.log(hxs);
20
- return hxs
21
- }
22
-
23
- /**
24
- * GRB颜色转Hex颜色
25
- * @param a
26
- * @param b
27
- * @param c
28
- * @constructor
29
- */
30
- export function RgbToHex (a: number, b: number, c: number) {
31
- const r = /^\d{1,3}$/
32
- if (!r.test(String(a)) || !r.test(String(b)) || !r.test(String(c))) return
33
- const hexs = [a.toString(16), b.toString(16), c.toString(16)]
34
- for (let i = 0; i < 3; i++) if (hexs[i].length === 1) hexs[i] = '0' + hexs[i]
35
- return '#' + hexs.join('')
36
- }
37
-
38
- /**
39
- * 得到hex颜色值为color的加深颜色值,level为加深的程度,限0-1之间
40
- * @param color
41
- * @param level
42
- */
43
- export function getDarkColor (color: string, level:number) {
44
- const r = /^#?[0-9A-Fa-f]{6}$/
45
- if (!r.test(color)) return color
46
- const rgbc = HexToRgb(color)
47
- // floor 向下取整
48
- for (let i = 0; i < 3; i++) { // @ts-ignore
49
- rgbc[i] = Math.floor(rgbc[i] * (1 - level))
50
- }
51
- // @ts-ignore
52
- return RgbToHex(rgbc[0], rgbc[1], rgbc[2])
53
- }
54
-
55
- /**
56
- * 得到hex颜色值为color的减淡颜色值,level为加深的程度,限0-1之间
57
- * @param color
58
- * @param level
59
- */
60
- export function getLightColor (color: string, level: number) {
61
- const r = /^#?[0-9A-Fa-f]{6}$/
62
- if (!r.test(color)) return color
63
- const rgbc = HexToRgb(color)
64
- for (let i = 0; i < 3; i++) { // @ts-ignore
65
- rgbc[i] = Math.floor((255 - rgbc[i]) * level + rgbc[i])
66
- }
67
- // @ts-ignore
68
- return RgbToHex(rgbc[0], rgbc[1], rgbc[2])
69
- }