@tmagic/form 1.7.0-beta.3 → 1.7.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/tmagic-form.js +330 -138
- package/dist/tmagic-form.umd.cjs +327 -135
- package/package.json +9 -9
- package/src/FormDialog.vue +15 -2
- package/src/containers/Container.vue +35 -8
- package/src/containers/FormLabel.vue +26 -0
- package/src/containers/GroupList.vue +4 -3
- package/src/containers/Panel.vue +12 -1
- package/src/fields/Number.vue +15 -3
- package/src/fields/NumberRange.vue +21 -4
- package/src/fields/Text.vue +14 -2
- package/src/fields/Textarea.vue +15 -3
- package/src/table/Table.vue +11 -3
- package/src/table/useSortable.ts +1 -1
- package/src/table/useTableColumns.ts +59 -4
- package/src/utils/form.ts +1 -1
- package/types/index.d.ts +14 -1
package/dist/tmagic-form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { toRaw, defineComponent,
|
|
2
|
-
import { WarningFilled, CaretBottom, CaretRight, Delete, DocumentCopy, CaretTop, Position, Grid, ArrowUp, ArrowDown, FullScreen } from '@element-plus/icons-vue';
|
|
1
|
+
import { toRaw, defineComponent, createElementBlock, openBlock, createElementVNode, createBlock, createCommentVNode, unref, withCtx, createVNode, inject, ref, computed, watchEffect, watch, resolveComponent, normalizeStyle, normalizeClass, mergeProps, resolveDynamicComponent, Fragment, renderList, createTextVNode, toDisplayString, readonly, withDirectives, vShow, renderSlot, getCurrentInstance, createSlots, onUnmounted, reactive, onBeforeUnmount, vModelText, useTemplateRef, provide, shallowRef, onBeforeMount, nextTick, resolveDirective, withModifiers, Teleport, h } from 'vue';
|
|
2
|
+
import { WarningFilled, CaretBottom, CaretRight, Delete, DocumentCopy, CaretTop, Position, Grid, Plus, ArrowUp, ArrowDown, FullScreen } from '@element-plus/icons-vue';
|
|
3
3
|
import { cloneDeep, isEqual, isEmpty, debounce } from 'lodash-es';
|
|
4
|
-
import {
|
|
4
|
+
import { TMagicTooltip, TMagicIcon, TMagicFormItem, TMagicButton, TMagicCheckbox, TMagicCard, TMagicPopover, TMagicInputNumber, TMagicCol, TMagicRow, TMagicSteps, TMagicStep, getDesignConfig, TMagicBadge, TMagicCascader, TMagicCheckboxGroup, TMagicColorPicker, TMagicDatePicker, TMagicForm, TMagicInput, tMagicMessage, tMagicMessageBox, TMagicDialog, TMagicRadioButton, TMagicRadio, TMagicRadioGroup, TMagicSelect, TMagicSwitch, TMagicTimePicker, useZIndex, TMagicTable, TMagicUpload, TMagicPagination, TMagicDrawer, TMagicScrollbar } from '@tmagic/design';
|
|
5
5
|
import { getValueByKeyPath, setValueByKeyPath, isNumber, asyncLoadJs } from '@tmagic/utils';
|
|
6
6
|
import dayjs from 'dayjs';
|
|
7
7
|
import utc from 'dayjs/plugin/utc';
|
|
@@ -215,7 +215,7 @@ const sortArray = (data, newIndex, oldIndex, sortKey) => {
|
|
|
215
215
|
newData[v][sortKey] = i;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
return newData;
|
|
218
|
+
return cloneDeep(newData);
|
|
219
219
|
};
|
|
220
220
|
const sortChange = (data, { prop, order }) => {
|
|
221
221
|
if (order === "ascending") {
|
|
@@ -225,17 +225,65 @@ const sortChange = (data, { prop, order }) => {
|
|
|
225
225
|
}
|
|
226
226
|
};
|
|
227
227
|
|
|
228
|
+
const _hoisted_1$e = {
|
|
229
|
+
key: 0,
|
|
230
|
+
style: { "display": "inline-flex", "align-items": "center" }
|
|
231
|
+
};
|
|
232
|
+
const _hoisted_2$8 = ["innerHTML", "title"];
|
|
233
|
+
const _hoisted_3$6 = ["innerHTML"];
|
|
234
|
+
const _hoisted_4$5 = ["innerHTML", "title"];
|
|
235
|
+
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
236
|
+
__name: "FormLabel",
|
|
237
|
+
props: {
|
|
238
|
+
tip: {},
|
|
239
|
+
type: {},
|
|
240
|
+
useLabel: { type: Boolean },
|
|
241
|
+
text: {},
|
|
242
|
+
labelTitle: {}
|
|
243
|
+
},
|
|
244
|
+
setup(__props) {
|
|
245
|
+
return (_ctx, _cache) => {
|
|
246
|
+
return __props.tip ? (openBlock(), createElementBlock("span", _hoisted_1$e, [
|
|
247
|
+
createElementVNode("span", {
|
|
248
|
+
innerHTML: __props.type === "checkbox" && !__props.useLabel ? "" : __props.text,
|
|
249
|
+
title: __props.labelTitle
|
|
250
|
+
}, null, 8, _hoisted_2$8),
|
|
251
|
+
__props.tip && (__props.type !== "checkbox" || __props.useLabel) ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
252
|
+
key: 0,
|
|
253
|
+
placement: "top"
|
|
254
|
+
}, {
|
|
255
|
+
content: withCtx(() => [
|
|
256
|
+
createElementVNode("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$6)
|
|
257
|
+
]),
|
|
258
|
+
default: withCtx(() => [
|
|
259
|
+
createVNode(unref(TMagicIcon), { style: { "margin-left": "5px", "display": "flex" } }, {
|
|
260
|
+
default: withCtx(() => [
|
|
261
|
+
createVNode(unref(WarningFilled))
|
|
262
|
+
]),
|
|
263
|
+
_: 1
|
|
264
|
+
/* STABLE */
|
|
265
|
+
})
|
|
266
|
+
]),
|
|
267
|
+
_: 1
|
|
268
|
+
/* STABLE */
|
|
269
|
+
})) : createCommentVNode("v-if", true)
|
|
270
|
+
])) : (openBlock(), createElementBlock("span", {
|
|
271
|
+
key: 1,
|
|
272
|
+
innerHTML: __props.type === "checkbox" && !__props.useLabel ? "" : __props.text,
|
|
273
|
+
title: __props.labelTitle
|
|
274
|
+
}, null, 8, _hoisted_4$5));
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
|
|
228
279
|
const _hoisted_1$d = ["data-tmagic-id", "data-tmagic-form-item-prop"];
|
|
229
|
-
const _hoisted_2$7 = ["innerHTML"
|
|
280
|
+
const _hoisted_2$7 = ["innerHTML"];
|
|
230
281
|
const _hoisted_3$5 = ["innerHTML"];
|
|
231
282
|
const _hoisted_4$4 = ["innerHTML"];
|
|
232
|
-
const _hoisted_5$3 = ["innerHTML"
|
|
283
|
+
const _hoisted_5$3 = ["innerHTML"];
|
|
233
284
|
const _hoisted_6$1 = ["innerHTML"];
|
|
234
285
|
const _hoisted_7$1 = ["innerHTML"];
|
|
235
|
-
const _hoisted_8$1 =
|
|
236
|
-
const _hoisted_9 = ["innerHTML"];
|
|
237
|
-
const _hoisted_10 = ["innerHTML"];
|
|
238
|
-
const _hoisted_11 = {
|
|
286
|
+
const _hoisted_8$1 = {
|
|
239
287
|
key: 5,
|
|
240
288
|
style: { "text-align": "center" }
|
|
241
289
|
};
|
|
@@ -482,10 +530,13 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
482
530
|
class: { "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value }
|
|
483
531
|
}), {
|
|
484
532
|
label: withCtx(() => [
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
533
|
+
createVNode(_sfc_main$B, {
|
|
534
|
+
tip: __props.config.tip,
|
|
535
|
+
type: type.value,
|
|
536
|
+
"use-label": __props.config.useLabel,
|
|
537
|
+
"label-title": __props.config.labelTitle,
|
|
538
|
+
text: text.value
|
|
539
|
+
}, null, 8, ["tip", "type", "use-label", "label-title", "text"])
|
|
489
540
|
]),
|
|
490
541
|
default: withCtx(() => [
|
|
491
542
|
tooltip.value.text ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
@@ -495,36 +546,38 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
495
546
|
content: withCtx(() => [
|
|
496
547
|
createElementVNode("div", {
|
|
497
548
|
innerHTML: tooltip.value.text
|
|
498
|
-
}, null, 8,
|
|
549
|
+
}, null, 8, _hoisted_2$7)
|
|
499
550
|
]),
|
|
500
551
|
default: withCtx(() => [
|
|
501
552
|
(openBlock(), createBlock(resolveDynamicComponent(tagName.value), mergeProps(fieldsProps.value, {
|
|
502
553
|
model: __props.model,
|
|
503
554
|
"last-values": __props.lastValues,
|
|
555
|
+
"is-compare": __props.isCompare,
|
|
504
556
|
onChange: onChangeHandler,
|
|
505
557
|
onAddDiffCount
|
|
506
|
-
}), null, 16, ["model", "last-values"]))
|
|
558
|
+
}), null, 16, ["model", "last-values", "is-compare"]))
|
|
507
559
|
]),
|
|
508
560
|
_: 1
|
|
509
561
|
/* STABLE */
|
|
510
562
|
}, 8, ["placement"])) : (openBlock(), createBlock(resolveDynamicComponent(tagName.value), mergeProps({ key: 1 }, fieldsProps.value, {
|
|
511
563
|
model: __props.model,
|
|
512
564
|
"last-values": __props.lastValues,
|
|
565
|
+
"is-compare": __props.isCompare,
|
|
513
566
|
onChange: onChangeHandler,
|
|
514
567
|
onAddDiffCount
|
|
515
|
-
}), null, 16, ["model", "last-values"]))
|
|
568
|
+
}), null, 16, ["model", "last-values", "is-compare"]))
|
|
516
569
|
]),
|
|
517
570
|
_: 1
|
|
518
571
|
/* STABLE */
|
|
519
572
|
}, 16, ["class"]),
|
|
520
|
-
__props.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
573
|
+
__props.config.tip && type.value === "checkbox" && !__props.config.useLabel ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
521
574
|
key: 0,
|
|
522
|
-
placement: "
|
|
575
|
+
placement: "top"
|
|
523
576
|
}, {
|
|
524
577
|
content: withCtx(() => [
|
|
525
578
|
createElementVNode("div", {
|
|
526
579
|
innerHTML: __props.config.tip
|
|
527
|
-
}, null, 8,
|
|
580
|
+
}, null, 8, _hoisted_3$5)
|
|
528
581
|
]),
|
|
529
582
|
default: withCtx(() => [
|
|
530
583
|
createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -551,10 +604,13 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
551
604
|
class: { "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value, "show-diff": true }
|
|
552
605
|
}), {
|
|
553
606
|
label: withCtx(() => [
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
607
|
+
createVNode(_sfc_main$B, {
|
|
608
|
+
tip: __props.config.tip,
|
|
609
|
+
type: type.value,
|
|
610
|
+
"use-label": __props.config.useLabel,
|
|
611
|
+
"label-title": __props.config.labelTitle,
|
|
612
|
+
text: text.value
|
|
613
|
+
}, null, 8, ["tip", "type", "use-label", "label-title", "text"])
|
|
558
614
|
]),
|
|
559
615
|
default: withCtx(() => [
|
|
560
616
|
tooltip.value.text ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
@@ -564,7 +620,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
564
620
|
content: withCtx(() => [
|
|
565
621
|
createElementVNode("div", {
|
|
566
622
|
innerHTML: tooltip.value.text
|
|
567
|
-
}, null, 8,
|
|
623
|
+
}, null, 8, _hoisted_4$4)
|
|
568
624
|
]),
|
|
569
625
|
default: withCtx(() => [
|
|
570
626
|
(openBlock(), createBlock(resolveDynamicComponent(tagName.value), mergeProps(fieldsProps.value, {
|
|
@@ -582,14 +638,14 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
582
638
|
_: 1
|
|
583
639
|
/* STABLE */
|
|
584
640
|
}, 16, ["class"]),
|
|
585
|
-
__props.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
641
|
+
__props.config.tip && type.value === "checkbox" && !__props.config.useLabel ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
586
642
|
key: 0,
|
|
587
|
-
placement: "
|
|
643
|
+
placement: "top"
|
|
588
644
|
}, {
|
|
589
645
|
content: withCtx(() => [
|
|
590
646
|
createElementVNode("div", {
|
|
591
647
|
innerHTML: __props.config.tip
|
|
592
|
-
}, null, 8,
|
|
648
|
+
}, null, 8, _hoisted_5$3)
|
|
593
649
|
]),
|
|
594
650
|
default: withCtx(() => [
|
|
595
651
|
createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -609,10 +665,13 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
609
665
|
class: { "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value, "show-diff": true }
|
|
610
666
|
}), {
|
|
611
667
|
label: withCtx(() => [
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
668
|
+
createVNode(_sfc_main$B, {
|
|
669
|
+
tip: __props.config.tip,
|
|
670
|
+
type: type.value,
|
|
671
|
+
"use-label": __props.config.useLabel,
|
|
672
|
+
"label-title": __props.config.labelTitle,
|
|
673
|
+
text: text.value
|
|
674
|
+
}, null, 8, ["tip", "type", "use-label", "label-title", "text"])
|
|
616
675
|
]),
|
|
617
676
|
default: withCtx(() => [
|
|
618
677
|
tooltip.value.text ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
@@ -622,7 +681,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
622
681
|
content: withCtx(() => [
|
|
623
682
|
createElementVNode("div", {
|
|
624
683
|
innerHTML: tooltip.value.text
|
|
625
|
-
}, null, 8,
|
|
684
|
+
}, null, 8, _hoisted_6$1)
|
|
626
685
|
]),
|
|
627
686
|
default: withCtx(() => [
|
|
628
687
|
(openBlock(), createBlock(resolveDynamicComponent(tagName.value), mergeProps(fieldsProps.value, {
|
|
@@ -640,14 +699,14 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
640
699
|
_: 1
|
|
641
700
|
/* STABLE */
|
|
642
701
|
}, 16, ["style", "class"]),
|
|
643
|
-
__props.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
702
|
+
__props.config.tip && type.value === "checkbox" && !__props.config.useLabel ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
644
703
|
key: 1,
|
|
645
|
-
placement: "
|
|
704
|
+
placement: "top"
|
|
646
705
|
}, {
|
|
647
706
|
content: withCtx(() => [
|
|
648
707
|
createElementVNode("div", {
|
|
649
708
|
innerHTML: __props.config.tip
|
|
650
|
-
}, null, 8,
|
|
709
|
+
}, null, 8, _hoisted_7$1)
|
|
651
710
|
]),
|
|
652
711
|
default: withCtx(() => [
|
|
653
712
|
createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -695,7 +754,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
695
754
|
64
|
|
696
755
|
/* STABLE_FRAGMENT */
|
|
697
756
|
)) : createCommentVNode("v-if", true),
|
|
698
|
-
__props.config.expand && type.value !== "fieldset" ? (openBlock(), createElementBlock("div",
|
|
757
|
+
__props.config.expand && type.value !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_8$1, [
|
|
699
758
|
createVNode(unref(TMagicButton), {
|
|
700
759
|
type: "primary",
|
|
701
760
|
size: "small",
|
|
@@ -1408,23 +1467,24 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
1408
1467
|
/* STABLE */
|
|
1409
1468
|
}, 8, ["icon"])) : createCommentVNode("v-if", true),
|
|
1410
1469
|
createElementVNode("div", _hoisted_5$1, [
|
|
1411
|
-
addable.value ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
1470
|
+
addable.value ? (openBlock(), createBlock(unref(TMagicButton), mergeProps({
|
|
1412
1471
|
key: 0,
|
|
1413
|
-
type: "primary",
|
|
1414
1472
|
size: __props.config.enableToggleMode ? "small" : "default",
|
|
1473
|
+
icon: unref(Plus)
|
|
1474
|
+
}, __props.config.addButtonConfig?.props || { type: "primary" }, {
|
|
1415
1475
|
disabled: __props.disabled,
|
|
1416
1476
|
onClick: addHandler
|
|
1417
|
-
}, {
|
|
1418
|
-
default: withCtx(() => [
|
|
1477
|
+
}), {
|
|
1478
|
+
default: withCtx(() => [
|
|
1419
1479
|
createTextVNode(
|
|
1420
|
-
"新增",
|
|
1421
|
-
|
|
1422
|
-
/*
|
|
1480
|
+
toDisplayString(__props.config.addButtonConfig?.text || "新增"),
|
|
1481
|
+
1
|
|
1482
|
+
/* TEXT */
|
|
1423
1483
|
)
|
|
1424
|
-
])
|
|
1484
|
+
]),
|
|
1425
1485
|
_: 1
|
|
1426
1486
|
/* STABLE */
|
|
1427
|
-
},
|
|
1487
|
+
}, 16, ["size", "icon", "disabled"])) : createCommentVNode("v-if", true)
|
|
1428
1488
|
])
|
|
1429
1489
|
])
|
|
1430
1490
|
]);
|
|
@@ -1457,7 +1517,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
1457
1517
|
disabled: { type: Boolean }
|
|
1458
1518
|
},
|
|
1459
1519
|
emits: ["change", "addDiffCount"],
|
|
1460
|
-
setup(__props, { emit: __emit }) {
|
|
1520
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1461
1521
|
const props = __props;
|
|
1462
1522
|
const emit = __emit;
|
|
1463
1523
|
const mForm = inject("mForm");
|
|
@@ -1468,6 +1528,12 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
1468
1528
|
emit("change", props.model, eventData);
|
|
1469
1529
|
};
|
|
1470
1530
|
const onAddDiffCount = () => emit("addDiffCount");
|
|
1531
|
+
__expose({
|
|
1532
|
+
getExpand: () => expand.value,
|
|
1533
|
+
setExpand: (v) => {
|
|
1534
|
+
expand.value = v;
|
|
1535
|
+
}
|
|
1536
|
+
});
|
|
1471
1537
|
return (_ctx, _cache) => {
|
|
1472
1538
|
return items.value && items.value.length ? (openBlock(), createBlock(unref(TMagicCard), {
|
|
1473
1539
|
key: 0,
|
|
@@ -1482,18 +1548,23 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
1482
1548
|
icon: expand.value ? unref(CaretBottom) : unref(CaretRight),
|
|
1483
1549
|
onClick: _cache[0] || (_cache[0] = ($event) => expand.value = !expand.value)
|
|
1484
1550
|
}, null, 8, ["icon"]),
|
|
1485
|
-
__props.config && __props.config.extra ? (openBlock(), createElementBlock("span", {
|
|
1486
|
-
key: 0,
|
|
1487
|
-
innerHTML: __props.config.extra,
|
|
1488
|
-
class: "m-form-tip"
|
|
1489
|
-
}, null, 8, _hoisted_2$3)) : createCommentVNode("v-if", true),
|
|
1490
1551
|
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
1491
|
-
|
|
1552
|
+
createElementVNode(
|
|
1553
|
+
"span",
|
|
1554
|
+
{
|
|
1555
|
+
style: { "cursor": "pointer" },
|
|
1556
|
+
onClick: _cache[1] || (_cache[1] = ($event) => expand.value = !expand.value)
|
|
1557
|
+
},
|
|
1492
1558
|
toDisplayString(filter(__props.config.title)),
|
|
1493
1559
|
1
|
|
1494
1560
|
/* TEXT */
|
|
1495
1561
|
)
|
|
1496
|
-
])
|
|
1562
|
+
]),
|
|
1563
|
+
__props.config && __props.config.extra ? (openBlock(), createElementBlock("span", {
|
|
1564
|
+
key: 0,
|
|
1565
|
+
innerHTML: __props.config.extra,
|
|
1566
|
+
class: "m-form-tip"
|
|
1567
|
+
}, null, 8, _hoisted_2$3)) : createCommentVNode("v-if", true)
|
|
1497
1568
|
])
|
|
1498
1569
|
]),
|
|
1499
1570
|
default: withCtx(() => [
|
|
@@ -1516,7 +1587,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
1516
1587
|
disabled: __props.disabled,
|
|
1517
1588
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
1518
1589
|
onChange: changeHandler,
|
|
1519
|
-
onAddDiffCount: _cache[
|
|
1590
|
+
onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
|
|
1520
1591
|
}, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
|
|
1521
1592
|
}),
|
|
1522
1593
|
128
|
|
@@ -1542,7 +1613,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
1542
1613
|
disabled: __props.disabled,
|
|
1543
1614
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
1544
1615
|
onChange: changeHandler,
|
|
1545
|
-
onAddDiffCount: _cache[
|
|
1616
|
+
onAddDiffCount: _cache[3] || (_cache[3] = ($event) => onAddDiffCount())
|
|
1546
1617
|
}, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
|
|
1547
1618
|
}),
|
|
1548
1619
|
128
|
|
@@ -2036,7 +2107,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
2036
2107
|
prop: {},
|
|
2037
2108
|
disabled: { type: Boolean },
|
|
2038
2109
|
size: {},
|
|
2039
|
-
lastValues: {}
|
|
2110
|
+
lastValues: {},
|
|
2111
|
+
isCompare: { type: Boolean }
|
|
2040
2112
|
},
|
|
2041
2113
|
emits: ["change"],
|
|
2042
2114
|
setup(__props, { emit: __emit }) {
|
|
@@ -2163,7 +2235,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
2163
2235
|
prop: {},
|
|
2164
2236
|
disabled: { type: Boolean },
|
|
2165
2237
|
size: {},
|
|
2166
|
-
lastValues: {}
|
|
2238
|
+
lastValues: {},
|
|
2239
|
+
isCompare: { type: Boolean }
|
|
2167
2240
|
},
|
|
2168
2241
|
emits: ["change"],
|
|
2169
2242
|
setup(__props, { emit: __emit }) {
|
|
@@ -2235,7 +2308,8 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
2235
2308
|
prop: {},
|
|
2236
2309
|
disabled: { type: Boolean },
|
|
2237
2310
|
size: {},
|
|
2238
|
-
lastValues: {}
|
|
2311
|
+
lastValues: {},
|
|
2312
|
+
isCompare: { type: Boolean }
|
|
2239
2313
|
},
|
|
2240
2314
|
emits: ["change"],
|
|
2241
2315
|
setup(__props, { emit: __emit }) {
|
|
@@ -2308,7 +2382,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
2308
2382
|
prop: {},
|
|
2309
2383
|
disabled: { type: Boolean },
|
|
2310
2384
|
size: {},
|
|
2311
|
-
lastValues: {}
|
|
2385
|
+
lastValues: {},
|
|
2386
|
+
isCompare: { type: Boolean }
|
|
2312
2387
|
},
|
|
2313
2388
|
emits: ["change"],
|
|
2314
2389
|
setup(__props, { emit: __emit }) {
|
|
@@ -2342,7 +2417,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
2342
2417
|
prop: {},
|
|
2343
2418
|
disabled: { type: Boolean },
|
|
2344
2419
|
size: {},
|
|
2345
|
-
lastValues: {}
|
|
2420
|
+
lastValues: {},
|
|
2421
|
+
isCompare: { type: Boolean }
|
|
2346
2422
|
},
|
|
2347
2423
|
emits: ["change"],
|
|
2348
2424
|
setup(__props, { emit: __emit }) {
|
|
@@ -2382,7 +2458,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
2382
2458
|
prop: {},
|
|
2383
2459
|
disabled: { type: Boolean },
|
|
2384
2460
|
size: {},
|
|
2385
|
-
lastValues: {}
|
|
2461
|
+
lastValues: {},
|
|
2462
|
+
isCompare: { type: Boolean }
|
|
2386
2463
|
},
|
|
2387
2464
|
emits: ["change"],
|
|
2388
2465
|
setup(__props, { emit: __emit }) {
|
|
@@ -2494,7 +2571,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
2494
2571
|
prop: {},
|
|
2495
2572
|
disabled: { type: Boolean },
|
|
2496
2573
|
size: {},
|
|
2497
|
-
lastValues: {}
|
|
2574
|
+
lastValues: {},
|
|
2575
|
+
isCompare: { type: Boolean }
|
|
2498
2576
|
},
|
|
2499
2577
|
emits: ["change"],
|
|
2500
2578
|
setup(__props, { emit: __emit }) {
|
|
@@ -2548,7 +2626,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
2548
2626
|
prop: {},
|
|
2549
2627
|
disabled: { type: Boolean },
|
|
2550
2628
|
size: {},
|
|
2551
|
-
lastValues: {}
|
|
2629
|
+
lastValues: {},
|
|
2630
|
+
isCompare: { type: Boolean }
|
|
2552
2631
|
},
|
|
2553
2632
|
setup(__props) {
|
|
2554
2633
|
const props = __props;
|
|
@@ -2583,7 +2662,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2583
2662
|
prop: {},
|
|
2584
2663
|
disabled: { type: Boolean },
|
|
2585
2664
|
size: {},
|
|
2586
|
-
lastValues: {}
|
|
2665
|
+
lastValues: {},
|
|
2666
|
+
isCompare: { type: Boolean }
|
|
2587
2667
|
},
|
|
2588
2668
|
emits: ["change"],
|
|
2589
2669
|
setup(__props, { emit: __emit }) {
|
|
@@ -2684,7 +2764,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
2684
2764
|
prop: {},
|
|
2685
2765
|
disabled: { type: Boolean },
|
|
2686
2766
|
size: {},
|
|
2687
|
-
lastValues: {}
|
|
2767
|
+
lastValues: {},
|
|
2768
|
+
isCompare: { type: Boolean }
|
|
2688
2769
|
},
|
|
2689
2770
|
setup(__props) {
|
|
2690
2771
|
const props = __props;
|
|
@@ -2949,7 +3030,12 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
2949
3030
|
zIndex: {},
|
|
2950
3031
|
size: {},
|
|
2951
3032
|
confirmText: { default: "确定" },
|
|
2952
|
-
preventSubmitDefault: { type: Boolean }
|
|
3033
|
+
preventSubmitDefault: { type: Boolean },
|
|
3034
|
+
closeOnClickModal: { type: Boolean, default: false },
|
|
3035
|
+
closeOnPressEscape: { type: Boolean, default: false },
|
|
3036
|
+
destroyOnClose: { type: Boolean, default: false },
|
|
3037
|
+
showClose: { type: Boolean, default: true },
|
|
3038
|
+
showCancel: { type: Boolean, default: true }
|
|
2953
3039
|
},
|
|
2954
3040
|
emits: ["close", "submit", "error", "change"],
|
|
2955
3041
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -3029,7 +3115,10 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
3029
3115
|
width: __props.width,
|
|
3030
3116
|
zIndex: __props.zIndex,
|
|
3031
3117
|
fullscreen: __props.fullscreen,
|
|
3032
|
-
"close-on-click-modal":
|
|
3118
|
+
"close-on-click-modal": __props.closeOnClickModal,
|
|
3119
|
+
"close-on-press-escape": __props.closeOnPressEscape,
|
|
3120
|
+
"destroy-on-close": __props.destroyOnClose,
|
|
3121
|
+
"show-close": __props.showClose,
|
|
3033
3122
|
onClose: closeHandler
|
|
3034
3123
|
}, {
|
|
3035
3124
|
footer: withCtx(() => [
|
|
@@ -3050,7 +3139,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
3050
3139
|
createVNode(unref(TMagicCol), { span: 12 }, {
|
|
3051
3140
|
default: withCtx(() => [
|
|
3052
3141
|
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
3053
|
-
|
|
3142
|
+
__props.showCancel ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
3143
|
+
key: 0,
|
|
3054
3144
|
onClick: cancel,
|
|
3055
3145
|
size: "small"
|
|
3056
3146
|
}, {
|
|
@@ -3063,9 +3153,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
3063
3153
|
])]),
|
|
3064
3154
|
_: 1
|
|
3065
3155
|
/* STABLE */
|
|
3066
|
-
}),
|
|
3156
|
+
})) : createCommentVNode("v-if", true),
|
|
3067
3157
|
hasStep.value && stepActive.value > 1 ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
3068
|
-
key:
|
|
3158
|
+
key: 1,
|
|
3069
3159
|
type: "info",
|
|
3070
3160
|
size: "small",
|
|
3071
3161
|
onClick: preStep
|
|
@@ -3081,7 +3171,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
3081
3171
|
/* STABLE */
|
|
3082
3172
|
})) : createCommentVNode("v-if", true),
|
|
3083
3173
|
hasStep.value && stepCount.value > stepActive.value ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
3084
|
-
key:
|
|
3174
|
+
key: 2,
|
|
3085
3175
|
type: "info",
|
|
3086
3176
|
size: "small",
|
|
3087
3177
|
onClick: nextStep
|
|
@@ -3096,7 +3186,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
3096
3186
|
_: 1
|
|
3097
3187
|
/* STABLE */
|
|
3098
3188
|
})) : (openBlock(), createBlock(unref(TMagicButton), {
|
|
3099
|
-
key:
|
|
3189
|
+
key: 3,
|
|
3100
3190
|
type: "primary",
|
|
3101
3191
|
size: "small",
|
|
3102
3192
|
disabled: __props.disabled,
|
|
@@ -3156,7 +3246,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
3156
3246
|
]),
|
|
3157
3247
|
_: 3
|
|
3158
3248
|
/* FORWARDED */
|
|
3159
|
-
}, 8, ["modelValue", "title", "width", "zIndex", "fullscreen"]);
|
|
3249
|
+
}, 8, ["modelValue", "title", "width", "zIndex", "fullscreen", "close-on-click-modal", "close-on-press-escape", "destroy-on-close", "show-close"]);
|
|
3160
3250
|
};
|
|
3161
3251
|
}
|
|
3162
3252
|
});
|
|
@@ -3180,7 +3270,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
3180
3270
|
prop: {},
|
|
3181
3271
|
disabled: { type: Boolean },
|
|
3182
3272
|
size: {},
|
|
3183
|
-
lastValues: {}
|
|
3273
|
+
lastValues: {},
|
|
3274
|
+
isCompare: { type: Boolean }
|
|
3184
3275
|
},
|
|
3185
3276
|
emits: ["change"],
|
|
3186
3277
|
setup(__props, { emit: __emit }) {
|
|
@@ -3291,16 +3382,27 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
3291
3382
|
prop: {},
|
|
3292
3383
|
disabled: { type: Boolean },
|
|
3293
3384
|
size: {},
|
|
3294
|
-
lastValues: {}
|
|
3385
|
+
lastValues: {},
|
|
3386
|
+
isCompare: { type: Boolean }
|
|
3295
3387
|
},
|
|
3296
3388
|
emits: ["change", "input"],
|
|
3297
3389
|
setup(__props, { emit: __emit }) {
|
|
3298
3390
|
const props = __props;
|
|
3299
3391
|
const emit = __emit;
|
|
3392
|
+
const value = ref();
|
|
3393
|
+
watch(
|
|
3394
|
+
() => props.model[props.name],
|
|
3395
|
+
(v) => {
|
|
3396
|
+
value.value = v;
|
|
3397
|
+
},
|
|
3398
|
+
{
|
|
3399
|
+
immediate: true
|
|
3400
|
+
}
|
|
3401
|
+
);
|
|
3300
3402
|
useAddField(props.prop);
|
|
3301
3403
|
const mForm = inject("mForm");
|
|
3302
|
-
const changeHandler = (
|
|
3303
|
-
emit("change",
|
|
3404
|
+
const changeHandler = (value2) => {
|
|
3405
|
+
emit("change", value2);
|
|
3304
3406
|
};
|
|
3305
3407
|
const inputHandler = (v) => {
|
|
3306
3408
|
emit("input", v);
|
|
@@ -3309,7 +3411,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
3309
3411
|
return (_ctx, _cache) => {
|
|
3310
3412
|
return __props.model ? (openBlock(), createBlock(unref(TMagicInputNumber), {
|
|
3311
3413
|
key: 0,
|
|
3312
|
-
|
|
3414
|
+
modelValue: value.value,
|
|
3415
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
3313
3416
|
clearable: "",
|
|
3314
3417
|
"controls-position": "right",
|
|
3315
3418
|
size: __props.size,
|
|
@@ -3318,9 +3421,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
3318
3421
|
step: __props.config.step,
|
|
3319
3422
|
placeholder: __props.config.placeholder,
|
|
3320
3423
|
disabled: __props.disabled,
|
|
3321
|
-
|
|
3424
|
+
onChange: changeHandler,
|
|
3322
3425
|
onInput: inputHandler
|
|
3323
|
-
}, null, 8, ["
|
|
3426
|
+
}, null, 8, ["modelValue", "size", "max", "min", "step", "placeholder", "disabled"])) : createCommentVNode("v-if", true);
|
|
3324
3427
|
};
|
|
3325
3428
|
}
|
|
3326
3429
|
});
|
|
@@ -3340,12 +3443,26 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3340
3443
|
prop: {},
|
|
3341
3444
|
disabled: { type: Boolean },
|
|
3342
3445
|
size: {},
|
|
3343
|
-
lastValues: {}
|
|
3446
|
+
lastValues: {},
|
|
3447
|
+
isCompare: { type: Boolean }
|
|
3344
3448
|
},
|
|
3345
3449
|
emits: ["change"],
|
|
3346
3450
|
setup(__props, { emit: __emit }) {
|
|
3347
3451
|
const props = __props;
|
|
3348
3452
|
const emit = __emit;
|
|
3453
|
+
const firstValue = ref();
|
|
3454
|
+
const secondValue = ref();
|
|
3455
|
+
watch(
|
|
3456
|
+
() => props.model[props.name],
|
|
3457
|
+
([first, second]) => {
|
|
3458
|
+
firstValue.value = first;
|
|
3459
|
+
secondValue.value = second;
|
|
3460
|
+
},
|
|
3461
|
+
{
|
|
3462
|
+
immediate: true,
|
|
3463
|
+
deep: true
|
|
3464
|
+
}
|
|
3465
|
+
);
|
|
3349
3466
|
useAddField(props.prop);
|
|
3350
3467
|
if (!Array.isArray(props.model[props.name])) {
|
|
3351
3468
|
props.model[props.name] = [];
|
|
@@ -3359,13 +3476,14 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3359
3476
|
return (_ctx, _cache) => {
|
|
3360
3477
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
3361
3478
|
createVNode(unref(TMagicInput), {
|
|
3362
|
-
|
|
3479
|
+
modelValue: firstValue.value,
|
|
3480
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => firstValue.value = $event),
|
|
3363
3481
|
clearable: __props.config.clearable ?? true,
|
|
3364
3482
|
size: __props.size,
|
|
3365
3483
|
disabled: __props.disabled,
|
|
3366
|
-
|
|
3367
|
-
}, null, 8, ["
|
|
3368
|
-
_cache[
|
|
3484
|
+
onChange: minChangeHandler
|
|
3485
|
+
}, null, 8, ["modelValue", "clearable", "size", "disabled"]),
|
|
3486
|
+
_cache[2] || (_cache[2] = createElementVNode(
|
|
3369
3487
|
"span",
|
|
3370
3488
|
{ class: "split-tag" },
|
|
3371
3489
|
"-",
|
|
@@ -3373,12 +3491,13 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3373
3491
|
/* CACHED */
|
|
3374
3492
|
)),
|
|
3375
3493
|
createVNode(unref(TMagicInput), {
|
|
3376
|
-
|
|
3494
|
+
modelValue: secondValue.value,
|
|
3495
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => secondValue.value = $event),
|
|
3377
3496
|
clearable: __props.config.clearable ?? true,
|
|
3378
3497
|
size: __props.size,
|
|
3379
3498
|
disabled: __props.disabled,
|
|
3380
|
-
|
|
3381
|
-
}, null, 8, ["
|
|
3499
|
+
onChange: maxChangeHandler
|
|
3500
|
+
}, null, 8, ["modelValue", "clearable", "size", "disabled"])
|
|
3382
3501
|
]);
|
|
3383
3502
|
};
|
|
3384
3503
|
}
|
|
@@ -3398,7 +3517,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3398
3517
|
prop: {},
|
|
3399
3518
|
disabled: { type: Boolean },
|
|
3400
3519
|
size: {},
|
|
3401
|
-
lastValues: {}
|
|
3520
|
+
lastValues: {},
|
|
3521
|
+
isCompare: { type: Boolean }
|
|
3402
3522
|
},
|
|
3403
3523
|
emits: ["change"],
|
|
3404
3524
|
setup(__props, { emit: __emit }) {
|
|
@@ -3496,7 +3616,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
3496
3616
|
prop: {},
|
|
3497
3617
|
disabled: { type: Boolean },
|
|
3498
3618
|
size: {},
|
|
3499
|
-
lastValues: {}
|
|
3619
|
+
lastValues: {},
|
|
3620
|
+
isCompare: { type: Boolean }
|
|
3500
3621
|
},
|
|
3501
3622
|
emits: ["change"],
|
|
3502
3623
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -3947,7 +4068,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
3947
4068
|
prop: {},
|
|
3948
4069
|
disabled: { type: Boolean },
|
|
3949
4070
|
size: {},
|
|
3950
|
-
lastValues: {}
|
|
4071
|
+
lastValues: {},
|
|
4072
|
+
isCompare: { type: Boolean }
|
|
3951
4073
|
},
|
|
3952
4074
|
emits: ["change"],
|
|
3953
4075
|
setup(__props, { emit: __emit }) {
|
|
@@ -4007,7 +4129,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4007
4129
|
prop: {},
|
|
4008
4130
|
disabled: { type: Boolean },
|
|
4009
4131
|
size: {},
|
|
4010
|
-
lastValues: {}
|
|
4132
|
+
lastValues: {},
|
|
4133
|
+
isCompare: { type: Boolean }
|
|
4011
4134
|
},
|
|
4012
4135
|
emits: ["change", "input"],
|
|
4013
4136
|
setup(__props, { emit: __emit }) {
|
|
@@ -4015,6 +4138,16 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4015
4138
|
const emit = __emit;
|
|
4016
4139
|
useAddField(props.prop);
|
|
4017
4140
|
const mForm = inject("mForm");
|
|
4141
|
+
const value = ref("");
|
|
4142
|
+
watch(
|
|
4143
|
+
() => props.model[props.name],
|
|
4144
|
+
(v) => {
|
|
4145
|
+
value.value = v;
|
|
4146
|
+
},
|
|
4147
|
+
{
|
|
4148
|
+
immediate: true
|
|
4149
|
+
}
|
|
4150
|
+
);
|
|
4018
4151
|
const appendConfig = computed(() => {
|
|
4019
4152
|
if (typeof props.config.append === "string") {
|
|
4020
4153
|
return {
|
|
@@ -4045,13 +4178,13 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4045
4178
|
emit("change", props.model[props.name].trim() || "");
|
|
4046
4179
|
popoverVisible.value = false;
|
|
4047
4180
|
};
|
|
4048
|
-
const checkWhiteSpace = debounce((
|
|
4049
|
-
if (typeof
|
|
4050
|
-
popoverVisible.value =
|
|
4181
|
+
const checkWhiteSpace = debounce((value2) => {
|
|
4182
|
+
if (typeof value2 === "string" && !props.config.trim) {
|
|
4183
|
+
popoverVisible.value = value2.trim() !== value2;
|
|
4051
4184
|
}
|
|
4052
4185
|
}, 300);
|
|
4053
|
-
const changeHandler = (
|
|
4054
|
-
emit("change",
|
|
4186
|
+
const changeHandler = (value2) => {
|
|
4187
|
+
emit("change", value2);
|
|
4055
4188
|
};
|
|
4056
4189
|
const inputHandler = (v) => {
|
|
4057
4190
|
checkWhiteSpace(v);
|
|
@@ -4062,11 +4195,11 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4062
4195
|
if (!appendConfig.value) return;
|
|
4063
4196
|
if (typeof appendConfig.value.handler === "function") {
|
|
4064
4197
|
const newChangeRecords = [];
|
|
4065
|
-
const setModel = (key,
|
|
4066
|
-
newChangeRecords.push({ propPath: props.prop.replace(`${props.name}`, key), value });
|
|
4198
|
+
const setModel = (key, value2) => {
|
|
4199
|
+
newChangeRecords.push({ propPath: props.prop.replace(`${props.name}`, key), value: value2 });
|
|
4067
4200
|
};
|
|
4068
|
-
const setFormValue = (key,
|
|
4069
|
-
newChangeRecords.push({ propPath: key, value });
|
|
4201
|
+
const setFormValue = (key, value2) => {
|
|
4202
|
+
newChangeRecords.push({ propPath: key, value: value2 });
|
|
4070
4203
|
};
|
|
4071
4204
|
appendConfig.value.handler(mForm, {
|
|
4072
4205
|
model: props.model,
|
|
@@ -4090,13 +4223,13 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4090
4223
|
if (!arrowUp && !arrowDown) {
|
|
4091
4224
|
return;
|
|
4092
4225
|
}
|
|
4093
|
-
const
|
|
4226
|
+
const value2 = props.model[props.name];
|
|
4094
4227
|
let num;
|
|
4095
4228
|
let unit;
|
|
4096
|
-
if (isNumber(
|
|
4097
|
-
num = +
|
|
4229
|
+
if (isNumber(value2)) {
|
|
4230
|
+
num = +value2;
|
|
4098
4231
|
} else {
|
|
4099
|
-
|
|
4232
|
+
value2.replace(/^([0-9.]+)([a-z%]+)$/, ($0, $1, $2) => {
|
|
4100
4233
|
num = +$1;
|
|
4101
4234
|
unit = $2;
|
|
4102
4235
|
});
|
|
@@ -4158,16 +4291,17 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4158
4291
|
return (_ctx, _cache) => {
|
|
4159
4292
|
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
4160
4293
|
createVNode(unref(TMagicInput), {
|
|
4161
|
-
|
|
4294
|
+
modelValue: value.value,
|
|
4295
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
4162
4296
|
ref_key: "input",
|
|
4163
4297
|
ref: input,
|
|
4164
4298
|
clearable: "",
|
|
4165
4299
|
size: __props.size,
|
|
4166
4300
|
placeholder: __props.config.placeholder,
|
|
4167
4301
|
disabled: __props.disabled,
|
|
4168
|
-
|
|
4302
|
+
onChange: changeHandler,
|
|
4169
4303
|
onInput: inputHandler,
|
|
4170
|
-
onKeyup: _cache[
|
|
4304
|
+
onKeyup: _cache[1] || (_cache[1] = ($event) => keyUpHandler($event))
|
|
4171
4305
|
}, createSlots({
|
|
4172
4306
|
_: 2
|
|
4173
4307
|
/* DYNAMIC */
|
|
@@ -4213,7 +4347,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4213
4347
|
]),
|
|
4214
4348
|
key: "1"
|
|
4215
4349
|
} : void 0
|
|
4216
|
-
]), 1032, ["
|
|
4350
|
+
]), 1032, ["modelValue", "size", "placeholder", "disabled"]),
|
|
4217
4351
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
4218
4352
|
popoverVisible.value ? (openBlock(), createElementBlock(
|
|
4219
4353
|
"div",
|
|
@@ -4224,7 +4358,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4224
4358
|
ref: popoverEl
|
|
4225
4359
|
},
|
|
4226
4360
|
[
|
|
4227
|
-
_cache[
|
|
4361
|
+
_cache[5] || (_cache[5] = createElementVNode(
|
|
4228
4362
|
"div",
|
|
4229
4363
|
{ class: "m-form-validate__warning" },
|
|
4230
4364
|
"输入内容前后有空格,是否移除空格?",
|
|
@@ -4235,9 +4369,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4235
4369
|
createVNode(unref(TMagicButton), {
|
|
4236
4370
|
link: "",
|
|
4237
4371
|
size: "small",
|
|
4238
|
-
onClick: _cache[
|
|
4372
|
+
onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
|
|
4239
4373
|
}, {
|
|
4240
|
-
default: withCtx(() => [..._cache[
|
|
4374
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
4241
4375
|
createTextVNode(
|
|
4242
4376
|
"保持原样",
|
|
4243
4377
|
-1
|
|
@@ -4252,7 +4386,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4252
4386
|
size: "small",
|
|
4253
4387
|
onClick: confirmTrimHandler
|
|
4254
4388
|
}, {
|
|
4255
|
-
default: withCtx(() => [..._cache[
|
|
4389
|
+
default: withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
4256
4390
|
createTextVNode(
|
|
4257
4391
|
"移除空格",
|
|
4258
4392
|
-1
|
|
@@ -4263,7 +4397,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4263
4397
|
/* STABLE */
|
|
4264
4398
|
})
|
|
4265
4399
|
]),
|
|
4266
|
-
_cache[
|
|
4400
|
+
_cache[6] || (_cache[6] = createElementVNode(
|
|
4267
4401
|
"span",
|
|
4268
4402
|
{
|
|
4269
4403
|
class: "tmagic-form-text-popper-arrow",
|
|
@@ -4297,16 +4431,27 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
4297
4431
|
prop: {},
|
|
4298
4432
|
disabled: { type: Boolean },
|
|
4299
4433
|
size: {},
|
|
4300
|
-
lastValues: {}
|
|
4434
|
+
lastValues: {},
|
|
4435
|
+
isCompare: { type: Boolean }
|
|
4301
4436
|
},
|
|
4302
4437
|
emits: ["change", "input"],
|
|
4303
4438
|
setup(__props, { emit: __emit }) {
|
|
4304
4439
|
const props = __props;
|
|
4305
4440
|
const emit = __emit;
|
|
4441
|
+
const value = ref("");
|
|
4442
|
+
watch(
|
|
4443
|
+
() => props.model[props.name],
|
|
4444
|
+
(v) => {
|
|
4445
|
+
value.value = v;
|
|
4446
|
+
},
|
|
4447
|
+
{
|
|
4448
|
+
immediate: true
|
|
4449
|
+
}
|
|
4450
|
+
);
|
|
4306
4451
|
useAddField(props.prop);
|
|
4307
4452
|
const mForm = inject("mForm");
|
|
4308
|
-
const changeHandler = (
|
|
4309
|
-
emit("change",
|
|
4453
|
+
const changeHandler = (value2) => {
|
|
4454
|
+
emit("change", value2);
|
|
4310
4455
|
};
|
|
4311
4456
|
const inputHandler = (v) => {
|
|
4312
4457
|
emit("input", v);
|
|
@@ -4314,16 +4459,17 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
4314
4459
|
};
|
|
4315
4460
|
return (_ctx, _cache) => {
|
|
4316
4461
|
return openBlock(), createBlock(unref(TMagicInput), {
|
|
4317
|
-
|
|
4462
|
+
modelValue: value.value,
|
|
4463
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
4318
4464
|
type: "textarea",
|
|
4319
4465
|
size: __props.size,
|
|
4320
4466
|
clearable: "",
|
|
4321
4467
|
placeholder: __props.config.placeholder,
|
|
4322
4468
|
disabled: __props.disabled,
|
|
4323
4469
|
rows: __props.config.rows,
|
|
4324
|
-
|
|
4470
|
+
onChange: changeHandler,
|
|
4325
4471
|
onInput: inputHandler
|
|
4326
|
-
}, null, 8, ["
|
|
4472
|
+
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "rows"]);
|
|
4327
4473
|
};
|
|
4328
4474
|
}
|
|
4329
4475
|
});
|
|
@@ -4342,7 +4488,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
4342
4488
|
prop: {},
|
|
4343
4489
|
disabled: { type: Boolean },
|
|
4344
4490
|
size: {},
|
|
4345
|
-
lastValues: {}
|
|
4491
|
+
lastValues: {},
|
|
4492
|
+
isCompare: { type: Boolean }
|
|
4346
4493
|
},
|
|
4347
4494
|
emits: ["change"],
|
|
4348
4495
|
setup(__props, { emit: __emit }) {
|
|
@@ -4380,7 +4527,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4380
4527
|
prop: {},
|
|
4381
4528
|
disabled: { type: Boolean },
|
|
4382
4529
|
size: {},
|
|
4383
|
-
lastValues: {}
|
|
4530
|
+
lastValues: {},
|
|
4531
|
+
isCompare: { type: Boolean }
|
|
4384
4532
|
},
|
|
4385
4533
|
emits: ["change"],
|
|
4386
4534
|
setup(__props, { emit: __emit }) {
|
|
@@ -4641,7 +4789,7 @@ const useSortable = (props, emit, tMagicTableRef, modelName) => {
|
|
|
4641
4789
|
const rowDrop = () => {
|
|
4642
4790
|
sortable?.destroy();
|
|
4643
4791
|
const tableEl = tMagicTableRef.value?.getEl();
|
|
4644
|
-
const tBodyEl = tableEl?.querySelector(".el-table__body > tbody");
|
|
4792
|
+
const tBodyEl = tableEl?.querySelector(".el-table__body > tbody") || tableEl?.querySelector(".t-table__body");
|
|
4645
4793
|
if (!tBodyEl) {
|
|
4646
4794
|
return;
|
|
4647
4795
|
}
|
|
@@ -4888,6 +5036,17 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
4888
5036
|
}
|
|
4889
5037
|
return fuc;
|
|
4890
5038
|
};
|
|
5039
|
+
const titleTip = (fuc) => {
|
|
5040
|
+
if (typeof fuc === "function") {
|
|
5041
|
+
return fuc(mForm, {
|
|
5042
|
+
values: mForm?.initValues,
|
|
5043
|
+
model: props.model,
|
|
5044
|
+
formValue: mForm ? mForm.values : props.model,
|
|
5045
|
+
prop: props.prop
|
|
5046
|
+
});
|
|
5047
|
+
}
|
|
5048
|
+
return fuc;
|
|
5049
|
+
};
|
|
4891
5050
|
const selection = computed(() => {
|
|
4892
5051
|
if (typeof props.config.selection === "function") {
|
|
4893
5052
|
return props.config.selection(mForm, { model: props.model[modelName.value] });
|
|
@@ -4924,10 +5083,14 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
4924
5083
|
})
|
|
4925
5084
|
});
|
|
4926
5085
|
}
|
|
4927
|
-
|
|
5086
|
+
let actionFixed = props.config.fixed === false ? void 0 : "left";
|
|
5087
|
+
if (typeof props.config.fixed === "string" && ["left", "right"].includes(props.config.fixed)) {
|
|
5088
|
+
actionFixed = props.config.fixed;
|
|
5089
|
+
}
|
|
5090
|
+
const actionClumn = {
|
|
4928
5091
|
props: {
|
|
4929
5092
|
label: "操作",
|
|
4930
|
-
fixed:
|
|
5093
|
+
fixed: actionFixed,
|
|
4931
5094
|
width: props.config.operateColWidth || 112,
|
|
4932
5095
|
align: "center"
|
|
4933
5096
|
},
|
|
@@ -4946,7 +5109,10 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
4946
5109
|
emit("change", v);
|
|
4947
5110
|
}
|
|
4948
5111
|
})
|
|
4949
|
-
}
|
|
5112
|
+
};
|
|
5113
|
+
if (actionFixed !== "right") {
|
|
5114
|
+
columns2.push(actionClumn);
|
|
5115
|
+
}
|
|
4950
5116
|
if (props.sort && props.model[modelName.value] && props.model[modelName.value].length > 1) {
|
|
4951
5117
|
columns2.push({
|
|
4952
5118
|
props: {
|
|
@@ -4989,6 +5155,7 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
4989
5155
|
}
|
|
4990
5156
|
for (const column of props.config.items) {
|
|
4991
5157
|
if (column.type !== "hidden" && display$1(column.display)) {
|
|
5158
|
+
const titleTipValue = titleTip(column.titleTip);
|
|
4992
5159
|
columns2.push({
|
|
4993
5160
|
props: {
|
|
4994
5161
|
prop: column.name,
|
|
@@ -5010,10 +5177,33 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
5010
5177
|
size: props.size,
|
|
5011
5178
|
onChange: changeHandler,
|
|
5012
5179
|
onAddDiffCount
|
|
5013
|
-
})
|
|
5180
|
+
}),
|
|
5181
|
+
title: titleTipValue ? () => h(
|
|
5182
|
+
TMagicTooltip,
|
|
5183
|
+
{ placement: "top" },
|
|
5184
|
+
{
|
|
5185
|
+
default: () => h(
|
|
5186
|
+
"span",
|
|
5187
|
+
{
|
|
5188
|
+
style: {
|
|
5189
|
+
display: "inline-flex",
|
|
5190
|
+
alignItems: "center",
|
|
5191
|
+
gap: "5px"
|
|
5192
|
+
}
|
|
5193
|
+
},
|
|
5194
|
+
[h("span", column.label), h(TMagicIcon, {}, { default: () => h(WarningFilled) })]
|
|
5195
|
+
),
|
|
5196
|
+
content: () => h("div", {
|
|
5197
|
+
innerHTML: titleTipValue
|
|
5198
|
+
})
|
|
5199
|
+
}
|
|
5200
|
+
) : void 0
|
|
5014
5201
|
});
|
|
5015
5202
|
}
|
|
5016
5203
|
}
|
|
5204
|
+
if (actionFixed === "right") {
|
|
5205
|
+
columns2.push(actionClumn);
|
|
5206
|
+
}
|
|
5017
5207
|
return columns2;
|
|
5018
5208
|
});
|
|
5019
5209
|
return {
|
|
@@ -5228,24 +5418,26 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
5228
5418
|
/* STABLE */
|
|
5229
5419
|
}, 8, ["disabled", "onClick"])) : createCommentVNode("v-if", true)
|
|
5230
5420
|
]),
|
|
5231
|
-
unref(addable) ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
5421
|
+
unref(addable) ? (openBlock(), createBlock(unref(TMagicButton), mergeProps({
|
|
5232
5422
|
key: 0,
|
|
5423
|
+
class: "m-form-table-add-button",
|
|
5233
5424
|
size: "small",
|
|
5234
|
-
type: "primary",
|
|
5235
|
-
disabled: __props.disabled,
|
|
5236
5425
|
plain: "",
|
|
5426
|
+
icon: unref(Plus)
|
|
5427
|
+
}, __props.config.addButtonConfig?.props || { type: "primary" }, {
|
|
5428
|
+
disabled: __props.disabled,
|
|
5237
5429
|
onClick: _cache[0] || (_cache[0] = ($event) => unref(newHandler)())
|
|
5238
|
-
}, {
|
|
5239
|
-
default: withCtx(() => [
|
|
5430
|
+
}), {
|
|
5431
|
+
default: withCtx(() => [
|
|
5240
5432
|
createTextVNode(
|
|
5241
|
-
"新增一行",
|
|
5242
|
-
|
|
5243
|
-
/*
|
|
5433
|
+
toDisplayString(__props.config.addButtonConfig?.text || "新增一行"),
|
|
5434
|
+
1
|
|
5435
|
+
/* TEXT */
|
|
5244
5436
|
)
|
|
5245
|
-
])
|
|
5437
|
+
]),
|
|
5246
5438
|
_: 1
|
|
5247
5439
|
/* STABLE */
|
|
5248
|
-
},
|
|
5440
|
+
}, 16, ["icon", "disabled"])) : createCommentVNode("v-if", true)
|
|
5249
5441
|
]),
|
|
5250
5442
|
__props.config.pagination ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
5251
5443
|
createVNode(unref(TMagicPagination), {
|