@tmagic/form 1.0.0-beta.1 → 1.0.0-beta.4
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 +0 -1
- package/dist/tmagic-form.es.js +29 -25
- package/dist/tmagic-form.es.js.map +1 -1
- package/dist/tmagic-form.umd.js +26 -22
- package/dist/tmagic-form.umd.js.map +1 -1
- package/dist/types/src/Form.vue.d.ts +10 -13
- package/dist/types/src/FormDialog.vue.d.ts +23 -26
- package/dist/types/src/containers/Container.vue.d.ts +1 -1
- package/dist/types/src/containers/Fieldset.vue.d.ts +1 -1
- package/dist/types/src/containers/GroupList.vue.d.ts +1 -1
- package/dist/types/src/containers/GroupListItem.vue.d.ts +1 -1
- package/dist/types/src/containers/Panel.vue.d.ts +1 -1
- package/dist/types/src/containers/Row.vue.d.ts +1 -1
- package/dist/types/src/containers/Step.vue.d.ts +1 -1
- package/dist/types/src/containers/Table.vue.d.ts +7 -5
- package/dist/types/src/containers/Tabs.vue.d.ts +2 -2
- package/dist/types/src/fields/Cascader.vue.d.ts +16 -16
- package/dist/types/src/fields/Checkbox.vue.d.ts +2 -2
- package/dist/types/src/fields/CheckboxGroup.vue.d.ts +2 -2
- package/dist/types/src/fields/Date.vue.d.ts +2 -2
- package/dist/types/src/fields/DateTime.vue.d.ts +2 -2
- package/dist/types/src/fields/Daterange.vue.d.ts +2 -2
- package/dist/types/src/fields/DynamicField.vue.d.ts +2 -2
- package/dist/types/src/fields/Link.vue.d.ts +47 -54
- package/dist/types/src/fields/Number.vue.d.ts +2 -2
- package/dist/types/src/fields/RadioGroup.vue.d.ts +2 -2
- package/dist/types/src/fields/Select.vue.d.ts +12 -12
- package/dist/types/src/fields/Switch.vue.d.ts +2 -2
- package/dist/types/src/fields/Text.vue.d.ts +2 -2
- package/dist/types/src/fields/Textarea.vue.d.ts +2 -2
- package/dist/types/src/fields/Time.vue.d.ts +2 -2
- package/package.json +7 -6
- package/src/Form.vue +33 -29
- package/src/FormDialog.vue +3 -0
- package/src/containers/Table.vue +8 -6
- package/src/containers/Tabs.vue +4 -0
- package/src/theme/table.scss +0 -1
package/dist/tmagic-form.umd.js
CHANGED
|
@@ -1362,6 +1362,8 @@
|
|
|
1362
1362
|
ArrowDown: icons.ArrowDown,
|
|
1363
1363
|
ArrowUp: icons.ArrowUp,
|
|
1364
1364
|
Delete: icons.Delete,
|
|
1365
|
+
FullScreen: icons.FullScreen,
|
|
1366
|
+
Grid: icons.Grid,
|
|
1365
1367
|
data: vue.computed(() => props.model[modelName.value].filter((item, index) => index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value)),
|
|
1366
1368
|
addable: vue.computed(() => {
|
|
1367
1369
|
if (!props.model[modelName.value].length) {
|
|
@@ -1610,7 +1612,7 @@
|
|
|
1610
1612
|
})) : vue.createCommentVNode("", true),
|
|
1611
1613
|
vue.createVNode(_component_el_table_column, {
|
|
1612
1614
|
label: "\u64CD\u4F5C",
|
|
1613
|
-
width: "
|
|
1615
|
+
width: "60",
|
|
1614
1616
|
fixed: _ctx.config.fixed === false ? void 0 : "left"
|
|
1615
1617
|
}, {
|
|
1616
1618
|
default: vue.withCtx((scope) => [
|
|
@@ -1628,7 +1630,7 @@
|
|
|
1628
1630
|
_ctx.sort && _ctx.model[_ctx.modelName] && _ctx.model[_ctx.modelName].length > 1 ? (vue.openBlock(), vue.createBlock(_component_el_table_column, {
|
|
1629
1631
|
key: 1,
|
|
1630
1632
|
label: "\u6392\u5E8F",
|
|
1631
|
-
width: "
|
|
1633
|
+
width: "60"
|
|
1632
1634
|
}, {
|
|
1633
1635
|
default: vue.withCtx((scope) => [
|
|
1634
1636
|
scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1 !== 0 ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
|
|
@@ -1676,7 +1678,7 @@
|
|
|
1676
1678
|
width: "45"
|
|
1677
1679
|
})) : vue.createCommentVNode("", true),
|
|
1678
1680
|
vue.createVNode(_component_el_table_column, {
|
|
1679
|
-
width: "
|
|
1681
|
+
width: "60",
|
|
1680
1682
|
label: "\u5E8F\u53F7"
|
|
1681
1683
|
}, {
|
|
1682
1684
|
default: vue.withCtx((scope) => [
|
|
@@ -1733,7 +1735,7 @@
|
|
|
1733
1735
|
_hoisted_5,
|
|
1734
1736
|
_ctx.enableToggleMode && !_ctx.isFullscreen ? (vue.openBlock(), vue.createBlock(_component_el_button, {
|
|
1735
1737
|
key: 1,
|
|
1736
|
-
icon:
|
|
1738
|
+
icon: _ctx.Grid,
|
|
1737
1739
|
size: "small",
|
|
1738
1740
|
onClick: _ctx.toggleMode
|
|
1739
1741
|
}, {
|
|
@@ -1741,10 +1743,10 @@
|
|
|
1741
1743
|
_hoisted_6
|
|
1742
1744
|
]),
|
|
1743
1745
|
_: 1
|
|
1744
|
-
}, 8, ["onClick"])) : vue.createCommentVNode("", true),
|
|
1746
|
+
}, 8, ["icon", "onClick"])) : vue.createCommentVNode("", true),
|
|
1745
1747
|
_ctx.config.enableFullscreen !== false ? (vue.openBlock(), vue.createBlock(_component_el_button, {
|
|
1746
1748
|
key: 2,
|
|
1747
|
-
icon:
|
|
1749
|
+
icon: _ctx.FullScreen,
|
|
1748
1750
|
size: "small",
|
|
1749
1751
|
onClick: _ctx.toggleFullscreen
|
|
1750
1752
|
}, {
|
|
@@ -1752,7 +1754,7 @@
|
|
|
1752
1754
|
vue.createTextVNode(vue.toDisplayString(_ctx.isFullscreen ? "\u9000\u51FA\u5168\u5C4F" : "\u5168\u5C4F\u7F16\u8F91"), 1)
|
|
1753
1755
|
]),
|
|
1754
1756
|
_: 1
|
|
1755
|
-
}, 8, ["onClick"])) : vue.createCommentVNode("", true),
|
|
1757
|
+
}, 8, ["icon", "onClick"])) : vue.createCommentVNode("", true),
|
|
1756
1758
|
_ctx.importable ? (vue.openBlock(), vue.createBlock(_component_el_upload, {
|
|
1757
1759
|
key: 3,
|
|
1758
1760
|
ref: "excelBtn",
|
|
@@ -1818,6 +1820,7 @@
|
|
|
1818
1820
|
};
|
|
1819
1821
|
const tabClickHandler = (mForm, tab, props) => {
|
|
1820
1822
|
const { config, model, prop } = props;
|
|
1823
|
+
tab.name = tab.paneName;
|
|
1821
1824
|
if (typeof config.onTabClick === "function") {
|
|
1822
1825
|
config.onTabClick(mForm, tab, { model, formValue: mForm?.values, prop });
|
|
1823
1826
|
}
|
|
@@ -3358,7 +3361,6 @@
|
|
|
3358
3361
|
|
|
3359
3362
|
const _sfc_main$1 = vue.defineComponent({
|
|
3360
3363
|
name: "m-form",
|
|
3361
|
-
components: { ElForm: elementPlus.ElForm, MContainer: Container },
|
|
3362
3364
|
props: {
|
|
3363
3365
|
initValues: {
|
|
3364
3366
|
type: Object,
|
|
@@ -3391,8 +3393,7 @@
|
|
|
3391
3393
|
default: () => 1
|
|
3392
3394
|
},
|
|
3393
3395
|
size: {
|
|
3394
|
-
type: String
|
|
3395
|
-
default: "small"
|
|
3396
|
+
type: String
|
|
3396
3397
|
},
|
|
3397
3398
|
inline: {
|
|
3398
3399
|
type: Boolean,
|
|
@@ -3435,8 +3436,10 @@
|
|
|
3435
3436
|
}
|
|
3436
3437
|
});
|
|
3437
3438
|
vue.provide("mForm", formState);
|
|
3438
|
-
vue.
|
|
3439
|
-
|
|
3439
|
+
vue.watch([() => props.config, () => props.initValues], ([config], [preConfig]) => {
|
|
3440
|
+
if (!lodashEs.isEqual(vue.toRaw(config), vue.toRaw(preConfig))) {
|
|
3441
|
+
initialized.value = false;
|
|
3442
|
+
}
|
|
3440
3443
|
initValue(formState, {
|
|
3441
3444
|
initValues: props.initValues,
|
|
3442
3445
|
config: props.config
|
|
@@ -3444,7 +3447,7 @@
|
|
|
3444
3447
|
values.value = value;
|
|
3445
3448
|
initialized.value = true;
|
|
3446
3449
|
});
|
|
3447
|
-
});
|
|
3450
|
+
}, { immediate: true });
|
|
3448
3451
|
return {
|
|
3449
3452
|
initialized,
|
|
3450
3453
|
values,
|
|
@@ -3477,10 +3480,9 @@
|
|
|
3477
3480
|
}
|
|
3478
3481
|
});
|
|
3479
3482
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3480
|
-
const
|
|
3481
|
-
const
|
|
3482
|
-
return
|
|
3483
|
-
key: 0,
|
|
3483
|
+
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
3484
|
+
const _component_el_form = vue.resolveComponent("el-form");
|
|
3485
|
+
return vue.openBlock(), vue.createBlock(_component_el_form, {
|
|
3484
3486
|
class: "m-form",
|
|
3485
3487
|
ref: "elForm",
|
|
3486
3488
|
model: _ctx.values,
|
|
@@ -3491,8 +3493,8 @@
|
|
|
3491
3493
|
"label-position": _ctx.labelPosition
|
|
3492
3494
|
}, {
|
|
3493
3495
|
default: vue.withCtx(() => [
|
|
3494
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment,
|
|
3495
|
-
return vue.openBlock(), vue.createBlock(
|
|
3496
|
+
_ctx.initialized && Array.isArray(_ctx.config) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.config, (item, index) => {
|
|
3497
|
+
return vue.openBlock(), vue.createBlock(_component_m_form_container, {
|
|
3496
3498
|
key: item[_ctx.keyProp] ?? index,
|
|
3497
3499
|
config: item,
|
|
3498
3500
|
model: _ctx.values,
|
|
@@ -3501,10 +3503,10 @@
|
|
|
3501
3503
|
size: _ctx.size,
|
|
3502
3504
|
onChange: _ctx.changeHandler
|
|
3503
3505
|
}, null, 8, ["config", "model", "label-width", "step-active", "size", "onChange"]);
|
|
3504
|
-
}), 128))
|
|
3506
|
+
}), 128)) : vue.createCommentVNode("", true)
|
|
3505
3507
|
]),
|
|
3506
3508
|
_: 1
|
|
3507
|
-
}, 8, ["model", "label-width", "disabled", "style", "inline", "label-position"])
|
|
3509
|
+
}, 8, ["model", "label-width", "disabled", "style", "inline", "label-position"]);
|
|
3508
3510
|
}
|
|
3509
3511
|
var Form = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
3510
3512
|
|
|
@@ -3524,6 +3526,7 @@
|
|
|
3524
3526
|
default: () => []
|
|
3525
3527
|
},
|
|
3526
3528
|
labelWidth: [Number, String],
|
|
3529
|
+
size: String,
|
|
3527
3530
|
confirmText: {
|
|
3528
3531
|
type: String,
|
|
3529
3532
|
default: "\u786E\u5B9A"
|
|
@@ -3694,11 +3697,12 @@
|
|
|
3694
3697
|
modelValue: _ctx.stepActive,
|
|
3695
3698
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.stepActive = $event),
|
|
3696
3699
|
ref: "form",
|
|
3700
|
+
size: _ctx.size,
|
|
3697
3701
|
config: _ctx.config,
|
|
3698
3702
|
"init-values": _ctx.values,
|
|
3699
3703
|
"label-width": _ctx.labelWidth,
|
|
3700
3704
|
onChange: _ctx.changeHandler
|
|
3701
|
-
}, null, 8, ["modelValue", "config", "init-values", "label-width", "onChange"]),
|
|
3705
|
+
}, null, 8, ["modelValue", "size", "config", "init-values", "label-width", "onChange"]),
|
|
3702
3706
|
vue.renderSlot(_ctx.$slots, "default")
|
|
3703
3707
|
], 4)
|
|
3704
3708
|
]),
|