vue-devui 1.0.0-beta.1 → 1.0.0-beta.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 (323) hide show
  1. package/accordion/index.d.ts +7 -0
  2. package/accordion/index.es.js +186 -139
  3. package/accordion/index.umd.js +1 -1
  4. package/accordion/style.css +1 -1
  5. package/alert/index.d.ts +7 -0
  6. package/alert/index.es.js +2 -3
  7. package/alert/index.umd.js +1 -1
  8. package/alert/style.css +1 -1
  9. package/anchor/index.d.ts +7 -0
  10. package/avatar/index.d.ts +7 -0
  11. package/avatar/index.es.js +1 -1
  12. package/avatar/index.umd.js +1 -1
  13. package/back-top/index.d.ts +7 -0
  14. package/back-top/index.es.js +128 -0
  15. package/back-top/index.umd.js +1 -0
  16. package/back-top/package.json +7 -0
  17. package/back-top/style.css +1 -0
  18. package/badge/index.d.ts +7 -0
  19. package/badge/index.es.js +1 -1
  20. package/badge/index.umd.js +1 -1
  21. package/breadcrumb/index.d.ts +7 -0
  22. package/button/index.d.ts +7 -0
  23. package/button/index.es.js +9 -8
  24. package/button/index.umd.js +1 -1
  25. package/card/index.d.ts +7 -0
  26. package/card/index.es.js +1 -1
  27. package/card/index.umd.js +1 -1
  28. package/carousel/index.d.ts +7 -0
  29. package/carousel/index.es.js +5 -4
  30. package/carousel/index.umd.js +1 -1
  31. package/cascader/index.d.ts +7 -0
  32. package/cascader/index.es.js +1239 -83
  33. package/cascader/index.umd.js +1 -1
  34. package/cascader/style.css +1 -1
  35. package/checkbox/index.d.ts +7 -0
  36. package/checkbox/index.es.js +43 -8
  37. package/checkbox/index.umd.js +1 -1
  38. package/comment/index.d.ts +7 -0
  39. package/comment/index.es.js +85 -0
  40. package/comment/index.umd.js +1 -0
  41. package/comment/package.json +7 -0
  42. package/comment/style.css +1 -0
  43. package/countdown/index.d.ts +7 -0
  44. package/countdown/index.es.js +176 -0
  45. package/countdown/index.umd.js +1 -0
  46. package/countdown/package.json +7 -0
  47. package/countdown/style.css +1 -0
  48. package/date-picker/index.d.ts +7 -0
  49. package/date-picker/index.es.js +32 -21
  50. package/date-picker/index.umd.js +1 -1
  51. package/date-picker/style.css +1 -1
  52. package/dragdrop/index.d.ts +7 -0
  53. package/dragdrop/index.es.js +32 -0
  54. package/dragdrop/index.umd.js +1 -0
  55. package/dragdrop/package.json +7 -0
  56. package/drawer/index.d.ts +7 -0
  57. package/drawer/index.es.js +161 -41
  58. package/drawer/index.umd.js +1 -1
  59. package/drawer/style.css +1 -1
  60. package/dropdown/index.d.ts +7 -0
  61. package/dropdown/index.es.js +527 -0
  62. package/dropdown/index.umd.js +1 -0
  63. package/dropdown/package.json +7 -0
  64. package/dropdown/style.css +1 -0
  65. package/editable-select/index.d.ts +7 -0
  66. package/editable-select/index.es.js +5718 -469
  67. package/editable-select/index.umd.js +27 -1
  68. package/editable-select/style.css +1 -1
  69. package/form/index.d.ts +7 -0
  70. package/form/index.es.js +2244 -0
  71. package/form/index.umd.js +1 -0
  72. package/form/package.json +7 -0
  73. package/form/style.css +1 -0
  74. package/fullscreen/index.d.ts +7 -0
  75. package/fullscreen/index.es.js +14 -4
  76. package/fullscreen/index.umd.js +1 -1
  77. package/gantt/index.d.ts +7 -0
  78. package/gantt/index.es.js +535 -0
  79. package/gantt/index.umd.js +1 -0
  80. package/gantt/package.json +7 -0
  81. package/gantt/style.css +1 -0
  82. package/grid/index.d.ts +7 -0
  83. package/grid/index.es.js +269 -0
  84. package/grid/index.umd.js +1 -0
  85. package/grid/package.json +7 -0
  86. package/grid/style.css +1 -0
  87. package/icon/index.d.ts +7 -0
  88. package/icon/index.es.js +6 -5
  89. package/icon/index.umd.js +1 -1
  90. package/image-preview/index.d.ts +7 -0
  91. package/image-preview/index.es.js +72 -11
  92. package/image-preview/index.umd.js +1 -1
  93. package/image-preview/style.css +1 -1
  94. package/index.d.ts +7 -0
  95. package/input/index.d.ts +7 -0
  96. package/input/index.es.js +24 -13
  97. package/input/index.umd.js +1 -1
  98. package/input-icon/index.d.ts +7 -0
  99. package/input-icon/index.es.js +332 -0
  100. package/input-icon/index.umd.js +1 -0
  101. package/input-icon/package.json +7 -0
  102. package/input-icon/style.css +1 -0
  103. package/input-number/index.d.ts +7 -0
  104. package/input-number/index.es.js +5 -4
  105. package/input-number/index.umd.js +1 -1
  106. package/layout/index.d.ts +7 -0
  107. package/layout/index.es.js +1 -1
  108. package/layout/index.umd.js +1 -1
  109. package/loading/index.d.ts +7 -0
  110. package/loading/index.es.js +1 -1
  111. package/loading/index.umd.js +1 -1
  112. package/modal/index.d.ts +7 -0
  113. package/modal/index.es.js +117 -99
  114. package/modal/index.umd.js +1 -1
  115. package/modal/style.css +1 -1
  116. package/nav-sprite/index.d.ts +7 -0
  117. package/nuxt/components/Accordion.js +3 -0
  118. package/nuxt/components/Alert.js +3 -0
  119. package/nuxt/components/Anchor.js +3 -0
  120. package/nuxt/components/Aside.js +3 -0
  121. package/nuxt/components/Avatar.js +3 -0
  122. package/nuxt/components/BackTop.js +3 -0
  123. package/nuxt/components/Badge.js +3 -0
  124. package/nuxt/components/Breadcrumb.js +3 -0
  125. package/nuxt/components/Button.js +3 -0
  126. package/nuxt/components/Card.js +3 -0
  127. package/nuxt/components/Carousel.js +3 -0
  128. package/nuxt/components/Cascader.js +3 -0
  129. package/nuxt/components/Checkbox.js +3 -0
  130. package/nuxt/components/Col.js +3 -0
  131. package/nuxt/components/Column.js +3 -0
  132. package/nuxt/components/Comment.js +3 -0
  133. package/nuxt/components/Content.js +3 -0
  134. package/nuxt/components/Countdown.js +3 -0
  135. package/nuxt/components/DatePicker.js +3 -0
  136. package/nuxt/components/Drawer.js +3 -0
  137. package/nuxt/components/Dropdown.js +3 -0
  138. package/nuxt/components/EditableSelect.js +3 -0
  139. package/nuxt/components/FixedOverlay.js +3 -0
  140. package/nuxt/components/FlexibleOverlay.js +3 -0
  141. package/nuxt/components/Footer.js +3 -0
  142. package/nuxt/components/Form.js +3 -0
  143. package/nuxt/components/FormControl.js +3 -0
  144. package/nuxt/components/FormItem.js +3 -0
  145. package/nuxt/components/FormLabel.js +3 -0
  146. package/nuxt/components/FormOperation.js +3 -0
  147. package/nuxt/components/Fullscreen.js +3 -0
  148. package/nuxt/components/Gantt.js +3 -0
  149. package/nuxt/components/Header.js +3 -0
  150. package/nuxt/components/Icon.js +2 -0
  151. package/nuxt/components/ImagePreviewService.js +3 -0
  152. package/nuxt/components/Input.js +3 -0
  153. package/nuxt/components/InputIcon.js +3 -0
  154. package/nuxt/components/InputNumber.js +3 -0
  155. package/nuxt/components/Layout.js +3 -0
  156. package/nuxt/components/Loading.js +3 -0
  157. package/nuxt/components/LoadingService.js +3 -0
  158. package/nuxt/components/Modal.js +3 -0
  159. package/nuxt/components/MultiUpload.js +3 -0
  160. package/nuxt/components/NavSprite.js +2 -0
  161. package/nuxt/components/Pagination.js +3 -0
  162. package/nuxt/components/Panel.js +3 -0
  163. package/nuxt/components/Popover.js +3 -0
  164. package/nuxt/components/Progress.js +3 -0
  165. package/nuxt/components/QuadrantDiagram.js +3 -0
  166. package/nuxt/components/Radio.js +3 -0
  167. package/nuxt/components/RadioGroup.js +3 -0
  168. package/nuxt/components/Rate.js +3 -0
  169. package/nuxt/components/ReadTip.js +3 -0
  170. package/nuxt/components/Result.js +3 -0
  171. package/nuxt/components/Row.js +3 -0
  172. package/nuxt/components/Search.js +3 -0
  173. package/nuxt/components/Select.js +3 -0
  174. package/nuxt/components/Skeleton.js +3 -0
  175. package/nuxt/components/SkeletonItem.js +3 -0
  176. package/nuxt/components/Slider.js +3 -0
  177. package/nuxt/components/Splitter.js +3 -0
  178. package/nuxt/components/Statistic.js +3 -0
  179. package/nuxt/components/Status.js +3 -0
  180. package/nuxt/components/StepsGuide.js +3 -0
  181. package/nuxt/components/StickSlider.js +3 -0
  182. package/nuxt/components/Sticky.js +2 -0
  183. package/nuxt/components/Switch.js +3 -0
  184. package/nuxt/components/Table.js +3 -0
  185. package/nuxt/components/Tabs.js +3 -0
  186. package/nuxt/components/Tag.js +3 -0
  187. package/nuxt/components/TagInput.js +3 -0
  188. package/nuxt/components/Textarea.js +3 -0
  189. package/nuxt/components/TimeAxis.js +3 -0
  190. package/nuxt/components/TimeAxisItem.js +3 -0
  191. package/nuxt/components/TimePicker.js +3 -0
  192. package/nuxt/components/Toast.js +3 -0
  193. package/nuxt/components/ToastService.js +3 -0
  194. package/nuxt/components/Tooltip.js +3 -0
  195. package/nuxt/components/Transfer.js +3 -0
  196. package/nuxt/components/Tree.js +3 -0
  197. package/nuxt/components/TreeSelect.js +3 -0
  198. package/nuxt/components/Upload.js +3 -0
  199. package/nuxt/components/buttonProps.js +3 -0
  200. package/nuxt/index.js +13 -0
  201. package/overlay/index.d.ts +7 -0
  202. package/overlay/index.es.js +110 -93
  203. package/overlay/index.umd.js +1 -1
  204. package/overlay/style.css +1 -1
  205. package/package.json +6 -33
  206. package/pagination/index.d.ts +7 -0
  207. package/pagination/index.es.js +3 -3
  208. package/pagination/index.umd.js +1 -1
  209. package/panel/index.d.ts +7 -0
  210. package/panel/index.es.js +25 -22
  211. package/panel/index.umd.js +1 -1
  212. package/panel/style.css +1 -1
  213. package/popover/index.d.ts +7 -0
  214. package/popover/index.es.js +5 -2
  215. package/popover/index.umd.js +1 -1
  216. package/progress/index.d.ts +7 -0
  217. package/progress/index.es.js +1 -1
  218. package/progress/index.umd.js +2 -2
  219. package/quadrant-diagram/index.d.ts +7 -0
  220. package/radio/index.d.ts +7 -0
  221. package/radio/index.es.js +1 -1
  222. package/radio/index.umd.js +1 -1
  223. package/rate/index.d.ts +7 -0
  224. package/rate/index.es.js +1 -1
  225. package/rate/index.umd.js +1 -1
  226. package/read-tip/index.d.ts +7 -0
  227. package/read-tip/index.es.js +258 -0
  228. package/read-tip/index.umd.js +1 -0
  229. package/read-tip/package.json +7 -0
  230. package/read-tip/style.css +1 -0
  231. package/result/index.d.ts +7 -0
  232. package/result/index.es.js +119 -0
  233. package/result/index.umd.js +1 -0
  234. package/result/package.json +7 -0
  235. package/result/style.css +1 -0
  236. package/ripple/index.d.ts +7 -0
  237. package/ripple/index.es.js +5 -2
  238. package/ripple/index.umd.js +1 -1
  239. package/search/index.d.ts +7 -0
  240. package/search/index.es.js +35 -21
  241. package/search/index.umd.js +1 -1
  242. package/select/index.d.ts +7 -0
  243. package/select/index.es.js +47 -11
  244. package/select/index.umd.js +1 -1
  245. package/skeleton/index.d.ts +7 -0
  246. package/skeleton/index.es.js +148 -26
  247. package/skeleton/index.umd.js +1 -1
  248. package/skeleton/style.css +1 -1
  249. package/slider/index.d.ts +7 -0
  250. package/slider/index.es.js +30 -177
  251. package/slider/index.umd.js +1 -1
  252. package/slider/style.css +1 -1
  253. package/splitter/index.d.ts +7 -0
  254. package/splitter/index.es.js +107 -89
  255. package/splitter/index.umd.js +1 -1
  256. package/statistic/index.d.ts +7 -0
  257. package/statistic/index.es.js +280 -0
  258. package/statistic/index.umd.js +1 -0
  259. package/statistic/package.json +7 -0
  260. package/statistic/style.css +1 -0
  261. package/status/index.d.ts +7 -0
  262. package/status/index.es.js +2 -2
  263. package/status/index.umd.js +1 -1
  264. package/steps-guide/index.d.ts +7 -0
  265. package/steps-guide/index.es.js +101 -73
  266. package/steps-guide/index.umd.js +1 -1
  267. package/steps-guide/style.css +1 -1
  268. package/sticky/index.d.ts +7 -0
  269. package/style.css +1 -1
  270. package/switch/index.d.ts +7 -0
  271. package/switch/index.es.js +1 -1
  272. package/switch/index.umd.js +1 -1
  273. package/table/index.d.ts +7 -0
  274. package/table/index.es.js +1498 -156
  275. package/table/index.umd.js +1 -1
  276. package/table/style.css +1 -1
  277. package/tabs/index.d.ts +7 -0
  278. package/tabs/index.es.js +6 -3
  279. package/tabs/index.umd.js +1 -1
  280. package/tag/index.d.ts +7 -0
  281. package/tag/index.es.js +131 -0
  282. package/tag/index.umd.js +1 -0
  283. package/tag/package.json +7 -0
  284. package/tag/style.css +1 -0
  285. package/tag-input/index.d.ts +7 -0
  286. package/tag-input/index.es.js +1 -13
  287. package/tag-input/index.umd.js +1 -1
  288. package/textarea/index.d.ts +7 -0
  289. package/textarea/index.es.js +132 -0
  290. package/textarea/index.umd.js +1 -0
  291. package/textarea/package.json +7 -0
  292. package/textarea/style.css +1 -0
  293. package/time-axis/index.d.ts +7 -0
  294. package/time-axis/index.es.js +241 -21
  295. package/time-axis/index.umd.js +1 -1
  296. package/time-axis/style.css +1 -1
  297. package/time-picker/index.d.ts +7 -0
  298. package/time-picker/index.es.js +50 -26
  299. package/time-picker/index.umd.js +1 -1
  300. package/time-picker/style.css +1 -1
  301. package/toast/index.d.ts +7 -0
  302. package/toast/index.es.js +8 -7
  303. package/toast/index.umd.js +1 -1
  304. package/toast/style.css +1 -1
  305. package/tooltip/index.d.ts +7 -0
  306. package/transfer/index.d.ts +7 -0
  307. package/transfer/index.es.js +368 -79
  308. package/transfer/index.umd.js +1 -1
  309. package/transfer/style.css +1 -1
  310. package/tree/index.d.ts +7 -0
  311. package/tree/index.es.js +171 -35
  312. package/tree/index.umd.js +1 -1
  313. package/tree-select/index.d.ts +7 -0
  314. package/tree-select/index.es.js +528 -0
  315. package/tree-select/index.umd.js +1 -0
  316. package/tree-select/package.json +7 -0
  317. package/tree-select/style.css +1 -0
  318. package/upload/index.d.ts +7 -0
  319. package/upload/index.es.js +8 -7
  320. package/upload/index.umd.js +1 -1
  321. package/upload/style.css +1 -1
  322. package/vue-devui.es.js +19214 -7637
  323. package/vue-devui.umd.js +29 -3
@@ -0,0 +1,7 @@
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,51 +1,186 @@
1
- import { defineComponent, createVNode } from "vue";
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";
2
18
  const timeAxisProps = {
3
19
  direction: {
4
20
  type: String,
5
21
  default: "vertical"
6
22
  },
7
- data: {
8
- type: Array,
9
- default: () => []
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"
10
34
  }
11
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
+ });
12
82
  const timeAxisItemProps = {
13
83
  time: {
14
84
  type: String
15
85
  },
16
- text: {
86
+ dotColor: {
17
87
  type: String
18
88
  },
19
- dotColor: {
89
+ lineStyle: {
90
+ type: String,
91
+ default: "solid"
92
+ },
93
+ lineColor: {
20
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"
21
106
  }
22
107
  };
23
- var index$1 = "";
24
108
  var TimeAxisItem = defineComponent({
25
109
  name: "DTimeAxisItem",
110
+ components: {
111
+ DIcon
112
+ },
26
113
  props: timeAxisItemProps,
27
114
  emits: [],
28
115
  setup(props, ctx) {
116
+ const timeAxis2 = inject("timeAxis");
29
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
+ };
30
167
  return () => {
31
168
  return createVNode("div", {
32
169
  "class": itemClass
33
170
  }, [createVNode("div", {
34
171
  "class": `${itemClass}-data-left ${itemClass}-data-top`
35
- }, [createVNode("span", null, [props.time])]), createVNode("div", {
172
+ }, [renderPosition(["top", "left"])]), createVNode("div", {
36
173
  "class": `${itemClass}-axis`
37
- }, [createVNode("div", {
38
- "class": `${itemClass}-line ${itemClass}-line-style-solid`
39
- }, null), createVNode("div", {
40
- "class": `${itemClass}-dot ${itemClass}-type-primary`,
174
+ }, [renderDot(), timeAxis2.props.direction === "vertical" && props.timePosition === "bottom" ? renderTime() : "", createVNode("div", {
175
+ "class": `${itemClass}-line ${itemClass}-line-style-${props.lineStyle}`,
41
176
  "style": {
42
- borderColor: props.dotColor
177
+ borderColor: props.lineColor
43
178
  }
44
- }, null), createVNode("div", {
45
- "class": `${itemClass}-line ${itemClass}-line-style-solid`
46
- }, null)]), createVNode("div", {
179
+ }, [ctx.slots.extra ? createVNode("div", {
180
+ "class": `${itemClass}-line-extra`
181
+ }, [ctx.slots.extra()]) : ""])]), createVNode("div", {
47
182
  "class": `${itemClass}-data-right ${itemClass}-data-bottom`
48
- }, [props.text])]);
183
+ }, [renderPosition(["right", "bottom"])])]);
49
184
  };
50
185
  }
51
186
  });
@@ -58,22 +193,107 @@ var TimeAxis = defineComponent({
58
193
  props: timeAxisProps,
59
194
  emits: [],
60
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
+ });
61
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
+ };
62
276
  return createVNode("div", {
63
- "class": `devui-time-axis-${props.direction}`
64
- }, [props.data.map((item) => createVNode(TimeAxisItem, item, null))]);
277
+ "class": `devui-time-axis devui-time-axis-${getDirection()} ${props.center ? "devui-time-axis-" + getDirection() + "-center" : ""} `,
278
+ "ref": timeAxis2,
279
+ "style": style
280
+ }, [renderItem()]);
65
281
  };
66
282
  }
67
283
  });
68
284
  TimeAxis.install = function(app) {
69
285
  app.component(TimeAxis.name, TimeAxis);
70
286
  };
287
+ TimeAxisItem.install = function(app) {
288
+ app.component(TimeAxisItem.name, TimeAxisItem);
289
+ };
71
290
  var index = {
72
291
  title: "TimeAxis \u65F6\u95F4\u8F74",
73
292
  category: "\u6570\u636E\u5C55\u793A",
74
- status: "10%",
293
+ status: "100%",
75
294
  install(app) {
76
295
  app.use(TimeAxis);
296
+ app.use(TimeAxisItem);
77
297
  }
78
298
  };
79
- export { TimeAxis, index as default };
299
+ export { TimeAxis, TimeAxisItem, index as default };
@@ -1 +1 @@
1
- (function(n,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis!="undefined"?globalThis:n||self,e(n.index={},n.Vue))})(this,function(n,e){"use strict";const d={direction:{type:String,default:"vertical"},data:{type:Array,default:()=>[]}},o={time:{type:String},text:{type:String},dotColor:{type:String}};var c="",a=e.defineComponent({name:"DTimeAxisItem",props:o,emits:[],setup(i,l){const t="devui-time-axis-item";return()=>e.createVNode("div",{class:t},[e.createVNode("div",{class:`${t}-data-left ${t}-data-top`},[e.createVNode("span",null,[i.time])]),e.createVNode("div",{class:`${t}-axis`},[e.createVNode("div",{class:`${t}-line ${t}-line-style-solid`},null),e.createVNode("div",{class:`${t}-dot ${t}-type-primary`,style:{borderColor:i.dotColor}},null),e.createVNode("div",{class:`${t}-line ${t}-line-style-solid`},null)]),e.createVNode("div",{class:`${t}-data-right ${t}-data-bottom`},[i.text])])}}),m="",s=e.defineComponent({name:"DTimeAxis",components:{TimeAxisItem:a},props:d,emits:[],setup(i,l){return()=>e.createVNode("div",{class:`devui-time-axis-${i.direction}`},[i.data.map(t=>e.createVNode(a,t,null))])}});s.install=function(i){i.component(s.name,s)};var r={title:"TimeAxis \u65F6\u95F4\u8F74",category:"\u6570\u636E\u5C55\u793A",status:"10%",install(i){i.use(s)}};n.TimeAxis=s,n.default=r,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
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"});
@@ -1 +1 @@
1
- .devui-time-axis-item-type-primary{border:2px solid var(--devui-placeholder, #8a8e99);border-radius:50%}.devui-time-axis-item-type-right i{color:var(--devui-success, #50d4ab)}.devui-time-axis-item-type-danger path{fill:var(--devui-danger, #f66f6a)}.devui-time-axis-item-type-danger circle{fill:var(--devui-light-text, #ffffff)}.devui-time-axis-item-type-warning i{color:var(--devui-warning, #fac20a)}.devui-time-axis-item-type-running{line-height:16px;text-align:center;animation:devui-time-axis-running 1.5s linear infinite;border:2px solid var(--devui-success, #50d4ab);border-radius:50%}.devui-time-axis-item-vertical-time-bottom{display:flex}.devui-time-axis-item-vertical-time-bottom .devui-time-axis-item-axis{display:flex;flex-direction:column;align-items:center}.devui-time-axis-item-vertical-time-bottom .devui-time-axis-item-dot,.devui-time-axis-item-vertical-time-bottom .devui-time-axis-item-dot>svg{width:18px;height:18px}.devui-time-axis-item-vertical-time-bottom .devui-time-axis-item-dot>i{font-size:18px}.devui-time-axis-item-vertical-time-bottom .devui-time-axis-item-custom-dot{width:18px;height:18px;text-align:center}.devui-time-axis-item-vertical-time-bottom .devui-time-axis-item-line-time-bottom{position:relative;height:calc(100% - 36px);border-left-width:2px;border-left-color:var(--devui-dividing-line, #dfe1e6)}.devui-time-axis-item-vertical-time-bottom .devui-time-axis-line-style-dashed{border-left-style:dashed}.devui-time-axis-item-vertical-time-bottom .devui-time-axis-line-style-solid{border-left-style:solid}.devui-time-axis-item-vertical-time-bottom .devui-time-axis-line-style-none{border-left-style:none}.devui-time-axis-item-vertical-time-bottom .devui-time-axis-middle-zone{position:absolute;top:50%;transform:translate(-50%,-50%)}.devui-time-axis-item-vertical-time-bottom .devui-time-axis-item-data-time-bottom{margin-left:12px;margin-bottom:40px}.devui-time-axis-item-vertical-time-bottom .devui-time-axis-item-template{margin-left:12px;margin-bottom:24px}@keyframes devui-time-axis-running{0%{transform:rotate(0);color:var(--devui-success, #50d4ab);border-color:var(--devui-success, #50d4ab)}50%{transform:rotate(180deg);color:var(--devui-success, #50d4ab);border-color:var(--devui-success, #50d4ab)}to{transform:rotate(360deg);color:var(--devui-success, #50d4ab);border-color:var(--devui-success, #50d4ab)}}.devui-time-axis-item-data-hidden{visibility:hidden}:host.devui-time-axis-item-horizontal-no-line{width:auto!important}:host.devui-time-axis-item-horizontal-no-line .devui-time-axis-item-data-horizontal-top{width:max-content}:host.devui-time-axis-item-horizontal-no-line .devui-time-axis-item-data-horizontal-bottom{width:max-content}:host.devui-time-axis-item-vertical-no-line .devui-time-axis-item-data-time-bottom{margin-bottom:0}:host.devui-time-axis-item-vertical-no-line .devui-time-axis-item-data-vertical-left{margin-bottom:0}:host.devui-time-axis-item-vertical-no-line .devui-time-axis-item-data-vertical-right{margin-bottom:0}.devui-time-axis-item-horizontal-align-center{position:relative;width:fit-content;transform:translate(-50%);left:8px}.devui-time-axis-vertical{display:flex;flex-direction:column;align-items:center;position:relative}.devui-time-axis-vertical .devui-time-axis-item{display:flex;flex-direction:row;width:100%}.devui-time-axis-vertical .devui-time-axis-item-axis{display:flex;flex-direction:column;align-items:center;padding:0 12px}.devui-time-axis-vertical .devui-time-axis-item-line{position:relative;height:calc(100% - 18px);border-left-width:2px;border-left-color:var(--devui-dividing-line, #dfe1e6)}.devui-time-axis-vertical .devui-time-axis-item-line:first-child{display:none}.devui-time-axis-vertical .devui-time-axis-item-data-left{text-align:end;margin-bottom:24px;height:18px;line-height:18px;flex:1}.devui-time-axis-vertical .devui-time-axis-item-data-right{margin-bottom:24px;height:18px;line-height:18px;flex:1}.devui-time-axis-vertical .devui-time-axis-item-line-style-dashed{border-left-style:dashed}.devui-time-axis-vertical .devui-time-axis-item-line-style-solid{border-left-style:solid}.devui-time-axis-vertical .devui-time-axis-item-line-style-dotted{border-left-style:dotted}.devui-time-axis-vertical .devui-time-axis-item-line-style-none{border-left-style:none}.devui-time-axis-vertical .devui-time-axis-item .devui-time-axis-middle-zone{position:absolute;top:50%;transform:translate(-50%,-50%)}.devui-time-axis-horizontal{display:flex;flex-direction:row;align-items:center;position:relative}.devui-time-axis-horizontal .devui-time-axis-item{display:flex;flex-direction:column;height:100%}.devui-time-axis-horizontal .devui-time-axis-item-axis{display:flex;flex-direction:row;align-items:center;padding:12px 0}.devui-time-axis-horizontal .devui-time-axis-item-line{position:relative;min-width:20px;width:calc(50% - (18px / 2));border-bottom-width:2px;border-bottom-color:var(--devui-dividing-line, #dfe1e6)}.devui-time-axis-horizontal .devui-time-axis-item:first-child .devui-time-axis-item-line:first-child{opacity:0}.devui-time-axis-horizontal .devui-time-axis-item-data-top{text-align:center;display:flex;align-items:flex-end;padding:0 12px;flex:1}.devui-time-axis-horizontal .devui-time-axis-item-data-bottom{text-align:center;padding:0 12px;flex:1}.devui-time-axis-horizontal .devui-time-axis-item-line-style-dashed{border-bottom-style:dashed}.devui-time-axis-horizontal .devui-time-axis-item-line-style-solid{border-bottom-style:solid}.devui-time-axis-horizontal .devui-time-axis-item-line-style-dotted{border-bottom-style:dotted}.devui-time-axis-horizontal .devui-time-axis-item-line-style-none{border-bottom-style:none}.devui-time-axis-horizontal .devui-time-axis-item .devui-time-axis-middle-zone{position:absolute;left:50%;transform:translate(-50%,-50%)}.devui-time-axis-item-dot,.devui-time-axis-item-dot>svg{width:18px;height:18px}.devui-time-axis-item-dot>i{font-size:18px}.devui-time-axis-item:last-child .devui-time-axis-item-line:last-child{display:none}
1
+ .devui-time-axis-vertical{display:flex;flex-direction:column;align-items:center;position:relative}.devui-time-axis-vertical .devui-time-axis-item{display:flex;flex-direction:row;width:100%}.devui-time-axis-vertical .devui-time-axis-item-axis{display:flex;flex-direction:column;align-items:center;padding:0 12px}.devui-time-axis-vertical .devui-time-axis-item-line{position:relative;height:calc(100% - 18px);min-height:20px;border-left-width:2px;border-left-color:var(--devui-dividing-line, #dfe1e6)}.devui-time-axis-vertical .devui-time-axis-item-line-extra{position:absolute;top:50%;transform:translate(-50%,-50%)}.devui-time-axis-vertical .devui-time-axis-item-line:first-child{display:none}.devui-time-axis-vertical .devui-time-axis-item-data-left{text-align:end}.devui-time-axis-vertical .devui-time-axis-item-data-left,.devui-time-axis-vertical .devui-time-axis-item-data-right{margin-bottom:24px;margin-top:-2px;flex:1}.devui-time-axis-vertical .devui-time-axis-item-line-style-dashed{border-left-style:dashed}.devui-time-axis-vertical .devui-time-axis-item-line-style-solid{border-left-style:solid}.devui-time-axis-vertical .devui-time-axis-item-line-style-dotted{border-left-style:dotted}.devui-time-axis-vertical .devui-time-axis-item-line-style-none{border-left-style:none}.devui-time-axis-vertical .devui-time-axis-item .devui-time-axis-middle-zone{position:absolute;top:50%;transform:translate(-50%,-50%)}.devui-time-axis-horizontal{display:flex;flex-direction:row;align-items:center;position:relative}.devui-time-axis-horizontal-center .devui-time-axis-item-data-top,.devui-time-axis-horizontal-center .devui-time-axis-item-data-bottom{text-align:center;padding:0 6px}.devui-time-axis-horizontal-center .devui-time-axis-item-data-top>div,.devui-time-axis-horizontal-center .devui-time-axis-item-data-bottom>div{transform:translate(-50%)}.devui-time-axis-horizontal .devui-time-axis-item{display:flex;flex-direction:column;height:100%}.devui-time-axis-horizontal .devui-time-axis-item-axis{display:flex;flex-direction:row;align-items:center;padding:12px 0}.devui-time-axis-horizontal .devui-time-axis-item-line{position:relative;min-width:60px;width:calc(100% - 18px);border-bottom-width:2px;border-bottom-color:var(--devui-dividing-line, #dfe1e6)}.devui-time-axis-horizontal .devui-time-axis-item-line-extra{position:absolute;left:50%;transform:translate(-50%,-50%)}.devui-time-axis-horizontal .devui-time-axis-item:first-child .devui-time-axis-item-line:first-child{opacity:0}.devui-time-axis-horizontal .devui-time-axis-item-data-top,.devui-time-axis-horizontal .devui-time-axis-item-data-bottom{padding-right:12px;flex:1}.devui-time-axis-horizontal .devui-time-axis-item-line-style-dashed{border-bottom-style:dashed}.devui-time-axis-horizontal .devui-time-axis-item-line-style-solid{border-bottom-style:solid}.devui-time-axis-horizontal .devui-time-axis-item-line-style-dotted{border-bottom-style:dotted}.devui-time-axis-horizontal .devui-time-axis-item-line-style-none{border-bottom-style:none}.devui-time-axis-horizontal .devui-time-axis-item .devui-time-axis-middle-zone{position:absolute;left:50%;transform:translate(-50%,-50%)}.devui-time-axis-item-dot,.devui-time-axis-item-dot>svg{width:18px;height:18px;flex-shrink:0}.devui-time-axis-item-dot>i{font-size:18px;vertical-align:0}.devui-time-axis-item-type-primary{border:2px solid var(--devui-placeholder, #8a8e99);border-radius:50%}.devui-time-axis-item-type-success i{color:var(--devui-success, #50d4ab)}.devui-time-axis-item-type-error i{color:var(--devui-danger, #f66f6a)}.devui-time-axis-item-type-warning i{color:var(--devui-warning, #fac20a)}.devui-time-axis-item-type-running{line-height:16px;text-align:center;animation:devui-time-axis-running 1.5s linear infinite;border:2px solid var(--devui-success, #50d4ab);border-radius:50%}@keyframes devui-time-axis-running{0%{transform:rotate(0);color:var(--devui-success, #50d4ab);border-color:var(--devui-success, #50d4ab)}50%{transform:rotate(180deg);color:var(--devui-success, #50d4ab);border-color:var(--devui-success, #50d4ab)}to{transform:rotate(360deg);color:var(--devui-success, #50d4ab);border-color:var(--devui-success, #50d4ab)}}
@@ -0,0 +1,7 @@
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;
@@ -14,7 +14,7 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
- import { defineComponent, createVNode, Fragment, reactive, ref, onMounted, onBeforeUnmount, onUnmounted, computed, mergeProps, watch, createTextVNode } from "vue";
17
+ import { defineComponent, createVNode, reactive, ref, onMounted, onBeforeUnmount, onUnmounted, Fragment, computed, withDirectives, mergeProps, resolveDirective, watch, createTextVNode } from "vue";
18
18
  const timePickerProps = {
19
19
  modelValue: {
20
20
  type: String,
@@ -47,6 +47,10 @@ const timePickerProps = {
47
47
  autoOpen: {
48
48
  type: Boolean,
49
49
  default: false
50
+ },
51
+ showAnimation: {
52
+ type: Boolean,
53
+ default: true
50
54
  }
51
55
  };
52
56
  var Icon = defineComponent({
@@ -79,11 +83,12 @@ var Icon = defineComponent({
79
83
  color,
80
84
  classPrefix
81
85
  } = this;
82
- return createVNode(Fragment, null, [/^((https?):)?\/\//.test(name) ? createVNode("img", {
86
+ return /^((https?):)?\/\//.test(name) ? createVNode("img", {
83
87
  "src": name,
84
88
  "alt": name.split("/")[name.split("/").length - 1],
85
89
  "style": {
86
- width: size
90
+ width: size,
91
+ verticalAlign: "text-bottom"
87
92
  }
88
93
  }, null) : createVNode("i", {
89
94
  "class": `${classPrefix} ${classPrefix}-${name}`,
@@ -91,7 +96,7 @@ var Icon = defineComponent({
91
96
  fontSize: size,
92
97
  color
93
98
  }
94
- }, null)]);
99
+ }, null);
95
100
  }
96
101
  });
97
102
  Icon.install = function(app) {
@@ -156,7 +161,7 @@ const setTimeAstrict = (hourList, minuteList, secondList, minTime, maxTime, form
156
161
  }
157
162
  });
158
163
  };
159
- function useTimePicker(hh, mm, ss, minTime, format, autoOpen, disabled, value) {
164
+ function useTimePicker(hh, mm, ss, minTime, maxTime, format, autoOpen, disabled, value) {
160
165
  const isActive = ref(false);
161
166
  const showPopup = ref(false);
162
167
  const devuiTimePicker = ref();
@@ -183,13 +188,29 @@ function useTimePicker(hh, mm, ss, minTime, format, autoOpen, disabled, value) {
183
188
  };
184
189
  const mouseInIputFun = () => {
185
190
  if (firsthandActiveTime.value == "00:00:00") {
191
+ const vModelValueArr = value.split(":");
192
+ const minTimeValueArr = minTime.split(":");
186
193
  vModeValue.value == "" ? vModeValue.value = "00:00:00" : "";
187
- vModeValue.value > minTime ? firsthandActiveTime.value = vModeValue.value : firsthandActiveTime.value = minTime;
194
+ if (vModeValue.value > minTime) {
195
+ firsthandActiveTime.value = value;
196
+ setInputValue(vModelValueArr[0], vModelValueArr[1], vModelValueArr[2]);
197
+ } else {
198
+ firsthandActiveTime.value = minTime;
199
+ setInputValue(minTimeValueArr[0], minTimeValueArr[1], minTimeValueArr[2]);
200
+ }
188
201
  }
189
- setInputValue();
190
202
  isActive.value = true;
191
203
  showPopup.value = true;
192
204
  };
205
+ const vModelIsBeyond = () => {
206
+ if (vModeValue.value != "" && vModeValue.value < minTime) {
207
+ vModeValue.value = minTime;
208
+ } else if (vModeValue.value != "" && vModeValue.value > maxTime) {
209
+ vModeValue.value = maxTime;
210
+ }
211
+ const vModelValueArr = vModeValue.value.split(":");
212
+ vModeValue.value && setInputValue(vModelValueArr[0], vModelValueArr[1], vModelValueArr[2]);
213
+ };
193
214
  const getTimeValue = (e) => {
194
215
  e.stopPropagation();
195
216
  if (showPopup.value) {
@@ -197,18 +218,18 @@ function useTimePicker(hh, mm, ss, minTime, format, autoOpen, disabled, value) {
197
218
  mm.value = timePopupDom.value.changTimeData().activeMinute.value;
198
219
  ss.value = timePopupDom.value.changTimeData().activeSecond.value;
199
220
  firsthandActiveTime.value = `${hh.value}:${mm.value}:${ss.value}`;
200
- setInputValue();
221
+ setInputValue(hh.value, mm.value, ss.value);
201
222
  }
202
223
  };
203
- const setInputValue = () => {
224
+ const setInputValue = (hh2, mm2, ss2) => {
204
225
  if (format == "hh:mm:ss") {
205
- vModeValue.value = `${hh.value}:${mm.value}:${ss.value}`;
226
+ vModeValue.value = `${hh2}:${mm2}:${ss2}`;
206
227
  } else if (format == "mm:hh:ss") {
207
- vModeValue.value = `${mm.value}:${hh.value}:${ss.value}`;
228
+ vModeValue.value = `${mm2}:${hh2}:${ss2}`;
208
229
  } else if (format == "hh:mm") {
209
- vModeValue.value = `${hh.value}:${mm.value}`;
230
+ vModeValue.value = `${hh2}:${mm2}`;
210
231
  } else if (format == "mm:ss") {
211
- vModeValue.value = `${mm.value}:${ss.value}`;
232
+ vModeValue.value = `${mm2}:${ss2}`;
212
233
  }
213
234
  };
214
235
  const clearAll = (e) => {
@@ -225,7 +246,7 @@ function useTimePicker(hh, mm, ss, minTime, format, autoOpen, disabled, value) {
225
246
  ss.value = "00";
226
247
  }
227
248
  firsthandActiveTime.value = `${hh.value}:${mm.value}:${ss.value}`;
228
- setInputValue();
249
+ setInputValue(hh.value, mm.value, ss.value);
229
250
  };
230
251
  const isOutOpen = () => {
231
252
  if (autoOpen) {
@@ -234,7 +255,7 @@ function useTimePicker(hh, mm, ss, minTime, format, autoOpen, disabled, value) {
234
255
  mm.value = timeArr[1];
235
256
  ss.value = timeArr[2];
236
257
  firsthandActiveTime.value = vModeValue.value;
237
- setInputValue();
258
+ setInputValue(hh.value, mm.value, ss.value);
238
259
  isActive.value = true;
239
260
  showPopup.value = autoOpen;
240
261
  }
@@ -249,14 +270,14 @@ function useTimePicker(hh, mm, ss, minTime, format, autoOpen, disabled, value) {
249
270
  ss.value = slotTime.time;
250
271
  }
251
272
  firsthandActiveTime.value = `${hh.value}:${mm.value}:${ss.value}`;
252
- setInputValue();
273
+ setInputValue(hh.value, mm.value, ss.value);
253
274
  } else {
254
275
  const timeArr = slotTime.time.split(":");
255
276
  hh.value = timeArr[0];
256
277
  mm.value = timeArr[1];
257
278
  ss.value = timeArr[2];
258
279
  firsthandActiveTime.value = `${hh.value}:${mm.value}:${ss.value}`;
259
- setInputValue();
280
+ setInputValue(hh.value, mm.value, ss.value);
260
281
  }
261
282
  };
262
283
  return {
@@ -272,10 +293,10 @@ function useTimePicker(hh, mm, ss, minTime, format, autoOpen, disabled, value) {
272
293
  firsthandActiveTime,
273
294
  vModeValue,
274
295
  getPopupPosition,
275
- setInputValue,
276
296
  getTimeValue,
277
297
  clickVerifyFun,
278
298
  isOutOpen,
299
+ vModelIsBeyond,
279
300
  clearAll,
280
301
  chooseTime
281
302
  };
@@ -552,6 +573,7 @@ function useTimeScroll() {
552
573
  var index$3 = "";
553
574
  var TimeScroll = defineComponent({
554
575
  name: "DTimeScroll",
576
+ props: timePickerProps,
555
577
  setup(props, ctx) {
556
578
  const {
557
579
  scrollBoxDom,
@@ -593,7 +615,7 @@ var TimeScroll = defineComponent({
593
615
  "class": "devui-scroll-box"
594
616
  }, [createVNode("div", {
595
617
  "ref": scrollContentDom,
596
- "class": `box-content ${isDown.value ? "box-content-behavior-auto" : ""}`,
618
+ "class": `box-content ${isDown.value || !props.showAnimation ? "box-content-behavior-auto" : ""}`,
597
619
  "style": {
598
620
  "margin-right": marginRight + "px"
599
621
  }
@@ -665,7 +687,7 @@ var TimeList = defineComponent({
665
687
  return createVNode("div", {
666
688
  "class": "time-item",
667
689
  "style": {
668
- "width": props.format.length > 6 ? "33.333%" : "50%"
690
+ "flex": 1
669
691
  }
670
692
  }, [createVNode(TimeScroll, null, {
671
693
  default: () => [createVNode("ul", {
@@ -789,7 +811,7 @@ var Button = defineComponent({
789
811
  showLoading,
790
812
  width
791
813
  } = props;
792
- return createVNode("div", mergeProps({
814
+ return withDirectives(createVNode("div", mergeProps({
793
815
  "class": "devui-btn-host"
794
816
  }, ctx.attrs), [createVNode("button", {
795
817
  "class": btnClass.value,
@@ -800,12 +822,12 @@ var Button = defineComponent({
800
822
  },
801
823
  "onClick": onClick
802
824
  }, [!!icon ? createVNode(Icon, {
803
- "name": props.icon,
825
+ "name": icon,
804
826
  "class": iconClass.value
805
827
  }, null) : null, createVNode("span", {
806
828
  "class": "button-content",
807
829
  "ref": buttonContent
808
- }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])])]);
830
+ }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])])]), [[resolveDirective("dLoading"), showLoading]]);
809
831
  };
810
832
  }
811
833
  });
@@ -938,11 +960,12 @@ var TimePicker = defineComponent({
938
960
  getTimeValue,
939
961
  clickVerifyFun,
940
962
  isOutOpen,
963
+ vModelIsBeyond,
941
964
  clearAll,
942
965
  timePopupDom,
943
966
  vModeValue,
944
967
  getPopupPosition
945
- } = useTimePicker(activeHour, activeMinute, activeSecond, props.minTime, format, props.autoOpen, props.disabled, props.modelValue);
968
+ } = useTimePicker(activeHour, activeMinute, activeSecond, props.minTime, props.maxTime, format, props.autoOpen, props.disabled, props.modelValue);
946
969
  const selectedTimeChage = (e) => {
947
970
  isActive.value = false;
948
971
  showPopup.value = false;
@@ -951,6 +974,7 @@ var TimePicker = defineComponent({
951
974
  onMounted(() => {
952
975
  getPopupPosition();
953
976
  isOutOpen();
977
+ vModelIsBeyond();
954
978
  document.addEventListener("click", clickVerifyFun);
955
979
  document.addEventListener("click", getTimeValue);
956
980
  document.addEventListener("scroll", getPopupPosition);
@@ -964,7 +988,7 @@ var TimePicker = defineComponent({
964
988
  });
965
989
  watch(vModeValue, (newValue) => {
966
990
  ctx.emit("update:modelValue", vModeValue.value);
967
- if (newValue != props.minTime) {
991
+ if (newValue != props.minTime && newValue != "00:00") {
968
992
  showClearIcon.value = true;
969
993
  } else {
970
994
  showClearIcon.value = false;
@@ -1021,7 +1045,7 @@ TimePicker.install = function(app) {
1021
1045
  var index = {
1022
1046
  title: "TimePicker \u65F6\u95F4\u9009\u62E9\u5668",
1023
1047
  category: "\u6570\u636E\u5F55\u5165",
1024
- status: "80%",
1048
+ status: "90%",
1025
1049
  install(app) {
1026
1050
  app.use(TimePicker);
1027
1051
  }