@tmagic/form 1.4.0 → 1.4.1

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.
@@ -4529,9 +4529,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4529
4529
  }
4530
4530
  });
4531
4531
 
4532
- const createForm = function(config) {
4533
- return config;
4534
- };
4532
+ const createForm = (config) => config;
4535
4533
  const defaultInstallOpt = {};
4536
4534
  const index = {
4537
4535
  install(app, opt = {}) {
@@ -4528,9 +4528,7 @@
4528
4528
  }
4529
4529
  });
4530
4530
 
4531
- const createForm = function(config) {
4532
- return config;
4533
- };
4531
+ const createForm = (config) => config;
4534
4532
  const defaultInstallOpt = {};
4535
4533
  const index = {
4536
4534
  install(app, opt = {}) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.0",
2
+ "version": "1.4.1",
3
3
  "name": "@tmagic/form",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@element-plus/icons-vue": "^2.3.1",
35
- "@tmagic/design": "1.4.0",
36
- "@tmagic/utils": "1.4.0",
35
+ "@tmagic/design": "1.4.1",
36
+ "@tmagic/utils": "1.4.1",
37
37
  "lodash-es": "^4.17.21",
38
38
  "sortablejs": "^1.14.0",
39
39
  "vue": "^3.4.21"
package/src/index.ts CHANGED
@@ -89,9 +89,7 @@ export { default as MSelect } from './fields/Select.vue';
89
89
  export { default as MCascader } from './fields/Cascader.vue';
90
90
  export { default as MDynamicField } from './fields/DynamicField.vue';
91
91
 
92
- export const createForm = function (config: FormConfig) {
93
- return config;
94
- };
92
+ export const createForm = <T extends [] = []>(config: FormConfig | T) => config;
95
93
 
96
94
  export interface InstallOptions {
97
95
  [key: string]: any;
package/src/schema.ts CHANGED
@@ -122,6 +122,7 @@ export interface Rule {
122
122
  type?: string;
123
123
  /** 是否必填 */
124
124
  required?: boolean;
125
+ trigger?: string;
125
126
  /** 自定义验证器 */
126
127
  validator?: (
127
128
  options: {
package/types/index.d.ts CHANGED
@@ -35,7 +35,7 @@ export { default as MLink } from './fields/Link.vue';
35
35
  export { default as MSelect } from './fields/Select.vue';
36
36
  export { default as MCascader } from './fields/Cascader.vue';
37
37
  export { default as MDynamicField } from './fields/DynamicField.vue';
38
- export declare const createForm: (config: FormConfig) => FormConfig;
38
+ export declare const createForm: <T extends [] = []>(config: FormConfig | T) => FormConfig | T;
39
39
  export interface InstallOptions {
40
40
  [key: string]: any;
41
41
  }
package/types/schema.d.ts CHANGED
@@ -94,6 +94,7 @@ export interface Rule {
94
94
  type?: string;
95
95
  /** 是否必填 */
96
96
  required?: boolean;
97
+ trigger?: string;
97
98
  /** 自定义验证器 */
98
99
  validator?: (options: {
99
100
  rule: string;