vue-devui 1.0.0-pre.0 → 1.0.0-rc.2

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 (264) hide show
  1. package/README.md +126 -187
  2. package/alert/index.es.js +28 -30
  3. package/alert/index.umd.js +1 -1
  4. package/auto-complete/index.es.js +67 -82
  5. package/auto-complete/index.umd.js +3 -1
  6. package/auto-complete/style.css +1 -1
  7. package/badge/index.es.js +1 -1
  8. package/badge/index.umd.js +1 -1
  9. package/badge/style.css +1 -1
  10. package/button/index.es.js +39 -40
  11. package/button/index.umd.js +1 -1
  12. package/countdown/index.es.js +2 -1
  13. package/editable-select/index.es.js +122 -163
  14. package/editable-select/index.umd.js +1 -1
  15. package/fullscreen/index.es.js +13 -16
  16. package/fullscreen/index.umd.js +1 -1
  17. package/icon/index.es.js +39 -57
  18. package/icon/index.umd.js +1 -1
  19. package/image-preview/index.es.js +2 -1
  20. package/modal/index.es.js +81 -76
  21. package/modal/index.umd.js +1 -1
  22. package/modal/style.css +1 -1
  23. package/notification/index.es.js +38 -40
  24. package/notification/index.umd.js +1 -1
  25. package/nuxt/components/PanelBody.js +3 -0
  26. package/nuxt/components/PanelFooter.js +3 -0
  27. package/nuxt/components/PanelHeader.js +3 -0
  28. package/nuxt/components/Timeline.js +3 -0
  29. package/nuxt/components/TimelineItem.js +3 -0
  30. package/nuxt/components/alertProps.js +3 -0
  31. package/nuxt/components/fullscreenProps.js +3 -0
  32. package/nuxt/components/iconProps.js +2 -0
  33. package/nuxt/components/paginationProps.js +3 -0
  34. package/nuxt/components/panelProps.js +3 -0
  35. package/nuxt/components/searchProps.js +3 -0
  36. package/nuxt/components/tagProps.js +3 -0
  37. package/overlay/index.es.js +44 -37
  38. package/overlay/index.umd.js +1 -1
  39. package/overlay/style.css +1 -1
  40. package/package.json +8 -43
  41. package/pagination/index.es.js +10 -12
  42. package/pagination/index.umd.js +1 -1
  43. package/panel/index.es.js +45 -32
  44. package/panel/index.umd.js +1 -1
  45. package/popover/index.es.js +46 -39
  46. package/popover/index.umd.js +6 -6
  47. package/popover/style.css +1 -1
  48. package/progress/index.es.js +1 -1
  49. package/progress/index.umd.js +1 -1
  50. package/progress/style.css +1 -1
  51. package/radio/index.es.js +11 -11
  52. package/radio/index.umd.js +1 -1
  53. package/radio/style.css +1 -1
  54. package/read-tip/index.es.js +6 -3
  55. package/result/index.es.js +38 -53
  56. package/result/index.umd.js +1 -1
  57. package/ripple/index.es.js +47 -42
  58. package/ripple/index.umd.js +1 -1
  59. package/search/index.es.js +2 -5
  60. package/search/index.umd.js +4 -4
  61. package/skeleton/index.es.js +17 -17
  62. package/skeleton/index.umd.js +1 -1
  63. package/slider/index.es.js +60 -59
  64. package/slider/index.umd.js +1 -1
  65. package/splitter/index.es.js +215 -160
  66. package/splitter/index.umd.js +11 -11
  67. package/splitter/style.css +1 -1
  68. package/status/index.es.js +1 -4
  69. package/status/index.umd.js +1 -1
  70. package/status/style.css +1 -1
  71. package/style.css +1 -1
  72. package/tag/index.es.js +15 -18
  73. package/tag/index.umd.js +1 -1
  74. package/tag/style.css +1 -1
  75. package/tag-input/index.es.js +4 -2
  76. package/{accordion → timeline}/index.d.ts +0 -0
  77. package/{time-axis → timeline}/index.es.js +65 -78
  78. package/timeline/index.umd.js +1 -0
  79. package/{anchor → timeline}/package.json +1 -1
  80. package/timeline/style.css +1 -0
  81. package/upload/index.es.js +38 -40
  82. package/upload/index.umd.js +1 -1
  83. package/vue-devui.es.js +1478 -1196
  84. package/vue-devui.umd.js +19 -17
  85. package/accordion/index.es.js +0 -720
  86. package/accordion/index.umd.js +0 -1
  87. package/accordion/package.json +0 -7
  88. package/accordion/style.css +0 -1
  89. package/anchor/index.d.ts +0 -7
  90. package/anchor/index.es.js +0 -263
  91. package/anchor/index.umd.js +0 -1
  92. package/anchor/style.css +0 -1
  93. package/back-top/index.d.ts +0 -7
  94. package/back-top/index.es.js +0 -128
  95. package/back-top/index.umd.js +0 -1
  96. package/back-top/package.json +0 -7
  97. package/back-top/style.css +0 -1
  98. package/breadcrumb/index.d.ts +0 -7
  99. package/breadcrumb/index.es.js +0 -127
  100. package/breadcrumb/index.umd.js +0 -1
  101. package/breadcrumb/package.json +0 -7
  102. package/breadcrumb/style.css +0 -1
  103. package/carousel/index.d.ts +0 -7
  104. package/carousel/index.es.js +0 -329
  105. package/carousel/index.umd.js +0 -1
  106. package/carousel/package.json +0 -7
  107. package/carousel/style.css +0 -1
  108. package/cascader/index.d.ts +0 -7
  109. package/cascader/index.es.js +0 -5963
  110. package/cascader/index.umd.js +0 -27
  111. package/cascader/package.json +0 -7
  112. package/cascader/style.css +0 -1
  113. package/color-picker/index.d.ts +0 -7
  114. package/color-picker/index.es.js +0 -8187
  115. package/color-picker/index.umd.js +0 -27
  116. package/color-picker/package.json +0 -7
  117. package/color-picker/style.css +0 -1
  118. package/date-picker/index.d.ts +0 -7
  119. package/date-picker/index.es.js +0 -1171
  120. package/date-picker/index.umd.js +0 -1
  121. package/date-picker/package.json +0 -7
  122. package/date-picker/style.css +0 -1
  123. package/dragdrop/index.d.ts +0 -7
  124. package/dragdrop/index.es.js +0 -157
  125. package/dragdrop/index.umd.js +0 -1
  126. package/dragdrop/package.json +0 -7
  127. package/drawer/index.d.ts +0 -7
  128. package/drawer/index.es.js +0 -234
  129. package/drawer/index.umd.js +0 -1
  130. package/drawer/package.json +0 -7
  131. package/drawer/style.css +0 -1
  132. package/dropdown/index.d.ts +0 -7
  133. package/dropdown/index.es.js +0 -638
  134. package/dropdown/index.umd.js +0 -1
  135. package/dropdown/package.json +0 -7
  136. package/dropdown/style.css +0 -1
  137. package/form/index.d.ts +0 -7
  138. package/form/index.es.js +0 -7865
  139. package/form/index.umd.js +0 -27
  140. package/form/package.json +0 -7
  141. package/form/style.css +0 -1
  142. package/gantt/index.d.ts +0 -7
  143. package/gantt/index.es.js +0 -523
  144. package/gantt/index.umd.js +0 -1
  145. package/gantt/package.json +0 -7
  146. package/gantt/style.css +0 -1
  147. package/input-icon/index.d.ts +0 -7
  148. package/input-icon/index.es.js +0 -331
  149. package/input-icon/index.umd.js +0 -1
  150. package/input-icon/package.json +0 -7
  151. package/input-icon/style.css +0 -1
  152. package/input-number/index.d.ts +0 -7
  153. package/input-number/index.es.js +0 -240
  154. package/input-number/index.umd.js +0 -1
  155. package/input-number/package.json +0 -7
  156. package/input-number/style.css +0 -1
  157. package/list/index.d.ts +0 -7
  158. package/list/index.es.js +0 -39
  159. package/list/index.umd.js +0 -1
  160. package/list/package.json +0 -7
  161. package/list/style.css +0 -1
  162. package/nav-sprite/index.d.ts +0 -7
  163. package/nav-sprite/index.es.js +0 -68
  164. package/nav-sprite/index.umd.js +0 -1
  165. package/nav-sprite/package.json +0 -7
  166. package/nuxt/components/Accordion.js +0 -3
  167. package/nuxt/components/Anchor.js +0 -3
  168. package/nuxt/components/BackTop.js +0 -3
  169. package/nuxt/components/Breadcrumb.js +0 -3
  170. package/nuxt/components/Carousel.js +0 -3
  171. package/nuxt/components/CarouselItem.js +0 -3
  172. package/nuxt/components/Cascader.js +0 -3
  173. package/nuxt/components/ColorPicker.js +0 -3
  174. package/nuxt/components/Column.js +0 -3
  175. package/nuxt/components/DatePicker.js +0 -3
  176. package/nuxt/components/Drawer.js +0 -3
  177. package/nuxt/components/DrawerService.js +0 -3
  178. package/nuxt/components/Dropdown.js +0 -3
  179. package/nuxt/components/DropdownMenu.js +0 -3
  180. package/nuxt/components/Form.js +0 -3
  181. package/nuxt/components/FormControl.js +0 -3
  182. package/nuxt/components/FormItem.js +0 -3
  183. package/nuxt/components/FormLabel.js +0 -3
  184. package/nuxt/components/FormOperation.js +0 -3
  185. package/nuxt/components/Gantt.js +0 -3
  186. package/nuxt/components/InputIcon.js +0 -3
  187. package/nuxt/components/InputNumber.js +0 -3
  188. package/nuxt/components/List.js +0 -3
  189. package/nuxt/components/ListItem.js +0 -3
  190. package/nuxt/components/NavSprite.js +0 -2
  191. package/nuxt/components/QuadrantDiagram.js +0 -3
  192. package/nuxt/components/Select.js +0 -3
  193. package/nuxt/components/StepsGuide.js +0 -3
  194. package/nuxt/components/StickSlider.js +0 -3
  195. package/nuxt/components/Sticky.js +0 -2
  196. package/nuxt/components/Table.js +0 -3
  197. package/nuxt/components/Tabs.js +0 -3
  198. package/nuxt/components/TimeAxis.js +0 -3
  199. package/nuxt/components/TimeAxisItem.js +0 -3
  200. package/nuxt/components/TimePicker.js +0 -3
  201. package/nuxt/components/Tooltip.js +0 -3
  202. package/nuxt/components/Transfer.js +0 -3
  203. package/nuxt/components/Tree.js +0 -3
  204. package/nuxt/components/TreeSelect.js +0 -3
  205. package/nuxt/components/dropdownMenuProps.js +0 -3
  206. package/nuxt/components/tooltipProps.js +0 -3
  207. package/quadrant-diagram/index.d.ts +0 -7
  208. package/quadrant-diagram/index.es.js +0 -5728
  209. package/quadrant-diagram/index.umd.js +0 -27
  210. package/quadrant-diagram/package.json +0 -7
  211. package/quadrant-diagram/style.css +0 -1
  212. package/select/index.d.ts +0 -7
  213. package/select/index.es.js +0 -706
  214. package/select/index.umd.js +0 -1
  215. package/select/package.json +0 -7
  216. package/select/style.css +0 -1
  217. package/steps-guide/index.d.ts +0 -7
  218. package/steps-guide/index.es.js +0 -239
  219. package/steps-guide/index.umd.js +0 -1
  220. package/steps-guide/package.json +0 -7
  221. package/steps-guide/style.css +0 -1
  222. package/sticky/index.d.ts +0 -7
  223. package/sticky/index.es.js +0 -197
  224. package/sticky/index.umd.js +0 -1
  225. package/sticky/package.json +0 -7
  226. package/table/index.d.ts +0 -7
  227. package/table/index.es.js +0 -1969
  228. package/table/index.umd.js +0 -1
  229. package/table/package.json +0 -7
  230. package/table/style.css +0 -1
  231. package/tabs/index.d.ts +0 -7
  232. package/tabs/index.es.js +0 -194
  233. package/tabs/index.umd.js +0 -1
  234. package/tabs/package.json +0 -7
  235. package/tabs/style.css +0 -1
  236. package/time-axis/index.d.ts +0 -7
  237. package/time-axis/index.umd.js +0 -1
  238. package/time-axis/package.json +0 -7
  239. package/time-axis/style.css +0 -1
  240. package/time-picker/index.d.ts +0 -7
  241. package/time-picker/index.es.js +0 -1237
  242. package/time-picker/index.umd.js +0 -1
  243. package/time-picker/package.json +0 -7
  244. package/time-picker/style.css +0 -1
  245. package/tooltip/index.d.ts +0 -7
  246. package/tooltip/index.es.js +0 -5828
  247. package/tooltip/index.umd.js +0 -27
  248. package/tooltip/package.json +0 -7
  249. package/tooltip/style.css +0 -1
  250. package/transfer/index.d.ts +0 -7
  251. package/transfer/index.es.js +0 -7608
  252. package/transfer/index.umd.js +0 -27
  253. package/transfer/package.json +0 -7
  254. package/transfer/style.css +0 -1
  255. package/tree/index.d.ts +0 -7
  256. package/tree/index.es.js +0 -6490
  257. package/tree/index.umd.js +0 -27
  258. package/tree/package.json +0 -7
  259. package/tree/style.css +0 -1
  260. package/tree-select/index.d.ts +0 -7
  261. package/tree-select/index.es.js +0 -623
  262. package/tree-select/index.umd.js +0 -1
  263. package/tree-select/package.json +0 -7
  264. package/tree-select/style.css +0 -1
@@ -1,1171 +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, inject, computed, ref, watch, createVNode, withDirectives, mergeProps, resolveDirective, resolveComponent, createTextVNode, reactive, onMounted, onUnmounted } from "vue";
18
- const getDateTime = (d) => {
19
- const year = d.getFullYear();
20
- const month = d.getMonth() + 1;
21
- const date = d.getDate();
22
- const day = d.getDay();
23
- const hour = d.getHours();
24
- const minute = d.getMinutes();
25
- const second = d.getSeconds();
26
- const ms = d.getMilliseconds();
27
- return [year, month, date, day, hour, minute, second, ms];
28
- };
29
- const fixStart = (n, m, max = 2, ch = "0") => {
30
- return (n + "").padStart(Math.min(m.length, max), ch);
31
- };
32
- const formatDate = (fmt, d) => {
33
- const usage = getDateTime(d);
34
- let res = fmt;
35
- res = res.replace(/y+/g, (m) => {
36
- const year = usage[0] + "";
37
- if (m.length === 2) {
38
- return year.substring(2);
39
- }
40
- return year;
41
- });
42
- res = res.replace(/M+/g, (m) => fixStart(usage[1], m));
43
- res = res.replace(/d+/g, (m) => fixStart(usage[2], m));
44
- res = res.replace(/h+/g, (m) => fixStart(usage[4], m));
45
- res = res.replace(/m+/g, (m) => fixStart(usage[5], m));
46
- res = res.replace(/s+/g, (m) => fixStart(usage[6], m));
47
- return res;
48
- };
49
- const formatRange$1 = (fmt, a, b, conn = "-") => {
50
- const ab = [a, b];
51
- if (a.getTime() > b.getTime()) {
52
- ab.reverse();
53
- }
54
- return `${formatDate(fmt, ab[0])} ${conn} ${formatDate(fmt, ab[1])}`;
55
- };
56
- const isIn = (a, b) => {
57
- if (!b) {
58
- return false;
59
- }
60
- while (a) {
61
- if (a === b) {
62
- return true;
63
- }
64
- a = a.parentNode;
65
- }
66
- return false;
67
- };
68
- const invokeFunction = (fn, ...args) => {
69
- if (typeof fn === "function") {
70
- fn(...args);
71
- }
72
- };
73
- const getHumanDate = (d) => {
74
- const year = d.getFullYear();
75
- const month = d.getMonth() + 1;
76
- const date = d.getDate();
77
- const day = d.getDay();
78
- const hour = d.getHours();
79
- const minute = d.getMinutes();
80
- const second = d.getSeconds();
81
- const ms = d.getMilliseconds();
82
- return {
83
- year,
84
- y: year,
85
- month,
86
- M: month,
87
- date,
88
- d: date,
89
- day,
90
- hour,
91
- H: hour,
92
- h: hour,
93
- minute,
94
- m: minute,
95
- second,
96
- s: second,
97
- ms
98
- };
99
- };
100
- const getMonthDays = (year, month) => {
101
- const first = new Date(year, month - 1, 1);
102
- const last = new Date(year, month, 0);
103
- const dates = [];
104
- let day = first.getDay();
105
- while (day > 0) {
106
- day -= 1;
107
- dates.push({ date: new Date(year, month - 1, -day), current: -1 });
108
- }
109
- day = last.getDate() - first.getDate();
110
- for (let i = 0; i <= day; i++) {
111
- const date = new Date(first);
112
- date.setDate(i + 1);
113
- dates.push({ date, current: 0 });
114
- }
115
- day = last.getDay();
116
- let tail = last;
117
- for (let i = day; i < 6; i++) {
118
- tail = new Date(year, month, i - day + 1);
119
- dates.push({ date: tail, current: 1 });
120
- }
121
- if (dates.length < 42) {
122
- day = tail.getDate();
123
- for (let i = 1; i <= 7; i++) {
124
- tail = new Date(year, month, day + i);
125
- dates.push({ date: tail, current: 1 });
126
- }
127
- }
128
- return dates;
129
- };
130
- const getMonthWeeklyDays = (date = new Date()) => {
131
- if (!(date instanceof Date)) {
132
- date = new Date();
133
- }
134
- const { year, month } = getHumanDate(date);
135
- const days = getMonthDays(year, month);
136
- const dayRows = [];
137
- while (days.length > 0) {
138
- dayRows.push(days.splice(0, 7));
139
- }
140
- return dayRows;
141
- };
142
- const WEEK_DAYS = ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
143
- const invokeCallback = (cb, ...args) => {
144
- typeof cb === "function" && cb(...args);
145
- };
146
- const subDateMonth = (a, b) => {
147
- const am = a.getFullYear() * 12 + a.getMonth();
148
- const bm = b.getFullYear() * 12 + b.getMonth();
149
- return am - bm;
150
- };
151
- const ONE_DAY = 1e3 * 60 * 60 * 24;
152
- const subDateDay = (a, b) => {
153
- const ad = new Date(a.getFullYear(), a.getMonth(), a.getDate()).getTime();
154
- const bd = new Date(b.getFullYear(), b.getMonth(), b.getDate()).getTime();
155
- return (ad - bd) / ONE_DAY;
156
- };
157
- const compareDate = (small, big, mode, min) => {
158
- if (!small || !big) {
159
- return true;
160
- }
161
- if (mode === "year") {
162
- return big.getFullYear() - small.getFullYear() > min;
163
- } else {
164
- return subDateMonth(big, small) > min;
165
- }
166
- };
167
- const parseDate = (str) => {
168
- if (!str || typeof str !== "string") {
169
- return null;
170
- }
171
- const [dateStr = "", timeStr = ""] = str.split(/([ ]|T)+/);
172
- if (!dateStr) {
173
- return null;
174
- }
175
- const [y, m, d] = dateStr.split(/[^\d]+/);
176
- const year = _parseInt(y), month = _parseInt(m), date = _parseInt(d) || 1;
177
- if (!year || !month) {
178
- return null;
179
- }
180
- const time = parseTime(timeStr);
181
- return new Date(year, month - 1, date, ...time);
182
- };
183
- const _parseInt = (str, dftVal) => {
184
- if (!str || typeof str !== "string") {
185
- return dftVal;
186
- }
187
- const n = parseInt(str);
188
- if (isNaN(n)) {
189
- return dftVal;
190
- }
191
- return n;
192
- };
193
- const parseTime = (str) => {
194
- const [h, m, s, ms] = str.split(/[\:\.]+/);
195
- return [_parseInt(h, 0), _parseInt(m, 0), _parseInt(s, 0), _parseInt(ms, 0)];
196
- };
197
- const compareDateSort = (d1, d2, type = "d") => {
198
- const t1 = dateCounter(d1, type), t2 = dateCounter(d2, type);
199
- return t1 < t2 ? -1 : t1 > t2 ? 1 : 0;
200
- };
201
- const dateCounter = (date, type) => {
202
- switch (type) {
203
- case "y":
204
- return date.getFullYear();
205
- case "m":
206
- return date.getFullYear() * 12 + date.getMonth();
207
- }
208
- return date.getTime() / ONE_DAY >> 0;
209
- };
210
- const betweenDate = (date, left, right) => {
211
- if (left instanceof Date && compareDateSort(left, date, "d") > 0) {
212
- return false;
213
- }
214
- if (right instanceof Date && compareDateSort(date, right, "d") > 0) {
215
- return false;
216
- }
217
- return true;
218
- };
219
- const inputProps = {
220
- placeholder: {
221
- type: String,
222
- default: void 0
223
- },
224
- disabled: {
225
- type: Boolean,
226
- default: false
227
- },
228
- autoFocus: {
229
- type: Boolean,
230
- default: false
231
- },
232
- maxLength: {
233
- type: Number,
234
- default: Number.MAX_SAFE_INTEGER
235
- },
236
- cssClass: {
237
- type: String,
238
- default: ""
239
- },
240
- error: {
241
- type: Boolean,
242
- default: false
243
- },
244
- size: {
245
- type: String,
246
- default: ""
247
- },
248
- showPassword: {
249
- type: Boolean,
250
- default: false
251
- },
252
- modelValue: {
253
- type: String,
254
- default: ""
255
- },
256
- "update:modelValue": {
257
- type: Function,
258
- default: void 0
259
- },
260
- onChange: {
261
- type: Function,
262
- default: void 0
263
- },
264
- onKeydown: {
265
- type: Function,
266
- default: void 0
267
- },
268
- onFocus: {
269
- type: Function,
270
- default: void 0
271
- },
272
- onBlur: {
273
- type: Function,
274
- default: void 0
275
- }
276
- };
277
- var input = "";
278
- const formItemInjectionKey = Symbol("dFormItem");
279
- const dFormItemEvents = {
280
- blur: "d.form.blur",
281
- change: "d.form.change",
282
- input: "d.form.input"
283
- };
284
- var Input = defineComponent({
285
- name: "DInput",
286
- directives: {
287
- focus: {
288
- mounted: function(el, binding) {
289
- if (binding.value) {
290
- el.focus();
291
- }
292
- }
293
- }
294
- },
295
- props: inputProps,
296
- emits: ["update:modelValue", "focus", "blur", "change", "keydown"],
297
- setup(props, ctx) {
298
- const formItem = inject(formItemInjectionKey, {});
299
- const hasFormItem = Object.keys(formItem).length > 0;
300
- const sizeCls = computed(() => `devui-input-${props.size}`);
301
- const showPwdIcon = ref(false);
302
- const inputType = ref("text");
303
- const inputCls = computed(() => {
304
- return {
305
- error: props.error,
306
- [props.cssClass]: true,
307
- "devui-input-restore": showPwdIcon.value,
308
- [sizeCls.value]: props.size !== ""
309
- };
310
- });
311
- const showPreviewIcon = computed(() => inputType.value === "password");
312
- watch(() => props.showPassword, (flg) => {
313
- inputType.value = flg ? "password" : "text";
314
- showPwdIcon.value = props.showPassword;
315
- }, {
316
- immediate: true
317
- });
318
- const onInput = ($event) => {
319
- ctx.emit("update:modelValue", $event.target.value);
320
- hasFormItem && formItem.formItemMitt.emit(dFormItemEvents.input);
321
- }, onFocus = () => {
322
- ctx.emit("focus");
323
- }, onBlur = () => {
324
- ctx.emit("blur");
325
- hasFormItem && formItem.formItemMitt.emit(dFormItemEvents.blur);
326
- }, onChange = ($event) => {
327
- ctx.emit("change", $event.target.value);
328
- hasFormItem && formItem.formItemMitt.emit(dFormItemEvents.change);
329
- }, onKeydown = ($event) => {
330
- ctx.emit("keydown", $event);
331
- }, onChangeInputType = () => {
332
- inputType.value = inputType.value === "password" ? "text" : "password";
333
- };
334
- return {
335
- inputCls,
336
- inputType,
337
- showPreviewIcon,
338
- showPwdIcon,
339
- onInput,
340
- onFocus,
341
- onBlur,
342
- onChange,
343
- onKeydown,
344
- onChangeInputType
345
- };
346
- },
347
- render() {
348
- const {
349
- modelValue,
350
- showPreviewIcon,
351
- showPwdIcon,
352
- inputCls,
353
- inputType,
354
- maxLength,
355
- autoFocus,
356
- placeholder,
357
- disabled,
358
- onInput,
359
- onFocus,
360
- onBlur,
361
- onChange,
362
- onKeydown,
363
- onChangeInputType
364
- } = this;
365
- return createVNode("div", {
366
- "class": "devui-input__wrap"
367
- }, [withDirectives(createVNode("input", mergeProps({
368
- dinput: true
369
- }, {
370
- "value": modelValue,
371
- "disabled": disabled,
372
- "type": inputType,
373
- "maxlength": maxLength,
374
- "placeholder": placeholder,
375
- "class": inputCls,
376
- "onInput": onInput,
377
- "onFocus": onFocus,
378
- "onBlur": onBlur,
379
- "onChange": onChange,
380
- "onKeydown": onKeydown
381
- }), null), [[resolveDirective("focus"), autoFocus]]), showPwdIcon && createVNode("div", {
382
- "class": "devui-input__preview",
383
- "onClick": onChangeInputType
384
- }, [showPreviewIcon ? createVNode(resolveComponent("d-icon"), {
385
- "name": "preview-forbidden",
386
- "size": "12px",
387
- "key": 1
388
- }, null) : createVNode(resolveComponent("d-icon"), {
389
- "name": "preview",
390
- "size": "12px",
391
- "key": 2
392
- }, null)])]);
393
- }
394
- });
395
- Input.install = function(app) {
396
- app.component(Input.name, Input);
397
- };
398
- var Icon = defineComponent({
399
- name: "DIcon",
400
- props: {
401
- name: {
402
- type: String,
403
- required: true
404
- },
405
- size: {
406
- type: String,
407
- default: "inherit"
408
- },
409
- color: {
410
- type: String,
411
- default: "inherit"
412
- },
413
- classPrefix: {
414
- type: String,
415
- default: "icon"
416
- }
417
- },
418
- setup(props) {
419
- return __spreadValues({}, props);
420
- },
421
- render() {
422
- const {
423
- name,
424
- size,
425
- color,
426
- classPrefix
427
- } = this;
428
- return /^((https?):)?\/\//.test(name) ? createVNode("img", {
429
- "src": name,
430
- "alt": name.split("/")[name.split("/").length - 1],
431
- "style": {
432
- width: size,
433
- verticalAlign: "text-bottom"
434
- }
435
- }, null) : createVNode("i", {
436
- "class": `${classPrefix} ${classPrefix}-${name}`,
437
- "style": {
438
- fontSize: size,
439
- color
440
- }
441
- }, null);
442
- }
443
- });
444
- Icon.install = function(app) {
445
- app.component(Icon.name, Icon);
446
- };
447
- const handleCalendarSwitchState = (state, index2, pos, date) => {
448
- switch (index2) {
449
- case 0:
450
- const preYear = new Date(date);
451
- preYear.setFullYear(preYear.getFullYear() - 1);
452
- pos === 0 ? state.current = preYear : state.next = preYear;
453
- break;
454
- case 1:
455
- const preMonth = new Date(date);
456
- preMonth.setMonth(preMonth.getMonth() - 1);
457
- pos === 0 ? state.current = preMonth : state.next = preMonth;
458
- break;
459
- case 2:
460
- const nextMonth = new Date(date);
461
- nextMonth.setMonth(nextMonth.getMonth() + 1);
462
- pos === 0 ? state.current = nextMonth : state.next = nextMonth;
463
- break;
464
- case 3:
465
- const nextYear = new Date(date);
466
- nextYear.setFullYear(nextYear.getFullYear() + 1);
467
- pos === 0 ? state.current = nextYear : state.next = nextYear;
468
- break;
469
- }
470
- };
471
- const formatValue = (state, props) => {
472
- const { format = "y/MM/dd", range, rangeSpliter = "-" } = props || {};
473
- if (range) {
474
- if (!state.start) {
475
- return "";
476
- } else if (!state.end) {
477
- return formatDate(format, state.start);
478
- }
479
- if (state.end < state.start) {
480
- const end = state.end;
481
- state.end = state.start;
482
- state.start = end;
483
- }
484
- return formatRange$1(format, state.start, state.end, rangeSpliter);
485
- } else {
486
- if (!state.start) {
487
- return "";
488
- }
489
- return formatDate(format, state.start);
490
- }
491
- };
492
- const formatPlaceholder = (props) => {
493
- if (!props)
494
- return "";
495
- const format = props.format || `y/MM/dd`;
496
- const sp = props.rangeSpliter || "-";
497
- return props.range ? `${format} ${sp} ${format}` : format;
498
- };
499
- const getDateKey = (date) => {
500
- return date.toDateString();
501
- };
502
- const cellClassName = (props, day, base = "cell") => {
503
- if (!betweenDate(day.date, props.dateMin, props.dateMax)) {
504
- return `${base} disabled`;
505
- } else if (day.current !== 0) {
506
- return `${base} not-current`;
507
- }
508
- const key = getDateKey(day.date);
509
- if (props.type === "range") {
510
- if (props.dateStart) {
511
- if (getDateKey(props.dateStart) === key) {
512
- return `${base} selected`;
513
- }
514
- if (props.dateEnd && getDateKey(props.dateEnd) === key) {
515
- return `${base} selected`;
516
- }
517
- const innerEnd = props.dateEnd || props.dateHover;
518
- if (innerEnd) {
519
- const range = innerEnd > props.dateStart ? [props.dateStart, innerEnd] : [innerEnd, props.dateStart];
520
- if (day.date > range[0] && day.date < range[1]) {
521
- return `${base} innerday`;
522
- }
523
- }
524
- }
525
- return base;
526
- } else {
527
- return props.dateStart && getDateKey(props.dateStart) === key ? `${base} selected` : base;
528
- }
529
- };
530
- const trigEvent = (props, day) => {
531
- if (!betweenDate(day.date, props.dateMin, props.dateMax)) {
532
- return;
533
- }
534
- if (props.type === "range") {
535
- if (!props.dateStart) {
536
- invokeCallback(props.onSelectStart, day.date);
537
- } else if (!props.dateEnd) {
538
- if (subDateDay(props.dateStart, day.date) !== 0) {
539
- invokeCallback(props.onSelectEnd, day.date);
540
- typeof props.onChange === "function" && props.onChange(props.type, props);
541
- }
542
- } else {
543
- invokeCallback(props.onReset, day.date);
544
- }
545
- } else {
546
- invokeCallback(props.onSelected, day.date);
547
- typeof props.onChange === "function" && props.onChange(props.type, props);
548
- }
549
- };
550
- const handleDateEnter = (props, day) => {
551
- if (day.current !== 0) {
552
- return;
553
- }
554
- const { dateMin, dateMax } = props;
555
- if (dateMin && subDateDay(day.date, dateMin) < 0) {
556
- return;
557
- }
558
- if (dateMax && subDateDay(dateMax, day.date) < 0) {
559
- return;
560
- }
561
- if (props.type === "range") {
562
- const key = getDateKey(day.date);
563
- if (!props.dateStart || getDateKey(props.dateStart) === key || props.dateEnd) {
564
- return;
565
- }
566
- invokeCallback(props.onSelecting, day.date);
567
- }
568
- };
569
- const Year = (props) => {
570
- const {
571
- color = "#585d6b",
572
- rotate = 0
573
- } = props;
574
- return createVNode("svg", {
575
- "style": {
576
- transform: `rotate(${rotate}deg)`
577
- },
578
- "width": "10px",
579
- "height": "10px",
580
- "viewBox": "0 0 10 10",
581
- "version": "1.1",
582
- "xmlns": "http://www.w3.org/2000/svg"
583
- }, [createVNode("g", {
584
- "fill": color,
585
- "transform": "translate(-1.000000, -1.000000)"
586
- }, [createVNode("path", {
587
- "d": "M11,1.83333333 L11,10.1666667 L7,7.38833333 L7,10.1666667 L1,6 L7,1.83333333 L7,4.61033333 L11,1.83333333 Z"
588
- }, null)])]);
589
- };
590
- const Month = (props) => {
591
- const {
592
- color = "#585d6b",
593
- rotate = 0
594
- } = props;
595
- return createVNode("svg", {
596
- "style": {
597
- transform: `rotate(${rotate}deg)`
598
- },
599
- "width": "6px",
600
- "height": "10px",
601
- "viewBox": "0 0 6 10",
602
- "version": "1.1",
603
- "xmlns": "http://www.w3.org/2000/svg"
604
- }, [createVNode("g", {
605
- "fill": color,
606
- "transform": "translate(-3.000000, -1.000000)"
607
- }, [createVNode("polygon", {
608
- "points": "6 3 10.1666667 9 1.83333333 9"
609
- }, null)])]);
610
- };
611
- var index$6 = "";
612
- const Item = (props) => {
613
- const {
614
- button: Btn,
615
- disabled = false,
616
- rotate = 0,
617
- date,
618
- pos
619
- } = props;
620
- const color = disabled ? "#cfd0d3" : "#585d6b";
621
- const className = `${disabled ? "disabled" : ""}`;
622
- const handleClick = disabled ? void 0 : () => invokeCallback(props.cb, date, pos);
623
- return createVNode("a", {
624
- "class": className,
625
- "onClick": handleClick
626
- }, [createVNode(Btn, {
627
- "color": color,
628
- "rotate": rotate
629
- }, null)]);
630
- };
631
- const Title = (props) => {
632
- const {
633
- date
634
- } = props;
635
- return createVNode("a", {
636
- "class": "title"
637
- }, [`${date.getFullYear()}\u5E74${(date.getMonth() + 1 + "").padStart(2, "0")}\u6708`]);
638
- };
639
- const CalendarToolbar = (props) => {
640
- const {
641
- type,
642
- current,
643
- compare,
644
- pos,
645
- dateMax,
646
- dateMin,
647
- onPreviousYear,
648
- onPreviousMonth,
649
- onNextMonth,
650
- onNextYear
651
- } = props;
652
- const dis = [false, false, false, false];
653
- if (type === "range") {
654
- if (pos === 1) {
655
- dis[0] = !compareDate(compare, current, "year", 1);
656
- dis[1] = !compareDate(compare, current, "month", 1);
657
- dis[2] = !compareDate(current, dateMax, "month", 0);
658
- dis[3] = !compareDate(current, dateMax, "year", 0);
659
- } else {
660
- dis[0] = !compareDate(dateMin, current, "year", 0);
661
- dis[1] = !compareDate(dateMin, current, "month", 0);
662
- dis[2] = !compareDate(current, compare, "month", 1);
663
- dis[3] = !compareDate(current, compare, "year", 1);
664
- }
665
- } else {
666
- dis[0] = !compareDate(dateMin, current, "year", 0);
667
- dis[1] = !compareDate(dateMin, current, "month", 0);
668
- dis[2] = !compareDate(current, dateMax, "month", 0);
669
- dis[3] = !compareDate(current, dateMax, "year", 0);
670
- }
671
- return createVNode("div", {
672
- "class": "devui-calendar-toolbar"
673
- }, [createVNode(Item, {
674
- "disabled": dis[0],
675
- "date": current,
676
- "pos": pos,
677
- "button": Year,
678
- "cb": onPreviousYear
679
- }, null), createVNode(Item, {
680
- "disabled": dis[1],
681
- "date": current,
682
- "pos": pos,
683
- "button": Month,
684
- "rotate": -90,
685
- "cb": onPreviousMonth
686
- }, null), createVNode(Title, {
687
- "date": current
688
- }, null), createVNode(Item, {
689
- "disabled": dis[2],
690
- "date": current,
691
- "pos": pos,
692
- "button": Month,
693
- "rotate": 90,
694
- "cb": onNextMonth
695
- }, null), createVNode(Item, {
696
- "disabled": dis[3],
697
- "date": current,
698
- "pos": pos,
699
- "button": Year,
700
- "rotate": 180,
701
- "cb": onNextYear
702
- }, null)]);
703
- };
704
- const TodayDefault = (props) => {
705
- const {
706
- onSelected = () => 0,
707
- disabled = false
708
- } = props;
709
- return createVNode("div", {
710
- "class": `today-container ${disabled ? "disabled" : ""}`
711
- }, [createVNode("button", {
712
- "class": "today-button",
713
- "disabled": disabled,
714
- "onClick": disabled ? void 0 : () => onSelected(new Date())
715
- }, [createTextVNode("\u4ECA\u5929")])]);
716
- };
717
- var index$5 = "";
718
- const CalendarDatePanel = (props) => {
719
- const today = new Date();
720
- return createVNode("div", {
721
- "class": "devui-calendar-panel"
722
- }, [createVNode(CalendarToolbar, {
723
- "current": props.current,
724
- "compare": props.compare,
725
- "pos": props.pos,
726
- "type": props.type,
727
- "showTime": props.showTime,
728
- "onPreviousYear": props.onPreviousYear,
729
- "onPreviousMonth": props.onPreviousMonth,
730
- "onNextMonth": props.onNextMonth,
731
- "onNextYear": props.onNextYear,
732
- "dateMax": props.dateMax,
733
- "dateMin": props.dateMin
734
- }, null), createVNode("ol", {
735
- "class": "head row"
736
- }, [WEEK_DAYS.map((day) => createVNode("li", {
737
- "class": "cell"
738
- }, [day]))]), createVNode("ul", {
739
- "class": "body"
740
- }, [getMonthWeeklyDays(props.current).map((row) => createVNode("li", {
741
- "class": "row"
742
- }, [row.map((day) => {
743
- return createVNode("span", {
744
- "class": cellClassName(props, day),
745
- "onClick": () => trigEvent(props, day),
746
- "onMouseenter": () => handleDateEnter(props, day)
747
- }, [day.date.getDate()]);
748
- })]))]), props.type !== "range" ? createVNode(TodayDefault, {
749
- "disabled": !betweenDate(today, props.dateMin, props.dateMax),
750
- "onSelected": (today2) => {
751
- typeof props.onToday === "function" && props.onToday(today2, 0);
752
- }
753
- }, null) : null]);
754
- };
755
- var index$4 = "";
756
- const VerticalSlider = defineComponent({
757
- props: {
758
- size: {
759
- type: Number,
760
- default: 26
761
- },
762
- items: {
763
- type: Array
764
- },
765
- selectedIndex: {
766
- type: Number
767
- },
768
- className: {
769
- type: String
770
- },
771
- itemClassNormal: {
772
- type: String
773
- },
774
- itemClassSelected: {
775
- type: String
776
- },
777
- onChange: {
778
- type: Function
779
- }
780
- },
781
- setup(props) {
782
- const {
783
- items = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
784
- selectedIndex = 0,
785
- size = 26,
786
- className = "",
787
- itemClassNormal = "",
788
- itemClassSelected = "selected",
789
- onChange
790
- } = props || {};
791
- let max_y = 0, min_y = 0;
792
- const container = ref();
793
- const movbar = ref();
794
- let pos_start = null;
795
- let pos_cache = null;
796
- const state = reactive({
797
- selectedIndex,
798
- barOpacity: 0,
799
- x: 0,
800
- y: 0,
801
- transition: "none"
802
- });
803
- const handleMouseDown = (e) => {
804
- e.stopPropagation();
805
- e.preventDefault();
806
- pos_start = [e.clientX, e.clientY];
807
- state.transition = "none";
808
- };
809
- const handleMouseMove = (e) => {
810
- e.stopPropagation();
811
- e.preventDefault();
812
- if (!pos_start || !pos_cache) {
813
- return;
814
- }
815
- state.x = pos_cache[0] + e.clientX - pos_start[0];
816
- state.y = Math.min(max_y, Math.max(min_y, pos_cache[1] + e.clientY - pos_start[1]));
817
- state.selectedIndex = (max_y - state.y + size / 2) / size >> 0;
818
- };
819
- const handleMouseUp = (e) => {
820
- e.stopPropagation();
821
- e.preventDefault();
822
- pos_start = null;
823
- state.y = max_y - state.selectedIndex * size;
824
- state.transition = "transform 0.1s";
825
- pos_cache[0] = state.x;
826
- pos_cache[1] = state.y;
827
- if (typeof onChange === "function") {
828
- const idx = state.selectedIndex;
829
- const val = items[idx];
830
- onChange(val, idx);
831
- }
832
- };
833
- onMounted(() => {
834
- const {
835
- height: ch
836
- } = container.value.getBoundingClientRect();
837
- const {
838
- height: mh
839
- } = movbar.value.getBoundingClientRect();
840
- max_y = (ch - size) / 2;
841
- min_y = (ch + size) / 2 - mh;
842
- pos_cache = [0, max_y - state.selectedIndex * size];
843
- state.x = pos_cache[0];
844
- state.y = pos_cache[1];
845
- state.barOpacity = 1;
846
- state.transition = "transform 0.1s";
847
- });
848
- return () => {
849
- return createVNode("div", {
850
- "ref": container,
851
- "class": `devui-vertical-slider ${className}`
852
- }, [createVNode("div", {
853
- "ref": movbar,
854
- "class": "movable-bar",
855
- "style": {
856
- opacity: state.barOpacity,
857
- transform: `translateY(${state.y}px)`,
858
- transition: state.transition
859
- }
860
- }, [items.map((c, i) => {
861
- const className2 = i === state.selectedIndex ? itemClassSelected : itemClassNormal;
862
- return createVNode("span", {
863
- "class": `slider-item ${className2}`,
864
- "style": {
865
- height: `${size}px`,
866
- lineHeight: `${size}px`
867
- }
868
- }, [c]);
869
- })]), createVNode("div", {
870
- "class": "slider-mask",
871
- "onMousedown": handleMouseDown,
872
- "onMousemove": handleMouseMove,
873
- "onMouseup": handleMouseUp,
874
- "onMouseout": handleMouseUp
875
- }, null)]);
876
- };
877
- }
878
- });
879
- var index$3 = "";
880
- const TimePicker = defineComponent({
881
- props: {
882
- time: {
883
- type: Date
884
- }
885
- },
886
- setup(props) {
887
- const {
888
- time = new Date()
889
- } = props || {};
890
- const state = reactive({
891
- hour: time.getHours(),
892
- minute: time.getMinutes(),
893
- second: time.getSeconds()
894
- });
895
- const hours = Array(24).fill(0).map((_, i) => `${i}`.padStart(2, "0"));
896
- const minutes = Array(60).fill(0).map((_, i) => `${i}`.padStart(2, "0"));
897
- return () => {
898
- return createVNode("div", {
899
- "class": "devui-calendar-timepicker"
900
- }, [createVNode("div", {
901
- "class": "head"
902
- }, [createVNode("div", {
903
- "class": "chars"
904
- }, [createVNode("span", null, [state.hour.toString().padStart(2, "0"), createTextVNode(":"), state.minute.toString().padStart(2, "0"), createTextVNode(":"), state.second.toString().padStart(2, "0")])])]), createVNode("div", {
905
- "class": "select"
906
- }, [createVNode(VerticalSlider, {
907
- "items": hours,
908
- "selectedIndex": state.hour,
909
- "onChange": (_, idx) => state.hour = idx
910
- }, null), createVNode(VerticalSlider, {
911
- "items": minutes,
912
- "selectedIndex": state.minute,
913
- "onChange": (_, idx) => state.minute = idx
914
- }, null), createVNode(VerticalSlider, {
915
- "items": minutes,
916
- "selectedIndex": state.second,
917
- "onChange": (_, idx) => state.second = idx
918
- }, null)])]);
919
- };
920
- }
921
- });
922
- var index$2 = "";
923
- const Calendar = (props) => {
924
- const {
925
- showTime = false
926
- } = props;
927
- let {
928
- current
929
- } = props;
930
- if (!(current instanceof Date)) {
931
- current = new Date();
932
- }
933
- if (props.type === "range") {
934
- let {
935
- next
936
- } = props;
937
- if (!(next instanceof Date)) {
938
- next = new Date(current.getFullYear(), current.getMonth() + 1, 1);
939
- }
940
- return createVNode("div", {
941
- "class": "devui-calendar-container"
942
- }, [createVNode(CalendarDatePanel, mergeProps(props, {
943
- "pos": 0,
944
- "current": current,
945
- "compare": next
946
- }), null), showTime ? createVNode(TimePicker, {
947
- "time": current
948
- }, null) : null, createVNode(CalendarDatePanel, mergeProps(props, {
949
- "pos": 1,
950
- "current": next,
951
- "compare": current
952
- }), null), showTime ? createVNode(TimePicker, {
953
- "time": next
954
- }, null) : null]);
955
- } else {
956
- return createVNode("div", {
957
- "class": "devui-calendar-container"
958
- }, [createVNode(CalendarDatePanel, mergeProps(props, {
959
- "pos": 0,
960
- "current": current
961
- }), null), showTime ? createVNode(TimePicker, {
962
- "time": current
963
- }, null) : null]);
964
- }
965
- };
966
- var datePicker = "";
967
- const formatRange = (state) => {
968
- const [start, end] = [state.start, state.end].sort((a, b) => a.getTime() - b.getTime());
969
- state.start = start;
970
- state.end = end;
971
- if (compareDateSort(start, end, "m") !== 0) {
972
- state.current = start;
973
- state.next = end;
974
- } else {
975
- if (compareDateSort(start, state.current) < 0) {
976
- state.current = start;
977
- }
978
- if (compareDateSort(state.next, end) < 0) {
979
- state.next = end;
980
- }
981
- }
982
- };
983
- var DatePicker = defineComponent({
984
- name: "DDatepicker",
985
- props: {
986
- selectedDateChange: {
987
- type: Function
988
- },
989
- autoClose: {
990
- type: Boolean,
991
- default: false
992
- },
993
- range: {
994
- type: Boolean,
995
- default: false
996
- },
997
- showTime: {
998
- type: Boolean,
999
- default: false
1000
- },
1001
- format: {
1002
- type: String,
1003
- default: "y/MM/dd"
1004
- },
1005
- rangeSpliter: {
1006
- type: String,
1007
- default: "-"
1008
- },
1009
- attachInputDom: {
1010
- type: String
1011
- },
1012
- dateMin: {
1013
- type: String
1014
- },
1015
- dateMax: {
1016
- type: String
1017
- }
1018
- },
1019
- setup(props) {
1020
- const panel = ref(null);
1021
- const input2 = ref(null);
1022
- const current = parseDate(props.dateMin) || new Date();
1023
- const next = new Date(current.getFullYear(), current.getMonth() + 1, 1);
1024
- const state = reactive({
1025
- show: false,
1026
- value: "",
1027
- placeholder: formatPlaceholder(props),
1028
- current,
1029
- next
1030
- });
1031
- state.value = formatValue(state, props);
1032
- state.placeholder = formatPlaceholder(props);
1033
- const documentClick = (e) => {
1034
- e.stopPropagation();
1035
- if (isIn(e.target, panel.value) || isIn(e.target, input2.value)) {
1036
- return;
1037
- }
1038
- state.show = false;
1039
- };
1040
- onMounted(() => {
1041
- document.addEventListener("click", documentClick);
1042
- });
1043
- onUnmounted(() => {
1044
- document.removeEventListener("click", documentClick);
1045
- });
1046
- return () => {
1047
- return createVNode("div", {
1048
- "class": "devui-datepicker-container"
1049
- }, [createVNode("div", {
1050
- "class": "input-container",
1051
- "ref": input2
1052
- }, [createVNode(Input, {
1053
- "ref": input2,
1054
- "class": "datepicker-input",
1055
- "modelValue": state.value,
1056
- "placeholder": state.placeholder,
1057
- "onFocus": () => state.show = true
1058
- }, null), createVNode(Icon, {
1059
- "size": "small",
1060
- "name": "calendar",
1061
- "class": "datepicker-input-icon"
1062
- }, null)]), createVNode("div", {
1063
- "class": "devui-datepicker-panel",
1064
- "ref": panel
1065
- }, [state.show ? createVNode(Calendar, {
1066
- "type": props.range ? "range" : "select",
1067
- "showTime": props.showTime,
1068
- "current": state.current,
1069
- "next": state.next,
1070
- "dateMin": parseDate(props.dateMin),
1071
- "dateMax": parseDate(props.dateMax),
1072
- "dateStart": state.start,
1073
- "dateEnd": state.end,
1074
- "dateHover": state.hover,
1075
- "onReset": (date) => {
1076
- state.end = state.hover = void 0;
1077
- state.start = date;
1078
- },
1079
- "onChange": () => {
1080
- state.value = formatValue(state, props);
1081
- state.placeholder = formatPlaceholder(props);
1082
- invokeFunction(props.selectedDateChange, state.value);
1083
- if (props.autoClose) {
1084
- state.show = false;
1085
- }
1086
- },
1087
- "onToday": (date) => {
1088
- state.current = date;
1089
- state.start = date;
1090
- state.value = formatValue(state, props);
1091
- state.placeholder = formatPlaceholder(props);
1092
- invokeFunction(props.selectedDateChange, state.value);
1093
- if (props.autoClose) {
1094
- state.show = false;
1095
- }
1096
- },
1097
- "onSelected": (date) => {
1098
- state.start = date;
1099
- if (compareDateSort(state.current, date) !== 0) {
1100
- state.current = date;
1101
- }
1102
- },
1103
- "onSelectStart": (date) => state.start = date,
1104
- "onSelectEnd": (date) => {
1105
- state.end = date;
1106
- formatRange(state);
1107
- },
1108
- "onSelecting": (date) => state.hover = date,
1109
- "onPreviousYear": (date, pos) => handleCalendarSwitchState(state, 0, pos, date),
1110
- "onPreviousMonth": (date, pos) => handleCalendarSwitchState(state, 1, pos, date),
1111
- "onNextMonth": (date, pos) => handleCalendarSwitchState(state, 2, pos, date),
1112
- "onNextYear": (date, pos) => handleCalendarSwitchState(state, 3, pos, date)
1113
- }, null) : null])]);
1114
- };
1115
- }
1116
- });
1117
- var index$1 = "";
1118
- const StickSlider = defineComponent({
1119
- name: "DStickSlider",
1120
- props: {},
1121
- setup() {
1122
- const state = reactive({
1123
- showButtons: false,
1124
- selectedIndex: 0
1125
- });
1126
- const reset = () => {
1127
- state.showButtons = false;
1128
- };
1129
- const handleMainButtonMouseDown = (e) => {
1130
- e.stopPropagation();
1131
- state.showButtons = true;
1132
- };
1133
- const handleMainButtonMouseUp = (e) => {
1134
- e.stopPropagation();
1135
- reset();
1136
- };
1137
- return () => {
1138
- return createVNode("div", {
1139
- "class": "devui-stick-slider",
1140
- "onMousedown": handleMainButtonMouseDown,
1141
- "onMouseup": handleMainButtonMouseUp,
1142
- "onMouseleave": handleMainButtonMouseUp
1143
- }, [createVNode("div", {
1144
- "class": "sub-buttons",
1145
- "style": {
1146
- display: state.showButtons ? "" : "none"
1147
- }
1148
- }, [Array(16).fill(null).map((_, i) => {
1149
- return createVNode("div", {
1150
- "class": `button ${i === state.selectedIndex ? "selected" : ""}`,
1151
- "onMouseenter": () => state.selectedIndex = i
1152
- }, [i]);
1153
- })]), createVNode("div", {
1154
- "class": "main-button"
1155
- }, null)]);
1156
- };
1157
- }
1158
- });
1159
- DatePicker.install = function(app) {
1160
- app.component(DatePicker.name, DatePicker);
1161
- app.component(StickSlider.name, StickSlider);
1162
- };
1163
- var index = {
1164
- title: "DatePicker \u65E5\u671F\u9009\u62E9\u5668",
1165
- category: "\u6570\u636E\u5F55\u5165",
1166
- status: "50%",
1167
- install(app) {
1168
- app.use(DatePicker);
1169
- }
1170
- };
1171
- export { DatePicker, StickSlider, index as default };