@opentiny/vue-renderless 3.6.7 → 3.8.0

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 (314) hide show
  1. package/action-sheet/index.js +28 -1
  2. package/action-sheet/vue.js +10 -4
  3. package/alert/index.js +24 -2
  4. package/alert/vue.js +15 -11
  5. package/amount/index.js +4 -4
  6. package/anchor/index.js +1 -1
  7. package/autocomplete/vue.js +3 -3
  8. package/autonavi-map/index.js +1 -1
  9. package/badge/vue.js +6 -6
  10. package/baidu-map/index.js +1 -1
  11. package/bulletin-board/index.js +1 -1
  12. package/calendar/index.js +2 -2
  13. package/calendar-bar/index.js +268 -0
  14. package/calendar-bar/vue.js +87 -0
  15. package/card/index.js +84 -0
  16. package/card/vue.js +70 -0
  17. package/card-group/index.js +16 -0
  18. package/card-group/vue.js +21 -0
  19. package/card-template/index.js +1 -1
  20. package/carousel/index.js +89 -2
  21. package/carousel/vue.js +14 -5
  22. package/carousel-item/index.js +8 -0
  23. package/carousel-item/vue.js +7 -3
  24. package/cascader/index.js +6 -6
  25. package/cascader/vue.js +3 -3
  26. package/cascader-menu/vue.js +2 -2
  27. package/cascader-panel/index.js +4 -4
  28. package/cascader-panel/node.js +4 -4
  29. package/cascader-panel/vue.js +2 -2
  30. package/cascader-select/index.js +179 -0
  31. package/cascader-select/vue.js +74 -0
  32. package/cell/vue.js +16 -0
  33. package/chart-bar/index.js +3 -3
  34. package/chart-boxplot/index.js +2 -2
  35. package/chart-candle/index.js +3 -3
  36. package/chart-core/deps/utils.js +7 -7
  37. package/chart-core/index.js +2 -2
  38. package/chart-funnel/index.js +3 -3
  39. package/chart-gauge/index.js +3 -3
  40. package/chart-graph/index.js +1 -1
  41. package/chart-heatmap/index.js +2 -2
  42. package/chart-line/index.js +3 -3
  43. package/chart-liquidfill/index.js +2 -2
  44. package/chart-map/index.js +3 -3
  45. package/chart-pie/index.js +3 -3
  46. package/chart-radar/index.js +3 -3
  47. package/chart-sankey/index.js +3 -3
  48. package/chart-scatter/index.js +4 -4
  49. package/chart-sunburst/index.js +1 -1
  50. package/chart-tree/index.js +2 -2
  51. package/chart-waterfall/index.js +3 -3
  52. package/chart-wordcloud/index.js +2 -2
  53. package/checkbox/index.js +21 -0
  54. package/checkbox/vue.js +16 -3
  55. package/checkbox-button/vue.js +1 -1
  56. package/collapse-item/vue.js +1 -1
  57. package/column-list-group/index.js +0 -0
  58. package/column-list-group/vue.js +14 -0
  59. package/column-list-item/index.js +50 -0
  60. package/column-list-item/vue.js +39 -0
  61. package/common/array.js +3 -3
  62. package/common/bigInt.js +5 -2
  63. package/common/dataset/index.js +3 -3
  64. package/common/date.js +2 -2
  65. package/common/deps/ResizeObserver.js +1 -1
  66. package/common/deps/clickoutside.js +1 -1
  67. package/common/deps/date-util.js +4 -4
  68. package/common/deps/date.js +2 -2
  69. package/common/deps/debounce.js +1 -1
  70. package/common/deps/dom.js +1 -1
  71. package/common/deps/fullscreen/apis.js +3 -3
  72. package/common/deps/fullscreen/screenfull.js +1 -1
  73. package/common/deps/infinite-scroll.js +176 -0
  74. package/common/deps/letter-only.js +1 -1
  75. package/common/deps/number-only.js +1 -1
  76. package/common/deps/observe-visibility.js +106 -0
  77. package/common/deps/popper.js +20 -22
  78. package/common/deps/popup-manager.js +2 -2
  79. package/common/deps/repeat-click.js +1 -1
  80. package/common/deps/resize-event.js +1 -1
  81. package/common/deps/tree-model/node.js +5 -5
  82. package/common/deps/tree-model/tree-store.js +3 -3
  83. package/common/deps/upload-ajax.js +2 -2
  84. package/common/deps/vue-popper.js +4 -4
  85. package/common/deps/vue-popup.js +4 -4
  86. package/common/index.js +2 -2
  87. package/common/object.js +1 -1
  88. package/common/runtime.js +24 -24
  89. package/common/string.js +23 -4
  90. package/common/validate/rules/range.js +2 -2
  91. package/common/validate/rules/required.js +1 -1
  92. package/common/validate/rules/type.js +3 -3
  93. package/common/validate/schema.js +1 -1
  94. package/common/validate/util.js +1 -1
  95. package/common/validate/validations/array.js +1 -1
  96. package/common/validate/validations/date.js +1 -1
  97. package/common/validate/validations/enum.js +1 -1
  98. package/common/validate/validations/float.js +1 -1
  99. package/common/validate/validations/integer.js +1 -1
  100. package/common/validate/validations/method.js +1 -1
  101. package/common/validate/validations/number.js +1 -1
  102. package/common/validate/validations/pattern.js +1 -1
  103. package/common/validate/validations/string.js +1 -1
  104. package/common/validate/validations/type.js +1 -1
  105. package/container/index.js +1 -1
  106. package/crop/index.js +2 -2
  107. package/currency/index.js +2 -2
  108. package/date-panel/index.js +7 -7
  109. package/date-panel/vue.js +3 -2
  110. package/date-picker-mobile/index.js +250 -0
  111. package/date-picker-mobile/vue.js +86 -0
  112. package/date-range/index.js +1 -1
  113. package/date-range/vue.js +1 -1
  114. package/date-table/index.js +3 -3
  115. package/date-table/vue.js +1 -1
  116. package/dialog-box/index.js +10 -6
  117. package/dialog-box/vue.js +1 -1
  118. package/dialog-select/index.js +345 -0
  119. package/dialog-select/vue.js +110 -0
  120. package/drawer/index.js +83 -0
  121. package/drawer/vue.js +51 -0
  122. package/drop-times/index.js +1 -1
  123. package/dropdown/index.js +2 -2
  124. package/dropdown/vue.js +1 -1
  125. package/dropdown-item/index.js +1 -1
  126. package/dropdown-item/mf.js +79 -0
  127. package/dropdown-menu/index.js +30 -1
  128. package/dropdown-menu/vue.js +17 -7
  129. package/dynamic-scroller/index.js +117 -0
  130. package/dynamic-scroller/vue.js +88 -0
  131. package/dynamic-scroller-item/index.js +147 -0
  132. package/dynamic-scroller-item/vue.js +92 -0
  133. package/espace/index.js +1 -1
  134. package/espace/vue.js +1 -1
  135. package/exception/vue.js +3 -1
  136. package/fall-menu/index.js +4 -4
  137. package/file-upload/index.js +872 -408
  138. package/file-upload/vue.js +87 -36
  139. package/filter/index.js +131 -0
  140. package/filter/tag-group.js +43 -0
  141. package/filter/vue.js +73 -0
  142. package/filter-bar/index.js +9 -0
  143. package/filter-bar/vue.js +16 -0
  144. package/filter-box/index.js +17 -0
  145. package/filter-box/vue.js +19 -0
  146. package/filter-panel/index.js +42 -0
  147. package/filter-panel/vue.js +33 -0
  148. package/floatbar/index.js +1 -1
  149. package/flowchart/index.js +721 -0
  150. package/flowchart/vue.js +81 -0
  151. package/form/index.js +15 -1
  152. package/form/vue.js +10 -4
  153. package/form-item/index.js +46 -6
  154. package/form-item/vue.js +27 -3
  155. package/fullscreen/index.js +1 -1
  156. package/fullscreen/vue.js +1 -1
  157. package/grid/plugins/export.js +2 -2
  158. package/grid/plugins/exportExcel.js +2 -2
  159. package/grid/plugins/resize.js +1 -1
  160. package/grid/static/base/helperEqualCompare.js +1 -1
  161. package/grid/static/base/isPlainObject.js +1 -1
  162. package/grid/utils/common.js +3 -3
  163. package/grid/utils/dom.js +3 -3
  164. package/grid/utils/event.js +2 -2
  165. package/guide/index.js +168 -0
  166. package/guide/vue.js +36 -0
  167. package/hrapprover/index.js +1 -1
  168. package/image/index.js +8 -4
  169. package/image/vue.js +12 -6
  170. package/image-viewer/index.js +3 -3
  171. package/image-viewer/vue.js +16 -6
  172. package/input/index.js +34 -1
  173. package/input/vue.js +22 -6
  174. package/ip-address/index.js +1 -1
  175. package/ip-address/vue.js +1 -1
  176. package/link-menu/index.js +2 -2
  177. package/link-menu/vue.js +2 -2
  178. package/loading/index.js +2 -2
  179. package/loading/vue.js +2 -1
  180. package/locales/index.js +1 -1
  181. package/logout/index.js +1 -1
  182. package/milestone/index.js +5 -1
  183. package/modal/index.js +68 -39
  184. package/modal/vue.js +15 -12
  185. package/month-range/index.js +1 -1
  186. package/month-range/vue.js +1 -1
  187. package/month-table/index.js +5 -5
  188. package/month-table/vue.js +1 -1
  189. package/multi-select/index.js +5 -2
  190. package/multi-select/vue.js +4 -5
  191. package/nav-menu/index.js +6 -6
  192. package/notify/index.js +3 -3
  193. package/numeric/index.js +15 -5
  194. package/numeric/vue.js +15 -6
  195. package/option/index.js +1 -1
  196. package/package.json +2 -1
  197. package/pager-item/index.js +1 -1
  198. package/panel/index.js +1 -1
  199. package/picker/index.js +7 -7
  200. package/picker/vue.js +1 -1
  201. package/picker-column/index.js +1 -1
  202. package/popconfirm/index.js +25 -0
  203. package/popconfirm/vue.js +22 -0
  204. package/popeditor/index.js +7 -7
  205. package/popeditor/vue.js +2 -2
  206. package/popover/index.js +11 -3
  207. package/popover/vue.js +33 -10
  208. package/popup/index.js +4 -4
  209. package/pull-refresh/index.js +8 -11
  210. package/pull-refresh/vue.js +7 -7
  211. package/radio/index.js +17 -0
  212. package/radio/vue.js +18 -3
  213. package/radio-button/index.js +8 -0
  214. package/radio-button/vue.js +19 -4
  215. package/radio-group/index.js +1 -1
  216. package/radio-group/vue.js +5 -2
  217. package/rate/index.js +4 -2
  218. package/rate/vue.js +1 -1
  219. package/record/index.js +190 -0
  220. package/record/vue.js +44 -0
  221. package/recycle-scroller/index.js +470 -0
  222. package/recycle-scroller/vue.js +135 -0
  223. package/river/index.js +371 -0
  224. package/river/river.js +352 -0
  225. package/river/vue.js +77 -0
  226. package/roles/index.js +1 -1
  227. package/scrollbar/vue-bar.js +1 -1
  228. package/scrollbar/vue.js +1 -1
  229. package/search/index.js +3 -3
  230. package/select/index.js +17 -14
  231. package/select/vue.js +14 -8
  232. package/select-dropdown/vue.js +1 -1
  233. package/select-mobile/index.js +111 -0
  234. package/select-mobile/vue.js +58 -0
  235. package/select-view/index.js +170 -0
  236. package/select-view/vue.js +82 -0
  237. package/selected-box/index.js +216 -0
  238. package/selected-box/vue.js +98 -0
  239. package/slide-bar/index.js +1 -1
  240. package/slider/index.js +49 -4
  241. package/slider/vue.js +15 -4
  242. package/split/vue.js +1 -1
  243. package/standard-list-item/index.js +18 -0
  244. package/standard-list-item/vue.js +22 -0
  245. package/steps/index.js +30 -0
  246. package/steps/slide-bar.js +122 -0
  247. package/steps/vue.js +15 -3
  248. package/switch/index.js +1 -1
  249. package/switch/vue.js +2 -1
  250. package/tab-bar/index.js +2 -2
  251. package/tab-item/index.js +2 -2
  252. package/tab-item/vue.js +1 -1
  253. package/tab-item-mf/index.js +0 -0
  254. package/tab-item-mf/vue.js +16 -0
  255. package/tab-nav/index.js +78 -4
  256. package/tab-nav/vue.js +11 -3
  257. package/tabbar-item/index.js +1 -1
  258. package/tabbar-item/vue.js +1 -1
  259. package/tabs/index.js +8 -9
  260. package/tabs/vue.js +1 -1
  261. package/tabs-mf/index.js +109 -0
  262. package/tabs-mf/vue-bar.js +49 -0
  263. package/tabs-mf/vue-nav-item.js +22 -0
  264. package/tabs-mf/vue-nav.js +13 -0
  265. package/tabs-mf/vue.js +45 -0
  266. package/tabs-mf/wheel.js +71 -0
  267. package/tag/index.js +8 -2
  268. package/tag/vue.js +13 -5
  269. package/tag-group/index.js +24 -0
  270. package/tag-group/vue.js +29 -0
  271. package/tall-storage/index.js +1 -1
  272. package/tall-storage/vue.js +1 -1
  273. package/time/index.js +1 -1
  274. package/time/vue.js +2 -2
  275. package/time-line/index.js +28 -7
  276. package/time-line/vue.js +9 -4
  277. package/time-panel/index.js +2 -2
  278. package/time-panel/vue.js +1 -1
  279. package/time-picker-mobile/index.js +30 -0
  280. package/time-picker-mobile/vue.js +30 -0
  281. package/time-range/index.js +1 -1
  282. package/time-range/vue.js +1 -1
  283. package/time-spinner/index.js +2 -2
  284. package/time-spinner/vue.js +1 -1
  285. package/toggle-menu/index.js +2 -2
  286. package/toggle-menu/vue.js +1 -1
  287. package/tooltip/index.js +30 -3
  288. package/tooltip/vue.js +33 -12
  289. package/top-box/index.js +3 -3
  290. package/transfer/index.js +1 -1
  291. package/transfer-panel/index.js +2 -2
  292. package/tree/index.js +6 -6
  293. package/tree/vue.js +1 -1
  294. package/tree-node/index.js +1 -1
  295. package/upload/index.js +1 -2
  296. package/upload/vue.js +2 -2
  297. package/upload-dragger/index.js +5 -1
  298. package/upload-dragger/vue.js +9 -3
  299. package/upload-list/index.js +158 -8
  300. package/upload-list/vue.js +77 -25
  301. package/user/index.js +86 -70
  302. package/user/vue.js +15 -5
  303. package/user-account/vue.js +1 -1
  304. package/user-contact/index.js +49 -3
  305. package/user-contact/vue.js +17 -8
  306. package/user-head-group/vue.js +17 -0
  307. package/user-link/index.js +10 -2
  308. package/user-link/vue.js +11 -6
  309. package/wheel/index.js +1 -1
  310. package/wizard/index.js +3 -3
  311. package/year-range/index.js +125 -0
  312. package/year-range/vue.js +88 -0
  313. package/year-table/index.js +175 -11
  314. package/year-table/vue.js +17 -5
@@ -0,0 +1,250 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ const getFormatTime = (time) => {
3
+ return ("0" + time).slice(-2);
4
+ };
5
+ const getDaysByMonth = (year, month) => {
6
+ return new Date(year, month, 0).getDate();
7
+ };
8
+ const isSameDay = (day1, day2) => {
9
+ const theDay1 = new Date(day1);
10
+ const theDay2 = new Date(day2);
11
+ return theDay1.getFullYear() === theDay2.getFullYear() && theDay1.getMonth() === theDay2.getMonth() && theDay1.getDate() === theDay2.getDate();
12
+ };
13
+ const getCurrentDate = () => (dateValue) => {
14
+ const today = /* @__PURE__ */ new Date();
15
+ const theDate = new Date(dateValue);
16
+ const year = theDate.getFullYear();
17
+ const month = theDate.getMonth() + 1;
18
+ const day = theDate.getDate();
19
+ const yearMonth = year + "/" + month;
20
+ const startWeek = new Date(year, month - 1, 1).getDay();
21
+ const index = startWeek + day - 1;
22
+ return {
23
+ date: yearMonth + "/" + day,
24
+ yearMonth,
25
+ index,
26
+ day,
27
+ year,
28
+ month,
29
+ isStartDay: false,
30
+ isEndDay: false,
31
+ isToday: isSameDay(today, theDate)
32
+ };
33
+ };
34
+ const getFormatDate = (date, yearUnit = "/", monthUnit = "/", dayUnit = "") => {
35
+ const theDate = new Date(date);
36
+ return theDate.getFullYear() + yearUnit + (theDate.getMonth() + 1) + monthUnit + theDate.getDate() + dayUnit;
37
+ };
38
+ const loadingDate = ({ state, api }) => (direction) => {
39
+ const list = Object.keys(state.dateList);
40
+ let date;
41
+ if (direction === "top") {
42
+ const yearMonth = list[0].split("/").map((item) => +item);
43
+ const year = yearMonth[1] === 1 ? yearMonth[0] - 1 : yearMonth[0];
44
+ const month = yearMonth[1] === 1 ? 11 : yearMonth[1] - 1;
45
+ date = new Date(year, month, 1);
46
+ } else {
47
+ const yearMonth = list[list.length - 1].split("/").map((item) => +item);
48
+ date = new Date(yearMonth[0], yearMonth[1] - 2, 1);
49
+ }
50
+ api.initPanel(date, direction, 2);
51
+ setTimeout(() => {
52
+ state.loading = false;
53
+ }, 300);
54
+ };
55
+ const initPanel = ({ state, api }) => (dateValue, direction, yearNum = 1) => {
56
+ const currentDate = dateValue || (Array.isArray(state.date) ? state.date[1] : state.date) || /* @__PURE__ */ new Date();
57
+ let month = currentDate.getMonth() + 1;
58
+ let year = direction === "top" ? currentDate.getFullYear() - 1 : currentDate.getFullYear();
59
+ if (yearNum === 1 && !direction) {
60
+ if (month <= 6) {
61
+ year -= 1;
62
+ month += 6;
63
+ } else {
64
+ month -= 6;
65
+ }
66
+ }
67
+ let date = new Date(year, month - 1, 1);
68
+ const dateList = {};
69
+ Array.from({ length: 12 * yearNum }).map(() => {
70
+ const startWeek = date.getDay();
71
+ dateList[year + "/" + month] = Array.from({ length: startWeek }).map(() => ({}));
72
+ const days = getDaysByMonth(year, month);
73
+ Array.from({ length: days }).map((v, index) => {
74
+ const day = index + 1;
75
+ const dayInfo = api.getCurrentDate(new Date(year, month - 1, day));
76
+ dateList[year + "/" + month].push(dayInfo);
77
+ });
78
+ month++;
79
+ if (month > 12) {
80
+ year++;
81
+ month = 1;
82
+ }
83
+ date = new Date(year, month - 1, 1);
84
+ });
85
+ state.dateList = dateList;
86
+ };
87
+ const getWeeksByMonth = ({ state }) => (yearMonth) => {
88
+ const length = state.dateList[yearMonth].length;
89
+ return Math.ceil(length / 7);
90
+ };
91
+ const getDaysByWeek = ({ state, api }) => (yearMonth, week) => {
92
+ const length = state.dateList[yearMonth].length;
93
+ const weeks = api.getWeeksByMonth(yearMonth);
94
+ return week === weeks ? length % 7 : 7;
95
+ };
96
+ const getDate = ({ state }) => ({ date, yearMonth, index }) => {
97
+ let currentDate;
98
+ if (date) {
99
+ const theDate = new Date(date);
100
+ currentDate = state.dateList[`${theDate.getFullYear()}/${theDate.getMonth + 1}`].filter((item) => item.day === theDate.getDate()).shift();
101
+ } else {
102
+ currentDate = state.dateList[yearMonth][index];
103
+ }
104
+ return currentDate || {};
105
+ };
106
+ const getSelectedPosition = ({ state }) => (dateFormat) => {
107
+ const { selected } = state;
108
+ if (!selected.length) {
109
+ return "";
110
+ }
111
+ const index = selected.map((item) => getFormatDate(item)).indexOf(dateFormat);
112
+ const length = selected.length;
113
+ return index === 0 ? "start" : index === length - 1 ? "end" : index > -1 ? "inner" : "";
114
+ };
115
+ const watchVisible = ({ emit, api, nextTick, vm }) => (bool) => {
116
+ if (bool) {
117
+ api.watchModelValue();
118
+ nextTick(() => {
119
+ const refBody = vm.$refs.datePickerBody;
120
+ if (refBody.scrollHeight && !refBody.scrollTop) {
121
+ refBody.scrollTop = refBody.scrollHeight / 2;
122
+ }
123
+ });
124
+ }
125
+ emit("update:visible", bool);
126
+ };
127
+ const watchModelValue = ({ props, state }) => () => {
128
+ const { modelValue, type } = props;
129
+ if (["daterange", "datetimerange"].includes(type)) {
130
+ state.date = modelValue && modelValue.length ? modelValue.map((date) => new Date(date)) : [];
131
+ }
132
+ if (["datetime", "date"].includes(type)) {
133
+ state.date = modelValue ? new Date(modelValue) : /* @__PURE__ */ new Date();
134
+ }
135
+ if (["datetimerange", "datetime"].includes(type)) {
136
+ const length = type === "datetime" ? 1 : 2;
137
+ Array.from({ length }).forEach((v, index) => {
138
+ const date = type === "datetime" ? state.date : state.date[index];
139
+ if (date) {
140
+ state.timeList[index] = [
141
+ getFormatTime(date.getHours()),
142
+ getFormatTime(date.getMinutes()),
143
+ getFormatTime(date.getSeconds())
144
+ ];
145
+ }
146
+ });
147
+ }
148
+ };
149
+ const selectOption = ({ emit, state, props }) => ({ yearMonth, index }) => {
150
+ const { type } = props;
151
+ const currentDateInfo = state.dateList[yearMonth][index];
152
+ if (!currentDateInfo) {
153
+ return;
154
+ }
155
+ if (["daterange", "datetimerange"].includes(type)) {
156
+ if (state.date.length > 1) {
157
+ state.date = [];
158
+ }
159
+ state.date.push(new Date(currentDateInfo.date));
160
+ if (state.date.length === 2) {
161
+ state.date.sort((a, b) => a.getTime() - b.getTime());
162
+ }
163
+ } else {
164
+ state.date = new Date(currentDateInfo.date);
165
+ emit("click", currentDateInfo);
166
+ }
167
+ };
168
+ const confirm = ({ emit, state, props, api }) => () => {
169
+ const { date, timeList } = state;
170
+ const { type } = props;
171
+ if (["daterange", "datetimerange", "datetime"].includes(type)) {
172
+ const length = type === "datetime" ? 1 : 2;
173
+ Array.from({ length }).forEach((v, index) => {
174
+ let thisDate = type === "datetime" ? date : date[index];
175
+ if (thisDate) {
176
+ const currentDate = api.getCurrentDate(thisDate);
177
+ const time = timeList[index];
178
+ thisDate = new Date(currentDate.year, currentDate.month - 1, currentDate.day, time[0], time[1], time[2]);
179
+ if (type === "datetime") {
180
+ state.date = thisDate;
181
+ } else {
182
+ state.date[index] = thisDate;
183
+ }
184
+ }
185
+ });
186
+ }
187
+ emit("confirm", state.date);
188
+ emit("update:visible", false);
189
+ emit("update:modelValue", state.date);
190
+ };
191
+ const timeConfirm = ({ emit, state }) => (value) => {
192
+ state.timeVisible = false;
193
+ state.timeList[state.showTimeIndex] = value;
194
+ emit("time-confirm", value);
195
+ };
196
+ const timeToggle = ({ state }) => (index) => {
197
+ state.showTimeIndex = index;
198
+ state.time = state.timeList[index];
199
+ state.timeVisible = true;
200
+ };
201
+ const selectedComputed = ({ state, props }) => () => {
202
+ if (["daterange", "datetimerange"].includes(props.type)) {
203
+ if (state.date && state.date.length) {
204
+ if (state.date.length === 1) {
205
+ return [state.date[0]];
206
+ }
207
+ const list = [];
208
+ let date1 = state.date[0].getTime();
209
+ let date2 = state.date[1].getTime();
210
+ while (date1 <= date2) {
211
+ list.push(new Date(date1));
212
+ date1 += 3600 * 24 * 1e3;
213
+ }
214
+ return list;
215
+ } else {
216
+ return [];
217
+ }
218
+ } else {
219
+ return state.date ? [getFormatDate(state.date)] : [];
220
+ }
221
+ };
222
+ const scrollLoadHandler = ({ state, vm, api }) => () => {
223
+ const refBody = vm.$refs.datePickerBody;
224
+ if (refBody.scrollHeight && refBody.scrollTop < 50 && !state.loading) {
225
+ state.loading = true;
226
+ api.loadingDate("top");
227
+ } else if (refBody.scrollHeight && refBody.scrollHeight - refBody.offsetHeight - refBody.scrollTop < 10 && !state.loading) {
228
+ state.loading = true;
229
+ api.loadingDate("down");
230
+ refBody.scrollTop = 50;
231
+ }
232
+ };
233
+ export {
234
+ confirm,
235
+ getCurrentDate,
236
+ getDate,
237
+ getDaysByWeek,
238
+ getFormatDate,
239
+ getSelectedPosition,
240
+ getWeeksByMonth,
241
+ initPanel,
242
+ loadingDate,
243
+ scrollLoadHandler,
244
+ selectOption,
245
+ selectedComputed,
246
+ timeConfirm,
247
+ timeToggle,
248
+ watchModelValue,
249
+ watchVisible
250
+ };
@@ -0,0 +1,86 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import { on, off } from "../common/deps/dom";
3
+ import {
4
+ initPanel,
5
+ getFormatDate,
6
+ getCurrentDate,
7
+ getSelectedPosition,
8
+ getWeeksByMonth,
9
+ getDaysByWeek,
10
+ getDate,
11
+ watchVisible,
12
+ watchModelValue,
13
+ selectOption,
14
+ timeToggle,
15
+ timeConfirm,
16
+ selectedComputed,
17
+ scrollLoadHandler,
18
+ loadingDate,
19
+ confirm
20
+ } from "./index";
21
+ const api = [
22
+ "state",
23
+ "getDate",
24
+ "getWeeksByMonth",
25
+ "getDaysByWeek",
26
+ "getSelectedPosition",
27
+ "selectOption",
28
+ "confirm",
29
+ "timeToggle",
30
+ "timeConfirm",
31
+ "getFormatDate"
32
+ ];
33
+ const renderless = (props, { computed, reactive, watch, onMounted, onBeforeUnmount }, { emit, vm, nextTick }) => {
34
+ const api2 = {};
35
+ const state = reactive({
36
+ toggle: false,
37
+ date: null,
38
+ loading: false,
39
+ dateList: {},
40
+ timeVisible: false,
41
+ showTimeIndex: 0,
42
+ time: ["00", "00", "00"],
43
+ timeList: [
44
+ ["00", "00", "00"],
45
+ ["00", "00", "00"]
46
+ ],
47
+ selected: computed(() => api2.selectedComputed()),
48
+ months: computed(() => Object.keys(state.dateList)),
49
+ btnDisabled: computed(
50
+ () => ["daterange", "datetimerange"].includes(props.type) && state.date && state.date.length === 1
51
+ )
52
+ });
53
+ Object.assign(api2, {
54
+ state,
55
+ initPanel: initPanel({ state, api: api2 }),
56
+ getCurrentDate: getCurrentDate(),
57
+ getWeeksByMonth: getWeeksByMonth({ state }),
58
+ getDate: getDate({ state }),
59
+ getDaysByWeek: getDaysByWeek({ state, api: api2 }),
60
+ getSelectedPosition: getSelectedPosition({ state }),
61
+ confirm: confirm({ state, emit, props, api: api2 }),
62
+ timeConfirm: timeConfirm({ state, emit }),
63
+ selectOption: selectOption({ state, emit, props }),
64
+ timeToggle: timeToggle({ state }),
65
+ watchVisible: watchVisible({ emit, api: api2, nextTick, vm }),
66
+ watchModelValue: watchModelValue({ props, state }),
67
+ selectedComputed: selectedComputed({ props, state }),
68
+ scrollLoadHandler: scrollLoadHandler({ state, vm, api: api2 }),
69
+ loadingDate: loadingDate({ state, api: api2 }),
70
+ getFormatDate
71
+ });
72
+ watch(() => props.visible, api2.watchVisible);
73
+ watch(() => props.modelValue, api2.watchModelValue, { immediate: true });
74
+ onMounted(() => {
75
+ api2.initPanel();
76
+ on(vm.$refs.datePickerBody, "scroll", api2.scrollLoadHandler);
77
+ });
78
+ onBeforeUnmount(() => {
79
+ off(vm.$refs.datePickerBody, "scroll", api2.scrollLoadHandler);
80
+ });
81
+ return api2;
82
+ };
83
+ export {
84
+ api,
85
+ renderless
86
+ };
@@ -11,7 +11,7 @@ import {
11
11
  nextMonth,
12
12
  prevMonth,
13
13
  modifyWithTimeString
14
- } from "@opentiny/vue-renderless/common/deps/date-util";
14
+ } from "../common/deps/date-util";
15
15
  const calcDefaultValue = (defaultValue) => {
16
16
  if (Array.isArray(defaultValue)) {
17
17
  return [new Date(defaultValue[0]), new Date(defaultValue[1])];
package/date-range/vue.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  computerLabel,
41
41
  computerEnableYearArrow
42
42
  } from "./index";
43
- import { nextMonth, extractDateFormat, extractTimeFormat } from "@opentiny/vue-renderless/common/deps/date-util";
43
+ import { nextMonth, extractDateFormat, extractTimeFormat } from "../common/deps/date-util";
44
44
  const api = [
45
45
  "state",
46
46
  "handleShortcutClick",
@@ -1,7 +1,7 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { formatDate } from "@opentiny/vue-renderless/common/deps/date-util";
3
- import { getFirstDayOfMonth, getDayCountOfMonth, getWeekNumber, prevDate, nextDate, isDate, clearTime } from "@opentiny/vue-renderless/common/deps/date-util";
4
- import { DATEPICKER } from "@opentiny/vue-renderless/common";
2
+ import { formatDate } from "../common/deps/date-util";
3
+ import { getFirstDayOfMonth, getDayCountOfMonth, getWeekNumber, prevDate, nextDate, isDate, clearTime } from "../common/deps/date-util";
4
+ import { DATEPICKER } from "../common";
5
5
  const formatJudg = ({ day, offset, j, i, cell, count, dateCountOfLastMonth }) => {
6
6
  const nodfpm = day + offset < 0 ? 7 + day + offset : day + offset;
7
7
  if (j + i * 7 >= nodfpm) {
package/date-table/vue.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  getCellRangeClasses,
16
16
  getCell
17
17
  } from "./index";
18
- import { getStartDateOfMonth } from "@opentiny/vue-renderless/common/deps/date-util";
18
+ import { getStartDateOfMonth } from "../common/deps/date-util";
19
19
  const api = ["state", "getCellClasses", "isWeekActive", "handleMouseMove", "handleClick"];
20
20
  const initState = ({ reactive, computed, api: api2, props }) => {
21
21
  const state = reactive({
@@ -1,25 +1,27 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { on, off, addClass, removeClass } from "@opentiny/vue-renderless/common/deps/dom";
3
- import { emitEvent } from "@opentiny/vue-renderless/common/event";
4
- import { getDomNode } from "@opentiny/vue-renderless/common/deps/dom";
2
+ import { on, off, addClass, removeClass } from "../common/deps/dom";
3
+ import { emitEvent } from "../common/event";
4
+ import { getDomNode } from "../common/deps/dom";
5
5
  const computedAnimationName = ({ constants, props }) => () => props.rightSlide ? constants.DIALOG_SLIDER_RIGHT : constants.DIALOG_FADE;
6
6
  const computedAddUnit = (value) => isNaN(Number(value)) ? value : value + "px";
7
7
  const computedStyle = ({ props, state }) => () => {
8
8
  const style = {};
9
- let { width, top, rightSlide } = props;
9
+ let { width, top, rightSlide, maxHeight } = props;
10
10
  if (top === void 0) {
11
11
  top = rightSlide ? "0" : "15vh";
12
12
  }
13
13
  width = computedAddUnit(width);
14
14
  top = computedAddUnit(top);
15
+ maxHeight = computedAddUnit(maxHeight);
15
16
  if (!state.isFull) {
16
17
  style.width = width;
17
- style.top = top;
18
+ style.top = state.top || top;
19
+ style.maxHeight = maxHeight;
18
20
  if (rightSlide) {
19
21
  style.right = 0;
20
22
  style.height = "calc(100vh - " + style.top + ")";
21
23
  } else {
22
- style.left = "calc((100vw - " + width + ") / 2)";
24
+ style.left = state.left || "calc((100vw - " + width + ") / 2)";
23
25
  }
24
26
  }
25
27
  return style;
@@ -171,6 +173,8 @@ const handleDrag = ({ parent, props, state, emit }) => (event) => {
171
173
  top = top < 0 ? 0 : top > maxY ? maxY : top;
172
174
  modalBoxElem.style.left = `${left}px`;
173
175
  modalBoxElem.style.top = `${top}px`;
176
+ state.left = `${left}px`;
177
+ state.top = `${top}px`;
174
178
  state.emitter.emit("boxdrag");
175
179
  emit("drag-move", event2);
176
180
  };
package/dialog-box/vue.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  showScrollbar,
20
20
  hideScrollbar
21
21
  } from "./index";
22
- import usePopup from "@opentiny/vue-renderless/common/deps/vue-popup";
22
+ import usePopup from "../common/deps/vue-popup";
23
23
  const api = ["afterEnter", "afterLeave", "handleClose", "handleWrapperClick", "handleCancel", "handleConfirm", "handleDrag", "state"];
24
24
  const initState = ({ reactive, computed, api: api2, emitter, props }) => {
25
25
  const state = reactive({