terminator-arco-renderer 0.0.1
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 +24 -0
- package/lib/es/base/enums/index.d.ts +4 -0
- package/lib/es/base/index.d.ts +4 -0
- package/lib/es/base/locale/cn/index.d.ts +3 -0
- package/lib/es/base/locale/en/index.d.ts +3 -0
- package/lib/es/base/locale/index.d.ts +3 -0
- package/lib/es/base/provider/index.d.ts +18 -0
- package/lib/es/fragments/button/index.d.ts +11 -0
- package/lib/es/fragments/dialog/index.d.ts +11 -0
- package/lib/es/fragments/form/index.d.ts +19 -0
- package/lib/es/fragments/input/index.d.ts +5 -0
- package/lib/es/fragments/message/index.d.ts +8 -0
- package/lib/es/fragments/page/index.d.ts +9 -0
- package/lib/es/fragments/tab/index.d.ts +16 -0
- package/lib/es/fragments/table/index.d.ts +23 -0
- package/lib/es/hooks/index.d.ts +1 -0
- package/lib/es/hooks/use-locale-hooks.d.ts +1 -0
- package/lib/es/icon/required.d.ts +1 -0
- package/lib/es/index.d.ts +13 -0
- package/lib/es/types/index.d.ts +40 -0
- package/lib/lugia-arco.css +10591 -0
- package/lib/lugia-arco.mjs +1058 -0
- package/lib/lugia-arco.umd.js +1058 -0
- package/package.json +52 -0
|
@@ -0,0 +1,1058 @@
|
|
|
1
|
+
(function(global, factory) {
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("@fatewa/lugia-next"), require("@arco-design/web-vue"), require("lodash-es")) : typeof define === "function" && define.amd ? define(["exports", "vue", "@fatewa/lugia-next", "@arco-design/web-vue", "lodash-es"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.LugiaArco = {}, global.Vue, global["lugia-next"], global.ArcoVue, global.lodash));
|
|
3
|
+
})(this, function(exports2, vue, lugiaNext, webVue, lodashEs) {
|
|
4
|
+
"use strict";var __defProp = Object.defineProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => {
|
|
7
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
+
return value;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const index$n = "";
|
|
12
|
+
const index$m = "";
|
|
13
|
+
const index$l = "";
|
|
14
|
+
const index$k = "";
|
|
15
|
+
const index$j = "";
|
|
16
|
+
const index$i = "";
|
|
17
|
+
const index$h = "";
|
|
18
|
+
const index$g = "";
|
|
19
|
+
const index$f = "";
|
|
20
|
+
const index$e = "";
|
|
21
|
+
const index$d = "";
|
|
22
|
+
const index$c = "";
|
|
23
|
+
const index$b = "";
|
|
24
|
+
const index$a = "";
|
|
25
|
+
const index$9 = "";
|
|
26
|
+
const index$8 = "";
|
|
27
|
+
const index$7 = "";
|
|
28
|
+
const index$6 = "";
|
|
29
|
+
const index$5 = "";
|
|
30
|
+
function _isSlot$1(s) {
|
|
31
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
|
32
|
+
}
|
|
33
|
+
const STATUS_MAPPER = {
|
|
34
|
+
danger: "danger",
|
|
35
|
+
primary: "normal",
|
|
36
|
+
success: "success",
|
|
37
|
+
warn: "warning"
|
|
38
|
+
};
|
|
39
|
+
const SIZE_MAPPER = {
|
|
40
|
+
tiny: "mini",
|
|
41
|
+
small: "small",
|
|
42
|
+
medium: "medium",
|
|
43
|
+
big: "large",
|
|
44
|
+
large: "large"
|
|
45
|
+
};
|
|
46
|
+
class ArcoButtonRenderer {
|
|
47
|
+
render(title, type, callback, property) {
|
|
48
|
+
const size = (property == null ? void 0 : property.size) ?? "small";
|
|
49
|
+
return vue.createVNode(webVue.Button, {
|
|
50
|
+
"type": "outline",
|
|
51
|
+
"status": STATUS_MAPPER[type] ?? "normal",
|
|
52
|
+
"size": SIZE_MAPPER[size],
|
|
53
|
+
"onClick": (e) => callback && callback(e)
|
|
54
|
+
}, _isSlot$1(title) ? title : {
|
|
55
|
+
default: () => [title]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const calendarLang$1 = {
|
|
60
|
+
formatYear: "YYYY 年",
|
|
61
|
+
formatMonth: "YYYY 年 MM 月",
|
|
62
|
+
today: "今天",
|
|
63
|
+
view: {
|
|
64
|
+
month: "月",
|
|
65
|
+
year: "年",
|
|
66
|
+
week: "周",
|
|
67
|
+
day: "日"
|
|
68
|
+
},
|
|
69
|
+
month: {
|
|
70
|
+
long: {
|
|
71
|
+
January: "一月",
|
|
72
|
+
February: "二月",
|
|
73
|
+
March: "三月",
|
|
74
|
+
April: "四月",
|
|
75
|
+
May: "五月",
|
|
76
|
+
June: "六月",
|
|
77
|
+
July: "七月",
|
|
78
|
+
August: "八月",
|
|
79
|
+
September: "九月",
|
|
80
|
+
October: "十月",
|
|
81
|
+
November: "十一月",
|
|
82
|
+
December: "十二月"
|
|
83
|
+
},
|
|
84
|
+
short: {
|
|
85
|
+
January: "一月",
|
|
86
|
+
February: "二月",
|
|
87
|
+
March: "三月",
|
|
88
|
+
April: "四月",
|
|
89
|
+
May: "五月",
|
|
90
|
+
June: "六月",
|
|
91
|
+
July: "七月",
|
|
92
|
+
August: "八月",
|
|
93
|
+
September: "九月",
|
|
94
|
+
October: "十月",
|
|
95
|
+
November: "十一月",
|
|
96
|
+
December: "十二月"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
week: {
|
|
100
|
+
long: {
|
|
101
|
+
self: "周",
|
|
102
|
+
monday: "周一",
|
|
103
|
+
tuesday: "周二",
|
|
104
|
+
wednesday: "周三",
|
|
105
|
+
thursday: "周四",
|
|
106
|
+
friday: "周五",
|
|
107
|
+
saturday: "周六",
|
|
108
|
+
sunday: "周日"
|
|
109
|
+
},
|
|
110
|
+
short: {
|
|
111
|
+
self: "周",
|
|
112
|
+
monday: "一",
|
|
113
|
+
tuesday: "二",
|
|
114
|
+
wednesday: "三",
|
|
115
|
+
thursday: "四",
|
|
116
|
+
friday: "五",
|
|
117
|
+
saturday: "六",
|
|
118
|
+
sunday: "日"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const lang$1 = {
|
|
123
|
+
locale: "zh-CN",
|
|
124
|
+
empty: {
|
|
125
|
+
description: "暂无数据"
|
|
126
|
+
},
|
|
127
|
+
drawer: {
|
|
128
|
+
okText: "确定",
|
|
129
|
+
cancelText: "取消"
|
|
130
|
+
},
|
|
131
|
+
popconfirm: {
|
|
132
|
+
okText: "确定",
|
|
133
|
+
cancelText: "取消"
|
|
134
|
+
},
|
|
135
|
+
modal: {
|
|
136
|
+
okText: "确定",
|
|
137
|
+
cancelText: "取消"
|
|
138
|
+
},
|
|
139
|
+
pagination: {
|
|
140
|
+
goto: "前往",
|
|
141
|
+
page: "页",
|
|
142
|
+
countPerPage: "条/页",
|
|
143
|
+
total: "共 {0} 条"
|
|
144
|
+
},
|
|
145
|
+
table: {
|
|
146
|
+
okText: "确定",
|
|
147
|
+
resetText: "重置"
|
|
148
|
+
},
|
|
149
|
+
upload: {
|
|
150
|
+
start: "开始",
|
|
151
|
+
cancel: "取消",
|
|
152
|
+
delete: "删除",
|
|
153
|
+
retry: "点击重试",
|
|
154
|
+
buttonText: "点击上传",
|
|
155
|
+
preview: "预览",
|
|
156
|
+
drag: "点击或拖拽文件到此处上传",
|
|
157
|
+
dragHover: "释放文件并开始上传",
|
|
158
|
+
error: "上传失败"
|
|
159
|
+
},
|
|
160
|
+
calendar: calendarLang$1,
|
|
161
|
+
datePicker: {
|
|
162
|
+
view: calendarLang$1.view,
|
|
163
|
+
month: calendarLang$1.month,
|
|
164
|
+
week: calendarLang$1.week,
|
|
165
|
+
placeholder: {
|
|
166
|
+
date: "请选择日期",
|
|
167
|
+
week: "请选择周",
|
|
168
|
+
month: "请选择月份",
|
|
169
|
+
year: "请选择年份",
|
|
170
|
+
quarter: "请选择季度",
|
|
171
|
+
time: "请选择时间"
|
|
172
|
+
},
|
|
173
|
+
rangePlaceholder: {
|
|
174
|
+
date: ["开始日期", "结束日期"],
|
|
175
|
+
week: ["开始周", "结束周"],
|
|
176
|
+
month: ["开始月份", "结束月份"],
|
|
177
|
+
year: ["开始年份", "结束年份"],
|
|
178
|
+
quarter: ["开始季度", "结束季度"],
|
|
179
|
+
time: ["开始时间", "结束时间"]
|
|
180
|
+
},
|
|
181
|
+
selectTime: "选择时间",
|
|
182
|
+
today: "今天",
|
|
183
|
+
now: "此刻",
|
|
184
|
+
ok: "确定"
|
|
185
|
+
},
|
|
186
|
+
image: {
|
|
187
|
+
loading: "加载中"
|
|
188
|
+
},
|
|
189
|
+
imagePreview: {
|
|
190
|
+
fullScreen: "全屏",
|
|
191
|
+
rotateRight: "向右旋转",
|
|
192
|
+
rotateLeft: "向左旋转",
|
|
193
|
+
zoomIn: "放大",
|
|
194
|
+
zoomOut: "缩小",
|
|
195
|
+
originalSize: "原始尺寸"
|
|
196
|
+
},
|
|
197
|
+
typography: {
|
|
198
|
+
copied: "已复制",
|
|
199
|
+
copy: "复制",
|
|
200
|
+
expand: "展开",
|
|
201
|
+
collapse: "折叠",
|
|
202
|
+
edit: "编辑"
|
|
203
|
+
},
|
|
204
|
+
form: {
|
|
205
|
+
validateMessages: {
|
|
206
|
+
required: "#{field} 是必填项",
|
|
207
|
+
type: {
|
|
208
|
+
string: "#{field} 不是合法的文本类型",
|
|
209
|
+
number: "#{field} 不是合法的数字类型",
|
|
210
|
+
boolean: "#{field} 不是合法的布尔类型",
|
|
211
|
+
array: "#{field} 不是合法的数组类型",
|
|
212
|
+
object: "#{field} 不是合法的对象类型",
|
|
213
|
+
url: "#{field} 不是合法的 url 地址",
|
|
214
|
+
email: "#{field} 不是合法的邮箱地址",
|
|
215
|
+
ip: "#{field} 不是合法的 IP 地址"
|
|
216
|
+
},
|
|
217
|
+
number: {
|
|
218
|
+
min: "`#{value}` 小于最小值 `#{min}`",
|
|
219
|
+
max: "`#{value}` 大于最大值 `#{max}`",
|
|
220
|
+
equal: "`#{value}` 不等于 `#{equal}`",
|
|
221
|
+
range: "`#{value}` 不在 `#{min} ~ #{max}` 范围内",
|
|
222
|
+
positive: "`#{value}` 不是正数",
|
|
223
|
+
negative: "`#{value}` 不是负数"
|
|
224
|
+
},
|
|
225
|
+
array: {
|
|
226
|
+
length: "`#{field}` 个数不等于 #{length}",
|
|
227
|
+
minLength: "`#{field}` 个数最少为 #{minLength}",
|
|
228
|
+
maxLength: "`#{field}` 个数最多为 #{maxLength}",
|
|
229
|
+
includes: "#{field} 不包含 #{includes}",
|
|
230
|
+
deepEqual: "#{field} 不等于 #{deepEqual}",
|
|
231
|
+
empty: "`#{field}` 不是空数组"
|
|
232
|
+
},
|
|
233
|
+
string: {
|
|
234
|
+
minLength: "字符数最少为 #{minLength}",
|
|
235
|
+
maxLength: "字符数最多为 #{maxLength}",
|
|
236
|
+
length: "字符数必须是 #{length}",
|
|
237
|
+
match: "`#{value}` 不符合模式 #{pattern}",
|
|
238
|
+
uppercase: "`#{value}` 必须全大写",
|
|
239
|
+
lowercase: "`#{value}` 必须全小写"
|
|
240
|
+
},
|
|
241
|
+
object: {
|
|
242
|
+
deepEqual: "`#{field}` 不等于期望值",
|
|
243
|
+
hasKeys: "`#{field}` 不包含必须字段",
|
|
244
|
+
empty: "`#{field}` 不是对象"
|
|
245
|
+
},
|
|
246
|
+
boolean: {
|
|
247
|
+
true: "期望是 `true`",
|
|
248
|
+
false: "期望是 `false`"
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
colorPicker: {
|
|
253
|
+
history: "最近使用颜色",
|
|
254
|
+
preset: "系统预设颜色",
|
|
255
|
+
empty: "暂无"
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
const cn = {
|
|
259
|
+
arcoDialog: {
|
|
260
|
+
submit: "确认",
|
|
261
|
+
cancel: "取消"
|
|
262
|
+
},
|
|
263
|
+
arcoForm: {
|
|
264
|
+
placeholderPrefix: "请输入"
|
|
265
|
+
},
|
|
266
|
+
arcoTab: {
|
|
267
|
+
default: "默认"
|
|
268
|
+
},
|
|
269
|
+
arcoTable: {
|
|
270
|
+
deleteConfirm: {
|
|
271
|
+
content: "是否确认要删除?",
|
|
272
|
+
okText: "确认",
|
|
273
|
+
cancelText: "取消"
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
...lang$1
|
|
277
|
+
};
|
|
278
|
+
var opt = Object.prototype.toString;
|
|
279
|
+
function isArray(obj) {
|
|
280
|
+
return opt.call(obj) === "[object Array]";
|
|
281
|
+
}
|
|
282
|
+
function isObject(obj) {
|
|
283
|
+
return opt.call(obj) === "[object Object]";
|
|
284
|
+
}
|
|
285
|
+
function isString(obj) {
|
|
286
|
+
return opt.call(obj) === "[object String]";
|
|
287
|
+
}
|
|
288
|
+
function isFunction(obj) {
|
|
289
|
+
return opt.call(obj) === "[object Function]";
|
|
290
|
+
}
|
|
291
|
+
function isEmptyValue(obj) {
|
|
292
|
+
return obj === void 0 || obj === null || obj === "";
|
|
293
|
+
}
|
|
294
|
+
function isEmptyArray(obj) {
|
|
295
|
+
return isArray(obj) && !obj.length;
|
|
296
|
+
}
|
|
297
|
+
var mergeTemplate = function(defaultValidateMessages, validateMessages) {
|
|
298
|
+
var result = Object.assign({}, defaultValidateMessages);
|
|
299
|
+
Object.keys(validateMessages || {}).forEach(function(key) {
|
|
300
|
+
var defaultValue = result[key];
|
|
301
|
+
var newValue = validateMessages === null || validateMessages === void 0 ? void 0 : validateMessages[key];
|
|
302
|
+
result[key] = isObject(defaultValue) ? Object.assign(Object.assign({}, defaultValue), newValue) : newValue || defaultValue;
|
|
303
|
+
});
|
|
304
|
+
return result;
|
|
305
|
+
};
|
|
306
|
+
var getTemplate = function(validateMessages, keyPath) {
|
|
307
|
+
var keys = keyPath.split(".");
|
|
308
|
+
var result = validateMessages;
|
|
309
|
+
for (var i = 0; i < keys.length; i++) {
|
|
310
|
+
result = result && result[keys[i]];
|
|
311
|
+
if (result === void 0) {
|
|
312
|
+
return result;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return result;
|
|
316
|
+
};
|
|
317
|
+
var defaultTypeTemplate = "#{field} is not a #{type} type";
|
|
318
|
+
var defaultValidateLocale = {
|
|
319
|
+
required: "#{field} is required",
|
|
320
|
+
type: {
|
|
321
|
+
ip: defaultTypeTemplate,
|
|
322
|
+
email: defaultTypeTemplate,
|
|
323
|
+
url: defaultTypeTemplate,
|
|
324
|
+
string: defaultTypeTemplate,
|
|
325
|
+
number: defaultTypeTemplate,
|
|
326
|
+
array: defaultTypeTemplate,
|
|
327
|
+
object: defaultTypeTemplate,
|
|
328
|
+
boolean: defaultTypeTemplate
|
|
329
|
+
},
|
|
330
|
+
number: {
|
|
331
|
+
min: "`#{value}` is not greater than `#{min}`",
|
|
332
|
+
max: "`#{value}` is not less than `#{max}`",
|
|
333
|
+
equal: "`#{value}` is not equal to `#{equal}`",
|
|
334
|
+
range: "`#{value}` is not in range `#{min} ~ #{max}`",
|
|
335
|
+
positive: "`#{value}` is not a positive number",
|
|
336
|
+
negative: "`#{value}` is not a negative number"
|
|
337
|
+
},
|
|
338
|
+
string: {
|
|
339
|
+
maxLength: "#{field} cannot be longer than #{maxLength} characters",
|
|
340
|
+
minLength: "#{field} must be at least #{minLength} characters",
|
|
341
|
+
length: "#{field} must be exactly #{length} characters",
|
|
342
|
+
match: "`#{value}` does not match pattern #{pattern}",
|
|
343
|
+
uppercase: "`#{value}` must be all uppercase",
|
|
344
|
+
lowercase: "`#{value}` must be all lowercased"
|
|
345
|
+
},
|
|
346
|
+
array: {
|
|
347
|
+
length: "#{field} must be exactly #{length} in length",
|
|
348
|
+
minLength: "#{field} cannot be less than #{minLength} in length",
|
|
349
|
+
maxLength: "#{field} cannot be greater than #{maxLength} in length",
|
|
350
|
+
includes: "#{field} is not includes #{includes}",
|
|
351
|
+
deepEqual: "#{field} is not deep equal with #{deepEqual}",
|
|
352
|
+
empty: "#{field} is not an empty array"
|
|
353
|
+
},
|
|
354
|
+
object: {
|
|
355
|
+
deepEqual: "#{field} is not deep equal to expected value",
|
|
356
|
+
hasKeys: "#{field} does not contain required fields",
|
|
357
|
+
empty: "#{field} is not an empty object"
|
|
358
|
+
},
|
|
359
|
+
boolean: {
|
|
360
|
+
true: "Expect true but got `#{value}`",
|
|
361
|
+
false: "Expect false but got `#{value}`"
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
var Base = function Base2(obj, options) {
|
|
365
|
+
var this$1$1 = this;
|
|
366
|
+
this.getValidateMsg = function(keyPath, info) {
|
|
367
|
+
if (info === void 0)
|
|
368
|
+
info = {};
|
|
369
|
+
var data = Object.assign(Object.assign({}, info), { value: this$1$1.obj, field: this$1$1.field, type: this$1$1.type });
|
|
370
|
+
var template = getTemplate(this$1$1.validateMessages, keyPath);
|
|
371
|
+
if (isFunction(template)) {
|
|
372
|
+
return template(data);
|
|
373
|
+
}
|
|
374
|
+
if (isString(template)) {
|
|
375
|
+
return template.replace(/\#\{.+?\}/g, function(variable) {
|
|
376
|
+
var key = variable.slice(2, -1);
|
|
377
|
+
if (key in data) {
|
|
378
|
+
if (isObject(data[key]) || isArray(data[key])) {
|
|
379
|
+
try {
|
|
380
|
+
return JSON.stringify(data[key]);
|
|
381
|
+
} catch (_) {
|
|
382
|
+
return data[key];
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return String(data[key]);
|
|
386
|
+
}
|
|
387
|
+
return variable;
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
return template;
|
|
391
|
+
};
|
|
392
|
+
if (isObject(options) && isString(obj) && options.trim) {
|
|
393
|
+
this.obj = obj.trim();
|
|
394
|
+
} else if (isObject(options) && options.ignoreEmptyString && obj === "") {
|
|
395
|
+
this.obj = void 0;
|
|
396
|
+
} else {
|
|
397
|
+
this.obj = obj;
|
|
398
|
+
}
|
|
399
|
+
this.message = options.message;
|
|
400
|
+
this.type = options.type;
|
|
401
|
+
this.error = null;
|
|
402
|
+
this.field = options.field || options.type;
|
|
403
|
+
this.validateMessages = mergeTemplate(defaultValidateLocale, options.validateMessages);
|
|
404
|
+
};
|
|
405
|
+
var prototypeAccessors = { not: { configurable: true }, isRequired: { configurable: true }, end: { configurable: true } };
|
|
406
|
+
prototypeAccessors.not.get = function() {
|
|
407
|
+
this._not = !this._not;
|
|
408
|
+
return this;
|
|
409
|
+
};
|
|
410
|
+
prototypeAccessors.isRequired.get = function() {
|
|
411
|
+
if (isEmptyValue(this.obj) || isEmptyArray(this.obj)) {
|
|
412
|
+
var message = this.getValidateMsg("required");
|
|
413
|
+
this.error = {
|
|
414
|
+
value: this.obj,
|
|
415
|
+
type: this.type,
|
|
416
|
+
requiredError: true,
|
|
417
|
+
message: this.message || (isObject(message) ? message : (this._not ? "[NOT MODE]:" : "") + message)
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
return this;
|
|
421
|
+
};
|
|
422
|
+
prototypeAccessors.end.get = function() {
|
|
423
|
+
return this.error;
|
|
424
|
+
};
|
|
425
|
+
Base.prototype.addError = function addError(message) {
|
|
426
|
+
if (!this.error && message) {
|
|
427
|
+
this.error = {
|
|
428
|
+
value: this.obj,
|
|
429
|
+
type: this.type,
|
|
430
|
+
message: this.message || (isObject(message) ? message : (this._not ? "[NOT MODE]:" : "") + message)
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
Base.prototype.validate = function validate(expression, errorMessage) {
|
|
435
|
+
var _expression = this._not ? expression : !expression;
|
|
436
|
+
if (_expression) {
|
|
437
|
+
this.addError(errorMessage);
|
|
438
|
+
}
|
|
439
|
+
return this;
|
|
440
|
+
};
|
|
441
|
+
Base.prototype.collect = function collect(callback) {
|
|
442
|
+
callback && callback(this.error);
|
|
443
|
+
};
|
|
444
|
+
Object.defineProperties(Base.prototype, prototypeAccessors);
|
|
445
|
+
const calendarLang = {
|
|
446
|
+
formatYear: "YYYY",
|
|
447
|
+
formatMonth: "MMM YYYY",
|
|
448
|
+
today: "Today",
|
|
449
|
+
view: {
|
|
450
|
+
month: "Month",
|
|
451
|
+
year: "Year",
|
|
452
|
+
week: "Week",
|
|
453
|
+
day: "Day"
|
|
454
|
+
},
|
|
455
|
+
month: {
|
|
456
|
+
long: {
|
|
457
|
+
January: "January",
|
|
458
|
+
February: "February",
|
|
459
|
+
March: "March",
|
|
460
|
+
April: "April",
|
|
461
|
+
May: "May",
|
|
462
|
+
June: "June",
|
|
463
|
+
July: "July",
|
|
464
|
+
August: "August",
|
|
465
|
+
September: "September",
|
|
466
|
+
October: "October",
|
|
467
|
+
November: "November",
|
|
468
|
+
December: "December"
|
|
469
|
+
},
|
|
470
|
+
short: {
|
|
471
|
+
January: "Jan",
|
|
472
|
+
February: "Feb",
|
|
473
|
+
March: "Mar",
|
|
474
|
+
April: "Apr",
|
|
475
|
+
May: "May",
|
|
476
|
+
June: "Jun",
|
|
477
|
+
July: "Jul",
|
|
478
|
+
August: "Aug",
|
|
479
|
+
September: "Sept",
|
|
480
|
+
October: "Oct",
|
|
481
|
+
November: "Nov",
|
|
482
|
+
December: "Dec"
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
week: {
|
|
486
|
+
long: {
|
|
487
|
+
self: "Week",
|
|
488
|
+
monday: "Monday",
|
|
489
|
+
tuesday: "Tuesday",
|
|
490
|
+
wednesday: "Wednesday",
|
|
491
|
+
thursday: "Thursday",
|
|
492
|
+
friday: "Friday",
|
|
493
|
+
saturday: "Saturday",
|
|
494
|
+
sunday: "Sunday"
|
|
495
|
+
},
|
|
496
|
+
short: {
|
|
497
|
+
self: "Week",
|
|
498
|
+
monday: "Mon",
|
|
499
|
+
tuesday: "Tue",
|
|
500
|
+
wednesday: "Wed",
|
|
501
|
+
thursday: "Thu",
|
|
502
|
+
friday: "Fri",
|
|
503
|
+
saturday: "Sat",
|
|
504
|
+
sunday: "Sun"
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
const lang = {
|
|
509
|
+
locale: "en-US",
|
|
510
|
+
empty: {
|
|
511
|
+
description: "No Data"
|
|
512
|
+
},
|
|
513
|
+
drawer: {
|
|
514
|
+
okText: "Ok",
|
|
515
|
+
cancelText: "Cancel"
|
|
516
|
+
},
|
|
517
|
+
popconfirm: {
|
|
518
|
+
okText: "Ok",
|
|
519
|
+
cancelText: "Cancel"
|
|
520
|
+
},
|
|
521
|
+
modal: {
|
|
522
|
+
okText: "Ok",
|
|
523
|
+
cancelText: "Cancel"
|
|
524
|
+
},
|
|
525
|
+
pagination: {
|
|
526
|
+
goto: "Goto",
|
|
527
|
+
page: "Page",
|
|
528
|
+
countPerPage: " / Page",
|
|
529
|
+
total: "Total: {0}"
|
|
530
|
+
},
|
|
531
|
+
table: {
|
|
532
|
+
okText: "Ok",
|
|
533
|
+
resetText: "Reset"
|
|
534
|
+
},
|
|
535
|
+
upload: {
|
|
536
|
+
start: "Start",
|
|
537
|
+
cancel: "Cancel",
|
|
538
|
+
delete: "Delete",
|
|
539
|
+
retry: "Click to retry",
|
|
540
|
+
buttonText: "Upload",
|
|
541
|
+
preview: "Preview",
|
|
542
|
+
drag: "Click or drag file to this area to upload",
|
|
543
|
+
dragHover: "Release to upload",
|
|
544
|
+
error: "Upload Error"
|
|
545
|
+
},
|
|
546
|
+
calendar: calendarLang,
|
|
547
|
+
datePicker: {
|
|
548
|
+
view: calendarLang.view,
|
|
549
|
+
month: calendarLang.month,
|
|
550
|
+
week: calendarLang.week,
|
|
551
|
+
placeholder: {
|
|
552
|
+
date: "Please select date",
|
|
553
|
+
week: "Please select week",
|
|
554
|
+
month: "Please select month",
|
|
555
|
+
year: "Please select year",
|
|
556
|
+
quarter: "Please select quarter",
|
|
557
|
+
time: "Please select time"
|
|
558
|
+
},
|
|
559
|
+
rangePlaceholder: {
|
|
560
|
+
date: ["Start date", "End date"],
|
|
561
|
+
week: ["Start week", "End week"],
|
|
562
|
+
month: ["Start month", "End month"],
|
|
563
|
+
year: ["Start year", "End year"],
|
|
564
|
+
quarter: ["Start quarter", "End quarter"],
|
|
565
|
+
time: ["Start time", "End time"]
|
|
566
|
+
},
|
|
567
|
+
selectTime: "Select time",
|
|
568
|
+
today: "Today",
|
|
569
|
+
now: "Now",
|
|
570
|
+
ok: "Ok"
|
|
571
|
+
},
|
|
572
|
+
image: {
|
|
573
|
+
loading: "loading"
|
|
574
|
+
},
|
|
575
|
+
imagePreview: {
|
|
576
|
+
fullScreen: "Full Screen",
|
|
577
|
+
rotateRight: "Rotate Right",
|
|
578
|
+
rotateLeft: "Rotate Left",
|
|
579
|
+
zoomIn: "Zoom In",
|
|
580
|
+
zoomOut: "Zoom Out",
|
|
581
|
+
originalSize: "Original Size"
|
|
582
|
+
},
|
|
583
|
+
typography: {
|
|
584
|
+
copied: "Copied",
|
|
585
|
+
copy: "Copy",
|
|
586
|
+
expand: "Expand",
|
|
587
|
+
collapse: "Collapse",
|
|
588
|
+
edit: "Edit"
|
|
589
|
+
},
|
|
590
|
+
form: {
|
|
591
|
+
validateMessages: defaultValidateLocale
|
|
592
|
+
},
|
|
593
|
+
colorPicker: {
|
|
594
|
+
history: "History Colors",
|
|
595
|
+
preset: "Preset Colors",
|
|
596
|
+
empty: "Empty"
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
const en = {
|
|
600
|
+
arcoDialog: {
|
|
601
|
+
submit: "Ok",
|
|
602
|
+
cancel: "Cancel"
|
|
603
|
+
},
|
|
604
|
+
arcoForm: {
|
|
605
|
+
placeholderPrefix: "Please enter the"
|
|
606
|
+
},
|
|
607
|
+
arcoTab: {
|
|
608
|
+
default: "Default"
|
|
609
|
+
},
|
|
610
|
+
arcoTable: {
|
|
611
|
+
deleteConfirm: {
|
|
612
|
+
content: "Want to delete?",
|
|
613
|
+
okText: "Ok",
|
|
614
|
+
cancelText: "Cancel"
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
...lang
|
|
618
|
+
};
|
|
619
|
+
const locale = {
|
|
620
|
+
en,
|
|
621
|
+
cn
|
|
622
|
+
};
|
|
623
|
+
var ArcoProviderKeyEnum = /* @__PURE__ */ ((ArcoProviderKeyEnum2) => {
|
|
624
|
+
ArcoProviderKeyEnum2["LOCALE"] = "locale";
|
|
625
|
+
ArcoProviderKeyEnum2["LOCALE_CONFIG"] = "locale_config";
|
|
626
|
+
return ArcoProviderKeyEnum2;
|
|
627
|
+
})(ArcoProviderKeyEnum || {});
|
|
628
|
+
const arcoConfigMap = /* @__PURE__ */ new Map();
|
|
629
|
+
function initArcoConfig() {
|
|
630
|
+
arcoConfigMap.set(ArcoProviderKeyEnum.LOCALE, "cn");
|
|
631
|
+
}
|
|
632
|
+
function arcoProvider(config) {
|
|
633
|
+
if (config.locale) {
|
|
634
|
+
arcoConfigMap.set(ArcoProviderKeyEnum.LOCALE, config.locale);
|
|
635
|
+
}
|
|
636
|
+
if (config.localeConfig) {
|
|
637
|
+
arcoConfigMap.set(ArcoProviderKeyEnum.LOCALE_CONFIG, config.localeConfig);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
function getArcoProviderByKey(key) {
|
|
641
|
+
return arcoConfigMap.get(key);
|
|
642
|
+
}
|
|
643
|
+
function useLocaleHooks() {
|
|
644
|
+
const localeLang = getArcoProviderByKey(ArcoProviderKeyEnum.LOCALE);
|
|
645
|
+
const localeConfig = getArcoProviderByKey(ArcoProviderKeyEnum.LOCALE_CONFIG);
|
|
646
|
+
if (!localeConfig || localeConfig && !localeConfig[localeLang]) {
|
|
647
|
+
if (!locale[localeLang]) {
|
|
648
|
+
return locale.cn;
|
|
649
|
+
}
|
|
650
|
+
return locale[localeLang];
|
|
651
|
+
}
|
|
652
|
+
if (localeLang === "en" || localeLang === "cn") {
|
|
653
|
+
return lodashEs.merge({}, locale[localeLang], localeConfig[localeLang]);
|
|
654
|
+
}
|
|
655
|
+
return lodashEs.merge({}, locale.cn, localeConfig[localeLang]);
|
|
656
|
+
}
|
|
657
|
+
class ArcoTableRenderer {
|
|
658
|
+
constructor() {
|
|
659
|
+
__publicField(this, "buttonRenderer", new ArcoButtonRenderer());
|
|
660
|
+
}
|
|
661
|
+
render(templates, features, lang2, data, callback, emit) {
|
|
662
|
+
const locale2 = useLocaleHooks();
|
|
663
|
+
const columns = this._getColumns(templates, features, lang2, callback, emit, locale2);
|
|
664
|
+
const loading = vue.inject("lugia_loading");
|
|
665
|
+
return vue.createVNode(webVue.ConfigProvider, {
|
|
666
|
+
"locale": locale2
|
|
667
|
+
}, {
|
|
668
|
+
default: () => [vue.createVNode(webVue.Table, vue.mergeProps(features.table, {
|
|
669
|
+
"loading": loading.value,
|
|
670
|
+
"pagination": false,
|
|
671
|
+
"columns": columns,
|
|
672
|
+
"data": data
|
|
673
|
+
}), null)]
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* 数据处理 返回表头数据
|
|
678
|
+
* @param templates
|
|
679
|
+
* @param features
|
|
680
|
+
* @param lang
|
|
681
|
+
* @param callback
|
|
682
|
+
* @param emit
|
|
683
|
+
* @param locale
|
|
684
|
+
* @private
|
|
685
|
+
*/
|
|
686
|
+
_getColumns(templates, features, lang2, callback, emit, locale2) {
|
|
687
|
+
var _a;
|
|
688
|
+
const getColumnOptions = (head) => {
|
|
689
|
+
if (!head)
|
|
690
|
+
return {};
|
|
691
|
+
if (typeof head === "string") {
|
|
692
|
+
return {
|
|
693
|
+
fixed: head
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
const obj = {};
|
|
697
|
+
if (head.width)
|
|
698
|
+
obj.width = head.width;
|
|
699
|
+
if (head.direction)
|
|
700
|
+
obj.fixed = head.direction;
|
|
701
|
+
return obj;
|
|
702
|
+
};
|
|
703
|
+
const columns = templates.map((head) => {
|
|
704
|
+
const options = getColumnOptions(head.fixed);
|
|
705
|
+
const key = lugiaNext.getTemplateRowKey(head, "query");
|
|
706
|
+
return {
|
|
707
|
+
title: head.title,
|
|
708
|
+
dataIndex: key,
|
|
709
|
+
...options,
|
|
710
|
+
render: ({
|
|
711
|
+
record
|
|
712
|
+
}) => {
|
|
713
|
+
var _a2, _b;
|
|
714
|
+
if ((_a2 = head.renderer) == null ? void 0 : _a2.query) {
|
|
715
|
+
try {
|
|
716
|
+
const node = vue.createVNode("span", null, [(_b = head.renderer) == null ? void 0 : _b.query({
|
|
717
|
+
key,
|
|
718
|
+
state: record,
|
|
719
|
+
mode: "query",
|
|
720
|
+
emit
|
|
721
|
+
})]);
|
|
722
|
+
if (node) {
|
|
723
|
+
return node;
|
|
724
|
+
}
|
|
725
|
+
} catch (e) {
|
|
726
|
+
console.error(e);
|
|
727
|
+
return vue.createVNode("span", null, [vue.createTextVNode("-")]);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
if (key) {
|
|
731
|
+
return vue.createVNode("span", null, [record[key]]);
|
|
732
|
+
}
|
|
733
|
+
return vue.createVNode(vue.Fragment, null, [vue.createTextVNode("-")]);
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
});
|
|
737
|
+
if (features.update !== false || features.delete !== false) {
|
|
738
|
+
const options = getColumnOptions((_a = features == null ? void 0 : features.action) == null ? void 0 : _a.fixed);
|
|
739
|
+
columns.push({
|
|
740
|
+
title: lang2.operation,
|
|
741
|
+
...options,
|
|
742
|
+
render: ({
|
|
743
|
+
record
|
|
744
|
+
}) => {
|
|
745
|
+
var _a2, _b, _c;
|
|
746
|
+
return vue.createVNode(vue.Fragment, null, [vue.createVNode("span", {
|
|
747
|
+
"style": {
|
|
748
|
+
marginRight: ".5rem"
|
|
749
|
+
}
|
|
750
|
+
}, [features.update !== false ? this.buttonRenderer.render(lang2.update, "primary", () => callback && callback.update(record), {
|
|
751
|
+
size: "tiny"
|
|
752
|
+
}) : ""]), features.delete !== false ? vue.createVNode(webVue.Popconfirm, {
|
|
753
|
+
"content": (_a2 = locale2.arcoTable) == null ? void 0 : _a2.deleteConfirm.content,
|
|
754
|
+
"type": "error",
|
|
755
|
+
"okText": (_b = locale2.arcoTable) == null ? void 0 : _b.deleteConfirm.okText,
|
|
756
|
+
"cancelText": (_c = locale2.arcoTable) == null ? void 0 : _c.deleteConfirm.cancelText,
|
|
757
|
+
"onOk": () => callback && callback.delete(record)
|
|
758
|
+
}, {
|
|
759
|
+
default: () => {
|
|
760
|
+
return this.buttonRenderer.render(lang2.delete, "danger", () => ({}), {
|
|
761
|
+
size: "tiny"
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
}) : null]);
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
}
|
|
768
|
+
return columns;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
const index$4 = "";
|
|
772
|
+
function _isSlot(s) {
|
|
773
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
|
774
|
+
}
|
|
775
|
+
class ArcoTabRenderer {
|
|
776
|
+
render(slots, state) {
|
|
777
|
+
let _slot;
|
|
778
|
+
const locale2 = useLocaleHooks();
|
|
779
|
+
return vue.createVNode(vue.Fragment, null, [slots.length === 1 ? vue.createVNode(vue.Fragment, null, [slots.map((slot) => {
|
|
780
|
+
return vue.createVNode("div", null, [slot.node]);
|
|
781
|
+
})]) : vue.createVNode(webVue.Tabs, {
|
|
782
|
+
"lazyLoad": true,
|
|
783
|
+
"onTabClick": (key) => {
|
|
784
|
+
state.activeTabIndex = key;
|
|
785
|
+
},
|
|
786
|
+
"activeKey": state.activeTabIndex,
|
|
787
|
+
"onUpdate:activeKey": ($event) => state.activeTabIndex = $event
|
|
788
|
+
}, _isSlot(_slot = slots.map((slot, index2) => {
|
|
789
|
+
var _a;
|
|
790
|
+
return vue.createVNode(webVue.TabPane, {
|
|
791
|
+
"title": slot.name !== "default" ? slot.name : (_a = locale2.arcoTab) == null ? void 0 : _a.default,
|
|
792
|
+
"key": index2
|
|
793
|
+
}, {
|
|
794
|
+
default: () => [slot.node]
|
|
795
|
+
});
|
|
796
|
+
})) ? _slot : {
|
|
797
|
+
default: () => [_slot]
|
|
798
|
+
})]);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
class ArcoPageRenderer {
|
|
802
|
+
render(remotePagination) {
|
|
803
|
+
const locale2 = useLocaleHooks();
|
|
804
|
+
return vue.createVNode(webVue.ConfigProvider, {
|
|
805
|
+
"locale": locale2
|
|
806
|
+
}, {
|
|
807
|
+
default: () => [vue.createVNode(webVue.Pagination, {
|
|
808
|
+
"total": remotePagination.total,
|
|
809
|
+
"current": remotePagination.current,
|
|
810
|
+
"onUpdate:current": ($event) => remotePagination.current = $event,
|
|
811
|
+
"pageSize": remotePagination.size,
|
|
812
|
+
"onUpdate:pageSize": ($event) => remotePagination.size = $event,
|
|
813
|
+
"showPageSize": true,
|
|
814
|
+
"showTotal": true
|
|
815
|
+
}, null)]
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
const index$3 = "";
|
|
820
|
+
class ArcoDialogRenderer {
|
|
821
|
+
constructor() {
|
|
822
|
+
__publicField(this, "buttonRenderer", new ArcoButtonRenderer());
|
|
823
|
+
}
|
|
824
|
+
render(title, slot, state, context) {
|
|
825
|
+
const locale2 = useLocaleHooks();
|
|
826
|
+
return vue.createVNode(vue.Fragment, null, [state.visible ? vue.createVNode(webVue.Modal, {
|
|
827
|
+
"class": "lugia-arco-dialog",
|
|
828
|
+
"width": "60%",
|
|
829
|
+
"visible": state.visible,
|
|
830
|
+
"onUpdate:visible": ($event) => state.visible = $event,
|
|
831
|
+
"footer": false
|
|
832
|
+
}, {
|
|
833
|
+
default: () => [vue.createVNode("div", {
|
|
834
|
+
"style": {
|
|
835
|
+
maxHeight: "60vh",
|
|
836
|
+
overflow: "auto"
|
|
837
|
+
}
|
|
838
|
+
}, [slot]), vue.createVNode("div", {
|
|
839
|
+
"style": {
|
|
840
|
+
display: "flex",
|
|
841
|
+
marginTop: ".5rem",
|
|
842
|
+
justifyContent: "end"
|
|
843
|
+
}
|
|
844
|
+
}, [vue.createVNode(lugiaNext.LugiaButton, {
|
|
845
|
+
"style": "width: 6rem;height: 2.3rem;",
|
|
846
|
+
"renderer": this.buttonRenderer,
|
|
847
|
+
"type": "primary",
|
|
848
|
+
"onClick": () => context.$emit("submit")
|
|
849
|
+
}, {
|
|
850
|
+
default: () => {
|
|
851
|
+
var _a;
|
|
852
|
+
return [(_a = locale2.arcoDialog) == null ? void 0 : _a.submit];
|
|
853
|
+
}
|
|
854
|
+
}), vue.createVNode(lugiaNext.LugiaButton, {
|
|
855
|
+
"style": "width: 6rem;height: 2.3rem;margin-left: 0.5rem",
|
|
856
|
+
"type": "danger",
|
|
857
|
+
"renderer": this.buttonRenderer,
|
|
858
|
+
"onClick": () => context.$emit("cancel")
|
|
859
|
+
}, {
|
|
860
|
+
default: () => {
|
|
861
|
+
var _a;
|
|
862
|
+
return [(_a = locale2.arcoDialog) == null ? void 0 : _a.cancel];
|
|
863
|
+
}
|
|
864
|
+
})])],
|
|
865
|
+
title: () => vue.createVNode(vue.Fragment, null, [title])
|
|
866
|
+
}) : null]);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
const index$2 = "";
|
|
870
|
+
const index$1 = "";
|
|
871
|
+
function Required() {
|
|
872
|
+
return vue.createVNode("svg", {
|
|
873
|
+
"fill": "currentColor",
|
|
874
|
+
"viewBox": "0 0 1024 1024",
|
|
875
|
+
"width": "1em",
|
|
876
|
+
"height": "1em"
|
|
877
|
+
}, [vue.createVNode("path", {
|
|
878
|
+
"d": "M583.338667 17.066667c18.773333 0 34.133333 15.36 34.133333 34.133333v349.013333l313.344-101.888a34.133333 34.133333 0 0 1 43.008 22.016l42.154667 129.706667a34.133333 34.133333 0 0 1-21.845334 43.178667l-315.733333 102.4 208.896 287.744a34.133333 34.133333 0 0 1-7.509333 47.786666l-110.421334 80.213334a34.133333 34.133333 0 0 1-47.786666-7.509334L505.685333 706.218667 288.426667 1005.226667a34.133333 34.133333 0 0 1-47.786667 7.509333l-110.421333-80.213333a34.133333 34.133333 0 0 1-7.509334-47.786667l214.186667-295.253333L29.013333 489.813333a34.133333 34.133333 0 0 1-22.016-43.008l42.154667-129.877333a34.133333 34.133333 0 0 1 43.008-22.016l320.512 104.106667L412.672 51.2c0-18.773333 15.36-34.133333 34.133333-34.133333h136.533334z"
|
|
879
|
+
}, null)]);
|
|
880
|
+
}
|
|
881
|
+
const resolveRequire = (config, mode) => {
|
|
882
|
+
if (typeof config === "boolean") {
|
|
883
|
+
return config;
|
|
884
|
+
}
|
|
885
|
+
const opt2 = config;
|
|
886
|
+
if (opt2 && opt2[mode]) {
|
|
887
|
+
return opt2[mode];
|
|
888
|
+
}
|
|
889
|
+
return false;
|
|
890
|
+
};
|
|
891
|
+
class ArcoFormRenderer {
|
|
892
|
+
constructor() {
|
|
893
|
+
__publicField(this, "tabRenderer", new ArcoTabRenderer());
|
|
894
|
+
}
|
|
895
|
+
render(templates, mode, state) {
|
|
896
|
+
const locale2 = useLocaleHooks();
|
|
897
|
+
const tabs = lugiaNext.resolveTabs(templates);
|
|
898
|
+
const groups = [];
|
|
899
|
+
const defaultTab = tabs.default;
|
|
900
|
+
const FormContainer = vue.createVNode(webVue.Form, {
|
|
901
|
+
"model": state[mode],
|
|
902
|
+
"layout": "vertical"
|
|
903
|
+
}, null);
|
|
904
|
+
const createItem = (name, restTemplates) => ({
|
|
905
|
+
name,
|
|
906
|
+
node: lugiaNext.renderGroup(restTemplates, mode, {
|
|
907
|
+
row: new lugiaNext.DefaultRowRenderer(3),
|
|
908
|
+
formItem: (row, {
|
|
909
|
+
state: state2,
|
|
910
|
+
mode: mode2
|
|
911
|
+
}) => {
|
|
912
|
+
if (row.visible) {
|
|
913
|
+
const visible = row.visible[mode2];
|
|
914
|
+
if (visible) {
|
|
915
|
+
if (typeof visible === "function") {
|
|
916
|
+
if (!visible(state2[mode2])) {
|
|
917
|
+
return vue.createVNode("span", {
|
|
918
|
+
"class": "empty"
|
|
919
|
+
}, null);
|
|
920
|
+
}
|
|
921
|
+
} else if (!visible) {
|
|
922
|
+
return vue.createVNode("span", {
|
|
923
|
+
"class": "empty"
|
|
924
|
+
}, null);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
const key = lugiaNext.getTemplateRowKey(row, mode2);
|
|
929
|
+
let result = null;
|
|
930
|
+
try {
|
|
931
|
+
result = state2 == null ? void 0 : state2.bindingResults[key][0];
|
|
932
|
+
} catch {
|
|
933
|
+
}
|
|
934
|
+
const mapper = {
|
|
935
|
+
error: "error",
|
|
936
|
+
success: "success",
|
|
937
|
+
warn: "warning"
|
|
938
|
+
};
|
|
939
|
+
if (row.renderer) {
|
|
940
|
+
const createOrUpdate = row.renderer[mode2];
|
|
941
|
+
if (createOrUpdate) {
|
|
942
|
+
const userRenderer = ({
|
|
943
|
+
key: key2,
|
|
944
|
+
state: state3,
|
|
945
|
+
mode: mode3
|
|
946
|
+
}) => {
|
|
947
|
+
try {
|
|
948
|
+
return createOrUpdate({
|
|
949
|
+
key: key2,
|
|
950
|
+
state: state3,
|
|
951
|
+
mode: mode3
|
|
952
|
+
});
|
|
953
|
+
} catch (e) {
|
|
954
|
+
console.error(e);
|
|
955
|
+
return vue.createVNode("span", null, [vue.createTextVNode("-")]);
|
|
956
|
+
}
|
|
957
|
+
};
|
|
958
|
+
return vue.createVNode(webVue.FormItem, {
|
|
959
|
+
"validateStatus": result ? mapper[result == null ? void 0 : result.level] : "",
|
|
960
|
+
"style": "width: 100%",
|
|
961
|
+
"label": row.title,
|
|
962
|
+
"field": key,
|
|
963
|
+
"help": (result == null ? void 0 : result.level) === "error" ? result == null ? void 0 : result.msg : ""
|
|
964
|
+
}, {
|
|
965
|
+
default: () => [userRenderer({
|
|
966
|
+
key,
|
|
967
|
+
state: state2[mode2],
|
|
968
|
+
mode: mode2
|
|
969
|
+
})],
|
|
970
|
+
label: () => {
|
|
971
|
+
var _a;
|
|
972
|
+
return vue.createVNode(vue.Fragment, null, [resolveRequire(((_a = row.validate) == null ? void 0 : _a.require) ?? false, mode2) && vue.createVNode("strong", {
|
|
973
|
+
"class": "arco-form-item-label-required-symbol"
|
|
974
|
+
}, [vue.createVNode(Required, null, null)]), vue.createVNode("span", null, [row.title])]);
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
return vue.createVNode(webVue.FormItem, {
|
|
980
|
+
"validateStatus": result ? mapper[result == null ? void 0 : result.level] : "",
|
|
981
|
+
"style": "width: 100%",
|
|
982
|
+
"field": key,
|
|
983
|
+
"help": (result == null ? void 0 : result.level) === "error" ? result == null ? void 0 : result.msg : ""
|
|
984
|
+
}, {
|
|
985
|
+
default: () => {
|
|
986
|
+
var _a;
|
|
987
|
+
return [vue.createVNode(webVue.Input, {
|
|
988
|
+
"modelValue": state2[mode2][key],
|
|
989
|
+
"onUpdate:modelValue": ($event) => state2[mode2][key] = $event,
|
|
990
|
+
"placeholder": `${(_a = locale2.arcoForm) == null ? void 0 : _a.placeholderPrefix}${row.title}`
|
|
991
|
+
}, null)];
|
|
992
|
+
},
|
|
993
|
+
label: () => {
|
|
994
|
+
var _a;
|
|
995
|
+
return vue.createVNode(vue.Fragment, null, [resolveRequire(((_a = row.validate) == null ? void 0 : _a.require) ?? false, mode2) && vue.createVNode("strong", {
|
|
996
|
+
"class": "arco-form-item-label-required-symbol"
|
|
997
|
+
}, [vue.createVNode(Required, null, null)]), vue.createVNode("span", null, [row.title])]);
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
}, state, FormContainer)
|
|
1002
|
+
});
|
|
1003
|
+
if (defaultTab.length > 0) {
|
|
1004
|
+
groups.push(createItem("default", defaultTab));
|
|
1005
|
+
}
|
|
1006
|
+
for (const it in tabs) {
|
|
1007
|
+
if (tabs[it].length === 0) {
|
|
1008
|
+
continue;
|
|
1009
|
+
}
|
|
1010
|
+
if (it !== "default") {
|
|
1011
|
+
groups.push(createItem(it, tabs[it]));
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
return this.tabRenderer.render(groups, state);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
class ArcoInputRenderer {
|
|
1018
|
+
render(row, key, placeholder) {
|
|
1019
|
+
return vue.createVNode(webVue.Input, {
|
|
1020
|
+
"modelValue": row[key],
|
|
1021
|
+
"onUpdate:modelValue": ($event) => row[key] = $event,
|
|
1022
|
+
"placeholder": placeholder
|
|
1023
|
+
}, null);
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
const index = "";
|
|
1027
|
+
class ArcoMessageRenderer {
|
|
1028
|
+
render(config) {
|
|
1029
|
+
return webVue.Message[config.type](config);
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
const ArcoUIRenderer = {
|
|
1033
|
+
table: new ArcoTableRenderer(),
|
|
1034
|
+
button: new ArcoButtonRenderer(),
|
|
1035
|
+
tab: new ArcoTabRenderer(),
|
|
1036
|
+
page: new ArcoPageRenderer(),
|
|
1037
|
+
dialog: new ArcoDialogRenderer(),
|
|
1038
|
+
form: new ArcoFormRenderer(),
|
|
1039
|
+
input: new ArcoInputRenderer(),
|
|
1040
|
+
message: new ArcoMessageRenderer()
|
|
1041
|
+
};
|
|
1042
|
+
initArcoConfig();
|
|
1043
|
+
exports2.ArcoButtonRenderer = ArcoButtonRenderer;
|
|
1044
|
+
exports2.ArcoDialogRenderer = ArcoDialogRenderer;
|
|
1045
|
+
exports2.ArcoFormRenderer = ArcoFormRenderer;
|
|
1046
|
+
exports2.ArcoInputRenderer = ArcoInputRenderer;
|
|
1047
|
+
exports2.ArcoMessageRenderer = ArcoMessageRenderer;
|
|
1048
|
+
exports2.ArcoPageRenderer = ArcoPageRenderer;
|
|
1049
|
+
exports2.ArcoProviderKeyEnum = ArcoProviderKeyEnum;
|
|
1050
|
+
exports2.ArcoTabRenderer = ArcoTabRenderer;
|
|
1051
|
+
exports2.ArcoTableRenderer = ArcoTableRenderer;
|
|
1052
|
+
exports2.ArcoUIRenderer = ArcoUIRenderer;
|
|
1053
|
+
exports2.arcoProvider = arcoProvider;
|
|
1054
|
+
exports2.getArcoProviderByKey = getArcoProviderByKey;
|
|
1055
|
+
exports2.initArcoConfig = initArcoConfig;
|
|
1056
|
+
exports2.locale = locale;
|
|
1057
|
+
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
1058
|
+
});
|