@opentiny/vue-renderless 3.12.1 → 3.13.0-alpha.1

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 (297) hide show
  1. package/action-sheet/index.js +20 -13
  2. package/action-sheet/vue.js +8 -7
  3. package/alert/index.js +50 -1
  4. package/alert/vue.js +36 -9
  5. package/amount/index.js +100 -25
  6. package/amount/vue.js +102 -26
  7. package/anchor/index.js +1 -0
  8. package/area/index.js +8 -8
  9. package/area/vue.js +5 -5
  10. package/async-flowchart/index.js +16 -3
  11. package/autocomplete/index.js +58 -14
  12. package/autocomplete/vue.js +40 -12
  13. package/badge/index.js +12 -0
  14. package/badge/vue.js +6 -4
  15. package/breadcrumb/vue.js +3 -1
  16. package/breadcrumb-item/vue.js +6 -2
  17. package/button/index.js +5 -1
  18. package/calendar/index.js +2 -86
  19. package/calendar-bar/index.js +20 -6
  20. package/calendar-view/index.js +10 -12
  21. package/calendar-view/vue.js +17 -4
  22. package/cascader/index.js +80 -34
  23. package/cascader/vue.js +49 -19
  24. package/cascader-menu/index.js +7 -7
  25. package/cascader-menu/vue.js +2 -3
  26. package/cascader-mobile/index.js +37 -24
  27. package/cascader-mobile/vue.js +7 -1
  28. package/cascader-node/index.js +13 -1
  29. package/cascader-node/vue.js +15 -4
  30. package/cascader-panel/index.js +1 -1
  31. package/cascader-select/column-index.js +150 -0
  32. package/cascader-select/column.js +120 -0
  33. package/cascader-select/index.js +29 -165
  34. package/cascader-select/usePicker.js +251 -0
  35. package/cascader-select/useTouch.js +65 -0
  36. package/cascader-select/vue.js +35 -47
  37. package/cascader-view/index.js +1 -1
  38. package/cell/vue.js +2 -1
  39. package/chart-bar/index.js +2 -3
  40. package/chart-core/deps/constants.js +43 -43
  41. package/chart-core/index.js +1 -1
  42. package/chart-gauge/index.js +2 -2
  43. package/chart-heatmap/index.js +17 -10
  44. package/chart-line/index.js +8 -9
  45. package/chart-tree/index.js +2 -2
  46. package/chart-waterfall/index.js +4 -6
  47. package/checkbox/index.js +17 -0
  48. package/checkbox/vue.js +16 -7
  49. package/checkbox-group/vue.js +2 -0
  50. package/col/vue.js +3 -2
  51. package/collapse/index.js +3 -3
  52. package/color-select-panel/vue.js +0 -7
  53. package/column-list-item/index.js +17 -1
  54. package/column-list-item/vue.js +8 -3
  55. package/common/date.js +2 -0
  56. package/common/deps/dom.js +19 -4
  57. package/common/deps/popper.js +48 -5
  58. package/common/deps/touch-emulator.js +4 -1
  59. package/common/deps/tree-model/node.js +1 -1
  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 +22 -10
  63. package/common/index.js +1 -1
  64. package/common/runtime.js +1 -1
  65. package/common/type.js +2 -1
  66. package/common/validate/rules/enum.js +1 -1
  67. package/common/validate/rules/pattern.js +2 -2
  68. package/common/validate/rules/range.js +8 -5
  69. package/common/validate/rules/required.js +1 -1
  70. package/common/validate/rules/type.js +5 -5
  71. package/common/validate/rules/whitespace.js +1 -1
  72. package/common/validate/util.js +15 -16
  73. package/common/validate/validations/integer.js +1 -1
  74. package/common/validate/validations/method.js +1 -1
  75. package/container/index.js +17 -1
  76. package/container/vue.js +12 -3
  77. package/currency/index.js +74 -7
  78. package/currency/vue.js +21 -5
  79. package/date-panel/index.js +16 -0
  80. package/date-panel/vue.js +8 -2
  81. package/date-picker-mobile/index.js +12 -0
  82. package/date-picker-mobile/vue.js +7 -1
  83. package/date-range/vue.js +12 -5
  84. package/date-table/index.js +5 -0
  85. package/date-table/vue.js +3 -1
  86. package/dialog-box/index.js +17 -6
  87. package/dialog-select/index.js +6 -3
  88. package/dialog-select/vue.js +8 -4
  89. package/drawer/index.js +26 -5
  90. package/drawer/vue.js +13 -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 +21 -8
  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 +47 -12
  103. package/file-upload/vue.js +38 -8
  104. package/filter-box/index.js +1 -0
  105. package/floating-button/index.js +62 -16
  106. package/floating-button/vue.js +27 -9
  107. package/flowchart/index.js +134 -25
  108. package/flowchart/node.js +13 -4
  109. package/flowchart/vue.js +16 -4
  110. package/form/vue.js +3 -1
  111. package/form-item/index.js +4 -4
  112. package/form-item/vue.js +3 -1
  113. package/fullscreen/index.js +5 -5
  114. package/fullscreen/vue.js +3 -3
  115. package/grid/utils/common.js +10 -5
  116. package/grid/utils/dom.js +7 -1
  117. package/image/index.js +6 -0
  118. package/image/vue.js +6 -3
  119. package/image-viewer/index.js +62 -51
  120. package/image-viewer/vue.js +17 -5
  121. package/input/index.js +89 -22
  122. package/input/vue.js +52 -21
  123. package/ip-address/index.js +61 -19
  124. package/ip-address/vue.js +22 -4
  125. package/label/index.js +56 -0
  126. package/label/vue.js +26 -0
  127. package/link/vue.js +3 -1
  128. package/loading/vue.js +8 -2
  129. package/logout/index.js +1 -1
  130. package/mask/index.js +13 -0
  131. package/mask/vue.js +18 -0
  132. package/mind-map/index.js +47 -0
  133. package/mind-map/vue.js +53 -0
  134. package/multi-select/index.js +150 -10
  135. package/multi-select/vue.js +46 -11
  136. package/multi-select-item/index.js +17 -0
  137. package/multi-select-item/vue.js +31 -0
  138. package/numeric/index.js +51 -9
  139. package/numeric/vue.js +44 -14
  140. package/option/index.js +12 -5
  141. package/option/vue.js +15 -7
  142. package/option-group/index.js +3 -3
  143. package/package.json +1 -1
  144. package/pager/index.js +372 -0
  145. package/pager/vue.js +125 -2
  146. package/picker/index.js +253 -48
  147. package/picker/mb.js +42 -0
  148. package/picker/vue.js +70 -17
  149. package/picker-column/index.js +1 -1
  150. package/pop-upload/index.js +0 -2
  151. package/pop-upload/vue.js +3 -4
  152. package/popconfirm/index.js +3 -6
  153. package/popconfirm/vue.js +1 -1
  154. package/popeditor/index.js +55 -24
  155. package/popeditor/vue.js +15 -11
  156. package/popover/index.js +4 -4
  157. package/popover/vue.js +6 -6
  158. package/popup/index.js +3 -3
  159. package/popup/vue.js +5 -5
  160. package/pull-refresh/index.js +57 -65
  161. package/pull-refresh/vue.js +23 -7
  162. package/radio/index.js +0 -17
  163. package/radio/vue.js +4 -10
  164. package/rate/index.js +1 -1
  165. package/rate/vue.js +0 -2
  166. package/record/index.js +4 -1
  167. package/{rich-text-edtior → rich-text-editor}/index.js +2 -2
  168. package/{rich-text-edtior → rich-text-editor}/vue.js +2 -5
  169. package/scrollbar/index.js +11 -11
  170. package/scrollbar/vue-bar.js +3 -3
  171. package/scrollbar/vue.js +5 -5
  172. package/search/index.js +1 -1
  173. package/search/vue.js +3 -1
  174. package/select/index.js +176 -110
  175. package/select/vue.js +105 -20
  176. package/select-dropdown/index.js +62 -4
  177. package/select-dropdown/vue.js +85 -8
  178. package/select-view/index.js +3 -1
  179. package/signature/index.js +241 -0
  180. package/signature/vue.js +88 -0
  181. package/skeleton/index.js +14 -0
  182. package/skeleton/vue.js +15 -0
  183. package/skeleton-item/vue.js +15 -0
  184. package/slider/index.js +27 -7
  185. package/slider/vue.js +26 -7
  186. package/split/index.js +1 -1
  187. package/split/vue.js +4 -6
  188. package/standard-list-item/index.js +15 -1
  189. package/standard-list-item/vue.js +6 -5
  190. package/steps/index.js +25 -2
  191. package/steps/slide-bar.js +8 -1
  192. package/steps/vue.js +15 -3
  193. package/tab-item-mf/vue.js +14 -8
  194. package/tab-nav/index.js +9 -4
  195. package/tab-nav/vue.js +6 -2
  196. package/tabbar/vue.js +9 -3
  197. package/tabbar-item/vue.js +3 -2
  198. package/tabs/index.js +1 -1
  199. package/tabs/vue.js +1 -0
  200. package/tabs-mf/index.js +20 -6
  201. package/tabs-mf/vue-nav.js +26 -11
  202. package/tabs-mf/vue.js +7 -7
  203. package/tag/index.js +1 -1
  204. package/tag/vue.js +5 -1
  205. package/tag-group/index.js +2 -1
  206. package/tall-storage/index.js +4 -5
  207. package/time/index.js +4 -1
  208. package/time/vue.js +1 -1
  209. package/time-line/vue.js +1 -1
  210. package/time-picker-mobile/index.js +24 -5
  211. package/time-picker-mobile/vue.js +17 -7
  212. package/time-range/index.js +2 -0
  213. package/time-spinner/index.js +0 -3
  214. package/time-spinner/vue.js +2 -3
  215. package/timeline-item/vue.js +1 -1
  216. package/tooltip/index.js +1 -2
  217. package/tooltip/vue.js +3 -3
  218. package/transfer/index.js +20 -22
  219. package/transfer/vue.js +1 -6
  220. package/transfer-panel/vue.js +3 -5
  221. package/tree/index.js +21 -4
  222. package/tree/vue.js +10 -8
  223. package/tree-menu/index.js +27 -3
  224. package/tree-menu/vue.js +27 -14
  225. package/tree-node/index.js +12 -10
  226. package/tree-node/vue.js +6 -5
  227. package/types/action-menu.type.d.ts +5 -0
  228. package/types/action-sheet.type.d.ts +118 -1
  229. package/types/alert.type.d.ts +16 -1
  230. package/types/amount.type.d.ts +168 -1
  231. package/types/area.type.d.ts +134 -1
  232. package/types/async-flowchart.type.d.ts +72 -0
  233. package/types/autocomplete.type.d.ts +199 -1
  234. package/types/badge.type.d.ts +3 -1
  235. package/types/breadcrumb-item.type.d.ts +2 -0
  236. package/types/breadcrumb.type.d.ts +2 -0
  237. package/types/button.type.d.ts +5 -0
  238. package/types/cascader-menu.type.d.ts +3 -4
  239. package/types/cascader-node.type.d.ts +5 -2
  240. package/types/cascader-panel.type-2bd03be3.d.ts +241 -0
  241. package/types/cascader-panel.type.d.ts +3 -241
  242. package/types/cascader.type.d.ts +327 -1
  243. package/types/checkbox.type.d.ts +9 -0
  244. package/types/collapse.type.d.ts +19 -2
  245. package/types/date-picker.type.d.ts +34 -1
  246. package/types/dialog-box.type.d.ts +5 -1
  247. package/types/drawer.type.d.ts +132 -1
  248. package/types/{dropdown-item.type-bf83e929.d.ts → dropdown-item.type-8475a549.d.ts} +8 -14
  249. package/types/dropdown-item.type.d.ts +1 -1
  250. package/types/dropdown-menu.type.d.ts +1 -1
  251. package/types/dropdown.type.d.ts +2 -5
  252. package/types/fall-menu.type.d.ts +94 -1
  253. package/types/file-upload.type.d.ts +1 -1
  254. package/types/form-item.type.d.ts +1 -1
  255. package/types/{form.type-d0fd42f3.d.ts → form.type-d88482e4.d.ts} +3 -0
  256. package/types/form.type.d.ts +1 -1
  257. package/types/input.type.d.ts +23 -9
  258. package/types/ip-address.type.d.ts +160 -1
  259. package/types/label.type.d.ts +81 -0
  260. package/types/link.type.d.ts +6 -3
  261. package/types/mind-map.type.d.ts +20 -0
  262. package/types/modal.type.d.ts +4 -2
  263. package/types/numeric.type.d.ts +36 -9
  264. package/types/pager.type.d.ts +171 -1
  265. package/types/picker.type.d.ts +14 -0
  266. package/types/popconfirm.type.d.ts +85 -1
  267. package/types/popeditor.type.d.ts +4 -0
  268. package/types/popover.type.d.ts +3 -3
  269. package/types/radio.type.d.ts +0 -4
  270. package/types/rate.type.d.ts +236 -1
  271. package/types/search.type.d.ts +88 -1
  272. package/types/shared.type.d.ts +1 -1
  273. package/types/skeleton-item.type.d.ts +38 -0
  274. package/types/skeleton.type.d.ts +45 -0
  275. package/types/slider.type.d.ts +8 -1
  276. package/types/steps.type.d.ts +14 -3
  277. package/types/tab-item.type.d.ts +0 -1
  278. package/types/tab-nav.type.d.ts +6 -1
  279. package/types/tabs.type.d.ts +5 -0
  280. package/types/tag-group.type.d.ts +64 -1
  281. package/types/tag.type.d.ts +12 -0
  282. package/types/tooltip.type.d.ts +1 -1
  283. package/types/transfer.type.d.ts +183 -1
  284. package/types/tree-menu.type.d.ts +210 -1
  285. package/types/upload-dragger.type.d.ts +1 -1
  286. package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-1078fba2.d.ts} +27 -6
  287. package/types/upload-list.type.d.ts +1 -1
  288. package/types/upload.type.d.ts +1 -1
  289. package/types/wizard.type.d.ts +1 -0
  290. package/upload/index.js +59 -29
  291. package/upload/vue.js +6 -4
  292. package/upload-list/index.js +14 -14
  293. package/upload-list/vue.js +5 -2
  294. package/user/index.js +5 -4
  295. package/user-head/index.js +1 -1
  296. package/wheel/index.js +3 -0
  297. package/wizard/vue.js +4 -2
@@ -68,6 +68,22 @@ const isScrollElement = (el) => {
68
68
  const scrollTypes = ["scroll", "auto"];
69
69
  return scrollTypes.includes(getStyleComputedProperty(el, "overflow")) || scrollTypes.includes(getStyleComputedProperty(el, "overflow-x")) || scrollTypes.includes(getStyleComputedProperty(el, "overflow-y"));
70
70
  };
71
+ const getAdjustOffset = (parent) => {
72
+ const placeholder = document.createElement("div");
73
+ setStyle(placeholder, {
74
+ opacity: 0,
75
+ position: "fixed",
76
+ width: 1,
77
+ height: 1,
78
+ top: 0,
79
+ left: 0,
80
+ "z-index": "-99"
81
+ });
82
+ parent.appendChild(placeholder);
83
+ const result = getBoundingClientRect(placeholder);
84
+ parent.removeChild(placeholder);
85
+ return result;
86
+ };
71
87
  const getScrollParent = (el) => {
72
88
  let parent = el.parentNode;
73
89
  if (!parent) {
@@ -84,9 +100,14 @@ const getScrollParent = (el) => {
84
100
  }
85
101
  return getScrollParent(parent);
86
102
  };
87
- const getOffsetRectRelativeToCustomParent = (el, parent, fixed) => {
103
+ const getOffsetRectRelativeToCustomParent = (el, parent, fixed, popper) => {
88
104
  let { top, left, width, height } = getBoundingClientRect(el);
89
105
  if (fixed) {
106
+ if (popper.parentElement) {
107
+ const { top: adjustTop, left: adjustLeft } = getAdjustOffset(popper.parentElement);
108
+ top -= adjustTop;
109
+ left -= adjustLeft;
110
+ }
90
111
  return {
91
112
  top,
92
113
  left,
@@ -161,6 +182,9 @@ const getOffsetRect = (el) => {
161
182
  elementRect.bottom = elementRect.top + elementRect.height;
162
183
  return elementRect;
163
184
  };
185
+ const stopFn = (ev) => {
186
+ ev.stopPropagation();
187
+ };
164
188
  class Popper {
165
189
  constructor(reference, popper, options) {
166
190
  this.modifiers = {};
@@ -192,6 +216,7 @@ class Popper {
192
216
  }
193
217
  update() {
194
218
  let data = { instance: this, styles: {} };
219
+ this.stopEventBubble();
195
220
  this.popperOuterSize = null;
196
221
  data.placement = data._originalPlacement = this._options.placement;
197
222
  data.offsets = this._getRefPopOffsets(this._popper, this._reference, data.placement);
@@ -199,6 +224,15 @@ class Popper {
199
224
  data = this.runModifiers(data, this._options.modifierFns);
200
225
  typeof this.state.updateCallback === "function" && this.state.updateCallback(data);
201
226
  }
227
+ // 阻止popper的mousewheel等事件冒泡。 通过 onxxx 绑定,是为了避免重复绑定事件
228
+ stopEventBubble() {
229
+ if (!this._popper)
230
+ return;
231
+ if (!this._popper.onmousewheel)
232
+ this._popper.onmousewheel = stopFn;
233
+ if (!this._popper.onwheel)
234
+ this._popper.onwheel = stopFn;
235
+ }
202
236
  /** 按顺序执行Modifiers, 如果传入终点modifier,则执行到指定位置 */
203
237
  runModifiers(data, modifiers2, ends) {
204
238
  let modifiersToRun = modifiers2.slice();
@@ -206,7 +240,7 @@ class Popper {
206
240
  if (ends !== void 0) {
207
241
  modifiersToRun = this._options.modifierFns.slice(
208
242
  0,
209
- _options.modifierFns.findIndex((m) => m == ends)
243
+ _options.modifierFns.findIndex((m) => m === ends)
210
244
  );
211
245
  }
212
246
  modifiersToRun.forEach((modifier) => {
@@ -221,8 +255,12 @@ class Popper {
221
255
  let styles = { position: data.offsets.popper.position };
222
256
  let left = Math.round(data.offsets.popper.left);
223
257
  let top = Math.round(data.offsets.popper.top);
224
- styles.transform = `translate3d(${left}px, ${top}px, 0)`;
225
- Object.assign(styles, { top: 0, left: 0 });
258
+ if (this._options.gpuAcceleration) {
259
+ styles.transform = `translate3d(${left}px, ${top}px, 0)`;
260
+ Object.assign(styles, { top: 0, left: 0 });
261
+ } else {
262
+ Object.assign(styles, { top, left });
263
+ }
226
264
  Object.assign(styles, data.styles);
227
265
  setStyle(this._popper, styles);
228
266
  this._popper.setAttribute("x-placement", data.placement);
@@ -416,7 +454,12 @@ class Popper {
416
454
  placement = placement.split("-")[0];
417
455
  let popperOffsets = { position: this.state.position };
418
456
  let isParentFixed = popperOffsets.position === "fixed";
419
- let referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
457
+ let referenceOffsets = getOffsetRectRelativeToCustomParent(
458
+ reference,
459
+ getOffsetParent(popper),
460
+ isParentFixed,
461
+ popper
462
+ );
420
463
  const { width, height } = this.popperOuterSize ? this.popperOuterSize : this.popperOuterSize = getOuterSizes(popper);
421
464
  if (~["right", "left"].indexOf(placement)) {
422
465
  popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - height / 2;
@@ -24,6 +24,8 @@ class Touch {
24
24
  this.screenY = pos.screenY + deltaY;
25
25
  this.clientX = pos.clientX + deltaX;
26
26
  this.clientY = pos.clientY + deltaY;
27
+ this.offsetX = pos.offsetX + deltaX;
28
+ this.offsetY = pos.offsetY + deltaY;
27
29
  }
28
30
  }
29
31
  const TouchList = () => {
@@ -69,7 +71,8 @@ const onMouse = (touchType) => (ev) => {
69
71
  if (ev.type === "mousedown" || !mouseTarget) {
70
72
  mouseTarget = ev.target;
71
73
  }
72
- if ((eventTarget = closest(mouseTarget, "[data-tiny-touch-simulate-container]")) && eventTarget.dispatchEvent) {
74
+ eventTarget = closest(mouseTarget, "[data-tiny-touch-simulate-container]");
75
+ if (eventTarget && eventTarget.dispatchEvent) {
73
76
  triggerTouch(touchType, ev);
74
77
  }
75
78
  if (ev.type === "mouseup") {
@@ -120,7 +120,7 @@ class Node {
120
120
  });
121
121
  const isLeafKey = ((_b = (_a = this.store) == null ? void 0 : _a.props) == null ? void 0 : _b.isLeaf) || defaultIsLeafKey;
122
122
  this.isLeaf = !!(this.data && this.data[isLeafKey]);
123
- this.loaded = false;
123
+ this.loaded = this.isLeaf;
124
124
  this.loading = false;
125
125
  this.childNodes = [];
126
126
  this.level = this.parent ? this.parent.level + 1 : 0;
@@ -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
+ };
@@ -6,13 +6,8 @@ import PopperJS from "./popper";
6
6
  import { on } 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,
@@ -56,9 +64,9 @@ var vue_popper_default = (options) => {
56
64
  return;
57
65
  }
58
66
  const options2 = props.popperOptions || {};
59
- state.popperElm = state.popperElm || props.popper || refs.popper;
67
+ state.popperElm = state.popperElm || props.popper || vm.$refs.popper || popperVmRef.popper;
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
  }
@@ -91,6 +99,10 @@ var vue_popper_default = (options) => {
91
99
  const popperJS = state.popperJS;
92
100
  if (popperJS) {
93
101
  popperJS.update();
102
+ if (popperJS._popper) {
103
+ popperJS._popper.style.zIndex = PopupManager.nextZIndex().toString();
104
+ followHide(state.popperJS);
105
+ }
94
106
  } else {
95
107
  createPopper();
96
108
  }
package/common/index.js CHANGED
@@ -224,7 +224,7 @@ const CASCADER = {
224
224
  PropsHover: "hoverThreshold",
225
225
  MenuConnector: "cascader-menu-"
226
226
  };
227
- const version = "3.12.0";
227
+ const version = "3.13.0-alpha.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.12.0";
25
+ const version = "3.13.0-alpha.0";
26
26
  const Renderless = {
27
27
  browser,
28
28
  array,
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
  }
@@ -73,12 +73,28 @@ const computedFooterStyle = ({ constants, props }) => () => {
73
73
  height: transferWidthOrHeight(props.footerHeight)
74
74
  };
75
75
  };
76
+ const computedLeftStyle = ({ constants, props }) => () => {
77
+ return {
78
+ width: transferWidthOrHeight(props.leftWidth)
79
+ };
80
+ };
81
+ const computedShowRight = ({ constants, props }) => () => {
82
+ return props.pattern === constants.DEFAULT ? false : true;
83
+ };
84
+ const computedRightStyle = ({ constants, props }) => () => {
85
+ return {
86
+ width: transferWidthOrHeight(props.rightWidth)
87
+ };
88
+ };
76
89
  export {
77
90
  computedAsideStyle,
78
91
  computedFooterStyle,
79
92
  computedHeaderStyle,
93
+ computedLeftStyle,
80
94
  computedMainStyle,
95
+ computedRightStyle,
81
96
  computedShowAside,
82
97
  computedShowFooter,
83
- computedShowHeader
98
+ computedShowHeader,
99
+ computedShowRight
84
100
  };
package/container/vue.js CHANGED
@@ -6,7 +6,10 @@ import {
6
6
  computedHeaderStyle,
7
7
  computedAsideStyle,
8
8
  computedMainStyle,
9
- computedFooterStyle
9
+ computedFooterStyle,
10
+ computedLeftStyle,
11
+ computedShowRight,
12
+ computedRightStyle
10
13
  } from "./index";
11
14
  const api = ["state"];
12
15
  const renderless = (props, { computed, reactive }, { constants }) => {
@@ -18,7 +21,10 @@ const renderless = (props, { computed, reactive }, { constants }) => {
18
21
  mainStyle: computed(() => api2.computedMainStyle()),
19
22
  asideStyle: computed(() => api2.computedAsideStyle()),
20
23
  headerStyle: computed(() => api2.computedHeaderStyle()),
21
- footerStyle: computed(() => api2.computedFooterStyle())
24
+ footerStyle: computed(() => api2.computedFooterStyle()),
25
+ showRight: computed(() => api2.computedShowRight()),
26
+ leftStyle: computed(() => api2.computedLeftStyle()),
27
+ rightStyle: computed(() => api2.computedRightStyle())
22
28
  });
23
29
  Object.assign(api2, {
24
30
  state,
@@ -28,7 +34,10 @@ const renderless = (props, { computed, reactive }, { constants }) => {
28
34
  computedMainStyle: computedMainStyle({ constants, props }),
29
35
  computedAsideStyle: computedAsideStyle({ constants, props }),
30
36
  computedHeaderStyle: computedHeaderStyle({ constants, props }),
31
- computedFooterStyle: computedFooterStyle({ constants, props })
37
+ computedFooterStyle: computedFooterStyle({ constants, props }),
38
+ computedLeftStyle: computedLeftStyle({ constants, props }),
39
+ computedShowRight: computedShowRight({ constants, props }),
40
+ computedRightStyle: computedRightStyle({ constants, props })
32
41
  });
33
42
  return api2;
34
43
  };