@shival99/z-ui 1.4.7 → 1.4.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shival99/z-ui",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
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" | "open" | "error" | "readonly" | null | undefined;
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" | "disabled" | "otherMonth" | "hovered" | null | undefined;
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" | "selected" | "disabled" | "current" | null | undefined;
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" | "selected" | "disabled" | "current" | null | undefined;
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" | "error" | "disabled" | "readonly" | null | undefined;
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" | "error" | "disabled" | "readonly" | null | undefined;
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" | "error" | "disabled" | "readonly" | null | undefined;
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" | "link" | "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" | null | undefined>;
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" | "open" | "error" | "disabled" | "readonly" | null | undefined;
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" | "error" | "disabled" | "readonly" | "active">;
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" | "error" | "active" | "disabled" | "readonly" | null | undefined;
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?: "pending" | "uploading" | "success" | "error" | null | undefined;
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
 
@@ -26,45 +24,12 @@ declare class ZCacheService {
26
24
  private static _decode;
27
25
  private static _getFullKey;
28
26
  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
27
  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
28
  static set<T>(key: string, data: T, encrypt?: boolean): boolean;
43
- /**
44
- * Delete a key from cache
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
- */
29
+ static delete(key: string): boolean;
30
+ static deleteMultiple(keys: string[]): boolean;
58
31
  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
32
  static has(key: string, encrypt?: boolean): boolean;
65
- /**
66
- * Get all keys with the configured prefix
67
- */
68
33
  static keys(): string[];
69
34
  }
70
35
 
@@ -307,26 +272,27 @@ interface ZHttpNetworkCheck {
307
272
  }
308
273
 
309
274
  interface ZIndexDbStoreConfig {
310
- /** Name of the store */
311
275
  name: string;
312
- /** Whether to encrypt data (default: true) */
313
276
  encrypt?: boolean;
314
- /** Keys to avoid during clear operation */
315
277
  protectedKeys?: string[];
316
278
  }
317
279
  interface ZIndexDbConfig {
318
- /** Database name */
319
280
  dbName?: string;
320
- /** Database version */
321
281
  version?: number;
322
- /** Transaction mode */
323
282
  mode?: IDBTransactionMode;
324
- /** Store configurations - supports multiple stores */
325
283
  stores?: ZIndexDbStoreConfig[];
326
- /** Default store name (for backward compatibility) */
327
284
  defaultStore?: string;
328
- /** Keys to avoid during clear operation (global) */
329
285
  protectedKeys?: string[];
286
+ encrypt?: boolean;
287
+ }
288
+ interface ZIndexDbGetOptions<T = unknown> {
289
+ defaultValue?: T;
290
+ storeName?: string;
291
+ encrypt?: boolean;
292
+ }
293
+ interface ZIndexDbSetOptions {
294
+ storeName?: string;
295
+ encrypt?: boolean;
330
296
  }
331
297
 
332
298
  declare class ZIndexDbService {
@@ -338,10 +304,18 @@ declare class ZIndexDbService {
338
304
  private _stores;
339
305
  private _defaultStoreName;
340
306
  private _globalProtectedKeys;
307
+ private _encrypt;
341
308
  constructor(config?: ZIndexDbConfig);
342
309
  private _getStoreConfig;
343
- private _encrypt;
344
- private _decrypt;
310
+ /**
311
+ * Determines if encryption should be used.
312
+ * Priority: per-call > store-level > global
313
+ * @param storeConfig - Store configuration
314
+ * @param perCallEncrypt - Per-call encrypt override (highest priority)
315
+ */
316
+ private _shouldEncrypt;
317
+ private _encryptData;
318
+ private _decryptData;
345
319
  private _closeConnection;
346
320
  private _reconnect;
347
321
  private _withRetry;
@@ -351,15 +325,21 @@ declare class ZIndexDbService {
351
325
  private _resetDatabase;
352
326
  private _getMissingStores;
353
327
  private _ensureStoreExists;
354
- get<T>(key: string, defaultValue?: T, storeName?: string): Promise<T | undefined>;
355
- set<T>(key: string, value: T, storeName?: string): Promise<void>;
328
+ get<T>(key: string, options?: ZIndexDbGetOptions<T>): Promise<T | undefined>;
329
+ set<T>(key: string, value: T, options?: ZIndexDbSetOptions): Promise<void>;
330
+ /**
331
+ * Delete key(s) from IndexDB. If storeName not provided, deletes from all stores.
332
+ * Tries both encrypted and non-encrypted versions of the key.
333
+ */
356
334
  delete(key: string | string[], storeName?: string): Promise<void>;
335
+ private _deleteFromStore;
357
336
  clear(storeName?: string): Promise<void>;
358
337
  getAll<T = unknown>(storeName?: string): Promise<Record<string, T>>;
359
- setMultiple<T>(items: Record<string, T>, storeName?: string): Promise<void>;
338
+ setMultiple<T>(items: Record<string, T>, options?: ZIndexDbSetOptions): Promise<void>;
360
339
  getStoreNames(): string[];
361
340
  hasStore(storeName: string): boolean;
362
341
  addStore(config: ZIndexDbStoreConfig): Promise<void>;
342
+ clearAll(): Promise<void>;
363
343
  }
364
344
 
365
345
  declare class ZTranslateService {
@@ -607,4 +587,4 @@ interface ZTranslateI18nConfig {
607
587
  declare const Z_LANG_CACHE_KEY = "Z_LANGUAGE";
608
588
 
609
589
  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 };
590
+ 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 };