@fishbelly/form-morph-arco 0.1.2 → 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 +25 -1
- 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 +1 -1
- package/dist/i18n.d.ts +12 -0
- package/dist/index.d.ts +15 -6
- package/dist/index.js +743 -584
- 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 +57 -53
- package/dist/__tests__/dateValue.test.d.ts +0 -1
- package/dist/__tests__/fieldConfig.test.d.ts +0 -1
- package/dist/__tests__/formRendererValidation.test.d.ts +0 -1
- package/dist/__tests__/labelWidth.test.d.ts +0 -1
- package/dist/__tests__/optionDisabled.test.d.ts +0 -1
- package/dist/__tests__/treeValue.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 _ = /* @__PURE__ */ V({
|
|
|
17
57
|
},
|
|
18
58
|
emits: ["update:modelValue"],
|
|
19
59
|
setup(e, { emit: t }) {
|
|
20
|
-
const l = e, a = t,
|
|
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
|
|
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
81
|
"onUpdate:modelValue": s
|
|
38
|
-
}, null, 8, ["model-value", "placeholder", "max-length", "auto-size", "show-word-limit", "allow-clear", "rows", "disabled", "size"])) :
|
|
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
90
|
"onUpdate:modelValue": s
|
|
47
|
-
}, null, 8, ["model-value", "placeholder", "max-length", "allow-clear", "disabled", "size"])) : (
|
|
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
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 _ = /* @__PURE__ */ V({
|
|
|
70
114
|
},
|
|
71
115
|
emits: ["update:modelValue"],
|
|
72
116
|
setup(e, { emit: t }) {
|
|
73
|
-
const l = e, a = t,
|
|
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 i
|
|
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
|
|
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 _ = /* @__PURE__ */ V({
|
|
|
107
155
|
},
|
|
108
156
|
emits: ["update:modelValue"],
|
|
109
157
|
setup(e, { emit: t }) {
|
|
110
|
-
const l = e, a = t,
|
|
158
|
+
const l = e, a = t, { tField: n } = O(), o = c(() => {
|
|
111
159
|
var s;
|
|
112
160
|
return l.node.type === "multi-select" || ((s = l.node.props) == null ? void 0 : s.multiple) === !0;
|
|
113
|
-
}),
|
|
114
|
-
|
|
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) {
|
|
115
167
|
a("update:modelValue", s === void 0 ? null : s);
|
|
116
168
|
}
|
|
117
|
-
return (s,
|
|
118
|
-
var
|
|
119
|
-
return
|
|
120
|
-
"model-value":
|
|
169
|
+
return (s, f) => {
|
|
170
|
+
var m, v, L;
|
|
171
|
+
return p(), g(h(el), {
|
|
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 _ = /* @__PURE__ */ V({
|
|
|
144
196
|
},
|
|
145
197
|
emits: ["update:modelValue"],
|
|
146
198
|
setup(e, { emit: t }) {
|
|
147
|
-
const l = e, a = t,
|
|
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
|
|
152
|
-
a("update:modelValue",
|
|
203
|
+
function o(r) {
|
|
204
|
+
a("update:modelValue", r);
|
|
153
205
|
}
|
|
154
|
-
return (
|
|
155
|
-
var
|
|
156
|
-
return
|
|
157
|
-
"model-value":
|
|
158
|
-
direction: ((
|
|
206
|
+
return (r, u) => {
|
|
207
|
+
var i;
|
|
208
|
+
return p(), g(h(ll), {
|
|
209
|
+
"model-value": n.value,
|
|
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
|
-
(
|
|
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 _ = /* @__PURE__ */ V({
|
|
|
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 _ = /* @__PURE__ */ V({
|
|
|
190
242
|
},
|
|
191
243
|
emits: ["update:modelValue"],
|
|
192
244
|
setup(e, { emit: t }) {
|
|
193
|
-
const l = e, a = t,
|
|
194
|
-
function
|
|
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
|
|
200
|
-
"model-value":
|
|
201
|
-
direction: ((
|
|
249
|
+
return (r, u) => {
|
|
250
|
+
var i;
|
|
251
|
+
return p(), g(h(al), {
|
|
252
|
+
"model-value": n.value,
|
|
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
|
-
(
|
|
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 _ = /* @__PURE__ */ V({
|
|
|
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 _ = /* @__PURE__ */ V({
|
|
|
233
285
|
},
|
|
234
286
|
emits: ["update:modelValue"],
|
|
235
287
|
setup(e, { emit: t }) {
|
|
236
|
-
const l = e, a = t,
|
|
237
|
-
return (
|
|
238
|
-
var
|
|
239
|
-
return
|
|
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
|
-
size:
|
|
245
|
-
"onUpdate:modelValue":
|
|
296
|
+
size: n.value,
|
|
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 _ = /* @__PURE__ */ V({
|
|
|
260
312
|
},
|
|
261
313
|
emits: ["update:modelValue"],
|
|
262
314
|
setup(e, { emit: t }) {
|
|
263
|
-
const l = e, a = t,
|
|
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
|
|
273
|
-
"model-value":
|
|
274
|
-
min: ((
|
|
275
|
-
max: ((
|
|
276
|
-
step: ((
|
|
322
|
+
return (o, r) => {
|
|
323
|
+
var u, i, s, f;
|
|
324
|
+
return p(), g(h(rl), {
|
|
325
|
+
"model-value": n.value,
|
|
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,
|
|
277
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 _ = /* @__PURE__ */ V({
|
|
|
294
346
|
},
|
|
295
347
|
emits: ["update:modelValue"],
|
|
296
348
|
setup(e, { emit: t }) {
|
|
297
|
-
const l = e, a = t,
|
|
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
|
|
304
|
-
"model-value":
|
|
305
|
-
count: ((
|
|
306
|
-
"allow-half": ((
|
|
353
|
+
return (o, r) => {
|
|
354
|
+
var u, i;
|
|
355
|
+
return p(), g(h(il), {
|
|
356
|
+
"model-value": n.value,
|
|
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 be = /* @__PURE__ */ V({
|
|
|
333
385
|
},
|
|
334
386
|
emits: ["update:modelValue"],
|
|
335
387
|
setup(e, { emit: t }) {
|
|
336
|
-
const l = e, a = t,
|
|
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
408
|
function f() {
|
|
357
|
-
a("update:modelValue",
|
|
409
|
+
a("update:modelValue", Dl(n.value));
|
|
358
410
|
}
|
|
359
|
-
return (
|
|
360
|
-
var
|
|
361
|
-
return
|
|
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:
|
|
422
|
+
onChange: s,
|
|
371
423
|
onClear: f
|
|
372
|
-
}, null, 8, ["model-value", "placeholder", "show-time", "format", "allow-clear", "disabled", "size"])) : (
|
|
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:
|
|
433
|
+
onChange: i,
|
|
382
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 be = /* @__PURE__ */ V({
|
|
|
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 (i,
|
|
408
|
-
var
|
|
409
|
-
return
|
|
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,32 +500,32 @@ function hl(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
|
-
const
|
|
507
|
+
const n = {
|
|
452
508
|
uid: t.uid ?? `file-${a.name}-${a.lastModified}`,
|
|
453
509
|
name: t.name ?? a.name,
|
|
454
510
|
file: a
|
|
455
511
|
};
|
|
456
|
-
t.url && (
|
|
457
|
-
const
|
|
458
|
-
return
|
|
512
|
+
t.url && (n.url = t.url), t.status && (n.status = t.status);
|
|
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,
|
|
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,26 +535,26 @@ function gl(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 = {
|
|
486
542
|
key: 0,
|
|
487
543
|
class: "fm-upload-view__empty"
|
|
488
|
-
},
|
|
544
|
+
}, jl = {
|
|
489
545
|
key: 1,
|
|
490
546
|
class: "fm-upload-view__summary"
|
|
491
|
-
},
|
|
547
|
+
}, Kl = {
|
|
492
548
|
key: 2,
|
|
493
549
|
class: "fm-upload-view__empty"
|
|
494
|
-
},
|
|
550
|
+
}, Hl = ["title"], Yl = {
|
|
495
551
|
key: 0,
|
|
496
552
|
class: "fm-upload-field__status"
|
|
497
|
-
},
|
|
553
|
+
}, ql = {
|
|
498
554
|
key: 1,
|
|
499
555
|
class: "fm-upload-field__notice",
|
|
500
556
|
role: "status"
|
|
501
|
-
},
|
|
557
|
+
}, Gl = /* @__PURE__ */ k({
|
|
502
558
|
__name: "UploadInput",
|
|
503
559
|
props: {
|
|
504
560
|
modelValue: {},
|
|
@@ -512,200 +568,207 @@ const wl = {
|
|
|
512
568
|
},
|
|
513
569
|
emits: ["update:modelValue"],
|
|
514
570
|
setup(e, { emit: t }) {
|
|
515
|
-
const l = e, a = t,
|
|
516
|
-
var
|
|
517
|
-
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;
|
|
518
574
|
};
|
|
519
|
-
function
|
|
520
|
-
return
|
|
575
|
+
function i(d) {
|
|
576
|
+
return d && typeof d == "object" ? d : null;
|
|
521
577
|
}
|
|
522
|
-
const
|
|
523
|
-
function d
|
|
524
|
-
const
|
|
525
|
-
if (!
|
|
578
|
+
const s = /* @__PURE__ */ new Set(["http:", "https:", "blob:"]);
|
|
579
|
+
function f(d) {
|
|
580
|
+
const y = d.trim();
|
|
581
|
+
if (!y) return "";
|
|
526
582
|
try {
|
|
527
|
-
const x = new URL(
|
|
528
|
-
return
|
|
583
|
+
const x = new URL(y, "http://form-morph.local").protocol;
|
|
584
|
+
return s.has(x) ? y : "";
|
|
529
585
|
} catch {
|
|
530
586
|
return "";
|
|
531
587
|
}
|
|
532
588
|
}
|
|
533
|
-
function
|
|
534
|
-
const
|
|
535
|
-
if (!
|
|
536
|
-
const x =
|
|
537
|
-
return typeof x == "string" && x ?
|
|
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)) : "";
|
|
538
594
|
}
|
|
539
|
-
function
|
|
540
|
-
const
|
|
541
|
-
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 ?? "");
|
|
542
598
|
}
|
|
543
|
-
function
|
|
544
|
-
const x =
|
|
545
|
-
return x ? String(x.uid ?? x.id ??
|
|
599
|
+
function L(d, y) {
|
|
600
|
+
const x = i(d);
|
|
601
|
+
return x ? String(x.uid ?? x.id ?? y) : y;
|
|
546
602
|
}
|
|
547
|
-
const
|
|
548
|
-
() =>
|
|
549
|
-
const
|
|
550
|
-
if (!
|
|
551
|
-
const x =
|
|
552
|
-
if (typeof x != "string" || !x) return
|
|
553
|
-
const
|
|
554
|
-
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 };
|
|
555
611
|
})
|
|
556
|
-
),
|
|
612
|
+
), D = c(
|
|
557
613
|
() => l.mode === "view" || l.mode === "print" || l.disabled || l.readonly
|
|
558
|
-
),
|
|
559
|
-
var
|
|
560
|
-
return ((
|
|
561
|
-
}),
|
|
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(
|
|
562
618
|
() => {
|
|
563
|
-
var
|
|
564
|
-
return typeof ((
|
|
619
|
+
var d;
|
|
620
|
+
return typeof ((d = l.node.props) == null ? void 0 : d.accept) == "string" ? l.node.props.accept : "";
|
|
565
621
|
}
|
|
566
|
-
),
|
|
567
|
-
var
|
|
568
|
-
return ((
|
|
569
|
-
}),
|
|
570
|
-
var
|
|
571
|
-
const
|
|
572
|
-
return Number.isFinite(
|
|
573
|
-
}),
|
|
574
|
-
const
|
|
575
|
-
return
|
|
576
|
-
}),
|
|
577
|
-
let
|
|
578
|
-
function
|
|
579
|
-
|
|
580
|
-
|
|
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;
|
|
581
637
|
}, 3200);
|
|
582
638
|
}
|
|
583
|
-
function
|
|
584
|
-
|
|
639
|
+
function J() {
|
|
640
|
+
E && (clearTimeout(E), E = void 0);
|
|
585
641
|
}
|
|
586
|
-
function
|
|
587
|
-
|
|
642
|
+
function ie() {
|
|
643
|
+
J(), S.value = !0;
|
|
588
644
|
}
|
|
589
|
-
function
|
|
645
|
+
function de(d) {
|
|
590
646
|
var x;
|
|
591
|
-
const
|
|
592
|
-
return !!(
|
|
647
|
+
const y = (x = d.dataTransfer) == null ? void 0 : x.types;
|
|
648
|
+
return !!(y && Array.from(y).includes("Files"));
|
|
593
649
|
}
|
|
594
|
-
function
|
|
595
|
-
return
|
|
650
|
+
function Fe(d) {
|
|
651
|
+
return ye({ name: d.name, type: d.type }, A.value) ? !0 : (q(o("field.upload.notice.type")), !1);
|
|
596
652
|
}
|
|
597
|
-
function
|
|
598
|
-
|
|
653
|
+
function se() {
|
|
654
|
+
$ = 0, J(), S.value = !1;
|
|
599
655
|
}
|
|
600
|
-
function
|
|
601
|
-
|
|
656
|
+
function Ie(d) {
|
|
657
|
+
de(d) && (d.preventDefault(), $ += 1, ie());
|
|
602
658
|
}
|
|
603
|
-
function
|
|
604
|
-
|
|
659
|
+
function $e(d) {
|
|
660
|
+
de(d) && (d.preventDefault(), d.dataTransfer && (d.dataTransfer.dropEffect = "copy"), $ = Math.max($, 1), ie());
|
|
605
661
|
}
|
|
606
|
-
function
|
|
607
|
-
|
|
608
|
-
|
|
662
|
+
function De(d) {
|
|
663
|
+
S.value && (d.preventDefault(), $ = Math.max(0, $ - 1), !($ > 0) && (J(), E = setTimeout(() => {
|
|
664
|
+
S.value = !1, E = void 0;
|
|
609
665
|
}, 80)));
|
|
610
666
|
}
|
|
611
|
-
function
|
|
612
|
-
var
|
|
613
|
-
|
|
614
|
-
const
|
|
615
|
-
if (
|
|
616
|
-
const x = Array.from(((
|
|
617
|
-
(j) =>
|
|
618
|
-
),
|
|
619
|
-
let
|
|
620
|
-
if (
|
|
621
|
-
const j = Math.max(0,
|
|
622
|
-
|
|
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;
|
|
623
686
|
}
|
|
624
|
-
const
|
|
625
|
-
|
|
687
|
+
const Ue = Array.isArray(l.modelValue) ? l.modelValue : [];
|
|
688
|
+
a("update:modelValue", [...Ue, ...R.map((j) => ke(j))]);
|
|
626
689
|
}
|
|
627
|
-
function
|
|
628
|
-
|
|
690
|
+
function K() {
|
|
691
|
+
S.value && se();
|
|
629
692
|
}
|
|
630
|
-
|
|
631
|
-
window.addEventListener("dragend",
|
|
632
|
-
}),
|
|
633
|
-
window.removeEventListener("dragend",
|
|
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);
|
|
634
697
|
});
|
|
635
|
-
function
|
|
636
|
-
a("update:modelValue", Array.isArray(
|
|
698
|
+
function Ne(d) {
|
|
699
|
+
a("update:modelValue", Array.isArray(d) ? d.map(ke) : []);
|
|
637
700
|
}
|
|
638
|
-
return (
|
|
639
|
-
var x,
|
|
640
|
-
return
|
|
641
|
-
|
|
642
|
-
(
|
|
643
|
-
key:
|
|
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),
|
|
644
707
|
class: "fm-upload-view__item"
|
|
645
708
|
}, [
|
|
646
|
-
|
|
709
|
+
m(M) ? (p(), C("a", {
|
|
647
710
|
key: 0,
|
|
648
711
|
class: "fm-upload-view__link",
|
|
649
|
-
href:
|
|
712
|
+
href: m(M),
|
|
650
713
|
target: "_blank",
|
|
651
714
|
rel: "noopener"
|
|
652
|
-
}, B(
|
|
715
|
+
}, B(v(M)), 9, Rl)) : (p(), C("span", Ol, B(v(M)), 1))
|
|
653
716
|
]))), 128)),
|
|
654
|
-
|
|
655
|
-
], 64)) :
|
|
656
|
-
])) : (
|
|
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", {
|
|
657
720
|
key: 1,
|
|
658
721
|
class: "fm-upload-field",
|
|
659
|
-
title:
|
|
660
|
-
onDragenter:
|
|
661
|
-
onDragover:
|
|
662
|
-
onDragleave:
|
|
663
|
-
onDrop:
|
|
722
|
+
title: V.value,
|
|
723
|
+
onDragenter: Ie,
|
|
724
|
+
onDragover: $e,
|
|
725
|
+
onDragleave: De,
|
|
726
|
+
onDrop: Pe
|
|
664
727
|
}, [
|
|
665
|
-
|
|
728
|
+
G(h(cl), {
|
|
666
729
|
ref_key: "uploadRef",
|
|
667
|
-
ref:
|
|
668
|
-
"file-list":
|
|
730
|
+
ref: r,
|
|
731
|
+
"file-list": I.value,
|
|
669
732
|
"auto-upload": ((x = e.node.props) == null ? void 0 : x.autoUpload) === !0,
|
|
670
|
-
accept:
|
|
671
|
-
action: ((
|
|
672
|
-
limit:
|
|
673
|
-
multiple:
|
|
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,
|
|
674
737
|
disabled: e.disabled || e.readonly,
|
|
675
|
-
"show-file-list":
|
|
676
|
-
"on-before-upload":
|
|
677
|
-
onChange:
|
|
738
|
+
"show-file-list": T.value,
|
|
739
|
+
"on-before-upload": Fe,
|
|
740
|
+
onChange: y[0] || (y[0] = (M) => Ne(M))
|
|
678
741
|
}, {
|
|
679
|
-
"upload-button":
|
|
680
|
-
|
|
742
|
+
"upload-button": F(() => [
|
|
743
|
+
G(h(pl), {
|
|
681
744
|
type: "primary",
|
|
682
745
|
disabled: e.disabled || e.readonly
|
|
683
746
|
}, {
|
|
684
|
-
icon:
|
|
685
|
-
|
|
747
|
+
icon: F(() => [
|
|
748
|
+
G(h(kl))
|
|
686
749
|
]),
|
|
687
|
-
default:
|
|
688
|
-
|
|
750
|
+
default: F(() => [
|
|
751
|
+
Z(" " + B(S.value ? h(o)("field.upload.release") : h(o)("field.upload.button")), 1)
|
|
689
752
|
]),
|
|
690
753
|
_: 1
|
|
691
754
|
}, 8, ["disabled"])
|
|
692
755
|
]),
|
|
693
756
|
_: 1
|
|
694
757
|
}, 8, ["file-list", "auto-upload", "accept", "action", "limit", "multiple", "disabled", "show-file-list"]),
|
|
695
|
-
!
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
])) :
|
|
699
|
-
|
|
700
|
-
], 40,
|
|
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));
|
|
701
764
|
};
|
|
702
765
|
}
|
|
703
|
-
}),
|
|
766
|
+
}), Zl = (e, t) => {
|
|
704
767
|
const l = e.__vccOpts || e;
|
|
705
|
-
for (const [a,
|
|
706
|
-
l[a] =
|
|
768
|
+
for (const [a, n] of t)
|
|
769
|
+
l[a] = n;
|
|
707
770
|
return l;
|
|
708
|
-
},
|
|
771
|
+
}, xe = /* @__PURE__ */ Zl(Gl, [["__scopeId", "data-v-8abfe030"]]), Jl = /* @__PURE__ */ k({
|
|
709
772
|
__name: "CascaderInput",
|
|
710
773
|
props: {
|
|
711
774
|
modelValue: {},
|
|
@@ -719,38 +782,42 @@ const wl = {
|
|
|
719
782
|
},
|
|
720
783
|
emits: ["update:modelValue"],
|
|
721
784
|
setup(e, { emit: t }) {
|
|
722
|
-
const l = t
|
|
723
|
-
|
|
724
|
-
|
|
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);
|
|
725
792
|
}
|
|
726
|
-
return (
|
|
727
|
-
var
|
|
728
|
-
return
|
|
793
|
+
return (u, i) => {
|
|
794
|
+
var s, f, m;
|
|
795
|
+
return p(), g(h(ml), {
|
|
729
796
|
"model-value": e.modelValue ?? void 0,
|
|
730
797
|
options: e.options,
|
|
731
|
-
placeholder:
|
|
798
|
+
placeholder: o.value,
|
|
732
799
|
"allow-search": ((s = e.node.props) == null ? void 0 : s.allowSearch) === !0,
|
|
733
|
-
"change-on-select": ((
|
|
800
|
+
"change-on-select": ((f = e.node.props) == null ? void 0 : f.changeOnSelect) === !0,
|
|
734
801
|
disabled: e.disabled || e.readonly,
|
|
735
802
|
size: e.size,
|
|
736
|
-
"allow-clear": ((
|
|
737
|
-
onChange:
|
|
803
|
+
"allow-clear": ((m = e.node.props) == null ? void 0 : m.allowClear) !== !1,
|
|
804
|
+
onChange: r
|
|
738
805
|
}, null, 8, ["model-value", "options", "placeholder", "allow-search", "change-on-select", "disabled", "size", "allow-clear"]);
|
|
739
806
|
};
|
|
740
807
|
}
|
|
741
808
|
});
|
|
742
|
-
function
|
|
809
|
+
function Ql(e) {
|
|
743
810
|
return typeof e == "boolean" ? String(e) : e;
|
|
744
811
|
}
|
|
745
|
-
function
|
|
812
|
+
function Ae(e = []) {
|
|
746
813
|
return e.map((t) => ({
|
|
747
|
-
key:
|
|
814
|
+
key: Ql(t.value),
|
|
748
815
|
title: String(t.label),
|
|
749
816
|
disabled: t.disabled,
|
|
750
|
-
children: Array.isArray(t.children) ?
|
|
817
|
+
children: Array.isArray(t.children) ? Ae(t.children) : void 0
|
|
751
818
|
}));
|
|
752
819
|
}
|
|
753
|
-
const
|
|
820
|
+
const Xl = /* @__PURE__ */ k({
|
|
754
821
|
__name: "TreeSelectInput",
|
|
755
822
|
props: {
|
|
756
823
|
modelValue: {},
|
|
@@ -764,25 +831,29 @@ const Al = /* @__PURE__ */ V({
|
|
|
764
831
|
},
|
|
765
832
|
emits: ["update:modelValue"],
|
|
766
833
|
setup(e, { emit: t }) {
|
|
767
|
-
const l = e, a = t,
|
|
768
|
-
|
|
769
|
-
|
|
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) {
|
|
840
|
+
a("update:modelValue", i ?? null);
|
|
770
841
|
}
|
|
771
|
-
return (
|
|
772
|
-
var
|
|
773
|
-
return
|
|
774
|
-
data:
|
|
842
|
+
return (i, s) => {
|
|
843
|
+
var f, m;
|
|
844
|
+
return p(), g(h(fl), {
|
|
845
|
+
data: o.value,
|
|
775
846
|
"model-value": e.modelValue ?? void 0,
|
|
776
|
-
placeholder:
|
|
777
|
-
"allow-search": ((
|
|
847
|
+
placeholder: r.value,
|
|
848
|
+
"allow-search": ((f = e.node.props) == null ? void 0 : f.allowSearch) === !0,
|
|
778
849
|
disabled: e.disabled || e.readonly,
|
|
779
850
|
size: e.size,
|
|
780
|
-
"allow-clear": ((
|
|
781
|
-
onChange:
|
|
851
|
+
"allow-clear": ((m = e.node.props) == null ? void 0 : m.allowClear) !== !1,
|
|
852
|
+
onChange: u
|
|
782
853
|
}, null, 8, ["data", "model-value", "placeholder", "allow-search", "disabled", "size", "allow-clear"]);
|
|
783
854
|
};
|
|
784
855
|
}
|
|
785
|
-
}),
|
|
856
|
+
}), _l = /* @__PURE__ */ k({
|
|
786
857
|
__name: "ColorInput",
|
|
787
858
|
props: {
|
|
788
859
|
modelValue: {},
|
|
@@ -797,18 +868,18 @@ const Al = /* @__PURE__ */ V({
|
|
|
797
868
|
emits: ["update:modelValue"],
|
|
798
869
|
setup(e, { emit: t }) {
|
|
799
870
|
const l = t;
|
|
800
|
-
return (a,
|
|
801
|
-
var
|
|
802
|
-
return
|
|
871
|
+
return (a, n) => {
|
|
872
|
+
var o;
|
|
873
|
+
return p(), g(h(yl), {
|
|
803
874
|
"model-value": e.modelValue === null || e.modelValue === void 0 ? "" : String(e.modelValue),
|
|
804
|
-
"disabled-alpha": ((
|
|
875
|
+
"disabled-alpha": ((o = e.node.props) == null ? void 0 : o.disabledAlpha) === !0,
|
|
805
876
|
disabled: e.disabled || e.readonly,
|
|
806
877
|
size: e.size,
|
|
807
|
-
onChange:
|
|
878
|
+
onChange: n[0] || (n[0] = (r) => l("update:modelValue", r ?? ""))
|
|
808
879
|
}, null, 8, ["model-value", "disabled-alpha", "disabled", "size"]);
|
|
809
880
|
};
|
|
810
881
|
}
|
|
811
|
-
}),
|
|
882
|
+
}), et = /* @__PURE__ */ k({
|
|
812
883
|
__name: "StaticText",
|
|
813
884
|
props: {
|
|
814
885
|
modelValue: {},
|
|
@@ -821,22 +892,24 @@ const Al = /* @__PURE__ */ V({
|
|
|
821
892
|
error: {}
|
|
822
893
|
},
|
|
823
894
|
setup(e) {
|
|
824
|
-
const t = e, l =
|
|
825
|
-
var
|
|
826
|
-
const
|
|
827
|
-
return
|
|
828
|
-
}),
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
895
|
+
const t = e, { tField: l } = O(), a = c(() => {
|
|
896
|
+
var u;
|
|
897
|
+
const r = (u = t.node.props) == null ? void 0 : u.content;
|
|
898
|
+
return r == null ? "" : String(r);
|
|
899
|
+
}), n = c(() => t.mode === "design"), o = c(
|
|
900
|
+
() => n.value && !a.value ? l("field.static-text.placeholder") : ""
|
|
901
|
+
);
|
|
902
|
+
return (r, u) => {
|
|
903
|
+
var i;
|
|
904
|
+
return p(), C("div", {
|
|
905
|
+
class: ee(["fm-static-text", [
|
|
906
|
+
(i = e.node.props) != null && i.type ? `fm-static-text--${String(e.node.props.type)}` : void 0,
|
|
907
|
+
{ "fm-static-text--empty": !!o.value }
|
|
835
908
|
]])
|
|
836
|
-
}, B(
|
|
909
|
+
}, B(a.value || o.value), 3);
|
|
837
910
|
};
|
|
838
911
|
}
|
|
839
|
-
}),
|
|
912
|
+
}), lt = /* @__PURE__ */ k({
|
|
840
913
|
__name: "ArcoFormItem",
|
|
841
914
|
props: {
|
|
842
915
|
node: {},
|
|
@@ -850,15 +923,15 @@ const Al = /* @__PURE__ */ V({
|
|
|
850
923
|
reserveMessage: { type: Boolean, default: !0 }
|
|
851
924
|
},
|
|
852
925
|
setup(e) {
|
|
853
|
-
const t = e, l =
|
|
854
|
-
var
|
|
855
|
-
return ((
|
|
856
|
-
}),
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
layout:
|
|
861
|
-
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"),
|
|
862
935
|
autoLabelWidth: !1,
|
|
863
936
|
maxLabelWidth: 0,
|
|
864
937
|
setLabelWidth: () => {
|
|
@@ -867,49 +940,50 @@ const Al = /* @__PURE__ */ V({
|
|
|
867
940
|
}
|
|
868
941
|
})
|
|
869
942
|
);
|
|
870
|
-
const
|
|
871
|
-
if (t.vertical ||
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
return !f || f === "auto" ? i ? void 0 : "108px" : /^\d+(\.\d+)?$/.test(f) ? `${f}px` : f;
|
|
877
|
-
}
|
|
878
|
-
return i ? void 0 : "108px";
|
|
879
|
-
}), s = p(() => {
|
|
880
|
-
const d = t.labelWidth;
|
|
881
|
-
if (typeof d == "number") return Number.isFinite(d);
|
|
882
|
-
if (typeof d == "string") {
|
|
883
|
-
const f = d.trim();
|
|
884
|
-
return !!f && f !== "auto";
|
|
885
|
-
}
|
|
886
|
-
return !1;
|
|
887
|
-
}), u = p(() => t.vertical ? { div: !0 } : { div: !1, wrap: !1 });
|
|
888
|
-
return (d, f) => (c(), w(h(el), {
|
|
889
|
-
class: X(["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", {
|
|
890
949
|
"fm-arco-form-item--vertical": e.vertical,
|
|
891
950
|
"fm-arco-form-item--label-left": e.labelAlign === "left",
|
|
892
951
|
"fm-arco-form-item--view": e.view,
|
|
893
|
-
"fm-arco-form-item--label-width":
|
|
952
|
+
"fm-arco-form-item--label-width": i.value,
|
|
894
953
|
"fm-arco-form-item--no-message-space": !e.reserveMessage
|
|
895
954
|
}]),
|
|
896
|
-
label:
|
|
897
|
-
"hide-label":
|
|
955
|
+
label: a.value ? void 0 : n.value,
|
|
956
|
+
"hide-label": a.value,
|
|
898
957
|
required: e.state.required && !e.view,
|
|
899
958
|
tooltip: e.node.help || void 0,
|
|
900
959
|
help: e.error || void 0,
|
|
901
960
|
"validate-status": e.error ? "error" : void 0,
|
|
902
961
|
disabled: e.disabled,
|
|
903
|
-
"label-col-flex":
|
|
904
|
-
"row-props":
|
|
962
|
+
"label-col-flex": u.value,
|
|
963
|
+
"row-props": s.value
|
|
905
964
|
}, {
|
|
906
|
-
default:
|
|
907
|
-
|
|
965
|
+
default: F(() => [
|
|
966
|
+
le(f.$slots, "default")
|
|
908
967
|
]),
|
|
909
968
|
_: 3
|
|
910
969
|
}, 8, ["class", "label", "hide-label", "required", "tooltip", "help", "validate-status", "disabled", "label-col-flex", "row-props"]));
|
|
911
970
|
}
|
|
912
|
-
}),
|
|
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({
|
|
913
987
|
__name: "ArcoFormShell",
|
|
914
988
|
props: {
|
|
915
989
|
layout: {},
|
|
@@ -919,68 +993,85 @@ const Al = /* @__PURE__ */ V({
|
|
|
919
993
|
size: {},
|
|
920
994
|
model: {},
|
|
921
995
|
rules: {},
|
|
922
|
-
scrollToFirstError: { type: Boolean }
|
|
996
|
+
scrollToFirstError: { type: Boolean },
|
|
997
|
+
localeMap: {},
|
|
998
|
+
syncLibraryLocale: { type: Boolean }
|
|
923
999
|
},
|
|
924
1000
|
emits: ["submit"],
|
|
925
1001
|
setup(e, { expose: t, emit: l }) {
|
|
926
|
-
const a = e,
|
|
927
|
-
|
|
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` } : {}
|
|
928
1014
|
);
|
|
929
|
-
function
|
|
930
|
-
var
|
|
931
|
-
const
|
|
932
|
-
if (!
|
|
933
|
-
let
|
|
934
|
-
|
|
935
|
-
const
|
|
936
|
-
|
|
937
|
-
}),
|
|
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);
|
|
938
1024
|
}
|
|
939
|
-
let
|
|
940
|
-
function
|
|
941
|
-
|
|
942
|
-
|
|
1025
|
+
let T = null, z = null;
|
|
1026
|
+
function A() {
|
|
1027
|
+
z && clearTimeout(z), z = setTimeout(() => {
|
|
1028
|
+
z = null, he(D);
|
|
943
1029
|
}, 30);
|
|
944
1030
|
}
|
|
945
|
-
|
|
946
|
-
var
|
|
947
|
-
|
|
948
|
-
const
|
|
949
|
-
!
|
|
950
|
-
|
|
951
|
-
var
|
|
952
|
-
return
|
|
953
|
-
}) &&
|
|
954
|
-
}),
|
|
955
|
-
}),
|
|
956
|
-
|
|
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;
|
|
957
1043
|
});
|
|
958
|
-
function
|
|
959
|
-
var
|
|
960
|
-
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);
|
|
961
1047
|
}
|
|
962
|
-
return t({ validate:
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
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"])
|
|
979
1070
|
]),
|
|
980
1071
|
_: 3
|
|
981
|
-
},
|
|
1072
|
+
}, 16));
|
|
982
1073
|
}
|
|
983
|
-
}),
|
|
1074
|
+
}), rt = /* @__PURE__ */ k({
|
|
984
1075
|
__name: "CardContainer",
|
|
985
1076
|
props: {
|
|
986
1077
|
modelValue: {},
|
|
@@ -994,27 +1085,27 @@ const Al = /* @__PURE__ */ V({
|
|
|
994
1085
|
},
|
|
995
1086
|
setup(e) {
|
|
996
1087
|
return (t, l) => {
|
|
997
|
-
var a,
|
|
998
|
-
return
|
|
1088
|
+
var a, n;
|
|
1089
|
+
return p(), g(h(gl), {
|
|
999
1090
|
class: "fm-arco-card",
|
|
1000
1091
|
title: e.node.label,
|
|
1001
1092
|
bordered: ((a = e.node.props) == null ? void 0 : a.bordered) !== !1,
|
|
1002
|
-
"header-style": (
|
|
1093
|
+
"header-style": (n = e.node.props) == null ? void 0 : n.headerStyle
|
|
1003
1094
|
}, {
|
|
1004
|
-
default:
|
|
1005
|
-
|
|
1095
|
+
default: F(() => [
|
|
1096
|
+
le(t.$slots, "default")
|
|
1006
1097
|
]),
|
|
1007
1098
|
_: 3
|
|
1008
1099
|
}, 8, ["title", "bordered", "header-style"]);
|
|
1009
1100
|
};
|
|
1010
1101
|
}
|
|
1011
|
-
}),
|
|
1102
|
+
}), it = {
|
|
1012
1103
|
key: 0,
|
|
1013
1104
|
class: "fm-arco-section__header"
|
|
1014
|
-
},
|
|
1105
|
+
}, dt = { class: "fm-arco-section__title" }, st = {
|
|
1015
1106
|
key: 1,
|
|
1016
1107
|
class: "fm-arco-section__desc"
|
|
1017
|
-
},
|
|
1108
|
+
}, ut = { class: "fm-arco-section__content" }, ct = /* @__PURE__ */ k({
|
|
1018
1109
|
__name: "SectionContainer",
|
|
1019
1110
|
props: {
|
|
1020
1111
|
modelValue: {},
|
|
@@ -1027,35 +1118,35 @@ const Al = /* @__PURE__ */ V({
|
|
|
1027
1118
|
error: {}
|
|
1028
1119
|
},
|
|
1029
1120
|
setup(e) {
|
|
1030
|
-
const t = e, l =
|
|
1121
|
+
const t = e, l = c(() => {
|
|
1031
1122
|
var a;
|
|
1032
1123
|
return (((a = t.node.children) == null ? void 0 : a.length) ?? 0) > 0;
|
|
1033
1124
|
});
|
|
1034
|
-
return (a,
|
|
1035
|
-
var
|
|
1036
|
-
return
|
|
1037
|
-
class:
|
|
1038
|
-
"fm-arco-section--plain": ((
|
|
1125
|
+
return (a, n) => {
|
|
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,
|
|
1039
1130
|
"fm-arco-section--empty": !l.value
|
|
1040
1131
|
}])
|
|
1041
1132
|
}, [
|
|
1042
|
-
e.node.label || e.node.help ? (
|
|
1043
|
-
((
|
|
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), {
|
|
1044
1135
|
key: 0,
|
|
1045
1136
|
class: "fm-arco-section__icon",
|
|
1046
1137
|
size: 18,
|
|
1047
1138
|
"aria-hidden": "true"
|
|
1048
|
-
})) :
|
|
1049
|
-
|
|
1050
|
-
e.node.help ? (
|
|
1051
|
-
])) :
|
|
1052
|
-
|
|
1053
|
-
|
|
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")
|
|
1054
1145
|
])
|
|
1055
1146
|
], 2);
|
|
1056
1147
|
};
|
|
1057
1148
|
}
|
|
1058
|
-
}),
|
|
1149
|
+
}), pt = /* @__PURE__ */ k({
|
|
1059
1150
|
__name: "DividerContainer",
|
|
1060
1151
|
props: {
|
|
1061
1152
|
modelValue: {},
|
|
@@ -1069,76 +1160,99 @@ const Al = /* @__PURE__ */ V({
|
|
|
1069
1160
|
},
|
|
1070
1161
|
setup(e) {
|
|
1071
1162
|
return (t, l) => {
|
|
1072
|
-
var a,
|
|
1073
|
-
return
|
|
1163
|
+
var a, n;
|
|
1164
|
+
return p(), g(h(wl), {
|
|
1074
1165
|
orientation: ((a = e.node.props) == null ? void 0 : a.orientation) ?? "center",
|
|
1075
|
-
type: ((
|
|
1166
|
+
type: ((n = e.node.props) == null ? void 0 : n.dividerType) === "dashed" ? "dashed" : "solid"
|
|
1076
1167
|
}, {
|
|
1077
|
-
default:
|
|
1078
|
-
|
|
1168
|
+
default: F(() => [
|
|
1169
|
+
Z(B(e.node.label), 1)
|
|
1079
1170
|
]),
|
|
1080
1171
|
_: 1
|
|
1081
1172
|
}, 8, ["orientation", "type"]);
|
|
1082
1173
|
};
|
|
1083
1174
|
}
|
|
1084
|
-
})
|
|
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 = [
|
|
1085
1199
|
{ key: "placeholder", label: "占位提示", control: "text" },
|
|
1086
1200
|
{ key: "allowClear", label: "允许清空", control: "switch" },
|
|
1087
1201
|
{ key: "maxLength", label: "最大长度", control: "number", min: 1 }
|
|
1088
|
-
],
|
|
1202
|
+
], ne = [
|
|
1089
1203
|
{ key: "placeholder", label: "占位提示", control: "text" },
|
|
1090
1204
|
{ key: "allowSearch", label: "允许搜索", control: "switch" },
|
|
1091
1205
|
{ key: "allowClear", label: "允许清空", control: "switch" },
|
|
1092
1206
|
{ key: "maxTagCount", label: "最多展示标签", control: "number", min: 1 }
|
|
1093
|
-
],
|
|
1094
|
-
|
|
1207
|
+
], ft = ne.filter((e) => e.key !== "maxTagCount"), yt = [
|
|
1208
|
+
w({
|
|
1095
1209
|
type: "input",
|
|
1096
1210
|
label: "单行文本",
|
|
1097
1211
|
category: "基础字段",
|
|
1098
1212
|
kind: "field",
|
|
1099
1213
|
valueType: "string",
|
|
1100
1214
|
aliases: ["text", "text-input", "string"],
|
|
1101
|
-
widget:
|
|
1215
|
+
widget: te,
|
|
1102
1216
|
defaultLayout: { span: 12 },
|
|
1103
1217
|
defaultProps: { placeholder: "请输入" },
|
|
1104
|
-
inspector:
|
|
1218
|
+
inspector: ae
|
|
1105
1219
|
}),
|
|
1106
|
-
|
|
1220
|
+
w({
|
|
1107
1221
|
type: "textarea",
|
|
1108
1222
|
label: "多行文本",
|
|
1109
1223
|
category: "基础字段",
|
|
1110
1224
|
kind: "field",
|
|
1111
1225
|
valueType: "string",
|
|
1112
1226
|
aliases: ["text-area"],
|
|
1113
|
-
widget:
|
|
1227
|
+
widget: te,
|
|
1114
1228
|
defaultLayout: { span: 24 },
|
|
1115
1229
|
defaultProps: { placeholder: "请输入", rows: 4 },
|
|
1116
1230
|
inspector: [
|
|
1117
|
-
...
|
|
1231
|
+
...ae,
|
|
1118
1232
|
{ key: "rows", label: "行数", control: "number", min: 2, max: 20 },
|
|
1119
1233
|
{ key: "autoSize", label: "自适应高度", control: "switch" },
|
|
1120
1234
|
{ key: "showWordLimit", label: "显示字数", control: "switch" }
|
|
1121
1235
|
]
|
|
1122
1236
|
}),
|
|
1123
|
-
|
|
1237
|
+
w({
|
|
1124
1238
|
type: "password",
|
|
1125
1239
|
label: "密码输入",
|
|
1126
1240
|
category: "基础字段",
|
|
1127
1241
|
kind: "field",
|
|
1128
1242
|
valueType: "string",
|
|
1129
|
-
widget:
|
|
1243
|
+
widget: te,
|
|
1130
1244
|
defaultLayout: { span: 12 },
|
|
1131
1245
|
defaultProps: { placeholder: "请输入密码" },
|
|
1132
|
-
inspector:
|
|
1246
|
+
inspector: ae
|
|
1133
1247
|
}),
|
|
1134
|
-
|
|
1248
|
+
w({
|
|
1135
1249
|
type: "number",
|
|
1136
1250
|
label: "数字输入",
|
|
1137
1251
|
category: "基础字段",
|
|
1138
1252
|
kind: "field",
|
|
1139
1253
|
valueType: "number",
|
|
1140
1254
|
aliases: ["input-number", "inputnumber"],
|
|
1141
|
-
widget:
|
|
1255
|
+
widget: Tl,
|
|
1142
1256
|
defaultLayout: { span: 12 },
|
|
1143
1257
|
defaultProps: { placeholder: "请输入数字" },
|
|
1144
1258
|
inspector: [
|
|
@@ -1149,7 +1263,7 @@ const Al = /* @__PURE__ */ V({
|
|
|
1149
1263
|
{ key: "precision", label: "精度", control: "number", min: 0, max: 10 }
|
|
1150
1264
|
]
|
|
1151
1265
|
}),
|
|
1152
|
-
|
|
1266
|
+
w({
|
|
1153
1267
|
type: "select",
|
|
1154
1268
|
label: "下拉选择",
|
|
1155
1269
|
category: "选择字段",
|
|
@@ -1157,12 +1271,12 @@ const Al = /* @__PURE__ */ V({
|
|
|
1157
1271
|
valueType: "string",
|
|
1158
1272
|
aliases: ["dropdown"],
|
|
1159
1273
|
supportsOptions: !0,
|
|
1160
|
-
widget:
|
|
1274
|
+
widget: ge,
|
|
1161
1275
|
defaultLayout: { span: 12 },
|
|
1162
1276
|
defaultProps: { placeholder: "请选择", allowClear: !0 },
|
|
1163
|
-
inspector:
|
|
1277
|
+
inspector: ne
|
|
1164
1278
|
}),
|
|
1165
|
-
|
|
1279
|
+
w({
|
|
1166
1280
|
type: "multi-select",
|
|
1167
1281
|
label: "多选下拉",
|
|
1168
1282
|
category: "选择字段",
|
|
@@ -1170,19 +1284,19 @@ const Al = /* @__PURE__ */ V({
|
|
|
1170
1284
|
valueType: "string[]",
|
|
1171
1285
|
aliases: ["multiselect", "multiple-select", "multi"],
|
|
1172
1286
|
supportsOptions: !0,
|
|
1173
|
-
widget:
|
|
1287
|
+
widget: ge,
|
|
1174
1288
|
defaultLayout: { span: 12 },
|
|
1175
1289
|
defaultProps: { placeholder: "请选择", allowClear: !0 },
|
|
1176
|
-
inspector:
|
|
1290
|
+
inspector: ne
|
|
1177
1291
|
}),
|
|
1178
|
-
|
|
1292
|
+
w({
|
|
1179
1293
|
type: "radio",
|
|
1180
1294
|
label: "单选框",
|
|
1181
1295
|
category: "选择字段",
|
|
1182
1296
|
kind: "field",
|
|
1183
1297
|
valueType: "string",
|
|
1184
1298
|
supportsOptions: !0,
|
|
1185
|
-
widget:
|
|
1299
|
+
widget: Sl,
|
|
1186
1300
|
defaultLayout: { span: 12 },
|
|
1187
1301
|
inspector: [
|
|
1188
1302
|
{
|
|
@@ -1196,14 +1310,14 @@ const Al = /* @__PURE__ */ V({
|
|
|
1196
1310
|
}
|
|
1197
1311
|
]
|
|
1198
1312
|
}),
|
|
1199
|
-
|
|
1313
|
+
w({
|
|
1200
1314
|
type: "checkbox",
|
|
1201
1315
|
label: "复选框",
|
|
1202
1316
|
category: "选择字段",
|
|
1203
1317
|
kind: "field",
|
|
1204
1318
|
valueType: "string[]",
|
|
1205
1319
|
supportsOptions: !0,
|
|
1206
|
-
widget:
|
|
1320
|
+
widget: Bl,
|
|
1207
1321
|
defaultLayout: { span: 12 },
|
|
1208
1322
|
inspector: [
|
|
1209
1323
|
{
|
|
@@ -1217,26 +1331,26 @@ const Al = /* @__PURE__ */ V({
|
|
|
1217
1331
|
}
|
|
1218
1332
|
]
|
|
1219
1333
|
}),
|
|
1220
|
-
|
|
1334
|
+
w({
|
|
1221
1335
|
type: "switch",
|
|
1222
1336
|
label: "开关",
|
|
1223
1337
|
category: "选择字段",
|
|
1224
1338
|
kind: "field",
|
|
1225
1339
|
valueType: "boolean",
|
|
1226
|
-
widget:
|
|
1340
|
+
widget: Al,
|
|
1227
1341
|
defaultLayout: { span: 8 },
|
|
1228
1342
|
inspector: [
|
|
1229
1343
|
{ key: "checkedText", label: "开启文案", control: "text" },
|
|
1230
1344
|
{ key: "uncheckedText", label: "关闭文案", control: "text" }
|
|
1231
1345
|
]
|
|
1232
1346
|
}),
|
|
1233
|
-
|
|
1347
|
+
w({
|
|
1234
1348
|
type: "slider",
|
|
1235
1349
|
label: "滑动条",
|
|
1236
1350
|
category: "选择字段",
|
|
1237
1351
|
kind: "field",
|
|
1238
1352
|
valueType: "number",
|
|
1239
|
-
widget:
|
|
1353
|
+
widget: Fl,
|
|
1240
1354
|
defaultLayout: { span: 12 },
|
|
1241
1355
|
inspector: [
|
|
1242
1356
|
{ key: "min", label: "最小值", control: "number" },
|
|
@@ -1245,27 +1359,27 @@ const Al = /* @__PURE__ */ V({
|
|
|
1245
1359
|
{ key: "showInput", label: "显示输入框", control: "switch" }
|
|
1246
1360
|
]
|
|
1247
1361
|
}),
|
|
1248
|
-
|
|
1362
|
+
w({
|
|
1249
1363
|
type: "rate",
|
|
1250
1364
|
label: "评分",
|
|
1251
1365
|
category: "选择字段",
|
|
1252
1366
|
kind: "field",
|
|
1253
1367
|
valueType: "number",
|
|
1254
|
-
widget:
|
|
1368
|
+
widget: Il,
|
|
1255
1369
|
defaultLayout: { span: 8 },
|
|
1256
1370
|
inspector: [
|
|
1257
1371
|
{ key: "count", label: "星星数量", control: "number", min: 1, max: 10 },
|
|
1258
1372
|
{ key: "allowHalf", label: "允许半星", control: "switch" }
|
|
1259
1373
|
]
|
|
1260
1374
|
}),
|
|
1261
|
-
|
|
1375
|
+
w({
|
|
1262
1376
|
type: "date",
|
|
1263
1377
|
label: "日期",
|
|
1264
1378
|
category: "日期时间",
|
|
1265
1379
|
kind: "field",
|
|
1266
1380
|
valueType: "timestamp",
|
|
1267
1381
|
aliases: ["datepicker", "date-picker"],
|
|
1268
|
-
widget:
|
|
1382
|
+
widget: we,
|
|
1269
1383
|
defaultLayout: { span: 12 },
|
|
1270
1384
|
defaultProps: { placeholder: "请选择日期" },
|
|
1271
1385
|
inspector: [
|
|
@@ -1274,14 +1388,14 @@ const Al = /* @__PURE__ */ V({
|
|
|
1274
1388
|
{ key: "allowClear", label: "允许清空", control: "switch" }
|
|
1275
1389
|
]
|
|
1276
1390
|
}),
|
|
1277
|
-
|
|
1391
|
+
w({
|
|
1278
1392
|
type: "date-range",
|
|
1279
1393
|
label: "日期范围",
|
|
1280
1394
|
category: "日期时间",
|
|
1281
1395
|
kind: "field",
|
|
1282
1396
|
valueType: "timestamp[]",
|
|
1283
1397
|
aliases: ["daterange", "date-picker-range", "rangepicker"],
|
|
1284
|
-
widget:
|
|
1398
|
+
widget: we,
|
|
1285
1399
|
defaultLayout: { span: 12 },
|
|
1286
1400
|
defaultProps: { placeholder: ["开始日期", "结束日期"] },
|
|
1287
1401
|
inspector: [
|
|
@@ -1290,14 +1404,14 @@ const Al = /* @__PURE__ */ V({
|
|
|
1290
1404
|
{ key: "allowClear", label: "允许清空", control: "switch" }
|
|
1291
1405
|
]
|
|
1292
1406
|
}),
|
|
1293
|
-
|
|
1407
|
+
w({
|
|
1294
1408
|
type: "time",
|
|
1295
1409
|
label: "时间",
|
|
1296
1410
|
category: "日期时间",
|
|
1297
1411
|
kind: "field",
|
|
1298
1412
|
valueType: "string",
|
|
1299
1413
|
aliases: ["timepicker", "time-picker"],
|
|
1300
|
-
widget:
|
|
1414
|
+
widget: Pl,
|
|
1301
1415
|
defaultLayout: { span: 12 },
|
|
1302
1416
|
defaultProps: { placeholder: "请选择时间" },
|
|
1303
1417
|
inspector: [
|
|
@@ -1305,15 +1419,15 @@ const Al = /* @__PURE__ */ V({
|
|
|
1305
1419
|
{ key: "allowClear", label: "允许清空", control: "switch" }
|
|
1306
1420
|
]
|
|
1307
1421
|
}),
|
|
1308
|
-
|
|
1422
|
+
w({
|
|
1309
1423
|
type: "upload",
|
|
1310
1424
|
label: "文件上传",
|
|
1311
1425
|
category: "高级字段",
|
|
1312
1426
|
kind: "field",
|
|
1313
1427
|
valueType: "file[]",
|
|
1314
1428
|
aliases: ["file", "file-upload"],
|
|
1315
|
-
widget:
|
|
1316
|
-
viewWidget:
|
|
1429
|
+
widget: xe,
|
|
1430
|
+
viewWidget: xe,
|
|
1317
1431
|
defaultLayout: { span: 24 },
|
|
1318
1432
|
defaultProps: { autoUpload: !1, showFileList: !0 },
|
|
1319
1433
|
inspector: [
|
|
@@ -1326,14 +1440,14 @@ const Al = /* @__PURE__ */ V({
|
|
|
1326
1440
|
{ key: "showFileList", label: "显示文件列表", control: "switch" }
|
|
1327
1441
|
]
|
|
1328
1442
|
}),
|
|
1329
|
-
|
|
1443
|
+
w({
|
|
1330
1444
|
type: "cascader",
|
|
1331
1445
|
label: "级联选择",
|
|
1332
1446
|
category: "高级字段",
|
|
1333
1447
|
kind: "field",
|
|
1334
1448
|
valueType: "string[]",
|
|
1335
1449
|
supportsOptions: !0,
|
|
1336
|
-
widget:
|
|
1450
|
+
widget: Jl,
|
|
1337
1451
|
defaultLayout: { span: 12 },
|
|
1338
1452
|
defaultProps: { placeholder: "请选择", allowClear: !0 },
|
|
1339
1453
|
inspector: [
|
|
@@ -1343,7 +1457,7 @@ const Al = /* @__PURE__ */ V({
|
|
|
1343
1457
|
{ key: "changeOnSelect", label: "选择即变化", control: "switch" }
|
|
1344
1458
|
]
|
|
1345
1459
|
}),
|
|
1346
|
-
|
|
1460
|
+
w({
|
|
1347
1461
|
type: "tree-select",
|
|
1348
1462
|
label: "树选择",
|
|
1349
1463
|
category: "高级字段",
|
|
@@ -1351,29 +1465,29 @@ const Al = /* @__PURE__ */ V({
|
|
|
1351
1465
|
valueType: "string",
|
|
1352
1466
|
aliases: ["treeselect"],
|
|
1353
1467
|
supportsOptions: !0,
|
|
1354
|
-
widget:
|
|
1468
|
+
widget: Xl,
|
|
1355
1469
|
defaultLayout: { span: 12 },
|
|
1356
1470
|
defaultProps: { placeholder: "请选择", allowClear: !0 },
|
|
1357
|
-
inspector:
|
|
1471
|
+
inspector: ft
|
|
1358
1472
|
}),
|
|
1359
|
-
|
|
1473
|
+
w({
|
|
1360
1474
|
type: "color",
|
|
1361
1475
|
label: "颜色选择",
|
|
1362
1476
|
category: "高级字段",
|
|
1363
1477
|
kind: "field",
|
|
1364
1478
|
valueType: "string",
|
|
1365
|
-
widget:
|
|
1479
|
+
widget: _l,
|
|
1366
1480
|
defaultLayout: { span: 8 },
|
|
1367
1481
|
inspector: [{ key: "disabledAlpha", label: "禁用透明度", control: "switch" }]
|
|
1368
1482
|
}),
|
|
1369
|
-
|
|
1483
|
+
w({
|
|
1370
1484
|
type: "static-text",
|
|
1371
1485
|
label: "静态文本",
|
|
1372
1486
|
category: "展示组件",
|
|
1373
1487
|
kind: "display",
|
|
1374
1488
|
valueType: "void",
|
|
1375
1489
|
aliases: ["static", "statictext"],
|
|
1376
|
-
widget:
|
|
1490
|
+
widget: et,
|
|
1377
1491
|
defaultLayout: { span: 24, hideLabel: !0 },
|
|
1378
1492
|
defaultProps: { content: "静态文本内容", type: "default" },
|
|
1379
1493
|
inspector: [
|
|
@@ -1392,25 +1506,25 @@ const Al = /* @__PURE__ */ V({
|
|
|
1392
1506
|
}
|
|
1393
1507
|
]
|
|
1394
1508
|
}),
|
|
1395
|
-
|
|
1509
|
+
w({
|
|
1396
1510
|
type: "card",
|
|
1397
1511
|
label: "卡片容器",
|
|
1398
1512
|
category: "布局容器",
|
|
1399
1513
|
kind: "container",
|
|
1400
1514
|
isContainer: !0,
|
|
1401
1515
|
valueType: "void",
|
|
1402
|
-
widget:
|
|
1516
|
+
widget: rt,
|
|
1403
1517
|
defaultLayout: { span: 24 },
|
|
1404
1518
|
inspector: [{ key: "bordered", label: "显示边框", control: "switch" }]
|
|
1405
1519
|
}),
|
|
1406
|
-
|
|
1520
|
+
w({
|
|
1407
1521
|
type: "section",
|
|
1408
1522
|
label: "分组区块",
|
|
1409
1523
|
category: "布局容器",
|
|
1410
1524
|
kind: "container",
|
|
1411
1525
|
isContainer: !0,
|
|
1412
1526
|
valueType: "void",
|
|
1413
|
-
widget:
|
|
1527
|
+
widget: ct,
|
|
1414
1528
|
defaultLayout: { span: 24 },
|
|
1415
1529
|
defaultProps: { icon: !0, plain: !1 },
|
|
1416
1530
|
inspector: [
|
|
@@ -1418,14 +1532,14 @@ const Al = /* @__PURE__ */ V({
|
|
|
1418
1532
|
{ key: "plain", label: "无背景", control: "switch" }
|
|
1419
1533
|
]
|
|
1420
1534
|
}),
|
|
1421
|
-
|
|
1535
|
+
w({
|
|
1422
1536
|
type: "divider",
|
|
1423
1537
|
label: "分割线",
|
|
1424
1538
|
category: "布局容器",
|
|
1425
1539
|
kind: "display",
|
|
1426
1540
|
valueType: "void",
|
|
1427
1541
|
aliases: ["line"],
|
|
1428
|
-
widget:
|
|
1542
|
+
widget: pt,
|
|
1429
1543
|
defaultLayout: { span: 24, hideLabel: !0 },
|
|
1430
1544
|
defaultProps: { orientation: "center", dividerType: "solid" },
|
|
1431
1545
|
inspector: [
|
|
@@ -1450,45 +1564,90 @@ const Al = /* @__PURE__ */ V({
|
|
|
1450
1564
|
}
|
|
1451
1565
|
]
|
|
1452
1566
|
})
|
|
1453
|
-
],
|
|
1454
|
-
|
|
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 }
|
|
1455
1608
|
);
|
|
1456
|
-
function
|
|
1457
|
-
return
|
|
1609
|
+
function xt(e = {}) {
|
|
1610
|
+
return je({
|
|
1458
1611
|
name: e.name ?? "@fishbelly/form-morph-arco",
|
|
1459
|
-
version: "0.
|
|
1612
|
+
version: "0.2.0",
|
|
1460
1613
|
apiVersion: 1,
|
|
1461
1614
|
contributes: {
|
|
1462
|
-
fieldTypes:
|
|
1463
|
-
formShell:
|
|
1615
|
+
fieldTypes: kt,
|
|
1616
|
+
formShell: mt(e),
|
|
1617
|
+
locales: {
|
|
1618
|
+
"zh-CN": Se,
|
|
1619
|
+
...e.locales ?? {}
|
|
1620
|
+
}
|
|
1464
1621
|
}
|
|
1465
1622
|
});
|
|
1466
1623
|
}
|
|
1467
|
-
const
|
|
1624
|
+
const At = xt();
|
|
1468
1625
|
export {
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
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
|
|
1493
1652
|
};
|
|
1494
1653
|
//# sourceMappingURL=index.js.map
|