cats-ui-lib 2.2.8 → 2.2.10
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/fesm2022/cats-ui-lib.mjs +336 -84
- package/fesm2022/cats-ui-lib.mjs.map +1 -1
- package/index.d.ts +73 -8
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { OnChanges, EventEmitter, ElementRef, SimpleChanges, OnInit, TemplateRef, ChangeDetectorRef, OnDestroy, Renderer2, QueryList, ViewContainerRef, ApplicationRef, EnvironmentInjector } from '@angular/core';
|
|
3
3
|
import { ControlValueAccessor, Validator, FormControl } from '@angular/forms';
|
|
4
4
|
import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
@@ -41,10 +41,33 @@ declare class SearchConfig {
|
|
|
41
41
|
serachValue: string;
|
|
42
42
|
placeholder?: string;
|
|
43
43
|
}
|
|
44
|
+
interface InputDropdownOption {
|
|
45
|
+
id?: string | number;
|
|
46
|
+
name?: string;
|
|
47
|
+
icon?: string;
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
}
|
|
50
|
+
interface InputDropdownConfig {
|
|
51
|
+
options: InputDropdownOption[];
|
|
52
|
+
selected?: InputDropdownOption | string | number;
|
|
53
|
+
idField?: string;
|
|
54
|
+
textField?: string;
|
|
55
|
+
iconField?: string;
|
|
56
|
+
disabledField?: string;
|
|
57
|
+
placeholder?: string;
|
|
58
|
+
}
|
|
44
59
|
declare class InputConfig {
|
|
45
60
|
type: 'text' | 'email' | 'password' | 'number';
|
|
46
61
|
placeholder?: string;
|
|
47
62
|
label?: string;
|
|
63
|
+
showDropdown?: boolean;
|
|
64
|
+
dropdownPosition?: 'leading' | 'trailing';
|
|
65
|
+
dropdownOptions?: InputDropdownOption[];
|
|
66
|
+
dropdownSelected?: InputDropdownOption | string | number;
|
|
67
|
+
leadingDropdown?: InputDropdownConfig;
|
|
68
|
+
trailingDropdown?: InputDropdownConfig;
|
|
69
|
+
errorMessage?: string;
|
|
70
|
+
showErrorMessage?: boolean;
|
|
48
71
|
}
|
|
49
72
|
declare class AutoCompleteSingleSelectConfig {
|
|
50
73
|
idField: string;
|
|
@@ -74,6 +97,7 @@ declare class AutoCompleteMultiSelectConfig {
|
|
|
74
97
|
declare class ToggleConfig {
|
|
75
98
|
checked: boolean;
|
|
76
99
|
disabled?: boolean;
|
|
100
|
+
type?: string;
|
|
77
101
|
}
|
|
78
102
|
declare class CheckBoxSubtask {
|
|
79
103
|
idField: string;
|
|
@@ -86,6 +110,7 @@ declare class CheckBoxConfig {
|
|
|
86
110
|
disabledField?: string;
|
|
87
111
|
name: string;
|
|
88
112
|
checked?: boolean;
|
|
113
|
+
type?: string;
|
|
89
114
|
subtasks?: CheckBoxSubtask[];
|
|
90
115
|
}
|
|
91
116
|
interface RadioButtonConfig {
|
|
@@ -94,6 +119,7 @@ interface RadioButtonConfig {
|
|
|
94
119
|
valueField?: string;
|
|
95
120
|
textField?: string;
|
|
96
121
|
name: string;
|
|
122
|
+
type?: string;
|
|
97
123
|
layout?: 'horizontal' | 'vertical';
|
|
98
124
|
}
|
|
99
125
|
interface DialogConfig {
|
|
@@ -105,21 +131,29 @@ interface DialogConfig {
|
|
|
105
131
|
showHeader?: boolean;
|
|
106
132
|
}
|
|
107
133
|
|
|
108
|
-
declare class InputComponent implements ControlValueAccessor, Validator {
|
|
134
|
+
declare class InputComponent implements ControlValueAccessor, Validator, OnChanges {
|
|
135
|
+
private el;
|
|
109
136
|
inputConfig: InputConfig;
|
|
137
|
+
selectedValue?: InputDropdownOption | string | number;
|
|
110
138
|
onKeyDown: EventEmitter<{
|
|
111
139
|
value: string;
|
|
112
140
|
} & KeyboardEvent>;
|
|
113
141
|
onKeyUp: EventEmitter<{
|
|
114
142
|
value: string;
|
|
115
143
|
} & KeyboardEvent>;
|
|
144
|
+
onDropdownSelection: EventEmitter<InputDropdownOption>;
|
|
116
145
|
value: string;
|
|
117
146
|
disabled: boolean;
|
|
118
147
|
touched: boolean;
|
|
119
148
|
control: FormControl<any> | null;
|
|
120
149
|
showPassword: boolean;
|
|
150
|
+
openDropdown: 'leading' | 'trailing' | null;
|
|
151
|
+
selectedLeadingOption: InputDropdownOption | null;
|
|
152
|
+
selectedTrailingOption: InputDropdownOption | null;
|
|
121
153
|
private onChange;
|
|
122
154
|
private onTouched;
|
|
155
|
+
constructor(el: ElementRef);
|
|
156
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
123
157
|
/**
|
|
124
158
|
* @description Method to when value changes
|
|
125
159
|
* @author Shiva Kant
|
|
@@ -158,8 +192,25 @@ declare class InputComponent implements ControlValueAccessor, Validator {
|
|
|
158
192
|
* @author Shiva Kant
|
|
159
193
|
*/
|
|
160
194
|
togglePassword(): void;
|
|
195
|
+
toggleDropdown(position: 'leading' | 'trailing', event: MouseEvent): void;
|
|
196
|
+
selectDropdownOption(position: 'leading' | 'trailing', option: InputDropdownOption, event: MouseEvent): void;
|
|
197
|
+
getDropdownText(option: InputDropdownOption | null, config?: InputDropdownConfig): string;
|
|
198
|
+
getDropdownIcon(option: InputDropdownOption | null, config?: InputDropdownConfig): string;
|
|
199
|
+
isDropdownSelected(position: 'leading' | 'trailing', option: InputDropdownOption): boolean;
|
|
200
|
+
isOptionDisabled(option: InputDropdownOption, config?: InputDropdownConfig): boolean;
|
|
201
|
+
closeDropdown(event: MouseEvent): void;
|
|
202
|
+
private syncDropdownSelections;
|
|
203
|
+
private resolveSelectedOption;
|
|
204
|
+
getDropdownConfig(position: 'leading' | 'trailing'): InputDropdownConfig | undefined;
|
|
205
|
+
private getIdField;
|
|
206
|
+
private getTextField;
|
|
207
|
+
private getIconField;
|
|
208
|
+
private hasDropdownConfig;
|
|
209
|
+
getOptionId(option: InputDropdownOption | null, config?: InputDropdownConfig): any;
|
|
210
|
+
private emitValueChange;
|
|
211
|
+
private getDropdownSelectedValue;
|
|
161
212
|
static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, never>;
|
|
162
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "cats-ui-input", never, { "inputConfig": { "alias": "inputConfig"; "required": false; }; }, { "onKeyDown": "onKeyDown"; "onKeyUp": "onKeyUp"; }, never, never, true, never>;
|
|
213
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "cats-ui-input", never, { "inputConfig": { "alias": "inputConfig"; "required": false; }; "selectedValue": { "alias": "selectedValue"; "required": false; }; }, { "onKeyDown": "onKeyDown"; "onKeyUp": "onKeyUp"; "onDropdownSelection": "onDropdownSelection"; }, never, never, true, never>;
|
|
163
214
|
}
|
|
164
215
|
|
|
165
216
|
declare const SINGLE_SELECT_CONTROL_VALUE_ACCESSOR: any;
|
|
@@ -330,6 +381,7 @@ declare class MultiSelectComponent implements OnChanges, OnInit, ControlValueAcc
|
|
|
330
381
|
}
|
|
331
382
|
|
|
332
383
|
declare class SearchBoxComponent implements ControlValueAccessor {
|
|
384
|
+
searchInput?: ElementRef<HTMLInputElement>;
|
|
333
385
|
searchParam: string;
|
|
334
386
|
searchConfig: SearchConfig;
|
|
335
387
|
onClose: EventEmitter<void>;
|
|
@@ -337,6 +389,7 @@ declare class SearchBoxComponent implements ControlValueAccessor {
|
|
|
337
389
|
private onChange;
|
|
338
390
|
onTouched: () => void;
|
|
339
391
|
isDisabled: boolean;
|
|
392
|
+
toggleSearch: boolean;
|
|
340
393
|
ngOnInit(): void;
|
|
341
394
|
/**
|
|
342
395
|
* @description Method to Called when input changes
|
|
@@ -352,6 +405,7 @@ declare class SearchBoxComponent implements ControlValueAccessor {
|
|
|
352
405
|
registerOnChange(fn: (value: string) => void): void;
|
|
353
406
|
registerOnTouched(fn: () => void): void;
|
|
354
407
|
setDisabledState?(isDisabled: boolean): void;
|
|
408
|
+
showSearch(): void;
|
|
355
409
|
static ɵfac: i0.ɵɵFactoryDeclaration<SearchBoxComponent, never>;
|
|
356
410
|
static ɵcmp: i0.ɵɵComponentDeclaration<SearchBoxComponent, "cats-ui-search-box", never, { "searchConfig": { "alias": "searchConfig"; "required": false; }; }, { "onClose": "onClose"; "searchParamValue": "searchParamValue"; }, never, never, true, never>;
|
|
357
411
|
}
|
|
@@ -907,8 +961,9 @@ interface TimeFilterValue {
|
|
|
907
961
|
type: string;
|
|
908
962
|
dates?: any;
|
|
909
963
|
lastValue?: number;
|
|
910
|
-
lastUnit?:
|
|
964
|
+
lastUnit?: LastUnit;
|
|
911
965
|
}
|
|
966
|
+
type LastUnit = 'seconds' | 'minutes' | 'hours' | 'days';
|
|
912
967
|
declare class TimestampFilterComponent implements OnInit {
|
|
913
968
|
private cdr;
|
|
914
969
|
config: TimeFilterConfig;
|
|
@@ -917,8 +972,14 @@ declare class TimestampFilterComponent implements OnInit {
|
|
|
917
972
|
radioValue: string | null;
|
|
918
973
|
previousRadioValue: string | null;
|
|
919
974
|
activePicker: TimeFilterOption | null;
|
|
975
|
+
activePickerTrigger: HTMLElement | null;
|
|
920
976
|
lastValue: number;
|
|
921
|
-
lastUnit:
|
|
977
|
+
lastUnit: LastUnit;
|
|
978
|
+
isLastUnitDropdownOpen: boolean;
|
|
979
|
+
lastUnitOptions: {
|
|
980
|
+
label: string;
|
|
981
|
+
value: LastUnit;
|
|
982
|
+
}[];
|
|
922
983
|
selectedDateLabels: Record<string, string>;
|
|
923
984
|
dateControls: Record<string, FormControl>;
|
|
924
985
|
get normalOptions(): TimeFilterOption[];
|
|
@@ -926,10 +987,11 @@ declare class TimestampFilterComponent implements OnInit {
|
|
|
926
987
|
/** Returns the FormControl for the currently active picker. */
|
|
927
988
|
get activePickerControl(): FormControl | null;
|
|
928
989
|
constructor(cdr: ChangeDetectorRef);
|
|
990
|
+
closeLastUnitDropdown(): void;
|
|
929
991
|
ngOnInit(): void;
|
|
930
992
|
private applyPreset;
|
|
931
993
|
getPickerConfig(option: TimeFilterOption): DatePickerConfig;
|
|
932
|
-
selectOption(option: TimeFilterOption): void;
|
|
994
|
+
selectOption(option: TimeFilterOption, trigger?: HTMLElement): void;
|
|
933
995
|
onDateApplied(event: any): void;
|
|
934
996
|
/**
|
|
935
997
|
* Cancel: restore radio to whatever was selected before picker opened.
|
|
@@ -937,6 +999,9 @@ declare class TimestampFilterComponent implements OnInit {
|
|
|
937
999
|
onCancel(_event: any): void;
|
|
938
1000
|
emitLast(): void;
|
|
939
1001
|
onLastChange(): void;
|
|
1002
|
+
toggleLastUnitDropdown(option: TimeFilterOption, trigger: HTMLElement, event: MouseEvent): void;
|
|
1003
|
+
selectLastUnit(unit: LastUnit, event: MouseEvent): void;
|
|
1004
|
+
getLastUnitLabel(unit: TimeFilterValue['lastUnit']): string;
|
|
940
1005
|
reset(): void;
|
|
941
1006
|
private extractStartDate;
|
|
942
1007
|
private extractEndDate;
|
|
@@ -1119,7 +1184,7 @@ declare class DialogBoxService {
|
|
|
1119
1184
|
}
|
|
1120
1185
|
|
|
1121
1186
|
interface SidebarConfig {
|
|
1122
|
-
sidebarType?: 'sectional' | string;
|
|
1187
|
+
sidebarType?: 'sectional' | 'default' | string;
|
|
1123
1188
|
switchOrganiser?: boolean;
|
|
1124
1189
|
}
|
|
1125
1190
|
interface SidebarAttribute {
|
|
@@ -1191,4 +1256,4 @@ declare class SidebarComponent {
|
|
|
1191
1256
|
}
|
|
1192
1257
|
|
|
1193
1258
|
export { AccordionComponent, AccordionItemComponent, AutoCompleteMultiSelectComponent, AutoCompleteMultiSelectConfig, AutoCompleteSingleSelectComponent, AutoCompleteSingleSelectConfig, CatsUiService, CatsUiTooltipDirective, CheckBoxConfig, CheckBoxSubtask, CheckboxButtonComponent, CustomDatePickerComponent, DROPDOWN_CONTROL_VALUE_ACCESSOR, DROPDOWN_CONTROL_VALUE_VALIDATOR, DialogBoxComponent, DialogBoxService, FileUploadComponent, HeaderComponent, InputComponent, InputConfig, MULTI_SELECT_CONTROL_VALUE_ACCESSOR, MULTI_SELECT_CONTROL_VALUE_VALIDATOR, MultiSelectComponent, MultiSelectConfig, OutsideClickDirective, RadioButtonComponent, SINGLE_SELECT_CONTROL_VALUE_ACCESSOR, SINGLE_SELECT_CONTROL_VALUE_VALIDATOR, SearchBoxComponent, SearchConfig, SidebarComponent, SingleSelectComponent, SingleSelectConfig, TabContentComponent, TabsetComponent, TimestampFilterComponent, ToggleConfig, ToogleButtonComponent, WizardComponent, WizardService, WizardStepDirective };
|
|
1194
|
-
export type { CalenderView, DatePickerConfig, DatePickerMode, DateRange, DateTimeResult, DialogConfig, FilterType, HeaderConfig, RadioButtonConfig, SidebarAttribute, SidebarConfig, SidebarFeature, SidebarModule, TabConfig, TabItem, TimeFilterConfig, TimeFilterOption, TimeFilterOutput, TimeFilterValue };
|
|
1259
|
+
export type { CalenderView, DatePickerConfig, DatePickerMode, DateRange, DateTimeResult, DialogConfig, FilterType, HeaderConfig, InputDropdownConfig, InputDropdownOption, RadioButtonConfig, SidebarAttribute, SidebarConfig, SidebarFeature, SidebarModule, TabConfig, TabItem, TimeFilterConfig, TimeFilterOption, TimeFilterOutput, TimeFilterValue };
|