@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/slider/index.js CHANGED
@@ -53,7 +53,8 @@ const bindMouseDown = ({
53
53
  constants,
54
54
  mode,
55
55
  emit,
56
- state
56
+ state,
57
+ props
57
58
  }) => (event) => {
58
59
  if (event.button !== 0 && event.detail !== 0) {
59
60
  state.activeIndex = -1;
@@ -66,6 +67,7 @@ const bindMouseDown = ({
66
67
  const handleEl = event.target;
67
68
  let isClickBar = false;
68
69
  let isClickBtn = false;
70
+ let isClickLabel = false;
69
71
  if (mode === "mobile-first") {
70
72
  const role = Array.from(handleEl.attributes).find((attr) => attr.name === "role");
71
73
  const name = role && role.value;
@@ -74,8 +76,9 @@ const bindMouseDown = ({
74
76
  } else {
75
77
  isClickBar = hasClass(handleEl, constants.sliderCls(mode)) || hasClass(handleEl, constants.rangeCls(mode));
76
78
  isClickBtn = hasClass(handleEl, constants.buttonCls(mode)) || hasClass(handleEl, constants.leftSvgCls(mode)) || hasClass(handleEl, constants.rightSvgCls(mode));
79
+ isClickLabel = hasClass(handleEl, constants.PC_LABEL_CLS);
77
80
  }
78
- if (state.disabled || !isClickBtn && !isClickBar) {
81
+ if (state.disabled || !isClickBtn && !isClickBar && !isClickLabel) {
79
82
  state.activeIndex = -1;
80
83
  return;
81
84
  }
@@ -85,7 +88,7 @@ const bindMouseDown = ({
85
88
  on(window, "touchmove", api.bindMouseMove);
86
89
  state.isDrag = isClickBtn;
87
90
  isClickBtn && (state.activeIndex = api.getActiveButtonIndex(event));
88
- if (isClickBar) {
91
+ if (isClickBar || isClickLabel) {
89
92
  const currentValue = api.calculateValue(event);
90
93
  if (state.isDouble) {
91
94
  if (Math.abs(currentValue - state.leftBtnValue) > Math.abs(state.rightBtnValue - currentValue)) {
@@ -98,6 +101,9 @@ const bindMouseDown = ({
98
101
  api.setButtonStyle();
99
102
  api.setBarStyle();
100
103
  emit("stop", api.getActiveButtonValue());
104
+ if (!props.changeCompat) {
105
+ emit("change", api.getActiveButtonValue());
106
+ }
101
107
  }
102
108
  };
103
109
  const bindMouseMove = ({ api, nextTick, state }) => (event) => {
@@ -111,7 +117,7 @@ const bindMouseMove = ({ api, nextTick, state }) => (event) => {
111
117
  api.setTipStyle();
112
118
  });
113
119
  };
114
- const bindMouseUp = ({ api, emit, state }) => () => {
120
+ const bindMouseUp = ({ api, emit, state, props }) => () => {
115
121
  if (state.disabled || !state.isDrag) {
116
122
  return;
117
123
  }
@@ -124,6 +130,9 @@ const bindMouseUp = ({ api, emit, state }) => () => {
124
130
  off(window, "touchend", api.bindMouseUp);
125
131
  off(window, "touchmove", api.bindMouseMove);
126
132
  emit("stop", api.getActiveButtonValue());
133
+ if (!props.changeCompat) {
134
+ emit("change", api.getActiveButtonValue());
135
+ }
127
136
  };
128
137
  const displayTip = ({ api, nextTick, state }) => (event) => {
129
138
  state.mouseOuterBtn = false;
@@ -285,12 +294,9 @@ const initSlider = ({ api, props, state }) => (value) => {
285
294
  state.rightBtnValue = Math.min(Number(item), props.max);
286
295
  state.rightBtnShow = true;
287
296
  }
288
- if (state.isInit) {
289
- api.changeActiveValue(index === 0);
290
- }
297
+ api.changeActiveValue(index === 0);
291
298
  api.setButtonStyle();
292
299
  });
293
- state.isInit = false;
294
300
  api.setBarStyle();
295
301
  };
296
302
  const calculateValue = ({ props, state, vm }) => (event) => {
@@ -369,13 +375,9 @@ const watchActiveValue = ({ api, emit, props, state }) => (newValue, oldValue) =
369
375
  } else {
370
376
  state.activeValue = nNewValue || 0;
371
377
  }
372
- if (!state.isSlotTyping) {
373
- state.slotValue = state.activeValue;
374
- }
375
378
  };
376
379
  const watchModelValue = ({ api, state }) => (value) => {
377
380
  if (!state.innerTrigger) {
378
- state.isInit = true;
379
381
  api.initSlider(value);
380
382
  api.setActiveButtonValue(value);
381
383
  } else {
@@ -385,6 +387,9 @@ const watchModelValue = ({ api, state }) => (value) => {
385
387
  api.setActiveButtonValue(value);
386
388
  }
387
389
  }
390
+ if (!state.isSlotTyping) {
391
+ api.updateSlotValue();
392
+ }
388
393
  };
389
394
  const getPoints = ({ props, state }) => () => {
390
395
  if (props.showSteps && props.step > 0) {
@@ -415,7 +420,28 @@ const getLabels = ({ props, state }) => () => {
415
420
  }
416
421
  }
417
422
  };
418
- const inputValueChange = ({ props, state, api }) => ($event, pos) => {
423
+ const getMarkList = ({ props }) => () => {
424
+ const markList = [];
425
+ if (!props.marks) {
426
+ return markList;
427
+ }
428
+ for (const [key, label] of Object.entries(props.marks)) {
429
+ const markValue = Number(key);
430
+ if (markValue >= props.min && markValue <= props.max) {
431
+ const percent = (markValue - props.min) / (props.max - props.min);
432
+ markList.push({
433
+ value: markValue,
434
+ label,
435
+ percent,
436
+ positionStyle: {
437
+ [props.vertical ? "bottom" : "left"]: percent * 100 + "%"
438
+ }
439
+ });
440
+ }
441
+ }
442
+ return markList;
443
+ };
444
+ const inputValueChange = ({ props, state, api, emit }) => ($event, pos) => {
419
445
  if (props.disabled || !state.isDouble)
420
446
  return;
421
447
  if (!/^\d+$/.test($event.target.value)) {
@@ -427,16 +453,40 @@ const inputValueChange = ({ props, state, api }) => ($event, pos) => {
427
453
  return;
428
454
  }
429
455
  api.initSlider([Math.min(...state.inputValue), Math.max(...state.inputValue)]);
456
+ if (!props.changeCompat) {
457
+ emit("change", api.getActiveButtonValue());
458
+ }
430
459
  };
431
460
  const handleSlotInputFocus = (state) => () => {
432
461
  state.isSlotTyping = true;
433
462
  };
434
- const handleSlotInputBlur = (state) => () => {
463
+ const handleSlotInputBlur = ({ state, api }) => () => {
435
464
  state.isSlotTyping = false;
436
- state.slotValue = state.activeValue;
465
+ api.updateSlotValue();
437
466
  };
438
- const handleSlotInput = (state) => (event) => {
439
- state.activeValue = Number(event.target.value);
467
+ const updateSlotValue = ({ state }) => () => {
468
+ if (!state.isDouble) {
469
+ state.slotValue = state.activeValue;
470
+ } else {
471
+ state.slotValue = state.activeIndex === 0 ? [state.activeValue, state.rightBtnValue] : [state.leftBtnValue, state.activeValue];
472
+ }
473
+ };
474
+ const handleSlotInput = ({ state, api }) => (event, isLeftInput = true) => {
475
+ const inputValue = event.target.value;
476
+ api.changeActiveValue(state.isDouble ? isLeftInput : true);
477
+ state.activeValue = Number(inputValue);
478
+ api.updateSlotValue();
479
+ };
480
+ const inputOnChange = ({ api, emit, props, state }) => (event) => {
481
+ if (!props.changeCompat) {
482
+ if (!/^\d+$/.test(event.target.value)) {
483
+ state.activeValue = state.leftBtnValue;
484
+ return;
485
+ }
486
+ const value = toNumber(state.activeValue) || 0;
487
+ api.autoSlider(value);
488
+ emit("change", api.getActiveButtonValue());
489
+ }
440
490
  };
441
491
  export {
442
492
  autoSlider,
@@ -456,18 +506,21 @@ export {
456
506
  getActiveButtonIndex,
457
507
  getActiveButtonValue,
458
508
  getLabels,
509
+ getMarkList,
459
510
  getPoints,
460
511
  handleSlotInput,
461
512
  handleSlotInputBlur,
462
513
  handleSlotInputFocus,
463
514
  hideTip,
464
515
  initSlider,
516
+ inputOnChange,
465
517
  inputValueChange,
466
518
  setActiveButtonValue,
467
519
  setBarStyle,
468
520
  setButtonStyle,
469
521
  setTipStyle,
470
522
  unBindEvent,
523
+ updateSlotValue,
471
524
  watchActiveValue,
472
525
  watchModelValue
473
526
  };
package/slider/vue.js CHANGED
@@ -28,9 +28,12 @@ import {
28
28
  getPoints,
29
29
  getLabels,
30
30
  inputValueChange,
31
+ inputOnChange,
31
32
  handleSlotInputFocus,
32
33
  handleSlotInputBlur,
33
- handleSlotInput
34
+ handleSlotInput,
35
+ getMarkList,
36
+ updateSlotValue
34
37
  } from "./index";
35
38
  const api = [
36
39
  "state",
@@ -58,6 +61,7 @@ const api = [
58
61
  "customAppearHook",
59
62
  "customAfterAppearHook",
60
63
  "inputValueChange",
64
+ "inputOnChange",
61
65
  "handleSlotInputFocus",
62
66
  "handleSlotInputBlur",
63
67
  "handleSlotInput"
@@ -70,7 +74,7 @@ const initState = ({ reactive, computed, props, api: api2, parent, inject }) =>
70
74
  moveStyle: [],
71
75
  points: [],
72
76
  labels: [],
73
- isInit: true,
77
+ markList: computed(() => api2.getMarkList()),
74
78
  inputValue: [0, 0],
75
79
  isDrag: false,
76
80
  sliderSize: 0,
@@ -88,6 +92,7 @@ const initState = ({ reactive, computed, props, api: api2, parent, inject }) =>
88
92
  rightBtnPercent: 0,
89
93
  rightBtnShow: false,
90
94
  innerTrigger: false,
95
+ changeCompat: computed(() => props.changeCompat),
91
96
  rangeDiff: computed(() => props.max - props.min),
92
97
  tipValue: computed(() => api2.formatTipValue(state.activeValue)),
93
98
  formDisabled: computed(() => (parent.tinyForm || {}).disabled),
@@ -122,19 +127,22 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
122
127
  unBindEvent: unBindEvent(api2),
123
128
  displayTip: displayTip({ api: api2, nextTick, state }),
124
129
  bindKeyDown: bindKeyDown({ api: api2, props, state }),
125
- bindMouseUp: bindMouseUp({ api: api2, emit, state }),
130
+ bindMouseUp: bindMouseUp({ api: api2, emit, state, props }),
126
131
  bindMouseMove: bindMouseMove({ api: api2, nextTick, state }),
127
- bindMouseDown: bindMouseDown({ api: api2, constants, mode, emit, state }),
132
+ bindMouseDown: bindMouseDown({ api: api2, constants, mode, emit, state, props }),
128
133
  setActiveButtonValue: setActiveButtonValue({ api: api2, emit, props, state }),
129
134
  initSlider: initSlider({ api: api2, props, state }),
130
135
  watchModelValue: watchModelValue({ api: api2, state }),
131
136
  watchActiveValue: watchActiveValue({ api: api2, emit, props, state }),
132
137
  getPoints: getPoints({ props, state }),
133
138
  getLabels: getLabels({ props, state }),
134
- inputValueChange: inputValueChange({ props, api: api2, state }),
139
+ inputValueChange: inputValueChange({ props, api: api2, state, emit }),
135
140
  handleSlotInputFocus: handleSlotInputFocus(state),
136
- handleSlotInputBlur: handleSlotInputBlur(state),
137
- handleSlotInput: handleSlotInput(state)
141
+ handleSlotInputBlur: handleSlotInputBlur({ state, api: api2 }),
142
+ handleSlotInput: handleSlotInput({ state, api: api2 }),
143
+ getMarkList: getMarkList({ props }),
144
+ updateSlotValue: updateSlotValue({ state }),
145
+ inputOnChange: inputOnChange({ api: api2, emit, props, state })
138
146
  });
139
147
  watch(
140
148
  () => props.modelValue,
@@ -146,6 +154,7 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
146
154
  },
147
155
  { immediate: true }
148
156
  );
157
+ props.changeCompat && watch(() => state.activeValue, api2.watchActiveValue, { immediate: true });
149
158
  watch(() => state.activeValue, api2.watchActiveValue, { immediate: true });
150
159
  watch(
151
160
  () => props.min,
package/split/index.js CHANGED
@@ -44,7 +44,7 @@ const handleUp = ({ api, emit, off, state }) => () => {
44
44
  emit("moveend");
45
45
  };
46
46
  const handleMousedown = ({ api, emit, on, props, state, vm }) => (event) => {
47
- if (state.dragable) {
47
+ if (!props.disabled) {
48
48
  state.initOffset = state.isHorizontal ? event.pageX : event.pageY;
49
49
  if (state.offset === 0) {
50
50
  state.oldOffset = 0;
@@ -95,8 +95,10 @@ const buttonRightBottomClick = ({ emit, props, state }) => () => {
95
95
  };
96
96
  const computeOffset = ({ api, nextTick, props, vm, state }) => () => {
97
97
  setTimeout(() => {
98
- state.totalPane = vm.$refs.outerWrapper[state.offsetSize];
99
- state.leftTopPane = state.totalPane * (state.offset / 100);
98
+ if (state) {
99
+ state.totalPane = vm.$refs.outerWrapper[state.offsetSize];
100
+ state.leftTopPane = state.totalPane * (state.offset / 100);
101
+ }
100
102
  });
101
103
  if (state.valueIsPx) {
102
104
  nextTick(() => {
package/split/vue.js CHANGED
@@ -32,12 +32,10 @@ const renderless = (props, hooks, { vm, nextTick, emit, constants }) => {
32
32
  computedleftTopMin: computed(() => api2.getComputedThresholdValue("leftTopMin")),
33
33
  computedrightBottomMin: computed(() => api2.getComputedThresholdValue("rightBottomMin")),
34
34
  wrapperClasses: computed(() => [`${state.prefix}-wrapper`, state.isMoving ? "no-select" : ""]),
35
- paneClasses: computed(() => [`${state.prefix}-pane`, { [`${state.prefix}-pane-moving`]: state.isMoving }]),
36
- dragable: !props.disabled,
37
- triggerSimple: props.triggerSimple,
38
- collapseLeftTop: props.collapseLeftTop,
39
- collapseRightBottom: props.collapseRightBottom,
40
- isThreeAreas: props.threeAreas
35
+ paneClasses: computed(() => [
36
+ `${state.prefix}-pane ${props.scrollable ? "tiny-split-scroll" : ""}`,
37
+ { [`${state.prefix}-pane-moving`]: state.isMoving }
38
+ ])
41
39
  }, getUseOffset.state));
42
40
  Object.assign(api2, __spreadProps(__spreadValues({
43
41
  state,
@@ -1,4 +1,7 @@
1
- import "../chunk-G2ADBYYC.js";
1
+ import {
2
+ __spreadProps,
3
+ __spreadValues
4
+ } from "../chunk-G2ADBYYC.js";
2
5
  const handleEnterDesc = ({ state, props }) => ($event) => {
3
6
  const target = $event.target;
4
7
  if (target && target.scrollHeight > target.offsetHeight) {
@@ -17,7 +20,18 @@ const handleTitleClick = ({ props }) => () => {
17
20
  return;
18
21
  props.titleOption.click();
19
22
  };
23
+ const computedOptions = ({ props }) => () => {
24
+ return props.options.filter((item) => {
25
+ const hidden = typeof item.hidden === "function" ? item.hidden(props.data) : item.hidden;
26
+ return !hidden;
27
+ }).map((op) => {
28
+ return __spreadProps(__spreadValues({}, op), {
29
+ disabled: typeof op.disabled === "function" ? op.disabled(props.data) : op.disabled
30
+ });
31
+ });
32
+ };
20
33
  export {
34
+ computedOptions,
21
35
  handelIconClick,
22
36
  handleEnterDesc,
23
37
  handleTitleClick
@@ -1,19 +1,20 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- import { handleEnterDesc, handelIconClick, handleTitleClick } from "./index";
3
- const api = ["state", "handelIconClick", "handleEnterDesc", "handleTitleClick"];
2
+ import { handleEnterDesc, handelIconClick, handleTitleClick, computedOptions } from "./index";
3
+ const api = ["state", "handelIconClick", "handleEnterDesc", "handleTitleClick", "computedOptions"];
4
4
  const renderless = (props, { computed, reactive }, { emit }) => {
5
+ const api2 = {};
5
6
  const state = reactive({
6
7
  descTooltip: "",
7
8
  sliceNum: 2,
8
9
  iconNum: 3,
9
- effectOptions: computed(() => props.options.filter((item) => !item.hidden))
10
+ effectOptions: computed(() => api2.computedOptions())
10
11
  });
11
- const api2 = {};
12
12
  Object.assign(api2, {
13
13
  state,
14
14
  handleTitleClick: handleTitleClick({ props }),
15
15
  handelIconClick: handelIconClick({ emit }),
16
- handleEnterDesc: handleEnterDesc({ state, props })
16
+ handleEnterDesc: handleEnterDesc({ state, props }),
17
+ computedOptions: computedOptions({ props })
17
18
  });
18
19
  return api2;
19
20
  };
package/steps/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
+ import { omitText } from "../common/string";
2
3
  const updateStartIndex = ({ state, props }) => () => {
3
4
  const { visibleNum, active } = props;
4
5
  const maxStartIndex = Math.min(props.data.length - visibleNum, active - Math.floor(visibleNum / 2));
@@ -23,9 +24,29 @@ const computedRightNodePos = ({ state, props }) => () => {
23
24
  right: -(index + 1) * 4 + "px"
24
25
  }));
25
26
  };
27
+ const handleMouseenter = ({ state, vm }) => (e, placement) => {
28
+ const ele = e.target;
29
+ const text = ele.textContent;
30
+ const font = window.getComputedStyle(ele).font;
31
+ const rect = ele.getBoundingClientRect();
32
+ const res = omitText(text, font, rect.width);
33
+ const popover = vm.$refs.popover;
34
+ if (res.o) {
35
+ popover.state.referenceElm = ele;
36
+ popover.state.popperElm && (popover.state.popperElm.style.display = "none");
37
+ popover.doDestroy();
38
+ state.popoverContent = text;
39
+ state.popoverVisible = true;
40
+ state.popoverPlacement = placement;
41
+ setTimeout(popover.updatePopper, 20);
42
+ }
43
+ };
44
+ const handleMouseleave = (state) => () => {
45
+ state.popoverVisible = false;
46
+ };
26
47
  const computedSpace = ({ props }) => {
27
- const { space } = props;
28
- if (/^\d+$/.test(space)) {
48
+ const { space = "" } = props;
49
+ if (/^\d+$/.test(String(space))) {
29
50
  return `${space}px`;
30
51
  }
31
52
  return space;
@@ -33,6 +54,8 @@ const computedSpace = ({ props }) => {
33
54
  export {
34
55
  computedRightNodePos,
35
56
  computedSpace,
57
+ handleMouseenter,
58
+ handleMouseleave,
36
59
  isVisibleHandler,
37
60
  updateStartIndex
38
61
  };
@@ -45,7 +45,14 @@ const rightSlideHandler = ({ state, api: api2 }) => () => {
45
45
  const updatePosition = ({ state, vm, props, api: api2 }) => debounce(10, (isInit) => {
46
46
  state.positionList = props.data.map((item, index) => {
47
47
  const blockRef = vm.$refs["block" + index];
48
- const position = blockRef && blockRef[0].getBoundingClientRect() || {};
48
+ let position = {};
49
+ if (blockRef) {
50
+ if (Array.isArray(blockRef)) {
51
+ position = blockRef[0] && blockRef[0].getBoundingClientRect();
52
+ } else {
53
+ position = blockRef.getBoundingClientRect();
54
+ }
55
+ }
49
56
  return Object.assign(position, { index });
50
57
  });
51
58
  state.slideMainPostion = vm.$refs.slideMain.getBoundingClientRect();
package/steps/vue.js CHANGED
@@ -1,9 +1,19 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- import { updateStartIndex, isVisibleHandler, computedRightNodePos, computedSpace } from "./index";
3
- const api = ["state", "isVisibleHandler"];
4
- const renderless = (props, { reactive, watch, computed }) => {
2
+ import {
3
+ updateStartIndex,
4
+ isVisibleHandler,
5
+ computedRightNodePos,
6
+ computedSpace,
7
+ handleMouseenter,
8
+ handleMouseleave
9
+ } from "./index";
10
+ const api = ["state", "isVisibleHandler", "handleMouseenter", "handleMouseleave"];
11
+ const renderless = (props, { reactive, watch, computed }, { vm }) => {
5
12
  const state = reactive({
6
13
  startIndex: 0,
14
+ popoverVisible: false,
15
+ popoverContent: "",
16
+ popoverPlacement: "top",
7
17
  endIndex: computed(() => state.startIndex + props.visibleNum),
8
18
  rightNodePositions: computed(() => api2.computedRightNodePos()),
9
19
  computedSpace: computed(() => computedSpace({ props }))
@@ -12,6 +22,8 @@ const renderless = (props, { reactive, watch, computed }) => {
12
22
  state,
13
23
  updateStartIndex: updateStartIndex({ state, props }),
14
24
  isVisibleHandler: isVisibleHandler({ state, props }),
25
+ handleMouseenter: handleMouseenter({ state, vm }),
26
+ handleMouseleave: handleMouseleave(state),
15
27
  computedRightNodePos: computedRightNodePos({ state, props })
16
28
  };
17
29
  watch(() => props.active, api2.updateStartIndex, { immediate: true });
@@ -1,14 +1,20 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- const renderless = (props, { inject }, { slots }) => {
2
+ const renderless = (props, { inject, onBeforeUnmount, reactive, toRef, markRaw }, { slots, vm }) => {
3
3
  const tabs = inject("tabs", null);
4
- const { title, name } = props;
5
- const item = { title, name, slotDefault: slots.default, slotTitle: slots.title, slotSetting: slots.setting };
6
- if (props.renderTitle)
7
- item.slotTitle = props.renderTitle;
8
- if (props.renderSetting)
9
- item.slotSetting = props.renderSetting;
10
- item.selected = (tabs.activeName || tabs.modelValue) === name;
4
+ const { lazy } = props;
5
+ const item = reactive({
6
+ title: toRef(props, "title"),
7
+ name: toRef(props, "name"),
8
+ slotDefault: slots.default,
9
+ slotTitle: props.renderTitle ? toRef(props, "renderTitle") : slots.title,
10
+ slotSetting: props.renderSetting ? toRef(props, "renderSetting") : slots.setting,
11
+ lazy,
12
+ selected: false,
13
+ vm: markRaw(vm)
14
+ });
15
+ item.selected = (tabs.activeName || tabs.modelValue) === item.name;
11
16
  tabs.addItem(item);
17
+ onBeforeUnmount(() => tabs.removeItem(item.name, true));
12
18
  return {};
13
19
  };
14
20
  export {
package/tab-nav/index.js CHANGED
@@ -6,8 +6,10 @@ import { on, off } from "../common/deps/dom";
6
6
  const computedNavStyle = (state) => {
7
7
  const dir = ~[POSITION.Top, POSITION.Bottom].indexOf(state.rootTabs.position) ? "X" : "Y";
8
8
  if (state.mode === "mobile") {
9
+ const { offset, width } = state.lineStyle;
9
10
  return {
10
- transform: `translate${dir}(${state.lineOffset}px) translate${dir}(-50%)`
11
+ width: `${width}px`,
12
+ transform: `translate${dir}(${offset}px) translate${dir}(-50%)`
11
13
  };
12
14
  } else {
13
15
  return {
@@ -28,7 +30,9 @@ const scrollIntoView = ({ parent, vm, state }) => () => {
28
30
  const from = nav.scrollLeft;
29
31
  if (state.mode === "mobile") {
30
32
  nav.scrollLeft += to - from;
31
- state.lineOffset = activeTab.offsetLeft + activeTab.offsetWidth / 2;
33
+ const nameHtml = activeTab.querySelector(".tiny-mobile-tabs__name");
34
+ state.lineStyle.width = nameHtml.offsetWidth;
35
+ state.lineStyle.offset = activeTab.offsetLeft + activeTab.offsetWidth / 2;
32
36
  }
33
37
  };
34
38
  const computedSizeName = (state) => ~[POSITION.Top, POSITION.Bottom].indexOf(state.rootTabs.position) ? "width" : "height";
@@ -43,9 +47,10 @@ const updated = ({ api, vm, state }) => () => {
43
47
  navSize += item.offsetWidth;
44
48
  }
45
49
  if (item.classList && item.classList.contains("is-active")) {
46
- const line = item.querySelector(".tiny-mobile-tabs__name");
50
+ const nameHtml = item.querySelector(".tiny-mobile-tabs__name");
47
51
  state.isActive = true;
48
- state.lineOffset = item.offsetLeft + item.offsetWidth / 2;
52
+ state.lineStyle.width = nameHtml.offsetWidth;
53
+ state.lineStyle.offset = item.offsetLeft + item.offsetWidth / 2;
49
54
  }
50
55
  });
51
56
  }
@@ -281,7 +286,7 @@ const sortableEvent = ({
281
286
  onStart(event) {
282
287
  api.handleTabDragStart(event);
283
288
  },
284
- onEnd(event) {
289
+ onEnd() {
285
290
  api.handleTabDragEnd();
286
291
  }
287
292
  });
@@ -295,6 +300,24 @@ const watchCurrentName = ({ nextTick, vm, state }) => () => {
295
300
  }
296
301
  });
297
302
  };
303
+ const handleTitleMouseenter = ({ state, vm }) => (e, title) => {
304
+ const dom = e.target;
305
+ if (dom && dom.scrollWidth > dom.offsetWidth) {
306
+ const tooltip = vm.$refs.tooltip;
307
+ tooltip.state.referenceElm = dom;
308
+ tooltip.state.popperElm && (tooltip.state.popperElm.style.display = "none");
309
+ tooltip.doDestroy();
310
+ state.tooltipContent = title;
311
+ state.tooltipVisible = true;
312
+ setTimeout(tooltip.updatePopper, 20);
313
+ }
314
+ };
315
+ const handleTitleMouseleave = ({ state }) => () => {
316
+ state.tooltipVisible = false;
317
+ setTimeout(() => {
318
+ state.tooltipContent = "";
319
+ }, 20);
320
+ };
298
321
  export {
299
322
  beforeUnmount,
300
323
  changeTab,
@@ -305,6 +328,8 @@ export {
305
328
  expandTabShow,
306
329
  handleTabDragEnd,
307
330
  handleTabDragStart,
331
+ handleTitleMouseenter,
332
+ handleTitleMouseleave,
308
333
  moreTabShow,
309
334
  mounted,
310
335
  removeFocus,
package/tab-nav/vue.js CHANGED
@@ -22,7 +22,9 @@ import {
22
22
  sortableEvent,
23
23
  handleTabDragStart,
24
24
  handleTabDragEnd,
25
- watchCurrentName
25
+ watchCurrentName,
26
+ handleTitleMouseenter,
27
+ handleTitleMouseleave
26
28
  } from "./index";
27
29
  const api = [
28
30
  "state",
@@ -37,19 +39,27 @@ const api = [
37
39
  "expandTabShow",
38
40
  "expandTabHide",
39
41
  "computedHeaderStyle",
40
- "swiperHandle"
42
+ "swiperHandle",
43
+ "updated",
44
+ "handleTitleMouseenter",
45
+ "handleTitleMouseleave"
41
46
  ];
42
47
  const renderless = (props, { computed, inject, onBeforeUnmount, onMounted, onUpdated, reactive, markRaw }, { parent, vm, nextTick, mode: tinyMode, emit }) => {
43
48
  const api2 = { mounted, beforeUnmount, computedNavStyle, computedSizeName };
44
49
  const state = reactive({
45
50
  dragging: false,
46
51
  navOffset: 0,
47
- lineOffset: 0,
52
+ lineStyle: {
53
+ width: 20,
54
+ offset: 0
55
+ },
48
56
  scrollable: false,
49
57
  isFocus: false,
50
58
  focusable: false,
51
59
  showMoreItem: false,
52
60
  isActive: false,
61
+ tooltipVisible: false,
62
+ tooltipContent: "",
53
63
  showMoreTabs: props.showMoreTabs,
54
64
  showExpandItem: false,
55
65
  showExpandTabs: props.showExpandTabs,
@@ -79,7 +89,9 @@ const renderless = (props, { computed, inject, onBeforeUnmount, onMounted, onUpd
79
89
  watchCurrentName: watchCurrentName({ nextTick, vm, state }),
80
90
  handleTabDragStart: handleTabDragStart({ state, vm, emit }),
81
91
  handleTabDragEnd: handleTabDragEnd({ state, vm, nextTick }),
82
- sortableEvent: sortableEvent({ api: api2, props, state, vm, emit, markRaw })
92
+ sortableEvent: sortableEvent({ api: api2, props, state, vm, emit, markRaw }),
93
+ handleTitleMouseenter: handleTitleMouseenter({ state, vm }),
94
+ handleTitleMouseleave: handleTitleMouseleave({ state })
83
95
  });
84
96
  Object.assign(api2, { updated: updated({ api: api2, vm, state }), changeTab: changeTab(api2) });
85
97
  onUpdated(() => api2.updated());
package/tabbar/vue.js CHANGED
@@ -2,7 +2,7 @@ import "../chunk-G2ADBYYC.js";
2
2
  import { setActiveItem, onChange, getChildrens, getItems, beforeDestroy, initPage } from "./index";
3
3
  import { on } from "../common/deps/dom";
4
4
  const api = ["state", "onChange", "getChildrens"];
5
- const renderless = (props, { computed, onMounted, reactive, watch, onBeforeUnmount }, { vm, emit, nextTick, childrenHandler }) => {
5
+ const renderless = (props, { computed, onMounted, reactive, watch, onBeforeUnmount, provide }, { vm, emit, nextTick, childrenHandler }) => {
6
6
  const api2 = {};
7
7
  const state = reactive({
8
8
  height: null,
@@ -11,7 +11,8 @@ const renderless = (props, { computed, onMounted, reactive, watch, onBeforeUnmou
11
11
  activeItem: false,
12
12
  showIndex: 0,
13
13
  showNumber: computed(() => props.showNumber > 0 ? props.showNumber : -1),
14
- tabbarWidth: null
14
+ tabbarWidth: null,
15
+ itemList: computed(() => props.itemList || [])
15
16
  });
16
17
  Object.assign(api2, {
17
18
  state,
@@ -25,12 +26,17 @@ const renderless = (props, { computed, onMounted, reactive, watch, onBeforeUnmou
25
26
  });
26
27
  onMounted(() => {
27
28
  on(window, "resize", api2.initPage);
28
- state.tabbarWidth = vm.$refs && vm.$refs.tabbar.offsetWidth;
29
+ state.tabbarWidth = vm.$refs.tabbar && vm.$refs.tabbar.offsetWidth;
29
30
  if (props.placeholder && props.fixed) {
30
31
  nextTick(() => {
31
32
  state.height = vm.$refs.tabbar.getBoundingClientRect().height;
32
33
  });
33
34
  }
35
+ state.itemList.forEach((item) => {
36
+ if (item.customIcon) {
37
+ provide("customIcon", item.customIcon);
38
+ }
39
+ });
34
40
  });
35
41
  vm.$on("updateItems", api2.getItems);
36
42
  vm.$on("activeItem", api2.onChange);