ud-components 0.2.5 → 0.2.7
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/ud-components.mjs +282 -13
- package/fesm2022/ud-components.mjs.map +1 -1
- package/lib/custom-table/custom-table.component.d.ts +7 -2
- package/lib/custom-table/custom-table.interface.d.ts +6 -0
- package/lib/form-fields/autocomplete/autocomplete.component.d.ts +42 -0
- package/lib/form-fields/multi-select/multi-select.component.d.ts +5 -3
- package/lib/form-fields/text-input/text-input.component.d.ts +2 -1
- package/lib/form-fields/textarea/textarea.component.d.ts +25 -0
- package/lib/form-fields/time-picker/time-picker.component.d.ts +35 -0
- package/package.json +26 -2
- package/public-api.d.ts +3 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomAction, TableQueryChange } from './custom-table.interface';
|
|
1
|
+
import { CustomAction, TableMenuItem, TableQueryChange } from './custom-table.interface';
|
|
2
2
|
import { NumberOperator } from '../../enums/custom-table.enum';
|
|
3
3
|
import { Role } from '../../enums/role.enum';
|
|
4
4
|
import { TableDisplayColumnType } from '../../enums/table-display-column-type';
|
|
@@ -104,6 +104,11 @@ export declare class CustomTableComponent implements OnInit {
|
|
|
104
104
|
* Actions button shown or not
|
|
105
105
|
*/
|
|
106
106
|
actionsMenuEnabled?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Pre-set per-row menu items rendered when actionsMenuEnabled is true.
|
|
109
|
+
* Each item has a label, icon, and clickFn(row).
|
|
110
|
+
*/
|
|
111
|
+
menuItems: TableMenuItem[];
|
|
107
112
|
/**
|
|
108
113
|
* Number of rows
|
|
109
114
|
*/
|
|
@@ -213,5 +218,5 @@ export declare class CustomTableComponent implements OnInit {
|
|
|
213
218
|
protected readonly NumberOperator: typeof NumberOperator;
|
|
214
219
|
protected readonly ActionType: typeof ActionType;
|
|
215
220
|
static ɵfac: i0.ɵɵFactoryDeclaration<CustomTableComponent, never>;
|
|
216
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CustomTableComponent, "ud-table", never, { "id": { "alias": "id"; "required": false; }; "title": { "alias": "title"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; "customActions": { "alias": "customActions"; "required": false; }; "allowedRoles": { "alias": "allowedRoles"; "required": false; }; "haveCheckbox": { "alias": "haveCheckbox"; "required": false; }; "displayedColumns": { "alias": "displayedColumns"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; "paginationSizeOptions": { "alias": "paginationSizeOptions"; "required": false; }; "initialPageSize": { "alias": "initialPageSize"; "required": false; }; "specificSelectRow": { "alias": "specificSelectRow"; "required": false; }; "hasFilter": { "alias": "hasFilter"; "required": false; }; "expandableRows": { "alias": "expandableRows"; "required": false; }; "expandedItem": { "alias": "expandedItem"; "required": false; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "separateFilters": { "alias": "separateFilters"; "required": false; }; "showPaginator": { "alias": "showPaginator"; "required": false; }; "noTableDataMessage": { "alias": "noTableDataMessage"; "required": false; }; "actionsMenuEnabled": { "alias": "actionsMenuEnabled"; "required": false; }; "totalElements": { "alias": "totalElements"; "required": false; }; "serverSideFiltering": { "alias": "serverSideFiltering"; "required": false; }; "disableHeader": { "alias": "disableHeader"; "required": false; }; }, { "delete": "delete"; "approve": "approve"; "reject": "reject"; "extend": "extend"; "add": "add"; "clicked": "clicked"; "queryChange": "queryChange"; }, ["actionsTemplate"], never, true, never>;
|
|
221
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomTableComponent, "ud-table", never, { "id": { "alias": "id"; "required": false; }; "title": { "alias": "title"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; "customActions": { "alias": "customActions"; "required": false; }; "allowedRoles": { "alias": "allowedRoles"; "required": false; }; "haveCheckbox": { "alias": "haveCheckbox"; "required": false; }; "displayedColumns": { "alias": "displayedColumns"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; "paginationSizeOptions": { "alias": "paginationSizeOptions"; "required": false; }; "initialPageSize": { "alias": "initialPageSize"; "required": false; }; "specificSelectRow": { "alias": "specificSelectRow"; "required": false; }; "hasFilter": { "alias": "hasFilter"; "required": false; }; "expandableRows": { "alias": "expandableRows"; "required": false; }; "expandedItem": { "alias": "expandedItem"; "required": false; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "separateFilters": { "alias": "separateFilters"; "required": false; }; "showPaginator": { "alias": "showPaginator"; "required": false; }; "noTableDataMessage": { "alias": "noTableDataMessage"; "required": false; }; "actionsMenuEnabled": { "alias": "actionsMenuEnabled"; "required": false; }; "menuItems": { "alias": "menuItems"; "required": false; }; "totalElements": { "alias": "totalElements"; "required": false; }; "serverSideFiltering": { "alias": "serverSideFiltering"; "required": false; }; "disableHeader": { "alias": "disableHeader"; "required": false; }; }, { "delete": "delete"; "approve": "approve"; "reject": "reject"; "extend": "extend"; "add": "add"; "clicked": "clicked"; "queryChange": "queryChange"; }, ["actionsTemplate"], never, true, never>;
|
|
217
222
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
2
2
|
import { FilterCriteria } from '../../interfaces/table.interface';
|
|
3
|
+
export interface TableMenuItem {
|
|
4
|
+
label: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
clickFn: (selection: SelectionModel<any>) => void;
|
|
7
|
+
disabled?: (selection: SelectionModel<any>) => boolean;
|
|
8
|
+
}
|
|
3
9
|
export interface CustomAction {
|
|
4
10
|
clickFn: (params?: any) => any;
|
|
5
11
|
tooltipText: string;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { UdSelectOption } from '../multi-select/multi-select.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Styled autocomplete input that participates in the parent FormGroup.
|
|
7
|
+
* Filters options as the user types and stores the selected option's value
|
|
8
|
+
* (not the label) in the form control.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* <ud-autocomplete
|
|
12
|
+
* controlName="country"
|
|
13
|
+
* label="Country"
|
|
14
|
+
* icon="public"
|
|
15
|
+
* [options]="countryOptions" />
|
|
16
|
+
*/
|
|
17
|
+
export declare class AutocompleteComponent implements OnInit, OnChanges, OnDestroy {
|
|
18
|
+
controlName: string;
|
|
19
|
+
label: string;
|
|
20
|
+
placeholder: string;
|
|
21
|
+
icon?: string;
|
|
22
|
+
iconFontSet: string;
|
|
23
|
+
options: UdSelectOption[];
|
|
24
|
+
/** Internal text control that drives the visible input */
|
|
25
|
+
searchControl: FormControl<string | null>;
|
|
26
|
+
filteredOptions: UdSelectOption[];
|
|
27
|
+
private controlContainer;
|
|
28
|
+
private destroy$;
|
|
29
|
+
private labelMap;
|
|
30
|
+
get formControl(): FormControl;
|
|
31
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
32
|
+
ngOnInit(): void;
|
|
33
|
+
ngOnDestroy(): void;
|
|
34
|
+
/** Called when the user selects an option from the dropdown */
|
|
35
|
+
onOptionSelected(value: any): void;
|
|
36
|
+
/** Display function for mat-autocomplete — shows the label, not the raw value */
|
|
37
|
+
displayFn: (value: any) => string;
|
|
38
|
+
private filter;
|
|
39
|
+
private buildLabelMap;
|
|
40
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AutocompleteComponent, never>;
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AutocompleteComponent, "ud-autocomplete", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconFontSet": { "alias": "iconFontSet"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, {}, never, never, true, never>;
|
|
42
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
1
|
+
import { OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { FormControl } from '@angular/forms';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export interface UdSelectOption {
|
|
@@ -22,7 +22,7 @@ export interface UdSelectOption {
|
|
|
22
22
|
* Pass options with already-resolved labels (translate before passing in):
|
|
23
23
|
* rolesOptions = roles.map(r => ({ value: r.key, label: translate(r.translationKey) }));
|
|
24
24
|
*/
|
|
25
|
-
export declare class MultiSelectComponent implements OnInit, OnDestroy {
|
|
25
|
+
export declare class MultiSelectComponent implements OnInit, OnChanges, OnDestroy {
|
|
26
26
|
controlName: string;
|
|
27
27
|
label: string;
|
|
28
28
|
icon?: string;
|
|
@@ -37,16 +37,18 @@ export declare class MultiSelectComponent implements OnInit, OnDestroy {
|
|
|
37
37
|
* Default: "+{n} more"
|
|
38
38
|
*/
|
|
39
39
|
moreText: string;
|
|
40
|
+
loading: boolean;
|
|
40
41
|
selectedValues: any[];
|
|
41
42
|
private controlContainer;
|
|
42
43
|
private destroy$;
|
|
43
44
|
private labelMap;
|
|
44
45
|
get control(): FormControl;
|
|
46
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
45
47
|
ngOnInit(): void;
|
|
46
48
|
ngOnDestroy(): void;
|
|
47
49
|
getLabelFor(value: any): string;
|
|
48
50
|
getMoreText(count: number): string;
|
|
49
51
|
private buildLabelMap;
|
|
50
52
|
static ɵfac: i0.ɵɵFactoryDeclaration<MultiSelectComponent, never>;
|
|
51
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MultiSelectComponent, "ud-multi-select", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconFontSet": { "alias": "iconFontSet"; "required": false; }; "options": { "alias": "options"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "maxChipsVisible": { "alias": "maxChipsVisible"; "required": false; }; "moreText": { "alias": "moreText"; "required": false; }; }, {}, never, never, true, never>;
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MultiSelectComponent, "ud-multi-select", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconFontSet": { "alias": "iconFontSet"; "required": false; }; "options": { "alias": "options"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "maxChipsVisible": { "alias": "maxChipsVisible"; "required": false; }; "moreText": { "alias": "moreText"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; }, {}, never, never, true, never>;
|
|
52
54
|
}
|
|
@@ -18,6 +18,7 @@ export declare class TextInputComponent {
|
|
|
18
18
|
/** Material icon name. Leave empty to show no icon. */
|
|
19
19
|
icon?: string;
|
|
20
20
|
iconFontSet: string;
|
|
21
|
+
loading: boolean;
|
|
21
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<TextInputComponent, never>;
|
|
22
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TextInputComponent, "ud-text-input", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "type": { "alias": "type"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconFontSet": { "alias": "iconFontSet"; "required": false; }; }, {}, never, never, true, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextInputComponent, "ud-text-input", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "type": { "alias": "type"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconFontSet": { "alias": "iconFontSet"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; }, {}, never, never, true, never>;
|
|
23
24
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Styled auto-growing textarea that participates in the parent FormGroup.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* <ud-textarea
|
|
7
|
+
* controlName="notes"
|
|
8
|
+
* label="Notes"
|
|
9
|
+
* icon="notes"
|
|
10
|
+
* [minRows]="3"
|
|
11
|
+
* [maxRows]="8" />
|
|
12
|
+
*/
|
|
13
|
+
export declare class TextareaComponent {
|
|
14
|
+
controlName: string;
|
|
15
|
+
label: string;
|
|
16
|
+
placeholder: string;
|
|
17
|
+
icon?: string;
|
|
18
|
+
iconFontSet: string;
|
|
19
|
+
/** Minimum number of visible rows before auto-grow kicks in. */
|
|
20
|
+
minRows: number;
|
|
21
|
+
/** Maximum number of rows before a scrollbar appears. */
|
|
22
|
+
maxRows: number;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextareaComponent, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextareaComponent, "ud-textarea", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconFontSet": { "alias": "iconFontSet"; "required": false; }; "minRows": { "alias": "minRows"; "required": false; }; "maxRows": { "alias": "maxRows"; "required": false; }; }, {}, never, never, true, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MatTimepickerOption } from '@angular/material/timepicker';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Styled time picker that participates in the parent FormGroup.
|
|
5
|
+
*
|
|
6
|
+
* Usage (interval mode — value is in minutes):
|
|
7
|
+
* <ud-time-picker
|
|
8
|
+
* controlName="checkInTime"
|
|
9
|
+
* label="Check-in time"
|
|
10
|
+
* [intervalMinutes]="30" />
|
|
11
|
+
*
|
|
12
|
+
* Usage (custom options mode):
|
|
13
|
+
* <ud-time-picker
|
|
14
|
+
* controlName="checkInTime"
|
|
15
|
+
* label="Check-in time"
|
|
16
|
+
* [options]="timeOptions" />
|
|
17
|
+
*/
|
|
18
|
+
export declare class TimePickerComponent {
|
|
19
|
+
controlName: string;
|
|
20
|
+
label: string;
|
|
21
|
+
placeholder: string;
|
|
22
|
+
icon: string;
|
|
23
|
+
iconFontSet: string;
|
|
24
|
+
/**
|
|
25
|
+
* Minutes between each option in the dropdown (e.g. 30 → every half hour).
|
|
26
|
+
* Omit to use Material's default (30 min). Ignored when `options` is provided.
|
|
27
|
+
* Internally converted to seconds for mat-timepicker.
|
|
28
|
+
*/
|
|
29
|
+
intervalMinutes?: number;
|
|
30
|
+
/** Pre-defined list of selectable times. When set, `intervalMinutes` is ignored. */
|
|
31
|
+
options?: readonly MatTimepickerOption<Date>[] | null;
|
|
32
|
+
get _intervalSeconds(): number | null;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TimePickerComponent, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TimePickerComponent, "ud-time-picker", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconFontSet": { "alias": "iconFontSet"; "required": false; }; "intervalMinutes": { "alias": "intervalMinutes"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, {}, never, never, true, never>;
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ud-components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^19.2.0",
|
|
6
6
|
"@angular/core": "^19.2.0"
|
|
@@ -18,6 +18,30 @@
|
|
|
18
18
|
".": {
|
|
19
19
|
"types": "./index.d.ts",
|
|
20
20
|
"default": "./fesm2022/ud-components.mjs"
|
|
21
|
+
},
|
|
22
|
+
"./enums/role.enum": {
|
|
23
|
+
"types": "./enums/role.enum.d.ts",
|
|
24
|
+
"default": "./enums/role.enum.js"
|
|
25
|
+
},
|
|
26
|
+
"./lib/kpi/kpi.enum": {
|
|
27
|
+
"types": "./lib/kpi/kpi.enum.d.ts",
|
|
28
|
+
"default": "./lib/kpi/kpi.enum.js"
|
|
29
|
+
},
|
|
30
|
+
"./lib/edit-view/edit-view-section.directive": {
|
|
31
|
+
"types": "./lib/edit-view/edit-view-section.directive.d.ts",
|
|
32
|
+
"default": "./lib/edit-view/edit-view-section.directive.js"
|
|
33
|
+
},
|
|
34
|
+
"./interfaces/page-request.interface": {
|
|
35
|
+
"types": "./interfaces/page-request.interface.d.ts",
|
|
36
|
+
"default": "./interfaces/page-request.interface.js"
|
|
37
|
+
},
|
|
38
|
+
"./interfaces/table.interface": {
|
|
39
|
+
"types": "./interfaces/table.interface.d.ts",
|
|
40
|
+
"default": "./interfaces/table.interface.js"
|
|
41
|
+
},
|
|
42
|
+
"./interfaces/table-display-column.interface": {
|
|
43
|
+
"types": "./interfaces/table-display-column.interface.d.ts",
|
|
44
|
+
"default": "./interfaces/table-display-column.interface.js"
|
|
21
45
|
}
|
|
22
46
|
}
|
|
23
|
-
}
|
|
47
|
+
}
|
package/public-api.d.ts
CHANGED
|
@@ -14,9 +14,12 @@ export * from './lib/summary-view/summary-view.component';
|
|
|
14
14
|
export * from './lib/tabs/tabs.component';
|
|
15
15
|
export * from './lib/tel-input/tel-input.component';
|
|
16
16
|
export * from './lib/form-fields/text-input/text-input.component';
|
|
17
|
+
export * from './lib/form-fields/autocomplete/autocomplete.component';
|
|
17
18
|
export * from './lib/form-fields/date-input/date-input.component';
|
|
18
19
|
export * from './lib/form-fields/multi-select/multi-select.component';
|
|
19
20
|
export * from './lib/form-fields/pill-toggle/pill-toggle.component';
|
|
21
|
+
export * from './lib/form-fields/time-picker/time-picker.component';
|
|
22
|
+
export * from './lib/form-fields/textarea/textarea.component';
|
|
20
23
|
export * from './lib/button/button.component';
|
|
21
24
|
export * from './lib/toggle/toggle.component';
|
|
22
25
|
export * from './enums/application-status.enum';
|