@tmagic/form 1.8.0-beta.14 → 1.8.0-beta.16
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/dist/es/Form.vue_vue_type_script_setup_true_lang.js +12 -1
- package/dist/es/containers/Col.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/es/containers/Container.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/es/index.js +2 -2
- package/dist/es/schema.js +11 -1
- package/dist/es/submitForm.js +13 -4
- package/dist/es/utils/form.js +10 -6
- package/dist/es/utils/typeMatch.js +3 -1
- package/dist/tmagic-form.umd.cjs +52 -13
- package/package.json +4 -4
- package/src/Form.vue +13 -1
- package/src/containers/Col.vue +1 -0
- package/src/containers/Container.vue +5 -1
- package/src/schema.ts +11 -0
- package/src/submitForm.ts +33 -4
- package/src/utils/form.ts +17 -6
- package/src/utils/typeMatch.ts +11 -2
- package/types/index.d.ts +24 -10
|
@@ -145,6 +145,17 @@ var Form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
/**
|
|
148
|
+
* formState 的内置 key 快照(keyProp / values / $emit / fields / post 等)。
|
|
149
|
+
*
|
|
150
|
+
* 在 `extendState` 首次合并前捕获,`applyExtendState` 会据此禁止 `extendState`
|
|
151
|
+
* 覆盖这些已有字段(只能新增字段),避免表单核心状态被外部意外改写。
|
|
152
|
+
*
|
|
153
|
+
* 之所以在此处(effect 之外)捕获而不是在 `applyExtendState` 内动态取:
|
|
154
|
+
* `watchEffect` 会在依赖变化时重跑,若动态取,`extendState` 自己新增的字段在第二次
|
|
155
|
+
* 合并时也会被当成「已有 key」而拒绝刷新;这里只锁定内置字段即可规避该问题。
|
|
156
|
+
*/
|
|
157
|
+
const reservedStateKeys = new Set(Reflect.ownKeys(formState));
|
|
158
|
+
/**
|
|
148
159
|
* `extendState` 的同步段(直到第一个 `await` 之前)所访问的任何响应式数据,
|
|
149
160
|
* 都会被 `watchEffect` 自动跟踪。这样可以兼容历史用法 ——
|
|
150
161
|
*
|
|
@@ -179,7 +190,7 @@ var Form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
179
190
|
return;
|
|
180
191
|
}
|
|
181
192
|
if (stale) return;
|
|
182
|
-
applyExtendState(formState, state);
|
|
193
|
+
applyExtendState(formState, state, reservedStateKeys);
|
|
183
194
|
});
|
|
184
195
|
provide("mForm", formState);
|
|
185
196
|
/**
|
|
@@ -40,7 +40,8 @@ var Col_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompon
|
|
|
40
40
|
size: __props.size,
|
|
41
41
|
disabled: __props.disabled,
|
|
42
42
|
onChange: changeHandler,
|
|
43
|
-
onAddDiffCount
|
|
43
|
+
onAddDiffCount,
|
|
44
|
+
"is-in-row": true
|
|
44
45
|
}, null, 8, [
|
|
45
46
|
"model",
|
|
46
47
|
"lastValues",
|
|
@@ -3,7 +3,7 @@ import { createObjectProp, display, filterFunction, getRules } from "../utils/fo
|
|
|
3
3
|
import Hidden_default from "../fields/Hidden.js";
|
|
4
4
|
import { getField } from "../utils/config.js";
|
|
5
5
|
import FormLabel_default from "./FormLabel.js";
|
|
6
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, inject, mergeProps, normalizeClass, normalizeStyle, openBlock, readonly, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, toRaw, unref, watch, watchEffect, withCtx } from "vue";
|
|
6
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, inject, mergeProps, normalizeClass, normalizeStyle, openBlock, provide, readonly, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, toRaw, unref, watch, watchEffect, withCtx } from "vue";
|
|
7
7
|
import { isEqual } from "lodash-es";
|
|
8
8
|
import { TMagicButton, TMagicFormItem, TMagicIcon, TMagicTooltip } from "@tmagic/design";
|
|
9
9
|
import { getValueByKeyPath } from "@tmagic/utils";
|
|
@@ -44,7 +44,8 @@ var Container_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
44
44
|
isCompare: {
|
|
45
45
|
type: Boolean,
|
|
46
46
|
default: false
|
|
47
|
-
}
|
|
47
|
+
},
|
|
48
|
+
isInRow: { type: Boolean }
|
|
48
49
|
},
|
|
49
50
|
emits: ["change", "addDiffCount"],
|
|
50
51
|
setup(__props, { emit: __emit }) {
|
|
@@ -161,6 +162,7 @@ var Container_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
161
162
|
if (items.value && !text.value && type.value && display$1.value) return;
|
|
162
163
|
if (display$1.value && showDiff && type.value) emit("addDiffCount");
|
|
163
164
|
}, { immediate: true });
|
|
165
|
+
provide("isInRow", props.isInRow ?? false);
|
|
164
166
|
const expandHandler = () => expand.value = !expand.value;
|
|
165
167
|
const key = (config) => config[mForm?.keyProps];
|
|
166
168
|
const filterHandler = (filter, value) => {
|
package/dist/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { FORM_DIFF_CONFIG_KEY, FORM_TYPE_MATCH_VALID_KEY } from "./schema.js";
|
|
2
|
+
import { FORM_DIFF_CONFIG_KEY, FORM_SILENT_MODE_KEY, FORM_TYPE_MATCH_VALID_KEY } from "./schema.js";
|
|
3
3
|
import { clearTypeMatchRules, deleteTypeMatchRule, getTypeMatchRule, registerTypeMatchRule, registerTypeMatchRules, validateTypeMatch } from "./utils/typeMatch.js";
|
|
4
4
|
import { adaptFormValidator, applyExtendState, createObjectProp, createValues, datetimeFormatter, display, filterFunction, getDataByPage, getRules, initValue, sortArray, sortChange } from "./utils/form.js";
|
|
5
5
|
import { useAddField } from "./utils/useAddField.js";
|
|
@@ -40,4 +40,4 @@ import plugin_default from "./plugin.js";
|
|
|
40
40
|
export * from "@tmagic/form-schema";
|
|
41
41
|
var createForm = (config) => config;
|
|
42
42
|
//#endregion
|
|
43
|
-
export { FORM_DIFF_CONFIG_KEY, FORM_TYPE_MATCH_VALID_KEY, Cascader_default as MCascader, Checkbox_default as MCheckbox, CheckboxGroup_default as MCheckboxGroup, ColorPicker_default as MColorPicker, Container_default as MContainer, Date_default as MDate, DateTime_default as MDateTime, Daterange_default as MDaterange, Display_default as MDisplay, DynamicField_default as MDynamicField, Fieldset_default as MFieldset, FlexLayout_default as MFlexLayout, Form_default as MForm, FormBox_default as MFormBox, FormDialog_default as MFormDialog, FormDrawer_default as MFormDrawer, TableGroupList_default as MGroupList, Hidden_default as MHidden, Link_default as MLink, Number_default as MNumber, NumberRange_default as MNumberRange, Panel_default as MPanel, RadioGroup_default as MRadioGroup, Row_default as MRow, Select_default as MSelect, Switch_default as MSwitch, TableGroupList_default as MTable, TableGroupList_default as MTableGroupList, Tabs_default as MTabs, Text_default as MText, Textarea_default as MTextarea, Time_default as MTime, Timerange_default as MTimerange, adaptFormValidator, applyExtendState, clearTypeMatchRules, createForm, createObjectProp, createValues, datetimeFormatter, plugin_default as default, deleteField as deleteFormField, deleteTypeMatchRule, display, filterFunction, getDataByPage, getField as getFormField, getRules, getTypeMatchRule, initValue, registerField as registerFormField, registerTypeMatchRule, registerTypeMatchRules, sortArray, sortChange, stripTabItemsLazy, submitForm, useAddField, validateForm, validateTypeMatch };
|
|
43
|
+
export { FORM_DIFF_CONFIG_KEY, FORM_SILENT_MODE_KEY, FORM_TYPE_MATCH_VALID_KEY, Cascader_default as MCascader, Checkbox_default as MCheckbox, CheckboxGroup_default as MCheckboxGroup, ColorPicker_default as MColorPicker, Container_default as MContainer, Date_default as MDate, DateTime_default as MDateTime, Daterange_default as MDaterange, Display_default as MDisplay, DynamicField_default as MDynamicField, Fieldset_default as MFieldset, FlexLayout_default as MFlexLayout, Form_default as MForm, FormBox_default as MFormBox, FormDialog_default as MFormDialog, FormDrawer_default as MFormDrawer, TableGroupList_default as MGroupList, Hidden_default as MHidden, Link_default as MLink, Number_default as MNumber, NumberRange_default as MNumberRange, Panel_default as MPanel, RadioGroup_default as MRadioGroup, Row_default as MRow, Select_default as MSelect, Switch_default as MSwitch, TableGroupList_default as MTable, TableGroupList_default as MTableGroupList, Tabs_default as MTabs, Text_default as MText, Textarea_default as MTextarea, Time_default as MTime, Timerange_default as MTimerange, adaptFormValidator, applyExtendState, clearTypeMatchRules, createForm, createObjectProp, createValues, datetimeFormatter, plugin_default as default, deleteField as deleteFormField, deleteTypeMatchRule, display, filterFunction, getDataByPage, getField as getFormField, getRules, getTypeMatchRule, initValue, registerField as registerFormField, registerTypeMatchRule, registerTypeMatchRules, sortArray, sortChange, stripTabItemsLazy, submitForm, useAddField, validateForm, validateTypeMatch };
|
package/dist/es/schema.js
CHANGED
|
@@ -3,5 +3,15 @@ export * from "@tmagic/form-schema";
|
|
|
3
3
|
//#region packages/form/src/schema.ts
|
|
4
4
|
var FORM_DIFF_CONFIG_KEY = Symbol("mFormDiffConfig");
|
|
5
5
|
var FORM_TYPE_MATCH_VALID_KEY = Symbol("mFormTypeMatchValid");
|
|
6
|
+
/**
|
|
7
|
+
* 静默模式标记,由 `submitForm` / `validateForm` 以隐藏方式挂载临时表单时 provide(debug 弹层模式不提供)。
|
|
8
|
+
*
|
|
9
|
+
* 重型字段组件(如 vs-code)可 inject 该标记并跳过自身渲染:字段校验由 FormItem 基于 model 值完成,
|
|
10
|
+
* 与叶子 UI 组件实例无关,跳过可省去无谓的实例化开销(如 monaco worker / model 的创建)。
|
|
11
|
+
*
|
|
12
|
+
* 注意:仅「挂载无值副作用」(不在 onMounted/watch immediate 中 emit change、不依赖 DOM 计算值)的
|
|
13
|
+
* 字段组件可以安全跳过,接入前需逐一审计。
|
|
14
|
+
*/
|
|
15
|
+
var FORM_SILENT_MODE_KEY = Symbol("mFormSilentMode");
|
|
6
16
|
//#endregion
|
|
7
|
-
export { FORM_DIFF_CONFIG_KEY, FORM_TYPE_MATCH_VALID_KEY };
|
|
17
|
+
export { FORM_DIFF_CONFIG_KEY, FORM_SILENT_MODE_KEY, FORM_TYPE_MATCH_VALID_KEY };
|
package/dist/es/submitForm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { FORM_SILENT_MODE_KEY } from "./schema.js";
|
|
1
2
|
import { applyExtendState } from "./utils/form.js";
|
|
2
3
|
import Form_default from "./Form.js";
|
|
3
|
-
import { createApp, defineComponent, h, nextTick, ref, watch } from "vue";
|
|
4
|
+
import { createApp, defineComponent, h, nextTick, provide, ref, watch } from "vue";
|
|
4
5
|
//#region packages/form/src/submitForm.ts
|
|
5
6
|
/**
|
|
6
7
|
* submitForm / validateForm 的公共脚手架:
|
|
@@ -41,7 +42,7 @@ var mountFormInstance = (options) => {
|
|
|
41
42
|
resolve,
|
|
42
43
|
reject
|
|
43
44
|
});
|
|
44
|
-
const
|
|
45
|
+
const wrapperComponent = typeof extendState === "function" ? defineComponent({
|
|
45
46
|
name: "MFormExtendStateInjector",
|
|
46
47
|
setup() {
|
|
47
48
|
watch(() => formRef.value, (form) => {
|
|
@@ -53,7 +54,8 @@ var mountFormInstance = (options) => {
|
|
|
53
54
|
console.error("[MForm] extendState failed:", e);
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
56
|
-
const
|
|
57
|
+
const reservedStateKeys = new Set(Reflect.ownKeys(form.formState));
|
|
58
|
+
const apply = (state) => applyExtendState(form.formState, state, reservedStateKeys);
|
|
57
59
|
if (result && typeof result.then === "function") result.then(apply, (e) => console.error("[MForm] extendState failed:", e));
|
|
58
60
|
else apply(result);
|
|
59
61
|
}, {
|
|
@@ -62,7 +64,14 @@ var mountFormInstance = (options) => {
|
|
|
62
64
|
});
|
|
63
65
|
return () => h(userWrapper);
|
|
64
66
|
}
|
|
65
|
-
}) : userWrapper
|
|
67
|
+
}) : userWrapper;
|
|
68
|
+
const app = createApp(hidden ? defineComponent({
|
|
69
|
+
name: "MFormSilentProvider",
|
|
70
|
+
setup() {
|
|
71
|
+
provide(FORM_SILENT_MODE_KEY, true);
|
|
72
|
+
return () => h(wrapperComponent);
|
|
73
|
+
}
|
|
74
|
+
}) : wrapperComponent);
|
|
66
75
|
instance.app = app;
|
|
67
76
|
if (appContext) Object.assign(app._context, appContext);
|
|
68
77
|
if (timeout > 0 && !skipTimeout) timer = setTimeout(() => {
|
package/dist/es/utils/form.js
CHANGED
|
@@ -211,15 +211,19 @@ var sortChange = (data, { prop, order }) => {
|
|
|
211
211
|
* - accessor 描述符(`{ get stage() { return ... } }`)按原样 defineProperty,调用方
|
|
212
212
|
* 可控制读时求值;强制 `configurable: true` 以便下一次合并可再 define。
|
|
213
213
|
*
|
|
214
|
-
* 注意:
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
214
|
+
* 注意:extendState 只能向 formState「新增」字段,不允许覆盖其已有 key。
|
|
215
|
+
* 调用方可通过 `reservedKeys` 传入合并前已存在的内置 key 快照(keyProp / popperClass /
|
|
216
|
+
* config / initValues / isCompare / lastValues / parentValues / values / $emit / fields /
|
|
217
|
+
* post 等),命中这些 key 时统一跳过并告警。
|
|
218
|
+
*
|
|
219
|
+
* 兜底:未传 `reservedKeys` 时,仍会拦截 props 派生的只读 getter 字段(无 setter),
|
|
220
|
+
* 否则以普通字段形式赋值会让 proxy 的 set trap 抛出
|
|
221
|
+
* `TypeError: 'set' on proxy: trap returned falsish`。
|
|
219
222
|
*/
|
|
220
|
-
var applyExtendState = (formState, state) => {
|
|
223
|
+
var applyExtendState = (formState, state, reservedKeys) => {
|
|
221
224
|
if (!state) return;
|
|
222
225
|
for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(state))) {
|
|
226
|
+
if (reservedKeys?.has(key)) continue;
|
|
223
227
|
if (!("value" in descriptor)) {
|
|
224
228
|
descriptor.configurable = true;
|
|
225
229
|
Object.defineProperty(formState, key, descriptor);
|
|
@@ -89,7 +89,7 @@ var stringifyExampleValue = (value) => {
|
|
|
89
89
|
}
|
|
90
90
|
return String(value);
|
|
91
91
|
};
|
|
92
|
-
var MAX_SUGGESTION_OPTIONS =
|
|
92
|
+
var MAX_SUGGESTION_OPTIONS = 20;
|
|
93
93
|
/**
|
|
94
94
|
* 生成「请使用以下某一个值:xxx;xxx」形式的参考建议;无可选值时返回空字符串(不追加建议)。
|
|
95
95
|
* 可选值超过 MAX_SUGGESTION_OPTIONS 个时仅展示前若干个并以「等」省略。
|
|
@@ -313,6 +313,7 @@ var validateBuiltinTypeMatch = (value, fieldType, mForm, props, message) => {
|
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
315
315
|
if (typeof config.filter === "function") return;
|
|
316
|
+
if (fieldType === "text" && isNumberValue(value)) return;
|
|
316
317
|
if (typeof value !== "string") return defaultMessage(message, `${value} 类型应为字符串`, typeExampleSuggestion(mForm, props, "\"文本内容\"", isStringValue));
|
|
317
318
|
return;
|
|
318
319
|
}
|
|
@@ -362,6 +363,7 @@ var validateBuiltinTypeMatch = (value, fieldType, mForm, props, message) => {
|
|
|
362
363
|
};
|
|
363
364
|
var validateTypeMatch = (value, mForm, props, message) => {
|
|
364
365
|
if (isEmptyValue(value) || isEmptyArray(value)) return;
|
|
366
|
+
if (!props.config?.name) return;
|
|
365
367
|
const rawFieldType = "type" in (props.config || {}) ? props.config.type : "";
|
|
366
368
|
if (typeof rawFieldType !== "string" || !rawFieldType) return;
|
|
367
369
|
const fieldType = toLine(rawFieldType);
|
package/dist/tmagic-form.umd.cjs
CHANGED
|
@@ -43,6 +43,16 @@
|
|
|
43
43
|
//#region packages/form/src/schema.ts
|
|
44
44
|
var FORM_DIFF_CONFIG_KEY = Symbol("mFormDiffConfig");
|
|
45
45
|
var FORM_TYPE_MATCH_VALID_KEY = Symbol("mFormTypeMatchValid");
|
|
46
|
+
/**
|
|
47
|
+
* 静默模式标记,由 `submitForm` / `validateForm` 以隐藏方式挂载临时表单时 provide(debug 弹层模式不提供)。
|
|
48
|
+
*
|
|
49
|
+
* 重型字段组件(如 vs-code)可 inject 该标记并跳过自身渲染:字段校验由 FormItem 基于 model 值完成,
|
|
50
|
+
* 与叶子 UI 组件实例无关,跳过可省去无谓的实例化开销(如 monaco worker / model 的创建)。
|
|
51
|
+
*
|
|
52
|
+
* 注意:仅「挂载无值副作用」(不在 onMounted/watch immediate 中 emit change、不依赖 DOM 计算值)的
|
|
53
|
+
* 字段组件可以安全跳过,接入前需逐一审计。
|
|
54
|
+
*/
|
|
55
|
+
var FORM_SILENT_MODE_KEY = Symbol("mFormSilentMode");
|
|
46
56
|
//#endregion
|
|
47
57
|
//#region node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
|
|
48
58
|
/** Detect free variable `global` from Node.js. */
|
|
@@ -2806,7 +2816,7 @@
|
|
|
2806
2816
|
}
|
|
2807
2817
|
return String(value);
|
|
2808
2818
|
};
|
|
2809
|
-
var MAX_SUGGESTION_OPTIONS =
|
|
2819
|
+
var MAX_SUGGESTION_OPTIONS = 20;
|
|
2810
2820
|
/**
|
|
2811
2821
|
* 生成「请使用以下某一个值:xxx;xxx」形式的参考建议;无可选值时返回空字符串(不追加建议)。
|
|
2812
2822
|
* 可选值超过 MAX_SUGGESTION_OPTIONS 个时仅展示前若干个并以「等」省略。
|
|
@@ -3030,6 +3040,7 @@
|
|
|
3030
3040
|
return;
|
|
3031
3041
|
}
|
|
3032
3042
|
if (typeof config.filter === "function") return;
|
|
3043
|
+
if (fieldType === "text" && isNumberValue(value)) return;
|
|
3033
3044
|
if (typeof value !== "string") return defaultMessage(message, `${value} 类型应为字符串`, typeExampleSuggestion(mForm, props, "\"文本内容\"", isStringValue));
|
|
3034
3045
|
return;
|
|
3035
3046
|
}
|
|
@@ -3079,6 +3090,7 @@
|
|
|
3079
3090
|
};
|
|
3080
3091
|
var validateTypeMatch = (value, mForm, props, message) => {
|
|
3081
3092
|
if (isEmptyValue(value) || isEmptyArray(value)) return;
|
|
3093
|
+
if (!props.config?.name) return;
|
|
3082
3094
|
const rawFieldType = "type" in (props.config || {}) ? props.config.type : "";
|
|
3083
3095
|
if (typeof rawFieldType !== "string" || !rawFieldType) return;
|
|
3084
3096
|
const fieldType = (0, _tmagic_utils.toLine)(rawFieldType);
|
|
@@ -3328,15 +3340,19 @@
|
|
|
3328
3340
|
* - accessor 描述符(`{ get stage() { return ... } }`)按原样 defineProperty,调用方
|
|
3329
3341
|
* 可控制读时求值;强制 `configurable: true` 以便下一次合并可再 define。
|
|
3330
3342
|
*
|
|
3331
|
-
* 注意:
|
|
3332
|
-
*
|
|
3333
|
-
*
|
|
3334
|
-
*
|
|
3335
|
-
*
|
|
3343
|
+
* 注意:extendState 只能向 formState「新增」字段,不允许覆盖其已有 key。
|
|
3344
|
+
* 调用方可通过 `reservedKeys` 传入合并前已存在的内置 key 快照(keyProp / popperClass /
|
|
3345
|
+
* config / initValues / isCompare / lastValues / parentValues / values / $emit / fields /
|
|
3346
|
+
* post 等),命中这些 key 时统一跳过并告警。
|
|
3347
|
+
*
|
|
3348
|
+
* 兜底:未传 `reservedKeys` 时,仍会拦截 props 派生的只读 getter 字段(无 setter),
|
|
3349
|
+
* 否则以普通字段形式赋值会让 proxy 的 set trap 抛出
|
|
3350
|
+
* `TypeError: 'set' on proxy: trap returned falsish`。
|
|
3336
3351
|
*/
|
|
3337
|
-
var applyExtendState = (formState, state) => {
|
|
3352
|
+
var applyExtendState = (formState, state, reservedKeys) => {
|
|
3338
3353
|
if (!state) return;
|
|
3339
3354
|
for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(state))) {
|
|
3355
|
+
if (reservedKeys?.has(key)) continue;
|
|
3340
3356
|
if (!("value" in descriptor)) {
|
|
3341
3357
|
descriptor.configurable = true;
|
|
3342
3358
|
Object.defineProperty(formState, key, descriptor);
|
|
@@ -3494,7 +3510,8 @@
|
|
|
3494
3510
|
isCompare: {
|
|
3495
3511
|
type: Boolean,
|
|
3496
3512
|
default: false
|
|
3497
|
-
}
|
|
3513
|
+
},
|
|
3514
|
+
isInRow: { type: Boolean }
|
|
3498
3515
|
},
|
|
3499
3516
|
emits: ["change", "addDiffCount"],
|
|
3500
3517
|
setup(__props, { emit: __emit }) {
|
|
@@ -3611,6 +3628,7 @@
|
|
|
3611
3628
|
if (items.value && !text.value && type.value && display$3.value) return;
|
|
3612
3629
|
if (display$3.value && showDiff && type.value) emit("addDiffCount");
|
|
3613
3630
|
}, { immediate: true });
|
|
3631
|
+
(0, vue.provide)("isInRow", props.isInRow ?? false);
|
|
3614
3632
|
const expandHandler = () => expand.value = !expand.value;
|
|
3615
3633
|
const key = (config) => config[mForm?.keyProps];
|
|
3616
3634
|
const filterHandler = (filter, value) => {
|
|
@@ -4153,6 +4171,17 @@
|
|
|
4153
4171
|
}
|
|
4154
4172
|
});
|
|
4155
4173
|
/**
|
|
4174
|
+
* formState 的内置 key 快照(keyProp / values / $emit / fields / post 等)。
|
|
4175
|
+
*
|
|
4176
|
+
* 在 `extendState` 首次合并前捕获,`applyExtendState` 会据此禁止 `extendState`
|
|
4177
|
+
* 覆盖这些已有字段(只能新增字段),避免表单核心状态被外部意外改写。
|
|
4178
|
+
*
|
|
4179
|
+
* 之所以在此处(effect 之外)捕获而不是在 `applyExtendState` 内动态取:
|
|
4180
|
+
* `watchEffect` 会在依赖变化时重跑,若动态取,`extendState` 自己新增的字段在第二次
|
|
4181
|
+
* 合并时也会被当成「已有 key」而拒绝刷新;这里只锁定内置字段即可规避该问题。
|
|
4182
|
+
*/
|
|
4183
|
+
const reservedStateKeys = new Set(Reflect.ownKeys(formState));
|
|
4184
|
+
/**
|
|
4156
4185
|
* `extendState` 的同步段(直到第一个 `await` 之前)所访问的任何响应式数据,
|
|
4157
4186
|
* 都会被 `watchEffect` 自动跟踪。这样可以兼容历史用法 ——
|
|
4158
4187
|
*
|
|
@@ -4187,7 +4216,7 @@
|
|
|
4187
4216
|
return;
|
|
4188
4217
|
}
|
|
4189
4218
|
if (stale) return;
|
|
4190
|
-
applyExtendState(formState, state);
|
|
4219
|
+
applyExtendState(formState, state, reservedStateKeys);
|
|
4191
4220
|
});
|
|
4192
4221
|
(0, vue.provide)("mForm", formState);
|
|
4193
4222
|
/**
|
|
@@ -4430,7 +4459,7 @@
|
|
|
4430
4459
|
resolve,
|
|
4431
4460
|
reject
|
|
4432
4461
|
});
|
|
4433
|
-
const
|
|
4462
|
+
const wrapperComponent = typeof extendState === "function" ? (0, vue.defineComponent)({
|
|
4434
4463
|
name: "MFormExtendStateInjector",
|
|
4435
4464
|
setup() {
|
|
4436
4465
|
(0, vue.watch)(() => formRef.value, (form) => {
|
|
@@ -4442,7 +4471,8 @@
|
|
|
4442
4471
|
console.error("[MForm] extendState failed:", e);
|
|
4443
4472
|
return;
|
|
4444
4473
|
}
|
|
4445
|
-
const
|
|
4474
|
+
const reservedStateKeys = new Set(Reflect.ownKeys(form.formState));
|
|
4475
|
+
const apply = (state) => applyExtendState(form.formState, state, reservedStateKeys);
|
|
4446
4476
|
if (result && typeof result.then === "function") result.then(apply, (e) => console.error("[MForm] extendState failed:", e));
|
|
4447
4477
|
else apply(result);
|
|
4448
4478
|
}, {
|
|
@@ -4451,7 +4481,14 @@
|
|
|
4451
4481
|
});
|
|
4452
4482
|
return () => (0, vue.h)(userWrapper);
|
|
4453
4483
|
}
|
|
4454
|
-
}) : userWrapper
|
|
4484
|
+
}) : userWrapper;
|
|
4485
|
+
const app = (0, vue.createApp)(hidden ? (0, vue.defineComponent)({
|
|
4486
|
+
name: "MFormSilentProvider",
|
|
4487
|
+
setup() {
|
|
4488
|
+
(0, vue.provide)(FORM_SILENT_MODE_KEY, true);
|
|
4489
|
+
return () => (0, vue.h)(wrapperComponent);
|
|
4490
|
+
}
|
|
4491
|
+
}) : wrapperComponent);
|
|
4455
4492
|
instance.app = app;
|
|
4456
4493
|
if (appContext) Object.assign(app._context, appContext);
|
|
4457
4494
|
if (timeout > 0 && !skipTimeout) timer = setTimeout(() => {
|
|
@@ -5766,7 +5803,8 @@
|
|
|
5766
5803
|
size: __props.size,
|
|
5767
5804
|
disabled: __props.disabled,
|
|
5768
5805
|
onChange: changeHandler,
|
|
5769
|
-
onAddDiffCount
|
|
5806
|
+
onAddDiffCount,
|
|
5807
|
+
"is-in-row": true
|
|
5770
5808
|
}, null, 8, [
|
|
5771
5809
|
"model",
|
|
5772
5810
|
"lastValues",
|
|
@@ -9204,6 +9242,7 @@
|
|
|
9204
9242
|
var createForm = (config) => config;
|
|
9205
9243
|
//#endregion
|
|
9206
9244
|
exports.FORM_DIFF_CONFIG_KEY = FORM_DIFF_CONFIG_KEY;
|
|
9245
|
+
exports.FORM_SILENT_MODE_KEY = FORM_SILENT_MODE_KEY;
|
|
9207
9246
|
exports.FORM_TYPE_MATCH_VALID_KEY = FORM_TYPE_MATCH_VALID_KEY;
|
|
9208
9247
|
exports.MCascader = Cascader_default;
|
|
9209
9248
|
exports.MCheckbox = Checkbox_default;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.8.0-beta.
|
|
2
|
+
"version": "1.8.0-beta.16",
|
|
3
3
|
"name": "@tmagic/form",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"vue": "^3.5.40",
|
|
54
54
|
"typescript": "^6.0.3",
|
|
55
|
-
"@tmagic/
|
|
56
|
-
"@tmagic/
|
|
57
|
-
"@tmagic/form-schema": "1.8.0-beta.
|
|
55
|
+
"@tmagic/design": "1.8.0-beta.16",
|
|
56
|
+
"@tmagic/utils": "1.8.0-beta.16",
|
|
57
|
+
"@tmagic/form-schema": "1.8.0-beta.16"
|
|
58
58
|
},
|
|
59
59
|
"peerDependenciesMeta": {
|
|
60
60
|
"typescript": {
|
package/src/Form.vue
CHANGED
|
@@ -261,6 +261,18 @@ const formState: FormState = reactive<FormState>({
|
|
|
261
261
|
},
|
|
262
262
|
});
|
|
263
263
|
|
|
264
|
+
/**
|
|
265
|
+
* formState 的内置 key 快照(keyProp / values / $emit / fields / post 等)。
|
|
266
|
+
*
|
|
267
|
+
* 在 `extendState` 首次合并前捕获,`applyExtendState` 会据此禁止 `extendState`
|
|
268
|
+
* 覆盖这些已有字段(只能新增字段),避免表单核心状态被外部意外改写。
|
|
269
|
+
*
|
|
270
|
+
* 之所以在此处(effect 之外)捕获而不是在 `applyExtendState` 内动态取:
|
|
271
|
+
* `watchEffect` 会在依赖变化时重跑,若动态取,`extendState` 自己新增的字段在第二次
|
|
272
|
+
* 合并时也会被当成「已有 key」而拒绝刷新;这里只锁定内置字段即可规避该问题。
|
|
273
|
+
*/
|
|
274
|
+
const reservedStateKeys = new Set<string | symbol>(Reflect.ownKeys(formState));
|
|
275
|
+
|
|
264
276
|
/**
|
|
265
277
|
* `extendState` 的同步段(直到第一个 `await` 之前)所访问的任何响应式数据,
|
|
266
278
|
* 都会被 `watchEffect` 自动跟踪。这样可以兼容历史用法 ——
|
|
@@ -299,7 +311,7 @@ watchEffect(async (onCleanup) => {
|
|
|
299
311
|
}
|
|
300
312
|
if (stale) return;
|
|
301
313
|
|
|
302
|
-
applyExtendState(formState, state);
|
|
314
|
+
applyExtendState(formState, state, reservedStateKeys);
|
|
303
315
|
});
|
|
304
316
|
|
|
305
317
|
provide('mForm', formState);
|
package/src/containers/Col.vue
CHANGED
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
</template>
|
|
241
241
|
|
|
242
242
|
<script setup lang="ts">
|
|
243
|
-
import { computed, inject, readonly, ref, toRaw, watch, watchEffect } from 'vue';
|
|
243
|
+
import { computed, inject, provide, readonly, ref, toRaw, watch, watchEffect } from 'vue';
|
|
244
244
|
import { ArrowDown, ArrowUp, WarningFilled } from '@element-plus/icons-vue';
|
|
245
245
|
import { isEqual } from 'lodash-es';
|
|
246
246
|
|
|
@@ -287,6 +287,8 @@ const props = withDefaults(
|
|
|
287
287
|
size?: string;
|
|
288
288
|
/** 是否开启对比模式 */
|
|
289
289
|
isCompare?: boolean;
|
|
290
|
+
/** 是否在行容器中 */
|
|
291
|
+
isInRow?: boolean;
|
|
290
292
|
}>(),
|
|
291
293
|
{
|
|
292
294
|
prop: '',
|
|
@@ -476,6 +478,8 @@ watch(
|
|
|
476
478
|
},
|
|
477
479
|
);
|
|
478
480
|
|
|
481
|
+
provide('isInRow', props.isInRow ?? false);
|
|
482
|
+
|
|
479
483
|
const expandHandler = () => (expand.value = !expand.value);
|
|
480
484
|
|
|
481
485
|
const key = (config: any) => config[mForm?.keyProps];
|
package/src/schema.ts
CHANGED
|
@@ -29,6 +29,17 @@ export interface FormDiffConfig {
|
|
|
29
29
|
export const FORM_DIFF_CONFIG_KEY: InjectionKey<FormDiffConfig> = Symbol('mFormDiffConfig');
|
|
30
30
|
export const FORM_TYPE_MATCH_VALID_KEY: InjectionKey<ComputedRef<boolean>> = Symbol('mFormTypeMatchValid');
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* 静默模式标记,由 `submitForm` / `validateForm` 以隐藏方式挂载临时表单时 provide(debug 弹层模式不提供)。
|
|
34
|
+
*
|
|
35
|
+
* 重型字段组件(如 vs-code)可 inject 该标记并跳过自身渲染:字段校验由 FormItem 基于 model 值完成,
|
|
36
|
+
* 与叶子 UI 组件实例无关,跳过可省去无谓的实例化开销(如 monaco worker / model 的创建)。
|
|
37
|
+
*
|
|
38
|
+
* 注意:仅「挂载无值副作用」(不在 onMounted/watch immediate 中 emit change、不依赖 DOM 计算值)的
|
|
39
|
+
* 字段组件可以安全跳过,接入前需逐一审计。
|
|
40
|
+
*/
|
|
41
|
+
export const FORM_SILENT_MODE_KEY: InjectionKey<boolean> = Symbol('mFormSilentMode');
|
|
42
|
+
|
|
32
43
|
export interface ValidateError {
|
|
33
44
|
message: string;
|
|
34
45
|
field: string;
|
package/src/submitForm.ts
CHANGED
|
@@ -16,11 +16,22 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
type AppContext,
|
|
21
|
+
type Component,
|
|
22
|
+
createApp,
|
|
23
|
+
defineComponent,
|
|
24
|
+
h,
|
|
25
|
+
nextTick,
|
|
26
|
+
provide,
|
|
27
|
+
type Ref,
|
|
28
|
+
ref,
|
|
29
|
+
watch,
|
|
30
|
+
} from 'vue';
|
|
20
31
|
|
|
21
32
|
import { applyExtendState } from './utils/form';
|
|
22
33
|
import Form from './Form.vue';
|
|
23
|
-
import type
|
|
34
|
+
import { type ChangeRecord, FORM_SILENT_MODE_KEY, type FormConfig, type FormState } from './schema';
|
|
24
35
|
|
|
25
36
|
// #region SubmitFormOptions
|
|
26
37
|
/**
|
|
@@ -193,10 +204,14 @@ const mountFormInstance = <T>(options: MountFormInstanceOptions<T>): Promise<T>
|
|
|
193
204
|
console.error('[MForm] extendState failed:', e);
|
|
194
205
|
return;
|
|
195
206
|
}
|
|
207
|
+
// formState 的内置 key 快照:在 extendState 合并前捕获,
|
|
208
|
+
// 供 applyExtendState 禁止 extendState 覆盖这些已有字段(只能新增),
|
|
209
|
+
// 与 Form.vue 中 reservedStateKeys 的语义保持一致。
|
|
210
|
+
const reservedStateKeys = new Set<string | symbol>(Reflect.ownKeys(form.formState));
|
|
196
211
|
// 合并逻辑收口在 applyExtendState:props 派生的只读 getter 字段
|
|
197
212
|
// (keyProp 等)以普通字段形式返回时会被跳过并告警,避免 proxy set 抛错
|
|
198
213
|
const apply = (state: Record<string, any> | null | undefined) =>
|
|
199
|
-
applyExtendState(form.formState, state);
|
|
214
|
+
applyExtendState(form.formState, state, reservedStateKeys);
|
|
200
215
|
if (result && typeof result.then === 'function') {
|
|
201
216
|
result.then(apply, (e: any) => console.error('[MForm] extendState failed:', e));
|
|
202
217
|
} else {
|
|
@@ -210,7 +225,21 @@ const mountFormInstance = <T>(options: MountFormInstanceOptions<T>): Promise<T>
|
|
|
210
225
|
})
|
|
211
226
|
: userWrapper;
|
|
212
227
|
|
|
213
|
-
|
|
228
|
+
// 静默(隐藏挂载)模式下注入静默标记:vs-code 等重型字段组件可据此跳过自身渲染,
|
|
229
|
+
// 校验/取值依赖 FormItem 与 model 值,与叶子 UI 组件无关(见 FORM_SILENT_MODE_KEY 注释)。
|
|
230
|
+
// 用组件级 provide 而非 app.provide:appContext 合并后 app._context.provides 与父级应用
|
|
231
|
+
// 共享引用,app.provide 会把标记泄漏到父级应用。
|
|
232
|
+
const rootComponent = hidden
|
|
233
|
+
? defineComponent({
|
|
234
|
+
name: 'MFormSilentProvider',
|
|
235
|
+
setup() {
|
|
236
|
+
provide(FORM_SILENT_MODE_KEY, true);
|
|
237
|
+
return () => h(wrapperComponent);
|
|
238
|
+
},
|
|
239
|
+
})
|
|
240
|
+
: wrapperComponent;
|
|
241
|
+
|
|
242
|
+
const app = createApp(rootComponent);
|
|
214
243
|
instance.app = app;
|
|
215
244
|
|
|
216
245
|
// 继承父级应用上下文(components / directives / provides / config 等)
|
package/src/utils/form.ts
CHANGED
|
@@ -449,16 +449,27 @@ export const sortChange = (data: any[], { prop, order }: SortProp) => {
|
|
|
449
449
|
* - accessor 描述符(`{ get stage() { return ... } }`)按原样 defineProperty,调用方
|
|
450
450
|
* 可控制读时求值;强制 `configurable: true` 以便下一次合并可再 define。
|
|
451
451
|
*
|
|
452
|
-
* 注意:
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
*
|
|
452
|
+
* 注意:extendState 只能向 formState「新增」字段,不允许覆盖其已有 key。
|
|
453
|
+
* 调用方可通过 `reservedKeys` 传入合并前已存在的内置 key 快照(keyProp / popperClass /
|
|
454
|
+
* config / initValues / isCompare / lastValues / parentValues / values / $emit / fields /
|
|
455
|
+
* post 等),命中这些 key 时统一跳过并告警。
|
|
456
|
+
*
|
|
457
|
+
* 兜底:未传 `reservedKeys` 时,仍会拦截 props 派生的只读 getter 字段(无 setter),
|
|
458
|
+
* 否则以普通字段形式赋值会让 proxy 的 set trap 抛出
|
|
459
|
+
* `TypeError: 'set' on proxy: trap returned falsish`。
|
|
457
460
|
*/
|
|
458
|
-
export const applyExtendState = (
|
|
461
|
+
export const applyExtendState = (
|
|
462
|
+
formState: FormState,
|
|
463
|
+
state: Record<string, any> | null | undefined,
|
|
464
|
+
reservedKeys?: Set<string | symbol>,
|
|
465
|
+
): void => {
|
|
459
466
|
if (!state) return;
|
|
460
467
|
|
|
461
468
|
for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(state))) {
|
|
469
|
+
if (reservedKeys?.has(key)) {
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
|
|
462
473
|
if (!('value' in descriptor)) {
|
|
463
474
|
descriptor.configurable = true;
|
|
464
475
|
Object.defineProperty(formState, key, descriptor);
|
package/src/utils/typeMatch.ts
CHANGED
|
@@ -142,7 +142,7 @@ const stringifyExampleValue = (value: any): string => {
|
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
// 参考建议中最多展示的可选值个数,超出以「等」省略。
|
|
145
|
-
const MAX_SUGGESTION_OPTIONS =
|
|
145
|
+
const MAX_SUGGESTION_OPTIONS = 20;
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* 生成「请使用以下某一个值:xxx;xxx」形式的参考建议;无可选值时返回空字符串(不追加建议)。
|
|
@@ -558,6 +558,11 @@ const validateBuiltinTypeMatch = (
|
|
|
558
558
|
return undefined;
|
|
559
559
|
}
|
|
560
560
|
|
|
561
|
+
// text 常与数字(如 id、数量)绑定,值允许为数字;错误建议仍按字符串给出
|
|
562
|
+
if (fieldType === 'text' && isNumberValue(value)) {
|
|
563
|
+
return undefined;
|
|
564
|
+
}
|
|
565
|
+
|
|
561
566
|
if (typeof value !== 'string') {
|
|
562
567
|
return defaultMessage(
|
|
563
568
|
message,
|
|
@@ -697,9 +702,13 @@ export const validateTypeMatch = (
|
|
|
697
702
|
return undefined;
|
|
698
703
|
}
|
|
699
704
|
|
|
705
|
+
if (!props.config?.name) {
|
|
706
|
+
return undefined;
|
|
707
|
+
}
|
|
708
|
+
|
|
700
709
|
const rawFieldType = 'type' in (props.config || {}) ? props.config.type : '';
|
|
701
710
|
if (typeof rawFieldType !== 'string' || !rawFieldType) {
|
|
702
|
-
return;
|
|
711
|
+
return undefined;
|
|
703
712
|
}
|
|
704
713
|
|
|
705
714
|
// 统一将驼峰形式(如 radioGroup)归一化为连字符形式(radio-group),与内置规则的 key 保持一致
|
package/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export * from "@tmagic/form-schema";
|
|
|
4
4
|
|
|
5
5
|
//#region \0rolldown/runtime.js
|
|
6
6
|
declare namespace schema_d_exports {
|
|
7
|
-
export { ChangeRecord, ContainerChangeEventData, FORM_DIFF_CONFIG_KEY, FORM_TYPE_MATCH_VALID_KEY, FormDiffConfig, FormLabelSlotProps, FormSlots, ValidateError };
|
|
7
|
+
export { ChangeRecord, ContainerChangeEventData, FORM_DIFF_CONFIG_KEY, FORM_SILENT_MODE_KEY, FORM_TYPE_MATCH_VALID_KEY, FormDiffConfig, FormLabelSlotProps, FormSlots, ValidateError };
|
|
8
8
|
}
|
|
9
9
|
import * as import__tmagic_form_schema from "@tmagic/form-schema";
|
|
10
10
|
/**
|
|
@@ -34,6 +34,16 @@ interface FormDiffConfig {
|
|
|
34
34
|
}
|
|
35
35
|
declare const FORM_DIFF_CONFIG_KEY: InjectionKey<FormDiffConfig>;
|
|
36
36
|
declare const FORM_TYPE_MATCH_VALID_KEY: InjectionKey<ComputedRef<boolean>>;
|
|
37
|
+
/**
|
|
38
|
+
* 静默模式标记,由 `submitForm` / `validateForm` 以隐藏方式挂载临时表单时 provide(debug 弹层模式不提供)。
|
|
39
|
+
*
|
|
40
|
+
* 重型字段组件(如 vs-code)可 inject 该标记并跳过自身渲染:字段校验由 FormItem 基于 model 值完成,
|
|
41
|
+
* 与叶子 UI 组件实例无关,跳过可省去无谓的实例化开销(如 monaco worker / model 的创建)。
|
|
42
|
+
*
|
|
43
|
+
* 注意:仅「挂载无值副作用」(不在 onMounted/watch immediate 中 emit change、不依赖 DOM 计算值)的
|
|
44
|
+
* 字段组件可以安全跳过,接入前需逐一审计。
|
|
45
|
+
*/
|
|
46
|
+
declare const FORM_SILENT_MODE_KEY: InjectionKey<boolean>;
|
|
37
47
|
interface ValidateError {
|
|
38
48
|
message: string;
|
|
39
49
|
field: string;
|
|
@@ -280,13 +290,16 @@ declare const sortChange: (data: any[], {
|
|
|
280
290
|
* - accessor 描述符(`{ get stage() { return ... } }`)按原样 defineProperty,调用方
|
|
281
291
|
* 可控制读时求值;强制 `configurable: true` 以便下一次合并可再 define。
|
|
282
292
|
*
|
|
283
|
-
* 注意:
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
293
|
+
* 注意:extendState 只能向 formState「新增」字段,不允许覆盖其已有 key。
|
|
294
|
+
* 调用方可通过 `reservedKeys` 传入合并前已存在的内置 key 快照(keyProp / popperClass /
|
|
295
|
+
* config / initValues / isCompare / lastValues / parentValues / values / $emit / fields /
|
|
296
|
+
* post 等),命中这些 key 时统一跳过并告警。
|
|
297
|
+
*
|
|
298
|
+
* 兜底:未传 `reservedKeys` 时,仍会拦截 props 派生的只读 getter 字段(无 setter),
|
|
299
|
+
* 否则以普通字段形式赋值会让 proxy 的 set trap 抛出
|
|
300
|
+
* `TypeError: 'set' on proxy: trap returned falsish`。
|
|
288
301
|
*/
|
|
289
|
-
declare const applyExtendState: (formState: schema_d_exports.FormState, state: Record<string, any> | null | undefined) => void;
|
|
302
|
+
declare const applyExtendState: (formState: schema_d_exports.FormState, state: Record<string, any> | null | undefined, reservedKeys?: Set<string | symbol>) => void;
|
|
290
303
|
declare const createObjectProp: (prop: string, key: string, name?: string | number) => string;
|
|
291
304
|
//#endregion
|
|
292
305
|
//#region temp/packages/form/src/utils/useAddField.d.ts
|
|
@@ -1773,7 +1786,8 @@ type __VLS_Props$26 = {
|
|
|
1773
1786
|
expandMore?: boolean;
|
|
1774
1787
|
stepActive?: string | number;
|
|
1775
1788
|
size?: string; /** 是否开启对比模式 */
|
|
1776
|
-
isCompare?: boolean;
|
|
1789
|
+
isCompare?: boolean; /** 是否在行容器中 */
|
|
1790
|
+
isInRow?: boolean;
|
|
1777
1791
|
};
|
|
1778
1792
|
declare const __VLS_base$1: import("@vue/runtime-core").DefineComponent<__VLS_Props$26, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
|
|
1779
1793
|
change: (v: any, eventData: ContainerChangeEventData) => any;
|
|
@@ -2207,8 +2221,8 @@ declare const _default$31: {
|
|
|
2207
2221
|
install(app: App, opt?: FormInstallOptions): void;
|
|
2208
2222
|
};
|
|
2209
2223
|
declare namespace index_d_exports {
|
|
2210
|
-
export { ChangeRecord, ContainerChangeEventData, FORM_DIFF_CONFIG_KEY, FORM_TYPE_MATCH_VALID_KEY, FormDiffConfig, FormInstallOptions, FormLabelSlotProps, FormSlots, _default as MCascader, _default$1 as MCheckbox, _default$2 as MCheckboxGroup, _default$3 as MColorPicker, _default$4 as MContainer, _default$5 as MDate, _default$6 as MDateTime, _default$7 as MDaterange, _default$8 as MDisplay, _default$9 as MDynamicField, _default$10 as MFieldset, _default$11 as MFlexLayout, _default$12 as MForm, _default$13 as MFormBox, _default$14 as MFormDialog, _default$15 as MFormDrawer, _default$16 as MGroupList, _default$17 as MHidden, _default$18 as MLink, _default$19 as MNumber, _default$20 as MNumberRange, _default$21 as MPanel, _default$22 as MRadioGroup, _default$23 as MRow, _default$24 as MSelect, _default$25 as MSwitch, _default$16 as MTable, _default$16 as MTableGroupList, _default$26 as MTabs, _default$27 as MText, _default$28 as MTextarea, _default$29 as MTime, _default$30 as MTimerange, SubmitFormOptions, SubmitFormResult, TypeMatchValidateContext, TypeMatchValidator, ValidateError, ValidateFormOptions, adaptFormValidator, applyExtendState, clearTypeMatchRules, createForm, createObjectProp, createValues, datetimeFormatter, _default$31 as default, deleteField as deleteFormField, deleteTypeMatchRule, display, filterFunction, getDataByPage, getField as getFormField, getRules, getTypeMatchRule, initValue, registerField as registerFormField, registerTypeMatchRule, registerTypeMatchRules, sortArray, sortChange, stripTabItemsLazy, submitForm, useAddField, validateForm, validateTypeMatch };
|
|
2224
|
+
export { ChangeRecord, ContainerChangeEventData, FORM_DIFF_CONFIG_KEY, FORM_SILENT_MODE_KEY, FORM_TYPE_MATCH_VALID_KEY, FormDiffConfig, FormInstallOptions, FormLabelSlotProps, FormSlots, _default as MCascader, _default$1 as MCheckbox, _default$2 as MCheckboxGroup, _default$3 as MColorPicker, _default$4 as MContainer, _default$5 as MDate, _default$6 as MDateTime, _default$7 as MDaterange, _default$8 as MDisplay, _default$9 as MDynamicField, _default$10 as MFieldset, _default$11 as MFlexLayout, _default$12 as MForm, _default$13 as MFormBox, _default$14 as MFormDialog, _default$15 as MFormDrawer, _default$16 as MGroupList, _default$17 as MHidden, _default$18 as MLink, _default$19 as MNumber, _default$20 as MNumberRange, _default$21 as MPanel, _default$22 as MRadioGroup, _default$23 as MRow, _default$24 as MSelect, _default$25 as MSwitch, _default$16 as MTable, _default$16 as MTableGroupList, _default$26 as MTabs, _default$27 as MText, _default$28 as MTextarea, _default$29 as MTime, _default$30 as MTimerange, SubmitFormOptions, SubmitFormResult, TypeMatchValidateContext, TypeMatchValidator, ValidateError, ValidateFormOptions, adaptFormValidator, applyExtendState, clearTypeMatchRules, createForm, createObjectProp, createValues, datetimeFormatter, _default$31 as default, deleteField as deleteFormField, deleteTypeMatchRule, display, filterFunction, getDataByPage, getField as getFormField, getRules, getTypeMatchRule, initValue, registerField as registerFormField, registerTypeMatchRule, registerTypeMatchRules, sortArray, sortChange, stripTabItemsLazy, submitForm, useAddField, validateForm, validateTypeMatch };
|
|
2211
2225
|
}
|
|
2212
2226
|
declare const createForm: <T extends [] = []>(config: schema_d_exports.FormConfig | T) => schema_d_exports.FormConfig | T;
|
|
2213
2227
|
//#endregion
|
|
2214
|
-
export { ChangeRecord, ContainerChangeEventData, FORM_DIFF_CONFIG_KEY, FORM_TYPE_MATCH_VALID_KEY, FormDiffConfig, type FormInstallOptions, FormLabelSlotProps, FormSlots, _default as MCascader, _default$1 as MCheckbox, _default$2 as MCheckboxGroup, _default$3 as MColorPicker, _default$4 as MContainer, _default$5 as MDate, _default$6 as MDateTime, _default$7 as MDaterange, _default$8 as MDisplay, _default$9 as MDynamicField, _default$10 as MFieldset, _default$11 as MFlexLayout, _default$12 as MForm, _default$13 as MFormBox, _default$14 as MFormDialog, _default$15 as MFormDrawer, _default$16 as MGroupList, _default$16 as MTable, _default$16 as MTableGroupList, _default$17 as MHidden, _default$18 as MLink, _default$19 as MNumber, _default$20 as MNumberRange, _default$21 as MPanel, _default$22 as MRadioGroup, _default$23 as MRow, _default$24 as MSelect, _default$25 as MSwitch, _default$26 as MTabs, _default$27 as MText, _default$28 as MTextarea, _default$29 as MTime, _default$30 as MTimerange, SubmitFormOptions, SubmitFormResult, type TypeMatchValidateContext, type TypeMatchValidator, ValidateError, ValidateFormOptions, adaptFormValidator, applyExtendState, clearTypeMatchRules, createForm, createObjectProp, createValues, datetimeFormatter, _default$31 as default, deleteField as deleteFormField, deleteTypeMatchRule, display, filterFunction, getDataByPage, getField as getFormField, getRules, getTypeMatchRule, initValue, registerField as registerFormField, registerTypeMatchRule, registerTypeMatchRules, sortArray, sortChange, stripTabItemsLazy, submitForm, useAddField, validateForm, validateTypeMatch };
|
|
2228
|
+
export { ChangeRecord, ContainerChangeEventData, FORM_DIFF_CONFIG_KEY, FORM_SILENT_MODE_KEY, FORM_TYPE_MATCH_VALID_KEY, FormDiffConfig, type FormInstallOptions, FormLabelSlotProps, FormSlots, _default as MCascader, _default$1 as MCheckbox, _default$2 as MCheckboxGroup, _default$3 as MColorPicker, _default$4 as MContainer, _default$5 as MDate, _default$6 as MDateTime, _default$7 as MDaterange, _default$8 as MDisplay, _default$9 as MDynamicField, _default$10 as MFieldset, _default$11 as MFlexLayout, _default$12 as MForm, _default$13 as MFormBox, _default$14 as MFormDialog, _default$15 as MFormDrawer, _default$16 as MGroupList, _default$16 as MTable, _default$16 as MTableGroupList, _default$17 as MHidden, _default$18 as MLink, _default$19 as MNumber, _default$20 as MNumberRange, _default$21 as MPanel, _default$22 as MRadioGroup, _default$23 as MRow, _default$24 as MSelect, _default$25 as MSwitch, _default$26 as MTabs, _default$27 as MText, _default$28 as MTextarea, _default$29 as MTime, _default$30 as MTimerange, SubmitFormOptions, SubmitFormResult, type TypeMatchValidateContext, type TypeMatchValidator, ValidateError, ValidateFormOptions, adaptFormValidator, applyExtendState, clearTypeMatchRules, createForm, createObjectProp, createValues, datetimeFormatter, _default$31 as default, deleteField as deleteFormField, deleteTypeMatchRule, display, filterFunction, getDataByPage, getField as getFormField, getRules, getTypeMatchRule, initValue, registerField as registerFormField, registerTypeMatchRule, registerTypeMatchRules, sortArray, sortChange, stripTabItemsLazy, submitForm, useAddField, validateForm, validateTypeMatch };
|