@94ai/nf-svg-icon 3.1.13
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/.eslintrc.cjs +49 -0
- package/README.md +11 -0
- package/components.d.ts +8 -0
- package/lib/index.d.ts +207 -0
- package/lib/nf-svg-icon.cjs.js +120 -0
- package/lib/nf-svg-icon.esm-bundler.js +120 -0
- package/lib/nf-svg-icon.vue.d.ts +74 -0
- package/lib/style/css.d.ts +1 -0
- package/lib/style/css.js +1 -0
- package/lib/style/index.d.ts +1 -0
- package/lib/style/index.js +1 -0
- package/package/index.ts +8 -0
- package/package/nf-svg-icon.vue +108 -0
- package/package/style/css.ts +1 -0
- package/package/style/index.ts +1 -0
- package/package.json +35 -0
- package/postcss.config.js +8 -0
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"root": true,
|
|
3
|
+
"env": {
|
|
4
|
+
"node": true
|
|
5
|
+
},
|
|
6
|
+
"extends": [
|
|
7
|
+
"plugin:vue/essential"
|
|
8
|
+
],
|
|
9
|
+
"parser": "vue-eslint-parser",
|
|
10
|
+
"parserOptions": {
|
|
11
|
+
"parser": "@typescript-eslint/parser",
|
|
12
|
+
"ecmaVersion": 2020,
|
|
13
|
+
"sourceType": "module"
|
|
14
|
+
},
|
|
15
|
+
"rules": {
|
|
16
|
+
"@typescript-eslint/ban-ts-ignore": "off",
|
|
17
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
18
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
19
|
+
"@typescript-eslint/no-var-requires": "off",
|
|
20
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
21
|
+
"vue/custom-event-name-casing": "off",
|
|
22
|
+
"no-use-before-define": "off",
|
|
23
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
24
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
25
|
+
"@typescript-eslint/ban-types": "off",
|
|
26
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
27
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
28
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
29
|
+
"vue/multi-word-component-names": [
|
|
30
|
+
"error",
|
|
31
|
+
{
|
|
32
|
+
"ignores": [
|
|
33
|
+
"index"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"no-console": "warn",
|
|
38
|
+
"no-debugger": "warn",
|
|
39
|
+
"prettier/prettier": [
|
|
40
|
+
"error",
|
|
41
|
+
{
|
|
42
|
+
"tabWidth": 2,
|
|
43
|
+
"singleQuote": true,
|
|
44
|
+
"semi": false,
|
|
45
|
+
"endOfLine": "auto"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
package/README.md
ADDED
package/components.d.ts
ADDED
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { PluginObject } from 'vue-demi';
|
|
2
|
+
declare const _default: import("vue/types/v3-component-public-instance").ComponentPublicInstanceConstructor<import("vue/types/v3-component-public-instance").Vue3Instance<{}, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
3
|
+
prefix: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
name: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
color: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
bgColor: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
outerSize: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
innerSize: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
cursor: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
}>>, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
32
|
+
prefix: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
name: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
color: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
bgColor: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
outerSize: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
innerSize: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
cursor: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
}>>, {}, {
|
|
61
|
+
color: string;
|
|
62
|
+
cursor: string;
|
|
63
|
+
prefix: string;
|
|
64
|
+
bgColor: string;
|
|
65
|
+
outerSize: string;
|
|
66
|
+
innerSize: string;
|
|
67
|
+
}, true, import("vue/types/v3-component-options").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import("vue-demi").ExtractPropTypes<{
|
|
68
|
+
prefix: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
default: string;
|
|
71
|
+
};
|
|
72
|
+
name: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
required: true;
|
|
75
|
+
};
|
|
76
|
+
color: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
default: string;
|
|
79
|
+
};
|
|
80
|
+
bgColor: {
|
|
81
|
+
type: StringConstructor;
|
|
82
|
+
default: string;
|
|
83
|
+
};
|
|
84
|
+
outerSize: {
|
|
85
|
+
type: StringConstructor;
|
|
86
|
+
default: string;
|
|
87
|
+
};
|
|
88
|
+
innerSize: {
|
|
89
|
+
type: StringConstructor;
|
|
90
|
+
default: string;
|
|
91
|
+
};
|
|
92
|
+
cursor: {
|
|
93
|
+
type: StringConstructor;
|
|
94
|
+
default: string;
|
|
95
|
+
};
|
|
96
|
+
}>>> & import("vue-demi").ShallowUnwrapRef<{
|
|
97
|
+
symbolId: import("vue-demi").ComputedRef<string>;
|
|
98
|
+
outerSizeNumber: import("vue-demi").ComputedRef<number>;
|
|
99
|
+
innerSizeNumber: import("vue-demi").ComputedRef<number>;
|
|
100
|
+
outerSizePx: import("vue-demi").ComputedRef<string>;
|
|
101
|
+
hoverBgColor: import("vue-demi").ComputedRef<string | undefined>;
|
|
102
|
+
hoverColor: import("vue-demi").ComputedRef<string | undefined>;
|
|
103
|
+
}> & import("vue/types/v3-component-options").ExtractComputedReturns<{}> & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{
|
|
104
|
+
prefix: {
|
|
105
|
+
type: StringConstructor;
|
|
106
|
+
default: string;
|
|
107
|
+
};
|
|
108
|
+
name: {
|
|
109
|
+
type: StringConstructor;
|
|
110
|
+
required: true;
|
|
111
|
+
};
|
|
112
|
+
color: {
|
|
113
|
+
type: StringConstructor;
|
|
114
|
+
default: string;
|
|
115
|
+
};
|
|
116
|
+
bgColor: {
|
|
117
|
+
type: StringConstructor;
|
|
118
|
+
default: string;
|
|
119
|
+
};
|
|
120
|
+
outerSize: {
|
|
121
|
+
type: StringConstructor;
|
|
122
|
+
default: string;
|
|
123
|
+
};
|
|
124
|
+
innerSize: {
|
|
125
|
+
type: StringConstructor;
|
|
126
|
+
default: string;
|
|
127
|
+
};
|
|
128
|
+
cursor: {
|
|
129
|
+
type: StringConstructor;
|
|
130
|
+
default: string;
|
|
131
|
+
};
|
|
132
|
+
}>>, any, any, any, import("vue-demi").ComponentComputedOptions, import("vue-demi").ComponentMethodOptions> & import("vue/types/v3-component-options").ComponentOptionsBase<Readonly<import("vue-demi").ExtractPropTypes<{
|
|
133
|
+
prefix: {
|
|
134
|
+
type: StringConstructor;
|
|
135
|
+
default: string;
|
|
136
|
+
};
|
|
137
|
+
name: {
|
|
138
|
+
type: StringConstructor;
|
|
139
|
+
required: true;
|
|
140
|
+
};
|
|
141
|
+
color: {
|
|
142
|
+
type: StringConstructor;
|
|
143
|
+
default: string;
|
|
144
|
+
};
|
|
145
|
+
bgColor: {
|
|
146
|
+
type: StringConstructor;
|
|
147
|
+
default: string;
|
|
148
|
+
};
|
|
149
|
+
outerSize: {
|
|
150
|
+
type: StringConstructor;
|
|
151
|
+
default: string;
|
|
152
|
+
};
|
|
153
|
+
innerSize: {
|
|
154
|
+
type: StringConstructor;
|
|
155
|
+
default: string;
|
|
156
|
+
};
|
|
157
|
+
cursor: {
|
|
158
|
+
type: StringConstructor;
|
|
159
|
+
default: string;
|
|
160
|
+
};
|
|
161
|
+
}>>, {
|
|
162
|
+
symbolId: import("vue-demi").ComputedRef<string>;
|
|
163
|
+
outerSizeNumber: import("vue-demi").ComputedRef<number>;
|
|
164
|
+
innerSizeNumber: import("vue-demi").ComputedRef<number>;
|
|
165
|
+
outerSizePx: import("vue-demi").ComputedRef<string>;
|
|
166
|
+
hoverBgColor: import("vue-demi").ComputedRef<string | undefined>;
|
|
167
|
+
hoverColor: import("vue-demi").ComputedRef<string | undefined>;
|
|
168
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, {
|
|
169
|
+
color: string;
|
|
170
|
+
cursor: string;
|
|
171
|
+
prefix: string;
|
|
172
|
+
bgColor: string;
|
|
173
|
+
outerSize: string;
|
|
174
|
+
innerSize: string;
|
|
175
|
+
}> & {
|
|
176
|
+
props: {
|
|
177
|
+
prefix: {
|
|
178
|
+
type: StringConstructor;
|
|
179
|
+
default: string;
|
|
180
|
+
};
|
|
181
|
+
name: {
|
|
182
|
+
type: StringConstructor;
|
|
183
|
+
required: true;
|
|
184
|
+
};
|
|
185
|
+
color: {
|
|
186
|
+
type: StringConstructor;
|
|
187
|
+
default: string;
|
|
188
|
+
};
|
|
189
|
+
bgColor: {
|
|
190
|
+
type: StringConstructor;
|
|
191
|
+
default: string;
|
|
192
|
+
};
|
|
193
|
+
outerSize: {
|
|
194
|
+
type: StringConstructor;
|
|
195
|
+
default: string;
|
|
196
|
+
};
|
|
197
|
+
innerSize: {
|
|
198
|
+
type: StringConstructor;
|
|
199
|
+
default: string;
|
|
200
|
+
};
|
|
201
|
+
cursor: {
|
|
202
|
+
type: StringConstructor;
|
|
203
|
+
default: string;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
} & PluginObject<undefined>;
|
|
207
|
+
export default _default;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
"use strict";
|
|
3
|
+
try {
|
|
4
|
+
if (typeof document != "undefined") {
|
|
5
|
+
var elementStyle = document.createElement("style");
|
|
6
|
+
elementStyle.appendChild(document.createTextNode(".nf-svg-icon[data-v-1a2d52cd] {\n width: var(--0a19ef0e);\n height: var(--0a19ef0e);\n cursor: var(--2ffc404c)!important;\n background-color: var(--ffacf030);\n color: var(--e426e8a6);\n position: relative;\n fill: currentColor;\n vertical-align: -2px;\n}\n.nf-svg-icon[data-v-1a2d52cd]:focus {\n outline: none;\n}\n.nf-svg-icon[data-v-1a2d52cd]:hover {\n background-color: var(--366d3490);\n//color: var(--65899d7d)\n}"));
|
|
7
|
+
document.head.appendChild(elementStyle);
|
|
8
|
+
}
|
|
9
|
+
} catch (e) {
|
|
10
|
+
console.error("vite-plugin-css-injected-by-js", e);
|
|
11
|
+
}
|
|
12
|
+
})();
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
15
|
+
const vueDemi = require("vue-demi");
|
|
16
|
+
const commonUtils = require("@94ai/common-utils");
|
|
17
|
+
const vue = require("vue");
|
|
18
|
+
const vue2RuntimeHelpers = require("@94ai/vue2-runtime-helpers");
|
|
19
|
+
const __default__ = vueDemi.defineComponent({
|
|
20
|
+
name: "nf-svg-icon",
|
|
21
|
+
props: {
|
|
22
|
+
prefix: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "icon"
|
|
25
|
+
},
|
|
26
|
+
name: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
color: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "#333"
|
|
33
|
+
},
|
|
34
|
+
bgColor: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "transparent"
|
|
37
|
+
},
|
|
38
|
+
outerSize: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "35px"
|
|
41
|
+
},
|
|
42
|
+
innerSize: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: "14px"
|
|
45
|
+
},
|
|
46
|
+
cursor: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "auto"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
setup(props) {
|
|
52
|
+
const symbolId = vueDemi.computed(() => {
|
|
53
|
+
return `#${props.prefix}-${props.name}`;
|
|
54
|
+
});
|
|
55
|
+
const outerSizeNumber = vueDemi.computed(() => {
|
|
56
|
+
return parseInt(props.outerSize);
|
|
57
|
+
});
|
|
58
|
+
const innerSizeNumber = vueDemi.computed(() => {
|
|
59
|
+
return parseInt(props.innerSize);
|
|
60
|
+
});
|
|
61
|
+
const outerSizePx = vueDemi.computed(() => {
|
|
62
|
+
return `${outerSizeNumber.value}px`;
|
|
63
|
+
});
|
|
64
|
+
const hoverBgColor = vueDemi.computed(() => {
|
|
65
|
+
return commonUtils.getDarkColor(props.bgColor, 0.03);
|
|
66
|
+
});
|
|
67
|
+
const hoverColor = vueDemi.computed(() => {
|
|
68
|
+
return commonUtils.getLightColor(props.color, 0.9);
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
symbolId,
|
|
72
|
+
outerSizeNumber,
|
|
73
|
+
innerSizeNumber,
|
|
74
|
+
outerSizePx,
|
|
75
|
+
hoverBgColor,
|
|
76
|
+
hoverColor
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
const __injectCSSVars__ = () => {
|
|
81
|
+
vue.useCssVars((_vm, _setup) => ({
|
|
82
|
+
"0a19ef0e": _vm.outerSizePx,
|
|
83
|
+
"2ffc404c": _vm.cursor,
|
|
84
|
+
"ffacf030": _vm.bgColor,
|
|
85
|
+
"e426e8a6": _vm.color,
|
|
86
|
+
"366d3490": _vm.hoverBgColor,
|
|
87
|
+
"65899d7d": _vm.hoverColor
|
|
88
|
+
}));
|
|
89
|
+
};
|
|
90
|
+
const __setup__ = __default__.setup;
|
|
91
|
+
__default__.setup = __setup__ ? (props, ctx) => {
|
|
92
|
+
__injectCSSVars__();
|
|
93
|
+
return __setup__(props, ctx);
|
|
94
|
+
} : __injectCSSVars__;
|
|
95
|
+
const nfSvgIcon_vue_vue_type_style_index_0_scoped_1a2d52cd_lang = "";
|
|
96
|
+
var _sfc_render = function render() {
|
|
97
|
+
var _vm = this, _c = _vm._self._c;
|
|
98
|
+
_vm._self._setupProxy;
|
|
99
|
+
return _c("svg", _vm._b({
|
|
100
|
+
staticClass: "nf-svg-icon",
|
|
101
|
+
attrs: {
|
|
102
|
+
"aria-hidden": "true",
|
|
103
|
+
"viewBox": `-${_vm.outerSizeNumber / 2 - _vm.innerSizeNumber / 2} -${_vm.outerSizeNumber / 2 - _vm.innerSizeNumber / 2} ${_vm.outerSizeNumber} ${_vm.outerSizeNumber}`
|
|
104
|
+
}
|
|
105
|
+
}, "svg", _vm.$attrs, false), [_c("use", {
|
|
106
|
+
attrs: {
|
|
107
|
+
"width": _vm.innerSize,
|
|
108
|
+
"height": _vm.innerSize,
|
|
109
|
+
"xlink:href": _vm.symbolId,
|
|
110
|
+
"fill": _vm.color
|
|
111
|
+
}
|
|
112
|
+
})]);
|
|
113
|
+
};
|
|
114
|
+
var _sfc_staticRenderFns = [];
|
|
115
|
+
var __component__ = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(__default__, _sfc_render, _sfc_staticRenderFns, false, null, "1a2d52cd", null, null);
|
|
116
|
+
const NfSvgIcon = __component__.exports;
|
|
117
|
+
NfSvgIcon.install = (app) => {
|
|
118
|
+
app.component("nf-svg-icon", NfSvgIcon);
|
|
119
|
+
};
|
|
120
|
+
exports.default = NfSvgIcon;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
"use strict";
|
|
3
|
+
try {
|
|
4
|
+
if (typeof document != "undefined") {
|
|
5
|
+
var elementStyle = document.createElement("style");
|
|
6
|
+
elementStyle.appendChild(document.createTextNode(".nf-svg-icon[data-v-1a2d52cd] {\n width: var(--0a19ef0e);\n height: var(--0a19ef0e);\n cursor: var(--2ffc404c)!important;\n background-color: var(--ffacf030);\n color: var(--e426e8a6);\n position: relative;\n fill: currentColor;\n vertical-align: -2px;\n}\n.nf-svg-icon[data-v-1a2d52cd]:focus {\n outline: none;\n}\n.nf-svg-icon[data-v-1a2d52cd]:hover {\n background-color: var(--366d3490);\n//color: var(--65899d7d)\n}"));
|
|
7
|
+
document.head.appendChild(elementStyle);
|
|
8
|
+
}
|
|
9
|
+
} catch (e) {
|
|
10
|
+
console.error("vite-plugin-css-injected-by-js", e);
|
|
11
|
+
}
|
|
12
|
+
})();
|
|
13
|
+
import { defineComponent, computed } from "vue-demi";
|
|
14
|
+
import { getDarkColor, getLightColor } from "@94ai/common-utils";
|
|
15
|
+
import { useCssVars } from "vue";
|
|
16
|
+
import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
|
|
17
|
+
const __default__ = defineComponent({
|
|
18
|
+
name: "nf-svg-icon",
|
|
19
|
+
props: {
|
|
20
|
+
prefix: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "icon"
|
|
23
|
+
},
|
|
24
|
+
name: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
color: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "#333"
|
|
31
|
+
},
|
|
32
|
+
bgColor: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "transparent"
|
|
35
|
+
},
|
|
36
|
+
outerSize: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "35px"
|
|
39
|
+
},
|
|
40
|
+
innerSize: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: "14px"
|
|
43
|
+
},
|
|
44
|
+
cursor: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "auto"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
setup(props) {
|
|
50
|
+
const symbolId = computed(() => {
|
|
51
|
+
return `#${props.prefix}-${props.name}`;
|
|
52
|
+
});
|
|
53
|
+
const outerSizeNumber = computed(() => {
|
|
54
|
+
return parseInt(props.outerSize);
|
|
55
|
+
});
|
|
56
|
+
const innerSizeNumber = computed(() => {
|
|
57
|
+
return parseInt(props.innerSize);
|
|
58
|
+
});
|
|
59
|
+
const outerSizePx = computed(() => {
|
|
60
|
+
return `${outerSizeNumber.value}px`;
|
|
61
|
+
});
|
|
62
|
+
const hoverBgColor = computed(() => {
|
|
63
|
+
return getDarkColor(props.bgColor, 0.03);
|
|
64
|
+
});
|
|
65
|
+
const hoverColor = computed(() => {
|
|
66
|
+
return getLightColor(props.color, 0.9);
|
|
67
|
+
});
|
|
68
|
+
return {
|
|
69
|
+
symbolId,
|
|
70
|
+
outerSizeNumber,
|
|
71
|
+
innerSizeNumber,
|
|
72
|
+
outerSizePx,
|
|
73
|
+
hoverBgColor,
|
|
74
|
+
hoverColor
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
const __injectCSSVars__ = () => {
|
|
79
|
+
useCssVars((_vm, _setup) => ({
|
|
80
|
+
"0a19ef0e": _vm.outerSizePx,
|
|
81
|
+
"2ffc404c": _vm.cursor,
|
|
82
|
+
"ffacf030": _vm.bgColor,
|
|
83
|
+
"e426e8a6": _vm.color,
|
|
84
|
+
"366d3490": _vm.hoverBgColor,
|
|
85
|
+
"65899d7d": _vm.hoverColor
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
const __setup__ = __default__.setup;
|
|
89
|
+
__default__.setup = __setup__ ? (props, ctx) => {
|
|
90
|
+
__injectCSSVars__();
|
|
91
|
+
return __setup__(props, ctx);
|
|
92
|
+
} : __injectCSSVars__;
|
|
93
|
+
const nfSvgIcon_vue_vue_type_style_index_0_scoped_1a2d52cd_lang = "";
|
|
94
|
+
var _sfc_render = function render() {
|
|
95
|
+
var _vm = this, _c = _vm._self._c;
|
|
96
|
+
_vm._self._setupProxy;
|
|
97
|
+
return _c("svg", _vm._b({
|
|
98
|
+
staticClass: "nf-svg-icon",
|
|
99
|
+
attrs: {
|
|
100
|
+
"aria-hidden": "true",
|
|
101
|
+
"viewBox": `-${_vm.outerSizeNumber / 2 - _vm.innerSizeNumber / 2} -${_vm.outerSizeNumber / 2 - _vm.innerSizeNumber / 2} ${_vm.outerSizeNumber} ${_vm.outerSizeNumber}`
|
|
102
|
+
}
|
|
103
|
+
}, "svg", _vm.$attrs, false), [_c("use", {
|
|
104
|
+
attrs: {
|
|
105
|
+
"width": _vm.innerSize,
|
|
106
|
+
"height": _vm.innerSize,
|
|
107
|
+
"xlink:href": _vm.symbolId,
|
|
108
|
+
"fill": _vm.color
|
|
109
|
+
}
|
|
110
|
+
})]);
|
|
111
|
+
};
|
|
112
|
+
var _sfc_staticRenderFns = [];
|
|
113
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(__default__, _sfc_render, _sfc_staticRenderFns, false, null, "1a2d52cd", null, null);
|
|
114
|
+
const NfSvgIcon = __component__.exports;
|
|
115
|
+
NfSvgIcon.install = (app) => {
|
|
116
|
+
app.component("nf-svg-icon", NfSvgIcon);
|
|
117
|
+
};
|
|
118
|
+
export {
|
|
119
|
+
NfSvgIcon as default
|
|
120
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
declare const _default: import("vue-demi").DefineComponent<{
|
|
2
|
+
prefix: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
name: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
color: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
bgColor: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
outerSize: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
innerSize: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
cursor: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
}, {
|
|
31
|
+
symbolId: import("vue-demi").ComputedRef<string>;
|
|
32
|
+
outerSizeNumber: import("vue-demi").ComputedRef<number>;
|
|
33
|
+
innerSizeNumber: import("vue-demi").ComputedRef<number>;
|
|
34
|
+
outerSizePx: import("vue-demi").ComputedRef<string>;
|
|
35
|
+
hoverBgColor: import("vue-demi").ComputedRef<string | undefined>;
|
|
36
|
+
hoverColor: import("vue-demi").ComputedRef<string | undefined>;
|
|
37
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
38
|
+
prefix: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
name: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
color: {
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
50
|
+
bgColor: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
54
|
+
outerSize: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
innerSize: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
62
|
+
cursor: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
}>>, {
|
|
67
|
+
color: string;
|
|
68
|
+
cursor: string;
|
|
69
|
+
prefix: string;
|
|
70
|
+
bgColor: string;
|
|
71
|
+
outerSize: string;
|
|
72
|
+
innerSize: string;
|
|
73
|
+
}>;
|
|
74
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/lib/style/css.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@94ai/nf-theme-chalk/lib/css/nf-svg-icon.css'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@94ai/nf-theme-chalk/lib/nf-svg-icon.scss'
|
package/package/index.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
class="nf-svg-icon"
|
|
4
|
+
aria-hidden="true"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
:viewBox="`-${outerSizeNumber/2-innerSizeNumber/2} -${outerSizeNumber/2-innerSizeNumber/2} ${outerSizeNumber} ${outerSizeNumber}`"
|
|
7
|
+
>
|
|
8
|
+
<use
|
|
9
|
+
:width="innerSize"
|
|
10
|
+
:height="innerSize"
|
|
11
|
+
:xlink:href="symbolId"
|
|
12
|
+
:fill="color"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
import { defineComponent, computed } from 'vue-demi'
|
|
19
|
+
import {
|
|
20
|
+
getDarkColor,
|
|
21
|
+
getLightColor
|
|
22
|
+
} from '@94ai/common-utils'
|
|
23
|
+
|
|
24
|
+
export default defineComponent({
|
|
25
|
+
name: 'nf-svg-icon',
|
|
26
|
+
props: {
|
|
27
|
+
prefix: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: 'icon'
|
|
30
|
+
},
|
|
31
|
+
name: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
color: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: '#333'
|
|
38
|
+
},
|
|
39
|
+
bgColor: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: 'transparent'
|
|
42
|
+
},
|
|
43
|
+
outerSize: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: '35px'
|
|
46
|
+
},
|
|
47
|
+
innerSize: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '14px'
|
|
50
|
+
},
|
|
51
|
+
cursor: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: 'auto'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
setup (props) {
|
|
57
|
+
const symbolId = computed(() => {
|
|
58
|
+
return `#${props.prefix}-${props.name}`
|
|
59
|
+
})
|
|
60
|
+
const outerSizeNumber = computed(() => {
|
|
61
|
+
return parseInt(props.outerSize)
|
|
62
|
+
})
|
|
63
|
+
const innerSizeNumber = computed(() => {
|
|
64
|
+
return parseInt(props.innerSize)
|
|
65
|
+
})
|
|
66
|
+
const outerSizePx = computed(() => {
|
|
67
|
+
return `${outerSizeNumber.value}px`
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const hoverBgColor = computed(() => {
|
|
71
|
+
return getDarkColor(props.bgColor, 0.03)
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
const hoverColor = computed(() => {
|
|
75
|
+
return getLightColor(props.color, 0.9)
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
symbolId,
|
|
80
|
+
outerSizeNumber,
|
|
81
|
+
innerSizeNumber,
|
|
82
|
+
outerSizePx,
|
|
83
|
+
hoverBgColor,
|
|
84
|
+
hoverColor
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
</script>
|
|
89
|
+
<style scoped>
|
|
90
|
+
.nf-svg-icon {
|
|
91
|
+
width: v-bind(outerSizePx);
|
|
92
|
+
height: v-bind(outerSizePx);
|
|
93
|
+
cursor: v-bind(cursor)!important;
|
|
94
|
+
background-color: v-bind(bgColor);
|
|
95
|
+
color: v-bind(color);
|
|
96
|
+
position: relative;
|
|
97
|
+
fill: currentColor;
|
|
98
|
+
vertical-align: -2px;
|
|
99
|
+
}
|
|
100
|
+
.nf-svg-icon:focus {
|
|
101
|
+
outline: none;
|
|
102
|
+
}
|
|
103
|
+
.nf-svg-icon:hover {
|
|
104
|
+
background-color: v-bind(hoverBgColor);
|
|
105
|
+
//color: v-bind(hoverColor)
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
108
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@94ai/nf-theme-chalk/lib/css/nf-svg-icon.css'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@94ai/nf-theme-chalk/lib/nf-svg-icon.scss'
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@94ai/nf-svg-icon",
|
|
3
|
+
"version": "3.1.13",
|
|
4
|
+
"description": "> TODO: description",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
7
|
+
"homepage": "https://oss.xccjh.top/common-ui/#/ai-index",
|
|
8
|
+
"license": "ISC",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "http://94ai.gitlab.com/ui/common-ui.git"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@94ai/common-utils": "^3.1.13",
|
|
18
|
+
"@94ai/nf-theme-chalk": "^3.1.13",
|
|
19
|
+
"vue-demi": "^0.14.5"
|
|
20
|
+
},
|
|
21
|
+
"peerDependenciesMeta": {
|
|
22
|
+
"@vue/composition-api": {
|
|
23
|
+
"optional": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@vue/composition-api": "^1.0.0-rc.1",
|
|
28
|
+
"element-ui": ">=2.13.2",
|
|
29
|
+
"vue": "^2.0.0 || >=3.0.0"
|
|
30
|
+
},
|
|
31
|
+
"types": "lib/index.d.ts",
|
|
32
|
+
"main": "lib/nf-svg-icon.cjs.js",
|
|
33
|
+
"module": "lib/nf-svg-icon.esm-bundler.js",
|
|
34
|
+
"gitHead": "a8c56183ccc8e979008e2d38bfde2d7d1448654c"
|
|
35
|
+
}
|