vdesign-ui 0.1.9 → 0.1.11

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 (165) hide show
  1. package/dist/components/actionbar/actionbar-cell/index.vue +34 -0
  2. package/dist/components/actionbar/index.js +8 -0
  3. package/dist/components/actionbar/index.vue +39 -0
  4. package/dist/components/actionbar/style.less +48 -0
  5. package/dist/components/actions-cell/actions/index.js +7 -0
  6. package/dist/components/actions-cell/actions/index.vue +67 -0
  7. package/dist/components/actions-cell/actions/style.less +75 -0
  8. package/dist/components/actions-cell/index.js +7 -0
  9. package/dist/components/actions-cell/index.vue +94 -0
  10. package/dist/components/actions-cell/style.less +39 -0
  11. package/dist/components/activityviews/index.js +8 -0
  12. package/dist/components/activityviews/index.vue +110 -0
  13. package/dist/components/activityviews/style.less +146 -0
  14. package/dist/components/badge/index.js +8 -0
  15. package/dist/components/badge/index.vue +49 -0
  16. package/dist/components/badge/style.less +66 -0
  17. package/dist/components/button/index.js +8 -0
  18. package/dist/components/button/index.vue +89 -0
  19. package/dist/components/button/style.less +563 -0
  20. package/dist/components/calendar/end.png +0 -0
  21. package/dist/components/calendar/index-element.vue +84 -0
  22. package/dist/components/calendar/index.js +8 -0
  23. package/dist/components/calendar/index.vue +52 -0
  24. package/dist/components/calendar/start.png +0 -0
  25. package/dist/components/calendar/style.less +167 -0
  26. package/dist/components/checkbox/assist.js +34 -0
  27. package/dist/components/checkbox/checkbox-group/index.js +8 -0
  28. package/dist/components/checkbox/checkbox-group/index.vue +69 -0
  29. package/dist/components/checkbox/index.js +8 -0
  30. package/dist/components/checkbox/index.vue +184 -0
  31. package/dist/components/checkbox/style.less +289 -0
  32. package/dist/components/common/state/index.vue +80 -0
  33. package/dist/components/data-list/index.js +10 -0
  34. package/dist/components/data-list/index.vue +19 -0
  35. package/dist/components/data-list/style.less +624 -0
  36. package/dist/components/datetime-picker/index.js +8 -0
  37. package/dist/components/datetime-picker/index.vue +37 -0
  38. package/dist/components/datetime-picker/style.less +25 -0
  39. package/dist/components/dialog/index copy.vue +112 -0
  40. package/dist/components/dialog/index.js +8 -0
  41. package/dist/components/dialog/index.vue +111 -0
  42. package/dist/components/dialog/style.less +122 -0
  43. package/dist/components/divider/index.js +8 -0
  44. package/dist/components/divider/index.vue +54 -0
  45. package/dist/components/divider/style.less +92 -0
  46. package/dist/components/dropdown/index.js +8 -0
  47. package/dist/components/dropdown/index.vue +210 -0
  48. package/dist/components/dropdown/style.less +402 -0
  49. package/dist/components/empty/empty-404.png +0 -0
  50. package/dist/components/empty/empty-img.png +0 -0
  51. package/dist/components/empty/empty-network.png +0 -0
  52. package/dist/components/empty/index.js +8 -0
  53. package/dist/components/empty/index.vue +65 -0
  54. package/dist/components/empty/style.less +53 -0
  55. package/dist/components/footer/index.js +7 -0
  56. package/dist/components/footer/index.vue +29 -0
  57. package/dist/components/footer/style.less +22 -0
  58. package/dist/components/footnav/footnav-item/index.js +7 -0
  59. package/dist/components/footnav/footnav-item/index.vue +75 -0
  60. package/dist/components/footnav/footnav-item/style.less +38 -0
  61. package/dist/components/footnav/index.js +7 -0
  62. package/dist/components/footnav/index.vue +82 -0
  63. package/dist/components/footnav/style.less +22 -0
  64. package/dist/components/form/index.js +7 -0
  65. package/dist/components/form/index.vue +12 -0
  66. package/dist/components/headnav/index.js +7 -0
  67. package/dist/components/headnav/index.vue +139 -0
  68. package/dist/components/headnav/style.less +232 -0
  69. package/dist/components/icon/font/iconfont.css +817 -0
  70. package/dist/components/icon/font/iconfont.js +2 -0
  71. package/dist/components/icon/index.js +9 -0
  72. package/dist/components/icon/index.vue +46 -0
  73. package/dist/components/icon/style.less +44 -0
  74. package/dist/components/input/calcTextareaHeight.js +266 -0
  75. package/dist/components/input/index.js +8 -0
  76. package/dist/components/input/index.vue +334 -0
  77. package/dist/components/input/password/index.js +8 -0
  78. package/dist/components/input/password/index.vue +60 -0
  79. package/dist/components/input/search/index.js +8 -0
  80. package/dist/components/input/search/index.vue +64 -0
  81. package/dist/components/input/stepper/index.js +8 -0
  82. package/dist/components/input/stepper/index.vue +136 -0
  83. package/dist/components/input/style.less +482 -0
  84. package/dist/components/list/index.js +8 -0
  85. package/dist/components/list/index.vue +159 -0
  86. package/dist/components/list/style.less +290 -0
  87. package/dist/components/loading/index.js +7 -0
  88. package/dist/components/loading/index.vue +53 -0
  89. package/dist/components/loading/loading.png +0 -0
  90. package/dist/components/loading/refresh.png +0 -0
  91. package/dist/components/loading/style.less +48 -0
  92. package/dist/components/mixins/clickoutside.js +81 -0
  93. package/dist/components/mixins/dom.js +41 -0
  94. package/dist/components/mixins/languageMixin.js +38 -0
  95. package/dist/components/mixins/outlineConfigPlugin.js +40 -0
  96. package/dist/components/mixins/router-link.js +23 -0
  97. package/dist/components/noticebar/index.js +8 -0
  98. package/dist/components/noticebar/index.vue +246 -0
  99. package/dist/components/noticebar/style.less +309 -0
  100. package/dist/components/overlay/index.js +8 -0
  101. package/dist/components/overlay/index.vue +161 -0
  102. package/dist/components/overlay/style.less +23 -0
  103. package/dist/components/pagebreak/index.js +7 -0
  104. package/dist/components/pagebreak/index.vue +60 -0
  105. package/dist/components/pagebreak/style.less +43 -0
  106. package/dist/components/popover/index.js +8 -0
  107. package/dist/components/popover/index.vue +99 -0
  108. package/dist/components/popover/style.less +349 -0
  109. package/dist/components/popover/vue-popover.vue +314 -0
  110. package/dist/components/radio/assist.js +34 -0
  111. package/dist/components/radio/index.js +8 -0
  112. package/dist/components/radio/index.vue +159 -0
  113. package/dist/components/radio/radio-group/index.vue +70 -0
  114. package/dist/components/radio/style.less +297 -0
  115. package/dist/components/result/completed.png +0 -0
  116. package/dist/components/result/error.png +0 -0
  117. package/dist/components/result/index.js +8 -0
  118. package/dist/components/result/index.vue +47 -0
  119. package/dist/components/result/style.less +42 -0
  120. package/dist/components/result/wait.png +0 -0
  121. package/dist/components/selector/index.js +8 -0
  122. package/dist/components/selector/index.vue +124 -0
  123. package/dist/components/selector/style.less +474 -0
  124. package/dist/components/skeleton/index.js +7 -0
  125. package/dist/components/skeleton/index.vue +134 -0
  126. package/dist/components/skeleton/style.less +192 -0
  127. package/dist/components/slider/draggable.js +49 -0
  128. package/dist/components/slider/index.js +7 -0
  129. package/dist/components/slider/index.vue +173 -0
  130. package/dist/components/slider/style.less +95 -0
  131. package/dist/components/slider/utils.js +60 -0
  132. package/dist/components/step/index.js +7 -0
  133. package/dist/components/step/index.vue +48 -0
  134. package/dist/components/step/style.less +59 -0
  135. package/dist/components/step-item/index.js +7 -0
  136. package/dist/components/step-item/index.vue +89 -0
  137. package/dist/components/step-item/style.less +361 -0
  138. package/dist/components/style/index.vue +42 -0
  139. package/dist/components/switch/index.js +8 -0
  140. package/dist/components/switch/index.vue +72 -0
  141. package/dist/components/switch/style.less +54 -0
  142. package/dist/components/tabs/index.js +8 -0
  143. package/dist/components/tabs/index.vue +185 -0
  144. package/dist/components/tabs/style.less +383 -0
  145. package/dist/components/tabs/tab/index.vue +52 -0
  146. package/dist/components/tag/index.js +7 -0
  147. package/dist/components/tag/index.vue +50 -0
  148. package/dist/components/tag/style.less +211 -0
  149. package/dist/components/title/index.js +8 -0
  150. package/dist/components/title/index.vue +92 -0
  151. package/dist/components/title/style.less +188 -0
  152. package/dist/components/toast/index.js +80 -0
  153. package/dist/components/toast/index.vue +44 -0
  154. package/dist/components/toast/style.less +55 -0
  155. package/dist/components/transition/index.js +8 -0
  156. package/dist/components/transition/index.vue +13 -0
  157. package/dist/components/transition/style.less +208 -0
  158. package/dist/components/upload/index.js +7 -0
  159. package/dist/components/upload/index.vue +224 -0
  160. package/dist/components/upload/style.less +156 -0
  161. package/dist/vdesign-ui.common.js +182 -238
  162. package/dist/vdesign-ui.css +1 -1
  163. package/dist/vdesign-ui.umd.js +182 -238
  164. package/dist/vdesign-ui.umd.min.js +3 -3
  165. package/package.json +1 -1
@@ -0,0 +1,210 @@
1
+ <template>
2
+ <div class="vd-dropdown" :class="wrapClasses" v-show="isMask">
3
+ <transition :name="isAnimation ? 'vd-dropdown-fade' : ''">
4
+ <div class="vd-menu-mask" @click.stop="clickMenuMask"></div>
5
+ </transition>
6
+
7
+ <transition :name="isAnimation ? 'vd-dropdown-slide-down' : ''">
8
+ <div class="vd-dropdown-menu" v-show="value">
9
+
10
+ <template v-if="!isMultiple && !$slots.custom">
11
+ <div class="vd-dropdown-item" :class="itemClass(item)" v-for="(item, index) of datalist" :key="item.name"
12
+ @click.stop="selectedItem(item, index)">
13
+ <span class="vd-dropdown-left">
14
+ <vd-icon v-if="item.icon" :name="item.icon" svg class="vd-dropdown-icon"></vd-icon>
15
+ <span class="vd-dropdown-group-cell">
16
+ <span class="vd-dropdown-text">
17
+ {{ item.text }}
18
+ </span>
19
+ <span v-if="['group'].includes(types)" class="vd-dropdown-group-sub">
20
+ <vd-icon v-if="item.subIcon" :name="item.subIcon" svg class="vd-dropdown-sub-icon"></vd-icon>
21
+ <span class="vd-dropdown-subtext" v-html="item.subText"></span>
22
+ </span>
23
+ </span>
24
+ </span>
25
+
26
+ <vd-icon v-if="['primary'].includes(types) && item.selected" class="vd-dropdown-active-select"
27
+ name="icon_btn_singleslt" color="#1BC47D"></vd-icon>
28
+ <span v-if="['state'].includes(types)" v-html="item.stateText" class="vd-dropdown-state-text"
29
+ :class="`vd-dropdown-state-text--${item.state}`"></span>
30
+ </div>
31
+ </template>
32
+
33
+ <template v-if="isMultiple">
34
+ <div class="vd-dropdown-item" :class="itemClass(item)" v-for="item of datalist" :key="item.name">
35
+
36
+ <vd-checkbox v-model="item.selected"
37
+ :disabled="!item.selected && max <= list.filter(value => value.selected == true).length ? true : false">
38
+ {{ item.text }}
39
+ </vd-checkbox>
40
+
41
+ <vd-icon v-if="['primary'].includes(types) && item.selected" class="vd-dropdown-active-select"
42
+ name="icon_btn_singleslt" color="#1BC47D"></vd-icon>
43
+ </div>
44
+ <div class="vd-dropdown--btn">
45
+ <vd-button block size="small" type="tertiary_grey" @click="resetMenu">{{ resetBtnTxt }}</vd-button>
46
+ <vd-button block size="small" @click="sureMenu">{{ okBtnTxt }}</vd-button>
47
+ </div>
48
+ </template>
49
+
50
+ <div class="vd-dropdown-item" v-if="$slots.custom">
51
+ <slot name="custom">{{ custom }}</slot>
52
+ </div>
53
+ </div>
54
+ </transition>
55
+
56
+ </div>
57
+ </template>
58
+ <script>
59
+ const prefixCls = 'vd-dropdown';
60
+ export default {
61
+ name: 'vd-dropdown',
62
+ props: {
63
+ isAnimation: {
64
+ //是否有动画效果
65
+ type: Boolean,
66
+ default: false
67
+ },
68
+ types: {
69
+ type: String,
70
+ default: 'primary',
71
+ validator: value => ['primary', 'secondary', 'state', 'group'].includes(value)
72
+ },
73
+ value: {
74
+ //是否显示
75
+ type: Boolean,
76
+ default: false
77
+ },
78
+ disabled: {
79
+ type: Boolean,
80
+ default: false
81
+ },
82
+ isMultiple: {
83
+ type: Boolean,
84
+ default: false
85
+ },
86
+ col: {
87
+ //显示的列数
88
+ type: [Number, String],
89
+ default: 1
90
+ },
91
+ max: {
92
+ type: [String, Number],
93
+ default: 5
94
+ },
95
+ custom: {
96
+ type: String,
97
+ default: ''
98
+ },
99
+ list: {
100
+ type: Array,
101
+ default: () => {
102
+ return [];
103
+ }
104
+ },
105
+ // state
106
+ state: {
107
+ type: String,
108
+ default: 'close',
109
+ validator: value => ['open', 'preopen', 'close'].includes(value)
110
+ },
111
+ stateText: {
112
+ type: String,
113
+ default: ''
114
+ },
115
+ // group
116
+ subText: {
117
+ type: String,
118
+ default: ''
119
+ },
120
+ subIcon: {
121
+ type: String,
122
+ default: ''
123
+ }
124
+ },
125
+ watch: {
126
+ value(val) {
127
+ this.isMask = val ? true : false
128
+ }
129
+ },
130
+ data() {
131
+ return {
132
+ datalist: [],
133
+ isMask: false
134
+ };
135
+ },
136
+ mounted() {
137
+ this.datalist = [...this.list];
138
+ },
139
+ computed: {
140
+ wrapClasses() {
141
+ return {
142
+ [`${prefixCls}-${this.types}`]: this.types,
143
+ [`${prefixCls}--divided`]: this.types !== 'state',
144
+ };
145
+ },
146
+ okBtnTxt() {
147
+ return '确定';
148
+ },
149
+ resetBtnTxt() {
150
+ return '重置';
151
+ }
152
+ },
153
+ methods: {
154
+ itemClass(item) {
155
+ return {
156
+ [`${prefixCls}--disabled`]: item.disabled,
157
+ [`${prefixCls}--active`]: item.selected
158
+ }
159
+ },
160
+ clickMenuMask() {
161
+ this.isMask = false;
162
+ this.$emit('close');
163
+ },
164
+ selectedItem(item, index) {
165
+ this.$emit('change', item, index);
166
+ },
167
+ selectMultiple(index) {
168
+ const count = this.datalist.filter(item => item.selected).length;
169
+ if (!this.datalist[index].selected && count >= this.max) {
170
+ this.$emit('maxTip');
171
+ return;
172
+ }
173
+ this.$set(this.datalist[index], 'selected', !this.datalist[index].selected);
174
+ },
175
+ resetMenu() {
176
+ this.datalist.map(value => (value.selected = false));
177
+ this.$emit('reset', this.datalist);
178
+ },
179
+ sureMenu() {
180
+ this.isMask = false;
181
+ this.$emit('close');
182
+ this.$emit('ok', this.datalist);
183
+ }
184
+ }
185
+ };
186
+ </script>
187
+
188
+ <style lang="less">
189
+ @import './style.less';
190
+
191
+ .vd-dropdown-fade-enter-active,
192
+ .vd-dropdown-fade-leave-active {
193
+ transition: opacity 0.5s;
194
+ }
195
+
196
+ .vd-dropdown-fade-enter,
197
+ .vd-dropdown-fade-leave-to {
198
+ opacity: 0;
199
+ }
200
+
201
+ .vd-dropdown-slide-down-enter-active,
202
+ .vd-dropdown-slide-down-leave-active {
203
+ transition: transform 0.5s;
204
+ }
205
+
206
+ .vd-dropdown-slide-down-enter,
207
+ .vd-dropdown-slide-down-leave-to {
208
+ transform: translateY(-20px);
209
+ }
210
+ </style>
@@ -0,0 +1,402 @@
1
+ .vd-menu-mask {
2
+ position: fixed;
3
+ z-index: 999;
4
+ top: 0;
5
+ right: 0;
6
+ left: 0;
7
+ bottom: 0;
8
+ background-color: rgba(0, 0, 0, 0);
9
+ }
10
+
11
+
12
+ @dropdown-prefix-cls: vd-dropdown;
13
+
14
+
15
+ .@{dropdown-prefix-cls} {
16
+ --translate-x: -50%;
17
+
18
+ position: relative;
19
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
20
+
21
+ // 额外加的 btn,token之外的
22
+ &--btn {
23
+ display: flex;
24
+ align-items: center;
25
+ flex-wrap: nowrap;
26
+ flex-direction: row;
27
+ justify-content: space-between;
28
+ padding: 10px 0;
29
+ gap: 10px;
30
+ }
31
+
32
+ &-menu {
33
+ z-index: 1000;
34
+ background: #fff;
35
+ transform-origin: top center;
36
+ position: absolute;
37
+ transition: transform 0.25s ease, opacity 0.25s ease;
38
+ inset-inline-start: 50%;
39
+ inset-block-start: 100%;
40
+ transform: translate(var(--translate-x), 2px);
41
+ }
42
+
43
+
44
+ &-primary {
45
+ .@{dropdown-prefix-cls}-menu {
46
+ display: inline-block;
47
+ overflow-y: auto;
48
+ min-width: calc(var(--width-dropdown-primary_small) * 1px);
49
+ max-height: calc(var(--height-dropdown-primary_large) * 1px);
50
+ background-color: var(--color-dropdown-bg-default);
51
+ padding-block-start: calc(var(--spacing-dropdown-primary-padding_x) * 1px);
52
+ padding-block-end: calc(var(--spacing-dropdown-primary-padding_x) * 1px);
53
+ padding-inline-start: calc(var(--spacing-dropdown-primary-padding_y) * 1px);
54
+ padding-inline-end: calc(var(--spacing-dropdown-primary-padding_y) * 1px);
55
+ box-shadow: var(--shadow-s2);
56
+ border-radius: calc(var(--radius-dropdown-primary) * 1px);
57
+ }
58
+
59
+ .@{dropdown-prefix-cls}-item {
60
+ position: relative;
61
+ display: flex;
62
+ justify-content: space-between;
63
+ align-items: center;
64
+ height: calc(var(--height-dropdown-primary_item) * 1px);
65
+ line-height: calc(var(--height-dropdown-primary_item) * 1px);
66
+ }
67
+
68
+ .@{dropdown-prefix-cls} {
69
+ &-left {
70
+ display: flex;
71
+ align-items: center;
72
+ }
73
+
74
+ &-text {
75
+ white-space: nowrap;
76
+ color: var(--color-dropdown-primary-text-default);
77
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
78
+ font-weight: var(--en-single-f-c-r-fontWeight);
79
+ }
80
+
81
+ &-icon {
82
+ font-size: calc(var(--icon-dropdown-primary) * 1px);
83
+ margin-inline-end: calc(var(--spacing-dropdown-primary_icon-margin_right) * 1px);
84
+ }
85
+
86
+ &-active-select {
87
+ font-size: calc(var(--icon-dropdown-primary_select) * 1px);
88
+ margin-inline-start: calc(var(--spacing-dropdown-primary_icon_select-margin_left) * 1px);
89
+ transform: scaleX(1) !important;
90
+ direction: ltr;
91
+ }
92
+
93
+ }
94
+
95
+ .@{dropdown-prefix-cls}--active {
96
+ .@{dropdown-prefix-cls}-text {
97
+ color: var(--color-dropdown-primary-text-active);
98
+ font-size: calc(var(--en-single-f-c-s-fontSize) * 1px);
99
+ font-weight: var(--en-single-f-c-s-fontWeight);
100
+ }
101
+ }
102
+
103
+ .@{dropdown-prefix-cls}--disabled {
104
+ pointer-events: none;
105
+ cursor: not-allowed;
106
+
107
+ .@{dropdown-prefix-cls}-text {
108
+ color: var(--color-dropdown-primary-text-disable);
109
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
110
+ font-weight: var(--en-single-f-c-r-fontWeight);
111
+ }
112
+
113
+ .@{dropdown-prefix-cls}-icon {
114
+ opacity: var(--opacity-30);
115
+ }
116
+ }
117
+ }
118
+
119
+ &-secondary {
120
+ .@{dropdown-prefix-cls}-menu {
121
+ display: inline-block;
122
+ overflow-y: auto;
123
+ max-height: calc(var(--height-dropdown-secondary_large) * 1px);
124
+ background-color: var(--color-dropdown-bg-default);
125
+ padding-block-start: calc(var(--spacing-dropdown-secondary-padding_x) * 1px);
126
+ padding-block-end: calc(var(--spacing-dropdown-secondary-padding_x) * 1px);
127
+ padding-inline-start: calc(var(--spacing-dropdown-secondary-padding_y) * 1px);
128
+ padding-inline-end: calc(var(--spacing-dropdown-secondary-padding_y) * 1px);
129
+ box-shadow: var(--shadow-s2);
130
+ border-radius: calc(var(--radius-dropdown-secondary) * 1px);
131
+ }
132
+
133
+ .@{dropdown-prefix-cls}-item {
134
+ position: relative;
135
+ display: flex;
136
+ justify-content: space-between;
137
+ align-items: center;
138
+ height: calc(var(--height-dropdown-secondary_item) * 1px);
139
+ line-height: calc(var(--height-dropdown-secondary_item) * 1px);
140
+ }
141
+
142
+ .@{dropdown-prefix-cls} {
143
+ &-left {
144
+ display: flex;
145
+ align-items: center;
146
+ }
147
+
148
+ &-text {
149
+ white-space: nowrap;
150
+ color: var(--color-dropdown-secondary-text-default);
151
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
152
+ font-weight: var(--en-single-f-c-r-fontWeight);
153
+ }
154
+
155
+ &-icon {
156
+ font-size: calc(var(--icon-dropdown-secondary) * 1px);
157
+ margin-inline-end: calc(var(--spacing-dropdown-secondary_icon-margin_right) * 1px);
158
+ }
159
+
160
+
161
+ }
162
+
163
+ .@{dropdown-prefix-cls}--active {
164
+ .@{dropdown-prefix-cls}-text {
165
+ color: var(--color-dropdown-secondary-text-active);
166
+ font-size: calc(var(--en-single-f-c-s-fontSize) * 1px);
167
+ font-weight: var(--en-single-f-c-s-fontWeight);
168
+ }
169
+ }
170
+
171
+ .@{dropdown-prefix-cls}--disabled {
172
+ pointer-events: none;
173
+ cursor: not-allowed;
174
+
175
+ .@{dropdown-prefix-cls}-text {
176
+ color: var(--color-dropdown-secondary-text-disable);
177
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
178
+ font-weight: var(--en-single-f-c-r-fontWeight);
179
+ }
180
+
181
+ .@{dropdown-prefix-cls}-icon {
182
+ opacity: var(--opacity-30);
183
+ }
184
+ }
185
+ }
186
+
187
+ &-state {
188
+ .@{dropdown-prefix-cls}-menu {
189
+ overflow-y: auto;
190
+ min-width: calc(var(--width-dropdown-state_small) * 1px);
191
+ max-height: calc(var(--height-dropdown-state_large) * 1px);
192
+ background-color: var(--color-dropdown-bg-default);
193
+ padding-block-start: calc(var(--spacing-dropdown-state-padding_x) * 1px);
194
+ padding-block-end: calc(var(--spacing-dropdown-state-padding_x) * 1px);
195
+ padding-inline-start: calc(var(--spacing-dropdown-state-padding_y) * 1px);
196
+ padding-inline-end: calc(var(--spacing-dropdown-state-padding_y) * 1px);
197
+ box-shadow: var(--shadow-s2);
198
+ border-radius: calc(var(--radius-dropdown-state) * 1px);
199
+ }
200
+
201
+ .@{dropdown-prefix-cls}-item {
202
+ position: relative;
203
+ display: flex;
204
+ justify-content: space-between;
205
+ align-items: center;
206
+ height: calc(var(--height-dropdown-state_item) * 1px);
207
+ line-height: calc(var(--height-dropdown-state_item) * 1px);
208
+ padding-inline-start: calc(var(--spacing-dropdown-state_item-padding_y) * 1px);
209
+ padding-inline-end: calc(var(--spacing-dropdown-state_item-padding_y) * 1px);
210
+ border-radius: calc(var(--radius-dropdown-state_item) * 1px);
211
+ }
212
+
213
+ .@{dropdown-prefix-cls} {
214
+ &-left {
215
+ display: flex;
216
+ align-items: center;
217
+ flex: 1;
218
+ overflow: hidden;
219
+ }
220
+
221
+ &-text {
222
+ text-overflow: ellipsis;
223
+ overflow: hidden;
224
+ white-space: nowrap;
225
+ color: var(--color-dropdown-state-text-default);
226
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
227
+ font-weight: var(--en-single-f-c-r-fontWeight);
228
+ }
229
+
230
+ &-icon {
231
+ font-size: calc(var(--icon-dropdown-state) * 1px);
232
+ margin-inline-end: calc(var(--spacing-dropdown-state_icon-margin_right) * 1px);
233
+ }
234
+
235
+ &-state-text {
236
+ font-size: calc(var(--en-single-f-b-r-fontSize) * 1px);
237
+ font-weight: var(--en-single-f-b-r-fontWeight);
238
+
239
+ &::before {
240
+ content: '';
241
+ display: inline-block;
242
+ border-radius: 50%;
243
+ width: calc(var(--width-dropdown-state_drop) * 1px);
244
+ height: calc(var(--width-dropdown-state_drop) * 1px);
245
+ margin-inline-start: calc(var(--spacing-dropdown-state_drop-margin_left) * 1px);
246
+ margin-inline-end: calc(var(--spacing-dropdown-state_drop-margin_right) * 1px);
247
+ background-color: var(--color-dropdown-state-open);
248
+ }
249
+
250
+ &--open {
251
+ color: var(--color-dropdown-state-open);
252
+
253
+ &::before {
254
+ background-color: var(--color-dropdown-state-open);
255
+ }
256
+ }
257
+
258
+ &--preopen {
259
+ color: var(--color-dropdown-state-preopen);
260
+
261
+ &::before {
262
+ background-color: var(--color-dropdown-state-preopen);
263
+ }
264
+ }
265
+
266
+ &--close {
267
+ color: var(--color-dropdown-state-close);
268
+
269
+ &::before {
270
+ background-color: var(--text-color-h3);
271
+ }
272
+ }
273
+
274
+ &--fusing {
275
+ color: var(--color-dropdown-state-fusing);
276
+
277
+ &::before {
278
+ background-color: var(--color-dropdown-state-fusing);
279
+ }
280
+ }
281
+ }
282
+
283
+
284
+ }
285
+
286
+ .@{dropdown-prefix-cls}--active {
287
+ background: var(--color-dropdown-state-bg-active);
288
+
289
+ .@{dropdown-prefix-cls}-text {
290
+ color: var(--color-dropdown-state-text-active);
291
+ }
292
+ }
293
+
294
+ .@{dropdown-prefix-cls}--disabled {
295
+ pointer-events: none;
296
+ cursor: not-allowed;
297
+
298
+ .@{dropdown-prefix-cls}-text {
299
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
300
+ font-weight: var(--en-single-f-c-r-fontWeight);
301
+ }
302
+
303
+ .@{dropdown-prefix-cls}-icon {
304
+ opacity: var(--opacity-30);
305
+ }
306
+
307
+ }
308
+ }
309
+
310
+ &-group {
311
+ .@{dropdown-prefix-cls}-menu {
312
+ overflow-y: auto;
313
+ min-width: calc(var(--width-dropdown-group_default) * 1px);
314
+ max-height: calc(var(--height-dropdown-group_large) * 1px);
315
+ background-color: var(--color-dropdown-bg-default);
316
+ padding-block-start: calc(var(--spacing-dropdown-group-padding_x) * 1px);
317
+ padding-block-end: calc(var(--spacing-dropdown-group-padding_x) * 1px);
318
+ padding-inline-start: calc(var(--spacing-dropdown-group-padding_y) * 1px);
319
+ padding-inline-end: calc(var(--spacing-dropdown-group-padding_y) * 1px);
320
+ box-shadow: var(--shadow-s2);
321
+ border-radius: calc(var(--radius-dropdown-group) * 1px);
322
+ }
323
+
324
+ .@{dropdown-prefix-cls}-item {
325
+ position: relative;
326
+ display: flex;
327
+ justify-content: space-between;
328
+ align-items: center;
329
+ padding-block-start: calc(var(--spacing-dropdown-group_item-padding_top) * 1px);
330
+ padding-block-end: calc(var(--spacing-dropdown-group_item-padding_bottom) * 1px);
331
+
332
+ }
333
+
334
+ .@{dropdown-prefix-cls} {
335
+ &-left {
336
+ display: flex;
337
+ align-items: center;
338
+ }
339
+
340
+ &-group-cell {
341
+ display: flex;
342
+ flex-direction: column;
343
+ color: var(--color-dropdown-state-text-default);
344
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
345
+ font-weight: var(--en-single-f-c-r-fontWeight);
346
+ }
347
+
348
+ &-text {
349
+ color: var(--color-dropdown-group-title-default);
350
+ font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
351
+ font-weight: var(--en-single-f-c-r-fontWeight);
352
+ }
353
+
354
+ &-group-sub {
355
+ display: flex;
356
+ align-items: center;
357
+ margin-block-start: calc(var(--spacing-dropdown-group_text-margin_bottom) * 1px);
358
+ }
359
+
360
+ &-sub-icon {
361
+ font-size: calc(var(--icon-dropdown-group) * 1px);
362
+ margin-inline-end: 6px;
363
+ }
364
+
365
+ &-subtext {
366
+ color: var(--color-dropdown-group-text-default);
367
+ font-size: calc(var(--en-single-f-c-s-fontSize) * 1px);
368
+ font-weight: var(--en-single-f-c-s-fontWeight);
369
+ }
370
+
371
+ &-multext {
372
+ margin-block-start: calc(var(--spacing-dropdown-group_text-margin_bottom) * 1px);
373
+ }
374
+
375
+ }
376
+ }
377
+
378
+ &--divided {
379
+ .@{dropdown-prefix-cls}-item {
380
+ &:not(:last-child)::after {
381
+ position: absolute;
382
+ box-sizing: border-box;
383
+ content: ' ';
384
+ pointer-events: none;
385
+ top: -50%;
386
+ right: -50%;
387
+ bottom: -50%;
388
+ left: -50%;
389
+ border: 0 solid var(--color-dropdown-divider);
390
+ -webkit-transform: scale(0.5);
391
+ transform: scale(0.5);
392
+ border-bottom-width: 1px;
393
+ }
394
+ }
395
+ }
396
+ }
397
+
398
+
399
+
400
+ [dir="rtl"] .@{dropdown-prefix-cls} {
401
+ --translate-x: 50%;
402
+ }
@@ -0,0 +1,8 @@
1
+ import Empty from './index.vue';
2
+ import './style.less';
3
+
4
+ Empty.install = function (Vue) {
5
+ Vue.component(Empty.name, Empty);
6
+ };
7
+
8
+ export default Empty;
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <div class="vd-empty" :class="wrapClasses">
3
+ <div class="vd-empty-img"><img :src="currentImg" alt="img"></div>
4
+ <p class="vd-empty-txt" :class="textClasses" v-if="text">{{ text }}</p>
5
+ <div class="vd-empty-footer" :class="footerClasses" v-if="$slots.btn">
6
+ <slot name="btn"></slot>
7
+ </div>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ const prefixCls = 'vd-empty';
13
+
14
+ export default {
15
+ name: 'vd-empty',
16
+ props: {
17
+ imgs: String,
18
+ text: String,
19
+ size: String,
20
+ type: {
21
+ type: String,
22
+ default: 'default' // 默认类型
23
+ },
24
+ },
25
+ data() {
26
+ return {
27
+ defaultImgs: {
28
+ default: require('./empty-img.png'),
29
+ network: require('./empty-network.png'),
30
+ 'not-found': require('./empty-404.png'),
31
+ }
32
+ }
33
+ },
34
+ computed: {
35
+ currentImg() {
36
+ return this.imgs || this.defaultImgs[this.type];
37
+ },
38
+ wrapClasses() {
39
+ return [
40
+ {
41
+ [`${prefixCls}-${this.size}`]: this.size
42
+ }
43
+ ]
44
+ },
45
+ textClasses() {
46
+ return [
47
+ {
48
+ [`${prefixCls}-${this.size}-txt`]: this.size
49
+ }
50
+ ]
51
+ },
52
+ footerClasses() {
53
+ return [
54
+ {
55
+ [`${prefixCls}-${this.size}-footer`]: this.size
56
+ }
57
+ ]
58
+ }
59
+ }
60
+ }
61
+ </script>
62
+
63
+ <style lang="less">
64
+ @import './style.less';
65
+ </style>