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,329 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- import { createVNode, mergeProps, defineComponent, ref, computed, watch, nextTick } from "vue";
18
- var removeBtnSvg = createVNode("svg", mergeProps({
19
- "width": "12px",
20
- "height": "12px",
21
- "viewBox": "0 0 12 12",
22
- "version": "1.1",
23
- "xmlns": "http://www.w3.org/2000/svg"
24
- }, {
25
- "xmlns:xlink": "http://www.w3.org/1999/xlink"
26
- }), [createVNode("g", {
27
- "stroke": "none",
28
- "stroke-width": "1",
29
- "fill": "none",
30
- "fill-rule": "evenodd"
31
- }, [createVNode("path", {
32
- "d": "M8.86785321,3.13214679 C9.02624037,3.29053395 9.02624037,3.54733027 8.86785321,3.70571743 L6.573,6 L8.86785321,8.29428257 C9.02624037,8.45266973 9.02624037,8.70946605 8.86785321,8.86785321 C8.70946605,9.02624037 8.45266973,9.02624037 8.29428257,8.86785321 L6,6.573 L3.70571743,8.86785321 C3.54733027,9.02624037 3.29053395,9.02624037 3.13214679,8.86785321 C2.97375963,8.70946605 2.97375963,8.45266973 3.13214679,8.29428257 L5.427,6 L3.13214679,3.70571743 C2.97375963,3.54733027 2.97375963,3.29053395 3.13214679,3.13214679 C3.29053395,2.97375963 3.54733027,2.97375963 3.70571743,3.13214679 L6,5.427 L8.29428257,3.13214679 C8.45266973,2.97375963 8.70946605,2.97375963 8.86785321,3.13214679 Z",
33
- "fill-rule": "nonzero"
34
- }, null)])]);
35
- var tagInput = "";
36
- const tagInputProps = {
37
- tags: {
38
- type: Array,
39
- default: () => []
40
- },
41
- displayProperty: {
42
- type: String,
43
- default: "name"
44
- },
45
- placeholder: {
46
- type: String,
47
- default: ""
48
- },
49
- minLength: {
50
- type: Number,
51
- default: 3
52
- },
53
- maxLength: {
54
- type: Number,
55
- default: Number.MAX_SAFE_INTEGER
56
- },
57
- maxTags: {
58
- type: Number,
59
- default: Number.MAX_SAFE_INTEGER
60
- },
61
- maxTagsText: {
62
- type: String,
63
- default: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
64
- },
65
- spellcheck: {
66
- type: Boolean,
67
- default: true
68
- },
69
- suggestionList: {
70
- type: Array,
71
- default: () => []
72
- },
73
- disabled: {
74
- type: Boolean,
75
- default: false
76
- },
77
- isAddBySpace: {
78
- type: Boolean,
79
- default: true
80
- },
81
- disabledText: {
82
- type: String,
83
- default: ""
84
- },
85
- noData: {
86
- type: String,
87
- default: ""
88
- },
89
- caseSensitivity: {
90
- type: Boolean,
91
- default: false
92
- }
93
- };
94
- const KEYS_MAP = {
95
- tab: "Tab",
96
- down: "ArrowDown",
97
- up: "ArrowUp",
98
- enter: "Enter",
99
- space: " "
100
- };
101
- var TagInput = defineComponent({
102
- name: "DTagInput",
103
- props: tagInputProps,
104
- emits: ["update:tags", "update:suggestionList", "valueChange"],
105
- setup(props, ctx) {
106
- const add = (arr, target) => {
107
- const res = Object.assign({}, target);
108
- delete res.__index;
109
- return arr.concat(res);
110
- };
111
- const remove = (arr, targetIdx) => {
112
- const newArr = arr.slice();
113
- newArr.splice(targetIdx, 1);
114
- return newArr;
115
- };
116
- const tagInputVal = ref("");
117
- const onInput = ($event) => {
118
- const v = $event.target.value || "";
119
- tagInputVal.value = v.trim();
120
- };
121
- const mergedSuggestions = computed(() => {
122
- let suggestions = props.suggestionList.map((item, index2) => {
123
- return __spreadValues({
124
- __index: index2
125
- }, item);
126
- });
127
- if (tagInputVal.value === "") {
128
- return suggestions;
129
- }
130
- return suggestions = props.caseSensitivity ? suggestions.filter((item) => item[props.displayProperty].indexOf(tagInputVal.value) !== -1) : suggestions.filter((item) => item[props.displayProperty].toLowerCase().indexOf(tagInputVal.value.toLowerCase()) !== -1);
131
- });
132
- const selectIndex = ref(0);
133
- watch(mergedSuggestions, () => {
134
- selectIndex.value = 0;
135
- });
136
- const onSelectIndexChange = (isUp = false) => {
137
- if (isUp) {
138
- selectIndex.value < mergedSuggestions.value.length - 1 ? selectIndex.value++ : selectIndex.value = 0;
139
- return;
140
- }
141
- selectIndex.value > 0 ? selectIndex.value-- : selectIndex.value = mergedSuggestions.value.length - 1;
142
- };
143
- const tagInputRef = ref(null);
144
- const isInputBoxFocus = ref(false);
145
- const onInputFocus = () => {
146
- isInputBoxFocus.value = true;
147
- };
148
- const onInputBlur = () => {
149
- isInputBoxFocus.value = false;
150
- };
151
- const handleEnter = () => {
152
- let res = {
153
- [props.displayProperty]: tagInputVal.value
154
- };
155
- if (tagInputVal.value === "" && mergedSuggestions.value.length === 0)
156
- return false;
157
- if (props.tags.findIndex((item) => item[props.displayProperty] === tagInputVal.value) > -1) {
158
- tagInputVal.value = "";
159
- return false;
160
- }
161
- if (mergedSuggestions.value.length === 0 && (tagInputVal.value.length < props.minLength || tagInputVal.value.length > props.maxLength)) {
162
- tagInputVal.value = "";
163
- return false;
164
- }
165
- if (mergedSuggestions.value.length) {
166
- const target = mergedSuggestions.value[selectIndex.value];
167
- res = target;
168
- ctx.emit("update:suggestionList", remove(props.suggestionList, target.__index));
169
- }
170
- const newTags = add(props.tags, res);
171
- ctx.emit("valueChange", props.tags, newTags);
172
- ctx.emit("update:tags", newTags);
173
- mergedSuggestions.value.length === 0 && (tagInputVal.value = "");
174
- };
175
- const onInputKeydown = ($event) => {
176
- switch ($event.key) {
177
- case KEYS_MAP.tab:
178
- case KEYS_MAP.enter:
179
- case KEYS_MAP.space:
180
- if (!props.isAddBySpace && KEYS_MAP.space)
181
- return;
182
- handleEnter();
183
- break;
184
- case KEYS_MAP.down:
185
- onSelectIndexChange(true);
186
- break;
187
- case KEYS_MAP.up:
188
- onSelectIndexChange();
189
- break;
190
- }
191
- };
192
- const removeTag = ($event, tagIdx) => {
193
- $event.preventDefault();
194
- ctx.emit("update:suggestionList", add(props.suggestionList, props.tags[tagIdx]));
195
- const newTags = remove(props.tags, tagIdx);
196
- ctx.emit("valueChange", props.tags, newTags);
197
- ctx.emit("update:tags", newTags);
198
- nextTick(() => {
199
- var _a;
200
- (_a = tagInputRef.value) == null ? void 0 : _a.focus();
201
- });
202
- };
203
- const onSuggestionItemClick = ($event, itemIndex) => {
204
- $event.preventDefault();
205
- const target = mergedSuggestions.value[itemIndex];
206
- const newTags = add(props.tags, target);
207
- const newSuggestions = remove(props.suggestionList, target.__index);
208
- ctx.emit("valueChange", props.tags, newTags);
209
- ctx.emit("update:tags", newTags);
210
- ctx.emit("update:suggestionList", newSuggestions);
211
- };
212
- const isTagsLimit = computed(() => props.maxTags <= props.tags.length);
213
- const isShowSuggestion = computed(() => {
214
- return !props.disabled && !isTagsLimit.value && isInputBoxFocus.value;
215
- });
216
- return {
217
- tagInputRef,
218
- tagInputVal,
219
- isInputBoxFocus,
220
- onInput,
221
- onInputFocus,
222
- onInputBlur,
223
- removeTag,
224
- onSuggestionItemClick,
225
- onInputKeydown,
226
- isShowSuggestion,
227
- mergedSuggestions,
228
- selectIndex,
229
- isTagsLimit
230
- };
231
- },
232
- render() {
233
- const {
234
- tagInputVal,
235
- isInputBoxFocus,
236
- disabled,
237
- disabledText,
238
- isTagsLimit,
239
- maxTagsText,
240
- displayProperty,
241
- tags,
242
- onInputKeydown,
243
- onInputFocus,
244
- onInputBlur,
245
- onInput,
246
- onSuggestionItemClick,
247
- removeTag,
248
- placeholder,
249
- spellcheck,
250
- isShowSuggestion,
251
- noData,
252
- mergedSuggestions,
253
- selectIndex,
254
- maxTags
255
- } = this;
256
- const inputBoxCls = {
257
- "devui-tags": true,
258
- "devui-form-control": true,
259
- "devui-dropdown-origin": true,
260
- "devui-dropdown-origin-open": isInputBoxFocus,
261
- "devui-disabled": disabled
262
- };
263
- const tagInputCls = {
264
- input: true,
265
- "devui-input": true,
266
- "invalid-tag": false
267
- };
268
- const tagInputStyle = [`display:${disabled ? "none" : "block"};`];
269
- const noDataTpl = createVNode("li", {
270
- "class": "devui-suggestion-item devui-disabled"
271
- }, [noData]);
272
- return createVNode("div", {
273
- "class": "devui-tags-host",
274
- "tabindex": "-1"
275
- }, [createVNode("div", {
276
- "class": inputBoxCls,
277
- "style": ["box-shadow: none;"]
278
- }, [createVNode("ul", {
279
- "class": "devui-tag-list",
280
- "title": disabled ? disabledText : ""
281
- }, [tags.map((tag, tagIdx) => {
282
- return createVNode("li", {
283
- "class": "devui-tag-item"
284
- }, [createVNode("span", null, [tag[displayProperty]]), !disabled && createVNode("a", {
285
- "class": "remove-button",
286
- "onMousedown": ($event) => removeTag($event, tagIdx)
287
- }, [removeBtnSvg])]);
288
- })]), createVNode("input", {
289
- "type": "text",
290
- "ref": "tagInputRef",
291
- "value": tagInputVal,
292
- "class": tagInputCls,
293
- "style": tagInputStyle,
294
- "onKeydown": onInputKeydown,
295
- "onFocus": onInputFocus,
296
- "onBlur": onInputBlur,
297
- "onInput": ($event) => onInput($event),
298
- "placeholder": isTagsLimit ? `${maxTagsText} ${maxTags}` : placeholder,
299
- "spellcheck": spellcheck,
300
- "disabled": isTagsLimit
301
- }, null)]), !isShowSuggestion ? "" : createVNode("div", {
302
- "class": "devui-tags-autocomplete devui-dropdown-menu"
303
- }, [createVNode("ul", {
304
- "class": "devui-suggestion-list"
305
- }, [mergedSuggestions.length === 0 ? noDataTpl : mergedSuggestions.map((item, index2) => {
306
- return createVNode("li", {
307
- "class": {
308
- "devui-suggestion-item": true,
309
- selected: index2 === selectIndex
310
- },
311
- "onMousedown": ($event) => {
312
- onSuggestionItemClick($event, index2);
313
- }
314
- }, [item[displayProperty]]);
315
- })])])]);
316
- }
317
- });
318
- TagInput.install = function(app) {
319
- app.component(TagInput.name, TagInput);
320
- };
321
- var index = {
322
- title: "TagInput \u6807\u7B7E\u8F93\u5165\u6846",
323
- category: "\u6570\u636E\u5F55\u5165",
324
- status: "100%",
325
- install(app) {
326
- app.use(TagInput);
327
- }
328
- };
329
- export { TagInput, index as default };
@@ -1 +0,0 @@
1
- var K=Object.defineProperty;var A=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var E=(u,e,o)=>e in u?K(u,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):u[e]=o,P=(u,e)=>{for(var o in e||(e={}))O.call(e,o)&&E(u,o,e[o]);if(A)for(var o of A(e))R.call(e,o)&&E(u,o,e[o]);return u};(function(u,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis!="undefined"?globalThis:u||self,e(u.index={},u.Vue))})(this,function(u,e){"use strict";var o=e.createVNode("svg",e.mergeProps({width:"12px",height:"12px",viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},{"xmlns:xlink":"http://www.w3.org/1999/xlink"}),[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:"M8.86785321,3.13214679 C9.02624037,3.29053395 9.02624037,3.54733027 8.86785321,3.70571743 L6.573,6 L8.86785321,8.29428257 C9.02624037,8.45266973 9.02624037,8.70946605 8.86785321,8.86785321 C8.70946605,9.02624037 8.45266973,9.02624037 8.29428257,8.86785321 L6,6.573 L3.70571743,8.86785321 C3.54733027,9.02624037 3.29053395,9.02624037 3.13214679,8.86785321 C2.97375963,8.70946605 2.97375963,8.45266973 3.13214679,8.29428257 L5.427,6 L3.13214679,3.70571743 C2.97375963,3.54733027 2.97375963,3.29053395 3.13214679,3.13214679 C3.29053395,2.97375963 3.54733027,2.97375963 3.70571743,3.13214679 L6,5.427 L8.29428257,3.13214679 C8.45266973,2.97375963 8.70946605,2.97375963 8.86785321,3.13214679 Z","fill-rule":"nonzero"},null)])]),j="";const F={tags:{type:Array,default:()=>[]},displayProperty:{type:String,default:"name"},placeholder:{type:String,default:""},minLength:{type:Number,default:3},maxLength:{type:Number,default:Number.MAX_SAFE_INTEGER},maxTags:{type:Number,default:Number.MAX_SAFE_INTEGER},maxTagsText:{type:String,default:"\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"},spellcheck:{type:Boolean,default:!0},suggestionList:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},isAddBySpace:{type:Boolean,default:!0},disabledText:{type:String,default:""},noData:{type:String,default:""},caseSensitivity:{type:Boolean,default:!1}},p={tab:"Tab",down:"ArrowDown",up:"ArrowUp",enter:"Enter",space:" "};var m=e.defineComponent({name:"DTagInput",props:F,emits:["update:tags","update:suggestionList","valueChange"],setup(t,d){const g=(n,a)=>{const s=Object.assign({},a);return delete s.__index,n.concat(s)},v=(n,a)=>{const s=n.slice();return s.splice(a,1),s},l=e.ref(""),b=n=>{const a=n.target.value||"";l.value=a.trim()},i=e.computed(()=>{let n=t.suggestionList.map((a,s)=>P({__index:s},a));return l.value===""?n:n=t.caseSensitivity?n.filter(a=>a[t.displayProperty].indexOf(l.value)!==-1):n.filter(a=>a[t.displayProperty].toLowerCase().indexOf(l.value.toLowerCase())!==-1)}),r=e.ref(0);e.watch(i,()=>{r.value=0});const h=(n=!1)=>{if(n){r.value<i.value.length-1?r.value++:r.value=0;return}r.value>0?r.value--:r.value=i.value.length-1},w=e.ref(null),f=e.ref(!1),S=()=>{f.value=!0},L=()=>{f.value=!1},N=()=>{let n={[t.displayProperty]:l.value};if(l.value===""&&i.value.length===0)return!1;if(t.tags.findIndex(s=>s[t.displayProperty]===l.value)>-1||i.value.length===0&&(l.value.length<t.minLength||l.value.length>t.maxLength))return l.value="",!1;if(i.value.length){const s=i.value[r.value];n=s,d.emit("update:suggestionList",v(t.suggestionList,s.__index))}const a=g(t.tags,n);d.emit("valueChange",t.tags,a),d.emit("update:tags",a),i.value.length===0&&(l.value="")},C=n=>{switch(n.key){case p.tab:case p.enter:case p.space:if(!t.isAddBySpace&&p.space)return;N();break;case p.down:h(!0);break;case p.up:h();break}},V=(n,a)=>{n.preventDefault(),d.emit("update:suggestionList",g(t.suggestionList,t.tags[a]));const s=v(t.tags,a);d.emit("valueChange",t.tags,s),d.emit("update:tags",s),e.nextTick(()=>{var c;(c=w.value)==null||c.focus()})},k=(n,a)=>{n.preventDefault();const s=i.value[a],c=g(t.tags,s),B=v(t.suggestionList,s.__index);d.emit("valueChange",t.tags,c),d.emit("update:tags",c),d.emit("update:suggestionList",B)},I=e.computed(()=>t.maxTags<=t.tags.length),T=e.computed(()=>!t.disabled&&!I.value&&f.value);return{tagInputRef:w,tagInputVal:l,isInputBoxFocus:f,onInput:b,onInputFocus:S,onInputBlur:L,removeTag:V,onSuggestionItemClick:k,onInputKeydown:C,isShowSuggestion:T,mergedSuggestions:i,selectIndex:r,isTagsLimit:I}},render(){const{tagInputVal:t,isInputBoxFocus:d,disabled:g,disabledText:v,isTagsLimit:l,maxTagsText:b,displayProperty:i,tags:r,onInputKeydown:h,onInputFocus:w,onInputBlur:f,onInput:S,onSuggestionItemClick:L,removeTag:N,placeholder:C,spellcheck:V,isShowSuggestion:k,noData:I,mergedSuggestions:T,selectIndex:n,maxTags:a}=this,s={"devui-tags":!0,"devui-form-control":!0,"devui-dropdown-origin":!0,"devui-dropdown-origin-open":d,"devui-disabled":g},c={input:!0,"devui-input":!0,"invalid-tag":!1},B=[`display:${g?"none":"block"};`],D=e.createVNode("li",{class:"devui-suggestion-item devui-disabled"},[I]);return e.createVNode("div",{class:"devui-tags-host",tabindex:"-1"},[e.createVNode("div",{class:s,style:["box-shadow: none;"]},[e.createVNode("ul",{class:"devui-tag-list",title:g?v:""},[r.map((y,x)=>e.createVNode("li",{class:"devui-tag-item"},[e.createVNode("span",null,[y[i]]),!g&&e.createVNode("a",{class:"remove-button",onMousedown:_=>N(_,x)},[o])]))]),e.createVNode("input",{type:"text",ref:"tagInputRef",value:t,class:c,style:B,onKeydown:h,onFocus:w,onBlur:f,onInput:y=>S(y),placeholder:l?`${b} ${a}`:C,spellcheck:V,disabled:l},null)]),k?e.createVNode("div",{class:"devui-tags-autocomplete devui-dropdown-menu"},[e.createVNode("ul",{class:"devui-suggestion-list"},[T.length===0?D:T.map((y,x)=>e.createVNode("li",{class:{"devui-suggestion-item":!0,selected:x===n},onMousedown:_=>{L(_,x)}},[y[i]]))])]):""])}});m.install=function(t){t.component(m.name,m)};var M={title:"TagInput \u6807\u7B7E\u8F93\u5165\u6846",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(t){t.use(m)}};u.TagInput=m,u.default=M,Object.defineProperty(u,"__esModule",{value:!0}),u[Symbol.toStringTag]="Module"});
@@ -1,7 +0,0 @@
1
- {
2
- "name": "tag-input",
3
- "version": "0.0.0",
4
- "main": "index.umd.js",
5
- "module": "index.es.js",
6
- "style": "style.css"
7
- }
@@ -1 +0,0 @@
1
- :host{display:block;outline:none}.devui-tags-host{position:relative;height:100%;outline:none}.devui-tags-host:active{outline:0}.devui-form-control.devui-tags{-moz-appearance:textfield;-webkit-appearance:textfield;padding:2px 4px;overflow:hidden;word-wrap:break-word;cursor:text;background-color:var(--devui-base-bg, #ffffff);border:1px solid var(--devui-line, #adb0b8);border-radius:var(--devui-border-radius, 2px);height:100%;transition:border-color .3s cubic-bezier(.645,.045,.355,1)}.devui-form-control.devui-tags:hover{border-color:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-form-control.devui-tags.focused{outline:0}.devui-form-control.devui-tags.devui-dropdown-origin:focus-within{border-color:var(--devui-brand, #5e7ce0)}.devui-form-control.devui-tags .devui-tag-list{margin:0;padding:0;list-style-type:none}.devui-form-control.devui-tags .devui-tag-item{margin:1px;padding:0 10px;display:inline-block;min-height:18px;line-height:18px;border-radius:var(--devui-border-radius, 2px);color:var(--devui-text, #252b3a);background-color:var(--devui-label-bg, #eef0f5);position:relative;border:1px solid var(--devui-label-bg, #eef0f5)}.devui-form-control.devui-tags .devui-tag-item span{line-height:1.5;margin-right:25px}.devui-form-control.devui-tags .devui-tag-item .remove-button{margin:0 0 0 12px;padding:0;border:none;vertical-align:top;font-size:var(--devui-font-size-page-title, 16px);border-radius:50%;background-color:var(--devui-line, #adb0b8);width:12px;height:12px;display:inline-block;line-height:12px;text-align:center;transform:translateY(-50%);position:absolute;top:50%;right:10px}.devui-form-control.devui-tags .devui-tag-item .remove-button svg path{fill:var(--devui-light-text, #ffffff)}.devui-form-control.devui-tags .devui-tag-item .remove-button:hover{text-decoration:none}.devui-form-control.devui-tags:not(.devui-disabled) .devui-tag-item{cursor:pointer}.devui-form-control.devui-tags:not(.devui-disabled) .devui-tag-item span:hover{color:var(--devui-list-item-hover-text, #526ecc)}.devui-form-control.devui-tags:not(.devui-disabled) .devui-tag-item .remove-button:hover{background-color:var(--devui-list-item-hover-text, #526ecc)}.devui-form-control.devui-tags.devui-disabled{border-color:var(--devui-disabled-line, #dfe1e6);background-color:var(--devui-disabled-bg, #f5f5f6);cursor:not-allowed}.devui-form-control.devui-tags.devui-disabled .devui-tag-item{color:var(--devui-disabled-text, #adb0b8);background-color:var(--devui-disabled-bg, #f5f5f6);border-color:var(--devui-disabled-line, #dfe1e6)}.devui-form-control.devui-tags.devui-disabled .devui-tag-item span{margin-right:0}.devui-form-control.devui-tags.devui-disabled .devui-tag-item .remove-button{background-color:var(--devui-disabled-line, #dfe1e6)}.devui-form-control.devui-tags.devui-disabled .devui-tag-item .remove-button svg path{fill:var(--devui-light-text, #ffffff)}.devui-form-control.devui-tags.devui-disabled .devui-tag-list{min-height:22px}.devui-form-control.devui-tags input.devui-input{border:0;outline:0;float:left;width:100%;height:22px;font-size:var(--devui-font-size, 12px);padding-left:5px}.devui-form-control.devui-tags input.devui-input::-ms-clear{display:none}.devui-tags-autocomplete{position:absolute;padding-bottom:5px;z-index:var(--devui-z-index-dropdown, 1052);width:100%;background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-connected-overlay, 0 2px 8px 0) var(--devui-shadow, rgba(0, 0, 0, .2))}.devui-tags-autocomplete.devui-dropdown-menu{display:block;margin:4px 0}.devui-tags-autocomplete .devui-suggestion-list{margin:0;padding:0;list-style-type:none;max-height:280px;overflow-y:auto;position:relative}.devui-tags-autocomplete .devui-suggestion-list .devui-suggestion-item{padding:5px 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--devui-font-size, 12px);line-height:20px}.devui-tags-autocomplete .devui-suggestion-list .devui-suggestion-item:not(.devui-disabled){cursor:pointer;color:var(--devui-text, #252b3a)}.devui-tags-autocomplete .devui-suggestion-list .devui-suggestion-item:not(.devui-disabled):hover{background-color:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-tags-autocomplete .devui-suggestion-list .devui-suggestion-item:not(.devui-disabled).selected{color:var(--devui-brand, #5e7ce0);background-color:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-tags-autocomplete .devui-suggestion-list .devui-suggestion-item{transition:color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1)),background-color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 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,299 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- import { defineComponent, createVNode, inject, createTextVNode, provide, ref, reactive, onMounted, watch, toRef, nextTick, Fragment } from "vue";
18
- const timeAxisProps = {
19
- direction: {
20
- type: String,
21
- default: "vertical"
22
- },
23
- center: {
24
- type: Boolean,
25
- default: false
26
- },
27
- mode: {
28
- type: String,
29
- default: "normal"
30
- },
31
- timePosition: {
32
- type: String,
33
- default: "left"
34
- }
35
- };
36
- var DIcon = defineComponent({
37
- name: "DIcon",
38
- props: {
39
- name: {
40
- type: String,
41
- required: true
42
- },
43
- size: {
44
- type: String,
45
- default: "inherit"
46
- },
47
- color: {
48
- type: String,
49
- default: "inherit"
50
- },
51
- classPrefix: {
52
- type: String,
53
- default: "icon"
54
- }
55
- },
56
- setup(props) {
57
- return __spreadValues({}, props);
58
- },
59
- render() {
60
- const {
61
- name,
62
- size,
63
- color,
64
- classPrefix
65
- } = this;
66
- return /^((https?):)?\/\//.test(name) ? createVNode("img", {
67
- "src": name,
68
- "alt": name.split("/")[name.split("/").length - 1],
69
- "style": {
70
- width: size,
71
- verticalAlign: "text-bottom"
72
- }
73
- }, null) : createVNode("i", {
74
- "class": `${classPrefix} ${classPrefix}-${name}`,
75
- "style": {
76
- fontSize: size,
77
- color
78
- }
79
- }, null);
80
- }
81
- });
82
- const timeAxisItemProps = {
83
- time: {
84
- type: String
85
- },
86
- dotColor: {
87
- type: String
88
- },
89
- lineStyle: {
90
- type: String,
91
- default: "solid"
92
- },
93
- lineColor: {
94
- type: String
95
- },
96
- position: {
97
- type: String
98
- },
99
- timePosition: {
100
- type: String,
101
- default: "left"
102
- },
103
- type: {
104
- type: String,
105
- default: "primary"
106
- }
107
- };
108
- var TimeAxisItem = defineComponent({
109
- name: "DTimeAxisItem",
110
- components: {
111
- DIcon
112
- },
113
- props: timeAxisItemProps,
114
- emits: [],
115
- setup(props, ctx) {
116
- const timeAxis2 = inject("timeAxis");
117
- const itemClass = "devui-time-axis-item";
118
- const renderTime = () => {
119
- var _a, _b;
120
- return createVNode("div", {
121
- "class": `${itemClass}-time`
122
- }, [ctx.slots.time ? (_b = (_a = ctx.slots).time) == null ? void 0 : _b.call(_a) : props.time]);
123
- };
124
- const renderContent = () => {
125
- var _a, _b;
126
- return createVNode("div", {
127
- "class": `${itemClass}-content`
128
- }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a, props)]);
129
- };
130
- const renderPosition = (types) => {
131
- if (types.includes(props.position)) {
132
- return renderContent();
133
- } else {
134
- if (timeAxis2.props.direction === "horizontal") {
135
- return renderTime();
136
- } else {
137
- return props.timePosition === "left" ? renderTime() : "";
138
- }
139
- }
140
- };
141
- const setTypeIcon = (type) => {
142
- if (type === "primary") {
143
- return "";
144
- }
145
- return createVNode("i", {
146
- "class": `icon-${type === "success" ? "right" : type}-o`
147
- }, null);
148
- };
149
- const renderDot = () => {
150
- var _a, _b;
151
- if (ctx.slots.dot) {
152
- return createVNode("div", {
153
- "style": {
154
- color: props.dotColor
155
- },
156
- "class": `${itemClass}-dot`
157
- }, [createTextVNode(" "), (_b = (_a = ctx.slots).dot) == null ? void 0 : _b.call(_a)]);
158
- } else {
159
- return createVNode("div", {
160
- "class": `${itemClass}-dot ${itemClass}-type-${props.type}`,
161
- "style": {
162
- borderColor: props.dotColor
163
- }
164
- }, [setTypeIcon(props.type)]);
165
- }
166
- };
167
- return () => {
168
- return createVNode("div", {
169
- "class": itemClass
170
- }, [createVNode("div", {
171
- "class": `${itemClass}-data-left ${itemClass}-data-top`
172
- }, [renderPosition(["top", "left"])]), createVNode("div", {
173
- "class": `${itemClass}-axis`
174
- }, [renderDot(), timeAxis2.props.direction === "vertical" && props.timePosition === "bottom" ? renderTime() : "", createVNode("div", {
175
- "class": `${itemClass}-line ${itemClass}-line-style-${props.lineStyle}`,
176
- "style": {
177
- borderColor: props.lineColor
178
- }
179
- }, [ctx.slots.extra ? createVNode("div", {
180
- "class": `${itemClass}-line-extra`
181
- }, [ctx.slots.extra()]) : ""])]), createVNode("div", {
182
- "class": `${itemClass}-data-right ${itemClass}-data-bottom`
183
- }, [renderPosition(["right", "bottom"])])]);
184
- };
185
- }
186
- });
187
- var timeAxis = "";
188
- var TimeAxis = defineComponent({
189
- name: "DTimeAxis",
190
- components: {
191
- TimeAxisItem
192
- },
193
- props: timeAxisProps,
194
- emits: [],
195
- setup(props, ctx) {
196
- provide("timeAxis", {
197
- ctx,
198
- props
199
- });
200
- const timeAxis2 = ref();
201
- const style = reactive({
202
- marginLeft: "0px",
203
- height: "auto"
204
- });
205
- const setStyle = () => {
206
- style.height = "auto";
207
- style.marginLeft = "0px";
208
- if (props.direction === "horizontal") {
209
- nextTick(() => {
210
- var _a;
211
- const el = timeAxis2.value;
212
- if (props.center) {
213
- style.marginLeft = (((_a = el == null ? void 0 : el.firstElementChild) == null ? void 0 : _a.clientWidth) || 0) / 2 + "px";
214
- }
215
- style.height = Math.max(...Array.from(el == null ? void 0 : el.querySelectorAll(".devui-time-axis-item-data-top")).map((el2) => el2.clientHeight), ...Array.from(el == null ? void 0 : el.querySelectorAll(".devui-time-axis-item-data-bottom")).map((el2) => el2.clientHeight)) * 2 + Math.max(...Array.from(el == null ? void 0 : el.querySelectorAll(".devui-time-axis-item-axis")).map((el2) => el2.clientHeight)) + "px";
216
- });
217
- }
218
- };
219
- onMounted(() => {
220
- setStyle();
221
- });
222
- watch(toRef(props, "direction"), () => {
223
- setStyle();
224
- });
225
- return () => {
226
- const renderItemPosition = (item, position) => {
227
- return position ? createVNode(item, {
228
- "position": position
229
- }, null) : createVNode(item, null, null);
230
- };
231
- const renderItem = () => {
232
- var _a, _b, _c;
233
- const slots = (_c = (_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)) != null ? _c : [];
234
- let children;
235
- if (slots.length === 1 && slots[0].type === Fragment) {
236
- children = slots[0].children || [];
237
- } else {
238
- children = slots;
239
- }
240
- return children.map((item, index2) => {
241
- var _a2, _b2, _c2, _d, _e, _f, _g, _h;
242
- if (index2 + 1 === children.length) {
243
- if (!((_a2 = item.props) == null ? void 0 : _a2.lineStyle) && !((_b2 = item.props) == null ? void 0 : _b2["line-style"])) {
244
- item = createVNode(item, {
245
- "line-style": "none"
246
- }, null);
247
- }
248
- }
249
- if (!((_c2 = item.props) == null ? void 0 : _c2.timePosition) && !((_d = item.props) == null ? void 0 : _d["time-position"])) {
250
- item = createVNode(item, {
251
- "time-position": props.timePosition ? props.timePosition : "left"
252
- }, null);
253
- }
254
- if (props.direction === "horizontal") {
255
- if (((_e = item.props) == null ? void 0 : _e.position) === "top" || ((_f = item.props) == null ? void 0 : _f.position) === "bottom")
256
- return item;
257
- if (props.mode === "alternative") {
258
- return renderItemPosition(item, index2 % 2 == 0 ? "bottom" : "top");
259
- } else {
260
- return renderItemPosition(item, "bottom");
261
- }
262
- } else {
263
- if (((_g = item.props) == null ? void 0 : _g.position) === "left" || ((_h = item.props) == null ? void 0 : _h.position) === "right")
264
- return item;
265
- if (props.mode === "alternative") {
266
- return renderItemPosition(item, index2 % 2 == 0 ? "left" : "right");
267
- } else {
268
- return renderItemPosition(item, "right");
269
- }
270
- }
271
- });
272
- };
273
- const getDirection = () => {
274
- return props.direction === "horizontal" ? "horizontal" : "vertical";
275
- };
276
- return createVNode("div", {
277
- "class": `devui-time-axis devui-time-axis-${getDirection()} ${props.center ? "devui-time-axis-" + getDirection() + "-center" : ""} `,
278
- "ref": timeAxis2,
279
- "style": style
280
- }, [renderItem()]);
281
- };
282
- }
283
- });
284
- TimeAxis.install = function(app) {
285
- app.component(TimeAxis.name, TimeAxis);
286
- };
287
- TimeAxisItem.install = function(app) {
288
- app.component(TimeAxisItem.name, TimeAxisItem);
289
- };
290
- var index = {
291
- title: "TimeAxis \u65F6\u95F4\u8F74",
292
- category: "\u6570\u636E\u5C55\u793A",
293
- status: "100%",
294
- install(app) {
295
- app.use(TimeAxis);
296
- app.use(TimeAxisItem);
297
- }
298
- };
299
- export { TimeAxis, TimeAxisItem, index as default };
@@ -1 +0,0 @@
1
- var F=Object.defineProperty;var I=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;var z=(r,t,a)=>t in r?F(r,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[t]=a,D=(r,t)=>{for(var a in t||(t={}))j.call(t,a)&&z(r,a,t[a]);if(I)for(var a of I(t))H.call(t,a)&&z(r,a,t[a]);return r};(function(r,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(r=typeof globalThis!="undefined"?globalThis:r||self,t(r.index={},r.Vue))})(this,function(r,t){"use strict";const a={direction:{type:String,default:"vertical"},center:{type:Boolean,default:!1},mode:{type:String,default:"normal"},timePosition:{type:String,default:"left"}};var q=t.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(e){return D({},e)},render(){const{name:e,size:l,color:f,classPrefix:i}=this;return/^((https?):)?\/\//.test(e)?t.createVNode("img",{src:e,alt:e.split("/")[e.split("/").length-1],style:{width:l,verticalAlign:"text-bottom"}},null):t.createVNode("i",{class:`${i} ${i}-${e}`,style:{fontSize:l,color:f}},null)}});const v={time:{type:String},dotColor:{type:String},lineStyle:{type:String,default:"solid"},lineColor:{type:String},position:{type:String},timePosition:{type:String,default:"left"},type:{type:String,default:"primary"}};var p=t.defineComponent({name:"DTimeAxisItem",components:{DIcon:q},props:v,emits:[],setup(e,l){const f=t.inject("timeAxis"),i="devui-time-axis-item",y=()=>{var o,d;return t.createVNode("div",{class:`${i}-time`},[l.slots.time?(d=(o=l.slots).time)==null?void 0:d.call(o):e.time])},n=()=>{var o,d;return t.createVNode("div",{class:`${i}-content`},[(d=(o=l.slots).default)==null?void 0:d.call(o,e)])},u=o=>o.includes(e.position)?n():f.props.direction==="horizontal"||e.timePosition==="left"?y():"",c=o=>o==="primary"?"":t.createVNode("i",{class:`icon-${o==="success"?"right":o}-o`},null),m=()=>{var o,d;return l.slots.dot?t.createVNode("div",{style:{color:e.dotColor},class:`${i}-dot`},[t.createTextVNode(" "),(d=(o=l.slots).dot)==null?void 0:d.call(o)]):t.createVNode("div",{class:`${i}-dot ${i}-type-${e.type}`,style:{borderColor:e.dotColor}},[c(e.type)])};return()=>t.createVNode("div",{class:i},[t.createVNode("div",{class:`${i}-data-left ${i}-data-top`},[u(["top","left"])]),t.createVNode("div",{class:`${i}-axis`},[m(),f.props.direction==="vertical"&&e.timePosition==="bottom"?y():"",t.createVNode("div",{class:`${i}-line ${i}-line-style-${e.lineStyle}`,style:{borderColor:e.lineColor}},[l.slots.extra?t.createVNode("div",{class:`${i}-line-extra`},[l.slots.extra()]):""])]),t.createVNode("div",{class:`${i}-data-right ${i}-data-bottom`},[u(["right","bottom"])])])}}),L="",g=t.defineComponent({name:"DTimeAxis",components:{TimeAxisItem:p},props:a,emits:[],setup(e,l){t.provide("timeAxis",{ctx:l,props:e});const f=t.ref(),i=t.reactive({marginLeft:"0px",height:"auto"}),y=()=>{i.height="auto",i.marginLeft="0px",e.direction==="horizontal"&&t.nextTick(()=>{var u;const n=f.value;e.center&&(i.marginLeft=(((u=n==null?void 0:n.firstElementChild)==null?void 0:u.clientWidth)||0)/2+"px"),i.height=Math.max(...Array.from(n==null?void 0:n.querySelectorAll(".devui-time-axis-item-data-top")).map(c=>c.clientHeight),...Array.from(n==null?void 0:n.querySelectorAll(".devui-time-axis-item-data-bottom")).map(c=>c.clientHeight))*2+Math.max(...Array.from(n==null?void 0:n.querySelectorAll(".devui-time-axis-item-axis")).map(c=>c.clientHeight))+"px"})};return t.onMounted(()=>{y()}),t.watch(t.toRef(e,"direction"),()=>{y()}),()=>{const n=(m,o)=>o?t.createVNode(m,{position:o},null):t.createVNode(m,null,null),u=()=>{var d,x,S;const m=(S=(x=(d=l.slots).default)==null?void 0:x.call(d))!=null?S:[];let o;return m.length===1&&m[0].type===t.Fragment?o=m[0].children||[]:o=m,o.map((s,h)=>{var A,$,V,N,C,P,T,b;return h+1===o.length&&!((A=s.props)==null?void 0:A.lineStyle)&&!(($=s.props)==null?void 0:$["line-style"])&&(s=t.createVNode(s,{"line-style":"none"},null)),!((V=s.props)==null?void 0:V.timePosition)&&!((N=s.props)==null?void 0:N["time-position"])&&(s=t.createVNode(s,{"time-position":e.timePosition?e.timePosition:"left"},null)),e.direction==="horizontal"?((C=s.props)==null?void 0:C.position)==="top"||((P=s.props)==null?void 0:P.position)==="bottom"?s:e.mode==="alternative"?n(s,h%2==0?"bottom":"top"):n(s,"bottom"):((T=s.props)==null?void 0:T.position)==="left"||((b=s.props)==null?void 0:b.position)==="right"?s:e.mode==="alternative"?n(s,h%2==0?"left":"right"):n(s,"right")})},c=()=>e.direction==="horizontal"?"horizontal":"vertical";return t.createVNode("div",{class:`devui-time-axis devui-time-axis-${c()} ${e.center?"devui-time-axis-"+c()+"-center":""} `,ref:f,style:i},[u()])}}});g.install=function(e){e.component(g.name,g)},p.install=function(e){e.component(p.name,p)};var M={title:"TimeAxis \u65F6\u95F4\u8F74",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(e){e.use(g),e.use(p)}};r.TimeAxis=g,r.TimeAxisItem=p,r.default=M,Object.defineProperty(r,"__esModule",{value:!0}),r[Symbol.toStringTag]="Module"});