vdesign-ui 0.1.18 → 0.1.19

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 (192) hide show
  1. package/dist/css/chunk-1952c402.04c2303e.css +1 -0
  2. package/dist/css/chunk-6a5c6104.38021b56.css +1 -0
  3. package/dist/css/chunk-vendors.4ecfba63.css +1 -0
  4. package/dist/css/sites.395ce21f.css +1 -0
  5. package/dist/img/404-dark.775df5bb.png +0 -0
  6. package/dist/img/bg_mobile.5909f667.png +0 -0
  7. package/dist/img/icon.a67073c3.svg +7 -0
  8. package/dist/img/iphoneX.38c8778e.png +0 -0
  9. package/dist/img/logo-white.fad4f907.png +0 -0
  10. package/dist/img/logo.1eda11d6.png +0 -0
  11. package/dist/img/network-dark.11a147bb.png +0 -0
  12. package/dist/img/nodata-dark.b0ea0e39.png +0 -0
  13. package/dist/img/qrcode2.0a9d9044.png +0 -0
  14. package/dist/index.html +1 -0
  15. package/dist/js/chunk-1952c402.c58ecfb5.js +1 -0
  16. package/dist/js/chunk-2d2183be.2a64419d.js +1 -0
  17. package/dist/js/chunk-6a5c6104.c8fa5635.js +1 -0
  18. package/dist/js/chunk-vendors.490b7673.js +37 -0
  19. package/dist/js/sites.5a217467.js +1 -0
  20. package/package.json +1 -1
  21. package/dist/components/actionbar/actionbar-cell/index.vue +0 -34
  22. package/dist/components/actionbar/index.js +0 -8
  23. package/dist/components/actionbar/index.vue +0 -39
  24. package/dist/components/actionbar/style.less +0 -48
  25. package/dist/components/actions-cell/actions/index.js +0 -7
  26. package/dist/components/actions-cell/actions/index.vue +0 -76
  27. package/dist/components/actions-cell/actions/style.less +0 -112
  28. package/dist/components/actions-cell/index.js +0 -7
  29. package/dist/components/actions-cell/index.vue +0 -94
  30. package/dist/components/actions-cell/style.less +0 -39
  31. package/dist/components/activityviews/index.js +0 -8
  32. package/dist/components/activityviews/index.vue +0 -139
  33. package/dist/components/activityviews/style.less +0 -150
  34. package/dist/components/badge/index.js +0 -8
  35. package/dist/components/badge/index.vue +0 -49
  36. package/dist/components/badge/style.less +0 -66
  37. package/dist/components/button/index.js +0 -8
  38. package/dist/components/button/index.vue +0 -89
  39. package/dist/components/button/style.less +0 -563
  40. package/dist/components/calendar/end.png +0 -0
  41. package/dist/components/calendar/index-element.vue +0 -84
  42. package/dist/components/calendar/index.js +0 -8
  43. package/dist/components/calendar/index.vue +0 -52
  44. package/dist/components/calendar/start.png +0 -0
  45. package/dist/components/calendar/style.less +0 -167
  46. package/dist/components/checkbox/assist.js +0 -34
  47. package/dist/components/checkbox/checkbox-group/index.js +0 -8
  48. package/dist/components/checkbox/checkbox-group/index.vue +0 -69
  49. package/dist/components/checkbox/index.js +0 -8
  50. package/dist/components/checkbox/index.vue +0 -184
  51. package/dist/components/checkbox/style.less +0 -291
  52. package/dist/components/common/state/index.vue +0 -80
  53. package/dist/components/data-list/index.js +0 -10
  54. package/dist/components/data-list/index.vue +0 -19
  55. package/dist/components/data-list/style.less +0 -624
  56. package/dist/components/datetime-picker/index.js +0 -8
  57. package/dist/components/datetime-picker/index.vue +0 -37
  58. package/dist/components/datetime-picker/style.less +0 -24
  59. package/dist/components/dialog/index.js +0 -8
  60. package/dist/components/dialog/index.vue +0 -111
  61. package/dist/components/dialog/style.less +0 -132
  62. package/dist/components/divider/index.js +0 -8
  63. package/dist/components/divider/index.vue +0 -54
  64. package/dist/components/divider/style.less +0 -92
  65. package/dist/components/dropdown/index.js +0 -8
  66. package/dist/components/dropdown/index.vue +0 -210
  67. package/dist/components/dropdown/style.less +0 -418
  68. package/dist/components/empty/empty-404.png +0 -0
  69. package/dist/components/empty/empty-img.png +0 -0
  70. package/dist/components/empty/empty-network.png +0 -0
  71. package/dist/components/empty/index.js +0 -8
  72. package/dist/components/empty/index.vue +0 -65
  73. package/dist/components/empty/style.less +0 -53
  74. package/dist/components/footer/index.js +0 -7
  75. package/dist/components/footer/index.vue +0 -29
  76. package/dist/components/footer/style.less +0 -22
  77. package/dist/components/footnav/footnav-item/index.js +0 -7
  78. package/dist/components/footnav/footnav-item/index.vue +0 -75
  79. package/dist/components/footnav/footnav-item/style.less +0 -39
  80. package/dist/components/footnav/index.js +0 -7
  81. package/dist/components/footnav/index.vue +0 -82
  82. package/dist/components/footnav/style.less +0 -22
  83. package/dist/components/form/index.js +0 -7
  84. package/dist/components/form/index.vue +0 -12
  85. package/dist/components/headnav/index.js +0 -7
  86. package/dist/components/headnav/index.vue +0 -139
  87. package/dist/components/headnav/style.less +0 -232
  88. package/dist/components/icon/font/iconfont.css +0 -1041
  89. package/dist/components/icon/font/iconfont.js +0 -2
  90. package/dist/components/icon/index.js +0 -9
  91. package/dist/components/icon/index.vue +0 -46
  92. package/dist/components/icon/style.less +0 -44
  93. package/dist/components/input/calcTextareaHeight.js +0 -266
  94. package/dist/components/input/index.js +0 -8
  95. package/dist/components/input/index.vue +0 -343
  96. package/dist/components/input/password/index.js +0 -8
  97. package/dist/components/input/password/index.vue +0 -60
  98. package/dist/components/input/search/index.js +0 -8
  99. package/dist/components/input/search/index.vue +0 -66
  100. package/dist/components/input/stepper/index.js +0 -8
  101. package/dist/components/input/stepper/index.vue +0 -136
  102. package/dist/components/input/style.less +0 -497
  103. package/dist/components/list/index.js +0 -8
  104. package/dist/components/list/index.vue +0 -159
  105. package/dist/components/list/style.less +0 -292
  106. package/dist/components/loading/index.js +0 -7
  107. package/dist/components/loading/index.vue +0 -53
  108. package/dist/components/loading/loading.png +0 -0
  109. package/dist/components/loading/refresh.png +0 -0
  110. package/dist/components/loading/style.less +0 -48
  111. package/dist/components/mixins/clickoutside.js +0 -81
  112. package/dist/components/mixins/dom.js +0 -41
  113. package/dist/components/mixins/languageMixin.js +0 -38
  114. package/dist/components/mixins/outlineConfigPlugin.js +0 -40
  115. package/dist/components/mixins/router-link.js +0 -23
  116. package/dist/components/mixins/themeMixin.js +0 -29
  117. package/dist/components/noticebar/index.js +0 -8
  118. package/dist/components/noticebar/index.vue +0 -247
  119. package/dist/components/noticebar/style.less +0 -332
  120. package/dist/components/overlay/index.js +0 -8
  121. package/dist/components/overlay/index.vue +0 -161
  122. package/dist/components/overlay/style.less +0 -23
  123. package/dist/components/pagebreak/index.js +0 -7
  124. package/dist/components/pagebreak/index.vue +0 -60
  125. package/dist/components/pagebreak/style.less +0 -43
  126. package/dist/components/popover/index.js +0 -8
  127. package/dist/components/popover/index.vue +0 -99
  128. package/dist/components/popover/style.less +0 -346
  129. package/dist/components/popover/vue-popover.vue +0 -314
  130. package/dist/components/radio/assist.js +0 -34
  131. package/dist/components/radio/index.js +0 -8
  132. package/dist/components/radio/index.vue +0 -159
  133. package/dist/components/radio/radio-group/index.vue +0 -70
  134. package/dist/components/radio/style.less +0 -297
  135. package/dist/components/result/completed-dark.png +0 -0
  136. package/dist/components/result/completed.png +0 -0
  137. package/dist/components/result/error-dark.png +0 -0
  138. package/dist/components/result/error.png +0 -0
  139. package/dist/components/result/index.js +0 -8
  140. package/dist/components/result/index.vue +0 -66
  141. package/dist/components/result/style.less +0 -42
  142. package/dist/components/result/wait-dark.png +0 -0
  143. package/dist/components/result/wait.png +0 -0
  144. package/dist/components/selector/index.js +0 -8
  145. package/dist/components/selector/index.vue +0 -124
  146. package/dist/components/selector/style.less +0 -474
  147. package/dist/components/skeleton/index.js +0 -7
  148. package/dist/components/skeleton/index.vue +0 -142
  149. package/dist/components/skeleton/style.less +0 -192
  150. package/dist/components/slider/draggable.js +0 -49
  151. package/dist/components/slider/index.js +0 -7
  152. package/dist/components/slider/index.vue +0 -173
  153. package/dist/components/slider/style.less +0 -96
  154. package/dist/components/slider/utils.js +0 -60
  155. package/dist/components/step/index.js +0 -7
  156. package/dist/components/step/index.vue +0 -48
  157. package/dist/components/step/style.less +0 -59
  158. package/dist/components/step-item/index.js +0 -7
  159. package/dist/components/step-item/index.vue +0 -117
  160. package/dist/components/step-item/style.less +0 -361
  161. package/dist/components/style/index.vue +0 -42
  162. package/dist/components/switch/index.js +0 -8
  163. package/dist/components/switch/index.vue +0 -72
  164. package/dist/components/switch/style.less +0 -56
  165. package/dist/components/tabs/index.js +0 -8
  166. package/dist/components/tabs/index.vue +0 -145
  167. package/dist/components/tabs/style.less +0 -383
  168. package/dist/components/tabs/tab/index.vue +0 -56
  169. package/dist/components/tag/index.js +0 -7
  170. package/dist/components/tag/index.vue +0 -50
  171. package/dist/components/tag/style.less +0 -211
  172. package/dist/components/title/index.js +0 -8
  173. package/dist/components/title/index.vue +0 -92
  174. package/dist/components/title/style.less +0 -188
  175. package/dist/components/toast/index.js +0 -80
  176. package/dist/components/toast/index.vue +0 -44
  177. package/dist/components/toast/style.less +0 -55
  178. package/dist/components/transition/index.js +0 -8
  179. package/dist/components/transition/index.vue +0 -13
  180. package/dist/components/transition/style.less +0 -208
  181. package/dist/components/upload/index.js +0 -7
  182. package/dist/components/upload/index.vue +0 -224
  183. package/dist/components/upload/style.less +0 -156
  184. package/dist/demo.html +0 -10
  185. package/dist/locale/ar.js +0 -98
  186. package/dist/locale/en.js +0 -98
  187. package/dist/locale/zh.js +0 -98
  188. package/dist/token.css +0 -2981
  189. package/dist/vdesign-ui.common.js +0 -27025
  190. package/dist/vdesign-ui.css +0 -1
  191. package/dist/vdesign-ui.umd.js +0 -27035
  192. package/dist/vdesign-ui.umd.min.js +0 -32
@@ -1,111 +0,0 @@
1
- <template>
2
- <div class="vd-dialog-wrap" v-if="visible">
3
- <div class="vd-overlay" v-if="visible && overlay" @click="close()"></div>
4
- <div class="vd-dialog" :class="className ? `vd-dialog--${className}` : ''">
5
- <header class="vd-dialog__header" :class="{ 'vd-dialog__header--img': $slots.imgs }">
6
- <div class="vd-dialog__header--img-content" v-if="$slots.imgs">
7
- <slot name="imgs"></slot>
8
- </div>
9
- <div class="vd-dialog__title">{{ title }}</div>
10
- </header>
11
- <div class="vd-dialog__content">
12
- <div class="vd-dialog__message" :class="{ 'vd-dialog__message--head': !title }"
13
- v-if="message || $slots.content">
14
- <slot name="content">{{
15
- message
16
- }}</slot>
17
- </div>
18
- </div>
19
- <footer class="vd-dialog__footer">
20
- <div class="vd-dialog__btns" v-if="btns">
21
- <vd-button type="tertiary_grey" size="large" @click="cancel">{{ cancelButtonText ||
22
- $t("alert.cancel") }}</vd-button>
23
- <vd-button type="large" @click="confirm">{{ confirmButtonText || $t("alert.confirm") }} </vd-button>
24
- </div>
25
- <div class="vd-dialog__btn" v-if="btn">
26
- <vd-button type="large" @click="confirm" block>{{ confirmButtonText || $t("alert.confirm")
27
- }}</vd-button>
28
- </div>
29
- <div class="vd-dialog__btns--text" v-if="btnsText">
30
- <vd-button type="tertiary_text" size="large" @click="cancel">{{ cancelButtonText ||
31
- $t("alert.cancel")
32
- }}</vd-button>
33
- <vd-button type="primary_text" size="large" @click="confirm">{{ confirmButtonText ||
34
- $t("alert.confirm") }}</vd-button>
35
- </div>
36
- <div class="vd-dialog__btn--text-block" v-if="btnTextBlock">
37
- <vd-button type="primary_text" size="large" block @click="confirm">{{ confirmButtonText ||
38
- $t("alert.confirm") }}</vd-button>
39
- </div>
40
- <div class="vd-dialog__btns-block" v-if="btnsBlock">
41
- <vd-button type="primary" block size="large" @click="confirm">{{ confirmButtonText ||
42
- $t("alert.confirm") }}</vd-button>
43
- <vd-button type="primary_text" block size="large" @click="cancel">{{ cancelButtonText ||
44
- $t("alert.cancel") }}</vd-button>
45
- </div>
46
- <div class="vd-dialog__btns--text" v-if="$slots['extra-btn']">
47
- <slot name="extra-btn"></slot>
48
- </div>
49
- </footer>
50
- </div>
51
- </div>
52
- </template>
53
-
54
- <script>
55
- export default {
56
- name: 'vd-dialog',
57
- props: {
58
- value: Boolean,
59
- btns: Boolean,
60
- btnsBlock: Boolean,
61
- btn: Boolean,
62
- btnsText: Boolean,
63
- btnTextBlock: Boolean,
64
- message: String,
65
- title: String,
66
- className: String,
67
- overlay: {
68
- type: Boolean,
69
- default: true
70
- },
71
- confirmButtonText: String,
72
- cancelButtonText: String,
73
- closeOnOverlay: {
74
- type: Boolean,
75
- default: true
76
- },
77
- },
78
- data() {
79
- return {
80
-
81
- }
82
- },
83
- watch: {
84
-
85
- },
86
- computed: {
87
- visible() {
88
- return this.value
89
- }
90
- },
91
- methods: {
92
- close(force = false) {
93
- if (force || this.closeOnOverlay) {
94
- this.$emit('input', false);
95
- }
96
- },
97
- cancel() {
98
- this.close(true); // 调用 close 方法关闭对话框
99
- // 触发取消事件,让父组件知道用户点击了取消
100
- this.$emit('cancel');
101
- },
102
- confirm() {
103
- this.$emit('confirm');
104
- },
105
- }
106
- }
107
- </script>
108
-
109
- <style lang="less">
110
- @import './style.less';
111
- </style>
@@ -1,132 +0,0 @@
1
- @dialog-prefix-cls: vd-dialog;
2
-
3
- .@{dialog-prefix-cls} {
4
- position: absolute;
5
- left: 50%;
6
- top: 50%;
7
- z-index: 2111;
8
- transform: translate(-50%, -50%);
9
- width: 279px;
10
- background-color: var(--color-dialog-bg);
11
- border-radius: calc(var(--radius-dialog-content) * 1px);
12
- padding-inline-start: calc(var(--spacing-dialog-padding_left) * 1px);
13
- padding-inline-end: calc(var(--spacing-dialog-padding_right) * 1px);
14
-
15
- ::-webkit-scrollbar {
16
- width: 3px;
17
- }
18
-
19
-
20
- &__header {
21
- padding-block-start: calc(var(--spacing-dialog-padding_top) * 1px);
22
-
23
- &--img {
24
- padding-block-start: calc(var(--spacing-dialog-icon-padding_top) * 1px);
25
-
26
- &-content {
27
- text-align: center;
28
- margin-block-end: calc(var(--spacing-dialog-icon_title-margin_top) * 1px);
29
- }
30
- }
31
-
32
- }
33
-
34
- &__title {
35
- text-align: center;
36
- font-size: calc(var(--en-multi-f-e-s-fontSize) * 1px);
37
- font-weight: var(--en-multi-f-e-s-fontWeight);
38
- line-height: calc(var(--en-multi-f-e-s-lineHeight) * 1px);
39
- color: var(--color-dialog-title);
40
- }
41
-
42
- &__message {
43
- text-align: center;
44
- overflow-y: auto;
45
- min-height: calc(var(--height-dialog-super_small) * 1px);
46
- max-height: calc(var(--height-dialog-super_large) * 1px);
47
- margin-block-start: calc(var(--spacing-dialog-title-margin_bottom) * 1px);
48
- font-size: calc(var(--en-multi-f-d-r-fontSize) * 1px);
49
- font-weight: var(--en-multi-f-d-r-fontWeight);
50
- line-height: calc(var(--en-multi-f-d-r-lineHeight) * 1px);
51
- color: var(--color-dialog-text);
52
-
53
- &--head {
54
- margin-block-start: 0;
55
- color: var(--color-dialog-title);
56
- }
57
- }
58
-
59
- &__footer {
60
- margin-block-start: calc(var(--spacing-dialog-button-margin_top) * 1px);
61
- }
62
-
63
- &__btns {
64
- display: flex;
65
- justify-content: space-between;
66
- padding-block-end: calc(var(--spacing-dialog-padding_bottom) * 1px);
67
-
68
- button {
69
- flex: 1;
70
- }
71
-
72
- button+button {
73
- margin-inline-start: calc(var(--spacing-dialog-button_double-margin_mid) * 1px);
74
- }
75
- }
76
-
77
- &__btn {
78
- padding-block-end: calc(var(--spacing-dialog-padding_bottom) * 1px);
79
- padding-inline-start: calc(var(--spacing-dialog-button_single-margin_left) * 1px);
80
- padding-inline-end: calc(var(--spacing-dialog-button_single-margin_right) * 1px);
81
- }
82
-
83
- &__btns--text {
84
- display: flex;
85
- justify-content: space-between;
86
- padding-block-end: calc(var(--spacing-dialog-button_text-padding_bottom) * 1px);
87
-
88
- button {
89
- flex: 1;
90
- }
91
-
92
- button+button {
93
- margin-inline-start: calc(var(--spacing-dialog-button_double-margin_mid) * 1px);
94
- }
95
- }
96
-
97
- &__btn--text-block {
98
- display: flex;
99
- justify-content: space-between;
100
- padding-block-end: calc(var(--spacing-dialog-button_text-padding_bottom) * 1px);
101
- }
102
-
103
- &__btns-block {
104
-
105
- padding-block-end: calc(var(--spacing-dialog-button_text-padding_bottom) * 1px);
106
-
107
- button {
108
- flex: 1;
109
- }
110
-
111
- button+button {
112
- margin-block-start: calc(var(--spacing-dialog-button_double-margin_mid) * 1px);
113
- }
114
- }
115
-
116
- }
117
-
118
- .vd-overlay {
119
- position: fixed;
120
- top: 0;
121
- left: 0;
122
- z-index: 2001;
123
- width: 100%;
124
- height: 100%;
125
- background-color: var(--color-dialog-mask_bg);
126
- }
127
-
128
- html[theme="dark"] {
129
- .@{dialog-prefix-cls} {
130
- background: linear-gradient(0deg, var(--bg-color-4) 0%, var(--bg-color-4) 100%), var(--bg-color-1);
131
- }
132
- }
@@ -1,8 +0,0 @@
1
- import Divider from './index.vue';
2
- import './style.less';
3
-
4
- Divider.install = function (Vue) {
5
- Vue.component(Divider.name, Divider);
6
- };
7
-
8
- export default Divider;
@@ -1,54 +0,0 @@
1
- <template>
2
- <div class="vd-divider" :class="wrapClasses">
3
- <span v-if="hasSlot" class="vd-divider__text">
4
- <slot></slot>
5
- </span>
6
- </div>
7
- </template>
8
-
9
- <script>
10
- const prefixCls = 'vd-divider';
11
-
12
- export default {
13
- name: 'vd-divider',
14
- props: {
15
- hairline: {
16
- type: Boolean,
17
- default: true
18
- },
19
- direction: {
20
- type: String,
21
- default: 'horizontal',
22
- validator: value => ['horizontal', 'vertical'].includes(value)
23
- },
24
- type: String,
25
- contentPosition: String,
26
- },
27
- data() {
28
- return {
29
-
30
- }
31
- },
32
- computed: {
33
- hasSlot() {
34
- return this.$slots.default;
35
- },
36
- wrapClasses() {
37
- return [
38
- `${prefixCls}--${this.direction}`,
39
- {
40
- [`${prefixCls}-with-text--${this.contentPosition}`]: this.contentPosition,
41
- [`${prefixCls}--hairline`]: this.hairline,
42
- [`${prefixCls}--${this.type}`]: this.type,
43
- [`${prefixCls}-with-text`]: this.hasSlot
44
- }
45
- ]
46
- },
47
-
48
- }
49
- }
50
- </script>
51
-
52
- <style lang="less">
53
- @import './style.less';
54
- </style>
@@ -1,92 +0,0 @@
1
- @divider-prefix-cls: vd-divider;
2
-
3
- .@{divider-prefix-cls} {
4
-
5
- &--hairline::before,
6
- &--hairline::after {
7
- transform: scaleY(0.5);
8
- }
9
-
10
- &--horizontal {
11
- display: flex;
12
- align-items: center;
13
- border-style: solid;
14
- border-width: 0;
15
-
16
- &::before {
17
- content: '';
18
- }
19
-
20
- &::before,
21
- &::after {
22
- display: block;
23
- flex: 1;
24
- box-sizing: border-box;
25
- height: 1px;
26
- border-color: inherit;
27
- border-style: inherit;
28
- border-width: 1px 0 0;
29
- }
30
-
31
- }
32
-
33
- &--vertical {
34
- display: inline-flex;
35
-
36
- &.@{divider-prefix-cls}--hairline {
37
-
38
- &::before {
39
- transform: scale(0.5, 1);
40
- }
41
- }
42
-
43
- &::before {
44
- content: '';
45
- display: block;
46
- width: 1px;
47
- height: 1em;
48
- background-color: var(--divider-color-default-1);
49
- }
50
-
51
- &.@{divider-prefix-cls}--large {
52
- &::before {
53
- background-color: var(--divider-color-default-2);
54
- }
55
- }
56
- }
57
-
58
- &--hairline {
59
- border-color: var(--divider-color-default-1);
60
- }
61
-
62
- &--large {
63
- border-color: var(--divider-color-default-2);
64
- }
65
-
66
-
67
- &-with-text {
68
- &::after {
69
- content: '';
70
- }
71
-
72
- &--left {
73
- &::before {
74
- max-width: 20%;
75
- }
76
- }
77
-
78
- &--right {
79
- &::after {
80
- max-width: 20%;
81
- }
82
- }
83
- }
84
-
85
-
86
-
87
- &__text {
88
- font-size: 12px;
89
- color: rgba(0, 0, 0, 0.3);
90
- margin: 0 calc(var(--spacing-tight) * 1px);
91
- }
92
- }
@@ -1,8 +0,0 @@
1
- import VDropdown from "./index.vue";
2
- import './style.less';
3
-
4
- VDropdown.install = function (Vue) {
5
- Vue.component(VDropdown.name, VDropdown);
6
- };
7
-
8
- export default VDropdown;
@@ -1,210 +0,0 @@
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', 'fusing', 'pre', 'last'].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>