@decaf-ts/for-angular 0.0.52 → 0.0.53

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Type, Injector, ElementRef, EnvironmentInjector, OnChanges, OnDestroy, ChangeDetectorRef, Renderer2, EventEmitter, SimpleChanges, ViewContainerRef, TemplateRef, OnInit, AfterViewInit, ComponentMirror, ComponentRef, InjectionToken, Provider, EnvironmentProviders, ModuleWithProviders } from '@angular/core';
2
+ import { Type, Injector, ElementRef, EnvironmentInjector, EnvironmentProviders, Provider, OnChanges, OnDestroy, ChangeDetectorRef, Renderer2, EventEmitter, SimpleChanges, ViewContainerRef, TemplateRef, OnInit, AfterViewInit, ComponentMirror, ComponentRef, InjectionToken, ModuleWithProviders } from '@angular/core';
3
3
  import { IonInput, IonSelect, IonTextarea, IonCheckbox, SpinnerTypes, InfiniteScrollCustomEvent, RefresherCustomEvent, MenuController } from '@ionic/angular';
4
4
  import { TextFieldTypes, SelectInterface, AutocompleteTypes, CheckboxCustomEvent, Color, PredefinedColors, OverlayEventDetail } from '@ionic/core';
5
5
  import * as i2 from '@angular/forms';
@@ -243,6 +243,7 @@ interface InputOption {
243
243
  text: string;
244
244
  value: string | number;
245
245
  disabled?: StringOrBoolean;
246
+ hidden?: StringOrBoolean;
246
247
  className?: string;
247
248
  icon?: string;
248
249
  }
@@ -968,6 +969,13 @@ type LayoutGridGap = (typeof LayoutGridGaps)[keyof typeof LayoutGridGaps];
968
969
  * @memberOf module:lib/engine/types
969
970
  */
970
971
  type ListItemPosition = (typeof ListItemPositions)[keyof typeof ListItemPositions];
972
+ /**
973
+ * @description Represents an Angular dependency injection provider.
974
+ * @summary This type is a union of Angular's `EnvironmentProviders` and `Provider` types, allowing for flexible DI configuration.
975
+ * @typedef {EnvironmentProviders | Provider} AngularProvider
976
+ * @memberOf module:lib/engine/types
977
+ */
978
+ type AngularProvider = EnvironmentProviders | Provider;
971
979
 
972
980
  /**
973
981
  * @module NgxMediaService
@@ -2891,11 +2899,11 @@ declare class CrudFieldComponent extends NgxFormFieldDirective implements OnInit
2891
2899
  * @summary Indicates whether the field labels should be translated based on the current language settings.
2892
2900
  * This is useful for applications supporting multiple languages.
2893
2901
  *
2894
- * @type {StringOrBoolean}
2902
+ * @type {boolean}
2895
2903
  * @default true
2896
2904
  * @memberOf CrudFieldComponent
2897
2905
  */
2898
- translatable: StringOrBoolean;
2906
+ translatable: boolean;
2899
2907
  constructor();
2900
2908
  /**
2901
2909
  * @description Component initialization lifecycle method.
@@ -9250,116 +9258,6 @@ declare class DecafFakerRepository<T extends Model> {
9250
9258
  }
9251
9259
  declare function getFakerData<T extends Model>(limit: number | undefined, data: Record<string, FunctionLike>, model?: string): T[];
9252
9260
 
9253
- /**
9254
- * @description Retrieves the locale context for a given class, object, or string.
9255
- * @summary Resolves the locale context by extracting the class name or using the provided suffix.
9256
- *
9257
- * @param {FunctionLike | object | string} clazz - The class, object, or string to derive the locale context from.
9258
- * @param {string} [suffix] - An optional suffix to append to the locale context.
9259
- * @returns {string} - The resolved locale context string.
9260
- */
9261
- declare function getLocaleContext(clazz: FunctionLike | object | string, suffix?: string): string;
9262
- /**
9263
- * @description Generates a localized string by combining locale and phrase
9264
- * @summary This utility function creates a properly formatted locale string by combining
9265
- * a locale identifier with a phrase. It handles edge cases such as empty phrases,
9266
- * missing locales, and phrases that already include the locale prefix. This function
9267
- * is useful for ensuring consistent formatting of localized strings throughout the application.
9268
- *
9269
- * @param {string} locale - The locale identifier (e.g., 'en', 'fr')
9270
- * @param {string | undefined} phrase - The phrase to localize
9271
- * @return {string} The formatted locale string, or empty string if phrase is undefined
9272
- *
9273
- * @function generateLocaleFromString
9274
- * @memberOf module:for-angular
9275
- */
9276
- declare function getLocaleContextByKey(locale: string, phrase: string | undefined): string;
9277
- /**
9278
- * @description Factory function for creating an instance of I18nLoader.
9279
- * @summary Configures and returns an I18nLoader instance with the specified HTTP client and translation resources.
9280
- *
9281
- * @param {HttpClient} http - The HTTP client used to fetch translation resources.
9282
- * @returns {TranslateLoader} - An instance of I18nLoader configured with the provided HTTP client and resources.
9283
- */
9284
- declare function I18nLoaderFactory(http: HttpClient): TranslateLoader;
9285
- /**
9286
- * @description Provides the I18nLoader configuration.
9287
- * @summary Configures the translation resources and versioned suffix for the I18nLoader.
9288
- *
9289
- * @param {I18nResourceConfigType} [resources=[]] - The translation resources to be used by the loader.
9290
- * @param {boolean} [versionedSuffix=false] - Whether to append a versioned suffix to resource URLs.
9291
- * @returns {object} - The configuration object for the I18nLoader.
9292
- */
9293
- declare function provideI18nLoader(resources?: I18nResourceConfigType, versionedSuffix?: boolean): {
9294
- provide: i0.InjectionToken<I18nToken>;
9295
- useValue: {
9296
- resources: I18nResourceConfig[];
9297
- versionedSuffix: boolean;
9298
- };
9299
- };
9300
- /**
9301
- * @description Custom implementation of TranslateLoader for loading translations.
9302
- * @summary Fetches and merges translation resources, supporting versioned suffixes and recursive merging.
9303
- */
9304
- declare class I18nLoader implements TranslateLoader {
9305
- private http;
9306
- private resources;
9307
- private versionedSuffix;
9308
- /**
9309
- * @param {HttpClient} http - The HTTP client used to fetch translation resources.
9310
- * @param {I18nResourceConfig[]} [resources=[]] - The translation resources to be loaded.
9311
- * @param {boolean} [versionedSuffix=false] - Whether to append a versioned suffix to resource URLs.
9312
- */
9313
- constructor(http: HttpClient, resources?: I18nResourceConfig[], versionedSuffix?: boolean);
9314
- /**
9315
- * @description Appends a versioned suffix to the resource URL if enabled.
9316
- * @summary Generates a versioned suffix based on the current date.
9317
- *
9318
- * @param {string} suffix - The original suffix of the resource URL.
9319
- * @returns {string} - The modified suffix with a version string appended.
9320
- */
9321
- private getSuffix;
9322
- /**
9323
- * @description Fetches and merges translations for the specified language.
9324
- * @summary Loads translation resources, merges them recursively, and includes library keys.
9325
- *
9326
- * @param {string} lang - The language code for the translations to load.
9327
- * @returns {Observable<TranslationObject>} - An observable that emits the merged translation object.
9328
- */
9329
- getTranslation(lang: string): Observable<TranslationObject>;
9330
- }
9331
- /**
9332
- * @description Custom implementation of TranslateParser for interpolation.
9333
- * @summary Extends TranslateParser to support string formatting with parameters.
9334
- */
9335
- declare class I18nParser extends TranslateParser {
9336
- /**
9337
- * @description Interpolates a translation string with parameters.
9338
- * @summary Replaces placeholders in the translation string with parameter values.
9339
- *
9340
- * @param {string} value - The translation string to interpolate.
9341
- * @param {object | string} [params={}] - The parameters to replace placeholders with.
9342
- * @returns {string} - The interpolated translation string.
9343
- */
9344
- interpolate(value: string, params?: object | string): string;
9345
- }
9346
- /**
9347
- * @description Provides the internationalization (i18n) configuration for the application.
9348
- * @summary Configures the translation service with a fallback language, default language, custom parser, and loader.
9349
- *
9350
- * @param {RootTranslateServiceConfig} [config={fallbackLang: 'en', lang: 'en'}] - The configuration for the translation service, including fallback and default languages.
9351
- * @param {I18nResourceConfigType} [resources=[]] - The translation resources to be used by the loader.
9352
- * @param {boolean} [versionedSuffix=false] - Whether to append a versioned suffix to resource URLs.
9353
- * @returns {Array} - An array of providers for the translation service and loader.
9354
- */
9355
- declare function provideI18n(config?: RootTranslateServiceConfig, resources?: I18nResourceConfigType, versionedSuffix?: boolean): (i0.EnvironmentProviders | {
9356
- provide: i0.InjectionToken<I18nToken>;
9357
- useValue: {
9358
- resources: I18nResourceConfig[];
9359
- versionedSuffix: boolean;
9360
- };
9361
- } | i0.Provider[])[];
9362
-
9363
9261
  declare const DB_ADAPTER_PROVIDER = "DB_ADAPTER_PROVIDER";
9364
9262
  /**
9365
9263
  * @description Injection token for registering the database adapter provider.
@@ -9422,7 +9320,7 @@ declare const I18N_CONFIG_TOKEN: InjectionToken<I18nToken>;
9422
9320
  * { provide: CPTKN, useValue: provideDynamicComponents(MyComponent, AnotherComponent) }
9423
9321
  * ]
9424
9322
  */
9425
- declare function provideDynamicComponents(...components: unknown[]): Constructor<unknown>[];
9323
+ declare function provideDecafDynamicComponents(...components: unknown[]): Constructor<unknown>[];
9426
9324
  /**
9427
9325
  * @description Retrieves the repository instance for a given model.
9428
9326
  * @summary Creates or retrieves a DecafRepository instance for the specified model. This function
@@ -9469,7 +9367,7 @@ declare function getModelAndRepository(model: Model | string): {
9469
9367
  * provideDbAdapter(PostgresAdapter, { host: 'localhost', port: 5432 })
9470
9368
  * ]
9471
9369
  */
9472
- declare function provideDbAdapter<DbAdapter extends {
9370
+ declare function provideDecafDbAdapter<DbAdapter extends {
9473
9371
  flavour: string;
9474
9372
  }>(clazz: Constructor<DbAdapter>, options?: KeyValue, flavour?: string): Provider;
9475
9373
  /**
@@ -9550,5 +9448,109 @@ declare class ForAngularCommonModule {
9550
9448
  static ɵinj: i0.ɵɵInjectorDeclaration<ForAngularCommonModule>;
9551
9449
  }
9552
9450
 
9553
- export { ActionRoles, AngularEngineKeys, BaseComponentProps, CPTKN, CardComponent, ComponentEventNames, ComponentRendererComponent, ComponentsTagNames, CrudFieldComponent, CrudFormComponent, CssClasses, DB_ADAPTER_PROVIDER, DB_ADAPTER_PROVIDER_TOKEN, DecafFakerRepository, DefaultFormReactiveOptions, DefaultListEmptyOptions, DefaultModalOptions, Dynamic, DynamicModule, ElementPositions, ElementSizes, EmptyStateComponent, FieldsetComponent, FileUploadComponent, FilterComponent, ForAngularCommonModule, ForAngularComponentsModule, FormConstants, I18N_CONFIG_TOKEN, I18nLoader, I18nLoaderFactory, I18nParser, IconComponent, LOCALE_ROOT_TOKEN, LayoutComponent, LayoutGridGaps, ListComponent, ListComponentsTypes, ListItemComponent, ListItemPositions, LoggerLevels, ModalComponent, ModelRendererComponent, NgxComponentDirective, NgxEventHandler, NgxFormDirective, NgxFormFieldDirective, NgxFormService, NgxMediaService, NgxModelPageDirective, NgxPageDirective, NgxParentComponentDirective, NgxRenderingEngine, NgxSvgDirective, PaginationComponent, RouteDirections, SearchbarComponent, SteppedFormComponent, WindowColorSchemes, cleanSpaces, dataMapper, decafPageTransition, filterString, formatDate, generateRandomValue, getFakerData, getInjectablesRegistry, getLocaleContext, getLocaleContextByKey, getLocaleFromClassName, getLocaleLanguage, getLogger, getModelAndRepository, getNgxInlineModal, getNgxModalComponent, getNgxSelectOptionsModal, getOnWindow, getOnWindowDocument, getWindow, getWindowDocument, getWindowWidth, isDarkMode, isDevelopmentMode, isNotUndefined, isValidDate, itemMapper, parseToValidDate, presentNgxInlineModal, presentNgxLightBoxModal, provideDbAdapter, provideDecafPageTransition, provideDynamicComponents, provideI18n, provideI18nLoader, removeFocusTrap, setOnWindow, stringToBoolean, windowEventEmitter };
9554
- export type { ActionRole, AngularDynamicOutput, AngularFieldDefinition, CheckboxOption, ComponentMetadata, CrudFieldOption, DecafRepository, DecafRepositoryAdapter, ElementPosition, ElementSize, FieldUpdateMode, FlexPosition, FormParent, FormParentGroup, FormServiceControl, FormServiceControls, FunctionLike, HTML5InputType, HTMLFormTarget, I18nResourceConfig, I18nResourceConfigType, I18nToken, IBaseCustomEvent, IComponentConfig, IComponentHolder, IComponentProperties, ICrudFormEvent, ICrudFormOptions, IFieldSetItem, IFieldSetValidationEvent, IFileUploadError, IFilterQuery, IFilterQueryItem, IFormComponentProperties, IFormElement, IFormReactiveSubmitEvent, IListComponentRefreshEvent, IListEmptyOptions, IMenuItem, IModelPageCustomEvent, IPaginationCustomEvent, IRenderedModel, ISortObject, IWindowResizeEvent, InputOption, KeyValue, LayoutGridGap, ListItemCustomEvent, ListItemPosition, PossibleInputTypes, RadioOption, RawQuery, SelectOption, StringOrBoolean, WindowColorScheme };
9451
+ /**
9452
+ * @description Retrieves the locale context for a given class, object, or string.
9453
+ * @summary Resolves the locale context by extracting the class name or using the provided suffix.
9454
+ *
9455
+ * @param {FunctionLike | object | string} clazz - The class, object, or string to derive the locale context from.
9456
+ * @param {string} [suffix] - An optional suffix to append to the locale context.
9457
+ * @returns {string} - The resolved locale context string.
9458
+ */
9459
+ declare function getLocaleContext(clazz: FunctionLike | object | string, suffix?: string): string;
9460
+ /**
9461
+ * @description Generates a localized string by combining locale and phrase
9462
+ * @summary This utility function creates a properly formatted locale string by combining
9463
+ * a locale identifier with a phrase. It handles edge cases such as empty phrases,
9464
+ * missing locales, and phrases that already include the locale prefix. This function
9465
+ * is useful for ensuring consistent formatting of localized strings throughout the application.
9466
+ *
9467
+ * @param {string} locale - The locale identifier (e.g., 'en', 'fr')
9468
+ * @param {string | undefined} phrase - The phrase to localize
9469
+ * @return {string} The formatted locale string, or empty string if phrase is undefined
9470
+ *
9471
+ * @function generateLocaleFromString
9472
+ * @memberOf module:for-angular
9473
+ */
9474
+ declare function getLocaleContextByKey(locale: string, phrase: string | undefined): string;
9475
+ /**
9476
+ * @description Factory function for creating an instance of I18nLoader.
9477
+ * @summary Configures and returns an I18nLoader instance with the specified HTTP client and translation resources.
9478
+ *
9479
+ * @param {HttpClient} http - The HTTP client used to fetch translation resources.
9480
+ * @returns {TranslateLoader} - An instance of I18nLoader configured with the provided HTTP client and resources.
9481
+ */
9482
+ declare function I18nLoaderFactory(http: HttpClient): TranslateLoader;
9483
+ /**
9484
+ * @description Provides the I18nLoader configuration.
9485
+ * @summary Configures the translation resources and versioned suffix for the I18nLoader.
9486
+ *
9487
+ * @param {I18nResourceConfigType} [resources=[]] - The translation resources to be used by the loader.
9488
+ * @param {boolean} [versionedSuffix=false] - Whether to append a versioned suffix to resource URLs.
9489
+ * @returns {object} - The configuration object for the I18nLoader.
9490
+ */
9491
+ declare function provideDecafI18nLoader(resources?: I18nResourceConfigType, versionedSuffix?: boolean): {
9492
+ provide: typeof I18N_CONFIG_TOKEN;
9493
+ useValue: {
9494
+ resources: I18nResourceConfig[];
9495
+ versionedSuffix: boolean;
9496
+ };
9497
+ };
9498
+ /**
9499
+ * @description Custom implementation of TranslateLoader for loading translations.
9500
+ * @summary Fetches and merges translation resources, supporting versioned suffixes and recursive merging.
9501
+ */
9502
+ declare class I18nLoader implements TranslateLoader {
9503
+ private http;
9504
+ private resources;
9505
+ private versionedSuffix;
9506
+ /**
9507
+ * @param {HttpClient} http - The HTTP client used to fetch translation resources.
9508
+ * @param {I18nResourceConfig[]} [resources=[]] - The translation resources to be loaded.
9509
+ * @param {boolean} [versionedSuffix=false] - Whether to append a versioned suffix to resource URLs.
9510
+ */
9511
+ constructor(http: HttpClient, resources?: I18nResourceConfig[], versionedSuffix?: boolean);
9512
+ /**
9513
+ * @description Appends a versioned suffix to the resource URL if enabled.
9514
+ * @summary Generates a versioned suffix based on the current date.
9515
+ *
9516
+ * @param {string} suffix - The original suffix of the resource URL.
9517
+ * @returns {string} - The modified suffix with a version string appended.
9518
+ */
9519
+ private getSuffix;
9520
+ /**
9521
+ * @description Fetches and merges translations for the specified language.
9522
+ * @summary Loads translation resources, merges them recursively, and includes library keys.
9523
+ *
9524
+ * @param {string} lang - The language code for the translations to load.
9525
+ * @returns {Observable<TranslationObject>} - An observable that emits the merged translation object.
9526
+ */
9527
+ getTranslation(lang: string): Observable<TranslationObject>;
9528
+ }
9529
+ /**
9530
+ * @description Custom implementation of TranslateParser for interpolation.
9531
+ * @summary Extends TranslateParser to support string formatting with parameters.
9532
+ */
9533
+ declare class I18nParser extends TranslateParser {
9534
+ /**
9535
+ * @description Interpolates a translation string with parameters.
9536
+ * @summary Replaces placeholders in the translation string with parameter values.
9537
+ *
9538
+ * @param {string} value - The translation string to interpolate.
9539
+ * @param {object | string} [params={}] - The parameters to replace placeholders with.
9540
+ * @returns {string} - The interpolated translation string.
9541
+ */
9542
+ interpolate(value: string, params?: object | string): string;
9543
+ }
9544
+ /**
9545
+ * @description Provides the internationalization (i18n) configuration for the application.
9546
+ * @summary Configures the translation service with a fallback language, default language, custom parser, and loader.
9547
+ *
9548
+ * @param {RootTranslateServiceConfig} [config={fallbackLang: 'en', lang: 'en'}] - The configuration for the translation service, including fallback and default languages.
9549
+ * @param {I18nResourceConfigType} [resources=[]] - The translation resources to be used by the loader.
9550
+ * @param {boolean} [versionedSuffix=false] - Whether to append a versioned suffix to resource URLs.
9551
+ * @returns {AngularProvider[]} - An array of providers for the translation service and loader.
9552
+ */
9553
+ declare function provideDecafI18nConfig(config?: RootTranslateServiceConfig, resources?: I18nResourceConfigType, versionedSuffix?: boolean): AngularProvider[];
9554
+
9555
+ export { ActionRoles, AngularEngineKeys, BaseComponentProps, CPTKN, CardComponent, ComponentEventNames, ComponentRendererComponent, ComponentsTagNames, CrudFieldComponent, CrudFormComponent, CssClasses, DB_ADAPTER_PROVIDER, DB_ADAPTER_PROVIDER_TOKEN, DecafFakerRepository, DefaultFormReactiveOptions, DefaultListEmptyOptions, DefaultModalOptions, Dynamic, DynamicModule, ElementPositions, ElementSizes, EmptyStateComponent, FieldsetComponent, FileUploadComponent, FilterComponent, ForAngularCommonModule, ForAngularComponentsModule, FormConstants, I18N_CONFIG_TOKEN, I18nLoader, I18nLoaderFactory, I18nParser, IconComponent, LOCALE_ROOT_TOKEN, LayoutComponent, LayoutGridGaps, ListComponent, ListComponentsTypes, ListItemComponent, ListItemPositions, LoggerLevels, ModalComponent, ModelRendererComponent, NgxComponentDirective, NgxEventHandler, NgxFormDirective, NgxFormFieldDirective, NgxFormService, NgxMediaService, NgxModelPageDirective, NgxPageDirective, NgxParentComponentDirective, NgxRenderingEngine, NgxSvgDirective, PaginationComponent, RouteDirections, SearchbarComponent, SteppedFormComponent, WindowColorSchemes, cleanSpaces, dataMapper, decafPageTransition, filterString, formatDate, generateRandomValue, getFakerData, getInjectablesRegistry, getLocaleContext, getLocaleContextByKey, getLocaleFromClassName, getLocaleLanguage, getLogger, getModelAndRepository, getNgxInlineModal, getNgxModalComponent, getNgxSelectOptionsModal, getOnWindow, getOnWindowDocument, getWindow, getWindowDocument, getWindowWidth, isDarkMode, isDevelopmentMode, isNotUndefined, isValidDate, itemMapper, parseToValidDate, presentNgxInlineModal, presentNgxLightBoxModal, provideDecafDbAdapter, provideDecafDynamicComponents, provideDecafI18nConfig, provideDecafI18nLoader, provideDecafPageTransition, removeFocusTrap, setOnWindow, stringToBoolean, windowEventEmitter };
9556
+ export type { ActionRole, AngularDynamicOutput, AngularFieldDefinition, AngularProvider, CheckboxOption, ComponentMetadata, CrudFieldOption, DecafRepository, DecafRepositoryAdapter, ElementPosition, ElementSize, FieldUpdateMode, FlexPosition, FormParent, FormParentGroup, FormServiceControl, FormServiceControls, FunctionLike, HTML5InputType, HTMLFormTarget, I18nResourceConfig, I18nResourceConfigType, I18nToken, IBaseCustomEvent, IComponentConfig, IComponentHolder, IComponentProperties, ICrudFormEvent, ICrudFormOptions, IFieldSetItem, IFieldSetValidationEvent, IFileUploadError, IFilterQuery, IFilterQueryItem, IFormComponentProperties, IFormElement, IFormReactiveSubmitEvent, IListComponentRefreshEvent, IListEmptyOptions, IMenuItem, IModelPageCustomEvent, IPaginationCustomEvent, IRenderedModel, ISortObject, IWindowResizeEvent, InputOption, KeyValue, LayoutGridGap, ListItemCustomEvent, ListItemPosition, PossibleInputTypes, RadioOption, RawQuery, SelectOption, StringOrBoolean, WindowColorScheme };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/for-angular",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "author": "Tiago Venceslau and Contributors",
5
5
  "license": "MPL-2.0 OR AGPL-3.0",
6
6
  "repository": {