cc1-form 1.2.27 → 1.2.29

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.
@@ -1,3 +1,4 @@
1
+ import type { CurdConfigColumn } from '..';
1
2
  /**
2
3
  * 表单工具类,提供自定义组件注册、选项数据动态更新等辅助方法
3
4
  *
@@ -23,6 +24,18 @@ export default class TForm {
23
24
  static customComponent: {
24
25
  [key: string]: any;
25
26
  };
27
+ /**
28
+ * 错误提示
29
+ */
30
+ static error: Partial<{
31
+ /**
32
+ * 全局异常提示回调,如果返回空字符串,则不进行提示
33
+ * @param key 字段名
34
+ * @param item 字段配置
35
+ * @returns 错误提示
36
+ */
37
+ callback: (key: string, item: CurdConfigColumn) => string;
38
+ }>;
26
39
  /**
27
40
  * 根据字段名查找对应 column 的 options 配置对象
28
41
  *
@@ -32,21 +45,21 @@ export default class TForm {
32
45
  */
33
46
  static findOptions: (option: any, field: string) => any;
34
47
  /**
35
- * 更新组件数据
36
- * @param option
37
- * @param field
38
- * @param data
39
- *
40
- * @example
41
- * TForm.setOptionsData(
42
- conf.option,
43
- 'url',
44
- list.map(item => ({
45
- label: item.path,
46
- value: item.path,
47
- }))
48
- )
49
- */
48
+ * 更新组件数据
49
+ * @param option
50
+ * @param field
51
+ * @param data
52
+ *
53
+ * @example
54
+ * TForm.setOptionsData(
55
+ conf.option,
56
+ 'url',
57
+ list.map(item => ({
58
+ label: item.path,
59
+ value: item.path,
60
+ }))
61
+ )
62
+ */
50
63
  static setOptionsData: (option: any, field: string, data: any) => void;
51
64
  static form: {
52
65
  openBefore: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc1-form",
3
- "version": "1.2.27",
3
+ "version": "1.2.29",
4
4
  "description": "我来助你-表单组件库",
5
5
  "repository": {
6
6
  "type": "git",