@tmagic/form 1.3.16 → 1.4.0-beta.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.
- package/dist/style.css +1 -1
- package/dist/tmagic-form.js +17 -15
- package/dist/tmagic-form.umd.cjs +17 -15
- package/package.json +12 -11
- package/src/containers/Container.vue +3 -3
- package/src/fields/Cascader.vue +1 -0
- package/src/fields/Checkbox.vue +2 -2
- package/src/fields/CheckboxGroup.vue +1 -6
- package/src/fields/RadioGroup.vue +3 -7
- package/src/schema.ts +6 -2
- package/src/theme/form-box.scss +1 -1
- package/types/Form.vue.d.ts +12 -12
- package/types/FormBox.vue.d.ts +191 -241
- package/types/FormDialog.vue.d.ts +191 -241
- package/types/FormDrawer.vue.d.ts +192 -242
- package/types/containers/Col.vue.d.ts +3 -3
- package/types/containers/Container.vue.d.ts +12 -12
- package/types/containers/Fieldset.vue.d.ts +11 -11
- package/types/containers/GroupList.vue.d.ts +3 -3
- package/types/containers/GroupListItem.vue.d.ts +3 -3
- package/types/containers/Panel.vue.d.ts +8 -8
- package/types/containers/Row.vue.d.ts +3 -3
- package/types/containers/Step.vue.d.ts +11 -11
- package/types/containers/Table.vue.d.ts +11 -11
- package/types/containers/Tabs.vue.d.ts +11 -11
- package/types/fields/Cascader.vue.d.ts +3 -3
- package/types/fields/Checkbox.vue.d.ts +3 -3
- package/types/fields/CheckboxGroup.vue.d.ts +3 -3
- package/types/fields/ColorPicker.vue.d.ts +3 -3
- package/types/fields/Date.vue.d.ts +3 -3
- package/types/fields/DateTime.vue.d.ts +3 -3
- package/types/fields/Daterange.vue.d.ts +3 -3
- package/types/fields/Display.vue.d.ts +2 -2
- package/types/fields/DynamicField.vue.d.ts +3 -3
- package/types/fields/Hidden.vue.d.ts +2 -2
- package/types/fields/Link.vue.d.ts +3 -3
- package/types/fields/Number.vue.d.ts +3 -3
- package/types/fields/NumberRange.vue.d.ts +3 -3
- package/types/fields/RadioGroup.vue.d.ts +3 -3
- package/types/fields/Select.vue.d.ts +3 -3
- package/types/fields/SelectOptionGroups.vue.d.ts +3 -3
- package/types/fields/SelectOptions.vue.d.ts +3 -3
- package/types/fields/Switch.vue.d.ts +3 -3
- package/types/fields/Text.vue.d.ts +3 -3
- package/types/fields/Textarea.vue.d.ts +3 -3
- package/types/fields/Time.vue.d.ts +3 -3
- package/types/fields/Timerange.vue.d.ts +3 -3
- package/types/schema.d.ts +6 -2
package/dist/style.css
CHANGED
package/dist/tmagic-form.js
CHANGED
|
@@ -167,15 +167,15 @@ const initValue = async (mForm, { initValues, config }) => {
|
|
|
167
167
|
};
|
|
168
168
|
|
|
169
169
|
const _hoisted_1$e = ["id", "data-magic-id"];
|
|
170
|
-
const _hoisted_2$9 = ["innerHTML"];
|
|
170
|
+
const _hoisted_2$9 = ["innerHTML", "title"];
|
|
171
171
|
const _hoisted_3$5 = ["innerHTML"];
|
|
172
172
|
const _hoisted_4$4 = ["innerHTML"];
|
|
173
173
|
const _hoisted_5$4 = ["innerHTML"];
|
|
174
|
-
const _hoisted_6$2 = ["innerHTML"];
|
|
174
|
+
const _hoisted_6$2 = ["innerHTML", "title"];
|
|
175
175
|
const _hoisted_7$1 = ["innerHTML"];
|
|
176
176
|
const _hoisted_8$1 = ["innerHTML"];
|
|
177
177
|
const _hoisted_9 = ["innerHTML"];
|
|
178
|
-
const _hoisted_10 = ["innerHTML"];
|
|
178
|
+
const _hoisted_10 = ["innerHTML", "title"];
|
|
179
179
|
const _hoisted_11 = ["innerHTML"];
|
|
180
180
|
const _hoisted_12 = ["innerHTML"];
|
|
181
181
|
const _hoisted_13 = ["innerHTML"];
|
|
@@ -371,7 +371,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
371
371
|
}, {
|
|
372
372
|
label: withCtx(() => [
|
|
373
373
|
createElementVNode("span", {
|
|
374
|
-
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
374
|
+
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
375
|
+
title: _ctx.config.labelTitle
|
|
375
376
|
}, null, 8, _hoisted_2$9)
|
|
376
377
|
]),
|
|
377
378
|
default: withCtx(() => [
|
|
@@ -443,7 +444,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
443
444
|
}, {
|
|
444
445
|
label: withCtx(() => [
|
|
445
446
|
createElementVNode("span", {
|
|
446
|
-
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
447
|
+
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
448
|
+
title: _ctx.config.labelTitle
|
|
447
449
|
}, null, 8, _hoisted_6$2)
|
|
448
450
|
]),
|
|
449
451
|
default: withCtx(() => [
|
|
@@ -510,7 +512,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
510
512
|
}, {
|
|
511
513
|
label: withCtx(() => [
|
|
512
514
|
createElementVNode("span", {
|
|
513
|
-
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
515
|
+
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
516
|
+
title: _ctx.config.labelTitle
|
|
514
517
|
}, null, 8, _hoisted_10)
|
|
515
518
|
]),
|
|
516
519
|
default: withCtx(() => [
|
|
@@ -2263,13 +2266,14 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
2263
2266
|
placeholder: _ctx.config.placeholder,
|
|
2264
2267
|
disabled: _ctx.disabled,
|
|
2265
2268
|
options: options.value,
|
|
2269
|
+
"popper-class": _ctx.config.popperClass,
|
|
2266
2270
|
props: {
|
|
2267
2271
|
multiple: _ctx.config.multiple ?? false,
|
|
2268
2272
|
emitPath: _ctx.config.emitPath ?? true,
|
|
2269
2273
|
checkStrictly: _ctx.config.checkStrictly ?? false
|
|
2270
2274
|
},
|
|
2271
2275
|
onChange: changeHandler
|
|
2272
|
-
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "options", "props"]);
|
|
2276
|
+
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "options", "popper-class", "props"]);
|
|
2273
2277
|
};
|
|
2274
2278
|
}
|
|
2275
2279
|
});
|
|
@@ -2323,8 +2327,8 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
2323
2327
|
modelValue: _ctx.model[_ctx.name],
|
|
2324
2328
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
2325
2329
|
size: _ctx.size,
|
|
2326
|
-
|
|
2327
|
-
|
|
2330
|
+
trueValue: activeValue.value,
|
|
2331
|
+
falseValue: inactiveValue.value,
|
|
2328
2332
|
disabled: _ctx.disabled,
|
|
2329
2333
|
onChange: changeHandler
|
|
2330
2334
|
}, {
|
|
@@ -2332,7 +2336,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
2332
2336
|
createTextVNode(toDisplayString(_ctx.config.text), 1)
|
|
2333
2337
|
]),
|
|
2334
2338
|
_: 1
|
|
2335
|
-
}, 8, ["modelValue", "size", "
|
|
2339
|
+
}, 8, ["modelValue", "size", "trueValue", "falseValue", "disabled"]);
|
|
2336
2340
|
};
|
|
2337
2341
|
}
|
|
2338
2342
|
});
|
|
@@ -2383,7 +2387,6 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
2383
2387
|
default: withCtx(() => [
|
|
2384
2388
|
(openBlock(true), createElementBlock(Fragment, null, renderList(options.value, (option) => {
|
|
2385
2389
|
return openBlock(), createBlock(unref(TMagicCheckbox), {
|
|
2386
|
-
label: option.value,
|
|
2387
2390
|
value: option.value,
|
|
2388
2391
|
key: option.value,
|
|
2389
2392
|
disabled: option.disabled
|
|
@@ -2392,7 +2395,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
2392
2395
|
createTextVNode(toDisplayString(option.text), 1)
|
|
2393
2396
|
]),
|
|
2394
2397
|
_: 2
|
|
2395
|
-
}, 1032, ["
|
|
2398
|
+
}, 1032, ["value", "disabled"]);
|
|
2396
2399
|
}), 128))
|
|
2397
2400
|
]),
|
|
2398
2401
|
_: 1
|
|
@@ -3389,7 +3392,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
3389
3392
|
default: withCtx(() => [
|
|
3390
3393
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.options, (option) => {
|
|
3391
3394
|
return openBlock(), createBlock(unref(TMagicRadio), {
|
|
3392
|
-
label: option.value,
|
|
3393
3395
|
value: option.value,
|
|
3394
3396
|
key: `${option.value}`
|
|
3395
3397
|
}, {
|
|
@@ -3397,7 +3399,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
3397
3399
|
createTextVNode(toDisplayString(option.text), 1)
|
|
3398
3400
|
]),
|
|
3399
3401
|
_: 2
|
|
3400
|
-
}, 1032, ["
|
|
3402
|
+
}, 1032, ["value"]);
|
|
3401
3403
|
}), 128))
|
|
3402
3404
|
]),
|
|
3403
3405
|
_: 1
|
|
@@ -4032,7 +4034,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4032
4034
|
createTextVNode(toDisplayString(appendConfig.value.text), 1)
|
|
4033
4035
|
]),
|
|
4034
4036
|
_: 1
|
|
4035
|
-
}, 8, ["size"
|
|
4037
|
+
}, 8, ["size"])) : createCommentVNode("", true)
|
|
4036
4038
|
]),
|
|
4037
4039
|
key: "0"
|
|
4038
4040
|
} : void 0
|
package/dist/tmagic-form.umd.cjs
CHANGED
|
@@ -166,15 +166,15 @@
|
|
|
166
166
|
};
|
|
167
167
|
|
|
168
168
|
const _hoisted_1$e = ["id", "data-magic-id"];
|
|
169
|
-
const _hoisted_2$9 = ["innerHTML"];
|
|
169
|
+
const _hoisted_2$9 = ["innerHTML", "title"];
|
|
170
170
|
const _hoisted_3$5 = ["innerHTML"];
|
|
171
171
|
const _hoisted_4$4 = ["innerHTML"];
|
|
172
172
|
const _hoisted_5$4 = ["innerHTML"];
|
|
173
|
-
const _hoisted_6$2 = ["innerHTML"];
|
|
173
|
+
const _hoisted_6$2 = ["innerHTML", "title"];
|
|
174
174
|
const _hoisted_7$1 = ["innerHTML"];
|
|
175
175
|
const _hoisted_8$1 = ["innerHTML"];
|
|
176
176
|
const _hoisted_9 = ["innerHTML"];
|
|
177
|
-
const _hoisted_10 = ["innerHTML"];
|
|
177
|
+
const _hoisted_10 = ["innerHTML", "title"];
|
|
178
178
|
const _hoisted_11 = ["innerHTML"];
|
|
179
179
|
const _hoisted_12 = ["innerHTML"];
|
|
180
180
|
const _hoisted_13 = ["innerHTML"];
|
|
@@ -370,7 +370,8 @@
|
|
|
370
370
|
}, {
|
|
371
371
|
label: vue.withCtx(() => [
|
|
372
372
|
vue.createElementVNode("span", {
|
|
373
|
-
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
373
|
+
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
374
|
+
title: _ctx.config.labelTitle
|
|
374
375
|
}, null, 8, _hoisted_2$9)
|
|
375
376
|
]),
|
|
376
377
|
default: vue.withCtx(() => [
|
|
@@ -442,7 +443,8 @@
|
|
|
442
443
|
}, {
|
|
443
444
|
label: vue.withCtx(() => [
|
|
444
445
|
vue.createElementVNode("span", {
|
|
445
|
-
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
446
|
+
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
447
|
+
title: _ctx.config.labelTitle
|
|
446
448
|
}, null, 8, _hoisted_6$2)
|
|
447
449
|
]),
|
|
448
450
|
default: vue.withCtx(() => [
|
|
@@ -509,7 +511,8 @@
|
|
|
509
511
|
}, {
|
|
510
512
|
label: vue.withCtx(() => [
|
|
511
513
|
vue.createElementVNode("span", {
|
|
512
|
-
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
514
|
+
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
515
|
+
title: _ctx.config.labelTitle
|
|
513
516
|
}, null, 8, _hoisted_10)
|
|
514
517
|
]),
|
|
515
518
|
default: vue.withCtx(() => [
|
|
@@ -2262,13 +2265,14 @@
|
|
|
2262
2265
|
placeholder: _ctx.config.placeholder,
|
|
2263
2266
|
disabled: _ctx.disabled,
|
|
2264
2267
|
options: options.value,
|
|
2268
|
+
"popper-class": _ctx.config.popperClass,
|
|
2265
2269
|
props: {
|
|
2266
2270
|
multiple: _ctx.config.multiple ?? false,
|
|
2267
2271
|
emitPath: _ctx.config.emitPath ?? true,
|
|
2268
2272
|
checkStrictly: _ctx.config.checkStrictly ?? false
|
|
2269
2273
|
},
|
|
2270
2274
|
onChange: changeHandler
|
|
2271
|
-
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "options", "props"]);
|
|
2275
|
+
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "options", "popper-class", "props"]);
|
|
2272
2276
|
};
|
|
2273
2277
|
}
|
|
2274
2278
|
});
|
|
@@ -2322,8 +2326,8 @@
|
|
|
2322
2326
|
modelValue: _ctx.model[_ctx.name],
|
|
2323
2327
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
2324
2328
|
size: _ctx.size,
|
|
2325
|
-
|
|
2326
|
-
|
|
2329
|
+
trueValue: activeValue.value,
|
|
2330
|
+
falseValue: inactiveValue.value,
|
|
2327
2331
|
disabled: _ctx.disabled,
|
|
2328
2332
|
onChange: changeHandler
|
|
2329
2333
|
}, {
|
|
@@ -2331,7 +2335,7 @@
|
|
|
2331
2335
|
vue.createTextVNode(vue.toDisplayString(_ctx.config.text), 1)
|
|
2332
2336
|
]),
|
|
2333
2337
|
_: 1
|
|
2334
|
-
}, 8, ["modelValue", "size", "
|
|
2338
|
+
}, 8, ["modelValue", "size", "trueValue", "falseValue", "disabled"]);
|
|
2335
2339
|
};
|
|
2336
2340
|
}
|
|
2337
2341
|
});
|
|
@@ -2382,7 +2386,6 @@
|
|
|
2382
2386
|
default: vue.withCtx(() => [
|
|
2383
2387
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(options.value, (option) => {
|
|
2384
2388
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCheckbox), {
|
|
2385
|
-
label: option.value,
|
|
2386
2389
|
value: option.value,
|
|
2387
2390
|
key: option.value,
|
|
2388
2391
|
disabled: option.disabled
|
|
@@ -2391,7 +2394,7 @@
|
|
|
2391
2394
|
vue.createTextVNode(vue.toDisplayString(option.text), 1)
|
|
2392
2395
|
]),
|
|
2393
2396
|
_: 2
|
|
2394
|
-
}, 1032, ["
|
|
2397
|
+
}, 1032, ["value", "disabled"]);
|
|
2395
2398
|
}), 128))
|
|
2396
2399
|
]),
|
|
2397
2400
|
_: 1
|
|
@@ -3388,7 +3391,6 @@
|
|
|
3388
3391
|
default: vue.withCtx(() => [
|
|
3389
3392
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.options, (option) => {
|
|
3390
3393
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRadio), {
|
|
3391
|
-
label: option.value,
|
|
3392
3394
|
value: option.value,
|
|
3393
3395
|
key: `${option.value}`
|
|
3394
3396
|
}, {
|
|
@@ -3396,7 +3398,7 @@
|
|
|
3396
3398
|
vue.createTextVNode(vue.toDisplayString(option.text), 1)
|
|
3397
3399
|
]),
|
|
3398
3400
|
_: 2
|
|
3399
|
-
}, 1032, ["
|
|
3401
|
+
}, 1032, ["value"]);
|
|
3400
3402
|
}), 128))
|
|
3401
3403
|
]),
|
|
3402
3404
|
_: 1
|
|
@@ -4031,7 +4033,7 @@
|
|
|
4031
4033
|
vue.createTextVNode(vue.toDisplayString(appendConfig.value.text), 1)
|
|
4032
4034
|
]),
|
|
4033
4035
|
_: 1
|
|
4034
|
-
}, 8, ["size"
|
|
4036
|
+
}, 8, ["size"])) : vue.createCommentVNode("", true)
|
|
4035
4037
|
]),
|
|
4036
4038
|
key: "0"
|
|
4037
4039
|
} : void 0
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.4.0-beta.1",
|
|
3
3
|
"name": "@tmagic/form",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@element-plus/icons-vue": "^2.3.1",
|
|
35
|
-
"@tmagic/design": "1.
|
|
36
|
-
"@tmagic/utils": "1.
|
|
35
|
+
"@tmagic/design": "1.4.0-beta.1",
|
|
36
|
+
"@tmagic/utils": "1.4.0-beta.1",
|
|
37
37
|
"lodash-es": "^4.17.21",
|
|
38
38
|
"sortablejs": "^1.14.0",
|
|
39
|
-
"vue": "^3.
|
|
39
|
+
"vue": "^3.4.21"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"vue": "^3.
|
|
42
|
+
"vue": "^3.4.21"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@babel/core": "^7.18.0",
|
|
@@ -47,17 +47,18 @@
|
|
|
47
47
|
"@types/node": "^18.19.0",
|
|
48
48
|
"@types/sortablejs": "^1.10.7",
|
|
49
49
|
"@vitejs/plugin-vue": "^4.5.2",
|
|
50
|
-
"@vue/compiler-sfc": "^3.
|
|
51
|
-
"@vue/test-utils": "^2.
|
|
50
|
+
"@vue/compiler-sfc": "^3.4.21",
|
|
51
|
+
"@vue/test-utils": "^2.4.4",
|
|
52
52
|
"rimraf": "^3.0.2",
|
|
53
53
|
"sass": "^1.35.1",
|
|
54
|
-
"typescript": "^5.
|
|
55
|
-
"vite": "^5.
|
|
56
|
-
"vue-tsc": "^
|
|
54
|
+
"typescript": "^5.4.2",
|
|
55
|
+
"vite": "^5.1.6",
|
|
56
|
+
"vue-tsc": "^2.0.6"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "npm run build:type && vite build",
|
|
60
60
|
"build:type": "npm run clear:type && vue-tsc --declaration --emitDeclarationOnly --project tsconfig.build.json",
|
|
61
|
-
"clear:type": "rimraf ./types"
|
|
61
|
+
"clear:type": "rimraf ./types",
|
|
62
|
+
"type:check": "vue-tsc --noEmit"
|
|
62
63
|
}
|
|
63
64
|
}
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
:label-width="itemLabelWidth"
|
|
43
43
|
:rules="rule"
|
|
44
44
|
>
|
|
45
|
-
<template #label><span v-html="type === 'checkbox' ? '' : text"></span></template>
|
|
45
|
+
<template #label><span v-html="type === 'checkbox' ? '' : text" :title="config.labelTitle"></span></template>
|
|
46
46
|
<TMagicTooltip v-if="tooltip">
|
|
47
47
|
<component
|
|
48
48
|
:key="key(config)"
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
:rules="rule"
|
|
100
100
|
style="background: #f7dadd"
|
|
101
101
|
>
|
|
102
|
-
<template #label><span v-html="type === 'checkbox' ? '' : text"></span></template>
|
|
102
|
+
<template #label><span v-html="type === 'checkbox' ? '' : text" :title="config.labelTitle"></span></template>
|
|
103
103
|
<TMagicTooltip v-if="tooltip">
|
|
104
104
|
<component
|
|
105
105
|
:key="key(config)"
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
:rules="rule"
|
|
149
149
|
style="background: #def7da"
|
|
150
150
|
>
|
|
151
|
-
<template #label><span v-html="type === 'checkbox' ? '' : text"></span></template>
|
|
151
|
+
<template #label><span v-html="type === 'checkbox' ? '' : text" :title="config.labelTitle"></span></template>
|
|
152
152
|
<TMagicTooltip v-if="tooltip">
|
|
153
153
|
<component
|
|
154
154
|
:key="key(config)"
|
package/src/fields/Cascader.vue
CHANGED
package/src/fields/Checkbox.vue
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<TMagicCheckboxGroup v-model="model[name]" :size="size" :disabled="disabled" @change="changeHandler">
|
|
3
|
-
<TMagicCheckbox
|
|
4
|
-
v-for="option in options"
|
|
5
|
-
:label="option.value"
|
|
6
|
-
:value="option.value"
|
|
7
|
-
:key="option.value"
|
|
8
|
-
:disabled="option.disabled"
|
|
3
|
+
<TMagicCheckbox v-for="option in options" :value="option.value" :key="option.value" :disabled="option.disabled"
|
|
9
4
|
>{{ option.text }}
|
|
10
5
|
</TMagicCheckbox>
|
|
11
6
|
</TMagicCheckboxGroup>
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<TMagicRadioGroup v-if="model" v-model="model[name]" :size="size" :disabled="disabled" @change="changeHandler">
|
|
3
|
-
<TMagicRadio
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
:value="option.value"
|
|
7
|
-
:key="`${option.value}`"
|
|
8
|
-
>{{ option.text }}</TMagicRadio
|
|
9
|
-
>
|
|
3
|
+
<TMagicRadio v-for="option in config.options" :value="option.value" :key="`${option.value}`">{{
|
|
4
|
+
option.text
|
|
5
|
+
}}</TMagicRadio>
|
|
10
6
|
</TMagicRadioGroup>
|
|
11
7
|
</template>
|
|
12
8
|
|
package/src/schema.ts
CHANGED
|
@@ -66,6 +66,8 @@ export interface FormItem {
|
|
|
66
66
|
__key?: string | number;
|
|
67
67
|
/** 表单域标签的的宽度,例如 '50px'。支持 auto。 */
|
|
68
68
|
labelWidth?: string;
|
|
69
|
+
/** label 标签的title属性 */
|
|
70
|
+
labelTitle?: string;
|
|
69
71
|
className?: string;
|
|
70
72
|
/** 表单组件类型 */
|
|
71
73
|
type?: string | TypeFunction;
|
|
@@ -399,8 +401,8 @@ export interface TimeConfig extends FormItem, Input {
|
|
|
399
401
|
*/
|
|
400
402
|
export interface CheckboxConfig extends FormItem {
|
|
401
403
|
type: 'checkbox';
|
|
402
|
-
activeValue?:
|
|
403
|
-
inactiveValue?:
|
|
404
|
+
activeValue?: number | string;
|
|
405
|
+
inactiveValue?: number | string;
|
|
404
406
|
}
|
|
405
407
|
|
|
406
408
|
/**
|
|
@@ -534,6 +536,8 @@ export interface CascaderConfig extends FormItem, Input {
|
|
|
534
536
|
multiple?: boolean;
|
|
535
537
|
/** 是否严格的遵守父子节点不互相关联,默认 false */
|
|
536
538
|
checkStrictly?: boolean;
|
|
539
|
+
/** 弹出内容的自定义类名 */
|
|
540
|
+
popperClass?: string;
|
|
537
541
|
options?:
|
|
538
542
|
| ((
|
|
539
543
|
mForm: FormState | undefined,
|
package/src/theme/form-box.scss
CHANGED
package/types/Form.vue.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FormConfig, FormState, FormValue } from './schema';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
3
3
|
/** 表单配置 */
|
|
4
4
|
config: FormConfig;
|
|
5
5
|
/** 表单值 */
|
|
@@ -45,7 +45,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
45
45
|
error: (...args: any[]) => void;
|
|
46
46
|
"field-input": (...args: any[]) => void;
|
|
47
47
|
"field-change": (...args: any[]) => void;
|
|
48
|
-
}, string, import("vue").
|
|
48
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
49
49
|
/** 表单配置 */
|
|
50
50
|
config: FormConfig;
|
|
51
51
|
/** 表单值 */
|
|
@@ -92,21 +92,12 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
92
92
|
parentValues: Record<string, any>;
|
|
93
93
|
labelWidth: string;
|
|
94
94
|
disabled: boolean;
|
|
95
|
-
stepActive: string | number;
|
|
96
95
|
height: string;
|
|
96
|
+
stepActive: string | number;
|
|
97
97
|
inline: boolean;
|
|
98
98
|
labelPosition: string;
|
|
99
99
|
}, {}>;
|
|
100
100
|
export default _default;
|
|
101
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
102
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
103
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
104
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
105
|
-
} : {
|
|
106
|
-
type: import('vue').PropType<T[K]>;
|
|
107
|
-
required: true;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
101
|
type __VLS_WithDefaults<P, D> = {
|
|
111
102
|
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
112
103
|
default: D[K];
|
|
@@ -115,3 +106,12 @@ type __VLS_WithDefaults<P, D> = {
|
|
|
115
106
|
type __VLS_Prettify<T> = {
|
|
116
107
|
[K in keyof T]: T[K];
|
|
117
108
|
} & {};
|
|
109
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
110
|
+
type __VLS_TypePropsToOption<T> = {
|
|
111
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
112
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
113
|
+
} : {
|
|
114
|
+
type: import('vue').PropType<T[K]>;
|
|
115
|
+
required: true;
|
|
116
|
+
};
|
|
117
|
+
};
|