@opentiny/vue-renderless 3.13.1 → 3.14.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 (321) hide show
  1. package/action-sheet/index.js +20 -13
  2. package/action-sheet/vue.js +8 -7
  3. package/amount/index.js +100 -25
  4. package/amount/vue.js +102 -26
  5. package/anchor/index.js +1 -0
  6. package/area/index.js +8 -8
  7. package/area/vue.js +5 -5
  8. package/async-flowchart/index.js +16 -3
  9. package/autocomplete/index.js +58 -14
  10. package/autocomplete/vue.js +40 -12
  11. package/badge/index.js +12 -0
  12. package/badge/vue.js +6 -4
  13. package/breadcrumb/vue.js +3 -1
  14. package/breadcrumb-item/vue.js +6 -2
  15. package/button/index.js +5 -1
  16. package/calendar/index.js +2 -86
  17. package/calendar-bar/index.js +18 -4
  18. package/calendar-view/index.js +5 -1
  19. package/calendar-view/vue.js +16 -3
  20. package/card-group/vue.js +4 -2
  21. package/cascader/index.js +86 -34
  22. package/cascader/vue.js +61 -20
  23. package/cascader-menu/index.js +7 -7
  24. package/cascader-menu/vue.js +2 -3
  25. package/cascader-mobile/index.js +36 -23
  26. package/cascader-mobile/vue.js +6 -0
  27. package/cascader-node/index.js +13 -1
  28. package/cascader-node/vue.js +15 -4
  29. package/cascader-panel/index.js +1 -1
  30. package/cascader-select/column-index.js +150 -0
  31. package/cascader-select/column.js +120 -0
  32. package/cascader-select/index.js +29 -165
  33. package/cascader-select/usePicker.js +251 -0
  34. package/cascader-select/useTouch.js +65 -0
  35. package/cascader-select/vue.js +35 -47
  36. package/cell/vue.js +2 -1
  37. package/chart-bar/index.js +2 -3
  38. package/chart-core/deps/constants.js +43 -43
  39. package/chart-core/index.js +1 -1
  40. package/chart-gauge/index.js +2 -2
  41. package/chart-heatmap/index.js +17 -10
  42. package/chart-line/index.js +8 -9
  43. package/chart-tree/index.js +2 -2
  44. package/chart-waterfall/index.js +4 -6
  45. package/checkbox/index.js +18 -1
  46. package/checkbox/vue.js +15 -7
  47. package/checkbox-group/vue.js +1 -0
  48. package/col/vue.js +1 -1
  49. package/collapse/index.js +3 -3
  50. package/color-select-panel/vue.js +0 -7
  51. package/column-list-item/index.js +17 -1
  52. package/column-list-item/vue.js +8 -3
  53. package/common/date.js +7 -5
  54. package/common/deps/clickoutside.js +6 -2
  55. package/common/deps/dom.js +19 -4
  56. package/common/deps/popper.js +44 -11
  57. package/common/deps/resize-event.js +1 -0
  58. package/common/deps/touch-emulator.js +4 -1
  59. package/common/deps/tree-model/node.js +2 -2
  60. package/common/deps/tree-model/tree-store.js +2 -13
  61. package/common/deps/useRect.js +25 -0
  62. package/common/deps/vue-popper.js +38 -20
  63. package/common/index.js +2 -2
  64. package/common/runtime.js +1 -1
  65. package/common/string.js +2 -2
  66. package/common/type.js +2 -1
  67. package/common/validate/rules/enum.js +1 -1
  68. package/common/validate/rules/pattern.js +2 -2
  69. package/common/validate/rules/range.js +8 -5
  70. package/common/validate/rules/required.js +1 -1
  71. package/common/validate/rules/type.js +5 -5
  72. package/common/validate/rules/whitespace.js +1 -1
  73. package/common/validate/util.js +15 -16
  74. package/common/validate/validations/integer.js +1 -1
  75. package/common/validate/validations/method.js +1 -1
  76. package/currency/index.js +74 -7
  77. package/currency/vue.js +21 -5
  78. package/date-panel/index.js +16 -0
  79. package/date-panel/vue.js +8 -2
  80. package/date-picker-mobile/index.js +12 -0
  81. package/date-picker-mobile/vue.js +7 -1
  82. package/date-range/vue.js +14 -6
  83. package/date-table/index.js +5 -0
  84. package/date-table/vue.js +3 -1
  85. package/dialog-box/index.js +46 -14
  86. package/dialog-box/vue.js +30 -7
  87. package/dialog-select/index.js +6 -3
  88. package/dialog-select/vue.js +8 -4
  89. package/drawer/index.js +27 -5
  90. package/drawer/vue.js +14 -7
  91. package/dropdown/index.js +7 -7
  92. package/dropdown/vue.js +6 -2
  93. package/dropdown-item/index.js +9 -1
  94. package/dropdown-item/mf.js +6 -10
  95. package/dropdown-item/vue.js +20 -7
  96. package/dropdown-menu/index.js +20 -7
  97. package/dropdown-menu/vue.js +4 -3
  98. package/exception/index.js +2 -7
  99. package/exception/vue.js +7 -10
  100. package/fall-menu/index.js +5 -1
  101. package/fall-menu/vue.js +13 -2
  102. package/file-upload/index.js +68 -18
  103. package/file-upload/vue.js +38 -8
  104. package/filter-box/index.js +1 -0
  105. package/float-button/index.js +42 -0
  106. package/float-button/vue.js +101 -0
  107. package/floating-button/index.js +62 -16
  108. package/floating-button/vue.js +27 -9
  109. package/flowchart/index.js +134 -25
  110. package/flowchart/node.js +13 -4
  111. package/flowchart/vue.js +16 -4
  112. package/form/vue.js +8 -0
  113. package/form-item/index.js +5 -5
  114. package/form-item/vue.js +3 -1
  115. package/fullscreen/index.js +5 -5
  116. package/fullscreen/vue.js +3 -3
  117. package/grid/plugins/export.js +5 -2
  118. package/grid/utils/column.js +1 -0
  119. package/grid/utils/dom.js +7 -1
  120. package/image/index.js +6 -1
  121. package/image/vue.js +6 -3
  122. package/image-viewer/index.js +62 -51
  123. package/image-viewer/vue.js +17 -5
  124. package/input/index.js +81 -20
  125. package/input/vue.js +44 -18
  126. package/ip-address/index.js +61 -19
  127. package/ip-address/vue.js +22 -4
  128. package/link/vue.js +3 -1
  129. package/loading/index.js +2 -2
  130. package/loading/vue.js +8 -2
  131. package/logout/index.js +1 -1
  132. package/menu/index.js +15 -2
  133. package/menu/vue.js +22 -17
  134. package/mind-map/index.js +47 -0
  135. package/mind-map/vue.js +53 -0
  136. package/modal/index.js +44 -4
  137. package/modal/vue.js +18 -4
  138. package/multi-select/index.js +186 -11
  139. package/multi-select/vue.js +60 -15
  140. package/multi-select-item/index.js +23 -0
  141. package/multi-select-item/vue.js +31 -0
  142. package/numeric/index.js +46 -12
  143. package/numeric/vue.js +44 -19
  144. package/option/index.js +27 -9
  145. package/option/vue.js +37 -21
  146. package/option-group/index.js +3 -3
  147. package/package.json +1 -1
  148. package/pager/index.js +18 -4
  149. package/pager/vue.js +16 -5
  150. package/picker/index.js +258 -49
  151. package/picker/mb.js +42 -0
  152. package/picker/vue.js +70 -17
  153. package/picker-column/index.js +1 -1
  154. package/pop-upload/vue.js +3 -0
  155. package/popconfirm/index.js +3 -6
  156. package/popconfirm/vue.js +1 -1
  157. package/popeditor/index.js +71 -32
  158. package/popeditor/vue.js +15 -11
  159. package/popover/index.js +4 -4
  160. package/popover/vue.js +6 -6
  161. package/popup/index.js +3 -3
  162. package/popup/vue.js +5 -5
  163. package/pull-refresh/index.js +13 -13
  164. package/pull-refresh/vue.js +5 -4
  165. package/radio/index.js +0 -17
  166. package/radio/vue.js +4 -10
  167. package/rate/index.js +1 -1
  168. package/rate/vue.js +0 -2
  169. package/record/index.js +4 -1
  170. package/rich-text/clipboard.js +54 -0
  171. package/rich-text/index.js +192 -0
  172. package/rich-text/module/file-upload.js +107 -0
  173. package/rich-text/module/image-drop.js +63 -0
  174. package/rich-text/module/image-upload.js +89 -0
  175. package/rich-text/options.js +141 -0
  176. package/rich-text/table-module.js +382 -0
  177. package/rich-text/vue.js +102 -0
  178. package/{rich-text-edtior → rich-text-editor}/index.js +2 -2
  179. package/{rich-text-edtior → rich-text-editor}/vue.js +2 -5
  180. package/scrollbar/index.js +11 -11
  181. package/scrollbar/vue-bar.js +3 -3
  182. package/scrollbar/vue.js +5 -5
  183. package/search/index.js +9 -9
  184. package/search/vue.js +8 -6
  185. package/select/index.js +457 -389
  186. package/select/vue.js +257 -161
  187. package/select-dropdown/index.js +61 -3
  188. package/select-dropdown/vue.js +85 -8
  189. package/select-view/index.js +3 -1
  190. package/selected-box/index.js +2 -0
  191. package/selected-box/vue.js +6 -3
  192. package/signature/index.js +241 -0
  193. package/signature/vue.js +88 -0
  194. package/skeleton/index.js +14 -0
  195. package/skeleton/vue.js +15 -0
  196. package/skeleton-item/vue.js +15 -0
  197. package/slider/index.js +70 -17
  198. package/slider/vue.js +16 -7
  199. package/split/index.js +5 -3
  200. package/split/vue.js +4 -6
  201. package/standard-list-item/index.js +15 -1
  202. package/standard-list-item/vue.js +6 -5
  203. package/steps/index.js +25 -2
  204. package/steps/slide-bar.js +8 -1
  205. package/steps/vue.js +15 -3
  206. package/tab-item-mf/vue.js +14 -8
  207. package/tab-nav/index.js +30 -5
  208. package/tab-nav/vue.js +16 -4
  209. package/tabbar/vue.js +9 -3
  210. package/tabbar-item/vue.js +3 -2
  211. package/tabs/index.js +16 -4
  212. package/tabs/vue.js +2 -1
  213. package/tabs-mf/index.js +20 -6
  214. package/tabs-mf/vue-nav.js +26 -11
  215. package/tabs-mf/vue.js +7 -7
  216. package/tabs-mf/wheel.js +1 -0
  217. package/tag/index.js +1 -1
  218. package/tag-group/index.js +2 -1
  219. package/time/index.js +5 -2
  220. package/time/vue.js +1 -1
  221. package/time-line/index.js +3 -3
  222. package/time-line/vue.js +2 -2
  223. package/time-picker-mobile/index.js +24 -5
  224. package/time-picker-mobile/vue.js +17 -7
  225. package/time-range/index.js +2 -0
  226. package/timeline-item/vue.js +1 -1
  227. package/tooltip/index.js +6 -3
  228. package/tooltip/vue.js +4 -4
  229. package/transfer/index.js +20 -22
  230. package/transfer/vue.js +1 -6
  231. package/transfer-panel/vue.js +3 -5
  232. package/tree/index.js +21 -4
  233. package/tree/vue.js +10 -8
  234. package/tree-menu/index.js +31 -5
  235. package/tree-menu/vue.js +28 -15
  236. package/tree-node/index.js +18 -18
  237. package/tree-node/vue.js +6 -5
  238. package/types/action-sheet.type.d.ts +118 -1
  239. package/types/alert.type.d.ts +1 -1
  240. package/types/amount.type.d.ts +168 -1
  241. package/types/area.type.d.ts +134 -1
  242. package/types/async-flowchart.type.d.ts +72 -0
  243. package/types/autocomplete.type.d.ts +199 -1
  244. package/types/badge.type.d.ts +3 -1
  245. package/types/breadcrumb-item.type.d.ts +2 -0
  246. package/types/breadcrumb.type.d.ts +2 -0
  247. package/types/button-group.type.d.ts +3 -3
  248. package/types/button.type.d.ts +4 -0
  249. package/types/cascader-menu.type.d.ts +3 -4
  250. package/types/cascader-node.type.d.ts +5 -2
  251. package/types/cascader-panel.type-2bd03be3.d.ts +241 -0
  252. package/types/cascader-panel.type.d.ts +3 -241
  253. package/types/cascader.type.d.ts +329 -1
  254. package/types/checkbox.type.d.ts +9 -3
  255. package/types/collapse.type.d.ts +20 -3
  256. package/types/date-picker.type.d.ts +37 -0
  257. package/types/dialog-box.type.d.ts +13 -3
  258. package/types/drawer.type.d.ts +133 -1
  259. package/types/{dropdown-item.type-8ea6c633.d.ts → dropdown-item.type-8475a549.d.ts} +7 -13
  260. package/types/dropdown-item.type.d.ts +1 -1
  261. package/types/dropdown-menu.type.d.ts +1 -1
  262. package/types/dropdown.type.d.ts +1 -5
  263. package/types/fall-menu.type.d.ts +94 -1
  264. package/types/file-upload.type.d.ts +1 -1
  265. package/types/float-button.type.d.ts +123 -0
  266. package/types/form-item.type.d.ts +1 -1
  267. package/types/{form.type-d0fd42f3.d.ts → form.type-222799ae.d.ts} +5 -2
  268. package/types/form.type.d.ts +1 -1
  269. package/types/{index-e0250f63.d.ts → index-b012f687.d.ts} +9 -0
  270. package/types/input.type.d.ts +1 -5
  271. package/types/ip-address.type.d.ts +160 -1
  272. package/types/link.type.d.ts +6 -3
  273. package/types/loading.type.d.ts +7 -0
  274. package/types/milestone.type.d.ts +1 -1
  275. package/types/mind-map.type.d.ts +20 -0
  276. package/types/modal.type.d.ts +29 -2
  277. package/types/numeric.type.d.ts +41 -10
  278. package/types/pager.type.d.ts +13 -1
  279. package/types/picker.type.d.ts +18 -0
  280. package/types/popconfirm.type.d.ts +86 -1
  281. package/types/popeditor.type.d.ts +5 -1
  282. package/types/popover.type.d.ts +3 -3
  283. package/types/progress.type.d.ts +3 -1
  284. package/types/radio.type.d.ts +0 -4
  285. package/types/rate.type.d.ts +236 -1
  286. package/types/search.type.d.ts +88 -1
  287. package/types/shared.type.d.ts +1 -1
  288. package/types/skeleton-item.type.d.ts +38 -0
  289. package/types/skeleton.type.d.ts +45 -0
  290. package/types/slider.type.d.ts +49 -10
  291. package/types/steps.type.d.ts +15 -4
  292. package/types/switch.type.d.ts +3 -3
  293. package/types/tab-bar.type.d.ts +1 -1
  294. package/types/tab-nav.type.d.ts +7 -2
  295. package/types/tabs.type.d.ts +9 -1
  296. package/types/tag-group.type.d.ts +64 -1
  297. package/types/{time-line.type-d7daa669.d.ts → time-line.type-b155cb4f.d.ts} +12 -0
  298. package/types/time-line.type.d.ts +1 -1
  299. package/types/timeline-item.type.d.ts +1 -1
  300. package/types/tooltip.type.d.ts +2 -2
  301. package/types/transfer.type.d.ts +185 -1
  302. package/types/tree-menu.type.d.ts +210 -1
  303. package/types/upload-dragger.type.d.ts +2 -2
  304. package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-a29aea50.d.ts} +31 -8
  305. package/types/upload-list.type.d.ts +1 -1
  306. package/types/upload.type.d.ts +1 -1
  307. package/types/user-head.type.d.ts +146 -1
  308. package/types/wizard.type.d.ts +1 -0
  309. package/upload/index.js +64 -34
  310. package/upload/vue.js +9 -5
  311. package/upload-dragger/index.js +22 -20
  312. package/upload-list/index.js +24 -18
  313. package/upload-list/vue.js +9 -4
  314. package/user/index.js +34 -25
  315. package/user/vue.js +1 -1
  316. package/user-head/index.js +3 -3
  317. package/watermark/index.js +11 -0
  318. package/wheel/index.js +3 -0
  319. package/wizard/vue.js +4 -2
  320. package/common/deps/modal-queue.js +0 -6
  321. package/common/deps/requestAnimationFrame.js +0 -25
package/date-panel/vue.js CHANGED
@@ -42,7 +42,9 @@ import {
42
42
  computerVisibleTime,
43
43
  computerVisibleDate,
44
44
  computerTimeFormat,
45
- watchVisible
45
+ watchVisible,
46
+ getDisabledNow,
47
+ getDisabledConfirm
46
48
  } from "./index";
47
49
  import { getWeekNumber, extractDateFormat } from "../common/deps/date-util";
48
50
  import { DATEPICKER, DATE } from "../common";
@@ -102,6 +104,8 @@ const initState = ({ reactive, computed, api: api2, i18n }) => {
102
104
  selectedTz: null,
103
105
  animationName: "",
104
106
  startYear: Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 10) * 10,
107
+ disabledNow: computed(() => api2.getDisabledNow()),
108
+ disabledConfirm: computed(() => api2.getDisabledConfirm()),
105
109
  year: computed(() => !Array.isArray(state.date) && state.date.getFullYear()),
106
110
  month: computed(() => !Array.isArray(state.date) && state.date.getMonth()),
107
111
  week: computed(() => getWeekNumber(state.date)),
@@ -192,7 +196,9 @@ const initApi = ({ api: api2, state, t, emit, nextTick, vm, watch }) => {
192
196
  handleShortcutClick: handleShortcutClick(api2),
193
197
  computerVisibleDate: computerVisibleDate({ state, t }),
194
198
  handleVisibleTimeChange: handleVisibleTimeChange({ api: api2, vm, state, t }),
195
- computerTimeFormat: computerTimeFormat({ state })
199
+ computerTimeFormat: computerTimeFormat({ state }),
200
+ getDisabledNow: getDisabledNow({ state }),
201
+ getDisabledConfirm: getDisabledConfirm({ state })
196
202
  });
197
203
  };
198
204
  const renderless = (props, { computed, reactive, watch, nextTick }, { t, emit: $emit, vm, i18n }) => {
@@ -273,7 +273,19 @@ const scrollEnd = ({ state, api }) => () => {
273
273
  state.loading = true;
274
274
  state.isYearMonthPanel ? api.loadYearMonth("down") : api.loadingDate("down");
275
275
  };
276
+ const clear = ({ state, emit, api }) => () => {
277
+ state.date = Array.isArray(state.date) ? [] : "";
278
+ emit("update:modelValue", state.date);
279
+ emit("clear", state.date);
280
+ api.close();
281
+ };
282
+ const close = ({ emit, vm }) => () => {
283
+ vm.$refs.actionSheet.close();
284
+ emit("close");
285
+ };
276
286
  export {
287
+ clear,
288
+ close,
277
289
  confirm,
278
290
  formatDate,
279
291
  getCurrentDate,
@@ -17,6 +17,8 @@ import {
17
17
  loadingDate,
18
18
  scrollStart,
19
19
  scrollEnd,
20
+ clear,
21
+ close,
20
22
  confirm
21
23
  } from "./index";
22
24
  import { initYearMonthPanel, getOffsetMonth, loadYearMonth } from "./year-month";
@@ -33,6 +35,8 @@ const api = [
33
35
  "scrollStart",
34
36
  "scrollEnd",
35
37
  "loadingDate",
38
+ "clear",
39
+ "close",
36
40
  "formatDate"
37
41
  ];
38
42
  const renderless = (props, { computed, reactive, watch, onMounted }, { emit, vm, nextTick, constants }) => {
@@ -86,7 +90,9 @@ const renderless = (props, { computed, reactive, watch, onMounted }, { emit, vm,
86
90
  loadingDate: loadingDate({ state, api: api2 }),
87
91
  loadYearMonth: loadYearMonth({ state, api: api2 }),
88
92
  getOffsetMonth: getOffsetMonth(),
89
- formatDate: formatDate({ props, constants })
93
+ formatDate: formatDate({ props, constants }),
94
+ clear: clear({ state, emit, api: api2 }),
95
+ close: close({ emit, vm })
90
96
  });
91
97
  watch(() => props.visible, api2.watchVisible);
92
98
  watch(() => props.modelValue, api2.watchModelValue, { immediate: true });
package/date-range/vue.js CHANGED
@@ -1,4 +1,6 @@
1
- import "../chunk-G2ADBYYC.js";
1
+ import {
2
+ __spreadValues
3
+ } from "../chunk-G2ADBYYC.js";
2
4
  import {
3
5
  getMinVisibleDate,
4
6
  watchValue,
@@ -64,9 +66,11 @@ const api = [
64
66
  "handleTimeInput",
65
67
  "handleMinTimeClose",
66
68
  "handleDateChange",
67
- "handleMaxTimeClose"
69
+ "handleMaxTimeClose",
70
+ "isValidValue"
68
71
  ];
69
- const initState = ({ reactive, computed, api: api2, constants }) => {
72
+ const initState = ({ reactive, computed, api: api2, constants, designConfig }) => {
73
+ var _a;
70
74
  const state = reactive({
71
75
  popperElm: null,
72
76
  popperClass: "",
@@ -112,7 +116,11 @@ const initState = ({ reactive, computed, api: api2, constants }) => {
112
116
  timeFormat: computed(() => state.format ? extractTimeFormat(state.format) : "HH:mm:ss"),
113
117
  dateFormat: computed(() => state.format ? extractDateFormat(state.format) : "yyyy-MM-dd"),
114
118
  enableMonthArrow: computed(() => api2.getEnableMonthArrow()),
115
- enableYearArrow: computed(() => api2.computerEnableYearArrow())
119
+ enableYearArrow: computed(() => api2.computerEnableYearArrow()),
120
+ confirmButtonProps: __spreadValues({
121
+ plain: true,
122
+ type: "default"
123
+ }, (_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.confirmButtonProps)
116
124
  });
117
125
  return state;
118
126
  };
@@ -172,10 +180,10 @@ const initApi = ({ api: api2, state, t, vm, nextTick, emit, constants }) => {
172
180
  watchPickerVisible: watchPickerVisible({ state, constants })
173
181
  });
174
182
  };
175
- const renderless = (props, { computed, reactive, watch, nextTick }, { t, emit: $emit, vm, constants }) => {
183
+ const renderless = (props, { computed, reactive, watch, nextTick }, { t, emit: $emit, vm, constants, designConfig }) => {
176
184
  const api2 = {};
177
185
  const emit = props.emitter ? props.emitter.emit : $emit;
178
- const state = initState({ reactive, computed, api: api2, constants });
186
+ const state = initState({ reactive, computed, api: api2, constants, designConfig });
179
187
  initApi({ api: api2, state, t, vm, nextTick, emit, constants });
180
188
  initWatch({ watch, state, api: api2 });
181
189
  return api2;
@@ -357,6 +357,10 @@ const handleClick = ({ api, emit, props, state }) => (event) => {
357
357
  emit("pick", newValue);
358
358
  }
359
359
  };
360
+ const getCssToken = ({ api }) => (cell, prexfix = "") => {
361
+ const cssStr = api.getCellClasses(cell) || "";
362
+ return cssStr.split(" ").map((className) => prexfix + className);
363
+ };
360
364
  export {
361
365
  arrayFind,
362
366
  arrayFindIndex,
@@ -365,6 +369,7 @@ export {
365
369
  getCell,
366
370
  getCellClasses,
367
371
  getCellRangeClasses,
372
+ getCssToken,
368
373
  getDateOfCell,
369
374
  getDateTimestamp,
370
375
  getOffsetDay,
package/date-table/vue.js CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  watchMaxDate,
9
9
  cellMatchesDate,
10
10
  getCellClasses,
11
+ getCssToken,
11
12
  getDateOfCell,
12
13
  isWeekActive,
13
14
  markRange,
@@ -16,7 +17,7 @@ import {
16
17
  getCell
17
18
  } from "./index";
18
19
  import { getStartDateOfMonth } from "../common/deps/date-util";
19
- const api = ["state", "getCellClasses", "isWeekActive", "handleMouseMove", "handleClick"];
20
+ const api = ["state", "getCellClasses", "getCssToken", "isWeekActive", "handleMouseMove", "handleClick"];
20
21
  const initState = ({ reactive, computed, api: api2, props }) => {
21
22
  const state = reactive({
22
23
  tableRows: [[], [], [], [], [], []],
@@ -50,6 +51,7 @@ const initApi = ({ api: api2, state, props, emit, t, vm }) => {
50
51
  getRows: getRows({ api: api2, props, state, t, vm }),
51
52
  handleClick: handleClick({ api: api2, emit, props, state }),
52
53
  getCellClasses: getCellClasses({ api: api2, props, state }),
54
+ getCssToken: getCssToken({ api: api2 }),
53
55
  getCellRangeClasses: getCellRangeClasses({ props })
54
56
  });
55
57
  };
@@ -1,14 +1,17 @@
1
- import "../chunk-G2ADBYYC.js";
1
+ import {
2
+ __spreadValues
3
+ } from "../chunk-G2ADBYYC.js";
2
4
  import { on, off, addClass, removeClass } from "../common/deps/dom";
3
5
  import { emitEvent } from "../common/event";
4
6
  import { getDomNode } from "../common/deps/dom";
5
7
  const computedAnimationName = ({ constants, props }) => () => props.rightSlide ? constants.DIALOG_SLIDER_RIGHT : constants.DIALOG_FADE;
6
8
  const computedAddUnit = (value) => isNaN(Number(value)) ? value : value + "px";
7
- const computedStyle = ({ props, state }) => () => {
8
- const style = {};
9
+ const computedStyle = ({ props, state, designConfig }) => () => {
10
+ var _a;
11
+ let style = {};
9
12
  let { width, top, rightSlide, maxHeight } = props;
10
13
  if (top === void 0) {
11
- top = rightSlide ? "0" : "15vh";
14
+ top = rightSlide ? "0" : ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.top) ? "" : "15vh";
12
15
  }
13
16
  width = computedAddUnit(width);
14
17
  top = computedAddUnit(top);
@@ -24,6 +27,9 @@ const computedStyle = ({ props, state }) => () => {
24
27
  style.left = state.left || "calc((100vw - " + width + ") / 2)";
25
28
  }
26
29
  }
30
+ if (state.dragStyle) {
31
+ style = __spreadValues(__spreadValues({}, style), state.dragStyle);
32
+ }
27
33
  return style;
28
34
  };
29
35
  const computedBodyStyle = ({ props }) => () => {
@@ -97,11 +103,25 @@ const unMounted = ({ api, parent, props }) => () => {
97
103
  el.parentNode.removeChild(el);
98
104
  }
99
105
  };
100
- const handleWrapperClick = ({ api, props }) => () => {
106
+ const useMouseEventDown = ({ state }) => (event) => {
107
+ state.mouseDownWrapperFlag = false;
108
+ if (/tiny-dialog-box__wrapper/.test(event.target.className) && event.type === "mousedown") {
109
+ state.mouseDownWrapperFlag = true;
110
+ }
111
+ };
112
+ const useMouseEventUp = ({ state }) => (event) => {
113
+ state.mouseUpWrapperFlag = false;
114
+ if (/tiny-dialog-box__wrapper/.test(event.target.className) && event.type === "mouseup") {
115
+ state.mouseUpWrapperFlag = true;
116
+ }
117
+ };
118
+ const handleWrapperClick = ({ api, props, state }) => () => {
101
119
  if (!props.closeOnClickModal) {
102
120
  return;
103
121
  }
104
- api.handleClose("mask");
122
+ if (state.mouseDownWrapperFlag && state.mouseUpWrapperFlag) {
123
+ api.handleClose("mask");
124
+ }
105
125
  };
106
126
  const handleClose = ({
107
127
  api,
@@ -193,14 +213,24 @@ const handleDrag = ({ parent, props, state, emit }) => (event) => {
193
213
  }
194
214
  let offsetWidth = modalBoxElem.offsetWidth;
195
215
  let offsetHeight = modalBoxElem.offsetHeight;
196
- let maxX = Math.max(visibleWidth - offsetWidth, 0);
197
- let maxY = Math.max(visibleHeight - offsetHeight, 0);
198
- let left = event2.clientX - disX;
199
- let top = event2.clientY - disY;
200
- left = left < 0 ? 0 : left > maxX ? maxX : left;
201
- top = top < 0 ? 0 : top > maxY ? maxY : top;
202
- modalBoxElem.style.left = `${left}px`;
203
- modalBoxElem.style.top = `${top}px`;
216
+ let left;
217
+ let top;
218
+ if (!props.dragOutsideWindow) {
219
+ let maxX = Math.max(visibleWidth - offsetWidth, 0);
220
+ let maxY = Math.max(visibleHeight - offsetHeight, 0);
221
+ left = event2.clientX - disX;
222
+ top = event2.clientY - disY;
223
+ left = left < 0 ? 0 : left > maxX ? maxX : left;
224
+ top = top < 0 ? 0 : top > maxY ? maxY : top;
225
+ } else {
226
+ let maxX = visibleWidth - 10;
227
+ let maxY = visibleHeight - 10;
228
+ left = event2.clientX - disX;
229
+ top = event2.clientY - disY;
230
+ left = event2.clientX < 0 ? -disX : left > maxX ? maxX : left;
231
+ top = event2.clientY < 0 ? -disY : top > maxY ? maxY : top;
232
+ }
233
+ state.dragStyle = { left: `${left}px`, top: `${top}px` };
204
234
  state.left = `${left}px`;
205
235
  state.top = `${top}px`;
206
236
  state.emitter.emit("boxdrag");
@@ -237,5 +267,7 @@ export {
237
267
  showScrollbar,
238
268
  unMounted,
239
269
  updatePopper,
270
+ useMouseEventDown,
271
+ useMouseEventUp,
240
272
  watchVisible
241
273
  };
package/dialog-box/vue.js CHANGED
@@ -12,6 +12,8 @@ import {
12
12
  hide,
13
13
  handleClose,
14
14
  handleWrapperClick,
15
+ useMouseEventDown,
16
+ useMouseEventUp,
15
17
  mounted,
16
18
  unMounted,
17
19
  updatePopper,
@@ -26,6 +28,8 @@ const api = [
26
28
  "afterLeave",
27
29
  "handleClose",
28
30
  "handleWrapperClick",
31
+ "useMouseEventDown",
32
+ "useMouseEventUp",
29
33
  "handleCancel",
30
34
  "handleConfirm",
31
35
  "handleDrag",
@@ -36,8 +40,10 @@ const initState = ({
36
40
  computed,
37
41
  api: api2,
38
42
  emitter,
39
- props
43
+ props,
44
+ useBreakpoint
40
45
  }) => {
46
+ const { current } = useBreakpoint();
41
47
  const state = reactive({
42
48
  emitter: emitter(),
43
49
  key: 0,
@@ -52,7 +58,9 @@ const initState = ({
52
58
  isFull: props.fullscreen,
53
59
  style: computed(() => api2.computedStyle()),
54
60
  bodyStyle: computed(() => api2.computedBodyStyle()),
55
- animationName: computed(() => api2.computedAnimationName())
61
+ animationName: computed(() => api2.computedAnimationName()),
62
+ current,
63
+ dragStyle: null
56
64
  });
57
65
  return state;
58
66
  };
@@ -75,6 +83,7 @@ const initApi = ({
75
83
  usePopups,
76
84
  nextTick,
77
85
  broadcast,
86
+ designConfig,
78
87
  vm
79
88
  }) => {
80
89
  const { open, close } = usePopups;
@@ -86,7 +95,9 @@ const initApi = ({
86
95
  handleCancel: handleCancel({ api: api2, emit }),
87
96
  handleConfirm: handleConfirm({ api: api2, emit }),
88
97
  updatePopper: updatePopper({ api: api2, constants }),
89
- handleWrapperClick: handleWrapperClick({ api: api2, props }),
98
+ handleWrapperClick: handleWrapperClick({ api: api2, props, state }),
99
+ useMouseEventDown: useMouseEventDown({ state }),
100
+ useMouseEventUp: useMouseEventUp({ state }),
90
101
  hide: hide({ api: api2, emit, state, props }),
91
102
  handleClose: handleClose({ api: api2, constants, emit, parent, props }),
92
103
  watchVisible: watchVisible({
@@ -99,7 +110,7 @@ const initApi = ({
99
110
  vm,
100
111
  state
101
112
  }),
102
- computedStyle: computedStyle({ state, props }),
113
+ computedStyle: computedStyle({ state, props, designConfig }),
103
114
  computedBodyStyle: computedBodyStyle({ props }),
104
115
  mounted: mounted({ api: api2, parent, props }),
105
116
  unMounted: unMounted({ api: api2, parent, props }),
@@ -120,10 +131,21 @@ const initWatch = ({ watch, state, api: api2, props }) => {
120
131
  }
121
132
  );
122
133
  };
123
- const renderless = (props, { computed, onBeforeUnmount, onMounted, toRefs, reactive, watch }, { vm, emitter, parent, emit, constants, nextTick, mode, broadcast }) => {
134
+ const renderless = (props, { computed, onBeforeUnmount, onMounted, toRefs, reactive, watch }, {
135
+ vm,
136
+ emitter,
137
+ parent,
138
+ emit,
139
+ constants,
140
+ nextTick,
141
+ mode,
142
+ broadcast,
143
+ designConfig,
144
+ useBreakpoint
145
+ }) => {
124
146
  const api2 = {};
125
147
  const lockScrollClass = constants.scrollLockClass(mode);
126
- let state = initState({ reactive, computed, api: api2, emitter, props });
148
+ let state = initState({ reactive, computed, api: api2, emitter, props, useBreakpoint });
127
149
  const usePopups = usePopup({
128
150
  api: api2,
129
151
  nextTick,
@@ -146,7 +168,8 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, toRefs, react
146
168
  lockScrollClass,
147
169
  nextTick,
148
170
  vm,
149
- broadcast
171
+ broadcast,
172
+ designConfig
150
173
  });
151
174
  state = mergeState({ reactive, state, toRefs, usePopups });
152
175
  initWatch({ watch, state, api: api2, props });
@@ -47,7 +47,7 @@ const queryGridData = ({ api, props, state }) => () => {
47
47
  const multiGridSelectAll = ({ api, props, state }) => ({ selection, checked }) => {
48
48
  if (checked) {
49
49
  arrayEach(selection, (item) => {
50
- const index = findIndexOf(state.selectedValues, (val) => val == item[props.valueField]);
50
+ const index = findIndexOf(state.selectedValues, (val) => val === item[props.valueField]);
51
51
  if (!~index) {
52
52
  state.selectedValues = [...state.selectedValues, item[props.valueField]];
53
53
  state.selectedDatas = [...state.selectedDatas, item];
@@ -62,7 +62,7 @@ const multiGridSelectAll = ({ api, props, state }) => ({ selection, checked }) =
62
62
  api.selectedBoxInit();
63
63
  };
64
64
  const multiGridSelectChange = ({ api, props, state }) => ({ row, checked }) => {
65
- const index = findIndexOf(state.selectedValues, (val) => val == row[props.valueField]);
65
+ const index = findIndexOf(state.selectedValues, (val) => val === row[props.valueField]);
66
66
  if (checked) {
67
67
  if (!~index) {
68
68
  state.selectedValues = [...state.selectedValues, row[props.valueField]];
@@ -109,7 +109,7 @@ const selectedBoxDelete = ({ props, state, vm }) => ({ option: row }) => {
109
109
  if (multi && popseletor === "tree") {
110
110
  vm.$refs.multiTree.setCheckedByNodeKey(row[props.valueField], false);
111
111
  }
112
- const index = findIndexOf(state.selectedValues, (val) => val == row[props.valueField]);
112
+ const index = findIndexOf(state.selectedValues, (val) => val === row[props.valueField]);
113
113
  if (~index) {
114
114
  state.selectedValues = [...state.selectedValues.slice(0, index), ...state.selectedValues.slice(index + 1)];
115
115
  state.selectedDatas = [...state.selectedDatas.slice(0, index), ...state.selectedDatas.slice(index + 1)];
@@ -136,6 +136,7 @@ const doMultiTreeFilter = ({ props, state, nextTick, vm }) => () => {
136
136
  }
137
137
  state.multiTreeStore.viewType = "plain";
138
138
  state.multiTreeStore.expandedKeys = expandedKeys;
139
+ vm.$refs.multiTree.filter(state.multiTreeStore.filterText);
139
140
  });
140
141
  }
141
142
  } else {
@@ -339,7 +340,9 @@ const watchMulti = ({ api, state, props }) => () => {
339
340
  state.lookupStore.datas = [];
340
341
  api.doAutoLookup();
341
342
  };
343
+ const clearStatus = (api) => () => api.watchMulti();
342
344
  export {
345
+ clearStatus,
343
346
  computedConfig,
344
347
  computedGridColumns,
345
348
  doAutoLookup,
@@ -23,7 +23,8 @@ import {
23
23
  doAutoLookup,
24
24
  multiTreeRadio,
25
25
  multiGridRadioChange,
26
- watchMulti
26
+ watchMulti,
27
+ clearStatus
27
28
  } from "./index";
28
29
  const api = [
29
30
  "state",
@@ -43,7 +44,8 @@ const api = [
43
44
  "onFooterCancel",
44
45
  "onFooterConfirm",
45
46
  "multiTreeRadio",
46
- "multiGridRadioChange"
47
+ "multiGridRadioChange",
48
+ "clearStatus"
47
49
  ];
48
50
  const renderless = (props, { reactive, computed, watch }, { vm, nextTick, emit }) => {
49
51
  const state = reactive({
@@ -68,7 +70,8 @@ const renderless = (props, { reactive, computed, watch }, { vm, nextTick, emit }
68
70
  },
69
71
  lookupStore: {
70
72
  datas: []
71
- }
73
+ },
74
+ theme: vm.theme
72
75
  });
73
76
  state.temporary = {};
74
77
  const api2 = {
@@ -98,7 +101,8 @@ const renderless = (props, { reactive, computed, watch }, { vm, nextTick, emit }
98
101
  queryGridData: queryGridData({ api: api2, props, state }),
99
102
  setChecked: setChecked({ api: api2, props, state }),
100
103
  multiTreeRadio: multiTreeRadio({ api: api2, props }),
101
- watchMulti: watchMulti({ api: api2, state, props })
104
+ watchMulti: watchMulti({ api: api2, state, props }),
105
+ clearStatus: clearStatus(api2)
102
106
  });
103
107
  watch(
104
108
  () => props.visible,
package/drawer/index.js CHANGED
@@ -1,9 +1,20 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  import debounce from "../common/deps/debounce";
3
3
  import { addClass, removeClass } from "../common/deps/dom";
4
- const close = ({ emit, state }) => () => {
5
- state.toggle = false;
6
- emit("close", state);
4
+ const computedWidth = ({
5
+ state,
6
+ designConfig,
7
+ props,
8
+ constants
9
+ }) => () => {
10
+ var _a;
11
+ if (state.width) {
12
+ return state.width + "px";
13
+ }
14
+ return props.width || ((_a = designConfig == null ? void 0 : designConfig.constants) == null ? void 0 : _a.DEFAULT_WIDTH) || constants.DEFAULT_WIDTH;
15
+ };
16
+ const close = ({ api }) => (force = false) => {
17
+ api.handleClose("close", force);
7
18
  };
8
19
  const watchVisible = ({ state }) => (bool) => {
9
20
  setTimeout(() => {
@@ -15,9 +26,17 @@ const watchToggle = ({ emit }) => (bool) => {
15
26
  emit("update:visible", bool);
16
27
  }, 0);
17
28
  };
18
- const confirm = ({ emit, state }) => () => {
29
+ const confirm = ({ api }) => () => {
30
+ api.handleClose("confirm");
31
+ };
32
+ const handleClose = ({ emit, props, state }) => (type, force) => {
33
+ const isMaskNotClosable = type === "mask" && !props.maskClosable;
34
+ const isBlockClose = !force && typeof props.beforeClose === "function" && props.beforeClose(type) === false;
35
+ if (isMaskNotClosable || isBlockClose) {
36
+ return;
37
+ }
19
38
  state.toggle = false;
20
- emit("confirm", state);
39
+ emit(["close", "confirm"].includes(type) ? type : "close", state);
21
40
  };
22
41
  const mousedown = ({ state, vm }) => (event2) => {
23
42
  event2.preventDefault();
@@ -50,6 +69,7 @@ const mouseup = ({ state }) => () => {
50
69
  if (!state.dragEvent.isDrag) {
51
70
  return;
52
71
  }
72
+ ;
53
73
  event.preventDefault();
54
74
  state.dragEvent.isDrag = false;
55
75
  };
@@ -85,7 +105,9 @@ const watchVisibleNotImmediate = ({ api, props }) => (visible) => {
85
105
  export {
86
106
  addDragEvent,
87
107
  close,
108
+ computedWidth,
88
109
  confirm,
110
+ handleClose,
89
111
  hideScrollbar,
90
112
  mousedown,
91
113
  mousemove,
package/drawer/vue.js CHANGED
@@ -11,22 +11,27 @@ import {
11
11
  removeDragEvent,
12
12
  showScrollbar,
13
13
  hideScrollbar,
14
- watchVisibleNotImmediate
14
+ watchVisibleNotImmediate,
15
+ handleClose,
16
+ computedWidth
15
17
  } from "./index";
16
- const api = ["state", "close", "confirm"];
17
- const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, computed }, { emit, vm, mode, constants }) => {
18
+ const api = ["state", "close", "confirm", "handleClose"];
19
+ const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, computed }, { emit, vm, mode, constants, designConfig }) => {
20
+ var _a;
18
21
  const lockScrollClass = constants.SCROLL_LOCK_CLASS(mode);
19
22
  const api2 = {};
20
23
  const state = reactive({
21
24
  toggle: false,
22
25
  width: 0,
23
26
  dragEvent: { x: 0, isDrag: false, offsetWidth: 0 },
24
- computedWidth: computed(() => state.width ? state.width + "px" : props.width)
27
+ computedWidth: computed(() => api2.computedWidth()),
28
+ btnOrderReversed: vm.theme === "saas" || ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.btnOrderReversed)
25
29
  });
26
30
  Object.assign(api2, {
27
31
  state,
28
- confirm: confirm({ state, emit }),
29
- close: close({ emit, state }),
32
+ confirm: confirm({ api: api2 }),
33
+ close: close({ api: api2 }),
34
+ handleClose: handleClose({ emit, props, state }),
30
35
  mousedown: mousedown({ state, vm }),
31
36
  mousemove: mousemove({ state, props }),
32
37
  mouseup: mouseup({ state }),
@@ -36,11 +41,13 @@ const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, comput
36
41
  watchToggle: watchToggle({ emit }),
37
42
  showScrollbar: showScrollbar(lockScrollClass),
38
43
  hideScrollbar: hideScrollbar(lockScrollClass),
39
- watchVisibleNotImmediate: watchVisibleNotImmediate({ api: api2, props })
44
+ watchVisibleNotImmediate: watchVisibleNotImmediate({ api: api2, props }),
45
+ computedWidth: computedWidth({ state, designConfig, props, constants })
40
46
  });
41
47
  onMounted(() => {
42
48
  props.dragable && api2.addDragEvent();
43
49
  if (props.lockScroll && props.visible) {
50
+ ;
44
51
  api2.showScrollbar();
45
52
  }
46
53
  });
package/dropdown/index.js CHANGED
@@ -20,7 +20,7 @@ const show = ({ props, state }) => () => {
20
20
  () => {
21
21
  state.visible = true;
22
22
  },
23
- props.trigger === "click" ? 0 : props.showTimeout
23
+ state.trigger === "click" ? 0 : props.showTimeout
24
24
  );
25
25
  };
26
26
  const hide = ({ api, props, state }) => () => {
@@ -36,7 +36,7 @@ const hide = ({ api, props, state }) => () => {
36
36
  () => {
37
37
  state.visible = false;
38
38
  },
39
- props.trigger === "click" ? 0 : props.hideTimeout
39
+ state.trigger === "click" ? 0 : props.hideTimeout
40
40
  );
41
41
  };
42
42
  const handleClick = ({ api, props, state, emit }) => () => {
@@ -128,12 +128,12 @@ const initEvent = ({ api, props, state, vm, mode }) => () => {
128
128
  on(state.triggerElm, "blur", toggleFocus({ state, value: false }));
129
129
  on(state.triggerElm, "click", toggleFocus({ state, value: false }));
130
130
  }
131
- if (props.trigger === "hover") {
131
+ if (state.trigger === "hover") {
132
132
  on(state.triggerElm, "mouseenter", api.show);
133
133
  on(state.triggerElm, "mouseleave", api.hide);
134
134
  on(state.dropdownElm, "mouseenter", api.show);
135
135
  on(state.dropdownElm, "mouseleave", api.hide);
136
- } else if (props.trigger === "click") {
136
+ } else if (state.trigger === "click") {
137
137
  on(state.triggerElm, "click", api.handleClick);
138
138
  }
139
139
  if (mode === "mobile-first") {
@@ -173,8 +173,8 @@ const mounted = ({ api, vm, state, broadcast }) => () => {
173
173
  }
174
174
  vm.$on("menu-item-click", api.handleMenuItemClick);
175
175
  vm.$on("current-item-click", api.handleMenuItemClick);
176
- vm.$on("selectedIndex", (selectedIndex) => {
177
- broadcast("TinyDropdownMenu", "menuselectedIndex", selectedIndex);
176
+ vm.$on("selected-index", (selectedIndex) => {
177
+ broadcast("TinyDropdownMenu", "menu-selected-index", selectedIndex);
178
178
  });
179
179
  vm.$on("is-disabled", api.clickOutside);
180
180
  };
@@ -196,7 +196,7 @@ const beforeDistory = ({ api, state }) => () => {
196
196
  state.dropdownElm = null;
197
197
  }
198
198
  };
199
- const clickOutside = ({ props, api, state }) => (disabled) => {
199
+ const clickOutside = ({ props, api }) => (disabled) => {
200
200
  if (props.hideOnClick) {
201
201
  disabled ? api.show() : api.hide();
202
202
  }
package/dropdown/vue.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  clickOutside
22
22
  } from "./index";
23
23
  const api = ["state", "handleMainButtonClick", "hide", "show", "initDomOperation", "handleClick", "clickOutside"];
24
- const renderless = (props, { reactive, watch, provide, onMounted }, { emit, parent, broadcast, vm, nextTick, mode, designConfig }) => {
24
+ const renderless = (props, { reactive, watch, provide, onMounted, computed }, { emit, parent, broadcast, vm, nextTick, mode, designConfig }) => {
25
25
  const api2 = {};
26
26
  const state = reactive({
27
27
  visible: false,
@@ -34,7 +34,11 @@ const renderless = (props, { reactive, watch, provide, onMounted }, { emit, pare
34
34
  listId: `dropdown-menu-${guid()}`,
35
35
  showIcon: props.showIcon,
36
36
  showSelfIcon: props.showSelfIcon,
37
- designConfig
37
+ designConfig,
38
+ trigger: computed(() => {
39
+ var _a;
40
+ return props.trigger || ((_a = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _a.trigger) || "hover";
41
+ })
38
42
  });
39
43
  provide("dropdownVm", vm);
40
44
  Object.assign(api2, {
@@ -89,14 +89,22 @@ const clickOutside = (parent) => () => {
89
89
  });
90
90
  }
91
91
  };
92
- const handleClick = ({ props, dispatch, vm, emit }) => (event) => {
92
+ const handleClick = ({
93
+ state,
94
+ props,
95
+ dispatch,
96
+ vm,
97
+ emit
98
+ }) => (event) => {
93
99
  event.stopPropagation();
100
+ state.currentIndex = `${props.currentIndex}`;
94
101
  const data = { itemData: props.itemData, vm, disabled: props.disabled };
95
102
  if (!props.disabled) {
96
103
  emit("item-click", data);
97
104
  }
98
105
  dispatch("TinyDropdown", "menu-item-click", data);
99
106
  dispatch("TinyDropdown", "is-disabled", [props.disabled]);
107
+ dispatch("TinyDropdown", "selected-index", [state.currentIndex]);
100
108
  };
101
109
  const computedGetIcon = ({ constants, designConfig }) => (name = "leftWardArrow") => {
102
110
  return (designConfig == null ? void 0 : designConfig.icons[name]) || (constants == null ? void 0 : constants.ICON_MAP[name]);