xt-element-ui 1.3.4 → 2.0.0

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 (103) hide show
  1. package/CHANGELOG.md +37 -20
  2. package/README.md +39 -35
  3. package/docs/README.md +25 -15
  4. package/docs/components/base/xt-badge.md +139 -0
  5. package/docs/components/base/xt-bar.md +182 -0
  6. package/docs/components/base/xt-card-item.md +12 -12
  7. package/docs/components/base/xt-chart.md +183 -0
  8. package/docs/components/base/xt-date-picker.md +111 -0
  9. package/docs/components/base/xt-icon.md +154 -0
  10. package/docs/components/base/xt-line.md +145 -0
  11. package/docs/components/base/xt-multi.md +278 -0
  12. package/docs/components/base/xt-page.md +84 -0
  13. package/docs/components/base/xt-pie.md +175 -0
  14. package/docs/components/base/xt-progress.md +134 -0
  15. package/docs/components/base/xt-select-tree.md +141 -0
  16. package/docs/components/base/xt-table.md +344 -0
  17. package/docs/components/base/xt-tabs.md +197 -0
  18. package/docs/components/base/xt-upload.md +85 -0
  19. package/lib/index.common.js +885 -828
  20. package/lib/index.css +1 -1
  21. package/lib/index.umd.js +890 -834
  22. package/lib/index.umd.min.js +5 -5
  23. package/package.json +1 -1
  24. package/src/components/index.scss +11 -8
  25. package/src/components/xt-badge/index.js +7 -0
  26. package/src/components/xt-badge/index.vue +71 -0
  27. package/src/components/xt-badge/style/index.scss +88 -0
  28. package/src/components/xt-button/index.js +8 -8
  29. package/src/components/xt-button/index.vue +43 -73
  30. package/src/components/xt-button/style/index.scss +51 -787
  31. package/src/components/xt-card/index.js +7 -8
  32. package/src/components/xt-card/index.vue +61 -21
  33. package/src/components/xt-card/style/index.scss +56 -32
  34. package/src/components/xt-card-item/index.vue +7 -7
  35. package/src/components/xt-chart/index.js +8 -0
  36. package/src/components/{ex-chart → xt-chart}/index.vue +13 -13
  37. package/src/components/{ex-chart → xt-chart}/pieList.vue +1 -1
  38. package/src/components/{ex-chart → xt-chart}/theme/dark.js +4 -1
  39. package/src/components/{ex-chart → xt-chart}/utils.js +1 -1
  40. package/src/components/xt-config-provider/index.vue +1 -1
  41. package/src/components/xt-date-picker/index.js +8 -0
  42. package/src/components/{ex-date-picker → xt-date-picker}/index.vue +1 -1
  43. package/src/components/xt-icon/index.js +8 -0
  44. package/src/components/{ex-icon → xt-icon}/index.vue +4 -4
  45. package/src/components/xt-layout/ExFieldset.vue +1 -1
  46. package/src/components/xt-page/index.js +8 -0
  47. package/src/components/{ex-page → xt-page}/index.vue +1 -1
  48. package/src/components/xt-progress/index.js +7 -0
  49. package/src/components/xt-progress/index.vue +103 -0
  50. package/src/components/xt-progress/style/index.scss +119 -0
  51. package/src/components/xt-select-tree/index.js +8 -0
  52. package/src/components/{ex-select-tree → xt-select-tree}/index.vue +1 -1
  53. package/src/components/{ex-table/ExTableCell.vue → xt-table/XtTableCell.vue} +1 -1
  54. package/src/components/xt-table/index.js +8 -0
  55. package/src/components/{ex-table → xt-table}/index.vue +6 -6
  56. package/src/components/xt-tabs/TabPane.vue +36 -0
  57. package/src/components/xt-tabs/index.js +10 -0
  58. package/src/components/xt-tabs/index.vue +113 -0
  59. package/src/components/xt-tabs/style/index.scss +197 -0
  60. package/src/components/xt-text/index.vue +15 -1
  61. package/src/components/xt-text/style/index.scss +18 -0
  62. package/src/components/xt-upload/index.js +8 -0
  63. package/src/index.js +24 -31
  64. package/src/utils/index.js +1 -1
  65. package/docs/components/extend/ex-bar.md +0 -68
  66. package/docs/components/extend/ex-button.md +0 -62
  67. package/docs/components/extend/ex-card.md +0 -86
  68. package/docs/components/extend/ex-chart.md +0 -463
  69. package/docs/components/extend/ex-date-picker.md +0 -0
  70. package/docs/components/extend/ex-icon.md +0 -189
  71. package/docs/components/extend/ex-line.md +0 -71
  72. package/docs/components/extend/ex-multi.md +0 -156
  73. package/docs/components/extend/ex-page.md +0 -0
  74. package/docs/components/extend/ex-pie.md +0 -70
  75. package/docs/components/extend/ex-select-tree.md +0 -210
  76. package/docs/components/extend/ex-table.md +0 -591
  77. package/docs/components/extend/ex-upload.md +0 -134
  78. package/src/components/ex-button/index.js +0 -8
  79. package/src/components/ex-button/index.vue +0 -67
  80. package/src/components/ex-button/style/index.scss +0 -67
  81. package/src/components/ex-card/index.js +0 -7
  82. package/src/components/ex-card/index.vue +0 -68
  83. package/src/components/ex-card/style/index.scss +0 -73
  84. package/src/components/ex-chart/index.js +0 -8
  85. package/src/components/ex-date-picker/index.js +0 -8
  86. package/src/components/ex-icon/index.js +0 -8
  87. package/src/components/ex-page/index.js +0 -8
  88. package/src/components/ex-select-tree/index.js +0 -8
  89. package/src/components/ex-table/index.js +0 -8
  90. package/src/components/ex-upload/index.js +0 -8
  91. package/src/config/element-registry.js +0 -136
  92. /package/src/components/{ex-chart/ExBar.vue → xt-chart/XtBar.vue} +0 -0
  93. /package/src/components/{ex-chart/ExLine.vue → xt-chart/XtLine.vue} +0 -0
  94. /package/src/components/{ex-chart/ExMulti.vue → xt-chart/XtMulti.vue} +0 -0
  95. /package/src/components/{ex-chart/ExPie.vue → xt-chart/XtPie.vue} +0 -0
  96. /package/src/components/{ex-chart → xt-chart}/theme/white.js +0 -0
  97. /package/src/components/{ex-date-picker → xt-date-picker}/SearchDate.vue +0 -0
  98. /package/src/components/{ex-date-picker → xt-date-picker}/quarter.vue +0 -0
  99. /package/src/components/{ex-icon → xt-icon}/style/index.scss +0 -0
  100. /package/src/components/{ex-table → xt-table}/VirtualElTable.vue +0 -0
  101. /package/src/components/{ex-table → xt-table}/virtualScrollData.js +0 -0
  102. /package/src/components/{ex-upload → xt-upload}/index.vue +0 -0
  103. /package/src/components/{ex-upload → xt-upload}/preview.vue +0 -0
@@ -1,8 +1,7 @@
1
- import XtCard from './index.vue'
2
-
3
- XtCard.install = function (Vue) {
4
- Vue.component(XtCard.name, XtCard)
5
- }
6
-
7
- export default XtCard
8
- export { XtCard }
1
+ import XtCard from './index.vue'
2
+
3
+ XtCard.install = function (Vue) {
4
+ Vue.component(XtCard.name, XtCard)
5
+ }
6
+
7
+ export default XtCard
@@ -1,28 +1,68 @@
1
1
  <template>
2
- <div class="xt-card" :class="{'no-padding': noPadding }">
3
- <div class="card__header" v-if="title">
4
- <slot name="icon">{{ icon }}</slot>
5
- <slot name="title">{{ title }}</slot>
6
- </div>
7
- <div class="card__body">
8
- <slot>
9
- <span class="value"><slot name="value">{{ value }}</slot></span>
10
- <span class="unit">{{ unit }}</span>
11
- </slot>
12
- </div>
13
- </div>
2
+ <el-card
3
+ class="ex-card"
4
+ :class="cardClasses"
5
+ v-bind="$attrs"
6
+ >
7
+ <template #header v-if="$slots.header || title">
8
+ <slot name="header">{{ title }}</slot>
9
+ </template>
10
+ <slot></slot>
11
+ </el-card>
14
12
  </template>
13
+
15
14
  <script>
16
15
  export default {
17
- name: "XtCard",
16
+ name: 'XtCard',
17
+ inheritAttrs: false,
18
+ inject: {
19
+ xtConfig: {
20
+ default: () => ({
21
+ theme: 'light',
22
+ size: 'medium',
23
+ primaryColor: '#1890ff'
24
+ })
25
+ }
26
+ },
18
27
  props: {
19
- type: {},
20
- title: {},
21
- value: {},
22
- unit: {},
23
- icon: {},
24
- iconIn: { default: "right" },
25
- noPadding: { type: Boolean, default: false }
28
+ title: {
29
+ type: String,
30
+ default: ''
31
+ },
32
+ shadow: {
33
+ type: String,
34
+ default: 'always',
35
+ validator: (val) => ['always', 'hover', 'never'].includes(val)
36
+ },
37
+ bordered: {
38
+ type: Boolean,
39
+ default: true
40
+ },
41
+ bodyClass: {
42
+ type: String,
43
+ default: ''
44
+ },
45
+ size: {
46
+ type: String,
47
+ default: null,
48
+ validator: (val) => !val || ['small', 'medium', 'large'].includes(val)
49
+ }
50
+ },
51
+ computed: {
52
+ finalSize() {
53
+ // 优先使用组件自身的 size,其次继承 XtConfigProvider 的 size,最后使用默认值
54
+ return this.size || this.xtConfig.size || 'medium'
55
+ },
56
+ cardClasses() {
57
+ return [
58
+ `ex-card-${this.shadow}`,
59
+ `ex-card-${this.finalSize}`,
60
+ {
61
+ 'ex-card-no-border': !this.bordered,
62
+ [this.bodyClass]: this.bodyClass
63
+ }
64
+ ]
65
+ }
26
66
  }
27
67
  }
28
- </script>
68
+ </script>
@@ -1,49 +1,73 @@
1
+ // XtCard 组件样式
2
+ @import '../../../styles/element-theme.scss';
1
3
  @import '../../../styles/variables.scss';
2
4
 
3
- .xt-card {
4
- --xt-card-bg-color: var(--xt-card-bg-color, #ffffff);
5
- --xt-card-border-color: var(--xt-card-border-color, #EBEEF5);
6
- --xt-card-text-color: var(--xt-color-text-primary, #303133);
5
+ .ex-card {
6
+ border-radius: 8px;
7
+ transition: all 0.3s;
8
+ font-size: var(--ex-card-font-size, 14px);
9
+ background-color: var(--el-bg-color-block, #ffffff);
10
+ color: var(--el-text-color-primary, #303133);
11
+ border-color: var(--el-border-color, #303133);
7
12
 
8
- border-radius: var(--xt-card-border-radius, 4px);
9
- box-shadow: var(--xt-card-shadow, 0 2px 12px 0 rgba(0, 0, 0, 0.1));
10
- background-color: var(--xt-card-bg-color);
11
- overflow: hidden;
12
- color: var(--xt-card-text-color);
13
- transition: var(--xt-transition-duration, 0.3s);
13
+ .el-card__header {
14
+ padding: var(--ex-card-header-padding, 16px 20px);
15
+ border-bottom: 1px solid var(--el-border-color, #ebeef5);
16
+ background-color: var(--el-bg-color-block-head, #ffffff);
17
+ font-weight: 600;
18
+ }
19
+
20
+ .el-card__body {
21
+ padding: var(--ex-card-body-padding, 20px);
22
+ }
23
+ }
24
+
25
+ .ex-card-small {
26
+ font-size: 12px;
27
+
28
+ .el-card__header {
29
+ font-size: 12px;
30
+ }
14
31
  }
15
32
 
16
- .xt-card .card__header {
17
- padding: var(--xt-card-header-padding, 18px 20px);
18
- box-sizing: border-box;
19
- font-weight: 600;
20
- font-size: var(--xt-font-size-medium, 16px);
33
+ .ex-card-medium {
34
+ font-size: 14px;
35
+
36
+ .el-card__header {
37
+ font-size: 14px;
38
+ }
21
39
  }
22
40
 
23
- .xt-card .card__body {
24
- padding: var(--xt-card-padding, 20px);
41
+ .ex-card-large {
42
+ font-size: 16px;
43
+
44
+ .el-card__header {
45
+ font-size: 16px;
46
+ }
25
47
  }
26
48
 
27
- .xt-card .card__body .value {
28
- font-size: var(--xt-font-size-large, 18px);
29
- font-weight: 600;
30
- color: var(--xt-color-primary, #1890ff);
49
+ .ex-card-always {
50
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
31
51
  }
32
52
 
33
- .xt-card .card__body .unit {
34
- font-size: var(--xt-font-size-base, 14px);
35
- color: var(--xt-color-text-secondary, #909399);
36
- margin-left: 4px;
53
+ .ex-card-hover {
54
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
55
+
56
+ &:hover {
57
+ box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.15);
58
+ }
37
59
  }
38
60
 
39
- .xt-card .value {
40
- font-weight: 600;
61
+ .ex-card-never {
62
+ box-shadow: none;
63
+ border: 1px solid var(--el-border-color, #ebeef5);
41
64
  }
42
65
 
43
- .xt-card .card__header + .card__body {
44
- padding-top: 0;
66
+ .ex-card-no-border {
67
+ border: none;
68
+
69
+ .el-card__header {
70
+ border-bottom: none;
71
+ }
45
72
  }
46
73
 
47
- .xt-card.noPadding .card__body {
48
- padding: 0;
49
- }
@@ -1,21 +1,21 @@
1
1
  <template>
2
- <ex-card class="xt-card-item" :bordered="false" :class="{ [`is-${type}`]: type ? true : false}">
3
- <xt-text bold size="medium">{{ title }}</xt-text>
4
- <xt-flex-box>
5
- <div style="width: 50%;margin-bottom: 5px;">
2
+ <xt-card class="xt-card-item" :bordered="false" :class="{ [`is-${type}`]: type ? true : false}">
3
+ <xt-flex-box content="between">
4
+ <div >
5
+ <div><xt-text bold size="extra-large">{{ title }}</xt-text></div>
6
6
  <xt-text bold size="large" v-model="value" format="thousand" :type="type" :decimals="0"></xt-text>
7
7
  <div style="margin: 5px 0;">
8
8
  <xt-text size="small">较昨日</xt-text>
9
9
  <xt-text v-model="change" format="normal" :type="diff > 0 ? 'success' : 'danger'" :suffix="diff > 0 ? '↑' : '↓'"></xt-text>
10
10
  </div>
11
11
  </div>
12
- <div style="flex: 1; height: 100%;">
12
+ <div style="height: 100%;">
13
13
  <slot name="icon">
14
- <xt-text size="extra-large" :type="type"><i class="el-icon-user"></i></xt-text>
14
+ <xt-text size="extra-large" :type="type"><xt-icon name="el-icon-user" :size="48" ></xt-icon></xt-text>
15
15
  </slot>
16
16
  </div>
17
17
  </xt-flex-box>
18
- </ex-card>
18
+ </xt-card>
19
19
  </template>
20
20
  <script>
21
21
  export default {
@@ -0,0 +1,8 @@
1
+ import XtChart from './index.vue'
2
+
3
+ XtChart.install = function (Vue) {
4
+ Vue.component(XtChart.name, XtChart)
5
+ }
6
+
7
+ export default XtChart
8
+ export { XtChart }
@@ -1,22 +1,22 @@
1
1
  <template>
2
- <ex-bar v-if="type=='bar'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-bar>
3
- <ex-line v-else-if="type=='line'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-line>
4
- <ex-pie v-else-if="type=='pie'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-pie>
5
- <ex-multi v-else-if="type=='multi'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-multi>
2
+ <xt-bar v-if="type=='bar'" v-bind="$attrs" :theme="myTheme" :size="mySize"></xt-bar>
3
+ <xt-line v-else-if="type=='line'" v-bind="$attrs" :theme="myTheme" :size="mySize"></xt-line>
4
+ <xt-pie v-else-if="type=='pie'" v-bind="$attrs" :theme="myTheme" :size="mySize"></xt-pie>
5
+ <xt-multi v-else-if="type=='multi'" v-bind="$attrs" :theme="myTheme" :size="mySize"></xt-multi>
6
6
  </template>
7
7
  <script>
8
- import ExBar from "./ExBar.vue"
9
- import ExLine from "./ExLine.vue"
10
- import ExPie from "./ExPie.vue"
11
- import ExMulti from "./ExMulti.vue"
8
+ import XtBar from "./XtBar.vue"
9
+ import XtLine from "./XtLine.vue"
10
+ import XtPie from "./XtPie.vue"
11
+ import XtMulti from "./XtMulti.vue"
12
12
 
13
13
  export default {
14
- name: "ExChart",
14
+ name: "XtChart",
15
15
  components: {
16
- ExBar,
17
- ExLine,
18
- ExPie,
19
- ExMulti
16
+ XtBar,
17
+ XtLine,
18
+ XtPie,
19
+ XtMulti
20
20
  },
21
21
  props: {
22
22
  theme: {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="pieLBox">
3
3
  <div class="left">
4
- <ExPie class="chart-box" :chart-data="chartData" :showLegend="false" :showLabel="false" :colors="colors"></ExPie>
4
+ <XtPie class="chart-box" :chart-data="chartData" :showLegend="false" :showLabel="false" :colors="colors"></XtPie>
5
5
  </div>
6
6
  <div class="right">
7
7
  <div v-for="(item, index) in chartData" :key="index" class="box">
@@ -14,6 +14,9 @@ export default {
14
14
  color: "#ffffff"
15
15
  }
16
16
  },
17
+ axisLabel: {
18
+ color: "#ffffff"
19
+ },
17
20
  line: {
18
21
  itemStyle: {
19
22
  },
@@ -24,7 +27,7 @@ export default {
24
27
  bar: {
25
28
  itemStyle: {
26
29
  borderRadius: 4
27
- }
30
+ },
28
31
  },
29
32
  pie: {
30
33
  roseType: "radius",
@@ -19,7 +19,7 @@ function getEcharts() {
19
19
  echarts.registerTheme(key, themeKeys[key]);
20
20
  }
21
21
  } catch (e) {
22
- console.warn('[ExChart] echarts 加载失败:', e.message);
22
+ console.warn('[XtChart] echarts 加载失败:', e.message);
23
23
  }
24
24
  }
25
25
  return echarts;
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import EchartsUtil from '../ex-chart/utils.js'
2
+ import EchartsUtil from '../xt-chart/utils.js'
3
3
  export default {
4
4
  name: 'XtConfigProvider',
5
5
  inheritAttrs: false,
@@ -0,0 +1,8 @@
1
+ import XtDatePicker from './index.vue'
2
+
3
+ XtDatePicker.install = function (Vue) {
4
+ Vue.component(XtDatePicker.name, XtDatePicker)
5
+ }
6
+
7
+ export default XtDatePicker
8
+ export { XtDatePicker }
@@ -20,7 +20,7 @@ const typeFormatEnum = {
20
20
  import FlexBox from '../xt-flex-box/index.vue'
21
21
  import Quarter from "./quarter.vue";
22
22
  export default {
23
- name: "ExDatePicker",
23
+ name: "XtDatePicker",
24
24
  components: {
25
25
  FlexBox,
26
26
  Quarter
@@ -0,0 +1,8 @@
1
+ import XtIcon from './index.vue'
2
+
3
+ XtIcon.install = function (Vue) {
4
+ Vue.component(XtIcon.name, XtIcon)
5
+ }
6
+
7
+ export default XtIcon
8
+ export { XtIcon }
@@ -16,8 +16,8 @@
16
16
  <script>
17
17
  const customPrefixes = {}
18
18
 
19
- const ExIcon = {
20
- name: 'ExIcon',
19
+ const XtIcon = {
20
+ name: 'XtIcon',
21
21
  inheritAttrs: false,
22
22
 
23
23
  props: {
@@ -139,13 +139,13 @@ const ExIcon = {
139
139
  }
140
140
  }
141
141
 
142
- ExIcon.registerPrefix = function (prefix) {
142
+ XtIcon.registerPrefix = function (prefix) {
143
143
  if (prefix && typeof prefix === 'string') {
144
144
  customPrefixes[prefix] = true
145
145
  }
146
146
  }
147
147
 
148
- export default ExIcon
148
+ export default XtIcon
149
149
  </script>
150
150
 
151
151
  <style lang="scss" scoped>
@@ -19,7 +19,7 @@
19
19
  </template>
20
20
  <script>
21
21
  export default {
22
- name: "ExFieldset",
22
+ name: "XtFieldset",
23
23
  props: {
24
24
  legend: {},
25
25
  type: {
@@ -0,0 +1,8 @@
1
+ import XtPage from './index.vue'
2
+
3
+ XtPage.install = function (Vue) {
4
+ Vue.component(XtPage.name, XtPage)
5
+ }
6
+
7
+ export default XtPage
8
+ export { XtPage }
@@ -19,7 +19,7 @@
19
19
  </template>
20
20
  <script>
21
21
  export default {
22
- name: "ExPage",
22
+ name: "XtPage",
23
23
  props: {
24
24
  showHeader: { type: Boolean, default: true },
25
25
  showFooter: { type: Boolean, default: true },
@@ -0,0 +1,7 @@
1
+ import XtProgress from './index.vue'
2
+
3
+ XtProgress.install = function(Vue) {
4
+ Vue.component(XtProgress.name, XtProgress)
5
+ }
6
+
7
+ export default XtProgress
@@ -0,0 +1,103 @@
1
+ <template>
2
+ <div class="xt-progress" :class="[
3
+ `xt-progress--${type}`,
4
+ `xt-progress--${size}`
5
+ ]">
6
+ <div v-if="type === 'line'" class="xt-progress__bar">
7
+ <div
8
+ class="xt-progress__bar-inner"
9
+ :style="{ width: `${percentage}%`, backgroundColor: color }"
10
+ >
11
+ <transition name="xt-progress-fade">
12
+ <div v-if="showText" class="xt-progress__bar-text">{{ percentage }}%</div>
13
+ </transition>
14
+ </div>
15
+ </div>
16
+
17
+ <div v-else-if="type === 'circle'" class="xt-progress__circle">
18
+ <svg :width="circleSize" :height="circleSize" class="xt-progress__circle-svg">
19
+ <circle
20
+ class="xt-progress__circle-bg"
21
+ :cx="circleSize / 2"
22
+ :cy="circleSize / 2"
23
+ :r="circleRadius"
24
+ fill="none"
25
+ :stroke="bgColor"
26
+ :stroke-width="strokeWidth"
27
+ />
28
+ <circle
29
+ class="xt-progress__circle-bar"
30
+ :cx="circleSize / 2"
31
+ :cy="circleSize / 2"
32
+ :r="circleRadius"
33
+ fill="none"
34
+ :stroke="color"
35
+ :stroke-width="strokeWidth"
36
+ :stroke-dasharray="circleLength"
37
+ :stroke-dashoffset="circleOffset"
38
+ stroke-linecap="round"
39
+ transform="rotate(-90 ${circleSize / 2} ${circleSize / 2})"
40
+ />
41
+ </svg>
42
+ <div v-if="showText" class="xt-progress__circle-text">
43
+ <span class="xt-progress__circle-percent">{{ percentage }}%</span>
44
+ </div>
45
+ </div>
46
+
47
+ <div v-if="showText && type === 'line'" class="xt-progress__text">{{ percentage }}%</div>
48
+ </div>
49
+ </template>
50
+
51
+ <script>
52
+ export default {
53
+ name: 'XtProgress',
54
+ props: {
55
+ percentage: {
56
+ type: Number,
57
+ default: 0,
58
+ validator: (val) => val >= 0 && val <= 100
59
+ },
60
+ type: {
61
+ type: String,
62
+ default: 'line',
63
+ validator: (val) => ['line', 'circle'].includes(val)
64
+ },
65
+ size: {
66
+ type: String,
67
+ default: 'medium',
68
+ validator: (val) => ['small', 'medium', 'large'].includes(val)
69
+ },
70
+ color: {
71
+ type: String,
72
+ default: '#1890ff'
73
+ },
74
+ bgColor: {
75
+ type: String,
76
+ default: '#ebeef5'
77
+ },
78
+ showText: {
79
+ type: Boolean,
80
+ default: true
81
+ },
82
+ strokeWidth: {
83
+ type: Number,
84
+ default: 6
85
+ },
86
+ circleSize: {
87
+ type: Number,
88
+ default: 120
89
+ }
90
+ },
91
+ computed: {
92
+ circleRadius() {
93
+ return (this.circleSize - this.strokeWidth) / 2
94
+ },
95
+ circleLength() {
96
+ return 2 * Math.PI * this.circleRadius
97
+ },
98
+ circleOffset() {
99
+ return this.circleLength * (1 - this.percentage / 100)
100
+ }
101
+ }
102
+ }
103
+ </script>
@@ -0,0 +1,119 @@
1
+ @import '../../../styles/variables.scss';
2
+
3
+ .xt-progress {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ }
7
+
8
+ .xt-progress__bar {
9
+ flex: 1;
10
+ height: 6px;
11
+ background: $xt-color-border-light;
12
+ border-radius: 3px;
13
+ overflow: hidden;
14
+ position: relative;
15
+ }
16
+
17
+ .xt-progress--small .xt-progress__bar {
18
+ height: 4px;
19
+ }
20
+
21
+ .xt-progress--large .xt-progress__bar {
22
+ height: 8px;
23
+ }
24
+
25
+ .xt-progress__bar-inner {
26
+ height: 100%;
27
+ border-radius: 3px;
28
+ transition: width 0.3s ease;
29
+ position: relative;
30
+ }
31
+
32
+ .xt-progress__bar-text {
33
+ position: absolute;
34
+ right: -30px;
35
+ top: 50%;
36
+ transform: translateY(-50%);
37
+ font-size: 12px;
38
+ color: $xt-color-text-secondary;
39
+ }
40
+
41
+ .xt-progress__text {
42
+ margin-left: 10px;
43
+ font-size: 14px;
44
+ color: $xt-color-text-secondary;
45
+ }
46
+
47
+ .xt-progress--small .xt-progress__text {
48
+ font-size: 12px;
49
+ }
50
+
51
+ .xt-progress--large .xt-progress__text {
52
+ font-size: 16px;
53
+ }
54
+
55
+ .xt-progress__circle {
56
+ position: relative;
57
+ display: inline-flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ }
61
+
62
+ .xt-progress__circle-svg {
63
+ transform: rotate(-90deg);
64
+ }
65
+
66
+ .xt-progress__circle-bg {
67
+ transition: stroke 0.3s ease;
68
+ }
69
+
70
+ .xt-progress__circle-bar {
71
+ transition: stroke-dashoffset 0.6s ease;
72
+ }
73
+
74
+ .xt-progress__circle-text {
75
+ position: absolute;
76
+ display: flex;
77
+ flex-direction: column;
78
+ align-items: center;
79
+ justify-content: center;
80
+ }
81
+
82
+ .xt-progress__circle-percent {
83
+ font-size: 16px;
84
+ font-weight: 500;
85
+ color: $xt-color-text-primary;
86
+ }
87
+
88
+ .xt-progress--small .xt-progress__circle-percent {
89
+ font-size: 12px;
90
+ }
91
+
92
+ .xt-progress--large .xt-progress__circle-percent {
93
+ font-size: 20px;
94
+ }
95
+
96
+ .xt-progress-fade-enter-active,
97
+ .xt-progress-fade-leave-active {
98
+ transition: opacity 0.3s ease;
99
+ }
100
+
101
+ .xt-progress-fade-enter,
102
+ .xt-progress-fade-leave-to {
103
+ opacity: 0;
104
+ }
105
+
106
+ [data-theme='dark'], html.dark {
107
+ .xt-progress__bar {
108
+ background: $xt-dark-color-border;
109
+ }
110
+
111
+ .xt-progress__bar-text,
112
+ .xt-progress__text {
113
+ color: $xt-dark-color-text-secondary;
114
+ }
115
+
116
+ .xt-progress__circle-percent {
117
+ color: $xt-dark-color-text-primary;
118
+ }
119
+ }
@@ -0,0 +1,8 @@
1
+ import XtSelectTree from './index.vue'
2
+
3
+ XtSelectTree.install = function (Vue) {
4
+ Vue.component(XtSelectTree.name, XtSelectTree)
5
+ }
6
+
7
+ export default XtSelectTree
8
+ export { XtSelectTree }
@@ -56,7 +56,7 @@
56
56
  import Emitter from "element-ui/lib/mixins/emitter";
57
57
  import { addResizeListener, removeResizeListener } from "element-ui/lib/utils/resize-event";
58
58
  export default {
59
- name: "ExSelectTree",
59
+ name: "XtSelectTree",
60
60
  mixins: [Emitter],
61
61
  inheritAttrs: false,
62
62
  model: {