@impartner/design-components 2.1.2 → 2.2.1

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 (56) hide show
  1. package/esm2022/constants/fontawesome-icons.mjs +3005 -3005
  2. package/esm2022/lib/alert/alert.component.mjs +11 -4
  3. package/esm2022/lib/datetime-picker/components/datetime-picker/datetime-picker.component.mjs +10 -10
  4. package/esm2022/lib/datetime-picker/constants/datetime-picker-defaults.mjs +2 -2
  5. package/esm2022/lib/file-upload/file-upload.module.mjs +14 -6
  6. package/esm2022/lib/icon/icon.component.mjs +3 -3
  7. package/esm2022/lib/modal/modal.component.mjs +9 -3
  8. package/esm2022/lib/progress-bar/progress-bar.component.mjs +19 -3
  9. package/esm2022/lib/select-icon/select-icon.component.mjs +3 -3
  10. package/esm2022/lib/table/components/bulk-actions/bulk-actions.component.mjs +6 -1
  11. package/esm2022/lib/table/constants/table.constants.mjs +1 -2
  12. package/esm2022/lib/table/containers/table.component.mjs +91 -20
  13. package/esm2022/lib/table/directives/collapse-monitor.directive.mjs +42 -0
  14. package/esm2022/lib/table/directives/index.mjs +2 -1
  15. package/esm2022/lib/table/directives/table-inject-component.directive.mjs +1 -1
  16. package/esm2022/lib/table/directives/table.directive.mjs +24 -4
  17. package/esm2022/lib/table/index.mjs +2 -2
  18. package/esm2022/lib/table/interfaces/cell-renderer.interface.mjs +1 -1
  19. package/esm2022/lib/table/interfaces/collapsible-row-content-context.interface.mjs +2 -0
  20. package/esm2022/lib/table/interfaces/index.mjs +3 -1
  21. package/esm2022/lib/table/interfaces/sort-by-payload.interface.mjs +1 -1
  22. package/esm2022/lib/table/interfaces/table-column-defs.type.mjs +1 -1
  23. package/esm2022/lib/table/interfaces/table-event-payload.interface.mjs +1 -1
  24. package/esm2022/lib/table/interfaces/table-row-action-payload.interface.mjs +1 -1
  25. package/esm2022/lib/table/interfaces/table-row-action.interface.mjs +1 -1
  26. package/esm2022/lib/table/interfaces/table-row-collapse-change.interface.mjs +2 -0
  27. package/esm2022/lib/table/interfaces/table-row-item.interface.mjs +1 -1
  28. package/esm2022/lib/table/table.module.mjs +12 -7
  29. package/fesm2022/impartner-design-components.mjs +3223 -3050
  30. package/fesm2022/impartner-design-components.mjs.map +1 -1
  31. package/lib/alert/alert.component.d.ts +5 -1
  32. package/lib/datetime-picker/components/datetime-picker/datetime-picker.component.d.ts +3 -3
  33. package/lib/datetime-picker/constants/datetime-picker-defaults.d.ts +1 -1
  34. package/lib/file-upload/file-upload.module.d.ts +1 -1
  35. package/lib/modal/modal.component.d.ts +5 -1
  36. package/lib/progress-bar/progress-bar.component.d.ts +10 -1
  37. package/lib/table/components/bulk-actions/bulk-actions.component.d.ts +5 -0
  38. package/lib/table/constants/table.constants.d.ts +0 -1
  39. package/lib/table/containers/table.component.d.ts +58 -13
  40. package/lib/table/directives/collapse-monitor.directive.d.ts +12 -0
  41. package/lib/table/directives/index.d.ts +1 -0
  42. package/lib/table/directives/table-inject-component.directive.d.ts +2 -2
  43. package/lib/table/directives/table.directive.d.ts +11 -3
  44. package/lib/table/index.d.ts +1 -1
  45. package/lib/table/interfaces/cell-renderer.interface.d.ts +10 -3
  46. package/lib/table/interfaces/collapsible-row-content-context.interface.d.ts +39 -0
  47. package/lib/table/interfaces/index.d.ts +2 -0
  48. package/lib/table/interfaces/sort-by-payload.interface.d.ts +6 -0
  49. package/lib/table/interfaces/table-column-defs.type.d.ts +30 -6
  50. package/lib/table/interfaces/table-event-payload.interface.d.ts +8 -1
  51. package/lib/table/interfaces/table-row-action-payload.interface.d.ts +8 -1
  52. package/lib/table/interfaces/table-row-action.interface.d.ts +10 -2
  53. package/lib/table/interfaces/table-row-collapse-change.interface.d.ts +11 -0
  54. package/lib/table/interfaces/table-row-item.interface.d.ts +3 -4
  55. package/lib/table/table.module.d.ts +18 -17
  56. package/package.json +1 -1
@@ -30,6 +30,10 @@ export declare class AlertComponent {
30
30
  * Removes the Alert icon provided by the theme or projected into the icon area using the `icon` directive.
31
31
  */
32
32
  hideIcon: boolean;
33
+ /**
34
+ * Removes the Alert border and background colors to only style icon and text according to theme.
35
+ */
36
+ borderless: boolean;
33
37
  /**
34
38
  * Allows the Alert to be dismissed.
35
39
  */
@@ -42,5 +46,5 @@ export declare class AlertComponent {
42
46
  get themeIconName(): string;
43
47
  closeAlert(): void;
44
48
  static ɵfac: i0.ɵɵFactoryDeclaration<AlertComponent, never>;
45
- static ɵcmp: i0.ɵɵComponentDeclaration<AlertComponent, "impdc-alert, [impdc-alert]", never, { "theme": { "alias": "theme"; "required": false; }; "show": { "alias": "show"; "required": false; }; "headingText": { "alias": "headingText"; "required": false; }; "bodyText": { "alias": "bodyText"; "required": false; }; "inline": { "alias": "inline"; "required": false; }; "hideIcon": { "alias": "hideIcon"; "required": false; }; "dismissible": { "alias": "dismissible"; "required": false; }; }, { "dismiss": "dismiss"; }, never, ["[icon]", "[heading]", "*", "[action]"], false, never>;
49
+ static ɵcmp: i0.ɵɵComponentDeclaration<AlertComponent, "impdc-alert, [impdc-alert]", never, { "theme": { "alias": "theme"; "required": false; }; "show": { "alias": "show"; "required": false; }; "headingText": { "alias": "headingText"; "required": false; }; "bodyText": { "alias": "bodyText"; "required": false; }; "inline": { "alias": "inline"; "required": false; }; "hideIcon": { "alias": "hideIcon"; "required": false; }; "borderless": { "alias": "borderless"; "required": false; }; "dismissible": { "alias": "dismissible"; "required": false; }; }, { "dismiss": "dismiss"; }, never, ["[icon]", "[heading]", "*", "[action]"], false, never>;
46
50
  }
@@ -47,7 +47,7 @@ export declare class DatetimePickerComponent extends _DatetimePickerComponentBas
47
47
  protected readonly formGroup: import("@angular/forms").FormGroup<{
48
48
  date: FormControl<any>;
49
49
  time: FormControl<any>;
50
- useMeridian: FormControl<boolean>;
50
+ use24hrTime: FormControl<boolean>;
51
51
  }>;
52
52
  protected cvaOnChange: (_: any) => void;
53
53
  protected cvaOnTouched: () => void;
@@ -139,8 +139,8 @@ export declare class DatetimePickerComponent extends _DatetimePickerComponentBas
139
139
  protected _focused: boolean;
140
140
  readonly controlType: string;
141
141
  readonly supportsAffixes: boolean;
142
- protected get useMeridian(): boolean;
143
- protected get useMeridianLabelText(): string;
142
+ protected get use24hrTime(): boolean;
143
+ protected get use24hrTimeLabelText(): string;
144
144
  protected handleFocusOut(evt: FocusEvent): void;
145
145
  private _getValueFromFormModel;
146
146
  private _dateIsOutsideCurrentMonth;
@@ -1,4 +1,4 @@
1
1
  import { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
2
- export declare const DEFAULT_USE_MERIDIAN_LABEL = "Use 24-hour format";
2
+ export declare const DEFAULT_USE_24HR_TIME_LABEL = "Use 24-hour format";
3
3
  export declare const DEFAULT_MIN_DATE: NgbDateStruct;
4
4
  export declare const DEFAULT_MAX_DATE: NgbDateStruct;
@@ -9,6 +9,6 @@ import * as i7 from "../icon/icon.module";
9
9
  export declare class FileUploadModule {
10
10
  constructor();
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadModule, never>;
12
- static ɵmod: i0.ɵɵNgModuleDeclaration<FileUploadModule, [typeof i1.FileDropDirective, typeof i2.FileUploadComponent, typeof i3.HumanReadableByteSizePipe], [typeof i4.CommonModule, typeof i5.FormsModule, typeof i6.ButtonModule, typeof i7.IconModule], [typeof i7.IconModule, typeof i1.FileDropDirective, typeof i2.FileUploadComponent]>;
12
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FileUploadModule, [typeof i1.FileDropDirective, typeof i2.FileUploadComponent, typeof i3.HumanReadableByteSizePipe], [typeof i4.CommonModule, typeof i5.FormsModule, typeof i6.ButtonModule, typeof i7.IconModule], [typeof i7.IconModule, typeof i1.FileDropDirective, typeof i2.FileUploadComponent, typeof i3.HumanReadableByteSizePipe]>;
13
13
  static ɵinj: i0.ɵɵInjectorDeclaration<FileUploadModule>;
14
14
  }
@@ -60,6 +60,10 @@ export declare class ModalComponent implements OnInit, OnDestroy, IInteractableC
60
60
  * Shows a backdrop behind the Modal.
61
61
  */
62
62
  backdrop: boolean;
63
+ /**
64
+ * When `true`, Modal will not automatically render a fallback "accept" button in the footer.
65
+ */
66
+ noFallback: boolean;
63
67
  /**
64
68
  * Contains the dismiss button content projection.
65
69
  */
@@ -108,5 +112,5 @@ export declare class ModalComponent implements OnInit, OnDestroy, IInteractableC
108
112
  private _setupEventHandling;
109
113
  private _disableEventHandling;
110
114
  static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent, never>;
111
- static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "impdc-modal", never, { "show": { "alias": "show"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "size": { "alias": "size"; "required": false; }; "iconName": { "alias": "iconName"; "required": false; }; "iconTheme": { "alias": "iconTheme"; "required": false; }; "titleText": { "alias": "titleText"; "required": false; }; "acceptText": { "alias": "acceptText"; "required": false; }; "dismissable": { "alias": "dismissable"; "required": false; }; "fade": { "alias": "fade"; "required": false; }; "backdrop": { "alias": "backdrop"; "required": false; }; }, { "dismiss": "dismiss"; "deny": "deny"; "accept": "accept"; }, never, ["*", "[dismiss]", "[deny]", "[accept]"], false, never>;
115
+ static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "impdc-modal", never, { "show": { "alias": "show"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "size": { "alias": "size"; "required": false; }; "iconName": { "alias": "iconName"; "required": false; }; "iconTheme": { "alias": "iconTheme"; "required": false; }; "titleText": { "alias": "titleText"; "required": false; }; "acceptText": { "alias": "acceptText"; "required": false; }; "dismissable": { "alias": "dismissable"; "required": false; }; "fade": { "alias": "fade"; "required": false; }; "backdrop": { "alias": "backdrop"; "required": false; }; "noFallback": { "alias": "noFallback"; "required": false; }; }, { "dismiss": "dismiss"; "deny": "deny"; "accept": "accept"; }, never, ["*", "[dismiss]", "[deny]", "[accept]"], false, never>;
112
116
  }
@@ -12,11 +12,20 @@ export declare class ProgressBarComponent {
12
12
  * The right/status text of the Progress Bar.
13
13
  */
14
14
  statusText: string;
15
+ /**
16
+ * The color of the progress bar
17
+ */
18
+ barColor: string;
19
+ /**
20
+ * The color of the label and status
21
+ */
22
+ darkText: boolean;
15
23
  /**
16
24
  * The current value of the Progress Bar represented as a number between 0 and 100.
17
25
  */
18
26
  progressPercentage: number;
27
+ get textClass(): string;
19
28
  constructor();
20
29
  static ɵfac: i0.ɵɵFactoryDeclaration<ProgressBarComponent, never>;
21
- static ɵcmp: i0.ɵɵComponentDeclaration<ProgressBarComponent, "impdc-progress-bar", never, { "labelText": { "alias": "labelText"; "required": false; }; "statusText": { "alias": "statusText"; "required": false; }; "progressPercentage": { "alias": "progressPercentage"; "required": false; }; }, {}, never, never, false, never>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<ProgressBarComponent, "impdc-progress-bar", never, { "labelText": { "alias": "labelText"; "required": false; }; "statusText": { "alias": "statusText"; "required": false; }; "barColor": { "alias": "barColor"; "required": false; }; "darkText": { "alias": "darkText"; "required": false; }; "progressPercentage": { "alias": "progressPercentage"; "required": false; }; }, {}, never, never, false, never>;
22
31
  }
@@ -1,4 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
+ /**
3
+ * A container component for projecting displays and controls for performing bulk actions upon one
4
+ * or more selected table rows. Elements to be projected should be decorated with `[selectedTotal]`
5
+ * and `[bulkAction]` attributes.
6
+ */
2
7
  export declare class TableBulkActionsComponent {
3
8
  static ɵfac: i0.ɵɵFactoryDeclaration<TableBulkActionsComponent, never>;
4
9
  static ɵcmp: i0.ɵɵComponentDeclaration<TableBulkActionsComponent, "impdc-table-bulk-actions", never, {}, {}, never, ["[selectedTotal]", "[bulkAction]"], false, never>;
@@ -6,5 +6,4 @@ export declare const SELECTED_ROWS_PER_PAGE: {
6
6
  text: string;
7
7
  };
8
8
  export declare const ROWS_PER_PAGE_GROUP: ITableCellOption[];
9
- export declare const SORT_COLUMN_INDEX = 0;
10
9
  export declare const DEBOUNCE_TIME = 500;
@@ -1,12 +1,13 @@
1
1
  import { DatePipe, DecimalPipe, PercentPipe } from '@angular/common';
2
- import { ChangeDetectorRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { ChangeDetectorRef, EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
3
3
  import { TableColumnType } from '../enumerations/index';
4
- import { ICustomCellRendererComponents, ISortByPayload, ITableActionsColumnDef, ITableEventPayload, ITableRowActionPayload, ITableRowItem, ITableRowItemValue, ITableRowItemValueTypes, TableColumnDef } from '../interfaces/index';
4
+ import { ICollapsibleRowContentContext, ICustomCellRendererComponents, ISortByPayload, ITableActionsColumnDef, ITableEventPayload, ITableRowActionPayload, ITableRowCollapseChange, ITableRowItem, ITableRowItemValueTypes, TableColumnDef } from '../interfaces/index';
5
5
  import { CheckboxChangeEvent } from '../../form-field';
6
6
  import { ComponentTheme } from '../../../types';
7
7
  import { BrandedDirective } from '../../branding';
8
8
  import { PaginationComponent } from '../../pagination';
9
9
  import { TableBulkActionsComponent } from '../components';
10
+ import { NgbCollapse } from '@ng-bootstrap/ng-bootstrap';
10
11
  import * as i0 from "@angular/core";
11
12
  /**
12
13
  * The `TableComponent` (`<impdc-table`) is a data table component.
@@ -29,11 +30,19 @@ export declare class TableComponent implements OnChanges {
29
30
  * 2) `colorGetter`- allows an `ITableColumnDef` to delegate the responsibility of cell color to a function of the `ITableRowItem` determined by the developer.
30
31
  * 3) `color` - a property of an `ITableColumnDef`.
31
32
  */
32
- columnDefs: TableColumnDef[];
33
+ columnDefs: TableColumnDef<any>[];
33
34
  /**
34
35
  * Whether the table is striped.
35
36
  */
36
37
  striped: boolean;
38
+ /**
39
+ * Whether table rows should apply hover styles when hovered over via cursor.
40
+ */
41
+ hover: boolean;
42
+ /**
43
+ * The layout algorithm to be used when rendering the table.
44
+ */
45
+ layout: 'auto' | 'fixed';
37
46
  /**
38
47
  * Whether individual rows can be selected. Will be `true` if explicitly set to `true` or `canSelectAllRows` is `true`.
39
48
  */
@@ -70,6 +79,18 @@ export declare class TableComponent implements OnChanges {
70
79
  * For a given `ITableColumnDef` in the `columnDefs` input, the `cellRendererComponent` property should be set to the key of the registered component in this input.
71
80
  */
72
81
  customCellComponents?: ICustomCellRendererComponents;
82
+ /**
83
+ * An optional template for content that may be rendered below a row in an collapsible view. Value can either be an Angular template or a function that can evaluated
84
+ * to resolve to a template. The template will be rendered with a provided `ICollapsibleRowContentContext` object as template context, with the current `ITableRowData`
85
+ * implicitly available as a default template key.
86
+ */
87
+ collapsibleTemplate: TemplateRef<ICollapsibleRowContentContext<any>> | null | ((row: any) => TemplateRef<ICollapsibleRowContentContext<any>> | null);
88
+ /**
89
+ * The clickable control that will trigger expansion and collapse of content when using `collapsibleTemplate` functionality.
90
+ * When set to `button`, the collapsible content's state can only be toggled from a clickable button at the start of the row.
91
+ * When set to `row`, the entire row will become a clickable trigger.
92
+ */
93
+ collapsibleTrigger: 'button' | 'row';
73
94
  /**
74
95
  * Event emitted when one or multiple rows are selected. Emits `(string | number)[]` payload.
75
96
  */
@@ -81,20 +102,24 @@ export declare class TableComponent implements OnChanges {
81
102
  /**
82
103
  * Event emitted when a row link is clicked. Emits `ITableEventPayload` payload.
83
104
  */
84
- readonly linkClick: EventEmitter<ITableEventPayload<ITableRowItem>>;
105
+ readonly linkClick: EventEmitter<ITableEventPayload<any>>;
85
106
  /**
86
107
  * Event emitted when a row action is clicked. Emits an `ITableRowActionPayload` payload.
87
108
  */
88
- readonly rowActionClick: EventEmitter<ITableRowActionPayload<ITableRowItem>>;
109
+ readonly rowActionClick: EventEmitter<ITableRowActionPayload<any>>;
110
+ /**
111
+ * Event emitted when a row input value is changed. Emitted cells of `columnType` `SingleSelect`, `MultiSelect`, `Input`, `Boolean` or `Icon`.
112
+ * Not emitted if column definition property `disabled` = `true`. Emits `ITableEventPayload` payload.
113
+ */
114
+ readonly inputChange: EventEmitter<ITableEventPayload<any>>;
115
+ /**
116
+ * Event emitted when a row with collapsible content has its collapse state changed.
117
+ */
118
+ readonly rowCollapseChange: EventEmitter<ITableRowCollapseChange<any>>;
89
119
  /** @ignore */
90
120
  paginationComponent?: PaginationComponent;
91
121
  /** @ignore */
92
122
  bulkActions?: TableBulkActionsComponent;
93
- /**
94
- * Event emitted when a row input value is changed. Emitted cells of `columnType` `SinglSelect`, `MultiSelect`, `Input`, `Boolean` or `Icon`.
95
- * Not emitted if column definition property `disabled` = `true`. Emits `ITableEventPayload` payload.
96
- */
97
- readonly inputChange: EventEmitter<ITableEventPayload<ITableRowItem>>;
98
123
  /** @ignore */
99
124
  readonly cellType: typeof TableColumnType;
100
125
  /** @ignore */
@@ -111,23 +136,43 @@ export declare class TableComponent implements OnChanges {
111
136
  private readonly _inputChange;
112
137
  constructor(_datePipe: DatePipe, _percentPipe: PercentPipe, _decmialPipe: DecimalPipe, _changeDetectorRef: ChangeDetectorRef, _branded: BrandedDirective);
113
138
  ngOnChanges(changes: SimpleChanges): void;
139
+ /** @ignore */
114
140
  getMailToValue(columnIndex: number, currentRow: ITableRowItem): string;
141
+ /** @ignore */
115
142
  getStringValue(columnIndex: number, currentRow: ITableRowItem): string;
143
+ /** @ignore */
116
144
  getValue(columnIndex: number, currentRow: ITableRowItem): string | string[];
117
- getRawValue(columnIndex: number, currentRow: ITableRowItem): ITableRowItemValueTypes<ITableRowItemValue>;
145
+ /** @ignore */
146
+ getRawValue(columnIndex: number, currentRow: ITableRowItem): ITableRowItemValueTypes;
147
+ /** @ignore */
118
148
  getCellColor(columnDefinition: TableColumnDef, item: ITableRowItem): string;
149
+ /** @ignore */
119
150
  getTheme(columnDefinition: TableColumnDef, item: ITableRowItem): ComponentTheme;
151
+ /** @ignore */
120
152
  isSortedColumn(columnIndex: number): boolean;
153
+ /** @ignore */
121
154
  isRowSelected(id: string | number): boolean;
155
+ /** @ignore */
122
156
  handleSelectAll(event: CheckboxChangeEvent): void;
157
+ /** @ignore */
123
158
  handleSort(columnIndex: number): void;
159
+ /** @ignore */
124
160
  handleRowSelect(event: CheckboxChangeEvent, rowId: number | string): void;
161
+ /** @ignore */
125
162
  handleCellValueChange(columnIndex: number, rowIndex: number, value: string | number | boolean | string[]): void;
126
- handleLinkClick(columnIndex: number, item: ITableRowItem): void;
163
+ /** @ignore */
164
+ handleLinkClick(columnIndex: number, item: ITableRowItem, event: Event): void;
165
+ /** @ignore */
127
166
  handleActionClick(columnIndex: number, item: ITableRowItem, actionApiName: string): void;
128
167
  protected columnDefIsActions(columnDef: TableColumnDef<any>): columnDef is ITableActionsColumnDef<any>;
168
+ protected tryToggleCollapse(collapsibleForRowResult: {
169
+ template: TemplateRef<ICollapsibleRowContentContext> | null;
170
+ }, ngbCollapse: NgbCollapse, event: Event, source: 'button' | 'row'): void;
171
+ protected getCollapsibleTemplateForRow(row: ITableRowItem): {
172
+ template: TemplateRef<ICollapsibleRowContentContext> | null;
173
+ };
129
174
  private _getColumnDefByIndex;
130
175
  private _getValue;
131
176
  static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, [null, null, null, null, { optional: true; host: true; }]>;
132
- static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "impdc-table", never, { "loading": { "alias": "loading"; "required": false; }; "columnDefs": { "alias": "columnDefs"; "required": false; }; "striped": { "alias": "striped"; "required": false; }; "canSelectRows": { "alias": "canSelectRows"; "required": false; }; "canSelectAllRows": { "alias": "canSelectAllRows"; "required": false; }; "selectPlaceholder": { "alias": "selectPlaceholder"; "required": false; }; "sortColumnIndex": { "alias": "sortColumnIndex"; "required": false; }; "sortDirection": { "alias": "sortDirection"; "required": false; }; "tableData": { "alias": "tableData"; "required": false; }; "selectedRowIds": { "alias": "selectedRowIds"; "required": false; }; "customCellComponents": { "alias": "customCellComponents"; "required": false; }; }, { "rowSelect": "rowSelect"; "sortBy": "sortBy"; "linkClick": "linkClick"; "rowActionClick": "rowActionClick"; "inputChange": "inputChange"; }, ["paginationComponent", "bulkActions"], ["impdc-table-bulk-actions", "[impdcTableBulkActions]", "[noData]", "impdc-pagination, div[impdc-pagination]"], false, never>;
177
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "impdc-table", never, { "loading": { "alias": "loading"; "required": false; }; "columnDefs": { "alias": "columnDefs"; "required": false; }; "striped": { "alias": "striped"; "required": false; }; "hover": { "alias": "hover"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "canSelectRows": { "alias": "canSelectRows"; "required": false; }; "canSelectAllRows": { "alias": "canSelectAllRows"; "required": false; }; "selectPlaceholder": { "alias": "selectPlaceholder"; "required": false; }; "sortColumnIndex": { "alias": "sortColumnIndex"; "required": false; }; "sortDirection": { "alias": "sortDirection"; "required": false; }; "tableData": { "alias": "tableData"; "required": false; }; "selectedRowIds": { "alias": "selectedRowIds"; "required": false; }; "customCellComponents": { "alias": "customCellComponents"; "required": false; }; "collapsibleTemplate": { "alias": "collapsibleTemplate"; "required": false; }; "collapsibleTrigger": { "alias": "collapsibleTrigger"; "required": false; }; }, { "rowSelect": "rowSelect"; "sortBy": "sortBy"; "linkClick": "linkClick"; "rowActionClick": "rowActionClick"; "inputChange": "inputChange"; "rowCollapseChange": "rowCollapseChange"; }, ["paginationComponent", "bulkActions"], ["impdc-table-bulk-actions", "[impdcTableBulkActions]", "[noData]", "impdc-pagination, div[impdc-pagination]"], false, never>;
133
178
  }
@@ -0,0 +1,12 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "@ng-bootstrap/ng-bootstrap";
4
+ export declare class CollapseMonitorDirective {
5
+ private readonly _ngbCollapse;
6
+ readonly collapsed: import("@angular/core").WritableSignal<boolean>;
7
+ readonly ngbCollapsing: import("@angular/core").WritableSignal<boolean>;
8
+ readonly collapseChange: EventEmitter<boolean>;
9
+ constructor();
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<CollapseMonitorDirective, never>;
11
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CollapseMonitorDirective, "[impdcCollapseMonitor]", ["impdcCollapseMonitor"], {}, { "collapseChange": "collapseChange"; }, never, never, false, [{ directive: typeof i1.NgbCollapse; inputs: { "ngbCollapse": "impdcCollapseMonitor"; }; outputs: {}; }]>;
12
+ }
@@ -1,2 +1,3 @@
1
+ export * from './collapse-monitor.directive';
1
2
  export * from './table-inject-component.directive';
2
3
  export * from './table.directive';
@@ -1,11 +1,11 @@
1
1
  import { ComponentFactoryResolver, OnInit, ViewContainerRef } from '@angular/core';
2
- import { ICustomCellRendererComponents, ITableRowItem, ITableRowItemValue, ITableRowItemValueTypes, TableColumnDef } from '../interfaces/index';
2
+ import { ICustomCellRendererComponents, ITableRowItem, ITableRowItemValueTypes, TableColumnDef } from '../interfaces/index';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class TableInjectComponentDirective implements OnInit {
5
5
  private readonly _viewContainerRef;
6
6
  private readonly _componentFactoryResolver;
7
7
  columnDef: TableColumnDef;
8
- value: ITableRowItemValueTypes<ITableRowItemValue>;
8
+ value: ITableRowItemValueTypes;
9
9
  rowItem: ITableRowItem;
10
10
  customCellComponents: ICustomCellRendererComponents;
11
11
  constructor(_viewContainerRef: ViewContainerRef, _componentFactoryResolver: ComponentFactoryResolver);
@@ -1,15 +1,23 @@
1
1
  import * as i0 from "@angular/core";
2
2
  /**
3
- * The `TableDirective` (`<table impdcTable`) that adds Hex styling to a `table` element.
4
- * To use, import `TableModule` or another module that imports and exports that module from `@impartner/design-components`.
3
+ * `TableDirective` (`table[impdcTable]`) is a directive that adds Hex styling to a `table` element.
5
4
  */
6
5
  export declare class TableDirective {
7
6
  /**
8
7
  * Stripes every other row in a slightly darker background color.
9
8
  */
10
9
  striped: boolean;
10
+ /**
11
+ * Whether table rows should apply hover styles when hovered over via cursor.
12
+ */
13
+ hover: boolean;
14
+ /**
15
+ * The layout algorithm to be used when rendering the table.
16
+ */
17
+ layout: 'auto' | 'fixed';
11
18
  private classTable;
12
19
  private get classTableStriped();
20
+ private get classTableHover();
13
21
  static ɵfac: i0.ɵɵFactoryDeclaration<TableDirective, never>;
14
- static ɵdir: i0.ɵɵDirectiveDeclaration<TableDirective, "table[impdcTable]", never, { "striped": { "alias": "striped"; "required": false; }; }, {}, never, never, false, never>;
22
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TableDirective, "table[impdcTable]", never, { "striped": { "alias": "striped"; "required": false; }; "hover": { "alias": "hover"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; }, {}, never, never, false, never>;
15
23
  }
@@ -1,7 +1,7 @@
1
1
  export * from './table.module';
2
2
  export * from './containers';
3
3
  export * from './components';
4
- export * from './directives';
4
+ export { TableDirective, TableInjectComponentDirective } from './directives';
5
5
  export * from './helpers';
6
6
  export * from './enumerations';
7
7
  export * from './interfaces';
@@ -1,6 +1,13 @@
1
- import { ITableRowItem, ITableRowItemValue, ITableRowItemValueTypes } from './table-row-item.interface';
2
- export interface ICellRenderer<T = ITableRowItem, P = object> {
3
- value: ITableRowItemValueTypes<ITableRowItemValue>;
1
+ import { ITableRowItem, ITableRowItemValueTypes } from './table-row-item.interface';
2
+ /**
3
+ * The base interface type implemented by Angular components to be used as custom renderers for
4
+ * `TableComponent` table cells.
5
+ */
6
+ export interface ICellRenderer<T extends ITableRowItem = ITableRowItem, P = object> {
7
+ /** The resolved raw value for the cell, as per the column defintion. */
8
+ value: ITableRowItemValueTypes;
9
+ /** The row object for the current table row. */
4
10
  rowItem: T;
11
+ /** The `cellRendererParams` value from the original column definition. */
5
12
  params?: P;
6
13
  }
@@ -0,0 +1,39 @@
1
+ import { ITableRowItem } from './table-row-item.interface';
2
+ /**
3
+ * An interface for context objects that will be provided when rendering collapsible row content
4
+ * for `TableComponent` rows.
5
+ */
6
+ export interface ICollapsibleRowContentContext<T extends ITableRowItem = ITableRowItem> {
7
+ /**
8
+ * The current row object.
9
+ */
10
+ $implicit: T;
11
+ /**
12
+ * Whether the collapsible row is collapsed.
13
+ */
14
+ collapsed: boolean;
15
+ /**
16
+ * Whether the table row is selected, if row selection is available.
17
+ */
18
+ selected: boolean;
19
+ /**
20
+ * Index of the parent row in the currently displayed data set.
21
+ */
22
+ index: number;
23
+ /**
24
+ * Whether the parent row is the first row in the displayed data set.
25
+ */
26
+ first: boolean;
27
+ /**
28
+ * Whether the parent row is the last row in the displayed data set.
29
+ */
30
+ last: boolean;
31
+ /**
32
+ * Whether the parent row's index in the currently displayed data set is even.
33
+ */
34
+ even: boolean;
35
+ /**
36
+ * Whether the parent row's index in the currently displayed data set is odd.
37
+ */
38
+ odd: boolean;
39
+ }
@@ -8,3 +8,5 @@ export * from './custom-cell-renderer-components.type';
8
8
  export * from './table-cell-option.interface';
9
9
  export * from './table-row-action.interface';
10
10
  export * from './table-row-action-payload.interface';
11
+ export * from './collapsible-row-content-context.interface';
12
+ export * from './table-row-collapse-change.interface';
@@ -1,5 +1,11 @@
1
+ /**
2
+ * An interface for events emitted from `TableComponent` when the user requests to sort by a particular column.
3
+ */
1
4
  export interface ISortByPayload {
5
+ /** The field the user has requested to sort by, if the sorted column is mapped to one. */
2
6
  field: string;
7
+ /** The index of the relevant column in the table. */
3
8
  columnIndex: number;
9
+ /** The direction or order in which the data is expected to be sorted. */
4
10
  direction: 'asc' | 'desc';
5
11
  }
@@ -3,27 +3,51 @@ import { ComponentTheme } from '../../../types';
3
3
  import { ITableRowItem } from './table-row-item.interface';
4
4
  import { ITableCellOption } from './table-cell-option.interface';
5
5
  import { ITableRowAction } from './table-row-action.interface';
6
- export interface ITableColumnDef<T = ITableRowItem> {
6
+ /**
7
+ * An interface for specifying all of the configuration necessary for a column of cells in `TableComponent` tables.
8
+ */
9
+ export interface ITableColumnDef<T extends ITableRowItem = ITableRowItem> {
10
+ /** The type indicating how the column cells should should be displayed and their data interpreted. */
7
11
  readonly columnType: TableColumnType;
12
+ /** The title of the column to be displayed in the table header. */
8
13
  title: string;
14
+ /** The row object property from which cell data will be retrieved. */
9
15
  field?: string;
16
+ /** A callable function that can be evaluated against the row object to resolve the cell value. */
10
17
  valueGetter?: (record: T) => string;
18
+ /** A default color/theme that can be used when rendering the table cell. */
11
19
  color?: ComponentTheme;
20
+ /** A callable function that can be evaluated against the row object to resolve a color/theme for the table cell. */
12
21
  colorGetter?: (record: T) => ComponentTheme;
22
+ /** A row object property from which a table cell's color/theme may be retrieved. */
13
23
  fieldColor?: string;
24
+ /** Whether the column is sortable. */
14
25
  sorted?: boolean;
15
- boldedText?: boolean;
16
- truncated?: number;
26
+ /**
27
+ * The name/key of the Angular component passed in the TableComponent's `[customCellComponents]` input that should
28
+ * be used to render cells in this column.
29
+ */
17
30
  cellRendererComponent?: string;
31
+ /**
32
+ * Additional parameters that will be passed to the custom cell renderer's `[params]` input property at render time.
33
+ */
18
34
  cellRendererParams?: object;
35
+ /** Whether to remove the default padding around cells for this column.*/
19
36
  noPadding?: boolean;
37
+ /** Available options for selection when `columnType` is `'SingleSelect'` or `'MultiSelect'`. */
20
38
  values?: ITableCellOption[];
39
+ /** The name of the FontAwesome icon to be displayed when `columnType` is `'Icon'`. */
21
40
  iconName?: string;
41
+ /** Whether to disable the input control when `columnType` is `'Boolean'`, `'SingleSelect'`, or `'MultiSelect'`. */
22
42
  disabled?: boolean;
43
+ /** @ignore */
44
+ boldedText?: boolean;
45
+ /** @ignore */
46
+ truncated?: number;
23
47
  }
24
- export interface ITableActionsColumnDef<T = ITableRowItem> extends ITableColumnDef<T> {
48
+ export interface ITableActionsColumnDef<T extends ITableRowItem = ITableRowItem> extends ITableColumnDef<T> {
25
49
  readonly columnType: TableColumnType.Actions;
26
- actions: ITableRowAction[];
50
+ actions: ITableRowAction<T>[];
27
51
  actionType: 'icon' | 'button' | 'link';
28
52
  }
29
- export type TableColumnDef<T = ITableRowItem> = ITableActionsColumnDef<T> | ITableColumnDef<T>;
53
+ export type TableColumnDef<T extends ITableRowItem = ITableRowItem> = ITableActionsColumnDef<T> | ITableColumnDef<T>;
@@ -1,6 +1,13 @@
1
1
  import { ITableRowItem } from './table-row-item.interface';
2
- export interface ITableEventPayload<T = ITableRowItem> {
2
+ /**
3
+ * An interface for user input events originating from `TableComponent` rows, including clicked links and changed
4
+ * values in editable cells.
5
+ */
6
+ export interface ITableEventPayload<T extends ITableRowItem = ITableRowItem> {
7
+ /** The row from which the event originated. */
3
8
  item: T;
9
+ /** The table column index from which the event originated. */
4
10
  columnIndex: number;
11
+ /** The new or selected value that triggered the event, in the case of an editable table cell. */
5
12
  value?: string | number | boolean | string[];
6
13
  }
@@ -1,6 +1,13 @@
1
1
  import { ITableRowItem } from './table-row-item.interface';
2
- export interface ITableRowActionPayload<T = ITableRowItem> {
2
+ /**
3
+ * An interface for events emitted from `TableComponent` when a user clicks or interacts with a row-level action
4
+ * button, link, or icon.
5
+ */
6
+ export interface ITableRowActionPayload<T extends ITableRowItem = ITableRowItem> {
7
+ /** The row object corresponding to the action taken. */
3
8
  item: T;
9
+ /** The specific column index the action originated from. */
4
10
  columnIndex: number;
11
+ /** The defined `apiName` for the action that triggered the event. */
5
12
  actionApiName: string;
6
13
  }
@@ -1,9 +1,17 @@
1
1
  import { ComponentTheme } from '../../../types';
2
2
  import { ITableRowItem } from './table-row-item.interface';
3
- export interface ITableRowAction {
3
+ /**
4
+ * An interface for declaring row-level actions that a user may trigger.
5
+ */
6
+ export interface ITableRowAction<T extends ITableRowItem = ITableRowItem> {
7
+ /** A uniquely identifying string that event listeners will use to discern which action was triggered. */
4
8
  apiName: string;
9
+ /** The text to display for the action. */
5
10
  text: string;
11
+ /** The name of the FontAwesome icon to use, should the action be rendered as an icon. */
6
12
  iconName: string;
13
+ /** The color theme to use when displaying the action as an icon. */
7
14
  theme?: ComponentTheme;
8
- isVisible?: (rowItem: ITableRowItem) => boolean;
15
+ /** A function to be evaluated against the row object in order to conditionally render an action for a given row. */
16
+ isVisible?: (rowItem: T) => boolean;
9
17
  }
@@ -0,0 +1,11 @@
1
+ import { ITableRowItem } from './table-row-item.interface';
2
+ /**
3
+ * An interface for events emitted from `TableComponent` when a user triggers the expansion or collapse of additional
4
+ * row-level content.
5
+ */
6
+ export interface ITableRowCollapseChange<T extends ITableRowItem = ITableRowItem> {
7
+ /** The row object for the row that is expanding or collapsing. */
8
+ readonly row: T;
9
+ /** Whether the row is in a collapsed state. */
10
+ readonly collapsed: boolean;
11
+ }
@@ -1,9 +1,8 @@
1
1
  export interface IIdentifiable {
2
2
  id: string | number;
3
3
  }
4
- export type ITableRowItemValueTypes<T = never> = string | number | boolean | Array<string | number> | T | Array<T>;
5
- export interface ITableRowItemBase<T = never> {
6
- [field: string]: ITableRowItemValueTypes<T>;
4
+ export type ITableRowItemValueTypes = string | number | boolean | Date | object | Array<any> | null;
5
+ export interface ITableRowItemValue {
6
+ [field: string]: ITableRowItemValueTypes;
7
7
  }
8
- export type ITableRowItemValue = ITableRowItemBase<ITableRowItemBase<ITableRowItemBase>>;
9
8
  export type ITableRowItem = IIdentifiable & ITableRowItemValue;
@@ -1,23 +1,24 @@
1
1
  import * as i0 from "@angular/core";
2
- import * as i1 from "./directives/table.directive";
3
- import * as i2 from "./containers/table.component";
4
- import * as i3 from "./components/column-heading/column-heading.component";
5
- import * as i4 from "./directives/table-inject-component.directive";
6
- import * as i5 from "./components/bulk-actions/bulk-actions.component";
7
- import * as i6 from "./components/row-actions/row-actions.component";
8
- import * as i7 from "@angular/common";
9
- import * as i8 from "../button/button.module";
10
- import * as i9 from "../pagination/pagination.module";
11
- import * as i10 from "../icon/icon.module";
12
- import * as i11 from "../form-field/impdc-forms.module";
13
- import * as i12 from "@angular/forms";
14
- import * as i13 from "../spinner/spinner.module";
15
- import * as i14 from "../badge/badge.module";
16
- import * as i15 from "../branding/branding.module";
17
- import * as i16 from "@ng-bootstrap/ng-bootstrap";
2
+ import * as i1 from "./directives/collapse-monitor.directive";
3
+ import * as i2 from "./directives/table.directive";
4
+ import * as i3 from "./containers/table.component";
5
+ import * as i4 from "./components/column-heading/column-heading.component";
6
+ import * as i5 from "./directives/table-inject-component.directive";
7
+ import * as i6 from "./components/bulk-actions/bulk-actions.component";
8
+ import * as i7 from "./components/row-actions/row-actions.component";
9
+ import * as i8 from "@angular/common";
10
+ import * as i9 from "../button/button.module";
11
+ import * as i10 from "../pagination/pagination.module";
12
+ import * as i11 from "../icon/icon.module";
13
+ import * as i12 from "../form-field/impdc-forms.module";
14
+ import * as i13 from "@angular/forms";
15
+ import * as i14 from "../spinner/spinner.module";
16
+ import * as i15 from "../badge/badge.module";
17
+ import * as i16 from "../branding/branding.module";
18
+ import * as i17 from "@ng-bootstrap/ng-bootstrap";
18
19
  export declare class TableModule {
19
20
  constructor();
20
21
  static ɵfac: i0.ɵɵFactoryDeclaration<TableModule, never>;
21
- static ɵmod: i0.ɵɵNgModuleDeclaration<TableModule, [typeof i1.TableDirective, typeof i2.TableComponent, typeof i3.ColumnHeadingComponent, typeof i4.TableInjectComponentDirective, typeof i5.TableBulkActionsComponent, typeof i6.RowActionsComponent], [typeof i7.CommonModule, typeof i8.ButtonModule, typeof i9.PaginationModule, typeof i10.IconModule, typeof i11.ImpdcFormsModule, typeof i12.FormsModule, typeof i13.SpinnerModule, typeof i14.BadgeModule, typeof i15.BrandingModule, typeof i16.NgbDropdownModule], [typeof i8.ButtonModule, typeof i1.TableDirective, typeof i3.ColumnHeadingComponent, typeof i5.TableBulkActionsComponent, typeof i9.PaginationModule, typeof i2.TableComponent, typeof i10.IconModule, typeof i4.TableInjectComponentDirective, typeof i15.BrandingModule, typeof i6.RowActionsComponent]>;
22
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TableModule, [typeof i1.CollapseMonitorDirective, typeof i2.TableDirective, typeof i3.TableComponent, typeof i4.ColumnHeadingComponent, typeof i5.TableInjectComponentDirective, typeof i6.TableBulkActionsComponent, typeof i7.RowActionsComponent], [typeof i8.CommonModule, typeof i9.ButtonModule, typeof i10.PaginationModule, typeof i11.IconModule, typeof i12.ImpdcFormsModule, typeof i13.FormsModule, typeof i14.SpinnerModule, typeof i15.BadgeModule, typeof i16.BrandingModule, typeof i17.NgbDropdownModule, typeof i17.NgbCollapseModule], [typeof i9.ButtonModule, typeof i2.TableDirective, typeof i4.ColumnHeadingComponent, typeof i6.TableBulkActionsComponent, typeof i10.PaginationModule, typeof i3.TableComponent, typeof i11.IconModule, typeof i5.TableInjectComponentDirective, typeof i16.BrandingModule, typeof i7.RowActionsComponent]>;
22
23
  static ɵinj: i0.ɵɵInjectorDeclaration<TableModule>;
23
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@impartner/design-components",
3
- "version": "2.1.2",
3
+ "version": "2.2.1",
4
4
  "author": "Impartner",
5
5
  "license": "BSD-3-Clause",
6
6
  "private": false,