vue-devui 1.0.0-rc.0 → 1.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/README.md +55 -113
  2. package/alert/index.es.js +28 -30
  3. package/alert/index.umd.js +1 -1
  4. package/auto-complete/index.es.js +143 -103
  5. package/auto-complete/index.umd.js +5 -1
  6. package/auto-complete/style.css +1 -1
  7. package/avatar/index.es.js +77 -81
  8. package/avatar/index.umd.js +1 -1
  9. package/badge/index.es.js +1 -1
  10. package/badge/index.umd.js +1 -1
  11. package/badge/style.css +1 -1
  12. package/button/index.es.js +43 -43
  13. package/button/index.umd.js +1 -1
  14. package/card/index.es.js +3 -6
  15. package/card/index.umd.js +1 -1
  16. package/checkbox/index.es.js +5 -11
  17. package/checkbox/index.umd.js +1 -1
  18. package/comment/index.es.js +2 -5
  19. package/comment/index.umd.js +1 -1
  20. package/countdown/index.es.js +5 -7
  21. package/countdown/index.umd.js +1 -1
  22. package/editable-select/index.es.js +124 -168
  23. package/editable-select/index.umd.js +1 -1
  24. package/fullscreen/index.es.js +13 -16
  25. package/fullscreen/index.umd.js +1 -1
  26. package/grid/index.es.js +30 -36
  27. package/grid/index.umd.js +1 -1
  28. package/icon/index.es.js +39 -57
  29. package/icon/index.umd.js +1 -1
  30. package/image-preview/index.es.js +21 -20
  31. package/image-preview/index.umd.js +1 -1
  32. package/input/index.es.js +2 -5
  33. package/input/index.umd.js +1 -1
  34. package/layout/index.es.js +6 -21
  35. package/layout/index.umd.js +1 -1
  36. package/loading/index.es.js +20 -12
  37. package/loading/index.umd.js +1 -1
  38. package/modal/index.es.js +135 -122
  39. package/modal/index.umd.js +1 -1
  40. package/modal/style.css +1 -1
  41. package/notification/index.es.js +38 -40
  42. package/notification/index.umd.js +1 -1
  43. package/nuxt/components/DropdownPropsKey.js +3 -0
  44. package/nuxt/components/PanelBody.js +3 -0
  45. package/nuxt/components/PanelFooter.js +3 -0
  46. package/nuxt/components/PanelHeader.js +3 -0
  47. package/nuxt/components/Timeline.js +3 -0
  48. package/nuxt/components/TimelineItem.js +3 -0
  49. package/nuxt/components/alertProps.js +3 -0
  50. package/nuxt/components/autoCompleteProps.js +3 -0
  51. package/nuxt/components/avatarProps.js +3 -0
  52. package/nuxt/components/cardProps.js +3 -0
  53. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  54. package/nuxt/components/checkboxGroupProps.js +3 -0
  55. package/nuxt/components/checkboxProps.js +3 -0
  56. package/nuxt/components/colProps.js +3 -0
  57. package/nuxt/components/colPropsBaseClass.js +3 -0
  58. package/nuxt/components/colPropsBaseStyle.js +3 -0
  59. package/nuxt/components/commentProps.js +3 -0
  60. package/nuxt/components/countdownProps.js +3 -0
  61. package/nuxt/components/editableSelectProps.js +3 -0
  62. package/nuxt/components/fullscreenProps.js +3 -0
  63. package/nuxt/components/iconProps.js +2 -0
  64. package/nuxt/components/imagePreviewProps.js +3 -0
  65. package/nuxt/components/inputProps.js +3 -0
  66. package/nuxt/components/paginationProps.js +3 -0
  67. package/nuxt/components/panelProps.js +3 -0
  68. package/nuxt/components/progressProps.js +3 -0
  69. package/nuxt/components/rateProps.js +3 -0
  70. package/nuxt/components/readTipProps.js +3 -0
  71. package/nuxt/components/resultProps.js +3 -0
  72. package/nuxt/components/rowProps.js +3 -0
  73. package/nuxt/components/screenSizes.js +3 -0
  74. package/nuxt/components/searchProps.js +3 -0
  75. package/nuxt/components/skeletonProps.js +3 -0
  76. package/nuxt/components/splitterProps.js +3 -0
  77. package/nuxt/components/statisticProps.js +3 -0
  78. package/nuxt/components/switchProps.js +3 -0
  79. package/nuxt/components/tagInputProps.js +3 -0
  80. package/nuxt/components/tagProps.js +3 -0
  81. package/nuxt/components/textareaProps.js +3 -0
  82. package/nuxt/components/timeAxisProps.js +3 -0
  83. package/overlay/index.es.js +49 -42
  84. package/overlay/index.umd.js +1 -1
  85. package/overlay/style.css +1 -1
  86. package/package.json +8 -43
  87. package/pagination/index.es.js +24 -25
  88. package/pagination/index.umd.js +1 -1
  89. package/panel/index.es.js +45 -32
  90. package/panel/index.umd.js +1 -1
  91. package/popover/index.es.js +51 -44
  92. package/popover/index.umd.js +12 -12
  93. package/popover/style.css +1 -1
  94. package/progress/index.es.js +34 -36
  95. package/progress/index.umd.js +3 -3
  96. package/progress/style.css +1 -1
  97. package/radio/index.es.js +11 -11
  98. package/radio/index.umd.js +1 -1
  99. package/radio/style.css +1 -1
  100. package/rate/index.es.js +4 -7
  101. package/rate/index.umd.js +1 -1
  102. package/read-tip/index.es.js +8 -8
  103. package/read-tip/index.umd.js +1 -1
  104. package/result/index.es.js +40 -58
  105. package/result/index.umd.js +1 -1
  106. package/ripple/index.es.js +47 -42
  107. package/ripple/index.umd.js +1 -1
  108. package/search/index.es.js +13 -16
  109. package/search/index.umd.js +8 -8
  110. package/skeleton/index.es.js +20 -23
  111. package/skeleton/index.umd.js +1 -1
  112. package/slider/index.es.js +60 -59
  113. package/slider/index.umd.js +1 -1
  114. package/splitter/index.es.js +223 -171
  115. package/splitter/index.umd.js +13 -13
  116. package/splitter/style.css +1 -1
  117. package/statistic/index.es.js +7 -18
  118. package/statistic/index.umd.js +1 -1
  119. package/status/index.es.js +1 -4
  120. package/status/index.umd.js +1 -1
  121. package/status/style.css +1 -1
  122. package/style.css +1 -1
  123. package/switch/index.es.js +3 -6
  124. package/switch/index.umd.js +1 -1
  125. package/tag/index.es.js +15 -18
  126. package/tag/index.umd.js +1 -1
  127. package/tag/style.css +1 -1
  128. package/tag-input/index.es.js +7 -8
  129. package/tag-input/index.umd.js +1 -1
  130. package/textarea/index.es.js +2 -5
  131. package/textarea/index.umd.js +1 -1
  132. package/{accordion → timeline}/index.d.ts +0 -0
  133. package/{time-axis → timeline}/index.es.js +64 -83
  134. package/timeline/index.umd.js +1 -0
  135. package/{anchor → timeline}/package.json +1 -1
  136. package/timeline/style.css +1 -0
  137. package/upload/index.es.js +98 -97
  138. package/upload/index.umd.js +1 -1
  139. package/vue-devui.es.js +12477 -24991
  140. package/vue-devui.umd.js +24 -20
  141. package/accordion/index.es.js +0 -720
  142. package/accordion/index.umd.js +0 -1
  143. package/accordion/package.json +0 -7
  144. package/accordion/style.css +0 -1
  145. package/anchor/index.d.ts +0 -7
  146. package/anchor/index.es.js +0 -263
  147. package/anchor/index.umd.js +0 -1
  148. package/anchor/style.css +0 -1
  149. package/back-top/index.d.ts +0 -7
  150. package/back-top/index.es.js +0 -128
  151. package/back-top/index.umd.js +0 -1
  152. package/back-top/package.json +0 -7
  153. package/back-top/style.css +0 -1
  154. package/breadcrumb/index.d.ts +0 -7
  155. package/breadcrumb/index.es.js +0 -127
  156. package/breadcrumb/index.umd.js +0 -1
  157. package/breadcrumb/package.json +0 -7
  158. package/breadcrumb/style.css +0 -1
  159. package/carousel/index.d.ts +0 -7
  160. package/carousel/index.es.js +0 -329
  161. package/carousel/index.umd.js +0 -1
  162. package/carousel/package.json +0 -7
  163. package/carousel/style.css +0 -1
  164. package/cascader/index.d.ts +0 -7
  165. package/cascader/index.es.js +0 -5963
  166. package/cascader/index.umd.js +0 -27
  167. package/cascader/package.json +0 -7
  168. package/cascader/style.css +0 -1
  169. package/color-picker/index.d.ts +0 -7
  170. package/color-picker/index.es.js +0 -8187
  171. package/color-picker/index.umd.js +0 -27
  172. package/color-picker/package.json +0 -7
  173. package/color-picker/style.css +0 -1
  174. package/date-picker/index.d.ts +0 -7
  175. package/date-picker/index.es.js +0 -1171
  176. package/date-picker/index.umd.js +0 -1
  177. package/date-picker/package.json +0 -7
  178. package/date-picker/style.css +0 -1
  179. package/dragdrop/index.d.ts +0 -7
  180. package/dragdrop/index.es.js +0 -157
  181. package/dragdrop/index.umd.js +0 -1
  182. package/dragdrop/package.json +0 -7
  183. package/drawer/index.d.ts +0 -7
  184. package/drawer/index.es.js +0 -234
  185. package/drawer/index.umd.js +0 -1
  186. package/drawer/package.json +0 -7
  187. package/drawer/style.css +0 -1
  188. package/dropdown/index.d.ts +0 -7
  189. package/dropdown/index.es.js +0 -638
  190. package/dropdown/index.umd.js +0 -1
  191. package/dropdown/package.json +0 -7
  192. package/dropdown/style.css +0 -1
  193. package/form/index.d.ts +0 -7
  194. package/form/index.es.js +0 -7865
  195. package/form/index.umd.js +0 -27
  196. package/form/package.json +0 -7
  197. package/form/style.css +0 -1
  198. package/gantt/index.d.ts +0 -7
  199. package/gantt/index.es.js +0 -523
  200. package/gantt/index.umd.js +0 -1
  201. package/gantt/package.json +0 -7
  202. package/gantt/style.css +0 -1
  203. package/input-icon/index.d.ts +0 -7
  204. package/input-icon/index.es.js +0 -331
  205. package/input-icon/index.umd.js +0 -1
  206. package/input-icon/package.json +0 -7
  207. package/input-icon/style.css +0 -1
  208. package/input-number/index.d.ts +0 -7
  209. package/input-number/index.es.js +0 -240
  210. package/input-number/index.umd.js +0 -1
  211. package/input-number/package.json +0 -7
  212. package/input-number/style.css +0 -1
  213. package/list/index.d.ts +0 -7
  214. package/list/index.es.js +0 -39
  215. package/list/index.umd.js +0 -1
  216. package/list/package.json +0 -7
  217. package/list/style.css +0 -1
  218. package/nav-sprite/index.d.ts +0 -7
  219. package/nav-sprite/index.es.js +0 -68
  220. package/nav-sprite/index.umd.js +0 -1
  221. package/nav-sprite/package.json +0 -7
  222. package/nuxt/components/Accordion.js +0 -3
  223. package/nuxt/components/Anchor.js +0 -3
  224. package/nuxt/components/BackTop.js +0 -3
  225. package/nuxt/components/Breadcrumb.js +0 -3
  226. package/nuxt/components/Carousel.js +0 -3
  227. package/nuxt/components/CarouselItem.js +0 -3
  228. package/nuxt/components/Cascader.js +0 -3
  229. package/nuxt/components/ColorPicker.js +0 -3
  230. package/nuxt/components/Column.js +0 -3
  231. package/nuxt/components/DatePicker.js +0 -3
  232. package/nuxt/components/Drawer.js +0 -3
  233. package/nuxt/components/DrawerService.js +0 -3
  234. package/nuxt/components/Dropdown.js +0 -3
  235. package/nuxt/components/DropdownMenu.js +0 -3
  236. package/nuxt/components/Form.js +0 -3
  237. package/nuxt/components/FormControl.js +0 -3
  238. package/nuxt/components/FormItem.js +0 -3
  239. package/nuxt/components/FormLabel.js +0 -3
  240. package/nuxt/components/FormOperation.js +0 -3
  241. package/nuxt/components/Gantt.js +0 -3
  242. package/nuxt/components/InputIcon.js +0 -3
  243. package/nuxt/components/InputNumber.js +0 -3
  244. package/nuxt/components/List.js +0 -3
  245. package/nuxt/components/ListItem.js +0 -3
  246. package/nuxt/components/NavSprite.js +0 -2
  247. package/nuxt/components/QuadrantDiagram.js +0 -3
  248. package/nuxt/components/Select.js +0 -3
  249. package/nuxt/components/StepsGuide.js +0 -3
  250. package/nuxt/components/StickSlider.js +0 -3
  251. package/nuxt/components/Sticky.js +0 -2
  252. package/nuxt/components/Table.js +0 -3
  253. package/nuxt/components/Tabs.js +0 -3
  254. package/nuxt/components/TimeAxis.js +0 -3
  255. package/nuxt/components/TimeAxisItem.js +0 -3
  256. package/nuxt/components/TimePicker.js +0 -3
  257. package/nuxt/components/Tooltip.js +0 -3
  258. package/nuxt/components/Transfer.js +0 -3
  259. package/nuxt/components/Tree.js +0 -3
  260. package/nuxt/components/TreeSelect.js +0 -3
  261. package/nuxt/components/dropdownMenuProps.js +0 -3
  262. package/nuxt/components/tooltipProps.js +0 -3
  263. package/quadrant-diagram/index.d.ts +0 -7
  264. package/quadrant-diagram/index.es.js +0 -5728
  265. package/quadrant-diagram/index.umd.js +0 -27
  266. package/quadrant-diagram/package.json +0 -7
  267. package/quadrant-diagram/style.css +0 -1
  268. package/select/index.d.ts +0 -7
  269. package/select/index.es.js +0 -706
  270. package/select/index.umd.js +0 -1
  271. package/select/package.json +0 -7
  272. package/select/style.css +0 -1
  273. package/steps-guide/index.d.ts +0 -7
  274. package/steps-guide/index.es.js +0 -239
  275. package/steps-guide/index.umd.js +0 -1
  276. package/steps-guide/package.json +0 -7
  277. package/steps-guide/style.css +0 -1
  278. package/sticky/index.d.ts +0 -7
  279. package/sticky/index.es.js +0 -197
  280. package/sticky/index.umd.js +0 -1
  281. package/sticky/package.json +0 -7
  282. package/table/index.d.ts +0 -7
  283. package/table/index.es.js +0 -1969
  284. package/table/index.umd.js +0 -1
  285. package/table/package.json +0 -7
  286. package/table/style.css +0 -1
  287. package/tabs/index.d.ts +0 -7
  288. package/tabs/index.es.js +0 -194
  289. package/tabs/index.umd.js +0 -1
  290. package/tabs/package.json +0 -7
  291. package/tabs/style.css +0 -1
  292. package/time-axis/index.d.ts +0 -7
  293. package/time-axis/index.umd.js +0 -1
  294. package/time-axis/package.json +0 -7
  295. package/time-axis/style.css +0 -1
  296. package/time-picker/index.d.ts +0 -7
  297. package/time-picker/index.es.js +0 -1237
  298. package/time-picker/index.umd.js +0 -1
  299. package/time-picker/package.json +0 -7
  300. package/time-picker/style.css +0 -1
  301. package/tooltip/index.d.ts +0 -7
  302. package/tooltip/index.es.js +0 -5828
  303. package/tooltip/index.umd.js +0 -27
  304. package/tooltip/package.json +0 -7
  305. package/tooltip/style.css +0 -1
  306. package/transfer/index.d.ts +0 -7
  307. package/transfer/index.es.js +0 -7608
  308. package/transfer/index.umd.js +0 -27
  309. package/transfer/package.json +0 -7
  310. package/transfer/style.css +0 -1
  311. package/tree/index.d.ts +0 -7
  312. package/tree/index.es.js +0 -6490
  313. package/tree/index.umd.js +0 -27
  314. package/tree/package.json +0 -7
  315. package/tree/style.css +0 -1
  316. package/tree-select/index.d.ts +0 -7
  317. package/tree-select/index.es.js +0 -623
  318. package/tree-select/index.umd.js +0 -1
  319. package/tree-select/package.json +0 -7
  320. package/tree-select/style.css +0 -1
@@ -1,706 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, createVNode, inject, computed, mergeProps, toRef, provide, onMounted, onBeforeUnmount, ref, Transition, withDirectives, vShow } from "vue";
21
- const selectProps = {
22
- modelValue: {
23
- type: [String, Number, Array],
24
- default: ""
25
- },
26
- "onUpdate:modelValue": {
27
- type: Function,
28
- default: void 0
29
- },
30
- options: {
31
- type: Array,
32
- default: () => []
33
- },
34
- size: {
35
- type: String,
36
- default: "md"
37
- },
38
- overview: {
39
- type: String,
40
- default: "border"
41
- },
42
- placeholder: {
43
- type: String,
44
- default: "\u8BF7\u9009\u62E9"
45
- },
46
- multiple: {
47
- type: Boolean,
48
- default: false
49
- },
50
- disabled: {
51
- type: Boolean,
52
- default: false
53
- },
54
- allowClear: {
55
- type: Boolean,
56
- default: false
57
- },
58
- optionDisabledKey: {
59
- type: String,
60
- default: ""
61
- },
62
- onToggleChange: {
63
- type: Function,
64
- default: void 0
65
- },
66
- onValueChange: {
67
- type: Function,
68
- default: void 0
69
- }
70
- };
71
- var Icon = defineComponent({
72
- name: "DIcon",
73
- props: {
74
- name: {
75
- type: String,
76
- required: true
77
- },
78
- size: {
79
- type: String,
80
- default: "inherit"
81
- },
82
- color: {
83
- type: String,
84
- default: "inherit"
85
- },
86
- classPrefix: {
87
- type: String,
88
- default: "icon"
89
- }
90
- },
91
- setup(props) {
92
- return __spreadValues({}, props);
93
- },
94
- render() {
95
- const {
96
- name,
97
- size,
98
- color,
99
- classPrefix
100
- } = this;
101
- return /^((https?):)?\/\//.test(name) ? createVNode("img", {
102
- "src": name,
103
- "alt": name.split("/")[name.split("/").length - 1],
104
- "style": {
105
- width: size,
106
- verticalAlign: "text-bottom"
107
- }
108
- }, null) : createVNode("i", {
109
- "class": `${classPrefix} ${classPrefix}-${name}`,
110
- "style": {
111
- fontSize: size,
112
- color
113
- }
114
- }, null);
115
- }
116
- });
117
- Icon.install = function(app) {
118
- app.component(Icon.name, Icon);
119
- };
120
- var checkbox = "";
121
- const commonProps = {
122
- name: {
123
- type: String,
124
- default: void 0
125
- },
126
- halfchecked: {
127
- type: Boolean,
128
- default: false
129
- },
130
- isShowTitle: {
131
- type: Boolean,
132
- default: true
133
- },
134
- title: {
135
- type: String
136
- },
137
- color: {
138
- type: String,
139
- default: void 0
140
- },
141
- showAnimation: {
142
- type: Boolean,
143
- default: true
144
- },
145
- disabled: {
146
- type: Boolean,
147
- default: false
148
- },
149
- beforeChange: {
150
- type: Function,
151
- default: void 0
152
- }
153
- };
154
- const checkboxProps = __spreadProps(__spreadValues({}, commonProps), {
155
- halfchecked: {
156
- type: Boolean,
157
- default: false
158
- },
159
- checked: {
160
- type: Boolean,
161
- default: false
162
- },
163
- value: {
164
- type: String
165
- },
166
- label: {
167
- type: String,
168
- default: void 0
169
- },
170
- title: {
171
- type: String,
172
- default: void 0
173
- },
174
- "onUpdate:checked": {
175
- type: Function,
176
- default: void 0
177
- },
178
- onChange: {
179
- type: Function,
180
- default: void 0
181
- },
182
- modelValue: {
183
- type: Boolean
184
- },
185
- "onUpdate:modelValue": {
186
- type: Function
187
- }
188
- });
189
- const checkboxGroupProps = __spreadProps(__spreadValues({}, commonProps), {
190
- modelValue: {
191
- type: Array,
192
- required: true
193
- },
194
- direction: {
195
- type: String,
196
- default: "column"
197
- },
198
- itemWidth: {
199
- type: Number,
200
- default: void 0
201
- },
202
- options: {
203
- type: Array,
204
- default: () => []
205
- },
206
- onChange: {
207
- type: Function,
208
- default: void 0
209
- },
210
- "onUpdate:modelValue": {
211
- type: Function,
212
- default: void 0
213
- }
214
- });
215
- const checkboxGroupInjectionKey = Symbol("d-checkbox-group");
216
- var Checkbox = defineComponent({
217
- name: "DCheckbox",
218
- props: checkboxProps,
219
- emits: ["change", "update:checked", "update:modelValue"],
220
- setup(props, ctx) {
221
- const checkboxGroupConf = inject(checkboxGroupInjectionKey, null);
222
- const isChecked = computed(() => props.checked || props.modelValue);
223
- const mergedDisabled = computed(() => {
224
- return (checkboxGroupConf == null ? void 0 : checkboxGroupConf.disabled.value) || props.disabled;
225
- });
226
- const mergedChecked = computed(() => {
227
- var _a, _b;
228
- return (_b = (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isItemChecked) == null ? void 0 : _a.call(checkboxGroupConf, props.value)) != null ? _b : isChecked.value;
229
- });
230
- const mergedIsShowTitle = computed(() => {
231
- var _a;
232
- return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isShowTitle.value) != null ? _a : props.isShowTitle;
233
- });
234
- const mergedShowAnimation = computed(() => {
235
- var _a;
236
- return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.showAnimation.value) != null ? _a : props.showAnimation;
237
- });
238
- const mergedColor = computed(() => {
239
- var _a;
240
- return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.color.value) != null ? _a : props.color;
241
- });
242
- const itemWidth = checkboxGroupConf == null ? void 0 : checkboxGroupConf.itemWidth.value;
243
- const direction = checkboxGroupConf == null ? void 0 : checkboxGroupConf.direction.value;
244
- const canChange = (isChecked2, val) => {
245
- var _a;
246
- if (mergedDisabled.value) {
247
- return Promise.resolve(false);
248
- }
249
- const beforeChange = (_a = props.beforeChange) != null ? _a : checkboxGroupConf == null ? void 0 : checkboxGroupConf.beforeChange;
250
- if (beforeChange) {
251
- const res = beforeChange(isChecked2, val);
252
- if (typeof res === "boolean") {
253
- return Promise.resolve(res);
254
- }
255
- return res;
256
- }
257
- return Promise.resolve(true);
258
- };
259
- const toggle = () => {
260
- const current = !isChecked.value;
261
- checkboxGroupConf == null ? void 0 : checkboxGroupConf.toggleGroupVal(props.value);
262
- ctx.emit("update:checked", current);
263
- ctx.emit("update:modelValue", current);
264
- ctx.emit("change", current);
265
- };
266
- const handleClick = () => {
267
- canChange(!isChecked.value, props.label).then((res) => res && toggle());
268
- };
269
- return {
270
- itemWidth,
271
- direction,
272
- mergedColor,
273
- mergedDisabled,
274
- mergedIsShowTitle,
275
- mergedChecked,
276
- mergedShowAnimation,
277
- handleClick
278
- };
279
- },
280
- render() {
281
- var _a;
282
- const {
283
- itemWidth,
284
- direction,
285
- mergedChecked,
286
- mergedDisabled,
287
- mergedIsShowTitle,
288
- mergedShowAnimation,
289
- halfchecked,
290
- title,
291
- label,
292
- handleClick,
293
- name,
294
- value,
295
- mergedColor,
296
- $slots
297
- } = this;
298
- const wrapperCls = {
299
- "devui-checkbox-column-margin": direction === "column",
300
- "devui-checkbox-wrap": typeof itemWidth !== "undefined"
301
- };
302
- const wrapperStyle = itemWidth ? [`width: ${itemWidth}px`] : [];
303
- const checkboxCls = {
304
- "devui-checkbox": true,
305
- active: mergedChecked,
306
- halfchecked,
307
- disabled: mergedDisabled,
308
- unchecked: !mergedChecked
309
- };
310
- const labelTitle = mergedIsShowTitle ? title || label : "";
311
- const bgImgStyle = mergedColor && halfchecked || mergedColor ? `linear-gradient(${mergedColor}, ${mergedColor})` : "";
312
- const spanStyle = [`border-color:${(mergedChecked || halfchecked) && mergedColor ? mergedColor : ""}`, `background-image:${bgImgStyle}`, `background-color:${mergedColor && halfchecked ? mergedColor : ""}`];
313
- const spanCls = {
314
- "devui-checkbox-material": true,
315
- "custom-color": mergedColor,
316
- "devui-checkbox-no-label": !label && !$slots.default,
317
- "devui-no-animation": !mergedShowAnimation,
318
- "devui-checkbox-default-background": !halfchecked
319
- };
320
- const polygonCls = {
321
- "devui-tick": true,
322
- "devui-no-animation": !mergedShowAnimation
323
- };
324
- const stopPropagation = ($event) => $event.stopPropagation();
325
- const inputProps = {
326
- indeterminate: halfchecked
327
- };
328
- return createVNode("div", {
329
- "class": wrapperCls,
330
- "style": wrapperStyle
331
- }, [createVNode("div", {
332
- "class": checkboxCls
333
- }, [createVNode("label", {
334
- "title": labelTitle,
335
- "onClick": handleClick
336
- }, [createVNode("input", mergeProps({
337
- "name": name || value,
338
- "class": "devui-checkbox-input",
339
- "type": "checkbox"
340
- }, inputProps, {
341
- "checked": mergedChecked,
342
- "disabled": mergedDisabled,
343
- "onClick": stopPropagation,
344
- "onChange": stopPropagation
345
- }), null), createVNode("span", {
346
- "style": spanStyle,
347
- "class": spanCls
348
- }, [createVNode("span", {
349
- "class": "devui-checkbox-halfchecked-bg"
350
- }, null), createVNode("svg", {
351
- "viewBox": "0 0 16 16",
352
- "version": "1.1",
353
- "xmlns": "http://www.w3.org/2000/svg",
354
- "class": "devui-checkbox-tick"
355
- }, [createVNode("g", {
356
- "stroke": "none",
357
- "stroke-width": "1",
358
- "fill": "none",
359
- "fill-rule": "evenodd"
360
- }, [createVNode("polygon", {
361
- "fill-rule": "nonzero",
362
- "points": "5.17391304 6.56521739 7.7173913 9.10869565 11.826087 5 13 6.17391304 7.7173913 11.4565217 4 7.73913043",
363
- "class": polygonCls
364
- }, null)])])]), label || ((_a = $slots.default) == null ? void 0 : _a.call($slots))])])]);
365
- }
366
- });
367
- var checkboxGroup = "";
368
- var CheckboxGroup = defineComponent({
369
- name: "DCheckboxGroup",
370
- props: checkboxGroupProps,
371
- emits: ["change", "update:modelValue"],
372
- setup(props, ctx) {
373
- const valList = toRef(props, "modelValue");
374
- const defaultOpt = {
375
- checked: false,
376
- isShowTitle: true,
377
- halfchecked: false,
378
- showAnimation: true,
379
- disabled: false
380
- };
381
- const toggleGroupVal = (val) => {
382
- let index2 = -1;
383
- if (typeof valList.value[0] === "string") {
384
- index2 = valList.value.findIndex((item) => item === val);
385
- } else if (typeof valList.value[0] === "object") {
386
- index2 = valList.value.findIndex((item) => item.value === val);
387
- }
388
- if (index2 === -1) {
389
- if (typeof props.options[0] === "object") {
390
- const newOne = props.options.find((item) => item.value === val);
391
- const res2 = [...valList.value, newOne];
392
- ctx.emit("update:modelValue", res2);
393
- ctx.emit("change", res2);
394
- return;
395
- }
396
- const res = [...valList.value, val];
397
- ctx.emit("update:modelValue", res);
398
- ctx.emit("change", res);
399
- return;
400
- }
401
- valList.value.splice(index2, 1);
402
- ctx.emit("update:modelValue", valList.value);
403
- ctx.emit("change", valList.value);
404
- };
405
- const isItemChecked = (itemVal) => {
406
- if (typeof valList.value[0] === "string") {
407
- return valList.value.includes(itemVal);
408
- } else if (typeof valList.value[0] === "object") {
409
- return valList.value.some((item) => item.value === itemVal);
410
- }
411
- };
412
- provide(checkboxGroupInjectionKey, {
413
- disabled: toRef(props, "disabled"),
414
- isShowTitle: toRef(props, "isShowTitle"),
415
- color: toRef(props, "color"),
416
- showAnimation: toRef(props, "showAnimation"),
417
- beforeChange: props.beforeChange,
418
- isItemChecked,
419
- toggleGroupVal,
420
- itemWidth: toRef(props, "itemWidth"),
421
- direction: toRef(props, "direction")
422
- });
423
- return {
424
- defaultOpt
425
- };
426
- },
427
- render() {
428
- var _a;
429
- const {
430
- direction,
431
- $slots,
432
- defaultOpt,
433
- options
434
- } = this;
435
- let children = (_a = $slots.default) == null ? void 0 : _a.call($slots);
436
- if ((options == null ? void 0 : options.length) > 0) {
437
- children = options.map((opt) => {
438
- let mergedOpt = null;
439
- if (typeof opt === "string") {
440
- mergedOpt = Object.assign({}, defaultOpt, {
441
- label: opt,
442
- value: opt
443
- });
444
- } else if (typeof opt === "object") {
445
- mergedOpt = Object.assign({}, defaultOpt, __spreadProps(__spreadValues({}, opt), {
446
- label: opt.name
447
- }));
448
- }
449
- return createVNode(Checkbox, mergedOpt, null);
450
- });
451
- }
452
- return createVNode("div", {
453
- "class": "devui-checkbox-group"
454
- }, [createVNode("div", {
455
- "class": {
456
- "devui-checkbox-list-inline": direction === "row"
457
- }
458
- }, [children])]);
459
- }
460
- });
461
- Checkbox.install = function(app) {
462
- app.component(Checkbox.name, Checkbox);
463
- };
464
- CheckboxGroup.install = function(app) {
465
- app.component(CheckboxGroup.name, CheckboxGroup);
466
- };
467
- function className(classStr, classOpt) {
468
- let classname = classStr;
469
- if (typeof classOpt === "object") {
470
- Object.keys(classOpt).forEach((key) => {
471
- classOpt[key] && (classname += ` ${key}`);
472
- });
473
- }
474
- return classname;
475
- }
476
- function useCacheOptions(mergeOptions) {
477
- const cacheOptions = computed(() => {
478
- const map = /* @__PURE__ */ new Map();
479
- mergeOptions.value.forEach((item) => {
480
- map.set(item.value, item);
481
- });
482
- return map;
483
- });
484
- const getValuesOption = (values) => values.map((value) => cacheOptions.value.get(value));
485
- return getValuesOption;
486
- }
487
- function useSelectOutsideClick(refs, isOpen, toggleChange) {
488
- function onGlobalMouseDown(e) {
489
- var _a, _b;
490
- let target = e.target;
491
- if (target.shadowRoot && e.composed) {
492
- target = e.composedPath()[0] || target;
493
- }
494
- const element = [(_a = refs[0]) == null ? void 0 : _a.value, (_b = refs[1]) == null ? void 0 : _b.value];
495
- if (isOpen.value && element.every((el) => el && !el.contains(target) && el !== target)) {
496
- toggleChange(false);
497
- }
498
- }
499
- onMounted(() => {
500
- document.body.addEventListener("mousedown", onGlobalMouseDown, false);
501
- });
502
- onBeforeUnmount(() => {
503
- document.body.addEventListener("mousedown", onGlobalMouseDown, false);
504
- });
505
- }
506
- var select = "";
507
- var Select = defineComponent({
508
- name: "DSelect",
509
- props: selectProps,
510
- emits: ["toggleChange", "valueChange", "update:modelValue"],
511
- setup(props, ctx) {
512
- const containerRef = ref(null);
513
- const dropdownRef = ref(null);
514
- const isOpen = ref(false);
515
- function toggleChange(bool) {
516
- if (props.disabled)
517
- return;
518
- isOpen.value = bool;
519
- ctx.emit("toggleChange", bool);
520
- }
521
- useSelectOutsideClick([containerRef, dropdownRef], isOpen, toggleChange);
522
- const mergeOptions = computed(() => {
523
- const {
524
- multiple,
525
- modelValue
526
- } = props;
527
- return props.options.map((item) => {
528
- let option;
529
- if (typeof item === "object") {
530
- option = __spreadValues({
531
- name: item.name ? item.name : item.value + "",
532
- value: item.value,
533
- _checked: false
534
- }, item);
535
- } else {
536
- option = {
537
- name: item + "",
538
- value: item,
539
- _checked: false
540
- };
541
- }
542
- if (multiple) {
543
- if (Array.isArray(modelValue)) {
544
- option._checked = modelValue.includes(option.value);
545
- } else {
546
- option._checked = false;
547
- }
548
- }
549
- return option;
550
- });
551
- });
552
- const getValuesOption = useCacheOptions(mergeOptions);
553
- const inputValue = computed(() => {
554
- var _a;
555
- if (props.multiple && Array.isArray(props.modelValue)) {
556
- const selectedOptions = getValuesOption(props.modelValue);
557
- return selectedOptions.map((item) => item.name).join(",");
558
- } else if (!Array.isArray(props.modelValue)) {
559
- return ((_a = getValuesOption([props.modelValue])[0]) == null ? void 0 : _a.name) || "";
560
- }
561
- return "";
562
- });
563
- const mergeClearable = computed(() => {
564
- return !props.disabled && props.allowClear && inputValue.value.length > 0;
565
- });
566
- function valueChange(item, index2) {
567
- const {
568
- multiple,
569
- optionDisabledKey: disabledKey
570
- } = props;
571
- let {
572
- modelValue
573
- } = props;
574
- if (disabledKey && !!item[disabledKey])
575
- return;
576
- if (multiple) {
577
- item._checked = !item._checked;
578
- modelValue = mergeOptions.value.filter((item2) => item2._checked).map((item2) => item2.value);
579
- ctx.emit("update:modelValue", modelValue);
580
- } else {
581
- ctx.emit("update:modelValue", item.value);
582
- toggleChange(false);
583
- }
584
- ctx.emit("valueChange", item, index2);
585
- }
586
- function getItemClassName(item) {
587
- const {
588
- optionDisabledKey: disabledKey
589
- } = props;
590
- return className("devui-select-item", {
591
- active: item.value === props.modelValue,
592
- disabled: disabledKey ? !!item[disabledKey] : false
593
- });
594
- }
595
- function handleClear(e) {
596
- e.preventDefault();
597
- e.stopPropagation();
598
- if (props.multiple) {
599
- ctx.emit("update:modelValue", []);
600
- } else {
601
- ctx.emit("update:modelValue", "");
602
- }
603
- }
604
- return {
605
- isOpen,
606
- containerRef,
607
- dropdownRef,
608
- inputValue,
609
- mergeOptions,
610
- mergeClearable,
611
- valueChange,
612
- toggleChange,
613
- getItemClassName,
614
- handleClear
615
- };
616
- },
617
- render() {
618
- const {
619
- mergeOptions,
620
- isOpen,
621
- inputValue,
622
- size,
623
- multiple,
624
- disabled,
625
- optionDisabledKey: disabledKey,
626
- placeholder,
627
- overview,
628
- valueChange,
629
- toggleChange,
630
- getItemClassName,
631
- mergeClearable,
632
- handleClear
633
- } = this;
634
- const selectCls = className("devui-select", {
635
- "devui-select-open": isOpen,
636
- "devui-dropdown-menu-multiple": multiple,
637
- "devui-select-lg": size === "lg",
638
- "devui-select-sm": size === "sm",
639
- "devui-select-underlined": overview === "underlined",
640
- "devui-select-disabled": disabled
641
- });
642
- const inputCls = className("devui-select-input", {
643
- "devui-select-input-lg": size === "lg",
644
- "devui-select-input-sm": size === "sm"
645
- });
646
- const selectionCls = className("devui-select-selection", {
647
- "devui-select-clearable": mergeClearable
648
- });
649
- return createVNode("div", {
650
- "class": selectCls,
651
- "ref": "containerRef"
652
- }, [createVNode("div", {
653
- "class": selectionCls,
654
- "onClick": () => toggleChange(!isOpen)
655
- }, [createVNode("input", {
656
- "value": inputValue,
657
- "type": "text",
658
- "class": inputCls,
659
- "placeholder": placeholder,
660
- "readonly": true,
661
- "disabled": disabled
662
- }, null), createVNode("span", {
663
- "onClick": handleClear,
664
- "class": "devui-select-clear"
665
- }, [createVNode(Icon, {
666
- "name": "close"
667
- }, null)]), createVNode("span", {
668
- "class": "devui-select-arrow"
669
- }, [createVNode(Icon, {
670
- "name": "select-arrow"
671
- }, null)])]), createVNode(Transition, {
672
- "name": "fade",
673
- "ref": "dropdownRef"
674
- }, {
675
- default: () => [withDirectives(createVNode("div", {
676
- "class": "devui-select-dropdown"
677
- }, [createVNode("ul", {
678
- "class": "devui-select-dropdown-list devui-scrollbar"
679
- }, [mergeOptions.map((item, i) => createVNode("li", {
680
- "onClick": (e) => {
681
- e.preventDefault();
682
- e.stopPropagation();
683
- valueChange(item, i);
684
- },
685
- "class": getItemClassName(item),
686
- "key": i
687
- }, [multiple ? createVNode(Checkbox, {
688
- "modelValue": item._checked,
689
- "label": item.name,
690
- "disabled": disabledKey ? !!item[disabledKey] : false
691
- }, null) : item.name]))])]), [[vShow, isOpen]])]
692
- })]);
693
- }
694
- });
695
- Select.install = function(app) {
696
- app.component(Select.name, Select);
697
- };
698
- var index = {
699
- title: "Select \u4E0B\u62C9\u6846",
700
- category: "\u6570\u636E\u5F55\u5165",
701
- status: "10%",
702
- install(app) {
703
- app.use(Select);
704
- }
705
- };
706
- export { Select, index as default };