vue-devui 1.0.0-rc.1 → 1.0.0-rc.10

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 (328) hide show
  1. package/README.md +149 -200
  2. package/alert/index.es.js +46 -15
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8166 -287
  6. package/auto-complete/index.umd.js +29 -1
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +153 -146
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +29 -4
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5726 -111
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +59 -35
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +8060 -255
  21. package/checkbox/index.umd.js +27 -1
  22. package/checkbox/style.css +1 -1
  23. package/{accordion → collapse}/index.d.ts +0 -0
  24. package/collapse/index.es.js +379 -0
  25. package/collapse/index.umd.js +1 -0
  26. package/{anchor → collapse}/package.json +1 -1
  27. package/collapse/style.css +1 -0
  28. package/countdown/index.es.js +3 -6
  29. package/countdown/index.umd.js +1 -1
  30. package/date-picker/index.es.js +8130 -242
  31. package/date-picker/index.umd.js +27 -1
  32. package/date-picker/style.css +1 -1
  33. package/drawer/index.es.js +31 -4
  34. package/drawer/index.umd.js +1 -1
  35. package/drawer/style.css +1 -1
  36. package/dropdown/index.es.js +209 -148
  37. package/dropdown/index.umd.js +1 -1
  38. package/dropdown/style.css +1 -1
  39. package/editable-select/index.es.js +521 -153
  40. package/editable-select/index.umd.js +1 -1
  41. package/editable-select/style.css +1 -1
  42. package/form/index.es.js +1040 -1187
  43. package/form/index.umd.js +16 -16
  44. package/form/style.css +1 -1
  45. package/fullscreen/index.es.js +29 -5
  46. package/fullscreen/index.umd.js +1 -1
  47. package/fullscreen/style.css +1 -1
  48. package/grid/index.es.js +101 -86
  49. package/grid/index.umd.js +1 -1
  50. package/grid/style.css +1 -1
  51. package/icon/index.es.js +182 -23
  52. package/icon/index.umd.js +1 -1
  53. package/icon/style.css +1 -0
  54. package/image-preview/index.es.js +53 -30
  55. package/image-preview/index.umd.js +1 -1
  56. package/image-preview/style.css +1 -1
  57. package/input/index.es.js +8066 -144
  58. package/input/index.umd.js +27 -1
  59. package/input/style.css +1 -1
  60. package/input-number/index.es.js +274 -177
  61. package/input-number/index.umd.js +1 -1
  62. package/input-number/style.css +1 -1
  63. package/layout/index.es.js +40 -25
  64. package/layout/index.umd.js +1 -1
  65. package/layout/style.css +1 -1
  66. package/loading/index.es.js +74 -35
  67. package/loading/index.umd.js +1 -1
  68. package/loading/style.css +1 -1
  69. package/modal/index.es.js +374 -171
  70. package/modal/index.umd.js +1 -1
  71. package/modal/style.css +1 -1
  72. package/notification/index.es.js +292 -40
  73. package/notification/index.umd.js +1 -1
  74. package/notification/style.css +1 -1
  75. package/nuxt/components/ButtonGroup.js +3 -0
  76. package/nuxt/components/CheckboxButton.js +3 -0
  77. package/nuxt/components/CheckboxGroup.js +3 -0
  78. package/nuxt/components/Collapse.js +3 -0
  79. package/nuxt/components/CollapseItem.js +3 -0
  80. package/nuxt/components/DropdownPropsKey.js +3 -0
  81. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  82. package/nuxt/components/FORM_TOKEN.js +3 -0
  83. package/nuxt/components/Icon.js +1 -0
  84. package/nuxt/components/IconGroup.js +3 -0
  85. package/nuxt/components/LABEL_DATA.js +3 -0
  86. package/nuxt/components/LoadingOptions.js +3 -0
  87. package/nuxt/components/Option.js +3 -0
  88. package/nuxt/components/RadioButton.js +3 -0
  89. package/nuxt/components/Tab.js +3 -0
  90. package/nuxt/components/autoCompleteProps.js +3 -0
  91. package/nuxt/components/avatarProps.js +3 -0
  92. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  93. package/nuxt/components/buttonGroupProps.js +3 -0
  94. package/nuxt/components/cardProps.js +3 -0
  95. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  96. package/nuxt/components/checkboxGroupProps.js +3 -0
  97. package/nuxt/components/checkboxProps.js +3 -0
  98. package/nuxt/components/colProps.js +3 -0
  99. package/nuxt/components/colPropsBaseClass.js +3 -0
  100. package/nuxt/components/colPropsBaseStyle.js +3 -0
  101. package/nuxt/components/collapseItemProps.js +3 -0
  102. package/nuxt/components/collapseProps.js +3 -0
  103. package/nuxt/components/countdownProps.js +3 -0
  104. package/nuxt/components/editableSelectProps.js +3 -0
  105. package/nuxt/components/formItemProps.js +3 -0
  106. package/nuxt/components/formProps.js +3 -0
  107. package/nuxt/components/iconProps.js +1 -0
  108. package/nuxt/components/imagePreviewProps.js +3 -0
  109. package/nuxt/components/inputProps.js +3 -0
  110. package/nuxt/components/loadingProps.js +3 -0
  111. package/nuxt/components/modalProps.js +3 -0
  112. package/nuxt/components/progressProps.js +3 -0
  113. package/nuxt/components/rateProps.js +3 -0
  114. package/nuxt/components/resultProps.js +3 -0
  115. package/nuxt/components/rowProps.js +3 -0
  116. package/nuxt/components/screenSizes.js +3 -0
  117. package/nuxt/components/skeletonProps.js +3 -0
  118. package/nuxt/components/sliderProps.js +3 -0
  119. package/nuxt/components/splitterProps.js +3 -0
  120. package/nuxt/components/statisticProps.js +3 -0
  121. package/nuxt/components/svgIconProps.js +3 -0
  122. package/nuxt/components/switchProps.js +3 -0
  123. package/nuxt/components/tabsProps.js +3 -0
  124. package/nuxt/components/tagProps.js +3 -0
  125. package/nuxt/components/textareaProps.js +3 -0
  126. package/nuxt/components/timeAxisProps.js +3 -0
  127. package/nuxt/components/treeProps.js +3 -0
  128. package/overlay/index.es.js +104 -133
  129. package/overlay/index.umd.js +1 -1
  130. package/overlay/style.css +1 -1
  131. package/package.json +3 -2
  132. package/pagination/index.es.js +148 -136
  133. package/pagination/index.umd.js +1 -1
  134. package/pagination/style.css +1 -1
  135. package/panel/style.css +1 -1
  136. package/popover/index.es.js +294 -230
  137. package/popover/index.umd.js +15 -15
  138. package/popover/style.css +1 -1
  139. package/progress/index.es.js +110 -56
  140. package/progress/index.umd.js +3 -3
  141. package/progress/style.css +1 -1
  142. package/radio/index.es.js +7959 -146
  143. package/radio/index.umd.js +27 -1
  144. package/radio/style.css +1 -1
  145. package/rate/index.es.js +77 -55
  146. package/rate/index.umd.js +1 -1
  147. package/rate/style.css +1 -1
  148. package/result/index.es.js +169 -27
  149. package/result/index.umd.js +1 -1
  150. package/result/style.css +1 -1
  151. package/ripple/index.es.js +43 -42
  152. package/ripple/index.umd.js +1 -1
  153. package/search/index.es.js +3620 -1095
  154. package/search/index.umd.js +18 -18
  155. package/search/style.css +1 -1
  156. package/select/index.es.js +9131 -584
  157. package/select/index.umd.js +27 -1
  158. package/select/style.css +1 -1
  159. package/skeleton/index.es.js +46 -24
  160. package/skeleton/index.umd.js +1 -1
  161. package/skeleton/style.css +1 -1
  162. package/slider/index.es.js +108 -75
  163. package/slider/index.umd.js +1 -1
  164. package/slider/style.css +1 -1
  165. package/splitter/index.es.js +443 -335
  166. package/splitter/index.umd.js +15 -15
  167. package/splitter/style.css +1 -1
  168. package/statistic/index.es.js +7 -18
  169. package/statistic/index.umd.js +1 -1
  170. package/status/index.es.js +26 -2
  171. package/status/index.umd.js +1 -1
  172. package/status/style.css +1 -1
  173. package/style.css +1 -1
  174. package/switch/index.es.js +7794 -64
  175. package/switch/index.umd.js +27 -1
  176. package/switch/style.css +1 -1
  177. package/table/index.es.js +10038 -1180
  178. package/table/index.umd.js +27 -1
  179. package/table/style.css +1 -1
  180. package/tabs/index.es.js +342 -141
  181. package/tabs/index.umd.js +1 -1
  182. package/tabs/style.css +1 -1
  183. package/tag/index.es.js +47 -23
  184. package/tag/index.umd.js +1 -1
  185. package/tag/style.css +1 -1
  186. package/textarea/index.es.js +7913 -83
  187. package/textarea/index.umd.js +35 -1
  188. package/textarea/style.css +1 -1
  189. package/timeline/index.es.js +176 -37
  190. package/timeline/index.umd.js +1 -1
  191. package/timeline/style.css +1 -1
  192. package/tooltip/index.es.js +285 -220
  193. package/tooltip/index.umd.js +15 -15
  194. package/tooltip/style.css +1 -1
  195. package/tree/index.es.js +4190 -1857
  196. package/tree/index.umd.js +18 -18
  197. package/tree/style.css +1 -1
  198. package/upload/index.es.js +365 -106
  199. package/upload/index.umd.js +1 -1
  200. package/upload/style.css +1 -1
  201. package/vue-devui.es.js +20102 -25264
  202. package/vue-devui.umd.js +25 -15
  203. package/accordion/index.es.js +0 -723
  204. package/accordion/index.umd.js +0 -1
  205. package/accordion/package.json +0 -7
  206. package/accordion/style.css +0 -1
  207. package/anchor/index.d.ts +0 -7
  208. package/anchor/index.es.js +0 -263
  209. package/anchor/index.umd.js +0 -1
  210. package/anchor/style.css +0 -1
  211. package/back-top/index.d.ts +0 -7
  212. package/back-top/index.es.js +0 -130
  213. package/back-top/index.umd.js +0 -1
  214. package/back-top/package.json +0 -7
  215. package/back-top/style.css +0 -1
  216. package/breadcrumb/index.d.ts +0 -7
  217. package/breadcrumb/index.es.js +0 -128
  218. package/breadcrumb/index.umd.js +0 -1
  219. package/breadcrumb/package.json +0 -7
  220. package/breadcrumb/style.css +0 -1
  221. package/carousel/index.d.ts +0 -7
  222. package/carousel/index.es.js +0 -314
  223. package/carousel/index.umd.js +0 -1
  224. package/carousel/package.json +0 -7
  225. package/carousel/style.css +0 -1
  226. package/cascader/index.d.ts +0 -7
  227. package/cascader/index.es.js +0 -5971
  228. package/cascader/index.umd.js +0 -27
  229. package/cascader/package.json +0 -7
  230. package/cascader/style.css +0 -1
  231. package/color-picker/index.d.ts +0 -7
  232. package/color-picker/index.es.js +0 -8196
  233. package/color-picker/index.umd.js +0 -27
  234. package/color-picker/package.json +0 -7
  235. package/color-picker/style.css +0 -1
  236. package/comment/index.d.ts +0 -7
  237. package/comment/index.es.js +0 -86
  238. package/comment/index.umd.js +0 -1
  239. package/comment/package.json +0 -7
  240. package/comment/style.css +0 -1
  241. package/dragdrop/index.d.ts +0 -7
  242. package/dragdrop/index.es.js +0 -157
  243. package/dragdrop/index.umd.js +0 -1
  244. package/dragdrop/package.json +0 -7
  245. package/gantt/index.d.ts +0 -7
  246. package/gantt/index.es.js +0 -523
  247. package/gantt/index.umd.js +0 -1
  248. package/gantt/package.json +0 -7
  249. package/gantt/style.css +0 -1
  250. package/input-icon/index.d.ts +0 -7
  251. package/input-icon/index.es.js +0 -332
  252. package/input-icon/index.umd.js +0 -1
  253. package/input-icon/package.json +0 -7
  254. package/input-icon/style.css +0 -1
  255. package/list/index.d.ts +0 -7
  256. package/list/index.es.js +0 -39
  257. package/list/index.umd.js +0 -1
  258. package/list/package.json +0 -7
  259. package/list/style.css +0 -1
  260. package/nav-sprite/index.d.ts +0 -7
  261. package/nav-sprite/index.es.js +0 -68
  262. package/nav-sprite/index.umd.js +0 -1
  263. package/nav-sprite/package.json +0 -7
  264. package/nuxt/components/Accordion.js +0 -3
  265. package/nuxt/components/Anchor.js +0 -3
  266. package/nuxt/components/BackTop.js +0 -3
  267. package/nuxt/components/Breadcrumb.js +0 -3
  268. package/nuxt/components/Carousel.js +0 -3
  269. package/nuxt/components/CarouselItem.js +0 -3
  270. package/nuxt/components/Cascader.js +0 -3
  271. package/nuxt/components/ColorPicker.js +0 -3
  272. package/nuxt/components/Comment.js +0 -3
  273. package/nuxt/components/FormControl.js +0 -3
  274. package/nuxt/components/FormLabel.js +0 -3
  275. package/nuxt/components/Gantt.js +0 -3
  276. package/nuxt/components/InputIcon.js +0 -3
  277. package/nuxt/components/List.js +0 -3
  278. package/nuxt/components/ListItem.js +0 -3
  279. package/nuxt/components/NavSprite.js +0 -2
  280. package/nuxt/components/QuadrantDiagram.js +0 -3
  281. package/nuxt/components/ReadTip.js +0 -3
  282. package/nuxt/components/StepsGuide.js +0 -3
  283. package/nuxt/components/Sticky.js +0 -2
  284. package/nuxt/components/TagInput.js +0 -3
  285. package/nuxt/components/TimePicker.js +0 -3
  286. package/nuxt/components/Transfer.js +0 -3
  287. package/nuxt/components/TreeSelect.js +0 -3
  288. package/nuxt/components/overlayEmits.js +0 -3
  289. package/nuxt/components/overlayProps.js +0 -3
  290. package/quadrant-diagram/index.d.ts +0 -7
  291. package/quadrant-diagram/index.es.js +0 -5728
  292. package/quadrant-diagram/index.umd.js +0 -27
  293. package/quadrant-diagram/package.json +0 -7
  294. package/quadrant-diagram/style.css +0 -1
  295. package/read-tip/index.d.ts +0 -7
  296. package/read-tip/index.es.js +0 -261
  297. package/read-tip/index.umd.js +0 -1
  298. package/read-tip/package.json +0 -7
  299. package/read-tip/style.css +0 -1
  300. package/steps-guide/index.d.ts +0 -7
  301. package/steps-guide/index.es.js +0 -242
  302. package/steps-guide/index.umd.js +0 -1
  303. package/steps-guide/package.json +0 -7
  304. package/steps-guide/style.css +0 -1
  305. package/sticky/index.d.ts +0 -7
  306. package/sticky/index.es.js +0 -197
  307. package/sticky/index.umd.js +0 -1
  308. package/sticky/package.json +0 -7
  309. package/tag-input/index.d.ts +0 -7
  310. package/tag-input/index.es.js +0 -331
  311. package/tag-input/index.umd.js +0 -1
  312. package/tag-input/package.json +0 -7
  313. package/tag-input/style.css +0 -1
  314. package/time-picker/index.d.ts +0 -7
  315. package/time-picker/index.es.js +0 -1238
  316. package/time-picker/index.umd.js +0 -1
  317. package/time-picker/package.json +0 -7
  318. package/time-picker/style.css +0 -1
  319. package/transfer/index.d.ts +0 -7
  320. package/transfer/index.es.js +0 -7615
  321. package/transfer/index.umd.js +0 -27
  322. package/transfer/package.json +0 -7
  323. package/transfer/style.css +0 -1
  324. package/tree-select/index.d.ts +0 -7
  325. package/tree-select/index.es.js +0 -627
  326. package/tree-select/index.umd.js +0 -1
  327. package/tree-select/package.json +0 -7
  328. package/tree-select/style.css +0 -1
@@ -1,7 +0,0 @@
1
- import { App } from 'vue';
2
- declare function install(app: App): void
3
- declare const _default: {
4
- install: typeof install;
5
- version: string;
6
- };
7
- export default _default;
@@ -1,627 +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 { ref, computed, defineComponent, inject, createVNode, mergeProps, toRefs, withDirectives, resolveComponent, createTextVNode, Transition, Fragment, vShow, resolveDirective } from "vue";
21
- var treeSelect = "";
22
- const treeSelectProps = {
23
- modelValue: {
24
- type: [String, Number, Array],
25
- default: ""
26
- },
27
- treeData: {
28
- type: Array,
29
- default: () => []
30
- },
31
- placeholder: {
32
- type: String,
33
- default: "\u8BF7\u9009\u62E9"
34
- },
35
- disabled: {
36
- type: Boolean,
37
- default: false
38
- },
39
- multiple: {
40
- type: Boolean,
41
- default: false
42
- },
43
- leafOnly: {
44
- type: Boolean,
45
- default: false
46
- },
47
- searchable: {
48
- type: Boolean,
49
- default: false
50
- },
51
- allowClear: {
52
- type: Boolean,
53
- default: false
54
- },
55
- enableLabelization: {
56
- type: Boolean,
57
- default: false
58
- },
59
- onToggleChange: {
60
- type: Function,
61
- default: void 0
62
- },
63
- onValueChange: {
64
- type: Function,
65
- default: void 0
66
- }
67
- };
68
- const nodeMap = /* @__PURE__ */ new Map();
69
- function attributeExtension(data) {
70
- data.forEach((el) => {
71
- let level = 1;
72
- el.level = level;
73
- nodeMap.set(el.label, el);
74
- const nodeQueue = [];
75
- nodeQueue.push(el);
76
- while (nodeQueue.length !== 0) {
77
- const node = nodeQueue.shift();
78
- if (node.children) {
79
- node.children.forEach((el2) => {
80
- el2.level = level + 1;
81
- el2.parent = node;
82
- nodeMap.set(el2.label, el2);
83
- nodeQueue.push(el2);
84
- });
85
- }
86
- level += 1;
87
- }
88
- });
89
- return data;
90
- }
91
- function className(classStr, classOpt) {
92
- let classname = classStr;
93
- if (typeof classOpt === "object") {
94
- Object.keys(classOpt).forEach((key) => {
95
- classOpt[key] && (classname += ` ${key}`);
96
- });
97
- }
98
- return classname;
99
- }
100
- function useToggle(props) {
101
- const visible = ref(false);
102
- const selectToggle = () => {
103
- if (props.disabled) {
104
- return;
105
- }
106
- visible.value = !visible.value;
107
- };
108
- const treeToggle = (e, item) => {
109
- e.preventDefault();
110
- e.stopPropagation();
111
- item.opened = !item.opened;
112
- };
113
- return {
114
- visible,
115
- selectToggle,
116
- treeToggle
117
- };
118
- }
119
- function useSelect(props) {
120
- const inputValue = ref([]);
121
- const selectedCache = /* @__PURE__ */ new Set();
122
- const selectValue = (item) => {
123
- if (!props.multiple) {
124
- inputValue.value = item.label;
125
- } else {
126
- item.checked = !item.checked;
127
- if (item.halfchecked) {
128
- item.halfchecked = false;
129
- }
130
- useCache(item);
131
- searchUp(item);
132
- searchDown(item);
133
- inputValue.value = [...selectedCache];
134
- }
135
- };
136
- const useCache = (item) => {
137
- item.checked === true ? selectedCache.add(item.label) : selectedCache.has(item.label) && selectedCache.delete(item.label);
138
- };
139
- const searchUp = (item) => {
140
- if (!item.parent) {
141
- return;
142
- }
143
- let state = "";
144
- const checkedArr = item.parent.children.filter((el) => el.checked === true);
145
- switch (checkedArr.length) {
146
- case 0:
147
- state = "none";
148
- break;
149
- case item.parent.children.length:
150
- state = "checked";
151
- break;
152
- default:
153
- state = "halfchecked";
154
- break;
155
- }
156
- if (state === "checked") {
157
- item.parent.checked = true;
158
- item.parent.halfchecked = false;
159
- } else if (state === "halfchecked") {
160
- item.parent.halfchecked = true;
161
- item.parent.checked = false;
162
- } else {
163
- item.parent.checked = false;
164
- item.parent.halfchecked = false;
165
- }
166
- useCache(item.parent);
167
- searchUp(item.parent);
168
- };
169
- const searchDown = (item) => {
170
- if (!item.children) {
171
- return;
172
- }
173
- item.children.forEach((el) => {
174
- el.checked = item.checked;
175
- useCache(el);
176
- searchDown(el);
177
- });
178
- };
179
- return {
180
- inputValue,
181
- selectValue
182
- };
183
- }
184
- function useClear(props, ctx2, data) {
185
- const isClearable = computed(() => {
186
- return !props.disabled && props.allowClear;
187
- });
188
- const handleClearAll = (e) => {
189
- e.preventDefault();
190
- e.stopPropagation();
191
- if (props.multiple) {
192
- ctx2.emit("update:modelValue", []);
193
- data.value = [];
194
- } else {
195
- ctx2.emit("update:modelValue", "");
196
- data.value = "";
197
- }
198
- };
199
- const handleClearItem = (e, item) => {
200
- e.preventDefault();
201
- e.stopPropagation();
202
- if (props.multiple) {
203
- data.value.splice(data.value.indexOf(item), 1);
204
- ctx2.emit("update:modelValue", data.value);
205
- } else {
206
- ctx2.emit("update:modelValue", []);
207
- data.value = [];
208
- }
209
- };
210
- return {
211
- isClearable,
212
- handleClearAll,
213
- handleClearItem
214
- };
215
- }
216
- var IconOpen = "data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIxNnB4IgogIGhlaWdodD0iMTZweCIKICB2aWV3Qm94PSIwIDAgMTYgMTYiCiAgdmVyc2lvbj0iMS4xIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIKICBjbGFzcz0ic3ZnLWljb24gc3ZnLWljb24tY2xvc2UiCj4KICA8ZyBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICA8cmVjdCB4PSIwLjUiIHk9IjAuNSIgd2lkdGg9IjE1IiBoZWlnaHQ9IjE1IiByeD0iMiIgc3Ryb2tlPSIjNWU3Y2UwIj48L3JlY3Q+CiAgICA8cmVjdCB4PSI0IiB5PSI3IiB3aWR0aD0iOCIgaGVpZ2h0PSIyIiBmaWxsPSIjNWU3Y2UwIj48L3JlY3Q+CiAgPC9nPgo8L3N2Zz4=";
217
- var IconClose = "data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIxNnB4IgogIGhlaWdodD0iMTZweCIKICB2aWV3Qm94PSIwIDAgMTYgMTYiCiAgdmVyc2lvbj0iMS4xIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIKICBjbGFzcz0ic3ZnLWljb24iCj4KICA8ZyBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxyZWN0IHg9IjAuNSIgeT0iMC41IiB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHJ4PSIyIiBzdHJva2U9IiMyNTJiM2EiPjwvcmVjdD4KICAgIDxwYXRoCiAgICAgIGZpbGw9IiMyNTJiM2EiCiAgICAgIGQ9Ik04Ljc1LDQgTDguNzUsNy4yNSBMMTIsNy4yNSBMMTIsOC43NSBMOC43NDksOC43NSBMOC43NSwxMiBMNy4yNSwxMiBMNy4yNDksOC43NSBMNCw4Ljc1IEw0LDcuMjUgTDcuMjUsNy4yNSBMNy4yNSw0IEw4Ljc1LDQgWiIKICAgID48L3BhdGg+CiAgPC9nPgo8L3N2Zz4K";
218
- var checkbox = "";
219
- const commonProps = {
220
- name: {
221
- type: String,
222
- default: void 0
223
- },
224
- halfchecked: {
225
- type: Boolean,
226
- default: false
227
- },
228
- isShowTitle: {
229
- type: Boolean,
230
- default: true
231
- },
232
- title: {
233
- type: String
234
- },
235
- color: {
236
- type: String,
237
- default: void 0
238
- },
239
- showAnimation: {
240
- type: Boolean,
241
- default: true
242
- },
243
- disabled: {
244
- type: Boolean,
245
- default: false
246
- },
247
- beforeChange: {
248
- type: Function,
249
- default: void 0
250
- }
251
- };
252
- const checkboxProps = __spreadProps(__spreadValues({}, commonProps), {
253
- halfchecked: {
254
- type: Boolean,
255
- default: false
256
- },
257
- checked: {
258
- type: Boolean,
259
- default: false
260
- },
261
- value: {
262
- type: String
263
- },
264
- label: {
265
- type: String,
266
- default: void 0
267
- },
268
- title: {
269
- type: String,
270
- default: void 0
271
- },
272
- "onUpdate:checked": {
273
- type: Function,
274
- default: void 0
275
- },
276
- onChange: {
277
- type: Function,
278
- default: void 0
279
- },
280
- modelValue: {
281
- type: Boolean
282
- },
283
- "onUpdate:modelValue": {
284
- type: Function
285
- }
286
- });
287
- const checkboxGroupInjectionKey = Symbol("d-checkbox-group");
288
- var Checkbox = defineComponent({
289
- name: "DCheckbox",
290
- props: checkboxProps,
291
- emits: ["change", "update:checked", "update:modelValue"],
292
- setup(props, ctx2) {
293
- const checkboxGroupConf = inject(checkboxGroupInjectionKey, null);
294
- const isChecked = computed(() => props.checked || props.modelValue);
295
- const mergedDisabled = computed(() => {
296
- return (checkboxGroupConf == null ? void 0 : checkboxGroupConf.disabled.value) || props.disabled;
297
- });
298
- const mergedChecked = computed(() => {
299
- var _a, _b;
300
- return (_b = (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isItemChecked) == null ? void 0 : _a.call(checkboxGroupConf, props.value)) != null ? _b : isChecked.value;
301
- });
302
- const mergedIsShowTitle = computed(() => {
303
- var _a;
304
- return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isShowTitle.value) != null ? _a : props.isShowTitle;
305
- });
306
- const mergedShowAnimation = computed(() => {
307
- var _a;
308
- return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.showAnimation.value) != null ? _a : props.showAnimation;
309
- });
310
- const mergedColor = computed(() => {
311
- var _a;
312
- return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.color.value) != null ? _a : props.color;
313
- });
314
- const itemWidth = checkboxGroupConf == null ? void 0 : checkboxGroupConf.itemWidth.value;
315
- const direction = checkboxGroupConf == null ? void 0 : checkboxGroupConf.direction.value;
316
- const canChange = (isChecked2, val) => {
317
- var _a;
318
- if (mergedDisabled.value) {
319
- return Promise.resolve(false);
320
- }
321
- const beforeChange = (_a = props.beforeChange) != null ? _a : checkboxGroupConf == null ? void 0 : checkboxGroupConf.beforeChange;
322
- if (beforeChange) {
323
- const res = beforeChange(isChecked2, val);
324
- if (typeof res === "boolean") {
325
- return Promise.resolve(res);
326
- }
327
- return res;
328
- }
329
- return Promise.resolve(true);
330
- };
331
- const toggle = () => {
332
- const current = !isChecked.value;
333
- checkboxGroupConf == null ? void 0 : checkboxGroupConf.toggleGroupVal(props.value);
334
- ctx2.emit("update:checked", current);
335
- ctx2.emit("update:modelValue", current);
336
- ctx2.emit("change", current);
337
- };
338
- const handleClick = () => {
339
- canChange(!isChecked.value, props.label).then((res) => res && toggle());
340
- };
341
- return {
342
- itemWidth,
343
- direction,
344
- mergedColor,
345
- mergedDisabled,
346
- mergedIsShowTitle,
347
- mergedChecked,
348
- mergedShowAnimation,
349
- handleClick
350
- };
351
- },
352
- render() {
353
- var _a;
354
- const {
355
- itemWidth,
356
- direction,
357
- mergedChecked,
358
- mergedDisabled,
359
- mergedIsShowTitle,
360
- mergedShowAnimation,
361
- halfchecked,
362
- title,
363
- label,
364
- handleClick,
365
- name,
366
- value,
367
- mergedColor,
368
- $slots
369
- } = this;
370
- const wrapperCls = {
371
- "devui-checkbox-column-margin": direction === "column",
372
- "devui-checkbox-wrap": typeof itemWidth !== "undefined"
373
- };
374
- const wrapperStyle = itemWidth ? [`width: ${itemWidth}px`] : [];
375
- const checkboxCls = {
376
- "devui-checkbox": true,
377
- active: mergedChecked,
378
- halfchecked,
379
- disabled: mergedDisabled,
380
- unchecked: !mergedChecked
381
- };
382
- const labelTitle = mergedIsShowTitle ? title || label : "";
383
- const bgImgStyle = mergedColor && halfchecked || mergedColor ? `linear-gradient(${mergedColor}, ${mergedColor})` : "";
384
- const spanStyle = [`border-color:${(mergedChecked || halfchecked) && mergedColor ? mergedColor : ""}`, `background-image:${bgImgStyle}`, `background-color:${mergedColor && halfchecked ? mergedColor : ""}`];
385
- const spanCls = {
386
- "devui-checkbox-material": true,
387
- "custom-color": mergedColor,
388
- "devui-checkbox-no-label": !label && !$slots.default,
389
- "devui-no-animation": !mergedShowAnimation,
390
- "devui-checkbox-default-background": !halfchecked
391
- };
392
- const polygonCls = {
393
- "devui-tick": true,
394
- "devui-no-animation": !mergedShowAnimation
395
- };
396
- const stopPropagation = ($event) => $event.stopPropagation();
397
- const inputProps = {
398
- indeterminate: halfchecked
399
- };
400
- return createVNode("div", {
401
- "class": wrapperCls,
402
- "style": wrapperStyle
403
- }, [createVNode("div", {
404
- "class": checkboxCls
405
- }, [createVNode("label", {
406
- "title": labelTitle,
407
- "onClick": handleClick
408
- }, [createVNode("input", mergeProps({
409
- "name": name || value,
410
- "class": "devui-checkbox-input",
411
- "type": "checkbox"
412
- }, inputProps, {
413
- "checked": mergedChecked,
414
- "disabled": mergedDisabled,
415
- "onClick": stopPropagation,
416
- "onChange": stopPropagation
417
- }), null), createVNode("span", {
418
- "style": spanStyle,
419
- "class": spanCls
420
- }, [createVNode("span", {
421
- "class": "devui-checkbox-halfchecked-bg"
422
- }, null), createVNode("svg", {
423
- "viewBox": "0 0 16 16",
424
- "version": "1.1",
425
- "xmlns": "http://www.w3.org/2000/svg",
426
- "class": "devui-checkbox-tick"
427
- }, [createVNode("g", {
428
- "stroke": "none",
429
- "stroke-width": "1",
430
- "fill": "none",
431
- "fill-rule": "evenodd"
432
- }, [createVNode("polygon", {
433
- "fill-rule": "nonzero",
434
- "points": "5.17391304 6.56521739 7.7173913 9.10869565 11.826087 5 13 6.17391304 7.7173913 11.4565217 4 7.73913043",
435
- "class": polygonCls
436
- }, null)])])]), label || ((_a = $slots.default) == null ? void 0 : _a.call($slots))])])]);
437
- }
438
- });
439
- const inBrowser = typeof window !== "undefined";
440
- function on(element, eventName, handler) {
441
- if (document.addEventListener) {
442
- if (element && eventName && handler) {
443
- element.addEventListener(eventName, handler, false);
444
- }
445
- } else {
446
- if (element && eventName && handler) {
447
- element.attachEvent("on" + eventName, handler);
448
- }
449
- }
450
- }
451
- const ctx = Symbol("@@clickoutside");
452
- const nodeList = /* @__PURE__ */ new Map();
453
- let startClick;
454
- let nid = 0;
455
- let isFirst = true;
456
- function createDocumentHandler(el, binding, vnode) {
457
- if (inBrowser && isFirst) {
458
- isFirst = false;
459
- on(document, "mousedown", (e) => {
460
- startClick = e;
461
- });
462
- on(document, "mouseup", (e) => {
463
- for (const [id, node] of nodeList) {
464
- node[ctx].documentHandler(e, startClick);
465
- }
466
- });
467
- }
468
- return function(mouseup, mousedown) {
469
- if (!vnode || !binding.instance || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target) {
470
- return;
471
- }
472
- el[ctx].bindingFn && el[ctx].bindingFn();
473
- };
474
- }
475
- const clickoutsideDirective = {
476
- beforeMount: function(el, binding, vnode) {
477
- nid++;
478
- nodeList.set(nid, el);
479
- el[ctx] = {
480
- nid,
481
- documentHandler: createDocumentHandler(el, binding, vnode),
482
- bindingFn: binding.value
483
- };
484
- },
485
- updated: function(el, binding, vnode) {
486
- el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
487
- el[ctx].bindingFn = binding.value;
488
- },
489
- unmounted: function(el) {
490
- nodeList.delete(el[ctx].nid);
491
- delete el[ctx];
492
- }
493
- };
494
- var TreeSelect = defineComponent({
495
- name: "DTreeSelect",
496
- directives: {
497
- ClickOutside: clickoutsideDirective
498
- },
499
- props: treeSelectProps,
500
- emits: ["toggleChange", "valueChange", "update:modelValue"],
501
- setup(props, ctx2) {
502
- const {
503
- treeData,
504
- placeholder,
505
- disabled,
506
- multiple,
507
- leafOnly,
508
- enableLabelization
509
- } = toRefs(props);
510
- const {
511
- visible,
512
- selectToggle,
513
- treeToggle
514
- } = useToggle(props);
515
- const {
516
- inputValue,
517
- selectValue
518
- } = useSelect(props);
519
- const {
520
- isClearable,
521
- handleClearAll,
522
- handleClearItem
523
- } = useClear(props, ctx2, inputValue);
524
- const clickNode = (item) => {
525
- if (!leafOnly.value) {
526
- selectValue(item);
527
- !multiple.value && selectToggle(item);
528
- } else {
529
- if (!item.children) {
530
- selectValue(item);
531
- !multiple.value && selectToggle(item);
532
- }
533
- }
534
- };
535
- const deleteNode = (e, item) => {
536
- handleClearItem(e, item);
537
- selectValue(nodeMap.get(item));
538
- };
539
- const treeSelectCls = className("devui-tree-select", {
540
- "devui-tree-select-open": visible.value,
541
- "devui-tree-select-disabled": disabled.value
542
- });
543
- const treeSelectInputItem = className("devui-tree-select-value", {
544
- "devui-tree-select-value-enableLabelization": enableLabelization.value
545
- });
546
- const renderNode = (item) => createVNode("div", {
547
- "class": "devui-tree-select-item",
548
- "style": {
549
- paddingLeft: `${20 * (item.level - 1)}px`
550
- },
551
- "onClick": () => clickNode(item)
552
- }, [item.children ? item.opened ? createVNode(IconOpen, {
553
- "class": "mr-xs",
554
- "onClick": (e) => treeToggle(e, item)
555
- }, null) : createVNode(IconClose, {
556
- "class": "mr-xs",
557
- "onClick": (e) => treeToggle(e, item)
558
- }, null) : createVNode("span", null, ["\xA0\xA0\xA0"]), ctx2.slots.default ? ctx2.slots.default({
559
- item
560
- }) : multiple.value ? item.halfchecked ? createVNode(Checkbox, {
561
- "label": item.label,
562
- "halfchecked": item.halfchecked
563
- }, null) : createVNode(Checkbox, {
564
- "label": item.label,
565
- "checked": item.checked
566
- }, null) : item.label]);
567
- const renderTree = (treeData2) => {
568
- return treeData2.map((item) => {
569
- if (item.children) {
570
- return createVNode(Fragment, null, [renderNode(item), item.opened && renderTree(item.children)]);
571
- }
572
- return renderNode(item);
573
- });
574
- };
575
- return () => {
576
- return withDirectives(createVNode("div", {
577
- "class": treeSelectCls
578
- }, [createVNode("div", {
579
- "class": isClearable.value ? "devui-tree-select-clearable" : "devui-tree-select-notclearable",
580
- "onClick": () => selectToggle()
581
- }, [createVNode("div", {
582
- "class": "devui-tree-select-input",
583
- "placeholder": placeholder.value
584
- }, [multiple.value ? inputValue.value.map((item) => createVNode("div", {
585
- "class": treeSelectInputItem
586
- }, [item, enableLabelization.value ? createVNode(resolveComponent("d-icon"), {
587
- "name": "close",
588
- "onClick": (e) => deleteNode(e, item)
589
- }, null) : createVNode("span", null, [createTextVNode(",")])])) : !Array.isArray(inputValue.value) && createVNode("div", {
590
- "class": treeSelectInputItem
591
- }, [inputValue.value, enableLabelization.value && createVNode(resolveComponent("d-icon"), {
592
- "name": "close",
593
- "onClick": (e) => handleClearItem(e)
594
- }, null)])]), createVNode("span", {
595
- "onClick": (e) => handleClearAll(e),
596
- "class": "devui-tree-select-clear"
597
- }, [createVNode(resolveComponent("d-icon"), {
598
- "name": "close"
599
- }, null)]), createVNode("span", {
600
- "class": "devui-tree-select-arrow"
601
- }, [createVNode(resolveComponent("d-icon"), {
602
- "name": "select-arrow"
603
- }, null)])]), createVNode(Transition, {
604
- "name": "fade",
605
- "ref": "dropdownRef"
606
- }, {
607
- default: () => [withDirectives(createVNode("div", {
608
- "class": "devui-tree-select-dropdown"
609
- }, [createVNode("ul", {
610
- "class": "devui-tree-select-dropdown-list"
611
- }, [renderTree(attributeExtension(treeData.value))])]), [[vShow, visible.value]])]
612
- })]), [[resolveDirective("click-outside"), () => visible.value = false]]);
613
- };
614
- }
615
- });
616
- TreeSelect.install = function(app) {
617
- app.component(TreeSelect.name, TreeSelect);
618
- };
619
- var index = {
620
- title: "TreeSelect \u6811\u5F62\u9009\u62E9\u6846",
621
- category: "\u6570\u636E\u5F55\u5165",
622
- status: "20%",
623
- install(app) {
624
- app.use(TreeSelect);
625
- }
626
- };
627
- export { TreeSelect, index as default };
@@ -1 +0,0 @@
1
- var te=Object.defineProperty,ae=Object.defineProperties;var ne=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var ce=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var x=(s,e,p)=>e in s?te(s,e,{enumerable:!0,configurable:!0,writable:!0,value:p}):s[e]=p,E=(s,e)=>{for(var p in e||(e={}))ce.call(e,p)&&x(s,p,e[p]);if(U)for(var p of U(e))oe.call(e,p)&&x(s,p,e[p]);return s},F=(s,e)=>ae(s,ne(e));(function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s.index={},s.Vue))})(this,function(s,e){"use strict";var p="";const O={modelValue:{type:[String,Number,Array],default:""},treeData:{type:Array,default:()=>[]},placeholder:{type:String,default:"\u8BF7\u9009\u62E9"},disabled:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},leafOnly:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!1},enableLabelization:{type:Boolean,default:!1},onToggleChange:{type:Function,default:void 0},onValueChange:{type:Function,default:void 0}},T=new Map;function R(t){return t.forEach(a=>{let l=1;a.level=l,T.set(a.label,a);const o=[];for(o.push(a);o.length!==0;){const r=o.shift();r.children&&r.children.forEach(d=>{d.level=l+1,d.parent=r,T.set(d.label,d),o.push(d)}),l+=1}}),t}function P(t,a){let l=t;return typeof a=="object"&&Object.keys(a).forEach(o=>{a[o]&&(l+=` ${o}`)}),l}function K(t){const a=e.ref(!1);return{visible:a,selectToggle:()=>{t.disabled||(a.value=!a.value)},treeToggle:(r,d)=>{r.preventDefault(),r.stopPropagation(),d.opened=!d.opened}}}function J(t){const a=e.ref([]),l=new Set,o=n=>{t.multiple?(n.checked=!n.checked,n.halfchecked&&(n.halfchecked=!1),r(n),d(n),u(n),a.value=[...l]):a.value=n.label},r=n=>{n.checked===!0?l.add(n.label):l.has(n.label)&&l.delete(n.label)},d=n=>{if(!n.parent)return;let g="";switch(n.parent.children.filter(y=>y.checked===!0).length){case 0:g="none";break;case n.parent.children.length:g="checked";break;default:g="halfchecked";break}g==="checked"?(n.parent.checked=!0,n.parent.halfchecked=!1):g==="halfchecked"?(n.parent.halfchecked=!0,n.parent.checked=!1):(n.parent.checked=!1,n.parent.halfchecked=!1),r(n.parent),d(n.parent)},u=n=>{!n.children||n.children.forEach(g=>{g.checked=n.checked,r(g),u(g)})};return{inputValue:a,selectValue:o}}function Y(t,a,l){return{isClearable:e.computed(()=>!t.disabled&&t.allowClear),handleClearAll:u=>{u.preventDefault(),u.stopPropagation(),t.multiple?(a.emit("update:modelValue",[]),l.value=[]):(a.emit("update:modelValue",""),l.value="")},handleClearItem:(u,n)=>{u.preventDefault(),u.stopPropagation(),t.multiple?(l.value.splice(l.value.indexOf(n),1),a.emit("update:modelValue",l.value)):(a.emit("update:modelValue",[]),l.value=[])}}}var Q="data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIxNnB4IgogIGhlaWdodD0iMTZweCIKICB2aWV3Qm94PSIwIDAgMTYgMTYiCiAgdmVyc2lvbj0iMS4xIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIKICBjbGFzcz0ic3ZnLWljb24gc3ZnLWljb24tY2xvc2UiCj4KICA8ZyBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICA8cmVjdCB4PSIwLjUiIHk9IjAuNSIgd2lkdGg9IjE1IiBoZWlnaHQ9IjE1IiByeD0iMiIgc3Ryb2tlPSIjNWU3Y2UwIj48L3JlY3Q+CiAgICA8cmVjdCB4PSI0IiB5PSI3IiB3aWR0aD0iOCIgaGVpZ2h0PSIyIiBmaWxsPSIjNWU3Y2UwIj48L3JlY3Q+CiAgPC9nPgo8L3N2Zz4=",$="data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIxNnB4IgogIGhlaWdodD0iMTZweCIKICB2aWV3Qm94PSIwIDAgMTYgMTYiCiAgdmVyc2lvbj0iMS4xIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIKICBjbGFzcz0ic3ZnLWljb24iCj4KICA8ZyBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxyZWN0IHg9IjAuNSIgeT0iMC41IiB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHJ4PSIyIiBzdHJva2U9IiMyNTJiM2EiPjwvcmVjdD4KICAgIDxwYXRoCiAgICAgIGZpbGw9IiMyNTJiM2EiCiAgICAgIGQ9Ik04Ljc1LDQgTDguNzUsNy4yNSBMMTIsNy4yNSBMMTIsOC43NSBMOC43NDksOC43NSBMOC43NSwxMiBMNy4yNSwxMiBMNy4yNDksOC43NSBMNCw4Ljc1IEw0LDcuMjUgTDcuMjUsNy4yNSBMNy4yNSw0IEw4Ljc1LDQgWiIKICAgID48L3BhdGg+CiAgPC9nPgo8L3N2Zz4K",de="";const G=F(E({},{name:{type:String,default:void 0},halfchecked:{type:Boolean,default:!1},isShowTitle:{type:Boolean,default:!0},title:{type:String},color:{type:String,default:void 0},showAnimation:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},beforeChange:{type:Function,default:void 0}}),{halfchecked:{type:Boolean,default:!1},checked:{type:Boolean,default:!1},value:{type:String},label:{type:String,default:void 0},title:{type:String,default:void 0},"onUpdate:checked":{type:Function,default:void 0},onChange:{type:Function,default:void 0},modelValue:{type:Boolean},"onUpdate:modelValue":{type:Function}}),X=Symbol("d-checkbox-group");var j=e.defineComponent({name:"DCheckbox",props:G,emits:["change","update:checked","update:modelValue"],setup(t,a){const l=e.inject(X,null),o=e.computed(()=>t.checked||t.modelValue),r=e.computed(()=>(l==null?void 0:l.disabled.value)||t.disabled),d=e.computed(()=>{var i,I;return(I=(i=l==null?void 0:l.isItemChecked)==null?void 0:i.call(l,t.value))!=null?I:o.value}),u=e.computed(()=>{var i;return(i=l==null?void 0:l.isShowTitle.value)!=null?i:t.isShowTitle}),n=e.computed(()=>{var i;return(i=l==null?void 0:l.showAnimation.value)!=null?i:t.showAnimation}),g=e.computed(()=>{var i;return(i=l==null?void 0:l.color.value)!=null?i:t.color}),v=l==null?void 0:l.itemWidth.value,y=l==null?void 0:l.direction.value,m=(i,I)=>{var S;if(r.value)return Promise.resolve(!1);const N=(S=t.beforeChange)!=null?S:l==null?void 0:l.beforeChange;if(N){const k=N(i,I);return typeof k=="boolean"?Promise.resolve(k):k}return Promise.resolve(!0)},f=()=>{const i=!o.value;l==null||l.toggleGroupVal(t.value),a.emit("update:checked",i),a.emit("update:modelValue",i),a.emit("change",i)};return{itemWidth:v,direction:y,mergedColor:g,mergedDisabled:r,mergedIsShowTitle:u,mergedChecked:d,mergedShowAnimation:n,handleClick:()=>{m(!o.value,t.label).then(i=>i&&f())}}},render(){var z;const{itemWidth:t,direction:a,mergedChecked:l,mergedDisabled:o,mergedIsShowTitle:r,mergedShowAnimation:d,halfchecked:u,title:n,label:g,handleClick:v,name:y,value:m,mergedColor:f,$slots:C}=this,i={"devui-checkbox-column-margin":a==="column","devui-checkbox-wrap":typeof t!="undefined"},I=t?[`width: ${t}px`]:[],N={"devui-checkbox":!0,active:l,halfchecked:u,disabled:o,unchecked:!l},S=r?n||g:"",k=f&&u||f?`linear-gradient(${f}, ${f})`:"",V=[`border-color:${(l||u)&&f?f:""}`,`background-image:${k}`,`background-color:${f&&u?f:""}`],B={"devui-checkbox-material":!0,"custom-color":f,"devui-checkbox-no-label":!g&&!C.default,"devui-no-animation":!d,"devui-checkbox-default-background":!u},M={"devui-tick":!0,"devui-no-animation":!d},c=le=>le.stopPropagation(),h={indeterminate:u};return e.createVNode("div",{class:i,style:I},[e.createVNode("div",{class:N},[e.createVNode("label",{title:S,onClick:v},[e.createVNode("input",e.mergeProps({name:y||m,class:"devui-checkbox-input",type:"checkbox"},h,{checked:l,disabled:o,onClick:c,onChange:c}),null),e.createVNode("span",{style:V,class:B},[e.createVNode("span",{class:"devui-checkbox-halfchecked-bg"},null),e.createVNode("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",class:"devui-checkbox-tick"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{"fill-rule":"nonzero",points:"5.17391304 6.56521739 7.7173913 9.10869565 11.826087 5 13 6.17391304 7.7173913 11.4565217 4 7.73913043",class:M},null)])])]),g||((z=C.default)==null?void 0:z.call(C))])])])}});const _=typeof window!="undefined";function Z(t,a,l){document.addEventListener?t&&a&&l&&t.addEventListener(a,l,!1):t&&a&&l&&t.attachEvent("on"+a,l)}const b=Symbol("@@clickoutside"),A=new Map;let L,D=0,H=!0;function W(t,a,l){return _&&H&&(H=!1,Z(document,"mousedown",o=>{L=o}),Z(document,"mouseup",o=>{for(const[r,d]of A)d[b].documentHandler(o,L)})),function(o,r){!l||!a.instance||!o.target||!r.target||t.contains(o.target)||t.contains(r.target)||t===o.target||t[b].bindingFn&&t[b].bindingFn()}}const q={beforeMount:function(t,a,l){D++,A.set(D,t),t[b]={nid:D,documentHandler:W(t,a,l),bindingFn:a.value}},updated:function(t,a,l){t[b].documentHandler=W(t,a,l),t[b].bindingFn=a.value},unmounted:function(t){A.delete(t[b].nid),delete t[b]}};var w=e.defineComponent({name:"DTreeSelect",directives:{ClickOutside:q},props:O,emits:["toggleChange","valueChange","update:modelValue"],setup(t,a){const{treeData:l,placeholder:o,disabled:r,multiple:d,leafOnly:u,enableLabelization:n}=e.toRefs(t),{visible:g,selectToggle:v,treeToggle:y}=K(t),{inputValue:m,selectValue:f}=J(t),{isClearable:C,handleClearAll:i,handleClearItem:I}=Y(t,a,m),N=c=>{u.value&&c.children||(f(c),!d.value&&v(c))},S=(c,h)=>{I(c,h),f(T.get(h))},k=P("devui-tree-select",{"devui-tree-select-open":g.value,"devui-tree-select-disabled":r.value}),V=P("devui-tree-select-value",{"devui-tree-select-value-enableLabelization":n.value}),B=c=>e.createVNode("div",{class:"devui-tree-select-item",style:{paddingLeft:`${20*(c.level-1)}px`},onClick:()=>N(c)},[c.children?c.opened?e.createVNode(Q,{class:"mr-xs",onClick:h=>y(h,c)},null):e.createVNode($,{class:"mr-xs",onClick:h=>y(h,c)},null):e.createVNode("span",null,["\xA0\xA0\xA0"]),a.slots.default?a.slots.default({item:c}):d.value?c.halfchecked?e.createVNode(j,{label:c.label,halfchecked:c.halfchecked},null):e.createVNode(j,{label:c.label,checked:c.checked},null):c.label]),M=c=>c.map(h=>h.children?e.createVNode(e.Fragment,null,[B(h),h.opened&&M(h.children)]):B(h));return()=>e.withDirectives(e.createVNode("div",{class:k},[e.createVNode("div",{class:C.value?"devui-tree-select-clearable":"devui-tree-select-notclearable",onClick:()=>v()},[e.createVNode("div",{class:"devui-tree-select-input",placeholder:o.value},[d.value?m.value.map(c=>e.createVNode("div",{class:V},[c,n.value?e.createVNode(e.resolveComponent("d-icon"),{name:"close",onClick:h=>S(h,c)},null):e.createVNode("span",null,[e.createTextVNode(",")])])):!Array.isArray(m.value)&&e.createVNode("div",{class:V},[m.value,n.value&&e.createVNode(e.resolveComponent("d-icon"),{name:"close",onClick:c=>I(c)},null)])]),e.createVNode("span",{onClick:c=>i(c),class:"devui-tree-select-clear"},[e.createVNode(e.resolveComponent("d-icon"),{name:"close"},null)]),e.createVNode("span",{class:"devui-tree-select-arrow"},[e.createVNode(e.resolveComponent("d-icon"),{name:"select-arrow"},null)])]),e.createVNode(e.Transition,{name:"fade",ref:"dropdownRef"},{default:()=>[e.withDirectives(e.createVNode("div",{class:"devui-tree-select-dropdown"},[e.createVNode("ul",{class:"devui-tree-select-dropdown-list"},[M(R(l.value))])]),[[e.vShow,g.value]])]})]),[[e.resolveDirective("click-outside"),()=>g.value=!1]])}});w.install=function(t){t.component(w.name,w)};var ee={title:"TreeSelect \u6811\u5F62\u9009\u62E9\u6846",category:"\u6570\u636E\u5F55\u5165",status:"20%",install(t){t.use(w)}};s.TreeSelect=w,s.default=ee,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
@@ -1,7 +0,0 @@
1
- {
2
- "name": "tree-select",
3
- "version": "0.0.0",
4
- "main": "index.umd.js",
5
- "module": "index.es.js",
6
- "style": "style.css"
7
- }
@@ -1 +0,0 @@
1
- .devui-tree-select{position:relative;width:100%}.devui-tree-select-disabled,.devui-tree-select-disabled .devui-tree-select-input{cursor:not-allowed;background-color:var(--devui-disabled-bg, #f5f5f6);border-color:var(--devui-disabled-line, #dfe1e6);color:var(--devui-disabled-text, #adb0b8)}.devui-tree-select-disabled .devui-tree-select-arrow{cursor:not-allowed;color:var(--devui-disabled-text, #adb0b8)}.devui-tree-select-open .devui-tree-select-arrow{transform:rotate(180deg)}.devui-tree-select-input{cursor:pointer;width:100%;height:28px;padding:0 10px;color:var(--devui-text, #252b3a);border:1px solid var(--devui-form-control-line, #adb0b8);border-radius:var(--devui-border-radius, 2px);outline:none;background-color:var(--devui-base-bg, #ffffff);overflow:auto}.devui-tree-select-input:empty:before{color:#d3d3d3;content:attr(placeholder);vertical-align:middle}.devui-tree-select-value{display:inline-block;height:80%;vertical-align:middle}.devui-tree-select-value-enableLabelization{padding:0 10px;margin:2px 10px 2px 0;background-color:var(--devui-icon-fill, #d3d5d9)}.devui-tree-select-dropdown{border-radius:var(--devui-border-radius, 2px);background:var(--devui-base-bg, #ffffff);box-shadow:0 2px 5px 0 var(--devui-shadow, rgba(0, 0, 0, .2))}.devui-tree-select-dropdown-list{max-height:300px;overflow-y:auto;padding:0;margin:0}.devui-tree-select-item{font-size:16px;display:inline-flex;min-height:36px;line-height:1.5;width:100%;padding:10px;clear:both;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border:0;color:var(--devui-text, #252b3a);cursor:pointer;align-items:center}.devui-tree-select-item:hover:not(.active):not(.disabled){color:var(--devui-list-item-hover-text, #526ecc);background-color:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-tree-select-clearable{position:relative}.devui-tree-select-clearable:hover .devui-tree-select-clear{display:inline-flex}.devui-tree-select-clearable:hover .devui-tree-select-arrow{display:none}.devui-tree-select-notclearable{position:relative}.devui-tree-select-clear,.devui-tree-select-arrow{position:absolute;top:0;right:0;height:100%;width:28px;display:inline-flex;justify-content:center;align-items:center}.devui-tree-select-clear{display:none}.devui-tree-select-clear:hover{cursor:pointer;color:var(--devui-icon-fill-active, #5e7ce0)}.devui-checkbox{position:relative;display:flex;display:-ms-flexbox;align-items:center;-ms-flex-align:center;height:100%;margin:0}.devui-checkbox .devui-checkbox-tick{position:absolute}.devui-checkbox .devui-checkbox-tick .devui-tick{fill:var(--devui-light-text, #ffffff);stroke-dashoffset:50;opacity:0;transform:scale(0);transform-origin:50% 50%;transition:stroke-dashoffset .2s ease-in-out,opacity .2s ease-in-out,transform .2s ease-in-out}.devui-checkbox.active:not(.halfchecked) .devui-tick{opacity:1;stroke-dashoffset:0;transform:scale(1);transition:stroke-dashoffset .3s cubic-bezier(.755,.05,.855,.06),opacity .2s cubic-bezier(.755,.05,.855,.06)}.devui-checkbox.active:not(.disabled) .devui-checkbox-material:not(.custom-color),.devui-checkbox.halfchecked:not(.disabled) .devui-checkbox-material:not(.custom-color){border-color:var(--devui-brand, #5e7ce0)}.devui-checkbox.active:not(.disabled) .devui-checkbox-material{background-size:100% 100%;transition:background-size .2s ease-in-out,border-color .2s ease-in-out}.devui-checkbox.unchecked:not(.disabled) .devui-checkbox-material:not(.custom-color){background-size:0% 0%;transition:background-size .2s ease-in-out,border-color .2s ease-in-out}.devui-checkbox.unchecked:not(.disabled) .devui-checkbox-material:not(.custom-color):hover{border-color:var(--devui-icon-fill-active, #5e7ce0)}.devui-checkbox.unchecked:not(.disabled) .devui-checkbox-material.custom-color{background-size:0% 0%;transition:background-size .2s ease-in-out,border-color .2s ease-in-out}.devui-checkbox.halfchecked .devui-checkbox-material:not(.custom-color){background-color:var(--devui-brand, #5e7ce0)}.devui-checkbox.halfchecked .devui-checkbox-material:not(.custom-color)>.devui-checkbox-halfchecked-bg{opacity:1;transform:scale(.4288);transition:transform .2s cubic-bezier(.755,.05,.855,.06);background-color:var(--devui-light-text, #ffffff)}.devui-checkbox.halfchecked .devui-checkbox-material.custom-color>.devui-checkbox-halfchecked-bg{opacity:1;transform:scale(.4288);transition:transform .2s cubic-bezier(.755,.05,.855,.06);background-color:var(--devui-light-text, #ffffff)}.devui-checkbox .devui-checkbox-material{text-align:initial;height:14px;width:14px;position:relative;user-select:none;border:1px solid var(--devui-line, #adb0b8);border-radius:var(--devui-border-radius, 2px);background:linear-gradient(var(--devui-brand, #5e7ce0),var(--devui-brand, #5e7ce0)) no-repeat center/0%;margin-right:8px;vertical-align:text-bottom}.devui-checkbox .devui-checkbox-material.devui-checkbox-default-background{background-color:var(--devui-base-bg, #ffffff)}.devui-checkbox .devui-checkbox-material.devui-checkbox-no-label{margin-right:0}.devui-checkbox .devui-checkbox-material>.devui-checkbox-halfchecked-bg{display:inline-block;position:absolute;content:"";background-color:var(--devui-light-text, #ffffff);top:0;left:0;height:100%;width:100%;transform:scale(1);opacity:0}.devui-checkbox .devui-checkbox-material>svg{width:14px;height:14px}.devui-checkbox:not(.disabled).halfchecked .devui-checkbox-material:not(.custom-color):focus,.devui-checkbox:not(.disabled).halfchecked .devui-checkbox-material:not(.custom-color):active,.devui-checkbox:not(.disabled).halfchecked .devui-checkbox-material:not(.custom-color):hover{background-color:var(--devui-icon-fill-active, #5e7ce0)}.devui-checkbox:not(.disabled).halfchecked .devui-checkbox-material:not(.custom-color):active,.devui-checkbox:not(.disabled).halfchecked .devui-checkbox-material:not(.custom-color):focus,.devui-checkbox:not(.disabled).halfchecked .devui-checkbox-material:not(.custom-color):hover:active,.devui-checkbox:not(.disabled).halfchecked .devui-checkbox-material:not(.custom-color):hover:focus{background-color:var(--devui-brand-active-focus, #344899)}.devui-checkbox-input{opacity:0;position:absolute;margin:0;z-index:-1;width:0;height:0;overflow:hidden;left:0;pointer-events:none}.devui-checkbox label{position:relative;font-weight:400;height:16px;line-height:16px;cursor:pointer;color:var(--devui-text, #252b3a);margin:0;display:block}.devui-checkbox label>span{display:inline-block;box-sizing:content-box;vertical-align:top}.devui-checkbox.disabled label{cursor:not-allowed;color:var(--devui-disabled-text, #adb0b8)}.devui-checkbox.disabled .devui-checkbox-material{border-color:var(--devui-icon-fill-active-disabled, #beccfa);background-color:var(--devui-icon-fill-active-disabled, #beccfa)}.devui-checkbox.disabled.unchecked .devui-checkbox-material{border-color:var(--devui-disabled-line, #dfe1e6);background-color:var(--devui-disabled-bg, #f5f5f6)}.devui-checkbox.disabled.halfchecked .devui-checkbox-material{background-color:var(--devui-disabled-bg, #f5f5f6)}.devui-checkbox.disabled.halfchecked .devui-checkbox-material .devui-checkbox-halfchecked-bg{transform:scale(.4288);background-color:var(--devui-disabled-text, #adb0b8);opacity:1}.devui-checkbox.disabled.active svg polygon{fill:var(--devui-light-text, #ffffff)}.devui-no-animation{transition:none!important}.devui-checkbox-column-margin{height:28px;line-height:28px}.devui-checkbox-wrap .devui-checkbox label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}