vdesign-ui 0.2.6 → 0.2.7

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 (195) hide show
  1. package/dist/components/actionbar/index.js +8 -0
  2. package/dist/components/actionbar/index.vue +39 -0
  3. package/dist/components/actionbar/style.less +44 -0
  4. package/dist/components/actionbar-cell/index.js +7 -0
  5. package/dist/components/actionbar-cell/index.vue +38 -0
  6. package/dist/components/actions/index.js +7 -0
  7. package/dist/components/actions/index.vue +76 -0
  8. package/dist/components/actions/style.less +109 -0
  9. package/dist/components/actions-cell/index.js +7 -0
  10. package/dist/components/actions-cell/index.vue +94 -0
  11. package/dist/components/actions-cell/style.less +39 -0
  12. package/dist/components/activityviews/index.js +8 -0
  13. package/dist/components/activityviews/index.vue +192 -0
  14. package/dist/components/activityviews/style.less +152 -0
  15. package/dist/components/badge/index.js +8 -0
  16. package/dist/components/badge/index.vue +49 -0
  17. package/dist/components/badge/style.less +54 -0
  18. package/dist/components/button/index.js +8 -0
  19. package/dist/components/button/index.vue +93 -0
  20. package/dist/components/button/style.less +558 -0
  21. package/dist/components/calendar/end.png +0 -0
  22. package/dist/components/calendar/index-element.vue +84 -0
  23. package/dist/components/calendar/index.js +8 -0
  24. package/dist/components/calendar/index.vue +52 -0
  25. package/dist/components/calendar/start.png +0 -0
  26. package/dist/components/calendar/style.less +138 -0
  27. package/dist/components/checkbox/index.js +8 -0
  28. package/dist/components/checkbox/index.vue +161 -0
  29. package/dist/components/checkbox/style.less +289 -0
  30. package/dist/components/checkbox-group/index.js +7 -0
  31. package/dist/components/checkbox-group/index.vue +69 -0
  32. package/dist/components/common/state/index.vue +33 -0
  33. package/dist/components/common/state/style.less +48 -0
  34. package/dist/components/data-list/index.js +10 -0
  35. package/dist/components/data-list/index.vue +19 -0
  36. package/dist/components/data-list/style.less +623 -0
  37. package/dist/components/datetime-picker/index.js +8 -0
  38. package/dist/components/datetime-picker/index.vue +37 -0
  39. package/dist/components/datetime-picker/style.less +24 -0
  40. package/dist/components/dialog/index.js +8 -0
  41. package/dist/components/dialog/index.vue +164 -0
  42. package/dist/components/dialog/overlay-manager.js +18 -0
  43. package/dist/components/dialog/style.less +139 -0
  44. package/dist/components/divider/index.js +8 -0
  45. package/dist/components/divider/index.vue +54 -0
  46. package/dist/components/divider/style.less +92 -0
  47. package/dist/components/dropdown/index.js +8 -0
  48. package/dist/components/dropdown/index.vue +218 -0
  49. package/dist/components/dropdown/style.less +432 -0
  50. package/dist/components/empty/404-dark.png +0 -0
  51. package/dist/components/empty/404.png +0 -0
  52. package/dist/components/empty/index.js +8 -0
  53. package/dist/components/empty/index.vue +138 -0
  54. package/dist/components/empty/network-dark.png +0 -0
  55. package/dist/components/empty/network.png +0 -0
  56. package/dist/components/empty/nocoupons-dark.png +0 -0
  57. package/dist/components/empty/nocoupons.png +0 -0
  58. package/dist/components/empty/nodata-dark.png +0 -0
  59. package/dist/components/empty/nodata.png +0 -0
  60. package/dist/components/empty/nomargin-dark.png +0 -0
  61. package/dist/components/empty/nomargin.png +0 -0
  62. package/dist/components/empty/nonotice-dark.png +0 -0
  63. package/dist/components/empty/nonotice.png +0 -0
  64. package/dist/components/empty/noocomments-dark.png +0 -0
  65. package/dist/components/empty/noocomments.png +0 -0
  66. package/dist/components/empty/noorders-dark.png +0 -0
  67. package/dist/components/empty/noorders.png +0 -0
  68. package/dist/components/empty/noposition-dark.png +0 -0
  69. package/dist/components/empty/noposition.png +0 -0
  70. package/dist/components/empty/nosearch-dark.png +0 -0
  71. package/dist/components/empty/nosearch.png +0 -0
  72. package/dist/components/empty/style.less +61 -0
  73. package/dist/components/footer/index.js +7 -0
  74. package/dist/components/footer/index.vue +33 -0
  75. package/dist/components/footer/style.less +21 -0
  76. package/dist/components/footnav/index.js +7 -0
  77. package/dist/components/footnav/index.vue +93 -0
  78. package/dist/components/footnav/style.less +23 -0
  79. package/dist/components/footnav-item/index.js +7 -0
  80. package/dist/components/footnav-item/index.vue +50 -0
  81. package/dist/components/footnav-item/style.less +39 -0
  82. package/dist/components/form/index.js +7 -0
  83. package/dist/components/form/index.vue +12 -0
  84. package/dist/components/headnav/index.js +7 -0
  85. package/dist/components/headnav/index.vue +185 -0
  86. package/dist/components/headnav/style.less +232 -0
  87. package/dist/components/icon/font/iconfont.css +163 -0
  88. package/dist/components/icon/font/iconfont.js +6 -0
  89. package/dist/components/icon/index.js +9 -0
  90. package/dist/components/icon/index.vue +96 -0
  91. package/dist/components/icon/style.less +44 -0
  92. package/dist/components/input/calcTextareaHeight.js +162 -0
  93. package/dist/components/input/index.js +8 -0
  94. package/dist/components/input/index.vue +345 -0
  95. package/dist/components/input/style.less +471 -0
  96. package/dist/components/list/index.js +8 -0
  97. package/dist/components/list/index.vue +152 -0
  98. package/dist/components/list/style.less +213 -0
  99. package/dist/components/loading/index.js +7 -0
  100. package/dist/components/loading/index.vue +68 -0
  101. package/dist/components/loading/style.less +54 -0
  102. package/dist/components/mixins/clickoutside.js +81 -0
  103. package/dist/components/mixins/dom.js +41 -0
  104. package/dist/components/mixins/languageMixin.js +41 -0
  105. package/dist/components/mixins/outlineConfigPlugin.js +45 -0
  106. package/dist/components/mixins/router-link.js +23 -0
  107. package/dist/components/mixins/themeMixin.js +43 -0
  108. package/dist/components/noticebar/index.js +8 -0
  109. package/dist/components/noticebar/index.vue +258 -0
  110. package/dist/components/noticebar/style.less +328 -0
  111. package/dist/components/overlay/index.js +8 -0
  112. package/dist/components/overlay/index.vue +184 -0
  113. package/dist/components/overlay/style.less +23 -0
  114. package/dist/components/pagebreak/index.js +7 -0
  115. package/dist/components/pagebreak/index.vue +67 -0
  116. package/dist/components/pagebreak/style.less +42 -0
  117. package/dist/components/password/index.js +8 -0
  118. package/dist/components/password/index.vue +60 -0
  119. package/dist/components/popover/index.js +8 -0
  120. package/dist/components/popover/index.vue +100 -0
  121. package/dist/components/popover/style.less +346 -0
  122. package/dist/components/popover/vue-popover.vue +314 -0
  123. package/dist/components/popup/index.js +7 -0
  124. package/dist/components/popup/index.vue +243 -0
  125. package/dist/components/radio/index.js +8 -0
  126. package/dist/components/radio/index.vue +184 -0
  127. package/dist/components/radio/style.less +294 -0
  128. package/dist/components/radio-group/index.js +6 -0
  129. package/dist/components/radio-group/index.vue +58 -0
  130. package/dist/components/result/completed-dark.png +0 -0
  131. package/dist/components/result/completed.png +0 -0
  132. package/dist/components/result/error-dark.png +0 -0
  133. package/dist/components/result/error.png +0 -0
  134. package/dist/components/result/index.js +8 -0
  135. package/dist/components/result/index.vue +73 -0
  136. package/dist/components/result/style.less +44 -0
  137. package/dist/components/result/wait-dark.png +0 -0
  138. package/dist/components/result/wait.png +0 -0
  139. package/dist/components/search/index.js +8 -0
  140. package/dist/components/search/index.vue +66 -0
  141. package/dist/components/selector/index.js +8 -0
  142. package/dist/components/selector/index.vue +161 -0
  143. package/dist/components/selector/style.less +484 -0
  144. package/dist/components/skeleton/index.js +7 -0
  145. package/dist/components/skeleton/index.vue +206 -0
  146. package/dist/components/skeleton/style.less +197 -0
  147. package/dist/components/slider/draggable.js +49 -0
  148. package/dist/components/slider/index.js +7 -0
  149. package/dist/components/slider/index.vue +167 -0
  150. package/dist/components/slider/style.less +100 -0
  151. package/dist/components/slider/utils.js +60 -0
  152. package/dist/components/step/index.js +7 -0
  153. package/dist/components/step/index.vue +48 -0
  154. package/dist/components/step/style.less +58 -0
  155. package/dist/components/step-item/index.js +7 -0
  156. package/dist/components/step-item/index.vue +126 -0
  157. package/dist/components/step-item/style.less +362 -0
  158. package/dist/components/stepper/index.js +8 -0
  159. package/dist/components/stepper/index.vue +146 -0
  160. package/dist/components/style/index.vue +42 -0
  161. package/dist/components/switch/index.js +8 -0
  162. package/dist/components/switch/index.vue +72 -0
  163. package/dist/components/switch/style.less +56 -0
  164. package/dist/components/tab/index.js +7 -0
  165. package/dist/components/tab/index.vue +53 -0
  166. package/dist/components/tabs/index.js +8 -0
  167. package/dist/components/tabs/index.vue +172 -0
  168. package/dist/components/tabs/style.less +377 -0
  169. package/dist/components/tag/index.js +7 -0
  170. package/dist/components/tag/index.vue +64 -0
  171. package/dist/components/tag/style.less +211 -0
  172. package/dist/components/title/index.js +8 -0
  173. package/dist/components/title/index.vue +99 -0
  174. package/dist/components/title/style.less +188 -0
  175. package/dist/components/toast/index.js +83 -0
  176. package/dist/components/toast/index.vue +49 -0
  177. package/dist/components/toast/style.less +55 -0
  178. package/dist/components/transition/index.js +8 -0
  179. package/dist/components/transition/index.vue +13 -0
  180. package/dist/components/transition/style.less +208 -0
  181. package/dist/components/upload/index.js +7 -0
  182. package/dist/components/upload/index.vue +106 -0
  183. package/dist/components/upload/style.less +147 -0
  184. package/dist/components/utils/assist.js +34 -0
  185. package/dist/components/utils/env.js +2 -0
  186. package/dist/demo.html +10 -0
  187. package/dist/locale/ar.js +98 -0
  188. package/dist/locale/en.js +98 -0
  189. package/dist/locale/zh.js +98 -0
  190. package/dist/token.css +2990 -0
  191. package/dist/vdesign-ui.common.js +27076 -0
  192. package/dist/vdesign-ui.css +1 -0
  193. package/dist/vdesign-ui.umd.js +27086 -0
  194. package/dist/vdesign-ui.umd.min.js +32 -0
  195. package/package.json +1 -1
@@ -0,0 +1,138 @@
1
+ .van-calendar__header {
2
+ box-shadow: none;
3
+ }
4
+
5
+ .van-calendar__header-subtitle {
6
+ height: var(--height-datepicker-title-month_year);
7
+ line-height: var(--height-datepicker-title-month_year);
8
+ color: var(--color-datepicker-title-month_year);
9
+ font-size: var(--en-single-f-d-s-fontSize);
10
+ font-weight: var(--en-single-f-d-s-fontWeight);
11
+ }
12
+
13
+ .van-calendar__weekdays {
14
+ padding: 0 20px;
15
+ height: var(--height-datepicker-week);
16
+ color: var(--color-datepicker-text-week);
17
+ }
18
+
19
+ .van-calendar__weekday {
20
+ line-height: var(--height-datepicker-week);
21
+ font-size: var(--en-single-f-b-r-fontSize);
22
+ font-weight: var(--en-single-f-b-r-fontWeight);
23
+ }
24
+
25
+ .van-calendar__days {
26
+ display: flex;
27
+ padding: 0 20px;
28
+ }
29
+
30
+ .van-calendar__day {
31
+ height: var(--height-datepicker-date);
32
+ font-size: var(--en-single-f-d-s-fontSize);
33
+ font-weight: var(--en-single-f-d-s-fontWeight);
34
+ color: var(--color-datepicker-date-text-default);
35
+ background-color: var(--color-datepicker-date-bg-default);
36
+ margin-block-start: var(--spacing-datepicker-date-margin_top);
37
+ margin-block-end: var(--spacing-datepicker-date-margin_bottom);
38
+
39
+ &--disabled {
40
+ color: var(--color-datepicker-date-text-disable);
41
+ background-color: var(--color-datepicker-date-bg-disable);
42
+ }
43
+
44
+ &--start {
45
+ font-size: var(--en-single-f-d-s-fontSize);
46
+ font-weight: var(--en-single-f-d-s-fontWeight);
47
+ color: var(--color-datepicker-date-text-active);
48
+ border-radius: 0;
49
+ background-image: url(./start.png) !important;
50
+ background-position: center center !important;
51
+ background-repeat: no-repeat !important;
52
+ background-size: cover !important;
53
+ }
54
+
55
+ &--middle {
56
+ color: var(--color-datepicker-date-text-default) !important;
57
+ background-color: var(--color-datepicker-date_mask-bg-active);
58
+
59
+ &::after {
60
+ background-color: transparent;
61
+ opacity: 1;
62
+ }
63
+ }
64
+
65
+ &--end {
66
+ font-size: var(--en-single-f-d-s-fontSize);
67
+ font-weight: var(--en-single-f-d-s-fontWeight);
68
+ color: var(--color-datepicker-date-text-active);
69
+ background-color: var(--color-datepicker-date-bg-active);
70
+ border-radius: 0;
71
+ background-image: url(./end.png) !important;
72
+ background-position: center center !important;
73
+ background-repeat: no-repeat !important;
74
+ background-size: cover !important;
75
+ }
76
+ }
77
+
78
+ .van-calendar__selected-day {
79
+ background-color: var(--color-datepicker-date-bg-active);
80
+ }
81
+
82
+ .van-calendar__bottom-info {
83
+ bottom: -14px;
84
+ color: #1BC47D;
85
+ font-size: 12px;
86
+ font-weight: normal;
87
+ }
88
+
89
+ .van-calendar__top-info {
90
+ top: auto;
91
+ bottom: -14px;
92
+ color: var(--color-datepicker-today_dot);
93
+ font-size: 18px;
94
+ }
95
+
96
+ .vd-calendar-input {
97
+ padding-block-start: var(--spacing-datepicker-range_picker-margin_top);
98
+ padding-block-end: var(--spacing-datepicker-range_picker-margin_bottom);
99
+ padding-inline-start: var(--spacing-datepicker-padding_y);
100
+ padding-inline-end: var(--spacing-datepicker-padding_y);
101
+
102
+ &-inner {
103
+ display: flex;
104
+ align-items: center;
105
+ border-radius: var(--radius-datepicker-range_picker_bg);
106
+ background-color: var(--color-datepicker-range_picker-bg);
107
+ }
108
+
109
+ &__inputs {
110
+ width: 100%;
111
+ text-align: center;
112
+ background-color: transparent;
113
+ height: var(--height-datepicker-range_picker_bg);
114
+ line-height: var(--height-datepicker-range_picker_bg);
115
+ font-size: var(--en-single-f-d-r-fontSize);
116
+ font-weight: var(--en-single-f-d-r-fontWeight);
117
+ color: var(--color-datepicker-range_picker-text-active);
118
+
119
+ ::-webkit-input-placeholder {
120
+ color: var(--color-datepicker-range_picker-text-default);
121
+ }
122
+ }
123
+
124
+ &__line {
125
+ width: var(--width-datepicker-range_picker_divider);
126
+ height: var(--height-datepicker-range_picker_divider);
127
+ background-color: var(--color-datepicker-range_picker_divider);
128
+ }
129
+ }
130
+
131
+ .van-hairline-unset--top-bottom::after {
132
+ border-width: 0;
133
+ }
134
+
135
+ .van-picker__frame {
136
+ left: var(--spacing-datepicker-padding_y);
137
+ right: var(--spacing-datepicker-padding_y);
138
+ }
@@ -0,0 +1,8 @@
1
+ import Checkbox from './index.vue';
2
+ import './style.less';
3
+
4
+ Checkbox.install = function (Vue) {
5
+ Vue.component(Checkbox.name, Checkbox);
6
+ };
7
+
8
+ export default Checkbox;
@@ -0,0 +1,161 @@
1
+ <template>
2
+ <label :class="wrapClasses" v-if="!checkboxButton">
3
+ <span :class="checkboxClasses">
4
+ <!-- 处理分组和单个情况的输入元素 -->
5
+ <span :class="innerClasses"></span>
6
+ <!-- 处理分组和单个情况的输入元素 -->
7
+ <input v-if="group" type="checkbox" :class="inputClasses" :disabled="disabled" :value="name" v-model="model"
8
+ @change="change" />
9
+ <input v-else type="checkbox" :class="inputClasses" :disabled="disabled" :checked="currentValue"
10
+ @change="change" />
11
+ </span>
12
+ <!-- 标签和可选的描述 -->
13
+ <div class="vd-checkbox__label" v-if="$slots.default">
14
+ <p class="vd-checkbox__text">
15
+ <slot></slot>
16
+ </p>
17
+ <p class="vd-checkbox__description" v-if="extra">{{ extra }}</p>
18
+ </div>
19
+ </label>
20
+
21
+ <!-- 复选框按钮变体 -->
22
+ <label class="vd-checkbox vd-checkbox-button" :class="checkboxButtonClasses" v-else>
23
+ <input type="checkbox" :class="inputClasses" :disabled="disabled" :checked="currentValue" @change="change" />
24
+ <template v-if="type === 'small'">
25
+ <vd-icon v-if="icon" :name="icon" class="vd-checkbox-button__icon--small"></vd-icon>
26
+ <span class="vd-checkbox-button__text">
27
+ <slot></slot>
28
+ </span>
29
+ </template>
30
+
31
+ <template v-if="type === 'medium'">
32
+ <span class="vd-checkbox-button__text">
33
+ <slot></slot>
34
+ </span>
35
+ <span class="vd-checkbox-button__description" v-if="extra">{{ extra }}</span>
36
+ </template>
37
+
38
+ <template v-if="type === 'large'">
39
+ <vd-icon v-if="icon" :name="icon" class="vd-checkbox-button__icon--large"></vd-icon>
40
+ <span class="vd-checkbox-button__text">
41
+ <slot></slot>
42
+ </span>
43
+ </template>
44
+ </label>
45
+ </template>
46
+ <script>
47
+ import { findComponentUpward } from "../utils/assist";
48
+ import VdIcon from '../icon';
49
+ const prefixCls = "vd-checkbox";
50
+
51
+ export default {
52
+ name: "vd-checkbox",
53
+ components: {
54
+ VdIcon
55
+ },
56
+ props: {
57
+ value: [String, Number, Boolean], // 复选框的当前值
58
+ checkboxButton: Boolean, // 是否为复选框按钮
59
+ disabled: Boolean, // 是否禁用
60
+ extra: String, // 额外的描述文本
61
+ trueValue: {
62
+ type: [String, Number, Boolean],
63
+ default: true, // 复选框被选中时的值
64
+ },
65
+ falseValue: {
66
+ type: [String, Number, Boolean],
67
+ default: false, // 复选框未被选中时的值
68
+ },
69
+ name: null, //复选框的 name 属性
70
+ indeterminate: Boolean, // 复选框的不确定状态
71
+ icon: String, // 使用复选框按钮时显示的图标
72
+ type: String, // 复选框按钮的尺寸类型('small','medium','large')
73
+ },
74
+ data() {
75
+ return {
76
+ model: [], // 复选框组的模型值
77
+ currentValue: this.value, // 复选框的当前值
78
+ group: false, // 是否为复选框组
79
+ parent: null, // 对父级复选框组组件的引用
80
+ };
81
+ },
82
+ computed: {
83
+ wrapClasses() {
84
+ return [
85
+ `${prefixCls}`,
86
+ {
87
+ [`${prefixCls}--checked`]: this.currentValue,
88
+ [`${prefixCls}--disabled`]: this.disabled,
89
+ },
90
+ ];
91
+ },
92
+ checkboxClasses() {
93
+ return [
94
+ `${prefixCls}__input`,
95
+ {
96
+ [`${prefixCls}--indeterminate`]: this.indeterminate,
97
+ },
98
+ ];
99
+ },
100
+ innerClasses() {
101
+ return [`${prefixCls}__icon`];
102
+ },
103
+ inputClasses() {
104
+ return `${prefixCls}__original`;
105
+ },
106
+ checkboxButtonClasses() {
107
+ return [
108
+ {
109
+ [`${prefixCls}-button--checked`]: this.currentValue,
110
+ [`${prefixCls}-button--${this.type}`]: this.type,
111
+ [`${prefixCls}-button--disabled`]: this.disabled,
112
+ },
113
+ ];
114
+ },
115
+ },
116
+ mounted() {
117
+ this.parent = findComponentUpward(this, "vd-checkbox-group");
118
+ if (this.parent) {
119
+ this.isGroup = true;
120
+ this.parent.updateModel(true);
121
+ } else {
122
+ this.updateModel();
123
+ }
124
+ },
125
+ methods: {
126
+ change(event) {
127
+ if (this.disabled) {
128
+ return false;
129
+ }
130
+
131
+ const checked = event.target.checked;
132
+ this.currentValue = checked;
133
+
134
+ const value = checked ? this.trueValue : this.falseValue;
135
+ this.$emit("input", value);
136
+
137
+ if (this.group) {
138
+ this.parent.change(this.model);
139
+ } else {
140
+ this.$emit("change", value);
141
+ }
142
+ },
143
+ updateModel() {
144
+ this.currentValue = this.value === this.trueValue;
145
+ },
146
+ },
147
+ watch: {
148
+ value(val) {
149
+ if (val === this.trueValue || val === this.falseValue) {
150
+ this.updateModel();
151
+ } else {
152
+ throw "Value should be trueValue or falseValue.";
153
+ }
154
+ },
155
+ },
156
+ };
157
+ </script>
158
+
159
+ <style lang="less">
160
+ @import "./style.less";
161
+ </style>
@@ -0,0 +1,289 @@
1
+ @checkbox-prefix-cls: vd-checkbox;
2
+ @checkbox-button-prefix-cls: vd-checkbox-button;
3
+ @checkbox-icon-prefix-cls: ~"@{checkbox-prefix-cls}__icon";
4
+
5
+ .@{checkbox-prefix-cls} {
6
+ cursor: pointer;
7
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
8
+ display: flex;
9
+ -webkit-tap-highlight-color: transparent;
10
+ }
11
+
12
+ // 普通状态
13
+ .@{checkbox-prefix-cls} {
14
+
15
+ &__input {
16
+ position: relative;
17
+ margin-inline-end: var(--spacing-check_radio-icon-margin_right);
18
+ width: var(--icon-check_radio-sizing);
19
+ height: var(--icon-check_radio-sizing);
20
+ }
21
+
22
+ &__text {
23
+ color: var(--color-check_radio-text-default);
24
+ font-size: var(--en-single-f-d-r-fontSize);
25
+ font-weight: var(--en-single-f-d-r-fontWeight);
26
+ }
27
+
28
+ &__description {
29
+ line-height: 1;
30
+ margin-top: var(--spacing-check_radio-text-margin_top);
31
+ color: var(--color-check_radio-text_describe-default);
32
+ font-size: var(--en-single-f-b-r-fontSize);
33
+ font-weight: var(--en-single-f-b-r-fontWeight);
34
+ }
35
+
36
+ .@{checkbox-icon-prefix-cls} {
37
+ display: block;
38
+ width: var(--icon-check_radio-sizing);
39
+ height: var(--icon-check_radio-sizing);
40
+ position: relative;
41
+ top: 0;
42
+ left: 0;
43
+
44
+ &::before {
45
+ position: absolute;
46
+ box-sizing: border-box;
47
+ content: ' ';
48
+ pointer-events: none;
49
+ top: -50%;
50
+ right: -50%;
51
+ bottom: -50%;
52
+ left: -50%;
53
+ border: 3px solid var(--color-check_radio-default);
54
+ -webkit-transform: scale(0.5);
55
+ transform: scale(0.5);
56
+ }
57
+ }
58
+
59
+ &__original {
60
+ width: 100%;
61
+ height: 100%;
62
+ position: absolute;
63
+ top: 0;
64
+ bottom: 0;
65
+ left: 0;
66
+ right: 0;
67
+ z-index: 1;
68
+ cursor: pointer;
69
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
70
+ opacity: 0;
71
+ }
72
+ }
73
+
74
+
75
+ // 选中状态
76
+ .@{checkbox-prefix-cls}--checked {
77
+
78
+ .@{checkbox-prefix-cls} {
79
+ &__text {
80
+ font-size: var(--en-single-f-d-s-fontSize);
81
+ font-weight: var(--en-single-f-d-s-fontWeight);
82
+ }
83
+ }
84
+
85
+ .@{checkbox-icon-prefix-cls} {
86
+ background: var(--color-check_radio-active);
87
+ border-radius: 2px;
88
+ border: 0;
89
+ &::after{
90
+ content: "";
91
+ box-sizing: content-box;
92
+ display: table;
93
+ width: 4px;
94
+ height: 8px;
95
+ position: absolute;
96
+ top: 2px;
97
+ left: 5px;
98
+ border: 2px solid var(--bg-color-1);
99
+ border-top: 0;
100
+ border-left: 0;
101
+ transform: rotate(45deg) scale(1);
102
+ }
103
+ &::before{
104
+ display: none;
105
+ }
106
+ }
107
+ }
108
+
109
+
110
+ // 禁用
111
+ .@{checkbox-prefix-cls}--disabled {
112
+ cursor: not-allowed;
113
+ // opacity: var(--opacity-30);
114
+
115
+ .@{checkbox-icon-prefix-cls} {
116
+ &::before{
117
+ border-color: var(--color-check_radio-disable);
118
+ }
119
+ }
120
+
121
+ .@{checkbox-prefix-cls}__text{
122
+ color: var(--color-check_radio-text-disable);
123
+ }
124
+
125
+ .@{checkbox-prefix-cls}__description{
126
+ color: var(--color-check_radio-text_describe-disable);
127
+ }
128
+
129
+ }
130
+
131
+ .@{checkbox-prefix-cls}--checked.@{checkbox-prefix-cls}--disabled{
132
+ .@{checkbox-icon-prefix-cls} {
133
+ background: var(--color-check_radio-active-disable);
134
+ }
135
+ }
136
+
137
+ // 半选状态
138
+ .@{checkbox-prefix-cls}--indeterminate {
139
+
140
+ & + .@{checkbox-prefix-cls}__label {
141
+ .@{checkbox-prefix-cls}__text {
142
+ font-size: var(--en-single-f-d-s-fontSize);
143
+ font-weight: var(--en-single-f-d-s-fontWeight);
144
+ }
145
+ }
146
+
147
+ .@{checkbox-icon-prefix-cls} {
148
+ background: #1BC47D;
149
+ border-radius: 2px;
150
+ border: 0;
151
+ &::after{
152
+ content: "";
153
+ width: 9px;
154
+ height: 2px;
155
+ position: absolute;
156
+ left: 50%;
157
+ top: 50%;
158
+ transform: translate(-50%, -50%);
159
+ border: 0;
160
+ background-color: var(--bg-color-1);
161
+ }
162
+
163
+ &::before{
164
+ display: none;
165
+ }
166
+ }
167
+
168
+ }
169
+
170
+
171
+
172
+
173
+
174
+ .@{checkbox-button-prefix-cls}{
175
+ position: relative;
176
+ display: inline-flex;
177
+ align-items: center;
178
+ flex-direction: column;
179
+ justify-content: center;
180
+ line-height: 1;
181
+ width: 100%;
182
+ -webkit-tap-highlight-color: transparent;
183
+ background-color: var(--color-check_radio-check_bg-default);
184
+
185
+ &--large {
186
+ height: var(--height-check_radio-check_button_l);
187
+ border-radius: var(--radius-check_radio-check_l);
188
+
189
+ .@{checkbox-button-prefix-cls}__text {
190
+ margin-block-start: var(--spacing-check_radio-check_icon-margin_bottom);
191
+ font-size: 12px;
192
+ color: var(--color-check_radio-radio_button_text-default);
193
+ }
194
+
195
+ }
196
+
197
+ &--medium {
198
+ height: var(--height-check_radio-check_button_m);
199
+ border-radius: var(--radius-check_radio-m);
200
+
201
+ .@{checkbox-button-prefix-cls}{
202
+ &__description {
203
+ margin-block-start: var(--spacing-check_radio-check_describe-margin_top);
204
+ font-size: 11px;
205
+ color: var(--color-check_radio-check_button_text_describe-default);
206
+ }
207
+ }
208
+ }
209
+
210
+ &--small {
211
+ display: flex;
212
+ flex-direction: row;
213
+ height: var(--height-check_radio-check_button_s);
214
+ border-radius: var(--radius-check_radio-s);
215
+ }
216
+
217
+
218
+ &__icon--large {
219
+ color: var(--color-check_radio-check_button_icon-default);
220
+ font-size: var(--icon-check_radio-check_l);
221
+ }
222
+
223
+ &__icon--small {
224
+ font-size: var(--icon-check_radio-check_s);
225
+ color: var(--text-color-h2);
226
+ margin-inline-end: var(--spacing-check_radio-check_icon-margin_right);
227
+ }
228
+
229
+ &__text {
230
+ color: var(--color-check_radio-radio_button_text-default);
231
+ font-size: var(--en-single-f-c-r-fontSize);
232
+ font-weight: var(--en-single-f-c-r-fontWeight);
233
+ }
234
+
235
+ &--checked {
236
+ background-color: var(--color-check_radio-check_bg-active);
237
+ border-color: var(--color-check_radio-radio_border-active);
238
+
239
+ .@{checkbox-button-prefix-cls}__text {
240
+ color: var(--color-check_radio-radio_button_text-active);
241
+ font-size: var(--en-single-f-c-s-fontSize);
242
+ font-weight: var(--en-single-f-c-s-fontWeight);
243
+ }
244
+
245
+ .@{checkbox-button-prefix-cls}__icon--large,
246
+ .@{checkbox-button-prefix-cls}__icon--small,
247
+ .@{checkbox-button-prefix-cls}__description {
248
+ color: var(--color-check_radio-check_button_icon-active);
249
+ }
250
+
251
+ &.@{checkbox-button-prefix-cls}{
252
+ &--large{
253
+ .@{checkbox-button-prefix-cls}__text {
254
+ font-size: 12px;
255
+ }
256
+ }
257
+
258
+ }
259
+ }
260
+
261
+ &--disabled{
262
+ cursor: not-allowed;
263
+ .@{checkbox-button-prefix-cls}__text {
264
+ color: var(--color-check_radio-radio_button_text-disable);
265
+ }
266
+ .@{checkbox-button-prefix-cls}__icon--large,
267
+ .@{checkbox-button-prefix-cls}__icon--small,
268
+ .@{checkbox-button-prefix-cls}__description{
269
+ color: var(--color-check_radio-check_button_icon-disable);
270
+ }
271
+ }
272
+ }
273
+
274
+ .@{checkbox-prefix-cls}-group {
275
+ display: flex;
276
+ flex-direction: column;
277
+ gap: var(--spacing-check_radio-group-margin_x);
278
+
279
+ &__card{
280
+ display: flex;
281
+ flex-wrap: wrap;
282
+ flex-direction: row;
283
+ gap: 12px;
284
+ }
285
+
286
+ .@{checkbox-button-prefix-cls}{
287
+ flex: 1;
288
+ }
289
+ }
@@ -0,0 +1,7 @@
1
+ import CheckboxGroup from './index.vue';
2
+
3
+ CheckboxGroup.install = function (Vue) {
4
+ Vue.component(CheckboxGroup.name, CheckboxGroup);
5
+ };
6
+
7
+ export default CheckboxGroup;
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <div :class="classes">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+ <script>
7
+ import { findComponentsDownward } from "../utils/assist";
8
+
9
+ const prefixCls = 'vd-checkbox-group';
10
+
11
+ export default {
12
+ name: 'vd-checkbox-group',
13
+ props: {
14
+ value: {
15
+ type: Array,
16
+ default() {
17
+ return [];
18
+ }
19
+ },
20
+ type: String, // 类型card
21
+
22
+ },
23
+ data() {
24
+ return {
25
+ currentValue: this.value,
26
+ childrens: []
27
+ };
28
+ },
29
+ computed: {
30
+ classes() {
31
+ return [
32
+ `${prefixCls}`,
33
+ {
34
+ [`${prefixCls}__${this.type}`]: this.type,
35
+ }
36
+ ];
37
+ }
38
+ },
39
+ mounted() {
40
+ this.updateModel(true);
41
+ },
42
+ methods: {
43
+ updateModel(update) {
44
+ this.childrens = findComponentsDownward(this, 'vd-checkbox', 'vd-checkbox-group');
45
+ if (this.childrens) {
46
+ const { value } = this;
47
+ this.childrens.forEach(child => {
48
+ child.model = value;
49
+
50
+ if (update) {
51
+ child.currentValue = value.indexOf(child.name) >= 0;
52
+ child.group = true;
53
+ }
54
+ });
55
+ }
56
+ },
57
+ change(data) {
58
+ this.currentValue = data;
59
+ this.$emit('input', data);
60
+ this.$emit('change', data);
61
+ }
62
+ },
63
+ watch: {
64
+ value() {
65
+ this.updateModel(true);
66
+ }
67
+ }
68
+ };
69
+ </script>
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <div class="vd-market-state" :class="stateClasses" v-if="state">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ const prefixCls = 'vd-market-state';
9
+
10
+ export default {
11
+ name: 'vd-market-state',
12
+ props: {
13
+ state: {
14
+ type: String,
15
+ default: 'open'
16
+ }
17
+ },
18
+ computed: {
19
+ stateClasses() {
20
+ return [
21
+ {
22
+ [`${prefixCls}--${this.state}`]: this.state,
23
+
24
+ }
25
+ ]
26
+ },
27
+ }
28
+ }
29
+ </script>
30
+
31
+ <style lang="less">
32
+ @import 'style.less';
33
+ </style>