@form-create/iview 2.5.37 → 2.6.0

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.
@@ -0,0 +1,4231 @@
1
+ /*!
2
+ * FormCreate 低代码表单渲染器
3
+ * @form-create/iview v2.6.0
4
+ * (c) 2018-2024 xaboy
5
+ * Github https://github.com/xaboy/form-create
6
+ * Site https://form-create.com/
7
+ * Released under the MIT License.
8
+ */
9
+ (function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode('._fc-frame .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;transition:opacity .3s}._fc-frame .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-frame .fc-files:hover .fc-upload-cover{opacity:1}._fc-frame .ivu-upload-list{margin-top:0}._fc-frame .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame .fc-upload-btn,._fc-frame .fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;box-shadow:2px 2px 5px #0000001a;margin-right:4px;box-sizing:border-box}._fc-upload .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-upload .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;transition:opacity .3s}._fc-upload .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-upload .fc-files:hover .fc-upload-cover{opacity:1}._fc-upload .ivu-upload-list{margin-top:0}._fc-upload .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-upload .fc-upload-btn,._fc-upload .fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;box-shadow:2px 2px 5px #0000001a;margin-right:4px;box-sizing:border-box}._fc-group{display:flex;min-height:42px;justify-content:center;flex-direction:column}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;padding:20px 20px 25px;margin:5px 5px 25px;border-radius:5px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}.form-create .form-create .ivu-form-item{margin-bottom:24px}.form-create .form-create .ivu-form-item .ivu-form-item{margin-bottom:0}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
10
+ var bt = Object.defineProperty, Ct = Object.defineProperties;
11
+ var _t = Object.getOwnPropertyDescriptors;
12
+ var Se = Object.getOwnPropertySymbols;
13
+ var Ot = Object.prototype.hasOwnProperty, kt = Object.prototype.propertyIsEnumerable;
14
+ var Re = (t, e, r) => e in t ? bt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, y = (t, e) => {
15
+ for (var r in e || (e = {}))
16
+ Ot.call(e, r) && Re(t, r, e[r]);
17
+ if (Se)
18
+ for (var r of Se(e))
19
+ kt.call(e, r) && Re(t, r, e[r]);
20
+ return t;
21
+ }, H = (t, e) => Ct(t, _t(e));
22
+ import D, { h as p } from "vue";
23
+ function wt(t) {
24
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
25
+ }
26
+ function le() {
27
+ return le = Object.assign ? Object.assign.bind() : function(t) {
28
+ for (var e, r = 1; r < arguments.length; r++) for (var i in e = arguments[r], e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
29
+ return t;
30
+ }, le.apply(this, arguments);
31
+ }
32
+ var Ft = ["attrs", "props", "domProps"], St = ["class", "style", "directives"], Rt = ["on", "nativeOn"], Et = function(t) {
33
+ return t.reduce(function(e, r) {
34
+ for (var i in r) if (!e[i]) e[i] = r[i];
35
+ else if (Ft.indexOf(i) !== -1) e[i] = le({}, e[i], r[i]);
36
+ else if (St.indexOf(i) !== -1) {
37
+ var s = e[i] instanceof Array ? e[i] : [e[i]], n = r[i] instanceof Array ? r[i] : [r[i]];
38
+ e[i] = [].concat(s, n);
39
+ } else if (Rt.indexOf(i) !== -1)
40
+ for (var o in r[i]) if (e[i][o]) {
41
+ var a = e[i][o] instanceof Array ? e[i][o] : [e[i][o]], u = r[i][o] instanceof Array ? r[i][o] : [r[i][o]];
42
+ e[i][o] = [].concat(a, u);
43
+ } else e[i][o] = r[i][o];
44
+ else if (i === "hook") for (var l in r[i]) e[i][l] = e[i][l] ? It(e[i][l], r[i][l]) : r[i][l];
45
+ else e[i] = r[i];
46
+ return e;
47
+ }, {});
48
+ }, It = function(t, e) {
49
+ return function() {
50
+ t && t.apply(this, arguments), e && e.apply(this, arguments);
51
+ };
52
+ }, jt = Et;
53
+ const _ = /* @__PURE__ */ wt(jt);
54
+ function te(t, e) {
55
+ return Object.keys(t).reduce((r, i) => ((!e || e.indexOf(i) === -1) && r.push(t[i]), r), []);
56
+ }
57
+ const At = "fcCheckbox", Vt = {
58
+ name: At,
59
+ props: {
60
+ formCreateInject: {
61
+ type: Object,
62
+ required: !0
63
+ },
64
+ value: {
65
+ type: Array,
66
+ default: () => []
67
+ }
68
+ },
69
+ watch: {
70
+ "formCreateInject.options": {
71
+ handler() {
72
+ this.update();
73
+ },
74
+ deep: !0
75
+ },
76
+ value() {
77
+ this.update();
78
+ }
79
+ },
80
+ data() {
81
+ return {
82
+ trueValue: []
83
+ };
84
+ },
85
+ methods: {
86
+ options() {
87
+ const t = this.formCreateInject.options;
88
+ return Array.isArray(t) ? t : [];
89
+ },
90
+ onInput(t) {
91
+ this.$emit("input", this.options().filter((e) => t.indexOf(e.label) !== -1).map((e) => e.value).filter((e) => e !== void 0));
92
+ },
93
+ update() {
94
+ const t = Array.isArray(this.value) ? this.value : [this.value];
95
+ this.trueValue = this.options().filter((e) => t.indexOf(e.value) !== -1).map((e) => e.label);
96
+ }
97
+ },
98
+ created() {
99
+ this.update();
100
+ },
101
+ render() {
102
+ return p("CheckboxGroup", _([{}, this.formCreateInject.prop, {
103
+ ref: "el"
104
+ }, {
105
+ props: {
106
+ value: this.trueValue
107
+ }
108
+ }, {
109
+ on: {
110
+ input: this.onInput
111
+ }
112
+ }]), [this.options().map((t, e) => {
113
+ const r = y({}, t);
114
+ return delete r.value, p("Checkbox", _([{}, {
115
+ props: r
116
+ }, {
117
+ key: "" + e + "-" + t.value
118
+ }]));
119
+ }), te(this.$slots)]);
120
+ },
121
+ mounted() {
122
+ this.$emit("fc.el", this.$refs.el);
123
+ }
124
+ };
125
+ function j(t) {
126
+ return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
127
+ }
128
+ const Pt = "fcFrame";
129
+ function Ge(t) {
130
+ return {
131
+ name: Pt,
132
+ props: {
133
+ formCreateInject: {
134
+ type: Object,
135
+ required: !0
136
+ },
137
+ type: {
138
+ type: String,
139
+ default: "input"
140
+ },
141
+ field: String,
142
+ helper: {
143
+ type: Boolean,
144
+ default: !0
145
+ },
146
+ disabled: {
147
+ type: Boolean,
148
+ default: !1
149
+ },
150
+ src: {
151
+ type: String,
152
+ required: !0
153
+ },
154
+ icon: {
155
+ type: String,
156
+ default: t.fileUpIcon
157
+ },
158
+ width: {
159
+ type: [Number, String],
160
+ default: 500
161
+ },
162
+ height: {
163
+ type: String,
164
+ default: "370px"
165
+ },
166
+ maxLength: {
167
+ type: Number,
168
+ default: 0
169
+ },
170
+ okBtnText: {
171
+ type: String,
172
+ default: "确定"
173
+ },
174
+ closeBtnText: {
175
+ type: String,
176
+ default: "关闭"
177
+ },
178
+ modalTitle: String,
179
+ handleIcon: {
180
+ type: [String, Boolean],
181
+ default: void 0
182
+ },
183
+ title: String,
184
+ allowRemove: {
185
+ type: Boolean,
186
+ default: !0
187
+ },
188
+ onOpen: {
189
+ type: Function,
190
+ default: () => {
191
+ }
192
+ },
193
+ onOk: {
194
+ type: Function,
195
+ default: () => {
196
+ }
197
+ },
198
+ onCancel: {
199
+ type: Function,
200
+ default: () => {
201
+ }
202
+ },
203
+ onLoad: {
204
+ type: Function,
205
+ default: () => {
206
+ }
207
+ },
208
+ onBeforeRemove: {
209
+ type: Function,
210
+ default: () => {
211
+ }
212
+ },
213
+ onRemove: {
214
+ type: Function,
215
+ default: () => {
216
+ }
217
+ },
218
+ onHandle: {
219
+ type: Function,
220
+ default(e) {
221
+ this.previewImage = this.getSrc(e), this.previewVisible = !0;
222
+ }
223
+ },
224
+ modal: {
225
+ type: Object,
226
+ default: () => ({})
227
+ },
228
+ srcKey: {
229
+ type: [String, Number]
230
+ },
231
+ value: [Array, String, Number, Object],
232
+ previewMask: void 0,
233
+ footer: {
234
+ type: Boolean,
235
+ default: !0
236
+ },
237
+ reload: {
238
+ type: Boolean,
239
+ default: !0
240
+ },
241
+ closeBtn: {
242
+ type: Boolean,
243
+ default: !0
244
+ },
245
+ okBtn: {
246
+ type: Boolean,
247
+ default: !0
248
+ }
249
+ },
250
+ data() {
251
+ return {
252
+ fileList: j(this.value),
253
+ previewVisible: !1,
254
+ frameVisible: !1,
255
+ previewImage: ""
256
+ };
257
+ },
258
+ watch: {
259
+ value(e) {
260
+ this.fileList = j(e);
261
+ },
262
+ fileList(e) {
263
+ const r = this.maxLength === 1 ? e[0] || "" : e;
264
+ this.$emit("input", r), this.$emit("change", r);
265
+ },
266
+ src(e) {
267
+ this.modalVm && (this.modalVm.src = e);
268
+ }
269
+ },
270
+ methods: {
271
+ key(e) {
272
+ return e;
273
+ },
274
+ closeModel(e) {
275
+ this.$emit(e ? "$close" : "$ok"), this.reload && (this.$off("$ok"), this.$off("$close")), this.frameVisible = !1;
276
+ },
277
+ showModel() {
278
+ this.disabled || this.onOpen() === !1 || (this.frameVisible = !0);
279
+ },
280
+ makeInput() {
281
+ const e = {
282
+ type: "text",
283
+ value: this.fileList.map((r) => this.getSrc(r)).toString(),
284
+ icon: this.icon,
285
+ readonly: !0,
286
+ clearable: !1
287
+ };
288
+ return p("Input", _([{}, {
289
+ props: e
290
+ }, {}, {
291
+ on: {
292
+ "on-click": () => this.showModel()
293
+ }
294
+ }, {
295
+ key: this.key("input")
296
+ }]));
297
+ },
298
+ makeGroup(e) {
299
+ return (!this.maxLength || this.fileList.length < this.maxLength) && e.push(this.makeBtn()), p("div", {
300
+ key: this.key("group")
301
+ }, [...e]);
302
+ },
303
+ makeItem(e, r) {
304
+ return p("div", {
305
+ class: "fc-files",
306
+ key: this.key("file" + e)
307
+ }, [...r]);
308
+ },
309
+ valid(e) {
310
+ const r = this.formCreateInject.field || this.field;
311
+ if (r && e !== r) throw new Error("[frame]无效的字段值");
312
+ },
313
+ makeIcons(e, r) {
314
+ if (this.handleIcon !== !1 || this.allowRemove === !0) {
315
+ const i = [];
316
+ return (this.type !== "file" && this.handleIcon !== !1 || this.type === "file" && this.handleIcon) && i.push(this.makeHandleIcon(e, r)), this.allowRemove && i.push(this.makeRemoveIcon(e, r)), p("div", {
317
+ class: "fc-upload-cover",
318
+ key: this.key("uc")
319
+ }, [i]);
320
+ }
321
+ },
322
+ makeHandleIcon(e, r) {
323
+ return p("icon", _([{}, {
324
+ props: {
325
+ type: this.handleIcon === !0 || this.handleIcon === void 0 ? "ios-eye-outline" : this.handleIcon
326
+ }
327
+ }, {
328
+ on: {
329
+ click: () => this.handleClick(e)
330
+ },
331
+ key: this.key("hi" + r)
332
+ }]));
333
+ },
334
+ makeRemoveIcon(e, r) {
335
+ return p("icon", _([{}, {
336
+ props: {
337
+ type: "ios-trash-outline"
338
+ }
339
+ }, {
340
+ on: {
341
+ click: () => this.handleRemove(e)
342
+ },
343
+ key: this.key("ri" + r)
344
+ }]));
345
+ },
346
+ makeFiles() {
347
+ return this.makeGroup(this.fileList.map((e, r) => this.makeItem(r, [p("icon", _([{}, {
348
+ props: {
349
+ type: t.fileIcon,
350
+ size: 40
351
+ }
352
+ }, {
353
+ on: {
354
+ click: () => this.handleClick(e)
355
+ }
356
+ }])), this.makeIcons(e, r)])));
357
+ },
358
+ makeImages() {
359
+ return this.makeGroup(this.fileList.map((e, r) => this.makeItem(r, [p("img", {
360
+ attrs: {
361
+ src: this.getSrc(e)
362
+ }
363
+ }), this.makeIcons(e, r)])));
364
+ },
365
+ makeBtn() {
366
+ return p("div", {
367
+ class: "fc-upload-btn",
368
+ on: {
369
+ click: () => this.showModel()
370
+ },
371
+ key: this.key("btn")
372
+ }, [p("icon", _([{}, {
373
+ props: {
374
+ type: this.icon,
375
+ size: 20
376
+ }
377
+ }]))]);
378
+ },
379
+ handleClick(e) {
380
+ return this.onHandle(e);
381
+ },
382
+ handleRemove(e) {
383
+ this.disabled || this.onBeforeRemove(e) !== !1 && (this.fileList.splice(this.fileList.indexOf(e), 1), this.onRemove(e));
384
+ },
385
+ getSrc(e) {
386
+ return this.srcKey ? e[this.srcKey] : e;
387
+ },
388
+ frameLoad(e) {
389
+ this.onLoad(e);
390
+ try {
391
+ this.helper === !0 && (e.form_create_helper = {
392
+ api: this.formCreateInject.api,
393
+ close: (r) => {
394
+ this.valid(r), this.closeModel();
395
+ },
396
+ set: (r, i) => {
397
+ this.valid(r), this.disabled || this.$emit("input", i);
398
+ },
399
+ get: (r) => (this.valid(r), this.value),
400
+ onOk: (r) => this.$on("$ok", r),
401
+ onClose: (r) => this.$on("$close", r)
402
+ });
403
+ } catch (r) {
404
+ console.log(r);
405
+ }
406
+ },
407
+ makeFooter() {
408
+ const {
409
+ okBtnText: e,
410
+ closeBtnText: r,
411
+ closeBtn: i,
412
+ okBtn: s,
413
+ footer: n
414
+ } = this.$props, o = [];
415
+ return n && (i && o.push(p("Button", {
416
+ on: {
417
+ click: () => this.onCancel() !== !1 && this.closeModel(!0)
418
+ }
419
+ }, [r])), s && o.push(p("Button", {
420
+ attrs: {
421
+ type: "primary"
422
+ },
423
+ on: {
424
+ click: () => this.onOk() !== !1 && this.closeModel()
425
+ }
426
+ }, [e]))), o;
427
+ }
428
+ },
429
+ render() {
430
+ const e = this.type;
431
+ let r;
432
+ e === "input" ? r = this.makeInput() : e === "image" ? r = this.makeImages() : r = this.makeFiles();
433
+ const {
434
+ width: i,
435
+ height: s,
436
+ src: n,
437
+ title: o,
438
+ modalTitle: a
439
+ } = this.$props;
440
+ return this.$nextTick(() => {
441
+ this.$refs.frame && this.frameLoad(this.$refs.frame.contentWindow || {});
442
+ }), p("div", {
443
+ class: "_fc-frame"
444
+ }, [r, p("Modal", _([{}, {
445
+ props: {
446
+ mask: this.previewMask,
447
+ title: a,
448
+ footerHide: !0
449
+ }
450
+ }, {
451
+ model: {
452
+ value: this.previewVisible,
453
+ callback: (u) => {
454
+ this.previewVisible = u;
455
+ }
456
+ }
457
+ }]), [p("img", {
458
+ style: "width: 100%",
459
+ attrs: {
460
+ src: this.previewImage
461
+ }
462
+ })]), p("Modal", _([{}, {
463
+ props: y({
464
+ width: i,
465
+ title: o
466
+ }, this.modal)
467
+ }, {
468
+ on: {
469
+ "on-cancel": () => this.closeModel(!0)
470
+ },
471
+ model: {
472
+ value: this.frameVisible,
473
+ callback: (u) => {
474
+ this.frameVisible = u;
475
+ }
476
+ }
477
+ }]), [this.frameVisible || !this.reload ? p("iframe", {
478
+ ref: "frame",
479
+ attrs: {
480
+ src: n,
481
+ frameBorder: "0"
482
+ },
483
+ style: {
484
+ height: s,
485
+ border: "0 none",
486
+ width: "100%"
487
+ }
488
+ }) : null, p("div", {
489
+ slot: "footer"
490
+ }, [this.makeFooter()])])]);
491
+ },
492
+ mounted() {
493
+ this.$on("fc.closeModal", this.closeModal);
494
+ }
495
+ };
496
+ }
497
+ const Ke = Ge({
498
+ fileIcon: "md-document",
499
+ fileUpIcon: "ios-folder-open"
500
+ });
501
+ Ke.v2 = Ge({
502
+ fileIcon: "document-text",
503
+ fileUpIcon: "folder"
504
+ });
505
+ const Dt = "fcRadio", Tt = {
506
+ name: Dt,
507
+ props: {
508
+ formCreateInject: {
509
+ type: Object,
510
+ required: !0
511
+ },
512
+ value: {}
513
+ },
514
+ watch: {
515
+ "formCreateInject.options": {
516
+ handler() {
517
+ this.update();
518
+ },
519
+ deep: !0
520
+ },
521
+ value() {
522
+ this.update();
523
+ }
524
+ },
525
+ data() {
526
+ return {
527
+ trueValue: []
528
+ };
529
+ },
530
+ methods: {
531
+ options() {
532
+ const t = this.formCreateInject.options;
533
+ return Array.isArray(t) ? t : [];
534
+ },
535
+ onInput(t) {
536
+ this.$emit("input", this.options().filter((e) => e.label === t).reduce((e, r) => r.value, ""));
537
+ },
538
+ update() {
539
+ this.trueValue = this.options().filter((t) => t.value === this.value).reduce((t, e) => e.label, "");
540
+ }
541
+ },
542
+ created() {
543
+ this.update();
544
+ },
545
+ render() {
546
+ return p("RadioGroup", _([{}, this.formCreateInject.prop, {}, {
547
+ props: {
548
+ value: this.trueValue
549
+ }
550
+ }, {
551
+ ref: "el",
552
+ on: {
553
+ input: this.onInput
554
+ }
555
+ }]), [this.options().map((t, e) => {
556
+ const r = y({}, t);
557
+ return delete r.value, p("Radio", _([{}, {
558
+ props: r
559
+ }, {
560
+ key: "" + e + "-" + t.value
561
+ }]));
562
+ }), te(this.$slots)]);
563
+ },
564
+ mounted() {
565
+ this.$emit("fc.el", this.$refs.el);
566
+ }
567
+ }, h = {
568
+ type(t, e) {
569
+ return Object.prototype.toString.call(t) === "[object " + e + "]";
570
+ },
571
+ Undef(t) {
572
+ return t == null;
573
+ },
574
+ Element(t) {
575
+ return typeof t == "object" && t !== null && t.nodeType === 1 && !h.Object(t);
576
+ },
577
+ trueArray(t) {
578
+ return Array.isArray(t) && t.length > 0;
579
+ },
580
+ Function(t) {
581
+ const e = this.getType(t);
582
+ return e === "Function" || e === "AsyncFunction";
583
+ },
584
+ getType(t) {
585
+ const e = Object.prototype.toString.call(t);
586
+ return /^\[object (.*)\]$/.exec(e)[1];
587
+ },
588
+ empty(t) {
589
+ return t == null || Array.isArray(t) && Array.isArray(t) && !t.length ? !0 : typeof t == "string" && !t;
590
+ }
591
+ };
592
+ ["Date", "Object", "String", "Boolean", "Array", "Number"].forEach((t) => {
593
+ h[t] = function(e) {
594
+ return h.type(e, t);
595
+ };
596
+ });
597
+ function w(t, e) {
598
+ return {}.hasOwnProperty.call(t, e);
599
+ }
600
+ const Bt = "fcSelect", Lt = {
601
+ name: Bt,
602
+ functional: !0,
603
+ props: {
604
+ formCreateInject: {
605
+ type: Object,
606
+ required: !0
607
+ }
608
+ },
609
+ render(t, e) {
610
+ const r = (n, o) => {
611
+ const a = n.slot;
612
+ return t("Option", _([{}, {
613
+ props: n
614
+ }, {
615
+ key: "" + o + "-" + n.value
616
+ }]), [a ? t("template", {
617
+ slot: n.slotName || "default"
618
+ }, [h.Function(a) ? n.slot(t) : a]) : null]);
619
+ }, i = (n, o) => t("OptionGroup", {
620
+ attrs: {
621
+ label: n.label
622
+ },
623
+ key: "" + o + "-" + n.label
624
+ }, [h.trueArray(n.options) && n.options.map((a, u) => r(a, u))]), s = e.props.formCreateInject.options;
625
+ return t("Select", _([{}, e.data, {
626
+ ref: "el"
627
+ }]), [(Array.isArray(s) ? s : []).map((n, o) => w(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
628
+ },
629
+ mounted() {
630
+ this.$emit("fc.el", this.$refs.el);
631
+ }
632
+ }, Nt = "fcTree", Mt = {
633
+ name: Nt,
634
+ props: {
635
+ formCreateInject: {
636
+ type: Object,
637
+ required: !0
638
+ },
639
+ type: {
640
+ type: String,
641
+ default: "checked"
642
+ },
643
+ value: {
644
+ type: [Array, String, Number],
645
+ default: () => []
646
+ }
647
+ },
648
+ data() {
649
+ return {
650
+ treeData: []
651
+ };
652
+ },
653
+ watch: {
654
+ value(t) {
655
+ this.setStatus(t);
656
+ }
657
+ },
658
+ created() {
659
+ this.setStatus(this.value);
660
+ },
661
+ methods: {
662
+ setStatus(t) {
663
+ const e = j(t), r = this.formCreateInject.prop.props.data;
664
+ this.type === "selected" ? this.checked(r, e, "selected") : this.checked(r, e, "checked"), this.$forceUpdate();
665
+ },
666
+ checked(t, e, r) {
667
+ t.forEach((i) => {
668
+ this.$set(i, r, e.indexOf(i.id) !== -1), i.children !== void 0 && Array.isArray(i.children) && this.checked(i.children, e, r);
669
+ });
670
+ },
671
+ onInput(t) {
672
+ this.$emit("input", t.map((e) => e.id));
673
+ }
674
+ },
675
+ render() {
676
+ const t = {};
677
+ return this.type === "selected" ? t["on-select-change"] = this.onInput : t["on-check-change"] = this.onInput, p("Tree", _([{}, this.formCreateInject.prop, {
678
+ ref: "tree"
679
+ }, {
680
+ on: t
681
+ }]), [te(this.$slots)]);
682
+ },
683
+ mounted() {
684
+ this.$emit("fc.el", this.$refs.tree);
685
+ }
686
+ };
687
+ function Ee(t) {
688
+ return {
689
+ url: t,
690
+ name: Ut(t)
691
+ };
692
+ }
693
+ function Ut(t) {
694
+ return ("" + t).split("/").pop();
695
+ }
696
+ const qt = "fcUpload";
697
+ function Xe(t) {
698
+ return {
699
+ name: qt,
700
+ props: {
701
+ formCreateInject: {
702
+ type: Object,
703
+ required: !0
704
+ },
705
+ onHandle: {
706
+ type: Function,
707
+ default(e) {
708
+ this.previewImage = e.url, this.previewVisible = !0;
709
+ }
710
+ },
711
+ uploadType: {
712
+ type: String,
713
+ default: "file"
714
+ },
715
+ maxLength: {
716
+ type: Number,
717
+ default: 0
718
+ },
719
+ allowRemove: {
720
+ type: Boolean,
721
+ default: !0
722
+ },
723
+ modalTitle: String,
724
+ handleIcon: {
725
+ type: [String, Boolean],
726
+ default: () => {
727
+ }
728
+ },
729
+ value: [Array, String]
730
+ },
731
+ data() {
732
+ return {
733
+ uploadList: [],
734
+ previewVisible: !1,
735
+ previewImage: "",
736
+ cacheFiles: []
737
+ };
738
+ },
739
+ created() {
740
+ this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = !1), this.formCreateInject.prop.props.defaultFileList = j(this.value).map(Ee);
741
+ },
742
+ watch: {
743
+ value(e) {
744
+ this.$refs.upload.fileList.every((r) => !r.status || r.status === "finished") && (this.$refs.upload.fileList = j(e).map(Ee), this.uploadList = this.$refs.upload.fileList);
745
+ },
746
+ maxLength(e, r) {
747
+ (r === 1 || e === 1) && this.update();
748
+ }
749
+ },
750
+ methods: {
751
+ key(e) {
752
+ return e;
753
+ },
754
+ isDisabled() {
755
+ return this.formCreateInject.prop.props.disabled === !0;
756
+ },
757
+ onRemove(e) {
758
+ this.isDisabled() || this.$refs.upload.handleRemove(e);
759
+ },
760
+ handleClick(e) {
761
+ this.onHandle(e);
762
+ },
763
+ makeItem(e, r) {
764
+ return this.uploadType === "image" ? p("img", {
765
+ attrs: {
766
+ src: e.url
767
+ },
768
+ key: this.key("img" + r)
769
+ }) : p("icon", _([{}, {
770
+ props: {
771
+ type: t.fileIcon,
772
+ size: 40
773
+ }
774
+ }, {
775
+ key: this.key("i" + r)
776
+ }]));
777
+ },
778
+ makeRemoveIcon(e, r) {
779
+ return p("icon", {
780
+ attrs: {
781
+ type: "ios-trash-outline"
782
+ },
783
+ on: {
784
+ click: () => this.onRemove(e)
785
+ },
786
+ key: this.key("ri" + r)
787
+ });
788
+ },
789
+ makeHandleIcon(e, r) {
790
+ return p("icon", {
791
+ attrs: {
792
+ type: this.handleIcon === !0 || this.handleIcon === void 0 ? "ios-eye-outline" : this.handleIcon
793
+ },
794
+ on: {
795
+ click: () => this.handleClick(e)
796
+ },
797
+ key: this.key("hi" + r)
798
+ });
799
+ },
800
+ makeProgress(e, r) {
801
+ return p("Progress", _([{}, {
802
+ props: {
803
+ percent: e.percentage,
804
+ hideInfo: !0
805
+ }
806
+ }, {
807
+ style: "width:90%",
808
+ key: this.key("pg" + r)
809
+ }]));
810
+ },
811
+ makeIcons(e, r) {
812
+ const i = [];
813
+ if (this.allowRemove || this.handleIcon !== !1)
814
+ return (this.uploadType !== "file" && this.handleIcon !== !1 || this.uploadType === "file" && this.handleIcon) && i.push(this.makeHandleIcon(e, r)), this.allowRemove && i.push(this.makeRemoveIcon(e, r)), p("div", {
815
+ class: "fc-upload-cover"
816
+ }, [i]);
817
+ },
818
+ makeFiles() {
819
+ return this.uploadList.map((e, r) => this.$scopedSlots.fileList ? this.$scopedSlots.fileList({
820
+ file: e,
821
+ index: r,
822
+ vm: this
823
+ }) : p("div", {
824
+ key: this.key(r),
825
+ class: "fc-files"
826
+ }, [e.showProgress ? this.makeProgress(e, r) : [this.makeItem(e, r), this.makeIcons(e, r)]]));
827
+ },
828
+ makeUpload() {
829
+ const e = !this.maxLength || this.maxLength > this.uploadList.length;
830
+ return p("Upload", _([{}, this.formCreateInject.prop, {}, {
831
+ style: {
832
+ display: "inline-block"
833
+ },
834
+ key: this.key("upload"),
835
+ ref: "upload"
836
+ }]), [e ? p("template", {
837
+ slot: "default"
838
+ }, [this.$slots.default || p("div", {
839
+ class: "fc-upload-btn"
840
+ }, [p("icon", _([{}, {
841
+ props: {
842
+ type: this.uploadType === "file" ? "ios-cloud-upload-outline" : t.imgUpIcon,
843
+ size: 20
844
+ }
845
+ }]))])]) : null, te(this.$slots, ["default"])]);
846
+ },
847
+ update() {
848
+ let e = this.$refs.upload.fileList.map((r) => r.url).filter((r) => r !== void 0);
849
+ (this.cacheFiles.length !== e.length || !e.length) && (this.cacheFiles = [...e], this.$emit("input", this.maxLength === 1 ? e[0] || "" : e));
850
+ },
851
+ handleCancel() {
852
+ this.previewVisible = !1;
853
+ }
854
+ },
855
+ render() {
856
+ return this.$refs.upload && (this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = this.$refs.upload.showUploadList), this.formCreateInject.prop.props.defaultFileList = this.$refs.upload.defaultFileList), p("div", {
857
+ class: "_fc-upload"
858
+ }, [[this.formCreateInject.prop.props.showUploadList ? [] : this.makeFiles(), this.makeUpload()], p("Modal", _([{}, {
859
+ props: {
860
+ title: this.modalTitle,
861
+ footerHide: !0
862
+ }
863
+ }, {
864
+ model: {
865
+ value: this.previewVisible,
866
+ callback: (e) => {
867
+ this.previewVisible = e;
868
+ }
869
+ }
870
+ }]), [p("img", {
871
+ attrs: {
872
+ alt: "example",
873
+ src: this.previewImage
874
+ },
875
+ style: "width: 100%"
876
+ })])]);
877
+ },
878
+ mounted() {
879
+ this.uploadList = this.$refs.upload.fileList, this.$watch(() => this.$refs.upload.fileList, () => {
880
+ this.update();
881
+ }, {
882
+ deep: !0
883
+ }), this.$emit("fc.el", this.$refs.upload);
884
+ }
885
+ };
886
+ }
887
+ const Qe = Xe({
888
+ fileIcon: "md-document",
889
+ imgUpIcon: "md-images"
890
+ });
891
+ Qe.v2 = Xe({
892
+ fileIcon: "document-text",
893
+ imgUpIcon: "image"
894
+ });
895
+ function F(t, e, r) {
896
+ D.set(t, e, r);
897
+ }
898
+ function B(t, e) {
899
+ D.delete(t, e);
900
+ }
901
+ function x(t, e = {}, r) {
902
+ let i = !1;
903
+ for (let s in e)
904
+ if (Object.prototype.hasOwnProperty.call(e, s)) {
905
+ let n = e[s];
906
+ if ((i = Array.isArray(n)) || h.Object(n)) {
907
+ let o = t[s] === void 0;
908
+ if (i)
909
+ i = !1, o && F(t, s, []);
910
+ else if (n._clone && r !== void 0)
911
+ if (r)
912
+ n = n.getRule(), o && F(t, s, {});
913
+ else {
914
+ F(t, s, n._clone());
915
+ continue;
916
+ }
917
+ else
918
+ o && F(t, s, {});
919
+ t[s] = x(t[s], n, r);
920
+ } else
921
+ F(t, s, n), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.Undef(n.__origin) || (t[s].__origin = n.__origin));
922
+ }
923
+ return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
924
+ }
925
+ function L(t) {
926
+ return x({}, { value: t }).value;
927
+ }
928
+ const Ht = Object.assign || function(t) {
929
+ for (let e, r = 1; r < arguments.length; r++)
930
+ for (let i in e = arguments[r], e)
931
+ Object.prototype.hasOwnProperty.call(e, i) && F(t, i, e[i]);
932
+ return t;
933
+ };
934
+ function m() {
935
+ return Ht.apply(this, arguments);
936
+ }
937
+ const Jt = "fcGroup", zt = {
938
+ name: Jt,
939
+ props: {
940
+ field: String,
941
+ rule: [Array, Object],
942
+ rules: Array,
943
+ expand: Number,
944
+ options: Object,
945
+ formCreateInject: {
946
+ type: Object,
947
+ required: !0
948
+ },
949
+ button: {
950
+ type: Boolean,
951
+ default: !0
952
+ },
953
+ max: {
954
+ type: Number,
955
+ default: 0
956
+ },
957
+ min: {
958
+ type: Number,
959
+ default: 0
960
+ },
961
+ value: {
962
+ type: Array,
963
+ default: () => []
964
+ },
965
+ sortBtn: {
966
+ type: Boolean,
967
+ default: !0
968
+ },
969
+ defaultValue: Object,
970
+ disabled: {
971
+ type: Boolean,
972
+ default: !1
973
+ },
974
+ syncDisabled: {
975
+ type: Boolean,
976
+ default: !0
977
+ },
978
+ onBeforeRemove: {
979
+ type: Function,
980
+ default: () => {
981
+ }
982
+ },
983
+ onBeforeAdd: {
984
+ type: Function,
985
+ default: () => {
986
+ }
987
+ },
988
+ parse: Function
989
+ },
990
+ data() {
991
+ return {
992
+ len: 0,
993
+ cacheRule: {},
994
+ cacheValue: {},
995
+ sort: [],
996
+ type: void 0
997
+ };
998
+ },
999
+ computed: {
1000
+ formRule() {
1001
+ return this.rules ? this.rules : this.rule ? Array.isArray(this.rule) ? this.rule : [this.rule] : [];
1002
+ }
1003
+ },
1004
+ watch: {
1005
+ cacheRule: {
1006
+ handler(t) {
1007
+ this.sort = Object.keys(t);
1008
+ },
1009
+ immediate: !0
1010
+ },
1011
+ formRule: {
1012
+ handler(t, e) {
1013
+ Object.keys(this.cacheRule).forEach((r) => {
1014
+ const i = this.cacheRule[r];
1015
+ if (i.$f) {
1016
+ const s = i.$f.formData();
1017
+ if (t === e)
1018
+ i.$f.deferSyncValue(() => {
1019
+ x(i.rule, t), i.$f.setValue(s);
1020
+ }, !0);
1021
+ else {
1022
+ const n = i.$f.formData();
1023
+ i.$f.once("reloading", () => {
1024
+ i.$f.setValue(n);
1025
+ }), i.rule = L(t);
1026
+ }
1027
+ }
1028
+ });
1029
+ },
1030
+ deep: !0
1031
+ },
1032
+ expand(t) {
1033
+ let e = t - this.value.length;
1034
+ e > 0 && this.expandRule(e);
1035
+ },
1036
+ value(t, e) {
1037
+ t = t || [];
1038
+ let r = this.sort, i = r.length, s = i - t.length;
1039
+ if (s < 0) {
1040
+ for (let n = s; n < 0; n++)
1041
+ this.addRule(t.length + n);
1042
+ this.sort = Object.keys(this.cacheRule);
1043
+ for (let n = 0; n < i; n++)
1044
+ this.setValue(r[n], t[n]);
1045
+ } else {
1046
+ if (s > 0)
1047
+ for (let n = 0; n < s; n++)
1048
+ this.removeRule(r[i - n - 1]);
1049
+ this.sort = Object.keys(this.cacheRule), t.forEach((n, o) => {
1050
+ this.setValue(r[o], t[o]);
1051
+ });
1052
+ }
1053
+ }
1054
+ },
1055
+ methods: {
1056
+ _value(t) {
1057
+ return t && w(t, this.field) ? t[this.field] : t;
1058
+ },
1059
+ cache(t, e) {
1060
+ this.cacheValue[t] = JSON.stringify(e);
1061
+ },
1062
+ input(t) {
1063
+ this.$emit("input", t), this.$emit("change", t);
1064
+ },
1065
+ formData(t, e) {
1066
+ const r = this.cacheRule, i = this.sort;
1067
+ if (i.filter((n) => r[n].$f).length !== i.length)
1068
+ return;
1069
+ const s = i.map((n) => {
1070
+ const o = t === n ? e : y({}, this.cacheRule[n].$f.form), a = this.field ? o[this.field] || null : o;
1071
+ return this.cache(n, a), a;
1072
+ });
1073
+ this.input(s);
1074
+ },
1075
+ setValue(t, e) {
1076
+ const r = this.field, i = this.cacheRule[t].$f;
1077
+ r && (e = {
1078
+ [r]: this._value(e)
1079
+ }), this.cacheValue[t] !== JSON.stringify(r ? e[r] : e) && (this.cache(t, e), i && i.coverValue(e || {}));
1080
+ },
1081
+ addRule(t, e) {
1082
+ const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ? y({}, this.options) : {
1083
+ submitBtn: !1,
1084
+ resetBtn: !1
1085
+ };
1086
+ if (this.defaultValue) {
1087
+ i.formData || (i.formData = {});
1088
+ const s = L(this.defaultValue);
1089
+ m(i.formData, this.field ? {
1090
+ [this.field]: s
1091
+ } : s);
1092
+ }
1093
+ this.parse && this.parse({
1094
+ rule: r,
1095
+ options: i,
1096
+ index: this.sort.length
1097
+ }), this.$set(this.cacheRule, ++this.len, {
1098
+ rule: r,
1099
+ options: i
1100
+ }), e && this.$nextTick(() => this.$emit("add", r, Object.keys(this.cacheRule).length - 1));
1101
+ },
1102
+ add$f(t, e, r) {
1103
+ this.cacheRule[e].$f = r, this.$nextTick(() => {
1104
+ this.$emit("itemMounted", r, Object.keys(this.cacheRule).indexOf(e));
1105
+ });
1106
+ },
1107
+ removeRule(t, e) {
1108
+ const r = Object.keys(this.cacheRule).indexOf(t);
1109
+ this.$delete(this.cacheRule, t), this.$delete(this.cacheValue, t), e && this.$nextTick(() => this.$emit("remove", r));
1110
+ },
1111
+ add(t) {
1112
+ this.disabled || this.onBeforeAdd(this.value) === !1 || this.addRule(t, !0);
1113
+ },
1114
+ del(t, e) {
1115
+ if (this.disabled || this.onBeforeRemove(this.value, t) === !1)
1116
+ return;
1117
+ this.removeRule(e, !0);
1118
+ const r = [...this.value];
1119
+ r.splice(t, 1), this.input(r);
1120
+ },
1121
+ addIcon(t) {
1122
+ return p("div", {
1123
+ class: "_fc-group-btn _fc-group-plus-minus",
1124
+ on: {
1125
+ click: this.add
1126
+ }
1127
+ });
1128
+ },
1129
+ delIcon(t, e) {
1130
+ return p("div", {
1131
+ class: "_fc-group-btn _fc-group-plus-minus _fc-group-minus",
1132
+ on: {
1133
+ click: () => this.del(t, e)
1134
+ }
1135
+ });
1136
+ },
1137
+ sortUpIcon(t) {
1138
+ return p("div", {
1139
+ class: "_fc-group-btn _fc-group-arrow _fc-group-up",
1140
+ on: {
1141
+ click: () => this.changeSort(t, -1)
1142
+ }
1143
+ });
1144
+ },
1145
+ sortDownIcon(t) {
1146
+ return p("div", {
1147
+ class: "_fc-group-btn _fc-group-arrow _fc-group-down",
1148
+ on: {
1149
+ click: () => this.changeSort(t, 1)
1150
+ }
1151
+ });
1152
+ },
1153
+ changeSort(t, e) {
1154
+ const r = this.sort[t];
1155
+ this.$set(this.sort, t, this.sort[t + e]), this.sort[t + e] = r, this.formData(0);
1156
+ },
1157
+ makeIcon(t, e, r) {
1158
+ if (this.$scopedSlots.button)
1159
+ return this.$scopedSlots.button({
1160
+ total: t,
1161
+ index: e,
1162
+ vm: this,
1163
+ key: r,
1164
+ del: () => this.del(e, r),
1165
+ add: this.add
1166
+ });
1167
+ const i = [];
1168
+ return (!this.max || t < this.max) && t === e + 1 && i.push(this.addIcon(r)), t > this.min && i.push(this.delIcon(e, r)), this.sortBtn && e && i.push(this.sortUpIcon(e)), this.sortBtn && e !== t - 1 && i.push(this.sortDownIcon(e)), i;
1169
+ },
1170
+ emitEvent(t, e, r, i) {
1171
+ this.$emit(t, ...e, this.cacheRule[i].$f, r);
1172
+ },
1173
+ expandRule(t) {
1174
+ for (let e = 0; e < t; e++)
1175
+ this.value.push(this.field ? null : {});
1176
+ }
1177
+ },
1178
+ created() {
1179
+ this.type = this.formCreateInject.form.$form();
1180
+ const t = (this.expand || 0) - this.value.length;
1181
+ t > 0 && this.expandRule(t);
1182
+ for (let e = 0; e < this.value.length; e++)
1183
+ this.addRule(e);
1184
+ },
1185
+ render() {
1186
+ const t = this.sort, e = this.button, r = this.type, i = this.disabled, s = t.length === 0 ? this.$scopedSlots.default ? this.$scopedSlots.default({
1187
+ vm: this,
1188
+ add: this.add
1189
+ }) : p("div", {
1190
+ key: "a_def",
1191
+ class: "_fc-group-plus-minus _fc-group-add",
1192
+ on: {
1193
+ click: this.add
1194
+ }
1195
+ }) : t.map((n, o) => {
1196
+ const {
1197
+ rule: a,
1198
+ options: u
1199
+ } = this.cacheRule[n], l = e && !i ? this.makeIcon(t.length, o, n) : [];
1200
+ return p("div", {
1201
+ class: "_fc-group-container",
1202
+ key: n
1203
+ }, [p(r, _([{
1204
+ key: n
1205
+ }, {
1206
+ on: {
1207
+ "update:value": (c) => this.formData(n, c),
1208
+ "emit-event": (c, ...g) => this.emitEvent(c, g, o, n),
1209
+ input: (c) => this.add$f(o, n, c)
1210
+ }
1211
+ }, {}, {
1212
+ props: {
1213
+ disabled: i,
1214
+ inFor: !0,
1215
+ value: this.field ? {
1216
+ [this.field]: this._value(this.value[o])
1217
+ } : this.value[o],
1218
+ rule: a,
1219
+ option: u,
1220
+ extendOption: !0
1221
+ }
1222
+ }])), p("div", {
1223
+ class: "_fc-group-idx"
1224
+ }, [o + 1]), l.length ? p("div", {
1225
+ class: "_fc-group-handle"
1226
+ }, [l]) : null]);
1227
+ });
1228
+ return p("div", {
1229
+ key: "con",
1230
+ class: "_fc-group " + (i ? "_fc-group-disabled" : "")
1231
+ }, [s]);
1232
+ }
1233
+ }, Wt = "fcSubForm", xt = {
1234
+ name: Wt,
1235
+ props: {
1236
+ rule: Array,
1237
+ options: Object,
1238
+ formCreateInject: {
1239
+ type: Object,
1240
+ required: !0
1241
+ },
1242
+ value: {
1243
+ type: Object,
1244
+ default: () => ({})
1245
+ },
1246
+ disabled: {
1247
+ type: Boolean,
1248
+ default: !1
1249
+ },
1250
+ syncDisabled: {
1251
+ type: Boolean,
1252
+ default: !0
1253
+ }
1254
+ },
1255
+ data() {
1256
+ return {
1257
+ cacheRule: {},
1258
+ cacheValue: {},
1259
+ type: void 0
1260
+ };
1261
+ },
1262
+ watch: {
1263
+ value(t) {
1264
+ this.setValue(t);
1265
+ }
1266
+ },
1267
+ methods: {
1268
+ formData(t) {
1269
+ this.cacheValue = JSON.stringify(t), this.$emit("input", t), this.$emit("change", t);
1270
+ },
1271
+ setValue(t) {
1272
+ const e = JSON.stringify(t);
1273
+ this.cacheValue !== e && (this.cacheValue = e, this.cacheRule.$f.coverValue(t || {}));
1274
+ },
1275
+ addRule() {
1276
+ const t = this.options ? this.options : {
1277
+ submitBtn: !1,
1278
+ resetBtn: !1
1279
+ };
1280
+ t.formData = y({}, this.value || {}), this.cacheRule = {
1281
+ rule: this.rule,
1282
+ options: t
1283
+ };
1284
+ },
1285
+ add$f(t) {
1286
+ this.cacheRule.$f = t, this.$nextTick(() => {
1287
+ this.$emit("itemMounted", t);
1288
+ });
1289
+ },
1290
+ emitEvent(t, ...e) {
1291
+ this.$emit(t, ...e);
1292
+ }
1293
+ },
1294
+ created() {
1295
+ this.addRule(), this.type = this.formCreateInject.form.$form();
1296
+ },
1297
+ render() {
1298
+ const {
1299
+ rule: t,
1300
+ options: e
1301
+ } = this.cacheRule, r = this.type;
1302
+ return p(r, _([{}, {
1303
+ on: {
1304
+ "update:value": this.formData,
1305
+ "emit-event": this.emitEvent,
1306
+ input: this.add$f
1307
+ }
1308
+ }, {}, {
1309
+ props: {
1310
+ rule: t,
1311
+ option: e,
1312
+ disabled: this.disabled,
1313
+ extendOption: !0
1314
+ }
1315
+ }]));
1316
+ }
1317
+ }, Gt = [
1318
+ Vt,
1319
+ Tt,
1320
+ Lt,
1321
+ Mt,
1322
+ xt,
1323
+ Ke,
1324
+ Qe,
1325
+ zt
1326
+ ], Ie = "FormCreate", ue = (t, e) => {
1327
+ if (!(!t || t === e)) {
1328
+ if (t.formCreateInject)
1329
+ return t.formCreateInject;
1330
+ if (t.$parent)
1331
+ return ue(t.$parent, e);
1332
+ }
1333
+ };
1334
+ function Kt(t, e, r) {
1335
+ return {
1336
+ name: Ie,
1337
+ componentName: Ie,
1338
+ model: {
1339
+ prop: "api"
1340
+ },
1341
+ components: e,
1342
+ directives: r,
1343
+ provide() {
1344
+ return {
1345
+ $pfc: this
1346
+ };
1347
+ },
1348
+ inject: { $pfc: { default: null } },
1349
+ props: {
1350
+ rule: {
1351
+ type: Array,
1352
+ required: !0
1353
+ },
1354
+ option: {
1355
+ type: Object,
1356
+ default: () => ({})
1357
+ },
1358
+ extendOption: Boolean,
1359
+ disabled: {
1360
+ type: Boolean,
1361
+ default: void 0
1362
+ },
1363
+ value: Object,
1364
+ api: Object,
1365
+ name: String,
1366
+ subForm: {
1367
+ type: Boolean,
1368
+ default: !0
1369
+ },
1370
+ inFor: Boolean
1371
+ },
1372
+ data() {
1373
+ return {
1374
+ formData: void 0,
1375
+ destroyed: !1,
1376
+ validate: {},
1377
+ $f: void 0,
1378
+ isShow: !0,
1379
+ unique: 1,
1380
+ renderRule: [...this.rule || []],
1381
+ ctxInject: {},
1382
+ updateValue: JSON.stringify(this.value || {}),
1383
+ isMore: !!this.inFor
1384
+ };
1385
+ },
1386
+ render() {
1387
+ return this.formCreate.render();
1388
+ },
1389
+ methods: {
1390
+ _refresh() {
1391
+ ++this.unique;
1392
+ },
1393
+ _renderRule() {
1394
+ this.renderRule = [...this.rule || []];
1395
+ },
1396
+ _updateValue(i) {
1397
+ this.destroyed || (this.updateValue = JSON.stringify(i), this.$emit("update:value", i));
1398
+ }
1399
+ },
1400
+ watch: {
1401
+ value: {
1402
+ handler(i) {
1403
+ JSON.stringify(i || {}) !== this.updateValue && (this.$f.config.forceCoverValue ? this.$f.coverValue(i || {}) : this.$f.setValue(i || {}));
1404
+ },
1405
+ deep: !0
1406
+ },
1407
+ option: {
1408
+ handler() {
1409
+ this.formCreate.initOptions(), this.$f.refresh();
1410
+ },
1411
+ deep: !0
1412
+ },
1413
+ rule(i) {
1414
+ i.length === this.renderRule.length && i.every((s) => this.renderRule.indexOf(s) > -1) || (this.formCreate.$handle.reloadRule(i), this._renderRule());
1415
+ },
1416
+ disabled() {
1417
+ this.$f.refresh();
1418
+ }
1419
+ },
1420
+ beforeCreate() {
1421
+ this.formCreate = new t(this), Object.keys(this.formCreate.prop).forEach((i) => {
1422
+ m(this.$options[i], this.formCreate.prop[i]);
1423
+ }), this.$emit("beforeCreate", this.formCreate.api());
1424
+ },
1425
+ created() {
1426
+ const i = this, s = this.formCreate.api(), n = () => {
1427
+ if (i.$pfc) {
1428
+ const a = ue(i, i.$pfc);
1429
+ if (a) {
1430
+ let u;
1431
+ i.isMore ? (u = j(a.getSubForm()), u.push(s)) : u = s, a.subForm(u);
1432
+ }
1433
+ }
1434
+ }, o = () => {
1435
+ const a = ue(i, i.$pfc);
1436
+ if (a)
1437
+ if (i.isMore) {
1438
+ const u = j(a.getSubForm()), l = u.indexOf(s);
1439
+ l > -1 && u.splice(l, 1);
1440
+ } else
1441
+ a.subForm();
1442
+ };
1443
+ i.$on("hook:beforeDestroy", () => {
1444
+ o();
1445
+ }), this.$watch(() => this.subForm, (a) => {
1446
+ a ? n() : o();
1447
+ }, { immediate: !0 });
1448
+ }
1449
+ };
1450
+ }
1451
+ const Ze = ["attrs", "props", "domProps", "scopedSlots"], Ye = ["class", "style", "directives"], et = ["on", "nativeOn"], T = (t, e = {}, r = {}) => {
1452
+ const i = [...Ze, ...r.normal || []], s = [...Ye, ...r.array || []], n = [...et, ...r.functional || []], o = r.props || [];
1453
+ return t.reduce((a, u) => {
1454
+ for (const l in u)
1455
+ if (a[l])
1456
+ if (o.indexOf(l) > -1)
1457
+ a[l] = T([u[l]], a[l]);
1458
+ else if (i.indexOf(l) > -1)
1459
+ a[l] = y(y({}, a[l]), u[l]);
1460
+ else if (s.indexOf(l) > -1) {
1461
+ const c = a[l] instanceof Array ? a[l] : [a[l]], g = u[l] instanceof Array ? u[l] : [u[l]];
1462
+ a[l] = [...c, ...g];
1463
+ } else if (n.indexOf(l) > -1)
1464
+ for (const c in u[l])
1465
+ if (a[l][c]) {
1466
+ const g = a[l][c] instanceof Array ? a[l][c] : [a[l][c]], b = u[l][c] instanceof Array ? u[l][c] : [u[l][c]];
1467
+ a[l][c] = [...g, ...b];
1468
+ } else
1469
+ a[l][c] = u[l][c];
1470
+ else if (l === "hook")
1471
+ for (let c in u[l])
1472
+ a[l][c] ? a[l][c] = Xt(a[l][c], u[l][c]) : a[l][c] = u[l][c];
1473
+ else
1474
+ a[l] = u[l];
1475
+ else
1476
+ i.indexOf(l) > -1 || n.indexOf(l) > -1 || o.indexOf(l) > -1 ? a[l] = y({}, u[l]) : s.indexOf(l) > -1 ? a[l] = u[l] instanceof Array ? [...u[l]] : typeof u[l] == "object" ? y({}, u[l]) : u[l] : a[l] = u[l];
1477
+ return a;
1478
+ }, e);
1479
+ }, Xt = (t, e) => function() {
1480
+ t && t.apply(this, arguments), e && e.apply(this, arguments);
1481
+ }, tt = ["type", "slot", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "preview", "component", "cache"], pe = ["validate", "children", "control"], me = ["effect", "deep"];
1482
+ function Qt() {
1483
+ return [...tt, ...Ze, ...Ye, ...et, ...pe, ...me];
1484
+ }
1485
+ function ye(t, e, r) {
1486
+ return `[form-create ${t}]: ${e}`;
1487
+ }
1488
+ function Zt(t, e) {
1489
+ console.warn(ye("tip", t));
1490
+ }
1491
+ function ge(t, e) {
1492
+ console.error(ye("err", t));
1493
+ }
1494
+ function Yt(t) {
1495
+ ge(t.toString()), console.error(t);
1496
+ }
1497
+ const fe = "[[FORM-CREATE-PREFIX-", he = "-FORM-CREATE-SUFFIX]]", je = "$FN:", Ae = "$FNX:", z = "function";
1498
+ function rt(t, e) {
1499
+ return JSON.stringify(x(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
1500
+ if (!(i && i._isVue === !0)) {
1501
+ if (typeof i !== z)
1502
+ return i;
1503
+ if (i.__json)
1504
+ return i.__json;
1505
+ if (i.__origin && (i = i.__origin), !i.__emit)
1506
+ return fe + i + he;
1507
+ }
1508
+ }, e);
1509
+ }
1510
+ function Ve(t) {
1511
+ return new Function("return " + t)();
1512
+ }
1513
+ function U(t, e) {
1514
+ if (t && h.String(t) && t.length > 4) {
1515
+ let r = t.trim(), i = !1;
1516
+ try {
1517
+ if (r.indexOf(he) > 0 && r.indexOf(fe) === 0)
1518
+ r = r.replace(he, "").replace(fe, ""), i = !0;
1519
+ else if (r.indexOf(je) === 0)
1520
+ r = r.replace(je, ""), i = !0;
1521
+ else {
1522
+ if (r.indexOf(Ae) === 0)
1523
+ return r = Ve("function($inject){" + r.replace(Ae, "") + "}"), r.__json = t, r.__inject = !0, r;
1524
+ !e && r.indexOf(z) === 0 && r !== z && (i = !0);
1525
+ }
1526
+ if (!i) return t;
1527
+ const s = Ve(r.indexOf(z) === -1 && r.indexOf("(") !== 0 ? z + " " + r : r);
1528
+ return s.__json = t, s;
1529
+ } catch (s) {
1530
+ ge(`解析失败:${r}
1531
+
1532
+ err: ${s}`);
1533
+ return;
1534
+ }
1535
+ }
1536
+ return t;
1537
+ }
1538
+ function er(t, e) {
1539
+ return JSON.parse(t, function(r, i) {
1540
+ return h.Undef(i) || !i.indexOf ? i : U(i, e);
1541
+ });
1542
+ }
1543
+ function it(t, e) {
1544
+ return {
1545
+ value: t,
1546
+ enumerable: !1,
1547
+ configurable: !1,
1548
+ writable: !!e
1549
+ };
1550
+ }
1551
+ function $e(t) {
1552
+ return nt([t])[0];
1553
+ }
1554
+ function nt(t, e) {
1555
+ return x([], [...t], e || !1);
1556
+ }
1557
+ function q(t, e) {
1558
+ return T(Array.isArray(e) ? e : [e], t, { array: pe, normal: me }), t;
1559
+ }
1560
+ function Pe(t) {
1561
+ const e = h.Function(t.getRule) ? t.getRule() : t;
1562
+ return e.type || (e.type = "input"), e;
1563
+ }
1564
+ function tr(t, e) {
1565
+ return t ? (Object.keys(e || {}).forEach((r) => {
1566
+ e[r] && (t[r] = q(t[r] || {}, e[r]));
1567
+ }), t) : e;
1568
+ }
1569
+ function st(t, e) {
1570
+ Object.defineProperties(t, Object.keys(e).reduce((r, i) => (r[i] = {
1571
+ get() {
1572
+ return e[i]();
1573
+ }
1574
+ }, r), {}));
1575
+ }
1576
+ function Q(t) {
1577
+ return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
1578
+ }
1579
+ function E(t, e) {
1580
+ try {
1581
+ e = t();
1582
+ } catch (r) {
1583
+ Yt(r);
1584
+ }
1585
+ return e;
1586
+ }
1587
+ const De = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, W = {
1588
+ "==": (t, e) => JSON.stringify(t) === JSON.stringify(De(t, e)),
1589
+ "!=": (t, e) => !W["=="](t, e),
1590
+ ">": (t, e) => t > e,
1591
+ ">=": (t, e) => t >= e,
1592
+ "<": (t, e) => t < e,
1593
+ "<=": (t, e) => t <= e,
1594
+ on(t, e) {
1595
+ return t && t.indexOf && t.indexOf(De(t[0], e)) > -1;
1596
+ },
1597
+ notOn(t, e) {
1598
+ return !W.on(t, e);
1599
+ },
1600
+ in(t, e) {
1601
+ return e && e.indexOf && e.indexOf(t) > -1;
1602
+ },
1603
+ notIn(t, e) {
1604
+ return !W.in(t, e);
1605
+ },
1606
+ between(t, e) {
1607
+ return t > e[0] && t < e[1];
1608
+ },
1609
+ notBetween(t, e) {
1610
+ return t < e[0] || t > e[1];
1611
+ },
1612
+ empty(t) {
1613
+ return h.empty(t);
1614
+ },
1615
+ notEmpty(t) {
1616
+ return !h.empty(t);
1617
+ },
1618
+ pattern(t, e) {
1619
+ return new RegExp(e, "g").test(t);
1620
+ }
1621
+ };
1622
+ function ot() {
1623
+ return {
1624
+ props: {},
1625
+ on: {},
1626
+ options: [],
1627
+ children: [],
1628
+ effect: {},
1629
+ hidden: !1,
1630
+ display: !0,
1631
+ value: void 0
1632
+ };
1633
+ }
1634
+ function S(t, e) {
1635
+ return (r, i, s, n = {}) => {
1636
+ const o = new ve(t, r, i, s, n);
1637
+ return e && (h.Function(e) ? e(o) : o.props(e)), o;
1638
+ };
1639
+ }
1640
+ function ve(t, e, r, i, s) {
1641
+ this._data = m(ot(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
1642
+ }
1643
+ m(ve.prototype, {
1644
+ getRule() {
1645
+ return this._data;
1646
+ },
1647
+ setProp(t, e) {
1648
+ return F(this._data, t, e), this;
1649
+ },
1650
+ _clone() {
1651
+ const t = new this.constructor();
1652
+ return t._data = $e(this._data), t;
1653
+ }
1654
+ });
1655
+ function at(t) {
1656
+ t.forEach((e) => {
1657
+ ve.prototype[e] = function(r) {
1658
+ return q(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
1659
+ };
1660
+ });
1661
+ }
1662
+ at(Qt());
1663
+ const lt = S("");
1664
+ function rr(t, e, r) {
1665
+ let i = lt("", e);
1666
+ return i._data.type = t, i._data.title = r, i;
1667
+ }
1668
+ function Te(t, e, r, i) {
1669
+ let s = lt("", r);
1670
+ return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
1671
+ }
1672
+ function ir() {
1673
+ return {
1674
+ create: rr,
1675
+ createTmp: Te,
1676
+ template: Te,
1677
+ factory: S
1678
+ };
1679
+ }
1680
+ function nr(t, e, r) {
1681
+ const i = `fail to ${t} ${r.status}'`, s = new Error(i);
1682
+ return s.status = r.status, s.url = t, s;
1683
+ }
1684
+ function Be(t) {
1685
+ const e = t.responseText || t.response;
1686
+ if (!e)
1687
+ return e;
1688
+ try {
1689
+ return JSON.parse(e);
1690
+ } catch (r) {
1691
+ return e;
1692
+ }
1693
+ }
1694
+ function ut(t) {
1695
+ if (typeof XMLHttpRequest == "undefined")
1696
+ return;
1697
+ const e = new XMLHttpRequest(), r = t.action;
1698
+ e.onerror = function(o) {
1699
+ t.onError(o);
1700
+ }, e.onload = function() {
1701
+ if (e.status < 200 || e.status >= 300)
1702
+ return t.onError(nr(r, t, e), Be(e));
1703
+ t.onSuccess(Be(e));
1704
+ }, e.open(t.method || "get", r, !0);
1705
+ let i;
1706
+ t.data && ((t.dataType || "").toLowerCase() !== "json" ? (i = new FormData(), Object.keys(t.data).map((n) => {
1707
+ i.append(n, t.data[n]);
1708
+ })) : (i = JSON.stringify(t.data), e.setRequestHeader("content-type", "application/json"))), t.withCredentials && "withCredentials" in e && (e.withCredentials = !0);
1709
+ const s = t.headers || {};
1710
+ Object.keys(s).forEach((n) => {
1711
+ s[n] !== null && e.setRequestHeader(n, s[n]);
1712
+ }), e.send(i);
1713
+ }
1714
+ function sr(t) {
1715
+ return new Promise((e, r) => {
1716
+ ut(H(y({}, t), {
1717
+ onSuccess(i) {
1718
+ let s = (o) => o;
1719
+ const n = U(t.parse);
1720
+ h.Function(n) ? s = n : n && h.String(n) && (s = (o) => (n.split(".").forEach((a) => {
1721
+ o && (o = o[a]);
1722
+ }), o)), e(s(i));
1723
+ },
1724
+ onError(i) {
1725
+ r(i);
1726
+ }
1727
+ }));
1728
+ });
1729
+ }
1730
+ function X(t) {
1731
+ return L(t);
1732
+ }
1733
+ function or(t) {
1734
+ function e(n) {
1735
+ return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
1736
+ }
1737
+ function r(n, o, a) {
1738
+ e(n).forEach((u) => {
1739
+ t.getCtxs(u).forEach((l) => {
1740
+ F(l.rule, o, a), t.$render.clearCache(l);
1741
+ });
1742
+ });
1743
+ }
1744
+ function i() {
1745
+ const n = t.subForm;
1746
+ return Object.keys(n).reduce((o, a) => {
1747
+ const u = n[a];
1748
+ return u && (Array.isArray(u) ? o.push(...u) : o.push(u)), o;
1749
+ }, []);
1750
+ }
1751
+ const s = {
1752
+ get config() {
1753
+ return t.options;
1754
+ },
1755
+ get options() {
1756
+ return t.options;
1757
+ },
1758
+ get form() {
1759
+ return t.form;
1760
+ },
1761
+ get rule() {
1762
+ return t.rules;
1763
+ },
1764
+ get parent() {
1765
+ return t.vm.$pfc && t.vm.$pfc.$f;
1766
+ },
1767
+ get top() {
1768
+ return s.parent ? s.parent.top : s;
1769
+ },
1770
+ get children() {
1771
+ return i();
1772
+ },
1773
+ formData(n) {
1774
+ return e(n).reduce((o, a) => {
1775
+ const u = t.getFieldCtx(a);
1776
+ return u && (o[u.field] = X(u.rule.value)), o;
1777
+ }, t.options.appendValue !== !1 ? X(t.appendData) : {});
1778
+ },
1779
+ getValue(n) {
1780
+ const o = t.getFieldCtx(n);
1781
+ if (o)
1782
+ return X(o.rule.value);
1783
+ },
1784
+ coverValue(n) {
1785
+ const o = y({}, n || {});
1786
+ t.deferSyncValue(() => {
1787
+ s.fields().forEach((a) => {
1788
+ const u = t.fieldCtx[a];
1789
+ if (u) {
1790
+ const l = w(o, a);
1791
+ u.forEach((c) => {
1792
+ c.rule.value = l ? o[a] : void 0;
1793
+ }), delete o[a];
1794
+ }
1795
+ }), m(t.appendData, o);
1796
+ });
1797
+ },
1798
+ setValue(n) {
1799
+ let o = n;
1800
+ arguments.length >= 2 && (o = { [n]: arguments[1] }), t.deferSyncValue(() => {
1801
+ Object.keys(o).forEach((a) => {
1802
+ const u = t.fieldCtx[a];
1803
+ if (!u) return t.appendData[a] = o[a];
1804
+ u.forEach((l) => {
1805
+ l.rule.value = o[a];
1806
+ });
1807
+ });
1808
+ });
1809
+ },
1810
+ removeField(n) {
1811
+ const o = t.getCtx(n);
1812
+ return t.deferSyncValue(() => {
1813
+ t.getCtxs(n).forEach((a) => {
1814
+ a.rm();
1815
+ });
1816
+ }, !0), o ? o.origin : void 0;
1817
+ },
1818
+ removeRule(n) {
1819
+ const o = n && Q(n);
1820
+ if (o)
1821
+ return o.rm(), o.origin;
1822
+ },
1823
+ destroy: () => {
1824
+ t.vm.$el.parentNode && t.vm.$el.parentNode.removeChild(t.vm.$el), t.vm.$destroy();
1825
+ },
1826
+ fields: () => t.fields(),
1827
+ append: (n, o, a) => {
1828
+ let u = t.sort.length - 1, l;
1829
+ const c = t.getCtx(o);
1830
+ c ? a ? (l = c.rule.children, u = c.rule.children.length - 1) : (u = c.root.indexOf(c.origin), l = c.root) : l = t.rules, l.splice(u + 1, 0, n);
1831
+ },
1832
+ prepend: (n, o, a) => {
1833
+ let u = 0, l;
1834
+ const c = t.getCtx(o);
1835
+ c ? a ? l = c.rule.children : (u = c.root.indexOf(c.origin), l = c.root) : l = t.rules, l.splice(u, 0, n);
1836
+ },
1837
+ hidden(n, o) {
1838
+ r(o, "hidden", !!n), t.refresh();
1839
+ },
1840
+ hiddenStatus(n) {
1841
+ const o = t.getCtx(n);
1842
+ if (o)
1843
+ return !!o.rule.hidden;
1844
+ },
1845
+ display(n, o) {
1846
+ r(o, "display", !!n), t.refresh();
1847
+ },
1848
+ displayStatus(n) {
1849
+ const o = t.getCtx(n);
1850
+ if (o)
1851
+ return !!o.rule.display;
1852
+ },
1853
+ disabled(n, o) {
1854
+ e(o).forEach((a) => {
1855
+ t.getCtxs(a).forEach((u) => {
1856
+ u.rule.props && F(u.rule.props, "disabled", !!n);
1857
+ });
1858
+ }), t.refresh();
1859
+ },
1860
+ all(n) {
1861
+ return Object.keys(t.ctxs).map((o) => {
1862
+ const a = t.ctxs[o];
1863
+ return n ? a.origin : a.rule;
1864
+ });
1865
+ },
1866
+ model(n) {
1867
+ return t.fields().reduce((o, a) => {
1868
+ const u = t.fieldCtx[a][0];
1869
+ return o[a] = n ? u.origin : u.rule, o;
1870
+ }, {});
1871
+ },
1872
+ component(n) {
1873
+ return Object.keys(t.nameCtx).reduce((o, a) => {
1874
+ const u = t.nameCtx[a].map((l) => n ? l.origin : l.rule);
1875
+ return o[a] = u.length === 1 ? u[0] : u, o;
1876
+ }, {});
1877
+ },
1878
+ bind() {
1879
+ return s.form;
1880
+ },
1881
+ reload: (n) => {
1882
+ t.reloadRule(n);
1883
+ },
1884
+ updateOptions(n) {
1885
+ t.fc.updateOptions(n), s.refresh();
1886
+ },
1887
+ onSubmit(n) {
1888
+ s.updateOptions({ onSubmit: n });
1889
+ },
1890
+ sync: (n) => {
1891
+ if (Array.isArray(n)) {
1892
+ n.forEach((a) => s.sync(a));
1893
+ return;
1894
+ }
1895
+ let o = h.Object(n) ? Q(n) : t.getCtxs(n);
1896
+ o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
1897
+ if (!a.deleted) {
1898
+ const u = t.subForm[a.id];
1899
+ u && (Array.isArray(u) ? u.forEach((l) => {
1900
+ l.refresh();
1901
+ }) : u && u.refresh()), t.$render.clearCache(a);
1902
+ }
1903
+ }), t.refresh());
1904
+ },
1905
+ refresh: () => {
1906
+ i().forEach((n) => {
1907
+ n.refresh();
1908
+ }), t.$render.clearCacheAll(), t.refresh();
1909
+ },
1910
+ refreshOptions() {
1911
+ t.$manager.updateOptions(t.options), s.refresh();
1912
+ },
1913
+ hideForm: (n) => {
1914
+ F(t.vm, "isShow", !n);
1915
+ },
1916
+ changeStatus: () => t.changeStatus,
1917
+ clearChangeStatus: () => {
1918
+ t.changeStatus = !1;
1919
+ },
1920
+ updateRule(n, o) {
1921
+ t.getCtxs(n).forEach((a) => {
1922
+ m(a.rule, o);
1923
+ });
1924
+ },
1925
+ updateRules(n) {
1926
+ Object.keys(n).forEach((o) => {
1927
+ s.updateRule(o, n[o]);
1928
+ });
1929
+ },
1930
+ mergeRule: (n, o) => {
1931
+ t.getCtxs(n).forEach((a) => {
1932
+ q(a.rule, o);
1933
+ });
1934
+ },
1935
+ mergeRules(n) {
1936
+ Object.keys(n).forEach((o) => {
1937
+ s.mergeRule(o, n[o]);
1938
+ });
1939
+ },
1940
+ getRule: (n, o) => {
1941
+ const a = t.getCtx(n);
1942
+ if (a)
1943
+ return o ? a.origin : a.rule;
1944
+ },
1945
+ getRenderRule: (n) => {
1946
+ const o = t.getCtx(n);
1947
+ if (o)
1948
+ return o.prop;
1949
+ },
1950
+ getRefRule: (n) => {
1951
+ const o = t.getCtxs(n);
1952
+ if (o && o.length) {
1953
+ const a = o.map((u) => u.rule);
1954
+ return a.length === 1 ? a[0] : a;
1955
+ }
1956
+ },
1957
+ setEffect(n, o, a) {
1958
+ const u = t.getCtx(n);
1959
+ u && o && (o[0] === "$" && (o = o.substr(1)), w(u.rule, "$" + o) && F(u.rule, "$" + o, a), w(u.rule, "effect") || F(u.rule, "effect", {}), F(u.rule.effect, o, a));
1960
+ },
1961
+ clearEffectData(n, o) {
1962
+ const a = t.getCtx(n);
1963
+ a && (o && o[0] === "$" && (o = o.substr(1)), a.clearEffectData(o), s.sync(n));
1964
+ },
1965
+ updateValidate(n, o, a) {
1966
+ a ? s.mergeRule(n, { validate: o }) : r(n, "validate", o);
1967
+ },
1968
+ updateValidates(n, o) {
1969
+ Object.keys(n).forEach((a) => {
1970
+ s.updateValidate(a, n[a], o);
1971
+ });
1972
+ },
1973
+ refreshValidate() {
1974
+ t.vm.validate = {}, s.refresh();
1975
+ },
1976
+ resetFields(n) {
1977
+ e(n).forEach((o) => {
1978
+ t.getCtxs(o).forEach((a) => {
1979
+ t.$render.clearCache(a), a.rule.value = X(a.defaultValue);
1980
+ });
1981
+ }), t.vm.$nextTick(() => {
1982
+ s.clearValidateState();
1983
+ }), n == null && (h.Function(t.options.onReset) && E(() => t.options.onReset(s)), t.vm.$emit("reset", s));
1984
+ },
1985
+ method(n, o) {
1986
+ const a = s.el(n);
1987
+ if (!a || !a[o])
1988
+ throw new Error(ye("err", `${o}方法不存在`));
1989
+ return (...u) => a[o](...u);
1990
+ },
1991
+ exec(n, o, ...a) {
1992
+ return E(() => s.method(n, o)(...a));
1993
+ },
1994
+ toJson(n) {
1995
+ return rt(s.rule, n);
1996
+ },
1997
+ trigger(n, o, ...a) {
1998
+ const u = s.el(n);
1999
+ u && u.$emit(o, ...a);
2000
+ },
2001
+ el(n) {
2002
+ const o = t.getCtx(n);
2003
+ if (o) return o.exportEl || o.el || t.vm.$refs[o.ref];
2004
+ },
2005
+ closeModal: (n) => {
2006
+ const o = s.el(n);
2007
+ o && o.$emit && o.$emit("close-modal");
2008
+ },
2009
+ getSubForm(n) {
2010
+ const o = t.getCtx(n);
2011
+ return o ? t.subForm[o.id] : void 0;
2012
+ },
2013
+ nextTick(n) {
2014
+ t.bus.$once("next-tick", n), t.refresh();
2015
+ },
2016
+ nextRefresh(n) {
2017
+ t.nextRefresh(), n && E(n);
2018
+ },
2019
+ emit(n, ...o) {
2020
+ t.vm.$emit(n, ...o);
2021
+ },
2022
+ deferSyncValue(n, o) {
2023
+ t.deferSyncValue(n, o);
2024
+ },
2025
+ fetch(n) {
2026
+ return new Promise((o, a) => {
2027
+ t.beforeFetch(n).then(() => sr(n).then(o).catch(a));
2028
+ });
2029
+ },
2030
+ getData(n, o) {
2031
+ return t.fc.getData(n, o);
2032
+ },
2033
+ setData(n, o) {
2034
+ return t.fc.setData(n, o);
2035
+ },
2036
+ helper: {
2037
+ tidyFields: e,
2038
+ props: r
2039
+ }
2040
+ };
2041
+ return ["on", "once", "off", "set", "emit"].forEach((n) => {
2042
+ s[n] = function(...o) {
2043
+ t.vm[`$${n}`](...o);
2044
+ };
2045
+ }), s.changeValue = s.changeField = s.setValue, s;
2046
+ }
2047
+ function ar(t) {
2048
+ m(t.prototype, {
2049
+ initCache() {
2050
+ this.clearCacheAll();
2051
+ },
2052
+ clearCache(e) {
2053
+ if (e.rule.cache)
2054
+ return;
2055
+ if (!this.cache[e.id]) {
2056
+ e.parent && this.clearCache(e.parent);
2057
+ return;
2058
+ }
2059
+ (this.cache[e.id].use === !0 || this.cache[e.id].parent) && this.$handle.refresh();
2060
+ const r = this.cache[e.id].parent;
2061
+ this.cache[e.id] = null, r && this.clearCache(r);
2062
+ },
2063
+ clearCacheAll() {
2064
+ this.cache = {};
2065
+ },
2066
+ setCache(e, r, i) {
2067
+ this.cache[e.id] = {
2068
+ vnode: r,
2069
+ use: !1,
2070
+ parent: i,
2071
+ slot: e.rule.slot
2072
+ };
2073
+ },
2074
+ getCache(e) {
2075
+ const r = this.cache[e.id];
2076
+ if (r)
2077
+ return r.use = !0, r.vnode;
2078
+ }
2079
+ });
2080
+ }
2081
+ function I(t) {
2082
+ const e = t.replace(/(-[a-z])/g, function(r) {
2083
+ return r.replace("-", "").toLocaleUpperCase();
2084
+ });
2085
+ return ft(e);
2086
+ }
2087
+ function ft(t) {
2088
+ return t.replace(t[0], t[0].toLowerCase());
2089
+ }
2090
+ function lr(t) {
2091
+ return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
2092
+ }
2093
+ function Z(t) {
2094
+ let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
2095
+ return e.indexOf("-") === 0 && (e = e.substr(1)), e;
2096
+ }
2097
+ let ur = 0;
2098
+ function re() {
2099
+ const t = 370 + ++ur;
2100
+ return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
2101
+ }
2102
+ function Y(t, e, r) {
2103
+ let i = t, s;
2104
+ return (e || "").split(".").forEach((n) => {
2105
+ s && ((!i[s] || typeof i[s] != "object") && (i[s] = {}), i = i[s]), s = n;
2106
+ }), i[s] = r, i;
2107
+ }
2108
+ function fr(t) {
2109
+ m(t.prototype, {
2110
+ initRender() {
2111
+ this.tempList = {}, this.clearOrgChildren();
2112
+ },
2113
+ initOrgChildren() {
2114
+ const e = this.$handle.ctxs;
2115
+ this.orgChildren = Object.keys(e).reduce((r, i) => {
2116
+ if (e[i].parser.loadChildren !== !1) {
2117
+ const s = e[i].rule.children;
2118
+ r[i] = h.trueArray(s) ? [...s] : [];
2119
+ }
2120
+ return r;
2121
+ }, {});
2122
+ },
2123
+ clearOrgChildren() {
2124
+ this.orgChildren = {};
2125
+ },
2126
+ getTypeSlot(e) {
2127
+ const r = (i) => {
2128
+ if (i) {
2129
+ let s;
2130
+ return e.rule.field && (s = i.$scopedSlots["field-" + Z(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + Z(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
2131
+ }
2132
+ };
2133
+ return r(this.vm);
2134
+ },
2135
+ render() {
2136
+ if (!this.vm.isShow)
2137
+ return;
2138
+ this.$h = this.vm.$createElement, this.$manager.beforeRender();
2139
+ let e;
2140
+ const r = () => this.renderList();
2141
+ return r.renderSlot = (i) => this.renderList(i), r.renderName = (i) => this.renderId(i), r.renderField = (i) => this.renderId(i, "field"), this.vm.$scopedSlots.container ? e = [this.vm.$scopedSlots.container(r)] : e = r(), this.$manager.render(e);
2142
+ },
2143
+ renderList(e) {
2144
+ return this.sort.map((r) => e ? this.renderSlot(this.$handle.ctxs[r], e) : this.renderCtx(this.$handle.ctxs[r])).filter((r) => r !== void 0);
2145
+ },
2146
+ makeVm(e) {
2147
+ const r = e.vm;
2148
+ if (r) {
2149
+ if (h.Function(r))
2150
+ return E(() => e.vm(this.$handle.getInjectData(e)));
2151
+ if (!r._isVue)
2152
+ return new D(r);
2153
+ } else return new D();
2154
+ return r;
2155
+ },
2156
+ mergeGlobal(e) {
2157
+ const r = this.$handle.options.global;
2158
+ r && (e.cacheConfig || (e.cacheConfig = r[e.originType] || r[e.type] || r[e.trueType] || {}), e.prop = q({}, [r["*"], e.cacheConfig, e.prop]));
2159
+ },
2160
+ setOptions(e) {
2161
+ e.prop.optionsTo && e.prop.options && Y(e.prop, e.prop.optionsTo, e.prop.options);
2162
+ },
2163
+ deepSet(e) {
2164
+ const r = e.rule.deep;
2165
+ r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
2166
+ Y(e.prop, i, r[i]);
2167
+ });
2168
+ },
2169
+ setTempProps(e, r) {
2170
+ if (!e.$props) return;
2171
+ const { prop: i } = r, s = Object.keys(e.$props), n = this.injectProp(r), o = Object.keys(n);
2172
+ s.forEach((u) => {
2173
+ w(i.props, u) ? e.$props[u] = i.props[u] : o.indexOf(u) > -1 && (e.$props[u] = n[u]);
2174
+ });
2175
+ const a = e.$options.model && e.$options.model.prop || "value";
2176
+ s.indexOf(a) > -1 && (e.$props[a] = i.value);
2177
+ },
2178
+ renderTemp(e) {
2179
+ if (!D.compile)
2180
+ return Zt("当前使用的Vue构建版本不支持compile,无法使用template功能"), [];
2181
+ const r = e.prop, { id: i, key: s } = e;
2182
+ if (!this.tempList[i]) {
2183
+ e.el || (e.el = this.makeVm(r), this.vm.$nextTick(() => e.parser.mounted(e)));
2184
+ let u = e.el;
2185
+ e.input && u.$on(u.$options.model && u.$options.model.event || "input", (l) => {
2186
+ this.onInput(e, l);
2187
+ }), this.tempList[i] = {
2188
+ vm: u,
2189
+ template: D.compile(r.template)
2190
+ };
2191
+ }
2192
+ const { vm: n, template: o } = this.tempList[i];
2193
+ this.setTempProps(n, e);
2194
+ const a = o.render.call(n);
2195
+ return h.Undef(a.data) && (a.data = {}), a.key = s, a.data.ref = e.ref, a.data.key = s, a;
2196
+ },
2197
+ parseSide(e, r) {
2198
+ return h.Object(e) ? q({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
2199
+ },
2200
+ renderSides(e, r, i) {
2201
+ const s = r[i ? "rule" : "prop"];
2202
+ return [this.renderRule(this.parseSide(s.prefix, r)), e, this.renderRule(this.parseSide(s.suffix, r))];
2203
+ },
2204
+ renderSlot(e, r) {
2205
+ return e.rule.slot === r ? this.renderCtx(e) : void 0;
2206
+ },
2207
+ renderId(e, r) {
2208
+ const i = this.$handle[r === "field" ? "fieldCtx" : "nameCtx"][e];
2209
+ return i ? i.map((s) => this.renderCtx(s, s.parent)) : void 0;
2210
+ },
2211
+ renderCtx(e, r) {
2212
+ if (e.type === "hidden") return;
2213
+ const i = e.rule;
2214
+ if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
2215
+ let s, n = i.cache !== !1;
2216
+ const o = e.trueType, a = !(h.Undef(i.display) || i.display);
2217
+ if (o === "template" && !i.template)
2218
+ s = this.renderSides(this.renderChildren(e), e, !0), a && this.display(s), s = this.item(e, s);
2219
+ else if (o === "fcFragment")
2220
+ s = this.renderChildren(e);
2221
+ else {
2222
+ e.initProp(), this.mergeGlobal(e), this.$manager.tidyRule(e), this.deepSet(e), this.setOptions(e), this.ctxProp(e);
2223
+ let u = e.prop;
2224
+ u.preview = !!(w(u, "preview") ? u.preview : this.options.preview), u.props.formCreateInject = this.injectProp(e);
2225
+ const l = u.preview;
2226
+ if (u.hidden) {
2227
+ this.setCache(e, void 0, r);
2228
+ return;
2229
+ }
2230
+ if (o === "template" && u.template)
2231
+ s = this.renderTemp(e), n = !1;
2232
+ else {
2233
+ let c = [];
2234
+ e.parser.renderChildren ? c = e.parser.renderChildren(e) : e.parser.loadChildren !== !1 && (c = this.renderChildren(e));
2235
+ const g = this.getTypeSlot(e);
2236
+ g ? s = g({
2237
+ rule: i,
2238
+ prop: u,
2239
+ preview: l,
2240
+ children: c,
2241
+ api: this.$handle.api,
2242
+ model: u.model || {}
2243
+ }) : s = l ? e.parser.preview(c, e) : e.parser.render(c, e);
2244
+ }
2245
+ s = this.renderSides(s, e), !(!e.input && h.Undef(u.native)) && u.native !== !0 && (s = this.$manager.makeWrap(e, s)), a && (s = this.display(s)), s = this.item(e, s);
2246
+ }
2247
+ return n && this.setCache(e, s, r), s;
2248
+ }
2249
+ return this.getCache(e);
2250
+ },
2251
+ display(e) {
2252
+ if (Array.isArray(e)) {
2253
+ const r = [];
2254
+ return e.forEach((i) => {
2255
+ if (Array.isArray(i)) return this.display(i);
2256
+ this.none(i) && r.push(i);
2257
+ }), r;
2258
+ } else
2259
+ return this.none(e);
2260
+ },
2261
+ none(e) {
2262
+ if (e && e.data)
2263
+ return Array.isArray(e.data.style) ? e.data.style.push({ display: "none" }) : h.String(e.data.style) ? e.data.style += ";display:none;" : e.data.style = [e.data.style, { display: "none" }], e;
2264
+ },
2265
+ item(e, r) {
2266
+ return this.$h("fcFragment", {
2267
+ slot: e.rule.slot,
2268
+ key: e.key
2269
+ }, [r]);
2270
+ },
2271
+ injectProp(e) {
2272
+ this.vm.ctxInject[e.id] || F(this.vm.ctxInject, e.id, {
2273
+ api: this.$handle.api,
2274
+ form: this.fc.create,
2275
+ subForm: (i) => {
2276
+ this.$handle.addSubForm(e, i);
2277
+ },
2278
+ getSubForm: () => this.$handle.subForm[e.id],
2279
+ options: [],
2280
+ children: [],
2281
+ prop: {},
2282
+ preview: !1,
2283
+ id: e.id,
2284
+ field: e.field,
2285
+ rule: e.rule,
2286
+ input: e.input
2287
+ });
2288
+ const r = this.vm.ctxInject[e.id];
2289
+ return m(r, {
2290
+ preview: e.prop.preview,
2291
+ options: e.prop.options,
2292
+ children: e.rule.children,
2293
+ prop: function() {
2294
+ const i = y({}, e.prop);
2295
+ return i.on = i.on ? y({}, i.on) : {}, delete i.model, i;
2296
+ }()
2297
+ }), r;
2298
+ },
2299
+ ctxProp(e) {
2300
+ const { ref: r, key: i, rule: s } = e;
2301
+ this.$manager.mergeProp(e), e.parser.mergeProp(e);
2302
+ const n = [
2303
+ {
2304
+ ref: r,
2305
+ key: s.key || `${i}fc`,
2306
+ slot: void 0,
2307
+ on: {
2308
+ "hook:mounted": () => {
2309
+ this.onMounted(e);
2310
+ },
2311
+ "fc.sub-form": (o) => {
2312
+ this.$handle.addSubForm(e, o);
2313
+ },
2314
+ "fc.el": (o) => {
2315
+ e.exportEl = o, o && ((o.$el || o).__rule__ = e.rule);
2316
+ }
2317
+ }
2318
+ }
2319
+ ];
2320
+ return e.input && (this.vm.$props.disabled === !0 && (e.prop.props.disabled = !0), e.prop.model = {
2321
+ value: this.$handle.getFormData(e),
2322
+ callback: (o) => {
2323
+ this.onInput(e, o);
2324
+ },
2325
+ expression: `formData.${e.id}`
2326
+ }), T(n, e.prop), e.prop;
2327
+ },
2328
+ onMounted(e) {
2329
+ e.el = this.vm.$refs[e.ref], e.el && ((e.el.$el || e.el).__rule__ = e.rule), e.parser.mounted(e), this.$handle.effect(e, "mounted");
2330
+ },
2331
+ onInput(e, r) {
2332
+ this.$handle.onInput(e, r);
2333
+ },
2334
+ renderChildren(e) {
2335
+ const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !h.String(n) && n.__fc__ && !this.$handle.ctxs[n.__fc__.id];
2336
+ return !h.trueArray(r) && i ? (this.$handle.deferSyncValue(() => {
2337
+ i.forEach((n) => {
2338
+ n && s(n) && this.$handle.rmCtx(n.__fc__);
2339
+ });
2340
+ }), this.orgChildren[e.id] = [], []) : (i && this.$handle.deferSyncValue(() => {
2341
+ i.forEach((n) => {
2342
+ n && r.indexOf(n) === -1 && s(n) && this.$handle.rmCtx(n.__fc__);
2343
+ });
2344
+ }), r.map((n) => {
2345
+ if (n) {
2346
+ if (h.String(n)) return n;
2347
+ if (n.__fc__)
2348
+ return this.renderCtx(n.__fc__, e);
2349
+ n.type && this.vm.$nextTick(() => {
2350
+ this.$handle.loadChildren(r, e), this.$handle.refresh();
2351
+ });
2352
+ }
2353
+ }));
2354
+ },
2355
+ defaultRender(e, r) {
2356
+ const i = e.prop;
2357
+ return i.component ? this.vNode.makeComponent(i.component, i, r) : this.vNode[e.type] ? this.vNode[e.type](i, r) : this.vNode[e.originType] ? this.vNode[e.originType](i, r) : this.vNode.make(ft(e.originType), i, r);
2358
+ },
2359
+ renderRule(e, r, i) {
2360
+ if (!e) return;
2361
+ if (h.String(e)) return e;
2362
+ let s;
2363
+ if (i)
2364
+ s = e.type;
2365
+ else if (s = e.is, e.type) {
2366
+ s = I(e.type);
2367
+ const o = this.vNode.aliasMap[s];
2368
+ o && (s = I(o));
2369
+ }
2370
+ if (!s) return;
2371
+ let n = [[r]];
2372
+ return h.trueArray(e.children) && n.push(e.children.map((o) => this.renderRule(o))), this.$h(s, y({}, e), n);
2373
+ }
2374
+ });
2375
+ }
2376
+ function be(t) {
2377
+ m(this, {
2378
+ $handle: t,
2379
+ fc: t.fc,
2380
+ vm: t.vm,
2381
+ $manager: t.$manager,
2382
+ vNode: new t.fc.CreateNode(t.vm)
2383
+ }), st(this, {
2384
+ options() {
2385
+ return t.options;
2386
+ },
2387
+ sort() {
2388
+ return t.sort;
2389
+ }
2390
+ }), this.initCache(), this.initRender();
2391
+ }
2392
+ ar(be);
2393
+ fr(be);
2394
+ function hr(t) {
2395
+ m(t.prototype, {
2396
+ parseInjectEvent(e, r) {
2397
+ const i = e.inject || this.options.injectEvent;
2398
+ return this.parseEventLst(e, r, i);
2399
+ },
2400
+ parseEventLst(e, r, i, s) {
2401
+ return Object.keys(r).forEach((n) => {
2402
+ const o = this.parseEvent(e, r[n], i, s);
2403
+ o && (r[n] = o);
2404
+ }), r;
2405
+ },
2406
+ parseEvent(e, r, i, s) {
2407
+ if (h.Function(r) && (i !== !1 && !h.Undef(i) || r.__inject))
2408
+ return this.inject(e, r, i);
2409
+ if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
2410
+ return this.parseEventLst(e, r, i, !0);
2411
+ if (h.String(r)) {
2412
+ const n = U(r);
2413
+ if (n && r !== n)
2414
+ return n.__inject ? this.parseEvent(e, n, i, !0) : n;
2415
+ }
2416
+ },
2417
+ parseEmit(e, r) {
2418
+ let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: u } = s, l = s[r ? "emit" : "nativeEmit"] || [];
2419
+ return h.trueArray(l) && l.forEach((c) => {
2420
+ if (!c) return;
2421
+ let g, b = n || o || a;
2422
+ if (h.Object(c) && (g = c.inject, c = c.name, b = c.prefix || b), b) {
2423
+ r || (b = `native-${b}`);
2424
+ const O = Z(`${b}-${c}`), $ = (...k) => {
2425
+ this.vm.$emit(O, ...k), this.vm.$emit("emit-event", O, ...k);
2426
+ };
2427
+ if ($.__emit = !0, !g && u === !1)
2428
+ i[c] = $;
2429
+ else {
2430
+ let k = g || u || this.options.injectEvent;
2431
+ i[c] = h.Undef(k) ? $ : this.inject(s, $, k);
2432
+ }
2433
+ }
2434
+ }), e.computed[r ? "on" : "nativeOn"] = i, i;
2435
+ },
2436
+ getInjectData(e, r) {
2437
+ const { option: i, rule: s } = this.vm.$options.propsData;
2438
+ return {
2439
+ api: this.api,
2440
+ $f: this.api,
2441
+ rule: s,
2442
+ self: e.__origin__,
2443
+ option: i,
2444
+ inject: r
2445
+ };
2446
+ },
2447
+ inject(e, r, i) {
2448
+ if (r.__origin) {
2449
+ if (this.watching && !this.loading)
2450
+ return r;
2451
+ r = r.__origin;
2452
+ }
2453
+ const s = this, n = function(...o) {
2454
+ const a = s.getInjectData(e, i);
2455
+ return a.args = [...o], o.unshift(a), r.apply(this, o);
2456
+ };
2457
+ return n.__origin = r, n.__json = r.__json, n;
2458
+ }
2459
+ });
2460
+ }
2461
+ const Le = ["hook:updated", "hook:mounted"];
2462
+ function cr(t) {
2463
+ m(t.prototype, {
2464
+ usePage() {
2465
+ const e = this.options.page;
2466
+ if (!e) return;
2467
+ let r = 25, i = dr(this.rules);
2468
+ h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), m(this, {
2469
+ first: r,
2470
+ limit: i,
2471
+ pageEnd: this.rules.length <= r
2472
+ }), this.bus.$on("page-end", () => this.vm.$emit("page-end", this.api)), this.pageLoad();
2473
+ },
2474
+ pageLoad() {
2475
+ const e = () => {
2476
+ this.pageEnd ? (this.vm.$off(Le, e), this.bus.$emit("page-end")) : (this.first += this.limit, this.pageEnd = this.rules.length <= this.first, this.loadRule(), this.refresh());
2477
+ };
2478
+ this.vm.$on(Le, e);
2479
+ }
2480
+ });
2481
+ }
2482
+ function dr(t) {
2483
+ return t.length < 31 ? 31 : Math.ceil(t.length / 3);
2484
+ }
2485
+ function pr(t) {
2486
+ m(t.prototype, {
2487
+ clearNextTick() {
2488
+ this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
2489
+ },
2490
+ bindNextTick(e) {
2491
+ this.clearNextTick(), this.nextTick = setTimeout(() => {
2492
+ e(), this.nextTick = null;
2493
+ }, 10);
2494
+ },
2495
+ render() {
2496
+ return ++this.loadedId, this.vm.unique > 0 ? this.$render.render() : (this.vm.unique = 1, []);
2497
+ }
2498
+ });
2499
+ }
2500
+ function mr(t) {
2501
+ Object.defineProperties(t.origin, {
2502
+ __fc__: it(t, !0)
2503
+ });
2504
+ }
2505
+ function ht(t, e, r) {
2506
+ const i = re();
2507
+ m(this, {
2508
+ id: i,
2509
+ ref: i,
2510
+ wrapRef: i + "fi",
2511
+ rule: e,
2512
+ origin: e.__origin__ || e,
2513
+ name: e.name,
2514
+ watch: [],
2515
+ linkOn: [],
2516
+ root: [],
2517
+ ctrlRule: [],
2518
+ parent: null,
2519
+ cacheConfig: null,
2520
+ prop: y({}, e),
2521
+ computed: {},
2522
+ payload: {},
2523
+ input: !!e.field,
2524
+ el: void 0,
2525
+ exportEl: void 0,
2526
+ defaultValue: e.field ? L(r) : void 0,
2527
+ field: e.field || void 0
2528
+ }), this.updateType(), this.updateKey(), mr(this), this.update(t, !0);
2529
+ }
2530
+ m(ht.prototype, {
2531
+ effectData(t) {
2532
+ return this.payload[t] || (this.payload[t] = {}), this.payload[t];
2533
+ },
2534
+ clearEffectData(t) {
2535
+ t === void 0 ? this.payload = {} : delete this.payload[t];
2536
+ },
2537
+ updateKey(t) {
2538
+ this.key = re(), t && this.parent && this.parent.updateKey(t);
2539
+ },
2540
+ updateType() {
2541
+ this.originType = this.rule.type, this.type = I(this.rule.type);
2542
+ },
2543
+ setParser(t) {
2544
+ this.parser = t, t.init(this);
2545
+ },
2546
+ initProp() {
2547
+ const t = y({}, this.rule);
2548
+ delete t.children, this.prop = q({}, [t, ...Object.keys(this.payload).map((e) => this.payload[e]), this.computed]);
2549
+ },
2550
+ injectValidate() {
2551
+ return j(this.prop.validate).map((t) => {
2552
+ if (h.Function(t.validator)) {
2553
+ const e = y({}, t), r = this;
2554
+ return e.validator = function(...i) {
2555
+ return t.validator.call({
2556
+ that: this,
2557
+ id: r.id,
2558
+ field: r.field,
2559
+ rule: r.rule,
2560
+ api: r.$handle.api
2561
+ }, ...i);
2562
+ }, e;
2563
+ }
2564
+ return t;
2565
+ });
2566
+ },
2567
+ check(t) {
2568
+ return this.vm === t.vm;
2569
+ },
2570
+ unwatch() {
2571
+ this.watch.forEach((t) => t()), this.watch = [];
2572
+ },
2573
+ unlink() {
2574
+ this.linkOn.forEach((t) => t()), this.linkOn = [];
2575
+ },
2576
+ link() {
2577
+ this.unlink(), this.$handle.appendLink(this);
2578
+ },
2579
+ watchTo() {
2580
+ this.$handle.watchCtx(this);
2581
+ },
2582
+ delete() {
2583
+ this.unwatch(), this.unlink(), this.rmCtrl(), m(this, {
2584
+ deleted: !0,
2585
+ prop: y({}, this.rule),
2586
+ computed: {},
2587
+ el: void 0,
2588
+ $handle: void 0,
2589
+ $render: void 0,
2590
+ $api: void 0,
2591
+ vm: void 0,
2592
+ vNode: void 0,
2593
+ parent: null,
2594
+ cacheConfig: null
2595
+ });
2596
+ },
2597
+ rmCtrl() {
2598
+ this.ctrlRule.forEach((t) => t.__fc__ && t.__fc__.rm()), this.ctrlRule = [];
2599
+ },
2600
+ rm() {
2601
+ const t = () => {
2602
+ let e = this.root.indexOf(this.origin);
2603
+ e > -1 && (this.root.splice(e, 1), this.$handle && this.$handle.refresh());
2604
+ };
2605
+ if (this.deleted) {
2606
+ t();
2607
+ return;
2608
+ }
2609
+ this.$handle.noWatch(() => {
2610
+ this.$handle.deferSyncValue(() => {
2611
+ this.rmCtrl(), t(), this.$handle.rmCtx(this), m(this, {
2612
+ root: []
2613
+ });
2614
+ }, this.input);
2615
+ });
2616
+ },
2617
+ update(t, e) {
2618
+ m(this, {
2619
+ deleted: !1,
2620
+ $handle: t,
2621
+ $render: t.$render,
2622
+ $api: t.api,
2623
+ vm: t.vm,
2624
+ trueType: t.getType(this.originType),
2625
+ vNode: t.$render.vNode,
2626
+ updated: !1,
2627
+ cacheValue: this.rule.value
2628
+ }), !e && this.unwatch(), this.watchTo(), this.link();
2629
+ }
2630
+ });
2631
+ function yr(t) {
2632
+ m(t.prototype, {
2633
+ nextRefresh(e) {
2634
+ const r = this.loadedId;
2635
+ this.vm.$nextTick(() => {
2636
+ r === this.loadedId && (e ? e() : this.refresh());
2637
+ });
2638
+ },
2639
+ parseRule(e) {
2640
+ const r = Pe(e);
2641
+ return Object.defineProperties(r, {
2642
+ __origin__: it(e, !0)
2643
+ }), gr(r), this.appendValue(r), r.options = Array.isArray(r.options) ? r.options : [], [r, r.prefix, r.suffix].forEach((i) => {
2644
+ i && this.loadFn(i, r);
2645
+ }), this.loadCtrl(r), r.update && (r.update = U(r.update)), r;
2646
+ },
2647
+ loadFn(e, r) {
2648
+ ["on", "props", "nativeOn", "deep"].forEach((i) => {
2649
+ e[i] && this.parseInjectEvent(r, e[i]);
2650
+ });
2651
+ },
2652
+ loadCtrl(e) {
2653
+ e.control && e.control.forEach((r) => {
2654
+ r.handle && (r.handle = U(r.handle));
2655
+ });
2656
+ },
2657
+ syncProp(e) {
2658
+ const r = e.rule;
2659
+ h.trueArray(r.sync) && T([{
2660
+ on: r.sync.reduce((i, s) => (i[`update:${s}`] = (n) => {
2661
+ r.props[s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
2662
+ }, i), {})
2663
+ }], e.computed);
2664
+ },
2665
+ loadRule() {
2666
+ this.cycleLoad = !1, this.loading = !0, this.pageEnd && this.bus.$emit("load-start"), this.deferSyncValue(() => {
2667
+ if (this._loadRule(this.rules), this.loading = !1, this.cycleLoad && this.pageEnd)
2668
+ return this.loadRule();
2669
+ this.pageEnd && this.bus.$emit("load-end"), this.vm._renderRule(), this.$render.initOrgChildren(), this.syncForm();
2670
+ });
2671
+ },
2672
+ loadChildren(e, r) {
2673
+ if (this.cycleLoad = !1, this.loading = !0, this.bus.$emit("load-start"), this._loadRule(e, r), this.loading = !1, this.cycleLoad)
2674
+ return this.loadRule();
2675
+ this.bus.$emit("load-end"), this.syncForm(), this.$render.clearCache(r);
2676
+ },
2677
+ _loadRule(e, r) {
2678
+ const i = (n) => {
2679
+ let o = e[n - 1];
2680
+ if (!o || !o.__fc__)
2681
+ return n > 0 ? i(n - 1) : -1;
2682
+ let a = this.sort.indexOf(o.__fc__.id);
2683
+ return a > -1 ? a : i(n - 1);
2684
+ }, s = (n, o) => {
2685
+ h.trueArray(n) && this._loadRule(n, o);
2686
+ };
2687
+ e.map((n, o) => {
2688
+ if (r && !h.Object(n) || !this.pageEnd && !r && o >= this.first) return;
2689
+ if (n.__fc__ && n.__fc__.root === e && this.ctxs[n.__fc__.id])
2690
+ return s(n.__fc__.rule.children, n.__fc__), n.__fc__;
2691
+ let a = Pe(n);
2692
+ const u = () => !!(a.field && this.fieldCtx[a.field] && this.fieldCtx[a.field][0] !== n.__fc__);
2693
+ this.ruleEffect(a, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", n, this.api);
2694
+ let l, c = !1, g = !!n.__fc__, b = a.value;
2695
+ if (g) {
2696
+ l = n.__fc__, b = l.defaultValue;
2697
+ const $ = !l.check(this);
2698
+ if (l.deleted) {
2699
+ if ($) {
2700
+ if (Ne(l))
2701
+ return;
2702
+ l.update(this);
2703
+ }
2704
+ } else if ($) {
2705
+ if (Ne(l))
2706
+ return;
2707
+ e[o] = n = n._clone ? n._clone() : $e(n), l = null, c = !0;
2708
+ }
2709
+ }
2710
+ if (l)
2711
+ l.originType !== l.rule.type && l.updateType(), this.bindParser(l), this.appendValue(l.rule);
2712
+ else {
2713
+ const $ = this.parseRule(n);
2714
+ l = new ht(this, $, b), this.bindParser(l);
2715
+ }
2716
+ if ([!1, !0].forEach(($) => this.parseEmit(l, $)), this.syncProp(l), l.parent = r || null, l.root = e, this.setCtx(l), !c && !g && this.effect(l, "load"), this.effect(l, "created"), l.parser.loadChildren === !1 || s(l.rule.children, l), !r) {
2717
+ const $ = i(o);
2718
+ $ > -1 || !o ? this.sort.splice($ + 1, 0, l.id) : this.sort.push(l.id);
2719
+ }
2720
+ const O = l.rule;
2721
+ return l.updated || (l.updated = !0, h.Function(O.update) && this.bus.$once("load-end", () => {
2722
+ this.refreshUpdate(l, O.value, "init");
2723
+ }), this.effect(l, "loaded")), l.input && Object.defineProperty(O, "value", this.valueHandle(l)), this.refreshControl(l) && (this.cycleLoad = !0), l;
2724
+ });
2725
+ },
2726
+ refreshControl(e) {
2727
+ return e.input && e.rule.control && this.useCtrl(e);
2728
+ },
2729
+ useCtrl(e) {
2730
+ const r = $r(e), i = [], s = this.api;
2731
+ if (!r.length) return !1;
2732
+ for (let a = 0; a < r.length; a++) {
2733
+ const u = r[a], l = u.handle || function(g) {
2734
+ return (W[u.condition || "=="] || W["=="])(g, u.value);
2735
+ };
2736
+ if (!h.trueArray(u.rule)) continue;
2737
+ const c = H(y({}, u), {
2738
+ valid: E(() => l(e.rule.value, s)),
2739
+ ctrl: vr(e, u.rule),
2740
+ isHidden: h.String(u.rule[0])
2741
+ });
2742
+ c.valid && c.ctrl || !c.valid && !c.ctrl && !c.isHidden || i.push(c);
2743
+ }
2744
+ if (!i.length) return !1;
2745
+ const n = [];
2746
+ let o = !1;
2747
+ return this.deferSyncValue(() => {
2748
+ i.reverse().forEach(({ isHidden: a, valid: u, rule: l, prepend: c, append: g, child: b, ctrl: O, method: $ }) => {
2749
+ if (a) {
2750
+ u ? e.ctrlRule.push({
2751
+ __ctrl: !0,
2752
+ children: l,
2753
+ valid: u
2754
+ }) : O && e.ctrlRule.splice(e.ctrlRule.indexOf(O) >>> 0, 1), n[u ? "push" : "unshift"](() => {
2755
+ $ === "disabled" || $ === "enabled" ? this.api.disabled(!u, l) : $ === "display" ? this.api.display(u, l) : $ === "required" ? (l.forEach((k) => {
2756
+ this.api.setEffect(k, "required", u);
2757
+ }), u || this.api.clearValidateState(l)) : this.api.hidden(!u, l);
2758
+ });
2759
+ return;
2760
+ }
2761
+ if (u) {
2762
+ o = !0;
2763
+ const k = {
2764
+ type: "fcFragment",
2765
+ native: !0,
2766
+ __ctrl: !0,
2767
+ children: l
2768
+ };
2769
+ e.ctrlRule.push(k), this.bus.$once("load-start", () => {
2770
+ c ? s.prepend(k, c, b) : g || b ? s.append(k, g || e.id, b) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, k);
2771
+ });
2772
+ } else {
2773
+ e.ctrlRule.splice(e.ctrlRule.indexOf(O), 1);
2774
+ const k = Q(O);
2775
+ k && k.rm();
2776
+ }
2777
+ });
2778
+ }), n.length && this.vm.$nextTick(() => {
2779
+ n.forEach((a) => a());
2780
+ }), this.vm.$emit("control", e.origin, this.api), this.effect(e, "control"), o;
2781
+ },
2782
+ reloadRule(e) {
2783
+ return this._reloadRule(e);
2784
+ },
2785
+ _reloadRule(e) {
2786
+ e || (e = this.rules);
2787
+ const r = y({}, this.ctxs);
2788
+ this.clearNextTick(), this.$render.clearOrgChildren(), this.initData(e), this.fc.rules = e, this.deferSyncValue(() => {
2789
+ this.bus.$once("load-end", () => {
2790
+ Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
2791
+ }), this.reloading = !0, this.loadRule(), this.reloading = !1, this.refresh(), this.vm.$emit("reloading", this.api);
2792
+ }), this.bus.$off("next-tick", this.nextReload), this.bus.$once("next-tick", this.nextReload), this.vm.$emit("update", this.api);
2793
+ },
2794
+ //todo 组件生成全部通过 alias
2795
+ refresh() {
2796
+ this.vm._refresh();
2797
+ }
2798
+ });
2799
+ }
2800
+ function gr(t) {
2801
+ const e = ot();
2802
+ return Object.keys(e).forEach((r) => {
2803
+ w(t, r) || F(t, r, e[r]);
2804
+ }), t;
2805
+ }
2806
+ function $r(t) {
2807
+ const e = t.rule.control || [];
2808
+ return h.Object(e) ? [e] : e;
2809
+ }
2810
+ function vr(t, e) {
2811
+ for (let r = 0; r < t.ctrlRule.length; r++) {
2812
+ const i = t.ctrlRule[r];
2813
+ if (i.children === e)
2814
+ return i;
2815
+ }
2816
+ }
2817
+ function Ne(t) {
2818
+ return !!t.rule.__ctrl;
2819
+ }
2820
+ function br(t) {
2821
+ m(t.prototype, {
2822
+ getValue(e) {
2823
+ return h.Undef(e.cacheValue) && (e.cacheValue = e.parser.toValue(this.getFormData(e), e)), e.cacheValue;
2824
+ },
2825
+ setValue(e, r, i, s) {
2826
+ e.deleted || (e.cacheValue = r, this.changeStatus = !0, this.nextRefresh(), this.$render.clearCache(e), this.setFormData(e, i), this.syncValue(), this.valueChange(e, r), this.vm.$emit("change", e.field, r, e.origin, this.api, s || !1), this.effect(e, "value"), this.emitEvent("change", e.field, r, {
2827
+ rule: e.origin,
2828
+ api: this.api,
2829
+ setFlag: s || !1
2830
+ }));
2831
+ },
2832
+ onInput(e, r) {
2833
+ let i;
2834
+ e.input && (this.isQuote(e, i = e.parser.toValue(r, e)) || this.isChange(e, i)) && this.setValue(e, i, r);
2835
+ },
2836
+ setFormData(e, r) {
2837
+ F(this.formData, e.id, r === null ? void 0 : r);
2838
+ },
2839
+ getFormData(e) {
2840
+ return this.formData[e.id];
2841
+ },
2842
+ validate() {
2843
+ return Ue(this.vm.validate), this.fields().forEach((e) => {
2844
+ this.fieldCtx[e].forEach((r) => {
2845
+ this.vm.validate[r.id] = j(r.rule.validate);
2846
+ });
2847
+ }), this.vm.validate;
2848
+ },
2849
+ syncForm() {
2850
+ Ue(this.form), Object.defineProperties(this.form, this.fields().reduce((e, r) => {
2851
+ const i = this.getFieldCtx(r), s = this.valueHandle(i);
2852
+ return s.configurable = !0, e[r] = s, e;
2853
+ }, this.options.appendValue !== !1 ? Object.keys(this.appendData).reduce((e, r) => (e[r] = {
2854
+ enumerable: !0,
2855
+ configurable: !0,
2856
+ get: () => this.appendData[r],
2857
+ set: (i) => {
2858
+ this.appendData[r] = i;
2859
+ }
2860
+ }, e), {}) : {})), this.syncValue();
2861
+ },
2862
+ valueHandle(e) {
2863
+ return {
2864
+ enumerable: !0,
2865
+ get: () => this.getValue(e),
2866
+ set: (r) => {
2867
+ this.isChange(e, r) && this.setValue(e, r, e.parser.toFormValue(r, e), !0);
2868
+ }
2869
+ };
2870
+ },
2871
+ appendValue(e) {
2872
+ !e.field || !w(this.appendData, e.field) || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
2873
+ },
2874
+ addSubForm(e, r) {
2875
+ this.subForm[e.id] = r;
2876
+ },
2877
+ deferSyncValue(e, r) {
2878
+ this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r), E(e), this.deferSyncFn === e && (this.deferSyncFn = null, e.sync && this.syncValue());
2879
+ },
2880
+ syncValue() {
2881
+ if (this.deferSyncFn)
2882
+ return this.deferSyncFn.sync = !0;
2883
+ this.vm._updateValue(y(y({}, this.options.appendValue !== !1 ? this.appendData : {}), this.form));
2884
+ },
2885
+ isChange(e, r) {
2886
+ return JSON.stringify(e.rule.value, Me) !== JSON.stringify(r === null ? void 0 : r, Me);
2887
+ },
2888
+ isQuote(e, r) {
2889
+ return (h.Object(r) || Array.isArray(r)) && r === e.rule.value;
2890
+ },
2891
+ refreshUpdate(e, r, i, s) {
2892
+ if (h.Function(e.rule.update)) {
2893
+ const n = E(() => e.rule.update(r, e.origin, this.api, {
2894
+ origin: i || "change",
2895
+ linkField: s
2896
+ }));
2897
+ if (n === void 0) return;
2898
+ e.rule.hidden = n === !0;
2899
+ }
2900
+ },
2901
+ valueChange(e, r) {
2902
+ this.refreshRule(e, r), this.bus.$emit("change-" + e.field, r);
2903
+ },
2904
+ refreshRule(e, r, i, s) {
2905
+ this.refreshControl(e) && (this.$render.clearCacheAll(), this.loadRule(), this.vm.$emit("update", this.api), this.refresh()), this.refreshUpdate(e, r, i, s);
2906
+ },
2907
+ appendLink(e) {
2908
+ const r = e.rule.link;
2909
+ h.trueArray(r) && r.forEach((i) => {
2910
+ const s = () => this.refreshRule(e, e.rule.value, "link", i);
2911
+ this.bus.$on("change-" + i, s), e.linkOn.push(() => this.bus.$off("change-" + i, s));
2912
+ });
2913
+ },
2914
+ fields() {
2915
+ return Object.keys(this.fieldCtx);
2916
+ }
2917
+ });
2918
+ }
2919
+ function Me(t, e) {
2920
+ return typeof e == "function" ? "" + e : e;
2921
+ }
2922
+ function Ue(t) {
2923
+ Object.keys(t).forEach((e) => delete t[e]);
2924
+ }
2925
+ const ce = {
2926
+ init(t) {
2927
+ },
2928
+ toFormValue(t, e) {
2929
+ return t;
2930
+ },
2931
+ toValue(t, e) {
2932
+ return t;
2933
+ },
2934
+ mounted(t) {
2935
+ },
2936
+ render(t, e) {
2937
+ return e.$render.defaultRender(e, t);
2938
+ },
2939
+ preview(t, e) {
2940
+ return this.render(t, e);
2941
+ },
2942
+ mergeProp(t) {
2943
+ }
2944
+ }, Cr = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "component", "cache"];
2945
+ function _r(t) {
2946
+ m(t.prototype, {
2947
+ getCtx(e) {
2948
+ return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
2949
+ },
2950
+ getCtxs(e) {
2951
+ return this.fieldCtx[e] || this.nameCtx[e] || (this.ctxs[e] ? [this.ctxs[e]] : []);
2952
+ },
2953
+ setIdCtx(e, r, i) {
2954
+ const s = `${i}Ctx`;
2955
+ this[s][r] ? this[s][r].push(e) : this[s][r] = [e];
2956
+ },
2957
+ rmIdCtx(e, r, i) {
2958
+ const s = `${i}Ctx`, n = this[s][r];
2959
+ if (!n) return !1;
2960
+ const o = n.splice(n.indexOf(e) >>> 0, 1).length > 0;
2961
+ return n.length || delete this[s][r], o;
2962
+ },
2963
+ getFieldCtx(e) {
2964
+ return (this.fieldCtx[e] || [])[0];
2965
+ },
2966
+ getNameCtx(e) {
2967
+ return this.nameCtx[e] || [];
2968
+ },
2969
+ setCtx(e) {
2970
+ let { id: r, field: i, name: s, rule: n } = e;
2971
+ this.ctxs[r] = e, s && this.setIdCtx(e, s, "name"), e.input && (this.setIdCtx(e, i, "field"), this.setFormData(e, e.parser.toFormValue(n.value, e)), this.isMounted && !this.reloading && this.vm.$emit("change", e.field, n.value, e.origin, this.api));
2972
+ },
2973
+ getParser(e) {
2974
+ const r = this.fc.parsers;
2975
+ return r[e.originType] || r[I(e.type)] || r[e.trueType] || ce;
2976
+ },
2977
+ bindParser(e) {
2978
+ e.setParser(this.getParser(e));
2979
+ },
2980
+ getType(e) {
2981
+ const r = this.fc.CreateNode.aliasMap, i = r[e] || r[I(e)] || e;
2982
+ return I(i);
2983
+ },
2984
+ noWatch(e) {
2985
+ this.noWatchFn || (this.noWatchFn = e), E(e), this.noWatchFn === e && (this.noWatchFn = null);
2986
+ },
2987
+ watchCtx(e) {
2988
+ const r = this.vm;
2989
+ Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" && Cr.indexOf(i) === -1).forEach((i) => {
2990
+ const s = i === "children";
2991
+ e.watch.push(r.$watch(() => e.rule[i], (n, o) => {
2992
+ if (!(this.loading || this.noWatchFn || this.reloading)) {
2993
+ if (s && e.parser.loadChildren === !1) {
2994
+ this.$render.clearCache(e), this.nextRefresh();
2995
+ return;
2996
+ }
2997
+ if (this.watching = !0, i === "link") {
2998
+ e.link();
2999
+ return;
3000
+ } else if (["props", "on", "nativeOn", "deep"].indexOf(i) > -1)
3001
+ this.parseInjectEvent(e.rule, n || {}), i === "props" && e.input && this.setFormData(e, e.parser.toFormValue(e.rule.value, e));
3002
+ else if (["emit", "nativeEmit"].indexOf(i) > -1)
3003
+ this.parseEmit(e, i === "emit");
3004
+ else if (["prefix", "suffix"].indexOf(i) > -1)
3005
+ n && this.loadFn(n, e.rule);
3006
+ else if (i === "type")
3007
+ e.updateType(), this.bindParser(e);
3008
+ else if (i === "children") {
3009
+ const a = h.trueArray(n);
3010
+ this.deferSyncValue(() => {
3011
+ n !== o && (this.rmSub(o, e), this.$render.initOrgChildren()), a && this.loadChildren(n, e), this.vm.$emit("update", this.api);
3012
+ });
3013
+ }
3014
+ this.$render.clearCache(e), this.refresh(), this.watching = !1;
3015
+ }
3016
+ }, { deep: !s, sync: s }));
3017
+ }), this.watchEffect(e);
3018
+ },
3019
+ rmSub(e, r) {
3020
+ h.trueArray(e) && e.forEach((i) => {
3021
+ i && i.__fc__ && i.__fc__.parent === r && this.rmCtx(i.__fc__);
3022
+ });
3023
+ },
3024
+ rmCtx(e) {
3025
+ if (e.deleted) return;
3026
+ const { id: r, field: i, input: s, name: n } = e;
3027
+ e.input && Object.defineProperty(e.rule, "value", {
3028
+ value: e.rule.value,
3029
+ writable: !0
3030
+ }), B(this.ctxs, r), B(this.$render.tempList, r), B(this.$render.orgChildren, r), B(this.vm.ctxInject, r), B(this.formData, r), B(this.subForm, r), B(e, "cacheValue"), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !w(this.fieldCtx, i) && B(this.form, i), this.deferSyncValue(() => {
3031
+ this.reloading || (e.parser.loadChildren !== !1 && h.trueArray(e.rule.children) && e.rule.children.forEach((a) => a.__fc__ && this.rmCtx(a.__fc__)), e.root === this.rules && this.vm._renderRule());
3032
+ }, s);
3033
+ const o = this.sort.indexOf(r);
3034
+ return o > -1 && this.sort.splice(o, 1), this.$render.clearCache(e), e.delete(), this.effect(e, "deleted"), s && !this.fieldCtx[i] && this.vm.$emit("removeField", i, e.rule, this.api), e.rule.__ctrl || this.vm.$emit("removeRule", e.rule, this.api), e;
3035
+ }
3036
+ });
3037
+ }
3038
+ function Or(t) {
3039
+ m(t.prototype, {
3040
+ mounted() {
3041
+ const e = () => {
3042
+ this.isMounted = !0, this.lifecycle("mounted");
3043
+ };
3044
+ this.pageEnd ? e() : this.bus.$once("page-end", e);
3045
+ },
3046
+ lifecycle(e) {
3047
+ this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
3048
+ },
3049
+ emitEvent(e, ...r) {
3050
+ const i = this.options[e] || this.options[I("on-" + e)];
3051
+ if (i) {
3052
+ const s = U(i);
3053
+ h.Function(s) && E(() => s(...r));
3054
+ }
3055
+ this.bus.$emit(e, ...r);
3056
+ }
3057
+ });
3058
+ }
3059
+ function kr(t) {
3060
+ m(t.prototype, {
3061
+ useProvider() {
3062
+ const e = this.fc.providers;
3063
+ Object.keys(e).forEach((r) => {
3064
+ let i = e[r];
3065
+ h.Function(i) && (i = i(this.fc)), i._c = Fr(i), this.onEffect(i), this.providers[r] = i;
3066
+ });
3067
+ },
3068
+ onEffect(e) {
3069
+ const r = [];
3070
+ (e._c || ["*"]).forEach((i) => {
3071
+ const s = i === "*" ? "*" : this.getType(i);
3072
+ r.indexOf(s) > -1 || (r.push(s), this.bus.$on(`p:${e.name}:${s}:${e.input ? 1 : 0}`, (n, o) => {
3073
+ e[n] && e[n](...o);
3074
+ }));
3075
+ }), e._used = r;
3076
+ },
3077
+ watchEffect(e) {
3078
+ const r = this.vm;
3079
+ let i = {
3080
+ required: () => {
3081
+ var s, n;
3082
+ return (w(e.rule, "$required") ? e.rule.$required : (n = (s = e.rule) == null ? void 0 : s.effect) == null ? void 0 : n.required) || !1;
3083
+ }
3084
+ };
3085
+ Object.keys(e.rule.effect || {}).forEach((s) => {
3086
+ i[s] = () => e.rule.effect[s];
3087
+ }), Object.keys(e.rule).forEach((s) => {
3088
+ s[0] === "$" && (i[s.substr(1)] = () => e.rule[s]);
3089
+ }), Object.keys(i || {}).forEach((s) => {
3090
+ e.watch.push(r.$watch(i[s], (n) => {
3091
+ this.effect(e, "watch", { [s]: n });
3092
+ }, { deep: !0 }));
3093
+ });
3094
+ },
3095
+ ruleEffect(e, r, i) {
3096
+ this.emitEffect({
3097
+ rule: e,
3098
+ input: !!e.field,
3099
+ type: this.getType(e.type)
3100
+ }, r, i);
3101
+ },
3102
+ effect(e, r, i) {
3103
+ this.emitEffect({
3104
+ rule: e.rule,
3105
+ input: e.input,
3106
+ type: e.trueType,
3107
+ ctx: e,
3108
+ custom: i
3109
+ }, r);
3110
+ },
3111
+ getEffect(e, r) {
3112
+ if (w(e, "$" + r))
3113
+ return e["$" + r];
3114
+ if (w(e, "effect") && w(e.effect, r))
3115
+ return e.effect[r];
3116
+ },
3117
+ emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
3118
+ if (!s || s === "fcFragment") return;
3119
+ const u = n || Object.keys(r).reduce((l, c) => (c[0] === "$" && (l[c.substr(1)] = r[c]), l), y({}, r.effect || {}));
3120
+ Object.keys(u).forEach((l) => {
3121
+ const c = this.providers[l];
3122
+ if (!c || c.input && !i) return;
3123
+ let g;
3124
+ if (!c._c)
3125
+ g = "*";
3126
+ else if (c._used.indexOf(s) > -1)
3127
+ g = s;
3128
+ else
3129
+ return;
3130
+ const b = y({ value: u[l], getValue: () => this.getEffect(r, l) }, a || {});
3131
+ e && (b.getProp = () => e.effectData(l), b.clearProp = () => e.clearEffectData(l), b.mergeProp = (O) => q(b.getProp(), [O]), b.id = e.id), this.bus.$emit(`p:${l}:${g}:${c.input ? 1 : 0}`, o, [b, r, this.api]);
3132
+ });
3133
+ }
3134
+ });
3135
+ }
3136
+ function wr(t) {
3137
+ return t.filter(function(e, r, i) {
3138
+ return i.indexOf(e, 0) === r;
3139
+ });
3140
+ }
3141
+ function Fr(t) {
3142
+ const e = t.components;
3143
+ if (Array.isArray(e)) {
3144
+ const r = wr(e.filter((i) => i !== "*"));
3145
+ return r.length ? r : !1;
3146
+ } else return h.String(e) ? [e] : !1;
3147
+ }
3148
+ function V(t) {
3149
+ m(this, {
3150
+ fc: t,
3151
+ vm: t.vm,
3152
+ watching: !1,
3153
+ loading: !1,
3154
+ reloading: !1,
3155
+ noWatchFn: null,
3156
+ deferSyncFn: null,
3157
+ isMounted: !1,
3158
+ formData: {},
3159
+ subForm: {},
3160
+ form: {},
3161
+ appendData: {},
3162
+ providers: {},
3163
+ cycleLoad: null,
3164
+ loadedId: 1,
3165
+ nextTick: null,
3166
+ changeStatus: !1,
3167
+ pageEnd: !0,
3168
+ nextReload: () => {
3169
+ this.lifecycle("reload");
3170
+ }
3171
+ }), st(this, {
3172
+ options() {
3173
+ return t.options;
3174
+ },
3175
+ bus() {
3176
+ return t.bus;
3177
+ }
3178
+ }), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new be(this), this.api = t.extendApi(or(this), this);
3179
+ }
3180
+ m(V.prototype, {
3181
+ initData(t) {
3182
+ m(this, {
3183
+ ctxs: {},
3184
+ fieldCtx: {},
3185
+ nameCtx: {},
3186
+ sort: [],
3187
+ rules: t
3188
+ });
3189
+ },
3190
+ init() {
3191
+ this.appendData = y(y(y({}, this.fc.options.formData || {}), this.vm.value || {}), this.appendData), this.useProvider(), this.usePage(), this.loadRule(), this.$manager.__init(), this.lifecycle("created"), this.vm.$set(this.vm, "formData", this.formData);
3192
+ },
3193
+ beforeFetch(t) {
3194
+ return new Promise((e) => {
3195
+ const r = this.options.beforeFetch && E(() => this.options.beforeFetch(t, { api: this.api }));
3196
+ r && h.Function(r.then) ? r.then(e) : e();
3197
+ });
3198
+ }
3199
+ });
3200
+ hr(V);
3201
+ cr(V);
3202
+ pr(V);
3203
+ yr(V);
3204
+ br(V);
3205
+ _r(V);
3206
+ Or(V);
3207
+ kr(V);
3208
+ const Sr = "fcFragment", ie = {
3209
+ name: Sr,
3210
+ functional: !0,
3211
+ props: ["vnode"],
3212
+ render(t, e) {
3213
+ return e.props.vnode ? e.props.vnode : e.children;
3214
+ }
3215
+ };
3216
+ function Rr(t) {
3217
+ return h.String(t) ? { domProps: { innerHTML: t } } : t;
3218
+ }
3219
+ function Er() {
3220
+ const t = {};
3221
+ function e(r) {
3222
+ r && this.setVm(r);
3223
+ }
3224
+ return m(e.prototype, {
3225
+ setVm(r) {
3226
+ this.vm = r, this.$h = r.$createElement;
3227
+ },
3228
+ make(r, i, s) {
3229
+ return D.config.isReservedTag(r) && i.nativeOn && delete i.nativeOn, this.makeComponent(r, i, s);
3230
+ },
3231
+ makeComponent(r, i, s) {
3232
+ let n = this.$h(r, Rr(i), s || []);
3233
+ return n.context = this.vm, n;
3234
+ },
3235
+ aliasMap: t
3236
+ }), m(e, {
3237
+ aliasMap: t,
3238
+ alias(r, i) {
3239
+ t[r] = i;
3240
+ },
3241
+ use(r) {
3242
+ Object.keys(r).forEach((i) => {
3243
+ const s = Z(i), n = lr(i).toLocaleLowerCase(), o = r[i];
3244
+ [i, s, n].forEach((a) => {
3245
+ e.alias(i, o), e.prototype[a] = function(u, l) {
3246
+ return this.make(o, u, l);
3247
+ };
3248
+ });
3249
+ });
3250
+ }
3251
+ }), e;
3252
+ }
3253
+ function Ir(t) {
3254
+ class e extends ct {
3255
+ }
3256
+ return Object.assign(e.prototype, t), e;
3257
+ }
3258
+ function ct(t) {
3259
+ m(this, {
3260
+ $handle: t,
3261
+ vm: t.vm,
3262
+ options: {},
3263
+ ref: "fcForm",
3264
+ mergeOptionsRule: {
3265
+ normal: ["form", "row", "info", "submitBtn", "resetBtn"]
3266
+ }
3267
+ }), this.updateKey(), this.init();
3268
+ }
3269
+ m(ct.prototype, {
3270
+ __init() {
3271
+ this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
3272
+ },
3273
+ updateKey() {
3274
+ this.key = re();
3275
+ },
3276
+ //TODO interface
3277
+ init() {
3278
+ },
3279
+ update() {
3280
+ },
3281
+ beforeRender() {
3282
+ },
3283
+ form() {
3284
+ return this.vm.$refs[this.ref];
3285
+ },
3286
+ getSlot(t) {
3287
+ const e = (r) => {
3288
+ if (r) {
3289
+ let i = r.$scopedSlots[t];
3290
+ return i || e(r.$pfc);
3291
+ }
3292
+ };
3293
+ return e(this.vm);
3294
+ },
3295
+ mergeOptions(t, e) {
3296
+ return T(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
3297
+ },
3298
+ updateOptions(t) {
3299
+ this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
3300
+ },
3301
+ tidyOptions(t) {
3302
+ return t;
3303
+ },
3304
+ tidyRule(t) {
3305
+ },
3306
+ mergeProp(t) {
3307
+ },
3308
+ getDefaultOptions() {
3309
+ return {};
3310
+ },
3311
+ render(t) {
3312
+ }
3313
+ });
3314
+ const jr = function(t) {
3315
+ const e = {
3316
+ name: "loadData",
3317
+ _fn: [],
3318
+ created(r, i, s) {
3319
+ this.deleted(r);
3320
+ let n = j(r.getValue());
3321
+ const o = [];
3322
+ n.forEach((a) => {
3323
+ if (a) {
3324
+ const u = () => {
3325
+ a.watch !== !1 && (t.bus.$off("p.loadData." + a.attr, u), t.bus.$once("p.loadData." + a.attr, u));
3326
+ let l;
3327
+ a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l = L(l))), Y(r.getProp(), a.to || "options", l), s.sync(i);
3328
+ };
3329
+ o.push(() => t.bus.$off("p.loadData." + a.attr, u)), u();
3330
+ }
3331
+ }), this._fn[r.id] = o;
3332
+ },
3333
+ deleted(r) {
3334
+ this._fn[r.id] && (this._fn[r.id].forEach((i) => {
3335
+ i();
3336
+ }), delete this._fn[r.id]), r.clearProp();
3337
+ }
3338
+ };
3339
+ return e.watch = e.created, e;
3340
+ }, dt = {
3341
+ name: "componentValidate",
3342
+ load(t, e, r) {
3343
+ const i = t.getValue();
3344
+ i ? t.getProp().validate = [{
3345
+ validator(...s) {
3346
+ const n = Q(e);
3347
+ if (n)
3348
+ return r.exec(n.id, i === !0 ? "formCreateValidate" : i, ...s, {
3349
+ attr: t,
3350
+ rule: e,
3351
+ api: r
3352
+ });
3353
+ }
3354
+ }] : (t.clearProp(), r.clearValidateState([e.field]));
3355
+ },
3356
+ watch(...t) {
3357
+ dt.load(...t);
3358
+ }
3359
+ }, Ar = function(t) {
3360
+ function e(i) {
3361
+ return h.String(i) && (i = {
3362
+ action: i,
3363
+ to: "options"
3364
+ }), i;
3365
+ }
3366
+ function r(i, s, n) {
3367
+ let o = i.value;
3368
+ const a = (g) => {
3369
+ g === void 0 ? (i.clearProp(), n.sync(s)) : Y(i.getProp(), o.to || "options", g);
3370
+ };
3371
+ if (h.Function(o) && (o = o(s, n)), o = e(o), !o || !o.action) {
3372
+ a(void 0);
3373
+ return;
3374
+ }
3375
+ o = L(o), o.to || (o.to = "options");
3376
+ const u = o.onError, l = () => {
3377
+ if (!i.getValue())
3378
+ return i.clearProp(), n.sync(s), !0;
3379
+ }, c = H(y({
3380
+ headers: {}
3381
+ }, o), {
3382
+ onSuccess(g, b) {
3383
+ if (l()) return;
3384
+ let O = ($) => b ? $ : w($, "data") ? $.data : $;
3385
+ h.Function(o.parse) ? O = o.parse : o.parse && h.String(o.parse) && (O = ($) => (o.parse.split(".").forEach((k) => {
3386
+ $ && ($ = $[k]);
3387
+ }), $)), a(O(g, s, n)), n.sync(s);
3388
+ },
3389
+ onError(g) {
3390
+ a(void 0), !l() && (u || ((b) => ge(b.message || "fetch fail " + o.action)))(g, s, n);
3391
+ }
3392
+ });
3393
+ t.$handle.beforeFetch(c, { rule: s, api: n }).then(() => {
3394
+ if (h.Function(o.action)) {
3395
+ o.action(s, n).then((g) => {
3396
+ c.onSuccess(g, !0);
3397
+ }).catch((g) => {
3398
+ c.onError(g);
3399
+ });
3400
+ return;
3401
+ }
3402
+ E(() => t.create.fetch(c, { inject: i, rule: s, api: n }));
3403
+ });
3404
+ }
3405
+ return {
3406
+ name: "fetch",
3407
+ loaded(...i) {
3408
+ r(...i);
3409
+ },
3410
+ watch(...i) {
3411
+ r(...i);
3412
+ }
3413
+ };
3414
+ }, pt = {
3415
+ name: "required",
3416
+ load(t, e, r) {
3417
+ const i = Vr(t.getValue());
3418
+ if (i.required === !1)
3419
+ t.clearProp(), r.clearValidateState([e.field]);
3420
+ else {
3421
+ const s = y({
3422
+ required: !0,
3423
+ validator(n, o, a) {
3424
+ h.empty(o) ? a(s.message) : a();
3425
+ }
3426
+ }, i);
3427
+ if (!s.message) {
3428
+ let n = e.title || "";
3429
+ s.message = ((typeof n == "object" ? n.title : n) || "") + "不能为空";
3430
+ }
3431
+ t.getProp().validate = [s];
3432
+ }
3433
+ r.sync(e);
3434
+ },
3435
+ watch(...t) {
3436
+ pt.load(...t);
3437
+ }
3438
+ };
3439
+ function Vr(t) {
3440
+ return h.Boolean(t) ? { required: t } : h.String(t) ? { message: t } : h.Undef(t) ? { required: !1 } : h.Function(t) ? { validator: t } : h.Object(t) ? t : {};
3441
+ }
3442
+ const Pr = {
3443
+ fetch: Ar,
3444
+ loadData: jr,
3445
+ required: pt,
3446
+ componentValidate: dt
3447
+ }, Dr = "html", Tr = {
3448
+ name: Dr,
3449
+ loadChildren: !1,
3450
+ render(t, e) {
3451
+ return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
3452
+ },
3453
+ renderChildren(t) {
3454
+ return Array.isArray(t.rule.children) ? t.rule.children.filter((e) => h.String(e)).join("") : "";
3455
+ }
3456
+ };
3457
+ function Br(t, e) {
3458
+ let r;
3459
+ return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
3460
+ }
3461
+ function ne() {
3462
+ return Br("name", ...arguments);
3463
+ }
3464
+ function qe(t) {
3465
+ return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
3466
+ }
3467
+ function He(t, e) {
3468
+ const r = new D({
3469
+ data() {
3470
+ return { rule: t, option: e || {} };
3471
+ },
3472
+ render(i) {
3473
+ return i("FormCreate", { ref: "fc", props: this.$data });
3474
+ }
3475
+ });
3476
+ return r.$mount(), r;
3477
+ }
3478
+ function Lr(t) {
3479
+ const e = t.key || [], r = t.array || [], i = t.normal || [];
3480
+ tt.push(...e), pe.push(...r), me.push(...i), at([...e, ...r, ...i]);
3481
+ }
3482
+ let Nr = 1;
3483
+ const R = {};
3484
+ function mt(t) {
3485
+ const e = {
3486
+ [ie.name]: ie
3487
+ }, r = {}, i = {}, s = y({}, Pr), n = ir();
3488
+ let o = { global: {} };
3489
+ const a = {}, u = Er(), l = {};
3490
+ Lr(t.attrs || {});
3491
+ function c(f) {
3492
+ const d = R[f];
3493
+ if (Array.isArray(d))
3494
+ return d.map((v) => v.api());
3495
+ if (d)
3496
+ return d.api();
3497
+ }
3498
+ function g() {
3499
+ const f = ne(...arguments);
3500
+ f.id && f.prop && (i[f.id] = f.prop);
3501
+ }
3502
+ function b() {
3503
+ const f = ne(...arguments);
3504
+ f.id && f.prop && (s[f.id] = H(y({}, f.prop), { name: f.id }));
3505
+ }
3506
+ function O(f) {
3507
+ u.use(f);
3508
+ }
3509
+ function $() {
3510
+ const f = ne(...arguments);
3511
+ if (!f.id || !f.prop) return ce;
3512
+ const d = I(f.id), v = f.prop, C = v.merge === !0 ? r[d] : void 0;
3513
+ r[d] = v, Object.setPrototypeOf(v, C || ce), n[d] = S(d), v.maker && m(n, v.maker);
3514
+ }
3515
+ function k(f, d) {
3516
+ let v;
3517
+ if (h.String(f)) {
3518
+ if (v = I(f), ["form-create", "formcreate"].indexOf(v) > -1)
3519
+ return G();
3520
+ if (d === void 0)
3521
+ return e[v];
3522
+ } else
3523
+ v = I(f.name), d = f;
3524
+ if (!v || !d) return;
3525
+ const C = I(v);
3526
+ e[v] = d, e[C] = d, delete u.aliasMap[v], delete u.aliasMap[C], delete r[v], delete r[C], d.formCreateParser && $(v, d.formCreateParser);
3527
+ }
3528
+ function Ce(f) {
3529
+ Object.keys(R).forEach((d) => {
3530
+ (Array.isArray(R[d]) ? R[d] : [R[d]]).forEach((C) => {
3531
+ C.bus.$emit("p.loadData." + f);
3532
+ });
3533
+ });
3534
+ }
3535
+ function _e(f, d) {
3536
+ a[f] = d, Ce(f);
3537
+ }
3538
+ function Oe(f, d) {
3539
+ return w(a, f) ? a[f] : d;
3540
+ }
3541
+ function yt(f) {
3542
+ delete a[f], Ce(f);
3543
+ }
3544
+ function G() {
3545
+ return Kt(we, e, i);
3546
+ }
3547
+ function ke() {
3548
+ return ie;
3549
+ }
3550
+ function gt(f, d) {
3551
+ return h.Function(f.install) ? f.install(M, d) : h.Function(f) && f(M, d), this;
3552
+ }
3553
+ function M(f, d, v) {
3554
+ let C = He(f, d || {});
3555
+ const A = C.$refs.fc.formCreate;
3556
+ return A.$parent = v, qe(A.options).appendChild(C.$el), A.api();
3557
+ }
3558
+ Object.setPrototypeOf(M, l);
3559
+ function $t(f) {
3560
+ let d = y({}, t);
3561
+ return f ? d.inherit = {
3562
+ components: e,
3563
+ parsers: r,
3564
+ directives: i,
3565
+ providers: s,
3566
+ maker: n,
3567
+ loadData: a
3568
+ } : delete d.inherit, mt(d);
3569
+ }
3570
+ function we(f) {
3571
+ const d = f.$options.propsData.rule;
3572
+ m(this, {
3573
+ id: Nr++,
3574
+ vm: f,
3575
+ create: M,
3576
+ manager: Ir(t.manager),
3577
+ parsers: r,
3578
+ providers: s,
3579
+ rules: Array.isArray(d) ? d : [],
3580
+ name: f.$options.propsData.name || re(),
3581
+ inFor: f.$options.propsData.inFor,
3582
+ prop: {
3583
+ components: e,
3584
+ directives: i
3585
+ },
3586
+ setData: _e,
3587
+ getData: Oe,
3588
+ loadData: a,
3589
+ CreateNode: u,
3590
+ bus: new D(),
3591
+ unwatch: null,
3592
+ options: {},
3593
+ extendApi: t.extendApi || ((v) => v)
3594
+ }), this.init(), this.initOptions(), this.name && (this.inFor ? (R[this.name] || (R[this.name] = []), R[this.name].push(this)) : R[this.name] = this);
3595
+ }
3596
+ m(we.prototype, {
3597
+ init() {
3598
+ const f = this.vm, d = new V(this);
3599
+ this.$handle = d, f.$f = d.api, f.$emit("input", d.api), f.$on("hook:created", () => {
3600
+ this.isSub() && (this.unwatch = f.$watch(() => f.$pfc.option, () => {
3601
+ this.initOptions(), f.$f.refresh();
3602
+ }, { deep: !0 }), this.initOptions()), this.created();
3603
+ }), f.$on("hook:mounted", () => {
3604
+ this.mounted();
3605
+ }), f.$on("hook:beforeDestroy", () => {
3606
+ if (f.destroyed = !0, this.unwatch && this.unwatch(), d.reloadRule([]), this.name)
3607
+ if (this.inFor) {
3608
+ const v = R[this.name].indexOf(this);
3609
+ R[this.name].splice(v, 1), R[this.name].length || delete R[this.name];
3610
+ } else
3611
+ delete R[this.name];
3612
+ }), f.$on("hook:updated", () => {
3613
+ d.bindNextTick(() => this.bus.$emit("next-tick", d.api));
3614
+ });
3615
+ },
3616
+ isSub() {
3617
+ return this.vm.$pfc && this.vm.extendOption;
3618
+ },
3619
+ initOptions() {
3620
+ this.options = {};
3621
+ let f = y({ formData: {}, submitBtn: {}, resetBtn: {} }, L(o));
3622
+ this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0), f = this.mergeOptions(f, this.vm.$options.propsData.option), this.updateOptions(f);
3623
+ },
3624
+ mergeOptions(f, d, v) {
3625
+ return d = L(d), v && ["page", "onSubmit", "mounted", "reload", "formData", "el"].forEach((C) => {
3626
+ delete d[C];
3627
+ }), d.global && (f.global = tr(f.global, d.global), delete d.global), this.$handle.$manager.mergeOptions([d], f), f;
3628
+ },
3629
+ updateOptions(f) {
3630
+ this.mergeOptions(this.options, f), this.$handle.$manager.updateOptions(this.options);
3631
+ },
3632
+ created() {
3633
+ this.$handle.init(), this.vm.$emit("created", this.api());
3634
+ },
3635
+ api() {
3636
+ return this.$handle.api;
3637
+ },
3638
+ render() {
3639
+ return this.$handle.render();
3640
+ },
3641
+ mounted() {
3642
+ this.$handle.mounted();
3643
+ }
3644
+ });
3645
+ function Fe(f) {
3646
+ m(f, {
3647
+ version: t.version,
3648
+ ui: t.ui,
3649
+ setData: _e,
3650
+ getData: Oe,
3651
+ removeData: yt,
3652
+ maker: n,
3653
+ component: k,
3654
+ directive: g,
3655
+ register: b,
3656
+ $vnode: ke,
3657
+ parser: $,
3658
+ use: gt,
3659
+ factory: $t,
3660
+ componentAlias: O,
3661
+ copyRule: $e,
3662
+ copyRules: nt,
3663
+ fetch: ut,
3664
+ $form: G,
3665
+ parseFn: U,
3666
+ parseJson: er,
3667
+ toJson: rt,
3668
+ getApi: c,
3669
+ init(d, v = {}) {
3670
+ let C = He(d, v), A = C.$refs.fc.formCreate;
3671
+ return {
3672
+ mount(J) {
3673
+ return J && h.Element(J) && (A.options.el = J), qe(A.options).appendChild(C.$el), A.api();
3674
+ },
3675
+ remove() {
3676
+ C.$el.parentNode && C.$el.parentNode.removeChild(C.$el);
3677
+ },
3678
+ destroy() {
3679
+ this.remove(), C.$destroy();
3680
+ },
3681
+ $f: A.api()
3682
+ };
3683
+ }
3684
+ });
3685
+ }
3686
+ function vt(f) {
3687
+ m(f, {
3688
+ create: M,
3689
+ install(d, v) {
3690
+ if (o = y(y({}, o), v || {}), d._installedFormCreate === !0) return;
3691
+ d._installedFormCreate = !0;
3692
+ const C = function(A, J = {}) {
3693
+ return M(A, J, this);
3694
+ };
3695
+ Fe(C), d.prototype.$formCreate = C, d.component("FormCreate", G()), d.component("FcFragment", ke());
3696
+ }
3697
+ });
3698
+ }
3699
+ if (Fe(l), vt(l), u.use({ fragment: "fcFragment" }), $(Tr), t.install && M.use(t), t.inherit) {
3700
+ const f = t.inherit;
3701
+ f.components && m(e, f.components), f.parsers && m(r, f.parsers), f.directives && m(i, f.directives), f.providers && m(s, f.providers), f.maker && m(n, f.maker), f.loadData && m(a, f.loadData);
3702
+ }
3703
+ const K = G();
3704
+ return Object.setPrototypeOf(K, l), Object.defineProperties(K, {
3705
+ fetch: {
3706
+ get() {
3707
+ return l.fetch;
3708
+ },
3709
+ set(f) {
3710
+ l.fetch = f;
3711
+ }
3712
+ }
3713
+ }), K.util = l, K;
3714
+ }
3715
+ function se(t) {
3716
+ if (h.Date(t))
3717
+ return t;
3718
+ {
3719
+ let e = new Date(t);
3720
+ return e.toString() === "Invalid Date" ? t : e;
3721
+ }
3722
+ }
3723
+ const Je = "datePicker", Mr = {
3724
+ name: Je,
3725
+ maker: function() {
3726
+ return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] = S(Je, { type: e.toLowerCase() }), t), {});
3727
+ }(),
3728
+ mergeProp(t) {
3729
+ let e = t.prop.props;
3730
+ e.startDate && (e.startDate = e.startDate && se(e.startDate));
3731
+ },
3732
+ isRange(t) {
3733
+ return t.type.includes("range") || t.multiple;
3734
+ },
3735
+ _toValue(t, e) {
3736
+ const r = e.el.formatDate(t || ""), { separator: i } = e.el, s = this.isRange(e.el);
3737
+ return r ? s ? r.split(i) : r : s ? e.el.multiple ? [] : ["", ""] : r;
3738
+ },
3739
+ toValue(t, e) {
3740
+ const r = e.el;
3741
+ return r ? (this.el = r, this._toValue(t, e)) : t;
3742
+ },
3743
+ toFormValue(t, e) {
3744
+ if (e.el) {
3745
+ const r = e.el.parseDate(t);
3746
+ return this.isRange(e.el) ? r : r[0];
3747
+ } else {
3748
+ let r = Array.isArray(t), i = e.prop.props, s, n = i.type || "date";
3749
+ return ["daterange", "datetimerange"].indexOf(n) !== -1 ? r ? s = t.map((o) => o ? se(o) : "") : s = ["", ""] : n === "date" && i.multiple === !0 ? s = toString(t) : (s = r ? t[0] || "" : t, s = s ? se(s) : ""), s;
3750
+ }
3751
+ },
3752
+ mounted(t) {
3753
+ t.rule.value = this.toValue(t.$handle.getFormData(t), t);
3754
+ }
3755
+ }, oe = "hidden", Ur = {
3756
+ name: oe,
3757
+ maker: {
3758
+ [oe]: (t, e) => S(oe)("", t, e)
3759
+ },
3760
+ render() {
3761
+ return [];
3762
+ }
3763
+ }, ae = "input", qr = {
3764
+ name: ae,
3765
+ maker: function() {
3766
+ const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = S(ae, { type: r }), e), {});
3767
+ return t.idate = S(ae, { type: "date" }), t;
3768
+ }(),
3769
+ mergeProp(t) {
3770
+ let { props: e } = t.prop;
3771
+ e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
3772
+ }
3773
+ }, ze = "slider", Hr = {
3774
+ name: ze,
3775
+ maker: {
3776
+ sliderRange: S(ze, { range: !0 })
3777
+ },
3778
+ toFormValue(t, e) {
3779
+ let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
3780
+ return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
3781
+ }
3782
+ }, Jr = {
3783
+ name: "switch",
3784
+ mergeProp(t) {
3785
+ const e = t.prop.props.slot || {}, r = t.prop.scopedSlots || {};
3786
+ e.open && (r.open = () => e.open), e.close && (r.close = () => e.close), t.prop.scopedSlots = r;
3787
+ }
3788
+ }, zr = {
3789
+ name: "FcRow",
3790
+ render(t, e) {
3791
+ return e.vNode.col({ props: { span: 24 } }, [
3792
+ e.vNode.row(e.prop, t)
3793
+ ]);
3794
+ }
3795
+ }, Wr = [
3796
+ Mr,
3797
+ Ur,
3798
+ qr,
3799
+ Hr,
3800
+ Jr,
3801
+ zr
3802
+ ], xr = {
3803
+ button: "iButton",
3804
+ icon: "Icon",
3805
+ slider: "Slider",
3806
+ rate: "Rate",
3807
+ upload: "fcUpload",
3808
+ cascader: "Cascader",
3809
+ colorPicker: "ColorPicker",
3810
+ timePicker: "TimePicker",
3811
+ datePicker: "DatePicker",
3812
+ switch: "iSwitch",
3813
+ select: "fcSelect",
3814
+ checkbox: "fcCheckbox",
3815
+ radio: "fcRadio",
3816
+ inputNumber: "InputNumber",
3817
+ input: "iInput",
3818
+ formItem: "FormItem",
3819
+ form: "iForm",
3820
+ frame: "fcFrame",
3821
+ col: "iCol",
3822
+ row: "row",
3823
+ tree: "fcTree",
3824
+ autoComplete: "AutoComplete",
3825
+ group: "fcGroup",
3826
+ subForm: "fcSubForm",
3827
+ object: "fcSubForm"
3828
+ }, ee = {
3829
+ resetBtnType: "default",
3830
+ resetBtnIcon: "md-refresh",
3831
+ infoIcon: "ios-information-circle-outline"
3832
+ };
3833
+ function Gr() {
3834
+ return {
3835
+ type: "poptip",
3836
+ trigger: "hover",
3837
+ placement: "top-start",
3838
+ wordWrap: !0,
3839
+ icon: ee.infoIcon
3840
+ };
3841
+ }
3842
+ function Kr() {
3843
+ return {
3844
+ form: {
3845
+ inline: !1,
3846
+ labelPosition: "right",
3847
+ labelWidth: 125,
3848
+ showMessage: !0,
3849
+ autocomplete: "off",
3850
+ size: void 0
3851
+ },
3852
+ row: {
3853
+ gutter: 0
3854
+ },
3855
+ submitBtn: {
3856
+ type: "primary",
3857
+ disabled: !1,
3858
+ innerText: "提交",
3859
+ loading: !1,
3860
+ show: !0,
3861
+ click: void 0
3862
+ },
3863
+ resetBtn: {
3864
+ type: ee.resetBtnType,
3865
+ disabled: !1,
3866
+ icon: ee.resetBtnIcon,
3867
+ innerText: "重置",
3868
+ loading: !1,
3869
+ show: !1,
3870
+ click: void 0
3871
+ }
3872
+ };
3873
+ }
3874
+ function We(t, e) {
3875
+ w(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
3876
+ }
3877
+ function P(t) {
3878
+ return t === !1;
3879
+ }
3880
+ function Xr(t, e) {
3881
+ w(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
3882
+ }
3883
+ const Qr = {
3884
+ validate() {
3885
+ const t = this.form();
3886
+ return t ? new Promise((e, r) => {
3887
+ t.validate().then((i) => {
3888
+ i ? e(!0) : r(!1);
3889
+ });
3890
+ }) : new Promise((e) => e());
3891
+ },
3892
+ validateField(t) {
3893
+ const e = this.form();
3894
+ return e ? new Promise((r, i) => {
3895
+ e.validateField(t, (s) => {
3896
+ s ? i(s) : r(null);
3897
+ });
3898
+ }) : new Promise((r) => r());
3899
+ },
3900
+ clearValidateState(t) {
3901
+ const e = this.vm.$refs[t.wrapRef];
3902
+ e && (e.validateMessage = "", e.validateState = "");
3903
+ },
3904
+ tidyOptions(t) {
3905
+ return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
3906
+ Xr(t, e);
3907
+ }), t;
3908
+ },
3909
+ tidyRule({ prop: t }) {
3910
+ return We(t, "title"), We(t, "info"), t;
3911
+ },
3912
+ mergeProp(t) {
3913
+ t.prop = T([{
3914
+ info: this.options.info || {},
3915
+ wrap: this.options.wrap || {},
3916
+ col: this.options.col || {},
3917
+ title: this.options.title || {}
3918
+ }, t.prop], {
3919
+ info: Gr(),
3920
+ title: {},
3921
+ col: { span: 24 },
3922
+ wrap: {}
3923
+ }, { normal: ["title", "info", "col", "wrap"] }), this.setSize(t.prop.props);
3924
+ },
3925
+ setSize(t) {
3926
+ !t.size && this.options.form.size && (t.size = this.options.form.size);
3927
+ },
3928
+ getDefaultOptions() {
3929
+ return Kr();
3930
+ },
3931
+ update() {
3932
+ const t = this.options.form;
3933
+ this.rule = {
3934
+ props: y({}, t),
3935
+ nativeOn: {
3936
+ submit: (e) => {
3937
+ e.preventDefault();
3938
+ }
3939
+ },
3940
+ class: [t.className, t.class, "form-create"],
3941
+ style: t.style,
3942
+ type: "form"
3943
+ };
3944
+ },
3945
+ beforeRender() {
3946
+ const { key: t, ref: e, $handle: r } = this;
3947
+ m(this.rule, { key: t, ref: e }), m(this.rule.props, {
3948
+ model: r.formData
3949
+ // rules: $handle.validate(),
3950
+ });
3951
+ },
3952
+ render(t) {
3953
+ return t.length && t.push(this.makeFormBtn()), this.$r(this.rule, P(this.options.row.show) ? t : [this.makeRow(t)]);
3954
+ },
3955
+ makeWrap(t, e) {
3956
+ const r = t.prop, i = `${this.key}${t.key}`, s = r.col, n = this.isTitle(r), o = !s.labelWidth && !n ? 0 : s.labelWidth, { inline: a, col: u } = this.rule.props, l = P(r.wrap.show) ? e : this.$r(T([r.wrap, {
3957
+ props: H(y({
3958
+ labelWidth: o
3959
+ }, r.wrap || {}), {
3960
+ prop: t.id,
3961
+ rules: t.injectValidate()
3962
+ }),
3963
+ class: r.className,
3964
+ key: `${i}fi`,
3965
+ ref: t.wrapRef,
3966
+ type: "formItem"
3967
+ }]), [e, n ? this.makeInfo(r, i, t) : null]);
3968
+ return a === !0 || P(u) || P(s.show) ? l : this.makeCol(r, i, [l]);
3969
+ },
3970
+ isTitle(t) {
3971
+ if (this.options.form.title === !1) return !1;
3972
+ const e = t.title;
3973
+ return !(!e.title && !e.native || P(e.show));
3974
+ },
3975
+ makeInfo(t, e, r) {
3976
+ const i = t.title, s = t.info, n = this.getSlot("title"), o = [n ? n({ title: i.title || "", rule: r.rule, options: this.options }) : i.title];
3977
+ if (!P(s.show) && (s.info || s.native) && !P(s.icon)) {
3978
+ const a = {
3979
+ type: s.type || "poptip",
3980
+ props: y({}, s),
3981
+ key: `${e}pop`,
3982
+ slot: "label"
3983
+ }, u = "content";
3984
+ s.info && !w(a.props, u) && (a.props[u] = s.info), o[s.align !== "left" ? "unshift" : "push"](this.$r(T([s, a]), [
3985
+ this.$r({
3986
+ type: "icon",
3987
+ props: { type: s.icon === !0 ? ee.infoIcon : s.icon, size: 16 },
3988
+ style: "margin-top: -1px",
3989
+ key: `${e}i`
3990
+ })
3991
+ ]));
3992
+ }
3993
+ return this.$r(T([i, {
3994
+ props: i,
3995
+ slot: i.slot || "label",
3996
+ key: `${e}tit`,
3997
+ type: i.type || "span"
3998
+ }]), o);
3999
+ },
4000
+ makeCol(t, e, r) {
4001
+ const i = t.col;
4002
+ return this.$r({
4003
+ class: i.class,
4004
+ type: "col",
4005
+ props: i || { span: 24 },
4006
+ key: `${e}col`
4007
+ }, r);
4008
+ },
4009
+ makeRow(t) {
4010
+ const e = this.options.row || {};
4011
+ return this.$r({
4012
+ type: "row",
4013
+ props: e,
4014
+ class: e.class,
4015
+ key: `${this.key}row`
4016
+ }, t);
4017
+ },
4018
+ makeFormBtn() {
4019
+ let t = [];
4020
+ if (P(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), P(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
4021
+ return;
4022
+ const e = this.$r({
4023
+ type: "formItem",
4024
+ key: `${this.key}fb`
4025
+ }, t);
4026
+ return this.rule.props.inline === !0 ? e : this.$r({
4027
+ type: "col",
4028
+ props: { span: 24 },
4029
+ key: `${this.key}fc`
4030
+ }, [e]);
4031
+ },
4032
+ makeResetBtn() {
4033
+ const t = this.options.resetBtn;
4034
+ return this.setSize(t), this.$r({
4035
+ type: "button",
4036
+ props: t,
4037
+ style: { width: t.width, marginLeft: "15px" },
4038
+ on: {
4039
+ click: () => {
4040
+ const e = this.$handle.api;
4041
+ t.click ? t.click(e) : e.resetFields();
4042
+ }
4043
+ },
4044
+ key: `${this.key}b2`
4045
+ }, [t.innerText]);
4046
+ },
4047
+ makeSubmitBtn() {
4048
+ const t = this.options.submitBtn;
4049
+ return this.setSize(t), this.$r({
4050
+ type: "button",
4051
+ props: t,
4052
+ style: { width: t.width },
4053
+ on: {
4054
+ click: () => {
4055
+ const e = this.$handle.api;
4056
+ t.click ? t.click(e) : e.submit();
4057
+ }
4058
+ },
4059
+ key: `${this.key}b1`
4060
+ }, [t.innerText]);
4061
+ }
4062
+ }, N = {}, Zr = ["upload", "select", "tree", "checkbox", "autoComplete", "cascader", "colorPicker", "frame", "inputNumber", "radio", "rate", "timePicker", "group"];
4063
+ function Yr(t) {
4064
+ Zr.forEach((e) => {
4065
+ t[e] = S(e);
4066
+ }), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
4067
+ }
4068
+ function ei(t) {
4069
+ const e = "upload", r = {
4070
+ image: ["image", 0],
4071
+ file: ["file", 0],
4072
+ uploadFileOne: ["file", 1],
4073
+ uploadImageOne: ["image", 1]
4074
+ };
4075
+ Object.keys(r).reduce((i, s) => (i[s] = S(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
4076
+ }
4077
+ function ti(t) {
4078
+ const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
4079
+ Object.keys(r).reduce((i, s) => (i[s] = S(e, { type: r[s] }), i), t);
4080
+ }
4081
+ function ri(t) {
4082
+ const e = "timePicker";
4083
+ t.time = S(e, { type: "time" }), t.timeRange = S(e, { type: "timerange" });
4084
+ }
4085
+ function ii(t) {
4086
+ const e = "select";
4087
+ t.selectMultiple = S(e, { multiple: !0 }), t.selectOne = S(e, { multiple: !1 });
4088
+ }
4089
+ function ni(t) {
4090
+ const e = "frame", r = {
4091
+ frameInputs: ["input", 0],
4092
+ frameFiles: ["file", 0],
4093
+ frameImages: ["image", 0],
4094
+ frameInputOne: ["input", 1],
4095
+ frameFileOne: ["file", 1],
4096
+ frameImageOne: ["image", 1]
4097
+ };
4098
+ Object.keys(r).reduce((i, s) => (i[s] = S(e, (n) => n.props({ type: r[s][0], maxLength: r[s][1] })), i), t), t.frameInput = t.frameInputs, t.frameFile = t.frameFiles, t.frameImage = t.frameImages;
4099
+ }
4100
+ Yr(N);
4101
+ ei(N);
4102
+ ti(N);
4103
+ ii(N);
4104
+ ni(N);
4105
+ ri(N);
4106
+ function xe(t, e) {
4107
+ return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
4108
+ }
4109
+ function si(t, e) {
4110
+ return m(t, {
4111
+ formEl() {
4112
+ return e.$manager.form();
4113
+ },
4114
+ wrapEl(r) {
4115
+ const i = e.getFieldCtx(r);
4116
+ if (i)
4117
+ return e.vm.$refs[i.wrapRef];
4118
+ },
4119
+ validate(r) {
4120
+ return new Promise((i, s) => {
4121
+ const n = t.children, o = [e.$manager.validate()];
4122
+ n.forEach((a) => {
4123
+ o.push(a.validate());
4124
+ }), Promise.all(o).then(() => {
4125
+ i(!0), r && r(!0);
4126
+ }).catch((a) => {
4127
+ s(a), r && r(a), e.vm.$emit("validate-fail", a, { api: t });
4128
+ });
4129
+ });
4130
+ },
4131
+ validateField: (r, i) => new Promise((s, n) => {
4132
+ const o = e.getFieldCtx(r);
4133
+ if (!o) return;
4134
+ const a = e.subForm[o.id], u = [e.$manager.validateField(o.id)];
4135
+ j(a).forEach((l) => {
4136
+ u.push(l.validate().catch(() => Promise.reject("子表单验证未通过")));
4137
+ }), Promise.all(u).then(() => {
4138
+ s(null), i && i(null);
4139
+ }).catch((l) => {
4140
+ n(l), i && i(l), e.vm.$emit("validate-field-fail", l, { field: r, api: t });
4141
+ });
4142
+ }),
4143
+ clearValidateState(r, i = !0) {
4144
+ t.helper.tidyFields(r).forEach((s) => {
4145
+ i && this.clearSubValidateState(s), e.getCtxs(s).forEach((n) => {
4146
+ e.$manager.clearValidateState(n);
4147
+ });
4148
+ });
4149
+ },
4150
+ clearSubValidateState(r) {
4151
+ t.helper.tidyFields(r).forEach((i) => {
4152
+ e.getCtxs(i).forEach((s) => {
4153
+ const n = e.subForm[s.id];
4154
+ n && (Array.isArray(n) ? n.forEach((o) => {
4155
+ o.clearValidateState();
4156
+ }) : n && n.clearValidateState());
4157
+ });
4158
+ });
4159
+ },
4160
+ btn: {
4161
+ loading: (r = !0) => {
4162
+ t.submitBtnProps({ loading: !!r });
4163
+ },
4164
+ disabled: (r = !0) => {
4165
+ t.submitBtnProps({ disabled: !!r });
4166
+ },
4167
+ show: (r = !0) => {
4168
+ t.submitBtnProps({ show: !!r });
4169
+ }
4170
+ },
4171
+ resetBtn: {
4172
+ loading: (r = !0) => {
4173
+ t.resetBtnProps({ loading: !!r });
4174
+ },
4175
+ disabled: (r = !0) => {
4176
+ t.resetBtnProps({ disabled: !!r });
4177
+ },
4178
+ show: (r = !0) => {
4179
+ t.resetBtnProps({ show: !!r });
4180
+ }
4181
+ },
4182
+ submitBtnProps: (r = {}) => {
4183
+ let i = xe(e.options.submitBtn, !0);
4184
+ m(i, r), e.options.submitBtn = i, t.refreshOptions();
4185
+ },
4186
+ resetBtnProps: (r = {}) => {
4187
+ let i = xe(e.options.resetBtn, !1);
4188
+ m(i, r), e.options.resetBtn = i, t.refreshOptions();
4189
+ },
4190
+ submit(r, i) {
4191
+ t.validate((s) => {
4192
+ if (s) {
4193
+ let n = t.formData();
4194
+ h.Function(r) ? E(() => r(n, this)) : (h.Function(e.options.onSubmit) && E(() => e.options.onSubmit(n, this)), e.vm.$emit("submit", n, this));
4195
+ } else
4196
+ h.Function(i) && E(() => i(this, ...arguments));
4197
+ }).catch((s) => {
4198
+ });
4199
+ }
4200
+ }), t;
4201
+ }
4202
+ function oi(t) {
4203
+ t.componentAlias(xr), Gt.forEach((e) => {
4204
+ t.component(e.name, e);
4205
+ }), Wr.forEach((e) => {
4206
+ t.parser(e);
4207
+ }), Object.keys(N).forEach((e) => {
4208
+ t.maker[e] = N[e];
4209
+ });
4210
+ }
4211
+ function ai() {
4212
+ return mt({
4213
+ ui: "iview",
4214
+ version: "2.6.0",
4215
+ manager: Qr,
4216
+ install: oi,
4217
+ extendApi: si,
4218
+ attrs: {
4219
+ normal: ["col", "wrap"],
4220
+ array: ["className"],
4221
+ key: ["title", "info"]
4222
+ }
4223
+ });
4224
+ }
4225
+ const de = ai();
4226
+ typeof window != "undefined" && (window.formCreate = de, window.Vue && de.install(window.Vue));
4227
+ const fi = de.maker;
4228
+ export {
4229
+ de as default,
4230
+ fi as maker
4231
+ };