@sdata/web-vue 3.26.0 → 3.28.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 +8 -0
- package/dist/sd.min.css +2 -2
- package/es/_hooks/use-theme-mode.d.ts +1 -1
- package/es/_utils/date.js +5 -38
- 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 +33 -23
- 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 +2 -0
- package/es/index.css +8 -0
- package/es/index.d.ts +6 -1
- package/es/index.js +6 -1
- package/es/index.scss +2 -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/locale/constant.d.ts +2 -0
- package/es/locale/constant.js +5 -0
- package/es/locale/index.d.ts +1 -0
- package/es/locale/index.js +6 -5
- package/es/locale/interface.d.ts +11 -0
- package/es/locale/lang/en-us.js +12 -1
- package/es/locale/lang/zh-cn.js +14 -2
- package/es/sd-vue.js +4 -0
- package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +5 -6
- package/es/thinking-orb/engine/braid.d.ts +2 -0
- package/es/thinking-orb/engine/braid.js +52 -0
- package/es/thinking-orb/engine/core.d.ts +28 -0
- package/es/thinking-orb/engine/core.js +104 -0
- package/es/thinking-orb/engine/lattice.d.ts +4 -0
- package/es/thinking-orb/engine/lattice.js +188 -0
- package/es/thinking-orb/engine/morph.d.ts +2 -0
- package/es/thinking-orb/engine/morph.js +111 -0
- package/es/thinking-orb/engine/orbits.d.ts +2 -0
- package/es/thinking-orb/engine/orbits.js +65 -0
- package/es/thinking-orb/engine/profiles.d.ts +6 -0
- package/es/thinking-orb/engine/profiles.js +150 -0
- package/es/thinking-orb/engine/registry.d.ts +3 -0
- package/es/thinking-orb/engine/registry.js +20 -0
- package/es/thinking-orb/engine/ribbon.d.ts +2 -0
- package/es/thinking-orb/engine/ribbon.js +71 -0
- package/es/thinking-orb/engine/types.d.ts +3 -0
- package/es/thinking-orb/engine/web.d.ts +2 -0
- package/es/thinking-orb/engine/web.js +87 -0
- package/es/thinking-orb/index.d.ts +21 -0
- package/es/thinking-orb/index.js +10 -0
- package/es/thinking-orb/presets.d.ts +10 -0
- package/es/thinking-orb/presets.js +176 -0
- package/es/thinking-orb/style/css.js +2 -0
- package/es/thinking-orb/style/index.css +20 -0
- package/es/thinking-orb/style/index.d.ts +2 -0
- package/es/thinking-orb/style/index.js +2 -0
- package/es/thinking-orb/style/index.scss +8 -0
- package/es/thinking-orb/thinking-orb.js +5 -0
- package/es/thinking-orb/thinking-orb.vue.d.ts +4 -0
- package/es/thinking-orb/thinking-orb.vue_vue_type_script_setup_true_lang.js +140 -0
- package/es/thinking-orb/types.d.ts +12 -0
- package/es/toolbar/toolbar.vue_vue_type_script_setup_true_lang.js +8 -10
- package/es/toolbar/types.d.ts +3 -0
- package/json/vetur-attributes.json +23 -0
- package/json/vetur-tags.json +14 -0
- package/json/web-types.json +70 -1
- package/package.json +1 -1
- package/es/locale/lang/ar-eg.d.ts +0 -3
- package/es/locale/lang/ar-eg.js +0 -262
- package/es/locale/lang/de-de.d.ts +0 -3
- package/es/locale/lang/de-de.js +0 -262
- package/es/locale/lang/es-es.d.ts +0 -3
- package/es/locale/lang/es-es.js +0 -262
- package/es/locale/lang/fr-fr.d.ts +0 -3
- package/es/locale/lang/fr-fr.js +0 -262
- package/es/locale/lang/id-id.d.ts +0 -3
- package/es/locale/lang/id-id.js +0 -262
- package/es/locale/lang/it-it.d.ts +0 -3
- package/es/locale/lang/it-it.js +0 -262
- package/es/locale/lang/ja-jp.d.ts +0 -3
- package/es/locale/lang/ja-jp.js +0 -262
- package/es/locale/lang/km-kh.d.ts +0 -3
- package/es/locale/lang/km-kh.js +0 -262
- package/es/locale/lang/ko-kr.d.ts +0 -3
- package/es/locale/lang/ko-kr.js +0 -262
- package/es/locale/lang/ms-my.d.ts +0 -3
- package/es/locale/lang/ms-my.js +0 -262
- package/es/locale/lang/nl-nl.d.ts +0 -3
- package/es/locale/lang/nl-nl.js +0 -262
- package/es/locale/lang/pt-pt.d.ts +0 -3
- package/es/locale/lang/pt-pt.js +0 -262
- package/es/locale/lang/ru-ru.d.ts +0 -3
- package/es/locale/lang/ru-ru.js +0 -262
- package/es/locale/lang/th-th.d.ts +0 -3
- package/es/locale/lang/th-th.js +0 -262
- package/es/locale/lang/vi-vn.d.ts +0 -3
- package/es/locale/lang/vi-vn.js +0 -262
- package/es/locale/lang/zh-tw.d.ts +0 -3
- package/es/locale/lang/zh-tw.js +0 -272
|
@@ -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/locale/index.d.ts
CHANGED
package/es/locale/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { configProviderInjectionKey } from "../config-provider/context.js";
|
|
2
2
|
import { isString } from "../_utils/is.js";
|
|
3
|
+
import { DEFAULT_LOCALE, DEFAULT_LOCALE_KEY } from "./constant.js";
|
|
3
4
|
import lang from "./lang/zh-cn.js";
|
|
4
5
|
import { computed, inject, reactive, ref } from "vue";
|
|
5
6
|
//#region components/locale/index.ts
|
|
6
|
-
var LOCALE = ref(
|
|
7
|
-
var I18N_MESSAGES = reactive({
|
|
7
|
+
var LOCALE = ref(DEFAULT_LOCALE);
|
|
8
|
+
var I18N_MESSAGES = reactive({ [DEFAULT_LOCALE]: lang });
|
|
8
9
|
/**
|
|
9
10
|
* 添加地区语言包。添加过后的语言包可以通过 `useLocale` 使用
|
|
10
11
|
* @param messages 需要添加的地区语言数据
|
|
@@ -33,8 +34,8 @@ var getLocale = () => {
|
|
|
33
34
|
var useI18n = () => {
|
|
34
35
|
const configProvider = inject(configProviderInjectionKey, void 0);
|
|
35
36
|
const i18nMessage = computed(() => {
|
|
36
|
-
var _configProvider$local;
|
|
37
|
-
return (_configProvider$local = configProvider === null || configProvider === void 0 ? void 0 : configProvider.locale) !== null && _configProvider$local !== void 0 ? _configProvider$local : I18N_MESSAGES[LOCALE.value];
|
|
37
|
+
var _ref, _configProvider$local;
|
|
38
|
+
return (_ref = (_configProvider$local = configProvider === null || configProvider === void 0 ? void 0 : configProvider.locale) !== null && _configProvider$local !== void 0 ? _configProvider$local : I18N_MESSAGES[LOCALE.value]) !== null && _ref !== void 0 ? _ref : I18N_MESSAGES[DEFAULT_LOCALE];
|
|
38
39
|
});
|
|
39
40
|
const locale = computed(() => i18nMessage.value.locale);
|
|
40
41
|
const transform = (key, ...args) => {
|
|
@@ -60,4 +61,4 @@ var useI18n = () => {
|
|
|
60
61
|
};
|
|
61
62
|
};
|
|
62
63
|
//#endregion
|
|
63
|
-
export { addI18nMessages, getLocale, useI18n, useLocale };
|
|
64
|
+
export { DEFAULT_LOCALE, DEFAULT_LOCALE_KEY, addI18nMessages, getLocale, useI18n, useLocale };
|
package/es/locale/interface.d.ts
CHANGED
|
@@ -151,6 +151,17 @@ export interface SdA11yLang {
|
|
|
151
151
|
goToSlide: string;
|
|
152
152
|
characterOf: string;
|
|
153
153
|
qrCode: string;
|
|
154
|
+
thinkingOrb: {
|
|
155
|
+
working: string;
|
|
156
|
+
searching: string;
|
|
157
|
+
solving: string;
|
|
158
|
+
listening: string;
|
|
159
|
+
connecting: string;
|
|
160
|
+
weaving: string;
|
|
161
|
+
composing: string;
|
|
162
|
+
breathing: string;
|
|
163
|
+
shaping: string;
|
|
164
|
+
};
|
|
154
165
|
}
|
|
155
166
|
export interface SdLang {
|
|
156
167
|
locale: string;
|
package/es/locale/lang/en-us.js
CHANGED
|
@@ -192,7 +192,18 @@ var lang = {
|
|
|
192
192
|
slideOf: "Slide {0} of {1}",
|
|
193
193
|
goToSlide: "Go to slide {0}",
|
|
194
194
|
characterOf: "Character {0} of {1}",
|
|
195
|
-
qrCode: "QR code: {0}"
|
|
195
|
+
qrCode: "QR code: {0}",
|
|
196
|
+
thinkingOrb: {
|
|
197
|
+
working: "Working…",
|
|
198
|
+
searching: "Searching…",
|
|
199
|
+
solving: "Solving…",
|
|
200
|
+
listening: "Listening…",
|
|
201
|
+
connecting: "Connecting…",
|
|
202
|
+
weaving: "Weaving…",
|
|
203
|
+
composing: "Composing…",
|
|
204
|
+
breathing: "Thinking…",
|
|
205
|
+
shaping: "Shaping…"
|
|
206
|
+
}
|
|
196
207
|
},
|
|
197
208
|
sender: {
|
|
198
209
|
messageInput: "Message input",
|
package/es/locale/lang/zh-cn.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DEFAULT_LOCALE } from "../constant.js";
|
|
1
2
|
//#region components/locale/lang/zh-cn.ts
|
|
2
3
|
var calendarLang = {
|
|
3
4
|
formatYear: "YYYY 年",
|
|
@@ -69,7 +70,7 @@ var calendarLang = {
|
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
72
|
var lang = {
|
|
72
|
-
locale:
|
|
73
|
+
locale: DEFAULT_LOCALE,
|
|
73
74
|
readonlyTip: "当前为只读模式",
|
|
74
75
|
empty: { description: "暂无数据" },
|
|
75
76
|
drawer: {
|
|
@@ -245,7 +246,18 @@ var lang = {
|
|
|
245
246
|
slideOf: "第 {0} 张,共 {1} 张",
|
|
246
247
|
goToSlide: "跳转到第 {0} 张",
|
|
247
248
|
characterOf: "第 {0} 个字符,共 {1} 个",
|
|
248
|
-
qrCode: "二维码:{0}"
|
|
249
|
+
qrCode: "二维码:{0}",
|
|
250
|
+
thinkingOrb: {
|
|
251
|
+
working: "正在工作",
|
|
252
|
+
searching: "正在搜索",
|
|
253
|
+
solving: "正在求解",
|
|
254
|
+
listening: "正在聆听",
|
|
255
|
+
connecting: "正在连接",
|
|
256
|
+
weaving: "正在编织",
|
|
257
|
+
composing: "正在组织内容",
|
|
258
|
+
breathing: "正在思考",
|
|
259
|
+
shaping: "正在塑形"
|
|
260
|
+
}
|
|
249
261
|
},
|
|
250
262
|
sender: {
|
|
251
263
|
messageInput: "消息输入",
|
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";
|
|
@@ -139,6 +140,7 @@ import tab_pane_default from "./tabs/tab-pane.js";
|
|
|
139
140
|
import Tabs from "./tabs/index.js";
|
|
140
141
|
import TagGroup from "./tag-group/index.js";
|
|
141
142
|
import ThemeProvider from "./theme-provider/index.js";
|
|
143
|
+
import ThinkingOrb from "./thinking-orb/index.js";
|
|
142
144
|
import item_default$1 from "./timeline/item.js";
|
|
143
145
|
import Timeline from "./timeline/index.js";
|
|
144
146
|
import Tour from "./tour/index.js";
|
|
@@ -193,6 +195,7 @@ var components = {
|
|
|
193
195
|
JsonForm,
|
|
194
196
|
KvList,
|
|
195
197
|
Input,
|
|
198
|
+
InputMask,
|
|
196
199
|
InputNumber,
|
|
197
200
|
InputTag,
|
|
198
201
|
Mention,
|
|
@@ -221,6 +224,7 @@ var components = {
|
|
|
221
224
|
QrCode,
|
|
222
225
|
Result,
|
|
223
226
|
Spin,
|
|
227
|
+
ThinkingOrb,
|
|
224
228
|
Skeleton,
|
|
225
229
|
Breadcrumb,
|
|
226
230
|
Dropdown,
|
|
@@ -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();
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { fibDir, frac, makeProj, paint, radiusScale } from "./core.js";
|
|
2
|
+
//#region components/thinking-orb/engine/braid.ts
|
|
3
|
+
var drawBraid = (ctx, size, t, dark, o) => {
|
|
4
|
+
var _o$rsPow, _o$ghostN, _o$strandN, _o$turns;
|
|
5
|
+
const cx = size / 2;
|
|
6
|
+
const cy = size / 2;
|
|
7
|
+
const R = size / 2 * .76;
|
|
8
|
+
const pt = makeProj(t * .4, .3, cx, cy, 1);
|
|
9
|
+
const rs = radiusScale(size, (_o$rsPow = o.rsPow) !== null && _o$rsPow !== void 0 ? _o$rsPow : .6);
|
|
10
|
+
const dots = [];
|
|
11
|
+
const ghostN = (_o$ghostN = o.ghostN) !== null && _o$ghostN !== void 0 ? _o$ghostN : 150;
|
|
12
|
+
for (let i = 0; i < ghostN; i++) {
|
|
13
|
+
const d = fibDir(i, ghostN);
|
|
14
|
+
const [px, py, z] = pt(d[0] * R, d[1] * R, d[2] * R);
|
|
15
|
+
const depth = (z / R + 1) / 2;
|
|
16
|
+
dots.push({
|
|
17
|
+
x: px,
|
|
18
|
+
y: py,
|
|
19
|
+
z,
|
|
20
|
+
r: .8 * rs,
|
|
21
|
+
white: .78,
|
|
22
|
+
a: .1 + .22 * depth
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const strandN = (_o$strandN = o.strandN) !== null && _o$strandN !== void 0 ? _o$strandN : 52;
|
|
26
|
+
const turns = (_o$turns = o.turns) !== null && _o$turns !== void 0 ? _o$turns : 3;
|
|
27
|
+
for (let s = 0; s < 3; s++) {
|
|
28
|
+
const phase = s / 3 * 2 * Math.PI;
|
|
29
|
+
for (let i = 0; i < strandN; i++) {
|
|
30
|
+
var _o$rBase, _o$rDepth;
|
|
31
|
+
const u = (frac(i / strandN + t * .045) * 2 - 1) * .96;
|
|
32
|
+
const surf = Math.sqrt(Math.max(0, 1 - u * u));
|
|
33
|
+
const endFade = Math.min(1, (1 - Math.abs(u)) / .1);
|
|
34
|
+
const a = u * Math.PI * turns + phase;
|
|
35
|
+
const weave = 1 + .075 * Math.sin(u * Math.PI * turns * 2 + phase * 2 + t * .8);
|
|
36
|
+
const rr = surf * R * weave;
|
|
37
|
+
const [px, py, zr] = pt(Math.cos(a) * rr, u * R * weave, Math.sin(a) * rr);
|
|
38
|
+
const depth = (zr / R + 1) / 2;
|
|
39
|
+
dots.push({
|
|
40
|
+
x: px,
|
|
41
|
+
y: py,
|
|
42
|
+
z: zr,
|
|
43
|
+
r: (((_o$rBase = o.rBase) !== null && _o$rBase !== void 0 ? _o$rBase : 1.2) + ((_o$rDepth = o.rDepth) !== null && _o$rDepth !== void 0 ? _o$rDepth : 1.8) * depth) * rs,
|
|
44
|
+
white: .55 - .45 * depth,
|
|
45
|
+
a: endFade * (.45 + .55 * depth)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
paint(ctx, dots, dark, o.rMin);
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { drawBraid };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface Dot {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
z: number;
|
|
5
|
+
r: number;
|
|
6
|
+
white: number;
|
|
7
|
+
a?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface Line {
|
|
10
|
+
x1: number;
|
|
11
|
+
y1: number;
|
|
12
|
+
x2: number;
|
|
13
|
+
y2: number;
|
|
14
|
+
white: number;
|
|
15
|
+
a?: number;
|
|
16
|
+
w: number;
|
|
17
|
+
}
|
|
18
|
+
export type Projector = (x: number, y: number, z: number) => [number, number, number];
|
|
19
|
+
export declare function lerp(a: number, b: number, f: number): number;
|
|
20
|
+
export declare function frac(x: number): number;
|
|
21
|
+
export declare function vnoise(x: number, y: number): number;
|
|
22
|
+
export declare function hashD(a: number, b: number): number;
|
|
23
|
+
export declare function fibDir(i: number, n: number): [number, number, number];
|
|
24
|
+
export declare function angleDelta(a: number, b: number): number;
|
|
25
|
+
export declare function makeProj(yaw: number, tilt: number, cx: number, cy: number, scale: number): Projector;
|
|
26
|
+
export declare function paint(ctx: CanvasRenderingContext2D, dots: Dot[], dark: boolean, rMin?: number): void;
|
|
27
|
+
export declare function paintLines(ctx: CanvasRenderingContext2D, lines: Line[], dark: boolean): void;
|
|
28
|
+
export declare function radiusScale(size: number, pow: number): number;
|