@acorex/core 21.0.2-next.4 → 21.0.2-next.40
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/fesm2022/acorex-core-components.mjs +3 -3
- package/fesm2022/acorex-core-config.mjs +3 -3
- package/fesm2022/acorex-core-date-time.mjs +105 -91
- package/fesm2022/acorex-core-date-time.mjs.map +1 -1
- package/fesm2022/acorex-core-events.mjs +3 -3
- package/fesm2022/acorex-core-file.mjs +667 -92
- package/fesm2022/acorex-core-file.mjs.map +1 -1
- package/fesm2022/acorex-core-format.mjs +19 -19
- package/fesm2022/acorex-core-full-screen.mjs +4 -4
- package/fesm2022/acorex-core-full-screen.mjs.map +1 -1
- package/fesm2022/acorex-core-icon.mjs +3 -3
- package/fesm2022/acorex-core-image.mjs +3 -3
- package/fesm2022/acorex-core-locale.mjs +30 -13
- package/fesm2022/acorex-core-locale.mjs.map +1 -1
- package/fesm2022/acorex-core-network.mjs +4 -4
- package/fesm2022/acorex-core-network.mjs.map +1 -1
- package/fesm2022/acorex-core-pipes.mjs +3 -3
- package/fesm2022/acorex-core-platform.mjs +4 -4
- package/fesm2022/acorex-core-platform.mjs.map +1 -1
- package/fesm2022/acorex-core-storage.mjs +9 -9
- package/fesm2022/acorex-core-translation.mjs +68 -24
- package/fesm2022/acorex-core-translation.mjs.map +1 -1
- package/fesm2022/acorex-core-utils.mjs +3 -78
- package/fesm2022/acorex-core-utils.mjs.map +1 -1
- package/fesm2022/acorex-core-validation.mjs +40 -40
- package/fesm2022/acorex-core-z-index.mjs +3 -3
- package/package.json +3 -2
- package/types/acorex-core-date-time.d.ts +24 -20
- package/types/acorex-core-file.d.ts +268 -40
- package/types/acorex-core-locale.d.ts +5 -0
- package/types/acorex-core-translation.d.ts +8 -1
- package/types/acorex-core-utils.d.ts +0 -22
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as i1 from '@acorex/core/format';
|
|
2
2
|
import { AXFormatOptions, AXFormatter } from '@acorex/core/format';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
+
import { InjectionToken, Type, Provider, ModuleWithProviders } from '@angular/core';
|
|
5
|
+
import * as i2 from '@acorex/core/validation';
|
|
6
|
+
import { AXValidationRuleOptions, AXValidationRuleResult, AXValidationService, AXValidationRule } from '@acorex/core/validation';
|
|
4
7
|
|
|
5
8
|
interface AXFileSizeFormatterOptions extends AXFormatOptions {
|
|
6
9
|
format: string;
|
|
@@ -28,58 +31,283 @@ declare class AXFileSizeFormatter implements AXFormatter {
|
|
|
28
31
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXFileSizeFormatter>;
|
|
29
32
|
}
|
|
30
33
|
|
|
34
|
+
/** Human-readable file size (binary units, e.g. `41.5 MB`). */
|
|
35
|
+
declare function formatFileSizeBytes(bytes: number): string;
|
|
36
|
+
|
|
37
|
+
/** Structured copy payload from {@link AXFileType.copy}. */
|
|
38
|
+
interface AXFileCopyData {
|
|
39
|
+
/** Primary plain-text value for clipboard or previews. */
|
|
40
|
+
text: string;
|
|
41
|
+
/** Optional type-specific metadata for consumers (URLs, names, mime types, …). */
|
|
42
|
+
meta?: Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
/** Return value of {@link AXFileType.copy} — shorthand string or structured data. */
|
|
45
|
+
type AXFileCopyResult = string | AXFileCopyData | null | undefined;
|
|
46
|
+
/** Resolves clipboard/plain text from a copy result. */
|
|
47
|
+
declare function resolveFileCopyText(result: AXFileCopyResult): string | null;
|
|
48
|
+
|
|
49
|
+
/** Generic rule executed via {@link AXValidationService}. */
|
|
50
|
+
interface AXFileValidationRule {
|
|
51
|
+
rule: string;
|
|
52
|
+
options?: AXValidationRuleOptions;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Common file constraints shared by {@link AXFileType} and {@link AXFileTypeExtension}.
|
|
56
|
+
* Extension `validations` are partial and override the parent type field-by-field.
|
|
57
|
+
*/
|
|
58
|
+
interface AXFileValidations {
|
|
59
|
+
mimeTypes?: string[];
|
|
60
|
+
minSize?: number;
|
|
61
|
+
maxSize?: number;
|
|
62
|
+
rules?: AXFileValidationRule[];
|
|
63
|
+
}
|
|
64
|
+
/** Extension entry; `validations` override the parent {@link AXFileType.validations}. */
|
|
65
|
+
interface AXFileTypeExtension {
|
|
66
|
+
name: string;
|
|
67
|
+
title?: string;
|
|
68
|
+
icon?: string;
|
|
69
|
+
validations?: Partial<AXFileValidations>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Logical file category (image, video, …).
|
|
73
|
+
*
|
|
74
|
+
* - With type `validations` set: any file matching those rules is allowed; `extensions` only override when matched.
|
|
75
|
+
* - With empty / omitted `validations` and `extensions` listed: only those extensions are allowed.
|
|
76
|
+
*/
|
|
77
|
+
interface AXFileType<T = Record<string, (ctx: {
|
|
78
|
+
readAsDataUrl: (file: File | Blob) => Promise<string>;
|
|
79
|
+
platformId: object;
|
|
80
|
+
}, ...args: unknown[]) => Promise<unknown> | unknown>> {
|
|
81
|
+
name: string;
|
|
82
|
+
title?: string;
|
|
83
|
+
icon?: string;
|
|
84
|
+
validations?: AXFileValidations;
|
|
85
|
+
extensions?: AXFileTypeExtension[];
|
|
86
|
+
/** Dynamic utility functions available for this file type. */
|
|
87
|
+
utilities?: T;
|
|
88
|
+
paste?: () => Promise<unknown>;
|
|
89
|
+
/**
|
|
90
|
+
* Produce copyable content from a payload (does not write to the clipboard).
|
|
91
|
+
* Returns a plain string or {@link AXFileCopyData} with `text` and optional `meta`.
|
|
92
|
+
*/
|
|
93
|
+
copy?: (payload: unknown) => Promise<AXFileCopyResult> | AXFileCopyResult;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Contributes {@link AXFileType} entries (multi provider). */
|
|
97
|
+
declare abstract class AXFileTypeInfoProvider {
|
|
98
|
+
abstract items(): Promise<AXFileType[]>;
|
|
99
|
+
}
|
|
100
|
+
declare const AX_FILE_TYPE_INFO_PROVIDER: InjectionToken<AXFileTypeInfoProvider[]>;
|
|
101
|
+
declare function provideFileTypeInfoProvider(provider: Type<AXFileTypeInfoProvider>): Provider;
|
|
102
|
+
|
|
103
|
+
declare class AXFileTypeRegistryService {
|
|
104
|
+
private readonly validation;
|
|
105
|
+
private readonly providers;
|
|
106
|
+
private readonly registeredTypes;
|
|
107
|
+
private cache;
|
|
108
|
+
/** Registers or replaces catalog entries (e.g. from feature bootstrap). */
|
|
109
|
+
registerTypes(types: AXFileType[]): void;
|
|
110
|
+
invalidateCache(): void;
|
|
111
|
+
private resolveTypes;
|
|
112
|
+
getTypes(): Promise<AXFileType[]>;
|
|
113
|
+
get(name: string): Promise<AXFileType | undefined>;
|
|
114
|
+
accept(typeNames?: string | string[]): Promise<string>;
|
|
115
|
+
matchType(file: File): Promise<AXFileType | undefined>;
|
|
116
|
+
validate(file: File, typeName: string): Promise<AXValidationRuleResult[]>;
|
|
117
|
+
validateAgainstTypes(file: File, typeNames: string | string[]): Promise<AXValidationRuleResult[]>;
|
|
118
|
+
validateMany(files: File[], typeNames: string | string[]): Promise<{
|
|
119
|
+
accepted: File[];
|
|
120
|
+
rejected: {
|
|
121
|
+
file: File;
|
|
122
|
+
errors: AXValidationRuleResult[];
|
|
123
|
+
}[];
|
|
124
|
+
}>;
|
|
125
|
+
private matchesMime;
|
|
126
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXFileTypeRegistryService, never>;
|
|
127
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXFileTypeRegistryService>;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Merges type-level validations with extension overrides (extension wins per field). */
|
|
131
|
+
declare function mergeFileValidations(base: AXFileValidations, override?: Partial<AXFileValidations>): AXFileValidations;
|
|
132
|
+
/** Resolved validations for a type + optional extension. */
|
|
133
|
+
declare function resolveFileValidations(type: AXFileType, extension?: AXFileTypeExtension): AXFileValidations;
|
|
134
|
+
/** True when no mime/size/rules are defined on the type. */
|
|
135
|
+
declare function isEmptyFileValidations(validations?: AXFileValidations): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Extension-only mode: empty type `validations` and a non-empty `extensions` list.
|
|
138
|
+
* Files must match a listed extension; rules come from that extension entry.
|
|
139
|
+
*/
|
|
140
|
+
declare function isExtensionsOnlyType(type: AXFileType): boolean;
|
|
141
|
+
/** File extension from name (lowercase, no dot). */
|
|
142
|
+
declare function getFileExtension(fileName: string): string;
|
|
143
|
+
/** Matching extension entry for a file within a type, if any. */
|
|
144
|
+
declare function findFileTypeExtension(file: File, type: AXFileType): AXFileTypeExtension | undefined;
|
|
145
|
+
|
|
146
|
+
/** Maps {@link AXFileValidations} to executable validation entries. */
|
|
147
|
+
declare function fileValidationsToRules(validations: AXFileValidations): AXFileValidationRule[];
|
|
148
|
+
/** Failed validation results; empty array means the file is valid. */
|
|
149
|
+
declare function validateFileWithValidations(validation: AXValidationService, file: File, validations: AXFileValidations): Promise<AXValidationRuleResult[]>;
|
|
150
|
+
/** Validates a file against a type; extension rules override when the file name matches. */
|
|
151
|
+
declare function validateFileAgainstType(validation: AXValidationService, file: File, type: AXFileType, extension?: AXFileTypeExtension): Promise<AXValidationRuleResult[]>;
|
|
152
|
+
|
|
153
|
+
declare const AX_AUDIO_FILE_TYPE: AXFileType;
|
|
154
|
+
declare class AXAudioFileTypeProvider extends AXFileTypeInfoProvider {
|
|
155
|
+
items(): Promise<AXFileType[]>;
|
|
156
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXAudioFileTypeProvider, never>;
|
|
157
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXAudioFileTypeProvider>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** Extension-only: no type `validations` — only listed extensions are allowed. */
|
|
161
|
+
declare const AX_DOCUMENT_FILE_TYPE: AXFileType;
|
|
162
|
+
declare class AXDocumentFileTypeProvider extends AXFileTypeInfoProvider {
|
|
163
|
+
items(): Promise<AXFileType[]>;
|
|
164
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXDocumentFileTypeProvider, never>;
|
|
165
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXDocumentFileTypeProvider>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
declare const AX_FILE_FILE_TYPE: AXFileType;
|
|
169
|
+
declare class AXFileFileTypeProvider extends AXFileTypeInfoProvider {
|
|
170
|
+
items(): Promise<AXFileType[]>;
|
|
171
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXFileFileTypeProvider, never>;
|
|
172
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXFileFileTypeProvider>;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
declare const AX_IMAGE_FILE_TYPE: AXFileType;
|
|
176
|
+
declare class AXImageFileTypeProvider extends AXFileTypeInfoProvider {
|
|
177
|
+
items(): Promise<AXFileType[]>;
|
|
178
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXImageFileTypeProvider, never>;
|
|
179
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXImageFileTypeProvider>;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
declare const AX_VIDEO_FILE_TYPE: AXFileType;
|
|
183
|
+
declare class AXVideoFileTypeProvider extends AXFileTypeInfoProvider {
|
|
184
|
+
items(): Promise<AXFileType[]>;
|
|
185
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXVideoFileTypeProvider, never>;
|
|
186
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXVideoFileTypeProvider>;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** Built-in file type provider classes (one logical type per provider). */
|
|
190
|
+
declare const AX_BUILTIN_FILE_TYPE_PROVIDERS: readonly [typeof AXImageFileTypeProvider, typeof AXVideoFileTypeProvider, typeof AXAudioFileTypeProvider, typeof AXFileFileTypeProvider, typeof AXDocumentFileTypeProvider];
|
|
191
|
+
/** Registers all built-in file type providers (image, video, audio, file, document). */
|
|
192
|
+
declare function provideBuiltinFileTypeProviders(): Provider[];
|
|
193
|
+
/** @deprecated Use {@link provideBuiltinFileTypeProviders}. */
|
|
194
|
+
declare const provideDefaultFileTypeProviders: typeof provideBuiltinFileTypeProviders;
|
|
195
|
+
|
|
196
|
+
interface AXFileMimeTypeValidationRuleOptions extends AXValidationRuleOptions {
|
|
197
|
+
/** MIME patterns, e.g. `image/*`, `image/png`. */
|
|
198
|
+
allowed: string[];
|
|
199
|
+
}
|
|
200
|
+
declare module '@acorex/core/validation' {
|
|
201
|
+
interface AXValidationRuleOptionsMap {
|
|
202
|
+
fileMimeType: AXFileMimeTypeValidationRuleOptions;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
declare class AXFileMimeTypeValidationRule implements AXValidationRule {
|
|
206
|
+
get name(): string;
|
|
207
|
+
validate(value: File | Blob, options: AXFileMimeTypeValidationRuleOptions): Promise<AXValidationRuleResult>;
|
|
208
|
+
private matchesMime;
|
|
209
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXFileMimeTypeValidationRule, never>;
|
|
210
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXFileMimeTypeValidationRule>;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
interface AXFileMinSizeValidationRuleOptions extends AXValidationRuleOptions {
|
|
214
|
+
/** Minimum size in bytes. */
|
|
215
|
+
minSize: number;
|
|
216
|
+
}
|
|
217
|
+
declare module '@acorex/core/validation' {
|
|
218
|
+
interface AXValidationRuleOptionsMap {
|
|
219
|
+
fileMinSize: AXFileMinSizeValidationRuleOptions;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
declare class AXFileMinSizeValidationRule implements AXValidationRule {
|
|
223
|
+
get name(): string;
|
|
224
|
+
validate(value: File | Blob, options: AXFileMinSizeValidationRuleOptions): Promise<AXValidationRuleResult>;
|
|
225
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXFileMinSizeValidationRule, never>;
|
|
226
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXFileMinSizeValidationRule>;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
interface AXFileMaxSizeValidationRuleOptions extends AXValidationRuleOptions {
|
|
230
|
+
/** Maximum size in bytes. */
|
|
231
|
+
maxSize: number;
|
|
232
|
+
}
|
|
233
|
+
declare module '@acorex/core/validation' {
|
|
234
|
+
interface AXValidationRuleOptionsMap {
|
|
235
|
+
fileMaxSize: AXFileMaxSizeValidationRuleOptions;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
declare class AXFileMaxSizeValidationRule implements AXValidationRule {
|
|
239
|
+
get name(): string;
|
|
240
|
+
validate(value: File | Blob, options: AXFileMaxSizeValidationRuleOptions): Promise<AXValidationRuleResult>;
|
|
241
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXFileMaxSizeValidationRule, never>;
|
|
242
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXFileMaxSizeValidationRule>;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** Validation rule classes to register with {@link AXValidationModule}. */
|
|
246
|
+
declare const AX_FILE_VALIDATION_RULES: readonly [typeof AXFileMimeTypeValidationRule, typeof AXFileMinSizeValidationRule, typeof AXFileMaxSizeValidationRule];
|
|
247
|
+
/** Registers file validation rules with {@link AXValidationRegistryService}. */
|
|
248
|
+
declare function provideFileValidationRules(): Provider;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Registers validation rules and optional built-in file type providers.
|
|
252
|
+
* {@link AXFileTypeRegistryService} and {@link AXFileService} are `providedIn: 'root'`.
|
|
253
|
+
*/
|
|
254
|
+
declare function provideFileTypeSystem(): Provider[];
|
|
255
|
+
|
|
256
|
+
interface AXFileModuleConfig {
|
|
257
|
+
fileTypeProviders?: Provider[];
|
|
258
|
+
includeDefaultFileTypes?: boolean;
|
|
259
|
+
}
|
|
31
260
|
declare class AXFileModule {
|
|
261
|
+
static forRoot(config?: AXFileModuleConfig): ModuleWithProviders<AXFileModule>;
|
|
262
|
+
static forChild(config?: AXFileModuleConfig): ModuleWithProviders<AXFileModule>;
|
|
32
263
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXFileModule, never>;
|
|
33
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<AXFileModule, never, [typeof i1.AXFormatModule], never>;
|
|
264
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AXFileModule, never, [typeof i1.AXFormatModule, typeof i2.AXValidationModule], never>;
|
|
34
265
|
static ɵinj: i0.ɵɵInjectorDeclaration<AXFileModule>;
|
|
35
266
|
}
|
|
36
267
|
|
|
268
|
+
interface AXFileChooseOptions {
|
|
269
|
+
/** Logical type name(s) from {@link AXFileTypeRegistryService}. When set, files are validated against the catalog. */
|
|
270
|
+
fileType?: string | string[];
|
|
271
|
+
accept?: string;
|
|
272
|
+
multiple?: boolean;
|
|
273
|
+
}
|
|
37
274
|
declare class AXFileService {
|
|
38
|
-
private document;
|
|
39
|
-
private
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
275
|
+
private readonly document;
|
|
276
|
+
private readonly fileTypes;
|
|
277
|
+
getFileTypes(): Promise<AXFileType[]>;
|
|
278
|
+
getFileType(name: string): Promise<AXFileType | undefined>;
|
|
279
|
+
getAcceptAttribute(fileType?: string | string[]): Promise<string>;
|
|
280
|
+
matchFileType(file: File): Promise<AXFileType | undefined>;
|
|
281
|
+
validate(file: File, fileType: string | string[]): Promise<AXValidationRuleResult[]>;
|
|
282
|
+
validateMany(files: File[], fileType: string | string[]): Promise<{
|
|
283
|
+
accepted: File[];
|
|
284
|
+
rejected: {
|
|
285
|
+
file: File;
|
|
286
|
+
errors: AXValidationRuleResult[];
|
|
287
|
+
}[];
|
|
288
|
+
}>;
|
|
52
289
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* @returns number | false - The size in bytes or false if not a base64 string
|
|
57
|
-
*/
|
|
58
|
-
blobToBase64: (blob: Blob) => Promise<string>;
|
|
59
|
-
/**
|
|
60
|
-
* Gets the size of a file, blob, or base64 string.
|
|
61
|
-
*
|
|
62
|
-
* @param file - The file, blob, or base64 string to get size for
|
|
63
|
-
* @returns number | false - The size in bytes or false if not a base64 string
|
|
290
|
+
* Opens a file selection dialog.
|
|
291
|
+
* With `fileType`, returns files that pass catalog validation (`accept` defaults from the catalog).
|
|
292
|
+
* Without `fileType`, returns all selected files (legacy `accept` / `multiple` only).
|
|
64
293
|
*/
|
|
294
|
+
chooseValidated(options: AXFileChooseOptions): Promise<{
|
|
295
|
+
accepted: File[];
|
|
296
|
+
rejected: {
|
|
297
|
+
file: File;
|
|
298
|
+
errors: AXValidationRuleResult[];
|
|
299
|
+
}[];
|
|
300
|
+
}>;
|
|
301
|
+
choose(options: AXFileChooseOptions): Promise<File[]>;
|
|
302
|
+
blobToBase64(blob: Blob): Promise<string>;
|
|
65
303
|
getSize(file: File | Blob | string): number | false;
|
|
66
|
-
/**
|
|
67
|
-
* Checks if a string is a valid base64 string.
|
|
68
|
-
*
|
|
69
|
-
* @param base64 - The string to check
|
|
70
|
-
* @returns boolean - True if the string is a valid base64 string
|
|
71
|
-
*/
|
|
72
304
|
isBase64(base64: string): boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Gets the size of a base64 string in bytes.
|
|
75
|
-
*
|
|
76
|
-
* @param base64 - The base64 string to get size for
|
|
77
|
-
* @returns number - The size in bytes
|
|
78
|
-
*/
|
|
79
305
|
getBase64Size(base64: string): number;
|
|
306
|
+
private resolveChooseOptions;
|
|
307
|
+
private openFileDialog;
|
|
80
308
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXFileService, never>;
|
|
81
309
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXFileService>;
|
|
82
310
|
}
|
|
83
311
|
|
|
84
|
-
export { AXFileModule, AXFileService, AXFileSizeFormatter };
|
|
85
|
-
export type { AXFileSizeFormatterOptions };
|
|
312
|
+
export { AXAudioFileTypeProvider, AXDocumentFileTypeProvider, AXFileFileTypeProvider, AXFileMaxSizeValidationRule, AXFileMimeTypeValidationRule, AXFileMinSizeValidationRule, AXFileModule, AXFileService, AXFileSizeFormatter, AXFileTypeInfoProvider, AXFileTypeRegistryService, AXImageFileTypeProvider, AXVideoFileTypeProvider, AX_AUDIO_FILE_TYPE, AX_BUILTIN_FILE_TYPE_PROVIDERS, AX_DOCUMENT_FILE_TYPE, AX_FILE_FILE_TYPE, AX_FILE_TYPE_INFO_PROVIDER, AX_FILE_VALIDATION_RULES, AX_IMAGE_FILE_TYPE, AX_VIDEO_FILE_TYPE, fileValidationsToRules, findFileTypeExtension, formatFileSizeBytes, getFileExtension, isEmptyFileValidations, isExtensionsOnlyType, mergeFileValidations, provideBuiltinFileTypeProviders, provideDefaultFileTypeProviders, provideFileTypeInfoProvider, provideFileTypeSystem, provideFileValidationRules, resolveFileCopyText, resolveFileValidations, validateFileAgainstType, validateFileWithValidations };
|
|
313
|
+
export type { AXFileChooseOptions, AXFileCopyData, AXFileCopyResult, AXFileMaxSizeValidationRuleOptions, AXFileMimeTypeValidationRuleOptions, AXFileMinSizeValidationRuleOptions, AXFileModuleConfig, AXFileSizeFormatterOptions, AXFileType, AXFileTypeExtension, AXFileValidationRule, AXFileValidations };
|
|
@@ -146,8 +146,12 @@ declare class AXLocaleModule {
|
|
|
146
146
|
declare class AXLocaleService {
|
|
147
147
|
private provider;
|
|
148
148
|
private config;
|
|
149
|
+
private document;
|
|
150
|
+
private platformId;
|
|
149
151
|
private _activeProfile;
|
|
150
152
|
activeProfile: i0.Signal<AXLocaleProfile>;
|
|
153
|
+
/** Whether the active locale uses right-to-left layout. */
|
|
154
|
+
readonly isRtl: i0.Signal<boolean>;
|
|
151
155
|
profileChanged$: rxjs.Observable<AXLocaleProfile>;
|
|
152
156
|
private originalProfile;
|
|
153
157
|
/**
|
|
@@ -157,6 +161,7 @@ declare class AXLocaleService {
|
|
|
157
161
|
* @returns Promise<void> - Resolves when the profile is loaded and activated.
|
|
158
162
|
*/
|
|
159
163
|
setProfile(localeCode: string): Promise<void>;
|
|
164
|
+
private applyDocumentDirection;
|
|
160
165
|
/**
|
|
161
166
|
*
|
|
162
167
|
*/
|
|
@@ -113,13 +113,20 @@ declare class AXTranslationService {
|
|
|
113
113
|
readonly langChanges$: Observable<string>;
|
|
114
114
|
readonly currentLocale$: Observable<string>;
|
|
115
115
|
constructor();
|
|
116
|
+
private preloadLocaleTranslations;
|
|
117
|
+
private peekTranslation;
|
|
116
118
|
setActiveLang(lang: AXTranslateLang): void;
|
|
117
119
|
getActiveLang(): AXTranslateLang;
|
|
118
120
|
getDefaultLang(): AXTranslateLang;
|
|
121
|
+
/**
|
|
122
|
+
* @deprecated Use {@link translateAsync} instead. `translateAsync` now accepts
|
|
123
|
+
* `string | AXMultiLanguageMap | null | undefined` and performs the same
|
|
124
|
+
* multi-language resolution in addition to translation.
|
|
125
|
+
*/
|
|
119
126
|
resolve(value: string | AXMultiLanguageMap | null | undefined, locale?: string): string;
|
|
120
127
|
toLocaleMap(value: string | AXMultiLanguageMap | null | undefined, activeLocale?: string): AXMultiLanguageMap;
|
|
121
128
|
translate$(value: string | AXMultiLanguageMap | null | undefined, options?: AXTranslateOptions): Observable<string>;
|
|
122
|
-
translateAsync(text: string, options?: AXTranslateOptions): Promise<string>;
|
|
129
|
+
translateAsync(text: string | AXMultiLanguageMap | null | undefined, options?: AXTranslateOptions): Promise<string>;
|
|
123
130
|
translateSync(text: string, options?: AXTranslateOptions & {
|
|
124
131
|
waitForLoad?: boolean;
|
|
125
132
|
timeoutMs?: number;
|
|
@@ -105,28 +105,6 @@ declare class AXHtmlUtil {
|
|
|
105
105
|
* Utility function to find scrollable parent elements
|
|
106
106
|
*/
|
|
107
107
|
static getScrollableParents(element: HTMLElement): HTMLElement[];
|
|
108
|
-
/**
|
|
109
|
-
* Resolves the closest ACoreX size for `element`: both the **HTMLElement** and the
|
|
110
|
-
* **class name** ({@link AX_SIZE_CLASSES}).
|
|
111
|
-
*
|
|
112
|
-
* 1. **Subtree of `element` only** — If any node under `element` (including itself)
|
|
113
|
-
* has a size class, returns the **deepest** such node. This prefers an inner scope
|
|
114
|
-
* (e.g. `ax-lg` on a child) when you start from a wrapper like `#ref` on a parent.
|
|
115
|
-
* 2. **Ancestors only** — Otherwise walks from `parentElement` up to `document.body`
|
|
116
|
-
* (inclusive) and returns the **nearest** ancestor that has a size class.
|
|
117
|
-
*
|
|
118
|
-
* Step 2 never scans unrelated siblings (e.g. other `ax-button` instances elsewhere on
|
|
119
|
-
* the page), which would happen if an entire `body` subtree were searched.
|
|
120
|
-
*
|
|
121
|
-
* If an element has several size tokens (unusual), the first match in
|
|
122
|
-
* {@link AX_SIZE_CLASSES} order is used.
|
|
123
|
-
*/
|
|
124
|
-
static findClosestAxSize(element: HTMLElement | null | undefined): AXClosestAxSizeMatch | null;
|
|
125
|
-
private static resolveClosestAxSizeElement;
|
|
126
|
-
private static getAxSizeClassOnElement;
|
|
127
|
-
private static elementHasAxSizeClass;
|
|
128
|
-
/** Deepest node under `root` (including `root`) whose `classList` contains a size token. */
|
|
129
|
-
private static findDeepestAxSizeInSubtree;
|
|
130
108
|
}
|
|
131
109
|
|
|
132
110
|
declare function AXAutoUnsubscriber(): (constructor: any) => void;
|