@tmagic/form 1.3.4 → 1.3.6
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/tmagic-form.js +24 -20
- package/dist/tmagic-form.js.map +1 -1
- package/dist/tmagic-form.umd.cjs +24 -20
- package/dist/tmagic-form.umd.cjs.map +1 -1
- package/package.json +9 -9
- package/src/containers/Container.vue +1 -0
- package/src/fields/Cascader.vue +6 -2
- package/types/Form.vue.d.ts +5 -1
- package/types/FormBox.vue.d.ts +14 -6
- package/types/FormDialog.vue.d.ts +15 -6
- package/types/FormDrawer.vue.d.ts +18 -6
- package/types/containers/Col.vue.d.ts +4 -1
- package/types/containers/Container.vue.d.ts +4 -1
- package/types/containers/Fieldset.vue.d.ts +4 -1
- package/types/containers/GroupList.vue.d.ts +4 -1
- package/types/containers/GroupListItem.vue.d.ts +6 -1
- package/types/containers/Panel.vue.d.ts +4 -1
- package/types/containers/Row.vue.d.ts +4 -1
- package/types/containers/Step.vue.d.ts +4 -1
- package/types/containers/Table.vue.d.ts +8 -4
- package/types/containers/Tabs.vue.d.ts +4 -1
- package/types/fields/Cascader.vue.d.ts +3 -1
- package/types/fields/Checkbox.vue.d.ts +3 -1
- package/types/fields/CheckboxGroup.vue.d.ts +3 -1
- package/types/fields/ColorPicker.vue.d.ts +5 -1
- package/types/fields/Date.vue.d.ts +5 -1
- package/types/fields/DateTime.vue.d.ts +5 -1
- package/types/fields/Daterange.vue.d.ts +3 -1
- package/types/fields/DynamicField.vue.d.ts +3 -1
- package/types/fields/Link.vue.d.ts +3 -1
- package/types/fields/Number.vue.d.ts +7 -1
- package/types/fields/NumberRange.vue.d.ts +5 -1
- package/types/fields/RadioGroup.vue.d.ts +3 -1
- package/types/fields/Select.vue.d.ts +3 -1
- package/types/fields/Switch.vue.d.ts +5 -1
- package/types/fields/Text.vue.d.ts +7 -1
- package/types/fields/Textarea.vue.d.ts +7 -1
- package/types/fields/Time.vue.d.ts +5 -1
- package/types/fields/Timerange.vue.d.ts +3 -1
package/dist/tmagic-form.js
CHANGED
|
@@ -166,7 +166,7 @@ const initValue = async (mForm, { initValues, config }) => {
|
|
|
166
166
|
return valuesTmp || {};
|
|
167
167
|
};
|
|
168
168
|
|
|
169
|
-
const _hoisted_1$e = ["
|
|
169
|
+
const _hoisted_1$e = ["id"];
|
|
170
170
|
const _hoisted_2$8 = ["innerHTML"];
|
|
171
171
|
const _hoisted_3$4 = ["innerHTML"];
|
|
172
172
|
const _hoisted_4$4 = ["innerHTML"];
|
|
@@ -178,7 +178,8 @@ const _hoisted_9 = ["innerHTML"];
|
|
|
178
178
|
const _hoisted_10 = ["innerHTML"];
|
|
179
179
|
const _hoisted_11 = ["innerHTML"];
|
|
180
180
|
const _hoisted_12 = ["innerHTML"];
|
|
181
|
-
const _hoisted_13 =
|
|
181
|
+
const _hoisted_13 = ["innerHTML"];
|
|
182
|
+
const _hoisted_14 = {
|
|
182
183
|
key: 5,
|
|
183
184
|
style: { "text-align": "center" }
|
|
184
185
|
};
|
|
@@ -331,6 +332,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
331
332
|
const _component_Container = resolveComponent("Container", true);
|
|
332
333
|
return _ctx.config ? (openBlock(), createElementBlock("div", {
|
|
333
334
|
key: 0,
|
|
335
|
+
id: _ctx.config.id,
|
|
334
336
|
style: normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
|
|
335
337
|
class: normalizeClass(`m-form-container m-container-${type.value || ""} ${_ctx.config.className || ""}`)
|
|
336
338
|
}, [
|
|
@@ -367,12 +369,12 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
367
369
|
label: withCtx(() => [
|
|
368
370
|
createElementVNode("span", {
|
|
369
371
|
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
370
|
-
}, null, 8,
|
|
372
|
+
}, null, 8, _hoisted_2$8)
|
|
371
373
|
]),
|
|
372
374
|
default: withCtx(() => [
|
|
373
375
|
tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
|
|
374
376
|
content: withCtx(() => [
|
|
375
|
-
createElementVNode("div", { innerHTML: tooltip.value }, null, 8,
|
|
377
|
+
createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_3$4)
|
|
376
378
|
]),
|
|
377
379
|
default: withCtx(() => [
|
|
378
380
|
(openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
@@ -405,7 +407,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
405
407
|
key: 2,
|
|
406
408
|
innerHTML: extra.value,
|
|
407
409
|
class: "m-form-tip"
|
|
408
|
-
}, null, 8,
|
|
410
|
+
}, null, 8, _hoisted_4$4)) : createCommentVNode("", true)
|
|
409
411
|
]),
|
|
410
412
|
_: 1
|
|
411
413
|
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
@@ -416,7 +418,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
416
418
|
content: withCtx(() => [
|
|
417
419
|
createElementVNode("div", {
|
|
418
420
|
innerHTML: _ctx.config.tip
|
|
419
|
-
}, null, 8,
|
|
421
|
+
}, null, 8, _hoisted_5$4)
|
|
420
422
|
]),
|
|
421
423
|
default: withCtx(() => [
|
|
422
424
|
createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -439,12 +441,12 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
439
441
|
label: withCtx(() => [
|
|
440
442
|
createElementVNode("span", {
|
|
441
443
|
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
442
|
-
}, null, 8,
|
|
444
|
+
}, null, 8, _hoisted_6$1)
|
|
443
445
|
]),
|
|
444
446
|
default: withCtx(() => [
|
|
445
447
|
tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
|
|
446
448
|
content: withCtx(() => [
|
|
447
|
-
createElementVNode("div", { innerHTML: tooltip.value }, null, 8,
|
|
449
|
+
createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_7$1)
|
|
448
450
|
]),
|
|
449
451
|
default: withCtx(() => [
|
|
450
452
|
(openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
@@ -473,7 +475,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
473
475
|
key: 2,
|
|
474
476
|
innerHTML: extra.value,
|
|
475
477
|
class: "m-form-tip"
|
|
476
|
-
}, null, 8,
|
|
478
|
+
}, null, 8, _hoisted_8$1)) : createCommentVNode("", true)
|
|
477
479
|
]),
|
|
478
480
|
_: 1
|
|
479
481
|
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
@@ -484,7 +486,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
484
486
|
content: withCtx(() => [
|
|
485
487
|
createElementVNode("div", {
|
|
486
488
|
innerHTML: _ctx.config.tip
|
|
487
|
-
}, null, 8,
|
|
489
|
+
}, null, 8, _hoisted_9)
|
|
488
490
|
]),
|
|
489
491
|
default: withCtx(() => [
|
|
490
492
|
createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -506,12 +508,12 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
506
508
|
label: withCtx(() => [
|
|
507
509
|
createElementVNode("span", {
|
|
508
510
|
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
509
|
-
}, null, 8,
|
|
511
|
+
}, null, 8, _hoisted_10)
|
|
510
512
|
]),
|
|
511
513
|
default: withCtx(() => [
|
|
512
514
|
tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
|
|
513
515
|
content: withCtx(() => [
|
|
514
|
-
createElementVNode("div", { innerHTML: tooltip.value }, null, 8,
|
|
516
|
+
createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_11)
|
|
515
517
|
]),
|
|
516
518
|
default: withCtx(() => [
|
|
517
519
|
(openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
@@ -540,7 +542,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
540
542
|
key: 2,
|
|
541
543
|
innerHTML: extra.value,
|
|
542
544
|
class: "m-form-tip"
|
|
543
|
-
}, null, 8,
|
|
545
|
+
}, null, 8, _hoisted_12)) : createCommentVNode("", true)
|
|
544
546
|
]),
|
|
545
547
|
_: 1
|
|
546
548
|
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
@@ -551,7 +553,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
551
553
|
content: withCtx(() => [
|
|
552
554
|
createElementVNode("div", {
|
|
553
555
|
innerHTML: _ctx.config.tip
|
|
554
|
-
}, null, 8,
|
|
556
|
+
}, null, 8, _hoisted_13)
|
|
555
557
|
]),
|
|
556
558
|
default: withCtx(() => [
|
|
557
559
|
createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -582,7 +584,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
582
584
|
}, null, 8, ["model", "last-values", "is-compare", "config", "size", "disabled", "step-active", "expand-more", "label-width", "prop"]);
|
|
583
585
|
}), 128)) : createCommentVNode("", true)
|
|
584
586
|
], 64)) : createCommentVNode("", true),
|
|
585
|
-
_ctx.config.expand && type.value !== "fieldset" ? (openBlock(), createElementBlock("div",
|
|
587
|
+
_ctx.config.expand && type.value !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_14, [
|
|
586
588
|
createVNode(unref(TMagicButton), {
|
|
587
589
|
type: "primary",
|
|
588
590
|
size: "small",
|
|
@@ -596,7 +598,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
596
598
|
_: 1
|
|
597
599
|
})
|
|
598
600
|
])) : createCommentVNode("", true)
|
|
599
|
-
],
|
|
601
|
+
], 14, _hoisted_1$e)) : createCommentVNode("", true);
|
|
600
602
|
};
|
|
601
603
|
}
|
|
602
604
|
});
|
|
@@ -2175,7 +2177,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
2175
2177
|
useAddField(props.prop);
|
|
2176
2178
|
const requestFunc = getConfig("request");
|
|
2177
2179
|
const tMagicCascader = ref();
|
|
2178
|
-
const options =
|
|
2180
|
+
const options = ref([]);
|
|
2179
2181
|
const remoteData = ref(null);
|
|
2180
2182
|
const setRemoteOptions = async function() {
|
|
2181
2183
|
const { config } = props;
|
|
@@ -2212,6 +2214,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
2212
2214
|
);
|
|
2213
2215
|
} else if (!props.config.options?.length || props.config.remote) {
|
|
2214
2216
|
Promise.resolve(setRemoteOptions());
|
|
2217
|
+
} else if (Array.isArray(props.config.options)) {
|
|
2218
|
+
watchEffect(() => {
|
|
2219
|
+
options.value = props.config.options;
|
|
2220
|
+
});
|
|
2215
2221
|
}
|
|
2216
2222
|
const changeHandler = (value) => {
|
|
2217
2223
|
if (!tMagicCascader.value)
|
|
@@ -2232,7 +2238,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
2232
2238
|
size: _ctx.size,
|
|
2233
2239
|
placeholder: _ctx.config.placeholder,
|
|
2234
2240
|
disabled: _ctx.disabled,
|
|
2235
|
-
options:
|
|
2241
|
+
options: options.value,
|
|
2236
2242
|
props: {
|
|
2237
2243
|
multiple: _ctx.config.multiple ?? false,
|
|
2238
2244
|
emitPath: _ctx.config.emitPath ?? true,
|
|
@@ -4140,8 +4146,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4140
4146
|
}
|
|
4141
4147
|
});
|
|
4142
4148
|
|
|
4143
|
-
const index$1 = '';
|
|
4144
|
-
|
|
4145
4149
|
const _hoisted_1$1 = { style: { "min-height": "1px" } };
|
|
4146
4150
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
4147
4151
|
...{
|