@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
@@ -3,12 +3,11 @@ import { omitText } from "../common/string";
3
3
  const api = ["dataStore", "handleClick", "dataStore", "mouseEnter", "mouseLeave"];
4
4
  const renderless = (props, { reactive, inject }, { dispatch, vm }) => {
5
5
  const api2 = {};
6
- const dropdownMenuVm = inject("dropdownMenuVm");
7
- const multiStage = inject("multiStage");
6
+ const dropdownMenuVm = inject("dropdownMenuVm", null);
8
7
  let dataStore = reactive({
9
- checkedStatus: dropdownMenuVm.checkedStatus,
8
+ checkedStatus: dropdownMenuVm == null ? void 0 : dropdownMenuVm.checkedStatus,
10
9
  multiStageMenu: "",
11
- multiStage: "",
10
+ multiStage: inject("multiStage", null),
12
11
  itemData: "",
13
12
  itemLabel: "",
14
13
  showContent: false,
@@ -16,9 +15,6 @@ const renderless = (props, { reactive, inject }, { dispatch, vm }) => {
16
15
  currentIndex: props.currentIndex,
17
16
  level: props.level
18
17
  });
19
- if (multiStage) {
20
- dataStore.multiStageMenu = true;
21
- }
22
18
  const handleClick = ({ dataStore: dataStore2, props: props2, vm: vm2 }) => () => {
23
19
  if (props2.disabled) {
24
20
  dataStore2.checkedStatus = false;
@@ -31,7 +27,7 @@ const renderless = (props, { reactive, inject }, { dispatch, vm }) => {
31
27
  } else {
32
28
  dataStore2.currentIndex = `${props2.currentIndex}`;
33
29
  }
34
- dispatch("TinyDropdown", "selectedIndex", [dataStore2.currentIndex]);
30
+ dispatch("TinyDropdown", "selected-index", [dataStore2.currentIndex]);
35
31
  const data = {
36
32
  itemData: dataStore2.itemData,
37
33
  vm: vm2,
@@ -69,8 +65,8 @@ const renderless = (props, { reactive, inject }, { dispatch, vm }) => {
69
65
  Object.assign(api2, {
70
66
  dataStore,
71
67
  handleClick: handleClick({ dataStore, props, vm }),
72
- mouseEnter: mouseEnter({ dataStore, vm, props }),
73
- mouseLeave: mouseLeave({ dataStore, props })
68
+ mouseEnter: mouseEnter({ dataStore, vm }),
69
+ mouseLeave: mouseLeave({ dataStore })
74
70
  });
75
71
  return api2;
76
72
  };
@@ -39,6 +39,7 @@ const api = [
39
39
  ];
40
40
  const initState = ({ reactive, computed, api: api2, props, parent, dropdownMenuVm }) => {
41
41
  const state = reactive({
42
+ checkedStatus: dropdownMenuVm == null ? void 0 : dropdownMenuVm.checkedStatus,
42
43
  sort: props.modelValue,
43
44
  transition: true,
44
45
  getTitle: false,
@@ -52,9 +53,12 @@ const initState = ({ reactive, computed, api: api2, props, parent, dropdownMenuV
52
53
  itemStyle: computed(() => api2.getItemStyle()),
53
54
  activeColor: computed(() => parent.activeColor),
54
55
  closeOnClickOverlay: computed(() => parent.closeOnClickOverlay),
56
+ dropdownMenuVm,
57
+ currentIndex: props.currentIndex,
55
58
  textField: (dropdownMenuVm == null ? void 0 : dropdownMenuVm.textField) || props.textField,
56
59
  popperClass: (dropdownMenuVm == null ? void 0 : dropdownMenuVm.popperClass) || "",
57
- getIcon: computed(() => api2.computedGetIcon())
60
+ getIcon: computed(() => api2.computedGetIcon()),
61
+ children: []
58
62
  });
59
63
  return state;
60
64
  };
@@ -77,21 +81,30 @@ const initApi = ({ api: api2, state, emit, props, parent, dispatch, vm, constant
77
81
  getItemStyle: getItemStyle({ parent, state }),
78
82
  bindScroll: bindScroll({ api: api2, parent }),
79
83
  confirm: confirm({ emit, props, state }),
80
- handleClick: handleClick({ props, dispatch, vm, emit }),
84
+ handleClick: handleClick({ state, props, dispatch, vm, emit }),
81
85
  computedGetIcon: computedGetIcon({ constants, designConfig }),
82
86
  getTip: getTip({ props, vm })
83
87
  });
84
88
  };
85
- const renderless = (props, { computed, reactive, watch, inject }, { parent, emit, vm, dispatch, mode, constants, designConfig }) => {
89
+ const renderless = (props, { computed, onMounted, reactive, watch, inject }, { parent, emit, vm, dispatch, constants, designConfig }) => {
86
90
  const api2 = {};
87
91
  const dropdownMenuVm = inject("dropdownMenuVm", null);
88
- if (mode === "mobile" && dropdownMenuVm) {
89
- dropdownMenuVm.state.children = [...dropdownMenuVm.state.children, vm];
90
- }
91
- parent = parent.$parent;
92
92
  const state = initState({ reactive, computed, api: api2, props, parent, dropdownMenuVm });
93
93
  initApi({ api: api2, state, emit, props, parent, dispatch, vm, constants, designConfig });
94
94
  watch(() => state.showPopup, api2.bindScroll);
95
+ onMounted(() => {
96
+ const realParent = parent.$parent.$parent || {};
97
+ if (realParent.state && realParent.state.children) {
98
+ realParent.state.children.push(vm);
99
+ } else {
100
+ if (dropdownMenuVm) {
101
+ dropdownMenuVm.state.children = [...dropdownMenuVm.state.children, vm];
102
+ }
103
+ }
104
+ if (props.disabled) {
105
+ state.checkedStatus = false;
106
+ }
107
+ });
95
108
  return api2;
96
109
  };
97
110
  export {
@@ -6,7 +6,7 @@ const toggleItem = (state) => (active, item) => {
6
6
  if (item.disabled) {
7
7
  return;
8
8
  }
9
- if (item.type == "sort") {
9
+ if (item.type === "sort") {
10
10
  if (!item.modelValue || item.modelValue === "desc") {
11
11
  item.state.sort = "asc";
12
12
  item.$emit("update:modelValue", "asc");
@@ -64,21 +64,34 @@ const getScroller = (el, root) => {
64
64
  }
65
65
  return root || null;
66
66
  };
67
- const useVuePopper = ({ api, props, hooks, instance, state, dropdownVm }) => {
67
+ const useVuePopper = ({
68
+ api,
69
+ props,
70
+ hooks,
71
+ instance,
72
+ state,
73
+ dropdownVm,
74
+ designConfig
75
+ }) => {
76
+ var _a, _b;
68
77
  const { nextTick, onBeforeUnmount, onDeactivated, onMounted, reactive, toRefs, watch } = hooks;
69
- const { emit, refs, slots, vm, parent } = instance;
78
+ const { emit, slots, vm, parent } = instance;
79
+ const designProps = {
80
+ placement: props.placement || ((_a = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _a.placement) || "bottom-end",
81
+ visibleArrow: props.visibleArrow || ((_b = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _b.visibleArrow) || false
82
+ };
70
83
  const popper = userPopper({
71
84
  emit,
72
85
  nextTick,
73
86
  onBeforeUnmount,
74
87
  onDeactivated,
75
- props: __spreadValues({
88
+ props: __spreadValues(__spreadValues({
76
89
  popperOptions: { boundariesPadding: 0, gpuAcceleration: false },
77
90
  offset: 0,
78
91
  boundariesPadding: 5
79
- }, props),
92
+ }, props), designProps),
80
93
  reactive,
81
- refs,
94
+ vm,
82
95
  slots,
83
96
  toRefs,
84
97
  watch
@@ -118,7 +131,7 @@ const useVuePopper = ({ api, props, hooks, instance, state, dropdownVm }) => {
118
131
  );
119
132
  };
120
133
  const mounted = ({ api, parent, state }) => () => {
121
- parent.$on("menuselectedIndex", (selectedIndex) => {
134
+ parent.$on("menu-selected-index", (selectedIndex) => {
122
135
  state.selectedIndex = selectedIndex;
123
136
  });
124
137
  parent.$on("menu-item-click", api.handleMenuItemClick);
@@ -22,7 +22,7 @@ const api = [
22
22
  const renderless = (props, hooks, instance) => {
23
23
  const api2 = {};
24
24
  const { reactive, provide, onMounted, inject } = hooks;
25
- const { nextTick, mode, vm, parent, dispatch, emit } = instance;
25
+ const { nextTick, mode, vm, parent, dispatch, emit, designConfig } = instance;
26
26
  const state = reactive({
27
27
  offset: 0,
28
28
  scroller: null,
@@ -32,7 +32,8 @@ const renderless = (props, hooks, instance) => {
32
32
  label: "",
33
33
  showContent: false,
34
34
  selected: false,
35
- selectedIndex: -1
35
+ selectedIndex: -1,
36
+ canvasHeight: inject("change-size", null)
36
37
  });
37
38
  provide("dropdownMenuVm", vm);
38
39
  provide("multiStage", props.multiStage);
@@ -42,7 +43,7 @@ const renderless = (props, hooks, instance) => {
42
43
  state.scroller = getScroller(vm.$refs.menu);
43
44
  });
44
45
  } else {
45
- useVuePopper({ api: api2, hooks, props, instance, state, dropdownVm });
46
+ useVuePopper({ api: api2, hooks, props, instance, state, dropdownVm, designConfig });
46
47
  }
47
48
  Object.assign(api2, {
48
49
  state,
@@ -1,10 +1,5 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- const create = (emit) => () => emit("btn-click");
3
- const getMessage = ({ props, t }) => () => {
4
- const types = ["build", "weaknet", "pcview", "busy", "noperm"];
5
- return props.message || t(`ui.exception.${~types.indexOf(props.type) ? props.type : "nodata"}`);
6
- };
2
+ const emitClick = (emit) => () => emit("click");
7
3
  export {
8
- create,
9
- getMessage
4
+ emitClick
10
5
  };
package/exception/vue.js CHANGED
@@ -1,17 +1,14 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- import { create, getMessage } from "./index";
2
+ import { emitClick } from "./index";
3
3
  const api = ["state", "create"];
4
- const renderless = (props, { computed, reactive }, { t, emit }, { images }) => {
5
- const api2 = {
6
- create: create(emit),
7
- getMessage: getMessage({ props, t })
8
- };
4
+ const renderless = (props, { reactive }, { emit }) => {
9
5
  const state = reactive({
10
- urlType: props.type,
11
- images,
12
- message: computed(() => api2.getMessage({ props, t }))
6
+ urlType: props.type
13
7
  });
14
- api2.state = state;
8
+ const api2 = {
9
+ state,
10
+ create: emitClick(emit)
11
+ };
15
12
  return api2;
16
13
  };
17
14
  export {
@@ -33,7 +33,11 @@ const computePx = ({ props, refs, state }) => () => {
33
33
  const list = refs.list;
34
34
  const width = list.parentElement.clientWidth;
35
35
  const arr = list.querySelectorAll("li");
36
- const set = { data: [], offset: [], index: [] };
36
+ const set = {
37
+ data: [],
38
+ offset: [],
39
+ index: []
40
+ };
37
41
  const liWidth = [];
38
42
  let innerwidth = 0;
39
43
  let start = 0;
package/fall-menu/vue.js CHANGED
@@ -12,7 +12,12 @@ import {
12
12
  computeData
13
13
  } from "./index";
14
14
  const api = ["state", "fall", "arrowClick", "mouseover", "mouseout", "overContent", "reRender", "left"];
15
- const initState = ({ reactive, computed, api: api2, props }) => {
15
+ const initState = ({
16
+ reactive,
17
+ computed,
18
+ api: api2,
19
+ props
20
+ }) => {
16
21
  const state = reactive({
17
22
  pager: 1,
18
23
  level2data: [],
@@ -24,7 +29,13 @@ const initState = ({ reactive, computed, api: api2, props }) => {
24
29
  });
25
30
  return state;
26
31
  };
27
- const initApi = ({ api: api2, state, fall, props, refs }) => {
32
+ const initApi = ({
33
+ api: api2,
34
+ state,
35
+ fall,
36
+ props,
37
+ refs
38
+ }) => {
28
39
  Object.assign(api2, {
29
40
  fall,
30
41
  state,
@@ -77,7 +77,7 @@ const watchListType = ({ constants, state, api }) => (type) => {
77
77
  try {
78
78
  file.url = URL.createObjectURL(file.raw);
79
79
  } catch (err) {
80
- return;
80
+ return null;
81
81
  }
82
82
  }
83
83
  return file;
@@ -412,7 +412,8 @@ const getFileHash = ({
412
412
  };
413
413
  });
414
414
  };
415
- const handleHwh5Files = (files) => {
415
+ const handleHwh5Files = (files, hwh5) => {
416
+ const fileMap = hwh5 && hwh5.fileMap;
416
417
  return files.map((file) => {
417
418
  if (file instanceof File)
418
419
  return file;
@@ -427,7 +428,8 @@ const handleHwh5Files = (files) => {
427
428
  const [name, index] = url.match(/[^/]*$/);
428
429
  const [type] = url.match(/\.[^.]*$/);
429
430
  const filePath = url.substring(0, index);
430
- return __spreadProps(__spreadValues({}, f), { type, name, filePath, webkitRelativePath: filePath });
431
+ const updateFile2 = __spreadProps(__spreadValues({}, f), { type, name, filePath, webkitRelativePath: filePath });
432
+ return typeof fileMap === "function" ? fileMap(updateFile2) : updateFile2;
431
433
  });
432
434
  };
433
435
  const handleStart = ({
@@ -438,7 +440,7 @@ const handleStart = ({
438
440
  vm
439
441
  }) => (rawFiles, updateId, reUpload = false) => {
440
442
  if (state.isHwh5) {
441
- rawFiles = handleHwh5Files(rawFiles);
443
+ rawFiles = handleHwh5Files(rawFiles, props.hwh5);
442
444
  }
443
445
  state.currentUploadingFileUids = [];
444
446
  rawFiles.forEach((rawFile) => api.addFileToList(rawFile, updateId, reUpload));
@@ -481,14 +483,14 @@ const handleStart = ({
481
483
  }
482
484
  if (!state.isEdm && props.autoUpload) {
483
485
  if (props.multiple && props.mergeService) {
484
- const handler = (file) => (vm.$refs[constants.UPLOAD_INNER].$refs[constants.UPLOAD_INNER_TEMPLATE].upload(file.raw), void 0);
486
+ const handler = (file) => vm.$refs[constants.UPLOAD_INNER].$refs[constants.UPLOAD_INNER_TEMPLATE].upload(file.raw);
485
487
  rawFiles.length && api.beforeUpload({ raw: rawFiles }, true, handler);
486
488
  } else {
487
489
  rawFiles.forEach((rawFile) => {
488
490
  const file = api.getFile(rawFile);
489
491
  if (!file)
490
492
  return;
491
- const handler = (file2) => (vm.$refs[constants.UPLOAD_INNER].$refs[constants.UPLOAD_INNER_TEMPLATE].upload(file2.raw), void 0);
493
+ const handler = (file2) => vm.$refs[constants.UPLOAD_INNER].$refs[constants.UPLOAD_INNER_TEMPLATE].upload(file2.raw);
492
494
  api.beforeUpload(file, true, handler);
493
495
  });
494
496
  }
@@ -560,6 +562,7 @@ const handleSuccess = ({
560
562
  Modal,
561
563
  t
562
564
  }) => (res, rawFile) => {
565
+ var _a;
563
566
  const currentUploadFiles = state.uploadFiles.filter((file) => state.currentUploadingFileUids.includes(file.uid));
564
567
  if (Array.isArray(rawFile)) {
565
568
  state.uploadFiles.forEach((file) => {
@@ -574,7 +577,7 @@ const handleSuccess = ({
574
577
  });
575
578
  } else {
576
579
  const file = api.getFile(rawFile);
577
- const status = res.data && res.data.status;
580
+ const status = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.status;
578
581
  const { STATUS_SPECIAL_CHARACTERS, NOT_SUPPORT_SPECIAL_CHARACTERS } = constants.EDM;
579
582
  delete file.cancelToken;
580
583
  if (props.edm.upload && file && res.data && status !== 200) {
@@ -801,7 +804,12 @@ const getTranslateFile = ({
801
804
  } else {
802
805
  const content = data.headers["content-disposition"];
803
806
  const name = content ? content.match(/fileName.?=(.*)/)[1] || content.match(/fileName=(.*)/)[1] : "";
804
- const type2 = !name.includes(".") ? data.headers["content-type"] : type2 !== "zip" ? "application / x - xls" : "application/zip";
807
+ let type2 = "application/zip";
808
+ if (!name.includes(".")) {
809
+ type2 = data.headers["content-type"];
810
+ } else if (type2 !== "zip") {
811
+ type2 = "application / x - xls";
812
+ }
805
813
  const blob = new Blob([data.data], { type: type2 });
806
814
  aLinkDownload({ blob, name });
807
815
  }
@@ -953,11 +961,16 @@ const downloadFileSingle = ({
953
961
  isLessThan17G,
954
962
  url: fileUrl
955
963
  } = args;
956
- const promise = fileUrl ? Promise.resolve(fileUrl) : service.getSingleDownloadUrl().then((url) => {
957
- let serviceUrl = url.replace(/{docId}/, file.docId || file) + `${~url.indexOf("?") ? "&" : "?"}x-download-sign=true&docVersion=${file.docVersion || ""}${file.decryptKey ? "&decryptKey=" + file.decryptKey : ""}`;
958
- serviceUrl = api.modifyServiceUrlSingle({ file, serviceUrl, range });
959
- return serviceUrl;
960
- });
964
+ let promise;
965
+ if (fileUrl) {
966
+ promise = Promise.resolve(fileUrl);
967
+ } else {
968
+ promise = service.getSingleDownloadUrl().then((url) => {
969
+ let serviceUrl = url.replace(/{docId}/, file.docId || file) + `${~url.indexOf("?") ? "&" : "?"}x-download-sign=true&docVersion=${file.docVersion || ""}${file.decryptKey ? "&decryptKey=" + file.decryptKey : ""}`;
970
+ serviceUrl = api.modifyServiceUrlSingle({ file, serviceUrl, range });
971
+ return serviceUrl;
972
+ });
973
+ }
961
974
  promise.then((url) => {
962
975
  url = xss.filterUrl(url);
963
976
  let params = {
@@ -1179,9 +1192,9 @@ const getDownloadFileInfo = ({ api, state, props, service }) => ({ docId }) => {
1179
1192
  cancelToken: api.createDownloadCancelToken({ docId }),
1180
1193
  data: { docInfoVO: { ids: [docId], docType: "", docVersion: "" } }
1181
1194
  }).then((res) => {
1182
- const { data, outDocQueryList } = res || {};
1195
+ const { data } = res || {};
1183
1196
  if (data && data.status === 200) {
1184
- const fileInfo = outDocQueryList && outDocQueryList[0].verInfo[0].docInfo[0];
1197
+ const fileInfo = data.result.outDocQueryList && data.result.outDocQueryList[0].verInfo[0].docInfo[0];
1185
1198
  resolve(fileInfo);
1186
1199
  } else {
1187
1200
  reject(res);
@@ -1867,7 +1880,7 @@ const getPreviewUrlSync = ({ constants, props, state }) => (file, batch) => {
1867
1880
  authToken: edmToken,
1868
1881
  jslibhtml: html,
1869
1882
  docId: file.docId,
1870
- docVersion: file.docVersion || file.version || "V1",
1883
+ docVersion: file.docVersion || file.version || "",
1871
1884
  type: "doc",
1872
1885
  pageNum: "1"
1873
1886
  });
@@ -1937,7 +1950,7 @@ const previewImageBatch = ({ service, api }) => ({ url, file }) => {
1937
1950
  });
1938
1951
  return service.all(promises);
1939
1952
  };
1940
- const getDialogConfigObj = ({ props, state }) => () => {
1953
+ const getDialogConfigObj = ({ props, state, t, constants }) => () => {
1941
1954
  const dialogConfigDefault = {
1942
1955
  class: "single-download-modal single-download-modal1",
1943
1956
  style: "",
@@ -1945,7 +1958,7 @@ const getDialogConfigObj = ({ props, state }) => () => {
1945
1958
  lockScroll: true,
1946
1959
  visible: state.showPreview,
1947
1960
  dragable: true,
1948
- title: "\u6587\u6863\u9884\u89C8",
1961
+ title: t(constants.EDM.DOC_PREVIEW),
1949
1962
  width: "60%"
1950
1963
  },
1951
1964
  on: {
@@ -1985,6 +1998,7 @@ const computeDocChunkSize = ({ props, state, constants }) => () => {
1985
1998
  chunkSize = Math.max(size, SIZE_2M);
1986
1999
  return true;
1987
2000
  }
2001
+ return false;
1988
2002
  });
1989
2003
  }
1990
2004
  state.docSize = docSize * 1024;
@@ -2049,6 +2063,8 @@ const handleTriggerClick = ({
2049
2063
  emit("trigger-click", $event, type);
2050
2064
  };
2051
2065
  const onBeforeDestroy = (state) => () => {
2066
+ if (!Array.isArray(state.uploadFiles))
2067
+ return;
2052
2068
  state.uploadFiles.forEach((file) => {
2053
2069
  if (file.url && file.url.indexOf("blob:") === 0) {
2054
2070
  URL.revokeObjectURL(file.url);
@@ -2067,6 +2083,38 @@ const encryptDialogConfirm = ({ state }) => () => {
2067
2083
  state.encryptDialogConfig.show = false;
2068
2084
  typeof selectFileMethod === "function" && selectFileMethod();
2069
2085
  };
2086
+ const closeRecordPanel = ({ vm, constants, state, props }) => () => {
2087
+ const { PICTURE_CARD } = constants.LIST_TYPE;
2088
+ const { isHwh5 } = state;
2089
+ const { listType } = props;
2090
+ if (listType === PICTURE_CARD && isHwh5) {
2091
+ vm.$refs[constants.UPLOAD_LIST_INNER].$refs[constants.UPLOAD_LIST_INNER_TEMPLATE].state.showAudioPanel = false;
2092
+ }
2093
+ };
2094
+ const getTipMessage = ({ t, api, constants }) => ({ accept, fileSize, limit }) => {
2095
+ let acceptTip = "";
2096
+ if (accept) {
2097
+ acceptTip = t(constants.ONLY_SUPPORT, {
2098
+ type: accept.split(",").map((item) => item.trim().replace(/^\./, "")).join(t(constants.COMMA))
2099
+ });
2100
+ }
2101
+ if (fileSize && acceptTip.length !== 0) {
2102
+ acceptTip += `${t(constants.COMMA)} `;
2103
+ }
2104
+ let fileSizeTip = "";
2105
+ let kibibyte = 1024;
2106
+ if (typeof fileSize === "number") {
2107
+ fileSizeTip = `${t(constants.FILE_NOT_LESS_THAN)}${api.formatFileSize(fileSize * kibibyte)}`;
2108
+ } else if (Array.isArray(fileSize)) {
2109
+ fileSizeTip += !isNaN(fileSize[0]) ? `${t(constants.FILE_NOT_LESS_THAN)}${api.formatFileSize(Number(fileSize[0]) * kibibyte)}${t(constants.COMMA)}` : "";
2110
+ fileSizeTip += !isNaN(fileSize[1]) ? `${t(constants.FILE_NOT_MORE_THAN)}${api.formatFileSize(Number(fileSize[1]) * kibibyte)}` : "";
2111
+ }
2112
+ let limitTip = limit ? t(constants.NUMBER_LIMIT, { number: limit }) : "";
2113
+ if ((fileSize || acceptTip.length !== 0) && limit) {
2114
+ limitTip = `${t(constants.COMMA)} ` + limitTip;
2115
+ }
2116
+ return acceptTip + fileSizeTip + limitTip;
2117
+ };
2070
2118
  export {
2071
2119
  abort,
2072
2120
  abortDownload,
@@ -2078,6 +2126,7 @@ export {
2078
2126
  calcUploadingFilesInfo,
2079
2127
  clearFiles,
2080
2128
  clearUploadingFiles,
2129
+ closeRecordPanel,
2081
2130
  computeDocChunkSize,
2082
2131
  computedSourcetype,
2083
2132
  computedUploadDisabled,
@@ -2103,6 +2152,7 @@ export {
2103
2152
  getKiaScanTip,
2104
2153
  getNewTabPreviewUrl,
2105
2154
  getPreviewUrlSync,
2155
+ getTipMessage,
2106
2156
  getToken,
2107
2157
  handleChange,
2108
2158
  handleClick,
@@ -71,7 +71,9 @@ import {
71
71
  computedSourcetype,
72
72
  getFileSourceType,
73
73
  encryptDialogConfirm,
74
- handleTriggerClick
74
+ handleTriggerClick,
75
+ closeRecordPanel,
76
+ getTipMessage
75
77
  } from "./index";
76
78
  import { isEmptyObject } from "../common/type";
77
79
  const api = [
@@ -99,10 +101,24 @@ const api = [
99
101
  "abortDownload",
100
102
  "handleClickFileList",
101
103
  "handleTriggerClick",
104
+ "closeRecordPanel",
102
105
  "encryptDialogConfirm",
103
- "formatFileSize"
106
+ "formatFileSize",
107
+ "getTipMessage"
104
108
  ];
105
- const initState = ({ api: api2, reactive, computed, inject, ref, vm, props, httpRequest, service }) => {
109
+ const initState = ({
110
+ api: api2,
111
+ reactive,
112
+ computed,
113
+ inject,
114
+ ref,
115
+ vm,
116
+ props,
117
+ httpRequest,
118
+ service,
119
+ useBreakpoint
120
+ }) => {
121
+ const { current } = useBreakpoint();
106
122
  const state = reactive({
107
123
  url: "",
108
124
  updateId: "",
@@ -165,7 +181,8 @@ const initState = ({ api: api2, reactive, computed, inject, ref, vm, props, http
165
181
  encryptDialogConfig: {
166
182
  show: false,
167
183
  selectFileMethod: null
168
- }
184
+ },
185
+ current
169
186
  });
170
187
  return state;
171
188
  };
@@ -185,7 +202,7 @@ const initApi = ({ api: api2, state, props, constants, vm, $service, t, Modal })
185
202
  computedUploadingSize: computedUploadingSize({ state, constants }),
186
203
  getFileUploadUrl: getFileUploadUrl($service),
187
204
  getToken: getToken({ constants, props, state, t, Modal }),
188
- getDialogConfigObj: getDialogConfigObj({ props, state }),
205
+ getDialogConfigObj: getDialogConfigObj({ props, state, t, constants }),
189
206
  computeDocChunkSize: computeDocChunkSize({ props, state, constants }),
190
207
  updateFile: updateFile({ constants, vm }),
191
208
  getPreviewUrlSync: getPreviewUrlSync({ constants, props, state }),
@@ -203,6 +220,7 @@ const initApi = ({ api: api2, state, props, constants, vm, $service, t, Modal })
203
220
  computedSourcetype: computedSourcetype({ props, constants }),
204
221
  getFileSourceType: getFileSourceType({ state, props, constants }),
205
222
  encryptDialogConfirm: encryptDialogConfirm({ state }),
223
+ getTipMessage: getTipMessage({ t, api: api2, constants }),
206
224
  formatFileSize
207
225
  });
208
226
  };
@@ -246,7 +264,8 @@ const mergeApi = ({ api: api2, props, $service, state, constants, emit, mode, Mo
246
264
  validateDownloadStatus: validateDownloadStatus({ state, Modal }),
247
265
  handleChange: handleChange({ vm, constants }),
248
266
  handleClickFileList: handleClickFileList({ state, emit }),
249
- handleTriggerClick: handleTriggerClick({ vm, state, constants, props, emit })
267
+ handleTriggerClick: handleTriggerClick({ vm, state, constants, props, emit }),
268
+ closeRecordPanel: closeRecordPanel({ vm, constants, state, props })
250
269
  });
251
270
  };
252
271
  const initWatch = ({ watch, state, api: api2, props, $service }) => {
@@ -278,11 +297,22 @@ const initWatch = ({ watch, state, api: api2, props, $service }) => {
278
297
  watch(() => props.edm, api2.computeDocChunkSize, { deep: true, immediate: true });
279
298
  };
280
299
  let getApi = () => ({});
281
- const renderless = (props, { computed, inject, onBeforeUnmount, provide, reactive, ref, watch, onMounted }, { t, vm, parent, emit, service, mode, constants }, { Modal, CryptoJS, Streamsaver }) => {
300
+ const renderless = (props, { computed, inject, onBeforeUnmount, provide, reactive, ref, watch, onMounted }, { t, vm, parent, emit, service, mode, constants, useBreakpoint }, { Modal, CryptoJS, Streamsaver }) => {
282
301
  let api2 = {};
283
302
  const $service = initService({ props, service });
284
303
  const httpRequest = $service.httpRequest;
285
- const state = initState({ reactive, computed, api: api2, inject, ref, vm, props, httpRequest, service });
304
+ const state = initState({
305
+ reactive,
306
+ computed,
307
+ api: api2,
308
+ inject,
309
+ ref,
310
+ vm,
311
+ props,
312
+ httpRequest,
313
+ service,
314
+ useBreakpoint
315
+ });
286
316
  initApi({ api: api2, state, props, constants, vm, $service, t, Modal });
287
317
  mergeApi({ api: api2, props, $service, state, constants, emit, mode, Modal, t, vm, CryptoJS, Streamsaver });
288
318
  getApi = () => api2;
@@ -3,6 +3,7 @@ const handleClear = ({ dispatch, emit }) => ($event) => {
3
3
  dispatch("Picker", "handle-clear", $event);
4
4
  dispatch("Select", "handle-clear", $event);
5
5
  dispatch("Cascader", "handle-clear", $event);
6
+ dispatch("Amount", "handle-clear", $event);
6
7
  emit("handle-clear");
7
8
  };
8
9
  const handeClick = ({ props, emit }) => ($event) => {
@@ -0,0 +1,42 @@
1
+ import "../chunk-G2ADBYYC.js";
2
+ const handleScroll = ({ props, state }) => {
3
+ if (props.element) {
4
+ const beforeHeight = props.element.scrollTop || document.documentElement.scrollTop || document.body.scrollTop;
5
+ if (beforeHeight <= props.visibilityHeight) {
6
+ state.show = false;
7
+ }
8
+ props.element.onscroll = function() {
9
+ state.show = true;
10
+ const height = props.element.scrollTop || document.documentElement.scrollTop || document.body.scrollTop;
11
+ if (height <= props.visibilityHeight) {
12
+ state.show = false;
13
+ }
14
+ };
15
+ }
16
+ };
17
+ const handleClick = ({ emit, props, state }) => (event) => {
18
+ var _a;
19
+ if (props.trigger === "click" && props.resetTime > 0 && !props.backTop) {
20
+ state.disabled = true;
21
+ state.open = !state.open;
22
+ state.timer = window.setTimeout(() => {
23
+ state.disabled = false;
24
+ }, props.resetTime);
25
+ }
26
+ if (!props.trigger && (props.href || props.target) && !props.backTop) {
27
+ window.open(props.href, props.target);
28
+ }
29
+ if (props.backTop) {
30
+ (_a = props.element) == null ? void 0 : _a.scrollTo({
31
+ top: 0,
32
+ behavior: "smooth"
33
+ });
34
+ }
35
+ emit("click", event);
36
+ };
37
+ const clearTimer = (state) => () => clearTimeout(state.timer);
38
+ export {
39
+ clearTimer,
40
+ handleClick,
41
+ handleScroll
42
+ };