ud-components 0.4.9 → 0.5.2
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 +242 -154
- package/fesm2022/ud-components.mjs.map +1 -1
- package/lib/custom-table/custom-table.component.d.ts +9 -38
- package/lib/custom-table/custom-table.interface.d.ts +9 -6
- package/lib/modal/modal.component.d.ts +5 -1
- package/lib/toggle-option/toggle-option.component.d.ts +30 -0
- package/package.json +3 -1
- package/public-api.d.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TableAction, TableMenuItem, TableQueryChange } from './custom-table.interface';
|
|
2
2
|
import { NumberOperator } from '../../enums/custom-table.enum';
|
|
3
3
|
import { TableDisplayColumnType } from '../../enums/table-display-column-type';
|
|
4
4
|
import { TableDisplayColumn } from '../../interfaces/table-display-column.interface';
|
|
@@ -12,13 +12,6 @@ import { MatSort } from '@angular/material/sort';
|
|
|
12
12
|
import { MatTableDataSource } from '@angular/material/table';
|
|
13
13
|
import { Observable } from 'rxjs';
|
|
14
14
|
import * as i0 from "@angular/core";
|
|
15
|
-
export declare enum ActionType {
|
|
16
|
-
ADD = "add",
|
|
17
|
-
APPROVE = "approve",
|
|
18
|
-
DELETE = "delete",
|
|
19
|
-
EXTEND = "extend",
|
|
20
|
-
REJECT = "reject"
|
|
21
|
-
}
|
|
22
15
|
export declare class CustomTableComponent implements OnInit {
|
|
23
16
|
private translateService;
|
|
24
17
|
private readonly destroyRef;
|
|
@@ -37,11 +30,7 @@ export declare class CustomTableComponent implements OnInit {
|
|
|
37
30
|
/**
|
|
38
31
|
* Actions
|
|
39
32
|
*/
|
|
40
|
-
actions:
|
|
41
|
-
/**
|
|
42
|
-
* Custom actions
|
|
43
|
-
*/
|
|
44
|
-
customActions: CustomAction[];
|
|
33
|
+
actions: TableAction[];
|
|
45
34
|
/**
|
|
46
35
|
* Should have checkbox or not
|
|
47
36
|
*/
|
|
@@ -118,25 +107,12 @@ export declare class CustomTableComponent implements OnInit {
|
|
|
118
107
|
*/
|
|
119
108
|
disableHeader?: boolean;
|
|
120
109
|
/**
|
|
121
|
-
* Emits
|
|
122
|
-
*/
|
|
123
|
-
delete: EventEmitter<SelectionModel<any>>;
|
|
124
|
-
/**
|
|
125
|
-
* Emits approve
|
|
126
|
-
*/
|
|
127
|
-
approve: EventEmitter<SelectionModel<any>>;
|
|
128
|
-
/**
|
|
129
|
-
* Emits reject
|
|
130
|
-
*/
|
|
131
|
-
reject: EventEmitter<SelectionModel<any>>;
|
|
132
|
-
/**
|
|
133
|
-
* Emits extend
|
|
134
|
-
*/
|
|
135
|
-
extend: EventEmitter<SelectionModel<any>>;
|
|
136
|
-
/**
|
|
137
|
-
* Emits add
|
|
110
|
+
* Emits the action id and current selection when an action button is clicked
|
|
138
111
|
*/
|
|
139
|
-
|
|
112
|
+
actionClicked: EventEmitter<{
|
|
113
|
+
id: string;
|
|
114
|
+
selection: SelectionModel<any>;
|
|
115
|
+
}>;
|
|
140
116
|
/**
|
|
141
117
|
* Emits clicked
|
|
142
118
|
*/
|
|
@@ -178,11 +154,7 @@ export declare class CustomTableComponent implements OnInit {
|
|
|
178
154
|
applyFilterByColumn(): void;
|
|
179
155
|
private buildFilterCriteria;
|
|
180
156
|
filterSelectionChanged(selectedFilters: string[]): void;
|
|
181
|
-
|
|
182
|
-
approveAction(): void;
|
|
183
|
-
rejectAction(): void;
|
|
184
|
-
extendAction(): void;
|
|
185
|
-
addAction(): void;
|
|
157
|
+
onActionClicked(action: TableAction): void;
|
|
186
158
|
clickedAction(item: any): void;
|
|
187
159
|
onPageChange(event: PageEvent): void;
|
|
188
160
|
/** Whether the number of selected elements matches the total number of rows. */
|
|
@@ -214,7 +186,6 @@ export declare class CustomTableComponent implements OnInit {
|
|
|
214
186
|
protected readonly capitalize: (word: string) => string;
|
|
215
187
|
protected readonly TableDisplayColumnType: typeof TableDisplayColumnType;
|
|
216
188
|
protected readonly NumberOperator: typeof NumberOperator;
|
|
217
|
-
protected readonly ActionType: typeof ActionType;
|
|
218
189
|
static ɵfac: i0.ɵɵFactoryDeclaration<CustomTableComponent, never>;
|
|
219
|
-
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; }; "
|
|
190
|
+
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; }; "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; }; }, { "actionClicked": "actionClicked"; "clicked": "clicked"; "queryChange": "queryChange"; }, ["actionsTemplate"], never, true, never>;
|
|
220
191
|
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
2
|
+
import { UdButtonColor, UdButtonVariant } from '../button/button.component';
|
|
2
3
|
import { FilterCriteria } from '../../interfaces/table.interface';
|
|
3
|
-
export interface
|
|
4
|
-
|
|
4
|
+
export interface TableAction {
|
|
5
|
+
id: string;
|
|
5
6
|
icon: string;
|
|
6
|
-
|
|
7
|
+
label?: string;
|
|
8
|
+
color?: UdButtonColor;
|
|
9
|
+
variant?: UdButtonVariant;
|
|
7
10
|
disabled?: (selection: SelectionModel<any>) => boolean;
|
|
8
11
|
}
|
|
9
|
-
export interface
|
|
10
|
-
|
|
11
|
-
tooltipText: string;
|
|
12
|
+
export interface TableMenuItem {
|
|
13
|
+
label: string;
|
|
12
14
|
icon: string;
|
|
15
|
+
clickFn: (selection: SelectionModel<any>) => void;
|
|
13
16
|
disabled?: (selection: SelectionModel<any>) => boolean;
|
|
14
17
|
}
|
|
15
18
|
export interface TableQuery {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { ModalInputType } from '../../enums/modal-input-type.enum';
|
|
2
2
|
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class ModalComponent {
|
|
5
6
|
data: any;
|
|
7
|
+
private dialogRef;
|
|
6
8
|
protected form?: FormGroup;
|
|
7
9
|
protected modalInputType: typeof ModalInputType;
|
|
8
10
|
protected showClose: boolean;
|
|
9
11
|
protected pictureUrls?: string;
|
|
10
12
|
protected currentPictureIndex?: number;
|
|
11
|
-
constructor(data: any);
|
|
13
|
+
constructor(data: any, dialogRef: MatDialogRef<ModalComponent>);
|
|
14
|
+
close(): void;
|
|
15
|
+
onAction(): void;
|
|
12
16
|
previous(): void;
|
|
13
17
|
next(): void;
|
|
14
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent, never>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ToggleOptionComponent implements ControlValueAccessor, OnInit, OnDestroy {
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
checked: boolean;
|
|
8
|
+
controlName?: string;
|
|
9
|
+
size: 'sm' | 'md' | 'lg';
|
|
10
|
+
get isSm(): boolean;
|
|
11
|
+
get isMd(): boolean;
|
|
12
|
+
get isLg(): boolean;
|
|
13
|
+
isDisabled: boolean;
|
|
14
|
+
private controlContainer;
|
|
15
|
+
private destroy$;
|
|
16
|
+
checkedChange: EventEmitter<boolean>;
|
|
17
|
+
toggle: EventEmitter<boolean>;
|
|
18
|
+
private _onChange;
|
|
19
|
+
private onTouched;
|
|
20
|
+
private get formControl();
|
|
21
|
+
ngOnInit(): void;
|
|
22
|
+
ngOnDestroy(): void;
|
|
23
|
+
onToggle(): void;
|
|
24
|
+
writeValue(value: boolean): void;
|
|
25
|
+
registerOnChange(fn: (value: boolean) => void): void;
|
|
26
|
+
registerOnTouched(fn: () => void): void;
|
|
27
|
+
setDisabledState(isDisabled: boolean): void;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToggleOptionComponent, never>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ToggleOptionComponent, "ud-toggle-option", never, { "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "controlName": { "alias": "controlName"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, { "checkedChange": "checkedChange"; "toggle": "toggle"; }, never, never, true, never>;
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ud-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
+
"@angular/cdk": ">=19",
|
|
5
6
|
"@angular/common": ">=19",
|
|
6
7
|
"@angular/core": ">=19",
|
|
8
|
+
"@angular/material": ">=19",
|
|
7
9
|
"@ngrx/signals": ">=19"
|
|
8
10
|
},
|
|
9
11
|
"dependencies": {
|
package/public-api.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export * from './lib/button/button.component';
|
|
|
26
26
|
export * from './lib/button-toggle/button-toggle.component';
|
|
27
27
|
export * from './lib/preview-container/preview-container.component';
|
|
28
28
|
export * from './lib/toggle/toggle.component';
|
|
29
|
+
export * from './lib/toggle-option/toggle-option.component';
|
|
29
30
|
export * from './enums/feature-flag-key.enum';
|
|
30
31
|
export * from './enums/loading-status.enum';
|
|
31
32
|
export * from './enums/application-status.enum';
|