@ngrdt/forms 0.0.89 → 0.0.92

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,8 +1,8 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, OnDestroy, Injector, Signal, Type, InjectionToken, PipeTransform } from '@angular/core';
2
+ import { OnInit, OnDestroy, Injector, Signal, Type, InjectionToken, AfterViewInit, WritableSignal, PipeTransform } from '@angular/core';
3
3
  import * as _angular_forms from '@angular/forms';
4
4
  import { ControlValueAccessor, AbstractControl, ValidationErrors, NgControl, FormControl, ValidatorFn } from '@angular/forms';
5
- import { RdtInteractiveElementComponent, RdtComponentOutletDirective, RdtTranslateService } from '@ngrdt/core';
5
+ import { RdtInteractiveElementComponent, RdtComponentOutletDirective, RdtTranslateService, RdtBooleanResult } from '@ngrdt/core';
6
6
  import { Nullable, RdtBaseFormInputComponentInputsInt, RdtFile, RdtMimeType, RdtCombinedMimeType, AllEncodingAliases } from '@ngrdt/utils';
7
7
  import * as _ngrdt_forms from '@ngrdt/forms';
8
8
  import * as rxjs from 'rxjs';
@@ -205,6 +205,22 @@ type RdtAutocompleteOtherToken = 'language' | 'bday' | 'bday-day' | 'bday-month'
205
205
  type RdtAutocompleteDetailToken = RdtAutocompleteDigitalContactWhole | RdtAutocompleteNameToken | RdtAutocompleteLoginToken | RdtAutocompleteAddressToken | RdtAutocompleteCCToken | RdtAutocompleteOtherToken;
206
206
  type RdtAutocompleteOptions = `${RdtAutocompleteGroup} ${RdtAutocompleteDetailToken}` | RdtAutocompleteDetailToken | 'off' | 'on';
207
207
 
208
+ interface RdtNumericInputInt extends RdtBaseFormInputComponentInputsInt {
209
+ min: number | null;
210
+ max: number | null;
211
+ step: number | null;
212
+ autocomplete: RdtAutocompleteOptions | undefined;
213
+ }
214
+
215
+ declare class RdtNumericInputOutletDirective<TCheckComp extends RdtNumericInputComponent, TCheckInputs extends RdtNumericInputInt = RdtNumericInputInt> extends RdtFormInputOutletDirective<TCheckComp, TCheckInputs> {
216
+ readonly componentClass: Type<TCheckComp>;
217
+ constructor();
218
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtNumericInputOutletDirective<any, any>, never>;
219
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtNumericInputOutletDirective<any, any>, "[rdtNumericInputOutlet]", ["rdtNumericInputOutlet"], {}, {}, never, never, true, never>;
220
+ }
221
+
222
+ declare const RDT_NUMERIC_INPUT_BASE_PROVIDER: InjectionToken<Type<RdtNumericInputComponent>>;
223
+
208
224
  declare abstract class RdtNumericInputComponent extends RdtBaseFormInputComponent<number | null> {
209
225
  readonly min: _angular_core.InputSignalWithTransform<number | null | undefined, Nullable<string | number>>;
210
226
  readonly max: _angular_core.InputSignalWithTransform<number | null | undefined, Nullable<string | number>>;
@@ -261,7 +277,7 @@ declare abstract class RdtSelectDatasource<TItem, TId> {
261
277
  abstract readonly queryRequired: boolean;
262
278
  }
263
279
 
264
- declare class RdtOfflineSelectDatasource<TValue extends string | number> extends RdtSelectDatasource<RdtLabelValue<TValue>, TValue> {
280
+ declare class RdtOfflineSelectDatasource<TValue> extends RdtSelectDatasource<RdtLabelValue<TValue>, TValue> {
265
281
  readonly data: RdtLabelValue<TValue>[];
266
282
  readonly totalCountKnown = true;
267
283
  readonly queryRequired = false;
@@ -284,7 +300,7 @@ declare class RdtOfflineSelectDatasource<TValue extends string | number> extends
284
300
  protected filterData(query: string | null): RdtLabelValue<TValue>[];
285
301
  }
286
302
 
287
- declare abstract class RdtSelectOfflineDatasourceProviderDirective<TValue extends string | number> {
303
+ declare abstract class RdtSelectOfflineDatasourceProviderDirective<TValue> {
288
304
  readonly store: {
289
305
  initialized: _angular_core.Signal<boolean>;
290
306
  query: _angular_core.Signal<string | null>;
@@ -358,6 +374,14 @@ declare class RdtSelectOptionDirective<TValue> implements Highlightable {
358
374
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtSelectOptionDirective<any>, "[rdtSelectOption]", never, { "value": { "alias": "rdtSelectOption"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
359
375
  }
360
376
 
377
+ interface rdtOptionInt {
378
+ label: string;
379
+ value: any;
380
+ }
381
+ interface RdtSelectInt extends RdtBaseFormInputComponentInputsInt {
382
+ options?: rdtOptionInt[] | null;
383
+ }
384
+
361
385
  interface RdtSelectState<TItem, TId> {
362
386
  initialized: boolean;
363
387
  query: string | null;
@@ -502,6 +526,15 @@ declare abstract class RdtBaseSelectCommonComponent<TItem, TId, TOut extends TId
502
526
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtBaseSelectCommonComponent<any, any, any>, never, never, { "manualInitInput": { "alias": "manualInit"; "required": false; "isSignal": true; }; "datasourceInput": { "alias": "datasource"; "required": false; "isSignal": true; }; "queryValidatorFnInput": { "alias": "inputValidator"; "required": false; "isSignal": true; }; "debounceTimeInput": { "alias": "debounce"; "required": false; "isSignal": true; }; "pageSizeInput": { "alias": "pageSize"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
503
527
  }
504
528
 
529
+ declare class RdtSelectOutletDirective<TSelectComp extends RdtBaseSelectCommonComponent<any, any, any>, TSelectInputs extends RdtSelectInt = RdtSelectInt> extends RdtFormInputOutletDirective<TSelectComp, TSelectInputs> {
530
+ readonly componentClass: Type<TSelectComp>;
531
+ constructor();
532
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtSelectOutletDirective<any, any>, never>;
533
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtSelectOutletDirective<any, any>, "[rdtSelectOutlet]", ["rdtSelectOutlet"], {}, {}, never, never, true, never>;
534
+ }
535
+
536
+ declare const RDT_SELECT_BASE_PROVIDER: InjectionToken<Type<RdtBaseSelectCommonComponent<any, any, any>>>;
537
+
505
538
  declare abstract class RdtMultiSelectComponent<TItem, TId> extends RdtBaseSelectCommonComponent<TItem, TId, TId[]> {
506
539
  readonly selected: _angular_core.Signal<_ngrdt_forms.RdtLabelValueId<TItem, TId>[] | null>;
507
540
  protected isEmpty(value: TId[]): boolean;
@@ -541,6 +574,46 @@ declare abstract class RdtTextInputComponent extends RdtBaseFormInputComponent<s
541
574
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtTextInputComponent, never, never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; "isSignal": true; }; "minlength": { "alias": "minlength"; "required": false; "isSignal": true; }; "pattern": { "alias": "pattern"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
542
575
  }
543
576
 
577
+ declare abstract class RdtTextInputSearchDatasource<TItem, TId> extends RdtSelectDatasource<TItem, TId> {
578
+ abstract getLabelForInputSearch(item: TItem): string;
579
+ abstract getDataForTextInputSearch(params: RdtSelectRequestParams): Observable<RdtSelectPage<TItem>>;
580
+ }
581
+
582
+ type ItemResolved<TId, TItem> = {
583
+ id: TId | null;
584
+ label: string | null;
585
+ item: TItem | null;
586
+ };
587
+ declare abstract class RdtTextSearchInputComponent<TItem, TId extends string | number, TInputComponent extends RdtTextInputComponent> extends RdtBaseFormInputComponent<TItem, TId> implements OnInit, AfterViewInit, ControlValueAccessor {
588
+ readonly hideErrors: _angular_core.InputSignalWithTransform<boolean, unknown>;
589
+ protected readonly textInput: WritableSignal<TInputComponent | undefined>;
590
+ private _input;
591
+ protected isEmpty(value: TItem | null): boolean;
592
+ focus(): void;
593
+ canFocus(): RdtBooleanResult;
594
+ readonly datasource: _angular_core.InputSignal<RdtTextInputSearchDatasource<TItem, TId> | null>;
595
+ readonly itemResolved: _angular_core.OutputEmitterRef<ItemResolved<TId, TItem>>;
596
+ private readonly store;
597
+ readonly ctrl: FormControl<string | null>;
598
+ private lastResult;
599
+ private initializing;
600
+ protected readonly errorEffect: _angular_core.EffectRef;
601
+ protected touchedEffect: _angular_core.EffectRef;
602
+ readonly anyDatasource: _angular_core.Signal<RdtTextInputSearchDatasource<TItem, TId> | null>;
603
+ ngOnInit(): void;
604
+ ngAfterViewInit(): void;
605
+ ngOnDestroy(): void;
606
+ private resolveInitialValue;
607
+ private handleSearchInput$;
608
+ private handleSearchResults;
609
+ private emitResolvedEvent;
610
+ writeValue(value: TId | null): void;
611
+ setDisabledState(isDisabled: boolean): void;
612
+ private readonly resultCountValidator;
613
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtTextSearchInputComponent<any, any, any>, never>;
614
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtTextSearchInputComponent<any, any, any>, never, never, { "hideErrors": { "alias": "hideErrors"; "required": false; "isSignal": true; }; "datasource": { "alias": "datasource"; "required": false; "isSignal": true; }; }, { "itemResolved": "itemResolved"; }, never, never, true, never>;
615
+ }
616
+
544
617
  type RdtErrorValue = {
545
618
  key: string;
546
619
  value: string;
@@ -554,6 +627,8 @@ interface RdtFormErrorCodeMap {
554
627
  maxlength: ErrorCodesFn;
555
628
  notFound: ErrorCodesFn;
556
629
  multipleFound: ErrorCodesFn;
630
+ incomplete: ErrorCodesFn;
631
+ minValue: ErrorCodesFn;
557
632
  [key: string]: ErrorCodesFn;
558
633
  }
559
634
 
@@ -598,5 +673,5 @@ declare class RdtCommonValidators {
598
673
  static cannotContainAccents: ValidatorFn;
599
674
  }
600
675
 
601
- export { NO_OP_FILE_READER, NoOpFileReader, RDT_CHECKBOX_BASE_PROVIDER, RDT_DEFAULT_FILE_LABEL_FN, RDT_DEFAULT_FILE_READER, RDT_DEFAULT_MAX_FILE_SIZE, RDT_EMPTY_TIME_DATE, RDT_FORM_CONTROL_DATETIME_FORMAT, RDT_FORM_CONTROL_DATE_FORMAT, RDT_FORM_CONTROL_TIME_FORMAT, RDT_FORM_ERROR_CODES_PROVIDER, RdtBaseFormInputComponent, RdtBaseSelectCommonComponent, RdtCheckboxComponent, RdtCheckboxOutletDirective, RdtCommonValidators, RdtDateComponent, RdtDateValidators, RdtFileInputComponent, RdtFileReader, RdtFileReaderArrayBuffer, RdtFileReaderBase64, RdtFormErrorPipe, RdtFormInputOutletDirective, RdtMultiSelectComponent, RdtNumericInputComponent, RdtOfflineSelectDatasource, RdtSelectDatasource, RdtSelectOfflineDatasourceProviderDirective, RdtSelectOptionDirective, RdtSelectStore, RdtSingleSelectComponent, RdtTextAreaComponent, RdtTextInputComponent, VnshFileReaderText, defaultRdtFormErrorCodes, fileLabelTranslate, getFirstError, getRdtSelectPage, rdtSelectInitialState };
602
- export type { ErrorCodesFn, RdtCheckboxInputInt, RdtDateType, RdtErrorValue, RdtFileLabelFn, RdtFormErrorCodeMap, RdtLabelValue, RdtLabelValueId, RdtRenderedSelectOption, RdtSelectPage, RdtSelectRequestParams, RdtSelectState };
676
+ export { NO_OP_FILE_READER, NoOpFileReader, RDT_CHECKBOX_BASE_PROVIDER, RDT_DEFAULT_FILE_LABEL_FN, RDT_DEFAULT_FILE_READER, RDT_DEFAULT_MAX_FILE_SIZE, RDT_EMPTY_TIME_DATE, RDT_FORM_CONTROL_DATETIME_FORMAT, RDT_FORM_CONTROL_DATE_FORMAT, RDT_FORM_CONTROL_TIME_FORMAT, RDT_FORM_ERROR_CODES_PROVIDER, RDT_NUMERIC_INPUT_BASE_PROVIDER, RDT_SELECT_BASE_PROVIDER, RdtBaseFormInputComponent, RdtBaseSelectCommonComponent, RdtCheckboxComponent, RdtCheckboxOutletDirective, RdtCommonValidators, RdtDateComponent, RdtDateValidators, RdtFileInputComponent, RdtFileReader, RdtFileReaderArrayBuffer, RdtFileReaderBase64, RdtFormErrorPipe, RdtFormInputOutletDirective, RdtMultiSelectComponent, RdtNumericInputComponent, RdtNumericInputOutletDirective, RdtOfflineSelectDatasource, RdtSelectDatasource, RdtSelectOfflineDatasourceProviderDirective, RdtSelectOptionDirective, RdtSelectOutletDirective, RdtSelectStore, RdtSingleSelectComponent, RdtTextAreaComponent, RdtTextInputComponent, RdtTextInputSearchDatasource, RdtTextSearchInputComponent, VnshFileReaderText, defaultRdtFormErrorCodes, fileLabelTranslate, getFirstError, getRdtSelectPage, rdtSelectInitialState };
677
+ export type { ErrorCodesFn, ItemResolved, RdtCheckboxInputInt, RdtDateType, RdtErrorValue, RdtFileLabelFn, RdtFormErrorCodeMap, RdtLabelValue, RdtLabelValueId, RdtNumericInputInt, RdtRenderedSelectOption, RdtSelectInt, RdtSelectPage, RdtSelectRequestParams, RdtSelectState };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@ngrdt/forms",
3
- "version": "0.0.89",
3
+ "version": "0.0.92",
4
4
  "peerDependencies": {
5
- "@ngrdt/core": "^0.0.89",
6
- "@ngrdt/utils": "^0.0.89",
5
+ "@ngrdt/core": "^0.0.92",
6
+ "@ngrdt/utils": "^0.0.92",
7
7
  "@angular/core": ">=20.0.0",
8
8
  "@angular/forms": ">=20.0.0",
9
9
  "rxjs": ">=7.0.0",