@tmagic/form 1.0.0-beta.6 → 1.0.0-rc.2
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/LICENSE +5432 -0
- package/README.md +1 -0
- package/coverage/clover.xml +1360 -0
- package/coverage/coverage-final.json +38 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +176 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/Form.vue.html +676 -0
- package/coverage/lcov-report/src/FormDialog.vue.html +583 -0
- package/coverage/lcov-report/src/containers/Col.vue.html +253 -0
- package/coverage/lcov-report/src/containers/Container.vue.html +925 -0
- package/coverage/lcov-report/src/containers/Fieldset.vue.html +499 -0
- package/coverage/lcov-report/src/containers/GroupList.vue.html +541 -0
- package/coverage/lcov-report/src/containers/GroupListItem.vue.html +562 -0
- package/coverage/lcov-report/src/containers/Panel.vue.html +403 -0
- package/coverage/lcov-report/src/containers/Row.vue.html +277 -0
- package/coverage/lcov-report/src/containers/Step.vue.html +331 -0
- package/coverage/lcov-report/src/containers/Table.vue.html +1987 -0
- package/coverage/lcov-report/src/containers/Tabs.vue.html +625 -0
- package/coverage/lcov-report/src/containers/index.html +251 -0
- package/coverage/lcov-report/src/fields/Cascader.vue.html +526 -0
- package/coverage/lcov-report/src/fields/Checkbox.vue.html +286 -0
- package/coverage/lcov-report/src/fields/CheckboxGroup.vue.html +217 -0
- package/coverage/lcov-report/src/fields/ColorPicker.vue.html +199 -0
- package/coverage/lcov-report/src/fields/Date.vue.html +238 -0
- package/coverage/lcov-report/src/fields/DateTime.vue.html +262 -0
- package/coverage/lcov-report/src/fields/Daterange.vue.html +310 -0
- package/coverage/lcov-report/src/fields/Display.vue.html +187 -0
- package/coverage/lcov-report/src/fields/DynamicField.vue.html +412 -0
- package/coverage/lcov-report/src/fields/Hidden.vue.html +172 -0
- package/coverage/lcov-report/src/fields/Link.vue.html +421 -0
- package/coverage/lcov-report/src/fields/Number.vue.html +244 -0
- package/coverage/lcov-report/src/fields/RadioGroup.vue.html +184 -0
- package/coverage/lcov-report/src/fields/Select.vue.html +1243 -0
- package/coverage/lcov-report/src/fields/Switch.vue.html +280 -0
- package/coverage/lcov-report/src/fields/Text.vue.html +487 -0
- package/coverage/lcov-report/src/fields/Textarea.vue.html +265 -0
- package/coverage/lcov-report/src/fields/Time.vue.html +229 -0
- package/coverage/lcov-report/src/fields/index.html +371 -0
- package/coverage/lcov-report/src/index.html +146 -0
- package/coverage/lcov-report/src/index.ts.html +466 -0
- package/coverage/lcov-report/src/theme/index.html +116 -0
- package/coverage/lcov-report/src/theme/index.scss.html +112 -0
- package/coverage/lcov-report/src/utils/config.ts.html +166 -0
- package/coverage/lcov-report/src/utils/createForm.ts.html +160 -0
- package/coverage/lcov-report/src/utils/fieldProps.ts.html +202 -0
- package/coverage/lcov-report/src/utils/form.ts.html +895 -0
- package/coverage/lcov-report/src/utils/index.html +176 -0
- package/coverage/lcov-report/src/utils/useAddField.ts.html +205 -0
- package/coverage/lcov.info +3061 -0
- package/dist/style.css +9 -11
- package/dist/tmagic-form.es.js +188 -127
- package/dist/tmagic-form.es.js.map +1 -1
- package/dist/tmagic-form.umd.js +191 -131
- package/dist/tmagic-form.umd.js.map +1 -1
- package/dist/types/src/Form.vue.d.ts +181 -120
- package/dist/types/src/FormDialog.vue.d.ts +357 -238
- package/dist/types/src/containers/Col.vue.d.ts +42 -0
- package/dist/types/src/containers/Container.vue.d.ts +1 -0
- package/dist/types/src/containers/Row.vue.d.ts +0 -1
- package/dist/types/src/containers/Table.vue.d.ts +1742 -544
- package/dist/types/src/fields/Checkbox.vue.d.ts +2 -2
- package/dist/types/src/fields/Link.vue.d.ts +710 -472
- package/dist/types/src/schema.d.ts +2 -0
- package/package.json +29 -9
- package/src/Form.vue +7 -2
- package/src/FormDialog.vue +1 -1
- package/src/containers/Col.vue +56 -0
- package/src/containers/Container.vue +28 -11
- package/src/containers/GroupListItem.vue +4 -4
- package/src/containers/Row.vue +13 -17
- package/src/containers/Table.vue +14 -6
- package/src/fields/Checkbox.vue +2 -2
- package/src/fields/Link.vue +1 -1
- package/src/fields/Select.vue +8 -15
- package/src/fields/Text.vue +4 -4
- package/src/fields/Textarea.vue +11 -13
- package/src/schema.ts +2 -0
- package/src/theme/form.scss +24 -17
- package/src/utils/form.ts +5 -1
- package/dist/types/src/fields/Cascader.vue.d.ts +0 -1748
- package/dist/types/src/fields/Select.vue.d.ts +0 -975
- package/tsconfig.json +0 -9
- package/vite.config.ts +0 -27
package/dist/tmagic-form.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicForm = {}, global.vue, global.
|
|
5
|
-
})(this, (function (exports, vue,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@element-plus/icons'), require('lodash-es'), require('element-plus'), require('sortablejs'), require('@tmagic/utils')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons', 'lodash-es', 'element-plus', 'sortablejs', '@tmagic/utils'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicForm = {}, global.vue, global.icons, global.lodashEs, global.elementPlus, global.Sortable, global.utils));
|
|
5
|
+
})(this, (function (exports, vue, icons, lodashEs, elementPlus, Sortable, utils) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -62,7 +62,11 @@
|
|
|
62
62
|
asyncLoadConfig(value, initValue2, item);
|
|
63
63
|
if (name && !items && typeof initValue2[name] !== "undefined") {
|
|
64
64
|
if (typeof value[name] === "undefined") {
|
|
65
|
-
|
|
65
|
+
if (type === "number") {
|
|
66
|
+
value[name] = Number(initValue2[name]);
|
|
67
|
+
} else {
|
|
68
|
+
value[name] = typeof initValue2[name] === "object" ? lodashEs.cloneDeep(initValue2[name]) : initValue2[name];
|
|
69
|
+
}
|
|
66
70
|
}
|
|
67
71
|
return value;
|
|
68
72
|
}
|
|
@@ -172,8 +176,9 @@
|
|
|
172
176
|
return target;
|
|
173
177
|
};
|
|
174
178
|
|
|
175
|
-
const _sfc_main$
|
|
179
|
+
const _sfc_main$t = vue.defineComponent({
|
|
176
180
|
name: "m-form-container",
|
|
181
|
+
components: { WarningFilled: icons.WarningFilled },
|
|
177
182
|
props: {
|
|
178
183
|
labelWidth: String,
|
|
179
184
|
expandMore: Boolean,
|
|
@@ -231,6 +236,7 @@
|
|
|
231
236
|
}
|
|
232
237
|
return display(mForm, props.config.display, props);
|
|
233
238
|
});
|
|
239
|
+
const itemLabelWidth = vue.computed(() => props.config.labelWidth || props.labelWidth);
|
|
234
240
|
vue.watchEffect(() => {
|
|
235
241
|
expand.value = props.expandMore;
|
|
236
242
|
});
|
|
@@ -267,9 +273,14 @@
|
|
|
267
273
|
};
|
|
268
274
|
const onChangeHandler = async function(v, key2) {
|
|
269
275
|
const { filter, onChange, trim, name: name2, dynamicKey } = props.config;
|
|
270
|
-
let value =
|
|
271
|
-
|
|
272
|
-
|
|
276
|
+
let value = v;
|
|
277
|
+
try {
|
|
278
|
+
value = filterHandler(filter, v);
|
|
279
|
+
value = await changeHandler(onChange, value) ?? value;
|
|
280
|
+
value = trimHandler(trim, value) ?? value;
|
|
281
|
+
} catch (e) {
|
|
282
|
+
console.error(e);
|
|
283
|
+
}
|
|
273
284
|
if ((name2 || name2 === 0) && props.model !== value && (v !== value || props.model[name2] !== value)) {
|
|
274
285
|
props.model[name2] = value;
|
|
275
286
|
}
|
|
@@ -286,6 +297,7 @@
|
|
|
286
297
|
itemProp,
|
|
287
298
|
items,
|
|
288
299
|
display: display$1,
|
|
300
|
+
itemLabelWidth,
|
|
289
301
|
tagName,
|
|
290
302
|
rule,
|
|
291
303
|
tooltip,
|
|
@@ -296,24 +308,25 @@
|
|
|
296
308
|
};
|
|
297
309
|
}
|
|
298
310
|
});
|
|
299
|
-
const _hoisted_1$
|
|
311
|
+
const _hoisted_1$f = ["innerHTML"];
|
|
300
312
|
const _hoisted_2$7 = ["innerHTML"];
|
|
301
313
|
const _hoisted_3$7 = ["innerHTML"];
|
|
302
|
-
const _hoisted_4$6 =
|
|
303
|
-
const _hoisted_5$4 =
|
|
304
|
-
const _hoisted_6$3 = {
|
|
314
|
+
const _hoisted_4$6 = ["innerHTML"];
|
|
315
|
+
const _hoisted_5$4 = {
|
|
305
316
|
key: 4,
|
|
306
317
|
style: { "text-align": "center" }
|
|
307
318
|
};
|
|
308
|
-
function _sfc_render$
|
|
319
|
+
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
309
320
|
const _component_m_fields_hidden = vue.resolveComponent("m-fields-hidden");
|
|
310
321
|
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
311
322
|
const _component_el_form_item = vue.resolveComponent("el-form-item");
|
|
323
|
+
const _component_warning_filled = vue.resolveComponent("warning-filled");
|
|
324
|
+
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
312
325
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
313
326
|
const _component_el_button = vue.resolveComponent("el-button");
|
|
314
327
|
return _ctx.config ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
315
328
|
key: 0,
|
|
316
|
-
style: vue.normalizeStyle(_ctx.config.tip ? "display: flex" : ""),
|
|
329
|
+
style: vue.normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
|
|
317
330
|
class: vue.normalizeClass([_ctx.config.className, "m-form-container"])
|
|
318
331
|
}, [
|
|
319
332
|
_ctx.type === "hidden" ? (vue.openBlock(), vue.createBlock(_component_m_fields_hidden, {
|
|
@@ -332,19 +345,20 @@
|
|
|
332
345
|
prop: _ctx.itemProp,
|
|
333
346
|
"step-active": _ctx.stepActive,
|
|
334
347
|
"expand-more": _ctx.expand,
|
|
335
|
-
"label-width": _ctx.
|
|
348
|
+
"label-width": _ctx.itemLabelWidth,
|
|
336
349
|
onChange: _ctx.onChangeHandler
|
|
337
350
|
}, null, 8, ["size", "model", "config", "name", "prop", "step-active", "expand-more", "label-width", "onChange"])) : _ctx.type && _ctx.display ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
338
351
|
vue.createVNode(_component_el_form_item, {
|
|
339
352
|
style: vue.normalizeStyle(_ctx.config.tip ? "flex: 1" : ""),
|
|
353
|
+
class: vue.normalizeClass({ hidden: _ctx.itemLabelWidth === 0 || !_ctx.config.text }),
|
|
340
354
|
prop: _ctx.itemProp,
|
|
341
|
-
"label-width": _ctx.
|
|
355
|
+
"label-width": _ctx.itemLabelWidth,
|
|
342
356
|
rules: _ctx.rule
|
|
343
357
|
}, {
|
|
344
358
|
label: vue.withCtx(() => [
|
|
345
359
|
vue.createElementVNode("span", {
|
|
346
360
|
innerHTML: _ctx.type === "checkbox" ? "" : _ctx.config.text
|
|
347
|
-
}, null, 8, _hoisted_1$
|
|
361
|
+
}, null, 8, _hoisted_1$f)
|
|
348
362
|
]),
|
|
349
363
|
default: vue.withCtx(() => [
|
|
350
364
|
_ctx.tooltip ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, { key: 0 }, {
|
|
@@ -381,19 +395,23 @@
|
|
|
381
395
|
}, null, 8, _hoisted_3$7)) : vue.createCommentVNode("", true)
|
|
382
396
|
]),
|
|
383
397
|
_: 1
|
|
384
|
-
}, 8, ["style", "prop", "label-width", "rules"]),
|
|
398
|
+
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
385
399
|
_ctx.config.tip ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
|
|
386
400
|
key: 0,
|
|
387
|
-
placement: "
|
|
388
|
-
style: { "line-height": "40px", "margin-left": "5px" }
|
|
401
|
+
placement: "left"
|
|
389
402
|
}, {
|
|
390
403
|
content: vue.withCtx(() => [
|
|
391
404
|
vue.createElementVNode("div", {
|
|
392
405
|
innerHTML: _ctx.config.tip
|
|
393
|
-
}, null, 8,
|
|
406
|
+
}, null, 8, _hoisted_4$6)
|
|
394
407
|
]),
|
|
395
408
|
default: vue.withCtx(() => [
|
|
396
|
-
|
|
409
|
+
vue.createVNode(_component_el_icon, { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
410
|
+
default: vue.withCtx(() => [
|
|
411
|
+
vue.createVNode(_component_warning_filled)
|
|
412
|
+
]),
|
|
413
|
+
_: 1
|
|
414
|
+
})
|
|
397
415
|
]),
|
|
398
416
|
_: 1
|
|
399
417
|
})) : vue.createCommentVNode("", true)
|
|
@@ -406,15 +424,15 @@
|
|
|
406
424
|
size: _ctx.size,
|
|
407
425
|
"step-active": _ctx.stepActive,
|
|
408
426
|
"expand-more": _ctx.expand,
|
|
409
|
-
"label-width": _ctx.
|
|
427
|
+
"label-width": _ctx.itemLabelWidth,
|
|
410
428
|
prop: _ctx.itemProp,
|
|
411
429
|
onChange: _ctx.onChangeHandler
|
|
412
430
|
}, null, 8, ["model", "config", "size", "step-active", "expand-more", "label-width", "prop", "onChange"]);
|
|
413
431
|
}), 128)) : vue.createCommentVNode("", true)
|
|
414
432
|
], 64)) : vue.createCommentVNode("", true),
|
|
415
|
-
_ctx.config.expand && _ctx.type !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div",
|
|
433
|
+
_ctx.config.expand && _ctx.type !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$4, [
|
|
416
434
|
vue.createVNode(_component_el_button, {
|
|
417
|
-
|
|
435
|
+
text: "",
|
|
418
436
|
onClick: _ctx.expandHandler
|
|
419
437
|
}, {
|
|
420
438
|
default: vue.withCtx(() => [
|
|
@@ -425,9 +443,9 @@
|
|
|
425
443
|
])) : vue.createCommentVNode("", true)
|
|
426
444
|
], 6)) : vue.createCommentVNode("", true);
|
|
427
445
|
}
|
|
428
|
-
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
446
|
+
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$q]]);
|
|
429
447
|
|
|
430
|
-
const _sfc_main$
|
|
448
|
+
const _sfc_main$s = vue.defineComponent({
|
|
431
449
|
name: "m-form-fieldset",
|
|
432
450
|
props: {
|
|
433
451
|
labelWidth: String,
|
|
@@ -479,7 +497,7 @@
|
|
|
479
497
|
};
|
|
480
498
|
}
|
|
481
499
|
});
|
|
482
|
-
const _hoisted_1$
|
|
500
|
+
const _hoisted_1$e = ["innerHTML"];
|
|
483
501
|
const _hoisted_2$6 = ["innerHTML"];
|
|
484
502
|
const _hoisted_3$6 = { key: 1 };
|
|
485
503
|
const _hoisted_4$5 = ["innerHTML"];
|
|
@@ -493,7 +511,7 @@
|
|
|
493
511
|
};
|
|
494
512
|
const _hoisted_10$1 = { style: { "flex": "1" } };
|
|
495
513
|
const _hoisted_11 = ["src"];
|
|
496
|
-
function _sfc_render$
|
|
514
|
+
function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
497
515
|
const _component_el_checkbox = vue.resolveComponent("el-checkbox");
|
|
498
516
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
499
517
|
return (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model) ? (vue.openBlock(), vue.createElementBlock("fieldset", {
|
|
@@ -513,7 +531,7 @@
|
|
|
513
531
|
default: vue.withCtx(() => [
|
|
514
532
|
vue.createElementVNode("span", {
|
|
515
533
|
innerHTML: _ctx.config.legend
|
|
516
|
-
}, null, 8, _hoisted_1$
|
|
534
|
+
}, null, 8, _hoisted_1$e),
|
|
517
535
|
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
518
536
|
key: 0,
|
|
519
537
|
innerHTML: _ctx.config.extra,
|
|
@@ -585,9 +603,9 @@
|
|
|
585
603
|
}), 128)) : vue.createCommentVNode("", true)
|
|
586
604
|
], 4)) : vue.createCommentVNode("", true);
|
|
587
605
|
}
|
|
588
|
-
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
606
|
+
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$p]]);
|
|
589
607
|
|
|
590
|
-
const _sfc_main$
|
|
608
|
+
const _sfc_main$r = vue.defineComponent({
|
|
591
609
|
name: "m-form-group-list-item",
|
|
592
610
|
components: { CaretRight: icons.CaretRight, CaretBottom: icons.CaretBottom },
|
|
593
611
|
props: {
|
|
@@ -671,11 +689,11 @@
|
|
|
671
689
|
};
|
|
672
690
|
}
|
|
673
691
|
});
|
|
674
|
-
const _hoisted_1$
|
|
692
|
+
const _hoisted_1$d = { class: "m-fields-group-list-item" };
|
|
675
693
|
const _hoisted_2$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0A\u79FB");
|
|
676
694
|
const _hoisted_3$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0B\u79FB");
|
|
677
695
|
const _hoisted_4$4 = ["innerHTML"];
|
|
678
|
-
function _sfc_render$
|
|
696
|
+
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
679
697
|
const _component_caret_bottom = vue.resolveComponent("caret-bottom");
|
|
680
698
|
const _component_caret_right = vue.resolveComponent("caret-right");
|
|
681
699
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
@@ -683,7 +701,7 @@
|
|
|
683
701
|
const _component_CaretRight = vue.resolveComponent("CaretRight");
|
|
684
702
|
const _component_CaretBottom = vue.resolveComponent("CaretBottom");
|
|
685
703
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
686
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
704
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
|
|
687
705
|
vue.createElementVNode("div", null, [
|
|
688
706
|
vue.createVNode(_component_el_icon, {
|
|
689
707
|
style: { "margin-right": "7px" },
|
|
@@ -695,7 +713,7 @@
|
|
|
695
713
|
_: 1
|
|
696
714
|
}, 8, ["onClick"]),
|
|
697
715
|
vue.createVNode(_component_el_button, {
|
|
698
|
-
|
|
716
|
+
text: "",
|
|
699
717
|
onClick: _ctx.expandHandler
|
|
700
718
|
}, {
|
|
701
719
|
default: vue.withCtx(() => [
|
|
@@ -704,7 +722,7 @@
|
|
|
704
722
|
_: 1
|
|
705
723
|
}, 8, ["onClick"]),
|
|
706
724
|
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
707
|
-
|
|
725
|
+
text: "",
|
|
708
726
|
icon: _ctx.Delete,
|
|
709
727
|
style: { "color": "#f56c6c" },
|
|
710
728
|
onClick: _ctx.removeHandler
|
|
@@ -713,7 +731,7 @@
|
|
|
713
731
|
]),
|
|
714
732
|
_ctx.movable() ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
715
733
|
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
716
|
-
|
|
734
|
+
text: "",
|
|
717
735
|
size: "small",
|
|
718
736
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.changeOrder(-1))
|
|
719
737
|
}, {
|
|
@@ -731,7 +749,7 @@
|
|
|
731
749
|
[vue.vShow, _ctx.index !== 0]
|
|
732
750
|
]),
|
|
733
751
|
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
734
|
-
|
|
752
|
+
text: "",
|
|
735
753
|
size: "small",
|
|
736
754
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.changeOrder(1))
|
|
737
755
|
}, {
|
|
@@ -766,9 +784,9 @@
|
|
|
766
784
|
}, null, 8, ["config", "model", "labelWidth", "prop", "size", "onChange"])) : vue.createCommentVNode("", true)
|
|
767
785
|
]);
|
|
768
786
|
}
|
|
769
|
-
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
787
|
+
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$o]]);
|
|
770
788
|
|
|
771
|
-
const _sfc_main$
|
|
789
|
+
const _sfc_main$q = vue.defineComponent({
|
|
772
790
|
name: "m-form-group-list",
|
|
773
791
|
components: { MFieldsGroupListItem },
|
|
774
792
|
props: {
|
|
@@ -860,7 +878,7 @@
|
|
|
860
878
|
};
|
|
861
879
|
}
|
|
862
880
|
});
|
|
863
|
-
const _hoisted_1$
|
|
881
|
+
const _hoisted_1$c = { class: "m-fields-group-list" };
|
|
864
882
|
const _hoisted_2$4 = ["innerHTML"];
|
|
865
883
|
const _hoisted_3$4 = {
|
|
866
884
|
key: 1,
|
|
@@ -872,10 +890,10 @@
|
|
|
872
890
|
];
|
|
873
891
|
const _hoisted_6$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0\u7EC4");
|
|
874
892
|
const _hoisted_7$1 = /* @__PURE__ */ vue.createTextVNode("\u5207\u6362\u4E3A\u8868\u683C");
|
|
875
|
-
function _sfc_render$
|
|
893
|
+
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
876
894
|
const _component_m_fields_group_list_item = vue.resolveComponent("m-fields-group-list-item");
|
|
877
895
|
const _component_el_button = vue.resolveComponent("el-button");
|
|
878
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
896
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
879
897
|
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
880
898
|
key: 0,
|
|
881
899
|
innerHTML: _ctx.config.extra,
|
|
@@ -919,9 +937,9 @@
|
|
|
919
937
|
}, 8, ["onClick"])) : vue.createCommentVNode("", true)
|
|
920
938
|
]);
|
|
921
939
|
}
|
|
922
|
-
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
940
|
+
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$n]]);
|
|
923
941
|
|
|
924
|
-
const _sfc_main$
|
|
942
|
+
const _sfc_main$p = vue.defineComponent({
|
|
925
943
|
name: "m-form-panel",
|
|
926
944
|
components: { CaretBottom: icons.CaretBottom, CaretRight: icons.CaretRight },
|
|
927
945
|
props: {
|
|
@@ -954,7 +972,7 @@
|
|
|
954
972
|
};
|
|
955
973
|
}
|
|
956
974
|
});
|
|
957
|
-
const _hoisted_1$
|
|
975
|
+
const _hoisted_1$b = { class: "clearfix" };
|
|
958
976
|
const _hoisted_2$3 = ["innerHTML"];
|
|
959
977
|
const _hoisted_3$3 = {
|
|
960
978
|
key: 0,
|
|
@@ -962,7 +980,7 @@
|
|
|
962
980
|
};
|
|
963
981
|
const _hoisted_4$2 = { style: { "flex": "1" } };
|
|
964
982
|
const _hoisted_5$1 = ["src"];
|
|
965
|
-
function _sfc_render$
|
|
983
|
+
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
966
984
|
const _component_caret_bottom = vue.resolveComponent("caret-bottom");
|
|
967
985
|
const _component_caret_right = vue.resolveComponent("caret-right");
|
|
968
986
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
@@ -974,7 +992,7 @@
|
|
|
974
992
|
"body-style": { display: _ctx.expand ? "block" : "none" }
|
|
975
993
|
}, {
|
|
976
994
|
header: vue.withCtx(() => [
|
|
977
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
995
|
+
vue.createElementVNode("div", _hoisted_1$b, [
|
|
978
996
|
vue.createElementVNode("a", {
|
|
979
997
|
href: "javascript:",
|
|
980
998
|
style: { "width": "100%", "display": "block" },
|
|
@@ -1032,10 +1050,60 @@
|
|
|
1032
1050
|
_: 3
|
|
1033
1051
|
}, 8, ["body-style"])) : vue.createCommentVNode("", true);
|
|
1034
1052
|
}
|
|
1035
|
-
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1053
|
+
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$m]]);
|
|
1054
|
+
|
|
1055
|
+
const _sfc_main$o = vue.defineComponent({
|
|
1056
|
+
props: {
|
|
1057
|
+
labelWidth: String,
|
|
1058
|
+
expandMore: Boolean,
|
|
1059
|
+
span: Number,
|
|
1060
|
+
model: {
|
|
1061
|
+
type: Object,
|
|
1062
|
+
default: () => ({})
|
|
1063
|
+
},
|
|
1064
|
+
config: {
|
|
1065
|
+
type: Object,
|
|
1066
|
+
default: () => ({})
|
|
1067
|
+
},
|
|
1068
|
+
prop: String,
|
|
1069
|
+
size: String
|
|
1070
|
+
},
|
|
1071
|
+
emits: ["change"],
|
|
1072
|
+
setup(props, { emit }) {
|
|
1073
|
+
const mForm = vue.inject("mForm");
|
|
1074
|
+
const changeHandler = () => emit("change", props.model);
|
|
1075
|
+
return {
|
|
1076
|
+
mForm,
|
|
1077
|
+
display: vue.computed(() => display(mForm, props.config.display, props)),
|
|
1078
|
+
changeHandler
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1083
|
+
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
1084
|
+
const _component_el_col = vue.resolveComponent("el-col");
|
|
1085
|
+
return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_el_col, { span: _ctx.span }, {
|
|
1086
|
+
default: vue.withCtx(() => [
|
|
1087
|
+
vue.createVNode(_component_m_form_container, {
|
|
1088
|
+
model: _ctx.model,
|
|
1089
|
+
config: _ctx.config,
|
|
1090
|
+
prop: _ctx.prop,
|
|
1091
|
+
"label-width": _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1092
|
+
"expand-more": _ctx.expandMore,
|
|
1093
|
+
size: _ctx.size,
|
|
1094
|
+
onChange: _ctx.changeHandler
|
|
1095
|
+
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1096
|
+
]),
|
|
1097
|
+
_: 1
|
|
1098
|
+
}, 8, ["span"])), [
|
|
1099
|
+
[vue.vShow, _ctx.display && _ctx.config.type !== "hidden"]
|
|
1100
|
+
]);
|
|
1101
|
+
}
|
|
1102
|
+
var Col = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$l]]);
|
|
1036
1103
|
|
|
1037
1104
|
const _sfc_main$n = vue.defineComponent({
|
|
1038
1105
|
name: "m-form-row",
|
|
1106
|
+
components: { Col },
|
|
1039
1107
|
props: {
|
|
1040
1108
|
labelWidth: String,
|
|
1041
1109
|
expandMore: Boolean,
|
|
@@ -1057,38 +1125,27 @@
|
|
|
1057
1125
|
const changeHandler = () => emit("change", props.name ? props.model[props.name] : props.model);
|
|
1058
1126
|
return {
|
|
1059
1127
|
mForm,
|
|
1060
|
-
display(config) {
|
|
1061
|
-
return display(mForm, config.display, props);
|
|
1062
|
-
},
|
|
1063
1128
|
changeHandler
|
|
1064
1129
|
};
|
|
1065
1130
|
}
|
|
1066
1131
|
});
|
|
1067
1132
|
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1068
|
-
const
|
|
1069
|
-
const _component_el_col = vue.resolveComponent("el-col");
|
|
1133
|
+
const _component_Col = vue.resolveComponent("Col");
|
|
1070
1134
|
const _component_el_row = vue.resolveComponent("el-row");
|
|
1071
1135
|
return vue.openBlock(), vue.createBlock(_component_el_row, { gutter: 10 }, {
|
|
1072
1136
|
default: vue.withCtx(() => [
|
|
1073
1137
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (col, index) => {
|
|
1074
|
-
return vue.openBlock(), vue.createBlock(
|
|
1075
|
-
style: vue.normalizeStyle(!_ctx.display(col) || col.type === "hidden" ? "display: none" : ""),
|
|
1138
|
+
return vue.openBlock(), vue.createBlock(_component_Col, {
|
|
1076
1139
|
key: col[_ctx.mForm?.keyProp || "__key"] ?? index,
|
|
1077
|
-
span: col.span || _ctx.config.span || 24 / _ctx.config.items.length
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
size: _ctx.size,
|
|
1087
|
-
onChange: _ctx.changeHandler
|
|
1088
|
-
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1089
|
-
]),
|
|
1090
|
-
_: 2
|
|
1091
|
-
}, 1032, ["style", "span"]);
|
|
1140
|
+
span: col.span || _ctx.config.span || 24 / _ctx.config.items.length,
|
|
1141
|
+
config: col,
|
|
1142
|
+
labelWidth: _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1143
|
+
expandMore: _ctx.expandMore,
|
|
1144
|
+
model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
|
|
1145
|
+
prop: _ctx.prop,
|
|
1146
|
+
size: _ctx.size,
|
|
1147
|
+
onChange: _ctx.changeHandler
|
|
1148
|
+
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "prop", "size", "onChange"]);
|
|
1092
1149
|
}), 128))
|
|
1093
1150
|
]),
|
|
1094
1151
|
_: 1
|
|
@@ -1547,7 +1604,7 @@
|
|
|
1547
1604
|
};
|
|
1548
1605
|
}
|
|
1549
1606
|
});
|
|
1550
|
-
const _hoisted_1$
|
|
1607
|
+
const _hoisted_1$a = ["innerHTML"];
|
|
1551
1608
|
const _hoisted_2$2 = { class: "el-form-item__content" };
|
|
1552
1609
|
const _hoisted_3$2 = ["innerHTML"];
|
|
1553
1610
|
const _hoisted_4$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0");
|
|
@@ -1576,7 +1633,7 @@
|
|
|
1576
1633
|
key: 0,
|
|
1577
1634
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1578
1635
|
innerHTML: _ctx.config.extra
|
|
1579
|
-
}, null, 8, _hoisted_1$
|
|
1636
|
+
}, null, 8, _hoisted_1$a)) : vue.createCommentVNode("", true),
|
|
1580
1637
|
vue.createElementVNode("div", _hoisted_2$2, [
|
|
1581
1638
|
vue.createVNode(_component_el_tooltip, {
|
|
1582
1639
|
content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
|
|
@@ -1617,8 +1674,8 @@
|
|
|
1617
1674
|
}, {
|
|
1618
1675
|
default: vue.withCtx((scope) => [
|
|
1619
1676
|
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
1620
|
-
|
|
1621
|
-
|
|
1677
|
+
type: "danger",
|
|
1678
|
+
text: "",
|
|
1622
1679
|
icon: _ctx.Delete,
|
|
1623
1680
|
onClick: ($event) => _ctx.removeHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1624
1681
|
}, null, 8, ["icon", "onClick"]), [
|
|
@@ -1642,8 +1699,9 @@
|
|
|
1642
1699
|
vue.createVNode(_component_el_button, {
|
|
1643
1700
|
plain: "",
|
|
1644
1701
|
size: "small",
|
|
1702
|
+
type: "primary",
|
|
1645
1703
|
icon: _ctx.ArrowUp,
|
|
1646
|
-
|
|
1704
|
+
text: "",
|
|
1647
1705
|
onClick: ($event) => _ctx.upHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1),
|
|
1648
1706
|
onDblclick: ($event) => _ctx.topHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1649
1707
|
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
@@ -1659,8 +1717,9 @@
|
|
|
1659
1717
|
vue.createVNode(_component_el_button, {
|
|
1660
1718
|
plain: "",
|
|
1661
1719
|
size: "small",
|
|
1720
|
+
type: "primary",
|
|
1662
1721
|
icon: _ctx.ArrowDown,
|
|
1663
|
-
|
|
1722
|
+
text: "",
|
|
1664
1723
|
onClick: ($event) => _ctx.downHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1),
|
|
1665
1724
|
onDblclick: ($event) => _ctx.bottomHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1666
1725
|
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
@@ -1737,6 +1796,7 @@
|
|
|
1737
1796
|
key: 1,
|
|
1738
1797
|
icon: _ctx.Grid,
|
|
1739
1798
|
size: "small",
|
|
1799
|
+
type: "primary",
|
|
1740
1800
|
onClick: _ctx.toggleMode
|
|
1741
1801
|
}, {
|
|
1742
1802
|
default: vue.withCtx(() => [
|
|
@@ -1748,6 +1808,7 @@
|
|
|
1748
1808
|
key: 2,
|
|
1749
1809
|
icon: _ctx.FullScreen,
|
|
1750
1810
|
size: "small",
|
|
1811
|
+
type: "primary",
|
|
1751
1812
|
onClick: _ctx.toggleFullscreen
|
|
1752
1813
|
}, {
|
|
1753
1814
|
default: vue.withCtx(() => [
|
|
@@ -2098,13 +2159,13 @@
|
|
|
2098
2159
|
};
|
|
2099
2160
|
}
|
|
2100
2161
|
});
|
|
2101
|
-
const _hoisted_1$
|
|
2162
|
+
const _hoisted_1$9 = {
|
|
2102
2163
|
class: "m-cascader",
|
|
2103
2164
|
style: { "width": "100%" }
|
|
2104
2165
|
};
|
|
2105
2166
|
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2106
2167
|
const _component_el_cascader = vue.resolveComponent("el-cascader");
|
|
2107
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2168
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
|
|
2108
2169
|
vue.createVNode(_component_el_cascader, {
|
|
2109
2170
|
modelValue: _ctx.model[_ctx.name],
|
|
2110
2171
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2144,7 +2205,7 @@
|
|
|
2144
2205
|
} else {
|
|
2145
2206
|
return props.config.activeValue;
|
|
2146
2207
|
}
|
|
2147
|
-
return
|
|
2208
|
+
return void 0;
|
|
2148
2209
|
}),
|
|
2149
2210
|
inactiveValue: vue.computed(() => {
|
|
2150
2211
|
if (typeof props.config.inactiveValue === "undefined") {
|
|
@@ -2154,7 +2215,7 @@
|
|
|
2154
2215
|
} else {
|
|
2155
2216
|
return props.config.inactiveValue;
|
|
2156
2217
|
}
|
|
2157
|
-
return
|
|
2218
|
+
return void 0;
|
|
2158
2219
|
}),
|
|
2159
2220
|
changeHandler(value) {
|
|
2160
2221
|
emit("change", value);
|
|
@@ -2227,7 +2288,7 @@
|
|
|
2227
2288
|
}
|
|
2228
2289
|
var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$e]]);
|
|
2229
2290
|
|
|
2230
|
-
const _hoisted_1$
|
|
2291
|
+
const _hoisted_1$8 = { key: 0 };
|
|
2231
2292
|
const __default__$2 = vue.defineComponent({
|
|
2232
2293
|
name: "m-fields-color-picker"
|
|
2233
2294
|
});
|
|
@@ -2247,7 +2308,7 @@
|
|
|
2247
2308
|
const changeHandler = (value) => emit("change", value);
|
|
2248
2309
|
return (_ctx, _cache) => {
|
|
2249
2310
|
const _component_el_color_picker = vue.resolveComponent("el-color-picker");
|
|
2250
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2311
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
|
|
2251
2312
|
vue.createVNode(_component_el_color_picker, {
|
|
2252
2313
|
modelValue: _ctx.model[_ctx.name],
|
|
2253
2314
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2283,10 +2344,10 @@
|
|
|
2283
2344
|
};
|
|
2284
2345
|
}
|
|
2285
2346
|
});
|
|
2286
|
-
const _hoisted_1$
|
|
2347
|
+
const _hoisted_1$7 = { key: 0 };
|
|
2287
2348
|
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2288
2349
|
const _component_el_date_picker = vue.resolveComponent("el-date-picker");
|
|
2289
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2350
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
|
|
2290
2351
|
vue.createVNode(_component_el_date_picker, {
|
|
2291
2352
|
modelValue: _ctx.model[_ctx.modelName],
|
|
2292
2353
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.modelName] = $event),
|
|
@@ -2390,10 +2451,10 @@
|
|
|
2390
2451
|
};
|
|
2391
2452
|
}
|
|
2392
2453
|
});
|
|
2393
|
-
const _hoisted_1$
|
|
2454
|
+
const _hoisted_1$6 = { key: 0 };
|
|
2394
2455
|
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2395
2456
|
const _component_el_date_picker = vue.resolveComponent("el-date-picker");
|
|
2396
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2457
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
|
|
2397
2458
|
vue.createVNode(_component_el_date_picker, {
|
|
2398
2459
|
modelValue: _ctx.model[_ctx.name],
|
|
2399
2460
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2410,7 +2471,7 @@
|
|
|
2410
2471
|
}
|
|
2411
2472
|
var DateTime = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
|
|
2412
2473
|
|
|
2413
|
-
const _hoisted_1$
|
|
2474
|
+
const _hoisted_1$5 = { key: 0 };
|
|
2414
2475
|
const __default__$1 = vue.defineComponent({
|
|
2415
2476
|
name: "m-fields-display"
|
|
2416
2477
|
});
|
|
@@ -2431,7 +2492,7 @@
|
|
|
2431
2492
|
}
|
|
2432
2493
|
useAddField(props.prop);
|
|
2433
2494
|
return (_ctx, _cache) => {
|
|
2434
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$
|
|
2495
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$5, vue.toDisplayString(_ctx.model[vue.unref(n)]), 1)) : vue.createCommentVNode("", true);
|
|
2435
2496
|
};
|
|
2436
2497
|
}
|
|
2437
2498
|
});
|
|
@@ -2501,12 +2562,12 @@
|
|
|
2501
2562
|
}
|
|
2502
2563
|
}
|
|
2503
2564
|
});
|
|
2504
|
-
const _hoisted_1$
|
|
2565
|
+
const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
|
|
2505
2566
|
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2506
2567
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
2507
2568
|
const _component_el_form_item = vue.resolveComponent("el-form-item");
|
|
2508
2569
|
const _component_el_form = vue.resolveComponent("el-form");
|
|
2509
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2570
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
2510
2571
|
vue.createVNode(_component_el_form, { size: "small" }, {
|
|
2511
2572
|
default: vue.withCtx(() => [
|
|
2512
2573
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Object.keys(_ctx.fieldMap.value), (key) => {
|
|
@@ -2628,7 +2689,7 @@
|
|
|
2628
2689
|
};
|
|
2629
2690
|
}
|
|
2630
2691
|
});
|
|
2631
|
-
const _hoisted_1$
|
|
2692
|
+
const _hoisted_1$3 = ["href"];
|
|
2632
2693
|
const _hoisted_2$1 = {
|
|
2633
2694
|
key: 2,
|
|
2634
2695
|
class: "m-fields-link"
|
|
@@ -2642,12 +2703,13 @@
|
|
|
2642
2703
|
target: "_blank",
|
|
2643
2704
|
href: _ctx.href,
|
|
2644
2705
|
style: vue.normalizeStyle(_ctx.config.css || {})
|
|
2645
|
-
}, vue.toDisplayString(_ctx.displayText), 13, _hoisted_1$
|
|
2706
|
+
}, vue.toDisplayString(_ctx.displayText), 13, _hoisted_1$3)) : _ctx.config.href && _ctx.disabled ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
2646
2707
|
key: 1,
|
|
2647
2708
|
style: vue.normalizeStyle(_ctx.config.disabledCss || {})
|
|
2648
2709
|
}, vue.toDisplayString(_ctx.displayText), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
|
|
2649
2710
|
vue.createVNode(_component_el_button, {
|
|
2650
|
-
|
|
2711
|
+
text: "",
|
|
2712
|
+
type: "primary",
|
|
2651
2713
|
onClick: _ctx.editHandler
|
|
2652
2714
|
}, {
|
|
2653
2715
|
default: vue.withCtx(() => [
|
|
@@ -2940,6 +3002,7 @@
|
|
|
2940
3002
|
vue.watch(() => mForm?.values, () => {
|
|
2941
3003
|
typeof props.config.options === "function" && Promise.resolve(props.config.options(mForm, {
|
|
2942
3004
|
model: props.model,
|
|
3005
|
+
prop: props.prop,
|
|
2943
3006
|
formValues: mForm?.values,
|
|
2944
3007
|
formValue: mForm?.values
|
|
2945
3008
|
})).then((data) => {
|
|
@@ -2989,11 +3052,11 @@
|
|
|
2989
3052
|
remote,
|
|
2990
3053
|
options,
|
|
2991
3054
|
moreLoadingVisible,
|
|
3055
|
+
popperClass: mForm?.popperClass,
|
|
3056
|
+
getOptions,
|
|
2992
3057
|
getRequestFuc() {
|
|
2993
3058
|
return getConfig("request");
|
|
2994
3059
|
},
|
|
2995
|
-
async getInitOption() {
|
|
2996
|
-
},
|
|
2997
3060
|
changeHandler(value) {
|
|
2998
3061
|
emit("change", value);
|
|
2999
3062
|
},
|
|
@@ -3010,10 +3073,6 @@
|
|
|
3010
3073
|
options.value = await getOptions();
|
|
3011
3074
|
}
|
|
3012
3075
|
},
|
|
3013
|
-
async editAfterAction() {
|
|
3014
|
-
pgIndex.value = 0;
|
|
3015
|
-
options.value = await getOptions();
|
|
3016
|
-
},
|
|
3017
3076
|
async remoteMethod(q) {
|
|
3018
3077
|
if (!localOptions.value.length) {
|
|
3019
3078
|
query.value = q;
|
|
@@ -3028,7 +3087,7 @@
|
|
|
3028
3087
|
};
|
|
3029
3088
|
}
|
|
3030
3089
|
});
|
|
3031
|
-
const _hoisted_1$
|
|
3090
|
+
const _hoisted_1$2 = { key: 2 };
|
|
3032
3091
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3033
3092
|
const _component_el_option = vue.resolveComponent("el-option");
|
|
3034
3093
|
const _component_el_option_group = vue.resolveComponent("el-option-group");
|
|
@@ -3042,6 +3101,7 @@
|
|
|
3042
3101
|
ref: "select",
|
|
3043
3102
|
clearable: "",
|
|
3044
3103
|
filterable: "",
|
|
3104
|
+
"popper-class": `m-select-popper ${_ctx.popperClass}`,
|
|
3045
3105
|
size: _ctx.size,
|
|
3046
3106
|
remote: _ctx.remote,
|
|
3047
3107
|
placeholder: _ctx.config.placeholder,
|
|
@@ -3049,21 +3109,21 @@
|
|
|
3049
3109
|
"value-key": _ctx.config.valueKey || "value",
|
|
3050
3110
|
"allow-create": _ctx.config.allowCreate,
|
|
3051
3111
|
disabled: _ctx.disabled,
|
|
3052
|
-
"remote-method": _ctx.remoteMethod,
|
|
3112
|
+
"remote-method": _ctx.config.remote && _ctx.remoteMethod,
|
|
3053
3113
|
onChange: _ctx.changeHandler,
|
|
3054
3114
|
onVisibleChange: _ctx.visibleHandler
|
|
3055
3115
|
}, {
|
|
3056
3116
|
default: vue.withCtx(() => [
|
|
3057
3117
|
_ctx.config.group ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.options, (group, index) => {
|
|
3058
3118
|
return vue.openBlock(), vue.createBlock(_component_el_option_group, {
|
|
3059
|
-
key:
|
|
3119
|
+
key: index,
|
|
3060
3120
|
label: group.label,
|
|
3061
3121
|
disabled: group.disabled
|
|
3062
3122
|
}, {
|
|
3063
3123
|
default: vue.withCtx(() => [
|
|
3064
3124
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(group.options, (item, index2) => {
|
|
3065
3125
|
return vue.openBlock(), vue.createBlock(_component_el_option, {
|
|
3066
|
-
key:
|
|
3126
|
+
key: index2,
|
|
3067
3127
|
label: item.label,
|
|
3068
3128
|
value: item.value,
|
|
3069
3129
|
disabled: item.disabled
|
|
@@ -3080,12 +3140,12 @@
|
|
|
3080
3140
|
disabled: option.disabled
|
|
3081
3141
|
}, null, 8, ["label", "value", "disabled"]);
|
|
3082
3142
|
}), 128)),
|
|
3083
|
-
_ctx.moreLoadingVisible ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3143
|
+
_ctx.moreLoadingVisible ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, null, 512)), [
|
|
3084
3144
|
[_directive_loading, true]
|
|
3085
3145
|
]) : vue.createCommentVNode("", true)
|
|
3086
3146
|
]),
|
|
3087
3147
|
_: 1
|
|
3088
|
-
}, 8, ["modelValue", "size", "remote", "placeholder", "multiple", "value-key", "allow-create", "disabled", "remote-method", "onChange", "onVisibleChange"])), [
|
|
3148
|
+
}, 8, ["modelValue", "popper-class", "size", "remote", "placeholder", "multiple", "value-key", "allow-create", "disabled", "remote-method", "onChange", "onVisibleChange"])), [
|
|
3089
3149
|
[_directive_loading, _ctx.loading]
|
|
3090
3150
|
]) : vue.createCommentVNode("", true);
|
|
3091
3151
|
}
|
|
@@ -3157,6 +3217,7 @@
|
|
|
3157
3217
|
},
|
|
3158
3218
|
emits: ["change", "input"],
|
|
3159
3219
|
setup(props, { emit }) {
|
|
3220
|
+
const mForm = vue.inject("mForm");
|
|
3160
3221
|
useAddField(props.prop);
|
|
3161
3222
|
const modelName = vue.computed(() => props.name || props.config.name || "");
|
|
3162
3223
|
return {
|
|
@@ -3165,12 +3226,10 @@
|
|
|
3165
3226
|
emit("change", v);
|
|
3166
3227
|
},
|
|
3167
3228
|
inputHandler(v) {
|
|
3168
|
-
const mForm = vue.inject("mForm");
|
|
3169
3229
|
emit("input", v);
|
|
3170
3230
|
mForm?.$emit("field-input", props.prop, v);
|
|
3171
3231
|
},
|
|
3172
3232
|
buttonClickHandler() {
|
|
3173
|
-
const mForm = vue.inject("mForm");
|
|
3174
3233
|
if (typeof props.config.append === "string")
|
|
3175
3234
|
return;
|
|
3176
3235
|
if (props.config.append?.handler) {
|
|
@@ -3234,7 +3293,7 @@
|
|
|
3234
3293
|
};
|
|
3235
3294
|
}
|
|
3236
3295
|
});
|
|
3237
|
-
const _hoisted_1$
|
|
3296
|
+
const _hoisted_1$1 = { key: 0 };
|
|
3238
3297
|
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3239
3298
|
const _component_el_button = vue.resolveComponent("el-button");
|
|
3240
3299
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
@@ -3252,17 +3311,18 @@
|
|
|
3252
3311
|
_ctx.config.append ? {
|
|
3253
3312
|
name: "append",
|
|
3254
3313
|
fn: vue.withCtx(() => [
|
|
3255
|
-
typeof _ctx.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$
|
|
3314
|
+
typeof _ctx.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$1, vue.toDisplayString(_ctx.config.append), 1)) : vue.createCommentVNode("", true),
|
|
3256
3315
|
typeof _ctx.config.append === "object" && _ctx.config.append.type === "button" ? (vue.openBlock(), vue.createBlock(_component_el_button, {
|
|
3257
3316
|
key: 1,
|
|
3258
3317
|
style: { "color": "#409eff" },
|
|
3259
|
-
|
|
3318
|
+
size: _ctx.size,
|
|
3319
|
+
onClick: vue.withModifiers(_ctx.buttonClickHandler, ["prevent"])
|
|
3260
3320
|
}, {
|
|
3261
3321
|
default: vue.withCtx(() => [
|
|
3262
3322
|
vue.createTextVNode(vue.toDisplayString(_ctx.config.append.text), 1)
|
|
3263
3323
|
]),
|
|
3264
3324
|
_: 1
|
|
3265
|
-
}, 8, ["onClick"])) : vue.createCommentVNode("", true)
|
|
3325
|
+
}, 8, ["size", "onClick"])) : vue.createCommentVNode("", true)
|
|
3266
3326
|
])
|
|
3267
3327
|
} : void 0
|
|
3268
3328
|
]), 1032, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
@@ -3301,22 +3361,19 @@
|
|
|
3301
3361
|
};
|
|
3302
3362
|
}
|
|
3303
3363
|
});
|
|
3304
|
-
const _hoisted_1$1 = { key: 0 };
|
|
3305
3364
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3306
3365
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
3307
|
-
return
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"])
|
|
3319
|
-
])) : vue.createCommentVNode("", true);
|
|
3366
|
+
return vue.openBlock(), vue.createBlock(_component_el_input, {
|
|
3367
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3368
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3369
|
+
type: "textarea",
|
|
3370
|
+
size: _ctx.size,
|
|
3371
|
+
clearable: "",
|
|
3372
|
+
placeholder: _ctx.config.placeholder,
|
|
3373
|
+
disabled: _ctx.disabled,
|
|
3374
|
+
onChange: _ctx.changeHandler,
|
|
3375
|
+
onInput: _ctx.inputHandler
|
|
3376
|
+
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
3320
3377
|
}
|
|
3321
3378
|
var Textarea = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
3322
3379
|
|
|
@@ -3406,6 +3463,9 @@
|
|
|
3406
3463
|
keyProp: {
|
|
3407
3464
|
type: String,
|
|
3408
3465
|
default: "__key"
|
|
3466
|
+
},
|
|
3467
|
+
popperClass: {
|
|
3468
|
+
type: String
|
|
3409
3469
|
}
|
|
3410
3470
|
},
|
|
3411
3471
|
emits: ["change", "field-input", "field-change"],
|
|
@@ -3417,6 +3477,7 @@
|
|
|
3417
3477
|
const requestFuc = getConfig("request");
|
|
3418
3478
|
const formState = vue.reactive({
|
|
3419
3479
|
keyProp: props.keyProp,
|
|
3480
|
+
popperClass: props.popperClass,
|
|
3420
3481
|
config: props.config,
|
|
3421
3482
|
initValues: props.initValues,
|
|
3422
3483
|
parentValues: props.parentValues,
|
|
@@ -3460,7 +3521,7 @@
|
|
|
3460
3521
|
submitForm: async (native) => {
|
|
3461
3522
|
try {
|
|
3462
3523
|
await elForm.value?.validate();
|
|
3463
|
-
return native ? values.value : lodashEs.cloneDeep(values.value);
|
|
3524
|
+
return native ? values.value : lodashEs.cloneDeep(vue.toRaw(values.value));
|
|
3464
3525
|
} catch (invalidFields) {
|
|
3465
3526
|
const error = [];
|
|
3466
3527
|
Object.entries(invalidFields).forEach(([, ValidateError]) => {
|
|
@@ -3787,8 +3848,7 @@
|
|
|
3787
3848
|
exports.initValue = initValue;
|
|
3788
3849
|
exports.useAddField = useAddField;
|
|
3789
3850
|
|
|
3790
|
-
Object.
|
|
3791
|
-
exports[Symbol.toStringTag] = 'Module';
|
|
3851
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
3792
3852
|
|
|
3793
3853
|
}));
|
|
3794
3854
|
//# sourceMappingURL=tmagic-form.umd.js.map
|