ud-components 0.2.5 → 0.2.6

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.
@@ -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;
@@ -42,6 +42,7 @@ export declare class MultiSelectComponent implements OnInit, OnDestroy {
42
42
  private destroy$;
43
43
  private labelMap;
44
44
  get control(): FormControl;
45
+ ngOnChanges(changes: SimpleChanges): void;
45
46
  ngOnInit(): void;
46
47
  ngOnDestroy(): void;
47
48
  getLabelFor(value: any): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ud-components",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.0",
6
6
  "@angular/core": "^19.2.0"
package/public-api.d.ts CHANGED
@@ -14,6 +14,7 @@ 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';