@acorex/core 21.0.2-next.9 → 21.0.3-next.3
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 +112 -92
- 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 +173 -142
- 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 +5 -5
- 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 +124 -5
- package/fesm2022/acorex-core-utils.mjs.map +1 -1
- package/fesm2022/acorex-core-validation.mjs +40 -40
- package/fesm2022/acorex-core-z-index.mjs +16 -10
- package/fesm2022/acorex-core-z-index.mjs.map +1 -1
- 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 +28 -1
- package/types/acorex-core-z-index.d.ts +3 -2
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Subject } from 'rxjs';
|
|
1
|
+
import { Observable, Subject } from 'rxjs';
|
|
3
2
|
import * as i1 from '@acorex/core/format';
|
|
4
3
|
import { AXFormatOptions, AXFormatter } from '@acorex/core/format';
|
|
5
4
|
import * as i0 from '@angular/core';
|
|
6
5
|
import { InjectionToken, PipeTransform } from '@angular/core';
|
|
7
|
-
import { AXTranslationService } from '@acorex/core/translation';
|
|
6
|
+
import { AXMultiLanguageString, AXTranslationService } from '@acorex/core/translation';
|
|
8
7
|
|
|
9
8
|
type TimeUnit = 'ms' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'week';
|
|
10
9
|
interface AXDateValue {
|
|
@@ -60,6 +59,10 @@ declare abstract class AXCalendar {
|
|
|
60
59
|
constructor(config: AXCalendarConfig);
|
|
61
60
|
get weekend(): number[];
|
|
62
61
|
get weekdays(): number[];
|
|
62
|
+
/**
|
|
63
|
+
* Updates week layout settings (column order and weekend days).
|
|
64
|
+
*/
|
|
65
|
+
applyWeekConfig(config: Partial<AXCalendarConfig>): void;
|
|
63
66
|
/**
|
|
64
67
|
* Returns the name of the calendar system.
|
|
65
68
|
* @returns The calendar system name (e.g., 'gregorian', 'persian', 'islamic').
|
|
@@ -83,6 +86,10 @@ declare abstract class AXCalendar {
|
|
|
83
86
|
* @returns The day of the week (1-7).
|
|
84
87
|
*/
|
|
85
88
|
abstract dayOfWeek(date: Date): number;
|
|
89
|
+
/**
|
|
90
|
+
* Returns the 0-based weekday index used for week layout (0 = Sunday … 6 = Saturday).
|
|
91
|
+
*/
|
|
92
|
+
weekdayIndex(date: Date): number;
|
|
86
93
|
/**
|
|
87
94
|
* Returns the month of the year for the given date.
|
|
88
95
|
* @param date - The date to get the month from.
|
|
@@ -154,6 +161,7 @@ declare class AXDateTime {
|
|
|
154
161
|
get dayOfMonth(): number;
|
|
155
162
|
get dayOfYear(): number;
|
|
156
163
|
get dayOfWeek(): number;
|
|
164
|
+
get weekdayIndex(): number;
|
|
157
165
|
get hour(): number;
|
|
158
166
|
get minute(): number;
|
|
159
167
|
get second(): number;
|
|
@@ -257,9 +265,11 @@ declare class AXDateTimeFormatter implements AXFormatter {
|
|
|
257
265
|
|
|
258
266
|
interface AXHolidayDate {
|
|
259
267
|
date: Date;
|
|
260
|
-
title:
|
|
268
|
+
title: AXMultiLanguageString;
|
|
269
|
+
/** Hex color used to render the holiday in scheduler views (e.g. `#ef4444`). */
|
|
270
|
+
color?: string;
|
|
261
271
|
cssClass?: string;
|
|
262
|
-
description?:
|
|
272
|
+
description?: AXMultiLanguageString;
|
|
263
273
|
[key: string]: unknown;
|
|
264
274
|
}
|
|
265
275
|
interface AXHolidaysLoaderOptions {
|
|
@@ -278,17 +288,21 @@ declare class AXHolidaysLoaderDefault implements AXHolidaysLoader {
|
|
|
278
288
|
declare const AX_DATETIME_HOLIDAYS_LOADER: InjectionToken<AXHolidaysLoader>;
|
|
279
289
|
|
|
280
290
|
declare class AXCalendarService {
|
|
281
|
-
private config;
|
|
282
291
|
private _holidaysLoader;
|
|
283
292
|
private eventService;
|
|
284
293
|
private formatService;
|
|
285
294
|
private localeService;
|
|
295
|
+
private readonly calendars;
|
|
286
296
|
get calendar(): AXCalendar;
|
|
287
297
|
private activeCalendar;
|
|
288
|
-
calendarChanges$:
|
|
298
|
+
calendarChanges$: Observable<AXCalendar>;
|
|
289
299
|
getDefaultCalendar(): AXCalendar;
|
|
290
300
|
getActiveCalendar(): AXCalendar;
|
|
291
301
|
setActiveCalendar(name: string): void;
|
|
302
|
+
private notifyCalendarChanged;
|
|
303
|
+
private buildWeekConfig;
|
|
304
|
+
private registerCalendars;
|
|
305
|
+
private applyLocaleWeekSettings;
|
|
292
306
|
onHolidaysChanged: Subject<AXHolidayDate[]>;
|
|
293
307
|
private _holidays;
|
|
294
308
|
get holidays(): AXHolidayDate[];
|
|
@@ -307,17 +321,6 @@ declare class AXCalendarService {
|
|
|
307
321
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXCalendarService>;
|
|
308
322
|
}
|
|
309
323
|
|
|
310
|
-
interface AXDateTimeConfig {
|
|
311
|
-
calendar: string;
|
|
312
|
-
calendars: {
|
|
313
|
-
[key: string]: AXCalendar;
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
declare const AX_DATETIME_CONFIG: InjectionToken<AXDateTimeConfig>;
|
|
317
|
-
declare const AXDateTimeDefaultConfig: AXDateTimeConfig;
|
|
318
|
-
type PartialDateTimeConfig = Partial<AXDateTimeConfig>;
|
|
319
|
-
declare function dateTimeConfig(config?: PartialDateTimeConfig): AXDateTimeConfig;
|
|
320
|
-
|
|
321
324
|
/**
|
|
322
325
|
* @deprecated The pipe should not be used, use format instead
|
|
323
326
|
*/
|
|
@@ -402,6 +405,7 @@ declare class AXSolarHijriCalendar extends AXCalendar {
|
|
|
402
405
|
dayOfMonth(date: Date): number;
|
|
403
406
|
dayOfYear(date: Date): number;
|
|
404
407
|
dayOfWeek(date: Date): number;
|
|
408
|
+
weekdayIndex(date: Date): number;
|
|
405
409
|
weekOfYear(date: Date): number;
|
|
406
410
|
year(date: Date): number;
|
|
407
411
|
monthOfYear(date: Date): number;
|
|
@@ -431,5 +435,5 @@ declare class AXSolarHijriCalendar extends AXCalendar {
|
|
|
431
435
|
private mod;
|
|
432
436
|
}
|
|
433
437
|
|
|
434
|
-
export { AXCalendar, AXCalendarMonth, AXCalendarService, AXDateTime,
|
|
435
|
-
export type { AXCalendarConfig,
|
|
438
|
+
export { AXCalendar, AXCalendarMonth, AXCalendarService, AXDateTime, AXDateTimeFormatter, AXDateTimeModule, AXDateTimePipe, AXDateTimeRange, AXGregorianCalendar, AXHolidaysLoaderDefault, AXSolarHijriCalendar, AXTimeDurationFormatter, AXTimeLeftFormatter, AX_DATETIME_HOLIDAYS_LOADER };
|
|
439
|
+
export type { AXCalendarConfig, AXDateTimeDisplayFormats, AXDateTimeFormatterOptions, AXDateTimePart, AXDateTimeParts, AXDateTimeUnitNames, AXDateValue, AXHolidayDate, AXHolidaysLoader, AXHolidaysLoaderOptions, AXTimeDurationFormatterOptions, AXTimeLeftFormatterOptions, AXTimeSpan, AXTimeSpanTotal, AXValidDateTimeValue, TimeUnit };
|
|
@@ -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;
|
|
@@ -83,6 +83,33 @@ declare function debounceAsync<T extends (...args: any[]) => Promise<any>>(fn: T
|
|
|
83
83
|
*/
|
|
84
84
|
declare function fallbackChain<T>(tasks: Array<() => Promise<T>>): Promise<T>;
|
|
85
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Service for applying and resetting text highlighting within specified HTML elements.
|
|
88
|
+
*/
|
|
89
|
+
declare class AXHighlightService {
|
|
90
|
+
private querySelector;
|
|
91
|
+
private searchValue;
|
|
92
|
+
/**
|
|
93
|
+
* Highlights all occurrences of a search value within the elements matching the provided query selector.
|
|
94
|
+
*
|
|
95
|
+
* @param querySelector - CSS selector to identify target elements.
|
|
96
|
+
* @param searchValue - Text to search and highlight.
|
|
97
|
+
*/
|
|
98
|
+
highlight(querySelector: string, searchValue: string): void;
|
|
99
|
+
/**
|
|
100
|
+
* Resets highlighted text within the elements matching the query selector.
|
|
101
|
+
*
|
|
102
|
+
* @param querySelector - CSS selector to clear. Falls back to the last selector used by `highlight`.
|
|
103
|
+
*/
|
|
104
|
+
clear(querySelector?: string): void;
|
|
105
|
+
private createSearchRegex;
|
|
106
|
+
private applyHighlight;
|
|
107
|
+
private recursivelyHighlight;
|
|
108
|
+
private createHighlightedHTML;
|
|
109
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXHighlightService, never>;
|
|
110
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXHighlightService>;
|
|
111
|
+
}
|
|
112
|
+
|
|
86
113
|
/** ACoreX layout size classes applied on a host or container. */
|
|
87
114
|
declare const AX_SIZE_CLASSES: readonly ["ax-xs", "ax-sm", "ax-md", "ax-lg", "ax-xl"];
|
|
88
115
|
type AXSizeClass = (typeof AX_SIZE_CLASSES)[number];
|
|
@@ -122,5 +149,5 @@ declare function getWordBoundsAtPosition(str: string, position: number): {
|
|
|
122
149
|
end: number;
|
|
123
150
|
};
|
|
124
151
|
|
|
125
|
-
export { AXAutoUnsubscriber, AXColorUtil, AXDrawingUtil, AXHtmlUtil, AXUnsubscriber, AX_SIZE_CLASSES, debounceAsync, delay, fallbackChain, getWordBoundsAtPosition, pollUntil, pollUntilAbortable, retryUntil, throttleAsync, waitFor };
|
|
152
|
+
export { AXAutoUnsubscriber, AXColorUtil, AXDrawingUtil, AXHighlightService, AXHtmlUtil, AXUnsubscriber, AX_SIZE_CLASSES, debounceAsync, delay, fallbackChain, getWordBoundsAtPosition, pollUntil, pollUntilAbortable, retryUntil, throttleAsync, waitFor };
|
|
126
153
|
export type { AXBoundingClientRect, AXClosestAxSizeMatch, AXColorFormat, AXColorMode, AXPoint, AXSizeClass };
|
|
@@ -3,12 +3,13 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
interface AXZToken {
|
|
4
4
|
id: string;
|
|
5
5
|
zIndex: number;
|
|
6
|
+
baseZIndex?: number;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
declare class AXZIndexService {
|
|
9
|
-
private
|
|
10
|
+
private stacks;
|
|
10
11
|
private active;
|
|
11
|
-
acquire(): AXZToken;
|
|
12
|
+
acquire(baseZIndex?: number): AXZToken;
|
|
12
13
|
release(token?: AXZToken | null): void;
|
|
13
14
|
bringToFront(token: AXZToken): AXZToken;
|
|
14
15
|
lastIndex(): number;
|