@shival99/z-ui 1.4.7 → 1.4.9
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/shival99-z-ui-providers.mjs +35 -3
- package/fesm2022/shival99-z-ui-providers.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-services.mjs +94 -79
- package/fesm2022/shival99-z-ui-services.mjs.map +1 -1
- package/package.json +1 -1
- package/types/shival99-z-ui-components-z-calendar.d.ts +4 -4
- package/types/shival99-z-ui-components-z-editor.d.ts +1 -1
- package/types/shival99-z-ui-components-z-input.d.ts +2 -2
- package/types/shival99-z-ui-components-z-modal.d.ts +1 -1
- package/types/shival99-z-ui-components-z-select.d.ts +1 -1
- package/types/shival99-z-ui-components-z-upload.d.ts +3 -3
- package/types/shival99-z-ui-providers.d.ts +23 -2
- package/types/shival99-z-ui-services.d.ts +34 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shival99/z-ui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.9",
|
|
4
4
|
"description": "Z-UI: Modern Angular UI Component Library - A comprehensive, high-performance design system built with Angular 20+, featuring 40+ customizable components with dark mode, accessibility, and enterprise-ready features.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -395,16 +395,16 @@ declare class ZCalendarComponent implements OnInit, ControlValueAccessor {
|
|
|
395
395
|
|
|
396
396
|
declare const zCalendarVariants: (props?: ({
|
|
397
397
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
398
|
-
zStatus?: "default" | "disabled" | "
|
|
398
|
+
zStatus?: "default" | "disabled" | "readonly" | "open" | "error" | null | undefined;
|
|
399
399
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
400
400
|
declare const zCalendarDayVariants: (props?: ({
|
|
401
|
-
state?: "default" | "today" | "selected" | "inRange" | "rangeStart" | "rangeEnd" | "rangeSingle" | "
|
|
401
|
+
state?: "default" | "disabled" | "today" | "selected" | "inRange" | "rangeStart" | "rangeEnd" | "rangeSingle" | "otherMonth" | "hovered" | null | undefined;
|
|
402
402
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
403
403
|
declare const zCalendarMonthVariants: (props?: ({
|
|
404
|
-
state?: "default" | "
|
|
404
|
+
state?: "default" | "current" | "disabled" | "selected" | null | undefined;
|
|
405
405
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
406
406
|
declare const zCalendarYearVariants: (props?: ({
|
|
407
|
-
state?: "default" | "
|
|
407
|
+
state?: "default" | "current" | "disabled" | "selected" | null | undefined;
|
|
408
408
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
409
409
|
|
|
410
410
|
export { ZCalendarComponent, zCalendarDayVariants, zCalendarMonthVariants, zCalendarVariants, zCalendarYearVariants };
|
|
@@ -109,7 +109,7 @@ declare class ZEditorComponent implements OnInit, ControlValueAccessor {
|
|
|
109
109
|
|
|
110
110
|
declare const zEditorVariants: (props?: ({
|
|
111
111
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
112
|
-
zStatus?: "default" | "
|
|
112
|
+
zStatus?: "default" | "disabled" | "readonly" | "error" | null | undefined;
|
|
113
113
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
114
114
|
type ZEditorVariants = VariantProps<typeof zEditorVariants>;
|
|
115
115
|
|
|
@@ -187,11 +187,11 @@ declare class ZInputComponent implements OnInit, ControlValueAccessor {
|
|
|
187
187
|
|
|
188
188
|
declare const zInputVariants: (props?: ({
|
|
189
189
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
190
|
-
zStatus?: "default" | "
|
|
190
|
+
zStatus?: "default" | "disabled" | "readonly" | "error" | null | undefined;
|
|
191
191
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
192
192
|
type ZInputVariants = VariantProps<typeof zInputVariants>;
|
|
193
193
|
declare const zTextareaVariants: (props?: ({
|
|
194
|
-
zStatus?: "default" | "
|
|
194
|
+
zStatus?: "default" | "disabled" | "readonly" | "error" | null | undefined;
|
|
195
195
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
196
196
|
type ZTextareaVariants = VariantProps<typeof zTextareaVariants>;
|
|
197
197
|
|
|
@@ -220,7 +220,7 @@ declare class ZModalComponent<T, U> extends BasePortalOutlet implements OnDestro
|
|
|
220
220
|
protected readonly effectiveOkText: _angular_core.Signal<string | null | undefined>;
|
|
221
221
|
protected readonly effectiveCancelText: _angular_core.Signal<string | null | undefined>;
|
|
222
222
|
protected readonly effectiveOkDestructive: _angular_core.Signal<boolean | undefined>;
|
|
223
|
-
protected readonly effectiveTypeOk: _angular_core.Signal<"info" | "warning" | "error" | "
|
|
223
|
+
protected readonly effectiveTypeOk: _angular_core.Signal<"info" | "warning" | "error" | "default" | "primary" | "secondary" | "destructive" | "success" | "outline" | "outline-primary" | "outline-secondary" | "outline-success" | "outline-info" | "outline-warning" | "outline-error" | "outline-destructive" | "outline-success-secondary" | "outline-info-secondary" | "outline-warning-secondary" | "outline-error-secondary" | "outline-destructive-secondary" | "outline-primary-secondary" | "ghost" | "ghost-primary" | "ghost-success" | "ghost-info" | "ghost-warning" | "ghost-error" | "ghost-destructive" | "subtle" | "link" | null | undefined>;
|
|
224
224
|
protected readonly effectiveOkDisabled: _angular_core.Signal<boolean | undefined>;
|
|
225
225
|
protected readonly effectiveLoading: _angular_core.Signal<boolean>;
|
|
226
226
|
protected readonly effectiveContentLoading: _angular_core.Signal<boolean>;
|
|
@@ -271,7 +271,7 @@ declare class ZTagClassesPipe implements PipeTransform {
|
|
|
271
271
|
|
|
272
272
|
declare const zSelectVariants: (props?: ({
|
|
273
273
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
274
|
-
zStatus?: "default" | "
|
|
274
|
+
zStatus?: "default" | "disabled" | "readonly" | "open" | "error" | null | undefined;
|
|
275
275
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
276
276
|
declare const zSelectTagVariants: (props?: ({
|
|
277
277
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
@@ -86,7 +86,7 @@ declare class ZUploadComponent implements OnInit, ControlValueAccessor {
|
|
|
86
86
|
protected readonly hasError: _angular_core.Signal<boolean>;
|
|
87
87
|
protected readonly showError: _angular_core.Signal<boolean>;
|
|
88
88
|
protected readonly errorMessage: _angular_core.Signal<string>;
|
|
89
|
-
protected readonly currentStatus: _angular_core.Signal<"default" | "
|
|
89
|
+
protected readonly currentStatus: _angular_core.Signal<"default" | "disabled" | "readonly" | "error" | "active">;
|
|
90
90
|
protected readonly dropzoneClasses: _angular_core.Signal<string>;
|
|
91
91
|
protected readonly acceptTypes: _angular_core.Signal<string>;
|
|
92
92
|
protected readonly formatFileSize: (bytes: number) => string;
|
|
@@ -125,11 +125,11 @@ declare class ZUploadComponent implements OnInit, ControlValueAccessor {
|
|
|
125
125
|
|
|
126
126
|
declare const zUploadDropzoneVariants: (props?: ({
|
|
127
127
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
128
|
-
zStatus?: "default" | "
|
|
128
|
+
zStatus?: "default" | "disabled" | "readonly" | "error" | "active" | null | undefined;
|
|
129
129
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
130
130
|
type ZUploadDropzoneVariants = VariantProps<typeof zUploadDropzoneVariants>;
|
|
131
131
|
declare const zUploadFileItemVariants: (props?: ({
|
|
132
|
-
zStatus?: "
|
|
132
|
+
zStatus?: "error" | "pending" | "uploading" | "success" | null | undefined;
|
|
133
133
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
134
134
|
type ZUploadFileItemVariants = VariantProps<typeof zUploadFileItemVariants>;
|
|
135
135
|
|
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
import { EnvironmentProviders, InjectionToken } from '@angular/core';
|
|
2
|
-
import { ZIndexDbConfig, ZIndexDbService, ZThemeConfig } from '@shival99/z-ui/services';
|
|
2
|
+
import { ZCacheConfig, ZIndexDbConfig, ZIndexDbService, ZThemeConfig } from '@shival99/z-ui/services';
|
|
3
3
|
export { ZThemeConfig, ZThemeName } from '@shival99/z-ui/services';
|
|
4
4
|
import { HttpClient } from '@angular/common/http';
|
|
5
5
|
import { TranslateLoader } from '@ngx-translate/core';
|
|
6
6
|
import { ZUITranslations } from '@shival99/z-ui/i18n';
|
|
7
7
|
|
|
8
|
+
/** Injection token for ZCacheService configuration */
|
|
9
|
+
declare const Z_CACHE_CONFIG: InjectionToken<ZCacheConfig>;
|
|
10
|
+
/**
|
|
11
|
+
* Provide Z-Cache service with configuration
|
|
12
|
+
* @param config - Cache configuration with prefix and encrypt options
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // In app.config.ts
|
|
17
|
+
* export const appConfig: ApplicationConfig = {
|
|
18
|
+
* providers: [
|
|
19
|
+
* provideZCache({
|
|
20
|
+
* prefix: 'myapp_',
|
|
21
|
+
* encrypt: false, // Disable encryption for debugging
|
|
22
|
+
* }),
|
|
23
|
+
* ],
|
|
24
|
+
* };
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare function provideZCache(config?: ZCacheConfig): EnvironmentProviders;
|
|
28
|
+
|
|
8
29
|
/** Injection token for ZIndexDbService */
|
|
9
30
|
declare const Z_INDEXDB_SERVICE: InjectionToken<ZIndexDbService>;
|
|
10
31
|
/**
|
|
@@ -126,5 +147,5 @@ interface ZTranslateProviderConfig {
|
|
|
126
147
|
declare function zCreateTranslateLoader(http: HttpClient, path?: string, extension?: string, includeZUI?: boolean, zuiOverridePath?: string, customZUI?: Partial<Record<string, ZUITranslations>>): TranslateLoader;
|
|
127
148
|
declare function provideZTranslate(config?: ZTranslateProviderConfig): EnvironmentProviders;
|
|
128
149
|
|
|
129
|
-
export { Z_INDEXDB_SERVICE, provideZIndexDb, provideZNgxMask, provideZScrollbar, provideZTheme, provideZTranslate, zCreateTranslateLoader };
|
|
150
|
+
export { Z_CACHE_CONFIG, Z_INDEXDB_SERVICE, provideZCache, provideZIndexDb, provideZNgxMask, provideZScrollbar, provideZTheme, provideZTranslate, zCreateTranslateLoader };
|
|
130
151
|
export type { ZNgxMaskConfig, ZTranslateProviderConfig };
|
|
@@ -12,9 +12,7 @@ interface ZCacheEntry<T = unknown> {
|
|
|
12
12
|
ttl: number;
|
|
13
13
|
}
|
|
14
14
|
interface ZCacheConfig {
|
|
15
|
-
/** Prefix for cache keys */
|
|
16
15
|
prefix?: string;
|
|
17
|
-
/** Whether to encrypt data */
|
|
18
16
|
encrypt?: boolean;
|
|
19
17
|
}
|
|
20
18
|
|
|
@@ -24,47 +22,15 @@ declare class ZCacheService {
|
|
|
24
22
|
static configure(config: ZCacheConfig): void;
|
|
25
23
|
private static _encode;
|
|
26
24
|
private static _decode;
|
|
25
|
+
private static _normalizeKey;
|
|
27
26
|
private static _getFullKey;
|
|
28
27
|
private static _safeOperation;
|
|
29
|
-
/**
|
|
30
|
-
* Get a value from cache
|
|
31
|
-
* @param key - Cache key
|
|
32
|
-
* @param defaultValue - Default value if not found
|
|
33
|
-
* @param encrypt - Whether to use encryption (default: service config)
|
|
34
|
-
*/
|
|
35
28
|
static get<T>(key: string, defaultValue?: T, encrypt?: boolean): T | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Set a value in cache
|
|
38
|
-
* @param key - Cache key
|
|
39
|
-
* @param data - Data to store
|
|
40
|
-
* @param encrypt - Whether to use encryption
|
|
41
|
-
*/
|
|
42
29
|
static set<T>(key: string, data: T, encrypt?: boolean): boolean;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
* @param key - Cache key
|
|
46
|
-
* @param encrypt - Whether key is encrypted
|
|
47
|
-
*/
|
|
48
|
-
static delete(key: string, encrypt?: boolean): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Delete multiple keys from cache
|
|
51
|
-
* @param keys - Array of cache keys
|
|
52
|
-
* @param encrypt - Whether keys are encrypted
|
|
53
|
-
*/
|
|
54
|
-
static deleteMultiple(keys: string[], encrypt?: boolean): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Clear all cache with the configured prefix
|
|
57
|
-
*/
|
|
30
|
+
static delete(key: string): boolean;
|
|
31
|
+
static deleteMultiple(keys: string[]): boolean;
|
|
58
32
|
static clear(): boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Check if a key exists in cache
|
|
61
|
-
* @param key - Cache key
|
|
62
|
-
* @param encrypt - Whether key is encrypted
|
|
63
|
-
*/
|
|
64
33
|
static has(key: string, encrypt?: boolean): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Get all keys with the configured prefix
|
|
67
|
-
*/
|
|
68
34
|
static keys(): string[];
|
|
69
35
|
}
|
|
70
36
|
|
|
@@ -307,26 +273,27 @@ interface ZHttpNetworkCheck {
|
|
|
307
273
|
}
|
|
308
274
|
|
|
309
275
|
interface ZIndexDbStoreConfig {
|
|
310
|
-
/** Name of the store */
|
|
311
276
|
name: string;
|
|
312
|
-
/** Whether to encrypt data (default: true) */
|
|
313
277
|
encrypt?: boolean;
|
|
314
|
-
/** Keys to avoid during clear operation */
|
|
315
278
|
protectedKeys?: string[];
|
|
316
279
|
}
|
|
317
280
|
interface ZIndexDbConfig {
|
|
318
|
-
/** Database name */
|
|
319
281
|
dbName?: string;
|
|
320
|
-
/** Database version */
|
|
321
282
|
version?: number;
|
|
322
|
-
/** Transaction mode */
|
|
323
283
|
mode?: IDBTransactionMode;
|
|
324
|
-
/** Store configurations - supports multiple stores */
|
|
325
284
|
stores?: ZIndexDbStoreConfig[];
|
|
326
|
-
/** Default store name (for backward compatibility) */
|
|
327
285
|
defaultStore?: string;
|
|
328
|
-
/** Keys to avoid during clear operation (global) */
|
|
329
286
|
protectedKeys?: string[];
|
|
287
|
+
encrypt?: boolean;
|
|
288
|
+
}
|
|
289
|
+
interface ZIndexDbGetOptions<T = unknown> {
|
|
290
|
+
defaultValue?: T;
|
|
291
|
+
storeName?: string;
|
|
292
|
+
encrypt?: boolean;
|
|
293
|
+
}
|
|
294
|
+
interface ZIndexDbSetOptions {
|
|
295
|
+
storeName?: string;
|
|
296
|
+
encrypt?: boolean;
|
|
330
297
|
}
|
|
331
298
|
|
|
332
299
|
declare class ZIndexDbService {
|
|
@@ -338,10 +305,19 @@ declare class ZIndexDbService {
|
|
|
338
305
|
private _stores;
|
|
339
306
|
private _defaultStoreName;
|
|
340
307
|
private _globalProtectedKeys;
|
|
308
|
+
private _encrypt;
|
|
341
309
|
constructor(config?: ZIndexDbConfig);
|
|
342
310
|
private _getStoreConfig;
|
|
343
|
-
|
|
344
|
-
|
|
311
|
+
/**
|
|
312
|
+
* Determines if encryption should be used.
|
|
313
|
+
* Priority: per-call > store-level > global
|
|
314
|
+
* @param storeConfig - Store configuration
|
|
315
|
+
* @param perCallEncrypt - Per-call encrypt override (highest priority)
|
|
316
|
+
*/
|
|
317
|
+
private _shouldEncrypt;
|
|
318
|
+
private _normalizeKey;
|
|
319
|
+
private _encryptData;
|
|
320
|
+
private _decryptData;
|
|
345
321
|
private _closeConnection;
|
|
346
322
|
private _reconnect;
|
|
347
323
|
private _withRetry;
|
|
@@ -351,15 +327,21 @@ declare class ZIndexDbService {
|
|
|
351
327
|
private _resetDatabase;
|
|
352
328
|
private _getMissingStores;
|
|
353
329
|
private _ensureStoreExists;
|
|
354
|
-
get<T>(key: string,
|
|
355
|
-
set<T>(key: string, value: T,
|
|
330
|
+
get<T>(key: string, options?: ZIndexDbGetOptions<T>): Promise<T | undefined>;
|
|
331
|
+
set<T>(key: string, value: T, options?: ZIndexDbSetOptions): Promise<void>;
|
|
332
|
+
/**
|
|
333
|
+
* Delete key(s) from IndexDB. If storeName not provided, deletes from all stores.
|
|
334
|
+
* Tries both encrypted and non-encrypted versions of the key.
|
|
335
|
+
*/
|
|
356
336
|
delete(key: string | string[], storeName?: string): Promise<void>;
|
|
337
|
+
private _deleteFromStore;
|
|
357
338
|
clear(storeName?: string): Promise<void>;
|
|
358
339
|
getAll<T = unknown>(storeName?: string): Promise<Record<string, T>>;
|
|
359
|
-
setMultiple<T>(items: Record<string, T>,
|
|
340
|
+
setMultiple<T>(items: Record<string, T>, options?: ZIndexDbSetOptions): Promise<void>;
|
|
360
341
|
getStoreNames(): string[];
|
|
361
342
|
hasStore(storeName: string): boolean;
|
|
362
343
|
addStore(config: ZIndexDbStoreConfig): Promise<void>;
|
|
344
|
+
clearAll(): Promise<void>;
|
|
363
345
|
}
|
|
364
346
|
|
|
365
347
|
declare class ZTranslateService {
|
|
@@ -607,4 +589,4 @@ interface ZTranslateI18nConfig {
|
|
|
607
589
|
declare const Z_LANG_CACHE_KEY = "Z_LANGUAGE";
|
|
608
590
|
|
|
609
591
|
export { ZCacheService, ZExcelService, ZHttpAbstractService, ZIndexDbService, ZSubjectService, ZThemeService, ZTranslateService, Z_DARK_MODE_CACHE_KEY, Z_DEFAULT_THEME, Z_EXCEL_BORDER_THIN, Z_EXCEL_CHAR_WIDTH_MAP, Z_EXCEL_COLORS, Z_EXCEL_DEFAULT_CONFIG, Z_EXCEL_FONT_MULTIPLIERS, Z_EXCEL_WIDTH_LIMITS, Z_HTTP_DEFAULT_CONFIG, Z_INDEXDB_BATCH_SIZE, Z_INDEXDB_DEFAULT_CONFIG, Z_INDEXDB_MAX_VERSION, Z_LANG_CACHE_KEY, Z_THEME_CACHE_KEY, Z_THEME_CONFIG, Z_THEME_CONFIG_CACHE_KEY, Z_THEME_CSS_MAP };
|
|
610
|
-
export type { ZCacheConfig, ZCacheEntry, ZExcelAlign, ZExcelCell, ZExcelCellContext, ZExcelColumnConfig, ZExcelConfig, ZExcelDefaultConfig, ZExcelExportOptions, ZExcelExportResult, ZExcelFontConfig, ZExcelFromTableConfig, ZExcelHeaderColors, ZExcelHeaderContext, ZExcelSheetSource, ZExcelTableColumnConfig, ZExcelTableHeaderConfig, ZExcelToastHandler, ZHttpBaseOptions, ZHttpCacheEntry, ZHttpConfig, ZHttpContentType, ZHttpError, ZHttpNetworkCheck, ZHttpOptions, ZHttpParamsType, ZIndexDbConfig, ZIndexDbStoreConfig, ZTableToExcelColumn, ZThemeConfig, ZThemeName, ZTranslateConfig, ZTranslateI18nConfig };
|
|
592
|
+
export type { ZCacheConfig, ZCacheEntry, ZExcelAlign, ZExcelCell, ZExcelCellContext, ZExcelColumnConfig, ZExcelConfig, ZExcelDefaultConfig, ZExcelExportOptions, ZExcelExportResult, ZExcelFontConfig, ZExcelFromTableConfig, ZExcelHeaderColors, ZExcelHeaderContext, ZExcelSheetSource, ZExcelTableColumnConfig, ZExcelTableHeaderConfig, ZExcelToastHandler, ZHttpBaseOptions, ZHttpCacheEntry, ZHttpConfig, ZHttpContentType, ZHttpError, ZHttpNetworkCheck, ZHttpOptions, ZHttpParamsType, ZIndexDbConfig, ZIndexDbGetOptions, ZIndexDbSetOptions, ZIndexDbStoreConfig, ZTableToExcelColumn, ZThemeConfig, ZThemeName, ZTranslateConfig, ZTranslateI18nConfig };
|