@fishbelly/form-morph-arco 0.1.1 → 0.2.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.
- package/README.md +248 -211
- package/dist/components/ArcoFormItem.vue.d.ts +1 -1
- package/dist/components/ArcoFormShell.vue.d.ts +5 -0
- package/dist/containers/CardContainer.vue.d.ts +1 -1
- package/dist/containers/DividerContainer.vue.d.ts +1 -1
- package/dist/containers/SectionContainer.vue.d.ts +1 -1
- package/dist/fields/CascaderInput.vue.d.ts +1 -1
- package/dist/fields/CheckboxInput.vue.d.ts +1 -1
- package/dist/fields/ColorInput.vue.d.ts +1 -1
- package/dist/fields/DateInput.vue.d.ts +1 -1
- package/dist/fields/NumberInput.vue.d.ts +1 -1
- package/dist/fields/RadioInput.vue.d.ts +1 -1
- package/dist/fields/RateInput.vue.d.ts +1 -1
- package/dist/fields/SelectInput.vue.d.ts +1 -1
- package/dist/fields/SliderInput.vue.d.ts +1 -1
- package/dist/fields/StaticText.vue.d.ts +1 -1
- package/dist/fields/SwitchInput.vue.d.ts +1 -1
- package/dist/fields/TextInput.vue.d.ts +1 -1
- package/dist/fields/TimeInput.vue.d.ts +1 -1
- package/dist/fields/TreeSelectInput.vue.d.ts +1 -1
- package/dist/fields/UploadInput.vue.d.ts +1 -1
- package/dist/fields/treeValue.d.ts +8 -0
- package/dist/i18n.d.ts +12 -0
- package/dist/index.d.ts +15 -6
- package/dist/index.js +766 -551
- package/dist/index.js.map +1 -1
- package/dist/locale.d.ts +14 -0
- package/dist/locales/en-US.d.ts +3 -0
- package/dist/locales/en-US.js +139 -0
- package/dist/locales/en-US.js.map +1 -0
- package/dist/locales/zh-CN.d.ts +34 -0
- package/dist/shell.d.ts +12 -0
- package/dist/style.css +1 -1
- package/package.json +6 -2
- package/dist/__tests__/dateValue.test.d.ts +0 -1
- package/dist/__tests__/fieldConfig.test.d.ts +0 -1
- package/dist/__tests__/uploadInput.test.d.ts +0 -1
- package/dist/__tests__/uploadValue.test.d.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,49 @@
|
|
|
1
|
-
import { FORM_RUNTIME_KEY as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { Textarea as
|
|
4
|
-
import { IconUpload as
|
|
5
|
-
import { formInjectionKey as
|
|
6
|
-
|
|
1
|
+
import { useLocale as Ve, FORM_RUNTIME_KEY as Ee, matchesFileAccept as ye, resolveLabelWidth as Re, localeCandidates as Oe, normalizeLocale as We, defineFieldType as w, definePlugin as je } from "@fishbelly/form-morph";
|
|
2
|
+
import { defineComponent as k, computed as c, openBlock as p, createBlock as g, unref as h, withCtx as F, createElementBlock as C, Fragment as _, renderList as re, createTextVNode as Z, toDisplayString as B, inject as ze, ref as H, onMounted as Ce, onBeforeUnmount as Le, createCommentVNode as Y, createVNode as G, normalizeClass as ee, provide as Ke, reactive as Te, renderSlot as le, nextTick as he, resolveDynamicComponent as He, normalizeProps as Ye, guardReactiveProps as qe, normalizeStyle as Ge, createElementVNode as ve, h as Ze } from "vue";
|
|
3
|
+
import { Textarea as Je, InputPassword as Qe, Input as Xe, InputNumber as _e, Select as el, RadioGroup as ll, Radio as tl, CheckboxGroup as al, Checkbox as ol, Switch as nl, Slider as rl, Rate as il, RangePicker as dl, DatePicker as sl, TimePicker as ul, Upload as cl, Button as pl, Cascader as ml, TreeSelect as fl, ColorPicker as yl, FormItem as hl, ConfigProvider as vl, Form as bl, Card as gl, Divider as wl } from "@arco-design/web-vue";
|
|
4
|
+
import { IconUpload as kl, IconCheckCircleFill as xl, IconCompass as Vl } from "@arco-design/web-vue/es/icon";
|
|
5
|
+
import { formInjectionKey as be } from "@arco-design/web-vue/es/form/context";
|
|
6
|
+
import zl from "@arco-design/web-vue/es/locale/lang/en-us";
|
|
7
|
+
import Cl from "@arco-design/web-vue/es/locale/lang/zh-cn";
|
|
8
|
+
const Se = {
|
|
9
|
+
"field.input.placeholder": "请输入",
|
|
10
|
+
"field.textarea.placeholder": "请输入",
|
|
11
|
+
"field.password.placeholder": "请输入密码",
|
|
12
|
+
"field.number.placeholder": "请输入数字",
|
|
13
|
+
"field.select.placeholder": "请选择",
|
|
14
|
+
"field.multi-select.placeholder": "请选择",
|
|
15
|
+
"field.cascader.placeholder": "请选择",
|
|
16
|
+
"field.tree-select.placeholder": "请选择",
|
|
17
|
+
"field.date.placeholder": "请选择日期",
|
|
18
|
+
"field.time.placeholder": "请选择时间",
|
|
19
|
+
"field.static-text.content": "静态文本内容",
|
|
20
|
+
"field.static-text.placeholder": "静态文本内容(请在右侧属性面板填写)",
|
|
21
|
+
"field.upload.button": "点击上传",
|
|
22
|
+
"field.upload.release": "松开上传",
|
|
23
|
+
"field.upload.count": "已上传 {count} 个文件",
|
|
24
|
+
"field.upload.notice.type": "文件类型不支持",
|
|
25
|
+
"field.upload.notice.rejected": "{count} 个文件类型不支持",
|
|
26
|
+
"field.upload.notice.limit": "最多上传 {limit} 个文件",
|
|
27
|
+
"field.upload.notice.separator": ";",
|
|
28
|
+
"field.upload.acceptHint": "支持 {accept},可拖拽上传",
|
|
29
|
+
"field.upload.acceptAllHint": "支持所有文件格式,可拖拽上传",
|
|
30
|
+
"field.upload.empty": "未上传",
|
|
31
|
+
"field.upload.attachment": "附件"
|
|
32
|
+
};
|
|
33
|
+
function Ll(e, t) {
|
|
34
|
+
return t ? e.replace(
|
|
35
|
+
/\{(\w+)\}/g,
|
|
36
|
+
(l, a) => t[a] === void 0 ? l : String(t[a])
|
|
37
|
+
) : e;
|
|
38
|
+
}
|
|
39
|
+
function O() {
|
|
40
|
+
const { t: e, hasMessage: t } = Ve();
|
|
41
|
+
function l(a, n) {
|
|
42
|
+
return t(a) ? e(a, n) : Ll(Se[a], n);
|
|
43
|
+
}
|
|
44
|
+
return { tField: l };
|
|
45
|
+
}
|
|
46
|
+
const te = /* @__PURE__ */ k({
|
|
7
47
|
__name: "TextInput",
|
|
8
48
|
props: {
|
|
9
49
|
modelValue: {},
|
|
@@ -17,46 +57,50 @@ const K = /* @__PURE__ */ x({
|
|
|
17
57
|
},
|
|
18
58
|
emits: ["update:modelValue"],
|
|
19
59
|
setup(e, { emit: t }) {
|
|
20
|
-
const l = e, a = t, n =
|
|
21
|
-
|
|
22
|
-
|
|
60
|
+
const l = e, a = t, { tField: n } = O(), o = c(() => l.node.type === "textarea"), r = c(() => l.node.type === "password"), u = c(() => l.modelValue === null || l.modelValue === void 0 ? "" : String(l.modelValue)), i = c(() => {
|
|
61
|
+
var m;
|
|
62
|
+
const f = (m = l.node.props) == null ? void 0 : m.placeholder;
|
|
63
|
+
return typeof f == "string" && f ? f : o.value ? n("field.textarea.placeholder") : r.value ? n("field.password.placeholder") : n("field.input.placeholder");
|
|
64
|
+
});
|
|
65
|
+
function s(f) {
|
|
66
|
+
a("update:modelValue", f);
|
|
23
67
|
}
|
|
24
|
-
return (
|
|
25
|
-
var v,
|
|
26
|
-
return
|
|
68
|
+
return (f, m) => {
|
|
69
|
+
var v, L, I, D, T, z, A, P, b;
|
|
70
|
+
return o.value ? (p(), g(h(Je), {
|
|
27
71
|
key: 0,
|
|
28
|
-
"model-value":
|
|
29
|
-
placeholder:
|
|
30
|
-
"max-length": ((
|
|
31
|
-
"auto-size": ((
|
|
32
|
-
"show-word-limit": ((
|
|
33
|
-
"allow-clear": ((
|
|
34
|
-
rows: ((
|
|
72
|
+
"model-value": u.value,
|
|
73
|
+
placeholder: i.value,
|
|
74
|
+
"max-length": ((v = e.node.props) == null ? void 0 : v.maxLength) ?? void 0,
|
|
75
|
+
"auto-size": ((L = e.node.props) == null ? void 0 : L.autoSize) === !0,
|
|
76
|
+
"show-word-limit": ((I = e.node.props) == null ? void 0 : I.showWordLimit) === !0,
|
|
77
|
+
"allow-clear": ((D = e.node.props) == null ? void 0 : D.allowClear) === !0,
|
|
78
|
+
rows: ((T = e.node.props) == null ? void 0 : T.rows) ?? 4,
|
|
35
79
|
disabled: e.disabled || e.readonly,
|
|
36
80
|
size: e.size,
|
|
37
|
-
"onUpdate:modelValue":
|
|
38
|
-
}, null, 8, ["model-value", "placeholder", "max-length", "auto-size", "show-word-limit", "allow-clear", "rows", "disabled", "size"])) : r.value ? (p(),
|
|
81
|
+
"onUpdate:modelValue": s
|
|
82
|
+
}, null, 8, ["model-value", "placeholder", "max-length", "auto-size", "show-word-limit", "allow-clear", "rows", "disabled", "size"])) : r.value ? (p(), g(h(Qe), {
|
|
39
83
|
key: 1,
|
|
40
|
-
"model-value":
|
|
41
|
-
placeholder:
|
|
42
|
-
"max-length": ((
|
|
43
|
-
"allow-clear": ((
|
|
84
|
+
"model-value": u.value,
|
|
85
|
+
placeholder: i.value,
|
|
86
|
+
"max-length": ((z = e.node.props) == null ? void 0 : z.maxLength) ?? void 0,
|
|
87
|
+
"allow-clear": ((A = e.node.props) == null ? void 0 : A.allowClear) !== !1,
|
|
44
88
|
disabled: e.disabled || e.readonly,
|
|
45
89
|
size: e.size,
|
|
46
|
-
"onUpdate:modelValue":
|
|
47
|
-
}, null, 8, ["model-value", "placeholder", "max-length", "allow-clear", "disabled", "size"])) : (p(),
|
|
90
|
+
"onUpdate:modelValue": s
|
|
91
|
+
}, null, 8, ["model-value", "placeholder", "max-length", "allow-clear", "disabled", "size"])) : (p(), g(h(Xe), {
|
|
48
92
|
key: 2,
|
|
49
|
-
"model-value":
|
|
50
|
-
placeholder:
|
|
51
|
-
"max-length": ((
|
|
52
|
-
"allow-clear": ((
|
|
93
|
+
"model-value": u.value,
|
|
94
|
+
placeholder: i.value,
|
|
95
|
+
"max-length": ((P = e.node.props) == null ? void 0 : P.maxLength) ?? void 0,
|
|
96
|
+
"allow-clear": ((b = e.node.props) == null ? void 0 : b.allowClear) !== !1,
|
|
53
97
|
disabled: e.disabled || e.readonly,
|
|
54
98
|
size: e.size,
|
|
55
|
-
"onUpdate:modelValue":
|
|
99
|
+
"onUpdate:modelValue": s
|
|
56
100
|
}, null, 8, ["model-value", "placeholder", "max-length", "allow-clear", "disabled", "size"]));
|
|
57
101
|
};
|
|
58
102
|
}
|
|
59
|
-
}),
|
|
103
|
+
}), Tl = /* @__PURE__ */ k({
|
|
60
104
|
__name: "NumberInput",
|
|
61
105
|
props: {
|
|
62
106
|
modelValue: {},
|
|
@@ -70,30 +114,34 @@ const K = /* @__PURE__ */ x({
|
|
|
70
114
|
},
|
|
71
115
|
emits: ["update:modelValue"],
|
|
72
116
|
setup(e, { emit: t }) {
|
|
73
|
-
const l = e, a = t, n =
|
|
117
|
+
const l = e, a = t, { tField: n } = O(), o = c(() => {
|
|
74
118
|
if (l.modelValue === null || l.modelValue === void 0 || l.modelValue === "") return;
|
|
75
|
-
const
|
|
76
|
-
return Number.isFinite(
|
|
119
|
+
const i = Number(l.modelValue);
|
|
120
|
+
return Number.isFinite(i) ? i : void 0;
|
|
121
|
+
}), r = c(() => {
|
|
122
|
+
var s;
|
|
123
|
+
const i = (s = l.node.props) == null ? void 0 : s.placeholder;
|
|
124
|
+
return typeof i == "string" && i ? i : n("field.number.placeholder");
|
|
77
125
|
});
|
|
78
|
-
function
|
|
79
|
-
a("update:modelValue",
|
|
126
|
+
function u(i) {
|
|
127
|
+
a("update:modelValue", i === void 0 || i === "" ? null : i);
|
|
80
128
|
}
|
|
81
|
-
return (
|
|
82
|
-
var
|
|
83
|
-
return p(),
|
|
84
|
-
"model-value":
|
|
85
|
-
placeholder:
|
|
86
|
-
min: ((
|
|
87
|
-
max: ((
|
|
88
|
-
step: ((
|
|
89
|
-
precision: ((
|
|
129
|
+
return (i, s) => {
|
|
130
|
+
var f, m, v, L;
|
|
131
|
+
return p(), g(h(_e), {
|
|
132
|
+
"model-value": o.value,
|
|
133
|
+
placeholder: r.value,
|
|
134
|
+
min: ((f = e.node.props) == null ? void 0 : f.min) ?? void 0,
|
|
135
|
+
max: ((m = e.node.props) == null ? void 0 : m.max) ?? void 0,
|
|
136
|
+
step: ((v = e.node.props) == null ? void 0 : v.step) ?? void 0,
|
|
137
|
+
precision: ((L = e.node.props) == null ? void 0 : L.precision) ?? void 0,
|
|
90
138
|
disabled: e.disabled || e.readonly,
|
|
91
139
|
size: e.size,
|
|
92
|
-
"onUpdate:modelValue":
|
|
140
|
+
"onUpdate:modelValue": u
|
|
93
141
|
}, null, 8, ["model-value", "placeholder", "min", "max", "step", "precision", "disabled", "size"]);
|
|
94
142
|
};
|
|
95
143
|
}
|
|
96
|
-
}),
|
|
144
|
+
}), ge = /* @__PURE__ */ k({
|
|
97
145
|
__name: "SelectInput",
|
|
98
146
|
props: {
|
|
99
147
|
modelValue: {},
|
|
@@ -107,30 +155,34 @@ const K = /* @__PURE__ */ x({
|
|
|
107
155
|
},
|
|
108
156
|
emits: ["update:modelValue"],
|
|
109
157
|
setup(e, { emit: t }) {
|
|
110
|
-
const l = e, a = t, n =
|
|
111
|
-
var
|
|
112
|
-
return l.node.type === "multi-select" || ((
|
|
113
|
-
}), r =
|
|
114
|
-
|
|
115
|
-
|
|
158
|
+
const l = e, a = t, { tField: n } = O(), o = c(() => {
|
|
159
|
+
var s;
|
|
160
|
+
return l.node.type === "multi-select" || ((s = l.node.props) == null ? void 0 : s.multiple) === !0;
|
|
161
|
+
}), r = c(() => o.value ? Array.isArray(l.modelValue) ? l.modelValue : [] : l.modelValue === null || l.modelValue === void 0 ? void 0 : l.modelValue), u = c(() => {
|
|
162
|
+
var f;
|
|
163
|
+
const s = (f = l.node.props) == null ? void 0 : f.placeholder;
|
|
164
|
+
return typeof s == "string" && s ? s : o.value ? n("field.multi-select.placeholder") : n("field.select.placeholder");
|
|
165
|
+
});
|
|
166
|
+
function i(s) {
|
|
167
|
+
a("update:modelValue", s === void 0 ? null : s);
|
|
116
168
|
}
|
|
117
|
-
return (
|
|
118
|
-
var
|
|
119
|
-
return p(),
|
|
169
|
+
return (s, f) => {
|
|
170
|
+
var m, v, L;
|
|
171
|
+
return p(), g(h(el), {
|
|
120
172
|
"model-value": r.value,
|
|
121
173
|
options: e.options,
|
|
122
|
-
multiple:
|
|
123
|
-
placeholder:
|
|
124
|
-
"allow-search": ((
|
|
125
|
-
"max-tag-count": ((
|
|
174
|
+
multiple: o.value,
|
|
175
|
+
placeholder: u.value,
|
|
176
|
+
"allow-search": ((m = e.node.props) == null ? void 0 : m.allowSearch) === !0,
|
|
177
|
+
"max-tag-count": ((v = e.node.props) == null ? void 0 : v.maxTagCount) ?? void 0,
|
|
126
178
|
disabled: e.disabled || e.readonly,
|
|
127
179
|
size: e.size,
|
|
128
|
-
"allow-clear": ((
|
|
129
|
-
"onUpdate:modelValue":
|
|
180
|
+
"allow-clear": ((L = e.node.props) == null ? void 0 : L.allowClear) !== !1,
|
|
181
|
+
"onUpdate:modelValue": i
|
|
130
182
|
}, null, 8, ["model-value", "options", "multiple", "placeholder", "allow-search", "max-tag-count", "disabled", "size", "allow-clear"]);
|
|
131
183
|
};
|
|
132
184
|
}
|
|
133
|
-
}),
|
|
185
|
+
}), Sl = /* @__PURE__ */ k({
|
|
134
186
|
__name: "RadioInput",
|
|
135
187
|
props: {
|
|
136
188
|
modelValue: {},
|
|
@@ -144,30 +196,30 @@ const K = /* @__PURE__ */ x({
|
|
|
144
196
|
},
|
|
145
197
|
emits: ["update:modelValue"],
|
|
146
198
|
setup(e, { emit: t }) {
|
|
147
|
-
const l = e, a = t, n =
|
|
148
|
-
const
|
|
149
|
-
if (typeof
|
|
199
|
+
const l = e, a = t, n = c(() => {
|
|
200
|
+
const r = l.modelValue;
|
|
201
|
+
if (typeof r == "string" || typeof r == "number" || typeof r == "boolean") return r;
|
|
150
202
|
});
|
|
151
|
-
function r
|
|
152
|
-
a("update:modelValue",
|
|
203
|
+
function o(r) {
|
|
204
|
+
a("update:modelValue", r);
|
|
153
205
|
}
|
|
154
|
-
return (
|
|
155
|
-
var
|
|
156
|
-
return p(),
|
|
206
|
+
return (r, u) => {
|
|
207
|
+
var i;
|
|
208
|
+
return p(), g(h(ll), {
|
|
157
209
|
"model-value": n.value,
|
|
158
|
-
direction: ((
|
|
210
|
+
direction: ((i = e.node.props) == null ? void 0 : i.direction) === "vertical" ? "vertical" : "horizontal",
|
|
159
211
|
disabled: e.disabled || e.readonly,
|
|
160
212
|
size: e.size,
|
|
161
|
-
onChange:
|
|
213
|
+
onChange: o
|
|
162
214
|
}, {
|
|
163
|
-
default:
|
|
164
|
-
(p(!0),
|
|
165
|
-
key: String(
|
|
166
|
-
value:
|
|
167
|
-
disabled:
|
|
215
|
+
default: F(() => [
|
|
216
|
+
(p(!0), C(_, null, re(e.options, (s) => (p(), g(h(tl), {
|
|
217
|
+
key: String(s.value),
|
|
218
|
+
value: s.value,
|
|
219
|
+
disabled: s.disabled
|
|
168
220
|
}, {
|
|
169
|
-
default:
|
|
170
|
-
|
|
221
|
+
default: F(() => [
|
|
222
|
+
Z(B(s.label), 1)
|
|
171
223
|
]),
|
|
172
224
|
_: 2
|
|
173
225
|
}, 1032, ["value", "disabled"]))), 128))
|
|
@@ -176,7 +228,7 @@ const K = /* @__PURE__ */ x({
|
|
|
176
228
|
}, 8, ["model-value", "direction", "disabled", "size"]);
|
|
177
229
|
};
|
|
178
230
|
}
|
|
179
|
-
}),
|
|
231
|
+
}), Bl = /* @__PURE__ */ k({
|
|
180
232
|
__name: "CheckboxInput",
|
|
181
233
|
props: {
|
|
182
234
|
modelValue: {},
|
|
@@ -190,27 +242,27 @@ const K = /* @__PURE__ */ x({
|
|
|
190
242
|
},
|
|
191
243
|
emits: ["update:modelValue"],
|
|
192
244
|
setup(e, { emit: t }) {
|
|
193
|
-
const l = e, a = t, n =
|
|
194
|
-
function r
|
|
195
|
-
a("update:modelValue", Array.isArray(
|
|
245
|
+
const l = e, a = t, n = c(() => Array.isArray(l.modelValue) ? l.modelValue : []);
|
|
246
|
+
function o(r) {
|
|
247
|
+
a("update:modelValue", Array.isArray(r) ? r : []);
|
|
196
248
|
}
|
|
197
|
-
return (
|
|
198
|
-
var
|
|
199
|
-
return p(),
|
|
249
|
+
return (r, u) => {
|
|
250
|
+
var i;
|
|
251
|
+
return p(), g(h(al), {
|
|
200
252
|
"model-value": n.value,
|
|
201
|
-
direction: ((
|
|
253
|
+
direction: ((i = e.node.props) == null ? void 0 : i.direction) === "vertical" ? "vertical" : "horizontal",
|
|
202
254
|
disabled: e.disabled || e.readonly,
|
|
203
255
|
size: e.size,
|
|
204
|
-
onChange:
|
|
256
|
+
onChange: o
|
|
205
257
|
}, {
|
|
206
|
-
default:
|
|
207
|
-
(p(!0),
|
|
208
|
-
key: String(
|
|
209
|
-
value:
|
|
210
|
-
disabled:
|
|
258
|
+
default: F(() => [
|
|
259
|
+
(p(!0), C(_, null, re(e.options, (s) => (p(), g(h(ol), {
|
|
260
|
+
key: String(s.value),
|
|
261
|
+
value: s.value,
|
|
262
|
+
disabled: s.disabled
|
|
211
263
|
}, {
|
|
212
|
-
default:
|
|
213
|
-
|
|
264
|
+
default: F(() => [
|
|
265
|
+
Z(B(s.label), 1)
|
|
214
266
|
]),
|
|
215
267
|
_: 2
|
|
216
268
|
}, 1032, ["value", "disabled"]))), 128))
|
|
@@ -219,7 +271,7 @@ const K = /* @__PURE__ */ x({
|
|
|
219
271
|
}, 8, ["model-value", "direction", "disabled", "size"]);
|
|
220
272
|
};
|
|
221
273
|
}
|
|
222
|
-
}),
|
|
274
|
+
}), Al = /* @__PURE__ */ k({
|
|
223
275
|
__name: "SwitchInput",
|
|
224
276
|
props: {
|
|
225
277
|
modelValue: {},
|
|
@@ -233,20 +285,20 @@ const K = /* @__PURE__ */ x({
|
|
|
233
285
|
},
|
|
234
286
|
emits: ["update:modelValue"],
|
|
235
287
|
setup(e, { emit: t }) {
|
|
236
|
-
const l = e, a = t, n =
|
|
237
|
-
return (
|
|
238
|
-
var
|
|
239
|
-
return p(),
|
|
288
|
+
const l = e, a = t, n = c(() => l.size === "mini" || l.size === "small" ? "small" : "medium");
|
|
289
|
+
return (o, r) => {
|
|
290
|
+
var u, i;
|
|
291
|
+
return p(), g(h(nl), {
|
|
240
292
|
"model-value": e.modelValue === !0,
|
|
241
|
-
"checked-text": ((
|
|
242
|
-
"unchecked-text": ((
|
|
293
|
+
"checked-text": ((u = e.node.props) == null ? void 0 : u.checkedText) ?? void 0,
|
|
294
|
+
"unchecked-text": ((i = e.node.props) == null ? void 0 : i.uncheckedText) ?? void 0,
|
|
243
295
|
disabled: e.disabled || e.readonly,
|
|
244
296
|
size: n.value,
|
|
245
|
-
"onUpdate:modelValue":
|
|
297
|
+
"onUpdate:modelValue": r[0] || (r[0] = (s) => a("update:modelValue", !!s))
|
|
246
298
|
}, null, 8, ["model-value", "checked-text", "unchecked-text", "disabled", "size"]);
|
|
247
299
|
};
|
|
248
300
|
}
|
|
249
|
-
}),
|
|
301
|
+
}), Fl = /* @__PURE__ */ k({
|
|
250
302
|
__name: "SliderInput",
|
|
251
303
|
props: {
|
|
252
304
|
modelValue: {},
|
|
@@ -260,27 +312,27 @@ const K = /* @__PURE__ */ x({
|
|
|
260
312
|
},
|
|
261
313
|
emits: ["update:modelValue"],
|
|
262
314
|
setup(e, { emit: t }) {
|
|
263
|
-
const l = e, a = t, n =
|
|
264
|
-
var
|
|
265
|
-
const
|
|
266
|
-
if (l.modelValue === null || l.modelValue === void 0 || l.modelValue === "") return
|
|
267
|
-
const
|
|
268
|
-
return Number.isFinite(
|
|
315
|
+
const l = e, a = t, n = c(() => {
|
|
316
|
+
var u;
|
|
317
|
+
const o = Number(((u = l.node.props) == null ? void 0 : u.min) ?? 0);
|
|
318
|
+
if (l.modelValue === null || l.modelValue === void 0 || l.modelValue === "") return o;
|
|
319
|
+
const r = Number(l.modelValue);
|
|
320
|
+
return Number.isFinite(r) ? r : o;
|
|
269
321
|
});
|
|
270
|
-
return (
|
|
271
|
-
var
|
|
272
|
-
return p(),
|
|
322
|
+
return (o, r) => {
|
|
323
|
+
var u, i, s, f;
|
|
324
|
+
return p(), g(h(rl), {
|
|
273
325
|
"model-value": n.value,
|
|
274
|
-
min: ((
|
|
275
|
-
max: ((
|
|
276
|
-
step: ((
|
|
277
|
-
"show-input": ((
|
|
326
|
+
min: ((u = e.node.props) == null ? void 0 : u.min) ?? 0,
|
|
327
|
+
max: ((i = e.node.props) == null ? void 0 : i.max) ?? 100,
|
|
328
|
+
step: ((s = e.node.props) == null ? void 0 : s.step) ?? 1,
|
|
329
|
+
"show-input": ((f = e.node.props) == null ? void 0 : f.showInput) === !0,
|
|
278
330
|
disabled: e.disabled || e.readonly,
|
|
279
|
-
onChange:
|
|
331
|
+
onChange: r[0] || (r[0] = (m) => a("update:modelValue", m))
|
|
280
332
|
}, null, 8, ["model-value", "min", "max", "step", "show-input", "disabled"]);
|
|
281
333
|
};
|
|
282
334
|
}
|
|
283
|
-
}),
|
|
335
|
+
}), Il = /* @__PURE__ */ k({
|
|
284
336
|
__name: "RateInput",
|
|
285
337
|
props: {
|
|
286
338
|
modelValue: {},
|
|
@@ -294,32 +346,32 @@ const K = /* @__PURE__ */ x({
|
|
|
294
346
|
},
|
|
295
347
|
emits: ["update:modelValue"],
|
|
296
348
|
setup(e, { emit: t }) {
|
|
297
|
-
const l = e, a = t, n =
|
|
298
|
-
const
|
|
299
|
-
return Number.isFinite(
|
|
349
|
+
const l = e, a = t, n = c(() => {
|
|
350
|
+
const o = Number(l.modelValue);
|
|
351
|
+
return Number.isFinite(o) ? o : 0;
|
|
300
352
|
});
|
|
301
|
-
return (
|
|
302
|
-
var
|
|
303
|
-
return p(),
|
|
353
|
+
return (o, r) => {
|
|
354
|
+
var u, i;
|
|
355
|
+
return p(), g(h(il), {
|
|
304
356
|
"model-value": n.value,
|
|
305
|
-
count: ((
|
|
306
|
-
"allow-half": ((
|
|
357
|
+
count: ((u = e.node.props) == null ? void 0 : u.count) ?? 5,
|
|
358
|
+
"allow-half": ((i = e.node.props) == null ? void 0 : i.allowHalf) === !0,
|
|
307
359
|
disabled: e.disabled || e.readonly,
|
|
308
|
-
onChange:
|
|
360
|
+
onChange: r[0] || (r[0] = (s) => a("update:modelValue", s))
|
|
309
361
|
}, null, 8, ["model-value", "count", "allow-half", "disabled"]);
|
|
310
362
|
};
|
|
311
363
|
}
|
|
312
364
|
});
|
|
313
|
-
function
|
|
365
|
+
function $l(e) {
|
|
314
366
|
return !Array.isArray(e) || e.length === 0 ? [] : [
|
|
315
367
|
e[0] instanceof Date ? e[0].getTime() : null,
|
|
316
368
|
e[1] instanceof Date ? e[1].getTime() : null
|
|
317
369
|
];
|
|
318
370
|
}
|
|
319
|
-
function
|
|
371
|
+
function Dl(e) {
|
|
320
372
|
return e ? [] : null;
|
|
321
373
|
}
|
|
322
|
-
const
|
|
374
|
+
const we = /* @__PURE__ */ k({
|
|
323
375
|
__name: "DateInput",
|
|
324
376
|
props: {
|
|
325
377
|
modelValue: {},
|
|
@@ -333,57 +385,57 @@ const ne = /* @__PURE__ */ x({
|
|
|
333
385
|
},
|
|
334
386
|
emits: ["update:modelValue"],
|
|
335
387
|
setup(e, { emit: t }) {
|
|
336
|
-
const l = e, a = t, n =
|
|
337
|
-
function
|
|
338
|
-
if (
|
|
339
|
-
const
|
|
340
|
-
return Number.isFinite(
|
|
388
|
+
const l = e, a = t, n = c(() => l.node.type === "date-range");
|
|
389
|
+
function o(m) {
|
|
390
|
+
if (m == null || m === "") return;
|
|
391
|
+
const v = Number(m);
|
|
392
|
+
return Number.isFinite(v) ? new Date(v) : void 0;
|
|
341
393
|
}
|
|
342
|
-
const
|
|
394
|
+
const r = c(() => o(l.modelValue)), u = c(() => {
|
|
343
395
|
if (!(!Array.isArray(l.modelValue) || l.modelValue.length === 0))
|
|
344
|
-
return [
|
|
396
|
+
return [o(l.modelValue[0]), o(l.modelValue[1])];
|
|
345
397
|
});
|
|
346
|
-
function
|
|
347
|
-
if (!
|
|
398
|
+
function i(m, v) {
|
|
399
|
+
if (!v) {
|
|
348
400
|
a("update:modelValue", null);
|
|
349
401
|
return;
|
|
350
402
|
}
|
|
351
|
-
|
|
403
|
+
v instanceof Date && a("update:modelValue", v.getTime());
|
|
352
404
|
}
|
|
353
|
-
function
|
|
354
|
-
a("update:modelValue",
|
|
405
|
+
function s(m, v) {
|
|
406
|
+
a("update:modelValue", $l(v));
|
|
355
407
|
}
|
|
356
|
-
function
|
|
357
|
-
a("update:modelValue",
|
|
408
|
+
function f() {
|
|
409
|
+
a("update:modelValue", Dl(n.value));
|
|
358
410
|
}
|
|
359
|
-
return (
|
|
360
|
-
var
|
|
361
|
-
return n.value ? (p(),
|
|
411
|
+
return (m, v) => {
|
|
412
|
+
var L, I, D, T, z, A, P, b;
|
|
413
|
+
return n.value ? (p(), g(h(dl), {
|
|
362
414
|
key: 0,
|
|
363
|
-
"model-value":
|
|
364
|
-
placeholder: ((
|
|
365
|
-
"show-time": ((
|
|
366
|
-
format: ((
|
|
367
|
-
"allow-clear": ((
|
|
415
|
+
"model-value": u.value,
|
|
416
|
+
placeholder: ((L = e.node.props) == null ? void 0 : L.placeholder) ?? void 0,
|
|
417
|
+
"show-time": ((I = e.node.props) == null ? void 0 : I.showTime) === !0,
|
|
418
|
+
format: ((D = e.node.props) == null ? void 0 : D.format) ?? void 0,
|
|
419
|
+
"allow-clear": ((T = e.node.props) == null ? void 0 : T.allowClear) !== !1,
|
|
368
420
|
disabled: e.disabled || e.readonly,
|
|
369
421
|
size: e.size,
|
|
370
|
-
onChange:
|
|
371
|
-
onClear:
|
|
372
|
-
}, null, 8, ["model-value", "placeholder", "show-time", "format", "allow-clear", "disabled", "size"])) : (p(),
|
|
422
|
+
onChange: s,
|
|
423
|
+
onClear: f
|
|
424
|
+
}, null, 8, ["model-value", "placeholder", "show-time", "format", "allow-clear", "disabled", "size"])) : (p(), g(h(sl), {
|
|
373
425
|
key: 1,
|
|
374
|
-
"model-value":
|
|
375
|
-
placeholder: ((
|
|
376
|
-
"show-time": ((
|
|
377
|
-
format: ((
|
|
378
|
-
"allow-clear": ((
|
|
426
|
+
"model-value": r.value,
|
|
427
|
+
placeholder: ((z = e.node.props) == null ? void 0 : z.placeholder) ?? void 0,
|
|
428
|
+
"show-time": ((A = e.node.props) == null ? void 0 : A.showTime) === !0,
|
|
429
|
+
format: ((P = e.node.props) == null ? void 0 : P.format) ?? void 0,
|
|
430
|
+
"allow-clear": ((b = e.node.props) == null ? void 0 : b.allowClear) !== !1,
|
|
379
431
|
disabled: e.disabled || e.readonly,
|
|
380
432
|
size: e.size,
|
|
381
|
-
onChange:
|
|
382
|
-
onClear:
|
|
433
|
+
onChange: i,
|
|
434
|
+
onClear: f
|
|
383
435
|
}, null, 8, ["model-value", "placeholder", "show-time", "format", "allow-clear", "disabled", "size"]));
|
|
384
436
|
};
|
|
385
437
|
}
|
|
386
|
-
}),
|
|
438
|
+
}), Pl = /* @__PURE__ */ k({
|
|
387
439
|
__name: "TimeInput",
|
|
388
440
|
props: {
|
|
389
441
|
modelValue: {},
|
|
@@ -397,44 +449,48 @@ const ne = /* @__PURE__ */ x({
|
|
|
397
449
|
},
|
|
398
450
|
emits: ["update:modelValue"],
|
|
399
451
|
setup(e, { emit: t }) {
|
|
400
|
-
const l = t
|
|
401
|
-
|
|
402
|
-
|
|
452
|
+
const l = e, a = t, { tField: n } = O(), o = c(() => {
|
|
453
|
+
var s;
|
|
454
|
+
const i = (s = l.node.props) == null ? void 0 : s.placeholder;
|
|
455
|
+
return typeof i == "string" && i ? i : n("field.time.placeholder");
|
|
456
|
+
});
|
|
457
|
+
function r(i) {
|
|
458
|
+
a("update:modelValue", i ?? "");
|
|
403
459
|
}
|
|
404
|
-
function
|
|
405
|
-
|
|
460
|
+
function u() {
|
|
461
|
+
a("update:modelValue", "");
|
|
406
462
|
}
|
|
407
|
-
return (
|
|
408
|
-
var
|
|
409
|
-
return p(),
|
|
463
|
+
return (i, s) => {
|
|
464
|
+
var f, m;
|
|
465
|
+
return p(), g(h(ul), {
|
|
410
466
|
"model-value": e.modelValue === null || e.modelValue === void 0 ? "" : String(e.modelValue),
|
|
411
|
-
placeholder:
|
|
412
|
-
format: ((
|
|
413
|
-
"allow-clear": ((
|
|
467
|
+
placeholder: o.value,
|
|
468
|
+
format: ((f = e.node.props) == null ? void 0 : f.format) ?? void 0,
|
|
469
|
+
"allow-clear": ((m = e.node.props) == null ? void 0 : m.allowClear) !== !1,
|
|
414
470
|
disabled: e.disabled || e.readonly,
|
|
415
471
|
size: e.size,
|
|
416
|
-
onChange:
|
|
417
|
-
onClear:
|
|
472
|
+
onChange: r,
|
|
473
|
+
onClear: u
|
|
418
474
|
}, null, 8, ["model-value", "placeholder", "format", "allow-clear", "disabled", "size"]);
|
|
419
475
|
};
|
|
420
476
|
}
|
|
421
|
-
}),
|
|
422
|
-
function
|
|
477
|
+
}), Nl = /* @__PURE__ */ new Set(["uid", "status", "percent", "response", "file", "originFile", "isUploading"]);
|
|
478
|
+
function oe(e) {
|
|
423
479
|
return typeof File < "u" && e instanceof File;
|
|
424
480
|
}
|
|
425
|
-
function
|
|
481
|
+
function Be(e) {
|
|
426
482
|
const t = e.response;
|
|
427
483
|
return t && typeof t == "object" ? t.data : void 0;
|
|
428
484
|
}
|
|
429
|
-
function
|
|
485
|
+
function Ml(e) {
|
|
430
486
|
const t = {};
|
|
431
487
|
return Object.entries(e).forEach(([l, a]) => {
|
|
432
|
-
|
|
488
|
+
Nl.has(l) || (t[l] = a);
|
|
433
489
|
}), t;
|
|
434
490
|
}
|
|
435
|
-
function
|
|
491
|
+
function ke(e) {
|
|
436
492
|
if (e == null) return e;
|
|
437
|
-
if (
|
|
493
|
+
if (oe(e))
|
|
438
494
|
return {
|
|
439
495
|
uid: `file-${e.name}-${e.lastModified}`,
|
|
440
496
|
name: e.name,
|
|
@@ -444,9 +500,9 @@ function rl(e) {
|
|
|
444
500
|
type: e.type
|
|
445
501
|
};
|
|
446
502
|
if (typeof e != "object") return e;
|
|
447
|
-
const t = e, l =
|
|
503
|
+
const t = e, l = Be(t);
|
|
448
504
|
if (l && typeof l == "object") return l;
|
|
449
|
-
const a =
|
|
505
|
+
const a = oe(t.file) ? t.file : void 0;
|
|
450
506
|
if (a) {
|
|
451
507
|
const n = {
|
|
452
508
|
uid: t.uid ?? `file-${a.name}-${a.lastModified}`,
|
|
@@ -454,22 +510,22 @@ function rl(e) {
|
|
|
454
510
|
file: a
|
|
455
511
|
};
|
|
456
512
|
t.url && (n.url = t.url), t.status && (n.status = t.status);
|
|
457
|
-
const
|
|
458
|
-
return
|
|
513
|
+
const o = a.size ?? t.size, r = a.type ?? t.type;
|
|
514
|
+
return o !== void 0 && (n.size = o), r !== void 0 && (n.type = r), n;
|
|
459
515
|
}
|
|
460
|
-
return typeof l == "string" || typeof l == "number" ? { id: l } :
|
|
516
|
+
return typeof l == "string" || typeof l == "number" ? { id: l } : Ml(t);
|
|
461
517
|
}
|
|
462
|
-
function
|
|
518
|
+
function Ul(e) {
|
|
463
519
|
return Array.isArray(e) ? e.map((t, l) => {
|
|
464
|
-
if (
|
|
520
|
+
if (oe(t))
|
|
465
521
|
return { uid: `local-${l}`, name: t.name, file: t, status: "done" };
|
|
466
522
|
if (t && typeof t == "object") {
|
|
467
|
-
const a = t, n =
|
|
523
|
+
const a = t, n = Be(a), o = n && typeof n == "object" ? n : a, r = o.id ?? a.id, u = o.originalName ?? o.name ?? a.name, i = o.fileUrl ?? o.url ?? a.url, s = {
|
|
468
524
|
...a,
|
|
469
|
-
uid: a.uid ?? (
|
|
525
|
+
uid: a.uid ?? (r !== void 0 ? `remote-${String(r)}` : `remote-${l}`),
|
|
470
526
|
status: a.status ?? "done"
|
|
471
527
|
};
|
|
472
|
-
return
|
|
528
|
+
return u !== void 0 && (s.name = u), i !== void 0 && (s.url = i), !a.response && r !== void 0 && (s.response = { data: o }), s;
|
|
473
529
|
}
|
|
474
530
|
return {
|
|
475
531
|
uid: `remote-${l}`,
|
|
@@ -479,13 +535,26 @@ function il(e) {
|
|
|
479
535
|
};
|
|
480
536
|
}) : [];
|
|
481
537
|
}
|
|
482
|
-
const
|
|
538
|
+
const El = {
|
|
483
539
|
key: 0,
|
|
484
540
|
class: "fm-upload-view"
|
|
485
|
-
},
|
|
541
|
+
}, Rl = ["href"], Ol = { key: 1 }, Wl = {
|
|
542
|
+
key: 0,
|
|
543
|
+
class: "fm-upload-view__empty"
|
|
544
|
+
}, jl = {
|
|
486
545
|
key: 1,
|
|
546
|
+
class: "fm-upload-view__summary"
|
|
547
|
+
}, Kl = {
|
|
548
|
+
key: 2,
|
|
487
549
|
class: "fm-upload-view__empty"
|
|
488
|
-
},
|
|
550
|
+
}, Hl = ["title"], Yl = {
|
|
551
|
+
key: 0,
|
|
552
|
+
class: "fm-upload-field__status"
|
|
553
|
+
}, ql = {
|
|
554
|
+
key: 1,
|
|
555
|
+
class: "fm-upload-field__notice",
|
|
556
|
+
role: "status"
|
|
557
|
+
}, Gl = /* @__PURE__ */ k({
|
|
489
558
|
__name: "UploadInput",
|
|
490
559
|
props: {
|
|
491
560
|
modelValue: {},
|
|
@@ -499,175 +568,207 @@ const dl = {
|
|
|
499
568
|
},
|
|
500
569
|
emits: ["update:modelValue"],
|
|
501
570
|
setup(e, { emit: t }) {
|
|
502
|
-
const l = e, a = t, n =
|
|
503
|
-
var
|
|
504
|
-
return ((
|
|
571
|
+
const l = e, a = t, n = ze(Ee, null), { tField: o } = O(), r = H(null), u = (d) => {
|
|
572
|
+
var y;
|
|
573
|
+
return ((y = n == null ? void 0 : n.resolveAssetUrl) == null ? void 0 : y.call(n, d)) ?? d;
|
|
505
574
|
};
|
|
506
|
-
function i(
|
|
507
|
-
return
|
|
575
|
+
function i(d) {
|
|
576
|
+
return d && typeof d == "object" ? d : null;
|
|
508
577
|
}
|
|
509
|
-
const
|
|
510
|
-
function
|
|
511
|
-
const
|
|
512
|
-
if (!
|
|
578
|
+
const s = /* @__PURE__ */ new Set(["http:", "https:", "blob:"]);
|
|
579
|
+
function f(d) {
|
|
580
|
+
const y = d.trim();
|
|
581
|
+
if (!y) return "";
|
|
513
582
|
try {
|
|
514
|
-
const
|
|
515
|
-
return
|
|
583
|
+
const x = new URL(y, "http://form-morph.local").protocol;
|
|
584
|
+
return s.has(x) ? y : "";
|
|
516
585
|
} catch {
|
|
517
586
|
return "";
|
|
518
587
|
}
|
|
519
588
|
}
|
|
520
|
-
function
|
|
521
|
-
const
|
|
522
|
-
if (!
|
|
523
|
-
const
|
|
524
|
-
return typeof
|
|
589
|
+
function m(d) {
|
|
590
|
+
const y = i(d);
|
|
591
|
+
if (!y) return "";
|
|
592
|
+
const x = y.url ?? y.fileUrl;
|
|
593
|
+
return typeof x == "string" && x ? f(u(x)) : "";
|
|
525
594
|
}
|
|
526
|
-
function
|
|
527
|
-
const
|
|
528
|
-
return String(
|
|
595
|
+
function v(d) {
|
|
596
|
+
const y = i(d);
|
|
597
|
+
return String(y ? y.originalName ?? y.name ?? y.id ?? o("field.upload.attachment") : d ?? "");
|
|
529
598
|
}
|
|
530
|
-
function
|
|
531
|
-
const
|
|
532
|
-
return
|
|
599
|
+
function L(d, y) {
|
|
600
|
+
const x = i(d);
|
|
601
|
+
return x ? String(x.uid ?? x.id ?? y) : y;
|
|
533
602
|
}
|
|
534
|
-
const
|
|
535
|
-
() =>
|
|
536
|
-
const
|
|
537
|
-
if (!
|
|
538
|
-
const
|
|
539
|
-
if (typeof
|
|
540
|
-
const
|
|
541
|
-
return
|
|
603
|
+
const I = c(
|
|
604
|
+
() => Ul(l.modelValue).map((d) => {
|
|
605
|
+
const y = i(d);
|
|
606
|
+
if (!y) return d;
|
|
607
|
+
const x = y.url ?? y.fileUrl;
|
|
608
|
+
if (typeof x != "string" || !x) return d;
|
|
609
|
+
const U = m(d);
|
|
610
|
+
return y.url === U ? d : { ...y, url: U || void 0 };
|
|
542
611
|
})
|
|
543
|
-
),
|
|
612
|
+
), D = c(
|
|
544
613
|
() => l.mode === "view" || l.mode === "print" || l.disabled || l.readonly
|
|
545
|
-
),
|
|
614
|
+
), T = c(() => {
|
|
615
|
+
var d;
|
|
616
|
+
return ((d = l.node.props) == null ? void 0 : d.showFileList) !== !1;
|
|
617
|
+
}), z = c(() => I.value.length), A = c(
|
|
546
618
|
() => {
|
|
547
|
-
var
|
|
548
|
-
return typeof ((
|
|
619
|
+
var d;
|
|
620
|
+
return typeof ((d = l.node.props) == null ? void 0 : d.accept) == "string" ? l.node.props.accept : "";
|
|
549
621
|
}
|
|
550
|
-
),
|
|
551
|
-
var
|
|
552
|
-
return ((
|
|
553
|
-
}),
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
622
|
+
), P = c(() => {
|
|
623
|
+
var d;
|
|
624
|
+
return ((d = l.node.props) == null ? void 0 : d.multiple) === !0;
|
|
625
|
+
}), b = c(() => {
|
|
626
|
+
var y;
|
|
627
|
+
const d = Number((y = l.node.props) == null ? void 0 : y.limit);
|
|
628
|
+
return Number.isFinite(d) && d > 0 ? Math.floor(d) : void 0;
|
|
629
|
+
}), V = c(() => {
|
|
630
|
+
const d = A.value.trim();
|
|
631
|
+
return d ? o("field.upload.acceptHint", { accept: d }) : o("field.upload.acceptAllHint");
|
|
632
|
+
}), S = H(!1), N = H("");
|
|
633
|
+
let $ = 0, E, W;
|
|
634
|
+
function q(d) {
|
|
635
|
+
N.value = d, W && clearTimeout(W), W = setTimeout(() => {
|
|
636
|
+
N.value = "", W = void 0;
|
|
637
|
+
}, 3200);
|
|
560
638
|
}
|
|
561
|
-
function
|
|
562
|
-
|
|
639
|
+
function J() {
|
|
640
|
+
E && (clearTimeout(E), E = void 0);
|
|
563
641
|
}
|
|
564
|
-
function
|
|
565
|
-
|
|
566
|
-
const c = (b = s.dataTransfer) == null ? void 0 : b.types;
|
|
567
|
-
return !!(c && Array.from(c).includes("Files"));
|
|
642
|
+
function ie() {
|
|
643
|
+
J(), S.value = !0;
|
|
568
644
|
}
|
|
569
|
-
function
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
return b.some((O) => {
|
|
574
|
-
const P = O.toLowerCase();
|
|
575
|
-
return P === B || `${M}${D.replace(".", "/")}` === P || /^\*(\/\*)?$/.test(P) ? !0 : /\/\*/.test(P) ? B.replace(/\/.*$/, "") === P.replace(/\/.*$/, "") : /\..*/.test(P) ? (P === ".jpg" || P === ".jpeg" ? [".jpg", ".jpeg"] : [P]).includes(D) : !1;
|
|
576
|
-
});
|
|
645
|
+
function de(d) {
|
|
646
|
+
var x;
|
|
647
|
+
const y = (x = d.dataTransfer) == null ? void 0 : x.types;
|
|
648
|
+
return !!(y && Array.from(y).includes("Files"));
|
|
577
649
|
}
|
|
578
|
-
function
|
|
579
|
-
return
|
|
650
|
+
function Fe(d) {
|
|
651
|
+
return ye({ name: d.name, type: d.type }, A.value) ? !0 : (q(o("field.upload.notice.type")), !1);
|
|
580
652
|
}
|
|
581
|
-
function
|
|
582
|
-
|
|
583
|
-
return b ? L : L.slice(0, 1);
|
|
653
|
+
function se() {
|
|
654
|
+
$ = 0, J(), S.value = !1;
|
|
584
655
|
}
|
|
585
|
-
function
|
|
586
|
-
|
|
656
|
+
function Ie(d) {
|
|
657
|
+
de(d) && (d.preventDefault(), $ += 1, ie());
|
|
587
658
|
}
|
|
588
|
-
function
|
|
589
|
-
|
|
659
|
+
function $e(d) {
|
|
660
|
+
de(d) && (d.preventDefault(), d.dataTransfer && (d.dataTransfer.dropEffect = "copy"), $ = Math.max($, 1), ie());
|
|
590
661
|
}
|
|
591
|
-
function
|
|
592
|
-
|
|
593
|
-
|
|
662
|
+
function De(d) {
|
|
663
|
+
S.value && (d.preventDefault(), $ = Math.max(0, $ - 1), !($ > 0) && (J(), E = setTimeout(() => {
|
|
664
|
+
S.value = !1, E = void 0;
|
|
594
665
|
}, 80)));
|
|
595
666
|
}
|
|
596
|
-
function
|
|
597
|
-
var
|
|
598
|
-
|
|
599
|
-
const
|
|
600
|
-
if (
|
|
601
|
-
const
|
|
602
|
-
|
|
667
|
+
function Pe(d) {
|
|
668
|
+
var ce, pe, me, X, fe;
|
|
669
|
+
d.preventDefault(), se();
|
|
670
|
+
const y = d.target;
|
|
671
|
+
if (y instanceof Element && y.closest(".arco-upload")) return;
|
|
672
|
+
const x = Array.from(((ce = d.dataTransfer) == null ? void 0 : ce.files) ?? []), U = x.filter(
|
|
673
|
+
(j) => ye({ name: j.name, type: j.type }, A.value)
|
|
674
|
+
), M = x.length - U.length;
|
|
675
|
+
let R = P.value ? U : U.slice(0, 1), ue = !1;
|
|
676
|
+
if (b.value) {
|
|
677
|
+
const j = Math.max(0, b.value - z.value);
|
|
678
|
+
R.length > j && (ue = !0, R = R.slice(0, j));
|
|
679
|
+
}
|
|
680
|
+
const Q = [];
|
|
681
|
+
if (M && Q.push(o("field.upload.notice.rejected", { count: M })), ue && Q.push(o("field.upload.notice.limit", { limit: b.value ?? 0 })), Q.length && q(Q.join(o("field.upload.notice.separator"))), !R.length) return;
|
|
682
|
+
const Me = typeof ((pe = l.node.props) == null ? void 0 : pe.action) == "string" ? l.node.props.action.trim() : "";
|
|
683
|
+
if (((me = l.node.props) == null ? void 0 : me.autoUpload) === !0 && Me) {
|
|
684
|
+
(fe = (X = r.value) == null ? void 0 : X.upload) == null || fe.call(X, R);
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
const Ue = Array.isArray(l.modelValue) ? l.modelValue : [];
|
|
688
|
+
a("update:modelValue", [...Ue, ...R.map((j) => ke(j))]);
|
|
603
689
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
a("update:modelValue", Array.isArray(s) ? s.map(rl) : []);
|
|
690
|
+
function K() {
|
|
691
|
+
S.value && se();
|
|
607
692
|
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
693
|
+
Ce(() => {
|
|
694
|
+
window.addEventListener("dragend", K), window.addEventListener("drop", K), window.addEventListener("blur", K);
|
|
695
|
+
}), Le(() => {
|
|
696
|
+
window.removeEventListener("dragend", K), window.removeEventListener("drop", K), window.removeEventListener("blur", K), J(), W && clearTimeout(W);
|
|
697
|
+
});
|
|
698
|
+
function Ne(d) {
|
|
699
|
+
a("update:modelValue", Array.isArray(d) ? d.map(ke) : []);
|
|
700
|
+
}
|
|
701
|
+
return (d, y) => {
|
|
702
|
+
var x, U;
|
|
703
|
+
return D.value ? (p(), C("div", El, [
|
|
704
|
+
T.value ? (p(), C(_, { key: 0 }, [
|
|
705
|
+
(p(!0), C(_, null, re(I.value, (M, R) => (p(), C("div", {
|
|
706
|
+
key: L(M, R),
|
|
707
|
+
class: "fm-upload-view__item"
|
|
708
|
+
}, [
|
|
709
|
+
m(M) ? (p(), C("a", {
|
|
710
|
+
key: 0,
|
|
711
|
+
class: "fm-upload-view__link",
|
|
712
|
+
href: m(M),
|
|
713
|
+
target: "_blank",
|
|
714
|
+
rel: "noopener"
|
|
715
|
+
}, B(v(M)), 9, Rl)) : (p(), C("span", Ol, B(v(M)), 1))
|
|
716
|
+
]))), 128)),
|
|
717
|
+
z.value ? Y("", !0) : (p(), C("span", Wl, B(h(o)("field.upload.empty")), 1))
|
|
718
|
+
], 64)) : z.value ? (p(), C("span", jl, B(h(o)("field.upload.count", { count: z.value })), 1)) : (p(), C("span", Kl, B(h(o)("field.upload.empty")), 1))
|
|
719
|
+
])) : (p(), C("div", {
|
|
624
720
|
key: 1,
|
|
625
721
|
class: "fm-upload-field",
|
|
626
|
-
title:
|
|
627
|
-
onDragenter:
|
|
628
|
-
onDragover:
|
|
629
|
-
onDragleave:
|
|
630
|
-
onDrop:
|
|
722
|
+
title: V.value,
|
|
723
|
+
onDragenter: Ie,
|
|
724
|
+
onDragover: $e,
|
|
725
|
+
onDragleave: De,
|
|
726
|
+
onDrop: Pe
|
|
631
727
|
}, [
|
|
632
|
-
|
|
728
|
+
G(h(cl), {
|
|
633
729
|
ref_key: "uploadRef",
|
|
634
730
|
ref: r,
|
|
635
|
-
"file-list":
|
|
636
|
-
"auto-upload": ((
|
|
637
|
-
accept:
|
|
638
|
-
action: ((
|
|
639
|
-
limit:
|
|
640
|
-
multiple:
|
|
731
|
+
"file-list": I.value,
|
|
732
|
+
"auto-upload": ((x = e.node.props) == null ? void 0 : x.autoUpload) === !0,
|
|
733
|
+
accept: A.value || void 0,
|
|
734
|
+
action: ((U = e.node.props) == null ? void 0 : U.action) ?? void 0,
|
|
735
|
+
limit: b.value,
|
|
736
|
+
multiple: P.value,
|
|
641
737
|
disabled: e.disabled || e.readonly,
|
|
642
|
-
"show-file-list":
|
|
643
|
-
"on-before-upload":
|
|
644
|
-
onChange:
|
|
738
|
+
"show-file-list": T.value,
|
|
739
|
+
"on-before-upload": Fe,
|
|
740
|
+
onChange: y[0] || (y[0] = (M) => Ne(M))
|
|
645
741
|
}, {
|
|
646
|
-
"upload-button":
|
|
647
|
-
|
|
742
|
+
"upload-button": F(() => [
|
|
743
|
+
G(h(pl), {
|
|
648
744
|
type: "primary",
|
|
649
745
|
disabled: e.disabled || e.readonly
|
|
650
746
|
}, {
|
|
651
|
-
icon:
|
|
652
|
-
|
|
747
|
+
icon: F(() => [
|
|
748
|
+
G(h(kl))
|
|
653
749
|
]),
|
|
654
|
-
default:
|
|
655
|
-
|
|
750
|
+
default: F(() => [
|
|
751
|
+
Z(" " + B(S.value ? h(o)("field.upload.release") : h(o)("field.upload.button")), 1)
|
|
656
752
|
]),
|
|
657
753
|
_: 1
|
|
658
754
|
}, 8, ["disabled"])
|
|
659
755
|
]),
|
|
660
756
|
_: 1
|
|
661
|
-
}, 8, ["file-list", "auto-upload", "accept", "action", "limit", "multiple", "disabled", "show-file-list"])
|
|
662
|
-
|
|
757
|
+
}, 8, ["file-list", "auto-upload", "accept", "action", "limit", "multiple", "disabled", "show-file-list"]),
|
|
758
|
+
!T.value && z.value ? (p(), C("span", Yl, [
|
|
759
|
+
G(h(xl), { class: "fm-upload-field__status-icon" }),
|
|
760
|
+
Z(" " + B(h(o)("field.upload.count", { count: z.value })), 1)
|
|
761
|
+
])) : Y("", !0),
|
|
762
|
+
N.value ? (p(), C("span", ql, B(N.value), 1)) : Y("", !0)
|
|
763
|
+
], 40, Hl));
|
|
663
764
|
};
|
|
664
765
|
}
|
|
665
|
-
}),
|
|
766
|
+
}), Zl = (e, t) => {
|
|
666
767
|
const l = e.__vccOpts || e;
|
|
667
768
|
for (const [a, n] of t)
|
|
668
769
|
l[a] = n;
|
|
669
770
|
return l;
|
|
670
|
-
},
|
|
771
|
+
}, xe = /* @__PURE__ */ Zl(Gl, [["__scopeId", "data-v-8abfe030"]]), Jl = /* @__PURE__ */ k({
|
|
671
772
|
__name: "CascaderInput",
|
|
672
773
|
props: {
|
|
673
774
|
modelValue: {},
|
|
@@ -681,26 +782,42 @@ const dl = {
|
|
|
681
782
|
},
|
|
682
783
|
emits: ["update:modelValue"],
|
|
683
784
|
setup(e, { emit: t }) {
|
|
684
|
-
const l = t
|
|
685
|
-
|
|
686
|
-
|
|
785
|
+
const l = e, a = t, { tField: n } = O(), o = c(() => {
|
|
786
|
+
var i;
|
|
787
|
+
const u = (i = l.node.props) == null ? void 0 : i.placeholder;
|
|
788
|
+
return typeof u == "string" && u ? u : n("field.cascader.placeholder");
|
|
789
|
+
});
|
|
790
|
+
function r(u) {
|
|
791
|
+
a("update:modelValue", u ?? null);
|
|
687
792
|
}
|
|
688
|
-
return (
|
|
689
|
-
var
|
|
690
|
-
return p(),
|
|
793
|
+
return (u, i) => {
|
|
794
|
+
var s, f, m;
|
|
795
|
+
return p(), g(h(ml), {
|
|
691
796
|
"model-value": e.modelValue ?? void 0,
|
|
692
797
|
options: e.options,
|
|
693
|
-
placeholder:
|
|
694
|
-
"allow-search": ((
|
|
695
|
-
"change-on-select": ((
|
|
798
|
+
placeholder: o.value,
|
|
799
|
+
"allow-search": ((s = e.node.props) == null ? void 0 : s.allowSearch) === !0,
|
|
800
|
+
"change-on-select": ((f = e.node.props) == null ? void 0 : f.changeOnSelect) === !0,
|
|
696
801
|
disabled: e.disabled || e.readonly,
|
|
697
802
|
size: e.size,
|
|
698
|
-
"allow-clear": ((
|
|
699
|
-
onChange:
|
|
803
|
+
"allow-clear": ((m = e.node.props) == null ? void 0 : m.allowClear) !== !1,
|
|
804
|
+
onChange: r
|
|
700
805
|
}, null, 8, ["model-value", "options", "placeholder", "allow-search", "change-on-select", "disabled", "size", "allow-clear"]);
|
|
701
806
|
};
|
|
702
807
|
}
|
|
703
|
-
})
|
|
808
|
+
});
|
|
809
|
+
function Ql(e) {
|
|
810
|
+
return typeof e == "boolean" ? String(e) : e;
|
|
811
|
+
}
|
|
812
|
+
function Ae(e = []) {
|
|
813
|
+
return e.map((t) => ({
|
|
814
|
+
key: Ql(t.value),
|
|
815
|
+
title: String(t.label),
|
|
816
|
+
disabled: t.disabled,
|
|
817
|
+
children: Array.isArray(t.children) ? Ae(t.children) : void 0
|
|
818
|
+
}));
|
|
819
|
+
}
|
|
820
|
+
const Xl = /* @__PURE__ */ k({
|
|
704
821
|
__name: "TreeSelectInput",
|
|
705
822
|
props: {
|
|
706
823
|
modelValue: {},
|
|
@@ -714,34 +831,29 @@ const dl = {
|
|
|
714
831
|
},
|
|
715
832
|
emits: ["update:modelValue"],
|
|
716
833
|
setup(e, { emit: t }) {
|
|
717
|
-
const l = e, a = t
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
children: Array.isArray(d.children) ? n(d.children) : void 0
|
|
724
|
-
}));
|
|
725
|
-
}
|
|
726
|
-
const r = m(() => n(l.options ?? []));
|
|
727
|
-
function o(i) {
|
|
834
|
+
const l = e, a = t, { tField: n } = O(), o = c(() => Ae(l.options ?? [])), r = c(() => {
|
|
835
|
+
var s;
|
|
836
|
+
const i = (s = l.node.props) == null ? void 0 : s.placeholder;
|
|
837
|
+
return typeof i == "string" && i ? i : n("field.tree-select.placeholder");
|
|
838
|
+
});
|
|
839
|
+
function u(i) {
|
|
728
840
|
a("update:modelValue", i ?? null);
|
|
729
841
|
}
|
|
730
|
-
return (i,
|
|
731
|
-
var
|
|
732
|
-
return p(),
|
|
733
|
-
data:
|
|
842
|
+
return (i, s) => {
|
|
843
|
+
var f, m;
|
|
844
|
+
return p(), g(h(fl), {
|
|
845
|
+
data: o.value,
|
|
734
846
|
"model-value": e.modelValue ?? void 0,
|
|
735
|
-
placeholder:
|
|
736
|
-
"allow-search": ((
|
|
847
|
+
placeholder: r.value,
|
|
848
|
+
"allow-search": ((f = e.node.props) == null ? void 0 : f.allowSearch) === !0,
|
|
737
849
|
disabled: e.disabled || e.readonly,
|
|
738
850
|
size: e.size,
|
|
739
|
-
"allow-clear": ((
|
|
740
|
-
onChange:
|
|
851
|
+
"allow-clear": ((m = e.node.props) == null ? void 0 : m.allowClear) !== !1,
|
|
852
|
+
onChange: u
|
|
741
853
|
}, null, 8, ["data", "model-value", "placeholder", "allow-search", "disabled", "size", "allow-clear"]);
|
|
742
854
|
};
|
|
743
855
|
}
|
|
744
|
-
}),
|
|
856
|
+
}), _l = /* @__PURE__ */ k({
|
|
745
857
|
__name: "ColorInput",
|
|
746
858
|
props: {
|
|
747
859
|
modelValue: {},
|
|
@@ -757,17 +869,17 @@ const dl = {
|
|
|
757
869
|
setup(e, { emit: t }) {
|
|
758
870
|
const l = t;
|
|
759
871
|
return (a, n) => {
|
|
760
|
-
var
|
|
761
|
-
return p(),
|
|
872
|
+
var o;
|
|
873
|
+
return p(), g(h(yl), {
|
|
762
874
|
"model-value": e.modelValue === null || e.modelValue === void 0 ? "" : String(e.modelValue),
|
|
763
|
-
"disabled-alpha": ((
|
|
875
|
+
"disabled-alpha": ((o = e.node.props) == null ? void 0 : o.disabledAlpha) === !0,
|
|
764
876
|
disabled: e.disabled || e.readonly,
|
|
765
877
|
size: e.size,
|
|
766
|
-
onChange: n[0] || (n[0] = (
|
|
878
|
+
onChange: n[0] || (n[0] = (r) => l("update:modelValue", r ?? ""))
|
|
767
879
|
}, null, 8, ["model-value", "disabled-alpha", "disabled", "size"]);
|
|
768
880
|
};
|
|
769
881
|
}
|
|
770
|
-
}),
|
|
882
|
+
}), et = /* @__PURE__ */ k({
|
|
771
883
|
__name: "StaticText",
|
|
772
884
|
props: {
|
|
773
885
|
modelValue: {},
|
|
@@ -780,22 +892,24 @@ const dl = {
|
|
|
780
892
|
error: {}
|
|
781
893
|
},
|
|
782
894
|
setup(e) {
|
|
783
|
-
const t = e, l =
|
|
784
|
-
var
|
|
785
|
-
const r = (
|
|
895
|
+
const t = e, { tField: l } = O(), a = c(() => {
|
|
896
|
+
var u;
|
|
897
|
+
const r = (u = t.node.props) == null ? void 0 : u.content;
|
|
786
898
|
return r == null ? "" : String(r);
|
|
787
|
-
}),
|
|
788
|
-
|
|
899
|
+
}), n = c(() => t.mode === "design"), o = c(
|
|
900
|
+
() => n.value && !a.value ? l("field.static-text.placeholder") : ""
|
|
901
|
+
);
|
|
902
|
+
return (r, u) => {
|
|
789
903
|
var i;
|
|
790
|
-
return p(),
|
|
791
|
-
class:
|
|
904
|
+
return p(), C("div", {
|
|
905
|
+
class: ee(["fm-static-text", [
|
|
792
906
|
(i = e.node.props) != null && i.type ? `fm-static-text--${String(e.node.props.type)}` : void 0,
|
|
793
|
-
{ "fm-static-text--empty": !!
|
|
907
|
+
{ "fm-static-text--empty": !!o.value }
|
|
794
908
|
]])
|
|
795
|
-
},
|
|
909
|
+
}, B(a.value || o.value), 3);
|
|
796
910
|
};
|
|
797
911
|
}
|
|
798
|
-
}),
|
|
912
|
+
}), lt = /* @__PURE__ */ k({
|
|
799
913
|
__name: "ArcoFormItem",
|
|
800
914
|
props: {
|
|
801
915
|
node: {},
|
|
@@ -809,15 +923,15 @@ const dl = {
|
|
|
809
923
|
reserveMessage: { type: Boolean, default: !0 }
|
|
810
924
|
},
|
|
811
925
|
setup(e) {
|
|
812
|
-
const t = e, l =
|
|
813
|
-
var
|
|
814
|
-
return ((
|
|
815
|
-
}),
|
|
816
|
-
r ||
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
layout:
|
|
820
|
-
labelAlign:
|
|
926
|
+
const t = e, l = c(() => Re(t.labelWidth)), a = c(() => {
|
|
927
|
+
var f;
|
|
928
|
+
return ((f = t.node.layout) == null ? void 0 : f.hideLabel) === !0;
|
|
929
|
+
}), n = c(() => t.node.label || t.node.name || t.node.type), r = ze(be, null) !== null;
|
|
930
|
+
r || Ke(
|
|
931
|
+
be,
|
|
932
|
+
Te({
|
|
933
|
+
layout: c(() => t.vertical ? "vertical" : "horizontal"),
|
|
934
|
+
labelAlign: c(() => t.labelAlign === "left" ? "left" : "right"),
|
|
821
935
|
autoLabelWidth: !1,
|
|
822
936
|
maxLabelWidth: 0,
|
|
823
937
|
setLabelWidth: () => {
|
|
@@ -826,35 +940,50 @@ const dl = {
|
|
|
826
940
|
}
|
|
827
941
|
})
|
|
828
942
|
);
|
|
829
|
-
const
|
|
830
|
-
if (t.vertical ||
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
class: E(["fm-arco-form-item", {
|
|
943
|
+
const u = c(() => {
|
|
944
|
+
if (!(t.vertical || a.value))
|
|
945
|
+
return l.value ? l.value : r ? void 0 : "108px";
|
|
946
|
+
}), i = c(() => !!l.value), s = c(() => t.vertical ? { div: !0 } : { div: !1, wrap: !1 });
|
|
947
|
+
return (f, m) => (p(), g(h(hl), {
|
|
948
|
+
class: ee(["fm-arco-form-item", {
|
|
836
949
|
"fm-arco-form-item--vertical": e.vertical,
|
|
837
950
|
"fm-arco-form-item--label-left": e.labelAlign === "left",
|
|
838
951
|
"fm-arco-form-item--view": e.view,
|
|
952
|
+
"fm-arco-form-item--label-width": i.value,
|
|
839
953
|
"fm-arco-form-item--no-message-space": !e.reserveMessage
|
|
840
954
|
}]),
|
|
841
|
-
label:
|
|
842
|
-
"hide-label":
|
|
955
|
+
label: a.value ? void 0 : n.value,
|
|
956
|
+
"hide-label": a.value,
|
|
843
957
|
required: e.state.required && !e.view,
|
|
844
958
|
tooltip: e.node.help || void 0,
|
|
845
959
|
help: e.error || void 0,
|
|
846
960
|
"validate-status": e.error ? "error" : void 0,
|
|
847
961
|
disabled: e.disabled,
|
|
848
|
-
"label-col-flex":
|
|
849
|
-
"row-props":
|
|
962
|
+
"label-col-flex": u.value,
|
|
963
|
+
"row-props": s.value
|
|
850
964
|
}, {
|
|
851
|
-
default:
|
|
852
|
-
|
|
965
|
+
default: F(() => [
|
|
966
|
+
le(f.$slots, "default")
|
|
853
967
|
]),
|
|
854
968
|
_: 3
|
|
855
969
|
}, 8, ["class", "label", "hide-label", "required", "tooltip", "help", "validate-status", "disabled", "label-col-flex", "row-props"]));
|
|
856
970
|
}
|
|
857
|
-
}),
|
|
971
|
+
}), tt = {
|
|
972
|
+
"zh-CN": Cl,
|
|
973
|
+
"en-US": zl
|
|
974
|
+
};
|
|
975
|
+
function at(e) {
|
|
976
|
+
return { ...tt, ...e ?? {} };
|
|
977
|
+
}
|
|
978
|
+
function ot(e, t = "zh-CN", l) {
|
|
979
|
+
const a = at(l);
|
|
980
|
+
for (const n of Oe(e, t)) {
|
|
981
|
+
const o = a[n];
|
|
982
|
+
if (o) return o;
|
|
983
|
+
}
|
|
984
|
+
return a[We(t)] ?? a["zh-CN"];
|
|
985
|
+
}
|
|
986
|
+
const nt = /* @__PURE__ */ k({
|
|
858
987
|
__name: "ArcoFormShell",
|
|
859
988
|
props: {
|
|
860
989
|
layout: {},
|
|
@@ -864,68 +993,85 @@ const dl = {
|
|
|
864
993
|
size: {},
|
|
865
994
|
model: {},
|
|
866
995
|
rules: {},
|
|
867
|
-
scrollToFirstError: { type: Boolean }
|
|
996
|
+
scrollToFirstError: { type: Boolean },
|
|
997
|
+
localeMap: {},
|
|
998
|
+
syncLibraryLocale: { type: Boolean }
|
|
868
999
|
},
|
|
869
1000
|
emits: ["submit"],
|
|
870
1001
|
setup(e, { expose: t, emit: l }) {
|
|
871
|
-
const a = e, n =
|
|
872
|
-
|
|
1002
|
+
const a = e, n = k({
|
|
1003
|
+
name: "ArcoSlotProvider",
|
|
1004
|
+
setup(b, { slots: V }) {
|
|
1005
|
+
return () => {
|
|
1006
|
+
var S;
|
|
1007
|
+
return (S = V.default) == null ? void 0 : S.call(V);
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
}), { locale: o } = Ve(), r = c(
|
|
1011
|
+
() => a.syncLibraryLocale === !1 ? void 0 : ot(o.value, "zh-CN", a.localeMap)
|
|
1012
|
+
), u = c(() => r.value ? vl : n), i = c(() => r.value ? { locale: r.value } : {}), s = l, f = Te({}), m = H(null), v = H(0), L = c(() => a.autoLabelWidth !== !1 && a.layout !== "vertical"), I = c(
|
|
1013
|
+
() => L.value && v.value > 0 ? { "--fm-label-col-width": `${v.value}px` } : {}
|
|
873
1014
|
);
|
|
874
|
-
function
|
|
875
|
-
var
|
|
876
|
-
const
|
|
877
|
-
if (!
|
|
878
|
-
let
|
|
879
|
-
|
|
880
|
-
const
|
|
881
|
-
|
|
882
|
-
}),
|
|
1015
|
+
function D() {
|
|
1016
|
+
var S;
|
|
1017
|
+
const b = (S = m.value) == null ? void 0 : S.$el;
|
|
1018
|
+
if (!L.value || !b || !b.querySelector(".fm-node")) return;
|
|
1019
|
+
let V = 0;
|
|
1020
|
+
b.querySelectorAll(".arco-form-item-label").forEach((N) => {
|
|
1021
|
+
const $ = Math.ceil(N.scrollWidth || 0);
|
|
1022
|
+
$ > V && (V = $);
|
|
1023
|
+
}), V > 0 && V !== v.value && (v.value = V);
|
|
883
1024
|
}
|
|
884
|
-
let
|
|
885
|
-
function
|
|
886
|
-
|
|
887
|
-
|
|
1025
|
+
let T = null, z = null;
|
|
1026
|
+
function A() {
|
|
1027
|
+
z && clearTimeout(z), z = setTimeout(() => {
|
|
1028
|
+
z = null, he(D);
|
|
888
1029
|
}, 30);
|
|
889
1030
|
}
|
|
890
|
-
|
|
891
|
-
var
|
|
892
|
-
|
|
893
|
-
const
|
|
894
|
-
!
|
|
895
|
-
|
|
896
|
-
var
|
|
897
|
-
return
|
|
898
|
-
}) &&
|
|
899
|
-
}),
|
|
900
|
-
}),
|
|
901
|
-
|
|
1031
|
+
Ce(() => {
|
|
1032
|
+
var V, S;
|
|
1033
|
+
he(D), typeof document < "u" && ((V = document.fonts) != null && V.ready) && document.fonts.ready.then(A);
|
|
1034
|
+
const b = (S = m.value) == null ? void 0 : S.$el;
|
|
1035
|
+
!b || typeof MutationObserver > "u" || (T = new MutationObserver((N) => {
|
|
1036
|
+
N.some((E) => {
|
|
1037
|
+
var q;
|
|
1038
|
+
return E.type === "childList" ? !0 : !!((q = E.target.parentElement) != null && q.closest(".arco-form-item-label"));
|
|
1039
|
+
}) && A();
|
|
1040
|
+
}), T.observe(b, { childList: !0, subtree: !0, characterData: !0 }));
|
|
1041
|
+
}), Le(() => {
|
|
1042
|
+
z && clearTimeout(z), T == null || T.disconnect(), T = null;
|
|
902
1043
|
});
|
|
903
|
-
function
|
|
904
|
-
var
|
|
905
|
-
return (
|
|
1044
|
+
function P() {
|
|
1045
|
+
var b, V;
|
|
1046
|
+
return (V = (b = m.value) == null ? void 0 : b.validate) == null ? void 0 : V.call(b);
|
|
906
1047
|
}
|
|
907
|
-
return t({ validate:
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
1048
|
+
return t({ validate: P }), (b, V) => (p(), g(He(u.value), Ye(qe(i.value)), {
|
|
1049
|
+
default: F(() => [
|
|
1050
|
+
G(h(bl), {
|
|
1051
|
+
ref_key: "formRef",
|
|
1052
|
+
ref: m,
|
|
1053
|
+
model: a.model ?? f,
|
|
1054
|
+
class: ee(["fm-arco-form", { "fm-arco-form--label-synced": L.value && v.value > 0 }]),
|
|
1055
|
+
style: Ge(I.value),
|
|
1056
|
+
layout: a.layout ?? "horizontal",
|
|
1057
|
+
"label-align": a.labelAlign ?? "right",
|
|
1058
|
+
"auto-label-width": a.autoLabelWidth !== !1,
|
|
1059
|
+
disabled: a.disabled,
|
|
1060
|
+
size: a.size,
|
|
1061
|
+
rules: a.rules,
|
|
1062
|
+
"scroll-to-first-error": a.scrollToFirstError === !0,
|
|
1063
|
+
onSubmit: V[0] || (V[0] = (S, N) => s("submit", N))
|
|
1064
|
+
}, {
|
|
1065
|
+
default: F(() => [
|
|
1066
|
+
le(b.$slots, "default")
|
|
1067
|
+
]),
|
|
1068
|
+
_: 3
|
|
1069
|
+
}, 8, ["model", "class", "style", "layout", "label-align", "auto-label-width", "disabled", "size", "rules", "scroll-to-first-error"])
|
|
924
1070
|
]),
|
|
925
1071
|
_: 3
|
|
926
|
-
},
|
|
1072
|
+
}, 16));
|
|
927
1073
|
}
|
|
928
|
-
}),
|
|
1074
|
+
}), rt = /* @__PURE__ */ k({
|
|
929
1075
|
__name: "CardContainer",
|
|
930
1076
|
props: {
|
|
931
1077
|
modelValue: {},
|
|
@@ -940,26 +1086,26 @@ const dl = {
|
|
|
940
1086
|
setup(e) {
|
|
941
1087
|
return (t, l) => {
|
|
942
1088
|
var a, n;
|
|
943
|
-
return p(),
|
|
1089
|
+
return p(), g(h(gl), {
|
|
944
1090
|
class: "fm-arco-card",
|
|
945
1091
|
title: e.node.label,
|
|
946
1092
|
bordered: ((a = e.node.props) == null ? void 0 : a.bordered) !== !1,
|
|
947
1093
|
"header-style": (n = e.node.props) == null ? void 0 : n.headerStyle
|
|
948
1094
|
}, {
|
|
949
|
-
default:
|
|
950
|
-
|
|
1095
|
+
default: F(() => [
|
|
1096
|
+
le(t.$slots, "default")
|
|
951
1097
|
]),
|
|
952
1098
|
_: 3
|
|
953
1099
|
}, 8, ["title", "bordered", "header-style"]);
|
|
954
1100
|
};
|
|
955
1101
|
}
|
|
956
|
-
}),
|
|
1102
|
+
}), it = {
|
|
957
1103
|
key: 0,
|
|
958
1104
|
class: "fm-arco-section__header"
|
|
959
|
-
},
|
|
1105
|
+
}, dt = { class: "fm-arco-section__title" }, st = {
|
|
960
1106
|
key: 1,
|
|
961
1107
|
class: "fm-arco-section__desc"
|
|
962
|
-
},
|
|
1108
|
+
}, ut = { class: "fm-arco-section__content" }, ct = /* @__PURE__ */ k({
|
|
963
1109
|
__name: "SectionContainer",
|
|
964
1110
|
props: {
|
|
965
1111
|
modelValue: {},
|
|
@@ -972,35 +1118,35 @@ const dl = {
|
|
|
972
1118
|
error: {}
|
|
973
1119
|
},
|
|
974
1120
|
setup(e) {
|
|
975
|
-
const t = e, l =
|
|
1121
|
+
const t = e, l = c(() => {
|
|
976
1122
|
var a;
|
|
977
1123
|
return (((a = t.node.children) == null ? void 0 : a.length) ?? 0) > 0;
|
|
978
1124
|
});
|
|
979
1125
|
return (a, n) => {
|
|
980
|
-
var
|
|
981
|
-
return p(),
|
|
982
|
-
class:
|
|
983
|
-
"fm-arco-section--plain": ((
|
|
1126
|
+
var o, r;
|
|
1127
|
+
return p(), C("section", {
|
|
1128
|
+
class: ee(["fm-arco-section", {
|
|
1129
|
+
"fm-arco-section--plain": ((o = e.node.props) == null ? void 0 : o.plain) === !0,
|
|
984
1130
|
"fm-arco-section--empty": !l.value
|
|
985
1131
|
}])
|
|
986
1132
|
}, [
|
|
987
|
-
e.node.label || e.node.help ? (p(),
|
|
988
|
-
((
|
|
1133
|
+
e.node.label || e.node.help ? (p(), C("header", it, [
|
|
1134
|
+
((r = e.node.props) == null ? void 0 : r.icon) !== !1 ? (p(), g(h(Vl), {
|
|
989
1135
|
key: 0,
|
|
990
1136
|
class: "fm-arco-section__icon",
|
|
991
1137
|
size: 18,
|
|
992
1138
|
"aria-hidden": "true"
|
|
993
|
-
})) :
|
|
994
|
-
|
|
995
|
-
e.node.help ? (p(),
|
|
996
|
-
])) :
|
|
997
|
-
|
|
998
|
-
|
|
1139
|
+
})) : Y("", !0),
|
|
1140
|
+
ve("span", dt, B(e.node.label), 1),
|
|
1141
|
+
e.node.help ? (p(), C("span", st, B(e.node.help), 1)) : Y("", !0)
|
|
1142
|
+
])) : Y("", !0),
|
|
1143
|
+
ve("div", ut, [
|
|
1144
|
+
le(a.$slots, "default")
|
|
999
1145
|
])
|
|
1000
1146
|
], 2);
|
|
1001
1147
|
};
|
|
1002
1148
|
}
|
|
1003
|
-
}),
|
|
1149
|
+
}), pt = /* @__PURE__ */ k({
|
|
1004
1150
|
__name: "DividerContainer",
|
|
1005
1151
|
props: {
|
|
1006
1152
|
modelValue: {},
|
|
@@ -1015,75 +1161,98 @@ const dl = {
|
|
|
1015
1161
|
setup(e) {
|
|
1016
1162
|
return (t, l) => {
|
|
1017
1163
|
var a, n;
|
|
1018
|
-
return p(),
|
|
1164
|
+
return p(), g(h(wl), {
|
|
1019
1165
|
orientation: ((a = e.node.props) == null ? void 0 : a.orientation) ?? "center",
|
|
1020
1166
|
type: ((n = e.node.props) == null ? void 0 : n.dividerType) === "dashed" ? "dashed" : "solid"
|
|
1021
1167
|
}, {
|
|
1022
|
-
default:
|
|
1023
|
-
|
|
1168
|
+
default: F(() => [
|
|
1169
|
+
Z(B(e.node.label), 1)
|
|
1024
1170
|
]),
|
|
1025
1171
|
_: 1
|
|
1026
1172
|
}, 8, ["orientation", "type"]);
|
|
1027
1173
|
};
|
|
1028
1174
|
}
|
|
1029
|
-
})
|
|
1175
|
+
});
|
|
1176
|
+
function mt(e = {}) {
|
|
1177
|
+
return k({
|
|
1178
|
+
name: "ArcoFormShellConfigured",
|
|
1179
|
+
inheritAttrs: !1,
|
|
1180
|
+
setup(t, { attrs: l, slots: a, expose: n }) {
|
|
1181
|
+
const o = H(null);
|
|
1182
|
+
return n({ validate: () => {
|
|
1183
|
+
var r, u;
|
|
1184
|
+
return (u = (r = o.value) == null ? void 0 : r.validate) == null ? void 0 : u.call(r);
|
|
1185
|
+
} }), () => Ze(
|
|
1186
|
+
nt,
|
|
1187
|
+
{
|
|
1188
|
+
...l,
|
|
1189
|
+
ref: o,
|
|
1190
|
+
localeMap: e.uiLocales,
|
|
1191
|
+
syncLibraryLocale: e.syncLibraryLocale
|
|
1192
|
+
},
|
|
1193
|
+
a
|
|
1194
|
+
);
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
const ae = [
|
|
1030
1199
|
{ key: "placeholder", label: "占位提示", control: "text" },
|
|
1031
1200
|
{ key: "allowClear", label: "允许清空", control: "switch" },
|
|
1032
1201
|
{ key: "maxLength", label: "最大长度", control: "number", min: 1 }
|
|
1033
|
-
],
|
|
1202
|
+
], ne = [
|
|
1034
1203
|
{ key: "placeholder", label: "占位提示", control: "text" },
|
|
1035
1204
|
{ key: "allowSearch", label: "允许搜索", control: "switch" },
|
|
1036
1205
|
{ key: "allowClear", label: "允许清空", control: "switch" },
|
|
1037
1206
|
{ key: "maxTagCount", label: "最多展示标签", control: "number", min: 1 }
|
|
1038
|
-
],
|
|
1039
|
-
|
|
1207
|
+
], ft = ne.filter((e) => e.key !== "maxTagCount"), yt = [
|
|
1208
|
+
w({
|
|
1040
1209
|
type: "input",
|
|
1041
1210
|
label: "单行文本",
|
|
1042
1211
|
category: "基础字段",
|
|
1043
1212
|
kind: "field",
|
|
1044
1213
|
valueType: "string",
|
|
1045
1214
|
aliases: ["text", "text-input", "string"],
|
|
1046
|
-
widget:
|
|
1215
|
+
widget: te,
|
|
1047
1216
|
defaultLayout: { span: 12 },
|
|
1048
1217
|
defaultProps: { placeholder: "请输入" },
|
|
1049
|
-
inspector:
|
|
1218
|
+
inspector: ae
|
|
1050
1219
|
}),
|
|
1051
|
-
|
|
1220
|
+
w({
|
|
1052
1221
|
type: "textarea",
|
|
1053
1222
|
label: "多行文本",
|
|
1054
1223
|
category: "基础字段",
|
|
1055
1224
|
kind: "field",
|
|
1056
1225
|
valueType: "string",
|
|
1057
1226
|
aliases: ["text-area"],
|
|
1058
|
-
widget:
|
|
1227
|
+
widget: te,
|
|
1059
1228
|
defaultLayout: { span: 24 },
|
|
1060
1229
|
defaultProps: { placeholder: "请输入", rows: 4 },
|
|
1061
1230
|
inspector: [
|
|
1062
|
-
...
|
|
1231
|
+
...ae,
|
|
1063
1232
|
{ key: "rows", label: "行数", control: "number", min: 2, max: 20 },
|
|
1064
1233
|
{ key: "autoSize", label: "自适应高度", control: "switch" },
|
|
1065
1234
|
{ key: "showWordLimit", label: "显示字数", control: "switch" }
|
|
1066
1235
|
]
|
|
1067
1236
|
}),
|
|
1068
|
-
|
|
1237
|
+
w({
|
|
1069
1238
|
type: "password",
|
|
1070
1239
|
label: "密码输入",
|
|
1071
1240
|
category: "基础字段",
|
|
1072
1241
|
kind: "field",
|
|
1073
1242
|
valueType: "string",
|
|
1074
|
-
widget:
|
|
1243
|
+
widget: te,
|
|
1075
1244
|
defaultLayout: { span: 12 },
|
|
1076
1245
|
defaultProps: { placeholder: "请输入密码" },
|
|
1077
|
-
inspector:
|
|
1246
|
+
inspector: ae
|
|
1078
1247
|
}),
|
|
1079
|
-
|
|
1248
|
+
w({
|
|
1080
1249
|
type: "number",
|
|
1081
1250
|
label: "数字输入",
|
|
1082
1251
|
category: "基础字段",
|
|
1083
1252
|
kind: "field",
|
|
1084
1253
|
valueType: "number",
|
|
1085
1254
|
aliases: ["input-number", "inputnumber"],
|
|
1086
|
-
widget:
|
|
1255
|
+
widget: Tl,
|
|
1087
1256
|
defaultLayout: { span: 12 },
|
|
1088
1257
|
defaultProps: { placeholder: "请输入数字" },
|
|
1089
1258
|
inspector: [
|
|
@@ -1094,7 +1263,7 @@ const dl = {
|
|
|
1094
1263
|
{ key: "precision", label: "精度", control: "number", min: 0, max: 10 }
|
|
1095
1264
|
]
|
|
1096
1265
|
}),
|
|
1097
|
-
|
|
1266
|
+
w({
|
|
1098
1267
|
type: "select",
|
|
1099
1268
|
label: "下拉选择",
|
|
1100
1269
|
category: "选择字段",
|
|
@@ -1102,12 +1271,12 @@ const dl = {
|
|
|
1102
1271
|
valueType: "string",
|
|
1103
1272
|
aliases: ["dropdown"],
|
|
1104
1273
|
supportsOptions: !0,
|
|
1105
|
-
widget:
|
|
1274
|
+
widget: ge,
|
|
1106
1275
|
defaultLayout: { span: 12 },
|
|
1107
1276
|
defaultProps: { placeholder: "请选择", allowClear: !0 },
|
|
1108
|
-
inspector:
|
|
1277
|
+
inspector: ne
|
|
1109
1278
|
}),
|
|
1110
|
-
|
|
1279
|
+
w({
|
|
1111
1280
|
type: "multi-select",
|
|
1112
1281
|
label: "多选下拉",
|
|
1113
1282
|
category: "选择字段",
|
|
@@ -1115,19 +1284,19 @@ const dl = {
|
|
|
1115
1284
|
valueType: "string[]",
|
|
1116
1285
|
aliases: ["multiselect", "multiple-select", "multi"],
|
|
1117
1286
|
supportsOptions: !0,
|
|
1118
|
-
widget:
|
|
1287
|
+
widget: ge,
|
|
1119
1288
|
defaultLayout: { span: 12 },
|
|
1120
1289
|
defaultProps: { placeholder: "请选择", allowClear: !0 },
|
|
1121
|
-
inspector:
|
|
1290
|
+
inspector: ne
|
|
1122
1291
|
}),
|
|
1123
|
-
|
|
1292
|
+
w({
|
|
1124
1293
|
type: "radio",
|
|
1125
1294
|
label: "单选框",
|
|
1126
1295
|
category: "选择字段",
|
|
1127
1296
|
kind: "field",
|
|
1128
1297
|
valueType: "string",
|
|
1129
1298
|
supportsOptions: !0,
|
|
1130
|
-
widget:
|
|
1299
|
+
widget: Sl,
|
|
1131
1300
|
defaultLayout: { span: 12 },
|
|
1132
1301
|
inspector: [
|
|
1133
1302
|
{
|
|
@@ -1141,14 +1310,14 @@ const dl = {
|
|
|
1141
1310
|
}
|
|
1142
1311
|
]
|
|
1143
1312
|
}),
|
|
1144
|
-
|
|
1313
|
+
w({
|
|
1145
1314
|
type: "checkbox",
|
|
1146
1315
|
label: "复选框",
|
|
1147
1316
|
category: "选择字段",
|
|
1148
1317
|
kind: "field",
|
|
1149
1318
|
valueType: "string[]",
|
|
1150
1319
|
supportsOptions: !0,
|
|
1151
|
-
widget:
|
|
1320
|
+
widget: Bl,
|
|
1152
1321
|
defaultLayout: { span: 12 },
|
|
1153
1322
|
inspector: [
|
|
1154
1323
|
{
|
|
@@ -1162,26 +1331,26 @@ const dl = {
|
|
|
1162
1331
|
}
|
|
1163
1332
|
]
|
|
1164
1333
|
}),
|
|
1165
|
-
|
|
1334
|
+
w({
|
|
1166
1335
|
type: "switch",
|
|
1167
1336
|
label: "开关",
|
|
1168
1337
|
category: "选择字段",
|
|
1169
1338
|
kind: "field",
|
|
1170
1339
|
valueType: "boolean",
|
|
1171
|
-
widget:
|
|
1340
|
+
widget: Al,
|
|
1172
1341
|
defaultLayout: { span: 8 },
|
|
1173
1342
|
inspector: [
|
|
1174
1343
|
{ key: "checkedText", label: "开启文案", control: "text" },
|
|
1175
1344
|
{ key: "uncheckedText", label: "关闭文案", control: "text" }
|
|
1176
1345
|
]
|
|
1177
1346
|
}),
|
|
1178
|
-
|
|
1347
|
+
w({
|
|
1179
1348
|
type: "slider",
|
|
1180
1349
|
label: "滑动条",
|
|
1181
1350
|
category: "选择字段",
|
|
1182
1351
|
kind: "field",
|
|
1183
1352
|
valueType: "number",
|
|
1184
|
-
widget:
|
|
1353
|
+
widget: Fl,
|
|
1185
1354
|
defaultLayout: { span: 12 },
|
|
1186
1355
|
inspector: [
|
|
1187
1356
|
{ key: "min", label: "最小值", control: "number" },
|
|
@@ -1190,27 +1359,27 @@ const dl = {
|
|
|
1190
1359
|
{ key: "showInput", label: "显示输入框", control: "switch" }
|
|
1191
1360
|
]
|
|
1192
1361
|
}),
|
|
1193
|
-
|
|
1362
|
+
w({
|
|
1194
1363
|
type: "rate",
|
|
1195
1364
|
label: "评分",
|
|
1196
1365
|
category: "选择字段",
|
|
1197
1366
|
kind: "field",
|
|
1198
1367
|
valueType: "number",
|
|
1199
|
-
widget:
|
|
1368
|
+
widget: Il,
|
|
1200
1369
|
defaultLayout: { span: 8 },
|
|
1201
1370
|
inspector: [
|
|
1202
1371
|
{ key: "count", label: "星星数量", control: "number", min: 1, max: 10 },
|
|
1203
1372
|
{ key: "allowHalf", label: "允许半星", control: "switch" }
|
|
1204
1373
|
]
|
|
1205
1374
|
}),
|
|
1206
|
-
|
|
1375
|
+
w({
|
|
1207
1376
|
type: "date",
|
|
1208
1377
|
label: "日期",
|
|
1209
1378
|
category: "日期时间",
|
|
1210
1379
|
kind: "field",
|
|
1211
1380
|
valueType: "timestamp",
|
|
1212
1381
|
aliases: ["datepicker", "date-picker"],
|
|
1213
|
-
widget:
|
|
1382
|
+
widget: we,
|
|
1214
1383
|
defaultLayout: { span: 12 },
|
|
1215
1384
|
defaultProps: { placeholder: "请选择日期" },
|
|
1216
1385
|
inspector: [
|
|
@@ -1219,14 +1388,14 @@ const dl = {
|
|
|
1219
1388
|
{ key: "allowClear", label: "允许清空", control: "switch" }
|
|
1220
1389
|
]
|
|
1221
1390
|
}),
|
|
1222
|
-
|
|
1391
|
+
w({
|
|
1223
1392
|
type: "date-range",
|
|
1224
1393
|
label: "日期范围",
|
|
1225
1394
|
category: "日期时间",
|
|
1226
1395
|
kind: "field",
|
|
1227
1396
|
valueType: "timestamp[]",
|
|
1228
1397
|
aliases: ["daterange", "date-picker-range", "rangepicker"],
|
|
1229
|
-
widget:
|
|
1398
|
+
widget: we,
|
|
1230
1399
|
defaultLayout: { span: 12 },
|
|
1231
1400
|
defaultProps: { placeholder: ["开始日期", "结束日期"] },
|
|
1232
1401
|
inspector: [
|
|
@@ -1235,14 +1404,14 @@ const dl = {
|
|
|
1235
1404
|
{ key: "allowClear", label: "允许清空", control: "switch" }
|
|
1236
1405
|
]
|
|
1237
1406
|
}),
|
|
1238
|
-
|
|
1407
|
+
w({
|
|
1239
1408
|
type: "time",
|
|
1240
1409
|
label: "时间",
|
|
1241
1410
|
category: "日期时间",
|
|
1242
1411
|
kind: "field",
|
|
1243
1412
|
valueType: "string",
|
|
1244
1413
|
aliases: ["timepicker", "time-picker"],
|
|
1245
|
-
widget:
|
|
1414
|
+
widget: Pl,
|
|
1246
1415
|
defaultLayout: { span: 12 },
|
|
1247
1416
|
defaultProps: { placeholder: "请选择时间" },
|
|
1248
1417
|
inspector: [
|
|
@@ -1250,19 +1419,20 @@ const dl = {
|
|
|
1250
1419
|
{ key: "allowClear", label: "允许清空", control: "switch" }
|
|
1251
1420
|
]
|
|
1252
1421
|
}),
|
|
1253
|
-
|
|
1422
|
+
w({
|
|
1254
1423
|
type: "upload",
|
|
1255
1424
|
label: "文件上传",
|
|
1256
1425
|
category: "高级字段",
|
|
1257
1426
|
kind: "field",
|
|
1258
1427
|
valueType: "file[]",
|
|
1259
1428
|
aliases: ["file", "file-upload"],
|
|
1260
|
-
widget:
|
|
1261
|
-
viewWidget:
|
|
1429
|
+
widget: xe,
|
|
1430
|
+
viewWidget: xe,
|
|
1262
1431
|
defaultLayout: { span: 24 },
|
|
1263
|
-
defaultProps: { autoUpload: !1 },
|
|
1432
|
+
defaultProps: { autoUpload: !1, showFileList: !0 },
|
|
1264
1433
|
inspector: [
|
|
1265
1434
|
{ key: "accept", label: "文件类型", control: "text", placeholder: ".pdf,.png" },
|
|
1435
|
+
{ key: "maxSize", label: "大小上限 (MB)", control: "number", min: 0, placeholder: "例如 10" },
|
|
1266
1436
|
{ key: "action", label: "上传地址", control: "text", placeholder: "https://api.example.com/upload" },
|
|
1267
1437
|
{ key: "autoUpload", label: "自动上传", control: "switch" },
|
|
1268
1438
|
{ key: "limit", label: "数量限制", control: "number", min: 1 },
|
|
@@ -1270,14 +1440,14 @@ const dl = {
|
|
|
1270
1440
|
{ key: "showFileList", label: "显示文件列表", control: "switch" }
|
|
1271
1441
|
]
|
|
1272
1442
|
}),
|
|
1273
|
-
|
|
1443
|
+
w({
|
|
1274
1444
|
type: "cascader",
|
|
1275
1445
|
label: "级联选择",
|
|
1276
1446
|
category: "高级字段",
|
|
1277
1447
|
kind: "field",
|
|
1278
1448
|
valueType: "string[]",
|
|
1279
1449
|
supportsOptions: !0,
|
|
1280
|
-
widget:
|
|
1450
|
+
widget: Jl,
|
|
1281
1451
|
defaultLayout: { span: 12 },
|
|
1282
1452
|
defaultProps: { placeholder: "请选择", allowClear: !0 },
|
|
1283
1453
|
inspector: [
|
|
@@ -1287,7 +1457,7 @@ const dl = {
|
|
|
1287
1457
|
{ key: "changeOnSelect", label: "选择即变化", control: "switch" }
|
|
1288
1458
|
]
|
|
1289
1459
|
}),
|
|
1290
|
-
|
|
1460
|
+
w({
|
|
1291
1461
|
type: "tree-select",
|
|
1292
1462
|
label: "树选择",
|
|
1293
1463
|
category: "高级字段",
|
|
@@ -1295,29 +1465,29 @@ const dl = {
|
|
|
1295
1465
|
valueType: "string",
|
|
1296
1466
|
aliases: ["treeselect"],
|
|
1297
1467
|
supportsOptions: !0,
|
|
1298
|
-
widget:
|
|
1468
|
+
widget: Xl,
|
|
1299
1469
|
defaultLayout: { span: 12 },
|
|
1300
1470
|
defaultProps: { placeholder: "请选择", allowClear: !0 },
|
|
1301
|
-
inspector:
|
|
1471
|
+
inspector: ft
|
|
1302
1472
|
}),
|
|
1303
|
-
|
|
1473
|
+
w({
|
|
1304
1474
|
type: "color",
|
|
1305
1475
|
label: "颜色选择",
|
|
1306
1476
|
category: "高级字段",
|
|
1307
1477
|
kind: "field",
|
|
1308
1478
|
valueType: "string",
|
|
1309
|
-
widget:
|
|
1479
|
+
widget: _l,
|
|
1310
1480
|
defaultLayout: { span: 8 },
|
|
1311
1481
|
inspector: [{ key: "disabledAlpha", label: "禁用透明度", control: "switch" }]
|
|
1312
1482
|
}),
|
|
1313
|
-
|
|
1483
|
+
w({
|
|
1314
1484
|
type: "static-text",
|
|
1315
1485
|
label: "静态文本",
|
|
1316
1486
|
category: "展示组件",
|
|
1317
1487
|
kind: "display",
|
|
1318
1488
|
valueType: "void",
|
|
1319
1489
|
aliases: ["static", "statictext"],
|
|
1320
|
-
widget:
|
|
1490
|
+
widget: et,
|
|
1321
1491
|
defaultLayout: { span: 24, hideLabel: !0 },
|
|
1322
1492
|
defaultProps: { content: "静态文本内容", type: "default" },
|
|
1323
1493
|
inspector: [
|
|
@@ -1336,25 +1506,25 @@ const dl = {
|
|
|
1336
1506
|
}
|
|
1337
1507
|
]
|
|
1338
1508
|
}),
|
|
1339
|
-
|
|
1509
|
+
w({
|
|
1340
1510
|
type: "card",
|
|
1341
1511
|
label: "卡片容器",
|
|
1342
1512
|
category: "布局容器",
|
|
1343
1513
|
kind: "container",
|
|
1344
1514
|
isContainer: !0,
|
|
1345
1515
|
valueType: "void",
|
|
1346
|
-
widget:
|
|
1516
|
+
widget: rt,
|
|
1347
1517
|
defaultLayout: { span: 24 },
|
|
1348
1518
|
inspector: [{ key: "bordered", label: "显示边框", control: "switch" }]
|
|
1349
1519
|
}),
|
|
1350
|
-
|
|
1520
|
+
w({
|
|
1351
1521
|
type: "section",
|
|
1352
1522
|
label: "分组区块",
|
|
1353
1523
|
category: "布局容器",
|
|
1354
1524
|
kind: "container",
|
|
1355
1525
|
isContainer: !0,
|
|
1356
1526
|
valueType: "void",
|
|
1357
|
-
widget:
|
|
1527
|
+
widget: ct,
|
|
1358
1528
|
defaultLayout: { span: 24 },
|
|
1359
1529
|
defaultProps: { icon: !0, plain: !1 },
|
|
1360
1530
|
inspector: [
|
|
@@ -1362,14 +1532,14 @@ const dl = {
|
|
|
1362
1532
|
{ key: "plain", label: "无背景", control: "switch" }
|
|
1363
1533
|
]
|
|
1364
1534
|
}),
|
|
1365
|
-
|
|
1535
|
+
w({
|
|
1366
1536
|
type: "divider",
|
|
1367
1537
|
label: "分割线",
|
|
1368
1538
|
category: "布局容器",
|
|
1369
1539
|
kind: "display",
|
|
1370
1540
|
valueType: "void",
|
|
1371
1541
|
aliases: ["line"],
|
|
1372
|
-
widget:
|
|
1542
|
+
widget: pt,
|
|
1373
1543
|
defaultLayout: { span: 24, hideLabel: !0 },
|
|
1374
1544
|
defaultProps: { orientation: "center", dividerType: "solid" },
|
|
1375
1545
|
inspector: [
|
|
@@ -1394,45 +1564,90 @@ const dl = {
|
|
|
1394
1564
|
}
|
|
1395
1565
|
]
|
|
1396
1566
|
})
|
|
1397
|
-
],
|
|
1398
|
-
|
|
1567
|
+
], ht = {
|
|
1568
|
+
基础字段: "category.basic",
|
|
1569
|
+
选择字段: "category.selection",
|
|
1570
|
+
日期时间: "category.datetime",
|
|
1571
|
+
高级字段: "category.advanced",
|
|
1572
|
+
展示组件: "category.display",
|
|
1573
|
+
布局容器: "category.container"
|
|
1574
|
+
}, vt = {
|
|
1575
|
+
"static-text": { content: "field.static-text.content" }
|
|
1576
|
+
}, bt = ["start", "end"];
|
|
1577
|
+
function gt(e, t) {
|
|
1578
|
+
return Array.isArray(t) ? t.map(
|
|
1579
|
+
(l, a) => `field.${e}.placeholder.${bt[a] ?? String(a)}`
|
|
1580
|
+
) : `field.${e}.placeholder`;
|
|
1581
|
+
}
|
|
1582
|
+
function wt(e) {
|
|
1583
|
+
var a;
|
|
1584
|
+
const t = e.type, l = {};
|
|
1585
|
+
return e.defaultProps && "placeholder" in e.defaultProps && (l.placeholder = gt(t, e.defaultProps.placeholder)), {
|
|
1586
|
+
...e,
|
|
1587
|
+
labelKey: `field.${t}.label`,
|
|
1588
|
+
categoryKey: ht[e.category ?? ""],
|
|
1589
|
+
propMessageKeys: {
|
|
1590
|
+
...l,
|
|
1591
|
+
...vt[t] ?? {}
|
|
1592
|
+
},
|
|
1593
|
+
inspector: (a = e.inspector) == null ? void 0 : a.map((n) => {
|
|
1594
|
+
var o;
|
|
1595
|
+
return {
|
|
1596
|
+
...n,
|
|
1597
|
+
labelKey: `field.${t}.inspector.${n.key}`,
|
|
1598
|
+
options: (o = n.options) == null ? void 0 : o.map((r) => ({
|
|
1599
|
+
...r,
|
|
1600
|
+
labelKey: `field.${t}.inspector.${n.key}.option.${String(r.value)}`
|
|
1601
|
+
}))
|
|
1602
|
+
};
|
|
1603
|
+
})
|
|
1604
|
+
};
|
|
1605
|
+
}
|
|
1606
|
+
const kt = yt.map(wt).map(
|
|
1607
|
+
(e) => e.kind === "container" ? e : { ...e, fieldWrapper: lt }
|
|
1399
1608
|
);
|
|
1400
|
-
function
|
|
1401
|
-
return
|
|
1609
|
+
function xt(e = {}) {
|
|
1610
|
+
return je({
|
|
1402
1611
|
name: e.name ?? "@fishbelly/form-morph-arco",
|
|
1403
|
-
version: "0.
|
|
1612
|
+
version: "0.2.0",
|
|
1404
1613
|
apiVersion: 1,
|
|
1405
1614
|
contributes: {
|
|
1406
|
-
fieldTypes:
|
|
1407
|
-
formShell:
|
|
1615
|
+
fieldTypes: kt,
|
|
1616
|
+
formShell: mt(e),
|
|
1617
|
+
locales: {
|
|
1618
|
+
"zh-CN": Se,
|
|
1619
|
+
...e.locales ?? {}
|
|
1620
|
+
}
|
|
1408
1621
|
}
|
|
1409
1622
|
});
|
|
1410
1623
|
}
|
|
1411
|
-
const
|
|
1624
|
+
const At = xt();
|
|
1412
1625
|
export {
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1626
|
+
lt as ArcoFormItem,
|
|
1627
|
+
nt as ArcoFormShell,
|
|
1628
|
+
rt as CardContainer,
|
|
1629
|
+
Jl as CascaderInput,
|
|
1630
|
+
Bl as CheckboxInput,
|
|
1631
|
+
_l as ColorInput,
|
|
1632
|
+
we as DateInput,
|
|
1633
|
+
pt as DividerContainer,
|
|
1634
|
+
Tl as NumberInput,
|
|
1635
|
+
Sl as RadioInput,
|
|
1636
|
+
Il as RateInput,
|
|
1637
|
+
ct as SectionContainer,
|
|
1638
|
+
ge as SelectInput,
|
|
1639
|
+
Fl as SliderInput,
|
|
1640
|
+
et as StaticText,
|
|
1641
|
+
Al as SwitchInput,
|
|
1642
|
+
te as TextInput,
|
|
1643
|
+
Pl as TimeInput,
|
|
1644
|
+
Xl as TreeSelectInput,
|
|
1645
|
+
xe as UploadInput,
|
|
1646
|
+
kt as arcoFieldTypes,
|
|
1647
|
+
At as arcoPack,
|
|
1648
|
+
Se as arcoZhCN,
|
|
1649
|
+
mt as createArcoFormShell,
|
|
1650
|
+
xt as createArcoPack,
|
|
1651
|
+
At as default
|
|
1437
1652
|
};
|
|
1438
1653
|
//# sourceMappingURL=index.js.map
|