@opentiny/vue-renderless 3.6.8 → 3.8.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 (314) hide show
  1. package/action-sheet/index.js +28 -1
  2. package/action-sheet/vue.js +10 -4
  3. package/alert/index.js +24 -2
  4. package/alert/vue.js +15 -11
  5. package/amount/index.js +4 -4
  6. package/anchor/index.js +1 -1
  7. package/autocomplete/vue.js +3 -3
  8. package/autonavi-map/index.js +1 -1
  9. package/badge/vue.js +6 -6
  10. package/baidu-map/index.js +1 -1
  11. package/bulletin-board/index.js +1 -1
  12. package/calendar/index.js +2 -2
  13. package/calendar-bar/index.js +268 -0
  14. package/calendar-bar/vue.js +87 -0
  15. package/card/index.js +84 -0
  16. package/card/vue.js +70 -0
  17. package/card-group/index.js +16 -0
  18. package/card-group/vue.js +21 -0
  19. package/card-template/index.js +1 -1
  20. package/carousel/index.js +89 -2
  21. package/carousel/vue.js +14 -5
  22. package/carousel-item/index.js +8 -0
  23. package/carousel-item/vue.js +7 -3
  24. package/cascader/index.js +6 -6
  25. package/cascader/vue.js +3 -3
  26. package/cascader-menu/vue.js +2 -2
  27. package/cascader-panel/index.js +4 -4
  28. package/cascader-panel/node.js +4 -4
  29. package/cascader-panel/vue.js +2 -2
  30. package/cascader-select/index.js +179 -0
  31. package/cascader-select/vue.js +74 -0
  32. package/cell/vue.js +16 -0
  33. package/chart-bar/index.js +3 -3
  34. package/chart-boxplot/index.js +2 -2
  35. package/chart-candle/index.js +3 -3
  36. package/chart-core/deps/utils.js +7 -7
  37. package/chart-core/index.js +2 -2
  38. package/chart-funnel/index.js +3 -3
  39. package/chart-gauge/index.js +3 -3
  40. package/chart-graph/index.js +1 -1
  41. package/chart-heatmap/index.js +2 -2
  42. package/chart-line/index.js +3 -3
  43. package/chart-liquidfill/index.js +2 -2
  44. package/chart-map/index.js +3 -3
  45. package/chart-pie/index.js +3 -3
  46. package/chart-radar/index.js +3 -3
  47. package/chart-sankey/index.js +3 -3
  48. package/chart-scatter/index.js +4 -4
  49. package/chart-sunburst/index.js +1 -1
  50. package/chart-tree/index.js +2 -2
  51. package/chart-waterfall/index.js +3 -3
  52. package/chart-wordcloud/index.js +2 -2
  53. package/checkbox/index.js +21 -0
  54. package/checkbox/vue.js +16 -3
  55. package/checkbox-button/vue.js +1 -1
  56. package/collapse-item/vue.js +1 -1
  57. package/column-list-group/index.js +0 -0
  58. package/column-list-group/vue.js +14 -0
  59. package/column-list-item/index.js +50 -0
  60. package/column-list-item/vue.js +39 -0
  61. package/common/array.js +3 -3
  62. package/common/bigInt.js +5 -2
  63. package/common/dataset/index.js +3 -3
  64. package/common/date.js +2 -2
  65. package/common/deps/ResizeObserver.js +1 -1
  66. package/common/deps/clickoutside.js +1 -1
  67. package/common/deps/date-util.js +4 -4
  68. package/common/deps/date.js +2 -2
  69. package/common/deps/debounce.js +1 -1
  70. package/common/deps/dom.js +1 -1
  71. package/common/deps/fullscreen/apis.js +3 -3
  72. package/common/deps/fullscreen/screenfull.js +1 -1
  73. package/common/deps/infinite-scroll.js +176 -0
  74. package/common/deps/letter-only.js +1 -1
  75. package/common/deps/number-only.js +1 -1
  76. package/common/deps/observe-visibility.js +106 -0
  77. package/common/deps/popper.js +20 -22
  78. package/common/deps/popup-manager.js +2 -2
  79. package/common/deps/repeat-click.js +1 -1
  80. package/common/deps/resize-event.js +1 -1
  81. package/common/deps/tree-model/node.js +5 -5
  82. package/common/deps/tree-model/tree-store.js +3 -3
  83. package/common/deps/upload-ajax.js +2 -2
  84. package/common/deps/vue-popper.js +4 -4
  85. package/common/deps/vue-popup.js +4 -4
  86. package/common/index.js +2 -2
  87. package/common/object.js +1 -1
  88. package/common/runtime.js +24 -24
  89. package/common/string.js +23 -4
  90. package/common/validate/rules/range.js +2 -2
  91. package/common/validate/rules/required.js +1 -1
  92. package/common/validate/rules/type.js +3 -3
  93. package/common/validate/schema.js +1 -1
  94. package/common/validate/util.js +1 -1
  95. package/common/validate/validations/array.js +1 -1
  96. package/common/validate/validations/date.js +1 -1
  97. package/common/validate/validations/enum.js +1 -1
  98. package/common/validate/validations/float.js +1 -1
  99. package/common/validate/validations/integer.js +1 -1
  100. package/common/validate/validations/method.js +1 -1
  101. package/common/validate/validations/number.js +1 -1
  102. package/common/validate/validations/pattern.js +1 -1
  103. package/common/validate/validations/string.js +1 -1
  104. package/common/validate/validations/type.js +1 -1
  105. package/container/index.js +1 -1
  106. package/crop/index.js +2 -2
  107. package/currency/index.js +2 -2
  108. package/date-panel/index.js +7 -7
  109. package/date-panel/vue.js +3 -2
  110. package/date-picker-mobile/index.js +250 -0
  111. package/date-picker-mobile/vue.js +86 -0
  112. package/date-range/index.js +1 -1
  113. package/date-range/vue.js +1 -1
  114. package/date-table/index.js +3 -3
  115. package/date-table/vue.js +1 -1
  116. package/dialog-box/index.js +6 -4
  117. package/dialog-box/vue.js +1 -1
  118. package/dialog-select/index.js +345 -0
  119. package/dialog-select/vue.js +110 -0
  120. package/drawer/index.js +83 -0
  121. package/drawer/vue.js +51 -0
  122. package/drop-times/index.js +1 -1
  123. package/dropdown/index.js +2 -2
  124. package/dropdown/vue.js +1 -1
  125. package/dropdown-item/index.js +1 -1
  126. package/dropdown-item/mf.js +79 -0
  127. package/dropdown-menu/index.js +30 -1
  128. package/dropdown-menu/vue.js +17 -7
  129. package/dynamic-scroller/index.js +117 -0
  130. package/dynamic-scroller/vue.js +88 -0
  131. package/dynamic-scroller-item/index.js +147 -0
  132. package/dynamic-scroller-item/vue.js +92 -0
  133. package/espace/index.js +1 -1
  134. package/espace/vue.js +1 -1
  135. package/exception/vue.js +3 -1
  136. package/fall-menu/index.js +4 -4
  137. package/file-upload/index.js +872 -408
  138. package/file-upload/vue.js +87 -36
  139. package/filter/index.js +131 -0
  140. package/filter/tag-group.js +43 -0
  141. package/filter/vue.js +73 -0
  142. package/filter-bar/index.js +9 -0
  143. package/filter-bar/vue.js +16 -0
  144. package/filter-box/index.js +17 -0
  145. package/filter-box/vue.js +19 -0
  146. package/filter-panel/index.js +42 -0
  147. package/filter-panel/vue.js +33 -0
  148. package/floatbar/index.js +1 -1
  149. package/flowchart/index.js +721 -0
  150. package/flowchart/vue.js +81 -0
  151. package/form/index.js +15 -1
  152. package/form/vue.js +10 -4
  153. package/form-item/index.js +46 -6
  154. package/form-item/vue.js +27 -3
  155. package/fullscreen/index.js +1 -1
  156. package/fullscreen/vue.js +1 -1
  157. package/grid/plugins/export.js +2 -2
  158. package/grid/plugins/exportExcel.js +2 -2
  159. package/grid/plugins/resize.js +1 -1
  160. package/grid/static/base/helperEqualCompare.js +1 -1
  161. package/grid/static/base/isPlainObject.js +1 -1
  162. package/grid/utils/common.js +3 -3
  163. package/grid/utils/dom.js +3 -3
  164. package/grid/utils/event.js +2 -2
  165. package/guide/index.js +168 -0
  166. package/guide/vue.js +36 -0
  167. package/hrapprover/index.js +1 -1
  168. package/image/index.js +8 -4
  169. package/image/vue.js +12 -6
  170. package/image-viewer/index.js +3 -3
  171. package/image-viewer/vue.js +16 -6
  172. package/input/index.js +34 -1
  173. package/input/vue.js +22 -6
  174. package/ip-address/index.js +1 -1
  175. package/ip-address/vue.js +1 -1
  176. package/link-menu/index.js +2 -2
  177. package/link-menu/vue.js +2 -2
  178. package/loading/index.js +2 -2
  179. package/loading/vue.js +2 -1
  180. package/locales/index.js +1 -1
  181. package/logout/index.js +1 -1
  182. package/milestone/index.js +5 -1
  183. package/modal/index.js +68 -39
  184. package/modal/vue.js +15 -12
  185. package/month-range/index.js +1 -1
  186. package/month-range/vue.js +1 -1
  187. package/month-table/index.js +5 -5
  188. package/month-table/vue.js +1 -1
  189. package/multi-select/index.js +5 -2
  190. package/multi-select/vue.js +4 -5
  191. package/nav-menu/index.js +6 -6
  192. package/notify/index.js +3 -3
  193. package/numeric/index.js +15 -5
  194. package/numeric/vue.js +15 -6
  195. package/option/index.js +1 -1
  196. package/package.json +2 -1
  197. package/pager-item/index.js +1 -1
  198. package/panel/index.js +1 -1
  199. package/picker/index.js +7 -7
  200. package/picker/vue.js +1 -1
  201. package/picker-column/index.js +1 -1
  202. package/popconfirm/index.js +25 -0
  203. package/popconfirm/vue.js +22 -0
  204. package/popeditor/index.js +7 -7
  205. package/popeditor/vue.js +2 -2
  206. package/popover/index.js +11 -3
  207. package/popover/vue.js +33 -10
  208. package/popup/index.js +4 -4
  209. package/pull-refresh/index.js +8 -11
  210. package/pull-refresh/vue.js +7 -7
  211. package/radio/index.js +17 -0
  212. package/radio/vue.js +18 -3
  213. package/radio-button/index.js +8 -0
  214. package/radio-button/vue.js +19 -4
  215. package/radio-group/index.js +1 -1
  216. package/radio-group/vue.js +5 -2
  217. package/rate/index.js +4 -2
  218. package/rate/vue.js +1 -1
  219. package/record/index.js +190 -0
  220. package/record/vue.js +44 -0
  221. package/recycle-scroller/index.js +470 -0
  222. package/recycle-scroller/vue.js +135 -0
  223. package/river/index.js +371 -0
  224. package/river/river.js +352 -0
  225. package/river/vue.js +77 -0
  226. package/roles/index.js +1 -1
  227. package/scrollbar/vue-bar.js +1 -1
  228. package/scrollbar/vue.js +1 -1
  229. package/search/index.js +3 -3
  230. package/select/index.js +17 -14
  231. package/select/vue.js +14 -8
  232. package/select-dropdown/vue.js +1 -1
  233. package/select-mobile/index.js +111 -0
  234. package/select-mobile/vue.js +58 -0
  235. package/select-view/index.js +170 -0
  236. package/select-view/vue.js +82 -0
  237. package/selected-box/index.js +216 -0
  238. package/selected-box/vue.js +98 -0
  239. package/slide-bar/index.js +1 -1
  240. package/slider/index.js +49 -4
  241. package/slider/vue.js +15 -4
  242. package/split/vue.js +1 -1
  243. package/standard-list-item/index.js +18 -0
  244. package/standard-list-item/vue.js +22 -0
  245. package/steps/index.js +30 -0
  246. package/steps/slide-bar.js +122 -0
  247. package/steps/vue.js +15 -3
  248. package/switch/index.js +1 -1
  249. package/switch/vue.js +2 -1
  250. package/tab-bar/index.js +2 -2
  251. package/tab-item/index.js +2 -2
  252. package/tab-item/vue.js +1 -1
  253. package/tab-item-mf/index.js +0 -0
  254. package/tab-item-mf/vue.js +16 -0
  255. package/tab-nav/index.js +78 -4
  256. package/tab-nav/vue.js +11 -3
  257. package/tabbar-item/index.js +1 -1
  258. package/tabbar-item/vue.js +1 -1
  259. package/tabs/index.js +8 -9
  260. package/tabs/vue.js +1 -1
  261. package/tabs-mf/index.js +109 -0
  262. package/tabs-mf/vue-bar.js +49 -0
  263. package/tabs-mf/vue-nav-item.js +22 -0
  264. package/tabs-mf/vue-nav.js +13 -0
  265. package/tabs-mf/vue.js +45 -0
  266. package/tabs-mf/wheel.js +71 -0
  267. package/tag/index.js +8 -2
  268. package/tag/vue.js +13 -5
  269. package/tag-group/index.js +24 -0
  270. package/tag-group/vue.js +29 -0
  271. package/tall-storage/index.js +1 -1
  272. package/tall-storage/vue.js +1 -1
  273. package/time/index.js +1 -1
  274. package/time/vue.js +2 -2
  275. package/time-line/index.js +28 -7
  276. package/time-line/vue.js +9 -4
  277. package/time-panel/index.js +2 -2
  278. package/time-panel/vue.js +1 -1
  279. package/time-picker-mobile/index.js +30 -0
  280. package/time-picker-mobile/vue.js +30 -0
  281. package/time-range/index.js +1 -1
  282. package/time-range/vue.js +1 -1
  283. package/time-spinner/index.js +2 -2
  284. package/time-spinner/vue.js +1 -1
  285. package/toggle-menu/index.js +2 -2
  286. package/toggle-menu/vue.js +1 -1
  287. package/tooltip/index.js +30 -3
  288. package/tooltip/vue.js +33 -12
  289. package/top-box/index.js +3 -3
  290. package/transfer/index.js +1 -1
  291. package/transfer-panel/index.js +2 -2
  292. package/tree/index.js +6 -6
  293. package/tree/vue.js +1 -1
  294. package/tree-node/index.js +1 -1
  295. package/upload/index.js +1 -1
  296. package/upload/vue.js +2 -2
  297. package/upload-dragger/index.js +5 -1
  298. package/upload-dragger/vue.js +9 -3
  299. package/upload-list/index.js +158 -8
  300. package/upload-list/vue.js +77 -25
  301. package/user/index.js +86 -70
  302. package/user/vue.js +15 -5
  303. package/user-account/vue.js +1 -1
  304. package/user-contact/index.js +49 -3
  305. package/user-contact/vue.js +17 -8
  306. package/user-head-group/vue.js +17 -0
  307. package/user-link/index.js +10 -2
  308. package/user-link/vue.js +11 -6
  309. package/wheel/index.js +1 -1
  310. package/wizard/index.js +3 -3
  311. package/year-range/index.js +125 -0
  312. package/year-range/vue.js +88 -0
  313. package/year-table/index.js +175 -11
  314. package/year-table/vue.js +17 -5
@@ -1,11 +1,12 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { downloadFile as ordinaryDownload } from "@opentiny/vue-renderless/upload-list";
2
+ import { downloadFile as ordinaryDownload } from "../upload-list";
3
3
  import {
4
4
  initService,
5
5
  getNewTabPreviewUrl,
6
6
  previewFile,
7
7
  getToken,
8
8
  downloadFile,
9
+ downloadFileSingleInner,
9
10
  batchSegmentUpload,
10
11
  segmentUpload,
11
12
  sliceChunk,
@@ -46,9 +47,25 @@ import {
46
47
  batchSegmentDownload,
47
48
  downloadFileInner,
48
49
  setWriterFile,
49
- afterDownload
50
+ afterDownload,
51
+ getFileHash,
52
+ modifyServiceUrlSingle,
53
+ getKiaScanTip,
54
+ downloadFileSingle,
55
+ downloadFileBatch,
56
+ downloadFileSingleHwh5,
57
+ validateDownloadStatus,
58
+ mounted,
59
+ handleChange,
60
+ previewFileSingle,
61
+ previewFileBatch,
62
+ previewImageSingle,
63
+ previewImageBatch,
64
+ abortDownload,
65
+ createDownloadCancelToken,
66
+ handleClickFileList
50
67
  } from "./index";
51
- import { isEmptyObject } from "@opentiny/vue-renderless/common/type";
68
+ import { isEmptyObject } from "../common/type";
52
69
  const api = [
53
70
  "state",
54
71
  "getNewTabPreviewUrl",
@@ -67,9 +84,12 @@ const api = [
67
84
  "getFileUploadUrl",
68
85
  "updateUrl",
69
86
  "previewImage",
70
- "updateFile"
87
+ "updateFile",
88
+ "handleChange",
89
+ "abortDownload",
90
+ "handleClickFileList"
71
91
  ];
72
- const initState = ({ api: api2, reactive, computed, inject, ref, vm, props, httpRequest }) => {
92
+ const initState = ({ api: api2, reactive, computed, inject, ref, vm, props, httpRequest, service }) => {
73
93
  const state = reactive({
74
94
  url: "",
75
95
  tempIndex: 1,
@@ -82,7 +102,7 @@ const initState = ({ api: api2, reactive, computed, inject, ref, vm, props, http
82
102
  docSize: 0,
83
103
  // unit(B)
84
104
  chunkSize: 0,
85
- chunkBatchLimit: 20,
105
+ chunkBatchLimit: 5,
86
106
  downloadChunkLimit: 5,
87
107
  batchQueue: {},
88
108
  batchQueueListen: {},
@@ -110,65 +130,92 @@ const initState = ({ api: api2, reactive, computed, inject, ref, vm, props, http
110
130
  isEntireCheckCode: computed(() => !("isEntireCheckCode" in props.edm && props.edm.isEntireCheckCode !== true)),
111
131
  downloadBatchQueue: {},
112
132
  downloadBatchQueueListen: {},
113
- dowuloadChunkFile: /* @__PURE__ */ new Map(),
114
- downloadReplayAtoms: {}
133
+ downloadChunkFile: {},
134
+ downloadReplayAtoms: {},
135
+ errorStatusCodes: [0, 401, 429],
136
+ // 0:上传异常 401:没权限(token过期)429:超限
137
+ hasFileInfoInterface: computed(() => service.setting.services.EDM && service.setting.services.EDM.DocumentInfoUrl),
138
+ currentDownloadFile: "",
139
+ isDragover: false,
140
+ downloadCancelToken: {},
141
+ // 取消下载token
142
+ downloadCancelData: {},
143
+ // 取消下载时需要清空的缓存数据
144
+ isHwh5: computed(() => !isEmptyObject(props.hwh5)),
145
+ selected: null
115
146
  });
116
147
  return state;
117
148
  };
118
- const initApi = ({ api: api2, state, props, constants, refs, $service, t, Modal }) => {
119
- const { SIZE_2G, SIZE_20M, SIZE_8M } = constants.EDM;
149
+ const initApi = ({ api: api2, state, props, constants, vm, $service, t, Modal }) => {
120
150
  Object.assign(api2, {
121
151
  state,
122
152
  sliceChunk: sliceChunk({ state, props }),
123
153
  getFormData: getFormData({ constants, props, state }),
124
- abort: abort({ constants, refs }),
125
- handleClick: handleClick({ constants, refs }),
154
+ abort: abort({ constants, vm, state }),
155
+ handleClick: handleClick({ constants, vm }),
126
156
  getFile: getFile(state),
127
157
  clearFiles: clearFiles(state),
128
- watchFileList: watchFileList({ constants, state }),
158
+ watchFileList: watchFileList({ constants, state, props }),
129
159
  watchListType: watchListType({ constants, state }),
130
160
  onBeforeDestroy: onBeforeDestroy(state),
131
161
  computedUploadDisabled: computedUploadDisabled({ props, state }),
132
- computedUploadingSize: computedUploadingSize(state),
162
+ computedUploadingSize: computedUploadingSize({ state, constants }),
133
163
  getFileUploadUrl: getFileUploadUrl($service),
134
164
  getToken: getToken({ constants, props, state, t, Modal }),
135
165
  getDialogConfigObj: getDialogConfigObj({ props, state }),
136
- computeDocChunkSize: computeDocChunkSize({ props, state, SIZE_2G, SIZE_20M, SIZE_8M }),
137
- updateFile: updateFile({ constants, refs }),
166
+ computeDocChunkSize: computeDocChunkSize({ props, state, constants }),
167
+ updateFile: updateFile({ constants, vm }),
138
168
  getPreviewUrlSync: getPreviewUrlSync({ constants, props, state }),
139
169
  ordinaryDownload: ordinaryDownload($service),
140
170
  clearUploadingFiles: clearUploadingFiles({ constants, state }),
141
- calcUploadingFilesInfo: calcUploadingFilesInfo({ state }),
142
- properFileSize: properFileSize({ props, state, constants, Modal, t })
171
+ calcUploadingFilesInfo: calcUploadingFilesInfo({ state, constants }),
172
+ properFileSize: properFileSize({ props, state, constants, Modal, t }),
173
+ mounted: mounted({ vm, state }),
174
+ previewFileSingle: previewFileSingle({ api: api2, state, props, constants, service: $service }),
175
+ previewFileBatch: previewFileBatch({ service: $service, props, state, api: api2 }),
176
+ previewImageSingle: previewImageSingle({ state, props, service: $service }),
177
+ previewImageBatch: previewImageBatch({ service: $service, api: api2 }),
178
+ abortDownload: abortDownload({ state }),
179
+ createDownloadCancelToken: createDownloadCancelToken({ state, service: $service })
143
180
  });
144
181
  };
145
- const mergeApi = ({ api: api2, props, $service, state, constants, emit, mode, Modal, t, refs }) => {
182
+ const mergeApi = ({ api: api2, props, $service, state, constants, emit, mode, Modal, t, vm, CryptoJS, Streamsaver }) => {
146
183
  Object.assign(api2, {
147
184
  segmentUploadInit: segmentUploadInit({ api: api2, props, service: $service, state, constants }),
148
- segmentUpload: segmentUpload({ api: api2, props, service: $service, state, emit, constants }),
185
+ segmentUpload: segmentUpload({ api: api2, props, service: $service, state, emit, constants, CryptoJS }),
149
186
  addFileToList: addFileToList({ api: api2, constants, emit, props, state, mode }),
150
- downloadFile: downloadFile({ api: api2, state, props }),
151
- previewImage: previewImage({ api: api2, props, service: $service, state }),
152
- previewFile: previewFile({ api: api2, constants, Modal, props, service: $service, state, t }),
153
- getNewTabPreviewUrl: getNewTabPreviewUrl({ api: api2, props }),
154
- submit: submit({ api: api2, constants, Modal, refs, props, state, t }),
155
- handleStart: handleStart({ api: api2, constants, props, state, refs }),
156
- batchSegmentUpload: batchSegmentUpload({ api: api2, constants, props, refs, state }),
187
+ downloadFile: downloadFile({ api: api2, state }),
188
+ downloadFileSingleInner: downloadFileSingleInner({ props, state, api: api2, constants }),
189
+ previewImage: previewImage({ api: api2, props, service: $service }),
190
+ previewFile: previewFile({ api: api2, props }),
191
+ getNewTabPreviewUrl: getNewTabPreviewUrl({ api: api2 }),
192
+ submit: submit({ api: api2, constants, Modal, vm, props, state, t }),
193
+ handleStart: handleStart({ api: api2, constants, props, state, vm }),
194
+ batchSegmentUpload: batchSegmentUpload({ api: api2, constants, props, vm, state }),
157
195
  largeDocumentUpload: largeDocumentUpload({ api: api2, Modal, state, emit, constants, t }),
158
196
  handleProgress: handleProgress({ api: api2, constants, emit, state }),
159
197
  handleSuccess: handleSuccess({ api: api2, constants, emit, Modal, props, state }),
160
198
  handleError: handleError({ api: api2, constants, emit, state }),
161
- handleRemove: handleRemove({ api: api2, emit, props, state }),
199
+ handleRemove: handleRemove({ api: api2, emit, props, state, constants }),
162
200
  updateUrl: updateUrl({ api: api2, props, service: $service, state }),
163
- startUpload: startUpload({ api: api2, state, constants, refs, Modal, t }),
201
+ startUpload: startUpload({ api: api2, state, constants, vm, Modal, t }),
164
202
  beforeUpload: beforeUpload({ api: api2, props, Modal, constants, t, state }),
165
203
  getDownloadFileInfo: getDownloadFileInfo({ api: api2, props, state, service: $service }),
166
204
  largeDocumentDownload: largeDocumentDownload({ api: api2, state }),
167
205
  sliceDownloadChunk: sliceDownloadChunk({ api: api2, state }),
168
206
  batchSegmentDownload: batchSegmentDownload({ state, api: api2 }),
169
- downloadFileInner: downloadFileInner({ api: api2, props, service: $service, state, emit, constants, t, Modal }),
170
- setWriterFile: setWriterFile({ state, emit, props }),
171
- afterDownload: afterDownload({ api: api2, state })
207
+ downloadFileInner: downloadFileInner({ api: api2, props, state }),
208
+ setWriterFile: setWriterFile({ state, emit, Streamsaver }),
209
+ afterDownload: afterDownload({ api: api2, state }),
210
+ getFileHash: getFileHash({ emit, Modal, constants, t, CryptoJS, state }),
211
+ modifyServiceUrlSingle: modifyServiceUrlSingle({ constants }),
212
+ getKiaScanTip: getKiaScanTip({ Modal, constants, t }),
213
+ downloadFileSingle: downloadFileSingle({ service: $service, constants, props, state, api: api2, emit }),
214
+ downloadFileBatch: downloadFileBatch({ api: api2, service: $service, props, state, emit }),
215
+ downloadFileSingleHwh5: downloadFileSingleHwh5({ state, props, emit, constants }),
216
+ validateDownloadStatus: validateDownloadStatus({ state, Modal }),
217
+ handleChange: handleChange({ vm, constants }),
218
+ handleClickFileList: handleClickFileList({ state, emit })
172
219
  });
173
220
  };
174
221
  const initWatch = ({ watch, state, api: api2, props, $service }) => {
@@ -199,19 +246,23 @@ const initWatch = ({ watch, state, api: api2, props, $service }) => {
199
246
  );
200
247
  watch(() => props.edm, api2.computeDocChunkSize, { deep: true, immediate: true });
201
248
  };
202
- const renderless = (props, { computed, inject, onBeforeUnmount, provide, reactive, ref, watch }, { t, vm, refs, parent, emit, service, mode, constants }, { Modal }) => {
249
+ let getApi = () => ({});
250
+ const renderless = (props, { computed, inject, onBeforeUnmount, provide, reactive, ref, watch, onMounted }, { t, vm, parent, emit, service, mode, constants }, { Modal, CryptoJS, Streamsaver }) => {
203
251
  const api2 = {};
204
252
  const $service = initService({ props, service });
205
253
  const httpRequest = $service.httpRequest;
206
- const state = initState({ reactive, computed, api: api2, inject, ref, vm, props, httpRequest });
207
- initApi({ api: api2, state, props, constants, refs, $service, t, Modal });
208
- mergeApi({ api: api2, props, $service, state, constants, emit, mode, Modal, t, refs });
254
+ const state = initState({ reactive, computed, api: api2, inject, ref, vm, props, httpRequest, service });
255
+ initApi({ api: api2, state, props, constants, vm, $service, t, Modal });
256
+ mergeApi({ api: api2, props, $service, state, constants, emit, mode, Modal, t, vm, CryptoJS, Streamsaver });
257
+ getApi = () => api2;
209
258
  provide("uploader", parent);
259
+ onMounted(api2.mounted);
210
260
  onBeforeUnmount(api2.onBeforeDestroy);
211
261
  initWatch({ watch, state, api: api2, props, $service });
212
262
  return api2;
213
263
  };
214
264
  export {
215
265
  api,
266
+ getApi,
216
267
  renderless
217
268
  };
@@ -0,0 +1,131 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import { cloneDeep } from "../chart-core/deps/utils";
3
+ const isEmpty = (value) => [void 0, null, ""].indexOf(value) !== -1;
4
+ const resize = ({ state, vm, props }) => () => {
5
+ const refs = vm.$refs;
6
+ if (state.showPanel) {
7
+ const pos = refs.maskPoint.getBoundingClientRect();
8
+ const height = window.innerHeight - pos.top;
9
+ refs.panelMask.style.top = pos.top + "px";
10
+ refs.panelMask.style.height = height + "px";
11
+ if (!props.panelClass) {
12
+ refs.panel.style.maxHeight = (height * 0.7 || 0).toFixed() + "px";
13
+ }
14
+ }
15
+ };
16
+ const panelToggle = ({ state, props, api }) => (index) => {
17
+ const { modelValue } = props;
18
+ if (index === "filter") {
19
+ state.showPanelIndex = -1;
20
+ state.filterPanel.show = !state.filterPanel.show;
21
+ if (state.filterPanel.show) {
22
+ state.filterPanel.selected = props.filterValue.slice();
23
+ api.resize();
24
+ }
25
+ return;
26
+ }
27
+ state.filterPanel.show = false;
28
+ if (state.showPanelIndex === index) {
29
+ state.showPanelIndex = -1;
30
+ } else {
31
+ let value = modelValue[index];
32
+ value = isEmpty(value) ? [] : Array.isArray(value) ? value : [value];
33
+ state.showPanelIndex = index;
34
+ state.selectPanel.selected = value.slice();
35
+ api.resize();
36
+ }
37
+ };
38
+ const selectOption = ({ state, api }) => (value) => {
39
+ const {
40
+ selectPanel: { config }
41
+ } = state;
42
+ if (config.type === "tag" && config.multiple) {
43
+ state.selectPanel.selected = value;
44
+ } else if (!config.multiple) {
45
+ state.selectPanel.selected = [value];
46
+ api.confirm();
47
+ }
48
+ };
49
+ const filterSelectOption = ({ state, props }) => (value, index) => {
50
+ const { filterGroup } = props;
51
+ if (filterGroup[index].type === "tag" && !filterGroup[index].multiple) {
52
+ state.filterPanel.selected[index] = value;
53
+ }
54
+ };
55
+ const reset = ({ state, props }) => (isFilterGroup) => {
56
+ const { modelValue, filterValue } = props;
57
+ if (isFilterGroup) {
58
+ state.filterPanel.selected = cloneDeep(filterValue);
59
+ } else {
60
+ let value = modelValue[state.showPanelIndex];
61
+ value = isEmpty(value) ? [] : Array.isArray(value) ? value : [value];
62
+ state.selectPanel.selected = value.slice();
63
+ }
64
+ };
65
+ const filterConfirm = ({ state, emit }) => () => {
66
+ const filterValue = state.filterPanel.selected.slice();
67
+ state.filterPanel.show = false;
68
+ emit("update:filter-value", cloneDeep(filterValue));
69
+ };
70
+ const confirm = ({ state, props, emit, api }) => (isFilterGroup) => {
71
+ if (isFilterGroup) {
72
+ api.filterConfirm();
73
+ return;
74
+ }
75
+ const {
76
+ showPanelIndex,
77
+ selectPanel: { config }
78
+ } = state;
79
+ let modelValue = props.modelValue;
80
+ if (config.multiple) {
81
+ modelValue[showPanelIndex] = state.selectPanel.selected;
82
+ } else {
83
+ modelValue[showPanelIndex] = state.selectPanel.selected[0];
84
+ }
85
+ state.showPanelIndex = -1;
86
+ emit("update:modelValue", modelValue.slice());
87
+ };
88
+ const cancel = ({ state, emit }) => () => {
89
+ state.showPanelIndex = -1;
90
+ state.filterPanel.show = false;
91
+ emit("cancel", state);
92
+ };
93
+ const labelListComputed = ({ props }) => () => {
94
+ const { data, modelValue } = props;
95
+ return data.map((item, index) => {
96
+ const data2 = modelValue[index];
97
+ const values = item.options.map((option) => option.value);
98
+ if (item.type === "tag" && item.multiple) {
99
+ if (data2 && data2.length) {
100
+ return data2.map((value) => {
101
+ const i = values.indexOf(value);
102
+ return i !== -1 ? item.options[i].label : item.options[i].value;
103
+ }).join("; ");
104
+ } else {
105
+ return item.placeholder;
106
+ }
107
+ } else if (!item.multiple) {
108
+ if (isEmpty(data2)) {
109
+ return item.placeholder;
110
+ }
111
+ const i = values.indexOf(data2);
112
+ return i !== -1 ? item.options[i].label : data2;
113
+ }
114
+ });
115
+ };
116
+ const selectOptionAll = ({ state }) => () => {
117
+ state.selectPanel.selected = [];
118
+ };
119
+ export {
120
+ cancel,
121
+ confirm,
122
+ filterConfirm,
123
+ filterSelectOption,
124
+ isEmpty,
125
+ labelListComputed,
126
+ panelToggle,
127
+ reset,
128
+ resize,
129
+ selectOption,
130
+ selectOptionAll
131
+ };
@@ -0,0 +1,43 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import { isEmpty } from "./index";
3
+ const selectOptionAll = ({ state, emit }) => () => {
4
+ state.selected = [];
5
+ emit("click", state.selected);
6
+ emit("update:modelValue", state.selected);
7
+ };
8
+ const selectOption = ({ state, props, emit }) => (value) => {
9
+ if (props.type === "tag" && props.multiple) {
10
+ const index = state.selected.indexOf(value);
11
+ index === -1 ? state.selected.push(value) : state.selected.splice(index, 1);
12
+ const values = state.selected;
13
+ emit("click", values);
14
+ emit("update:modelValue", values.slice());
15
+ } else if (props.type === "tag" && !props.multiple) {
16
+ state.selected = [value];
17
+ emit("click", value);
18
+ emit("update:modelValue", value);
19
+ }
20
+ };
21
+ const setSelectedOption = ({ state }) => (value) => {
22
+ state.selected = isEmpty(value) ? [] : Array.isArray(value) ? value.slice() : [value];
23
+ };
24
+ const api = ["state", "selectOptionAll", "selectOption"];
25
+ const renderless = (props, { reactive, watch, computed }, { emit }) => {
26
+ const api2 = {};
27
+ const state = reactive({
28
+ tagWidth: computed(() => (100 / props.columnNum).toFixed(1) + "%"),
29
+ selected: []
30
+ });
31
+ Object.assign(api2, {
32
+ state,
33
+ selectOptionAll: selectOptionAll({ state, emit }),
34
+ selectOption: selectOption({ state, props, emit }),
35
+ setSelectedOption: setSelectedOption({ state, props })
36
+ });
37
+ watch(() => props.modelValue, api2.setSelectedOption);
38
+ return api2;
39
+ };
40
+ export {
41
+ api,
42
+ renderless
43
+ };
package/filter/vue.js ADDED
@@ -0,0 +1,73 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import { on, off } from "../common/deps/dom";
3
+ import {
4
+ panelToggle,
5
+ filterSelectOption,
6
+ filterConfirm,
7
+ labelListComputed,
8
+ selectOption,
9
+ confirm,
10
+ cancel,
11
+ resize,
12
+ reset,
13
+ selectOptionAll
14
+ } from "./index";
15
+ const api = [
16
+ "state",
17
+ "panelToggle",
18
+ "filterSelectOption",
19
+ "filterConfirm",
20
+ "selectOption",
21
+ "confirm",
22
+ "cancel",
23
+ "reset",
24
+ "selectOptionAll"
25
+ ];
26
+ const renderless = (props, { reactive, computed, onMounted, onBeforeUnmount }, { emit, vm }) => {
27
+ const api2 = {};
28
+ const state = reactive({
29
+ showPanelIndex: -1,
30
+ filterPanel: {
31
+ show: false,
32
+ selected: []
33
+ },
34
+ selectPanel: {
35
+ selected: [],
36
+ config: computed(() => state.showPanelIndex !== -1 ? props.data[state.showPanelIndex] : { options: [] })
37
+ },
38
+ tagWidth: computed(() => (100 / props.columnNum).toFixed(1) + "%"),
39
+ labelList: computed(() => api2.labelListComputed()),
40
+ showPanel: computed(() => state.showPanelIndex !== -1 || state.filterPanel.show),
41
+ hasFilterValue: computed(
42
+ () => props.filterValue.find(
43
+ (item) => Array.isArray(item) ? item.length > 0 : [void 0, null, ""].indexOf(item) === -1
44
+ )
45
+ )
46
+ });
47
+ Object.assign(api2, {
48
+ state,
49
+ panelToggle: panelToggle({ state, props, api: api2 }),
50
+ filterSelectOption: filterSelectOption({ state, props, emit, api: api2 }),
51
+ filterConfirm: filterConfirm({ state, props, emit }),
52
+ selectOption: selectOption({ state, props, emit, api: api2 }),
53
+ confirm: confirm({ state, props, emit, api: api2 }),
54
+ cancel: cancel({ state, emit }),
55
+ resize: resize({ state, vm, props }),
56
+ reset: reset({ state, props }),
57
+ selectOptionAll: selectOptionAll({ state }),
58
+ labelListComputed: labelListComputed({ state, props })
59
+ });
60
+ onMounted(() => {
61
+ on(window, "scroll", api2.resize);
62
+ on(window, "resize", api2.resize);
63
+ });
64
+ onBeforeUnmount(() => {
65
+ off(window, "scroll", api2.resize);
66
+ off(window, "resize", api2.resize);
67
+ });
68
+ return api2;
69
+ };
70
+ export {
71
+ api,
72
+ renderless
73
+ };
@@ -0,0 +1,9 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ const click = ({ props, emit }) => (index) => {
3
+ const i = props.modelValue === index ? void 0 : index;
4
+ emit("update:modelValue", i);
5
+ emit("click", index);
6
+ };
7
+ export {
8
+ click
9
+ };
@@ -0,0 +1,16 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import { click } from "./index";
3
+ const api = ["state", "click"];
4
+ const renderless = (props, { reactive }, { emit }) => {
5
+ const api2 = {};
6
+ const state = reactive({});
7
+ Object.assign(api2, {
8
+ state,
9
+ click: click({ props, emit })
10
+ });
11
+ return api2;
12
+ };
13
+ export {
14
+ api,
15
+ renderless
16
+ };
@@ -0,0 +1,17 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ const handleClear = ({ dispatch, emit }) => ($event) => {
3
+ dispatch("Picker", "handle-clear", $event);
4
+ dispatch("Select", "handle-clear", $event);
5
+ dispatch("Cascader", "handle-clear", $event);
6
+ emit("handle-clear");
7
+ };
8
+ const handeClick = ({ props, emit }) => ($event) => {
9
+ if (props.disabled)
10
+ return;
11
+ $event.stopPropagation();
12
+ emit("click", $event);
13
+ };
14
+ export {
15
+ handeClick,
16
+ handleClear
17
+ };
@@ -0,0 +1,19 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import { handleClear, handeClick } from "./index";
3
+ const api = ["state", "handleClear", "focus", "blur", "handeClick"];
4
+ const renderless = (props, { reactive }, { dispatch, emit }) => {
5
+ const state = reactive({});
6
+ const api2 = {};
7
+ Object.assign(api2, {
8
+ state,
9
+ focus: () => state,
10
+ blur: () => state,
11
+ handleClear: handleClear({ dispatch, emit }),
12
+ handeClick: handeClick({ props, emit })
13
+ });
14
+ return api2;
15
+ };
16
+ export {
17
+ api,
18
+ renderless
19
+ };
@@ -0,0 +1,42 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ const doDestroy = ({ vm }) => () => {
3
+ vm.$refs.popper && vm.$refs.popper.doDestroy();
4
+ };
5
+ const show = ({ state }) => () => {
6
+ state.visible = true;
7
+ };
8
+ const hide = ({ state }) => () => {
9
+ state.visible = false;
10
+ };
11
+ const togglePanel = ({ props, state }) => () => {
12
+ if (props.disabled)
13
+ return;
14
+ state.visible = !state.visible;
15
+ };
16
+ const popoverShow = ({ state, emit }) => () => {
17
+ emit("visible-change", state.visible);
18
+ };
19
+ const popoverHide = ({ state, emit }) => () => {
20
+ emit("visible-change", state.visible);
21
+ };
22
+ const handleClear = ({ emit }) => () => {
23
+ emit("handle-clear");
24
+ };
25
+ const handleDocumentClick = ({ state, vm }) => (event) => {
26
+ const filterBox = vm.$refs.filterBox.$el;
27
+ const popper = document.querySelector(".tiny-filter-panel__popover");
28
+ if (!filterBox || !popper || filterBox.contains(event.target) || popper.contains(event.target)) {
29
+ return;
30
+ }
31
+ state.visible = false;
32
+ };
33
+ export {
34
+ doDestroy,
35
+ handleClear,
36
+ handleDocumentClick,
37
+ hide,
38
+ popoverHide,
39
+ popoverShow,
40
+ show,
41
+ togglePanel
42
+ };
@@ -0,0 +1,33 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import { doDestroy, show, hide, popoverShow, popoverHide, handleClear, handleDocumentClick, togglePanel } from "./index";
3
+ import { on, off } from "../common/deps/dom";
4
+ const api = ["state", "doDestroy", "show", "hide", "popoverShow", "popoverHide", "handleClear", "togglePanel"];
5
+ const renderless = (props, { reactive, onMounted, onBeforeUnmount }, { vm, emit }) => {
6
+ const state = reactive({
7
+ visible: false
8
+ });
9
+ const api2 = {};
10
+ Object.assign(api2, {
11
+ state,
12
+ show: show({ state }),
13
+ hide: hide({ state }),
14
+ togglePanel: togglePanel({ props, state }),
15
+ popoverShow: popoverShow({ state, emit }),
16
+ popoverHide: popoverHide({ state, emit }),
17
+ handleClear: handleClear({ emit }),
18
+ doDestroy: doDestroy({ vm }),
19
+ handleDocumentClick: handleDocumentClick({ vm, state })
20
+ });
21
+ handleDocumentClick;
22
+ onMounted(() => {
23
+ on(document, "click", api2.handleDocumentClick);
24
+ });
25
+ onBeforeUnmount(() => {
26
+ off(document, "click", api2.handleDocumentClick);
27
+ });
28
+ return api2;
29
+ };
30
+ export {
31
+ api,
32
+ renderless
33
+ };
package/floatbar/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { xss } from "@opentiny/vue-renderless/common/xss.js";
2
+ import { xss } from "../common/xss.js";
3
3
  const computeData = ({ props }) => {
4
4
  if (Array.isArray(props.data) && props.data.length) {
5
5
  props.data.forEach((item) => {