xt-element-ui 1.0.7 → 1.0.9
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/lib/index.common.js +628 -377
- package/lib/index.css +1 -1
- package/lib/index.umd.js +628 -377
- package/lib/index.umd.min.js +1 -1
- package/package.json +2 -2
- package/src/components/button/index.vue +48 -15
- package/src/components/button/style/index.scss +130 -0
- package/src/components/card/index.vue +20 -41
- package/src/components/card/style/index.scss +49 -0
- package/src/components/card-item/index.vue +85 -40
- package/src/components/card-item/style/index.scss +72 -0
- package/src/components/config-provider/index.js +2 -0
- package/src/components/config-provider/index.vue +176 -0
- package/src/components/config-provider/style/index.scss +12 -0
- package/src/components/flex-box/index.vue +21 -91
- package/src/components/flex-box/style/index.scss +91 -0
- package/src/components/index.scss +19 -0
- package/src/components/input/index.vue +28 -11
- package/src/components/input/style/index.scss +27 -0
- package/src/index.js +65 -122
- package/src/styles/export.scss +1 -1
- package/src/styles/theme/bg.scss +6 -0
- package/src/styles/theme/border.scss +4 -0
- package/src/styles/theme/color.scss +11 -0
- package/src/styles/theme/component.scss +70 -0
- package/src/styles/theme/dark.scss +29 -0
- package/src/styles/theme/font.scss +10 -0
- package/src/styles/theme/index.scss +11 -0
- package/src/styles/theme/radius.scss +4 -0
- package/src/styles/theme/shadow.scss +3 -0
- package/src/styles/theme/spacing.scss +5 -0
- package/src/styles/theme/text.scss +5 -0
- package/src/styles/theme/transition.scss +3 -0
- package/src/styles/theme-element.scss +0 -10
- package/src/styles/variables.scss +1 -119
- package/src/styles/vars.scss +168 -0
- package/src/utils/index.js +195 -124
- package/src/styles/theme.scss +0 -128
package/lib/index.umd.js
CHANGED
|
@@ -96,35 +96,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
96
96
|
/************************************************************************/
|
|
97
97
|
/******/ ({
|
|
98
98
|
|
|
99
|
-
/***/ "1809":
|
|
100
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
101
|
-
|
|
102
|
-
// extracted by mini-css-extract-plugin
|
|
103
|
-
|
|
104
|
-
/***/ }),
|
|
105
|
-
|
|
106
|
-
/***/ "1e2e":
|
|
107
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
108
|
-
|
|
109
|
-
"use strict";
|
|
110
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_2a9eeb9d_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("b7a7");
|
|
111
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_2a9eeb9d_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_2a9eeb9d_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
|
|
112
|
-
/* unused harmony reexport * */
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
/***/ }),
|
|
116
|
-
|
|
117
|
-
/***/ "2580":
|
|
118
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
119
|
-
|
|
120
|
-
"use strict";
|
|
121
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_3d0e4bcc_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1809");
|
|
122
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_3d0e4bcc_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_3d0e4bcc_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
|
|
123
|
-
/* unused harmony reexport * */
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
/***/ }),
|
|
127
|
-
|
|
128
99
|
/***/ "27fd":
|
|
129
100
|
/***/ (function(module, exports, __webpack_require__) {
|
|
130
101
|
|
|
@@ -133,25 +104,14 @@ module.exports = {"xtColorPrimary":"#409EFF","xtColorSuccess":"#67C23A","xtColor
|
|
|
133
104
|
|
|
134
105
|
/***/ }),
|
|
135
106
|
|
|
136
|
-
/***/ "
|
|
137
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
138
|
-
|
|
139
|
-
"use strict";
|
|
140
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_617fe54e_prod_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("991c");
|
|
141
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_617fe54e_prod_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_617fe54e_prod_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
|
|
142
|
-
/* unused harmony reexport * */
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
/***/ }),
|
|
146
|
-
|
|
147
|
-
/***/ "991c":
|
|
107
|
+
/***/ "7fc4":
|
|
148
108
|
/***/ (function(module, exports, __webpack_require__) {
|
|
149
109
|
|
|
150
110
|
// extracted by mini-css-extract-plugin
|
|
151
111
|
|
|
152
112
|
/***/ }),
|
|
153
113
|
|
|
154
|
-
/***/ "
|
|
114
|
+
/***/ "d67a":
|
|
155
115
|
/***/ (function(module, exports, __webpack_require__) {
|
|
156
116
|
|
|
157
117
|
// extracted by mini-css-extract-plugin
|
|
@@ -166,18 +126,18 @@ module.exports = {"xtColorPrimary":"#409EFF","xtColorSuccess":"#67C23A","xtColor
|
|
|
166
126
|
__webpack_require__.r(__webpack_exports__);
|
|
167
127
|
|
|
168
128
|
// EXPORTS
|
|
169
|
-
__webpack_require__.d(__webpack_exports__, "utils", function() { return /* reexport */
|
|
129
|
+
__webpack_require__.d(__webpack_exports__, "utils", function() { return /* reexport */ src_utils; });
|
|
170
130
|
__webpack_require__.d(__webpack_exports__, "variables", function() { return /* reexport */ export_default.a; });
|
|
171
131
|
__webpack_require__.d(__webpack_exports__, "getConfig", function() { return /* reexport */ src_getConfig; });
|
|
172
132
|
__webpack_require__.d(__webpack_exports__, "setConfig", function() { return /* reexport */ src_setConfig; });
|
|
173
|
-
__webpack_require__.d(__webpack_exports__, "setTheme", function() { return /* reexport */ src_setTheme; });
|
|
174
|
-
__webpack_require__.d(__webpack_exports__, "setSize", function() { return /* reexport */ src_setSize; });
|
|
175
|
-
__webpack_require__.d(__webpack_exports__, "setPrimaryColor", function() { return /* reexport */ src_setPrimaryColor; });
|
|
176
133
|
__webpack_require__.d(__webpack_exports__, "getTheme", function() { return /* reexport */ src_getTheme; });
|
|
177
134
|
__webpack_require__.d(__webpack_exports__, "getSize", function() { return /* reexport */ src_getSize; });
|
|
178
135
|
__webpack_require__.d(__webpack_exports__, "getPrimaryColor", function() { return /* reexport */ src_getPrimaryColor; });
|
|
179
136
|
__webpack_require__.d(__webpack_exports__, "resetConfig", function() { return /* reexport */ src_resetConfig; });
|
|
180
137
|
__webpack_require__.d(__webpack_exports__, "onConfigChange", function() { return /* reexport */ src_onConfigChange; });
|
|
138
|
+
__webpack_require__.d(__webpack_exports__, "setTheme", function() { return /* reexport */ src_setTheme; });
|
|
139
|
+
__webpack_require__.d(__webpack_exports__, "setSize", function() { return /* reexport */ src_setSize; });
|
|
140
|
+
__webpack_require__.d(__webpack_exports__, "setPrimaryColor", function() { return /* reexport */ src_setPrimaryColor; });
|
|
181
141
|
|
|
182
142
|
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
|
183
143
|
// This file is imported into lib/wc client bundles.
|
|
@@ -195,154 +155,258 @@ if (typeof window !== 'undefined') {
|
|
|
195
155
|
// Indicate to webpack that this file can be concatenated
|
|
196
156
|
/* harmony default export */ var setPublicPath = (null);
|
|
197
157
|
|
|
158
|
+
// EXTERNAL MODULE: ./src/styles/vars.scss
|
|
159
|
+
var vars = __webpack_require__("7fc4");
|
|
160
|
+
|
|
161
|
+
// EXTERNAL MODULE: ./src/components/index.scss
|
|
162
|
+
var components = __webpack_require__("d67a");
|
|
163
|
+
|
|
198
164
|
// EXTERNAL MODULE: ./src/styles/export.scss
|
|
199
165
|
var styles_export = __webpack_require__("27fd");
|
|
200
166
|
var export_default = /*#__PURE__*/__webpack_require__.n(styles_export);
|
|
201
167
|
|
|
202
168
|
// CONCATENATED MODULE: ./src/utils/index.js
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
169
|
+
// 默认配置
|
|
170
|
+
const defaultConfig = {
|
|
171
|
+
theme: 'light',
|
|
172
|
+
size: 'medium',
|
|
173
|
+
primaryColor: '#409EFF'
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// 当前配置
|
|
177
|
+
let currentConfig = { ...defaultConfig }
|
|
178
|
+
|
|
179
|
+
// 调试:输出初始化信息
|
|
180
|
+
console.log('[XtElementUI] utils initialized with currentConfig:', currentConfig)
|
|
181
|
+
|
|
182
|
+
// 配置变更事件处理
|
|
183
|
+
const configChangeListeners = []
|
|
184
|
+
|
|
185
|
+
const emitConfigChange = function(key, value) {
|
|
186
|
+
configChangeListeners.forEach(listener => {
|
|
187
|
+
listener(key, value)
|
|
188
|
+
})
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// 获取所有配置
|
|
192
|
+
const getConfig = function() {
|
|
193
|
+
return { ...currentConfig }
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// 设置全局配置
|
|
197
|
+
const setConfig = function(config) {
|
|
198
|
+
if (typeof config !== 'object' || config === null) {
|
|
199
|
+
console.warn('[XtElementUI] setConfig 必须传入对象参数')
|
|
200
|
+
return
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (config.theme !== undefined) {
|
|
204
|
+
setTheme(config.theme)
|
|
205
|
+
}
|
|
206
|
+
if (config.size !== undefined) {
|
|
207
|
+
setSize(config.size)
|
|
208
|
+
}
|
|
209
|
+
if (config.primaryColor !== undefined) {
|
|
210
|
+
setPrimaryColor(config.primaryColor)
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
// 设置主题
|
|
216
|
+
const setTheme = function(theme) {
|
|
217
|
+
const validThemes = ['light', 'dark']
|
|
218
|
+
if (!validThemes.includes(theme)) {
|
|
219
|
+
console.warn(`[XtElementUI] 无效的主题值: ${theme},可选值: ${validThemes.join(', ')}`)
|
|
220
|
+
return
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
currentConfig.theme = theme
|
|
224
|
+
const root = document.documentElement
|
|
225
|
+
|
|
226
|
+
// 使用类名方式切换主题(兼容 Element Plus 风格)
|
|
227
|
+
if (theme === 'dark') {
|
|
228
|
+
root.classList.add('dark')
|
|
229
|
+
root.setAttribute('data-theme', 'dark')
|
|
230
|
+
} else {
|
|
231
|
+
root.classList.remove('dark')
|
|
232
|
+
root.removeAttribute('data-theme')
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
emitConfigChange('theme', theme)
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// 设置字体大小
|
|
239
|
+
const setSize = function(size) {
|
|
240
|
+
const validSizes = ['small', 'medium', 'large']
|
|
241
|
+
if (!validSizes.includes(size)) {
|
|
242
|
+
console.warn(`[XtElementUI] 无效的大小值: ${size},可选值: ${validSizes.join(', ')}`)
|
|
243
|
+
return
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
currentConfig.size = size
|
|
247
|
+
document.documentElement.setAttribute('data-size', size)
|
|
248
|
+
emitConfigChange('size', size)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// 将十六进制颜色转换为 RGB 对象
|
|
252
|
+
function hexToRgb(hex) {
|
|
253
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)
|
|
254
|
+
return result ? {
|
|
255
|
+
r: parseInt(result[1], 16),
|
|
256
|
+
g: parseInt(result[2], 16),
|
|
257
|
+
b: parseInt(result[3], 16)
|
|
258
|
+
} : null
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// 将 RGB 对象转换为十六进制颜色
|
|
262
|
+
function rgbToHex(r, g, b) {
|
|
263
|
+
return '#' + [r, g, b].map(x => {
|
|
264
|
+
const hex = x.toString(16)
|
|
265
|
+
return hex.length === 1 ? '0' + hex : hex
|
|
266
|
+
}).join('')
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// 计算浅色系列(混合白色)
|
|
270
|
+
function lightenColor(hex, percent) {
|
|
271
|
+
const rgb = hexToRgb(hex)
|
|
272
|
+
if (!rgb) return hex
|
|
273
|
+
|
|
274
|
+
const amount = Math.round(2.55 * percent)
|
|
275
|
+
const r = Math.min(255, rgb.r + amount)
|
|
276
|
+
const g = Math.min(255, rgb.g + amount)
|
|
277
|
+
const b = Math.min(255, rgb.b + amount)
|
|
278
|
+
|
|
279
|
+
return rgbToHex(r, g, b)
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// 设置主色调
|
|
283
|
+
const setPrimaryColor = function(color) {
|
|
284
|
+
// 颜色格式验证(支持 3/6/8 位十六进制)
|
|
285
|
+
const colorRegex = /^#[0-9A-Fa-f]{3}$|^#[0-9A-Fa-f]{6}$|^#[0-9A-Fa-f]{8}$/
|
|
286
|
+
if (!colorRegex.test(color)) {
|
|
287
|
+
console.warn(`[XtElementUI] 无效的颜色值: ${color},请使用十六进制颜色格式,如 #1890ff`)
|
|
288
|
+
return
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// 转换为 6 位十六进制(去掉透明度)
|
|
292
|
+
let validColor = color
|
|
293
|
+
if (color.length === 4) {
|
|
294
|
+
// #RGB 转换为 #RRGGBB
|
|
295
|
+
validColor = '#' + color[1] + color[1] + color[2] + color[2] + color[3] + color[3]
|
|
296
|
+
} else if (color.length === 9) {
|
|
297
|
+
// #RRGGBBAA 转换为 #RRGGBB(去掉 Alpha)
|
|
298
|
+
validColor = color.substring(0, 7)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
currentConfig.primaryColor = validColor
|
|
302
|
+
|
|
303
|
+
// 设置主色调
|
|
304
|
+
document.documentElement.style.setProperty('--xt-color-primary', validColor)
|
|
305
|
+
|
|
306
|
+
// 动态计算并设置浅色系列
|
|
307
|
+
document.documentElement.style.setProperty('--xt-color-primary-light-3', lightenColor(validColor, 30))
|
|
308
|
+
document.documentElement.style.setProperty('--xt-color-primary-light-5', lightenColor(validColor, 50))
|
|
309
|
+
document.documentElement.style.setProperty('--xt-color-primary-light-7', lightenColor(validColor, 70))
|
|
310
|
+
document.documentElement.style.setProperty('--xt-color-primary-light-8', lightenColor(validColor, 80))
|
|
311
|
+
document.documentElement.style.setProperty('--xt-color-primary-light-9', lightenColor(validColor, 90))
|
|
312
|
+
|
|
313
|
+
emitConfigChange('primaryColor', validColor)
|
|
314
|
+
console.log('[XtElementUI] 主色调已设置为:', validColor)
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// 获取当前主题
|
|
318
|
+
const getTheme = function() {
|
|
319
|
+
return currentConfig.theme
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// 获取当前字体大小
|
|
323
|
+
const getSize = function() {
|
|
324
|
+
return currentConfig.size
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// 获取当前主色调
|
|
328
|
+
const getPrimaryColor = function() {
|
|
329
|
+
return currentConfig.primaryColor
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// 重置为默认配置
|
|
333
|
+
const resetConfig = function() {
|
|
334
|
+
setConfig(defaultConfig)
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// 监听配置变更
|
|
338
|
+
const onConfigChange = function(listener) {
|
|
339
|
+
if (typeof listener === 'function') {
|
|
340
|
+
configChangeListeners.push(listener)
|
|
341
|
+
return function() {
|
|
342
|
+
const index = configChangeListeners.indexOf(listener)
|
|
343
|
+
if (index > -1) {
|
|
344
|
+
configChangeListeners.splice(index, 1)
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
} else {
|
|
348
|
+
console.warn('[XtElementUI] onConfigChange 必须传入函数')
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/* harmony default export */ var utils = ({
|
|
353
|
+
setTheme,
|
|
354
|
+
setSize,
|
|
355
|
+
setPrimaryColor,
|
|
356
|
+
getConfig,
|
|
357
|
+
setConfig,
|
|
358
|
+
getTheme,
|
|
359
|
+
getSize,
|
|
360
|
+
getPrimaryColor,
|
|
361
|
+
resetConfig,
|
|
362
|
+
onConfigChange
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"721fc731-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/button/index.vue?vue&type=template&id=0886961b
|
|
366
|
+
var render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-button',{staticClass:"xt-button",class:['xt-button--' + _vm.type],style:(_vm.buttonStyle),attrs:{"type":_vm.type,"plain":_vm.plain},on:{"click":_vm.handleClick}},[_vm._t("default")],2)
|
|
329
367
|
}
|
|
330
368
|
var staticRenderFns = []
|
|
331
369
|
|
|
332
370
|
|
|
333
|
-
// CONCATENATED MODULE: ./src/components/button/index.vue?vue&type=template&id=
|
|
371
|
+
// CONCATENATED MODULE: ./src/components/button/index.vue?vue&type=template&id=0886961b
|
|
334
372
|
|
|
335
373
|
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/button/index.vue?vue&type=script&lang=js
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
|
|
374
|
+
|
|
375
|
+
/* harmony default export */ var buttonvue_type_script_lang_js = ({
|
|
376
|
+
name: 'XtButton',
|
|
377
|
+
props: {
|
|
378
|
+
type: {
|
|
379
|
+
type: String,
|
|
380
|
+
default: 'primary'
|
|
381
|
+
},
|
|
382
|
+
plain: {
|
|
383
|
+
type: Boolean,
|
|
384
|
+
default: false
|
|
385
|
+
},
|
|
386
|
+
color: {
|
|
387
|
+
type: String,
|
|
388
|
+
default: ''
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
computed: {
|
|
392
|
+
buttonStyle() {
|
|
393
|
+
if (this.color) {
|
|
394
|
+
return {
|
|
395
|
+
'--xt-button-bg-color': this.color,
|
|
396
|
+
'--xt-button-border-color': this.color,
|
|
397
|
+
'--xt-button-text-color': '#fff'
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
return {}
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
methods: {
|
|
404
|
+
handleClick() {
|
|
405
|
+
this.$emit('click')
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
|
|
346
410
|
// CONCATENATED MODULE: ./src/components/button/index.vue?vue&type=script&lang=js
|
|
347
411
|
/* harmony default export */ var components_buttonvue_type_script_lang_js = (buttonvue_type_script_lang_js);
|
|
348
412
|
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
@@ -466,27 +530,41 @@ var component = normalizeComponent(
|
|
|
466
530
|
// CONCATENATED MODULE: ./src/components/button/index.js
|
|
467
531
|
|
|
468
532
|
/* harmony default export */ var src_components_button = (components_button);
|
|
469
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
470
|
-
var
|
|
533
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"721fc731-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/input/index.vue?vue&type=template&id=4349f550
|
|
534
|
+
var inputvue_type_template_id_4349f550_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-input"},[_c('el-input',{style:(_vm.inputStyle),attrs:{"value":_vm.value,"placeholder":_vm.placeholder},on:{"input":function($event){return _vm.$emit('input', $event)}}})],1)
|
|
471
535
|
}
|
|
472
|
-
var
|
|
536
|
+
var inputvue_type_template_id_4349f550_staticRenderFns = []
|
|
473
537
|
|
|
474
538
|
|
|
475
|
-
// CONCATENATED MODULE: ./src/components/input/index.vue?vue&type=template&id=
|
|
539
|
+
// CONCATENATED MODULE: ./src/components/input/index.vue?vue&type=template&id=4349f550
|
|
476
540
|
|
|
477
541
|
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/input/index.vue?vue&type=script&lang=js
|
|
478
542
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
543
|
+
/* harmony default export */ var inputvue_type_script_lang_js = ({
|
|
544
|
+
name: 'XtInput',
|
|
545
|
+
props: {
|
|
546
|
+
value: [String, Number],
|
|
547
|
+
placeholder: {
|
|
548
|
+
type: String,
|
|
549
|
+
default: '请输入内容'
|
|
550
|
+
},
|
|
551
|
+
color: {
|
|
552
|
+
type: String,
|
|
553
|
+
default: ''
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
computed: {
|
|
557
|
+
inputStyle() {
|
|
558
|
+
if (this.color) {
|
|
559
|
+
return {
|
|
560
|
+
'--xt-input-focus-color': this.color
|
|
561
|
+
}
|
|
486
562
|
}
|
|
563
|
+
return {}
|
|
487
564
|
}
|
|
488
|
-
}
|
|
489
|
-
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
|
|
490
568
|
// CONCATENATED MODULE: ./src/components/input/index.vue?vue&type=script&lang=js
|
|
491
569
|
/* harmony default export */ var components_inputvue_type_script_lang_js = (inputvue_type_script_lang_js);
|
|
492
570
|
// CONCATENATED MODULE: ./src/components/input/index.vue
|
|
@@ -499,8 +577,8 @@ var inputvue_type_template_id_fe9146e4_staticRenderFns = []
|
|
|
499
577
|
|
|
500
578
|
var input_component = normalizeComponent(
|
|
501
579
|
components_inputvue_type_script_lang_js,
|
|
502
|
-
|
|
503
|
-
|
|
580
|
+
inputvue_type_template_id_4349f550_render,
|
|
581
|
+
inputvue_type_template_id_4349f550_staticRenderFns,
|
|
504
582
|
false,
|
|
505
583
|
null,
|
|
506
584
|
null,
|
|
@@ -512,55 +590,60 @@ var input_component = normalizeComponent(
|
|
|
512
590
|
// CONCATENATED MODULE: ./src/components/input/index.js
|
|
513
591
|
|
|
514
592
|
/* harmony default export */ var components_input = (input);
|
|
515
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
516
|
-
var
|
|
593
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"721fc731-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/flex-box/index.vue?vue&type=template&id=68f07021
|
|
594
|
+
var flex_boxvue_type_template_id_68f07021_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-flex-box",class:_vm.classAttrs,style:(_vm.flexStyle)},[_vm._t("default")],2)
|
|
517
595
|
}
|
|
518
|
-
var
|
|
596
|
+
var flex_boxvue_type_template_id_68f07021_staticRenderFns = []
|
|
519
597
|
|
|
520
598
|
|
|
521
|
-
// CONCATENATED MODULE: ./src/components/flex-box/index.vue?vue&type=template&id=
|
|
599
|
+
// CONCATENATED MODULE: ./src/components/flex-box/index.vue?vue&type=template&id=68f07021
|
|
522
600
|
|
|
523
601
|
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/flex-box/index.vue?vue&type=script&lang=js
|
|
524
602
|
|
|
525
603
|
/* harmony default export */ var flex_boxvue_type_script_lang_js = ({
|
|
526
|
-
name: "
|
|
604
|
+
name: "XtFlexBox",
|
|
527
605
|
props: {
|
|
528
|
-
type: "flex",
|
|
529
|
-
align: "center",
|
|
530
|
-
content: "start",
|
|
531
|
-
direction: "row",
|
|
532
|
-
wrap: "unset",
|
|
533
|
-
gap: {}
|
|
606
|
+
type: { type: String, default: "flex" },
|
|
607
|
+
align: { type: String, default: "center" },
|
|
608
|
+
content: { type: String, default: "start" },
|
|
609
|
+
direction: { type: String, default: "row" },
|
|
610
|
+
wrap: { type: String, default: "unset" },
|
|
611
|
+
gap: { type: String, default: "" }
|
|
534
612
|
},
|
|
535
613
|
computed: {
|
|
536
614
|
classAttrs(){
|
|
537
|
-
const {
|
|
538
|
-
return [`${
|
|
615
|
+
const { type, align, wrap, direction, content } = this;
|
|
616
|
+
return [`${type}`, `align-${align}`, `content-${content}`, `direction-${direction}`, `wrap-${wrap}`]
|
|
617
|
+
},
|
|
618
|
+
flexStyle() {
|
|
619
|
+
const result = {}
|
|
620
|
+
if (this.gap) {
|
|
621
|
+
result.gap = this.gap
|
|
622
|
+
} else {
|
|
623
|
+
result.gap = 'var(--xt-flex-box-gap, 8px)'
|
|
624
|
+
}
|
|
625
|
+
return result
|
|
539
626
|
}
|
|
540
627
|
}
|
|
541
628
|
});
|
|
542
629
|
|
|
543
630
|
// CONCATENATED MODULE: ./src/components/flex-box/index.vue?vue&type=script&lang=js
|
|
544
631
|
/* harmony default export */ var components_flex_boxvue_type_script_lang_js = (flex_boxvue_type_script_lang_js);
|
|
545
|
-
// EXTERNAL MODULE: ./src/components/flex-box/index.vue?vue&type=style&index=0&id=617fe54e&prod&scoped=true&lang=scss
|
|
546
|
-
var flex_boxvue_type_style_index_0_id_617fe54e_prod_scoped_true_lang_scss = __webpack_require__("4755");
|
|
547
|
-
|
|
548
632
|
// CONCATENATED MODULE: ./src/components/flex-box/index.vue
|
|
549
633
|
|
|
550
634
|
|
|
551
635
|
|
|
552
636
|
|
|
553
637
|
|
|
554
|
-
|
|
555
638
|
/* normalize component */
|
|
556
639
|
|
|
557
640
|
var flex_box_component = normalizeComponent(
|
|
558
641
|
components_flex_boxvue_type_script_lang_js,
|
|
559
|
-
|
|
560
|
-
|
|
642
|
+
flex_boxvue_type_template_id_68f07021_render,
|
|
643
|
+
flex_boxvue_type_template_id_68f07021_staticRenderFns,
|
|
561
644
|
false,
|
|
562
645
|
null,
|
|
563
|
-
|
|
646
|
+
null,
|
|
564
647
|
null
|
|
565
648
|
|
|
566
649
|
)
|
|
@@ -569,47 +652,43 @@ var flex_box_component = normalizeComponent(
|
|
|
569
652
|
// CONCATENATED MODULE: ./src/components/flex-box/index.js
|
|
570
653
|
|
|
571
654
|
/* harmony default export */ var components_flex_box = (flex_box);
|
|
572
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
573
|
-
var
|
|
655
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"721fc731-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/card/index.vue?vue&type=template&id=cb20295a
|
|
656
|
+
var cardvue_type_template_id_cb20295a_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-card",class:{'no-padding': _vm.noPadding }},[(_vm.title)?_c('div',{staticClass:"card__header"},[_vm._t("title",function(){return [_vm._v(_vm._s(_vm.title))]})],2):_vm._e(),_c('div',{staticClass:"card__body"},[_vm._t("default",function(){return [_c('span',{staticClass:"value"},[_vm._t("value",function(){return [_vm._v(_vm._s(_vm.value))]})],2),_c('span',{staticClass:"unit"},[_vm._v(_vm._s(_vm.unit))])]})],2)])
|
|
574
657
|
}
|
|
575
|
-
var
|
|
658
|
+
var cardvue_type_template_id_cb20295a_staticRenderFns = []
|
|
576
659
|
|
|
577
660
|
|
|
578
|
-
// CONCATENATED MODULE: ./src/components/card/index.vue?vue&type=template&id=
|
|
661
|
+
// CONCATENATED MODULE: ./src/components/card/index.vue?vue&type=template&id=cb20295a
|
|
579
662
|
|
|
580
663
|
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/card/index.vue?vue&type=script&lang=js
|
|
581
664
|
|
|
582
665
|
/* harmony default export */ var cardvue_type_script_lang_js = ({
|
|
583
|
-
name:"XtCard",
|
|
584
|
-
props:{
|
|
585
|
-
type:{},
|
|
586
|
-
title:{},
|
|
587
|
-
value:{},
|
|
588
|
-
unit:{},
|
|
589
|
-
icon:{},
|
|
590
|
-
iconIn:{default:"right"},
|
|
591
|
-
noPadding:{type:Boolean,default:false}
|
|
666
|
+
name: "XtCard",
|
|
667
|
+
props: {
|
|
668
|
+
type: {},
|
|
669
|
+
title: {},
|
|
670
|
+
value: {},
|
|
671
|
+
unit: {},
|
|
672
|
+
icon: {},
|
|
673
|
+
iconIn: { default: "right" },
|
|
674
|
+
noPadding: { type: Boolean, default: false }
|
|
592
675
|
}
|
|
593
676
|
});
|
|
594
677
|
|
|
595
678
|
// CONCATENATED MODULE: ./src/components/card/index.vue?vue&type=script&lang=js
|
|
596
679
|
/* harmony default export */ var components_cardvue_type_script_lang_js = (cardvue_type_script_lang_js);
|
|
597
|
-
// EXTERNAL MODULE: ./src/components/card/index.vue?vue&type=style&index=0&id=2a9eeb9d&prod&lang=scss
|
|
598
|
-
var cardvue_type_style_index_0_id_2a9eeb9d_prod_lang_scss = __webpack_require__("1e2e");
|
|
599
|
-
|
|
600
680
|
// CONCATENATED MODULE: ./src/components/card/index.vue
|
|
601
681
|
|
|
602
682
|
|
|
603
683
|
|
|
604
684
|
|
|
605
685
|
|
|
606
|
-
|
|
607
686
|
/* normalize component */
|
|
608
687
|
|
|
609
688
|
var card_component = normalizeComponent(
|
|
610
689
|
components_cardvue_type_script_lang_js,
|
|
611
|
-
|
|
612
|
-
|
|
690
|
+
cardvue_type_template_id_cb20295a_render,
|
|
691
|
+
cardvue_type_template_id_cb20295a_staticRenderFns,
|
|
613
692
|
false,
|
|
614
693
|
null,
|
|
615
694
|
null,
|
|
@@ -621,47 +700,87 @@ var card_component = normalizeComponent(
|
|
|
621
700
|
// CONCATENATED MODULE: ./src/components/card/index.js
|
|
622
701
|
|
|
623
702
|
/* harmony default export */ var components_card = (card);
|
|
624
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
625
|
-
var
|
|
703
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"721fc731-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/card-item/index.vue?vue&type=template&id=20eea1e3
|
|
704
|
+
var card_itemvue_type_template_id_20eea1e3_render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.iconType=='border')?_c('FlexBox',{staticClass:"xt-card-item is-border",class:[_vm.iconType=='border'?`is-${_vm.type}`:''],style:(_vm.cardItemStyle),attrs:{"content":"between"}},[(_vm.title)?_c('span',{staticClass:"item__label"},[_vm._t("label",function(){return [_vm._v(_vm._s(_vm.label))]})],2):_vm._e(),_c('span',{staticClass:"item__value"},[_vm._t("value",function(){return [_vm._v(_vm._s(_vm.value))]})],2),_c('span',{staticClass:"item__unit"},[_vm._t("unit",function(){return [_vm._v(_vm._s(_vm.unit))]})],2)]):_c('FlexBox',{staticClass:"xt-card-item",attrs:{"direction":_vm.direction,"content":_vm.contentAlign}},[_vm._t("icon",function(){return [_c('el-button',{attrs:{"type":_vm.type,"circle":_vm.circle,"round":_vm.round,"plain":"","icon":_vm.icon}})]}),_c('div',{staticClass:"item__value"},[_c('span',{staticClass:"value",style:(_vm.valueStyle)},[_vm._t("value",function(){return [_vm._v(_vm._s(_vm.label))]})],2),_c('div',{staticClass:"unit"},[_vm._v(_vm._s(_vm.value))])])],2)
|
|
626
705
|
}
|
|
627
|
-
var
|
|
706
|
+
var card_itemvue_type_template_id_20eea1e3_staticRenderFns = []
|
|
628
707
|
|
|
629
708
|
|
|
630
|
-
// CONCATENATED MODULE: ./src/components/card-item/index.vue?vue&type=template&id=
|
|
709
|
+
// CONCATENATED MODULE: ./src/components/card-item/index.vue?vue&type=template&id=20eea1e3
|
|
631
710
|
|
|
632
711
|
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/card-item/index.vue?vue&type=script&lang=js
|
|
633
712
|
|
|
713
|
+
|
|
634
714
|
/* harmony default export */ var card_itemvue_type_script_lang_js = ({
|
|
635
|
-
name:"XtCardItem",
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
715
|
+
name: "XtCardItem",
|
|
716
|
+
components: {
|
|
717
|
+
FlexBox: flex_box
|
|
718
|
+
},
|
|
719
|
+
props: {
|
|
720
|
+
iconType: { default: "border" },
|
|
721
|
+
type: { default: "primary" },
|
|
722
|
+
label: {},
|
|
723
|
+
value: {},
|
|
724
|
+
unit: {},
|
|
725
|
+
icon: {},
|
|
726
|
+
iconAt: { default: "right" },
|
|
727
|
+
color: {
|
|
728
|
+
type: String,
|
|
729
|
+
default: ''
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
data() {
|
|
733
|
+
return {
|
|
734
|
+
circle: false,
|
|
735
|
+
round: false
|
|
736
|
+
}
|
|
737
|
+
},
|
|
738
|
+
computed: {
|
|
739
|
+
contentAlign() {
|
|
740
|
+
return this.iconAt == 'center' ? 'center' : 'start'
|
|
741
|
+
},
|
|
742
|
+
direction() {
|
|
743
|
+
const iconAtMap = {
|
|
744
|
+
left: 'row',
|
|
745
|
+
right: 'row-reverse',
|
|
746
|
+
top: 'column',
|
|
747
|
+
bottom: 'column-reverse'
|
|
748
|
+
}
|
|
749
|
+
return iconAtMap[this.iconAt]
|
|
750
|
+
},
|
|
751
|
+
cardItemStyle() {
|
|
752
|
+
if (this.iconType === 'border' && this.type === 'primary' && this.color) {
|
|
753
|
+
return {
|
|
754
|
+
'--xt-card-item-color': this.color
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
return {}
|
|
758
|
+
},
|
|
759
|
+
valueStyle() {
|
|
760
|
+
if (this.iconType !== 'border' && this.type === 'primary' && this.color) {
|
|
761
|
+
return {
|
|
762
|
+
color: this.color
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
return {}
|
|
766
|
+
}
|
|
644
767
|
}
|
|
645
768
|
});
|
|
646
769
|
|
|
647
770
|
// CONCATENATED MODULE: ./src/components/card-item/index.vue?vue&type=script&lang=js
|
|
648
771
|
/* harmony default export */ var components_card_itemvue_type_script_lang_js = (card_itemvue_type_script_lang_js);
|
|
649
|
-
// EXTERNAL MODULE: ./src/components/card-item/index.vue?vue&type=style&index=0&id=3d0e4bcc&prod&lang=scss
|
|
650
|
-
var card_itemvue_type_style_index_0_id_3d0e4bcc_prod_lang_scss = __webpack_require__("2580");
|
|
651
|
-
|
|
652
772
|
// CONCATENATED MODULE: ./src/components/card-item/index.vue
|
|
653
773
|
|
|
654
774
|
|
|
655
775
|
|
|
656
776
|
|
|
657
777
|
|
|
658
|
-
|
|
659
778
|
/* normalize component */
|
|
660
779
|
|
|
661
780
|
var card_item_component = normalizeComponent(
|
|
662
781
|
components_card_itemvue_type_script_lang_js,
|
|
663
|
-
|
|
664
|
-
|
|
782
|
+
card_itemvue_type_template_id_20eea1e3_render,
|
|
783
|
+
card_itemvue_type_template_id_20eea1e3_staticRenderFns,
|
|
665
784
|
false,
|
|
666
785
|
null,
|
|
667
786
|
null,
|
|
@@ -673,12 +792,223 @@ var card_item_component = normalizeComponent(
|
|
|
673
792
|
// CONCATENATED MODULE: ./src/components/card-item/index.js
|
|
674
793
|
|
|
675
794
|
/* harmony default export */ var components_card_item = (card_item);
|
|
795
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"721fc731-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/config-provider/index.vue?vue&type=template&id=676593fc
|
|
796
|
+
var config_providervue_type_template_id_676593fc_render = function render(){var _vm=this,_c=_vm._self._c;return _c(_vm.tag,_vm._b({tag:"component",class:_vm.computedClass,style:(_vm.mergedStyle)},'component',_vm.customAttrs,false),[_vm._t("default")],2)
|
|
797
|
+
}
|
|
798
|
+
var config_providervue_type_template_id_676593fc_staticRenderFns = []
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
// CONCATENATED MODULE: ./src/components/config-provider/index.vue?vue&type=template&id=676593fc
|
|
802
|
+
|
|
803
|
+
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/config-provider/index.vue?vue&type=script&lang=js
|
|
804
|
+
|
|
805
|
+
/* harmony default export */ var config_providervue_type_script_lang_js = ({
|
|
806
|
+
name: 'XtConfigProvider',
|
|
807
|
+
inheritAttrs: false,
|
|
808
|
+
props: {
|
|
809
|
+
theme: {
|
|
810
|
+
type: String,
|
|
811
|
+
default: 'light'
|
|
812
|
+
},
|
|
813
|
+
size: {
|
|
814
|
+
type: String,
|
|
815
|
+
default: 'medium'
|
|
816
|
+
},
|
|
817
|
+
primaryColor: {
|
|
818
|
+
type: String,
|
|
819
|
+
default: '#409EFF'
|
|
820
|
+
},
|
|
821
|
+
vars: {
|
|
822
|
+
type: Object,
|
|
823
|
+
default: () => ({})
|
|
824
|
+
},
|
|
825
|
+
tag: {
|
|
826
|
+
type: String,
|
|
827
|
+
default: 'div',
|
|
828
|
+
validator: (value) => {
|
|
829
|
+
return ['div', 'span', 'section', 'main', 'template', 'article', 'aside'].includes(value)
|
|
830
|
+
}
|
|
831
|
+
},
|
|
832
|
+
injectBackground: {
|
|
833
|
+
type: Boolean,
|
|
834
|
+
default: false
|
|
835
|
+
},
|
|
836
|
+
injectColor: {
|
|
837
|
+
type: Boolean,
|
|
838
|
+
default: false
|
|
839
|
+
}
|
|
840
|
+
},
|
|
841
|
+
computed: {
|
|
842
|
+
mergedStyle() {
|
|
843
|
+
const result = { ...this.vars }
|
|
844
|
+
|
|
845
|
+
if (this.primaryColor) {
|
|
846
|
+
const color = this.normalizeColor(this.primaryColor)
|
|
847
|
+
result['--xt-color-primary'] = color
|
|
848
|
+
result['--xt-color-primary-light-3'] = this.lightenColor(color, 30)
|
|
849
|
+
result['--xt-color-primary-light-5'] = this.lightenColor(color, 50)
|
|
850
|
+
result['--xt-color-primary-light-7'] = this.lightenColor(color, 70)
|
|
851
|
+
result['--xt-color-primary-light-8'] = this.lightenColor(color, 80)
|
|
852
|
+
result['--xt-color-primary-light-9'] = this.lightenColor(color, 90)
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
const sizeMap = {
|
|
856
|
+
small: '12px',
|
|
857
|
+
medium: '14px',
|
|
858
|
+
large: '16px'
|
|
859
|
+
}
|
|
860
|
+
if (sizeMap[this.size]) {
|
|
861
|
+
result['--xt-font-size-base'] = sizeMap[this.size]
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
if (this.theme === 'dark') {
|
|
865
|
+
result['--xt-color-text-primary'] = 'rgba(255, 255, 255, 0.95)'
|
|
866
|
+
result['--xt-color-text-regular'] = 'rgba(255, 255, 255, 0.8)'
|
|
867
|
+
result['--xt-color-text-secondary'] = 'rgba(255, 255, 255, 0.6)'
|
|
868
|
+
result['--xt-color-bg-primary'] = '#1f1f1f'
|
|
869
|
+
result['--xt-color-bg-secondary'] = '#2d2d2d'
|
|
870
|
+
result['--xt-color-bg-container'] = '#1f1f1f'
|
|
871
|
+
result['--xt-color-border'] = '#434343'
|
|
872
|
+
result['--xt-color-border-light'] = '#3d3d3d'
|
|
873
|
+
|
|
874
|
+
if (this.injectBackground) {
|
|
875
|
+
result.backgroundColor = result['--xt-color-bg-primary']
|
|
876
|
+
}
|
|
877
|
+
if (this.injectColor) {
|
|
878
|
+
result.color = result['--xt-color-text-primary']
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
return result
|
|
883
|
+
},
|
|
884
|
+
computedClass() {
|
|
885
|
+
const classes = []
|
|
886
|
+
|
|
887
|
+
if (this.tag !== 'template') {
|
|
888
|
+
classes.push('xt-config-provider')
|
|
889
|
+
|
|
890
|
+
if (this.theme === 'dark') {
|
|
891
|
+
classes.push('xt-config-provider--dark')
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
return classes
|
|
896
|
+
},
|
|
897
|
+
customAttrs() {
|
|
898
|
+
const props = ['theme', 'size', 'primaryColor', 'vars', 'tag', 'injectBackground', 'injectColor']
|
|
899
|
+
const attrs = {}
|
|
900
|
+
|
|
901
|
+
for (const key in this.$attrs) {
|
|
902
|
+
if (!props.includes(key)) {
|
|
903
|
+
attrs[key] = this.$attrs[key]
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
return attrs
|
|
908
|
+
}
|
|
909
|
+
},
|
|
910
|
+
methods: {
|
|
911
|
+
normalizeColor(color) {
|
|
912
|
+
if (!color) return '#409EFF'
|
|
913
|
+
|
|
914
|
+
if (/^#[0-9A-Fa-f]{6}$/.test(color)) {
|
|
915
|
+
return color
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
if (/^#[0-9A-Fa-f]{3}$/.test(color)) {
|
|
919
|
+
return '#' + color[1] + color[1] + color[2] + color[2] + color[3] + color[3]
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
if (/^#[0-9A-Fa-f]{8}$/.test(color)) {
|
|
923
|
+
return color.substring(0, 7)
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
const rgbaMatch = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)/i)
|
|
927
|
+
if (rgbaMatch) {
|
|
928
|
+
const r = parseInt(rgbaMatch[1])
|
|
929
|
+
const g = parseInt(rgbaMatch[2])
|
|
930
|
+
const b = parseInt(rgbaMatch[3])
|
|
931
|
+
return this.rgbToHex(r, g, b)
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
console.warn('[XtConfigProvider] 无法识别的颜色格式:', color)
|
|
935
|
+
return '#409EFF'
|
|
936
|
+
},
|
|
937
|
+
|
|
938
|
+
hexToRgb(hex) {
|
|
939
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)
|
|
940
|
+
return result ? {
|
|
941
|
+
r: parseInt(result[1], 16),
|
|
942
|
+
g: parseInt(result[2], 16),
|
|
943
|
+
b: parseInt(result[3], 16)
|
|
944
|
+
} : null
|
|
945
|
+
},
|
|
946
|
+
|
|
947
|
+
rgbToHex(r, g, b) {
|
|
948
|
+
return '#' + [r, g, b].map(x => {
|
|
949
|
+
const hex = x.toString(16)
|
|
950
|
+
return hex.length === 1 ? '0' + hex : hex
|
|
951
|
+
}).join('')
|
|
952
|
+
},
|
|
953
|
+
|
|
954
|
+
lightenColor(hex, percent) {
|
|
955
|
+
const rgb = this.hexToRgb(hex)
|
|
956
|
+
if (!rgb) return hex
|
|
957
|
+
|
|
958
|
+
const amount = Math.round(2.55 * percent)
|
|
959
|
+
const r = Math.min(255, rgb.r + amount)
|
|
960
|
+
const g = Math.min(255, rgb.g + amount)
|
|
961
|
+
const b = Math.min(255, rgb.b + amount)
|
|
962
|
+
|
|
963
|
+
return this.rgbToHex(r, g, b)
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
});
|
|
967
|
+
|
|
968
|
+
// CONCATENATED MODULE: ./src/components/config-provider/index.vue?vue&type=script&lang=js
|
|
969
|
+
/* harmony default export */ var components_config_providervue_type_script_lang_js = (config_providervue_type_script_lang_js);
|
|
970
|
+
// CONCATENATED MODULE: ./src/components/config-provider/index.vue
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
/* normalize component */
|
|
977
|
+
|
|
978
|
+
var config_provider_component = normalizeComponent(
|
|
979
|
+
components_config_providervue_type_script_lang_js,
|
|
980
|
+
config_providervue_type_template_id_676593fc_render,
|
|
981
|
+
config_providervue_type_template_id_676593fc_staticRenderFns,
|
|
982
|
+
false,
|
|
983
|
+
null,
|
|
984
|
+
null,
|
|
985
|
+
null
|
|
986
|
+
|
|
987
|
+
)
|
|
988
|
+
|
|
989
|
+
/* harmony default export */ var config_provider = (config_provider_component.exports);
|
|
990
|
+
// CONCATENATED MODULE: ./src/components/config-provider/index.js
|
|
991
|
+
|
|
992
|
+
/* harmony default export */ var components_config_provider = (config_provider);
|
|
993
|
+
|
|
676
994
|
// CONCATENATED MODULE: ./src/index.js
|
|
995
|
+
// 导入主题样式(定义 CSS 变量)
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
// 导入组件样式(统一入口)
|
|
999
|
+
|
|
1000
|
+
|
|
677
1001
|
// 导入 SCSS 变量(通过 CSS Modules :export 导出)
|
|
678
1002
|
|
|
679
1003
|
|
|
680
1004
|
|
|
681
1005
|
|
|
1006
|
+
// ES Module 默认导出需要通过 .default 访问
|
|
1007
|
+
const src_utils = utils.default || utils
|
|
1008
|
+
|
|
1009
|
+
// 从 utils 导入配置管理函数(仅用于存储配置)
|
|
1010
|
+
const { getConfig: src_getConfig, setConfig: src_setConfig, getTheme: src_getTheme, getSize: src_getSize, getPrimaryColor: src_getPrimaryColor, resetConfig: src_resetConfig, onConfigChange: src_onConfigChange, setTheme: src_setTheme, setSize: src_setSize, setPrimaryColor: src_setPrimaryColor } = src_utils
|
|
1011
|
+
|
|
682
1012
|
// 导入组件
|
|
683
1013
|
|
|
684
1014
|
|
|
@@ -686,26 +1016,61 @@ var card_item_component = normalizeComponent(
|
|
|
686
1016
|
|
|
687
1017
|
|
|
688
1018
|
|
|
1019
|
+
|
|
689
1020
|
// 存储组件列表
|
|
690
|
-
const
|
|
1021
|
+
const src_components = [
|
|
691
1022
|
src_components_button,
|
|
692
1023
|
components_input,
|
|
693
1024
|
components_flex_box,
|
|
694
1025
|
components_card,
|
|
695
|
-
components_card_item
|
|
1026
|
+
components_card_item,
|
|
1027
|
+
components_config_provider
|
|
696
1028
|
]
|
|
697
1029
|
|
|
698
1030
|
|
|
699
1031
|
// 定义 install 方法,Vue.use() 会自动调用
|
|
700
|
-
const install = function (Vue) {
|
|
1032
|
+
const install = function (Vue, options = {}) {
|
|
701
1033
|
if (install.installed) return
|
|
702
1034
|
install.installed = true
|
|
703
1035
|
|
|
704
1036
|
// 全局注册所有 xt- 组件
|
|
705
|
-
|
|
1037
|
+
src_components.forEach(component => {
|
|
706
1038
|
Vue.component(component.name, component)
|
|
707
1039
|
})
|
|
708
|
-
|
|
1040
|
+
|
|
1041
|
+
// 将工具方法挂载到 Vue.prototype
|
|
1042
|
+
Vue.prototype.$xt = {
|
|
1043
|
+
setTheme: src_setTheme,
|
|
1044
|
+
setSize: src_setSize,
|
|
1045
|
+
setPrimaryColor: src_setPrimaryColor,
|
|
1046
|
+
getConfig: src_getConfig,
|
|
1047
|
+
setConfig: src_setConfig,
|
|
1048
|
+
getTheme: src_getTheme,
|
|
1049
|
+
getSize: src_getSize,
|
|
1050
|
+
getPrimaryColor: src_getPrimaryColor,
|
|
1051
|
+
resetConfig: src_resetConfig,
|
|
1052
|
+
onConfigChange: src_onConfigChange
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
// 在安装时直接应用配置选项
|
|
1056
|
+
if (options) {
|
|
1057
|
+
// 处理主题配置
|
|
1058
|
+
if (options.theme !== undefined) {
|
|
1059
|
+
src_setTheme(options.theme)
|
|
1060
|
+
}
|
|
1061
|
+
// 处理字体大小配置
|
|
1062
|
+
if (options.size !== undefined) {
|
|
1063
|
+
src_setSize(options.size)
|
|
1064
|
+
}
|
|
1065
|
+
// 处理主色调配置
|
|
1066
|
+
if (options.primaryColor !== undefined) {
|
|
1067
|
+
src_setPrimaryColor(options.primaryColor)
|
|
1068
|
+
}
|
|
1069
|
+
// 处理完整配置对象
|
|
1070
|
+
if (options.config !== undefined) {
|
|
1071
|
+
src_setConfig(options.config)
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
709
1074
|
}
|
|
710
1075
|
|
|
711
1076
|
// 支持全局 script 标签引入
|
|
@@ -721,127 +1086,13 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
721
1086
|
Input: components_input,
|
|
722
1087
|
FlexBox: components_flex_box,
|
|
723
1088
|
Card: components_card,
|
|
724
|
-
CardItem: components_card_item
|
|
1089
|
+
CardItem: components_card_item,
|
|
1090
|
+
ConfigProvider: components_config_provider
|
|
725
1091
|
});
|
|
726
1092
|
|
|
727
1093
|
// 导出工具函数和变量
|
|
728
1094
|
|
|
729
1095
|
|
|
730
|
-
// 默认配置
|
|
731
|
-
const src_defaultConfig = {
|
|
732
|
-
theme: 'light',
|
|
733
|
-
size: 'medium',
|
|
734
|
-
primaryColor: '#1890ff'
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
// 当前配置
|
|
738
|
-
let src_currentConfig = { ...src_defaultConfig }
|
|
739
|
-
|
|
740
|
-
// 配置变更事件处理
|
|
741
|
-
const src_configChangeListeners = []
|
|
742
|
-
|
|
743
|
-
const src_emitConfigChange = function(key, value) {
|
|
744
|
-
src_configChangeListeners.forEach(listener => {
|
|
745
|
-
listener(key, value)
|
|
746
|
-
})
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
// 获取所有配置
|
|
750
|
-
const src_getConfig = function() {
|
|
751
|
-
return { ...src_currentConfig }
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
// 设置全局配置
|
|
755
|
-
const src_setConfig = function(config) {
|
|
756
|
-
if (typeof config !== 'object' || config === null) {
|
|
757
|
-
console.warn('[XtElementUI] setConfig 必须传入对象参数')
|
|
758
|
-
return
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
if (config.theme !== undefined) {
|
|
762
|
-
src_setTheme(config.theme)
|
|
763
|
-
}
|
|
764
|
-
if (config.size !== undefined) {
|
|
765
|
-
src_setSize(config.size)
|
|
766
|
-
}
|
|
767
|
-
if (config.primaryColor !== undefined) {
|
|
768
|
-
src_setPrimaryColor(config.primaryColor)
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
// 设置主题(只控制颜色)
|
|
773
|
-
const src_setTheme = function(theme) {
|
|
774
|
-
const validThemes = ['light', 'dark']
|
|
775
|
-
if (!validThemes.includes(theme)) {
|
|
776
|
-
console.warn(`[XtElementUI] 无效的主题值: ${theme},可选值: ${validThemes.join(', ')}`)
|
|
777
|
-
return
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
src_currentConfig.theme = theme
|
|
781
|
-
document.documentElement.setAttribute('data-theme', theme)
|
|
782
|
-
src_emitConfigChange('theme', theme)
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
// 设置字体大小和间距
|
|
786
|
-
const src_setSize = function(size) {
|
|
787
|
-
const validSizes = ['small', 'medium', 'large']
|
|
788
|
-
if (!validSizes.includes(size)) {
|
|
789
|
-
console.warn(`[XtElementUI] 无效的大小值: ${size},可选值: ${validSizes.join(', ')}`)
|
|
790
|
-
return
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
src_currentConfig.size = size
|
|
794
|
-
document.documentElement.setAttribute('data-size', size)
|
|
795
|
-
src_emitConfigChange('size', size)
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
// 设置主色调
|
|
799
|
-
const src_setPrimaryColor = function(color) {
|
|
800
|
-
const colorRegex = /^#[0-9A-Fa-f]{6}$|^#[0-9A-Fa-f]{3}$/
|
|
801
|
-
if (!colorRegex.test(color)) {
|
|
802
|
-
console.warn(`[XtElementUI] 无效的颜色值: ${color},请使用十六进制颜色格式,如 #1890ff`)
|
|
803
|
-
return
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
src_currentConfig.primaryColor = color
|
|
807
|
-
document.documentElement.style.setProperty('--xt-color-primary', color)
|
|
808
|
-
src_emitConfigChange('primaryColor', color)
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
// 获取当前主题
|
|
812
|
-
const src_getTheme = function() {
|
|
813
|
-
return src_currentConfig.theme
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
// 获取当前字体大小
|
|
817
|
-
const src_getSize = function() {
|
|
818
|
-
return src_currentConfig.size
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
// 获取当前主色调
|
|
822
|
-
const src_getPrimaryColor = function() {
|
|
823
|
-
return src_currentConfig.primaryColor
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
// 重置为默认配置
|
|
827
|
-
const src_resetConfig = function() {
|
|
828
|
-
src_setConfig(src_defaultConfig)
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
// 监听配置变更
|
|
832
|
-
const src_onConfigChange = function(listener) {
|
|
833
|
-
if (typeof listener === 'function') {
|
|
834
|
-
src_configChangeListeners.push(listener)
|
|
835
|
-
return function() {
|
|
836
|
-
const index = src_configChangeListeners.indexOf(listener)
|
|
837
|
-
if (index > -1) {
|
|
838
|
-
src_configChangeListeners.splice(index, 1)
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
} else {
|
|
842
|
-
console.warn('[XtElementUI] onConfigChange 必须传入函数')
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
1096
|
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
|
846
1097
|
|
|
847
1098
|
|