xt-element-ui 2.2.1 → 2.2.3

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 (139) hide show
  1. package/README.md +1 -1
  2. package/docs/README.md +10 -3
  3. package/docs/components/base/xt-button.md +11 -4
  4. package/docs/components/base/xt-card.md +5 -11
  5. package/docs/components/base/xt-config-provider.md +2 -0
  6. package/docs/components/base/xt-date-picker.md +7 -26
  7. package/docs/components/base/xt-flow.md +404 -0
  8. package/docs/components/base/xt-grid-box.md +34 -34
  9. package/docs/components/base/xt-multi.md +5 -5
  10. package/docs/components/base/xt-tabs.md +51 -6
  11. package/docs/components/base/xt-text.md +20 -3
  12. package/docs/components/business/xt-chart.md +1 -0
  13. package/lib/css/1.87a493be.css +1 -0
  14. package/lib/index.common.1.js +294 -0
  15. package/lib/index.common.2.js +141 -0
  16. package/lib/index.common.js +12125 -118823
  17. package/lib/index.css +1 -1
  18. package/lib/index.umd.1.js +294 -0
  19. package/lib/index.umd.2.js +141 -0
  20. package/lib/index.umd.js +12131 -118828
  21. package/lib/index.umd.min.1.js +1 -0
  22. package/lib/index.umd.min.2.js +1 -0
  23. package/lib/index.umd.min.js +1 -1
  24. package/lib/xt-badge/xt-badge.common.js +1 -1
  25. package/lib/xt-badge/xt-badge.css +1 -1
  26. package/lib/xt-badge/xt-badge.umd.js +1 -1
  27. package/lib/xt-button/xt-button.common.js +13 -8
  28. package/lib/xt-button/xt-button.css +1 -1
  29. package/lib/xt-button/xt-button.umd.js +13 -8
  30. package/lib/xt-button/xt-button.umd.min.js +1 -1
  31. package/lib/xt-card/xt-card.common.js +5 -5
  32. package/lib/xt-card/xt-card.umd.js +5 -5
  33. package/lib/xt-card/xt-card.umd.min.js +1 -1
  34. package/lib/xt-card-item/xt-card-item.common.js +4 -4
  35. package/lib/xt-card-item/xt-card-item.umd.js +4 -4
  36. package/lib/xt-card-item/xt-card-item.umd.min.js +1 -1
  37. package/lib/xt-chart/xt-chart.common.js +1969 -108924
  38. package/lib/xt-chart/xt-chart.css +1 -1
  39. package/lib/xt-chart/xt-chart.umd.js +1975 -108929
  40. package/lib/xt-chart/xt-chart.umd.min.js +1 -1
  41. package/lib/xt-config-provider/xt-config-provider.common.js +561 -107504
  42. package/lib/xt-config-provider/xt-config-provider.css +1 -1
  43. package/lib/xt-config-provider/xt-config-provider.umd.js +567 -107509
  44. package/lib/xt-config-provider/xt-config-provider.umd.min.js +1 -1
  45. package/lib/xt-date-picker/css/1.87a493be.css +1 -0
  46. package/lib/xt-date-picker/xt-date-picker.common.1.js +294 -0
  47. package/lib/xt-date-picker/xt-date-picker.common.2.js +141 -0
  48. package/lib/xt-date-picker/xt-date-picker.common.js +201 -332
  49. package/lib/xt-date-picker/xt-date-picker.css +1 -1
  50. package/lib/xt-date-picker/xt-date-picker.umd.1.js +294 -0
  51. package/lib/xt-date-picker/xt-date-picker.umd.2.js +141 -0
  52. package/lib/xt-date-picker/xt-date-picker.umd.js +201 -332
  53. package/lib/xt-date-picker/xt-date-picker.umd.min.1.js +1 -0
  54. package/lib/xt-date-picker/xt-date-picker.umd.min.2.js +1 -0
  55. package/lib/xt-date-picker/xt-date-picker.umd.min.js +1 -1
  56. package/lib/xt-flex-box/xt-flex-box.common.js +1 -1
  57. package/lib/xt-flex-box/xt-flex-box.umd.js +1 -1
  58. package/lib/xt-flow/demo.html +10 -0
  59. package/lib/xt-flow/index.js +1 -0
  60. package/lib/xt-flow/xt-flow.common.js +638 -0
  61. package/lib/xt-flow/xt-flow.css +1 -0
  62. package/lib/xt-flow/xt-flow.umd.js +648 -0
  63. package/lib/xt-flow/xt-flow.umd.min.js +1 -0
  64. package/lib/xt-form-schema/xt-form-schema.common.js +1 -1
  65. package/lib/xt-form-schema/xt-form-schema.umd.js +1 -1
  66. package/lib/xt-grid-box/xt-grid-box.common.js +1 -1
  67. package/lib/xt-grid-box/xt-grid-box.umd.js +1 -1
  68. package/lib/xt-grid-item/xt-grid-item.common.js +1 -1
  69. package/lib/xt-grid-item/xt-grid-item.umd.js +1 -1
  70. package/lib/xt-icon/xt-icon.common.js +1 -1
  71. package/lib/xt-icon/xt-icon.umd.js +1 -1
  72. package/lib/xt-input/xt-input.common.js +1 -1
  73. package/lib/xt-input/xt-input.umd.js +1 -1
  74. package/lib/xt-list/xt-list.common.js +1 -1
  75. package/lib/xt-list/xt-list.umd.js +1 -1
  76. package/lib/xt-map/xt-map.common.js +1 -1
  77. package/lib/xt-map/xt-map.umd.js +1 -1
  78. package/lib/xt-map-provider/xt-map-provider.common.js +1 -1
  79. package/lib/xt-map-provider/xt-map-provider.umd.js +1 -1
  80. package/lib/xt-page/xt-page.common.js +1 -1
  81. package/lib/xt-page/xt-page.umd.js +1 -1
  82. package/lib/xt-progress/xt-progress.common.js +1 -1
  83. package/lib/xt-progress/xt-progress.umd.js +1 -1
  84. package/lib/xt-scroll-arrow/xt-scroll-arrow.common.js +1 -1
  85. package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.js +1 -1
  86. package/lib/xt-select-tree/xt-select-tree.common.js +1 -1
  87. package/lib/xt-select-tree/xt-select-tree.umd.js +1 -1
  88. package/lib/xt-step-price/xt-step-price.common.js +2 -2
  89. package/lib/xt-step-price/xt-step-price.umd.js +2 -2
  90. package/lib/xt-step-price-item/xt-step-price-item.common.js +1 -1
  91. package/lib/xt-step-price-item/xt-step-price-item.umd.js +1 -1
  92. package/lib/xt-tab-pane/xt-tab-pane.common.js +1 -1
  93. package/lib/xt-tab-pane/xt-tab-pane.umd.js +1 -1
  94. package/lib/xt-table/xt-table.common.js +2 -2
  95. package/lib/xt-table/xt-table.umd.js +2 -2
  96. package/lib/xt-tabs/xt-tabs.common.js +5 -27
  97. package/lib/xt-tabs/xt-tabs.css +1 -1
  98. package/lib/xt-tabs/xt-tabs.umd.js +5 -27
  99. package/lib/xt-tabs/xt-tabs.umd.min.js +1 -1
  100. package/lib/xt-text/xt-text.common.js +7 -4
  101. package/lib/xt-text/xt-text.css +1 -1
  102. package/lib/xt-text/xt-text.umd.js +7 -4
  103. package/lib/xt-text/xt-text.umd.min.js +1 -1
  104. package/lib/xt-time/xt-time.common.js +1 -1
  105. package/lib/xt-time/xt-time.umd.js +1 -1
  106. package/lib/xt-transfer-tree/xt-transfer-tree.common.js +1 -1
  107. package/lib/xt-transfer-tree/xt-transfer-tree.umd.js +1 -1
  108. package/lib/xt-upload/xt-upload.common.js +11 -11
  109. package/lib/xt-upload/xt-upload.umd.js +12 -12
  110. package/lib/xt-upload/xt-upload.umd.min.js +1 -1
  111. package/package.json +5 -6
  112. package/src/components/index.scss +7 -1
  113. package/src/components/xt-badge/style/index.scss +6 -6
  114. package/src/components/xt-button/index.vue +11 -6
  115. package/src/components/xt-button/style/index.scss +7 -5
  116. package/src/components/xt-card/index.vue +3 -3
  117. package/src/components/xt-card-item/index.vue +2 -2
  118. package/src/components/xt-chart/XtMulti.vue +8 -18
  119. package/src/components/xt-chart/XtPie.vue +1 -0
  120. package/src/components/xt-chart/utils.js +84 -50
  121. package/src/components/xt-config-provider/index.vue +56 -54
  122. package/src/components/xt-date-picker/component/Picker.vue +2 -46
  123. package/src/components/xt-date-picker/component/RangeDate.vue +4 -4
  124. package/src/components/xt-date-picker/index.js +1 -0
  125. package/src/components/xt-date-picker/index.vue +3 -23
  126. package/src/components/xt-date-picker/style/index.scss +62 -0
  127. package/src/components/xt-flow/flowable-parser.js +244 -0
  128. package/src/components/xt-flow/index.js +8 -0
  129. package/src/components/xt-flow/index.vue +226 -0
  130. package/src/components/xt-flow/style/index.scss +359 -0
  131. package/src/components/xt-input/style/index.scss +1 -1
  132. package/src/components/xt-tabs/index.vue +3 -174
  133. package/src/components/xt-tabs/style/index.scss +131 -121
  134. package/src/components/xt-text/index.vue +5 -2
  135. package/src/components/xt-text/style/index.scss +6 -6
  136. package/src/index.js +8 -13
  137. package/src/styles/css-variables.scss +73 -1
  138. package/src/styles/theme/index.scss +0 -1
  139. package/src/styles/theme/dark-variables.scss +0 -0
@@ -7,71 +7,67 @@ const HTMLElementType = typeof HTMLElement !== 'undefined' ? HTMLElement : Objec
7
7
  export default {
8
8
  name: 'XtConfigProvider',
9
9
  inheritAttrs: false,
10
- provide() {
10
+ data() {
11
11
  return {
12
12
  xtConfig: {
13
13
  theme: this.theme,
14
14
  size: this.size,
15
- primaryColor: this.primaryColor
15
+ primaryColor: this.primaryColor,
16
+ brand: this.brand
16
17
  }
17
18
  }
18
19
  },
20
+ provide() {
21
+ return {
22
+ xtConfig: this.xtConfig
23
+ }
24
+ },
19
25
  watch: {
20
26
  theme(newVal) {
21
- this.xtConfig ={
22
- theme: newVal,
23
- size: this.size,
24
- primaryColor: this.primaryColor
25
- }
27
+ this.xtConfig.theme = newVal
28
+ this.updateConfig()
26
29
  },
27
30
  size(newVal) {
28
- this.xtConfig ={
29
- theme: newVal,
30
- size: this.size,
31
- primaryColor: this.primaryColor
32
- }
31
+ this.xtConfig.size = newVal
32
+ this.updateConfig()
33
33
  },
34
34
  primaryColor(newVal) {
35
- this.xtConfig ={
36
- theme: newVal,
37
- size: this.size,
38
- primaryColor: this.primaryColor
39
- }
35
+ this.xtConfig.primaryColor = newVal
36
+ this.updateConfig()
37
+ },
38
+ brand(newVal) {
39
+ this.xtConfig.brand = newVal
40
+ this.updateConfig()
40
41
  }
41
42
  },
42
43
  render(h) {
43
- // Vue 2 不支持 Fragment,当 tag="template" 时需要特殊处理
44
- // 如果设置了 proxyElement,则不渲染包裹元素,只渲染 slot 内容
45
- if (this.tag === 'template' || this.proxyElement) {
46
- // 渲染 slot 内容,如果只有一个元素则直接返回,否则包裹一个 div
47
- const slotContent = this.$slots.default
44
+ const slotContent = this.$slots.default
48
45
 
46
+ if (this.tag === 'template' || this.proxyElement) {
49
47
  if (!slotContent || slotContent.length === 0) {
50
48
  return h('div')
51
49
  }
52
50
 
53
- // 如果 slot 只有一个元素,直接返回该元素
54
51
  if (slotContent.length === 1) {
55
52
  return slotContent[0]
56
53
  }
57
54
 
58
- // Vue 2 不支持多根节点,需要包裹一个 div
59
- // 使用普通的 div 包裹,避免 display: contents 的兼容性问题
60
55
  return h('div', {
61
56
  class: 'xt-config-provider-wrapper',
62
57
  attrs: {
63
- 'data-theme': this.theme
58
+ 'data-theme': this.theme,
59
+ 'data-brand': this.brand
64
60
  }
65
61
  }, slotContent)
66
62
  }
67
63
 
68
- // 正常渲染包裹元素
69
64
  return h(this.tag, {
70
65
  style: this.mergedStyle,
71
66
  class: this.computedClass,
72
67
  attrs: {
73
68
  ...this.customAttrs,
74
- 'data-theme': this.theme
69
+ 'data-theme': this.theme,
70
+ 'data-brand': this.brand
75
71
  }
76
72
  }, this.$slots.default)
77
73
  },
@@ -85,12 +81,22 @@ export default {
85
81
  },
86
82
  size: {
87
83
  type: String,
88
- default: 'medium'
84
+ default: 'medium',
85
+ validator: (value) => {
86
+ return ['small', 'medium', 'large'].includes(value)
87
+ }
89
88
  },
90
89
  primaryColor: {
91
90
  type: String,
92
91
  default: '#1890ff'
93
92
  },
93
+ brand: {
94
+ type: String,
95
+ default: '',
96
+ validator: (value) => {
97
+ return ['', 'water', 'electricity', 'gas'].includes(value)
98
+ }
99
+ },
94
100
  vars: {
95
101
  type: Object,
96
102
  default: () => ({})
@@ -118,12 +124,12 @@ export default {
118
124
  onThemeChange: {
119
125
  type: Function,
120
126
  default: null,
121
- description: '主题改变时的钩子函数,接收参数: { theme, size, primaryColor }'
127
+ description: '主题改变时的钩子函数,接收参数: { theme, size, primaryColor, brand }'
122
128
  },
123
129
  onStyleApplied: {
124
130
  type: Function,
125
131
  default: null,
126
- description: '样式应用完成时的钩子函数,接收参数: { element, style, theme }'
132
+ description: '样式应用完成时的钩子函数,接收参数: { element, style, theme, brand }'
127
133
  }
128
134
  },
129
135
  computed: {
@@ -133,13 +139,11 @@ export default {
133
139
  if (this.primaryColor) {
134
140
  const color = this.normalizeColor(this.primaryColor)
135
141
  result['--xt-color-primary'] = color
136
- // 浅色系列(与 css-variables.scss 保持一致)
137
142
  result['--xt-color-primary-light-3'] = this.lightenColor(color, 30)
138
143
  result['--xt-color-primary-light-5'] = this.lightenColor(color, 50)
139
144
  result['--xt-color-primary-light-7'] = this.lightenColor(color, 70)
140
145
  result['--xt-color-primary-light-8'] = this.lightenColor(color, 80)
141
146
  result['--xt-color-primary-light-9'] = this.lightenColor(color, 90)
142
- // 深色系列
143
147
  result['--xt-color-primary-dark-2'] = this.darkenColor(color, 20)
144
148
  }
145
149
 
@@ -154,18 +158,17 @@ export default {
154
158
 
155
159
  if (this.theme === 'dark') {
156
160
  if (this.injectBackground) {
157
- result.backgroundColor = result['--xt-color-bg-primary'] || '#141414'
161
+ result.backgroundColor = result['--xt-bg-color'] || '#141414'
158
162
  }
159
163
  if (this.injectColor) {
160
- result.color = result['--xt-color-text-primary'] || '#E5EAF3'
164
+ result.color = result['--xt-text-color-primary'] || '#E5EAF3'
161
165
  }
162
166
  } else {
163
- // 恢复默认主题颜色(light 主题)
164
167
  if (this.injectBackground) {
165
- result.backgroundColor = result['--xt-color-bg-primary'] || '#ffffff'
168
+ result.backgroundColor = result['--xt-bg-color'] || '#ffffff'
166
169
  }
167
170
  if (this.injectColor) {
168
- result.color = result['--xt-color-text-primary'] || '#2c3e50'
171
+ result.color = result['--xt-text-color-primary'] || '#303133'
169
172
  }
170
173
  }
171
174
 
@@ -181,7 +184,7 @@ export default {
181
184
  return classes
182
185
  },
183
186
  customAttrs() {
184
- const props = ['theme', 'size', 'primaryColor', 'vars', 'tag', 'injectBackground', 'injectColor', 'proxyElement']
187
+ const props = ['theme', 'size', 'primaryColor', 'brand', 'vars', 'tag', 'injectBackground', 'injectColor', 'proxyElement']
185
188
  const attrs = {}
186
189
 
187
190
  for (const key in this.$attrs) {
@@ -203,6 +206,10 @@ export default {
203
206
  this.clearProxyElementStyle()
204
207
  },
205
208
  methods: {
209
+ updateConfig() {
210
+ this.applyProxyElementStyle()
211
+ },
212
+
206
213
  normalizeColor(color) {
207
214
  if (!color) return '#1890ff'
208
215
 
@@ -250,8 +257,6 @@ export default {
250
257
  const rgb = this.hexToRgb(hex)
251
258
  if (!rgb) return hex
252
259
 
253
- // 使用与 Element Plus 一致的算法:将颜色与白色按比例混合
254
- // percent 表示混合白色的比例(0-100),即 (1 - percent/100) 是原色比例
255
260
  const ratio = percent / 100
256
261
  const r = Math.round(rgb.r * (1 - ratio) + 255 * ratio)
257
262
  const g = Math.round(rgb.g * (1 - ratio) + 255 * ratio)
@@ -264,8 +269,6 @@ export default {
264
269
  const rgb = this.hexToRgb(hex)
265
270
  if (!rgb) return hex
266
271
 
267
- // 使用按比例混合黑色的方式变暗
268
- // percent 表示混合黑色的比例(0-100)
269
272
  const ratio = percent / 100
270
273
  const r = Math.max(0, Math.round(rgb.r * (1 - ratio)))
271
274
  const g = Math.max(0, Math.round(rgb.g * (1 - ratio)))
@@ -305,36 +308,36 @@ export default {
305
308
 
306
309
  const style = this.mergedStyle
307
310
  const prevTheme = element.getAttribute('data-theme')
311
+ const prevBrand = element.getAttribute('data-brand')
308
312
 
309
- // 应用样式到代理元素
310
313
  for (const key in style) {
311
314
  element.style.setProperty(key, style[key])
312
315
  }
313
316
 
314
- // 设置 data-theme 属性
315
317
  element.setAttribute('data-theme', this.theme)
318
+ element.setAttribute('data-brand', this.brand)
316
319
 
317
- // 更新图表颜色
318
- EchartsUtil.changeAllTheme(this.theme, this.size, this.primaryColor)
320
+ EchartsUtil.changeAllTheme(this.theme, this.size, this.primaryColor, this.brand)
319
321
 
320
- // 触发主题改变钩子(当主题实际发生变化时)
321
322
  if (prevTheme !== this.theme && typeof this.onThemeChange === 'function') {
322
323
  this.onThemeChange({
323
324
  theme: this.theme,
324
325
  size: this.size,
325
326
  primaryColor: this.primaryColor,
326
- prevTheme: prevTheme
327
+ brand: this.brand,
328
+ prevTheme: prevTheme,
329
+ prevBrand: prevBrand
327
330
  })
328
331
  }
329
332
 
330
- // 触发样式应用完成钩子
331
333
  if (typeof this.onStyleApplied === 'function') {
332
334
  this.onStyleApplied({
333
335
  element: element,
334
336
  style: style,
335
337
  theme: this.theme,
336
338
  size: this.size,
337
- primaryColor: this.primaryColor
339
+ primaryColor: this.primaryColor,
340
+ brand: this.brand
338
341
  })
339
342
  }
340
343
 
@@ -350,17 +353,16 @@ export default {
350
353
  element.style.removeProperty(key)
351
354
  }
352
355
 
353
- // 移除 data-theme 属性
354
356
  element.removeAttribute('data-theme')
357
+ element.removeAttribute('data-brand')
355
358
  }
356
359
  }
357
360
  }
358
361
  </script>
359
362
 
360
363
  <style scoped>
361
- /* 包裹容器样式 - 最小化影响布局 */
362
364
  .xt-config-provider-wrapper {
363
365
  width: 100%;
364
366
  height: 100%;
365
367
  }
366
- </style>
368
+ </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="base-date-root">
2
+ <div class="date-picker">
3
3
  <el-date-picker
4
4
  v-if="type !== 'quarter'"
5
5
  v-model="innerValue"
@@ -73,9 +73,7 @@ export default {
73
73
  disabled: {
74
74
  type: Boolean,
75
75
  default: false
76
- },
77
- placeholder: String,
78
- valueFormat: String
76
+ }
79
77
  },
80
78
  data() {
81
79
  return {
@@ -89,7 +87,6 @@ export default {
89
87
  return this.type === 'quarter' ? null : this.type
90
88
  },
91
89
  placeholder() {
92
- if (this.$props.placeholder) return this.$props.placeholder
93
90
  const map = {
94
91
  date: '请选择日期',
95
92
  month: '请选择月份',
@@ -100,7 +97,6 @@ export default {
100
97
  return map[this.type] || '请选择日期'
101
98
  },
102
99
  valueFormat() {
103
- if (this.$props.valueFormat) return this.$props.valueFormat
104
100
  const map = {
105
101
  date: 'yyyy-MM-dd',
106
102
  month: 'yyyy-MM',
@@ -154,43 +150,3 @@ export default {
154
150
  }
155
151
  }
156
152
  </script>
157
-
158
- <style scoped>
159
- .base-date-root {
160
- }
161
-
162
- .quarter-panel {
163
- padding: 10px;
164
- }
165
-
166
- .quarter-header {
167
- display: flex;
168
- align-items: center;
169
- justify-content: space-between;
170
- margin-bottom: 10px;
171
- }
172
-
173
- .quarter-list {
174
- display: grid;
175
- grid-template-columns: repeat(2, 1fr);
176
- gap: 8px;
177
- }
178
-
179
- .quarter-item {
180
- text-align: center;
181
- padding: 8px 0;
182
- border: 1px solid #e4e7ed;
183
- border-radius: 4px;
184
- cursor: pointer;
185
- }
186
-
187
- .quarter-item.active {
188
- background: #409eff;
189
- color: #fff;
190
- border-color: #409eff;
191
- }
192
-
193
- ::v-deep .base-date-popper {
194
- border-radius: 4px;
195
- }
196
- </style>
@@ -1,6 +1,6 @@
1
1
  <!-- RangeDate.vue 区间业务组件 -->
2
2
  <template>
3
- <div class="range-wrap">
3
+ <div class="range-picker">
4
4
  <Picker
5
5
  v-model="startVal"
6
6
  :type="type"
@@ -107,14 +107,14 @@
107
107
  }
108
108
  </script>
109
109
  <style scoped>
110
- .range-wrap {
110
+ .range-picker {
111
111
  display: flex;
112
112
  align-items: center;
113
113
  flex-wrap: wrap;
114
114
  gap: 8px;
115
115
  width: 100%;
116
116
  }
117
- .range-wrap .el-date-editor {
117
+ .range-picker .el-date-editor {
118
118
  flex: 1;
119
119
  min-width: 130px;
120
120
  }
@@ -124,7 +124,7 @@
124
124
  }
125
125
  /* 手机/窄侧边栏自动竖向排列 */
126
126
  @media (max-width: 360px) {
127
- .range-wrap {
127
+ .range-picker {
128
128
  flex-direction: column;
129
129
  align-items: stretch;
130
130
  }
@@ -1,3 +1,4 @@
1
+ import './style/index.scss'
1
2
  import XtDatePicker from './index.vue'
2
3
 
3
4
  XtDatePicker.install = function (Vue) {
@@ -31,6 +31,7 @@
31
31
  ref="singlePicker"
32
32
  v-model="singleValue"
33
33
  size="small"
34
+ class="xt-date"
34
35
  :disabled="disabled"
35
36
  append-to-body
36
37
  :format="format"
@@ -45,6 +46,7 @@
45
46
  v-else-if="!useRangeMode && realDateType === 'quarter'"
46
47
  v-model="singleValue"
47
48
  type="quarter"
49
+ class="xt-date"
48
50
  size="small"
49
51
  :disabled="disabled"
50
52
  :placeholder="innerPlaceholder"
@@ -89,12 +91,9 @@ const NORMAL_TO_RANGE_TYPE = {
89
91
  week: 'week'
90
92
  };
91
93
 
92
- import RangeDate from './component/RangeDate.vue';
93
- import Picker from './component/Picker.vue';
94
-
95
94
  export default {
96
95
  name: 'XtDatePicker',
97
- components: { RangeDate, Picker },
96
+ components: { RangeDate: () => import( './component/RangeDate.vue'), Picker: () => import( './component/Picker.vue') },
98
97
  // 标准v-model:父组件 v-model="xxx"
99
98
  model: {
100
99
  prop: 'value',
@@ -250,22 +249,3 @@ export default {
250
249
  }
251
250
  };
252
251
  </script>
253
-
254
- <style lang="scss" scoped>
255
- .xt-date-picker-container {
256
- display: inline-block;
257
- width: 100%;
258
- }
259
-
260
- .xt-date-dimension {
261
- margin-bottom: 8px;
262
- }
263
-
264
- .xt-date-picker-wrapper {
265
- display: inline-block;
266
- }
267
-
268
- .xt-date {
269
- width: 100%;
270
- }
271
- </style>
@@ -0,0 +1,62 @@
1
+
2
+ @import '../../../styles/variables.scss';
3
+ .xt-date-picker-container {
4
+ display: inline-block;
5
+ width: 100%;
6
+ --xt-input-height: 32px;
7
+ }
8
+ .xt-date .el-date-editor .el-input__inner {
9
+ background-color: var(--xt-fill-color-blank);
10
+ border-color: var(--xt-border-color);
11
+ color: var(--xt-text-color-regular);
12
+ font-size: var(--xt-font-size-base, 14px);
13
+ border-radius: var(--xt-border-radius-small, 4px);
14
+ height: var(--xt-input-height);
15
+ line-height: var(--xt-input-height);
16
+ padding: 0 30px;
17
+ }
18
+ .xt-date-dimension {
19
+ margin-bottom: 8px;
20
+ }
21
+
22
+ .xt-date-picker-wrapper {
23
+ display: inline-block;
24
+ }
25
+
26
+
27
+
28
+
29
+ .quarter-panel {
30
+ padding: 10px;
31
+
32
+ .quarter-header {
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: space-between;
36
+ margin-bottom: 10px;
37
+ }
38
+
39
+ .quarter-list {
40
+ display: grid;
41
+ grid-template-columns: repeat(2, 1fr);
42
+ gap: 8px;
43
+ }
44
+
45
+ .quarter-item {
46
+ text-align: center;
47
+ padding: 8px 0;
48
+ border: 1px solid #e4e7ed;
49
+ border-radius: 4px;
50
+ cursor: pointer;
51
+ }
52
+
53
+ .quarter-item.active {
54
+ background: #409eff;
55
+ color: #fff;
56
+ border-color: #409eff;
57
+ }
58
+
59
+ ::v-deep .base-date-popper {
60
+ border-radius: 4px;
61
+ }
62
+ }