@acorex/core 21.0.0-next.3 → 21.0.0-next.31
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/components/index.d.ts +14 -0
- package/date-time/index.d.ts +71 -0
- package/fesm2022/acorex-core-components.mjs +17 -3
- package/fesm2022/acorex-core-components.mjs.map +1 -1
- package/fesm2022/acorex-core-config.mjs +3 -3
- package/fesm2022/acorex-core-config.mjs.map +1 -1
- package/fesm2022/acorex-core-constants.mjs.map +1 -1
- package/fesm2022/acorex-core-date-time.mjs +89 -67
- package/fesm2022/acorex-core-date-time.mjs.map +1 -1
- package/fesm2022/acorex-core-events.mjs +3 -3
- package/fesm2022/acorex-core-events.mjs.map +1 -1
- package/fesm2022/acorex-core-file.mjs +53 -10
- package/fesm2022/acorex-core-file.mjs.map +1 -1
- package/fesm2022/acorex-core-format.mjs +82 -32
- package/fesm2022/acorex-core-format.mjs.map +1 -1
- package/fesm2022/acorex-core-icon.mjs +3 -3
- package/fesm2022/acorex-core-icon.mjs.map +1 -1
- package/fesm2022/acorex-core-image.mjs +11 -3
- package/fesm2022/acorex-core-image.mjs.map +1 -1
- package/fesm2022/acorex-core-locale.mjs +43 -10
- package/fesm2022/acorex-core-locale.mjs.map +1 -1
- package/fesm2022/acorex-core-memoize.mjs.map +1 -1
- package/fesm2022/acorex-core-network.mjs +3 -3
- package/fesm2022/acorex-core-network.mjs.map +1 -1
- package/fesm2022/acorex-core-pipes.mjs +9 -3
- package/fesm2022/acorex-core-pipes.mjs.map +1 -1
- package/fesm2022/acorex-core-platform.mjs +31 -10
- package/fesm2022/acorex-core-platform.mjs.map +1 -1
- package/fesm2022/acorex-core-storage.mjs +43 -12
- package/fesm2022/acorex-core-storage.mjs.map +1 -1
- package/fesm2022/acorex-core-translation.mjs +16 -16
- package/fesm2022/acorex-core-translation.mjs.map +1 -1
- package/fesm2022/acorex-core-utils.mjs +4 -4
- package/fesm2022/acorex-core-utils.mjs.map +1 -1
- package/fesm2022/acorex-core-validation.mjs +44 -40
- package/fesm2022/acorex-core-validation.mjs.map +1 -1
- package/fesm2022/acorex-core.mjs.map +1 -1
- package/file/index.d.ts +43 -0
- package/format/index.d.ts +54 -3
- package/image/index.d.ts +8 -0
- package/locale/index.d.ts +66 -0
- package/package.json +5 -5
- package/pipes/index.d.ts +6 -0
- package/platform/index.d.ts +21 -0
- package/storage/index.d.ts +31 -0
- package/validation/index.d.ts +4 -0
package/components/index.d.ts
CHANGED
|
@@ -13,7 +13,21 @@ interface AXComponentOptions {
|
|
|
13
13
|
declare class AXComponentService {
|
|
14
14
|
private appRef;
|
|
15
15
|
private getRootViewContainerRef;
|
|
16
|
+
/**
|
|
17
|
+
* Creates and inserts a component instance into the application's root ViewContainerRef.
|
|
18
|
+
*
|
|
19
|
+
* @typeParam T - Component class type
|
|
20
|
+
* @param content - Component type to instantiate
|
|
21
|
+
* @returns Promise<ComponentRef<T>> - Reference to the created component
|
|
22
|
+
*/
|
|
16
23
|
createFromComponent<T>(content: AXComponentType<T>): Promise<ComponentRef<T>>;
|
|
24
|
+
/**
|
|
25
|
+
* Creates and inserts an embedded view from a TemplateRef into the application's root ViewContainerRef.
|
|
26
|
+
*
|
|
27
|
+
* @typeParam T - Template context type
|
|
28
|
+
* @param content - TemplateRef to render
|
|
29
|
+
* @returns Promise<EmbeddedViewRef<T>> - Reference to the created embedded view
|
|
30
|
+
*/
|
|
17
31
|
createFromTemplate<T>(content: TemplateRef<T>): Promise<EmbeddedViewRef<T>>;
|
|
18
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXComponentService, never>;
|
|
19
33
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXComponentService>;
|
package/date-time/index.d.ts
CHANGED
|
@@ -60,18 +60,88 @@ declare abstract class AXCalendar {
|
|
|
60
60
|
constructor(config: AXCalendarConfig);
|
|
61
61
|
get weekend(): number[];
|
|
62
62
|
get weekdays(): number[];
|
|
63
|
+
/**
|
|
64
|
+
* Returns the name of the calendar system.
|
|
65
|
+
* @returns The calendar system name (e.g., 'gregorian', 'persian', 'islamic').
|
|
66
|
+
*/
|
|
63
67
|
abstract name(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the day of the month for the given date.
|
|
70
|
+
* @param date - The date to get the day of month from.
|
|
71
|
+
* @returns The day of the month (1-31).
|
|
72
|
+
*/
|
|
64
73
|
abstract dayOfMonth(date: Date): number;
|
|
74
|
+
/**
|
|
75
|
+
* Returns the day of the year for the given date.
|
|
76
|
+
* @param date - The date to get the day of year from.
|
|
77
|
+
* @returns The day of the year (1-365/366).
|
|
78
|
+
*/
|
|
65
79
|
abstract dayOfYear(date: Date): number;
|
|
80
|
+
/**
|
|
81
|
+
* Returns the day of the week for the given date.
|
|
82
|
+
* @param date - The date to get the day of week from.
|
|
83
|
+
* @returns The day of the week (1-7).
|
|
84
|
+
*/
|
|
66
85
|
abstract dayOfWeek(date: Date): number;
|
|
86
|
+
/**
|
|
87
|
+
* Returns the month of the year for the given date.
|
|
88
|
+
* @param date - The date to get the month from.
|
|
89
|
+
* @returns The month of the year (1-12).
|
|
90
|
+
*/
|
|
67
91
|
abstract monthOfYear(date: Date): number;
|
|
92
|
+
/**
|
|
93
|
+
* Returns the week of the year for the given date.
|
|
94
|
+
* @param date - The date to get the week from.
|
|
95
|
+
* @returns The week of the year (1-52/53).
|
|
96
|
+
*/
|
|
68
97
|
abstract weekOfYear(date: Date): number;
|
|
98
|
+
/**
|
|
99
|
+
* Returns the year for the given date.
|
|
100
|
+
* @param date - The date to get the year from.
|
|
101
|
+
* @returns The year.
|
|
102
|
+
*/
|
|
69
103
|
abstract year(date: Date): number;
|
|
104
|
+
/**
|
|
105
|
+
* Adds a specified amount of time units to the given date.
|
|
106
|
+
* @param date - The base date.
|
|
107
|
+
* @param unit - The time unit to add (day, month, year, etc.).
|
|
108
|
+
* @param amount - The amount to add.
|
|
109
|
+
* @returns A new AXDateTime instance with the added time.
|
|
110
|
+
*/
|
|
70
111
|
abstract add(date: Date, unit: TimeUnit, amount: number): AXDateTime;
|
|
112
|
+
/**
|
|
113
|
+
* Sets a specific time unit to a given value.
|
|
114
|
+
* @param date - The base date.
|
|
115
|
+
* @param unit - The time unit to set (day, month, year, etc.).
|
|
116
|
+
* @param value - The new value for the time unit.
|
|
117
|
+
* @returns A new AXDateTime instance with the set time unit.
|
|
118
|
+
*/
|
|
71
119
|
abstract set(date: Date, unit: TimeUnit, value: number): AXDateTime;
|
|
120
|
+
/**
|
|
121
|
+
* Returns the start of the specified time unit for the given date.
|
|
122
|
+
* @param date - The base date.
|
|
123
|
+
* @param unit - The time unit to get the start of (day, month, year, etc.).
|
|
124
|
+
* @returns A new AXDateTime instance representing the start of the time unit.
|
|
125
|
+
*/
|
|
72
126
|
abstract startOf(date: Date, unit: TimeUnit): AXDateTime;
|
|
127
|
+
/**
|
|
128
|
+
* Returns the end of the specified time unit for the given date.
|
|
129
|
+
* @param date - The base date.
|
|
130
|
+
* @param unit - The time unit to get the end of (day, month, year, etc.).
|
|
131
|
+
* @returns A new AXDateTime instance representing the end of the time unit.
|
|
132
|
+
*/
|
|
73
133
|
abstract endOf(date: Date, unit: TimeUnit): AXDateTime;
|
|
134
|
+
/**
|
|
135
|
+
* Creates a new AXDateTime instance from an AXDateValue object.
|
|
136
|
+
* @param value - The date value object containing date information.
|
|
137
|
+
* @returns A new AXDateTime instance.
|
|
138
|
+
*/
|
|
74
139
|
abstract create(value: AXDateValue): AXDateTime;
|
|
140
|
+
/**
|
|
141
|
+
* Parses a date string and returns a new AXDateTime instance.
|
|
142
|
+
* @param value - The date string to parse.
|
|
143
|
+
* @returns A new AXDateTime instance.
|
|
144
|
+
*/
|
|
75
145
|
abstract parse(value: string): AXDateTime;
|
|
76
146
|
}
|
|
77
147
|
declare class AXDateTime {
|
|
@@ -294,6 +364,7 @@ declare module '@acorex/core/format' {
|
|
|
294
364
|
declare class AXTimeLeftFormatter implements AXFormatter {
|
|
295
365
|
private translateService;
|
|
296
366
|
get name(): string;
|
|
367
|
+
updateInterval: number;
|
|
297
368
|
format(value: number | string | Date, options?: AXTimeLeftFormatterOptions): string;
|
|
298
369
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXTimeLeftFormatter, never>;
|
|
299
370
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXTimeLeftFormatter>;
|
|
@@ -14,16 +14,30 @@ class AXComponentService {
|
|
|
14
14
|
}
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Creates and inserts a component instance into the application's root ViewContainerRef.
|
|
19
|
+
*
|
|
20
|
+
* @typeParam T - Component class type
|
|
21
|
+
* @param content - Component type to instantiate
|
|
22
|
+
* @returns Promise<ComponentRef<T>> - Reference to the created component
|
|
23
|
+
*/
|
|
17
24
|
async createFromComponent(content) {
|
|
18
25
|
return this.getRootViewContainerRef().createComponent(content);
|
|
19
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Creates and inserts an embedded view from a TemplateRef into the application's root ViewContainerRef.
|
|
29
|
+
*
|
|
30
|
+
* @typeParam T - Template context type
|
|
31
|
+
* @param content - TemplateRef to render
|
|
32
|
+
* @returns Promise<EmbeddedViewRef<T>> - Reference to the created embedded view
|
|
33
|
+
*/
|
|
20
34
|
async createFromTemplate(content) {
|
|
21
35
|
return this.getRootViewContainerRef().createEmbeddedView(content);
|
|
22
36
|
}
|
|
23
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
24
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
37
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXComponentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
38
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXComponentService, providedIn: 'root' }); }
|
|
25
39
|
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXComponentService, decorators: [{
|
|
27
41
|
type: Injectable,
|
|
28
42
|
args: [{
|
|
29
43
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-core-components.mjs","sources":["
|
|
1
|
+
{"version":3,"file":"acorex-core-components.mjs","sources":["../../../../packages/core/components/src/lib/component.service.ts","../../../../packages/core/components/src/acorex-core-components.ts"],"sourcesContent":["import {\n ApplicationRef,\n ComponentRef,\n EmbeddedViewRef,\n inject,\n Injectable,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { AXComponentType } from './component.types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXComponentService {\n private appRef = inject(ApplicationRef);\n\n private getRootViewContainerRef(): ViewContainerRef | null {\n // Get all components in the application\n const components = this.appRef.components;\n\n if (components.length > 0) {\n const rootComponentRef: ComponentRef<any> = components[0];\n return rootComponentRef.injector.get(ViewContainerRef, null);\n }\n\n return null;\n }\n\n /**\n * Creates and inserts a component instance into the application's root ViewContainerRef.\n *\n * @typeParam T - Component class type\n * @param content - Component type to instantiate\n * @returns Promise<ComponentRef<T>> - Reference to the created component\n */\n async createFromComponent<T>(content: AXComponentType<T>): Promise<ComponentRef<T>> {\n return this.getRootViewContainerRef().createComponent<T>(content);\n }\n\n /**\n * Creates and inserts an embedded view from a TemplateRef into the application's root ViewContainerRef.\n *\n * @typeParam T - Template context type\n * @param content - TemplateRef to render\n * @returns Promise<EmbeddedViewRef<T>> - Reference to the created embedded view\n */\n async createFromTemplate<T>(content: TemplateRef<T>): Promise<EmbeddedViewRef<T>> {\n return this.getRootViewContainerRef().createEmbeddedView(content);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAca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return get(v2, parts[parts.length - 1], defaultValue);
|
|
22
22
|
}
|
|
23
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
24
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
23
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
24
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXConfigService, providedIn: 'root' }); }
|
|
25
25
|
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXConfigService, decorators: [{
|
|
27
27
|
type: Injectable,
|
|
28
28
|
args: [{ providedIn: 'root' }]
|
|
29
29
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-core-config.mjs","sources":["
|
|
1
|
+
{"version":3,"file":"acorex-core-config.mjs","sources":["../../../../packages/core/config/src/lib/configs.ts","../../../../packages/core/config/src/lib/configs.service.ts","../../../../packages/core/config/src/acorex-core-config.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport type AXGlobalConfig = {\n [key: string]: unknown;\n};\n\nexport const AXGlobalDefaultConfig: AXGlobalConfig = {};\n\nexport const AX_GLOBAL_CONFIG = new InjectionToken<AXGlobalConfig>('AX_GLOBAL_CONFIG', {\n providedIn: 'root',\n factory: () => AXGlobalDefaultConfig,\n});\n","import { Injectable, InjectionToken, Injector, inject } from '@angular/core';\nimport { get } from 'lodash-es';\nimport { AX_GLOBAL_CONFIG } from './configs';\n\n@Injectable({ providedIn: 'root' })\nexport class AXConfigService {\n private injector = inject(Injector);\n\n public get<T = string>(key: string, defaultValue?: T) {\n const v1 = this.injector.get(AX_GLOBAL_CONFIG);\n const parts = key.split('.');\n const tokenName = parts.slice(0, parts.length - 1).join('.');\n const providerToken = get(v1, tokenName);\n const v2 = this.injector.get(providerToken as InjectionToken<unknown>);\n return get(v2, parts[parts.length - 1], defaultValue);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAMO,MAAM,qBAAqB,GAAmB;MAExC,gBAAgB,GAAG,IAAI,cAAc,CAAiB,kBAAkB,EAAE;AACrF,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,qBAAqB;AACrC,CAAA;;MCNY,eAAe,CAAA;AAD5B,IAAA,WAAA,GAAA;AAEU,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAUpC,IAAA;IARQ,GAAG,CAAa,GAAW,EAAE,YAAgB,EAAA;QAClD,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC;QAC9C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;AAC5B,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC5D,MAAM,aAAa,GAAG,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC;QACxC,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAwC,CAAC;AACtE,QAAA,OAAO,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC;IACvD;+GAVW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SA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