@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
@@ -27,12 +27,11 @@ class TreeStore {
27
27
  }
28
28
  }
29
29
  filter(value) {
30
- const { lazy, getMappingData, filterNodeMethod } = this;
30
+ const { lazy, filterNodeMethod } = this;
31
31
  const walkTree = (node) => {
32
32
  const childNodes = node.root ? node.root.childNodes : node.childNodes;
33
33
  childNodes.forEach((child) => {
34
- const mappingData = getMappingData.call(this, child.data);
35
- child.visible = filterNodeMethod.call(child, value, mappingData, child);
34
+ child.visible = filterNodeMethod.call(child, value, child.data, child);
36
35
  walkTree(child);
37
36
  });
38
37
  if (!node.visible && childNodes.length) {
@@ -52,16 +51,6 @@ class TreeStore {
52
51
  };
53
52
  walkTree(this);
54
53
  }
55
- getMappingData(data) {
56
- const props = this.props || {};
57
- const mapping = {};
58
- Object.keys(props).forEach((key) => {
59
- if (hasOwn.call(props, key)) {
60
- mapping[key] = data[props[key]];
61
- }
62
- });
63
- return Object.assign(data, mapping);
64
- }
65
54
  setData(newVal) {
66
55
  if (newVal !== this.root.data) {
67
56
  this.root.setData(newVal);
@@ -0,0 +1,25 @@
1
+ import "../../chunk-G2ADBYYC.js";
2
+ const isWindow = (val) => val === window;
3
+ const makeDOMRect = (width, height) => ({
4
+ top: 0,
5
+ left: 0,
6
+ width,
7
+ right: width,
8
+ height,
9
+ bottom: height
10
+ });
11
+ const useRect = (unref) => (elOrRef) => {
12
+ const el = unref(elOrRef);
13
+ if (isWindow(el)) {
14
+ const width = el.innerWidth;
15
+ const height = el.innerHeight;
16
+ return makeDOMRect(width, height);
17
+ }
18
+ if (el && el.getBoundingClientRect) {
19
+ return el.getBoundingClientRect();
20
+ }
21
+ return makeDOMRect(0, 0);
22
+ };
23
+ export {
24
+ useRect
25
+ };
@@ -3,16 +3,11 @@ import {
3
3
  } from "../../chunk-G2ADBYYC.js";
4
4
  import PopupManager from "./popup-manager";
5
5
  import PopperJS from "./popper";
6
- import { on } from "./dom";
6
+ import { on, off, isDisplayNone } from "./dom";
7
7
  const stop = (e) => e.stopPropagation();
8
8
  const isServer = typeof window === "undefined";
9
- const getReference = ({
10
- state,
11
- props,
12
- refs,
13
- slots
14
- }) => {
15
- let reference = state.referenceElm || props.reference || refs.reference && refs.reference.$el || refs.reference;
9
+ const getReference = ({ state, props, vm, slots }) => {
10
+ let reference = state.referenceElm || props.reference || vm.$refs.reference && vm.$refs.reference.$el || vm.$refs.reference;
16
11
  if (!reference && slots.reference && slots.reference()[0]) {
17
12
  state.referenceElm = slots.reference()[0].elm || slots.reference()[0].el;
18
13
  reference = state.referenceElm;
@@ -20,7 +15,20 @@ const getReference = ({
20
15
  return reference;
21
16
  };
22
17
  var vue_popper_default = (options) => {
23
- const { parent, emit, nextTick, onBeforeUnmount, onDeactivated, props, watch, reactive, refs, slots, toRefs } = options;
18
+ const {
19
+ parent,
20
+ emit,
21
+ nextTick,
22
+ onBeforeUnmount,
23
+ onDeactivated,
24
+ props,
25
+ watch,
26
+ reactive,
27
+ vm,
28
+ slots,
29
+ toRefs,
30
+ popperVmRef
31
+ } = options;
24
32
  const state = reactive({
25
33
  popperJS: null,
26
34
  appended: false,
@@ -43,11 +51,11 @@ var vue_popper_default = (options) => {
43
51
  const followHide = (popperInstance) => {
44
52
  const { followReferenceHide = true } = (props == null ? void 0 : props.popperOptions) || {};
45
53
  const { _popper: popper, _reference: reference } = popperInstance;
46
- if (followReferenceHide && getComputedStyle(reference).position !== "fixed" && reference.offsetParent === null) {
54
+ if (followReferenceHide && isDisplayNone(reference)) {
47
55
  popper.style.display = "none";
48
56
  }
49
57
  };
50
- const createPopper = () => {
58
+ const createPopper = (dom) => {
51
59
  if (isServer) {
52
60
  return;
53
61
  }
@@ -55,10 +63,10 @@ var vue_popper_default = (options) => {
55
63
  if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(state.currentPlacement)) {
56
64
  return;
57
65
  }
58
- const options2 = props.popperOptions || {};
59
- state.popperElm = state.popperElm || props.popper || refs.popper;
66
+ const options2 = props.popperOptions || { gpuAcceleration: false };
67
+ state.popperElm = state.popperElm || props.popper || vm.$refs.popper || popperVmRef.popper || dom;
60
68
  const popper = state.popperElm;
61
- let reference = getReference({ state, props, refs, slots });
69
+ let reference = getReference({ state, props, vm, slots });
62
70
  if (!popper || !reference || reference.nodeType !== Node.ELEMENT_NODE) {
63
71
  return;
64
72
  }
@@ -75,6 +83,7 @@ var vue_popper_default = (options) => {
75
83
  options2.offset = props.offset || 0;
76
84
  options2.arrowOffset = props.arrowOffset || 0;
77
85
  options2.adjustArrow = props.adjustArrow || false;
86
+ options2.appendToBody = props.appendToBody || props.popperAppendToBody;
78
87
  state.popperJS = new PopperJS(reference, popper, options2);
79
88
  emit("created", state);
80
89
  if (typeof options2.onUpdate === "function") {
@@ -84,15 +93,19 @@ var vue_popper_default = (options) => {
84
93
  followHide(state.popperJS);
85
94
  on(state.popperElm, "click", stop);
86
95
  };
87
- const updatePopper = (popperElm) => {
88
- if (popperElm) {
89
- state.popperElm = popperElm;
96
+ const updatePopper = (popperElmOrTrue) => {
97
+ if (popperElmOrTrue && popperElmOrTrue !== true) {
98
+ state.popperElm = popperElmOrTrue;
90
99
  }
91
100
  const popperJS = state.popperJS;
92
101
  if (popperJS) {
93
102
  popperJS.update();
103
+ if (popperJS._popper && popperElmOrTrue !== true) {
104
+ popperJS._popper.style.zIndex = PopupManager.nextZIndex().toString();
105
+ followHide(state.popperJS);
106
+ }
94
107
  } else {
95
- createPopper();
108
+ createPopper(popperElmOrTrue && popperElmOrTrue !== true ? popperElmOrTrue : void 0);
96
109
  }
97
110
  };
98
111
  const doDestroy = (forceDestroy) => {
@@ -105,6 +118,7 @@ var vue_popper_default = (options) => {
105
118
  const destroyPopper = (remove) => {
106
119
  if (remove) {
107
120
  if (state.popperElm) {
121
+ off(state.popperElm, "click", stop);
108
122
  state.popperElm.remove();
109
123
  }
110
124
  }
@@ -124,12 +138,16 @@ var vue_popper_default = (options) => {
124
138
  onBeforeUnmount(() => {
125
139
  nextTick(() => {
126
140
  doDestroy(true);
127
- destroyPopper("remove");
141
+ if (props.appendToBody || props.popperAppendToBody) {
142
+ destroyPopper("remove");
143
+ }
128
144
  });
129
145
  });
130
146
  onDeactivated(() => {
131
147
  doDestroy(true);
132
- destroyPopper("remove");
148
+ if (props.appendToBody || props.popperAppendToBody) {
149
+ destroyPopper("remove");
150
+ }
133
151
  });
134
152
  return __spreadValues({ updatePopper, destroyPopper, doDestroy }, toRefs(state));
135
153
  };
package/common/index.js CHANGED
@@ -182,7 +182,7 @@ const DATEPICKER = {
182
182
  queryClass: ".tiny-picker-panel__content",
183
183
  disableClass: ".time-select-item:not(.disabled)",
184
184
  defaultClass: ".default",
185
- Qurtyli: "li",
185
+ Qurtyli: '[data-tag="li"]',
186
186
  MappingKeyCode: { 40: 1, 38: -1 },
187
187
  DatePicker: "DatePicker",
188
188
  TimePicker: "TimePicker"
@@ -224,7 +224,7 @@ const CASCADER = {
224
224
  PropsHover: "hoverThreshold",
225
225
  MenuConnector: "cascader-menu-"
226
226
  };
227
- const version = "3.13.0";
227
+ const version = "3.14.0";
228
228
  const log = (data, type = "log") => {
229
229
  uLog.logger[type](data);
230
230
  };
package/common/runtime.js CHANGED
@@ -22,7 +22,7 @@ import vuePopup from "./deps/vue-popup";
22
22
  import validate from "./validate";
23
23
  import memorize from "./deps/memorize";
24
24
  import * as common from ".";
25
- const version = "3.13.0";
25
+ const version = "3.14.0";
26
26
  const Renderless = {
27
27
  browser,
28
28
  array,
package/common/string.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  import { isPlainObject, isNumber, isNumeric, isNull } from "./type";
3
3
  import { getObj, toJsonStr } from "./object";
4
- import { toFixed } from "./decimal";
4
+ import { toFixed, Decimal } from "./decimal";
5
5
  const formatTypes = {
6
6
  text: "text",
7
7
  url: "url",
@@ -315,7 +315,7 @@ const toBoolValue = (value) => {
315
315
  }
316
316
  return !!value;
317
317
  };
318
- const toRate = (value, total = 1, fraction = 2) => isNumber(value) && isNumber(total) ? `${toDecimal(value * 100 / total, fraction)}%` : value;
318
+ const toRate = (value, total = 1, fraction = 2) => isNumber(value) && isNumber(total) ? toDecimal(Decimal(value).mul(100).div(total).toNumber(), fraction) + "%" : value;
319
319
  const toFileSize = (value, unit, currUnit) => {
320
320
  if (isNumeric(value)) {
321
321
  value = Number(value);
package/common/type.js CHANGED
@@ -11,6 +11,7 @@ const class2type = {
11
11
  "[object Date]": "date",
12
12
  "[object Array]": "array",
13
13
  "[object Function]": "function",
14
+ "[object AsyncFunction]": "asyncFunction",
14
15
  "[object String]": "string",
15
16
  "[object Number]": "number",
16
17
  "[object Boolean]": "boolean"
@@ -18,7 +19,7 @@ const class2type = {
18
19
  const isNull = (x) => x === null || x === void 0;
19
20
  const typeOf = (obj) => isNull(obj) ? String(obj) : class2type[toString.call(obj)] || "object";
20
21
  const isObject = (obj) => typeOf(obj) === "object";
21
- const isFunction = (fn) => typeOf(fn) === "function";
22
+ const isFunction = (fn) => ["asyncFunction", "function"].includes(typeOf(fn));
22
23
  const isPlainObject = (obj) => {
23
24
  if (!obj || toString.call(obj) !== "[object Object]") {
24
25
  return false;
@@ -4,7 +4,7 @@ const ENUM = "enum";
4
4
  function enum_default(rule, checkValue, source, errors, options) {
5
5
  rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
6
6
  if (!rule[ENUM].includes(checkValue)) {
7
- errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(", ")));
7
+ errors.push(util.format(options.messages[ENUM], "", rule[ENUM].join(", ")));
8
8
  }
9
9
  }
10
10
  export {
@@ -5,12 +5,12 @@ function pattern_default(rule, checkValue, source, errors, options) {
5
5
  if (rule.pattern instanceof RegExp) {
6
6
  rule.pattern.lastIndex = 0;
7
7
  if (!rule.pattern.test(checkValue)) {
8
- errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, checkValue, rule.pattern));
8
+ errors.push(util.format(options.messages.pattern.mismatch, "", checkValue, rule.pattern));
9
9
  }
10
10
  } else if (typeof rule.pattern === "string") {
11
11
  const _pattern = new RegExp(rule.pattern);
12
12
  if (!_pattern.test(checkValue)) {
13
- errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, checkValue, rule.pattern));
13
+ errors.push(util.format(options.messages.pattern.mismatch, "", checkValue, rule.pattern));
14
14
  }
15
15
  }
16
16
  }
@@ -4,11 +4,11 @@ import { isNumber } from "../../type";
4
4
  import { getLength } from "../../string";
5
5
  function getErro({ min, max, val, key, rule, errors, util: util2, options }) {
6
6
  if (min && !max && val < rule.min) {
7
- errors.push(util2.format(options.messages[key].min, rule.fullField, rule.min));
7
+ errors.push(util2.format(options.messages[key].min, "", rule.min));
8
8
  } else if (max && !min && val > rule.max) {
9
- errors.push(util2.format(options.messages[key].max, rule.fullField, rule.max));
9
+ errors.push(util2.format(options.messages[key].max, "", rule.max));
10
10
  } else if (min && max && (val < rule.min || val > rule.max)) {
11
- errors.push(util2.format(options.messages[key].range, rule.fullField, rule.min, rule.max));
11
+ errors.push(util2.format(options.messages[key].range, "", rule.min, rule.max));
12
12
  }
13
13
  }
14
14
  function range_default(rule, checkValue, source, errors, options) {
@@ -17,7 +17,7 @@ function range_default(rule, checkValue, source, errors, options) {
17
17
  const max = isNumber(rule.max);
18
18
  let val = checkValue;
19
19
  let key = null;
20
- const num = isNumber(checkValue);
20
+ const num = isNumber(Number(checkValue));
21
21
  const str = typeof checkValue === "string";
22
22
  const arr = Array.isArray(checkValue);
23
23
  if (num) {
@@ -36,9 +36,12 @@ function range_default(rule, checkValue, source, errors, options) {
36
36
  if (str) {
37
37
  val = getLength(checkValue, "string");
38
38
  }
39
+ if (rule.type === "number") {
40
+ val = checkValue;
41
+ }
39
42
  if (len) {
40
43
  if (val !== rule.len) {
41
- errors.push(util.format(options.messages[key].len, rule.fullField, rule.len));
44
+ errors.push(util.format(options.messages[key].len, "", rule.len));
42
45
  }
43
46
  } else {
44
47
  getErro({ min, max, val, key, rule, errors, util, options });
@@ -3,7 +3,7 @@ import * as util from "../util";
3
3
  import { hasOwn } from "../../type";
4
4
  function required_default({ rule, checkValue, source, errors, options, type }) {
5
5
  if (rule.required && (!hasOwn.call(source, rule.field) || util.isEmptyValue(checkValue, type || rule.type))) {
6
- errors.push(util.format(options.messages.required, rule.fullField));
6
+ errors.push(util.format(options.messages.required, ""));
7
7
  }
8
8
  }
9
9
  export {
@@ -17,11 +17,11 @@ const pattern = {
17
17
  speczh: /^[0-9a-zA-Z_\u4E00-\u9FA5]+$/,
18
18
  specialch: /^[0-9a-zA-Z_\-.]+$/,
19
19
  specialch2: /^[0-9a-zA-Z_-]+$/,
20
- url: /^([a-zA-Z]{3,}):\/\/([\w-]+\.)+[\w]+(\/[a-zA-Z- ./?%&=]*)?/i,
20
+ url: /^(([a-zA-Z]{3,}):)?\/\/([\w-]+\.)+[\w]+(\/[a-zA-Z- ./?%&=]*)?/i,
21
21
  version: /^\d+\.\d+(\.\d+)*$/
22
22
  };
23
23
  const types = {
24
- integer: (value) => types.number(value) && parseInt(value, 10) === value,
24
+ integer: (value) => types.number(value) && /^[-]?[\d]+$/.test(value),
25
25
  float: (value) => types.number(value) && !types.integer(value),
26
26
  array: Array.isArray,
27
27
  regexp(value) {
@@ -35,7 +35,7 @@ const types = {
35
35
  }
36
36
  },
37
37
  date: isDate,
38
- number: isNumber,
38
+ number: (value) => isNumber(Number(value)),
39
39
  object: (value) => isObject(value) && !types.array(value),
40
40
  method: (value) => typeOf(value) === "function",
41
41
  email: (value) => isNullOrEmpty(value) || !!value.match(pattern.email) && value.length < 255,
@@ -89,10 +89,10 @@ function type_default(rule, value, source, errors, options) {
89
89
  const ruleType = rule.type;
90
90
  if (custom.includes(ruleType)) {
91
91
  if (!types[ruleType](value)) {
92
- errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));
92
+ errors.push(util.format(options.messages.types[ruleType], "", rule.type));
93
93
  }
94
94
  } else if (ruleType && typeof value !== rule.type) {
95
- errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));
95
+ errors.push(util.format(options.messages.types[ruleType], "", rule.type));
96
96
  }
97
97
  }
98
98
  export {
@@ -2,7 +2,7 @@ import "../../../chunk-G2ADBYYC.js";
2
2
  import * as util from "../util";
3
3
  function whitespace_default(rule, checkValue, source, errors, options) {
4
4
  if (/^\s+$/.test(checkValue) || checkValue === "") {
5
- errors.push(util.format(options.messages.whitespace, rule.fullField));
5
+ errors.push(util.format(options.messages.whitespace, ""));
6
6
  }
7
7
  }
8
8
  export {
@@ -4,7 +4,7 @@ import {
4
4
  import { hasOwn, isNull } from "../type";
5
5
  import { log } from "../xss";
6
6
  const formatRegExp = /%[sdj%]/g;
7
- let warning = () => void 0;
7
+ const warning = () => void 0;
8
8
  function convertFieldsError(errors) {
9
9
  if (!errors || !errors.length) {
10
10
  return null;
@@ -17,15 +17,14 @@ function convertFieldsError(errors) {
17
17
  });
18
18
  return fields;
19
19
  }
20
- function format(...args) {
21
- let i = 1;
22
- const checkData = args[0];
23
- const len = args.length;
24
- if (typeof checkData === "function") {
25
- return checkData.apply(null, args.slice(1));
20
+ function format(i18nTemplate, ...rest) {
21
+ if (typeof i18nTemplate === "function") {
22
+ return i18nTemplate(...rest);
26
23
  }
27
- if (typeof checkData === "string") {
28
- let str = String(checkData).replace(formatRegExp, (matchChar) => {
24
+ if (typeof i18nTemplate === "string") {
25
+ let i = 0;
26
+ const len = rest.length;
27
+ let str = String(i18nTemplate).replace(formatRegExp, (matchChar) => {
29
28
  if (matchChar === "%%") {
30
29
  return "%";
31
30
  }
@@ -35,21 +34,21 @@ function format(...args) {
35
34
  switch (matchChar) {
36
35
  case "%j":
37
36
  try {
38
- return JSON.stringify(args[i++]);
37
+ return JSON.stringify(rest[i++]);
39
38
  } catch (e) {
40
39
  return "[Circular]";
41
40
  }
42
41
  case "%d":
43
- return Number(args[i++]);
42
+ return Number(rest[i++]);
44
43
  case "%s":
45
- return String(args[i++]);
44
+ return String(rest[i++]);
46
45
  default:
47
46
  return matchChar;
48
47
  }
49
48
  });
50
49
  return str;
51
50
  }
52
- return checkData;
51
+ return i18nTemplate;
53
52
  }
54
53
  function isNativeStringType(type) {
55
54
  return [
@@ -93,7 +92,7 @@ function asyncParallelArray(arrData, func, callback) {
93
92
  const results = [];
94
93
  const arrLength = arrData.length;
95
94
  function checkCount(errors) {
96
- results.push.apply(results, errors);
95
+ results.push(...errors);
97
96
  count++;
98
97
  if (count === arrLength) {
99
98
  callback(results);
@@ -124,7 +123,7 @@ function asyncSerialArray(arr, fn, cb) {
124
123
  function flattenObjArr(objArr) {
125
124
  const result = [];
126
125
  Object.keys(objArr).forEach((item) => {
127
- result.push.apply(result, objArr[item]);
126
+ result.push(...objArr[item]);
128
127
  });
129
128
  return result;
130
129
  }
@@ -153,7 +152,7 @@ function asyncMap(objArray, option, func, callback) {
153
152
  const pending = new Promise((resolve, reject) => {
154
153
  const errorFn = reject;
155
154
  const next = (errors) => {
156
- results.push.apply(results, errors);
155
+ results.push(...errors);
157
156
  total++;
158
157
  if (total === objArrLength) {
159
158
  callback(results);
@@ -10,7 +10,7 @@ function integer_default(rule, checkValue, callback, source, options) {
10
10
  return callback();
11
11
  }
12
12
  rules.required({ rule, checkValue, source, errors, options });
13
- if (void 0 !== checkValue) {
13
+ if (checkValue !== void 0 && checkValue !== "") {
14
14
  rules.type(rule, checkValue, source, errors, options);
15
15
  rules.range(rule, checkValue, source, errors, options);
16
16
  }
@@ -10,7 +10,7 @@ function method_default(rule, checkValue, callback, source, options) {
10
10
  return callback();
11
11
  }
12
12
  rules.required({ rule, checkValue, source, errors, options });
13
- if (void 0 !== checkValue) {
13
+ if (checkValue !== void 0) {
14
14
  rules.type(rule, checkValue, source, errors, options);
15
15
  }
16
16
  }
package/currency/index.js CHANGED
@@ -1,4 +1,6 @@
1
- import "../chunk-G2ADBYYC.js";
1
+ import {
2
+ __spreadValues
3
+ } from "../chunk-G2ADBYYC.js";
2
4
  import { isUndefined, isNull } from "../grid/static";
3
5
  import { log } from "../common";
4
6
  const init = ({ state, service, api }) => () => {
@@ -21,12 +23,17 @@ const initService = ({ props, service }) => {
21
23
  textField: "currency_code",
22
24
  valueField: "currency_code"
23
25
  };
24
- const { setting = {}, fetchCurrency } = service || {};
25
- const { options = {} } = setting;
26
- const fetchCurrencyNoop = () => Promise.resolve([]);
26
+ const { getCurrency, getDefaultCurrency, setDefaultCurrency } = (service == null ? void 0 : service.common) || {};
27
+ const { setting } = service || {};
28
+ const { options = {} } = setting || {};
29
+ const fetchCurrencyNoop = () => {
30
+ return Promise.resolve([]);
31
+ };
27
32
  return {
28
- fetchCurrency: props.fetchCurrency || fetchCurrency || fetchCurrencyNoop,
29
- fields: props.fields || options.Currency || defaultCurrencySetting
33
+ fetchCurrency: props.fetchCurrency || getCurrency || fetchCurrencyNoop,
34
+ fields: props.fields || options.Currency || defaultCurrencySetting,
35
+ fetchDefaultCurrency: props.fetchDefaultCurrency || getDefaultCurrency,
36
+ setDefaultCurrency: props.setDefaultCurrency || setDefaultCurrency
30
37
  };
31
38
  };
32
39
  const fixServiceData = ({ props, service }) => (data) => {
@@ -52,9 +59,69 @@ const fixServiceData = ({ props, service }) => (data) => {
52
59
  resolve(result);
53
60
  });
54
61
  };
62
+ const fetchDefaultCurrency = ({ state, props, emit, service }) => () => {
63
+ if (!service.fetchDefaultCurrency || !props.setDefault)
64
+ return;
65
+ const result = service.fetchDefaultCurrency();
66
+ if (result.then) {
67
+ result.then((res) => {
68
+ if (!res)
69
+ return;
70
+ state.defaultCurrency = res;
71
+ emit("update:modelValue", res);
72
+ });
73
+ } else {
74
+ state.defaultCurrency = result;
75
+ emit("update:modelValue", result);
76
+ }
77
+ };
78
+ const toogleDefaultCurrency = ({ state, service }) => (value, isActive) => {
79
+ if (!service.setDefaultCurrency)
80
+ return;
81
+ let setValue = isActive ? "" : value;
82
+ const result = service.setDefaultCurrency(setValue);
83
+ if (result.then) {
84
+ result.then(() => {
85
+ state.defaultCurrency = setValue;
86
+ });
87
+ }
88
+ };
89
+ const computedSearchConfig = ({ props, service }) => () => {
90
+ const { textField, valueField } = service.fields;
91
+ const { searchConfig } = props;
92
+ const handleOptions = (options) => {
93
+ return options.map((item) => ({
94
+ label: item[textField],
95
+ value: item[valueField]
96
+ }));
97
+ };
98
+ const searchMethod = (...args) => {
99
+ return new Promise((resolve) => {
100
+ const options = searchConfig.searchMethod(...args);
101
+ if (typeof options.then === "function") {
102
+ options.then((result) => resolve(handleOptions(result)));
103
+ } else {
104
+ resolve(handleOptions(options));
105
+ }
106
+ });
107
+ };
108
+ const config = __spreadValues({}, props.searchConfig);
109
+ if (searchConfig && searchConfig.searchMethod) {
110
+ config.searchMethod = searchMethod;
111
+ }
112
+ return config;
113
+ };
114
+ const visibleChange = (emit) => (value) => {
115
+ emit("update:visible", value);
116
+ emit("visible-change", value);
117
+ };
55
118
  export {
56
119
  change,
120
+ computedSearchConfig,
121
+ fetchDefaultCurrency,
57
122
  fixServiceData,
58
123
  init,
59
- initService
124
+ initService,
125
+ toogleDefaultCurrency,
126
+ visibleChange
60
127
  };
package/currency/vue.js CHANGED
@@ -1,18 +1,33 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- import { init, fixServiceData, change, initService } from "./index";
3
- const api = ["state", "change"];
4
- const renderless = (props, { watch, reactive }, { service, emit }) => {
2
+ import {
3
+ init,
4
+ fixServiceData,
5
+ change,
6
+ initService,
7
+ fetchDefaultCurrency,
8
+ toogleDefaultCurrency,
9
+ computedSearchConfig,
10
+ visibleChange
11
+ } from "./index";
12
+ const api = ["state", "change", "toogleDefaultCurrency", "visibleChange"];
13
+ const renderless = (props, { watch, reactive, computed }, { service, emit }) => {
5
14
  const api2 = {};
6
15
  const $service = initService({ props, service });
7
16
  const state = reactive({
8
17
  options: [],
9
- selectedValue: props.modelValue
18
+ selectedValue: props.modelValue,
19
+ defaultCurrency: "",
20
+ searchConfig: computed(() => api2.computedSearchConfig())
10
21
  });
11
22
  Object.assign(api2, {
12
23
  state,
13
24
  change: change(emit),
25
+ visibleChange: visibleChange(emit),
14
26
  fixServiceData: fixServiceData({ props, service: $service }),
15
- init: init({ state, service: $service, api: api2 })
27
+ init: init({ state, service: $service, api: api2 }),
28
+ fetchDefaultCurrency: fetchDefaultCurrency({ state, props, emit, service: $service }),
29
+ toogleDefaultCurrency: toogleDefaultCurrency({ state, props, service: $service }),
30
+ computedSearchConfig: computedSearchConfig({ props, service: $service })
16
31
  });
17
32
  watch(
18
33
  () => props.modelValue,
@@ -22,6 +37,7 @@ const renderless = (props, { watch, reactive }, { service, emit }) => {
22
37
  { immediate: true }
23
38
  );
24
39
  api2.init();
40
+ api2.fetchDefaultCurrency();
25
41
  return api2;
26
42
  };
27
43
  export {
@@ -199,6 +199,20 @@ const handleYearPick = ({ api, state }) => (value) => {
199
199
  state.currentView = DATEPICKER.Month;
200
200
  }
201
201
  };
202
+ const getDisabledNow = ({ state }) => () => {
203
+ let disabledDate = state.disabledDate;
204
+ if (!disabledDate)
205
+ return false;
206
+ return disabledDate(/* @__PURE__ */ new Date());
207
+ };
208
+ const getDisabledConfirm = ({ state }) => () => {
209
+ let disabledDate = state.disabledDate;
210
+ if (!disabledDate)
211
+ return false;
212
+ if (!state.value)
213
+ return true;
214
+ return disabledDate(state.value);
215
+ };
202
216
  const dateToLocaleStringForIE = (timezone, value) => {
203
217
  const localTimezone = getLocalTimezone();
204
218
  const offsetTimezone = timezone - localTimezone;
@@ -426,6 +440,8 @@ export {
426
440
  debounceChange,
427
441
  doPick,
428
442
  getDefaultValue,
443
+ getDisabledConfirm,
444
+ getDisabledNow,
429
445
  getRenderTz,
430
446
  getYearLabel,
431
447
  handleClear,