@robot-admin/naive-ui-components 0.22.1 → 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 (308) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +7 -5
  3. package/README_EN.md +7 -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_Cascade.d.cts +1 -1
  18. package/dist/C_Cascade.d.ts +1 -1
  19. package/dist/C_Chat.d.cts +1 -1
  20. package/dist/C_Chat.d.ts +1 -1
  21. package/dist/C_City.d.cts +1 -1
  22. package/dist/C_City.d.ts +1 -1
  23. package/dist/C_Code.d.cts +1 -1
  24. package/dist/C_Code.d.ts +1 -1
  25. package/dist/C_ContextMenu.d.cts +1 -1
  26. package/dist/C_ContextMenu.d.ts +1 -1
  27. package/dist/C_DataPicker.cjs +1 -0
  28. package/dist/C_DataPicker.css +54 -0
  29. package/dist/C_DataPicker.d.cts +2 -0
  30. package/dist/C_DataPicker.d.ts +5 -0
  31. package/dist/C_DataPicker.js +1 -0
  32. package/dist/C_DataPicker2.cjs +1 -0
  33. package/dist/C_DataPicker2.js +1 -0
  34. package/dist/C_Date.d.cts +1 -1
  35. package/dist/C_Date.d.ts +1 -1
  36. package/dist/C_Density.cjs +1 -0
  37. package/dist/C_Density.css +1 -0
  38. package/dist/C_Density.d.cts +3 -0
  39. package/dist/C_Density.d.ts +3 -0
  40. package/dist/C_Density.js +1 -0
  41. package/dist/C_Density2.cjs +1 -0
  42. package/dist/C_Density2.js +1 -0
  43. package/dist/C_Editor.d.cts +1 -1
  44. package/dist/C_Editor.d.ts +1 -1
  45. package/dist/C_ErrorSummary.cjs +1 -0
  46. package/dist/C_ErrorSummary.css +29 -0
  47. package/dist/C_ErrorSummary.d.cts +3 -0
  48. package/dist/C_ErrorSummary.d.ts +3 -0
  49. package/dist/C_ErrorSummary.js +1 -0
  50. package/dist/C_ErrorSummary2.cjs +1 -0
  51. package/dist/C_ErrorSummary2.js +1 -0
  52. package/dist/C_Form.base.css +150 -148
  53. package/dist/C_Form.css +151 -253
  54. package/dist/C_Form.d.cts +1 -1
  55. package/dist/C_Form.d.ts +19 -2
  56. package/dist/C_FormModal.css +1 -2
  57. package/dist/C_FormModal.d.cts +1 -1
  58. package/dist/C_FormModal.d.ts +17 -2
  59. package/dist/C_FormSearch.cjs +1 -1
  60. package/dist/C_FormSearch.css +124 -52
  61. package/dist/C_FormSearch.d.cts +3 -3
  62. package/dist/C_FormSearch.d.ts +5 -4
  63. package/dist/C_FormSearch.js +1 -1
  64. package/dist/C_FormulaEditor.d.cts +1 -1
  65. package/dist/C_FormulaEditor.d.ts +1 -1
  66. package/dist/C_Guide.d.cts +1 -1
  67. package/dist/C_Guide.d.ts +1 -1
  68. package/dist/C_Icon.d.cts +1 -1
  69. package/dist/C_Icon.d.ts +1 -1
  70. package/dist/C_Language.d.cts +1 -1
  71. package/dist/C_Language.d.ts +1 -1
  72. package/dist/C_Loading.d.cts +1 -1
  73. package/dist/C_Loading.d.ts +1 -1
  74. package/dist/C_Login.d.cts +1 -1
  75. package/dist/C_Login.d.ts +1 -1
  76. package/dist/C_Markdown.d.cts +1 -1
  77. package/dist/C_Markdown.d.ts +1 -1
  78. package/dist/C_Menu.d.cts +2 -2
  79. package/dist/C_Menu.d.ts +1 -1
  80. package/dist/C_OrgChart.d.cts +1 -1
  81. package/dist/C_OrgChart.d.ts +1 -1
  82. package/dist/C_Progress.d.cts +1 -1
  83. package/dist/C_Progress.d.ts +1 -1
  84. package/dist/C_SectionNav.cjs +1 -0
  85. package/dist/C_SectionNav.css +46 -0
  86. package/dist/C_SectionNav.d.cts +2 -0
  87. package/dist/C_SectionNav.d.ts +2 -0
  88. package/dist/C_SectionNav.js +1 -0
  89. package/dist/C_SectionNav2.cjs +1 -0
  90. package/dist/C_SectionNav2.js +1 -0
  91. package/dist/C_Skeleton.d.cts +1 -1
  92. package/dist/C_Skeleton.d.ts +1 -1
  93. package/dist/C_Steps.d.cts +1 -1
  94. package/dist/C_Steps.d.ts +1 -1
  95. package/dist/C_Table.base.css +258 -256
  96. package/dist/C_Table.cjs +1 -1
  97. package/dist/C_Table.css +109 -1283
  98. package/dist/C_Table.d.cts +2 -1
  99. package/dist/C_Table.d.ts +9 -8
  100. package/dist/C_Table.js +1 -1
  101. package/dist/C_Table2.cjs +3 -0
  102. package/dist/C_Table2.js +3 -0
  103. package/dist/C_Tabs.cjs +1 -1
  104. package/dist/C_Tabs.d.cts +1 -1
  105. package/dist/C_Tabs.d.ts +1 -1
  106. package/dist/C_Tabs.js +1 -1
  107. package/dist/C_TagsView.d.cts +1 -1
  108. package/dist/C_Theme.d.cts +1 -1
  109. package/dist/C_Theme.d.ts +1 -1
  110. package/dist/C_Timeline.d.cts +1 -1
  111. package/dist/C_Timeline.d.ts +1 -1
  112. package/dist/C_Transfer.d.cts +1 -1
  113. package/dist/C_Transfer.d.ts +1 -1
  114. package/dist/C_Tree.d.cts +1 -1
  115. package/dist/C_Tree.d.ts +9 -8
  116. package/dist/C_Upload.d.cts +1 -1
  117. package/dist/C_Upload.d.ts +1 -1
  118. package/dist/C_WorkFlow2.cjs +1 -1
  119. package/dist/C_WorkFlow2.js +1 -1
  120. package/dist/Card.cjs +1 -1
  121. package/dist/Card.js +1 -1
  122. package/dist/Steps.cjs +1 -1
  123. package/dist/Steps.js +1 -1
  124. package/dist/Tabs.cjs +1 -1
  125. package/dist/Tabs.js +1 -1
  126. package/dist/batchPatch.cjs +1 -0
  127. package/dist/batchPatch.d.cts +26 -0
  128. package/dist/batchPatch.d.ts +26 -0
  129. package/dist/batchPatch.js +1 -0
  130. package/dist/config.cjs +1 -1
  131. package/dist/config.d.cts +4 -1
  132. package/dist/config.d.ts +6 -2
  133. package/dist/config.js +1 -1
  134. package/dist/config2.d.ts +1 -1
  135. package/dist/constants.d.cts +3 -3
  136. package/dist/constants.d.ts +3 -3
  137. package/dist/constants2.d.cts +402 -173
  138. package/dist/constants2.d.ts +402 -173
  139. package/dist/constants3.d.cts +4 -4
  140. package/dist/constants3.d.ts +4 -4
  141. package/dist/constants4.d.cts +173 -402
  142. package/dist/constants4.d.ts +173 -402
  143. package/dist/constants5.d.cts +2 -2
  144. package/dist/constants5.d.ts +2 -2
  145. package/dist/contracts.d.ts +24 -0
  146. package/dist/data.cjs +1 -1
  147. package/dist/data.d.cts +5 -108
  148. package/dist/data.d.ts +5 -108
  149. package/dist/data.js +1 -1
  150. package/dist/data2.cjs +1 -1
  151. package/dist/data2.d.cts +108 -0
  152. package/dist/data2.d.ts +108 -0
  153. package/dist/data2.js +1 -1
  154. package/dist/data3.cjs +1 -0
  155. package/dist/data3.js +1 -0
  156. package/dist/dateRange.d.cts +108 -13
  157. package/dist/dateRange.d.ts +110 -14
  158. package/dist/density.d.ts +15 -0
  159. package/dist/dictionary.cjs +1 -0
  160. package/dist/dictionary.d.cts +38 -0
  161. package/dist/dictionary.d.ts +38 -0
  162. package/dist/dictionary.js +1 -0
  163. package/dist/helpers.cjs +1 -1
  164. package/dist/helpers.js +1 -1
  165. package/dist/index.cjs +1 -1
  166. package/dist/index.d.cts +63 -52
  167. package/dist/index.d.ts +71 -57
  168. package/dist/index.js +1 -1
  169. package/dist/index.vue.d.cts +5 -5
  170. package/dist/index.vue.d.ts +5 -5
  171. package/dist/index10.vue.d.cts +37 -80
  172. package/dist/index10.vue.d.ts +77 -53
  173. package/dist/index11.vue.d.cts +77 -53
  174. package/dist/index11.vue.d.ts +1117 -45
  175. package/dist/index12.vue.d.cts +1117 -45
  176. package/dist/index12.vue.d.ts +17 -128
  177. package/dist/index13.vue.d.cts +17 -128
  178. package/dist/index13.vue.d.ts +57 -53
  179. package/dist/index14.vue.d.cts +57 -53
  180. package/dist/index14.vue.d.ts +16 -25
  181. package/dist/index15.vue.d.cts +16 -25
  182. package/dist/index15.vue.d.ts +52 -12
  183. package/dist/index16.vue.d.cts +52 -12
  184. package/dist/index16.vue.d.ts +13 -129
  185. package/dist/index17.vue.d.cts +13 -129
  186. package/dist/index17.vue.d.ts +123 -74
  187. package/dist/index18.vue.d.cts +123 -74
  188. package/dist/index18.vue.d.ts +48 -71
  189. package/dist/index19.vue.d.cts +40 -91
  190. package/dist/index19.vue.d.ts +36 -96
  191. package/dist/index2.vue.d.cts +2 -2
  192. package/dist/index2.vue.d.ts +2 -2
  193. package/dist/index20.vue.d.cts +38 -47
  194. package/dist/index20.vue.d.ts +13 -48
  195. package/dist/index21.vue.d.cts +12 -96
  196. package/dist/index21.vue.d.ts +25 -95
  197. package/dist/index22.vue.d.cts +20 -32
  198. package/dist/index22.vue.d.ts +75 -37
  199. package/dist/index23.vue.d.cts +77 -13
  200. package/dist/index23.vue.d.ts +71 -13
  201. package/dist/index24.vue.d.cts +1 -1
  202. package/dist/index25.vue.d.cts +116 -90
  203. package/dist/index25.vue.d.ts +116 -90
  204. package/dist/index26.vue.d.cts +94 -59
  205. package/dist/index26.vue.d.ts +94 -59
  206. package/dist/index27.vue.d.cts +75 -0
  207. package/dist/index27.vue.d.ts +75 -0
  208. package/dist/index28.vue.d.cts +103 -0
  209. package/dist/index28.vue.d.ts +103 -0
  210. package/dist/index29.vue.d.cts +105 -0
  211. package/dist/index29.vue.d.ts +105 -0
  212. package/dist/index3.vue.d.cts +5 -5
  213. package/dist/index3.vue.d.ts +5 -5
  214. package/dist/index30.vue.d.cts +28 -0
  215. package/dist/index30.vue.d.ts +28 -0
  216. package/dist/index4.vue.d.cts +19 -128
  217. package/dist/index4.vue.d.ts +17 -34
  218. package/dist/index5.vue.d.cts +127 -35
  219. package/dist/index5.vue.d.ts +30 -19
  220. package/dist/index6.vue.d.cts +30 -19
  221. package/dist/index6.vue.d.ts +22 -118
  222. package/dist/index7.vue.d.cts +22 -118
  223. package/dist/index7.vue.d.ts +112 -18
  224. package/dist/index8.vue.d.cts +112 -18
  225. package/dist/index8.vue.d.ts +24 -35
  226. package/dist/index9.vue.d.cts +24 -35
  227. package/dist/index9.vue.d.ts +37 -80
  228. package/dist/mapUtils.d.cts +4 -4
  229. package/dist/mapUtils.d.ts +4 -4
  230. package/dist/numberCodec.cjs +1 -0
  231. package/dist/numberCodec.d.cts +25 -0
  232. package/dist/numberCodec.d.ts +25 -0
  233. package/dist/numberCodec.js +1 -0
  234. package/dist/observer.cjs +1 -0
  235. package/dist/observer.js +1 -0
  236. package/dist/presets.d.cts +3 -66
  237. package/dist/presets.d.ts +3 -66
  238. package/dist/resolver.cjs +1 -1
  239. package/dist/resolver.d.cts +1 -1
  240. package/dist/resolver.d.ts +1 -1
  241. package/dist/resolver.js +1 -1
  242. package/dist/serializeSearch.cjs +1 -0
  243. package/dist/serializeSearch.js +1 -0
  244. package/dist/style.css +547 -308
  245. package/dist/types.d.cts +60 -103
  246. package/dist/types.d.ts +62 -52
  247. package/dist/types2.d.cts +104 -51
  248. package/dist/types2.d.ts +56 -0
  249. package/dist/types3.d.cts +56 -0
  250. package/dist/useCollapsePanel.d.cts +6 -6
  251. package/dist/useCollapsePanel.d.ts +6 -6
  252. package/dist/useComponentLocale.cjs +1 -1
  253. package/dist/useComponentLocale.js +1 -1
  254. package/dist/useCropperCore.d.cts +13 -13
  255. package/dist/useCropperCore.d.ts +13 -13
  256. package/dist/useDataResource.cjs +1 -0
  257. package/dist/useDataResource.js +1 -0
  258. package/dist/useDictionary.cjs +1 -0
  259. package/dist/useDictionary.js +1 -0
  260. package/dist/useDynamicFormState.d.cts +960 -10
  261. package/dist/useDynamicFormState.d.ts +951 -11
  262. package/dist/useEdgeInteraction.d.cts +3 -3
  263. package/dist/useEdgeInteraction.d.ts +3 -3
  264. package/dist/useFormArray.cjs +1 -0
  265. package/dist/useFormArray.d.cts +69 -0
  266. package/dist/useFormArray.d.ts +69 -0
  267. package/dist/useFormArray.js +1 -0
  268. package/dist/useFormConfig.d.cts +14 -0
  269. package/dist/useFormConfig.d.ts +17 -38
  270. package/dist/useGridWidth.cjs +1 -0
  271. package/dist/useGridWidth.js +1 -0
  272. package/dist/useInfiniteScroll.d.cts +3 -3
  273. package/dist/useInfiniteScroll.d.ts +3 -3
  274. package/dist/useQRCode.d.cts +5 -5
  275. package/dist/useQRCode.d.ts +5 -5
  276. package/dist/useSignatureHistory.d.cts +7 -7
  277. package/dist/useSignatureHistory.d.ts +7 -7
  278. package/dist/useSplitResize.d.cts +9 -9
  279. package/dist/useSplitResize.d.ts +9 -9
  280. package/dist/useTableGlobalConfig.cjs +1 -0
  281. package/dist/useTableGlobalConfig.js +1 -0
  282. package/dist/useTableQuery.cjs +1 -3
  283. package/dist/useTableQuery.js +1 -3
  284. package/dist/useWorkflowValidation.d.cts +5 -5
  285. package/dist/useWorkflowValidation.d.ts +5 -5
  286. package/dist/validation.cjs +1 -0
  287. package/dist/validation.d.cts +18 -0
  288. package/dist/validation.d.ts +18 -0
  289. package/dist/validation.js +1 -0
  290. package/dist/verification.d.cts +4 -4
  291. package/dist/verification.d.ts +5 -5
  292. package/dist/workflows.cjs +1 -0
  293. package/dist/workflows.d.cts +2 -0
  294. package/dist/workflows.d.ts +2 -0
  295. package/dist/workflows.js +1 -0
  296. package/docs/components.en.md +13 -1
  297. package/docs/components.md +13 -1
  298. package/docs/guides/batch-results.md +47 -0
  299. package/docs/guides/data-picker.md +65 -0
  300. package/docs/guides/data-workflows.md +123 -0
  301. package/docs/guides/form-density.en.md +39 -0
  302. package/docs/guides/form-density.md +39 -0
  303. package/docs/guides/search-workflows.md +164 -0
  304. package/package.json +21 -1
  305. package/dist/C_FormSearch2.cjs +0 -1
  306. package/dist/C_FormSearch2.js +0 -1
  307. package/dist/useTableQuery.d.cts +0 -1957
  308. package/dist/useTableQuery.d.ts +0 -1946
@@ -1,431 +1,202 @@
1
1
  import * as vue from "vue";
2
2
  import { Ref } from "vue";
3
3
 
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;
20
- }
21
- /** 分片上传进度 */
22
- interface ChunkProgress {
23
- /** 已上传分片数 */
24
- uploadedChunks: number;
25
- /** 总分片数 */
26
- totalChunks: number;
27
- /** 已上传字节 */
28
- uploadedBytes: number;
29
- /** 总字节 */
30
- totalBytes: number;
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;
31
19
  }
32
- /** 上传文件项 */
33
- interface UploadFileItem {
34
- /** 唯一标识 */
35
- uid: string;
36
- /** 文件名 */
20
+ /** 内置函数定义 */
21
+ interface FormulaFunction {
22
+ /** 函数名(如 'IF'、'SUM') */
37
23
  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;
24
+ /** 函数签名(如 'IF(条件, 真值, 假值)') */
25
+ signature: string;
26
+ /** 函数描述 */
27
+ description: string;
28
+ /** 分类(如「逻辑」「数学」「聚合」) */
29
+ category?: string;
60
30
  }
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;
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;
85
43
  }
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;
44
+ /** 公式校验结果 */
45
+ interface FormulaValidation {
46
+ /** 是否合法 */
47
+ valid: boolean;
48
+ /** 消息 */
49
+ message: string;
50
+ /** 错误位置(字符索引) */
51
+ position?: number;
52
+ }
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;
67
+ }
68
+ /** 公式编辑器 Props */
69
+ interface FormulaEditorConfig {
70
+ /** 可选变量列表 */
71
+ variables?: FormulaVariable[];
72
+ /** 可用函数列表(为空则使用内置默认函数) */
73
+ functions?: FormulaFunction[];
74
+ /** 样例数据(用于预览计算结果) */
75
+ sampleData?: Record<string, number | string | boolean>;
119
76
  /** 是否禁用 */
120
77
  disabled?: boolean;
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[];
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[];
151
92
  }
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[]];
93
+ /** 模板仅包含展示信息与公式,不绑定项目业务。 */
94
+ interface FormulaTemplate {
95
+ label: string;
96
+ value: string;
97
+ description?: string;
168
98
  }
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;
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;
191
124
  }
192
125
  //#endregion
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
- change: (fileList: UploadFileItem[]) => any;
200
- success: (file: UploadFileItem, response: unknown) => any;
201
- error: (file: UploadFileItem, error: Error) => any;
202
- progress: (file: UploadFileItem, percent: number) => any;
203
- remove: (file: UploadFileItem) => any;
204
- finish: (fileList: UploadFileItem[]) => any;
205
- exceed: (files: File[], fileList: UploadFileItem[]) => any;
206
- }, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
207
- onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
208
- onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
209
- onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
210
- onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
211
- onRemove?: ((file: UploadFileItem) => any) | undefined;
212
- onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
213
- onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
126
+ //#region src/components/C_FormulaEditor/index.vue.d.ts
127
+ declare const __VLS_export: vue.DefineComponent<FormulaEditorProps, FormulaEditorExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
128
+ change: (value: string) => any;
129
+ "update:modelValue": (value: string) => any;
130
+ "validation-change": (result: FormulaValidation) => any;
131
+ }, string, vue.PublicProps, Readonly<FormulaEditorProps> & Readonly<{
132
+ onChange?: ((value: string) => any) | undefined;
133
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
134
+ "onValidation-change"?: ((result: FormulaValidation) => any) | undefined;
214
135
  }>, {
136
+ showPreview: boolean;
215
137
  disabled: boolean;
216
- action: string;
217
- headers: Record<string, string>;
218
- data: Record<string, unknown>;
219
- multiple: boolean;
220
- directory: boolean;
221
- accept: string;
222
- maxSize: number;
223
- maxCount: number;
224
- draggable: boolean;
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[];
138
+ showKeyboard: boolean;
139
+ showVariablePanel: boolean;
140
+ editableSampleData: boolean;
234
141
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
235
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
236
142
  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
- };
325
143
  //#endregion
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>>;
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;
341
150
  };
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>;
151
+ /** 编译一次后可对多组试算值复用,不执行 JavaScript。 */
152
+ declare function compileSafeExpression(expression: string): {
153
+ tokens: Token[];
154
+ evaluate(fields: ReadonlyMap<string, string>, values: Readonly<Record<string, Primitive>>): Primitive;
349
155
  };
350
156
  //#endregion
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>;
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;
379
162
  }
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;
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>>;
398
171
  };
399
172
  //#endregion
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
- }
173
+ //#region src/components/C_FormulaEditor/composables/useFormulaEvaluator.d.ts
415
174
  /**
416
- *
175
+ * 公式求值引擎
176
+ * 将公式中的 [变量名] 替换为实际值后计算结果
417
177
  */
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;
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>>;
423
186
  };
424
187
  //#endregion
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;
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>;
430
201
  //#endregion
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 };
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 };
@@ -262,8 +262,8 @@ type PlayerInstance = InstanceType<typeof xgplayer.default>;
262
262
  //#endregion
263
263
  //#region src/components/C_VideoPlayer/index.vue.d.ts
264
264
  declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
265
- error: (error: Error) => any;
266
265
  ready: () => any;
266
+ error: (error: Error) => any;
267
267
  ended: () => any;
268
268
  stateChange: (state: PlayerState) => any;
269
269
  qualityChange: (quality: QualityLevel) => any;
@@ -275,8 +275,8 @@ declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExp
275
275
  quizAnswer: (quizId: string, answer: string | string[], isCorrect: boolean) => any;
276
276
  timeUpdate: (currentTime: number, duration: number) => any;
277
277
  }, string, vue.PublicProps, Readonly<VideoPlayerProps> & Readonly<{
278
- onError?: ((error: Error) => any) | undefined;
279
278
  onReady?: (() => any) | undefined;
279
+ onError?: ((error: Error) => any) | undefined;
280
280
  onEnded?: (() => any) | undefined;
281
281
  onStateChange?: ((state: PlayerState) => any) | undefined;
282
282
  onQualityChange?: ((quality: QualityLevel) => any) | undefined;
@@ -262,8 +262,8 @@ type PlayerInstance = InstanceType<typeof xgplayer.default>;
262
262
  //#endregion
263
263
  //#region src/components/C_VideoPlayer/index.vue.d.ts
264
264
  declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
265
- error: (error: Error) => any;
266
265
  ready: () => any;
266
+ error: (error: Error) => any;
267
267
  ended: () => any;
268
268
  stateChange: (state: PlayerState) => any;
269
269
  qualityChange: (quality: QualityLevel) => any;
@@ -275,8 +275,8 @@ declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExp
275
275
  quizAnswer: (quizId: string, answer: string | string[], isCorrect: boolean) => any;
276
276
  timeUpdate: (currentTime: number, duration: number) => any;
277
277
  }, string, vue.PublicProps, Readonly<VideoPlayerProps> & Readonly<{
278
- onError?: ((error: Error) => any) | undefined;
279
278
  onReady?: (() => any) | undefined;
279
+ onError?: ((error: Error) => any) | undefined;
280
280
  onEnded?: (() => any) | undefined;
281
281
  onStateChange?: ((state: PlayerState) => any) | undefined;
282
282
  onQualityChange?: ((quality: QualityLevel) => any) | undefined;