@3kles/kles-material-dynamicforms 19.5.1 → 21.0.0

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.
Files changed (94) hide show
  1. package/fesm2022/3kles-kles-material-dynamicforms.mjs +285 -277
  2. package/fesm2022/3kles-kles-material-dynamicforms.mjs.map +1 -1
  3. package/package.json +17 -16
  4. package/types/3kles-kles-material-dynamicforms.d.ts +1083 -0
  5. package/index.d.ts +0 -5
  6. package/lib/controls/array.control.d.ts +0 -5
  7. package/lib/controls/control.abstract.d.ts +0 -13
  8. package/lib/controls/control.interface.d.ts +0 -7
  9. package/lib/controls/default.control.d.ts +0 -5
  10. package/lib/controls/group.control.d.ts +0 -5
  11. package/lib/controls/range.control.d.ts +0 -5
  12. package/lib/decorators/component.decorator.d.ts +0 -15
  13. package/lib/directive/dynamic-component.directive.d.ts +0 -16
  14. package/lib/directive/dynamic-field.directive.d.ts +0 -25
  15. package/lib/directive/mat-error-form.directive.d.ts +0 -12
  16. package/lib/directive/mat-error-message.directive.d.ts +0 -17
  17. package/lib/dynamic-form-intl.d.ts +0 -7
  18. package/lib/dynamic-form.component.d.ts +0 -37
  19. package/lib/enums/button-attribute.enum.d.ts +0 -6
  20. package/lib/enums/type.enum.d.ts +0 -19
  21. package/lib/factories/field.factory.d.ts +0 -6
  22. package/lib/fields/array.component.d.ts +0 -14
  23. package/lib/fields/badge.component.d.ts +0 -9
  24. package/lib/fields/button-fab.component.d.ts +0 -9
  25. package/lib/fields/button-form.component.d.ts +0 -9
  26. package/lib/fields/button-icon.component.d.ts +0 -9
  27. package/lib/fields/button-mini-fab.component.d.ts +0 -9
  28. package/lib/fields/button-toogle-group.component.d.ts +0 -11
  29. package/lib/fields/buttonchecker-form.component.d.ts +0 -9
  30. package/lib/fields/buttonfile-form.component.d.ts +0 -9
  31. package/lib/fields/checkbox-indeterminate.component.d.ts +0 -9
  32. package/lib/fields/checkbox.component.d.ts +0 -11
  33. package/lib/fields/chip.component.d.ts +0 -9
  34. package/lib/fields/color.component.d.ts +0 -10
  35. package/lib/fields/date-time.component.d.ts +0 -6
  36. package/lib/fields/date.component.d.ts +0 -9
  37. package/lib/fields/field.abstract.d.ts +0 -38
  38. package/lib/fields/file.component.d.ts +0 -6
  39. package/lib/fields/group.component.d.ts +0 -16
  40. package/lib/fields/icon.component.d.ts +0 -9
  41. package/lib/fields/input.clearable.component.d.ts +0 -8
  42. package/lib/fields/input.component.d.ts +0 -26
  43. package/lib/fields/label.component.d.ts +0 -10
  44. package/lib/fields/line-break.component.d.ts +0 -9
  45. package/lib/fields/link.component.d.ts +0 -9
  46. package/lib/fields/list-field.component.d.ts +0 -19
  47. package/lib/fields/radio.component.d.ts +0 -11
  48. package/lib/fields/range.component.d.ts +0 -9
  49. package/lib/fields/select.component.d.ts +0 -22
  50. package/lib/fields/select.lazy-search.component.d.ts +0 -12
  51. package/lib/fields/select.search.component.d.ts +0 -37
  52. package/lib/fields/selection-list.component.d.ts +0 -15
  53. package/lib/fields/selection-list.search.component.d.ts +0 -18
  54. package/lib/fields/slide-toggle.component.d.ts +0 -9
  55. package/lib/fields/subfields/clear.component.d.ts +0 -18
  56. package/lib/fields/subfields/copy.component.d.ts +0 -18
  57. package/lib/fields/subfields/password-visibility.component.d.ts +0 -13
  58. package/lib/fields/text.component.d.ts +0 -9
  59. package/lib/fields/textarea.component.d.ts +0 -9
  60. package/lib/forms/button-control-base.d.ts +0 -41
  61. package/lib/forms/button-control.component.d.ts +0 -10
  62. package/lib/forms/buttonchecker-control.component.d.ts +0 -14
  63. package/lib/forms/buttonfile-control.component.d.ts +0 -19
  64. package/lib/forms/fab-control.component.d.ts +0 -7
  65. package/lib/forms/file-control.component.d.ts +0 -20
  66. package/lib/forms/icon-button-control.component.d.ts +0 -7
  67. package/lib/forms/indeterminate-checkbox.d.ts +0 -22
  68. package/lib/forms/mini-fab-control.component.d.ts +0 -7
  69. package/lib/interfaces/clear-control.interface.d.ts +0 -4
  70. package/lib/interfaces/component.interface.d.ts +0 -5
  71. package/lib/interfaces/directive.interface.d.ts +0 -3
  72. package/lib/interfaces/field.config.interface.d.ts +0 -101
  73. package/lib/interfaces/field.interface.d.ts +0 -7
  74. package/lib/interfaces/validator.interface.d.ts +0 -17
  75. package/lib/kles-material-dynamicforms.module.d.ts +0 -76
  76. package/lib/matcher/form-error.matcher.d.ts +0 -9
  77. package/lib/modules/material.module.d.ts +0 -42
  78. package/lib/pipe/array.pipe.d.ts +0 -7
  79. package/lib/pipe/transform.pipe.d.ts +0 -10
  80. package/lib/selection/selection-model.d.ts +0 -102
  81. package/lib/token.d.ts +0 -9
  82. package/lib/ui/array.ui.d.ts +0 -5
  83. package/lib/ui/default.ui.d.ts +0 -5
  84. package/lib/ui/group.ui.d.ts +0 -5
  85. package/lib/ui/ui-state/array-ui-state.d.ts +0 -14
  86. package/lib/ui/ui-state/control-ui-state.d.ts +0 -9
  87. package/lib/ui/ui-state/group-ui-state.d.ts +0 -16
  88. package/lib/ui/ui-state/ui-state.abstract.d.ts +0 -16
  89. package/lib/ui/ui.abstract.d.ts +0 -8
  90. package/lib/ui/ui.interface.d.ts +0 -4
  91. package/lib/utils/destroyable.guard.d.ts +0 -4
  92. package/lib/utils/validation.util.d.ts +0 -2
  93. package/lib/validators/autocomplete.validator.d.ts +0 -3
  94. package/public-api.d.ts +0 -102
@@ -1,10 +0,0 @@
1
- import { PipeTransform } from "@angular/core";
2
- import * as i0 from "@angular/core";
3
- export declare class KlesTransformPipe implements PipeTransform {
4
- transform(value: any, pipes: {
5
- pipe: PipeTransform;
6
- options?: any[];
7
- }[]): any;
8
- static ɵfac: i0.ɵɵFactoryDeclaration<KlesTransformPipe, never>;
9
- static ɵpipe: i0.ɵɵPipeDeclaration<KlesTransformPipe, "klesTransform", true>;
10
- }
@@ -1,102 +0,0 @@
1
- import { Subject } from "rxjs";
2
- /**
3
- * Copy and past from https://github.com/angular/components/blob/17.0.x/src/cdk/collections/selection-model.ts
4
- * (They put everything in private, thanks to angular team)
5
- */
6
- export declare class KlesSelectionModel<T> {
7
- private _multiple;
8
- private _emitChanges;
9
- compareWith?: (o1: T, o2: T) => boolean;
10
- /** Currently-selected values. */
11
- private _selection;
12
- /** Keeps track of the deselected options that haven't been emitted by the change event. */
13
- private _deselectedToEmit;
14
- /** Keeps track of the selected options that haven't been emitted by the change event. */
15
- private _selectedToEmit;
16
- /** Cache for the array value of the selected items. */
17
- private _selected;
18
- /** Selected values. */
19
- get selected(): T[];
20
- /** Event emitted when the value has changed. */
21
- readonly changed: Subject<any>;
22
- constructor(_multiple?: boolean, initiallySelectedValues?: T[], _emitChanges?: boolean, compareWith?: (o1: T, o2: T) => boolean);
23
- /**
24
- * Selects a value or an array of values.
25
- * @param values The values to select
26
- * @return Whether the selection changed as a result of this call
27
- * @breaking-change 16.0.0 make return type boolean
28
- */
29
- select(values: T[], option?: {
30
- emitEvent: boolean;
31
- }): boolean | void;
32
- /**
33
- * Deselects a value or an array of values.
34
- * @param values The values to deselect
35
- * @return Whether the selection changed as a result of this call
36
- * @breaking-change 16.0.0 make return type boolean
37
- */
38
- deselect(values: T[], option?: {
39
- emitEvent: boolean;
40
- }): boolean | void;
41
- /**
42
- * Sets the selected values
43
- * @param values The new selected values
44
- * @return Whether the selection changed as a result of this call
45
- * @breaking-change 16.0.0 make return type boolean
46
- */
47
- setSelection(values: T[], option?: {
48
- emitEvent: boolean;
49
- }): boolean | void;
50
- /**
51
- * Toggles a value between selected and deselected.
52
- * @param value The value to toggle
53
- * @return Whether the selection changed as a result of this call
54
- * @breaking-change 16.0.0 make return type boolean
55
- */
56
- toggle(value: T): boolean | void;
57
- /**
58
- * Clears all of the selected values.
59
- * @param flushEvent Whether to flush the changes in an event.
60
- * If false, the changes to the selection will be flushed along with the next event.
61
- * @return Whether the selection changed as a result of this call
62
- * @breaking-change 16.0.0 make return type boolean
63
- */
64
- clear(flushEvent?: boolean): boolean | void;
65
- /**
66
- * Determines whether a value is selected.
67
- */
68
- isSelected(value: T): boolean;
69
- /**
70
- * Determines whether the model does not have a value.
71
- */
72
- isEmpty(): boolean;
73
- /**
74
- * Determines whether the model has a value.
75
- */
76
- hasValue(): boolean;
77
- /**
78
- * Sorts the selected values based on a predicate function.
79
- */
80
- sort(predicate?: (a: T, b: T) => number): void;
81
- /**
82
- * Gets whether multiple values can be selected.
83
- */
84
- isMultipleSelection(): boolean;
85
- /** Emits a change event and clears the records of selected and deselected values. */
86
- private _emitChangeEvent;
87
- /** Selects a value. */
88
- private _markSelected;
89
- /** Deselects a value. */
90
- private _unmarkSelected;
91
- /** Clears out the selected values. */
92
- private _unmarkAll;
93
- /**
94
- * Verifies the value assignment and throws an error if the specified value array is
95
- * including multiple values while the selection model is not supporting multiple values.
96
- */
97
- private _verifyValueAssignment;
98
- /** Whether there are queued up change to be emitted. */
99
- private _hasQueuedChanges;
100
- /** Returns a value that is comparable to inputValue by applying compareWith function, returns the same inputValue otherwise. */
101
- private _getConcreteValue;
102
- }
package/lib/token.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { FormGroup } from '@angular/forms';
3
- import { IKlesFieldConfig } from './interfaces/field.config.interface';
4
- import { GroupUiState } from './ui/ui-state/group-ui-state';
5
- export declare const FIELD_NAME: InjectionToken<string>;
6
- export declare const GROUP: InjectionToken<FormGroup<any>>;
7
- export declare const SIBLING_FIELDS: InjectionToken<IKlesFieldConfig[]>;
8
- export declare const GROUP_UI: InjectionToken<GroupUiState<any>>;
9
- export declare const FIELD: InjectionToken<IKlesFieldConfig>;
@@ -1,5 +0,0 @@
1
- import { KlesFormUiControl } from './default.ui';
2
- import { AbstractUiState } from './ui-state/ui-state.abstract';
3
- export declare class KlesFormUiArray extends KlesFormUiControl {
4
- create(): AbstractUiState<any, any>;
5
- }
@@ -1,5 +0,0 @@
1
- import { AbstractUiState } from './ui-state/ui-state.abstract';
2
- import { KlesAbstractFormUiControl } from './ui.abstract';
3
- export declare class KlesFormUiControl extends KlesAbstractFormUiControl {
4
- create(): AbstractUiState;
5
- }
@@ -1,5 +0,0 @@
1
- import { KlesFormUiControl } from './default.ui';
2
- import { AbstractUiState } from './ui-state/ui-state.abstract';
3
- export declare class KlesFormUiGroup extends KlesFormUiControl {
4
- create(): AbstractUiState<any, any>;
5
- }
@@ -1,14 +0,0 @@
1
- import { AbstractUiState } from './ui-state.abstract';
2
- export declare class ArrayUiState<TItem extends AbstractUiState<any, any> = AbstractUiState<any, any>, TValue extends any[] = any[], TRawValue extends TValue = TValue> extends AbstractUiState<TValue, TRawValue> {
3
- states: TItem[];
4
- constructor(states?: TItem[]);
5
- setValue(value: TRawValue): void;
6
- patchValue(value: Partial<TRawValue>): void;
7
- childValueChanged(key: string | number, value: any): void;
8
- at(index: number): AbstractUiState;
9
- _find(name: string | number): AbstractUiState | null;
10
- push(control: TItem | TItem[]): void;
11
- insert(index: number, state: TItem | TItem[]): void;
12
- removeAt(index: number): void;
13
- clear(): void;
14
- }
@@ -1,9 +0,0 @@
1
- import { Signal } from '@angular/core';
2
- import { IKlesFieldUi } from '../../interfaces/field.config.interface';
3
- import { AbstractUiState } from './ui-state.abstract';
4
- export declare class ControlUiState<TValue extends IKlesFieldUi> extends AbstractUiState<TValue, TValue> {
5
- constructor(value?: TValue);
6
- get value(): Signal<TValue | undefined>;
7
- setValue(value: TValue): void;
8
- patchValue(value: Partial<TValue> | TValue): void;
9
- }
@@ -1,16 +0,0 @@
1
- import { ɵTypedOrUntyped } from '@angular/forms';
2
- import { AbstractUiState } from './ui-state.abstract';
3
- export declare class GroupUiState<TUiState extends {
4
- [K in keyof TUiState]: AbstractUiState<any>;
5
- } = any> extends AbstractUiState<any, any> {
6
- states: ɵTypedOrUntyped<TUiState, TUiState, {
7
- [key: string]: AbstractUiState<any>;
8
- }>;
9
- constructor(states?: TUiState);
10
- setValue(value: any): void;
11
- patchValue(value: any): void;
12
- childValueChanged(key: string | number, value: any): void;
13
- _find(name: string | number): AbstractUiState | null;
14
- addUiState(name: string, uiState: AbstractUiState<any>): void;
15
- private buildInitialValue;
16
- }
@@ -1,16 +0,0 @@
1
- import { Signal } from '@angular/core';
2
- import { ɵGetProperty } from '@angular/forms';
3
- export declare abstract class AbstractUiState<TValue = any, TRawValue extends TValue = TValue> {
4
- protected _value: import("@angular/core").WritableSignal<TValue>;
5
- private _parent;
6
- private _parentKey;
7
- get<P extends string | readonly (string | number)[]>(path: P): AbstractUiState<ɵGetProperty<TRawValue, P>> | null;
8
- get<P extends string | Array<string | number>>(path: P): AbstractUiState<ɵGetProperty<TRawValue, P>> | null;
9
- _find(name: string | number): AbstractUiState | null;
10
- abstract setValue(value: TRawValue): void;
11
- abstract patchValue(value: Partial<TValue>): void;
12
- get value(): Signal<TValue | undefined>;
13
- setParent(parent: AbstractUiState<any>, key: string | number): void;
14
- protected notifyParent(): void;
15
- childValueChanged(key: string | number, value: any): void;
16
- }
@@ -1,8 +0,0 @@
1
- import { IKlesFieldConfig } from '../interfaces/field.config.interface';
2
- import { AbstractUiState } from './ui-state/ui-state.abstract';
3
- import { IKlesUi } from './ui.interface';
4
- export declare abstract class KlesAbstractFormUiControl implements IKlesUi {
5
- protected field: IKlesFieldConfig;
6
- constructor(field: IKlesFieldConfig);
7
- abstract create(): AbstractUiState;
8
- }
@@ -1,4 +0,0 @@
1
- import { AbstractUiState } from './ui-state/ui-state.abstract';
2
- export interface IKlesUi {
3
- create(): AbstractUiState;
4
- }
@@ -1,4 +0,0 @@
1
- export interface Destroyable {
2
- destroy(): any;
3
- }
4
- export declare function isDestroyable(value: unknown): value is Destroyable;
@@ -1,2 +0,0 @@
1
- import { IKlesValidator, KlesValidationKey } from '../interfaces/validator.interface';
2
- export declare function flattenValidators<T>(validations: IKlesValidator<T>[]): KlesValidationKey[];
@@ -1,3 +0,0 @@
1
- import { ValidatorFn } from "@angular/forms";
2
- export declare function autocompleteObjectValidator(optional?: boolean): ValidatorFn;
3
- export declare function autocompleteStringValidator(validOptions: Array<string>, optional?: boolean): ValidatorFn;
package/public-api.d.ts DELETED
@@ -1,102 +0,0 @@
1
- export * from './lib/kles-material-dynamicforms.module';
2
- /**DIRECTIVE */
3
- export * from './lib/directive/dynamic-field.directive';
4
- export * from './lib/directive/dynamic-component.directive';
5
- export * from './lib/directive/mat-error-message.directive';
6
- export * from './lib/directive/mat-error-form.directive';
7
- export * from './lib/forms/button-control-base';
8
- export * from './lib/forms/button-control.component';
9
- export * from './lib/forms/buttonchecker-control.component';
10
- export * from './lib/forms/buttonfile-control.component';
11
- export * from './lib/forms/file-control.component';
12
- export * from './lib/forms/fab-control.component';
13
- export * from './lib/forms/mini-fab-control.component';
14
- export * from './lib/forms/icon-button-control.component';
15
- export * from './lib/forms/indeterminate-checkbox';
16
- /**FIELDS */
17
- export * from './lib/fields/badge.component';
18
- export * from './lib/fields/button-form.component';
19
- export * from './lib/fields/buttonchecker-form.component';
20
- export * from './lib/fields/buttonfile-form.component';
21
- export * from './lib/fields/checkbox.component';
22
- export * from './lib/fields/checkbox-indeterminate.component';
23
- export * from './lib/fields/color.component';
24
- export * from './lib/fields/date.component';
25
- export * from './lib/fields/date-time.component';
26
- export * from './lib/fields/field.abstract';
27
- export * from './lib/fields/input.component';
28
- export * from './lib/fields/input.clearable.component';
29
- export * from './lib/fields/file.component';
30
- export * from './lib/fields/label.component';
31
- export * from './lib/fields/list-field.component';
32
- export * from './lib/fields/radio.component';
33
- export * from './lib/fields/select.component';
34
- export * from './lib/fields/textarea.component';
35
- export * from './lib/fields/text.component';
36
- export * from './lib/fields/chip.component';
37
- export * from './lib/fields/group.component';
38
- export * from './lib/fields/icon.component';
39
- export * from './lib/fields/select.search.component';
40
- export * from './lib/fields/line-break.component';
41
- export * from './lib/fields/link.component';
42
- export * from './lib/fields/slide-toggle.component';
43
- export * from './lib/fields/selection-list.component';
44
- export * from './lib/fields/button-toogle-group.component';
45
- export * from './lib/fields/array.component';
46
- export * from './lib/fields/range.component';
47
- export * from './lib/fields/subfields/clear.component';
48
- export * from './lib/fields/select.lazy-search.component';
49
- export * from './lib/fields/button-fab.component';
50
- export * from './lib/fields/button-mini-fab.component';
51
- export * from './lib/fields/button-icon.component';
52
- export * from './lib/fields/selection-list.search.component';
53
- export * from './lib/fields/subfields/copy.component';
54
- export * from './lib/fields/subfields/password-visibility.component';
55
- /**ENUMS */
56
- export * from './lib/enums/type.enum';
57
- export * from './lib/enums/button-attribute.enum';
58
- /**INTERFACES */
59
- export * from './lib/interfaces/component.interface';
60
- export * from './lib/interfaces/field.interface';
61
- export * from './lib/interfaces/field.config.interface';
62
- export * from './lib/interfaces/validator.interface';
63
- export * from './lib/interfaces/directive.interface';
64
- export * from './lib/interfaces/clear-control.interface';
65
- /**MATCHER */
66
- export * from './lib/matcher/form-error.matcher';
67
- /**VALIDATORS */
68
- export * from './lib/validators/autocomplete.validator';
69
- /**FORM */
70
- export * from './lib/dynamic-form.component';
71
- /**PIPES */
72
- export * from './lib/pipe/array.pipe';
73
- export * from './lib/pipe/transform.pipe';
74
- /**DECORATORS */
75
- export * from './lib/decorators/component.decorator';
76
- /**FACTORIES */
77
- export * from './lib/factories/field.factory';
78
- /**CONTROLS */
79
- export * from './lib/controls/array.control';
80
- export * from './lib/controls/control.interface';
81
- export * from './lib/controls/default.control';
82
- export * from './lib/controls/group.control';
83
- export * from './lib/controls/range.control';
84
- export * from './lib/controls/control.abstract';
85
- /**SELECTION */
86
- export * from './lib/selection/selection-model';
87
- /**UTILS */
88
- export * from './lib/utils/destroyable.guard';
89
- /**INTL */
90
- export * from './lib/dynamic-form-intl';
91
- /**UI */
92
- export * from './lib/ui/array.ui';
93
- export * from './lib/ui/default.ui';
94
- export * from './lib/ui/group.ui';
95
- export * from './lib/ui/ui.abstract';
96
- export * from './lib/ui/ui.interface';
97
- export * from './lib/ui/ui-state/array-ui-state';
98
- export * from './lib/ui/ui-state/control-ui-state';
99
- export * from './lib/ui/ui-state/group-ui-state';
100
- export * from './lib/ui/ui-state/ui-state.abstract';
101
- /**TOKEN */
102
- export * from './lib/token';