@wexample/js-helpers 0.0.25 → 0.0.34
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 +1 -128
- package/package.json +14 -6
- package/src/Common/AsyncConstructor.ts +47 -0
- package/src/Common/RetryBackoffScheduler.ts +64 -0
- package/src/Helper/AbstractMixin.ts +18 -0
- package/src/Helper/Animation.ts +47 -0
- package/src/Helper/Array.ts +30 -0
- package/src/Helper/Bytes.ts +12 -0
- package/src/Helper/Dom.ts +142 -0
- package/src/Helper/ElementSize.ts +87 -0
- package/src/Helper/Event.ts +30 -0
- package/src/Helper/Function.ts +5 -0
- package/src/Helper/Height.ts +20 -0
- package/src/Helper/Id.ts +3 -0
- package/src/Helper/KeyCode.ts +5 -0
- package/src/Helper/Location.ts +65 -0
- package/src/Helper/Log.ts +41 -0
- package/src/Helper/Mixin.ts +33 -0
- package/src/Helper/NodeEnv.ts +46 -0
- package/src/Helper/NodeFs.ts +37 -0
- package/src/Helper/NodePath.ts +23 -0
- package/src/Helper/Object.ts +124 -0
- package/src/Helper/Pointer.ts +3 -0
- package/src/Helper/Queue.ts +112 -0
- package/src/Helper/Reconnect.ts +170 -0
- package/src/Helper/Serialize.ts +69 -0
- package/src/Helper/String.ts +316 -0
- package/src/Helper/Time.ts +5 -0
- package/src/Helper/Transition.ts +50 -0
- package/src/Helper/Url.ts +23 -0
- package/src/Helper/Variables.ts +13 -0
- package/dist/Common/AsyncConstructor.js +0 -42
- package/dist/Common/AsyncConstructor.js.map +0 -1
- package/dist/Helper/Array.js +0 -25
- package/dist/Helper/Array.js.map +0 -1
- package/dist/Helper/Bytes.js +0 -11
- package/dist/Helper/Bytes.js.map +0 -1
- package/dist/Helper/Dom.js +0 -74
- package/dist/Helper/Dom.js.map +0 -1
- package/dist/Helper/Event.js +0 -29
- package/dist/Helper/Event.js.map +0 -1
- package/dist/Helper/Function.js +0 -4
- package/dist/Helper/Function.js.map +0 -1
- package/dist/Helper/KeyCode.js +0 -4
- package/dist/Helper/KeyCode.js.map +0 -1
- package/dist/Helper/Location.js +0 -49
- package/dist/Helper/Location.js.map +0 -1
- package/dist/Helper/Log.js +0 -27
- package/dist/Helper/Log.js.map +0 -1
- package/dist/Helper/Mixin.js +0 -29
- package/dist/Helper/Mixin.js.map +0 -1
- package/dist/Helper/Object.js +0 -90
- package/dist/Helper/Object.js.map +0 -1
- package/dist/Helper/Pointer.js +0 -4
- package/dist/Helper/Pointer.js.map +0 -1
- package/dist/Helper/Queue.js +0 -80
- package/dist/Helper/Queue.js.map +0 -1
- package/dist/Helper/String.js +0 -261
- package/dist/Helper/String.js.map +0 -1
- package/dist/Helper/Time.js +0 -6
- package/dist/Helper/Time.js.map +0 -1
- package/dist/Helper/Url.js +0 -17
- package/dist/Helper/Url.js.map +0 -1
- package/dist/Helper/Variables.js +0 -11
- package/dist/Helper/Variables.js.map +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export type SerializeForLogOptions = {
|
|
2
|
+
maxDepth?: number;
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
export function serializeForLog(
|
|
6
|
+
value: unknown,
|
|
7
|
+
options: SerializeForLogOptions = {},
|
|
8
|
+
depth = 0,
|
|
9
|
+
seen?: WeakSet<object>
|
|
10
|
+
): unknown {
|
|
11
|
+
const maxDepth = options.maxDepth ?? 5;
|
|
12
|
+
|
|
13
|
+
if (
|
|
14
|
+
value === null ||
|
|
15
|
+
typeof value === 'string' ||
|
|
16
|
+
typeof value === 'number' ||
|
|
17
|
+
typeof value === 'boolean'
|
|
18
|
+
) {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (typeof value === 'bigint') {
|
|
23
|
+
return value.toString();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (typeof value === 'undefined') {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (depth >= maxDepth) {
|
|
31
|
+
return '[MaxDepth]';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (value instanceof Error) {
|
|
35
|
+
const err = value as Error & { cause?: unknown };
|
|
36
|
+
return {
|
|
37
|
+
name: err.name,
|
|
38
|
+
message: err.message,
|
|
39
|
+
stack: err.stack,
|
|
40
|
+
cause:
|
|
41
|
+
typeof err.cause === 'undefined'
|
|
42
|
+
? undefined
|
|
43
|
+
: serializeForLog(err.cause, options, depth + 1, seen),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (Array.isArray(value)) {
|
|
48
|
+
return value.map((item) => serializeForLog(item, options, depth + 1, seen));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (typeof value === 'object') {
|
|
52
|
+
const objectValue = value as Record<string, unknown>;
|
|
53
|
+
const nextSeen = seen || new WeakSet<object>();
|
|
54
|
+
|
|
55
|
+
if (nextSeen.has(objectValue)) {
|
|
56
|
+
return '[Circular]';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
nextSeen.add(objectValue);
|
|
60
|
+
|
|
61
|
+
const output: Record<string, unknown> = {};
|
|
62
|
+
for (const [key, item] of Object.entries(objectValue)) {
|
|
63
|
+
output[key] = serializeForLog(item, options, depth + 1, nextSeen);
|
|
64
|
+
}
|
|
65
|
+
return output;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return String(value);
|
|
69
|
+
}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
const CAMEL_REGEX = /^[a-z][a-z0-9]*([A-Z][a-z0-9]*)+$/;
|
|
2
|
+
const PASCAL_REGEX = /^[A-Z][a-zA-Z0-9]*$/;
|
|
3
|
+
const CONSTANT_REGEX = /^[A-Z][A-Z0-9_]*$/;
|
|
4
|
+
const SNAKE_REGEX = /^[a-z][a-z0-9]*(_[a-z0-9]+)*$/;
|
|
5
|
+
const KEBAB_REGEX = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
|
|
6
|
+
const DOT_REGEX = /^[a-z][a-z0-9]*(\.[a-z0-9]+)*$/;
|
|
7
|
+
const PATH_REGEX = /^[a-z][a-z0-9]*(\/[a-z0-9]+)*$/;
|
|
8
|
+
const TITLE_REGEX = /^[A-Z][a-z]+(\s[A-Z][a-z]+)*$/;
|
|
9
|
+
|
|
10
|
+
const LOREM_BASE =
|
|
11
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' +
|
|
12
|
+
'Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ' +
|
|
13
|
+
'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ' +
|
|
14
|
+
'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' +
|
|
15
|
+
'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
|
|
16
|
+
|
|
17
|
+
type TranslationArgs = Record<string, unknown>;
|
|
18
|
+
|
|
19
|
+
function escapeRegExp(value: string): string {
|
|
20
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function normalizeWords(value?: string | null): string[] {
|
|
24
|
+
if (!value) return [];
|
|
25
|
+
const trimmed = value.trim();
|
|
26
|
+
if (!trimmed) return [];
|
|
27
|
+
|
|
28
|
+
let text = trimmed;
|
|
29
|
+
|
|
30
|
+
// Replace any non-alphanumeric separators with spaces.
|
|
31
|
+
text = text.replace(/[^A-Za-z0-9]+/g, ' ');
|
|
32
|
+
// Split camelCase / PascalCase.
|
|
33
|
+
text = text.replace(/([a-z0-9])([A-Z])/g, '$1 $2');
|
|
34
|
+
// Split multiple caps like "JSONParser" -> "JSON Parser".
|
|
35
|
+
text = text.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2');
|
|
36
|
+
|
|
37
|
+
return text.toLowerCase().split(/\s+/).filter(Boolean);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Casing conversions
|
|
41
|
+
export function stringToSnakeCase(value: string): string {
|
|
42
|
+
return normalizeWords(value).join('_');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function stringToKebabCase(value: string): string {
|
|
46
|
+
return normalizeWords(value).join('-');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function stringToDotCase(value: string): string {
|
|
50
|
+
return normalizeWords(value).join('.');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function stringToPathCase(value: string): string {
|
|
54
|
+
return normalizeWords(value).join('/');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function stringToCamelCase(value: string): string {
|
|
58
|
+
const words = normalizeWords(value);
|
|
59
|
+
if (!words.length) return '';
|
|
60
|
+
return (
|
|
61
|
+
words[0] +
|
|
62
|
+
words
|
|
63
|
+
.slice(1)
|
|
64
|
+
.map((w) => stringCapitalizeFirst(w))
|
|
65
|
+
.join('')
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function stringToPascalCase(value: string): string {
|
|
70
|
+
return normalizeWords(value)
|
|
71
|
+
.map((w) => stringCapitalizeFirst(w))
|
|
72
|
+
.join('');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function stringToConstantCase(value: string): string {
|
|
76
|
+
return normalizeWords(value).join('_').toUpperCase();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function stringToTitleCase(value: string): string {
|
|
80
|
+
return normalizeWords(value)
|
|
81
|
+
.map((w) => stringCapitalizeFirst(w))
|
|
82
|
+
.join(' ');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function stringConvertCaseMap(): Record<string, (text: string) => string> {
|
|
86
|
+
return {
|
|
87
|
+
snake: stringToSnakeCase,
|
|
88
|
+
kebab: stringToKebabCase,
|
|
89
|
+
camel: stringToCamelCase,
|
|
90
|
+
pascal: stringToPascalCase,
|
|
91
|
+
constant: stringToConstantCase,
|
|
92
|
+
title: stringToTitleCase,
|
|
93
|
+
dot: stringToDotCase,
|
|
94
|
+
path: stringToPathCase,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function stringConvertCase(
|
|
99
|
+
text: string,
|
|
100
|
+
toFormat: keyof ReturnType<typeof stringConvertCaseMap>
|
|
101
|
+
): string {
|
|
102
|
+
const converters = stringConvertCaseMap();
|
|
103
|
+
const converter = converters[toFormat];
|
|
104
|
+
if (!converter) {
|
|
105
|
+
throw new Error(
|
|
106
|
+
`Invalid format '${toFormat}'. Must be one of: ${Object.keys(converters).join(', ')}`
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
return converter(text);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function stringDetectCase(text: string): string {
|
|
113
|
+
if (!text || !text.trim()) return 'unknown';
|
|
114
|
+
const value = text.trim();
|
|
115
|
+
|
|
116
|
+
if (CONSTANT_REGEX.test(value)) return 'constant';
|
|
117
|
+
if (SNAKE_REGEX.test(value)) return 'snake';
|
|
118
|
+
if (KEBAB_REGEX.test(value)) return 'kebab';
|
|
119
|
+
if (DOT_REGEX.test(value)) return 'dot';
|
|
120
|
+
if (PATH_REGEX.test(value)) return 'path';
|
|
121
|
+
if (CAMEL_REGEX.test(value)) return 'camel';
|
|
122
|
+
if (PASCAL_REGEX.test(value)) return 'pascal';
|
|
123
|
+
if (TITLE_REGEX.test(value)) return 'title';
|
|
124
|
+
|
|
125
|
+
const separators =
|
|
126
|
+
(value.includes('_') ? 1 : 0) +
|
|
127
|
+
(value.includes('-') ? 1 : 0) +
|
|
128
|
+
(value.includes('.') ? 1 : 0) +
|
|
129
|
+
(value.includes('/') ? 1 : 0) +
|
|
130
|
+
(/[a-z][A-Z]/.test(value) ? 1 : 0);
|
|
131
|
+
|
|
132
|
+
if (separators > 1) return 'mixed';
|
|
133
|
+
return 'unknown';
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function stringIsCamelCase(text: string): boolean {
|
|
137
|
+
return stringDetectCase(text) === 'camel';
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function stringIsPascalCase(text: string): boolean {
|
|
141
|
+
return stringDetectCase(text) === 'pascal';
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function stringIsSnakeCase(text: string): boolean {
|
|
145
|
+
return stringDetectCase(text) === 'snake';
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function stringIsKebabCase(text: string): boolean {
|
|
149
|
+
return stringDetectCase(text) === 'kebab';
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function stringIsConstantCase(text: string): boolean {
|
|
153
|
+
return stringDetectCase(text) === 'constant';
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function stringIsDotCase(text: string): boolean {
|
|
157
|
+
return stringDetectCase(text) === 'dot';
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function stringIsPathCase(text: string): boolean {
|
|
161
|
+
return stringDetectCase(text) === 'path';
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function stringIsTitleCase(text: string): boolean {
|
|
165
|
+
return stringDetectCase(text) === 'title';
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Formatting helpers
|
|
169
|
+
export function stringCapitalizeFirst(text: string): string {
|
|
170
|
+
return text ? text.charAt(0).toUpperCase() + text.slice(1) : text;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function stringFirstLetterLower(text: string): string {
|
|
174
|
+
return text ? text.charAt(0).toLowerCase() + text.slice(1) : text;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export function stringFirstLetterUpper(text: string): string {
|
|
178
|
+
return text ? text.charAt(0).toUpperCase() + text.slice(1) : text;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function stringFormat(text: string, args: TranslationArgs): string {
|
|
182
|
+
return Object.entries(args).reduce((acc, [key, value]) => {
|
|
183
|
+
return acc.replace(new RegExp(key, 'g'), String(value));
|
|
184
|
+
}, text);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export function stringToClass(text: string): string {
|
|
188
|
+
return stringCapitalizeFirst(stringToCamelCase(text));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function stringToCamel(text: string): string {
|
|
192
|
+
return stringToCamelCase(text);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export function stringToKebab(text: string): string {
|
|
196
|
+
return stringToKebabCase(text);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export function stringToSnake(text: string): string {
|
|
200
|
+
return (
|
|
201
|
+
text
|
|
202
|
+
// Add underscore between lower and upper letters
|
|
203
|
+
.replace(/(\p{Lu}+)(\p{Lu}\p{Ll})/gu, '$1_$2')
|
|
204
|
+
// Add underscore between lower and number
|
|
205
|
+
.replace(/([\p{Ll}0-9])(\p{Lu})/gu, '$1_$2')
|
|
206
|
+
// Remove dash before numbers
|
|
207
|
+
.replace(/-(\d)/g, '$1')
|
|
208
|
+
.toLowerCase()
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export function stringToScreamingSnake(text: string): string {
|
|
213
|
+
return stringToKebab(text).replace(/-/g, '_').toUpperCase();
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function stringPathToTagName(text: string): string {
|
|
217
|
+
return text.split('/').join('-').toLowerCase();
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Build a stable identifier from a string.
|
|
222
|
+
*
|
|
223
|
+
* Rules (kept in sync with PHP `DomHelper::buildStringIdentifier()`):
|
|
224
|
+
* - Replace any non [a-zA-Z0-9-] character with '-'
|
|
225
|
+
* - Convert to kebab-case
|
|
226
|
+
* - Collapse multiple '-' into one and trim '-' at both ends
|
|
227
|
+
* - Keep legacy behavior by removing dashes before numbers (e.g. "vue-2" -> "vue2")
|
|
228
|
+
*/
|
|
229
|
+
export function stringBuildIdentifier(input: string): string {
|
|
230
|
+
const kebab = stringToKebab(input.replace(/[^a-zA-Z0-9-]/g, '-'));
|
|
231
|
+
|
|
232
|
+
return kebab
|
|
233
|
+
.replace(/-(\d)/g, '$1')
|
|
234
|
+
.replace(/-+/g, '-')
|
|
235
|
+
.replace(/^[-]+|[-]+$/g, '');
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Text utilities
|
|
239
|
+
export function stringAppendMissingLines(lines: string[], content: string): string {
|
|
240
|
+
let normalized = stringRemoveTrailingEmptyLines(content);
|
|
241
|
+
const currentLines = normalized.split('\n');
|
|
242
|
+
|
|
243
|
+
const seen = new Set(currentLines);
|
|
244
|
+
const linesToAdd: string[] = [];
|
|
245
|
+
|
|
246
|
+
for (const line of lines) {
|
|
247
|
+
if (!seen.has(line)) {
|
|
248
|
+
linesToAdd.push(line);
|
|
249
|
+
seen.add(line);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (linesToAdd.length) {
|
|
254
|
+
normalized = stringEnsureEndWithNewLine(normalized);
|
|
255
|
+
normalized += linesToAdd.join('\n') + '\n';
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
return normalized;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function stringEnsureEndWithNewLine(text: string): string {
|
|
262
|
+
return text.endsWith('\n') ? text : `${text}\n`;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export function stringRemoveTrailingEmptyLines(content: string): string {
|
|
266
|
+
if (!content) return content;
|
|
267
|
+
|
|
268
|
+
const lines = content.split('\n');
|
|
269
|
+
while (lines.length && !lines[lines.length - 1].trim()) {
|
|
270
|
+
lines.pop();
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
let result = lines.join('\n');
|
|
274
|
+
if (result && content.endsWith('\n')) {
|
|
275
|
+
result += '\n';
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return result;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export function stringGenerateLoremIpsum(length = 100): string {
|
|
282
|
+
if (length <= 0) return '';
|
|
283
|
+
|
|
284
|
+
const text = `${LOREM_BASE} `.repeat(Math.floor(length / (LOREM_BASE.length + 1)) + 1);
|
|
285
|
+
let cut = text.slice(0, length).trimEnd();
|
|
286
|
+
|
|
287
|
+
if (cut.length === length && length < text.length && !/[ .,!?;:]$/.test(cut)) {
|
|
288
|
+
const lastSpace = cut.lastIndexOf(' ');
|
|
289
|
+
if (lastSpace > 0) {
|
|
290
|
+
cut = cut.slice(0, lastSpace);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
return cut.trim();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export function stringRemovePrefix(text: string, prefix: string): string {
|
|
298
|
+
return text.replace(new RegExp(`^${escapeRegExp(prefix)}`), '');
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export function stringRenderBoolean(boolean: boolean): string {
|
|
302
|
+
return boolean ? 'True' : 'False';
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export function stringReplaceParams(text: string, params: Record<string, unknown>): string {
|
|
306
|
+
return Object.entries(params).reduce((acc, [key, value]) => {
|
|
307
|
+
return acc.replace(new RegExp(`%${escapeRegExp(key)}%`, 'g'), String(value));
|
|
308
|
+
}, text);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export function stringTruncate(text: string, limit: number): string {
|
|
312
|
+
if (limit <= 0) return '';
|
|
313
|
+
return text.length > limit ? `${text.slice(0, Math.max(0, limit - 3))}...` : text;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export default stringToKebab;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export const waitForTransitionEnd = (
|
|
2
|
+
el: HTMLElement | null,
|
|
3
|
+
propertyName: string,
|
|
4
|
+
softTimeoutMs = 50,
|
|
5
|
+
hardTimeoutMs = 1000
|
|
6
|
+
): Promise<void> => {
|
|
7
|
+
if (!el) {
|
|
8
|
+
return Promise.resolve();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return new Promise((resolve) => {
|
|
12
|
+
let started = false;
|
|
13
|
+
let resolved = false;
|
|
14
|
+
|
|
15
|
+
const clear = () => {
|
|
16
|
+
el.removeEventListener('transitionrun', onStart);
|
|
17
|
+
el.removeEventListener('transitionend', onEnd);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const finish = () => {
|
|
21
|
+
if (resolved) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
resolved = true;
|
|
25
|
+
clear();
|
|
26
|
+
resolve();
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const onStart = () => {
|
|
30
|
+
started = true;
|
|
31
|
+
window.setTimeout(finish, hardTimeoutMs);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const onEnd = (event: TransitionEvent) => {
|
|
35
|
+
if (event.target !== el || event.propertyName !== propertyName) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
finish();
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
el.addEventListener('transitionrun', onStart, { once: true });
|
|
42
|
+
el.addEventListener('transitionend', onEnd);
|
|
43
|
+
|
|
44
|
+
window.setTimeout(() => {
|
|
45
|
+
if (!started) {
|
|
46
|
+
finish();
|
|
47
|
+
}
|
|
48
|
+
}, softTimeoutMs);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function urlAppendQueryString(
|
|
2
|
+
path: string,
|
|
3
|
+
params: Record<string, string | number | boolean | undefined | null>
|
|
4
|
+
): string {
|
|
5
|
+
const url = new URL(path, 'http://dummy');
|
|
6
|
+
|
|
7
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
8
|
+
if (value !== undefined && value !== null) {
|
|
9
|
+
url.searchParams.append(key, String(value));
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
return url.pathname + url.search + url.hash;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function urlParse(url: string): URL {
|
|
17
|
+
if (!/^https?:\/\//i.test(url)) {
|
|
18
|
+
const normalized = url.startsWith('/') ? url : `/${url}`;
|
|
19
|
+
return new URL(`${window.location.origin}${normalized}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return new URL(url);
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const VARIABLES = {
|
|
2
|
+
CLOSED: 'closed',
|
|
3
|
+
COMPONENT: 'component',
|
|
4
|
+
PAGE: 'page',
|
|
5
|
+
ID: 'id',
|
|
6
|
+
OPENED: 'opened',
|
|
7
|
+
PLURAL_COMPONENT: 'components',
|
|
8
|
+
PLURAL_PAGE: 'pages',
|
|
9
|
+
} as const;
|
|
10
|
+
|
|
11
|
+
export type VariablesValue = (typeof VARIABLES)[keyof typeof VARIABLES];
|
|
12
|
+
|
|
13
|
+
export default VARIABLES;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { functionIsType } from '../Helper/Function.js';
|
|
2
|
-
export default class AsyncConstructor {
|
|
3
|
-
constructor() {
|
|
4
|
-
this._isReady = false;
|
|
5
|
-
this._readyArgs = null;
|
|
6
|
-
this.readyCallbacks = [];
|
|
7
|
-
}
|
|
8
|
-
get isReady() {
|
|
9
|
-
return this._isReady;
|
|
10
|
-
}
|
|
11
|
-
defer(fn) {
|
|
12
|
-
if (typeof queueMicrotask === 'function')
|
|
13
|
-
queueMicrotask(fn);
|
|
14
|
-
else
|
|
15
|
-
setTimeout(fn, 0);
|
|
16
|
-
}
|
|
17
|
-
ready(cb) {
|
|
18
|
-
if (this._isReady) {
|
|
19
|
-
const args = this._readyArgs ?? [];
|
|
20
|
-
this.defer(() => void cb.apply(this, args));
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
this.readyCallbacks.push(cb);
|
|
24
|
-
}
|
|
25
|
-
async readyComplete(...args) {
|
|
26
|
-
if (this._isReady)
|
|
27
|
-
return;
|
|
28
|
-
this._isReady = true;
|
|
29
|
-
this._readyArgs = args;
|
|
30
|
-
const callbacks = this.readyCallbacks.splice(0);
|
|
31
|
-
for (const cb of callbacks) {
|
|
32
|
-
if (!functionIsType(cb)) {
|
|
33
|
-
throw new TypeError('Ready callback must be a function.');
|
|
34
|
-
}
|
|
35
|
-
await cb.apply(this, args);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
seal() {
|
|
39
|
-
Object.seal(this);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=AsyncConstructor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncConstructor.js","sourceRoot":"","sources":["../../src/Common/AsyncConstructor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,CAAC,OAAO,OAAgB,gBAAgB;IAA9C;QACU,aAAQ,GAAG,KAAK,CAAC;QACjB,eAAU,GAAiB,IAAI,CAAC;QACvB,mBAAc,GAA8B,EAAE,CAAC;IAuClE,CAAC;IArCC,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAES,KAAK,CAAC,EAAc;QAC5B,IAAI,OAAO,cAAc,KAAK,UAAU;YAAE,cAAc,CAAC,EAAE,CAAC,CAAC;;YACxD,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,EAAsB;QAC1B,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,IAAK,EAAuB,CAAC;YACzD,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;YAC5C,OAAO;QACT,CAAC;QACD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IAES,KAAK,CAAC,aAAa,CAAC,GAAG,IAAW;QAC1C,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAE1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QAEvB,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAEhD,KAAK,MAAM,EAAE,IAAI,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC;gBACxB,MAAM,IAAI,SAAS,CAAC,oCAAoC,CAAC,CAAC;YAC5D,CAAC;YACD,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAES,IAAI;QACZ,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;CACF"}
|
package/dist/Helper/Array.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export function arrayDeleteItem(haystack, needle) {
|
|
2
|
-
return arrayDeleteByIndex(haystack, haystack.indexOf(needle));
|
|
3
|
-
}
|
|
4
|
-
export function arrayDeleteByIndex(haystack, index) {
|
|
5
|
-
if (index !== -1) {
|
|
6
|
-
haystack.splice(index, 1);
|
|
7
|
-
}
|
|
8
|
-
return haystack;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Functions "arguments" object may be transformed to real array for extra manipulations.
|
|
12
|
-
*/
|
|
13
|
-
export function arrayFromArguments(args) {
|
|
14
|
-
return Array.prototype.slice.call(args);
|
|
15
|
-
}
|
|
16
|
-
export function arrayShallowCopy(array) {
|
|
17
|
-
return array.slice(0);
|
|
18
|
-
}
|
|
19
|
-
export function arrayUnique(array) {
|
|
20
|
-
return array.filter((value, index) => array.indexOf(value) === index);
|
|
21
|
-
}
|
|
22
|
-
export function arrayFindByIndex(array, position) {
|
|
23
|
-
return array[position >= 0 ? position : array.length + position];
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=Array.js.map
|
package/dist/Helper/Array.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Array.js","sourceRoot":"","sources":["../../src/Helper/Array.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,eAAe,CAAI,QAAa,EAAE,MAAS;IACzD,OAAO,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAI,QAAa,EAAE,KAAa;IAChE,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACjB,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAI,IAAkB;IACtD,OAAO,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAI,KAAU;IAC5C,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,WAAW,CAAI,KAAU;IACvC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAI,KAAU,EAAE,QAAgB;IAC9D,OAAO,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC;AACnE,CAAC"}
|
package/dist/Helper/Bytes.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function bytesFormatBytes(bytes, decimals = 2) {
|
|
2
|
-
if (bytes === 0) {
|
|
3
|
-
return '0 Bytes';
|
|
4
|
-
}
|
|
5
|
-
const k = 1024;
|
|
6
|
-
const dm = decimals < 0 ? 0 : decimals;
|
|
7
|
-
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
8
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
9
|
-
return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=Bytes.js.map
|
package/dist/Helper/Bytes.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Bytes.js","sourceRoot":"","sources":["../../src/Helper/Bytes.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,QAAQ,GAAG,CAAC;IAC1D,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,GAAG,IAAI,CAAC;IACf,MAAM,EAAE,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvC,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACpE,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpD,OAAO,GAAG,UAAU,CAAC,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACnE,CAAC"}
|
package/dist/Helper/Dom.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
export const DOM_ATTRIBUTE = {
|
|
2
|
-
HREF: 'href',
|
|
3
|
-
ID: 'id',
|
|
4
|
-
REL: 'rel',
|
|
5
|
-
SRC: 'src',
|
|
6
|
-
};
|
|
7
|
-
export const DOM_ATTRIBUTE_VALUE = {
|
|
8
|
-
STYLESHEET: 'stylesheet',
|
|
9
|
-
};
|
|
10
|
-
export const DOM_INSERT_POSITION = {
|
|
11
|
-
BEFORE_END: 'beforeend',
|
|
12
|
-
};
|
|
13
|
-
export const DOM_TAG_NAME = {
|
|
14
|
-
A: 'a',
|
|
15
|
-
DIV: 'div',
|
|
16
|
-
LINK: 'link',
|
|
17
|
-
SCRIPT: 'script',
|
|
18
|
-
};
|
|
19
|
-
export function domAppendInnerHtml(el, html) {
|
|
20
|
-
el.insertAdjacentHTML(DOM_INSERT_POSITION.BEFORE_END, html);
|
|
21
|
-
}
|
|
22
|
-
export function domFindPreviousNode(el) {
|
|
23
|
-
let current = el;
|
|
24
|
-
do {
|
|
25
|
-
current = current?.previousSibling ?? null;
|
|
26
|
-
} while (current && current.nodeType === Node.TEXT_NODE);
|
|
27
|
-
return current;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Return first scrollable parent.
|
|
31
|
-
*
|
|
32
|
-
* @see https://stackoverflow.com/a/42543908/2057976
|
|
33
|
-
*/
|
|
34
|
-
export function domFindScrollParent(element, includeHidden = false) {
|
|
35
|
-
const style = getComputedStyle(element);
|
|
36
|
-
const overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/;
|
|
37
|
-
const excludeStaticParent = style.position === 'absolute';
|
|
38
|
-
if (style.position === 'fixed') {
|
|
39
|
-
return document.body;
|
|
40
|
-
}
|
|
41
|
-
let parent = element.parentElement;
|
|
42
|
-
while (parent) {
|
|
43
|
-
const parentStyle = getComputedStyle(parent);
|
|
44
|
-
if ((!excludeStaticParent || parentStyle.position !== 'static') &&
|
|
45
|
-
overflowRegex.test(parentStyle.overflow + parentStyle.overflowY + parentStyle.overflowX)) {
|
|
46
|
-
return parent;
|
|
47
|
-
}
|
|
48
|
-
parent = parent.parentElement;
|
|
49
|
-
}
|
|
50
|
-
return document.body;
|
|
51
|
-
}
|
|
52
|
-
export function domToggleMainOverlay(visible = null) {
|
|
53
|
-
const overlay = document.getElementById('main-overlay');
|
|
54
|
-
if (!overlay)
|
|
55
|
-
return;
|
|
56
|
-
const classList = overlay.classList;
|
|
57
|
-
const shouldShow = visible !== null ? visible : !classList.contains('visible');
|
|
58
|
-
classList[shouldShow ? 'add' : 'remove']('visible');
|
|
59
|
-
}
|
|
60
|
-
export function domCreateHtmlDocumentFromHtml(html) {
|
|
61
|
-
const root = document.createElement('html');
|
|
62
|
-
root.innerHTML = html;
|
|
63
|
-
return root;
|
|
64
|
-
}
|
|
65
|
-
export function domRemoveAllClasses(el, classesToRemove) {
|
|
66
|
-
for (const className of classesToRemove) {
|
|
67
|
-
el.classList.remove(className);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
export function domReplaceByOneClass(el, newState, classesToRemove) {
|
|
71
|
-
domRemoveAllClasses(el, classesToRemove);
|
|
72
|
-
el.classList.add(newState);
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=Dom.js.map
|
package/dist/Helper/Dom.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dom.js","sourceRoot":"","sources":["../../src/Helper/Dom.ts"],"names":[],"mappings":"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"}
|
package/dist/Helper/Event.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export const EVENT = {
|
|
2
|
-
CLICK: 'click',
|
|
3
|
-
DBLCLICK: 'dblclick',
|
|
4
|
-
CONTEXTMENU: 'contextmenu',
|
|
5
|
-
KEYDOWN: 'keydown',
|
|
6
|
-
KEYUP: 'keyup',
|
|
7
|
-
KEYPRESS: 'keypress',
|
|
8
|
-
INPUT: 'input',
|
|
9
|
-
CHANGE: 'change',
|
|
10
|
-
FOCUS: 'focus',
|
|
11
|
-
BLUR: 'blur',
|
|
12
|
-
SUBMIT: 'submit',
|
|
13
|
-
RESET: 'reset',
|
|
14
|
-
MOUSEUP: 'mouseup',
|
|
15
|
-
MOUSEDOWN: 'mousedown',
|
|
16
|
-
MOUSEMOVE: 'mousemove',
|
|
17
|
-
MOUSEENTER: 'mouseenter',
|
|
18
|
-
MOUSELEAVE: 'mouseleave',
|
|
19
|
-
WHEEL: 'wheel',
|
|
20
|
-
SCROLL: 'scroll',
|
|
21
|
-
RESIZE: 'resize',
|
|
22
|
-
TOUCHSTART: 'touchstart',
|
|
23
|
-
TOUCHMOVE: 'touchmove',
|
|
24
|
-
TOUCHEND: 'touchend',
|
|
25
|
-
POINTERDOWN: 'pointerdown',
|
|
26
|
-
POINTERMOVE: 'pointermove',
|
|
27
|
-
POINTERUP: 'pointerup',
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=Event.js.map
|
package/dist/Helper/Event.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Event.js","sourceRoot":"","sources":["../../src/Helper/Event.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,aAAa;IAC1B,SAAS,EAAE,WAAW;CACd,CAAC"}
|