@klippa/ngx-enhancy-forms 20.1.1 → 20.1.3

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,13 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnInit, OnDestroy, OnChanges, TemplateRef, EventEmitter, SimpleChanges, AfterViewInit, ElementRef, NgZone, InjectionToken, ChangeDetectorRef, QueryList, ApplicationRef } from '@angular/core';
3
- import * as i32 from '@angular/forms';
2
+ import { InjectionToken, OnInit, OnDestroy, OnChanges, TemplateRef, EventEmitter, SimpleChanges, AfterViewInit, ElementRef, NgZone, ChangeDetectorRef, QueryList, ApplicationRef } from '@angular/core';
3
+ import * as i34 from '@angular/forms';
4
4
  import { FormGroup, FormArray, AbstractControl, UntypedFormArray, UntypedFormGroup, UntypedFormControl, ControlValueAccessor, ControlContainer, ValidationErrors } from '@angular/forms';
5
5
  import * as i3 from '@angular/material/core';
6
6
  import { MatDateFormats, DateAdapter } from '@angular/material/core';
7
7
  import * as i1 from '@angular/material/datepicker';
8
8
  import { MatDatepicker, DateFilterFn } from '@angular/material/datepicker';
9
- import * as i31 from '@angular/common';
10
- import * as i33 from '@ng-select/ng-select';
9
+ import * as i33 from '@angular/common';
10
+ import * as i35 from '@ng-select/ng-select';
11
11
  import * as i2 from '@angular/material/form-field';
12
12
  import * as i4 from '@angular/material/input';
13
13
  import * as i5 from '@angular/material/button';
@@ -28,6 +28,12 @@ type CustomErrorMessages = Record<keyof FormErrorMessages, () => string>;
28
28
  type KlpDateFormats = (format: string) => MatDateFormats;
29
29
  type ErrorTypes = keyof FormErrorMessages | 'message' | 'async' | string;
30
30
 
31
+ type FormSize = 'small' | 'medium' | 'large';
32
+ type SizeClass = 'input-sm' | 'input-md' | 'input-lg';
33
+ declare function getSizeClass(size: FormSize): SizeClass;
34
+ declare const KLP_FORM_DEFAULT_SIZE: InjectionToken<FormSize>;
35
+ declare const DefaultSize = "medium";
36
+
31
37
  declare const invalidFieldsSymbol: unique symbol;
32
38
  type OnInjectedEmitterType = {
33
39
  childValue: Record<string, any>;
@@ -54,6 +60,7 @@ declare class FormComponent implements OnInit, OnDestroy, OnChanges {
54
60
  errors: Map<AbstractControl, string>;
55
61
  patchValueInterceptor: (values: any) => Promise<any>;
56
62
  allowSubmitOn: 'buttonAndEnter' | 'buttonOnly';
63
+ size: FormSize;
57
64
  onInjected: EventEmitter<OnInjectedEmitterType>;
58
65
  private topLevelFormControl;
59
66
  private activeControls;
@@ -84,12 +91,12 @@ declare class FormComponent implements OnInit, OnDestroy, OnChanges {
84
91
  _ext_getRenderedFieldValues(): Record<string, any>;
85
92
  private setDisabledStatesForAllControls;
86
93
  static ɵfac: i0.ɵɵFactoryDeclaration<FormComponent, [{ optional: true; skipSelf: true; }, { optional: true; }]>;
87
- static ɵcmp: i0.ɵɵComponentDeclaration<FormComponent, "klp-form", never, { "readOnly": { "alias": "readOnly"; "required": false; }; "showErrorMessages": { "alias": "showErrorMessages"; "required": false; }; "errorMessageLocation": { "alias": "errorMessageLocation"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "formArray": { "alias": "formArray"; "required": false; }; "warnings": { "alias": "warnings"; "required": false; }; "immutableValues": { "alias": "immutableValues"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "patchValueInterceptor": { "alias": "patchValueInterceptor"; "required": false; }; "allowSubmitOn": { "alias": "allowSubmitOn"; "required": false; }; }, { "onInjected": "onInjected"; }, never, ["*"], false, never>;
94
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormComponent, "klp-form", never, { "readOnly": { "alias": "readOnly"; "required": false; }; "showErrorMessages": { "alias": "showErrorMessages"; "required": false; }; "errorMessageLocation": { "alias": "errorMessageLocation"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "formArray": { "alias": "formArray"; "required": false; }; "warnings": { "alias": "warnings"; "required": false; }; "immutableValues": { "alias": "immutableValues"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "patchValueInterceptor": { "alias": "patchValueInterceptor"; "required": false; }; "allowSubmitOn": { "alias": "allowSubmitOn"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, { "onInjected": "onInjected"; }, never, ["*"], false, never>;
88
95
  }
89
96
 
90
97
  declare const FORM_ERROR_MESSAGES: InjectionToken<CustomErrorMessages>;
91
98
  declare const DEFAULT_ERROR_MESSAGES: FormErrorMessages;
92
- declare class FormElementComponent implements AfterViewInit, OnDestroy {
99
+ declare class FormElementComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {
93
100
  private parent;
94
101
  private customMessages;
95
102
  private elRef;
@@ -103,6 +110,7 @@ declare class FormElementComponent implements AfterViewInit, OnDestroy {
103
110
  swapInputAndCaption: boolean;
104
111
  errorMessageAsTooltip: boolean;
105
112
  errorMessageHasMaxWidth: boolean;
113
+ size: FormSize | null;
106
114
  internalComponentRef: ElementRef;
107
115
  tailTpl: TemplateRef<any>;
108
116
  captionDummyForSpaceCalculation: ElementRef;
@@ -111,8 +119,10 @@ declare class FormElementComponent implements AfterViewInit, OnDestroy {
111
119
  fixedWrapper: ElementRef;
112
120
  inputContainer: ElementRef;
113
121
  fieldInput: ValueAccessorBase<any>;
122
+ private injectedSize;
114
123
  captionRef: TemplateRef<any>;
115
124
  captionEndRef: TemplateRef<any>;
125
+ subCaptionRef: TemplateRef<any>;
116
126
  errorMessages: FormErrorMessages;
117
127
  customErrorHandlers: Array<{
118
128
  error: string;
@@ -122,7 +132,10 @@ declare class FormElementComponent implements AfterViewInit, OnDestroy {
122
132
  errorFullyVisible: boolean;
123
133
  private popupState;
124
134
  private subscriptions;
135
+ sizeClass: SizeClass;
125
136
  constructor(parent: FormComponent, customMessages: CustomErrorMessages, elRef: ElementRef, ngZone: NgZone);
137
+ ngOnInit(): void;
138
+ ngOnChanges(changes: SimpleChanges): void;
126
139
  ngAfterViewInit(): Promise<void>;
127
140
  shouldShowErrorMessages(): boolean;
128
141
  substituteParameters(message: string, parameters: Record<string, any>): string;
@@ -135,6 +148,7 @@ declare class FormElementComponent implements AfterViewInit, OnDestroy {
135
148
  registerErrorHandler(error: string, templateRef: TemplateRef<any>): void;
136
149
  registerCaption(templateRef: TemplateRef<any>): void;
137
150
  registerCaptionEnd(templateRef: TemplateRef<any>): void;
151
+ registerSubCaption(templateRef: TemplateRef<any>): void;
138
152
  getWarningToShow(): string | TemplateRef<any>;
139
153
  getWarningToShowAsTemplateRef(): TemplateRef<any>;
140
154
  getWarningToShowIsTemplateRef(): boolean;
@@ -160,7 +174,7 @@ declare class FormElementComponent implements AfterViewInit, OnDestroy {
160
174
  ngOnDestroy(): void;
161
175
  private initializeTailTpl;
162
176
  static ɵfac: i0.ɵɵFactoryDeclaration<FormElementComponent, [{ optional: true; }, { optional: true; }, null, null]>;
163
- static ɵcmp: i0.ɵɵComponentDeclaration<FormElementComponent, "klp-form-element", never, { "caption": { "alias": "caption"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "captionSpacing": { "alias": "captionSpacing"; "required": false; }; "verticalAlignment": { "alias": "verticalAlignment"; "required": false; }; "spaceDistribution": { "alias": "spaceDistribution"; "required": false; }; "swapInputAndCaption": { "alias": "swapInputAndCaption"; "required": false; }; "errorMessageAsTooltip": { "alias": "errorMessageAsTooltip"; "required": false; }; "errorMessageHasMaxWidth": { "alias": "errorMessageHasMaxWidth"; "required": false; }; }, {}, ["fieldInput"], ["*"], false, never>;
177
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormElementComponent, "klp-form-element", never, { "caption": { "alias": "caption"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "captionSpacing": { "alias": "captionSpacing"; "required": false; }; "verticalAlignment": { "alias": "verticalAlignment"; "required": false; }; "spaceDistribution": { "alias": "spaceDistribution"; "required": false; }; "swapInputAndCaption": { "alias": "swapInputAndCaption"; "required": false; }; "errorMessageAsTooltip": { "alias": "errorMessageAsTooltip"; "required": false; }; "errorMessageHasMaxWidth": { "alias": "errorMessageHasMaxWidth"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, {}, ["fieldInput"], ["*"], false, never>;
164
178
  }
165
179
 
166
180
  /**
@@ -172,7 +186,7 @@ declare class FormElementComponent implements AfterViewInit, OnDestroy {
172
186
  * setInnerValueAndNotify() = call this when you want your ngModel to be updated from INSIDE of your component, and provide it to the OUTSIDE.
173
187
  * ngOnInit() = Used to support the angular reactive forms framework. If you use ngOnInit in your own component (which happens fairly often) you must not forget to call the super.ngOnInit() method.
174
188
  */
175
- declare class ValueAccessorBase<T> implements ControlValueAccessor, OnInit, OnDestroy {
189
+ declare class ValueAccessorBase<T> implements ControlValueAccessor, OnInit, OnChanges, OnDestroy {
176
190
  protected parent: FormElementComponent;
177
191
  protected controlContainer: ControlContainer;
178
192
  innerValue: T;
@@ -186,13 +200,17 @@ declare class ValueAccessorBase<T> implements ControlValueAccessor, OnInit, OnDe
186
200
  formControl: UntypedFormControl;
187
201
  inErrorState: boolean;
188
202
  getTailTplFn: () => TemplateRef<any>;
203
+ size: FormSize | null;
189
204
  onTouch: EventEmitter<void>;
190
205
  nativeInputRef: ElementRef;
206
+ private injectedSize;
207
+ protected sizeClass: SizeClass;
191
208
  private attachedFormControl;
192
209
  private tailTpl;
193
210
  private getImmutableValueFn;
194
211
  constructor(parent: FormElementComponent, controlContainer: ControlContainer);
195
212
  ngOnInit(): void;
213
+ ngOnChanges(changes: SimpleChanges): void;
196
214
  protected getImmutableValue(): T;
197
215
  isInErrorState(): boolean;
198
216
  ngOnDestroy(): void;
@@ -207,17 +225,14 @@ declare class ValueAccessorBase<T> implements ControlValueAccessor, OnInit, OnDe
207
225
  setTailTpl: (tpl: TemplateRef<any>) => void;
208
226
  getTailTpl: () => TemplateRef<any>;
209
227
  static ɵfac: i0.ɵɵFactoryDeclaration<ValueAccessorBase<any>, [{ optional: true; host: true; }, { optional: true; host: true; }]>;
210
- static ɵcmp: i0.ɵɵComponentDeclaration<ValueAccessorBase<any>, "ng-component", never, { "disabled": { "alias": "disabled"; "required": false; }; "innerValueChangeInterceptor": { "alias": "innerValueChangeInterceptor"; "required": false; }; "formControlName": { "alias": "formControlName"; "required": false; }; "formControl": { "alias": "formControl"; "required": false; }; "inErrorState": { "alias": "inErrorState"; "required": false; }; "getTailTplFn": { "alias": "getTailTplFn"; "required": false; }; }, { "onTouch": "onTouch"; }, never, never, false, never>;
228
+ static ɵcmp: i0.ɵɵComponentDeclaration<ValueAccessorBase<any>, "ng-component", never, { "disabled": { "alias": "disabled"; "required": false; }; "innerValueChangeInterceptor": { "alias": "innerValueChangeInterceptor"; "required": false; }; "formControlName": { "alias": "formControlName"; "required": false; }; "formControl": { "alias": "formControl"; "required": false; }; "inErrorState": { "alias": "inErrorState"; "required": false; }; "getTailTplFn": { "alias": "getTailTplFn"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, { "onTouch": "onTouch"; }, never, never, false, never>;
211
229
  }
212
230
 
213
231
  declare class MultipleValueAccessorBase<T> extends ValueAccessorBase<Array<T> | T> {
214
- protected parent: FormElementComponent;
215
- protected controlContainer: ControlContainer;
216
232
  multiple: boolean;
217
- constructor(parent: FormElementComponent, controlContainer: ControlContainer);
218
233
  writeValue(value: Array<T> | T): void;
219
234
  setInnerValueAndNotify(value: T | Array<T>): void;
220
- static ɵfac: i0.ɵɵFactoryDeclaration<MultipleValueAccessorBase<any>, [{ optional: true; host: true; }, { optional: true; host: true; }]>;
235
+ static ɵfac: i0.ɵɵFactoryDeclaration<MultipleValueAccessorBase<any>, never>;
221
236
  static ɵcmp: i0.ɵɵComponentDeclaration<MultipleValueAccessorBase<any>, "ng-component", never, { "multiple": { "alias": "multiple"; "required": false; }; }, {}, never, never, false, never>;
222
237
  }
223
238
 
@@ -237,10 +252,18 @@ declare class ButtonComponent {
237
252
  static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "klp-form-button", never, { "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "fullWidth": { "alias": "fullWidth"; "required": false; }; "hasBorder": { "alias": "hasBorder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "type": { "alias": "type"; "required": false; }; "clickCallback": { "alias": "clickCallback"; "required": false; }; }, {}, never, ["*"], false, never>;
238
253
  }
239
254
 
240
- declare class CheckboxComponent extends ValueAccessorBase<boolean> {
255
+ declare function stringIsSetAndFilled(s: string): boolean;
256
+
257
+ declare class CheckboxComponent extends ValueAccessorBase<boolean> implements OnInit, OnChanges {
258
+ protected readonly stringIsSetAndFilled: typeof stringIsSetAndFilled;
241
259
  caption: string;
242
260
  description: string;
243
261
  renderUndefinedAsIndeterminate: boolean;
262
+ protected checkBoxSize: number;
263
+ protected captionSpacing: number;
264
+ ngOnInit(): void;
265
+ ngOnChanges(changes: SimpleChanges): void;
266
+ private calculateCheckboxSize;
244
267
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxComponent, never>;
245
268
  static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxComponent, "klp-form-checkbox", never, { "caption": { "alias": "caption"; "required": false; }; "description": { "alias": "description"; "required": false; }; "renderUndefinedAsIndeterminate": { "alias": "renderUndefinedAsIndeterminate"; "required": false; }; }, {}, never, never, false, never>;
246
269
  }
@@ -259,7 +282,7 @@ declare class DatePickerComponent extends MultipleValueAccessorBase<string | typ
259
282
  format: string;
260
283
  placeholder: string;
261
284
  clearable: boolean;
262
- size: 'small' | 'medium' | 'large';
285
+ size: FormSize | null;
263
286
  suffixTpl: TemplateRef<any> | null;
264
287
  prefixTpl: TemplateRef<any> | null;
265
288
  dateValue: Date | Array<Date>;
@@ -295,7 +318,6 @@ declare class DateTimePickerComponent extends MultipleValueAccessorBase<Date | t
295
318
  initHour: string;
296
319
  initMinute: string;
297
320
  invalidTimeAsMidnight: boolean;
298
- size: 'small' | 'medium' | 'large';
299
321
  suffixTpl: TemplateRef<any> | null;
300
322
  prefixTpl: TemplateRef<any> | null;
301
323
  nativeInputRef: ElementRef;
@@ -347,7 +369,7 @@ declare class DateTimePickerComponent extends MultipleValueAccessorBase<Date | t
347
369
  clickHandlerForTimeDropdown: (event: MouseEvent) => void;
348
370
  shizzle(): void;
349
371
  static ɵfac: i0.ɵɵFactoryDeclaration<DateTimePickerComponent, [{ optional: true; host: true; }, { optional: true; host: true; }, { optional: true; }, { optional: true; }, null, null, null, null]>;
350
- static ɵcmp: i0.ɵɵComponentDeclaration<DateTimePickerComponent, "klp-form-date-time-picker", never, { "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "sameMonthOnly": { "alias": "sameMonthOnly"; "required": false; }; "format": { "alias": "format"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "showTimeInput": { "alias": "showTimeInput"; "required": false; }; "initHour": { "alias": "initHour"; "required": false; }; "initMinute": { "alias": "initMinute"; "required": false; }; "invalidTimeAsMidnight": { "alias": "invalidTimeAsMidnight"; "required": false; }; "size": { "alias": "size"; "required": false; }; "suffixTpl": { "alias": "suffixTpl"; "required": false; }; "prefixTpl": { "alias": "prefixTpl"; "required": false; }; }, {}, never, never, false, never>;
372
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateTimePickerComponent, "klp-form-date-time-picker", never, { "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "sameMonthOnly": { "alias": "sameMonthOnly"; "required": false; }; "format": { "alias": "format"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "showTimeInput": { "alias": "showTimeInput"; "required": false; }; "initHour": { "alias": "initHour"; "required": false; }; "initMinute": { "alias": "initMinute"; "required": false; }; "invalidTimeAsMidnight": { "alias": "invalidTimeAsMidnight"; "required": false; }; "suffixTpl": { "alias": "suffixTpl"; "required": false; }; "prefixTpl": { "alias": "prefixTpl"; "required": false; }; }, {}, never, never, false, never>;
351
373
  }
352
374
 
353
375
  declare class EmailInputComponent extends ValueAccessorBase<string> {
@@ -356,10 +378,15 @@ declare class EmailInputComponent extends ValueAccessorBase<string> {
356
378
  static ɵcmp: i0.ɵɵComponentDeclaration<EmailInputComponent, "klp-form-email-input", never, { "placeholder": { "alias": "placeholder"; "required": false; }; }, {}, never, never, false, never>;
357
379
  }
358
380
 
359
- declare class LoadingIndicatorComponent {
381
+ declare class LoadingIndicatorComponent implements OnInit, OnChanges {
360
382
  variant: '3dots' | 'spinner' | 'textInput' | 'picker';
361
383
  size: 'tiny' | 'small' | 'medium' | 'large' | 'huge';
362
- formSize: 'small' | 'medium' | 'large';
384
+ formSize: FormSize | null;
385
+ private injectedSize;
386
+ protected parent: FormElementComponent;
387
+ protected sizeClass: SizeClass;
388
+ ngOnInit(): void;
389
+ ngOnChanges(changes: SimpleChanges): void;
363
390
  static ɵfac: i0.ɵɵFactoryDeclaration<LoadingIndicatorComponent, never>;
364
391
  static ɵcmp: i0.ɵɵComponentDeclaration<LoadingIndicatorComponent, "klp-form-loading-indicator", never, { "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "formSize": { "alias": "formSize"; "required": false; }; }, {}, never, never, false, never>;
365
392
  }
@@ -367,12 +394,11 @@ declare class LoadingIndicatorComponent {
367
394
  declare class NumberInputComponent extends ValueAccessorBase<string | number> {
368
395
  placeholder: string;
369
396
  parseNumber: boolean;
370
- size: 'small' | 'medium' | 'large';
371
397
  suffixTpl: TemplateRef<any> | null;
372
398
  prefixTpl: TemplateRef<any> | null;
373
399
  setInnerValueAndNotify(value: string | number): void;
374
400
  static ɵfac: i0.ɵɵFactoryDeclaration<NumberInputComponent, never>;
375
- static ɵcmp: i0.ɵɵComponentDeclaration<NumberInputComponent, "klp-form-number-input", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "parseNumber": { "alias": "parseNumber"; "required": false; }; "size": { "alias": "size"; "required": false; }; "suffixTpl": { "alias": "suffixTpl"; "required": false; }; "prefixTpl": { "alias": "prefixTpl"; "required": false; }; }, {}, never, never, false, never>;
401
+ static ɵcmp: i0.ɵɵComponentDeclaration<NumberInputComponent, "klp-form-number-input", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "parseNumber": { "alias": "parseNumber"; "required": false; }; "suffixTpl": { "alias": "suffixTpl"; "required": false; }; "prefixTpl": { "alias": "prefixTpl"; "required": false; }; }, {}, never, never, false, never>;
376
402
  }
377
403
 
378
404
  declare class PasswordFieldComponent extends ValueAccessorBase<string> {
@@ -394,7 +420,7 @@ declare class KlpSelectOptionTemplateDirective {
394
420
  static ɵfac: i0.ɵɵFactoryDeclaration<KlpSelectOptionTemplateDirective, never>;
395
421
  static ɵdir: i0.ɵɵDirectiveDeclaration<KlpSelectOptionTemplateDirective, "[klpSelectOptionTpl]", never, {}, {}, never, never, false, never>;
396
422
  }
397
- declare class SelectComponent extends ValueAccessorBase<string | string[]> implements OnChanges, AfterViewInit, OnDestroy {
423
+ declare class SelectComponent extends ValueAccessorBase<string | string[]> implements OnInit, OnChanges, AfterViewInit, OnDestroy {
398
424
  protected parent: FormElementComponent;
399
425
  protected controlContainer: ControlContainer;
400
426
  private translations;
@@ -420,7 +446,6 @@ declare class SelectComponent extends ValueAccessorBase<string | string[]> imple
420
446
  description: string;
421
447
  }) => boolean;
422
448
  footerElement: TemplateRef<any>;
423
- size: 'small' | 'medium' | 'large';
424
449
  prefixTpl: TemplateRef<any> | null;
425
450
  suffixTpl: TemplateRef<any> | null;
426
451
  onSearch: EventEmitter<string>;
@@ -471,7 +496,7 @@ declare class SelectComponent extends ValueAccessorBase<string | string[]> imple
471
496
  private getScrollbarWidth;
472
497
  ngOnDestroy(): void;
473
498
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent, [{ optional: true; host: true; }, { optional: true; host: true; }, { optional: true; }, null, null]>;
474
- static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "klp-form-select", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "options": { "alias": "options"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "multipleDisplayedAsAmount": { "alias": "multipleDisplayedAsAmount"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "truncateOptions": { "alias": "truncateOptions"; "required": false; }; "withSeparatingLine": { "alias": "withSeparatingLine"; "required": false; }; "searchable": { "alias": "searchable"; "required": false; }; "hasBorderLeft": { "alias": "hasBorderLeft"; "required": false; }; "hasBorderRight": { "alias": "hasBorderRight"; "required": false; }; "dropdownPosition": { "alias": "dropdownPosition"; "required": false; }; "dropdownAlignment": { "alias": "dropdownAlignment"; "required": false; }; "customSearchFn": { "alias": "customSearchFn"; "required": false; }; "footerElement": { "alias": "footerElement"; "required": false; }; "size": { "alias": "size"; "required": false; }; "prefixTpl": { "alias": "prefixTpl"; "required": false; }; "suffixTpl": { "alias": "suffixTpl"; "required": false; }; }, { "onSearch": "onSearch"; "onEndReached": "onEndReached"; "onOpened": "onOpened"; "onClosed": "onClosed"; "onBlur": "onBlur"; "onClear": "onClear"; "onEnterKey": "onEnterKey"; }, ["customOptionTpl"], never, false, never>;
499
+ static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "klp-form-select", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "options": { "alias": "options"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "multipleDisplayedAsAmount": { "alias": "multipleDisplayedAsAmount"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "truncateOptions": { "alias": "truncateOptions"; "required": false; }; "withSeparatingLine": { "alias": "withSeparatingLine"; "required": false; }; "searchable": { "alias": "searchable"; "required": false; }; "hasBorderLeft": { "alias": "hasBorderLeft"; "required": false; }; "hasBorderRight": { "alias": "hasBorderRight"; "required": false; }; "dropdownPosition": { "alias": "dropdownPosition"; "required": false; }; "dropdownAlignment": { "alias": "dropdownAlignment"; "required": false; }; "customSearchFn": { "alias": "customSearchFn"; "required": false; }; "footerElement": { "alias": "footerElement"; "required": false; }; "prefixTpl": { "alias": "prefixTpl"; "required": false; }; "suffixTpl": { "alias": "suffixTpl"; "required": false; }; }, { "onSearch": "onSearch"; "onEndReached": "onEndReached"; "onOpened": "onOpened"; "onClosed": "onClosed"; "onBlur": "onBlur"; "onClear": "onClear"; "onEnterKey": "onEnterKey"; }, ["customOptionTpl"], never, false, never>;
475
500
  }
476
501
 
477
502
  declare class SelectFooterComponent {
@@ -482,16 +507,13 @@ declare class SelectFooterComponent {
482
507
  }
483
508
 
484
509
  declare class SortableItemsComponent extends ValueAccessorBase<Array<any>> implements OnInit, AfterViewInit {
485
- protected parent: FormElementComponent;
486
- protected controlContainer: ControlContainer;
487
- private ngZone;
488
510
  template: TemplateRef<any>;
489
511
  sortableItemSize: 'sm' | 'lg';
490
512
  dragItems: QueryList<ElementRef>;
491
513
  dragSourceIndex: number;
492
514
  private currentDragPosition;
493
515
  private scrollInterval;
494
- constructor(parent: FormElementComponent, controlContainer: ControlContainer, ngZone: NgZone);
516
+ private ngZone;
495
517
  ngAfterViewInit(): void;
496
518
  private setDragItemListeners;
497
519
  private onDragOver;
@@ -502,7 +524,7 @@ declare class SortableItemsComponent extends ValueAccessorBase<Array<any>> imple
502
524
  shouldShoveUp(index: number): boolean;
503
525
  private scrollPage;
504
526
  private stopScrolling;
505
- static ɵfac: i0.ɵɵFactoryDeclaration<SortableItemsComponent, [{ optional: true; host: true; }, { optional: true; host: true; }, null]>;
527
+ static ɵfac: i0.ɵɵFactoryDeclaration<SortableItemsComponent, never>;
506
528
  static ɵcmp: i0.ɵɵComponentDeclaration<SortableItemsComponent, "klp-form-sortable-items", never, { "sortableItemSize": { "alias": "sortableItemSize"; "required": false; }; }, {}, ["template"], never, false, never>;
507
529
  }
508
530
 
@@ -525,13 +547,12 @@ declare class TextInputComponent extends ValueAccessorBase<string> {
525
547
  passwordPeekIcon: TemplateRef<any>;
526
548
  suffixTpl: TemplateRef<any> | null;
527
549
  prefixTpl: TemplateRef<any> | null;
528
- size: 'small' | 'medium' | 'large';
529
550
  onBlur: EventEmitter<void>;
530
551
  private isPeekingPassword;
531
552
  togglePeakPassword(): void;
532
553
  getType(): 'text' | 'password';
533
554
  static ɵfac: i0.ɵɵFactoryDeclaration<TextInputComponent, never>;
534
- static ɵcmp: i0.ɵɵComponentDeclaration<TextInputComponent, "klp-form-text-input", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "type": { "alias": "type"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "hasBorderLeft": { "alias": "hasBorderLeft"; "required": false; }; "hasBorderRight": { "alias": "hasBorderRight"; "required": false; }; "passwordPeekIcon": { "alias": "passwordPeekIcon"; "required": false; }; "suffixTpl": { "alias": "suffixTpl"; "required": false; }; "prefixTpl": { "alias": "prefixTpl"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, { "onBlur": "onBlur"; }, never, never, false, never>;
555
+ static ɵcmp: i0.ɵɵComponentDeclaration<TextInputComponent, "klp-form-text-input", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "type": { "alias": "type"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "hasBorderLeft": { "alias": "hasBorderLeft"; "required": false; }; "hasBorderRight": { "alias": "hasBorderRight"; "required": false; }; "passwordPeekIcon": { "alias": "passwordPeekIcon"; "required": false; }; "suffixTpl": { "alias": "suffixTpl"; "required": false; }; "prefixTpl": { "alias": "prefixTpl"; "required": false; }; }, { "onBlur": "onBlur"; }, never, never, false, never>;
535
556
  }
536
557
 
537
558
  declare class TextAreaComponent extends ValueAccessorBase<string> {
@@ -541,10 +562,19 @@ declare class TextAreaComponent extends ValueAccessorBase<string> {
541
562
  static ɵcmp: i0.ɵɵComponentDeclaration<TextAreaComponent, "klp-form-text-area", never, { "placeholder": { "alias": "placeholder"; "required": false; }; }, { "onBlur": "onBlur"; }, never, never, false, never>;
542
563
  }
543
564
 
544
- declare class ToggleComponent extends ValueAccessorBase<boolean> {
565
+ declare class ToggleComponent extends ValueAccessorBase<boolean> implements OnInit, OnChanges {
566
+ protected readonly stringIsSetAndFilled: typeof stringIsSetAndFilled;
545
567
  transparentBackground: boolean;
568
+ caption: string;
569
+ description: string;
570
+ protected toggleWidth: number;
571
+ protected toggleHeight: number;
572
+ protected captionSpacing: number;
573
+ ngOnInit(): void;
574
+ ngOnChanges(changes: SimpleChanges): void;
575
+ private calculateToggleSize;
546
576
  static ɵfac: i0.ɵɵFactoryDeclaration<ToggleComponent, never>;
547
- static ɵcmp: i0.ɵɵComponentDeclaration<ToggleComponent, "klp-form-toggle", never, { "transparentBackground": { "alias": "transparentBackground"; "required": false; }; }, {}, never, never, false, never>;
577
+ static ɵcmp: i0.ɵɵComponentDeclaration<ToggleComponent, "klp-form-toggle", never, { "transparentBackground": { "alias": "transparentBackground"; "required": false; }; "caption": { "alias": "caption"; "required": false; }; "description": { "alias": "description"; "required": false; }; }, {}, never, never, false, never>;
548
578
  }
549
579
 
550
580
  declare class FileInputComponent extends MultipleValueAccessorBase<File> {
@@ -582,6 +612,22 @@ declare class FormCaptionEndComponent implements OnInit, OnDestroy {
582
612
  static ɵcmp: i0.ɵɵComponentDeclaration<FormCaptionEndComponent, "klp-form-caption-end", never, {}, {}, never, ["*"], false, never>;
583
613
  }
584
614
 
615
+ declare class FormSubCaptionComponent implements AfterViewInit, OnDestroy {
616
+ contentRef: TemplateRef<any>;
617
+ private parent;
618
+ ngAfterViewInit(): void;
619
+ ngOnDestroy(): void;
620
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormSubCaptionComponent, never>;
621
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormSubCaptionComponent, "klp-form-sub-caption", never, {}, {}, never, ["*"], false, never>;
622
+ }
623
+
624
+ declare class FormTextSubCaptionComponent {
625
+ text: string;
626
+ protected parent: FormElementComponent;
627
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormTextSubCaptionComponent, never>;
628
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormTextSubCaptionComponent, "klp-form-text-sub-caption", never, { "text": { "alias": "text"; "required": true; }; }, {}, never, never, false, never>;
629
+ }
630
+
585
631
  declare class FormErrorComponent implements OnInit {
586
632
  private parent;
587
633
  error: ErrorTypes;
@@ -644,14 +690,18 @@ type RadioOption = {
644
690
  name: string;
645
691
  description?: string;
646
692
  };
647
- declare class RadioComponent extends ValueAccessorBase<string> {
693
+ declare class RadioComponent extends ValueAccessorBase<string> implements OnInit, OnChanges {
648
694
  options: RadioOptions;
649
695
  orientation: Orientation;
650
696
  variant: 'classic' | 'button' | 'buttonGray';
651
- size: 'small' | 'medium';
652
697
  Orientation: typeof Orientation;
698
+ protected radioSize: number;
699
+ protected captionSpacing: number;
700
+ ngOnInit(): void;
701
+ ngOnChanges(changes: SimpleChanges): void;
702
+ private calculateRadioSize;
653
703
  static ɵfac: i0.ɵɵFactoryDeclaration<RadioComponent, never>;
654
- static ɵcmp: i0.ɵɵComponentDeclaration<RadioComponent, "klp-form-radio", never, { "options": { "alias": "options"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, {}, never, never, false, never>;
704
+ static ɵcmp: i0.ɵɵComponentDeclaration<RadioComponent, "klp-form-radio", never, { "options": { "alias": "options"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; }, {}, never, never, false, never>;
655
705
  }
656
706
 
657
707
  declare class WithTooltipDirective {
@@ -713,7 +763,7 @@ declare class MaterialModule {
713
763
 
714
764
  declare class NgxEnhancyFormsModule {
715
765
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxEnhancyFormsModule, never>;
716
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxEnhancyFormsModule, [typeof ValueAccessorBase, typeof MultipleValueAccessorBase, typeof ButtonComponent, typeof CheckboxComponent, typeof DatePickerComponent, typeof DateTimePickerComponent, typeof EmailInputComponent, typeof LoadingIndicatorComponent, typeof NumberInputComponent, typeof PasswordFieldComponent, typeof SelectComponent, typeof KlpSelectOptionTemplateDirective, typeof SelectFooterComponent, typeof SortableItemsComponent, typeof SortableGroupedItemsComponent, typeof TextInputComponent, typeof TextAreaComponent, typeof ToggleComponent, typeof FileInputComponent, typeof FormCaptionComponent, typeof FormCaptionEndComponent, typeof FormElementComponent, typeof FormErrorComponent, typeof FormSubmitButtonComponent, typeof FormComponent, typeof SubFormDirective, typeof HourMinuteInputComponent, typeof RadioComponent, typeof WithTooltipDirective, typeof OnRenderDirective, typeof WarningIconComponent, typeof ElementIsTruncatedCbComponent], [typeof i31.CommonModule, typeof i32.FormsModule, typeof i33.NgSelectModule, typeof MaterialModule], [typeof ValueAccessorBase, typeof MultipleValueAccessorBase, typeof ButtonComponent, typeof DatePickerComponent, typeof DateTimePickerComponent, typeof CheckboxComponent, typeof EmailInputComponent, typeof LoadingIndicatorComponent, typeof NumberInputComponent, typeof PasswordFieldComponent, typeof SelectComponent, typeof KlpSelectOptionTemplateDirective, typeof SelectFooterComponent, typeof SortableItemsComponent, typeof SortableGroupedItemsComponent, typeof TextInputComponent, typeof TextAreaComponent, typeof ToggleComponent, typeof FileInputComponent, typeof FormCaptionComponent, typeof FormCaptionEndComponent, typeof FormElementComponent, typeof FormErrorComponent, typeof FormSubmitButtonComponent, typeof FormComponent, typeof SubFormDirective, typeof HourMinuteInputComponent, typeof RadioComponent, typeof WithTooltipDirective, typeof OnRenderDirective, typeof ElementIsTruncatedCbComponent]>;
766
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxEnhancyFormsModule, [typeof ValueAccessorBase, typeof MultipleValueAccessorBase, typeof ButtonComponent, typeof CheckboxComponent, typeof DatePickerComponent, typeof DateTimePickerComponent, typeof EmailInputComponent, typeof LoadingIndicatorComponent, typeof NumberInputComponent, typeof PasswordFieldComponent, typeof SelectComponent, typeof KlpSelectOptionTemplateDirective, typeof SelectFooterComponent, typeof SortableItemsComponent, typeof SortableGroupedItemsComponent, typeof TextInputComponent, typeof TextAreaComponent, typeof ToggleComponent, typeof FileInputComponent, typeof FormCaptionComponent, typeof FormCaptionEndComponent, typeof FormSubCaptionComponent, typeof FormTextSubCaptionComponent, typeof FormElementComponent, typeof FormErrorComponent, typeof FormSubmitButtonComponent, typeof FormComponent, typeof SubFormDirective, typeof HourMinuteInputComponent, typeof RadioComponent, typeof WithTooltipDirective, typeof OnRenderDirective, typeof WarningIconComponent, typeof ElementIsTruncatedCbComponent], [typeof i33.CommonModule, typeof i34.FormsModule, typeof i35.NgSelectModule, typeof MaterialModule], [typeof ValueAccessorBase, typeof MultipleValueAccessorBase, typeof ButtonComponent, typeof DatePickerComponent, typeof DateTimePickerComponent, typeof CheckboxComponent, typeof EmailInputComponent, typeof LoadingIndicatorComponent, typeof NumberInputComponent, typeof PasswordFieldComponent, typeof SelectComponent, typeof KlpSelectOptionTemplateDirective, typeof SelectFooterComponent, typeof SortableItemsComponent, typeof SortableGroupedItemsComponent, typeof TextInputComponent, typeof TextAreaComponent, typeof ToggleComponent, typeof FileInputComponent, typeof FormCaptionComponent, typeof FormCaptionEndComponent, typeof FormSubCaptionComponent, typeof FormTextSubCaptionComponent, typeof FormElementComponent, typeof FormErrorComponent, typeof FormSubmitButtonComponent, typeof FormComponent, typeof SubFormDirective, typeof HourMinuteInputComponent, typeof RadioComponent, typeof WithTooltipDirective, typeof OnRenderDirective, typeof ElementIsTruncatedCbComponent]>;
717
767
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxEnhancyFormsModule>;
718
768
  }
719
769
 
@@ -730,5 +780,5 @@ declare const KLP_FORM_ERROR_HANDLER: InjectionToken<FormErrorHandler>;
730
780
  declare const KLP_FORM_ERROR_NO_CONTROL_FOUND_HANDLER: InjectionToken<FormErrorNoControlFound>;
731
781
  declare const DefaultErrorHandler: FormErrorHandler;
732
782
 
733
- export { ButtonComponent, CheckboxComponent, DATE_PICKER_LOCALE, DATE_PICKER_TRANSLATIONS, DATE_TIME_PICKER_TRANSLATIONS, DEFAULT_ERROR_MESSAGES, DatePickerComponent, DateTimePickerComponent, DefaultErrorHandler, ElementIsTruncatedCbComponent, EmailInputComponent, FORM_ERROR_MESSAGES, FileInputComponent, FormCaptionComponent, FormCaptionEndComponent, FormComponent, FormElementComponent, FormErrorComponent, FormSubmitButtonComponent, FormValidationError, HourMinuteInputComponent, KLP_DATE_FORMATS, KLP_FORM_ERROR_HANDLER, KLP_FORM_ERROR_NO_CONTROL_FOUND_HANDLER, KlpSelectOptionTemplateDirective, LoadingIndicatorComponent, MultipleValueAccessorBase, NgxEnhancyFormsModule, NumberInputComponent, OnRenderDirective, Orientation, PasswordFieldComponent, RadioComponent, SELECT_TRANSLATIONS, SelectComponent, SelectFooterComponent, SortableGroupedItemsComponent, SortableItemsComponent, SubFormDirective, TextAreaComponent, TextInputComponent, ToggleComponent, ValueAccessorBase, WithTooltipDirective, dateValidator, invalidDateKey, invalidFieldsSymbol, matDateFormatsFactory };
734
- export type { AppSelectOption, AppSelectOptions, ButtonVariant, CustomErrorMessages, ErrorTypes, FormErrorHandler, FormErrorMessages, FormErrorNoControlFound, FormValidationErrors, KlpDateFormats, OnInjectedEmitterType, RadioOption, RadioOptions, SubmitButtonVariant };
783
+ export { ButtonComponent, CheckboxComponent, DATE_PICKER_LOCALE, DATE_PICKER_TRANSLATIONS, DATE_TIME_PICKER_TRANSLATIONS, DEFAULT_ERROR_MESSAGES, DatePickerComponent, DateTimePickerComponent, DefaultErrorHandler, DefaultSize, ElementIsTruncatedCbComponent, EmailInputComponent, FORM_ERROR_MESSAGES, FileInputComponent, FormCaptionComponent, FormCaptionEndComponent, FormComponent, FormElementComponent, FormErrorComponent, FormSubCaptionComponent, FormSubmitButtonComponent, FormTextSubCaptionComponent, FormValidationError, HourMinuteInputComponent, KLP_DATE_FORMATS, KLP_FORM_DEFAULT_SIZE, KLP_FORM_ERROR_HANDLER, KLP_FORM_ERROR_NO_CONTROL_FOUND_HANDLER, KlpSelectOptionTemplateDirective, LoadingIndicatorComponent, MultipleValueAccessorBase, NgxEnhancyFormsModule, NumberInputComponent, OnRenderDirective, Orientation, PasswordFieldComponent, RadioComponent, SELECT_TRANSLATIONS, SelectComponent, SelectFooterComponent, SortableGroupedItemsComponent, SortableItemsComponent, SubFormDirective, TextAreaComponent, TextInputComponent, ToggleComponent, ValueAccessorBase, WithTooltipDirective, dateValidator, getSizeClass, invalidDateKey, invalidFieldsSymbol, matDateFormatsFactory };
784
+ export type { AppSelectOption, AppSelectOptions, ButtonVariant, CustomErrorMessages, ErrorTypes, FormErrorHandler, FormErrorMessages, FormErrorNoControlFound, FormSize, FormValidationErrors, KlpDateFormats, OnInjectedEmitterType, RadioOption, RadioOptions, SizeClass, SubmitButtonVariant };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klippa/ngx-enhancy-forms",
3
- "version": "20.1.1",
3
+ "version": "20.1.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },