@sdata/web-vue 3.27.0 → 3.29.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/dist/sd.css +5 -1
- package/dist/sd.min.css +2 -2
- package/es/_utils/grapheme.d.ts +5 -0
- package/es/_utils/grapheme.js +93 -0
- package/es/basic-crud-table/basic-crud-table.vue_vue_type_script_setup_true_lang.js +40 -25
- package/es/basic-crud-table/index.d.ts +1 -1
- package/es/basic-crud-table/types.d.ts +9 -1
- package/es/components.d.ts +1 -0
- package/es/index.css +5 -1
- package/es/index.d.ts +3 -0
- package/es/index.js +4 -1
- package/es/index.scss +1 -0
- package/es/input/input.js +5 -6
- package/es/input-mask/index.d.ts +120 -0
- package/es/input-mask/index.js +12 -0
- package/es/input-mask/input-mask.js +5 -0
- package/es/input-mask/input-mask.vue.d.ts +49 -0
- package/es/input-mask/input-mask.vue_vue_type_script_setup_true_lang.js +346 -0
- package/es/input-mask/mask-engine.d.ts +18 -0
- package/es/input-mask/mask-engine.js +176 -0
- package/es/input-mask/presets.d.ts +2 -0
- package/es/input-mask/presets.js +220 -0
- package/es/input-mask/style/css.js +1 -0
- package/es/input-mask/style/index.css +20 -0
- package/es/input-mask/style/index.d.ts +2 -0
- package/es/input-mask/style/index.js +1 -0
- package/es/input-mask/style/index.scss +10 -0
- package/es/input-mask/style/token.scss +5 -0
- package/es/input-mask/types.d.ts +49 -0
- package/es/sd-vue.js +2 -0
- package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +5 -6
- package/es/toolbar/toolbar.vue_vue_type_script_setup_true_lang.js +8 -10
- package/es/toolbar/types.d.ts +3 -0
- package/es/upload/context.d.ts +1 -0
- package/es/upload/index.d.ts +15 -0
- package/es/upload/style/index.css +1 -1
- package/es/upload/style/index.scss +1 -1
- package/es/upload/upload-picture-item.js +15 -6
- package/es/upload/upload-progress.js +17 -13
- package/es/upload/upload.d.ts +9 -0
- package/es/upload/upload.js +10 -1
- package/json/vetur-attributes.json +10 -0
- package/json/vetur-tags.json +6 -0
- package/json/web-types.json +31 -1
- package/package.json +1 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
//#region components/input-mask/presets.ts
|
|
2
|
+
var testPattern = (pattern, value) => {
|
|
3
|
+
pattern.lastIndex = 0;
|
|
4
|
+
return pattern.test(value);
|
|
5
|
+
};
|
|
6
|
+
var filterCharacters = (pattern) => (value) => Array.from(value).filter((character) => testPattern(pattern, character)).join("");
|
|
7
|
+
var acceptsIpv4 = (value) => {
|
|
8
|
+
if (!/^\d*(?:\.\d*){0,3}$/.test(value)) return false;
|
|
9
|
+
return value.split(".").every((part) => part.length <= 3 && (!part || Number(part) <= 255));
|
|
10
|
+
};
|
|
11
|
+
var acceptsIpv6 = (value) => {
|
|
12
|
+
var _value$match, _value$match2;
|
|
13
|
+
if (!/^[0-9A-Fa-f:]*$/.test(value)) return false;
|
|
14
|
+
if (value.includes(":::")) return false;
|
|
15
|
+
if (((_value$match = value.match(/::/g)) !== null && _value$match !== void 0 ? _value$match : []).length > 1) return false;
|
|
16
|
+
if (((_value$match2 = value.match(/:/g)) !== null && _value$match2 !== void 0 ? _value$match2 : []).length > 7) return false;
|
|
17
|
+
return value.split(":").every((part) => part.length <= 4);
|
|
18
|
+
};
|
|
19
|
+
var formatDateTimeDigits = (digits, dateTimeSeparator) => {
|
|
20
|
+
const value = digits.slice(0, 14);
|
|
21
|
+
let result = value.slice(0, 4);
|
|
22
|
+
if (value.length >= 4) result += "-";
|
|
23
|
+
result += value.slice(4, 6);
|
|
24
|
+
if (value.length >= 6) result += "-";
|
|
25
|
+
result += value.slice(6, 8);
|
|
26
|
+
if (value.length >= 8) result += dateTimeSeparator;
|
|
27
|
+
result += value.slice(8, 10);
|
|
28
|
+
if (value.length >= 10) result += ":";
|
|
29
|
+
result += value.slice(10, 12);
|
|
30
|
+
if (value.length >= 12) result += ":";
|
|
31
|
+
result += value.slice(12, 14);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
var normalizeDateTime = (dateTimeSeparator) => (value) => {
|
|
35
|
+
const normalized = filterCharacters(/[0-9TtZz:+\-. ]/)(value);
|
|
36
|
+
const suffix = normalized.slice(19);
|
|
37
|
+
if (normalized.includes(".") || /[Zz+]/.test(normalized) || suffix.includes("-")) return normalized;
|
|
38
|
+
return formatDateTimeDigits(normalized.replace(/\D/g, ""), dateTimeSeparator);
|
|
39
|
+
};
|
|
40
|
+
var normalizeIban = (value) => filterCharacters(/[A-Za-z0-9]/)(value).toUpperCase().slice(0, 34).replace(/(.{4})(?=.)/g, "$1 ");
|
|
41
|
+
var looseUriCharacters = /[^\s]/u;
|
|
42
|
+
var inputMaskPresets = {
|
|
43
|
+
"date": {
|
|
44
|
+
placeholder: "YYYY-MM-DD",
|
|
45
|
+
inputMode: "numeric",
|
|
46
|
+
mask: "9999-99-99"
|
|
47
|
+
},
|
|
48
|
+
"time": {
|
|
49
|
+
placeholder: "HH:MM:SS",
|
|
50
|
+
inputMode: "numeric",
|
|
51
|
+
mask: "99:99:99"
|
|
52
|
+
},
|
|
53
|
+
"datetime": {
|
|
54
|
+
placeholder: "2026-08-06 10:30:00",
|
|
55
|
+
inputMode: "text",
|
|
56
|
+
normalize: normalizeDateTime(" "),
|
|
57
|
+
accepts: (value) => /^\d{0,4}(?:-\d{0,2}(?:-\d{0,2}(?:[Tt ]\d{0,2}(?::\d{0,2}(?::\d{0,2}(?:\.\d{0,6})?(?:[Zz]|[+-]\d{0,2}(?::\d{0,2})?)?)?)?)?)?)?$/.test(value)
|
|
58
|
+
},
|
|
59
|
+
"rfc3339": {
|
|
60
|
+
placeholder: "2026-08-06T10:30:00+08:00",
|
|
61
|
+
inputMode: "text",
|
|
62
|
+
normalize: normalizeDateTime("T"),
|
|
63
|
+
accepts: (value) => /^\d{0,4}(?:-\d{0,2}(?:-\d{0,2}(?:[Tt]\d{0,2}(?::\d{0,2}(?::\d{0,2}(?:\.\d{0,6})?(?:[Zz]|[+-]\d{0,2}(?::\d{0,2})?)?)?)?)?)?)?$/.test(value)
|
|
64
|
+
},
|
|
65
|
+
"ip": {
|
|
66
|
+
placeholder: "192.168.1.1 或 2001:db8::1",
|
|
67
|
+
inputMode: "text",
|
|
68
|
+
normalize: filterCharacters(/[0-9A-Fa-f:.]/),
|
|
69
|
+
accepts: (value) => acceptsIpv4(value) || acceptsIpv6(value)
|
|
70
|
+
},
|
|
71
|
+
"ipv4": {
|
|
72
|
+
placeholder: "192.168.1.1",
|
|
73
|
+
inputMode: "decimal",
|
|
74
|
+
normalize: filterCharacters(/[0-9.]/),
|
|
75
|
+
accepts: acceptsIpv4
|
|
76
|
+
},
|
|
77
|
+
"ipv6": {
|
|
78
|
+
placeholder: "2001:db8::1",
|
|
79
|
+
inputMode: "text",
|
|
80
|
+
normalize: filterCharacters(/[0-9A-Fa-f:]/),
|
|
81
|
+
accepts: acceptsIpv6
|
|
82
|
+
},
|
|
83
|
+
"ip-range": {
|
|
84
|
+
placeholder: "192.168.1.0/24",
|
|
85
|
+
inputMode: "text",
|
|
86
|
+
normalize: filterCharacters(/[0-9A-Fa-f:./]/),
|
|
87
|
+
accepts: (value) => {
|
|
88
|
+
const slash = value.lastIndexOf("/");
|
|
89
|
+
if (slash === -1) return acceptsIpv4(value) || acceptsIpv6(value);
|
|
90
|
+
const ip = value.slice(0, slash);
|
|
91
|
+
const prefix = value.slice(slash + 1);
|
|
92
|
+
if (!(acceptsIpv4(ip) || acceptsIpv6(ip))) return false;
|
|
93
|
+
if (prefix === "") return true;
|
|
94
|
+
if (!/^\d{0,3}$/.test(prefix)) return false;
|
|
95
|
+
const prefixNum = Number(prefix);
|
|
96
|
+
if (prefixNum > 128) return false;
|
|
97
|
+
if (ip.includes(".") && !ip.includes(":") && prefixNum > 32) return false;
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"url": {
|
|
102
|
+
placeholder: "https://example.com/path",
|
|
103
|
+
inputMode: "url",
|
|
104
|
+
normalize: filterCharacters(/[A-Za-z0-9:/?#@!$&'()*+,;=._~%\u005B\u005D-]/),
|
|
105
|
+
accepts: (value) => /^(?:[A-Za-z][A-Za-z\d+.-]*:\/{0,2})?[A-Za-z0-9:/?#@!$&'()*+,;=._~%\u005B\u005D-]*$/.test(value)
|
|
106
|
+
},
|
|
107
|
+
"email": {
|
|
108
|
+
placeholder: "name@example.com",
|
|
109
|
+
inputMode: "email",
|
|
110
|
+
normalize: filterCharacters(looseUriCharacters),
|
|
111
|
+
accepts: (value) => /^[^\s@]*(?:@[^\s@]*)?$/u.test(value)
|
|
112
|
+
},
|
|
113
|
+
"fqdn": {
|
|
114
|
+
placeholder: "example.com",
|
|
115
|
+
inputMode: "url",
|
|
116
|
+
normalize: filterCharacters(/* @__PURE__ */ new RegExp("[\\p{Letter}\\p{Number}._*-]", "u")),
|
|
117
|
+
accepts: (value) => !value.includes("..")
|
|
118
|
+
},
|
|
119
|
+
"semver": {
|
|
120
|
+
placeholder: "1.2.3-beta.1+build.7",
|
|
121
|
+
inputMode: "text",
|
|
122
|
+
normalize: filterCharacters(/[0-9A-Za-z.+-]/),
|
|
123
|
+
accepts: (value) => /^(?:0|[1-9]\d*)?(?:\.(?:0|[1-9]\d*)?)?(?:\.(?:0|[1-9]\d*)?)?(?:-[0-9A-Za-z-]*(?:\.[0-9A-Za-z-]*)*)?(?:\+[0-9A-Za-z-]*(?:\.[0-9A-Za-z-]*)*)?$/.test(value)
|
|
124
|
+
},
|
|
125
|
+
"uuid": {
|
|
126
|
+
placeholder: "550e8400-e29b-41d4-a716-446655440000",
|
|
127
|
+
inputMode: "text",
|
|
128
|
+
mask: "hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh",
|
|
129
|
+
formatChars: { h: /[0-9A-Fa-f]/ }
|
|
130
|
+
},
|
|
131
|
+
"mac-address": {
|
|
132
|
+
placeholder: "01:23:45:67:89:ab",
|
|
133
|
+
inputMode: "text",
|
|
134
|
+
mask: "hh:hh:hh:hh:hh:hh",
|
|
135
|
+
formatChars: { h: /[0-9A-Fa-f]/ }
|
|
136
|
+
},
|
|
137
|
+
"lat-long": {
|
|
138
|
+
placeholder: "31.2304, 121.4737",
|
|
139
|
+
inputMode: "text",
|
|
140
|
+
normalize: filterCharacters(/[-0-9+., ]/),
|
|
141
|
+
accepts: (value) => /^[-+]?\d*(?:\.\d*)?(?:, ?[-+]?\d*(?:\.\d*)?)?$/.test(value)
|
|
142
|
+
},
|
|
143
|
+
"hex-color": {
|
|
144
|
+
placeholder: "#1677ff",
|
|
145
|
+
inputMode: "text",
|
|
146
|
+
normalize: filterCharacters(/[0-9A-Fa-f#]/),
|
|
147
|
+
accepts: (value) => /^#?[0-9A-Fa-f]{0,8}$/.test(value)
|
|
148
|
+
},
|
|
149
|
+
"rgb-color": {
|
|
150
|
+
placeholder: "rgb(22, 119, 255)",
|
|
151
|
+
inputMode: "text",
|
|
152
|
+
normalize: filterCharacters(/[0-9a-zA-Z().,% ]/),
|
|
153
|
+
accepts: (value) => /^r(?:g(?:b(?:a)?)?)?\(?(?:\d{0,3}(?:, ?\d{0,3}(?:, ?\d{0,3}(?:, ?(?:\d{0,3}(?:\.\d{0,3})?%?)?)?)?)?)?\)?$/i.test(value)
|
|
154
|
+
},
|
|
155
|
+
"hsl": {
|
|
156
|
+
placeholder: "hsl(210, 100%, 50%)",
|
|
157
|
+
inputMode: "text",
|
|
158
|
+
normalize: filterCharacters(/[0-9a-zA-Z().,% ]/),
|
|
159
|
+
accepts: (value) => /^h(?:s(?:l(?:a)?)?)?\(?(?:\d{0,3}(?:, ?\d{0,3}%?(?:, ?\d{0,3}%?(?:, ?(?:\d{0,3}(?:\.\d{0,3})?%?)?)?)?)?)?\)?$/i.test(value)
|
|
160
|
+
},
|
|
161
|
+
"imei": {
|
|
162
|
+
placeholder: "12-345678-901234-5",
|
|
163
|
+
inputMode: "numeric",
|
|
164
|
+
mask: "99-999999-999999-9"
|
|
165
|
+
},
|
|
166
|
+
"issn": {
|
|
167
|
+
placeholder: "1234-567X",
|
|
168
|
+
inputMode: "text",
|
|
169
|
+
mask: "9999-999x",
|
|
170
|
+
formatChars: { x: /[0-9Xx]/ }
|
|
171
|
+
},
|
|
172
|
+
"isrc": {
|
|
173
|
+
placeholder: "US-AAA-26-12345",
|
|
174
|
+
inputMode: "text",
|
|
175
|
+
mask: "aa-aaa-99-99999"
|
|
176
|
+
},
|
|
177
|
+
"iso6346": {
|
|
178
|
+
placeholder: "MSCU 123456 7",
|
|
179
|
+
inputMode: "text",
|
|
180
|
+
mask: "aaaa 999999 9"
|
|
181
|
+
},
|
|
182
|
+
"jwt": {
|
|
183
|
+
placeholder: "header.payload.signature",
|
|
184
|
+
inputMode: "text",
|
|
185
|
+
normalize: filterCharacters(/[0-9A-Za-z._-]/),
|
|
186
|
+
accepts: (value) => /^[0-9A-Za-z_-]*(?:\.[0-9A-Za-z_-]*){0,2}$/.test(value)
|
|
187
|
+
},
|
|
188
|
+
"mime-type": {
|
|
189
|
+
placeholder: "application/json",
|
|
190
|
+
inputMode: "text",
|
|
191
|
+
normalize: filterCharacters(/[0-9A-Za-z!#$&^_.+/-]/),
|
|
192
|
+
accepts: (value) => /^[^/\s]*(?:\/[^/\s]*)?$/.test(value)
|
|
193
|
+
},
|
|
194
|
+
"mailto-uri": {
|
|
195
|
+
placeholder: "mailto:name@example.com",
|
|
196
|
+
inputMode: "email",
|
|
197
|
+
normalize: filterCharacters(looseUriCharacters),
|
|
198
|
+
accepts: (value) => /^(?:mailto:?)?[^\s]*$/i.test(value)
|
|
199
|
+
},
|
|
200
|
+
"data-uri": {
|
|
201
|
+
placeholder: "data:text/plain;base64,...",
|
|
202
|
+
inputMode: "text",
|
|
203
|
+
normalize: filterCharacters(looseUriCharacters),
|
|
204
|
+
accepts: (value) => /^(?:data:?)?[^\s]*$/i.test(value)
|
|
205
|
+
},
|
|
206
|
+
"magnet-uri": {
|
|
207
|
+
placeholder: "magnet:?xt=urn:btih:...",
|
|
208
|
+
inputMode: "text",
|
|
209
|
+
normalize: filterCharacters(looseUriCharacters),
|
|
210
|
+
accepts: (value) => /^(?:magnet:?)?[^\s]*$/i.test(value)
|
|
211
|
+
},
|
|
212
|
+
"iban": {
|
|
213
|
+
placeholder: "GB82 WEST 1234 5698 7654 32",
|
|
214
|
+
inputMode: "text",
|
|
215
|
+
normalize: normalizeIban,
|
|
216
|
+
accepts: (value) => /^[A-Z0-9 ]{0,42}$/.test(value)
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
//#endregion
|
|
220
|
+
export { inputMaskPresets };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.css";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/******** borderSize *******/
|
|
2
|
+
/******** borderStyle *******/
|
|
3
|
+
/******** radius *******/
|
|
4
|
+
/******** shadow distance *******/
|
|
5
|
+
/******** size *******/
|
|
6
|
+
/******** spacing *******/
|
|
7
|
+
/******** shadow *******/
|
|
8
|
+
/******** opacity *******/
|
|
9
|
+
/******** fontSize *******/
|
|
10
|
+
/******** fontWeight ********/
|
|
11
|
+
/******** Primary *******/
|
|
12
|
+
/******** success *******/
|
|
13
|
+
/******** warning *******/
|
|
14
|
+
/******** danger *******/
|
|
15
|
+
/******** link *******/
|
|
16
|
+
/******** radius *******/
|
|
17
|
+
/********* icon hover *********/
|
|
18
|
+
.sd-input-mask .sd-input {
|
|
19
|
+
font-variant-numeric: tabular-nums;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.scss";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@use '@style/theme/index.scss' as theme;
|
|
2
|
+
@use '@components/input-mask/style/token.scss' as *;
|
|
3
|
+
@use 'sass:string';
|
|
4
|
+
|
|
5
|
+
$input-mask-prefix-cls: string.unquote('#{theme.$prefix}-input-mask');
|
|
6
|
+
$input-prefix-cls: string.unquote('#{theme.$prefix}-input');
|
|
7
|
+
|
|
8
|
+
.#{$input-mask-prefix-cls} .#{$input-prefix-cls} {
|
|
9
|
+
font-variant-numeric: $input-mask-font-variant-numeric;
|
|
10
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export type InputMaskSize = 'mini' | 'small' | 'medium' | 'large';
|
|
2
|
+
export type InputMaskToken = string | RegExp;
|
|
3
|
+
export type InputMaskPattern = string | readonly InputMaskToken[];
|
|
4
|
+
export interface InputMaskSelection {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
}
|
|
8
|
+
export interface InputMaskState {
|
|
9
|
+
value: string;
|
|
10
|
+
selection: InputMaskSelection | null;
|
|
11
|
+
}
|
|
12
|
+
export type InputMaskBeforeChange = (nextState: InputMaskState, previousState: InputMaskState) => InputMaskState;
|
|
13
|
+
export interface InputMaskPresetDefinition {
|
|
14
|
+
placeholder: string;
|
|
15
|
+
inputMode?: 'decimal' | 'email' | 'numeric' | 'search' | 'tel' | 'text' | 'url';
|
|
16
|
+
mask?: InputMaskPattern;
|
|
17
|
+
formatChars?: Readonly<Record<string, RegExp>>;
|
|
18
|
+
normalize?: (value: string) => string;
|
|
19
|
+
accepts?: (value: string) => boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface InputMaskProps {
|
|
22
|
+
modelValue?: string;
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
mask?: InputMaskPattern;
|
|
25
|
+
preset?: InputMaskPresetName;
|
|
26
|
+
maskChar?: string | null;
|
|
27
|
+
formatChars?: Readonly<Record<string, RegExp>>;
|
|
28
|
+
alwaysShowMask?: boolean;
|
|
29
|
+
beforeMaskedValueChange?: InputMaskBeforeChange;
|
|
30
|
+
size?: InputMaskSize;
|
|
31
|
+
allowClear?: boolean;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
readonly?: boolean | string;
|
|
34
|
+
error?: boolean;
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
fitWidth?: boolean;
|
|
37
|
+
maxWFull?: boolean;
|
|
38
|
+
showWordLimit?: boolean;
|
|
39
|
+
maxLength?: number | {
|
|
40
|
+
length: number;
|
|
41
|
+
errorOnly?: boolean;
|
|
42
|
+
};
|
|
43
|
+
wordLength?: (value: string) => number;
|
|
44
|
+
wordSlice?: (value: string, maxLength: number) => string;
|
|
45
|
+
inputAttrs?: Record<string, unknown>;
|
|
46
|
+
prepend?: string;
|
|
47
|
+
append?: string;
|
|
48
|
+
}
|
|
49
|
+
export type InputMaskPresetName = 'data-uri' | 'date' | 'datetime' | 'email' | 'fqdn' | 'hex-color' | 'hsl' | 'iban' | 'imei' | 'ip' | 'ip-range' | 'ipv4' | 'ipv6' | 'isrc' | 'iso6346' | 'issn' | 'jwt' | 'lat-long' | 'mac-address' | 'magnet-uri' | 'mailto-uri' | 'mime-type' | 'rgb-color' | 'rfc3339' | 'semver' | 'time' | 'url' | 'uuid';
|
package/es/sd-vue.js
CHANGED
|
@@ -105,6 +105,7 @@ import preview_group_default from "./image/preview-group.js";
|
|
|
105
105
|
import Image from "./image/index.js";
|
|
106
106
|
import FilePreviewer from "./file-previewer/index.js";
|
|
107
107
|
import Icon from "./icon-component/index.js";
|
|
108
|
+
import InputMask from "./input-mask/index.js";
|
|
108
109
|
import KvList from "./kv-list/index.js";
|
|
109
110
|
import content_default from "./layout/content.js";
|
|
110
111
|
import footer_default from "./layout/footer.js";
|
|
@@ -194,6 +195,7 @@ var components = {
|
|
|
194
195
|
JsonForm,
|
|
195
196
|
KvList,
|
|
196
197
|
Input,
|
|
198
|
+
InputMask,
|
|
197
199
|
InputNumber,
|
|
198
200
|
InputTag,
|
|
199
201
|
Mention,
|
|
@@ -12,6 +12,7 @@ import { useCursor } from "../_hooks/use-cursor.js";
|
|
|
12
12
|
import { useFitWidth } from "../_hooks/use-fit-width.js";
|
|
13
13
|
import { isReadonlyModificationKey, useReadonlyTip, useReadonlyTipText } from "../_hooks/use-readonly-tip.js";
|
|
14
14
|
import { INPUT_EVENTS } from "../_utils/constant.js";
|
|
15
|
+
import { countGraphemes, sliceGraphemes } from "../_utils/grapheme.js";
|
|
15
16
|
import { omit } from "../_utils/omit.js";
|
|
16
17
|
import pick from "../_utils/pick.js";
|
|
17
18
|
import Tooltip from "../tooltip/index.js";
|
|
@@ -191,9 +192,8 @@ var textarea_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
191
192
|
return props.maxLength;
|
|
192
193
|
});
|
|
193
194
|
const getValueLength = (value) => {
|
|
194
|
-
var _value$length;
|
|
195
195
|
if (isFunction(props.wordLength)) return props.wordLength(value);
|
|
196
|
-
return (
|
|
196
|
+
return countGraphemes(value);
|
|
197
197
|
};
|
|
198
198
|
const valueLength = computed(() => getValueLength(computedValue.value));
|
|
199
199
|
const mergedError = computed(() => _mergedError.value || Boolean(computedMaxLength.value && maxLengthErrorOnly.value && valueLength.value > computedMaxLength.value));
|
|
@@ -214,10 +214,9 @@ var textarea_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
214
214
|
});
|
|
215
215
|
};
|
|
216
216
|
const updateValue = (value, inner = true) => {
|
|
217
|
-
if (computedMaxLength.value && !maxLengthErrorOnly.value && getValueLength(value) > computedMaxLength.value)
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
217
|
+
if (computedMaxLength.value && !maxLengthErrorOnly.value && getValueLength(value) > computedMaxLength.value) if (isFunction(props.wordSlice)) value = props.wordSlice(value, computedMaxLength.value);
|
|
218
|
+
else if (isFunction(props.wordLength)) value = value.slice(0, computedMaxLength.value);
|
|
219
|
+
else value = sliceGraphemes(value, computedMaxLength.value);
|
|
221
220
|
_value.value = value;
|
|
222
221
|
if (inner) emit("update:modelValue", value);
|
|
223
222
|
keepControl();
|
|
@@ -27,6 +27,8 @@ var toolbar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
|
|
|
27
27
|
type: Boolean,
|
|
28
28
|
default: true
|
|
29
29
|
},
|
|
30
|
+
searchBtn: {},
|
|
31
|
+
resetBtn: {},
|
|
30
32
|
showActions: {
|
|
31
33
|
type: Boolean,
|
|
32
34
|
default: true
|
|
@@ -175,21 +177,17 @@ var toolbar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
|
|
|
175
177
|
_: 3
|
|
176
178
|
}, 8, ["class"])) : createCommentVNode("", true), _ctx.$slots.extra ? renderSlot(_ctx.$slots, "extra", {}, void 0, void 0, 1) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
177
179
|
renderSlot(_ctx.$slots, "action-prepend"),
|
|
178
|
-
__props.showSearch ? (openBlock(), createBlock(unref(Button), {
|
|
180
|
+
__props.showSearch ? (openBlock(), createBlock(unref(Button), mergeProps({
|
|
179
181
|
key: 0,
|
|
180
|
-
type: "primary"
|
|
181
|
-
|
|
182
|
-
}, {
|
|
182
|
+
type: "primary"
|
|
183
|
+
}, __props.searchBtn, { onClick: handleSearch }), {
|
|
183
184
|
default: withCtx(() => [createTextVNode(toDisplayString(__props.searchText), 1)]),
|
|
184
185
|
_: 1
|
|
185
|
-
})) : createCommentVNode("", true),
|
|
186
|
-
__props.showReset ? (openBlock(), createBlock(unref(Button), {
|
|
187
|
-
key: 1,
|
|
188
|
-
onClick: _cache[1] || (_cache[1] = ($event) => reset())
|
|
189
|
-
}, {
|
|
186
|
+
}, 16)) : createCommentVNode("", true),
|
|
187
|
+
__props.showReset ? (openBlock(), createBlock(unref(Button), mergeProps({ key: 1 }, __props.resetBtn, { onClick: _cache[1] || (_cache[1] = ($event) => reset()) }), {
|
|
190
188
|
default: withCtx(() => [createTextVNode(toDisplayString(__props.resetText), 1)]),
|
|
191
189
|
_: 1
|
|
192
|
-
})) : createCommentVNode("", true),
|
|
190
|
+
}, 16)) : createCommentVNode("", true),
|
|
193
191
|
renderSlot(_ctx.$slots, "action-append")
|
|
194
192
|
], 64))], 2)) : createCommentVNode("", true)]),
|
|
195
193
|
_: 3
|
package/es/toolbar/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ButtonProps } from '../button';
|
|
1
2
|
import type { JsonFormSchema } from '../json-form';
|
|
2
3
|
import type { SpinProps } from '../spin';
|
|
3
4
|
export type ToolbarModelValue = Record<string, unknown>;
|
|
@@ -7,6 +8,8 @@ export interface ToolbarProps {
|
|
|
7
8
|
spinProps?: SpinProps;
|
|
8
9
|
showSearch?: boolean;
|
|
9
10
|
showReset?: boolean;
|
|
11
|
+
searchBtn?: ButtonProps;
|
|
12
|
+
resetBtn?: ButtonProps;
|
|
10
13
|
showActions?: boolean;
|
|
11
14
|
searchText?: string;
|
|
12
15
|
resetText?: string;
|
package/es/upload/context.d.ts
CHANGED
package/es/upload/index.d.ts
CHANGED
|
@@ -62,6 +62,10 @@ declare const Upload: {
|
|
|
62
62
|
type: BooleanConstructor;
|
|
63
63
|
default: boolean;
|
|
64
64
|
};
|
|
65
|
+
showStartButton: {
|
|
66
|
+
type: BooleanConstructor;
|
|
67
|
+
default: boolean;
|
|
68
|
+
};
|
|
65
69
|
showRetryButton: {
|
|
66
70
|
type: BooleanConstructor;
|
|
67
71
|
default: boolean;
|
|
@@ -155,6 +159,7 @@ declare const Upload: {
|
|
|
155
159
|
autoUpload: boolean;
|
|
156
160
|
showFileList: boolean;
|
|
157
161
|
showRemoveButton: boolean;
|
|
162
|
+
showStartButton: boolean;
|
|
158
163
|
showRetryButton: boolean;
|
|
159
164
|
showCancelButton: boolean;
|
|
160
165
|
showUploadButton: boolean | {
|
|
@@ -231,6 +236,10 @@ declare const Upload: {
|
|
|
231
236
|
type: BooleanConstructor;
|
|
232
237
|
default: boolean;
|
|
233
238
|
};
|
|
239
|
+
showStartButton: {
|
|
240
|
+
type: BooleanConstructor;
|
|
241
|
+
default: boolean;
|
|
242
|
+
};
|
|
234
243
|
showRetryButton: {
|
|
235
244
|
type: BooleanConstructor;
|
|
236
245
|
default: boolean;
|
|
@@ -316,6 +325,7 @@ declare const Upload: {
|
|
|
316
325
|
autoUpload: boolean;
|
|
317
326
|
showFileList: boolean;
|
|
318
327
|
showRemoveButton: boolean;
|
|
328
|
+
showStartButton: boolean;
|
|
319
329
|
showRetryButton: boolean;
|
|
320
330
|
showCancelButton: boolean;
|
|
321
331
|
showUploadButton: boolean | {
|
|
@@ -389,6 +399,10 @@ declare const Upload: {
|
|
|
389
399
|
type: BooleanConstructor;
|
|
390
400
|
default: boolean;
|
|
391
401
|
};
|
|
402
|
+
showStartButton: {
|
|
403
|
+
type: BooleanConstructor;
|
|
404
|
+
default: boolean;
|
|
405
|
+
};
|
|
392
406
|
showRetryButton: {
|
|
393
407
|
type: BooleanConstructor;
|
|
394
408
|
default: boolean;
|
|
@@ -482,6 +496,7 @@ declare const Upload: {
|
|
|
482
496
|
autoUpload: boolean;
|
|
483
497
|
showFileList: boolean;
|
|
484
498
|
showRemoveButton: boolean;
|
|
499
|
+
showStartButton: boolean;
|
|
485
500
|
showRetryButton: boolean;
|
|
486
501
|
showCancelButton: boolean;
|
|
487
502
|
showUploadButton: boolean | {
|
|
@@ -6,6 +6,7 @@ import IconImageClose from "../icon/icon-image-close/index.js";
|
|
|
6
6
|
import IconDelete from "../icon/icon-delete/index.js";
|
|
7
7
|
import { uploadInjectionKey } from "./context.js";
|
|
8
8
|
import IconUpload from "../icon/icon-upload/index.js";
|
|
9
|
+
import IconPlayArrowFill from "../icon/icon-play-arrow-fill/index.js";
|
|
9
10
|
import upload_progress_default from "./upload-progress.js";
|
|
10
11
|
import { Fragment, computed, createVNode, defineComponent, inject, mergeProps } from "vue";
|
|
11
12
|
//#region components/upload/upload-picture-item.tsx
|
|
@@ -33,7 +34,7 @@ var upload_picture_item_default = /* @__PURE__ */ defineComponent({
|
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
36
|
const renderCard = () => {
|
|
36
|
-
var _uploadCtx$slots$imag, _uploadCtx$slots, _uploadCtx$slots$imag2, _ref, _uploadCtx$slots$erro, _uploadCtx$slots2, _uploadCtx$slots2$err, _uploadCtx$customIcon, _uploadCtx$customIcon2, _ref2, _uploadCtx$slots$prev, _uploadCtx$slots3, _uploadCtx$slots3$pre, _uploadCtx$customIcon3, _uploadCtx$customIcon4, _ref3, _uploadCtx$slots$
|
|
37
|
+
var _uploadCtx$slots$imag, _uploadCtx$slots, _uploadCtx$slots$imag2, _ref, _uploadCtx$slots$erro, _uploadCtx$slots2, _uploadCtx$slots2$err, _uploadCtx$customIcon, _uploadCtx$customIcon2, _ref2, _uploadCtx$slots$prev, _uploadCtx$slots3, _uploadCtx$slots3$pre, _uploadCtx$customIcon3, _uploadCtx$customIcon4, _ref3, _uploadCtx$slots$star, _uploadCtx$slots4, _uploadCtx$slots4$sta, _uploadCtx$customIcon5, _uploadCtx$customIcon6, _ref4, _uploadCtx$slots$retr, _uploadCtx$slots5, _uploadCtx$slots5$ret, _uploadCtx$customIcon7, _uploadCtx$customIcon8, _ref5, _uploadCtx$slots$remo, _uploadCtx$slots6, _uploadCtx$slots6$rem, _uploadCtx$customIcon9, _uploadCtx$customIcon10, _uploadCtx$slots7, _uploadCtx$slots7$ext;
|
|
37
38
|
if (props.file.status === "uploading") return createVNode(upload_progress_default, {
|
|
38
39
|
"file": props.file,
|
|
39
40
|
"listType": "picture-card"
|
|
@@ -41,7 +42,7 @@ var upload_picture_item_default = /* @__PURE__ */ defineComponent({
|
|
|
41
42
|
return createVNode(Fragment, null, [(_uploadCtx$slots$imag = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots$imag2 = (_uploadCtx$slots = uploadCtx.slots).image) === null || _uploadCtx$slots$imag2 === void 0 ? void 0 : _uploadCtx$slots$imag2.call(_uploadCtx$slots, { fileItem: props.file })) !== null && _uploadCtx$slots$imag !== void 0 ? _uploadCtx$slots$imag : createVNode("img", mergeProps({
|
|
42
43
|
"src": props.file.url,
|
|
43
44
|
"alt": props.file.name
|
|
44
|
-
}, (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.imageLoading) ? { loading: uploadCtx.imageLoading } : void 0), null), createVNode("div", { "class": `${itemCls}-mask` }, [props.file.status === "error" &&
|
|
45
|
+
}, (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.imageLoading) ? { loading: uploadCtx.imageLoading } : void 0), null), createVNode("div", { "class": `${itemCls}-mask` }, [props.file.status === "error" && createVNode("div", { "class": `${itemCls}-error-tip` }, [createVNode("span", { "class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-error`] }, [(_ref = (_uploadCtx$slots$erro = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots2$err = (_uploadCtx$slots2 = uploadCtx.slots)["error-icon"]) === null || _uploadCtx$slots2$err === void 0 ? void 0 : _uploadCtx$slots2$err.call(_uploadCtx$slots2)) !== null && _uploadCtx$slots$erro !== void 0 ? _uploadCtx$slots$erro : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon = uploadCtx.customIcon) === null || _uploadCtx$customIcon === void 0 || (_uploadCtx$customIcon2 = _uploadCtx$customIcon.errorIcon) === null || _uploadCtx$customIcon2 === void 0 ? void 0 : _uploadCtx$customIcon2.call(_uploadCtx$customIcon)) !== null && _ref !== void 0 ? _ref : createVNode(IconImageClose, null, null)])]), createVNode("div", { "class": `${itemCls}-operation` }, [
|
|
45
46
|
props.file.status !== "error" && (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showPreviewButton) && createVNode("span", {
|
|
46
47
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-preview`],
|
|
47
48
|
"role": "button",
|
|
@@ -50,14 +51,22 @@ var upload_picture_item_default = /* @__PURE__ */ defineComponent({
|
|
|
50
51
|
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onPreview(props.file),
|
|
51
52
|
"onKeydown": onActionKeydown(() => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onPreview(props.file))
|
|
52
53
|
}, [(_ref2 = (_uploadCtx$slots$prev = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots3$pre = (_uploadCtx$slots3 = uploadCtx.slots)["preview-icon"]) === null || _uploadCtx$slots3$pre === void 0 ? void 0 : _uploadCtx$slots3$pre.call(_uploadCtx$slots3)) !== null && _uploadCtx$slots$prev !== void 0 ? _uploadCtx$slots$prev : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon3 = uploadCtx.customIcon) === null || _uploadCtx$customIcon3 === void 0 || (_uploadCtx$customIcon4 = _uploadCtx$customIcon3.previewIcon) === null || _uploadCtx$customIcon4 === void 0 ? void 0 : _uploadCtx$customIcon4.call(_uploadCtx$customIcon3)) !== null && _ref2 !== void 0 ? _ref2 : createVNode(IconEye, null, null)]),
|
|
53
|
-
|
|
54
|
+
props.file.status === "init" && (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showStartButton) && createVNode("span", {
|
|
55
|
+
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-start`],
|
|
56
|
+
"role": "button",
|
|
57
|
+
"tabindex": "0",
|
|
58
|
+
"aria-label": t("upload.start"),
|
|
59
|
+
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file),
|
|
60
|
+
"onKeydown": onActionKeydown(() => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file))
|
|
61
|
+
}, [(_ref3 = (_uploadCtx$slots$star = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots4$sta = (_uploadCtx$slots4 = uploadCtx.slots)["start-icon"]) === null || _uploadCtx$slots4$sta === void 0 ? void 0 : _uploadCtx$slots4$sta.call(_uploadCtx$slots4)) !== null && _uploadCtx$slots$star !== void 0 ? _uploadCtx$slots$star : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon5 = uploadCtx.customIcon) === null || _uploadCtx$customIcon5 === void 0 || (_uploadCtx$customIcon6 = _uploadCtx$customIcon5.startIcon) === null || _uploadCtx$customIcon6 === void 0 ? void 0 : _uploadCtx$customIcon6.call(_uploadCtx$customIcon5)) !== null && _ref3 !== void 0 ? _ref3 : createVNode(IconPlayArrowFill, null, null)]),
|
|
62
|
+
props.file.status === "error" && (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showRetryButton) && createVNode("span", {
|
|
54
63
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-upload`],
|
|
55
64
|
"role": "button",
|
|
56
65
|
"tabindex": "0",
|
|
57
66
|
"aria-label": t("a11y.retryUpload"),
|
|
58
67
|
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file),
|
|
59
68
|
"onKeydown": onActionKeydown(() => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file))
|
|
60
|
-
}, [(
|
|
69
|
+
}, [(_ref4 = (_uploadCtx$slots$retr = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots5$ret = (_uploadCtx$slots5 = uploadCtx.slots)["retry-icon"]) === null || _uploadCtx$slots5$ret === void 0 ? void 0 : _uploadCtx$slots5$ret.call(_uploadCtx$slots5)) !== null && _uploadCtx$slots$retr !== void 0 ? _uploadCtx$slots$retr : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon7 = uploadCtx.customIcon) === null || _uploadCtx$customIcon7 === void 0 || (_uploadCtx$customIcon8 = _uploadCtx$customIcon7.retryIcon) === null || _uploadCtx$customIcon8 === void 0 ? void 0 : _uploadCtx$customIcon8.call(_uploadCtx$customIcon7)) !== null && _ref4 !== void 0 ? _ref4 : createVNode(IconUpload, null, null)]),
|
|
61
70
|
!(uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.disabled) && (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showRemoveButton) && createVNode("span", {
|
|
62
71
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-remove`],
|
|
63
72
|
"role": "button",
|
|
@@ -68,8 +77,8 @@ var upload_picture_item_default = /* @__PURE__ */ defineComponent({
|
|
|
68
77
|
var _uploadCtx$onRemove;
|
|
69
78
|
return uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$onRemove = uploadCtx.onRemove) === null || _uploadCtx$onRemove === void 0 ? void 0 : _uploadCtx$onRemove.call(uploadCtx, props.file);
|
|
70
79
|
})
|
|
71
|
-
}, [(
|
|
72
|
-
uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$
|
|
80
|
+
}, [(_ref5 = (_uploadCtx$slots$remo = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots6$rem = (_uploadCtx$slots6 = uploadCtx.slots)["remove-icon"]) === null || _uploadCtx$slots6$rem === void 0 ? void 0 : _uploadCtx$slots6$rem.call(_uploadCtx$slots6)) !== null && _uploadCtx$slots$remo !== void 0 ? _uploadCtx$slots$remo : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon9 = uploadCtx.customIcon) === null || _uploadCtx$customIcon9 === void 0 || (_uploadCtx$customIcon10 = _uploadCtx$customIcon9.removeIcon) === null || _uploadCtx$customIcon10 === void 0 ? void 0 : _uploadCtx$customIcon10.call(_uploadCtx$customIcon9)) !== null && _ref5 !== void 0 ? _ref5 : createVNode(IconDelete, null, null)]),
|
|
81
|
+
uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots7$ext = (_uploadCtx$slots7 = uploadCtx.slots)["extra-button"]) === null || _uploadCtx$slots7$ext === void 0 ? void 0 : _uploadCtx$slots7$ext.call(_uploadCtx$slots7, props.file)
|
|
73
82
|
])])]);
|
|
74
83
|
};
|
|
75
84
|
return () => createVNode("span", { "class": cls.value }, [renderCard()]);
|
|
@@ -28,29 +28,33 @@ var upload_progress_default = /* @__PURE__ */ defineComponent({
|
|
|
28
28
|
const uploadCtx = inject(uploadInjectionKey, void 0);
|
|
29
29
|
const renderIcon = () => {
|
|
30
30
|
if (props.file.status === "error") {
|
|
31
|
-
var _uploadCtx$slots$retr, _uploadCtx$slots, _uploadCtx$slots
|
|
31
|
+
var _ref, _uploadCtx$slots$retr, _uploadCtx$slots$retr2, _uploadCtx$slots, _uploadCtx$customIcon, _uploadCtx$customIcon2;
|
|
32
|
+
if (!(uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showRetryButton)) return null;
|
|
32
33
|
return createVNode("span", {
|
|
33
34
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-upload`],
|
|
34
35
|
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file)
|
|
35
|
-
}, [(
|
|
36
|
+
}, [(_ref = (_uploadCtx$slots$retr = (_uploadCtx$slots$retr2 = (_uploadCtx$slots = uploadCtx.slots)["retry-icon"]) === null || _uploadCtx$slots$retr2 === void 0 ? void 0 : _uploadCtx$slots$retr2.call(_uploadCtx$slots)) !== null && _uploadCtx$slots$retr !== void 0 ? _uploadCtx$slots$retr : (_uploadCtx$customIcon = uploadCtx.customIcon) === null || _uploadCtx$customIcon === void 0 || (_uploadCtx$customIcon2 = _uploadCtx$customIcon.retryIcon) === null || _uploadCtx$customIcon2 === void 0 ? void 0 : _uploadCtx$customIcon2.call(_uploadCtx$customIcon)) !== null && _ref !== void 0 ? _ref : props.listType === "picture-card" ? createVNode(IconUpload, null, null) : t("upload.retry")]);
|
|
36
37
|
}
|
|
37
38
|
if (props.file.status === "done") {
|
|
38
|
-
var
|
|
39
|
-
return createVNode("span", { "class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-success`] }, [(
|
|
39
|
+
var _ref2, _uploadCtx$slots$succ, _uploadCtx$slots2, _uploadCtx$slots2$suc, _uploadCtx$customIcon3, _uploadCtx$customIcon4;
|
|
40
|
+
return createVNode("span", { "class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-success`] }, [(_ref2 = (_uploadCtx$slots$succ = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots2$suc = (_uploadCtx$slots2 = uploadCtx.slots)["success-icon"]) === null || _uploadCtx$slots2$suc === void 0 ? void 0 : _uploadCtx$slots2$suc.call(_uploadCtx$slots2)) !== null && _uploadCtx$slots$succ !== void 0 ? _uploadCtx$slots$succ : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon3 = uploadCtx.customIcon) === null || _uploadCtx$customIcon3 === void 0 || (_uploadCtx$customIcon4 = _uploadCtx$customIcon3.successIcon) === null || _uploadCtx$customIcon4 === void 0 ? void 0 : _uploadCtx$customIcon4.call(_uploadCtx$customIcon3)) !== null && _ref2 !== void 0 ? _ref2 : createVNode(IconCheck, null, null)]);
|
|
41
|
+
}
|
|
42
|
+
if (props.file.status === "init") {
|
|
43
|
+
if (!(uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showStartButton)) return null;
|
|
44
|
+
return createVNode(Tooltip, { "content": t("upload.start") }, { default: () => {
|
|
45
|
+
var _ref3, _uploadCtx$slots$star, _uploadCtx$slots3, _uploadCtx$slots3$sta, _uploadCtx$customIcon5, _uploadCtx$customIcon6;
|
|
46
|
+
return [createVNode("span", {
|
|
47
|
+
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-start`],
|
|
48
|
+
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file)
|
|
49
|
+
}, [(_ref3 = (_uploadCtx$slots$star = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots3$sta = (_uploadCtx$slots3 = uploadCtx.slots)["start-icon"]) === null || _uploadCtx$slots3$sta === void 0 ? void 0 : _uploadCtx$slots3$sta.call(_uploadCtx$slots3)) !== null && _uploadCtx$slots$star !== void 0 ? _uploadCtx$slots$star : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon5 = uploadCtx.customIcon) === null || _uploadCtx$customIcon5 === void 0 || (_uploadCtx$customIcon6 = _uploadCtx$customIcon5.startIcon) === null || _uploadCtx$customIcon6 === void 0 ? void 0 : _uploadCtx$customIcon6.call(_uploadCtx$customIcon5)) !== null && _ref3 !== void 0 ? _ref3 : createVNode(IconPlayArrowFill, null, null)])];
|
|
50
|
+
} });
|
|
40
51
|
}
|
|
41
|
-
if (props.file.status === "init") return createVNode(Tooltip, { "content": t("upload.start") }, { default: () => {
|
|
42
|
-
var _ref2, _uploadCtx$slots$star, _uploadCtx$slots3, _uploadCtx$slots3$sta, _uploadCtx$customIcon5, _uploadCtx$customIcon6;
|
|
43
|
-
return [createVNode("span", {
|
|
44
|
-
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-start`],
|
|
45
|
-
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file)
|
|
46
|
-
}, [(_ref2 = (_uploadCtx$slots$star = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots3$sta = (_uploadCtx$slots3 = uploadCtx.slots)["start-icon"]) === null || _uploadCtx$slots3$sta === void 0 ? void 0 : _uploadCtx$slots3$sta.call(_uploadCtx$slots3)) !== null && _uploadCtx$slots$star !== void 0 ? _uploadCtx$slots$star : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon5 = uploadCtx.customIcon) === null || _uploadCtx$customIcon5 === void 0 || (_uploadCtx$customIcon6 = _uploadCtx$customIcon5.startIcon) === null || _uploadCtx$customIcon6 === void 0 ? void 0 : _uploadCtx$customIcon6.call(_uploadCtx$customIcon5)) !== null && _ref2 !== void 0 ? _ref2 : createVNode(IconPlayArrowFill, null, null)])];
|
|
47
|
-
} });
|
|
48
52
|
return (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showCancelButton) && createVNode(Tooltip, { "content": t("upload.cancel") }, { default: () => {
|
|
49
|
-
var
|
|
53
|
+
var _ref4, _uploadCtx$slots$canc, _uploadCtx$slots4, _uploadCtx$slots4$can, _uploadCtx$customIcon7, _uploadCtx$customIcon8;
|
|
50
54
|
return [createVNode("span", {
|
|
51
55
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-cancel`],
|
|
52
56
|
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onAbort(props.file)
|
|
53
|
-
}, [(
|
|
57
|
+
}, [(_ref4 = (_uploadCtx$slots$canc = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots4$can = (_uploadCtx$slots4 = uploadCtx.slots)["cancel-icon"]) === null || _uploadCtx$slots4$can === void 0 ? void 0 : _uploadCtx$slots4$can.call(_uploadCtx$slots4)) !== null && _uploadCtx$slots$canc !== void 0 ? _uploadCtx$slots$canc : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon7 = uploadCtx.customIcon) === null || _uploadCtx$customIcon7 === void 0 || (_uploadCtx$customIcon8 = _uploadCtx$customIcon7.cancelIcon) === null || _uploadCtx$customIcon8 === void 0 ? void 0 : _uploadCtx$customIcon8.call(_uploadCtx$customIcon7)) !== null && _ref4 !== void 0 ? _ref4 : createVNode(IconPause, null, null)])];
|
|
54
58
|
} });
|
|
55
59
|
};
|
|
56
60
|
const renderProgress = () => {
|