@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
@@ -2,7 +2,7 @@ import "../chunk-G2ADBYYC.js";
2
2
  import { getRouteActive, onClick, bindChildren, routeTab, getTabbarItemsWidth } from "./index";
3
3
  import { xss } from "../common";
4
4
  const api = ["state", "onClick", "getTabbarItemsWidth"];
5
- const renderless = (props, { computed, onMounted, reactive }, { parent, emit, nextTick, route, router, dispatch, vm }) => {
5
+ const renderless = (props, { computed, onMounted, reactive, inject }, { parent, emit, nextTick, route, router, dispatch, vm }) => {
6
6
  const api2 = {};
7
7
  const state = reactive({
8
8
  index: -1,
@@ -14,7 +14,8 @@ const renderless = (props, { computed, onMounted, reactive }, { parent, emit, ne
14
14
  renderColor: computed(() => parent.$parent[state.active ? "activeColor" : "inactiveColor"]),
15
15
  showVm: true,
16
16
  itemWidth: null,
17
- childrenNumber: 0
17
+ childrenNumber: 0,
18
+ customIcon: inject("customIcon", null) || props.customIcon
18
19
  });
19
20
  Object.assign(api2, {
20
21
  state,
package/tabs/index.js CHANGED
@@ -77,13 +77,25 @@ const handleTabClick = ({ api, emit, props, refs }) => (pane, tabName, event) =>
77
77
  refs.nav && refs.nav.expandTabHide();
78
78
  }
79
79
  };
80
- const handleTabRemove = (emit) => (pane, event) => {
80
+ const handleTabRemove = ({ emit, props }) => (pane, event) => {
81
81
  if (pane.disabled) {
82
82
  return;
83
83
  }
84
84
  event.stopPropagation();
85
- emit("edit", pane.name, "remove");
86
- emit("close", pane.name);
85
+ const emitEvent = () => {
86
+ emit("edit", pane.name, "remove");
87
+ emit("close", pane.name);
88
+ };
89
+ if (typeof props.beforeClose === "function") {
90
+ const beforeCloseResult = props.beforeClose(pane.name);
91
+ if (beforeCloseResult && beforeCloseResult.then) {
92
+ beforeCloseResult.then((res) => res && emitEvent());
93
+ } else {
94
+ beforeCloseResult && emitEvent();
95
+ }
96
+ } else {
97
+ emitEvent();
98
+ }
87
99
  };
88
100
  const handleTabAdd = (emit) => () => {
89
101
  emit("edit", null, "add");
@@ -97,7 +109,7 @@ const setCurrentName = ({ api, props, refs, state }) => (value) => {
97
109
  before.then(() => {
98
110
  api.changeCurrentName(value);
99
111
  refs.nav && refs.nav.removeFocus(value);
100
- });
112
+ }).catch(() => null);
101
113
  } else if (before !== false) {
102
114
  api.changeCurrentName(value);
103
115
  }
package/tabs/vue.js CHANGED
@@ -39,6 +39,7 @@ const initState = ({ reactive, props }) => reactive({
39
39
  offsetY: 0,
40
40
  direction: "",
41
41
  expandPanesWidth: "",
42
+ activeIndex: 1,
42
43
  separator: props.separator
43
44
  });
44
45
  const initWatcher = ({
@@ -77,7 +78,7 @@ const renderless = (props, { onMounted, onUpdated, provide, reactive, watch }, {
77
78
  Object.assign(api2, {
78
79
  state,
79
80
  handleTabAdd: handleTabAdd(emit),
80
- handleTabRemove: handleTabRemove(emit),
81
+ handleTabRemove: handleTabRemove({ emit, props }),
81
82
  changeDirection: changeDirection({ props, state }),
82
83
  changeCurrentName: changeCurrentName({ emit, state }),
83
84
  calcMorePanes: calcMorePanes({ parent, props, state, refs }),
package/tabs-mf/index.js CHANGED
@@ -2,11 +2,22 @@ import "../chunk-G2ADBYYC.js";
2
2
  import { random } from "../common/string";
3
3
  import debounce from "../common/deps/debounce";
4
4
  import { fastdom } from "../common/deps/fastdom";
5
- const setActive = ({ emit, state, props }) => (name) => {
5
+ const setActive = ({ state, props, api }) => (name) => {
6
6
  const current = state.currentItem ? state.currentItem.name : "";
7
- if (current && current !== name && props.beforeLeave && !props.beforeLeave(name, current)) {
8
- return;
7
+ if (current && current !== name && props.beforeLeave) {
8
+ const before = props.beforeLeave(name, current);
9
+ if (before && before.then) {
10
+ before.then(() => {
11
+ api.changeCurrentName(name);
12
+ }).catch(() => null);
13
+ } else if (before !== false) {
14
+ api.changeCurrentName(name);
15
+ }
16
+ } else {
17
+ api.changeCurrentName(name);
9
18
  }
19
+ };
20
+ const changeCurrentName = ({ emit, state }) => (name) => {
10
21
  state.items.forEach((item) => item.selected = item.name === name);
11
22
  emit("update:activeName", name);
12
23
  emit("update:modelValue", name);
@@ -41,7 +52,7 @@ const clickMore = (api) => (name) => {
41
52
  api.setActive(name);
42
53
  api.scrollTo(name);
43
54
  };
44
- const removeItem = ({ state, emit }) => (name) => {
55
+ const removeItem = ({ state, emit }) => (name, silent = false) => {
45
56
  const itemIndex = state.items.findIndex((item) => item.name === name);
46
57
  const navIndex = state.navs.findIndex((item) => item.name === name);
47
58
  if (~itemIndex) {
@@ -49,8 +60,10 @@ const removeItem = ({ state, emit }) => (name) => {
49
60
  state.items = [...state.items];
50
61
  state.navs.splice(navIndex, 1);
51
62
  state.navs = [...state.navs];
52
- emit("edit", name, "remove");
53
- emit("close", name);
63
+ if (!silent) {
64
+ emit("edit", name, "remove");
65
+ emit("close", name);
66
+ }
54
67
  }
55
68
  };
56
69
  const wheelListener = ({ vm, api, tabs, state }) => debounce(10, (e) => {
@@ -99,6 +112,7 @@ const handleNavItemClose = ({ tabs, props }) => (e) => {
99
112
  export {
100
113
  addItem,
101
114
  addNav,
115
+ changeCurrentName,
102
116
  clickMore,
103
117
  emitAdd,
104
118
  getBoundRect,
@@ -1,26 +1,41 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  const api = ["state"];
3
- const renderless = (props, { reactive, inject, computed, nextTick, watch }) => {
3
+ const renderless = (props, { reactive, inject, computed, onMounted, onBeforeUnmount }, { vm }) => {
4
4
  const tabs = inject("tabs", null);
5
5
  const state = reactive({
6
6
  navItems: computed(() => tabs.state.items),
7
- currentNav: null,
7
+ currentNav: computed(() => tabs.state.navs[state.currentIndex]),
8
8
  currentIndex: computed(
9
9
  () => tabs.state.navs.findIndex((item) => tabs.state.currentItem && tabs.state.currentItem.name === item.name)
10
10
  ),
11
11
  currentWidth: 0,
12
12
  currentPosition: 0
13
13
  });
14
- watch(
15
- () => state.currentIndex,
16
- () => {
17
- nextTick(() => {
18
- const nav = state.currentNav = tabs.state.navs[state.currentIndex];
19
- state.currentWidth = nav && nav.$el.offsetWidth || 0;
20
- state.currentPosition = nav && nav.$el.offsetLeft || 0;
21
- });
14
+ let rafId, observer;
15
+ onMounted(() => {
16
+ observer = new MutationObserver((mutationsList) => {
17
+ for (let mutation of mutationsList) {
18
+ if (mutation.type === "attributes") {
19
+ if (rafId) {
20
+ cancelAnimationFrame(rafId);
21
+ }
22
+ rafId = requestAnimationFrame(() => {
23
+ const nav = state.currentNav;
24
+ state.currentWidth = nav && nav.$el.offsetWidth || 0;
25
+ state.currentPosition = nav && nav.$el.offsetLeft || 0;
26
+ });
27
+ }
28
+ }
29
+ });
30
+ observer.observe(vm.$el, { attributes: true, subtree: true });
31
+ });
32
+ onBeforeUnmount(() => {
33
+ if (rafId) {
34
+ cancelAnimationFrame(rafId);
22
35
  }
23
- );
36
+ observer.disconnect();
37
+ observer = null;
38
+ });
24
39
  return { state };
25
40
  };
26
41
  export {
package/tabs-mf/vue.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  import { random } from "../common/string";
3
- import { setActive, addItem, addNav, scrollTo, clickMore, removeItem } from "./index";
3
+ import { setActive, addItem, addNav, scrollTo, clickMore, removeItem, changeCurrentName } from "./index";
4
4
  const api = ["state", "setActive", "addItem", "addNav", "scrollTo", "clickMore", "removeItem"];
5
5
  const renderless = (props, { onMounted, onBeforeUnmount, provide, reactive, watch, computed }, { vm, emit }) => {
6
6
  const state = reactive({
@@ -10,15 +10,15 @@ const renderless = (props, { onMounted, onBeforeUnmount, provide, reactive, watc
10
10
  key: computed(() => state.currentItem ? state.currentItem.name : random()),
11
11
  separator: props.separator
12
12
  });
13
- const api2 = {
14
- setActive: setActive({ emit, state, props }),
13
+ const api2 = {};
14
+ Object.assign(api2, {
15
+ state,
16
+ setActive: setActive({ api: api2, state, props }),
15
17
  addItem: addItem(state),
16
18
  addNav: addNav(state),
17
19
  scrollTo: scrollTo({ vm, state }),
18
- removeItem: removeItem({ state, emit })
19
- };
20
- Object.assign(api2, {
21
- state,
20
+ removeItem: removeItem({ state, emit }),
21
+ changeCurrentName: changeCurrentName({ state, emit }),
22
22
  clickMore: clickMore(api2)
23
23
  });
24
24
  provide("tabs", vm);
package/tabs-mf/wheel.js CHANGED
@@ -64,6 +64,7 @@ const getWheelListener = ({ addApiName, removeApiName, prefix, support, window }
64
64
  remove: (elem, eventName, callback, useCapture) => {
65
65
  const cb = elemCbMap.get(elem);
66
66
  elem[removeApiName](prefix + eventName, cb, useCapture || false);
67
+ elemCbMap.delete(elem);
67
68
  }
68
69
  });
69
70
  export {
package/tag/index.js CHANGED
@@ -8,7 +8,7 @@ const handleClose = ({ emit, props, state }) => (event) => {
8
8
  props.beforeDelete ? props.beforeDelete(close) : close();
9
9
  };
10
10
  const handleClick = ({ emit, props, parent, state }) => (event) => {
11
- if (props.selectable === false || props.disabled)
11
+ if (props.selectable || props.disabled)
12
12
  return;
13
13
  parent.$parent && parent.$parent.tagSelectable && event.stopPropagation();
14
14
  state.selected = !state.selected;
@@ -25,7 +25,8 @@ const getHiddenTags = ({ props, vm, state }) => () => {
25
25
  state.hiddenTags = [];
26
26
  Array.from(tags).forEach((el, index) => {
27
27
  const item = props.data[index];
28
- if (el.offsetTop >= el.offsetHeight && item) {
28
+ const element = el;
29
+ if (element.offsetTop >= element.offsetHeight && item) {
29
30
  state.hiddenTags.push(__spreadValues({}, item));
30
31
  }
31
32
  });
package/time/index.js CHANGED
@@ -13,10 +13,13 @@ const watchValue = ({ api, nextTick, state }) => (value) => {
13
13
  state.needInitAdjust = false;
14
14
  }
15
15
  };
16
- const watchVisible = ({ nextTick, vm, state }) => (value) => {
16
+ const watchVisible = ({ nextTick, vm, state, api }) => (value) => {
17
17
  if (value) {
18
18
  state.oldValue = state.value;
19
- nextTick(() => vm.$refs.spinner.emitSelectRange("hours"));
19
+ nextTick(() => {
20
+ vm.$refs.spinner.emitSelectRange("hours");
21
+ api.adjustSpinners();
22
+ });
20
23
  } else {
21
24
  state.needInitAdjust = true;
22
25
  }
package/time/vue.js CHANGED
@@ -45,7 +45,7 @@ const renderless = (props, { computed, onMounted, reactive, watch, nextTick }, {
45
45
  adjustSpinners: adjustSpinners(vm),
46
46
  handleCancel: handleCancel({ state, emit }),
47
47
  setSelectionRange: setSelectionRange({ state, emit }),
48
- watchVisible: watchVisible({ nextTick, vm, state }),
48
+ watchVisible: watchVisible({ nextTick, vm, state, api: api2 }),
49
49
  isValidValue: isValidValue({ state }),
50
50
  changeSelectionRange: changeSelectionRange({ vm, state }),
51
51
  handleConfirm: handleConfirm({ state, emit }),
@@ -46,10 +46,10 @@ const computedData = ({ props, state }) => () => {
46
46
  };
47
47
  const computedCurrent = ({ props, state }) => () => state.isReverse ? state.nodes.length - props.active - 1 : props.active;
48
48
  const computedIsReverse = (props) => () => props.reverse && props.vertical;
49
- const computedStackNodes = ({ state, constants }) => () => {
50
- if (state.nodes.length >= constants.STACK_NODES_MAX) {
49
+ const computedStackNodes = ({ state, props }) => () => {
50
+ if (state.nodes.length >= props.nodeMax && !props.foldDisabled) {
51
51
  state.showData = true;
52
- return state.nodes.slice(0, constants.LIMITED_STACK_NODES);
52
+ return state.nodes.slice(0, props.limitedNodes);
53
53
  }
54
54
  return state.nodes;
55
55
  };
package/time-line/vue.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  toggleFold
15
15
  } from "./index";
16
16
  const api = ["state", "handleClick", "getStatusCls", "getStatus", "getDate", "changeStatus", "toggleFold"];
17
- const renderless = (props, { computed, reactive, provide, watch }, { t, emit, constants }) => {
17
+ const renderless = (props, { computed, reactive, provide, watch }, { t, emit, constants, designConfig }) => {
18
18
  const api2 = {};
19
19
  const state = reactive({
20
20
  nodes: computed(() => api2.computedData()),
@@ -37,7 +37,7 @@ const renderless = (props, { computed, reactive, provide, watch }, { t, emit, co
37
37
  getStatus: getStatus({ state, t }),
38
38
  handleClick: handleClick({ emit, state }),
39
39
  getStatusCls: getStatusCls({ constants, state }),
40
- computedStackNodes: computedStackNodes({ state, constants }),
40
+ computedStackNodes: computedStackNodes({ state, props }),
41
41
  changeStatus: changeStatus({ state }),
42
42
  computedWrapperClass: computedWrapperClass({ props }),
43
43
  toggleFold: toggleFold({ props })
@@ -1,11 +1,15 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  const optionMethod = (value) => {
3
3
  const val = ("0" + value).slice(-2);
4
- return { id: val, label: val };
4
+ return { id: +val, label: val };
5
5
  };
6
6
  const watchModelValue = ({ props, state }) => () => {
7
- const { modelValue } = props;
8
- state.dateArr = modelValue ? modelValue.slice() : [];
7
+ const { modelValue, showSeconds } = props;
8
+ const num = showSeconds ? 3 : 2;
9
+ if (!showSeconds && modelValue.length === 3) {
10
+ state.seconds = modelValue[2];
11
+ }
12
+ state.dateArr = modelValue ? modelValue.slice(0, num) : [];
9
13
  };
10
14
  const watchVisible = ({ api, state }) => (value) => {
11
15
  state.visible = value;
@@ -18,11 +22,26 @@ const updateVisible = ({ state, emit }) => (value) => {
18
22
  const confirm = ({ emit, state }) => (value) => {
19
23
  const dateArr = value.map((item) => ("0" + item).slice(-2));
20
24
  state.dateArr = dateArr;
21
- emit("update:modelValue", dateArr);
22
- emit("confirm", dateArr);
25
+ emit("update:modelValue", state.value);
26
+ emit("confirm", state.value);
27
+ };
28
+ const getTimePeriod = ({ state, props }) => (unit, length) => {
29
+ const step = props.step || {};
30
+ const value = step[unit] || 1;
31
+ return Array.from({ length }).map((v, key) => key).filter((v) => v % value === 0).map((v) => optionMethod(v));
32
+ };
33
+ const computedOptions = ({ state, api, props }) => () => {
34
+ const { showSeconds } = props;
35
+ const options = [];
36
+ options.push(api.getTimePeriod("hour", 24));
37
+ options.push(api.getTimePeriod("minute", 60));
38
+ showSeconds && options.push(api.getTimePeriod("second", 60));
39
+ return options;
23
40
  };
24
41
  export {
42
+ computedOptions,
25
43
  confirm,
44
+ getTimePeriod,
26
45
  optionMethod,
27
46
  updateVisible,
28
47
  watchModelValue,
@@ -1,16 +1,24 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- import { optionMethod, watchModelValue, watchVisible, confirm, updateVisible } from "./index";
2
+ import {
3
+ optionMethod,
4
+ watchModelValue,
5
+ watchVisible,
6
+ confirm,
7
+ updateVisible,
8
+ getTimePeriod,
9
+ computedOptions
10
+ } from "./index";
3
11
  const api = ["state", "confirm", "updateVisible"];
4
- const renderless = (props, { reactive, watch }, { emit }) => {
12
+ const renderless = (props, { reactive, watch, computed }, { emit }) => {
5
13
  const api2 = {};
6
14
  const state = reactive({
7
15
  visible: false,
8
16
  dateArr: [],
9
- optionList: [
10
- { range: [0, 23], optionMethod },
11
- { range: [0, 59], optionMethod },
12
- { range: [0, 59], optionMethod }
13
- ]
17
+ seconds: null,
18
+ options: computed(() => api2.computedOptions()),
19
+ value: computed(
20
+ () => !props.showSeconds && state.seconds !== null ? [...state.dateArr, state.seconds] : state.dateArr
21
+ )
14
22
  });
15
23
  Object.assign(api2, {
16
24
  state,
@@ -18,6 +26,8 @@ const renderless = (props, { reactive, watch }, { emit }) => {
18
26
  watchVisible: watchVisible({ api: api2, state }),
19
27
  confirm: confirm({ emit, state }),
20
28
  updateVisible: updateVisible({ emit, state }),
29
+ getTimePeriod: getTimePeriod({ state, props }),
30
+ computedOptions: computedOptions({ state, api: api2, props }),
21
31
  optionMethod
22
32
  });
23
33
  watch(() => props.visible, api2.watchVisible);
@@ -74,6 +74,8 @@ const handleMaxChange = ({ api, state }) => (date) => {
74
74
  api.handleChange();
75
75
  };
76
76
  const handleChange = ({ api, emit, vm, state }) => () => {
77
+ if (!vm.$refs.minSpinner || !vm.$refs.maxSpinner || !state.visible)
78
+ return;
77
79
  if (api.isValidValue([state.minDate, state.maxDate])) {
78
80
  vm.$refs.minSpinner.state.selectableRange = [[api.minTimeOfDay(state.minDate), state.maxDate]];
79
81
  vm.$refs.maxSpinner.state.selectableRange = [[state.minDate, api.maxTimeOfDay(state.maxDate)]];
@@ -11,7 +11,7 @@ import {
11
11
  computedItemStyle
12
12
  } from "./index";
13
13
  const api = ["state", "handleClick", "getStatusCls", "getStatus", "getDate", "rootProps"];
14
- const renderless = (props, { computed, reactive, inject }, { t, emit, constants }) => {
14
+ const renderless = (props, { computed, reactive, inject }, { t, emit, constants, designConfig }) => {
15
15
  const api2 = {};
16
16
  const { timelineItems, nodes, props: rootProps } = inject("nodesInject");
17
17
  timelineItems.push(props.node);
package/tooltip/index.js CHANGED
@@ -75,7 +75,7 @@ const setExpectedState = ({ state }) => (value) => {
75
75
  }
76
76
  state.expectedState = value;
77
77
  };
78
- const destroyed = ({ state, api }) => () => {
78
+ const destroyed = ({ state, api, vm }) => () => {
79
79
  const reference = state.referenceElm;
80
80
  state.showPopper = false;
81
81
  if (reference && reference.nodeType === 1) {
@@ -86,6 +86,10 @@ const destroyed = ({ state, api }) => () => {
86
86
  off(reference, "blur", api.handleBlur);
87
87
  off(reference, "click", api.removeFocusing);
88
88
  }
89
+ if (vm.popperVM) {
90
+ typeof vm.popperVM.$destroy === "function" && vm.popperVM.$destroy();
91
+ vm.popperVM = null;
92
+ }
89
93
  };
90
94
  const debounceClose = ({ api, props }) => debounce(props.closeDelay, () => {
91
95
  api.handleClosePopper();
@@ -137,7 +141,7 @@ const observeCallback = ({ state, popperVmRef }) => (mutationsList) => {
137
141
  }
138
142
  }
139
143
  };
140
- const bindPopper = ({ vm, refs, nextTick, popperVmRef }) => (el) => {
144
+ const bindPopper = ({ vm, nextTick, popperVmRef }) => (el) => {
141
145
  nextTick(() => vm.bindEvent(el));
142
146
  let popperVM = vm.popperVM;
143
147
  if (!vm.$refs.popper) {
@@ -145,7 +149,6 @@ const bindPopper = ({ vm, refs, nextTick, popperVmRef }) => (el) => {
145
149
  } else {
146
150
  popperVmRef.popper = vm.$refs.popper;
147
151
  }
148
- refs.popper || (refs.popper = popperVM.$el);
149
152
  nextTick(() => {
150
153
  if (vm.modelValue) {
151
154
  vm.updatePopper();
package/tooltip/vue.js CHANGED
@@ -55,10 +55,10 @@ const renderless = (props, {
55
55
  onMounted,
56
56
  onUnmounted,
57
57
  inject
58
- }, { vm, emit, refs, slots, nextTick, parent }) => {
58
+ }, { vm, emit, slots, nextTick, parent }) => {
59
59
  const api2 = {};
60
- const popperParam = { emit, props, nextTick, toRefs, reactive, parent: parent.$parent, refs };
61
60
  const popperVmRef = {};
61
+ const popperParam = { emit, props, nextTick, toRefs, reactive, parent: parent.$parent, vm, popperVmRef };
62
62
  Object.assign(popperParam, { slots, onBeforeUnmount, onDeactivated, watch });
63
63
  const { showPopper, updatePopper, popperElm, referenceElm, doDestroy } = userPopper(popperParam);
64
64
  const state = initState({ reactive, showPopper, popperElm, referenceElm, props, inject });
@@ -68,8 +68,8 @@ const renderless = (props, {
68
68
  updatePopper,
69
69
  show: show({ api: api2, state, props }),
70
70
  hide: hide(api2),
71
- destroyed: destroyed({ state, api: api2 }),
72
- bindPopper: bindPopper({ vm, refs, nextTick, popperVmRef }),
71
+ destroyed: destroyed({ state, api: api2, vm }),
72
+ bindPopper: bindPopper({ vm, nextTick, popperVmRef }),
73
73
  watchFocusing: watchFocusing(state),
74
74
  removeFocusing: removeFocusing({ api: api2, state }),
75
75
  handleBlur: handleBlur({ api: api2, state }),
package/transfer/index.js CHANGED
@@ -27,7 +27,12 @@ const getFlatData = (data, hasChildren) => {
27
27
  }
28
28
  return nodes;
29
29
  };
30
- const getTargetData = ({ props, state, Tree, Table }) => () => {
30
+ const getTargetData = ({
31
+ props,
32
+ state,
33
+ Tree,
34
+ Table
35
+ }) => () => {
31
36
  if (props.render && props.render.plugin.name === Tree) {
32
37
  const nodes = getFlatData(copyArray(props.data), true);
33
38
  const rightData = nodes.filter((item) => props.modelValue.includes(item[props.props.key]));
@@ -87,7 +92,13 @@ const addToLeft = ({ emit, props, state }) => (value) => {
87
92
  };
88
93
  props.beforeTransfer ? props.beforeTransfer(change) : change();
89
94
  };
90
- const addToRight = ({ emit, refs, props, state, Tree }) => (value) => {
95
+ const addToRight = ({
96
+ emit,
97
+ refs,
98
+ props,
99
+ state,
100
+ Tree
101
+ }) => (value) => {
91
102
  const change = () => {
92
103
  state.isToLeft = false;
93
104
  let currentValue = props.modelValue.slice();
@@ -154,7 +165,13 @@ const logicFun = ({ props, emit, state }) => ({ event, isAdd, pullMode }) => {
154
165
  emit("update:modelValue", currentValue);
155
166
  emit("change", currentValue, "left", movedKeys);
156
167
  };
157
- const sortableEvent = ({ api, droppanel, props, queryDom, refs }) => () => {
168
+ const sortableEvent = ({
169
+ api,
170
+ droppanel,
171
+ props,
172
+ queryDom,
173
+ refs
174
+ }) => () => {
158
175
  if (props.dropConfig) {
159
176
  const leftPanel = refs.leftPanel.$el.querySelector(droppanel);
160
177
  const Sortable = props.dropConfig.plugin;
@@ -187,24 +204,6 @@ const sortableEvent = ({ api, droppanel, props, queryDom, refs }) => () => {
187
204
  };
188
205
  const getLeftCheckedData = ({ props, state }) => () => state.sourceData.filter((item) => !item[props.props.disabled]);
189
206
  const getRightCheckedData = ({ props, state }) => () => state.targetData.filter((item) => !item[props.props.disabled]);
190
- const recursiveData = ({ api, props, state }) => (data, isCasader, sign) => {
191
- const propChildren = props.treeOp && props.treeOp.props && props.treeOp.props.children || "children";
192
- const values = props.modelValue.slice();
193
- const key = props.props.key;
194
- data.forEach((obj) => {
195
- const isChecked = ~values.indexOf(obj[key]);
196
- if (sign && !isCasader) {
197
- state.treeData.push(obj);
198
- } else {
199
- if (isChecked) {
200
- state.treeData.push(obj);
201
- }
202
- }
203
- if (obj[propChildren] && obj[propChildren].length > 0) {
204
- api.recursiveData(obj[propChildren], isCasader, !!isChecked);
205
- }
206
- });
207
- };
208
207
  export {
209
208
  addToLeft,
210
209
  addToRight,
@@ -218,6 +217,5 @@ export {
218
217
  logicFun,
219
218
  onSourceCheckedChange,
220
219
  onTargetCheckedChange,
221
- recursiveData,
222
220
  sortableEvent
223
221
  };
package/transfer/vue.js CHANGED
@@ -2,7 +2,6 @@ import "../chunk-G2ADBYYC.js";
2
2
  import {
3
3
  getObj,
4
4
  getSourceData,
5
- recursiveData,
6
5
  getLeftCheckedData,
7
6
  getRightCheckedData,
8
7
  getTargetData,
@@ -24,8 +23,6 @@ const initState = ({ reactive, computed, api: api2, props, h, slots }) => reacti
24
23
  sourceData: computed(() => api2.getSourceData()),
25
24
  targetData: computed(() => api2.getTargetData()),
26
25
  hasButtonTexts: computed(() => props.buttonTexts.length === 2),
27
- treeData: [],
28
- sourceTreeData: [],
29
26
  isToLeft: false,
30
27
  optionRender: computed(() => (option) => {
31
28
  if (props.renderContent) {
@@ -45,7 +42,6 @@ const renderless = (props, { computed, onMounted, reactive, h }, { $prefix, emit
45
42
  const { DROPPANEL, TRANSFERPANEL } = parent.$constants;
46
43
  Object.assign(api2, {
47
44
  state,
48
- $slots: parent.$slots,
49
45
  getObj: getObj(props),
50
46
  clearQuery: clearQuery(refs),
51
47
  getSourceData: getSourceData({ props, Tree }),
@@ -57,8 +53,7 @@ const renderless = (props, { computed, onMounted, reactive, h }, { $prefix, emit
57
53
  onSourceCheckedChange: onSourceCheckedChange({ emit, state }),
58
54
  logicFun: logicFun({ props, emit, state }),
59
55
  getTargetData: getTargetData({ props, state, Tree, Table }),
60
- recursiveData: recursiveData({ api: api2, props, state }),
61
- sortableEvent: sortableEvent({ api: api2, droppanel: DROPPANEL, props, queryDom: TRANSFERPANEL, refs, state })
56
+ sortableEvent: sortableEvent({ api: api2, droppanel: DROPPANEL, props, queryDom: TRANSFERPANEL, refs })
62
57
  });
63
58
  onMounted(api2.sortableEvent);
64
59
  return api2;
@@ -113,16 +113,14 @@ const initWatcher = ({ watch, state, api: api2, props, Table }) => {
113
113
  }
114
114
  );
115
115
  };
116
- const renderless = (props, { computed, reactive, watch, toRaw, markRaw }, { $prefix, t, emit, parent, nextTick, refs, vm, slots }) => {
116
+ const renderless = (props, { computed, reactive, watch, toRaw }, { $prefix, emit, parent, vm, slots }) => {
117
117
  const api2 = {};
118
118
  const Table = $prefix + "Table";
119
119
  const Tree = $prefix + "Tree";
120
120
  const state = initState({ reactive, props, parent, computed, api: api2, slots });
121
121
  Object.assign(api2, {
122
- t,
123
122
  state,
124
123
  toRaw,
125
- markRaw,
126
124
  sizesChange: sizesChange(state),
127
125
  setPosition: setPosition({ parent, state }),
128
126
  selectChange: selectChange(state),
@@ -131,14 +129,14 @@ const renderless = (props, { computed, reactive, watch, toRaw, markRaw }, { $pre
131
129
  checkedEvent: checkedEvent(state),
132
130
  getDeteminate: getDeteminate(state),
133
131
  updateAllChecked: updateAllChecked({ state, Table, Tree }),
134
- handleAllCheckedChange: handleAllCheckedChange({ nextTick, props, state, Table, Tree, vm }),
132
+ handleAllCheckedChange: handleAllCheckedChange({ state, Table, Tree, vm }),
135
133
  getCheckedSummary: getCheckedSummary({ props, state, Tree }),
136
134
  getFilterTreeData: getFilterTreeData({ props, state }),
137
135
  getTreeCheckableData: getTreeCheckableData(state),
138
136
  getStrictData: getStrictData({ props, state }),
139
137
  setExpandCache: setExpandCache(state),
140
138
  getCheckableData: getCheckableData({ api: api2, state, Tree }),
141
- getFilterData: getFilterData({ api: api2, parent, props, refs, state, Table, Tree }),
139
+ getFilterData: getFilterData({ api: api2, props, state, Table, Tree }),
142
140
  watchData: watchData({ api: api2, props, state, Tree }),
143
141
  watchDefaultCheckded: watchDefaultCheckded({ api: api2, props, state, Tree }),
144
142
  watchChecked: watchChecked({ api: api2, emit, state })