@tmagic/form 1.3.1 → 1.3.3

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.3.1",
2
+ "version": "1.3.3",
3
3
  "name": "@tmagic/form",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -37,14 +37,14 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@element-plus/icons-vue": "^2.0.9",
40
- "@tmagic/design": "1.3.1",
41
- "@tmagic/utils": "1.3.1",
40
+ "@tmagic/design": "1.3.3",
41
+ "@tmagic/utils": "1.3.3",
42
42
  "lodash-es": "^4.17.21",
43
43
  "sortablejs": "^1.14.0",
44
- "vue": "^3.3.4"
44
+ "vue": "^3.3.8"
45
45
  },
46
46
  "peerDependencies": {
47
- "vue": "^3.3.4"
47
+ "vue": "^3.3.8"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@babel/core": "^7.18.0",
@@ -52,7 +52,7 @@
52
52
  "@types/node": "^15.12.4",
53
53
  "@types/sortablejs": "^1.10.7",
54
54
  "@vitejs/plugin-vue": "^4.2.3",
55
- "@vue/compiler-sfc": "^3.3.4",
55
+ "@vue/compiler-sfc": "^3.3.8",
56
56
  "@vue/test-utils": "^2.3.2",
57
57
  "rimraf": "^3.0.2",
58
58
  "sass": "^1.35.1",
@@ -0,0 +1,106 @@
1
+ <template>
2
+ <div class="m-form-box">
3
+ <div ref="boxBody" class="m-box-body">
4
+ <Form
5
+ ref="form"
6
+ :size="size"
7
+ :disabled="disabled"
8
+ :config="config"
9
+ :init-values="values"
10
+ :parent-values="parentValues"
11
+ :label-width="labelWidth"
12
+ :label-position="labelPosition"
13
+ :inline="inline"
14
+ @change="changeHandler"
15
+ ></Form>
16
+ <slot></slot>
17
+ </div>
18
+
19
+ <TMagicRow class="dialog-footer">
20
+ <TMagicCol :span="12" style="text-align: left">
21
+ <div style="min-height: 1px">
22
+ <slot name="left"></slot>
23
+ </div>
24
+ </TMagicCol>
25
+ <TMagicCol :span="12">
26
+ <slot name="footer">
27
+ <TMagicButton type="primary" :disabled="disabled" :loading="saveFetch" @click="submitHandler">{{
28
+ confirmText
29
+ }}</TMagicButton>
30
+ </slot>
31
+ </TMagicCol>
32
+ </TMagicRow>
33
+ </div>
34
+ </template>
35
+
36
+ <script setup lang="ts">
37
+ import { ref, watchEffect } from 'vue';
38
+
39
+ import { TMagicButton, TMagicCol, TMagicRow } from '@tmagic/design';
40
+
41
+ import Form from './Form.vue';
42
+ import type { FormConfig } from './schema';
43
+
44
+ defineOptions({
45
+ name: 'MFormDialog',
46
+ });
47
+
48
+ withDefaults(
49
+ defineProps<{
50
+ config?: FormConfig;
51
+ values?: Object;
52
+ parentValues?: Object;
53
+ width?: string | number;
54
+ labelWidth?: string;
55
+ disabled?: boolean;
56
+ size?: 'small' | 'default' | 'large';
57
+ confirmText?: string;
58
+ inline?: boolean;
59
+ labelPosition?: string;
60
+ }>(),
61
+ {
62
+ config: () => [],
63
+ values: () => ({}),
64
+ confirmText: '确定',
65
+ },
66
+ );
67
+
68
+ const emit = defineEmits(['submit', 'change', 'error']);
69
+
70
+ const form = ref<InstanceType<typeof Form>>();
71
+ const boxBody = ref<HTMLDivElement>();
72
+ const saveFetch = ref(false);
73
+ const bodyHeight = ref(0);
74
+
75
+ watchEffect(() => {
76
+ if (boxBody.value) {
77
+ bodyHeight.value = boxBody.value.clientHeight;
78
+ }
79
+ });
80
+
81
+ const submitHandler = async () => {
82
+ try {
83
+ const values = await form.value?.submitForm();
84
+ emit('submit', values);
85
+ } catch (e) {
86
+ emit('error', e);
87
+ }
88
+ };
89
+
90
+ const changeHandler = (value: any) => {
91
+ emit('change', value);
92
+ };
93
+
94
+ const show = () => {};
95
+
96
+ const hide = () => {};
97
+
98
+ defineExpose({
99
+ form,
100
+ saveFetch,
101
+ bodyHeight,
102
+
103
+ show,
104
+ hide,
105
+ });
106
+ </script>
package/src/index.ts CHANGED
@@ -59,6 +59,7 @@ export * from './utils/useAddField';
59
59
  export { default as MForm } from './Form.vue';
60
60
  export { default as MFormDialog } from './FormDialog.vue';
61
61
  export { default as MFormDrawer } from './FormDrawer.vue';
62
+ export { default as MFormBox } from './FormBox.vue';
62
63
  export { default as MContainer } from './containers/Container.vue';
63
64
  export { default as MFieldset } from './containers/Fieldset.vue';
64
65
  export { default as MPanel } from './containers/Panel.vue';
package/src/schema.ts CHANGED
@@ -72,19 +72,19 @@ export interface FormItem {
72
72
  /** 字段名 */
73
73
  name?: string | number;
74
74
  /** 额外的提示信息,和 help 类似,当提示文案同时出现时,可以使用这个。 */
75
- extra?: string | FilterFunction;
75
+ extra?: string | FilterFunction<string>;
76
76
  /** 配置提示信息 */
77
- tooltip?: string | FilterFunction;
77
+ tooltip?: string | FilterFunction<string>;
78
78
  /** 是否置灰 */
79
79
  disabled?: boolean | FilterFunction;
80
80
  /** 使用表单中的值作为key,例如配置了text,则使用model.text作为key */
81
81
  key?: string;
82
82
  /** 是否显示 */
83
- display?: boolean | 'expand' | FilterFunction;
83
+ display?: boolean | 'expand' | FilterFunction<boolean | 'expand'>;
84
84
  /** 值发生改变时调用的方法 */
85
85
  onChange?: OnChangeHandler;
86
86
  /** label 标签的文本 */
87
- text?: string | FilterFunction;
87
+ text?: string | FilterFunction<string>;
88
88
  /** 右侧感叹号 */
89
89
  tip?: string;
90
90
 
@@ -158,7 +158,7 @@ export type TypeFunction = (
158
158
  },
159
159
  ) => string;
160
160
 
161
- export type FilterFunction = (
161
+ export type FilterFunction<T = boolean> = (
162
162
  mForm: FormState | undefined,
163
163
  data: {
164
164
  model: Record<any, any>;
@@ -168,7 +168,7 @@ export type FilterFunction = (
168
168
  prop: string;
169
169
  config: any;
170
170
  },
171
- ) => boolean;
171
+ ) => T;
172
172
 
173
173
  type OnChangeHandler = (
174
174
  mForm: FormState | undefined,
@@ -667,7 +667,7 @@ export interface TableConfig extends FormItem {
667
667
  /** 是否显示全屏按钮 */
668
668
  enableFullscreen?: boolean;
669
669
  fixed?: boolean;
670
- itemExtra?: string | FilterFunction;
670
+ itemExtra?: string | FilterFunction<string>;
671
671
  rowKey?: string;
672
672
  }
673
673
 
@@ -680,8 +680,8 @@ export interface GroupListConfig extends FormItem {
680
680
  tableItems?: FormConfig;
681
681
  titleKey?: string;
682
682
  titlePrefix?: string;
683
- title?: string | FilterFunction;
684
- itemExtra?: string | FilterFunction;
683
+ title?: string | FilterFunction<string>;
684
+ itemExtra?: string | FilterFunction<string>;
685
685
  expandAll?: boolean;
686
686
  addable?: (mForm: FormState | undefined, data: any) => boolean | 'undefined' | boolean;
687
687
  defaultAdd?: (mForm: FormState | undefined, data: any) => any;
@@ -0,0 +1,18 @@
1
+ .m-form-box {
2
+ display: flex;
3
+ flex-direction: column;
4
+ padding: 16px;
5
+ width: 100%;
6
+ .el-box__header {
7
+ margin: 0;
8
+ }
9
+
10
+ .m-box-body {
11
+ flex: 1;
12
+ overflow-y: auto;
13
+ overflow-x: hidden;
14
+ }
15
+ .dialog-footer {
16
+ margin-top: 16px;
17
+ }
18
+ }
@@ -10,3 +10,4 @@
10
10
  @use "./select.scss";
11
11
  @use "./tabs.scss";
12
12
  @use "./number-range.scss";
13
+ @use "./form-box.scss";
package/src/utils/form.ts CHANGED
@@ -181,7 +181,7 @@ const getDefaultValue = function (mForm: FormState | undefined, { defaultValue,
181
181
  return '';
182
182
  };
183
183
 
184
- export const filterFunction = (mForm: FormState | undefined, config: any, props: any) => {
184
+ export const filterFunction = <T = any>(mForm: FormState | undefined, config: T, props: any) => {
185
185
  if (typeof config !== 'function') {
186
186
  return config;
187
187
  }
@@ -0,0 +1,363 @@
1
+ import type { FormConfig } from './schema';
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
+ config?: FormConfig | undefined;
4
+ values?: Object | undefined;
5
+ parentValues?: Object | undefined;
6
+ width?: string | number | undefined;
7
+ labelWidth?: string | undefined;
8
+ disabled?: boolean | undefined;
9
+ size?: "large" | "default" | "small" | undefined;
10
+ confirmText?: string | undefined;
11
+ inline?: boolean | undefined;
12
+ labelPosition?: string | undefined;
13
+ }>, {
14
+ config: () => never[];
15
+ values: () => {};
16
+ confirmText: string;
17
+ }>, {
18
+ form: import("vue").Ref<({
19
+ $: import("vue").ComponentInternalInstance;
20
+ $data: {};
21
+ $props: Partial<{
22
+ config: FormConfig;
23
+ initValues: Record<string, any>;
24
+ lastValues: Record<string, any>;
25
+ isCompare: boolean;
26
+ keyProp: string;
27
+ parentValues: Record<string, any>;
28
+ labelWidth: string;
29
+ disabled: boolean;
30
+ stepActive: string | number;
31
+ height: string;
32
+ inline: boolean;
33
+ labelPosition: string;
34
+ }> & Omit<{
35
+ readonly config: FormConfig;
36
+ readonly initValues: Record<string, any>;
37
+ readonly lastValues: Record<string, any>;
38
+ readonly isCompare: boolean;
39
+ readonly keyProp: string;
40
+ readonly parentValues: Record<string, any>;
41
+ readonly labelWidth: string;
42
+ readonly disabled: boolean;
43
+ readonly stepActive: string | number;
44
+ readonly height: string;
45
+ readonly inline: boolean;
46
+ readonly labelPosition: string;
47
+ readonly popperClass?: string | undefined;
48
+ readonly size?: "large" | "default" | "small" | undefined;
49
+ readonly extendState?: ((state: import("./schema").FormState) => Record<string, any> | Promise<Record<string, any>>) | undefined;
50
+ onChange?: ((...args: any[]) => any) | undefined;
51
+ "onField-input"?: ((...args: any[]) => any) | undefined;
52
+ "onField-change"?: ((...args: any[]) => any) | undefined;
53
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
54
+ config: {
55
+ type: import("vue").PropType<FormConfig>;
56
+ required: true;
57
+ default: () => never[];
58
+ };
59
+ popperClass: {
60
+ type: import("vue").PropType<string>;
61
+ };
62
+ initValues: {
63
+ type: import("vue").PropType<Record<string, any>>;
64
+ required: true;
65
+ default: () => {};
66
+ };
67
+ lastValues: {
68
+ type: import("vue").PropType<Record<string, any>>;
69
+ default: () => {};
70
+ };
71
+ isCompare: {
72
+ type: import("vue").PropType<boolean>;
73
+ default: boolean;
74
+ };
75
+ keyProp: {
76
+ type: import("vue").PropType<string>;
77
+ default: string;
78
+ };
79
+ parentValues: {
80
+ type: import("vue").PropType<Record<string, any>>;
81
+ default: () => {};
82
+ };
83
+ labelWidth: {
84
+ type: import("vue").PropType<string>;
85
+ default: string;
86
+ };
87
+ disabled: {
88
+ type: import("vue").PropType<boolean>;
89
+ default: boolean;
90
+ };
91
+ stepActive: {
92
+ type: import("vue").PropType<string | number>;
93
+ default: number;
94
+ };
95
+ size: {
96
+ type: import("vue").PropType<"large" | "default" | "small">;
97
+ };
98
+ height: {
99
+ type: import("vue").PropType<string>;
100
+ default: string;
101
+ };
102
+ inline: {
103
+ type: import("vue").PropType<boolean>;
104
+ default: boolean;
105
+ };
106
+ labelPosition: {
107
+ type: import("vue").PropType<string>;
108
+ default: string;
109
+ };
110
+ extendState: {
111
+ type: import("vue").PropType<(state: import("./schema").FormState) => Record<string, any> | Promise<Record<string, any>>>;
112
+ };
113
+ }>> & {
114
+ onChange?: ((...args: any[]) => any) | undefined;
115
+ "onField-input"?: ((...args: any[]) => any) | undefined;
116
+ "onField-change"?: ((...args: any[]) => any) | undefined;
117
+ }, "config" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "labelWidth" | "disabled" | "stepActive" | "height" | "inline" | "labelPosition">;
118
+ $attrs: {
119
+ [x: string]: unknown;
120
+ };
121
+ $refs: {
122
+ [x: string]: unknown;
123
+ };
124
+ $slots: Readonly<{
125
+ [name: string]: import("vue").Slot<any> | undefined;
126
+ }>;
127
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
128
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
129
+ $emit: (event: "change" | "field-input" | "field-change", ...args: any[]) => void;
130
+ $el: any;
131
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
132
+ config: {
133
+ type: import("vue").PropType<FormConfig>;
134
+ required: true;
135
+ default: () => never[];
136
+ };
137
+ popperClass: {
138
+ type: import("vue").PropType<string>;
139
+ };
140
+ initValues: {
141
+ type: import("vue").PropType<Record<string, any>>;
142
+ required: true;
143
+ default: () => {};
144
+ };
145
+ lastValues: {
146
+ type: import("vue").PropType<Record<string, any>>;
147
+ default: () => {};
148
+ };
149
+ isCompare: {
150
+ type: import("vue").PropType<boolean>;
151
+ default: boolean;
152
+ };
153
+ keyProp: {
154
+ type: import("vue").PropType<string>;
155
+ default: string;
156
+ };
157
+ parentValues: {
158
+ type: import("vue").PropType<Record<string, any>>;
159
+ default: () => {};
160
+ };
161
+ labelWidth: {
162
+ type: import("vue").PropType<string>;
163
+ default: string;
164
+ };
165
+ disabled: {
166
+ type: import("vue").PropType<boolean>;
167
+ default: boolean;
168
+ };
169
+ stepActive: {
170
+ type: import("vue").PropType<string | number>;
171
+ default: number;
172
+ };
173
+ size: {
174
+ type: import("vue").PropType<"large" | "default" | "small">;
175
+ };
176
+ height: {
177
+ type: import("vue").PropType<string>;
178
+ default: string;
179
+ };
180
+ inline: {
181
+ type: import("vue").PropType<boolean>;
182
+ default: boolean;
183
+ };
184
+ labelPosition: {
185
+ type: import("vue").PropType<string>;
186
+ default: string;
187
+ };
188
+ extendState: {
189
+ type: import("vue").PropType<(state: import("./schema").FormState) => Record<string, any> | Promise<Record<string, any>>>;
190
+ };
191
+ }>> & {
192
+ onChange?: ((...args: any[]) => any) | undefined;
193
+ "onField-input"?: ((...args: any[]) => any) | undefined;
194
+ "onField-change"?: ((...args: any[]) => any) | undefined;
195
+ }, {
196
+ values: import("vue").Ref<import("./schema").FormValue>;
197
+ lastValuesProcessed: import("vue").Ref<import("./schema").FormValue>;
198
+ formState: import("./schema").FormState;
199
+ initialized: import("vue").Ref<boolean>;
200
+ changeHandler: () => void;
201
+ resetForm: () => any;
202
+ submitForm: (native?: boolean | undefined) => Promise<any>;
203
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "field-input" | "field-change")[], string, {
204
+ config: FormConfig;
205
+ initValues: Record<string, any>;
206
+ lastValues: Record<string, any>;
207
+ isCompare: boolean;
208
+ keyProp: string;
209
+ parentValues: Record<string, any>;
210
+ labelWidth: string;
211
+ disabled: boolean;
212
+ stepActive: string | number;
213
+ height: string;
214
+ inline: boolean;
215
+ labelPosition: string;
216
+ }, {}, string, {}> & {
217
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
218
+ created?: ((() => void) | (() => void)[]) | undefined;
219
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
220
+ mounted?: ((() => void) | (() => void)[]) | undefined;
221
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
222
+ updated?: ((() => void) | (() => void)[]) | undefined;
223
+ activated?: ((() => void) | (() => void)[]) | undefined;
224
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
225
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
226
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
227
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
228
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
229
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
230
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
231
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null, info: string) => boolean | void)[]) | undefined;
232
+ };
233
+ $forceUpdate: () => void;
234
+ $nextTick: typeof import("vue").nextTick;
235
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
236
+ } & Readonly<import("vue").ExtractPropTypes<{
237
+ config: {
238
+ type: import("vue").PropType<FormConfig>;
239
+ required: true;
240
+ default: () => never[];
241
+ };
242
+ popperClass: {
243
+ type: import("vue").PropType<string>;
244
+ };
245
+ initValues: {
246
+ type: import("vue").PropType<Record<string, any>>;
247
+ required: true;
248
+ default: () => {};
249
+ };
250
+ lastValues: {
251
+ type: import("vue").PropType<Record<string, any>>;
252
+ default: () => {};
253
+ };
254
+ isCompare: {
255
+ type: import("vue").PropType<boolean>;
256
+ default: boolean;
257
+ };
258
+ keyProp: {
259
+ type: import("vue").PropType<string>;
260
+ default: string;
261
+ };
262
+ parentValues: {
263
+ type: import("vue").PropType<Record<string, any>>;
264
+ default: () => {};
265
+ };
266
+ labelWidth: {
267
+ type: import("vue").PropType<string>;
268
+ default: string;
269
+ };
270
+ disabled: {
271
+ type: import("vue").PropType<boolean>;
272
+ default: boolean;
273
+ };
274
+ stepActive: {
275
+ type: import("vue").PropType<string | number>;
276
+ default: number;
277
+ };
278
+ size: {
279
+ type: import("vue").PropType<"large" | "default" | "small">;
280
+ };
281
+ height: {
282
+ type: import("vue").PropType<string>;
283
+ default: string;
284
+ };
285
+ inline: {
286
+ type: import("vue").PropType<boolean>;
287
+ default: boolean;
288
+ };
289
+ labelPosition: {
290
+ type: import("vue").PropType<string>;
291
+ default: string;
292
+ };
293
+ extendState: {
294
+ type: import("vue").PropType<(state: import("./schema").FormState) => Record<string, any> | Promise<Record<string, any>>>;
295
+ };
296
+ }>> & {
297
+ onChange?: ((...args: any[]) => any) | undefined;
298
+ "onField-input"?: ((...args: any[]) => any) | undefined;
299
+ "onField-change"?: ((...args: any[]) => any) | undefined;
300
+ } & import("vue").ShallowUnwrapRef<{
301
+ values: import("vue").Ref<import("./schema").FormValue>;
302
+ lastValuesProcessed: import("vue").Ref<import("./schema").FormValue>;
303
+ formState: import("./schema").FormState;
304
+ initialized: import("vue").Ref<boolean>;
305
+ changeHandler: () => void;
306
+ resetForm: () => any;
307
+ submitForm: (native?: boolean | undefined) => Promise<any>;
308
+ }> & {} & import("vue").ComponentCustomProperties & {}) | undefined>;
309
+ saveFetch: import("vue").Ref<boolean>;
310
+ bodyHeight: import("vue").Ref<number>;
311
+ show: () => void;
312
+ hide: () => void;
313
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "submit" | "error")[], "change" | "submit" | "error", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
314
+ config?: FormConfig | undefined;
315
+ values?: Object | undefined;
316
+ parentValues?: Object | undefined;
317
+ width?: string | number | undefined;
318
+ labelWidth?: string | undefined;
319
+ disabled?: boolean | undefined;
320
+ size?: "large" | "default" | "small" | undefined;
321
+ confirmText?: string | undefined;
322
+ inline?: boolean | undefined;
323
+ labelPosition?: string | undefined;
324
+ }>, {
325
+ config: () => never[];
326
+ values: () => {};
327
+ confirmText: string;
328
+ }>>> & {
329
+ onChange?: ((...args: any[]) => any) | undefined;
330
+ onSubmit?: ((...args: any[]) => any) | undefined;
331
+ onError?: ((...args: any[]) => any) | undefined;
332
+ }, {
333
+ config: FormConfig;
334
+ values: Object;
335
+ confirmText: string;
336
+ }, {}>, {
337
+ default?(_: {}): any;
338
+ left?(_: {}): any;
339
+ footer?(_: {}): any;
340
+ }>;
341
+ export default _default;
342
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
343
+ type __VLS_TypePropsToRuntimeProps<T> = {
344
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
345
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
346
+ } : {
347
+ type: import('vue').PropType<T[K]>;
348
+ required: true;
349
+ };
350
+ };
351
+ type __VLS_WithDefaults<P, D> = {
352
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
353
+ default: D[K];
354
+ }> : P[K];
355
+ };
356
+ type __VLS_WithTemplateSlots<T, S> = T & {
357
+ new (): {
358
+ $slots: S;
359
+ };
360
+ };
361
+ type __VLS_Prettify<T> = {
362
+ [K in keyof T]: T[K];
363
+ } & {};