@robot-admin/naive-ui-components 0.22.0 → 0.23.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/CHANGELOG.md +18 -0
  2. package/README.md +9 -5
  3. package/README_EN.md +9 -5
  4. package/dist/C_ActionBar.d.cts +2 -1
  5. package/dist/C_ActionBar.d.ts +2 -1
  6. package/dist/C_AntV2.cjs +3 -3
  7. package/dist/C_AntV2.js +3 -3
  8. package/dist/C_BatchResult.cjs +1 -0
  9. package/dist/C_BatchResult.css +32 -0
  10. package/dist/C_BatchResult.d.cts +2 -0
  11. package/dist/C_BatchResult.d.ts +2 -0
  12. package/dist/C_BatchResult.js +1 -0
  13. package/dist/C_BatchResult2.cjs +1 -0
  14. package/dist/C_BatchResult2.js +1 -0
  15. package/dist/C_Breadcrumb.d.cts +2 -2
  16. package/dist/C_Breadcrumb.d.ts +1 -1
  17. package/dist/C_Captcha.d.ts +2 -0
  18. package/dist/C_Cascade.d.cts +1 -1
  19. package/dist/C_Cascade.d.ts +1 -1
  20. package/dist/C_Chat.d.cts +1 -1
  21. package/dist/C_Chat.d.ts +1 -1
  22. package/dist/C_City.d.cts +1 -1
  23. package/dist/C_City.d.ts +1 -1
  24. package/dist/C_Code.d.cts +1 -1
  25. package/dist/C_Code.d.ts +1 -1
  26. package/dist/C_ContextMenu.d.cts +1 -1
  27. package/dist/C_ContextMenu.d.ts +1 -1
  28. package/dist/C_DataPicker.cjs +1 -0
  29. package/dist/C_DataPicker.css +54 -0
  30. package/dist/C_DataPicker.d.cts +2 -0
  31. package/dist/C_DataPicker.d.ts +5 -0
  32. package/dist/C_DataPicker.js +1 -0
  33. package/dist/C_DataPicker2.cjs +1 -0
  34. package/dist/C_DataPicker2.js +1 -0
  35. package/dist/C_Date.d.cts +1 -1
  36. package/dist/C_Date.d.ts +1 -1
  37. package/dist/C_Density.cjs +1 -0
  38. package/dist/C_Density.css +1 -0
  39. package/dist/C_Density.d.cts +3 -0
  40. package/dist/C_Density.d.ts +3 -0
  41. package/dist/C_Density.js +1 -0
  42. package/dist/C_Density2.cjs +1 -0
  43. package/dist/C_Density2.js +1 -0
  44. package/dist/C_Editor.d.cts +1 -1
  45. package/dist/C_Editor.d.ts +1 -1
  46. package/dist/C_ErrorSummary.cjs +1 -0
  47. package/dist/C_ErrorSummary.css +29 -0
  48. package/dist/C_ErrorSummary.d.cts +3 -0
  49. package/dist/C_ErrorSummary.d.ts +3 -0
  50. package/dist/C_ErrorSummary.js +1 -0
  51. package/dist/C_ErrorSummary2.cjs +1 -0
  52. package/dist/C_ErrorSummary2.js +1 -0
  53. package/dist/C_Form.base.css +150 -148
  54. package/dist/C_Form.cjs +1 -1
  55. package/dist/C_Form.css +151 -253
  56. package/dist/C_Form.d.cts +3 -1
  57. package/dist/C_Form.d.ts +19 -1
  58. package/dist/C_Form.js +1 -1
  59. package/dist/C_FormModal.css +11 -12
  60. package/dist/C_FormModal.d.cts +1 -1
  61. package/dist/C_FormModal.d.ts +18 -2
  62. package/dist/C_FormModal2.cjs +1 -1
  63. package/dist/C_FormModal2.js +1 -1
  64. package/dist/C_FormSearch.cjs +1 -1
  65. package/dist/C_FormSearch.css +128 -56
  66. package/dist/C_FormSearch.d.cts +3 -3
  67. package/dist/C_FormSearch.d.ts +5 -3
  68. package/dist/C_FormSearch.js +1 -1
  69. package/dist/C_FormulaEditor.d.cts +1 -1
  70. package/dist/C_FormulaEditor.d.ts +1 -1
  71. package/dist/C_Guide.d.cts +1 -1
  72. package/dist/C_Guide.d.ts +1 -1
  73. package/dist/C_Icon.d.cts +1 -1
  74. package/dist/C_Icon.d.ts +1 -1
  75. package/dist/C_Language.d.cts +1 -1
  76. package/dist/C_Language.d.ts +1 -1
  77. package/dist/C_Loading.d.cts +1 -1
  78. package/dist/C_Loading.d.ts +1 -1
  79. package/dist/C_Login.d.cts +1 -1
  80. package/dist/C_Login.d.ts +4 -1
  81. package/dist/C_Markdown.d.cts +1 -1
  82. package/dist/C_Markdown.d.ts +1 -1
  83. package/dist/C_Menu.d.cts +2 -2
  84. package/dist/C_Menu.d.ts +1 -1
  85. package/dist/C_OrgChart.d.cts +1 -1
  86. package/dist/C_OrgChart.d.ts +1 -1
  87. package/dist/C_Progress.d.cts +1 -1
  88. package/dist/C_Progress.d.ts +1 -1
  89. package/dist/C_SectionNav.cjs +1 -0
  90. package/dist/C_SectionNav.css +46 -0
  91. package/dist/C_SectionNav.d.cts +2 -0
  92. package/dist/C_SectionNav.d.ts +2 -0
  93. package/dist/C_SectionNav.js +1 -0
  94. package/dist/C_SectionNav2.cjs +1 -0
  95. package/dist/C_SectionNav2.js +1 -0
  96. package/dist/C_Skeleton.d.cts +1 -1
  97. package/dist/C_Skeleton.d.ts +1 -1
  98. package/dist/C_Steps.d.cts +1 -1
  99. package/dist/C_Steps.d.ts +1 -1
  100. package/dist/C_Table.base.css +258 -256
  101. package/dist/C_Table.cjs +1 -1
  102. package/dist/C_Table.css +109 -1283
  103. package/dist/C_Table.d.cts +2 -1
  104. package/dist/C_Table.d.ts +11 -7
  105. package/dist/C_Table.js +1 -1
  106. package/dist/C_Table2.cjs +3 -0
  107. package/dist/C_Table2.js +3 -0
  108. package/dist/C_Tabs.cjs +1 -1
  109. package/dist/C_Tabs.d.cts +1 -1
  110. package/dist/C_Tabs.d.ts +1 -1
  111. package/dist/C_Tabs.js +1 -1
  112. package/dist/C_TagsView.d.cts +1 -1
  113. package/dist/C_Theme.d.cts +1 -1
  114. package/dist/C_Theme.d.ts +1 -1
  115. package/dist/C_Timeline.d.cts +1 -1
  116. package/dist/C_Timeline.d.ts +1 -1
  117. package/dist/C_Transfer.d.cts +1 -1
  118. package/dist/C_Transfer.d.ts +1 -1
  119. package/dist/C_Tree.d.cts +1 -1
  120. package/dist/C_Tree.d.ts +10 -6
  121. package/dist/C_Upload.d.cts +1 -1
  122. package/dist/C_Upload.d.ts +1 -1
  123. package/dist/C_WorkFlow2.cjs +1 -1
  124. package/dist/C_WorkFlow2.js +1 -1
  125. package/dist/Card.cjs +1 -1
  126. package/dist/Card.js +1 -1
  127. package/dist/Steps.cjs +1 -1
  128. package/dist/Steps.js +1 -1
  129. package/dist/Tabs.cjs +1 -1
  130. package/dist/Tabs.js +1 -1
  131. package/dist/batchPatch.cjs +1 -0
  132. package/dist/batchPatch.d.cts +26 -0
  133. package/dist/batchPatch.d.ts +26 -0
  134. package/dist/batchPatch.js +1 -0
  135. package/dist/config.cjs +1 -1
  136. package/dist/config.d.cts +7 -1
  137. package/dist/config.d.ts +7 -1
  138. package/dist/config.js +1 -1
  139. package/dist/config2.d.ts +14 -0
  140. package/dist/constants.d.cts +3 -3
  141. package/dist/constants.d.ts +3 -3
  142. package/dist/constants2.d.cts +402 -173
  143. package/dist/constants2.d.ts +402 -173
  144. package/dist/constants3.d.cts +3 -3
  145. package/dist/constants3.d.ts +3 -3
  146. package/dist/constants4.d.cts +173 -402
  147. package/dist/constants4.d.ts +173 -402
  148. package/dist/constants5.d.cts +2 -2
  149. package/dist/constants5.d.ts +2 -2
  150. package/dist/data.cjs +1 -1
  151. package/dist/data.d.cts +5 -108
  152. package/dist/data.d.ts +5 -108
  153. package/dist/data.js +1 -1
  154. package/dist/data2.cjs +1 -1
  155. package/dist/data2.d.cts +108 -0
  156. package/dist/data2.d.ts +108 -0
  157. package/dist/data2.js +1 -1
  158. package/dist/data3.cjs +1 -0
  159. package/dist/data3.js +1 -0
  160. package/dist/dateRange.d.cts +108 -13
  161. package/dist/dateRange.d.ts +108 -13
  162. package/dist/density.cjs +1 -1
  163. package/dist/density.js +1 -1
  164. package/dist/dictionary.cjs +1 -0
  165. package/dist/dictionary.d.cts +38 -0
  166. package/dist/dictionary.d.ts +38 -0
  167. package/dist/dictionary.js +1 -0
  168. package/dist/helpers.cjs +1 -1
  169. package/dist/helpers.js +1 -1
  170. package/dist/index.cjs +1 -1
  171. package/dist/index.d.cts +65 -53
  172. package/dist/index.d.ts +73 -57
  173. package/dist/index.js +1 -1
  174. package/dist/index.vue.d.cts +1 -1
  175. package/dist/index.vue.d.ts +1 -1
  176. package/dist/index10.vue.d.cts +37 -80
  177. package/dist/index10.vue.d.ts +77 -53
  178. package/dist/index11.vue.d.cts +77 -53
  179. package/dist/index11.vue.d.ts +1117 -45
  180. package/dist/index12.vue.d.cts +1117 -45
  181. package/dist/index12.vue.d.ts +17 -128
  182. package/dist/index13.vue.d.cts +17 -128
  183. package/dist/index13.vue.d.ts +57 -53
  184. package/dist/index14.vue.d.cts +57 -53
  185. package/dist/index14.vue.d.ts +16 -25
  186. package/dist/index15.vue.d.cts +16 -25
  187. package/dist/index15.vue.d.ts +52 -12
  188. package/dist/index16.vue.d.cts +52 -12
  189. package/dist/index16.vue.d.ts +13 -129
  190. package/dist/index17.vue.d.cts +13 -129
  191. package/dist/index17.vue.d.ts +123 -74
  192. package/dist/index18.vue.d.cts +123 -74
  193. package/dist/index18.vue.d.ts +48 -71
  194. package/dist/index19.vue.d.cts +40 -91
  195. package/dist/index19.vue.d.ts +36 -96
  196. package/dist/index2.vue.d.cts +2 -2
  197. package/dist/index2.vue.d.ts +2 -2
  198. package/dist/index20.vue.d.cts +38 -47
  199. package/dist/index20.vue.d.ts +13 -48
  200. package/dist/index21.vue.d.cts +12 -96
  201. package/dist/index21.vue.d.ts +25 -95
  202. package/dist/index22.vue.d.cts +20 -32
  203. package/dist/index22.vue.d.ts +75 -37
  204. package/dist/index23.vue.d.cts +77 -13
  205. package/dist/index23.vue.d.ts +71 -13
  206. package/dist/index24.vue.d.cts +2 -2
  207. package/dist/index24.vue.d.ts +1 -1
  208. package/dist/index25.vue.d.cts +116 -90
  209. package/dist/index25.vue.d.ts +116 -90
  210. package/dist/index26.vue.d.cts +94 -59
  211. package/dist/index26.vue.d.ts +94 -59
  212. package/dist/index27.vue.d.cts +75 -0
  213. package/dist/index27.vue.d.ts +75 -0
  214. package/dist/index28.vue.d.cts +103 -0
  215. package/dist/index28.vue.d.ts +103 -0
  216. package/dist/index29.vue.d.cts +105 -0
  217. package/dist/index29.vue.d.ts +105 -0
  218. package/dist/index3.vue.d.cts +4 -4
  219. package/dist/index3.vue.d.ts +4 -4
  220. package/dist/index30.vue.d.cts +28 -0
  221. package/dist/index30.vue.d.ts +28 -0
  222. package/dist/index4.vue.d.cts +19 -128
  223. package/dist/index4.vue.d.ts +17 -34
  224. package/dist/index5.vue.d.cts +127 -35
  225. package/dist/index5.vue.d.ts +30 -19
  226. package/dist/index6.vue.d.cts +30 -19
  227. package/dist/index6.vue.d.ts +22 -118
  228. package/dist/index7.vue.d.cts +22 -118
  229. package/dist/index7.vue.d.ts +112 -18
  230. package/dist/index8.vue.d.cts +112 -18
  231. package/dist/index8.vue.d.ts +24 -35
  232. package/dist/index9.vue.d.cts +24 -35
  233. package/dist/index9.vue.d.ts +37 -80
  234. package/dist/mapUtils.d.cts +4 -4
  235. package/dist/mapUtils.d.ts +4 -4
  236. package/dist/numberCodec.cjs +1 -0
  237. package/dist/numberCodec.d.cts +25 -0
  238. package/dist/numberCodec.d.ts +25 -0
  239. package/dist/numberCodec.js +1 -0
  240. package/dist/observer.cjs +1 -0
  241. package/dist/observer.js +1 -0
  242. package/dist/presets.d.cts +3 -66
  243. package/dist/presets.d.ts +3 -66
  244. package/dist/resolver.cjs +1 -1
  245. package/dist/resolver.d.cts +1 -1
  246. package/dist/resolver.d.ts +1 -1
  247. package/dist/resolver.js +1 -1
  248. package/dist/serializeSearch.cjs +1 -0
  249. package/dist/serializeSearch.js +1 -0
  250. package/dist/style.css +561 -322
  251. package/dist/types.d.cts +60 -103
  252. package/dist/types.d.ts +62 -52
  253. package/dist/types2.d.cts +104 -51
  254. package/dist/types2.d.ts +56 -0
  255. package/dist/types3.d.cts +56 -0
  256. package/dist/useCalendarEvents.d.cts +1 -1
  257. package/dist/useCalendarEvents.d.ts +1 -1
  258. package/dist/useCollapsePanel.d.cts +6 -6
  259. package/dist/useCollapsePanel.d.ts +6 -6
  260. package/dist/useComponentLocale.cjs +1 -1
  261. package/dist/useComponentLocale.js +1 -1
  262. package/dist/useCropperCore.d.cts +13 -13
  263. package/dist/useCropperCore.d.ts +13 -13
  264. package/dist/useDataResource.cjs +1 -0
  265. package/dist/useDataResource.js +1 -0
  266. package/dist/useDictionary.cjs +1 -0
  267. package/dist/useDictionary.js +1 -0
  268. package/dist/useDynamicFormState.d.cts +959 -582
  269. package/dist/useDynamicFormState.d.ts +951 -584
  270. package/dist/useEdgeInteraction.d.cts +3 -3
  271. package/dist/useEdgeInteraction.d.ts +3 -3
  272. package/dist/useFormArray.cjs +1 -0
  273. package/dist/useFormArray.d.cts +69 -0
  274. package/dist/useFormArray.d.ts +69 -0
  275. package/dist/useFormArray.js +1 -0
  276. package/dist/useFormConfig.cjs +1 -0
  277. package/dist/useFormConfig.d.cts +590 -0
  278. package/dist/useFormConfig.d.ts +590 -0
  279. package/dist/useFormConfig.js +1 -0
  280. package/dist/useFullscreen.d.cts +3 -3
  281. package/dist/useFullscreen.d.ts +3 -3
  282. package/dist/useGridWidth.cjs +1 -0
  283. package/dist/useGridWidth.js +1 -0
  284. package/dist/useInfiniteScroll.d.cts +2 -2
  285. package/dist/useInfiniteScroll.d.ts +2 -2
  286. package/dist/useQRCode.d.cts +3 -3
  287. package/dist/useQRCode.d.ts +3 -3
  288. package/dist/useSignatureHistory.d.cts +4 -4
  289. package/dist/useSignatureHistory.d.ts +4 -4
  290. package/dist/useSplitResize.d.cts +5 -5
  291. package/dist/useSplitResize.d.ts +5 -5
  292. package/dist/useTableGlobalConfig.cjs +1 -0
  293. package/dist/useTableGlobalConfig.js +1 -0
  294. package/dist/useTableQuery.cjs +1 -3
  295. package/dist/useTableQuery.js +1 -3
  296. package/dist/useWorkflowValidation.d.cts +6 -6
  297. package/dist/useWorkflowValidation.d.ts +6 -6
  298. package/dist/validation.cjs +1 -0
  299. package/dist/validation.d.cts +18 -0
  300. package/dist/validation.d.ts +18 -0
  301. package/dist/validation.js +1 -0
  302. package/dist/verification.d.cts +4 -4
  303. package/dist/verification.d.ts +4 -4
  304. package/dist/workflows.cjs +1 -0
  305. package/dist/workflows.d.cts +2 -0
  306. package/dist/workflows.d.ts +2 -0
  307. package/dist/workflows.js +1 -0
  308. package/docs/components.en.md +13 -1
  309. package/docs/components.md +13 -1
  310. package/docs/guides/batch-results.md +47 -0
  311. package/docs/guides/data-picker.md +65 -0
  312. package/docs/guides/data-workflows.md +123 -0
  313. package/docs/guides/form-density.en.md +56 -3
  314. package/docs/guides/form-density.md +56 -3
  315. package/docs/guides/search-workflows.md +164 -0
  316. package/docs/guides/usage.en.md +1 -1
  317. package/package.json +21 -1
  318. package/dist/C_FormSearch2.cjs +0 -1
  319. package/dist/C_FormSearch2.js +0 -1
  320. package/dist/useTableQuery.d.cts +0 -1957
  321. package/dist/useTableQuery.d.ts +0 -1957
@@ -1,202 +1,431 @@
1
1
  import * as vue from "vue";
2
2
  import { Ref } from "vue";
3
3
 
4
- //#region src/components/C_FormulaEditor/types.d.ts
5
- /** 变量数据类型 */
6
- type FormulaVariableType = 'number' | 'text' | 'boolean';
7
- /** 变量定义 */
8
- interface FormulaVariable {
9
- /** 显示名称(如「完成值」「目标额」) */
10
- name: string;
11
- /** 字段标识(如 'completion_value'),用于存储和求值 */
12
- field: string;
13
- /** 数据类型 */
14
- type: FormulaVariableType;
15
- /** 分组名称(如「目标档参数」「目标值」) */
16
- group?: string;
17
- /** 变量描述 */
18
- description?: string;
19
- }
20
- /** 内置函数定义 */
21
- interface FormulaFunction {
22
- /** 函数名(如 'IF'、'SUM') */
23
- name: string;
24
- /** 函数签名(如 'IF(条件, 真值, 假值)') */
25
- signature: string;
26
- /** 函数描述 */
27
- description: string;
28
- /** 分类(如「逻辑」「数学」「聚合」) */
29
- category?: string;
4
+ //#region src/components/C_Upload/types.d.ts
5
+ /**
6
+ * C_Upload 组件类型定义
7
+ */
8
+ /** 文件上传状态 */
9
+ type UploadFileStatus = 'pending' | 'validating' | 'hashing' | 'uploading' | 'success' | 'error' | 'paused' | 'instant';
10
+ /** 单个分片 */
11
+ interface UploadChunk {
12
+ /** 分片索引 */
13
+ index: number;
14
+ /** 分片 Blob */
15
+ blob: Blob;
16
+ /** 分片大小(bytes) */
17
+ size: number;
18
+ /** 是否已上传 */
19
+ uploaded: boolean;
30
20
  }
31
- /** Token 类型 */
32
- type FormulaTokenType = 'variable' | 'operator' | 'number' | 'function' | 'paren' | 'comma' | 'text' | 'space';
33
- /** 公式中的单个 Token */
34
- interface FormulaToken {
35
- /** Token 类型 */
36
- type: FormulaTokenType;
37
- /** 显示值 */
38
- value: string;
39
- /** 在原始字符串中的起始位置 */
40
- start: number;
41
- /** 在原始字符串中的结束位置 */
42
- end: number;
21
+ /** 分片上传进度 */
22
+ interface ChunkProgress {
23
+ /** 已上传分片数 */
24
+ uploadedChunks: number;
25
+ /** 总分片数 */
26
+ totalChunks: number;
27
+ /** 已上传字节 */
28
+ uploadedBytes: number;
29
+ /** 总字节 */
30
+ totalBytes: number;
43
31
  }
44
- /** 公式校验结果 */
45
- interface FormulaValidation {
46
- /** 是否合法 */
47
- valid: boolean;
48
- /** 消息 */
49
- message: string;
50
- /** 错误位置(字符索引) */
51
- position?: number;
32
+ /** 上传文件项 */
33
+ interface UploadFileItem {
34
+ /** 唯一标识 */
35
+ uid: string;
36
+ /** 文件名 */
37
+ name: string;
38
+ /** 文件大小(bytes) */
39
+ size: number;
40
+ /** MIME 类型 */
41
+ type: string;
42
+ /** 上传状态 */
43
+ status: UploadFileStatus;
44
+ /** 上传进度(0-100) */
45
+ percent: number;
46
+ /** 文件 hash(spark-md5) */
47
+ hash?: string;
48
+ /** 分片进度 */
49
+ chunkProgress?: ChunkProgress;
50
+ /** 原生 File 对象 */
51
+ raw?: File;
52
+ /** 缩略图 URL(图片文件) */
53
+ thumbUrl?: string;
54
+ /** 上传成功后的 URL */
55
+ url?: string;
56
+ /** 服务端响应 */
57
+ response?: unknown;
58
+ /** 错误信息 */
59
+ error?: string;
52
60
  }
53
- /** 键盘按键类型 */
54
- type FormulaKeyType = 'operator' | 'number' | 'paren' | 'logic' | 'compare' | 'action';
55
- /** 单个键盘按键定义 */
56
- interface FormulaKeyboardKey {
57
- /** 按键显示文本 */
58
- label: string;
59
- /** 按键输出值 */
60
- value: string;
61
- /** 按键类型 */
62
- type: FormulaKeyType;
63
- /** 高亮色(可选) */
64
- color?: 'primary' | 'warning' | 'error' | 'info';
65
- /** 是否是动作键(如退格、清空) */
66
- isAction?: boolean;
61
+ /** 自定义上传请求参数 */
62
+ interface UploadRequestOptions {
63
+ /** 上传地址 */
64
+ action: string;
65
+ /** 请求头 */
66
+ headers?: Record<string, string>;
67
+ /** 附加字段 */
68
+ data?: Record<string, unknown>;
69
+ /** 文件 / 分片 Blob */
70
+ file: File | Blob;
71
+ /** 文件名 */
72
+ filename: string;
73
+ /** 文件 hash */
74
+ hash?: string;
75
+ /** 分片索引(分片模式) */
76
+ chunkIndex?: number;
77
+ /** 总分片数(分片模式) */
78
+ totalChunks?: number;
79
+ /** 进度回调 */
80
+ onProgress?: (percent: number) => void;
81
+ /** 成功回调 */
82
+ onSuccess?: (response: unknown) => void;
83
+ /** 失败回调 */
84
+ onError?: (error: Error) => void;
67
85
  }
68
- /** 公式编辑器 Props */
69
- interface FormulaEditorConfig {
70
- /** 可选变量列表 */
71
- variables?: FormulaVariable[];
72
- /** 可用函数列表(为空则使用内置默认函数) */
73
- functions?: FormulaFunction[];
74
- /** 样例数据(用于预览计算结果) */
75
- sampleData?: Record<string, number | string | boolean>;
86
+ /** 自定义上传函数签名 */
87
+ type CustomUploadRequest = (options: UploadRequestOptions) => {
88
+ abort: () => void;
89
+ };
90
+ /** 秒传检查函数签名 */
91
+ type InstantCheckFn = (hash: string, filename: string) => Promise<{
92
+ exists: boolean;
93
+ url?: string;
94
+ }>;
95
+ /** 已上传分片查询函数签名 */
96
+ type UploadedChunksQueryFn = (hash: string) => Promise<number[]>;
97
+ /** 分片合并函数签名 */
98
+ type MergeChunksFn = (hash: string, filename: string, totalChunks: number) => Promise<{
99
+ url: string;
100
+ }>;
101
+ /** 上传组件 Props */
102
+ interface UploadProps {
103
+ /** 上传地址 */
104
+ action?: string;
105
+ /** 请求头 */
106
+ headers?: Record<string, string>;
107
+ /** 附加字段 */
108
+ data?: Record<string, unknown>;
109
+ /** 是否多选 */
110
+ multiple?: boolean;
111
+ /** 是否允许目录上传 */
112
+ directory?: boolean;
113
+ /** 接受的文件类型(同 input accept) */
114
+ accept?: string;
115
+ /** 文件大小限制(bytes) */
116
+ maxSize?: number;
117
+ /** 最大文件数 */
118
+ maxCount?: number;
76
119
  /** 是否禁用 */
77
120
  disabled?: boolean;
78
- /** 占位文本 */
79
- placeholder?: string;
80
- /** 容器高度 */
81
- height?: string | number;
82
- /** 是否显示预览 */
83
- showPreview?: boolean;
84
- /** 是否显示虚拟键盘 */
85
- showKeyboard?: boolean;
86
- /** 是否显示变量面板 */
87
- showVariablePanel?: boolean;
88
- /** 允许调整试算值;不会修改传入的 sampleData */
89
- editableSampleData?: boolean;
90
- /** 可直接应用的公式模板 */
91
- templates?: FormulaTemplate[];
121
+ /** 是否启用拖拽上传 */
122
+ draggable?: boolean;
123
+ /** 是否启用粘贴上传 */
124
+ pasteable?: boolean;
125
+ /** 是否分片上传 */
126
+ chunked?: boolean;
127
+ /** 分片大小(bytes,默认 2MB) */
128
+ chunkSize?: number;
129
+ /** 最大并发数 */
130
+ concurrency?: number;
131
+ /** 是否显示文件列表 */
132
+ showFileList?: boolean;
133
+ /** 列表类型 */
134
+ listType?: 'text' | 'image';
135
+ /** 是否显示图片预览缩略图 */
136
+ showThumbnail?: boolean;
137
+ /** 自定义上传函数 */
138
+ customRequest?: CustomUploadRequest;
139
+ /** 秒传检查函数 */
140
+ instantCheck?: InstantCheckFn;
141
+ /** 已上传分片查询 */
142
+ uploadedChunksQuery?: UploadedChunksQueryFn;
143
+ /** 分片合并函数 */
144
+ mergeChunks?: MergeChunksFn;
145
+ /** 上传前拦截 */
146
+ beforeUpload?: (file: File) => boolean | Promise<boolean | File>;
147
+ /** 提示文本 */
148
+ tip?: string;
149
+ /** 已有文件列表(回显) */
150
+ defaultFileList?: UploadFileItem[];
92
151
  }
93
- /** 模板仅包含展示信息与公式,不绑定项目业务。 */
94
- interface FormulaTemplate {
95
- label: string;
96
- value: string;
97
- description?: string;
152
+ /** 上传组件 Events */
153
+ interface UploadEmits {
154
+ /** 文件列表变更 */
155
+ change: [fileList: UploadFileItem[]];
156
+ /** 单文件上传成功 */
157
+ success: [file: UploadFileItem, response: unknown];
158
+ /** 单文件上传失败 */
159
+ error: [file: UploadFileItem, error: Error];
160
+ /** 单文件进度 */
161
+ progress: [file: UploadFileItem, percent: number];
162
+ /** 文件移除 */
163
+ remove: [file: UploadFileItem];
164
+ /** 全部上传完成 */
165
+ finish: [fileList: UploadFileItem[]];
166
+ /** 超出限制 */
167
+ exceed: [files: File[], fileList: UploadFileItem[]];
98
168
  }
99
- /** 推荐使用 v-model + 扁平 config;独立配置属性继续兼容。 */
100
- interface FormulaEditorProps extends FormulaEditorConfig {
101
- modelValue?: string;
102
- config?: FormulaEditorConfig;
103
- }
104
- /** 公式编辑器 Emits */
105
- interface FormulaEditorEmits {
106
- 'update:modelValue': [value: string];
107
- change: [value: string];
108
- 'validation-change': [result: FormulaValidation];
109
- }
110
- /** 公式编辑器暴露方法 */
111
- interface FormulaEditorExpose {
112
- /** 获取当前公式字符串 */
113
- getValue: () => string;
114
- /** 设置公式 */
115
- setValue: (expr: string) => void;
116
- /** 重置为初始值 */
117
- reset: () => void;
118
- /** 校验公式 */
119
- validate: () => FormulaValidation;
120
- /** 在光标位置插入文本 */
121
- insertAtCursor: (text: string) => void;
122
- /** 聚焦输入区 */
123
- focus: () => void;
169
+ /** 上传组件暴露方法 */
170
+ interface UploadExpose {
171
+ /** 手动触发文件选择 */
172
+ selectFiles: () => void;
173
+ /** 手动开始上传 */
174
+ startUpload: () => void;
175
+ /** 暂停所有上传 */
176
+ pauseAll: () => void;
177
+ /** 恢复所有上传 */
178
+ resumeAll: () => void;
179
+ /** 清空文件列表 */
180
+ clearAll: () => void;
181
+ /** 移除指定文件 */
182
+ removeFile: (uid: string) => void;
183
+ /** 重试失败文件 */
184
+ retryFile: (uid: string) => void;
185
+ /** 获取当前文件列表 */
186
+ getFileList: () => UploadFileItem[];
187
+ /** 获取成功文件列表 */
188
+ getSuccessList: () => UploadFileItem[];
189
+ /** 总体进度(0-100) */
190
+ totalPercent: number;
124
191
  }
125
192
  //#endregion
126
- //#region src/components/C_FormulaEditor/index.vue.d.ts
127
- declare const __VLS_export: vue.DefineComponent<FormulaEditorProps, FormulaEditorExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
128
- "update:modelValue": (value: string) => any;
129
- change: (value: string) => any;
130
- "validation-change": (result: FormulaValidation) => any;
131
- }, string, vue.PublicProps, Readonly<FormulaEditorProps> & Readonly<{
132
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
133
- onChange?: ((value: string) => any) | undefined;
134
- "onValidation-change"?: ((result: FormulaValidation) => any) | undefined;
193
+ //#region src/components/C_Upload/index.vue.d.ts
194
+ declare var __VLS_11: {};
195
+ type __VLS_Slots = {} & {
196
+ area?: (props: typeof __VLS_11) => any;
197
+ };
198
+ declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
199
+ error: (file: UploadFileItem, error: Error) => any;
200
+ change: (fileList: UploadFileItem[]) => any;
201
+ success: (file: UploadFileItem, response: unknown) => any;
202
+ remove: (file: UploadFileItem) => any;
203
+ progress: (file: UploadFileItem, percent: number) => any;
204
+ finish: (fileList: UploadFileItem[]) => any;
205
+ exceed: (files: File[], fileList: UploadFileItem[]) => any;
206
+ }, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
207
+ onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
208
+ onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
209
+ onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
210
+ onRemove?: ((file: UploadFileItem) => any) | undefined;
211
+ onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
212
+ onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
213
+ onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
135
214
  }>, {
136
215
  disabled: boolean;
137
- showPreview: boolean;
138
- showKeyboard: boolean;
139
- showVariablePanel: boolean;
140
- editableSampleData: boolean;
216
+ data: Record<string, unknown>;
217
+ multiple: boolean;
218
+ draggable: boolean;
219
+ action: string;
220
+ maxSize: number;
221
+ headers: Record<string, string>;
222
+ directory: boolean;
223
+ accept: string;
224
+ maxCount: number;
225
+ pasteable: boolean;
226
+ chunked: boolean;
227
+ chunkSize: number;
228
+ concurrency: number;
229
+ showFileList: boolean;
230
+ listType: "text" | "image";
231
+ showThumbnail: boolean;
232
+ tip: string;
233
+ defaultFileList: UploadFileItem[];
141
234
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
235
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
142
236
  declare const _default: typeof __VLS_export;
237
+ type __VLS_WithSlots<T, S> = T & {
238
+ new (): {
239
+ $slots: S;
240
+ };
241
+ };
242
+ //#endregion
243
+ //#region src/components/C_Upload/composables/useUploadCore.d.ts
244
+ /**
245
+ * 核心上传逻辑
246
+ *
247
+ * 统一调度文件校验、hash 计算、秒传检查、分片/普通上传、
248
+ * 进度汇总和状态管理。
249
+ */
250
+ declare function useUploadCore(props: UploadProps): {
251
+ /** 文件列表 */fileList: vue.Ref<{
252
+ uid: string;
253
+ name: string;
254
+ size: number;
255
+ type: string;
256
+ status: UploadFileStatus;
257
+ percent: number;
258
+ hash?: string | undefined;
259
+ chunkProgress?: {
260
+ uploadedChunks: number;
261
+ totalChunks: number;
262
+ uploadedBytes: number;
263
+ totalBytes: number;
264
+ } | undefined;
265
+ raw?: {
266
+ readonly lastModified: number;
267
+ readonly name: string;
268
+ readonly webkitRelativePath: string;
269
+ readonly size: number;
270
+ readonly type: string;
271
+ arrayBuffer: () => Promise<ArrayBuffer>;
272
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
273
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
274
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
275
+ text: () => Promise<string>;
276
+ } | undefined;
277
+ thumbUrl?: string | undefined;
278
+ url?: string | undefined;
279
+ response?: unknown;
280
+ error?: string | undefined;
281
+ }[], UploadFileItem[] | {
282
+ uid: string;
283
+ name: string;
284
+ size: number;
285
+ type: string;
286
+ status: UploadFileStatus;
287
+ percent: number;
288
+ hash?: string | undefined;
289
+ chunkProgress?: {
290
+ uploadedChunks: number;
291
+ totalChunks: number;
292
+ uploadedBytes: number;
293
+ totalBytes: number;
294
+ } | undefined;
295
+ raw?: {
296
+ readonly lastModified: number;
297
+ readonly name: string;
298
+ readonly webkitRelativePath: string;
299
+ readonly size: number;
300
+ readonly type: string;
301
+ arrayBuffer: () => Promise<ArrayBuffer>;
302
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
303
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
304
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
305
+ text: () => Promise<string>;
306
+ } | undefined;
307
+ thumbUrl?: string | undefined;
308
+ url?: string | undefined;
309
+ response?: unknown;
310
+ error?: string | undefined;
311
+ }[]>; /** 总进度 */
312
+ totalPercent: vue.ComputedRef<number>; /** 正在计算 hash */
313
+ hashing: vue.ComputedRef<boolean>; /** hash 进度 */
314
+ hashProgress: Readonly<vue.Ref<number, number>>; /** 添加文件 */
315
+ addFiles: (files: File[]) => UploadFileItem[]; /** 移除文件 */
316
+ removeFile: (uid: string) => void; /** 清空所有 */
317
+ clearAll: () => void; /** 开始上传 */
318
+ startUpload: () => void; /** 暂停所有 */
319
+ pauseAll: () => void; /** 恢复所有 */
320
+ resumeAll: () => void; /** 重试 */
321
+ retryFile: (uid: string) => void; /** 处理单文件 */
322
+ processFile: (item: UploadFileItem) => Promise<void>; /** 获取成功列表 */
323
+ getSuccessList: () => UploadFileItem[];
324
+ };
143
325
  //#endregion
144
- //#region src/components/C_FormulaEditor/utils/safeExpression.d.ts
145
- type Primitive = number | string | boolean;
146
- type Token = {
147
- type: 'number' | 'string' | 'variable' | 'identifier' | 'operator' | 'punctuation' | 'eof';
148
- value: string;
149
- position: number;
326
+ //#region src/components/C_Upload/composables/useDragDrop.d.ts
327
+ /**
328
+ * 拖拽 & 粘贴上传
329
+ *
330
+ * 监听容器的 dragover / drop / paste 事件,
331
+ * 提取文件(含目录遍历)后回调给上层。
332
+ *
333
+ * @param containerRef 容器 DOM
334
+ * @param enabled 是否启用拖拽
335
+ * @param pasteable 是否启用粘贴
336
+ * @param accept 文件类型限制
337
+ * @param onFiles 文件回调
338
+ */
339
+ declare function useDragDrop(containerRef: Ref<HTMLElement | undefined>, enabled: Ref<boolean>, pasteable: Ref<boolean>, accept: Ref<string>, onFiles: (files: File[]) => void): {
340
+ /** 是否正在拖拽悬停 */isDragOver: Readonly<Ref<boolean, boolean>>;
150
341
  };
151
- /** 编译一次后可对多组试算值复用,不执行 JavaScript。 */
152
- declare function compileSafeExpression(expression: string): {
153
- tokens: Token[];
154
- evaluate(fields: ReadonlyMap<string, string>, values: Readonly<Record<string, Primitive>>): Primitive;
342
+ //#endregion
343
+ //#region src/components/C_Upload/composables/useFileHash.d.ts
344
+ /** Compute MD5 incrementally while yielding between chunks to keep UI responsive. */
345
+ declare function useFileHash(chunkSize: Ref<number>): {
346
+ hashing: vue.ComputedRef<boolean>;
347
+ hashProgress: Readonly<Ref<number, number>>;
348
+ calculateHash: (file: File, onProgress?: (percent: number) => void, signal?: AbortSignal) => Promise<string>;
155
349
  };
156
350
  //#endregion
157
- //#region src/components/C_FormulaEditor/composables/useFormulaParser.d.ts
158
- interface FormulaAnalysis {
159
- tokens: FormulaToken[];
160
- validation: FormulaValidation;
161
- compiled: ReturnType<typeof compileSafeExpression> | null;
351
+ //#region src/components/C_Upload/composables/uploadScheduler.d.ts
352
+ /** 普通文件与分片共享同一个组件级请求额度;排队、取消和同步回调均释放一次。 */
353
+ declare function createUploadScheduler(concurrency: Ref<number>): ((request: CustomUploadRequest, options: UploadRequestOptions) => {
354
+ abort: () => void;
355
+ }) & {
356
+ abortAll(): void;
357
+ };
358
+ type UploadScheduler = ReturnType<typeof createUploadScheduler>;
359
+ //#endregion
360
+ //#region src/components/C_Upload/composables/useChunkUpload.d.ts
361
+ interface UseChunkUploadOptions {
362
+ scheduler?: UploadScheduler;
363
+ /** 分片大小 */
364
+ chunkSize: Ref<number>;
365
+ /** 最大并发数 */
366
+ concurrency: Ref<number>;
367
+ /** 上传地址 */
368
+ action: Ref<string>;
369
+ /** 请求头 */
370
+ headers: Ref<Record<string, string>>;
371
+ /** 附加字段 */
372
+ data: Ref<Record<string, unknown>>;
373
+ /** 自定义上传函数 */
374
+ customRequest?: Ref<CustomUploadRequest | undefined>;
375
+ /** 已上传分片查询 */
376
+ uploadedChunksQuery?: Ref<UploadedChunksQueryFn | undefined>;
377
+ /** 分片合并函数 */
378
+ mergeChunks?: Ref<MergeChunksFn | undefined>;
162
379
  }
163
- /** 在不执行公式、不需要试算值的情况下完成完整语法检查。 */
164
- declare function useFormulaParser(variables: Ref<FormulaVariable[]>, functions: Ref<FormulaFunction[]>): {
165
- tokenize: (formula: string) => FormulaToken[];
166
- analyze: (formula: string) => FormulaAnalysis;
167
- validate: (formula: string) => FormulaValidation;
168
- toEvalExpression: (formula: string, variableMap: Map<string, string>) => string;
169
- variableNames: vue.ComputedRef<Set<string>>;
170
- functionNames: vue.ComputedRef<Set<string>>;
380
+ /**
381
+ * 分片上传引擎
382
+ *
383
+ * 处理大文件分片切割、并发上传、断点续传、分片合并。
384
+ */
385
+ declare function useChunkUpload(options: UseChunkUploadOptions): {
386
+ createChunks: (file: File) => UploadChunk[];
387
+ uploadChunks: (params: {
388
+ uid: string;
389
+ file: File;
390
+ hash: string;
391
+ onProgress: (progress: ChunkProgress) => void;
392
+ onSuccess: (response: unknown) => void;
393
+ onError: (error: Error) => void;
394
+ isPaused: () => boolean;
395
+ }) => Promise<void>;
396
+ abortUpload: (uid: string) => void;
397
+ abortAll: () => void;
171
398
  };
172
399
  //#endregion
173
- //#region src/components/C_FormulaEditor/composables/useFormulaEvaluator.d.ts
400
+ //#region src/components/C_Upload/composables/useUploadQueue.d.ts
401
+ interface UseUploadQueueOptions {
402
+ scheduler?: UploadScheduler;
403
+ concurrency: Ref<number>;
404
+ action: Ref<string>;
405
+ headers: Ref<Record<string, string>>;
406
+ data: Ref<Record<string, unknown>>;
407
+ customRequest?: Ref<CustomUploadRequest | undefined>;
408
+ }
409
+ interface QueueJob {
410
+ file: UploadFileItem;
411
+ onProgress: (uid: string, percent: number) => void;
412
+ onSuccess: (uid: string, response: unknown) => void;
413
+ onError: (uid: string, error: Error) => void;
414
+ }
174
415
  /**
175
- * 公式求值引擎
176
- * 将公式中的 [变量名] 替换为实际值后计算结果
416
+ *
177
417
  */
178
- declare function useFormulaEvaluator(variables: Ref<FormulaVariable[]>): {
179
- evaluate: (formula: string, sampleData: Record<string, number | string | boolean>) => {
180
- success: boolean;
181
- result: unknown;
182
- error?: string;
183
- };
184
- extractVariableNames: (formula: string) => string[];
185
- variableMap: vue.ComputedRef<Map<string, string>>;
418
+ declare function useUploadQueue(options: UseUploadQueueOptions): {
419
+ activeCount: Readonly<Ref<number, number>>;
420
+ enqueue: (file: UploadFileItem, onProgress: QueueJob["onProgress"], onSuccess: QueueJob["onSuccess"], onError: QueueJob["onError"]) => void;
421
+ abort: (uid: string) => void;
422
+ abortAll: () => void;
186
423
  };
187
424
  //#endregion
188
- //#region src/components/C_FormulaEditor/constants.d.ts
189
- /** 运算符区(5 列 × 3 行) */
190
- declare const OPERATOR_KEYS: FormulaKeyboardKey[];
191
- /** 数字区(5 列 × 3 行) */
192
- declare const NUMBER_KEYS: FormulaKeyboardKey[];
193
- /** 动作键(⌫ + 清空) */
194
- declare const ACTION_KEYS: FormulaKeyboardKey[];
195
- /** 默认可用函数列表 */
196
- declare const DEFAULT_FUNCTIONS: FormulaFunction[];
197
- /** 所有可识别的运算符 */
198
- declare const OPERATORS: Set<string>;
199
- /** 需要在两侧加空格的运算符 */
200
- declare const SPACED_OPERATORS: Set<string>;
425
+ //#region src/components/C_Upload/constants.d.ts
426
+ /** 根据 MIME 类型获取图标 */
427
+ declare function getFileIcon(type: string): string;
428
+ /** 格式化文件大小 */
429
+ declare function formatFileSize(bytes: number): string;
201
430
  //#endregion
202
- export { FormulaVariableType as S, FormulaTemplate as _, OPERATOR_KEYS as a, FormulaValidation as b, useFormulaParser as c, FormulaEditorEmits as d, FormulaEditorExpose as f, FormulaKeyboardKey as g, FormulaKeyType as h, OPERATORS as i, _default as l, FormulaFunction as m, DEFAULT_FUNCTIONS as n, SPACED_OPERATORS as o, FormulaEditorProps as p, NUMBER_KEYS as r, useFormulaEvaluator as s, ACTION_KEYS as t, FormulaEditorConfig as u, FormulaToken as v, FormulaVariable as x, FormulaTokenType as y };
431
+ export { UploadFileStatus as _, useFileHash as a, UploadedChunksQueryFn as b, _default as c, InstantCheckFn as d, MergeChunksFn as f, UploadFileItem as g, UploadExpose as h, useChunkUpload as i, ChunkProgress as l, UploadEmits as m, getFileIcon as n, useDragDrop as o, UploadChunk as p, useUploadQueue as r, useUploadCore as s, formatFileSize as t, CustomUploadRequest as u, UploadProps as v, UploadRequestOptions as y };
@@ -231,8 +231,8 @@ interface NotificationCenterExpose {
231
231
  type __VLS_Slots = NotificationCenterSlots;
232
232
  declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, NotificationCenterExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
233
233
  delete: (ids: string[]) => any;
234
- read: (ids: string[]) => any;
235
234
  itemClick: (message: NotificationMessage) => any;
235
+ read: (ids: string[]) => any;
236
236
  allRead: (category?: NotificationCategory | undefined) => any;
237
237
  unreadChange: (count: number) => any;
238
238
  wsStatusChange: (status: WSConnectionStatus) => any;
@@ -241,8 +241,8 @@ declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, Notificat
241
241
  viewAll: () => any;
242
242
  }, string, vue.PublicProps, Readonly<NotificationCenterProps> & Readonly<{
243
243
  onDelete?: ((ids: string[]) => any) | undefined;
244
- onRead?: ((ids: string[]) => any) | undefined;
245
244
  onItemClick?: ((message: NotificationMessage) => any) | undefined;
245
+ onRead?: ((ids: string[]) => any) | undefined;
246
246
  onAllRead?: ((category?: NotificationCategory | undefined) => any) | undefined;
247
247
  onUnreadChange?: ((count: number) => any) | undefined;
248
248
  onWsStatusChange?: ((status: WSConnectionStatus) => any) | undefined;
@@ -250,12 +250,12 @@ declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, Notificat
250
250
  onNavigate?: ((url: string) => any) | undefined;
251
251
  onViewAll?: (() => any) | undefined;
252
252
  }>, {
253
+ storageKey: string;
253
254
  pageSize: number;
254
255
  autoStart: boolean;
255
256
  desktopNotification: boolean;
256
257
  maxBadgeCount: number;
257
258
  pollingInterval: number;
258
- storageKey: string;
259
259
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
260
260
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
261
261
  declare const _default: typeof __VLS_export;