@tmagic/form 1.1.3 → 1.1.5

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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.3",
2
+ "version": "1.1.5",
3
3
  "name": "@tmagic/form",
4
4
  "sideEffects": [
5
5
  "dist/*",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@element-plus/icons-vue": "^2.0.9",
38
- "@tmagic/utils": "1.1.3",
38
+ "@tmagic/utils": "1.1.5",
39
39
  "element-plus": "^2.2.6",
40
40
  "lodash-es": "^4.17.21",
41
41
  "sortablejs": "^1.14.0",
@@ -50,13 +50,13 @@
50
50
  "@types/lodash-es": "^4.17.4",
51
51
  "@types/node": "^15.12.4",
52
52
  "@types/sortablejs": "^1.10.7",
53
- "@vitejs/plugin-vue": "^3.0.1",
53
+ "@vitejs/plugin-vue": "^3.1.0",
54
54
  "@vue/compiler-sfc": "^3.2.37",
55
55
  "@vue/test-utils": "^2.0.0",
56
56
  "rimraf": "^3.0.2",
57
57
  "sass": "^1.35.1",
58
58
  "typescript": "^4.7.4",
59
- "vite": "^3.0.4",
59
+ "vite": "^3.1.3",
60
60
  "vue-tsc": "^0.39.4"
61
61
  }
62
62
  }
@@ -1,52 +1,53 @@
1
1
  <template>
2
- <div>
3
- <el-dialog
4
- v-model="dialogVisible"
5
- custom-class="m-form-dialog"
6
- top="20px"
7
- :title="title"
8
- :appendToBody="true"
9
- :width="width"
10
- :fullscreen="fullscreen"
11
- :close-on-click-modal="false"
12
- @close="closeHandler"
13
- >
14
- <div class="m-dialog-body" :style="`max-height: ${bodyHeight}; overflow-y: auto; overflow-x: hidden;`">
15
- <m-form
16
- v-model="stepActive"
17
- ref="form"
18
- :size="size"
19
- :config="config"
20
- :init-values="values"
21
- :label-width="labelWidth"
22
- @change="changeHandler"
23
- ></m-form>
24
- <slot></slot>
25
- </div>
26
-
27
- <template #footer>
28
- <el-row class="dialog-footer">
29
- <el-col :span="12" style="text-align: left">
30
- <div style="min-height: 1px">
31
- <slot name="left"></slot>
32
- </div>
33
- </el-col>
34
- <el-col :span="12">
35
- <slot name="footer">
36
- <el-button @click="cancel" size="small">取 消</el-button>
37
- <el-button v-if="hasStep && stepActive > 1" type="info" size="small" @click="preStep">上一步</el-button>
38
- <el-button v-if="hasStep && stepCount > stepActive" type="info" size="small" @click="nextStep"
39
- >下一步</el-button
40
- >
41
- <el-button v-else type="primary" size="small" :loading="saveFetch" @click="save">{{
42
- confirmText
43
- }}</el-button>
44
- </slot>
45
- </el-col>
46
- </el-row>
47
- </template>
48
- </el-dialog>
49
- </div>
2
+ <teleport to="body">
3
+ <div class="m-form-dialog" v-show="dialogVisible">
4
+ <el-dialog
5
+ v-model="dialogVisible"
6
+ top="20px"
7
+ :title="title"
8
+ :width="width"
9
+ :fullscreen="fullscreen"
10
+ :close-on-click-modal="false"
11
+ @close="closeHandler"
12
+ >
13
+ <div class="m-dialog-body" :style="`max-height: ${bodyHeight}; overflow-y: auto; overflow-x: hidden;`">
14
+ <m-form
15
+ v-model="stepActive"
16
+ ref="form"
17
+ :size="size"
18
+ :config="config"
19
+ :init-values="values"
20
+ :parent-values="parentValues"
21
+ :label-width="labelWidth"
22
+ @change="changeHandler"
23
+ ></m-form>
24
+ <slot></slot>
25
+ </div>
26
+
27
+ <template #footer>
28
+ <el-row class="dialog-footer">
29
+ <el-col :span="12" style="text-align: left">
30
+ <div style="min-height: 1px">
31
+ <slot name="left"></slot>
32
+ </div>
33
+ </el-col>
34
+ <el-col :span="12">
35
+ <slot name="footer">
36
+ <el-button @click="cancel" size="small">取 消</el-button>
37
+ <el-button v-if="hasStep && stepActive > 1" type="info" size="small" @click="preStep">上一步</el-button>
38
+ <el-button v-if="hasStep && stepCount > stepActive" type="info" size="small" @click="nextStep"
39
+ >下一步</el-button
40
+ >
41
+ <el-button v-else type="primary" size="small" :loading="saveFetch" @click="save">{{
42
+ confirmText
43
+ }}</el-button>
44
+ </slot>
45
+ </el-col>
46
+ </el-row>
47
+ </template>
48
+ </el-dialog>
49
+ </div>
50
+ </teleport>
50
51
  </template>
51
52
 
52
53
  <script lang="ts">
@@ -64,6 +65,10 @@ export default defineComponent({
64
65
  default: () => ({}),
65
66
  },
66
67
 
68
+ parentValues: {
69
+ type: Object,
70
+ },
71
+
67
72
  width: [Number, String],
68
73
 
69
74
  fullscreen: Boolean,
package/src/schema.ts CHANGED
@@ -97,7 +97,7 @@ export interface ContainerCommonConfig {
97
97
  export interface Rule {
98
98
  message?: string;
99
99
  /** 系统提供的验证器类型。有:string,number,boolean,method,regexp,integer,float,array,object,enum,date,url,hex,email,any */
100
- type: string;
100
+ type?: string;
101
101
  /** 是否必填 */
102
102
  required?: boolean;
103
103
  /** 自定义验证器 */
@@ -5,6 +5,9 @@ declare const _default: import("vue").DefineComponent<{
5
5
  type: ObjectConstructor;
6
6
  default: () => {};
7
7
  };
8
+ parentValues: {
9
+ type: ObjectConstructor;
10
+ };
8
11
  width: (NumberConstructor | StringConstructor)[];
9
12
  fullscreen: BooleanConstructor;
10
13
  title: StringConstructor;
@@ -272,6 +275,9 @@ declare const _default: import("vue").DefineComponent<{
272
275
  type: ObjectConstructor;
273
276
  default: () => {};
274
277
  };
278
+ parentValues: {
279
+ type: ObjectConstructor;
280
+ };
275
281
  width: (NumberConstructor | StringConstructor)[];
276
282
  fullscreen: BooleanConstructor;
277
283
  title: StringConstructor;
@@ -37,6 +37,9 @@ declare const _default: import("vue").DefineComponent<{
37
37
  type: ObjectConstructor;
38
38
  default: () => {};
39
39
  };
40
+ parentValues: {
41
+ type: ObjectConstructor;
42
+ };
40
43
  width: (NumberConstructor | StringConstructor)[];
41
44
  fullscreen: BooleanConstructor;
42
45
  title: StringConstructor;
@@ -75,6 +78,9 @@ declare const _default: import("vue").DefineComponent<{
75
78
  type: ObjectConstructor;
76
79
  default: () => {};
77
80
  };
81
+ parentValues: {
82
+ type: ObjectConstructor;
83
+ };
78
84
  width: (NumberConstructor | StringConstructor)[];
79
85
  fullscreen: BooleanConstructor;
80
86
  title: StringConstructor;
@@ -372,6 +378,9 @@ declare const _default: import("vue").DefineComponent<{
372
378
  type: ObjectConstructor;
373
379
  default: () => {};
374
380
  };
381
+ parentValues: {
382
+ type: ObjectConstructor;
383
+ };
375
384
  width: (NumberConstructor | StringConstructor)[];
376
385
  fullscreen: BooleanConstructor;
377
386
  title: StringConstructor;
package/types/schema.d.ts CHANGED
@@ -71,7 +71,7 @@ export interface ContainerCommonConfig {
71
71
  export interface Rule {
72
72
  message?: string;
73
73
  /** 系统提供的验证器类型。有:string,number,boolean,method,regexp,integer,float,array,object,enum,date,url,hex,email,any */
74
- type: string;
74
+ type?: string;
75
75
  /** 是否必填 */
76
76
  required?: boolean;
77
77
  /** 自定义验证器 */