xt-element-ui 1.3.2 → 1.3.4
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/CHANGELOG.md +72 -72
- package/LICENSE +21 -21
- package/README.md +240 -240
- package/docs/README.md +100 -100
- package/docs/components/base/xt-button.md +114 -114
- package/docs/components/base/xt-card-item.md +104 -104
- package/docs/components/base/xt-card.md +108 -108
- package/docs/components/base/xt-config-provider.md +199 -199
- package/docs/components/base/xt-flex-box.md +115 -115
- package/docs/components/base/xt-grid-box.md +302 -302
- package/docs/components/base/xt-input.md +150 -150
- package/docs/components/base/xt-map-provider.md +23 -0
- package/docs/components/base/xt-map.md +331 -331
- package/docs/components/base/xt-step-price.md +165 -165
- package/docs/components/base/xt-text.md +212 -212
- package/docs/components/base/xt-time.md +165 -165
- package/docs/components/extend/ex-bar.md +67 -67
- package/docs/components/extend/ex-button.md +62 -62
- package/docs/components/extend/ex-card.md +86 -86
- package/docs/components/extend/ex-chart.md +463 -463
- package/docs/components/extend/ex-icon.md +189 -189
- package/docs/components/extend/ex-line.md +70 -70
- package/docs/components/extend/ex-multi.md +155 -155
- package/docs/components/extend/ex-pie.md +69 -69
- package/docs/components/extend/ex-select-tree.md +210 -210
- package/docs/components/extend/ex-table.md +590 -590
- package/docs/components/extend/ex-upload.md +134 -134
- package/docs/components/utils/size.md +147 -147
- package/docs/components/utils/theme.md +182 -182
- package/lib/index.common.js +4131 -4162
- package/lib/index.css +1 -1
- package/lib/index.umd.js +4099 -4129
- package/lib/index.umd.min.js +3 -3
- package/package.json +80 -81
- package/src/components/ex-button/index.js +7 -7
- package/src/components/ex-button/index.vue +66 -66
- package/src/components/ex-button/style/index.scss +67 -67
- package/src/components/ex-card/index.js +7 -7
- package/src/components/ex-card/index.vue +68 -68
- package/src/components/ex-card/style/index.scss +73 -73
- package/src/components/ex-chart/index.js +7 -7
- package/src/components/ex-chart/index.vue +136 -136
- package/src/components/ex-date-picker/index.js +7 -7
- package/src/components/ex-icon/index.js +7 -7
- package/src/components/ex-icon/index.vue +168 -168
- package/src/components/ex-icon/style/index.scss +7 -7
- package/src/components/ex-page/index.js +7 -7
- package/src/components/ex-select-tree/index.js +7 -7
- package/src/components/ex-table/ExTableCell.vue +22 -22
- package/src/components/ex-table/index.js +7 -7
- package/src/components/ex-table/virtualScrollData.js +35 -35
- package/src/components/ex-upload/index.js +7 -7
- package/src/components/index.scss +39 -39
- package/src/components/xt-button/index.js +7 -7
- package/src/components/xt-button/index.vue +97 -97
- package/src/components/xt-card/index.js +7 -7
- package/src/components/xt-card/style/index.scss +48 -48
- package/src/components/xt-card-item/index.js +7 -7
- package/src/components/xt-card-item/style/index copy.scss +71 -71
- package/src/components/xt-card-item/style/index.scss +82 -82
- package/src/components/xt-config-provider/index.js +7 -7
- package/src/components/xt-config-provider/index.vue +362 -362
- package/src/components/xt-config-provider/style/index.scss +11 -11
- package/src/components/xt-flex-box/index.js +7 -7
- package/src/components/xt-flex-box/style/index.scss +81 -81
- package/src/components/xt-grid-box/index.js +7 -7
- package/src/components/xt-grid-box/style/index.scss +92 -92
- package/src/components/xt-grid-item/index.js +7 -7
- package/src/components/xt-grid-item/index.vue +106 -106
- package/src/components/xt-input/index.js +7 -7
- package/src/components/xt-input/index.vue +66 -66
- package/src/components/xt-input/style/index.scss +84 -84
- package/src/components/xt-map/adapters/amap.js +235 -235
- package/src/components/xt-map/adapters/baidu.js +254 -254
- package/src/components/xt-map/adapters/base.js +267 -267
- package/src/components/xt-map/adapters/index.js +29 -29
- package/src/components/xt-map/adapters/tianditu.js +242 -242
- package/src/components/xt-map/config/xt-map-config.js +197 -197
- package/src/components/xt-map/index.js +8 -30
- package/src/components/xt-map/index.vue +351 -351
- package/src/components/xt-map/loaders/script-loader.js +114 -114
- package/src/components/xt-map/provider.vue +200 -200
- package/src/components/xt-map/style/index.scss +77 -77
- package/src/components/xt-map-provider/index.js +8 -0
- package/src/components/xt-step-price/index.js +10 -10
- package/src/components/xt-step-price/index.vue +272 -272
- package/src/components/xt-step-price/style/index.scss +123 -123
- package/src/components/xt-step-price-item/index.js +7 -7
- package/src/components/xt-step-price-item/index.vue +187 -187
- package/src/components/xt-text/index.js +7 -7
- package/src/components/xt-text/index.vue +1 -1
- package/src/components/xt-text/style/index.scss +92 -92
- package/src/components/xt-time/index.js +7 -7
- package/src/components/xt-time/index.vue +313 -313
- package/src/components/xt-time/style/index.scss +23 -23
- package/src/config/element-registry.js +135 -135
- package/src/index.js +162 -178
- package/src/styles/css-variables.scss +257 -257
- package/src/styles/theme/background.scss +5 -5
- package/src/styles/theme/border-radius.scss +3 -3
- package/src/styles/theme/borders.scss +3 -3
- package/src/styles/theme/colors.scss +101 -101
- package/src/styles/theme/component-variables.scss +69 -69
- package/src/styles/theme/dark-variables.scss +28 -28
- package/src/styles/theme/font.scss +12 -12
- package/src/styles/theme/index.scss +11 -11
- package/src/styles/theme/shadows.scss +2 -2
- package/src/styles/theme/spacing.scss +4 -4
- package/src/styles/theme/transitions.scss +2 -2
- package/src/styles/theme/typography.scss +4 -4
- package/src/styles/variables-export.scss +85 -85
- package/src/utils/index.js +191 -202
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* XT-UI 组件注册配置文件
|
|
3
|
-
* 用于统一管理 Element UI 组件的自动注册配置
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// 已存在的 Ex 组件列表(不需要从 Element UI 自动注册)
|
|
7
|
-
export const existingExComponents = [
|
|
8
|
-
'Button', // ExButton 已存在
|
|
9
|
-
'Card', // ExCard 已存在
|
|
10
|
-
'Input', // XtInput 已存在(用户要求不自动注册)
|
|
11
|
-
'Table', // ExTable 已存在(在 ex-table 目录中)
|
|
12
|
-
'TableColumn', // ExColumn 已存在(在 ex-table 目录中)
|
|
13
|
-
'Chart' // ExChart 已存在
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
// Element UI 组件列表(用于自动注册为 Ex 开头,但排除已存在的组件)
|
|
17
|
-
export const elementComponentNames = [
|
|
18
|
-
'Autocomplete',
|
|
19
|
-
'Avatar',
|
|
20
|
-
'Backtop',
|
|
21
|
-
'Badge',
|
|
22
|
-
'Breadcrumb',
|
|
23
|
-
'BreadcrumbItem',
|
|
24
|
-
'ButtonGroup',
|
|
25
|
-
'Calendar',
|
|
26
|
-
'Carousel',
|
|
27
|
-
'CarouselItem',
|
|
28
|
-
'Cascader',
|
|
29
|
-
'Checkbox',
|
|
30
|
-
'CheckboxButton',
|
|
31
|
-
'CheckboxGroup',
|
|
32
|
-
'Col',
|
|
33
|
-
'Collapse',
|
|
34
|
-
'CollapseItem',
|
|
35
|
-
'ColorPicker',
|
|
36
|
-
'Container',
|
|
37
|
-
'DatePicker',
|
|
38
|
-
'Dialog',
|
|
39
|
-
'Divider',
|
|
40
|
-
'Drawer',
|
|
41
|
-
'Dropdown',
|
|
42
|
-
'DropdownItem',
|
|
43
|
-
'DropdownMenu',
|
|
44
|
-
'Footer',
|
|
45
|
-
'Form',
|
|
46
|
-
'FormItem',
|
|
47
|
-
'Header',
|
|
48
|
-
'Icon',
|
|
49
|
-
'Image',
|
|
50
|
-
'InputNumber',
|
|
51
|
-
'Link',
|
|
52
|
-
'Main',
|
|
53
|
-
'Menu',
|
|
54
|
-
'MenuItem',
|
|
55
|
-
'MenuItemGroup',
|
|
56
|
-
'Option',
|
|
57
|
-
'OptionGroup',
|
|
58
|
-
'Pagination',
|
|
59
|
-
'Popconfirm',
|
|
60
|
-
'Popover',
|
|
61
|
-
'Progress',
|
|
62
|
-
'Radio',
|
|
63
|
-
'RadioButton',
|
|
64
|
-
'RadioGroup',
|
|
65
|
-
'Rate',
|
|
66
|
-
'Row',
|
|
67
|
-
'Scrollbar',
|
|
68
|
-
'Select',
|
|
69
|
-
'Slider',
|
|
70
|
-
'Step',
|
|
71
|
-
'Steps',
|
|
72
|
-
'Submenu',
|
|
73
|
-
'Switch',
|
|
74
|
-
'TabPane',
|
|
75
|
-
'Tabs',
|
|
76
|
-
'Tag',
|
|
77
|
-
'TimePicker',
|
|
78
|
-
'TimeSelect',
|
|
79
|
-
'Timeline',
|
|
80
|
-
'TimelineItem',
|
|
81
|
-
'Tooltip',
|
|
82
|
-
'Transfer',
|
|
83
|
-
'Tree',
|
|
84
|
-
'Upload'
|
|
85
|
-
]
|
|
86
|
-
|
|
87
|
-
// Element UI 指令列表
|
|
88
|
-
export const elementDirectives = [
|
|
89
|
-
'Loading',
|
|
90
|
-
'Popover',
|
|
91
|
-
'Tooltip'
|
|
92
|
-
]
|
|
93
|
-
|
|
94
|
-
// 注册 Element UI 组件为 Ex 开头的工具函数
|
|
95
|
-
export function registerElementExComponents(Vue, ElementUI) {
|
|
96
|
-
if (!ElementUI) {
|
|
97
|
-
console.warn('[XT-UI] ElementUI not found, skipping Ex- prefix registration')
|
|
98
|
-
return
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
elementComponentNames.forEach(componentName => {
|
|
102
|
-
// 如果组件已存在于排除列表中,则跳过
|
|
103
|
-
if (existingExComponents.includes(componentName)) {
|
|
104
|
-
console.log(`[XT-UI] ${componentName} already exists, skipping registration`)
|
|
105
|
-
return
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const exComponentName = `Ex${componentName}`
|
|
109
|
-
|
|
110
|
-
// 检查是否已经注册过该组件
|
|
111
|
-
if (Vue.options.components[exComponentName]) {
|
|
112
|
-
return
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// 注册 Element 的组件为 Ex 开头
|
|
116
|
-
const elementComponent = ElementUI[componentName]
|
|
117
|
-
if (elementComponent) {
|
|
118
|
-
Vue.component(exComponentName, elementComponent)
|
|
119
|
-
console.log(`[XT-UI] Registered Element component as ${exComponentName}`)
|
|
120
|
-
}
|
|
121
|
-
})
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// 注册 Element UI 指令的工具函数
|
|
125
|
-
export function registerElementDirectives(Vue, ElementUI) {
|
|
126
|
-
if (!ElementUI) {
|
|
127
|
-
return
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
elementDirectives.forEach(directiveName => {
|
|
131
|
-
const directive = ElementUI[directiveName]
|
|
132
|
-
if (directive && directive.install) {
|
|
133
|
-
Vue.use(directive)
|
|
134
|
-
}
|
|
135
|
-
})
|
|
1
|
+
/**
|
|
2
|
+
* XT-UI 组件注册配置文件
|
|
3
|
+
* 用于统一管理 Element UI 组件的自动注册配置
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// 已存在的 Ex 组件列表(不需要从 Element UI 自动注册)
|
|
7
|
+
export const existingExComponents = [
|
|
8
|
+
'Button', // ExButton 已存在
|
|
9
|
+
'Card', // ExCard 已存在
|
|
10
|
+
'Input', // XtInput 已存在(用户要求不自动注册)
|
|
11
|
+
'Table', // ExTable 已存在(在 ex-table 目录中)
|
|
12
|
+
'TableColumn', // ExColumn 已存在(在 ex-table 目录中)
|
|
13
|
+
'Chart' // ExChart 已存在
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
// Element UI 组件列表(用于自动注册为 Ex 开头,但排除已存在的组件)
|
|
17
|
+
export const elementComponentNames = [
|
|
18
|
+
'Autocomplete',
|
|
19
|
+
'Avatar',
|
|
20
|
+
'Backtop',
|
|
21
|
+
'Badge',
|
|
22
|
+
'Breadcrumb',
|
|
23
|
+
'BreadcrumbItem',
|
|
24
|
+
'ButtonGroup',
|
|
25
|
+
'Calendar',
|
|
26
|
+
'Carousel',
|
|
27
|
+
'CarouselItem',
|
|
28
|
+
'Cascader',
|
|
29
|
+
'Checkbox',
|
|
30
|
+
'CheckboxButton',
|
|
31
|
+
'CheckboxGroup',
|
|
32
|
+
'Col',
|
|
33
|
+
'Collapse',
|
|
34
|
+
'CollapseItem',
|
|
35
|
+
'ColorPicker',
|
|
36
|
+
'Container',
|
|
37
|
+
'DatePicker',
|
|
38
|
+
'Dialog',
|
|
39
|
+
'Divider',
|
|
40
|
+
'Drawer',
|
|
41
|
+
'Dropdown',
|
|
42
|
+
'DropdownItem',
|
|
43
|
+
'DropdownMenu',
|
|
44
|
+
'Footer',
|
|
45
|
+
'Form',
|
|
46
|
+
'FormItem',
|
|
47
|
+
'Header',
|
|
48
|
+
'Icon',
|
|
49
|
+
'Image',
|
|
50
|
+
'InputNumber',
|
|
51
|
+
'Link',
|
|
52
|
+
'Main',
|
|
53
|
+
'Menu',
|
|
54
|
+
'MenuItem',
|
|
55
|
+
'MenuItemGroup',
|
|
56
|
+
'Option',
|
|
57
|
+
'OptionGroup',
|
|
58
|
+
'Pagination',
|
|
59
|
+
'Popconfirm',
|
|
60
|
+
'Popover',
|
|
61
|
+
'Progress',
|
|
62
|
+
'Radio',
|
|
63
|
+
'RadioButton',
|
|
64
|
+
'RadioGroup',
|
|
65
|
+
'Rate',
|
|
66
|
+
'Row',
|
|
67
|
+
'Scrollbar',
|
|
68
|
+
'Select',
|
|
69
|
+
'Slider',
|
|
70
|
+
'Step',
|
|
71
|
+
'Steps',
|
|
72
|
+
'Submenu',
|
|
73
|
+
'Switch',
|
|
74
|
+
'TabPane',
|
|
75
|
+
'Tabs',
|
|
76
|
+
'Tag',
|
|
77
|
+
'TimePicker',
|
|
78
|
+
'TimeSelect',
|
|
79
|
+
'Timeline',
|
|
80
|
+
'TimelineItem',
|
|
81
|
+
'Tooltip',
|
|
82
|
+
'Transfer',
|
|
83
|
+
'Tree',
|
|
84
|
+
'Upload'
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
// Element UI 指令列表
|
|
88
|
+
export const elementDirectives = [
|
|
89
|
+
'Loading',
|
|
90
|
+
'Popover',
|
|
91
|
+
'Tooltip'
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
// 注册 Element UI 组件为 Ex 开头的工具函数
|
|
95
|
+
export function registerElementExComponents(Vue, ElementUI) {
|
|
96
|
+
if (!ElementUI) {
|
|
97
|
+
console.warn('[XT-UI] ElementUI not found, skipping Ex- prefix registration')
|
|
98
|
+
return
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
elementComponentNames.forEach(componentName => {
|
|
102
|
+
// 如果组件已存在于排除列表中,则跳过
|
|
103
|
+
if (existingExComponents.includes(componentName)) {
|
|
104
|
+
console.log(`[XT-UI] ${componentName} already exists, skipping registration`)
|
|
105
|
+
return
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const exComponentName = `Ex${componentName}`
|
|
109
|
+
|
|
110
|
+
// 检查是否已经注册过该组件
|
|
111
|
+
if (Vue.options.components[exComponentName]) {
|
|
112
|
+
return
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 注册 Element 的组件为 Ex 开头
|
|
116
|
+
const elementComponent = ElementUI[componentName]
|
|
117
|
+
if (elementComponent) {
|
|
118
|
+
Vue.component(exComponentName, elementComponent)
|
|
119
|
+
console.log(`[XT-UI] Registered Element component as ${exComponentName}`)
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// 注册 Element UI 指令的工具函数
|
|
125
|
+
export function registerElementDirectives(Vue, ElementUI) {
|
|
126
|
+
if (!ElementUI) {
|
|
127
|
+
return
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
elementDirectives.forEach(directiveName => {
|
|
131
|
+
const directive = ElementUI[directiveName]
|
|
132
|
+
if (directive && directive.install) {
|
|
133
|
+
Vue.use(directive)
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
136
|
}
|
package/src/index.js
CHANGED
|
@@ -1,179 +1,163 @@
|
|
|
1
|
-
// 导入主题样式(定义 CSS 变量)
|
|
2
|
-
import './styles/css-variables.scss'
|
|
3
|
-
|
|
4
|
-
// 导入组件样式(统一入口)
|
|
5
|
-
import './components/index.scss'
|
|
6
|
-
|
|
7
|
-
// 导入 SCSS 变量(通过 CSS Modules :export 导出)
|
|
8
|
-
import variables from './styles/variables-export.scss'
|
|
9
|
-
|
|
10
|
-
import utilsModule from './utils/index'
|
|
11
|
-
|
|
12
|
-
// ES Module 默认导出需要通过 .default 访问
|
|
13
|
-
const utils = utilsModule.default || utilsModule
|
|
14
|
-
|
|
15
|
-
// 从 utils 导入配置管理函数(仅用于存储配置)
|
|
16
|
-
const { getConfig, setConfig, getTheme, getSize, getPrimaryColor, resetConfig, onConfigChange, setTheme, setSize, setPrimaryColor } = utils
|
|
17
|
-
|
|
18
|
-
// 导入组件
|
|
19
|
-
import XtButton from './components/xt-button'
|
|
20
|
-
import XtInput from './components/xt-input'
|
|
21
|
-
import XtFlexBox from './components/xt-flex-box'
|
|
22
|
-
import XtCard from './components/xt-card'
|
|
23
|
-
import XtCardItem from './components/xt-card-item'
|
|
24
|
-
import XtConfigProvider from './components/xt-config-provider'
|
|
25
|
-
import XtText from './components/xt-text'
|
|
26
|
-
import XtTime from './components/xt-time'
|
|
27
|
-
import XtStepPrice from './components/xt-step-price'
|
|
28
|
-
import XtStepPriceItem from './components/xt-step-price-item'
|
|
29
|
-
import XtMap from './components/xt-map'
|
|
30
|
-
import
|
|
31
|
-
import XtGridBox from './components/xt-grid-box'
|
|
32
|
-
import XtGridItem from './components/xt-grid-item'
|
|
33
|
-
import ExDatePicker from './components/ex-date-picker'
|
|
34
|
-
import ExButton from './components/ex-button'
|
|
35
|
-
import ExChart from './components/ex-chart' // ExChart 组件(基于 ECharts 封装)
|
|
36
|
-
import ExCard from './components/ex-card'
|
|
37
|
-
import ExIcon from './components/ex-icon' // ExIcon 组件(支持 el-icon / svg / 自定义字体)
|
|
38
|
-
import ExTable from './components/ex-table' // ExTable 组件(基于 ElementUI Table 封装)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
// 导出工具函数和变量
|
|
165
|
-
export {
|
|
166
|
-
utils,
|
|
167
|
-
variables,
|
|
168
|
-
// 配置管理函数(从 utils 导入)
|
|
169
|
-
getConfig,
|
|
170
|
-
setConfig,
|
|
171
|
-
getTheme,
|
|
172
|
-
getSize,
|
|
173
|
-
getPrimaryColor,
|
|
174
|
-
resetConfig,
|
|
175
|
-
onConfigChange,
|
|
176
|
-
setTheme,
|
|
177
|
-
setSize,
|
|
178
|
-
setPrimaryColor
|
|
1
|
+
// 导入主题样式(定义 CSS 变量)
|
|
2
|
+
import './styles/css-variables.scss'
|
|
3
|
+
|
|
4
|
+
// 导入组件样式(统一入口)
|
|
5
|
+
import './components/index.scss'
|
|
6
|
+
|
|
7
|
+
// 导入 SCSS 变量(通过 CSS Modules :export 导出)
|
|
8
|
+
import variables from './styles/variables-export.scss'
|
|
9
|
+
|
|
10
|
+
import utilsModule from './utils/index'
|
|
11
|
+
|
|
12
|
+
// ES Module 默认导出需要通过 .default 访问
|
|
13
|
+
const utils = utilsModule.default || utilsModule
|
|
14
|
+
|
|
15
|
+
// 从 utils 导入配置管理函数(仅用于存储配置)
|
|
16
|
+
const { getConfig, setConfig, getTheme, getSize, getPrimaryColor, resetConfig, onConfigChange, setTheme, setSize, setPrimaryColor } = utils
|
|
17
|
+
|
|
18
|
+
// 导入组件
|
|
19
|
+
import XtButton from './components/xt-button'
|
|
20
|
+
import XtInput from './components/xt-input'
|
|
21
|
+
import XtFlexBox from './components/xt-flex-box'
|
|
22
|
+
import XtCard from './components/xt-card'
|
|
23
|
+
import XtCardItem from './components/xt-card-item'
|
|
24
|
+
import XtConfigProvider from './components/xt-config-provider'
|
|
25
|
+
import XtText from './components/xt-text'
|
|
26
|
+
import XtTime from './components/xt-time'
|
|
27
|
+
import XtStepPrice from './components/xt-step-price'
|
|
28
|
+
import XtStepPriceItem from './components/xt-step-price-item'
|
|
29
|
+
import XtMap from './components/xt-map'
|
|
30
|
+
import XtMapProvider from './components/xt-map-provider'
|
|
31
|
+
import XtGridBox from './components/xt-grid-box'
|
|
32
|
+
import XtGridItem from './components/xt-grid-item'
|
|
33
|
+
import ExDatePicker from './components/ex-date-picker'
|
|
34
|
+
import ExButton from './components/ex-button'
|
|
35
|
+
import ExChart from './components/ex-chart' // ExChart 组件(基于 ECharts 封装)
|
|
36
|
+
import ExCard from './components/ex-card'
|
|
37
|
+
import ExIcon from './components/ex-icon' // ExIcon 组件(支持 el-icon / svg / 自定义字体)
|
|
38
|
+
import ExTable from './components/ex-table' // ExTable 组件(基于 ElementUI Table 封装)
|
|
39
|
+
|
|
40
|
+
import { registerElementExComponents, registerElementDirectives } from './config/element-registry'
|
|
41
|
+
|
|
42
|
+
const components = [
|
|
43
|
+
XtButton,
|
|
44
|
+
XtInput,
|
|
45
|
+
XtFlexBox,
|
|
46
|
+
XtCard,
|
|
47
|
+
XtCardItem,
|
|
48
|
+
XtConfigProvider,
|
|
49
|
+
XtText,
|
|
50
|
+
XtTime,
|
|
51
|
+
XtStepPrice,
|
|
52
|
+
XtStepPriceItem,
|
|
53
|
+
XtMap,
|
|
54
|
+
XtMapProvider,
|
|
55
|
+
XtGridBox,
|
|
56
|
+
XtGridItem,
|
|
57
|
+
ExDatePicker,
|
|
58
|
+
ExButton,
|
|
59
|
+
ExChart,
|
|
60
|
+
ExCard,
|
|
61
|
+
ExIcon,
|
|
62
|
+
ExTable
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
const install = function (Vue, options = {}) {
|
|
66
|
+
if (install.installed) return
|
|
67
|
+
install.installed = true
|
|
68
|
+
|
|
69
|
+
components.forEach(component => {
|
|
70
|
+
Vue.component(component.name, component)
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
Vue.prototype.$xt = {
|
|
74
|
+
setTheme,
|
|
75
|
+
setSize,
|
|
76
|
+
setPrimaryColor,
|
|
77
|
+
getConfig,
|
|
78
|
+
setConfig,
|
|
79
|
+
getTheme,
|
|
80
|
+
getSize,
|
|
81
|
+
getPrimaryColor,
|
|
82
|
+
resetConfig,
|
|
83
|
+
onConfigChange
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (options) {
|
|
87
|
+
if (options.theme !== undefined) {
|
|
88
|
+
setTheme(options.theme)
|
|
89
|
+
}
|
|
90
|
+
if (options.size !== undefined) {
|
|
91
|
+
setSize(options.size)
|
|
92
|
+
}
|
|
93
|
+
if (options.primaryColor !== undefined) {
|
|
94
|
+
setPrimaryColor(options.primaryColor)
|
|
95
|
+
}
|
|
96
|
+
if (options.config !== undefined) {
|
|
97
|
+
setConfig(options.config)
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
const ElementUI = require('element-ui')
|
|
103
|
+
registerElementExComponents(Vue, ElementUI)
|
|
104
|
+
registerElementDirectives(Vue, ElementUI)
|
|
105
|
+
} catch (e) {
|
|
106
|
+
console.warn('[XtElementUI] ElementUI 未安装,Ex 系列组件可能无法正常使用')
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// 支持全局 script 标签引入
|
|
111
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
112
|
+
install(window.Vue)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 导出
|
|
116
|
+
export default {
|
|
117
|
+
install,
|
|
118
|
+
// 导出组件列表
|
|
119
|
+
components,
|
|
120
|
+
// 按需导出组件
|
|
121
|
+
XtButton,
|
|
122
|
+
XtInput,
|
|
123
|
+
XtFlexBox,
|
|
124
|
+
XtCard,
|
|
125
|
+
XtCardItem,
|
|
126
|
+
XtConfigProvider,
|
|
127
|
+
XtText,
|
|
128
|
+
XtTime,
|
|
129
|
+
XtStepPrice,
|
|
130
|
+
XtStepPriceItem,
|
|
131
|
+
XtMap,
|
|
132
|
+
XtMapProvider,
|
|
133
|
+
XtGridBox,
|
|
134
|
+
XtGridItem,
|
|
135
|
+
ExDatePicker,
|
|
136
|
+
ExButton,
|
|
137
|
+
ExCard,
|
|
138
|
+
ExIcon,
|
|
139
|
+
ExTable
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// ExChart 组件按需导出(使用时需自行安装 echarts 依赖)
|
|
143
|
+
export { default as ExChart } from './components/ex-chart'
|
|
144
|
+
|
|
145
|
+
// ExTable 虚拟滚动演示数据工具
|
|
146
|
+
export { createVirtualScrollData, virtualScrollColumns } from './components/ex-table/virtualScrollData'
|
|
147
|
+
|
|
148
|
+
// 导出工具函数和变量
|
|
149
|
+
export {
|
|
150
|
+
utils,
|
|
151
|
+
variables,
|
|
152
|
+
// 配置管理函数(从 utils 导入)
|
|
153
|
+
getConfig,
|
|
154
|
+
setConfig,
|
|
155
|
+
getTheme,
|
|
156
|
+
getSize,
|
|
157
|
+
getPrimaryColor,
|
|
158
|
+
resetConfig,
|
|
159
|
+
onConfigChange,
|
|
160
|
+
setTheme,
|
|
161
|
+
setSize,
|
|
162
|
+
setPrimaryColor
|
|
179
163
|
}
|