vue-devui 1.0.0-pre.0 → 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 (347) hide show
  1. package/README.md +149 -187
  2. package/alert/index.es.js +74 -45
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8182 -296
  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 +30 -5
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5741 -127
  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 +5 -7
  29. package/countdown/index.umd.js +1 -1
  30. package/date-picker/index.es.js +8159 -288
  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 +297 -181
  37. package/dropdown/index.umd.js +1 -1
  38. package/dropdown/style.css +1 -1
  39. package/editable-select/index.es.js +525 -154
  40. package/editable-select/index.umd.js +1 -1
  41. package/editable-select/style.css +1 -1
  42. package/form/index.es.js +1039 -1175
  43. package/form/index.umd.js +15 -15
  44. package/form/style.css +1 -1
  45. package/fullscreen/index.es.js +42 -21
  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 +197 -56
  52. package/icon/index.umd.js +1 -1
  53. package/icon/style.css +1 -0
  54. package/image-preview/index.es.js +55 -31
  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 +269 -183
  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 +412 -204
  70. package/modal/index.umd.js +1 -1
  71. package/modal/style.css +1 -1
  72. package/notification/index.es.js +307 -57
  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/PanelBody.js +3 -0
  89. package/nuxt/components/PanelFooter.js +3 -0
  90. package/nuxt/components/PanelHeader.js +3 -0
  91. package/nuxt/components/RadioButton.js +3 -0
  92. package/nuxt/components/Tab.js +3 -0
  93. package/nuxt/components/Timeline.js +3 -0
  94. package/nuxt/components/TimelineItem.js +3 -0
  95. package/nuxt/components/alertProps.js +3 -0
  96. package/nuxt/components/autoCompleteProps.js +3 -0
  97. package/nuxt/components/avatarProps.js +3 -0
  98. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  99. package/nuxt/components/buttonGroupProps.js +3 -0
  100. package/nuxt/components/cardProps.js +3 -0
  101. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  102. package/nuxt/components/checkboxGroupProps.js +3 -0
  103. package/nuxt/components/checkboxProps.js +3 -0
  104. package/nuxt/components/colProps.js +3 -0
  105. package/nuxt/components/colPropsBaseClass.js +3 -0
  106. package/nuxt/components/colPropsBaseStyle.js +3 -0
  107. package/nuxt/components/collapseItemProps.js +3 -0
  108. package/nuxt/components/collapseProps.js +3 -0
  109. package/nuxt/components/countdownProps.js +3 -0
  110. package/nuxt/components/editableSelectProps.js +3 -0
  111. package/nuxt/components/formItemProps.js +3 -0
  112. package/nuxt/components/formProps.js +3 -0
  113. package/nuxt/components/fullscreenProps.js +3 -0
  114. package/nuxt/components/iconProps.js +3 -0
  115. package/nuxt/components/imagePreviewProps.js +3 -0
  116. package/nuxt/components/inputProps.js +3 -0
  117. package/nuxt/components/loadingProps.js +3 -0
  118. package/nuxt/components/modalProps.js +3 -0
  119. package/nuxt/components/paginationProps.js +3 -0
  120. package/nuxt/components/panelProps.js +3 -0
  121. package/nuxt/components/progressProps.js +3 -0
  122. package/nuxt/components/rateProps.js +3 -0
  123. package/nuxt/components/resultProps.js +3 -0
  124. package/nuxt/components/rowProps.js +3 -0
  125. package/nuxt/components/screenSizes.js +3 -0
  126. package/nuxt/components/searchProps.js +3 -0
  127. package/nuxt/components/skeletonProps.js +3 -0
  128. package/nuxt/components/sliderProps.js +3 -0
  129. package/nuxt/components/splitterProps.js +3 -0
  130. package/nuxt/components/statisticProps.js +3 -0
  131. package/nuxt/components/svgIconProps.js +3 -0
  132. package/nuxt/components/switchProps.js +3 -0
  133. package/nuxt/components/tabsProps.js +3 -0
  134. package/nuxt/components/tagProps.js +3 -0
  135. package/nuxt/components/textareaProps.js +3 -0
  136. package/nuxt/components/timeAxisProps.js +3 -0
  137. package/nuxt/components/treeProps.js +3 -0
  138. package/overlay/index.es.js +127 -149
  139. package/overlay/index.umd.js +1 -1
  140. package/overlay/style.css +1 -1
  141. package/package.json +10 -44
  142. package/pagination/index.es.js +158 -148
  143. package/pagination/index.umd.js +1 -1
  144. package/pagination/style.css +1 -1
  145. package/panel/index.es.js +45 -32
  146. package/panel/index.umd.js +1 -1
  147. package/panel/style.css +1 -1
  148. package/popover/index.es.js +317 -246
  149. package/popover/index.umd.js +15 -15
  150. package/popover/style.css +1 -1
  151. package/progress/index.es.js +110 -56
  152. package/progress/index.umd.js +3 -3
  153. package/progress/style.css +1 -1
  154. package/radio/index.es.js +7964 -157
  155. package/radio/index.umd.js +27 -1
  156. package/radio/style.css +1 -1
  157. package/rate/index.es.js +77 -55
  158. package/rate/index.umd.js +1 -1
  159. package/rate/style.css +1 -1
  160. package/result/index.es.js +184 -57
  161. package/result/index.umd.js +1 -1
  162. package/result/style.css +1 -1
  163. package/ripple/index.es.js +47 -42
  164. package/ripple/index.umd.js +1 -1
  165. package/search/index.es.js +3644 -1122
  166. package/search/index.umd.js +18 -18
  167. package/search/style.css +1 -1
  168. package/select/index.es.js +9144 -597
  169. package/select/index.umd.js +27 -1
  170. package/select/style.css +1 -1
  171. package/skeleton/index.es.js +63 -41
  172. package/skeleton/index.umd.js +1 -1
  173. package/skeleton/style.css +1 -1
  174. package/slider/index.es.js +109 -75
  175. package/slider/index.umd.js +1 -1
  176. package/slider/style.css +1 -1
  177. package/splitter/index.es.js +469 -349
  178. package/splitter/index.umd.js +15 -15
  179. package/splitter/style.css +1 -1
  180. package/statistic/index.es.js +7 -18
  181. package/statistic/index.umd.js +1 -1
  182. package/status/index.es.js +27 -6
  183. package/status/index.umd.js +1 -1
  184. package/status/style.css +1 -1
  185. package/style.css +1 -1
  186. package/switch/index.es.js +7794 -64
  187. package/switch/index.umd.js +27 -1
  188. package/switch/style.css +1 -1
  189. package/table/index.es.js +10119 -1206
  190. package/table/index.umd.js +27 -1
  191. package/table/style.css +1 -1
  192. package/tabs/index.es.js +342 -141
  193. package/tabs/index.umd.js +1 -1
  194. package/tabs/style.css +1 -1
  195. package/tag/index.es.js +49 -24
  196. package/tag/index.umd.js +1 -1
  197. package/tag/style.css +1 -1
  198. package/textarea/index.es.js +7913 -83
  199. package/textarea/index.umd.js +35 -1
  200. package/textarea/style.css +1 -1
  201. package/{anchor → timeline}/index.d.ts +0 -0
  202. package/timeline/index.es.js +425 -0
  203. package/timeline/index.umd.js +1 -0
  204. package/{back-top → timeline}/package.json +1 -1
  205. package/timeline/style.css +1 -0
  206. package/tooltip/index.es.js +308 -236
  207. package/tooltip/index.umd.js +15 -15
  208. package/tooltip/style.css +1 -1
  209. package/tree/index.es.js +4189 -1851
  210. package/tree/index.umd.js +18 -18
  211. package/tree/style.css +1 -1
  212. package/upload/index.es.js +380 -123
  213. package/upload/index.umd.js +1 -1
  214. package/upload/style.css +1 -1
  215. package/vue-devui.es.js +18121 -23161
  216. package/vue-devui.umd.js +25 -15
  217. package/accordion/index.es.js +0 -720
  218. package/accordion/index.umd.js +0 -1
  219. package/accordion/package.json +0 -7
  220. package/accordion/style.css +0 -1
  221. package/anchor/index.es.js +0 -263
  222. package/anchor/index.umd.js +0 -1
  223. package/anchor/style.css +0 -1
  224. package/back-top/index.d.ts +0 -7
  225. package/back-top/index.es.js +0 -128
  226. package/back-top/index.umd.js +0 -1
  227. package/back-top/style.css +0 -1
  228. package/breadcrumb/index.d.ts +0 -7
  229. package/breadcrumb/index.es.js +0 -127
  230. package/breadcrumb/index.umd.js +0 -1
  231. package/breadcrumb/package.json +0 -7
  232. package/breadcrumb/style.css +0 -1
  233. package/carousel/index.d.ts +0 -7
  234. package/carousel/index.es.js +0 -329
  235. package/carousel/index.umd.js +0 -1
  236. package/carousel/package.json +0 -7
  237. package/carousel/style.css +0 -1
  238. package/cascader/index.d.ts +0 -7
  239. package/cascader/index.es.js +0 -5963
  240. package/cascader/index.umd.js +0 -27
  241. package/cascader/package.json +0 -7
  242. package/cascader/style.css +0 -1
  243. package/color-picker/index.d.ts +0 -7
  244. package/color-picker/index.es.js +0 -8187
  245. package/color-picker/index.umd.js +0 -27
  246. package/color-picker/package.json +0 -7
  247. package/color-picker/style.css +0 -1
  248. package/comment/index.d.ts +0 -7
  249. package/comment/index.es.js +0 -86
  250. package/comment/index.umd.js +0 -1
  251. package/comment/package.json +0 -7
  252. package/comment/style.css +0 -1
  253. package/dragdrop/index.d.ts +0 -7
  254. package/dragdrop/index.es.js +0 -157
  255. package/dragdrop/index.umd.js +0 -1
  256. package/dragdrop/package.json +0 -7
  257. package/gantt/index.d.ts +0 -7
  258. package/gantt/index.es.js +0 -523
  259. package/gantt/index.umd.js +0 -1
  260. package/gantt/package.json +0 -7
  261. package/gantt/style.css +0 -1
  262. package/input-icon/index.d.ts +0 -7
  263. package/input-icon/index.es.js +0 -331
  264. package/input-icon/index.umd.js +0 -1
  265. package/input-icon/package.json +0 -7
  266. package/input-icon/style.css +0 -1
  267. package/list/index.d.ts +0 -7
  268. package/list/index.es.js +0 -39
  269. package/list/index.umd.js +0 -1
  270. package/list/package.json +0 -7
  271. package/list/style.css +0 -1
  272. package/nav-sprite/index.d.ts +0 -7
  273. package/nav-sprite/index.es.js +0 -68
  274. package/nav-sprite/index.umd.js +0 -1
  275. package/nav-sprite/package.json +0 -7
  276. package/nuxt/components/Accordion.js +0 -3
  277. package/nuxt/components/Anchor.js +0 -3
  278. package/nuxt/components/BackTop.js +0 -3
  279. package/nuxt/components/Breadcrumb.js +0 -3
  280. package/nuxt/components/Carousel.js +0 -3
  281. package/nuxt/components/CarouselItem.js +0 -3
  282. package/nuxt/components/Cascader.js +0 -3
  283. package/nuxt/components/ColorPicker.js +0 -3
  284. package/nuxt/components/Comment.js +0 -3
  285. package/nuxt/components/FormControl.js +0 -3
  286. package/nuxt/components/FormLabel.js +0 -3
  287. package/nuxt/components/Gantt.js +0 -3
  288. package/nuxt/components/InputIcon.js +0 -3
  289. package/nuxt/components/List.js +0 -3
  290. package/nuxt/components/ListItem.js +0 -3
  291. package/nuxt/components/NavSprite.js +0 -2
  292. package/nuxt/components/QuadrantDiagram.js +0 -3
  293. package/nuxt/components/ReadTip.js +0 -3
  294. package/nuxt/components/StepsGuide.js +0 -3
  295. package/nuxt/components/Sticky.js +0 -2
  296. package/nuxt/components/TagInput.js +0 -3
  297. package/nuxt/components/TimeAxis.js +0 -3
  298. package/nuxt/components/TimeAxisItem.js +0 -3
  299. package/nuxt/components/TimePicker.js +0 -3
  300. package/nuxt/components/Transfer.js +0 -3
  301. package/nuxt/components/TreeSelect.js +0 -3
  302. package/nuxt/components/overlayEmits.js +0 -3
  303. package/nuxt/components/overlayProps.js +0 -3
  304. package/quadrant-diagram/index.d.ts +0 -7
  305. package/quadrant-diagram/index.es.js +0 -5728
  306. package/quadrant-diagram/index.umd.js +0 -27
  307. package/quadrant-diagram/package.json +0 -7
  308. package/quadrant-diagram/style.css +0 -1
  309. package/read-tip/index.d.ts +0 -7
  310. package/read-tip/index.es.js +0 -258
  311. package/read-tip/index.umd.js +0 -1
  312. package/read-tip/package.json +0 -7
  313. package/read-tip/style.css +0 -1
  314. package/steps-guide/index.d.ts +0 -7
  315. package/steps-guide/index.es.js +0 -239
  316. package/steps-guide/index.umd.js +0 -1
  317. package/steps-guide/package.json +0 -7
  318. package/steps-guide/style.css +0 -1
  319. package/sticky/index.d.ts +0 -7
  320. package/sticky/index.es.js +0 -197
  321. package/sticky/index.umd.js +0 -1
  322. package/sticky/package.json +0 -7
  323. package/tag-input/index.d.ts +0 -7
  324. package/tag-input/index.es.js +0 -329
  325. package/tag-input/index.umd.js +0 -1
  326. package/tag-input/package.json +0 -7
  327. package/tag-input/style.css +0 -1
  328. package/time-axis/index.d.ts +0 -7
  329. package/time-axis/index.es.js +0 -299
  330. package/time-axis/index.umd.js +0 -1
  331. package/time-axis/package.json +0 -7
  332. package/time-axis/style.css +0 -1
  333. package/time-picker/index.d.ts +0 -7
  334. package/time-picker/index.es.js +0 -1237
  335. package/time-picker/index.umd.js +0 -1
  336. package/time-picker/package.json +0 -7
  337. package/time-picker/style.css +0 -1
  338. package/transfer/index.d.ts +0 -7
  339. package/transfer/index.es.js +0 -7608
  340. package/transfer/index.umd.js +0 -27
  341. package/transfer/package.json +0 -7
  342. package/transfer/style.css +0 -1
  343. package/tree-select/index.d.ts +0 -7
  344. package/tree-select/index.es.js +0 -623
  345. package/tree-select/index.umd.js +0 -1
  346. package/tree-select/package.json +0 -7
  347. package/tree-select/style.css +0 -1
@@ -1,720 +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 { createVNode, getCurrentInstance, defineComponent, toRefs, inject, computed, Fragment, mergeProps, resolveComponent, isVNode, createTextVNode, provide, onMounted, watch } from "vue";
21
- import { useRoute } from "vue-router";
22
- const accordionProps = {
23
- data: {
24
- type: Array,
25
- default: null
26
- },
27
- titleKey: { type: String, default: "title" },
28
- loadingKey: { type: String, default: "loading" },
29
- childrenKey: { type: String, default: "children" },
30
- disabledKey: { type: String, default: "disabled" },
31
- activeKey: { type: String, default: "active" },
32
- openKey: { type: String, default: "open" },
33
- menuItemTemplate: { type: Boolean, default: true },
34
- itemTemplate: { type: Boolean, default: true },
35
- menuToggle: {
36
- type: Function,
37
- default: null
38
- },
39
- itemClick: {
40
- type: Function,
41
- default: null
42
- },
43
- activeItemChange: {
44
- type: Function,
45
- default: null
46
- },
47
- restrictOneOpen: { type: Boolean, default: false },
48
- autoOpenActiveMenu: { type: Boolean, default: false },
49
- showNoContent: { type: Boolean, default: true },
50
- noContentTemplate: { type: Boolean, default: true },
51
- loadingTemplate: { type: Boolean, default: true },
52
- innerListTemplate: { type: Boolean, default: true },
53
- linkType: {
54
- type: String,
55
- default: ""
56
- },
57
- linkTypeKey: { type: String, default: "linkType" },
58
- linkKey: { type: String, default: "link" },
59
- linkTargetKey: { type: String, default: "target" },
60
- linkDefaultTarget: { type: String, default: "_self" },
61
- accordionType: {
62
- type: String,
63
- default: "normal"
64
- }
65
- };
66
- const OpenIcon = () => {
67
- return createVNode("svg", {
68
- "width": "1em",
69
- "height": "1em",
70
- "viewBox": "0 0 16 16",
71
- "version": "1.1",
72
- "xmlns": "http://www.w3.org/2000/svg",
73
- "xmlns:xlink": "http://www.w3.org/1999/xlink"
74
- }, [createVNode("g", {
75
- "stroke": "none",
76
- "stroke-width": "1",
77
- "fill": "none",
78
- "fill-rule": "evenodd"
79
- }, [createVNode("path", {
80
- "d": "M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z",
81
- "fill-rule": "nonzero"
82
- }, null)])]);
83
- };
84
- const getRootSlots = () => {
85
- const rootComponentName = "DAccordion";
86
- const getRootComponent = (component) => {
87
- if (component && component.type.name === rootComponentName) {
88
- return component;
89
- }
90
- if (component && component.parent) {
91
- const parent = component.parent;
92
- return getRootComponent(parent);
93
- }
94
- };
95
- const rootComponent = getRootComponent(getCurrentInstance());
96
- return rootComponent == null ? void 0 : rootComponent.slots;
97
- };
98
- var DAccordionMenu = defineComponent({
99
- name: "DAccordionMenu",
100
- components: {
101
- OpenIcon
102
- },
103
- props: __spreadValues({
104
- item: Object,
105
- deepth: {
106
- type: Number,
107
- default: 0
108
- },
109
- parent: {
110
- type: Object,
111
- default: null
112
- }
113
- }, accordionProps),
114
- setup(props) {
115
- const {
116
- item,
117
- deepth,
118
- parent,
119
- openKey,
120
- activeKey,
121
- autoOpenActiveMenu,
122
- disabledKey,
123
- childrenKey,
124
- titleKey,
125
- menuItemTemplate
126
- } = toRefs(props);
127
- const rootSlots = getRootSlots();
128
- const accordionCtx = inject("accordionContext");
129
- const parentValue = parent.value;
130
- const deepValue = deepth.value;
131
- const toggle = (itemEvent) => {
132
- accordionCtx.menuToggleFn(itemEvent);
133
- };
134
- const hasActiveChildren = (item2) => {
135
- if (item2[activeKey.value] === true)
136
- return true;
137
- if (item2[childrenKey.value]) {
138
- return hasChildActive(item2[childrenKey.value]);
139
- }
140
- };
141
- const hasChildActive = (arr) => {
142
- let flag = false;
143
- if (!arr.length)
144
- return false;
145
- for (let i = 0; i < arr.length; i++) {
146
- if (arr[i][activeKey.value] === true) {
147
- flag = true;
148
- break;
149
- }
150
- if (arr[i][childrenKey.value]) {
151
- flag = hasChildActive(arr[i][childrenKey.value]);
152
- if (flag)
153
- break;
154
- }
155
- }
156
- return flag;
157
- };
158
- const keyOpen = computed(() => {
159
- return item.value && item.value[openKey.value];
160
- });
161
- const disabled = computed(() => {
162
- return item.value && item.value[disabledKey.value];
163
- });
164
- const title = computed(() => {
165
- return item.value && item.value[titleKey.value];
166
- });
167
- const children = computed(() => {
168
- return item.value && item.value[childrenKey.value];
169
- });
170
- const childActived = computed(() => {
171
- return hasActiveChildren(item.value);
172
- });
173
- const open = computed(() => {
174
- return keyOpen.value === void 0 && autoOpenActiveMenu.value ? childActived.value : keyOpen.value;
175
- });
176
- return () => {
177
- var _a;
178
- return createVNode(Fragment, null, [createVNode("div", {
179
- "class": ["devui-accordion-item-title", "devui-over-flow-ellipsis", open.value && "open", childActived.value && "active", disabled.value && "disabled"],
180
- "title": title.value,
181
- "style": {
182
- textIndent: deepValue * 20 + "px"
183
- },
184
- "onClick": (e) => !disabled.value && toggle({
185
- item: item.value,
186
- open: !open.value,
187
- parent: parentValue,
188
- event: e
189
- })
190
- }, [createVNode("div", {
191
- "class": ["devui-accordion-splitter", deepValue === 0 && "devui-parent-list"],
192
- "style": {
193
- left: deepValue * 20 + 10 + "px"
194
- }
195
- }, null), (!rootSlots.menuItemTemplate || menuItemTemplate.value === false) && createVNode(Fragment, null, [title.value]), rootSlots.menuItemTemplate && menuItemTemplate.value !== false && ((_a = rootSlots.menuItemTemplate) == null ? void 0 : _a.call(rootSlots, {
196
- parent: parentValue,
197
- deepth: deepValue,
198
- item: item.value
199
- })), createVNode("span", {
200
- "class": "devui-accordion-open-icon"
201
- }, [createVNode(OpenIcon, null, null)])]), createVNode("div", {
202
- "class": [!open.value && "devui-accordion-menu-hidden", "devui-accordion-submenu", "devui-accordion-show-animate"]
203
- }, [createVNode(AccordionList, mergeProps(props, {
204
- "deepth": deepValue + 1,
205
- "data": children.value || [],
206
- "parent": item.value
207
- }), null)])]);
208
- };
209
- }
210
- });
211
- var DAccordionItem = defineComponent({
212
- name: "DAccordionItem",
213
- props: __spreadValues({
214
- item: Object,
215
- deepth: {
216
- type: Number,
217
- default: 0
218
- },
219
- parent: {
220
- type: Object,
221
- default: null
222
- }
223
- }, accordionProps),
224
- setup(props) {
225
- const {
226
- item,
227
- deepth,
228
- parent,
229
- titleKey,
230
- activeKey,
231
- disabledKey,
232
- itemTemplate
233
- } = toRefs(props);
234
- const rootSlots = getRootSlots();
235
- const accordionCtx = inject("accordionContext");
236
- const parentValue = parent.value;
237
- const deepValue = deepth.value;
238
- const disabled = computed(() => {
239
- return item.value && item.value[disabledKey.value];
240
- });
241
- const title = computed(() => {
242
- return item.value && item.value[titleKey.value];
243
- });
244
- const active = computed(() => {
245
- return item.value && item.value[activeKey.value];
246
- });
247
- const childActived = computed(() => {
248
- return active.value;
249
- });
250
- const itemClick = (itemEvent) => {
251
- if (item.value && !disabled.value) {
252
- accordionCtx.itemClickFn(itemEvent);
253
- }
254
- };
255
- return () => {
256
- var _a;
257
- return createVNode(Fragment, null, [createVNode("div", {
258
- "class": ["devui-accordion-item-title", "devui-over-flow-ellipsis", childActived.value && "active", disabled.value && "disabled"],
259
- "title": title.value,
260
- "style": {
261
- textIndent: deepValue * 20 + "px"
262
- },
263
- "onClick": (e) => itemClick({
264
- item: item.value,
265
- parent: parentValue,
266
- event: e
267
- })
268
- }, [createVNode("div", {
269
- "class": ["devui-accordion-splitter", deepValue === 0 && "devui-parent-list"],
270
- "style": {
271
- left: deepValue * 20 + 10 + "px"
272
- }
273
- }, null), (!rootSlots.itemTemplate || itemTemplate.value === false) && createVNode(Fragment, null, [title.value]), rootSlots.itemTemplate && itemTemplate.value !== false && ((_a = rootSlots.itemTemplate) == null ? void 0 : _a.call(rootSlots, {
274
- parent: parentValue,
275
- deepth: deepValue,
276
- item: item.value
277
- }))])]);
278
- };
279
- }
280
- });
281
- var DAccordionItemHreflink = defineComponent({
282
- name: "DAccordionItemHreflink",
283
- component: {
284
- DAccordionItem
285
- },
286
- props: __spreadValues({
287
- item: Object,
288
- deepth: {
289
- type: Number,
290
- default: 0
291
- },
292
- parent: {
293
- type: Object,
294
- default: null
295
- }
296
- }, accordionProps),
297
- setup(props) {
298
- const {
299
- item,
300
- deepth,
301
- parent,
302
- titleKey,
303
- linkKey,
304
- linkTargetKey,
305
- linkDefaultTarget,
306
- disabledKey,
307
- itemTemplate
308
- } = toRefs(props);
309
- const rootSlots = getRootSlots();
310
- const accordionCtx = inject("accordionContext");
311
- const title = computed(() => {
312
- return item.value && item.value[titleKey.value];
313
- });
314
- const link = computed(() => {
315
- return item.value && item.value[linkKey.value];
316
- });
317
- const target = computed(() => {
318
- return item.value && (item.value[linkTargetKey.value] || linkDefaultTarget.value);
319
- });
320
- const disabled = computed(() => {
321
- return item.value && item.value[disabledKey.value];
322
- });
323
- const parentValue = parent.value;
324
- const deepValue = deepth.value;
325
- const linkItemClickFn = (itemEvent) => {
326
- if (item.value && !disabled.value) {
327
- accordionCtx.itemClickFn(itemEvent);
328
- }
329
- };
330
- const renderContent = () => {
331
- var _a;
332
- return createVNode(Fragment, null, [createVNode("div", {
333
- "class": ["devui-accordion-splitter", deepValue === 0 && "devui-parent-list"],
334
- "style": {
335
- left: deepValue * 20 + 10 + "px"
336
- }
337
- }, null), (!rootSlots.itemTemplate || itemTemplate.value === false) && createVNode(Fragment, null, [title.value]), rootSlots.itemTemplate && itemTemplate.value !== false && ((_a = rootSlots.itemTemplate) == null ? void 0 : _a.call(rootSlots, {
338
- parent: parentValue,
339
- deepth: deepValue,
340
- item: item.value
341
- }))]);
342
- };
343
- return () => {
344
- return createVNode(Fragment, null, [createVNode("div", {
345
- "class": ["devui-accordion-item-title", disabled.value && "disabled"],
346
- "style": {
347
- textIndent: deepValue * 20 + "px"
348
- }
349
- }, [!disabled.value && createVNode("a", {
350
- "href": link.value,
351
- "target": target.value,
352
- "class": "devui-over-flow-ellipsis",
353
- "title": title.value,
354
- "onClick": (e) => linkItemClickFn({
355
- item: item.value,
356
- parent: parentValue,
357
- event: e
358
- })
359
- }, [renderContent()]), disabled.value && createVNode("a", {
360
- "class": "devui-over-flow-ellipsis",
361
- "title": title.value
362
- }, [renderContent()])])]);
363
- };
364
- }
365
- });
366
- function _isSlot(s) {
367
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
368
- }
369
- var DAccordionItemRouterlink = defineComponent({
370
- name: "DAccordionItemRouterlink",
371
- component: {
372
- DAccordionItem
373
- },
374
- props: __spreadValues({
375
- item: Object,
376
- deepth: {
377
- type: Number,
378
- default: 0
379
- },
380
- parent: {
381
- type: Object,
382
- default: null
383
- }
384
- }, accordionProps),
385
- setup(props) {
386
- const {
387
- item,
388
- deepth,
389
- parent,
390
- titleKey,
391
- linkKey,
392
- linkDefaultTarget,
393
- disabledKey,
394
- itemTemplate
395
- } = toRefs(props);
396
- const route = useRoute();
397
- const rootSlots = getRootSlots();
398
- const accordionCtx = inject("accordionContext");
399
- console.log(useRoute());
400
- const title = computed(() => {
401
- return item.value && item.value[titleKey.value];
402
- });
403
- const link = computed(() => {
404
- return item.value && item.value[linkKey.value];
405
- });
406
- const isUsedVueRouter = computed(() => route !== void 0);
407
- const routerLinkActive = computed(() => {
408
- return route === link.value;
409
- });
410
- const disabled = computed(() => {
411
- return item.value && item.value[disabledKey.value];
412
- });
413
- const parentValue = parent.value;
414
- const deepValue = deepth.value;
415
- const linkItemClickFn = (itemEvent) => {
416
- if (item.value && !disabled.value) {
417
- accordionCtx.itemClickFn(itemEvent);
418
- }
419
- };
420
- const renderContent = () => {
421
- var _a;
422
- return createVNode(Fragment, null, [createVNode("div", {
423
- "class": ["devui-accordion-splitter", deepValue === 0 && "devui-parent-list"],
424
- "style": {
425
- left: deepValue * 20 + 10 + "px"
426
- }
427
- }, null), (!rootSlots.itemTemplate || itemTemplate.value === false) && createVNode(Fragment, null, [title.value]), rootSlots.itemTemplate && itemTemplate.value !== false && ((_a = rootSlots.itemTemplate) == null ? void 0 : _a.call(rootSlots, {
428
- parent: parentValue,
429
- deepth: deepValue,
430
- item: item.value
431
- }))]);
432
- };
433
- return () => {
434
- let _slot;
435
- return createVNode(Fragment, null, [createVNode("div", {
436
- "class": ["devui-accordion-item-title", disabled.value && "disabled"],
437
- "style": {
438
- textIndent: deepValue * 20 + "px"
439
- }
440
- }, [!disabled.value && createVNode(Fragment, null, [isUsedVueRouter.value && createVNode(resolveComponent("router-link"), {
441
- "to": link.value,
442
- "class": ["devui-over-flow-ellipsis", routerLinkActive.value && ".devui-router-active"],
443
- "custom": true,
444
- "title": title.value,
445
- "onClick": (e) => linkItemClickFn({
446
- item: item.value,
447
- parent: parentValue,
448
- event: e
449
- })
450
- }, _isSlot(_slot = renderContent()) ? _slot : {
451
- default: () => [_slot]
452
- }), !isUsedVueRouter.value && createVNode("a", {
453
- "href": link.value,
454
- "target": linkDefaultTarget.value,
455
- "class": "devui-over-flow-ellipsis",
456
- "title": title.value,
457
- "onClick": (e) => linkItemClickFn({
458
- item: item.value,
459
- parent: parentValue,
460
- event: e
461
- })
462
- }, [renderContent()])]), disabled.value && createVNode("a", {
463
- "class": "devui-over-flow-ellipsis",
464
- "title": title.value
465
- }, [renderContent()])])]);
466
- };
467
- }
468
- });
469
- var AccordionList = defineComponent({
470
- name: "DAccordionList",
471
- components: {
472
- DAccordionMenu,
473
- DAccordionItem,
474
- DAccordionItemHreflink,
475
- DAccordionItemRouterlink
476
- },
477
- inheritAttrs: false,
478
- props: __spreadValues({
479
- data: {
480
- type: Array,
481
- default: null
482
- },
483
- deepth: {
484
- type: Number,
485
- default: 0
486
- },
487
- parent: {
488
- type: Object,
489
- default: null
490
- },
491
- innerListTemplate: Boolean
492
- }, accordionProps),
493
- setup(props, {
494
- attrs
495
- }) {
496
- const {
497
- childrenKey,
498
- deepth,
499
- parent,
500
- data,
501
- linkType,
502
- showNoContent,
503
- loadingKey,
504
- titleKey,
505
- linkTypeKey,
506
- loadingTemplate,
507
- noContentTemplate,
508
- innerListTemplate
509
- } = toRefs(props);
510
- const parentValue = parent.value;
511
- const deepValue = deepth.value;
512
- const rootSlots = getRootSlots();
513
- const accordionCtx = inject("accordionContext");
514
- const loading = computed(() => {
515
- return parentValue && parentValue[loadingKey.value];
516
- });
517
- const noContent = computed(() => {
518
- const dataValue = data.value;
519
- return dataValue === void 0 || dataValue === null || dataValue.length === 0;
520
- });
521
- return () => {
522
- var _a, _b, _c;
523
- return createVNode(Fragment, null, [(!rootSlots.innerListTemplate || deepth.value === 0 || innerListTemplate.value === false) && createVNode("ul", mergeProps({
524
- "class": ["devui-accordion-list"]
525
- }, attrs), [data.value.map((item) => {
526
- return createVNode("li", {
527
- "class": "devui-accordion-item",
528
- "key": item[titleKey.value]
529
- }, [item[childrenKey.value] !== void 0 && createVNode("div", {
530
- "class": "devui-accordion-menu-item"
531
- }, [createVNode(resolveComponent("d-accordion-menu"), mergeProps(props, {
532
- "item": item,
533
- "deepth": deepValue,
534
- "parent": parentValue
535
- }), null)]), item[childrenKey.value] === void 0 && createVNode(Fragment, null, [(!linkType.value || linkType.value === "") && createVNode(resolveComponent("d-accordion-item"), mergeProps(props, {
536
- "item": item,
537
- "deepth": deepValue,
538
- "parent": parentValue
539
- }), null), linkType.value === "routerLink" && createVNode(resolveComponent("d-accordion-item-routerlink"), mergeProps(props, {
540
- "item": item,
541
- "deepth": deepValue,
542
- "parent": parentValue
543
- }), null), linkType.value === "hrefLink" && createVNode(resolveComponent("d-accordion-item-hreflink"), mergeProps(props, {
544
- "item": item,
545
- "deepth": deepValue,
546
- "parent": parentValue
547
- }), null), linkType.value === "dependOnLinkTypeKey" && createVNode(Fragment, null, [item[linkTypeKey.value] === "routerLink" && createVNode(resolveComponent("d-accordion-item-routerlink"), mergeProps(props, {
548
- "item": item,
549
- "deepth": deepValue,
550
- "parent": parentValue
551
- }), null), item[linkTypeKey.value] === "hrefLink" && createVNode(resolveComponent("d-accordion-item-hreflink"), mergeProps(props, {
552
- "item": item,
553
- "deepth": deepValue,
554
- "parent": parentValue
555
- }), null), item[linkTypeKey.value] !== "routerLink" && item[linkTypeKey.value] !== "hrefLink" && createVNode(resolveComponent("d-accordion-item"), mergeProps(props, {
556
- "item": item,
557
- "deepth": deepValue,
558
- "parent": parentValue
559
- }), null)])])]);
560
- })]), rootSlots.innerListTemplate && innerListTemplate.value !== false && deepValue !== 0 && ((_a = rootSlots.innerListTemplate) == null ? void 0 : _a.call(rootSlots, {
561
- item: parentValue,
562
- deepth: deepValue,
563
- itemClickFn: accordionCtx.itemClickFn,
564
- menuToggleFn: accordionCtx.menuToggleFn
565
- })), (!rootSlots.innerListTemplate || innerListTemplate.value === false) && (loading.value || noContent.value && showNoContent.value) && createVNode("ul", mergeProps({
566
- "class": ["devui-accordion-list"]
567
- }, attrs), [
568
- loading.value && (!rootSlots.loadingTemplate || loadingTemplate.value === false) && createVNode("li", {
569
- "class": "devui-accordion-item"
570
- }, [createVNode("div", {
571
- "class": ["devui-accordion-item-title", "devui-over-flow-ellipsis"],
572
- "style": {
573
- textIndent: deepValue * 20 + "px"
574
- }
575
- }, [createTextVNode("\u52A0\u8F7D\u4E2D...")])]),
576
- loading.value && rootSlots.loadingTemplate && loadingTemplate.value !== false && ((_b = rootSlots.loadingTemplate) == null ? void 0 : _b.call(rootSlots, {
577
- item: parentValue,
578
- deepth: deepValue
579
- })),
580
- showNoContent.value && !loading.value && noContent.value && (!rootSlots.noContentTemplate || noContentTemplate.value === false) && createVNode("li", {
581
- "class": "devui-accordion-item"
582
- }, [createVNode("div", {
583
- "class": ["devui-accordion-item-title", "devui-over-flow-ellipsis disabled"],
584
- "style": {
585
- textIndent: deepValue * 20 + "px"
586
- }
587
- }, [createTextVNode("\u6CA1\u6709\u6570\u636E")])]),
588
- showNoContent.value && !loading.value && noContent.value && rootSlots.noContentTemplate && noContentTemplate.value !== false && ((_c = rootSlots.noContentTemplate) == null ? void 0 : _c.call(rootSlots, {
589
- item: parentValue,
590
- deepth: deepValue
591
- }))
592
- ])]);
593
- };
594
- }
595
- });
596
- var accordion = "";
597
- var Accordion = defineComponent({
598
- name: "DAccordion",
599
- props: accordionProps,
600
- setup(props, {
601
- emit
602
- }) {
603
- const {
604
- data,
605
- childrenKey,
606
- activeKey,
607
- openKey,
608
- accordionType,
609
- autoOpenActiveMenu,
610
- restrictOneOpen
611
- } = toRefs(props);
612
- let clickActiveItem = void 0;
613
- const flatten = (arr, childrenKey2 = "children", includeParent = false, includeLeaf = true) => {
614
- return arr.reduce((acc, cur) => {
615
- const children = cur[childrenKey2];
616
- if (children === void 0) {
617
- if (includeLeaf) {
618
- acc.push(cur);
619
- }
620
- } else {
621
- if (includeParent) {
622
- acc.push(cur);
623
- }
624
- if (Array.isArray(children)) {
625
- acc.push(...flatten(children, childrenKey2, includeParent));
626
- }
627
- }
628
- return acc;
629
- }, []);
630
- };
631
- const initActiveItem = () => {
632
- const activeItem = flatten(data.value, childrenKey.value).filter((item) => item[activeKey.value]).pop();
633
- if (activeItem) {
634
- if (!clickActiveItem) {
635
- activeItemFn(activeItem);
636
- }
637
- } else {
638
- clickActiveItem = void 0;
639
- }
640
- };
641
- const activeItemFn = (item) => {
642
- if (clickActiveItem && clickActiveItem[activeKey.value]) {
643
- clickActiveItem[activeKey.value] = false;
644
- }
645
- item[activeKey.value] = true;
646
- clickActiveItem = item;
647
- emit("activeItemChange", clickActiveItem);
648
- };
649
- const openMenuFn = (item, open) => {
650
- if (open && restrictOneOpen.value) {
651
- data.value.forEach((itemtemp) => {
652
- itemtemp[openKey.value] = false;
653
- });
654
- }
655
- item[openKey.value] = open;
656
- };
657
- const itemClickFn = (itemEvent) => {
658
- const prevActiveItem = clickActiveItem;
659
- activeItemFn(itemEvent.item);
660
- emit("itemClick", __spreadProps(__spreadValues({}, itemEvent), {
661
- prevActiveItem
662
- }));
663
- };
664
- const linkItemClickFn = (itemEvent) => {
665
- const prevActiveItem = clickActiveItem;
666
- clickActiveItem = itemEvent.item;
667
- emit("linkItemClick", __spreadProps(__spreadValues({}, itemEvent), {
668
- prevActiveItem
669
- }));
670
- };
671
- const menuToggleFn = (menuEvent) => {
672
- openMenuFn(menuEvent.item, menuEvent.open);
673
- emit("menuToggle", menuEvent);
674
- };
675
- const cleanOpenData = () => {
676
- flatten(data.value, childrenKey.value, true, false).forEach((item) => item[openKey.value] = void 0);
677
- };
678
- provide("accordionContext", {
679
- itemClickFn,
680
- linkItemClickFn,
681
- menuToggleFn
682
- });
683
- onMounted(() => {
684
- if (data.value) {
685
- initActiveItem();
686
- }
687
- });
688
- watch(() => autoOpenActiveMenu.value, (current, preV) => {
689
- if (current && preV === false) {
690
- cleanOpenData();
691
- }
692
- });
693
- watch(data.value, (current, preV) => {
694
- initActiveItem();
695
- }, {
696
- deep: true
697
- });
698
- return () => {
699
- return createVNode("div", {
700
- "class": ["devui-accordion-menu", "devui-scrollbar", "devui-accordion-show-animate", accordionType.value === "normal" && "devui-accordion-menu-normal"]
701
- }, [createVNode(AccordionList, mergeProps(props, {
702
- "data": data.value,
703
- "deepth": 0,
704
- "parent": null
705
- }), null)]);
706
- };
707
- }
708
- });
709
- Accordion.install = function(app) {
710
- app.component(Accordion.name, Accordion);
711
- };
712
- var index = {
713
- title: "Accordion \u624B\u98CE\u7434",
714
- category: "\u5BFC\u822A",
715
- status: "10%",
716
- install(app) {
717
- app.use(Accordion);
718
- }
719
- };
720
- export { Accordion, index as default };