xt-element-ui 1.3.3 → 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.
Files changed (111) hide show
  1. package/CHANGELOG.md +72 -72
  2. package/LICENSE +21 -21
  3. package/README.md +240 -240
  4. package/docs/README.md +100 -100
  5. package/docs/components/base/xt-button.md +114 -114
  6. package/docs/components/base/xt-card-item.md +104 -104
  7. package/docs/components/base/xt-card.md +108 -108
  8. package/docs/components/base/xt-config-provider.md +199 -199
  9. package/docs/components/base/xt-flex-box.md +115 -115
  10. package/docs/components/base/xt-grid-box.md +302 -302
  11. package/docs/components/base/xt-input.md +150 -150
  12. package/docs/components/base/xt-map-provider.md +23 -23
  13. package/docs/components/base/xt-map.md +331 -331
  14. package/docs/components/base/xt-step-price.md +165 -165
  15. package/docs/components/base/xt-text.md +212 -212
  16. package/docs/components/base/xt-time.md +165 -165
  17. package/docs/components/extend/ex-bar.md +67 -67
  18. package/docs/components/extend/ex-button.md +62 -62
  19. package/docs/components/extend/ex-card.md +86 -86
  20. package/docs/components/extend/ex-chart.md +463 -463
  21. package/docs/components/extend/ex-icon.md +189 -189
  22. package/docs/components/extend/ex-line.md +70 -70
  23. package/docs/components/extend/ex-multi.md +155 -155
  24. package/docs/components/extend/ex-pie.md +69 -69
  25. package/docs/components/extend/ex-select-tree.md +210 -210
  26. package/docs/components/extend/ex-table.md +590 -590
  27. package/docs/components/extend/ex-upload.md +134 -134
  28. package/docs/components/utils/size.md +147 -147
  29. package/docs/components/utils/theme.md +182 -182
  30. package/lib/index.common.js +4112 -4122
  31. package/lib/index.umd.js +4072 -4081
  32. package/lib/index.umd.min.js +3 -3
  33. package/package.json +80 -81
  34. package/src/components/ex-button/index.js +7 -7
  35. package/src/components/ex-button/index.vue +66 -66
  36. package/src/components/ex-button/style/index.scss +67 -67
  37. package/src/components/ex-card/index.js +7 -7
  38. package/src/components/ex-card/index.vue +68 -68
  39. package/src/components/ex-card/style/index.scss +73 -73
  40. package/src/components/ex-chart/index.js +7 -7
  41. package/src/components/ex-chart/index.vue +136 -136
  42. package/src/components/ex-date-picker/index.js +7 -7
  43. package/src/components/ex-icon/index.js +7 -7
  44. package/src/components/ex-icon/index.vue +168 -168
  45. package/src/components/ex-icon/style/index.scss +7 -7
  46. package/src/components/ex-page/index.js +7 -7
  47. package/src/components/ex-select-tree/index.js +7 -7
  48. package/src/components/ex-table/ExTableCell.vue +22 -22
  49. package/src/components/ex-table/index.js +7 -7
  50. package/src/components/ex-table/virtualScrollData.js +35 -35
  51. package/src/components/ex-upload/index.js +7 -7
  52. package/src/components/index.scss +39 -39
  53. package/src/components/xt-button/index.js +7 -7
  54. package/src/components/xt-button/index.vue +97 -97
  55. package/src/components/xt-card/index.js +7 -7
  56. package/src/components/xt-card/style/index.scss +48 -48
  57. package/src/components/xt-card-item/index.js +7 -7
  58. package/src/components/xt-card-item/style/index copy.scss +71 -71
  59. package/src/components/xt-card-item/style/index.scss +82 -82
  60. package/src/components/xt-config-provider/index.js +7 -7
  61. package/src/components/xt-config-provider/index.vue +362 -362
  62. package/src/components/xt-config-provider/style/index.scss +11 -11
  63. package/src/components/xt-flex-box/index.js +7 -7
  64. package/src/components/xt-flex-box/style/index.scss +81 -81
  65. package/src/components/xt-grid-box/index.js +7 -7
  66. package/src/components/xt-grid-box/style/index.scss +92 -92
  67. package/src/components/xt-grid-item/index.js +7 -7
  68. package/src/components/xt-grid-item/index.vue +106 -106
  69. package/src/components/xt-input/index.js +7 -7
  70. package/src/components/xt-input/index.vue +66 -66
  71. package/src/components/xt-input/style/index.scss +84 -84
  72. package/src/components/xt-map/adapters/amap.js +235 -235
  73. package/src/components/xt-map/adapters/baidu.js +254 -254
  74. package/src/components/xt-map/adapters/base.js +267 -267
  75. package/src/components/xt-map/adapters/index.js +29 -29
  76. package/src/components/xt-map/adapters/tianditu.js +242 -242
  77. package/src/components/xt-map/config/xt-map-config.js +197 -197
  78. package/src/components/xt-map/index.js +8 -8
  79. package/src/components/xt-map/index.vue +351 -351
  80. package/src/components/xt-map/loaders/script-loader.js +114 -114
  81. package/src/components/xt-map/provider.vue +200 -200
  82. package/src/components/xt-map/style/index.scss +77 -77
  83. package/src/components/xt-map-provider/index.js +8 -8
  84. package/src/components/xt-step-price/index.js +10 -10
  85. package/src/components/xt-step-price/index.vue +272 -272
  86. package/src/components/xt-step-price/style/index.scss +123 -123
  87. package/src/components/xt-step-price-item/index.js +7 -7
  88. package/src/components/xt-step-price-item/index.vue +187 -187
  89. package/src/components/xt-text/index.js +7 -7
  90. package/src/components/xt-text/index.vue +1 -1
  91. package/src/components/xt-text/style/index.scss +92 -92
  92. package/src/components/xt-time/index.js +7 -7
  93. package/src/components/xt-time/index.vue +313 -313
  94. package/src/components/xt-time/style/index.scss +23 -23
  95. package/src/config/element-registry.js +135 -135
  96. package/src/index.js +162 -178
  97. package/src/styles/css-variables.scss +257 -257
  98. package/src/styles/theme/background.scss +5 -5
  99. package/src/styles/theme/border-radius.scss +3 -3
  100. package/src/styles/theme/borders.scss +3 -3
  101. package/src/styles/theme/colors.scss +101 -101
  102. package/src/styles/theme/component-variables.scss +69 -69
  103. package/src/styles/theme/dark-variables.scss +28 -28
  104. package/src/styles/theme/font.scss +12 -12
  105. package/src/styles/theme/index.scss +11 -11
  106. package/src/styles/theme/shadows.scss +2 -2
  107. package/src/styles/theme/spacing.scss +4 -4
  108. package/src/styles/theme/transitions.scss +2 -2
  109. package/src/styles/theme/typography.scss +4 -4
  110. package/src/styles/variables-export.scss +85 -85
  111. package/src/utils/index.js +191 -202
@@ -1,197 +1,197 @@
1
- /**
2
- * XtMap 全局配置管理
3
- * 支持通过 Vue.use 配置或运行时动态设置地图提供商、密钥、URL、主题等
4
- */
5
-
6
- // 支持的地图提供商
7
- export const MAP_PROVIDERS = ['amap', 'tianditu', 'baidu']
8
-
9
- // 支持的地图类型(统一枚举,各适配器会转成对应引擎的类型)
10
- export const MAP_TYPES = ['standard', 'satellite', 'hybrid', 'traffic']
11
-
12
- // 支持的主题
13
- export const MAP_THEMES = ['light', 'dark']
14
-
15
- // 默认配置 - 以高德地图为基准
16
- const defaultConfig = {
17
- provider: 'amap',
18
- apiKey: '',
19
- apiUrl: null,
20
- mapType: 'standard',
21
- theme: 'light',
22
- center: [116.397428, 39.90923],
23
- zoom: 11,
24
- plugins: [],
25
- securityJsCode: null,
26
- // 天地图专用:图层类型(vec:矢量, img:影像, ter:地形)
27
- tiandituLayerType: 'vec',
28
- // 百度地图专用:坐标系(bd09ll:百度经纬度, bd09mc:百度墨卡托)
29
- baiduCoordType: 'bd09ll'
30
- }
31
-
32
- // 当前配置
33
- let currentConfig = { ...defaultConfig }
34
-
35
- // 配置变更监听器
36
- const configChangeListeners = []
37
-
38
- const emitConfigChange = (key, value) => {
39
- configChangeListeners.forEach(listener => {
40
- try {
41
- listener(key, value)
42
- } catch (e) {
43
- console.warn('[XtMap] 配置变更监听异常:', e)
44
- }
45
- })
46
- }
47
-
48
- // 获取完整配置
49
- export const getMapConfig = () => ({ ...currentConfig })
50
-
51
- // 设置完整配置
52
- export const setMapConfig = (config) => {
53
- if (typeof config !== 'object' || config === null) {
54
- console.warn('[XtMap] setMapConfig 必须传入对象参数')
55
- return
56
- }
57
-
58
- if (config.provider !== undefined) setMapProvider(config.provider)
59
- if (config.apiKey !== undefined) setMapApiKey(config.apiKey)
60
- if (config.apiUrl !== undefined) setMapApiUrl(config.apiUrl)
61
- if (config.mapType !== undefined) setMapType(config.mapType)
62
- if (config.theme !== undefined) setMapTheme(config.theme)
63
- if (config.center !== undefined) setMapCenter(config.center)
64
- if (config.zoom !== undefined) setMapZoom(config.zoom)
65
- if (config.plugins !== undefined) setMapPlugins(config.plugins)
66
- if (config.securityJsCode !== undefined) setSecurityJsCode(config.securityJsCode)
67
- }
68
-
69
- export const setMapProvider = (provider) => {
70
- if (!MAP_PROVIDERS.includes(provider)) {
71
- console.warn(`[XtMap] 无效的地图提供商: ${provider},可选: ${MAP_PROVIDERS.join(', ')}`)
72
- return
73
- }
74
- currentConfig.provider = provider
75
- emitConfigChange('provider', provider)
76
- }
77
-
78
- export const setMapApiKey = (key) => {
79
- currentConfig.apiKey = key
80
- emitConfigChange('apiKey', key)
81
- }
82
-
83
- export const setMapApiUrl = (url) => {
84
- currentConfig.apiUrl = url
85
- emitConfigChange('apiUrl', url)
86
- }
87
-
88
- export const setMapType = (type) => {
89
- if (!MAP_TYPES.includes(type)) {
90
- console.warn(`[XtMap] 无效的地图类型: ${type},可选: ${MAP_TYPES.join(', ')}`)
91
- return
92
- }
93
- currentConfig.mapType = type
94
- emitConfigChange('mapType', type)
95
- }
96
-
97
- export const setMapTheme = (theme) => {
98
- if (!MAP_THEMES.includes(theme)) {
99
- console.warn(`[XtMap] 无效的主题: ${theme},可选: ${MAP_THEMES.join(', ')}`)
100
- return
101
- }
102
- currentConfig.theme = theme
103
- emitConfigChange('theme', theme)
104
- }
105
-
106
- export const setMapCenter = (center) => {
107
- if (!Array.isArray(center) || center.length !== 2) {
108
- console.warn('[XtMap] center 必须是 [lng, lat] 数组')
109
- return
110
- }
111
- currentConfig.center = center
112
- emitConfigChange('center', center)
113
- }
114
-
115
- export const setMapZoom = (zoom) => {
116
- const z = Number(zoom)
117
- if (isNaN(z)) {
118
- console.warn('[XtMap] zoom 必须是数字')
119
- return
120
- }
121
- currentConfig.zoom = z
122
- emitConfigChange('zoom', z)
123
- }
124
-
125
- export const setMapPlugins = (plugins) => {
126
- if (!Array.isArray(plugins)) {
127
- console.warn('[XtMap] plugins 必须是数组')
128
- return
129
- }
130
- currentConfig.plugins = plugins
131
- emitConfigChange('plugins', plugins)
132
- }
133
-
134
- export const setSecurityJsCode = (code) => {
135
- currentConfig.securityJsCode = code
136
- // 高德地图安全密钥:设置 window._AMapSecurityConfig
137
- if (typeof window !== 'undefined' && code) {
138
- window._AMapSecurityConfig = {
139
- securityJsCode: code,
140
- ...(window._AMapSecurityConfig || {})
141
- }
142
- }
143
- emitConfigChange('securityJsCode', code)
144
- }
145
-
146
- // 获取当前配置的快捷方法
147
- export const getMapProvider = () => currentConfig.provider
148
- export const getMapApiKey = () => currentConfig.apiKey
149
- export const getMapApiUrl = () => currentConfig.apiUrl
150
- export const getMapType = () => currentConfig.mapType
151
- export const getMapTheme = () => currentConfig.theme
152
- export const getMapCenter = () => currentConfig.center
153
- export const getMapZoom = () => currentConfig.zoom
154
- export const getMapPlugins = () => currentConfig.plugins
155
-
156
- // 监听配置变更
157
- export const onMapConfigChange = (listener) => {
158
- if (typeof listener === 'function') {
159
- configChangeListeners.push(listener)
160
- return () => {
161
- const index = configChangeListeners.indexOf(listener)
162
- if (index > -1) configChangeListeners.splice(index, 1)
163
- }
164
- }
165
- }
166
-
167
- // 重置为默认配置
168
- export const resetMapConfig = () => {
169
- setMapConfig(defaultConfig)
170
- }
171
-
172
- export default {
173
- MAP_PROVIDERS,
174
- MAP_TYPES,
175
- MAP_THEMES,
176
- getMapConfig,
177
- setMapConfig,
178
- setMapProvider,
179
- setMapApiKey,
180
- setMapApiUrl,
181
- setMapType,
182
- setMapTheme,
183
- setMapCenter,
184
- setMapZoom,
185
- setMapPlugins,
186
- setSecurityJsCode,
187
- getMapProvider,
188
- getMapApiKey,
189
- getMapApiUrl,
190
- getMapType,
191
- getMapTheme,
192
- getMapCenter,
193
- getMapZoom,
194
- getMapPlugins,
195
- onMapConfigChange,
196
- resetMapConfig
197
- }
1
+ /**
2
+ * XtMap 全局配置管理
3
+ * 支持通过 Vue.use 配置或运行时动态设置地图提供商、密钥、URL、主题等
4
+ */
5
+
6
+ // 支持的地图提供商
7
+ export const MAP_PROVIDERS = ['amap', 'tianditu', 'baidu']
8
+
9
+ // 支持的地图类型(统一枚举,各适配器会转成对应引擎的类型)
10
+ export const MAP_TYPES = ['standard', 'satellite', 'hybrid', 'traffic']
11
+
12
+ // 支持的主题
13
+ export const MAP_THEMES = ['light', 'dark']
14
+
15
+ // 默认配置 - 以高德地图为基准
16
+ const defaultConfig = {
17
+ provider: 'amap',
18
+ apiKey: '',
19
+ apiUrl: null,
20
+ mapType: 'standard',
21
+ theme: 'light',
22
+ center: [116.397428, 39.90923],
23
+ zoom: 11,
24
+ plugins: [],
25
+ securityJsCode: null,
26
+ // 天地图专用:图层类型(vec:矢量, img:影像, ter:地形)
27
+ tiandituLayerType: 'vec',
28
+ // 百度地图专用:坐标系(bd09ll:百度经纬度, bd09mc:百度墨卡托)
29
+ baiduCoordType: 'bd09ll'
30
+ }
31
+
32
+ // 当前配置
33
+ let currentConfig = { ...defaultConfig }
34
+
35
+ // 配置变更监听器
36
+ const configChangeListeners = []
37
+
38
+ const emitConfigChange = (key, value) => {
39
+ configChangeListeners.forEach(listener => {
40
+ try {
41
+ listener(key, value)
42
+ } catch (e) {
43
+ console.warn('[XtMap] 配置变更监听异常:', e)
44
+ }
45
+ })
46
+ }
47
+
48
+ // 获取完整配置
49
+ export const getMapConfig = () => ({ ...currentConfig })
50
+
51
+ // 设置完整配置
52
+ export const setMapConfig = (config) => {
53
+ if (typeof config !== 'object' || config === null) {
54
+ console.warn('[XtMap] setMapConfig 必须传入对象参数')
55
+ return
56
+ }
57
+
58
+ if (config.provider !== undefined) setMapProvider(config.provider)
59
+ if (config.apiKey !== undefined) setMapApiKey(config.apiKey)
60
+ if (config.apiUrl !== undefined) setMapApiUrl(config.apiUrl)
61
+ if (config.mapType !== undefined) setMapType(config.mapType)
62
+ if (config.theme !== undefined) setMapTheme(config.theme)
63
+ if (config.center !== undefined) setMapCenter(config.center)
64
+ if (config.zoom !== undefined) setMapZoom(config.zoom)
65
+ if (config.plugins !== undefined) setMapPlugins(config.plugins)
66
+ if (config.securityJsCode !== undefined) setSecurityJsCode(config.securityJsCode)
67
+ }
68
+
69
+ export const setMapProvider = (provider) => {
70
+ if (!MAP_PROVIDERS.includes(provider)) {
71
+ console.warn(`[XtMap] 无效的地图提供商: ${provider},可选: ${MAP_PROVIDERS.join(', ')}`)
72
+ return
73
+ }
74
+ currentConfig.provider = provider
75
+ emitConfigChange('provider', provider)
76
+ }
77
+
78
+ export const setMapApiKey = (key) => {
79
+ currentConfig.apiKey = key
80
+ emitConfigChange('apiKey', key)
81
+ }
82
+
83
+ export const setMapApiUrl = (url) => {
84
+ currentConfig.apiUrl = url
85
+ emitConfigChange('apiUrl', url)
86
+ }
87
+
88
+ export const setMapType = (type) => {
89
+ if (!MAP_TYPES.includes(type)) {
90
+ console.warn(`[XtMap] 无效的地图类型: ${type},可选: ${MAP_TYPES.join(', ')}`)
91
+ return
92
+ }
93
+ currentConfig.mapType = type
94
+ emitConfigChange('mapType', type)
95
+ }
96
+
97
+ export const setMapTheme = (theme) => {
98
+ if (!MAP_THEMES.includes(theme)) {
99
+ console.warn(`[XtMap] 无效的主题: ${theme},可选: ${MAP_THEMES.join(', ')}`)
100
+ return
101
+ }
102
+ currentConfig.theme = theme
103
+ emitConfigChange('theme', theme)
104
+ }
105
+
106
+ export const setMapCenter = (center) => {
107
+ if (!Array.isArray(center) || center.length !== 2) {
108
+ console.warn('[XtMap] center 必须是 [lng, lat] 数组')
109
+ return
110
+ }
111
+ currentConfig.center = center
112
+ emitConfigChange('center', center)
113
+ }
114
+
115
+ export const setMapZoom = (zoom) => {
116
+ const z = Number(zoom)
117
+ if (isNaN(z)) {
118
+ console.warn('[XtMap] zoom 必须是数字')
119
+ return
120
+ }
121
+ currentConfig.zoom = z
122
+ emitConfigChange('zoom', z)
123
+ }
124
+
125
+ export const setMapPlugins = (plugins) => {
126
+ if (!Array.isArray(plugins)) {
127
+ console.warn('[XtMap] plugins 必须是数组')
128
+ return
129
+ }
130
+ currentConfig.plugins = plugins
131
+ emitConfigChange('plugins', plugins)
132
+ }
133
+
134
+ export const setSecurityJsCode = (code) => {
135
+ currentConfig.securityJsCode = code
136
+ // 高德地图安全密钥:设置 window._AMapSecurityConfig
137
+ if (typeof window !== 'undefined' && code) {
138
+ window._AMapSecurityConfig = {
139
+ securityJsCode: code,
140
+ ...(window._AMapSecurityConfig || {})
141
+ }
142
+ }
143
+ emitConfigChange('securityJsCode', code)
144
+ }
145
+
146
+ // 获取当前配置的快捷方法
147
+ export const getMapProvider = () => currentConfig.provider
148
+ export const getMapApiKey = () => currentConfig.apiKey
149
+ export const getMapApiUrl = () => currentConfig.apiUrl
150
+ export const getMapType = () => currentConfig.mapType
151
+ export const getMapTheme = () => currentConfig.theme
152
+ export const getMapCenter = () => currentConfig.center
153
+ export const getMapZoom = () => currentConfig.zoom
154
+ export const getMapPlugins = () => currentConfig.plugins
155
+
156
+ // 监听配置变更
157
+ export const onMapConfigChange = (listener) => {
158
+ if (typeof listener === 'function') {
159
+ configChangeListeners.push(listener)
160
+ return () => {
161
+ const index = configChangeListeners.indexOf(listener)
162
+ if (index > -1) configChangeListeners.splice(index, 1)
163
+ }
164
+ }
165
+ }
166
+
167
+ // 重置为默认配置
168
+ export const resetMapConfig = () => {
169
+ setMapConfig(defaultConfig)
170
+ }
171
+
172
+ export default {
173
+ MAP_PROVIDERS,
174
+ MAP_TYPES,
175
+ MAP_THEMES,
176
+ getMapConfig,
177
+ setMapConfig,
178
+ setMapProvider,
179
+ setMapApiKey,
180
+ setMapApiUrl,
181
+ setMapType,
182
+ setMapTheme,
183
+ setMapCenter,
184
+ setMapZoom,
185
+ setMapPlugins,
186
+ setSecurityJsCode,
187
+ getMapProvider,
188
+ getMapApiKey,
189
+ getMapApiUrl,
190
+ getMapType,
191
+ getMapTheme,
192
+ getMapCenter,
193
+ getMapZoom,
194
+ getMapPlugins,
195
+ onMapConfigChange,
196
+ resetMapConfig
197
+ }
@@ -1,8 +1,8 @@
1
- import XtMap from './index.vue'
2
-
3
- XtMap.install = function (Vue) {
4
- Vue.component(XtMap.name, XtMap)
5
- }
6
-
7
- export default XtMap
8
- export { XtMap }
1
+ import XtMap from './index.vue'
2
+
3
+ XtMap.install = function (Vue) {
4
+ Vue.component(XtMap.name, XtMap)
5
+ }
6
+
7
+ export default XtMap
8
+ export { XtMap }