@ngrdt/forms 0.0.86 → 0.0.91

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';
@@ -90,26 +90,18 @@ declare abstract class RdtCheckboxComponent<TTrue = any, TFalse = any> extends R
90
90
  readonly falseValueInput: _angular_core.InputSignal<TFalse>;
91
91
  readonly falseValue: _angular_core.WritableSignal<TFalse>;
92
92
  readonly indeterminate: _angular_core.InputSignalWithTransform<boolean, unknown>;
93
- readonly value: _angular_core.InputSignal<string | undefined>;
94
- readonly checked: _angular_core.InputSignal<boolean>;
95
- readonly checkedChange: _angular_core.OutputEmitterRef<boolean>;
96
- readonly checkedState: _angular_core.WritableSignal<boolean>;
97
- constructor();
98
- writeValue(value: TFalse | TTrue): void;
99
- protected handleValueChange(newInternal: boolean): void;
100
93
  protected toExternalValue(internalValue: boolean | null): TTrue | TFalse | null;
101
94
  protected toInternalValue(externalValue: TTrue | TFalse | null): boolean | null;
102
95
  protected isEmpty(value: TTrue | TFalse | null): boolean;
103
96
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtCheckboxComponent<any, any>, never>;
104
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtCheckboxComponent<any, any>, never, never, { "trueValueInput": { "alias": "trueValue"; "required": false; "isSignal": true; }; "falseValueInput": { "alias": "falseValue"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; }, never, never, true, never>;
97
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtCheckboxComponent<any, any>, never, never, { "trueValueInput": { "alias": "trueValue"; "required": false; "isSignal": true; }; "falseValueInput": { "alias": "falseValue"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
105
98
  }
106
99
 
107
100
  declare class RdtCheckboxOutletDirective<TCheckComp extends RdtCheckboxComponent, TCheckInputs extends RdtCheckboxInputInt = RdtCheckboxInputInt> extends RdtFormInputOutletDirective<TCheckComp, TCheckInputs> {
108
101
  readonly componentClass: Type<TCheckComp>;
109
- readonly checkedChange: _angular_core.OutputEmitterRef<boolean>;
110
102
  constructor();
111
103
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtCheckboxOutletDirective<any, any>, never>;
112
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtCheckboxOutletDirective<any, any>, "[rdtCheckboxOutlet]", ["rdtCheckboxOutlet"], {}, { "checkedChange": "checkedChange"; }, never, never, true, never>;
104
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtCheckboxOutletDirective<any, any>, "[rdtCheckboxOutlet]", ["rdtCheckboxOutlet"], {}, {}, never, never, true, never>;
113
105
  }
114
106
 
115
107
  declare const RDT_CHECKBOX_BASE_PROVIDER: InjectionToken<Type<RdtCheckboxComponent<any, any>>>;
@@ -213,6 +205,22 @@ type RdtAutocompleteOtherToken = 'language' | 'bday' | 'bday-day' | 'bday-month'
213
205
  type RdtAutocompleteDetailToken = RdtAutocompleteDigitalContactWhole | RdtAutocompleteNameToken | RdtAutocompleteLoginToken | RdtAutocompleteAddressToken | RdtAutocompleteCCToken | RdtAutocompleteOtherToken;
214
206
  type RdtAutocompleteOptions = `${RdtAutocompleteGroup} ${RdtAutocompleteDetailToken}` | RdtAutocompleteDetailToken | 'off' | 'on';
215
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
+
216
224
  declare abstract class RdtNumericInputComponent extends RdtBaseFormInputComponent<number | null> {
217
225
  readonly min: _angular_core.InputSignalWithTransform<number | null | undefined, Nullable<string | number>>;
218
226
  readonly max: _angular_core.InputSignalWithTransform<number | null | undefined, Nullable<string | number>>;
@@ -269,7 +277,7 @@ declare abstract class RdtSelectDatasource<TItem, TId> {
269
277
  abstract readonly queryRequired: boolean;
270
278
  }
271
279
 
272
- declare class RdtOfflineSelectDatasource<TValue extends string | number> extends RdtSelectDatasource<RdtLabelValue<TValue>, TValue> {
280
+ declare class RdtOfflineSelectDatasource<TValue> extends RdtSelectDatasource<RdtLabelValue<TValue>, TValue> {
273
281
  readonly data: RdtLabelValue<TValue>[];
274
282
  readonly totalCountKnown = true;
275
283
  readonly queryRequired = false;
@@ -292,7 +300,7 @@ declare class RdtOfflineSelectDatasource<TValue extends string | number> extends
292
300
  protected filterData(query: string | null): RdtLabelValue<TValue>[];
293
301
  }
294
302
 
295
- declare abstract class RdtSelectOfflineDatasourceProviderDirective<TValue extends string | number> {
303
+ declare abstract class RdtSelectOfflineDatasourceProviderDirective<TValue> {
296
304
  readonly store: {
297
305
  initialized: _angular_core.Signal<boolean>;
298
306
  query: _angular_core.Signal<string | null>;
@@ -366,6 +374,14 @@ declare class RdtSelectOptionDirective<TValue> implements Highlightable {
366
374
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtSelectOptionDirective<any>, "[rdtSelectOption]", never, { "value": { "alias": "rdtSelectOption"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
367
375
  }
368
376
 
377
+ interface rdtOptionInt {
378
+ label: string;
379
+ value: any;
380
+ }
381
+ interface RdtSelectInt extends RdtBaseFormInputComponentInputsInt {
382
+ options?: rdtOptionInt[] | null;
383
+ }
384
+
369
385
  interface RdtSelectState<TItem, TId> {
370
386
  initialized: boolean;
371
387
  query: string | null;
@@ -510,6 +526,15 @@ declare abstract class RdtBaseSelectCommonComponent<TItem, TId, TOut extends TId
510
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>;
511
527
  }
512
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
+
513
538
  declare abstract class RdtMultiSelectComponent<TItem, TId> extends RdtBaseSelectCommonComponent<TItem, TId, TId[]> {
514
539
  readonly selected: _angular_core.Signal<_ngrdt_forms.RdtLabelValueId<TItem, TId>[] | null>;
515
540
  protected isEmpty(value: TId[]): boolean;
@@ -549,6 +574,46 @@ declare abstract class RdtTextInputComponent extends RdtBaseFormInputComponent<s
549
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>;
550
575
  }
551
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
+
552
617
  type RdtErrorValue = {
553
618
  key: string;
554
619
  value: string;
@@ -562,6 +627,8 @@ interface RdtFormErrorCodeMap {
562
627
  maxlength: ErrorCodesFn;
563
628
  notFound: ErrorCodesFn;
564
629
  multipleFound: ErrorCodesFn;
630
+ incomplete: ErrorCodesFn;
631
+ minValue: ErrorCodesFn;
565
632
  [key: string]: ErrorCodesFn;
566
633
  }
567
634
 
@@ -606,5 +673,5 @@ declare class RdtCommonValidators {
606
673
  static cannotContainAccents: ValidatorFn;
607
674
  }
608
675
 
609
- 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 };
610
- 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.86",
3
+ "version": "0.0.91",
4
4
  "peerDependencies": {
5
- "@ngrdt/core": "^0.0.86",
6
- "@ngrdt/utils": "^0.0.86",
5
+ "@ngrdt/core": "^0.0.91",
6
+ "@ngrdt/utils": "^0.0.91",
7
7
  "@angular/core": ">=20.0.0",
8
8
  "@angular/forms": ">=20.0.0",
9
9
  "rxjs": ">=7.0.0",