@robot-admin/naive-ui-components 0.13.9 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +42 -1
  3. package/README_EN.md +42 -1
  4. package/dist/C_ActionBar.css +11 -10
  5. package/dist/C_AntV.css +206 -204
  6. package/dist/C_AudioPlayer.css +11 -10
  7. package/dist/C_AvatarGroup.css +7 -5
  8. package/dist/C_Barcode.css +3 -1
  9. package/dist/C_Breadcrumb.css +17 -16
  10. package/dist/C_Captcha.css +14 -13
  11. package/dist/C_Cascade.css +7 -5
  12. package/dist/C_Chat.css +9 -8
  13. package/dist/C_City.css +8 -6
  14. package/dist/C_Code.css +15 -14
  15. package/dist/C_CollapsePanel.css +12 -11
  16. package/dist/C_ContextMenu.css +28 -28
  17. package/dist/C_Cron.cjs +1 -1
  18. package/dist/C_Cron.css +472 -251
  19. package/dist/C_Cron.d.cts +2 -2
  20. package/dist/C_Cron.d.ts +2 -2
  21. package/dist/C_Cron.js +1 -1
  22. package/dist/C_Cron2.cjs +1 -1
  23. package/dist/C_Cron2.js +1 -1
  24. package/dist/C_Date.css +2 -1
  25. package/dist/C_Draggable.css +2 -1
  26. package/dist/C_Editor.css +2 -1
  27. package/dist/C_FilePreview.css +185 -184
  28. package/dist/C_Form.base.css +334 -332
  29. package/dist/C_Form.css +333 -332
  30. package/dist/C_FormModal.css +13 -11
  31. package/dist/C_FormSearch.css +2 -1
  32. package/dist/C_FormulaEditor.cjs +1 -1
  33. package/dist/C_FormulaEditor.css +430 -273
  34. package/dist/C_FormulaEditor.d.cts +2 -2
  35. package/dist/C_FormulaEditor.d.ts +2 -2
  36. package/dist/C_FormulaEditor.js +1 -1
  37. package/dist/C_FullCalendar.css +12 -11
  38. package/dist/C_GlobalSearch.css +13 -11
  39. package/dist/C_Guide.css +8 -8
  40. package/dist/C_Icon.css +9 -7
  41. package/dist/C_ImageCropper.css +70 -68
  42. package/dist/C_Language.css +8 -8
  43. package/dist/C_Loading.css +10 -8
  44. package/dist/C_Login.css +20 -21
  45. package/dist/C_Map.css +24 -22
  46. package/dist/C_Markdown.css +8 -6
  47. package/dist/C_Menu.css +2 -1
  48. package/dist/C_NotificationCenter.css +362 -360
  49. package/dist/C_OrgChart.css +6 -5
  50. package/dist/C_PageLoading.css +2 -1
  51. package/dist/C_Progress.css +1 -1
  52. package/dist/C_QRCode.css +7 -5
  53. package/dist/C_Signature.css +7 -5
  54. package/dist/C_Skeleton.css +8 -6
  55. package/dist/C_SplitPane.css +25 -23
  56. package/dist/C_Steps.css +7 -5
  57. package/dist/C_Table.base.css +536 -537
  58. package/dist/C_Table.css +536 -538
  59. package/dist/C_Tabs.css +78 -1
  60. package/dist/C_TagsView.css +8 -8
  61. package/dist/C_Theme.css +9 -7
  62. package/dist/C_Time.css +3 -1
  63. package/dist/C_Timeline.css +9 -8
  64. package/dist/C_Transfer.css +10 -9
  65. package/dist/C_Tree.css +2 -1
  66. package/dist/C_Upload.css +176 -174
  67. package/dist/C_VideoPlayer.css +186 -184
  68. package/dist/C_VtableGantt.css +2 -1
  69. package/dist/C_WaterFall.css +19 -17
  70. package/dist/C_WorkFlow.css +976 -976
  71. package/dist/constants.d.cts +15 -20
  72. package/dist/constants.d.ts +15 -20
  73. package/dist/constants2.d.cts +44 -19
  74. package/dist/constants2.d.ts +44 -19
  75. package/dist/constants3.d.cts +4 -4
  76. package/dist/constants3.d.ts +4 -4
  77. package/dist/constants4.d.cts +7 -7
  78. package/dist/constants4.d.ts +7 -7
  79. package/dist/constants5.d.cts +2 -2
  80. package/dist/constants5.d.ts +2 -2
  81. package/dist/data.d.cts +9 -9
  82. package/dist/data.d.ts +9 -9
  83. package/dist/index.cjs +1 -1
  84. package/dist/index.d.cts +3 -3
  85. package/dist/index.d.ts +3 -3
  86. package/dist/index.js +1 -1
  87. package/dist/index.vue.d.cts +2 -2
  88. package/dist/index.vue.d.ts +2 -2
  89. package/dist/index10.vue.d.cts +5 -5
  90. package/dist/index10.vue.d.ts +2 -2
  91. package/dist/index11.vue.d.cts +2 -2
  92. package/dist/index11.vue.d.ts +5 -5
  93. package/dist/index12.vue.d.cts +5 -5
  94. package/dist/index13.vue.d.ts +2 -2
  95. package/dist/index14.vue.d.cts +2 -2
  96. package/dist/index14.vue.d.ts +4 -4
  97. package/dist/index15.vue.d.cts +4 -4
  98. package/dist/index15.vue.d.ts +1 -1
  99. package/dist/index16.vue.d.cts +1 -1
  100. package/dist/index16.vue.d.ts +1 -1
  101. package/dist/index17.vue.d.cts +1 -1
  102. package/dist/index17.vue.d.ts +1 -1
  103. package/dist/index18.vue.d.cts +1 -1
  104. package/dist/index18.vue.d.ts +4 -4
  105. package/dist/index19.vue.d.cts +4 -4
  106. package/dist/index19.vue.d.ts +1 -1
  107. package/dist/index2.vue.d.cts +1 -1
  108. package/dist/index2.vue.d.ts +1 -1
  109. package/dist/index21.vue.d.cts +2 -2
  110. package/dist/index21.vue.d.ts +2 -2
  111. package/dist/index22.vue.d.cts +2 -2
  112. package/dist/index22.vue.d.ts +2 -2
  113. package/dist/index23.vue.d.cts +2 -2
  114. package/dist/index23.vue.d.ts +2 -2
  115. package/dist/index25.vue.d.cts +3 -3
  116. package/dist/index25.vue.d.ts +3 -3
  117. package/dist/index27.vue.d.cts +4 -4
  118. package/dist/index27.vue.d.ts +4 -4
  119. package/dist/index28.vue.d.cts +1 -1
  120. package/dist/index28.vue.d.ts +1 -1
  121. package/dist/index3.vue.d.cts +3 -3
  122. package/dist/index3.vue.d.ts +3 -3
  123. package/dist/index4.vue.d.cts +1 -1
  124. package/dist/index6.vue.d.ts +1 -1
  125. package/dist/index7.vue.d.cts +1 -1
  126. package/dist/index8.vue.d.ts +2 -2
  127. package/dist/index9.vue.d.cts +2 -2
  128. package/dist/index9.vue.d.ts +5 -5
  129. package/dist/mapUtils.d.cts +5 -5
  130. package/dist/mapUtils.d.ts +5 -5
  131. package/dist/presets.d.cts +1 -1
  132. package/dist/presets.d.ts +1 -1
  133. package/dist/style.css +9934 -9765
  134. package/dist/useCollapsePanel.d.cts +2 -2
  135. package/dist/useCollapsePanel.d.ts +2 -2
  136. package/dist/useCropperCore.d.cts +9 -9
  137. package/dist/useCropperCore.d.ts +9 -9
  138. package/dist/useDraggableLayout.d.cts +7 -7
  139. package/dist/useDraggableLayout.d.ts +7 -7
  140. package/dist/useDynamicFormState.d.cts +2 -2
  141. package/dist/useDynamicFormState.d.ts +2 -2
  142. package/dist/useEdgeInteraction.d.cts +2 -2
  143. package/dist/useEdgeInteraction.d.ts +2 -2
  144. package/dist/useFormulaEvaluator.cjs +2 -0
  145. package/dist/useFormulaEvaluator.js +2 -0
  146. package/dist/useFullscreen.d.cts +2 -2
  147. package/dist/useFullscreen.d.ts +2 -2
  148. package/dist/useInfiniteScroll.d.cts +2 -2
  149. package/dist/useInfiniteScroll.d.ts +2 -2
  150. package/dist/useQRCode.d.cts +6 -6
  151. package/dist/useQRCode.d.ts +6 -6
  152. package/dist/useSearchState.d.cts +6 -6
  153. package/dist/useSearchState.d.ts +6 -6
  154. package/dist/useSignatureHistory.d.cts +4 -4
  155. package/dist/useSignatureHistory.d.ts +4 -4
  156. package/dist/useSplitResize.d.cts +7 -7
  157. package/dist/useSplitResize.d.ts +7 -7
  158. package/dist/useTableQuery.d.cts +1 -1
  159. package/dist/useTableQuery.d.ts +1 -1
  160. package/dist/useTimeSelection.d.cts +2 -2
  161. package/dist/useTimeSelection.d.ts +2 -2
  162. package/dist/useTreeOperations.d.cts +5 -5
  163. package/dist/useTreeOperations.d.ts +5 -5
  164. package/dist/useWorkflowValidation.d.cts +6 -6
  165. package/dist/useWorkflowValidation.d.ts +6 -6
  166. package/dist/verification.d.cts +5 -5
  167. package/dist/verification.d.ts +5 -5
  168. package/package.json +1 -1
  169. package/dist/C_FormulaEditor2.cjs +0 -2
  170. package/dist/C_FormulaEditor2.js +0 -2
@@ -3,9 +3,9 @@ import { Ref } from "vue";
3
3
 
4
4
  //#region src/components/C_Cron/types.d.ts
5
5
  /** Cron 字段类型 */
6
- type CronFieldType = "second" | "minute" | "hour" | "day" | "month" | "week";
6
+ type CronFieldType = 'second' | 'minute' | 'hour' | 'day' | 'month' | 'week';
7
7
  /** 单字段编辑模式 */
8
- type CronFieldMode = "every" | "range" | "step" | "specific" | "none";
8
+ type CronFieldMode = 'every' | 'range' | 'step' | 'specific' | 'none';
9
9
  /** 单字段值 */
10
10
  interface CronFieldValue {
11
11
  /** 编辑模式 */
@@ -64,9 +64,7 @@ interface CronValidation {
64
64
  field?: CronFieldType;
65
65
  }
66
66
  /** 组件 Props */
67
- interface CronProps {
68
- /** 当前 Cron 表达式 (v-model) */
69
- modelValue?: string;
67
+ interface CronConfig {
70
68
  /** 是否禁用 */
71
69
  disabled?: boolean;
72
70
  /** 预览未来执行次数 */
@@ -79,6 +77,13 @@ interface CronProps {
79
77
  showSecond?: boolean;
80
78
  /** 容器高度 */
81
79
  height?: string | number;
80
+ /** 常用计划;省略时使用组件内置模板 */
81
+ templates?: CronTemplate[];
82
+ }
83
+ /** 推荐使用 v-model + 扁平 config;独立配置属性继续兼容。 */
84
+ interface CronProps extends CronConfig {
85
+ modelValue?: string;
86
+ config?: CronConfig;
82
87
  }
83
88
  /** 组件暴露方法 */
84
89
  interface CronExpose {
@@ -94,22 +99,15 @@ interface CronExpose {
94
99
  /** 组件事件 */
95
100
  interface CronEmits {
96
101
  /** 表达式变更 */
97
- "update:modelValue": [value: string];
102
+ 'update:modelValue': [value: string];
98
103
  /** 值变更 */
99
104
  change: [value: string];
100
105
  /** 校验状态变更 */
101
- "validation-change": [result: CronValidation];
106
+ 'validation-change': [result: CronValidation];
102
107
  }
103
108
  //#endregion
104
109
  //#region src/components/C_Cron/index.vue.d.ts
105
- /** 重置为初始值 */
106
- declare function handleReset(): void;
107
- declare const __VLS_export: vue.DefineComponent<CronProps, {
108
- getValue: () => string;
109
- setValue: (expr: string) => void;
110
- reset: typeof handleReset;
111
- validate: () => CronValidation;
112
- }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
110
+ declare const __VLS_export: vue.DefineComponent<CronProps, CronExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
113
111
  "update:modelValue": (value: string) => any;
114
112
  change: (value: string) => any;
115
113
  "validation-change": (result: CronValidation) => any;
@@ -118,11 +116,8 @@ declare const __VLS_export: vue.DefineComponent<CronProps, {
118
116
  onChange?: ((value: string) => any) | undefined;
119
117
  "onValidation-change"?: ((result: CronValidation) => any) | undefined;
120
118
  }>, {
121
- height: string | number;
122
- modelValue: string;
123
119
  disabled: boolean;
124
120
  showPreview: boolean;
125
- previewCount: number;
126
121
  showTemplates: boolean;
127
122
  showSecond: boolean;
128
123
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
@@ -245,7 +240,7 @@ declare function useCronParser(): {
245
240
  * 解析 Cron 表达式,预测未来 N 次执行时间
246
241
  * 纯逻辑实现,不依赖外部库
247
242
  */
248
- declare function useCronPreview(expression: Ref<string>, validation: Ref<CronValidation>, count: Ref<number>): {
243
+ declare function useCronPreview(expression: Ref<string>, validation: Ref<CronValidation>, count: Ref<number>, enabled?: Ref<boolean>): {
249
244
  nextExecutions: Ref<Date[], Date[]>;
250
245
  computing: Ref<boolean, boolean>;
251
246
  formatDate: (date: Date) => string;
@@ -269,4 +264,4 @@ declare const CRON_TEMPLATES: CronTemplate[];
269
264
  declare const MONTH_LABELS: Record<number, string>;
270
265
  declare const WEEK_LABELS: Record<number, string>;
271
266
  //#endregion
272
- export { CronFieldValue as _, DEFAULT_FIELD_VALUE as a, CronValidation as b, useCronDescription as c, _default as d, CronEmits as f, CronFieldType as g, CronFieldMode as h, DEFAULT_CRON_VALUE as i, useCronPreview as l, CronFieldMeta as m, CRON_TEMPLATES as n, MONTH_LABELS as o, CronExpose as p, DEFAULT_CRON_EXPRESSION as r, WEEK_LABELS as s, CRON_FIELD_META as t, useCronParser as u, CronProps as v, CronValue as x, CronTemplate as y };
267
+ export { CronValue as S, CronFieldType as _, DEFAULT_FIELD_VALUE as a, CronTemplate as b, useCronDescription as c, _default as d, CronConfig as f, CronFieldMode as g, CronFieldMeta as h, DEFAULT_CRON_VALUE as i, useCronPreview as l, CronExpose as m, CRON_TEMPLATES as n, MONTH_LABELS as o, CronEmits as p, DEFAULT_CRON_EXPRESSION as r, WEEK_LABELS as s, CRON_FIELD_META as t, useCronParser as u, CronFieldValue as v, CronValidation as x, CronProps as y };
@@ -3,9 +3,9 @@ import { Ref } from "vue";
3
3
 
4
4
  //#region src/components/C_Cron/types.d.ts
5
5
  /** Cron 字段类型 */
6
- type CronFieldType = "second" | "minute" | "hour" | "day" | "month" | "week";
6
+ type CronFieldType = 'second' | 'minute' | 'hour' | 'day' | 'month' | 'week';
7
7
  /** 单字段编辑模式 */
8
- type CronFieldMode = "every" | "range" | "step" | "specific" | "none";
8
+ type CronFieldMode = 'every' | 'range' | 'step' | 'specific' | 'none';
9
9
  /** 单字段值 */
10
10
  interface CronFieldValue {
11
11
  /** 编辑模式 */
@@ -64,9 +64,7 @@ interface CronValidation {
64
64
  field?: CronFieldType;
65
65
  }
66
66
  /** 组件 Props */
67
- interface CronProps {
68
- /** 当前 Cron 表达式 (v-model) */
69
- modelValue?: string;
67
+ interface CronConfig {
70
68
  /** 是否禁用 */
71
69
  disabled?: boolean;
72
70
  /** 预览未来执行次数 */
@@ -79,6 +77,13 @@ interface CronProps {
79
77
  showSecond?: boolean;
80
78
  /** 容器高度 */
81
79
  height?: string | number;
80
+ /** 常用计划;省略时使用组件内置模板 */
81
+ templates?: CronTemplate[];
82
+ }
83
+ /** 推荐使用 v-model + 扁平 config;独立配置属性继续兼容。 */
84
+ interface CronProps extends CronConfig {
85
+ modelValue?: string;
86
+ config?: CronConfig;
82
87
  }
83
88
  /** 组件暴露方法 */
84
89
  interface CronExpose {
@@ -94,22 +99,15 @@ interface CronExpose {
94
99
  /** 组件事件 */
95
100
  interface CronEmits {
96
101
  /** 表达式变更 */
97
- "update:modelValue": [value: string];
102
+ 'update:modelValue': [value: string];
98
103
  /** 值变更 */
99
104
  change: [value: string];
100
105
  /** 校验状态变更 */
101
- "validation-change": [result: CronValidation];
106
+ 'validation-change': [result: CronValidation];
102
107
  }
103
108
  //#endregion
104
109
  //#region src/components/C_Cron/index.vue.d.ts
105
- /** 重置为初始值 */
106
- declare function handleReset(): void;
107
- declare const __VLS_export: vue.DefineComponent<CronProps, {
108
- getValue: () => string;
109
- setValue: (expr: string) => void;
110
- reset: typeof handleReset;
111
- validate: () => CronValidation;
112
- }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
110
+ declare const __VLS_export: vue.DefineComponent<CronProps, CronExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
113
111
  "update:modelValue": (value: string) => any;
114
112
  change: (value: string) => any;
115
113
  "validation-change": (result: CronValidation) => any;
@@ -118,11 +116,8 @@ declare const __VLS_export: vue.DefineComponent<CronProps, {
118
116
  onChange?: ((value: string) => any) | undefined;
119
117
  "onValidation-change"?: ((result: CronValidation) => any) | undefined;
120
118
  }>, {
121
- height: string | number;
122
- modelValue: string;
123
119
  disabled: boolean;
124
120
  showPreview: boolean;
125
- previewCount: number;
126
121
  showTemplates: boolean;
127
122
  showSecond: boolean;
128
123
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
@@ -245,7 +240,7 @@ declare function useCronParser(): {
245
240
  * 解析 Cron 表达式,预测未来 N 次执行时间
246
241
  * 纯逻辑实现,不依赖外部库
247
242
  */
248
- declare function useCronPreview(expression: Ref<string>, validation: Ref<CronValidation>, count: Ref<number>): {
243
+ declare function useCronPreview(expression: Ref<string>, validation: Ref<CronValidation>, count: Ref<number>, enabled?: Ref<boolean>): {
249
244
  nextExecutions: Ref<Date[], Date[]>;
250
245
  computing: Ref<boolean, boolean>;
251
246
  formatDate: (date: Date) => string;
@@ -269,4 +264,4 @@ declare const CRON_TEMPLATES: CronTemplate[];
269
264
  declare const MONTH_LABELS: Record<number, string>;
270
265
  declare const WEEK_LABELS: Record<number, string>;
271
266
  //#endregion
272
- export { CronFieldValue as _, DEFAULT_FIELD_VALUE as a, CronValidation as b, useCronDescription as c, _default as d, CronEmits as f, CronFieldType as g, CronFieldMode as h, DEFAULT_CRON_VALUE as i, useCronPreview as l, CronFieldMeta as m, CRON_TEMPLATES as n, MONTH_LABELS as o, CronExpose as p, DEFAULT_CRON_EXPRESSION as r, WEEK_LABELS as s, CRON_FIELD_META as t, useCronParser as u, CronProps as v, CronValue as x, CronTemplate as y };
267
+ export { CronValue as S, CronFieldType as _, DEFAULT_FIELD_VALUE as a, CronTemplate as b, useCronDescription as c, _default as d, CronConfig as f, CronFieldMode as g, CronFieldMeta as h, DEFAULT_CRON_VALUE as i, useCronPreview as l, CronExpose as m, CRON_TEMPLATES as n, MONTH_LABELS as o, CronEmits as p, DEFAULT_CRON_EXPRESSION as r, WEEK_LABELS as s, CRON_FIELD_META as t, useCronParser as u, CronFieldValue as v, CronValidation as x, CronProps as y };
@@ -3,7 +3,7 @@ import { Ref } from "vue";
3
3
 
4
4
  //#region src/components/C_FormulaEditor/types.d.ts
5
5
  /** 变量数据类型 */
6
- type FormulaVariableType = "number" | "text" | "boolean";
6
+ type FormulaVariableType = 'number' | 'text' | 'boolean';
7
7
  /** 变量定义 */
8
8
  interface FormulaVariable {
9
9
  /** 显示名称(如「完成值」「目标额」) */
@@ -29,7 +29,7 @@ interface FormulaFunction {
29
29
  category?: string;
30
30
  }
31
31
  /** Token 类型 */
32
- type FormulaTokenType = "variable" | "operator" | "number" | "function" | "paren" | "comma" | "text" | "space";
32
+ type FormulaTokenType = 'variable' | 'operator' | 'number' | 'function' | 'paren' | 'comma' | 'text' | 'space';
33
33
  /** 公式中的单个 Token */
34
34
  interface FormulaToken {
35
35
  /** Token 类型 */
@@ -51,7 +51,7 @@ interface FormulaValidation {
51
51
  position?: number;
52
52
  }
53
53
  /** 键盘按键类型 */
54
- type FormulaKeyType = "operator" | "number" | "paren" | "logic" | "compare" | "action";
54
+ type FormulaKeyType = 'operator' | 'number' | 'paren' | 'logic' | 'compare' | 'action';
55
55
  /** 单个键盘按键定义 */
56
56
  interface FormulaKeyboardKey {
57
57
  /** 按键显示文本 */
@@ -61,14 +61,12 @@ interface FormulaKeyboardKey {
61
61
  /** 按键类型 */
62
62
  type: FormulaKeyType;
63
63
  /** 高亮色(可选) */
64
- color?: "primary" | "warning" | "error" | "info";
64
+ color?: 'primary' | 'warning' | 'error' | 'info';
65
65
  /** 是否是动作键(如退格、清空) */
66
66
  isAction?: boolean;
67
67
  }
68
68
  /** 公式编辑器 Props */
69
- interface FormulaEditorProps {
70
- /** 公式字符串 (v-model) */
71
- modelValue?: string;
69
+ interface FormulaEditorConfig {
72
70
  /** 可选变量列表 */
73
71
  variables?: FormulaVariable[];
74
72
  /** 可用函数列表(为空则使用内置默认函数) */
@@ -87,12 +85,27 @@ interface FormulaEditorProps {
87
85
  showKeyboard?: boolean;
88
86
  /** 是否显示变量面板 */
89
87
  showVariablePanel?: boolean;
88
+ /** 允许调整试算值;不会修改传入的 sampleData */
89
+ editableSampleData?: boolean;
90
+ /** 可直接应用的公式模板 */
91
+ templates?: FormulaTemplate[];
92
+ }
93
+ /** 模板仅包含展示信息与公式,不绑定项目业务。 */
94
+ interface FormulaTemplate {
95
+ label: string;
96
+ value: string;
97
+ description?: string;
98
+ }
99
+ /** 推荐使用 v-model + 扁平 config;独立配置属性继续兼容。 */
100
+ interface FormulaEditorProps extends FormulaEditorConfig {
101
+ modelValue?: string;
102
+ config?: FormulaEditorConfig;
90
103
  }
91
104
  /** 公式编辑器 Emits */
92
105
  interface FormulaEditorEmits {
93
- "update:modelValue": [value: string];
106
+ 'update:modelValue': [value: string];
94
107
  change: [value: string];
95
- "validation-change": [result: FormulaValidation];
108
+ 'validation-change': [result: FormulaValidation];
96
109
  }
97
110
  /** 公式编辑器暴露方法 */
98
111
  interface FormulaEditorExpose {
@@ -120,25 +133,37 @@ declare const __VLS_export: vue.DefineComponent<FormulaEditorProps, FormulaEdito
120
133
  onChange?: ((value: string) => any) | undefined;
121
134
  "onValidation-change"?: ((result: FormulaValidation) => any) | undefined;
122
135
  }>, {
123
- height: string | number;
124
- modelValue: string;
125
136
  disabled: boolean;
126
- placeholder: string;
127
137
  showPreview: boolean;
128
- variables: FormulaVariable[];
129
- functions: FormulaFunction[];
130
- sampleData: Record<string, number | string | boolean>;
131
138
  showKeyboard: boolean;
132
139
  showVariablePanel: boolean;
140
+ editableSampleData: boolean;
133
141
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
134
142
  declare const _default: typeof __VLS_export;
135
143
  //#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;
150
+ };
151
+ /** 编译一次后可对多组试算值复用,不执行 JavaScript。 */
152
+ declare function compileSafeExpression(expression: string): {
153
+ tokens: Token[];
154
+ evaluate(fields: ReadonlyMap<string, string>, values: Readonly<Record<string, Primitive>>): Primitive;
155
+ };
156
+ //#endregion
136
157
  //#region src/components/C_FormulaEditor/composables/useFormulaParser.d.ts
137
- /**
138
- * 公式解析 & 校验引擎
139
- */
158
+ interface FormulaAnalysis {
159
+ tokens: FormulaToken[];
160
+ validation: FormulaValidation;
161
+ compiled: ReturnType<typeof compileSafeExpression> | null;
162
+ }
163
+ /** 在不执行公式、不需要试算值的情况下完成完整语法检查。 */
140
164
  declare function useFormulaParser(variables: Ref<FormulaVariable[]>, functions: Ref<FormulaFunction[]>): {
141
165
  tokenize: (formula: string) => FormulaToken[];
166
+ analyze: (formula: string) => FormulaAnalysis;
142
167
  validate: (formula: string) => FormulaValidation;
143
168
  toEvalExpression: (formula: string, variableMap: Map<string, string>) => string;
144
169
  variableNames: vue.ComputedRef<Set<string>>;
@@ -174,4 +199,4 @@ declare const OPERATORS: Set<string>;
174
199
  /** 需要在两侧加空格的运算符 */
175
200
  declare const SPACED_OPERATORS: Set<string>;
176
201
  //#endregion
177
- export { FormulaTokenType as _, OPERATOR_KEYS as a, FormulaVariableType as b, useFormulaParser as c, FormulaEditorExpose as d, FormulaEditorProps as f, FormulaToken as g, FormulaKeyboardKey as h, OPERATORS as i, _default as l, FormulaKeyType as m, DEFAULT_FUNCTIONS as n, SPACED_OPERATORS as o, FormulaFunction as p, NUMBER_KEYS as r, useFormulaEvaluator as s, ACTION_KEYS as t, FormulaEditorEmits as u, FormulaValidation as v, FormulaVariable 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 };
@@ -3,7 +3,7 @@ import { Ref } from "vue";
3
3
 
4
4
  //#region src/components/C_FormulaEditor/types.d.ts
5
5
  /** 变量数据类型 */
6
- type FormulaVariableType = "number" | "text" | "boolean";
6
+ type FormulaVariableType = 'number' | 'text' | 'boolean';
7
7
  /** 变量定义 */
8
8
  interface FormulaVariable {
9
9
  /** 显示名称(如「完成值」「目标额」) */
@@ -29,7 +29,7 @@ interface FormulaFunction {
29
29
  category?: string;
30
30
  }
31
31
  /** Token 类型 */
32
- type FormulaTokenType = "variable" | "operator" | "number" | "function" | "paren" | "comma" | "text" | "space";
32
+ type FormulaTokenType = 'variable' | 'operator' | 'number' | 'function' | 'paren' | 'comma' | 'text' | 'space';
33
33
  /** 公式中的单个 Token */
34
34
  interface FormulaToken {
35
35
  /** Token 类型 */
@@ -51,7 +51,7 @@ interface FormulaValidation {
51
51
  position?: number;
52
52
  }
53
53
  /** 键盘按键类型 */
54
- type FormulaKeyType = "operator" | "number" | "paren" | "logic" | "compare" | "action";
54
+ type FormulaKeyType = 'operator' | 'number' | 'paren' | 'logic' | 'compare' | 'action';
55
55
  /** 单个键盘按键定义 */
56
56
  interface FormulaKeyboardKey {
57
57
  /** 按键显示文本 */
@@ -61,14 +61,12 @@ interface FormulaKeyboardKey {
61
61
  /** 按键类型 */
62
62
  type: FormulaKeyType;
63
63
  /** 高亮色(可选) */
64
- color?: "primary" | "warning" | "error" | "info";
64
+ color?: 'primary' | 'warning' | 'error' | 'info';
65
65
  /** 是否是动作键(如退格、清空) */
66
66
  isAction?: boolean;
67
67
  }
68
68
  /** 公式编辑器 Props */
69
- interface FormulaEditorProps {
70
- /** 公式字符串 (v-model) */
71
- modelValue?: string;
69
+ interface FormulaEditorConfig {
72
70
  /** 可选变量列表 */
73
71
  variables?: FormulaVariable[];
74
72
  /** 可用函数列表(为空则使用内置默认函数) */
@@ -87,12 +85,27 @@ interface FormulaEditorProps {
87
85
  showKeyboard?: boolean;
88
86
  /** 是否显示变量面板 */
89
87
  showVariablePanel?: boolean;
88
+ /** 允许调整试算值;不会修改传入的 sampleData */
89
+ editableSampleData?: boolean;
90
+ /** 可直接应用的公式模板 */
91
+ templates?: FormulaTemplate[];
92
+ }
93
+ /** 模板仅包含展示信息与公式,不绑定项目业务。 */
94
+ interface FormulaTemplate {
95
+ label: string;
96
+ value: string;
97
+ description?: string;
98
+ }
99
+ /** 推荐使用 v-model + 扁平 config;独立配置属性继续兼容。 */
100
+ interface FormulaEditorProps extends FormulaEditorConfig {
101
+ modelValue?: string;
102
+ config?: FormulaEditorConfig;
90
103
  }
91
104
  /** 公式编辑器 Emits */
92
105
  interface FormulaEditorEmits {
93
- "update:modelValue": [value: string];
106
+ 'update:modelValue': [value: string];
94
107
  change: [value: string];
95
- "validation-change": [result: FormulaValidation];
108
+ 'validation-change': [result: FormulaValidation];
96
109
  }
97
110
  /** 公式编辑器暴露方法 */
98
111
  interface FormulaEditorExpose {
@@ -120,25 +133,37 @@ declare const __VLS_export: vue.DefineComponent<FormulaEditorProps, FormulaEdito
120
133
  onChange?: ((value: string) => any) | undefined;
121
134
  "onValidation-change"?: ((result: FormulaValidation) => any) | undefined;
122
135
  }>, {
123
- height: string | number;
124
- modelValue: string;
125
136
  disabled: boolean;
126
- placeholder: string;
127
137
  showPreview: boolean;
128
- variables: FormulaVariable[];
129
- functions: FormulaFunction[];
130
- sampleData: Record<string, number | string | boolean>;
131
138
  showKeyboard: boolean;
132
139
  showVariablePanel: boolean;
140
+ editableSampleData: boolean;
133
141
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
134
142
  declare const _default: typeof __VLS_export;
135
143
  //#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;
150
+ };
151
+ /** 编译一次后可对多组试算值复用,不执行 JavaScript。 */
152
+ declare function compileSafeExpression(expression: string): {
153
+ tokens: Token[];
154
+ evaluate(fields: ReadonlyMap<string, string>, values: Readonly<Record<string, Primitive>>): Primitive;
155
+ };
156
+ //#endregion
136
157
  //#region src/components/C_FormulaEditor/composables/useFormulaParser.d.ts
137
- /**
138
- * 公式解析 & 校验引擎
139
- */
158
+ interface FormulaAnalysis {
159
+ tokens: FormulaToken[];
160
+ validation: FormulaValidation;
161
+ compiled: ReturnType<typeof compileSafeExpression> | null;
162
+ }
163
+ /** 在不执行公式、不需要试算值的情况下完成完整语法检查。 */
140
164
  declare function useFormulaParser(variables: Ref<FormulaVariable[]>, functions: Ref<FormulaFunction[]>): {
141
165
  tokenize: (formula: string) => FormulaToken[];
166
+ analyze: (formula: string) => FormulaAnalysis;
142
167
  validate: (formula: string) => FormulaValidation;
143
168
  toEvalExpression: (formula: string, variableMap: Map<string, string>) => string;
144
169
  variableNames: vue.ComputedRef<Set<string>>;
@@ -174,4 +199,4 @@ declare const OPERATORS: Set<string>;
174
199
  /** 需要在两侧加空格的运算符 */
175
200
  declare const SPACED_OPERATORS: Set<string>;
176
201
  //#endregion
177
- export { FormulaTokenType as _, OPERATOR_KEYS as a, FormulaVariableType as b, useFormulaParser as c, FormulaEditorExpose as d, FormulaEditorProps as f, FormulaToken as g, FormulaKeyboardKey as h, OPERATORS as i, _default as l, FormulaKeyType as m, DEFAULT_FUNCTIONS as n, SPACED_OPERATORS as o, FormulaFunction as p, NUMBER_KEYS as r, useFormulaEvaluator as s, ACTION_KEYS as t, FormulaEditorEmits as u, FormulaValidation as v, FormulaVariable 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 };
@@ -155,8 +155,8 @@ interface NotificationCenterExpose {
155
155
  //#region src/components/C_NotificationCenter/index.vue.d.ts
156
156
  declare const __VLS_export: vue.DefineComponent<NotificationCenterProps, NotificationCenterExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
157
157
  delete: (ids: string[]) => any;
158
- read: (ids: string[]) => any;
159
158
  itemClick: (message: NotificationMessage) => any;
159
+ read: (ids: string[]) => any;
160
160
  allRead: (category?: NotificationCategory | undefined) => any;
161
161
  unreadChange: (count: number) => any;
162
162
  wsStatusChange: (status: WSConnectionStatus) => any;
@@ -164,19 +164,19 @@ declare const __VLS_export: vue.DefineComponent<NotificationCenterProps, Notific
164
164
  navigate: (url: string) => any;
165
165
  }, string, vue.PublicProps, Readonly<NotificationCenterProps> & Readonly<{
166
166
  onDelete?: ((ids: string[]) => any) | undefined;
167
- onRead?: ((ids: string[]) => any) | undefined;
168
167
  onItemClick?: ((message: NotificationMessage) => any) | undefined;
168
+ onRead?: ((ids: string[]) => any) | undefined;
169
169
  onAllRead?: ((category?: NotificationCategory | undefined) => any) | undefined;
170
170
  onUnreadChange?: ((count: number) => any) | undefined;
171
171
  onWsStatusChange?: ((status: WSConnectionStatus) => any) | undefined;
172
172
  onNewMessage?: ((message: NotificationMessage) => any) | undefined;
173
173
  onNavigate?: ((url: string) => any) | undefined;
174
174
  }>, {
175
+ storageKey: string;
176
+ pageSize: number;
175
177
  desktopNotification: boolean;
176
178
  maxBadgeCount: number;
177
179
  pollingInterval: number;
178
- pageSize: number;
179
- storageKey: string;
180
180
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
181
181
  declare const _default: typeof __VLS_export;
182
182
  //#endregion
@@ -155,8 +155,8 @@ interface NotificationCenterExpose {
155
155
  //#region src/components/C_NotificationCenter/index.vue.d.ts
156
156
  declare const __VLS_export: vue.DefineComponent<NotificationCenterProps, NotificationCenterExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
157
157
  delete: (ids: string[]) => any;
158
- read: (ids: string[]) => any;
159
158
  itemClick: (message: NotificationMessage) => any;
159
+ read: (ids: string[]) => any;
160
160
  allRead: (category?: NotificationCategory | undefined) => any;
161
161
  unreadChange: (count: number) => any;
162
162
  wsStatusChange: (status: WSConnectionStatus) => any;
@@ -164,19 +164,19 @@ declare const __VLS_export: vue.DefineComponent<NotificationCenterProps, Notific
164
164
  navigate: (url: string) => any;
165
165
  }, string, vue.PublicProps, Readonly<NotificationCenterProps> & Readonly<{
166
166
  onDelete?: ((ids: string[]) => any) | undefined;
167
- onRead?: ((ids: string[]) => any) | undefined;
168
167
  onItemClick?: ((message: NotificationMessage) => any) | undefined;
168
+ onRead?: ((ids: string[]) => any) | undefined;
169
169
  onAllRead?: ((category?: NotificationCategory | undefined) => any) | undefined;
170
170
  onUnreadChange?: ((count: number) => any) | undefined;
171
171
  onWsStatusChange?: ((status: WSConnectionStatus) => any) | undefined;
172
172
  onNewMessage?: ((message: NotificationMessage) => any) | undefined;
173
173
  onNavigate?: ((url: string) => any) | undefined;
174
174
  }>, {
175
+ storageKey: string;
176
+ pageSize: number;
175
177
  desktopNotification: boolean;
176
178
  maxBadgeCount: number;
177
179
  pollingInterval: number;
178
- pageSize: number;
179
- storageKey: string;
180
180
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
181
181
  declare const _default: typeof __VLS_export;
182
182
  //#endregion
@@ -196,31 +196,31 @@ type __VLS_Slots = {} & {
196
196
  area?: (props: typeof __VLS_11) => any;
197
197
  };
198
198
  declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
199
+ progress: (file: UploadFileItem, percent: number) => any;
200
+ success: (file: UploadFileItem, response: unknown) => any;
199
201
  change: (fileList: UploadFileItem[]) => any;
200
202
  error: (file: UploadFileItem, error: Error) => any;
201
- success: (file: UploadFileItem, response: unknown) => any;
202
- progress: (file: UploadFileItem, percent: number) => any;
203
203
  remove: (file: UploadFileItem) => any;
204
204
  finish: (fileList: UploadFileItem[]) => any;
205
205
  exceed: (files: File[], fileList: UploadFileItem[]) => any;
206
206
  }, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
207
+ onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
208
+ onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
207
209
  onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
208
210
  onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
209
- onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
210
- onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
211
211
  onRemove?: ((file: UploadFileItem) => any) | undefined;
212
212
  onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
213
213
  onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
214
214
  }>, {
215
- data: Record<string, unknown>;
216
- maxSize: number;
217
215
  disabled: boolean;
218
216
  draggable: boolean;
219
- multiple: boolean;
220
217
  action: string;
218
+ data: Record<string, unknown>;
219
+ multiple: boolean;
221
220
  headers: Record<string, string>;
222
221
  directory: boolean;
223
222
  accept: string;
223
+ maxSize: number;
224
224
  maxCount: number;
225
225
  pasteable: boolean;
226
226
  chunked: boolean;
@@ -196,31 +196,31 @@ type __VLS_Slots = {} & {
196
196
  area?: (props: typeof __VLS_11) => any;
197
197
  };
198
198
  declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
199
+ progress: (file: UploadFileItem, percent: number) => any;
200
+ success: (file: UploadFileItem, response: unknown) => any;
199
201
  change: (fileList: UploadFileItem[]) => any;
200
202
  error: (file: UploadFileItem, error: Error) => any;
201
- success: (file: UploadFileItem, response: unknown) => any;
202
- progress: (file: UploadFileItem, percent: number) => any;
203
203
  remove: (file: UploadFileItem) => any;
204
204
  finish: (fileList: UploadFileItem[]) => any;
205
205
  exceed: (files: File[], fileList: UploadFileItem[]) => any;
206
206
  }, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
207
+ onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
208
+ onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
207
209
  onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
208
210
  onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
209
- onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
210
- onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
211
211
  onRemove?: ((file: UploadFileItem) => any) | undefined;
212
212
  onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
213
213
  onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
214
214
  }>, {
215
- data: Record<string, unknown>;
216
- maxSize: number;
217
215
  disabled: boolean;
218
216
  draggable: boolean;
219
- multiple: boolean;
220
217
  action: string;
218
+ data: Record<string, unknown>;
219
+ multiple: boolean;
221
220
  headers: Record<string, string>;
222
221
  directory: boolean;
223
222
  accept: string;
223
+ maxSize: number;
224
224
  maxCount: number;
225
225
  pasteable: boolean;
226
226
  chunked: boolean;
@@ -258,8 +258,8 @@ type PlayerInstance = InstanceType<typeof xgplayer.default>;
258
258
  //#endregion
259
259
  //#region src/components/C_VideoPlayer/index.vue.d.ts
260
260
  declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
261
- ready: () => any;
262
261
  error: (error: Error) => any;
262
+ ready: () => any;
263
263
  ended: () => any;
264
264
  stateChange: (state: PlayerState) => any;
265
265
  timeUpdate: (currentTime: number, duration: number) => any;
@@ -271,8 +271,8 @@ declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExp
271
271
  chapterChange: (chapter: Chapter) => any;
272
272
  progressUpdate: (data: ProgressData) => any;
273
273
  }, string, vue.PublicProps, Readonly<VideoPlayerProps> & Readonly<{
274
- onReady?: (() => any) | undefined;
275
274
  onError?: ((error: Error) => any) | undefined;
275
+ onReady?: (() => any) | undefined;
276
276
  onEnded?: (() => any) | undefined;
277
277
  onStateChange?: ((state: PlayerState) => any) | undefined;
278
278
  onTimeUpdate?: ((currentTime: number, duration: number) => any) | undefined;
@@ -258,8 +258,8 @@ type PlayerInstance = InstanceType<typeof xgplayer.default>;
258
258
  //#endregion
259
259
  //#region src/components/C_VideoPlayer/index.vue.d.ts
260
260
  declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
261
- ready: () => any;
262
261
  error: (error: Error) => any;
262
+ ready: () => any;
263
263
  ended: () => any;
264
264
  stateChange: (state: PlayerState) => any;
265
265
  timeUpdate: (currentTime: number, duration: number) => any;
@@ -271,8 +271,8 @@ declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExp
271
271
  chapterChange: (chapter: Chapter) => any;
272
272
  progressUpdate: (data: ProgressData) => any;
273
273
  }, string, vue.PublicProps, Readonly<VideoPlayerProps> & Readonly<{
274
- onReady?: (() => any) | undefined;
275
274
  onError?: ((error: Error) => any) | undefined;
275
+ onReady?: (() => any) | undefined;
276
276
  onEnded?: (() => any) | undefined;
277
277
  onStateChange?: ((state: PlayerState) => any) | undefined;
278
278
  onTimeUpdate?: ((currentTime: number, duration: number) => any) | undefined;