@impartner/design-components 1.1.2 → 1.2.0

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 (60) hide show
  1. package/esm2020/lib/pagination/pagination.component.mjs +51 -20
  2. package/esm2020/lib/pagination/pagination.module.mjs +8 -4
  3. package/esm2020/lib/table/components/bulk-actions/bulk-actions.component.mjs +11 -0
  4. package/esm2020/lib/table/components/column-heading/column-heading.component.mjs +38 -0
  5. package/esm2020/lib/table/components/index.mjs +3 -0
  6. package/esm2020/lib/table/constants/index.mjs +3 -0
  7. package/esm2020/lib/table/constants/public-table.constants.mjs +2 -0
  8. package/esm2020/lib/table/constants/table.constants.mjs +24 -0
  9. package/esm2020/lib/table/containers/index.mjs +2 -0
  10. package/esm2020/lib/table/containers/table.component.mjs +386 -0
  11. package/esm2020/lib/table/directives/index.mjs +3 -0
  12. package/esm2020/lib/table/directives/table-inject-component.directive.mjs +46 -0
  13. package/esm2020/lib/table/directives/table.directive.mjs +35 -0
  14. package/esm2020/lib/table/enumerations/index.mjs +2 -0
  15. package/esm2020/lib/table/enumerations/table-column-type.mjs +20 -0
  16. package/esm2020/lib/table/helpers/index.mjs +2 -0
  17. package/esm2020/lib/table/helpers/table-theme.helper.mjs +31 -0
  18. package/esm2020/lib/table/index.mjs +8 -3
  19. package/esm2020/lib/table/interfaces/cell-renderer.interface.mjs +2 -0
  20. package/esm2020/lib/table/interfaces/custom-cell-renderer-components.type.mjs +2 -0
  21. package/esm2020/lib/table/interfaces/index.mjs +9 -0
  22. package/esm2020/lib/table/interfaces/sort-by-payload.interface.mjs +2 -0
  23. package/esm2020/lib/table/interfaces/table-cell-option.interface.mjs +2 -0
  24. package/esm2020/lib/table/interfaces/table-column-def.interface.mjs +2 -0
  25. package/esm2020/lib/table/interfaces/table-event-payload.interface.mjs +2 -0
  26. package/esm2020/lib/table/interfaces/table-row-item.interface.mjs +2 -0
  27. package/esm2020/lib/table/table.module.mjs +76 -7
  28. package/fesm2015/impartner-design-components.mjs +3605 -2986
  29. package/fesm2015/impartner-design-components.mjs.map +1 -1
  30. package/fesm2020/impartner-design-components.mjs +3002 -2387
  31. package/fesm2020/impartner-design-components.mjs.map +1 -1
  32. package/lib/pagination/pagination.component.d.ts +18 -3
  33. package/lib/pagination/pagination.module.d.ts +2 -1
  34. package/lib/table/components/bulk-actions/bulk-actions.component.d.ts +5 -0
  35. package/lib/table/components/column-heading/column-heading.component.d.ts +14 -0
  36. package/lib/table/components/index.d.ts +2 -0
  37. package/lib/table/constants/index.d.ts +2 -0
  38. package/lib/table/constants/public-table.constants.d.ts +1 -0
  39. package/lib/table/constants/table.constants.d.ts +10 -0
  40. package/lib/table/containers/index.d.ts +1 -0
  41. package/lib/table/containers/table.component.d.ts +127 -0
  42. package/lib/table/directives/index.d.ts +2 -0
  43. package/lib/table/directives/table-inject-component.directive.d.ts +16 -0
  44. package/lib/table/{table.component.d.ts → directives/table.directive.d.ts} +4 -4
  45. package/lib/table/enumerations/index.d.ts +1 -0
  46. package/lib/table/enumerations/table-column-type.d.ts +18 -0
  47. package/lib/table/helpers/index.d.ts +1 -0
  48. package/lib/table/helpers/table-theme.helper.d.ts +7 -0
  49. package/lib/table/index.d.ts +7 -2
  50. package/lib/table/interfaces/cell-renderer.interface.d.ts +6 -0
  51. package/lib/table/interfaces/custom-cell-renderer-components.type.d.ts +3 -0
  52. package/lib/table/interfaces/index.d.ts +8 -0
  53. package/lib/table/interfaces/sort-by-payload.interface.d.ts +5 -0
  54. package/lib/table/interfaces/table-cell-option.interface.d.ts +4 -0
  55. package/lib/table/interfaces/table-column-def.interface.d.ts +22 -0
  56. package/lib/table/interfaces/table-event-payload.interface.d.ts +6 -0
  57. package/lib/table/interfaces/table-row-item.interface.d.ts +9 -0
  58. package/lib/table/table.module.d.ts +15 -3
  59. package/package.json +3 -2
  60. package/esm2020/lib/table/table.component.mjs +0 -33
@@ -1,4 +1,5 @@
1
- import { EventEmitter } from '@angular/core';
1
+ import { ChangeDetectorRef, EventEmitter } from '@angular/core';
2
+ import { IElementSize } from '../size-detection';
2
3
  import * as i0 from "@angular/core";
3
4
  /**
4
5
  * The `PaginationComponent` (`<impdc-pagination` or `<div impdc-pagination`) is a control for paged content such as tables or lists.
@@ -6,6 +7,7 @@ import * as i0 from "@angular/core";
6
7
  * `ModalModule` imports and exports ImpdcFormsModule and [ButtonModule](./?path=/docs/design-components-button).
7
8
  */
8
9
  export declare class PaginationComponent {
10
+ private readonly _changeDetectorRef;
9
11
  private _summary;
10
12
  /**
11
13
  * The current page.
@@ -25,19 +27,32 @@ export declare class PaginationComponent {
25
27
  */
26
28
  set summary(summary: string);
27
29
  get summary(): string;
30
+ /**
31
+ * The label text for the per page select input.
32
+ */
33
+ perPageLabel: string;
28
34
  /**
29
35
  * Emitted when the page number is changed, specifying the target page number.
30
36
  */
31
37
  readonly goToPage: EventEmitter<number>;
38
+ /**
39
+ * Emitted when the per page is changed, specifying the new value.
40
+ */
41
+ readonly perPageChange: EventEmitter<number>;
32
42
  get totalPages(): number;
33
43
  get firstPageResult(): number;
34
44
  get lastPageResult(): number;
35
- private _getPageClamped;
45
+ /** @ignore */
46
+ mobile: boolean;
47
+ constructor(_changeDetectorRef: ChangeDetectorRef);
48
+ handleResize(size: IElementSize): void;
36
49
  goToPreviousPage(): void;
37
50
  goToNextPage(): void;
38
51
  goToExactPageFromEvent({ target }: FocusEvent): void;
39
52
  goToExactPage(page: number | string): void;
53
+ handlePerPageChange(): void;
40
54
  preventDefaultAndBlur(event: Event): void;
55
+ private _getPageClamped;
41
56
  static ɵfac: i0.ɵɵFactoryDeclaration<PaginationComponent, never>;
42
- static ɵcmp: i0.ɵɵComponentDeclaration<PaginationComponent, "impdc-pagination, div[impdc-pagination]", never, { "page": "page"; "perPage": "perPage"; "total": "total"; "summary": "summary"; }, { "goToPage": "goToPage"; }, never, never, false>;
57
+ static ɵcmp: i0.ɵɵComponentDeclaration<PaginationComponent, "impdc-pagination, div[impdc-pagination]", never, { "page": "page"; "perPage": "perPage"; "total": "total"; "summary": "summary"; "perPageLabel": "perPageLabel"; }, { "goToPage": "goToPage"; "perPageChange": "perPageChange"; }, never, never, false>;
43
58
  }
@@ -5,9 +5,10 @@ import * as i3 from "../button/button.module";
5
5
  import * as i4 from "@angular/forms";
6
6
  import * as i5 from "../form-field/impdc-forms.module";
7
7
  import * as i6 from "../icon/icon.module";
8
+ import * as i7 from "../size-detection/size-detection.module";
8
9
  export declare class PaginationModule {
9
10
  constructor();
10
11
  static ɵfac: i0.ɵɵFactoryDeclaration<PaginationModule, never>;
11
- static ɵmod: i0.ɵɵNgModuleDeclaration<PaginationModule, [typeof i1.PaginationComponent], [typeof i2.CommonModule, typeof i3.ButtonModule, typeof i4.FormsModule, typeof i5.ImpdcFormsModule, typeof i6.IconModule], [typeof i3.ButtonModule, typeof i5.ImpdcFormsModule, typeof i6.IconModule, typeof i1.PaginationComponent]>;
12
+ static ɵmod: i0.ɵɵNgModuleDeclaration<PaginationModule, [typeof i1.PaginationComponent], [typeof i2.CommonModule, typeof i3.ButtonModule, typeof i4.FormsModule, typeof i5.ImpdcFormsModule, typeof i6.IconModule, typeof i7.SizeDetectionModule], [typeof i3.ButtonModule, typeof i5.ImpdcFormsModule, typeof i6.IconModule, typeof i1.PaginationComponent]>;
12
13
  static ɵinj: i0.ɵɵInjectorDeclaration<PaginationModule>;
13
14
  }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class TableBulkActionsComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableBulkActionsComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableBulkActionsComponent, "impdc-table-bulk-actions", never, {}, {}, never, ["[selectedTotal]", "[bulkAction]"], false>;
5
+ }
@@ -0,0 +1,14 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ColumnHeadingComponent {
4
+ isSortable: boolean;
5
+ columnIndex?: number;
6
+ sortColumnIndex?: number;
7
+ direction: 'asc' | 'desc';
8
+ text: string;
9
+ get sortedColumn(): boolean;
10
+ sort: EventEmitter<number>;
11
+ onSort(): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ColumnHeadingComponent, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<ColumnHeadingComponent, "impdc-column-heading", never, { "isSortable": "isSortable"; "columnIndex": "columnIndex"; "sortColumnIndex": "sortColumnIndex"; "direction": "direction"; "text": "text"; }, { "sort": "sort"; }, never, never, false>;
14
+ }
@@ -0,0 +1,2 @@
1
+ export * from './column-heading/column-heading.component';
2
+ export * from './bulk-actions/bulk-actions.component';
@@ -0,0 +1,2 @@
1
+ export * from './table.constants';
2
+ export * from './public-table.constants';
@@ -0,0 +1 @@
1
+ export declare const IS_SELECTED_PROPERTY = "isSelected";
@@ -0,0 +1,10 @@
1
+ import { ITableCellOption } from '../interfaces';
2
+ export declare const DEFAULT_PAGE = 1;
3
+ export declare const ROWS_PER_PAGE = 10;
4
+ export declare const SELECTED_ROWS_PER_PAGE: {
5
+ value: string;
6
+ text: string;
7
+ };
8
+ export declare const ROWS_PER_PAGE_GROUP: ITableCellOption[];
9
+ export declare const SORT_COLUMN_INDEX = 0;
10
+ export declare const DEBOUNCE_TIME = 500;
@@ -0,0 +1 @@
1
+ export * from './table.component';
@@ -0,0 +1,127 @@
1
+ import { DatePipe, DecimalPipe, PercentPipe } from '@angular/common';
2
+ import { ChangeDetectorRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
3
+ import { TableColumnType } from '../enumerations/index';
4
+ import { ICustomCellRendererComponents, ISortByPayload, ITableColumnDef, ITableEventPayload, ITableRowItem, ITableRowItemValue, ITableRowItemValueTypes } from '../interfaces/index';
5
+ import { CheckboxChangeEvent } from '../../form-field';
6
+ import { ComponentTheme } from '../../../types';
7
+ import { BrandedDirective } from '../../branding';
8
+ import { PaginationComponent } from '../../pagination';
9
+ import { TableBulkActionsComponent } from '../components';
10
+ import * as i0 from "@angular/core";
11
+ /**
12
+ * The `TableComponent` (`<impdc-table`) is a data table component.
13
+ * To use, import `TableModule` from `@impartner/design-components`.
14
+ */
15
+ export declare class TableComponent implements OnChanges {
16
+ private readonly _datePipe;
17
+ private readonly _percentPipe;
18
+ private readonly _decmialPipe;
19
+ private readonly _changeDetectorRef;
20
+ private _branded;
21
+ /**
22
+ * Whether the table data is currently being loaded. The `<impdc-spinner>` will show if data is loading.
23
+ */
24
+ loading: boolean;
25
+ /**
26
+ * The visible columns of the table. Each `ITableColumnDef` defines properties regarding the display, formatting and interaction of the column's cells.
27
+ * Column/cell color precedence is:
28
+ * 1) `fieldColor` - allows an `ITableColumnDef` to delegate the responsibility of cell color to an `ITableRowItem` property.
29
+ * 2) `colorGetter`- allows an `ITableColumnDef` to delegate the responsibility of cell color to a function of the `ITableRowItem` determined by the developer.
30
+ * 3) `color` - a property of an `ITableColumnDef`.
31
+ */
32
+ columnDefs: ITableColumnDef[];
33
+ /**
34
+ * Whether the table is striped.
35
+ */
36
+ striped: boolean;
37
+ /**
38
+ * Whether individual rows can be selected. Will be `true` if explicitly set to `true` or `canSelectAllRows` is `true`.
39
+ */
40
+ set canSelectRows(value: boolean);
41
+ get canSelectRows(): boolean;
42
+ /**
43
+ * Whether all rows can be selected at once. Will be `true` if explicitly set to `true` or if `TableBulkActionsComponent` is content projected.
44
+ */
45
+ set canSelectAllRows(value: boolean);
46
+ get canSelectAllRows(): boolean;
47
+ /**
48
+ * The placeholder text and empty value display text for `<impdc-select>` instances in cells with a `ITableColumnDef` `columnType` = `SingleSelect` or `MultiSelect`.
49
+ */
50
+ selectPlaceholder: string;
51
+ /**
52
+ * The `columnDefs` index of the currently sorted column.
53
+ */
54
+ sortColumnIndex: number;
55
+ /**
56
+ * The direction of the currently sorted column.
57
+ */
58
+ sortDirection: 'asc' | 'desc';
59
+ /**
60
+ * The table row data as an array of `ITableRowItem`.
61
+ */
62
+ tableData: ITableRowItem[];
63
+ /**
64
+ * An array of currently selected IDs from the `tableData` input. Array must be of type `(string | number)[]`.
65
+ */
66
+ set selectedRowIds(value: (string | number)[]);
67
+ get selectedRowIds(): (string | number)[];
68
+ /**
69
+ * The registered custom cell renderer components available to be used in the table instance.
70
+ * 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
+ */
72
+ customCellComponents?: ICustomCellRendererComponents;
73
+ /**
74
+ * Event emitted when one or multiple rows are selected. Emits `(string | number)[]` payload.
75
+ */
76
+ readonly rowSelect: EventEmitter<(string | number)[]>;
77
+ /**
78
+ * Event emitted when a column is sorted. Emits `ISortByPayload` payload.
79
+ */
80
+ readonly sortBy: EventEmitter<ISortByPayload>;
81
+ /**
82
+ * Event emitted when a row link is clicked. Emits `ITableEventPayload` payload.
83
+ */
84
+ readonly linkClick: EventEmitter<ITableEventPayload<ITableRowItem>>;
85
+ /** @ignore */
86
+ paginationComponent?: PaginationComponent;
87
+ /** @ignore */
88
+ bulkActions?: TableBulkActionsComponent;
89
+ /**
90
+ * Event emitted when a row input value is changed. Emitted cells of `columnType` `SinglSelect`, `MultiSelect`, `Input`, `Boolean` or `Icon`.
91
+ * Not emitted if column definition property `disabled` = `true`. Emits `ITableEventPayload` payload.
92
+ */
93
+ readonly inputChange: EventEmitter<ITableEventPayload<ITableRowItem>>;
94
+ /** @ignore */
95
+ cellType: typeof TableColumnType;
96
+ /** @ignore */
97
+ allSelected: boolean;
98
+ /** @ignore */
99
+ get someSelected(): boolean;
100
+ /** @ignore */
101
+ readonly branded: boolean;
102
+ /** @ignore */
103
+ get tableSpan(): number;
104
+ private _canSelectRows;
105
+ private _canSelectAllRows;
106
+ private _selectedRowIds;
107
+ private readonly _inputChange;
108
+ constructor(_datePipe: DatePipe, _percentPipe: PercentPipe, _decmialPipe: DecimalPipe, _changeDetectorRef: ChangeDetectorRef, _branded: BrandedDirective);
109
+ ngOnChanges(changes: SimpleChanges): void;
110
+ getMailToValue(columnIndex: number, currentRow: ITableRowItem): string;
111
+ getStringValue(columnIndex: number, currentRow: ITableRowItem): string;
112
+ getValue(columnIndex: number, currentRow: ITableRowItem): string | string[];
113
+ getRawValue(columnIndex: number, currentRow: ITableRowItem): ITableRowItemValueTypes<ITableRowItemValue>;
114
+ getCellColor(columnDefinition: ITableColumnDef, item: ITableRowItem): string;
115
+ getTheme(columnDefinition: ITableColumnDef, item: ITableRowItem): ComponentTheme;
116
+ isSortedColumn(columnIndex: number): boolean;
117
+ isRowSelected(id: string | number): boolean;
118
+ handleSelectAll(event: CheckboxChangeEvent): void;
119
+ handleSort(columnIndex: number): void;
120
+ handleRowSelect(event: CheckboxChangeEvent, rowId: number | string): void;
121
+ handleCellValueChange(columnIndex: number, rowIndex: number, value: string | number | boolean | string[]): void;
122
+ handleLinkClick(columnIndex: number, item: ITableRowItem): void;
123
+ private _getColumnDefByIndex;
124
+ private _getValue;
125
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, [null, null, null, null, { optional: true; host: true; }]>;
126
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "impdc-table", never, { "loading": "loading"; "columnDefs": "columnDefs"; "striped": "striped"; "canSelectRows": "canSelectRows"; "canSelectAllRows": "canSelectAllRows"; "selectPlaceholder": "selectPlaceholder"; "sortColumnIndex": "sortColumnIndex"; "sortDirection": "sortDirection"; "tableData": "tableData"; "selectedRowIds": "selectedRowIds"; "customCellComponents": "customCellComponents"; }, { "rowSelect": "rowSelect"; "sortBy": "sortBy"; "linkClick": "linkClick"; "inputChange": "inputChange"; }, ["paginationComponent", "bulkActions"], ["impdc-table-bulk-actions", "[impdcTableBulkActions]", "[noData]", "impdc-pagination, div[impdc-pagination]"], false>;
127
+ }
@@ -0,0 +1,2 @@
1
+ export * from './table-inject-component.directive';
2
+ export * from './table.directive';
@@ -0,0 +1,16 @@
1
+ import { ComponentFactoryResolver, OnInit, ViewContainerRef } from '@angular/core';
2
+ import { ICustomCellRendererComponents, ITableColumnDef, ITableRowItem, ITableRowItemValue, ITableRowItemValueTypes } from '../interfaces/index';
3
+ import * as i0 from "@angular/core";
4
+ export declare class TableInjectComponentDirective implements OnInit {
5
+ private readonly _viewContainerRef;
6
+ private readonly _componentFactoryResolver;
7
+ columnDef: ITableColumnDef;
8
+ value: ITableRowItemValueTypes<ITableRowItemValue>;
9
+ rowItem: ITableRowItem;
10
+ customCellComponents: ICustomCellRendererComponents;
11
+ constructor(_viewContainerRef: ViewContainerRef, _componentFactoryResolver: ComponentFactoryResolver);
12
+ ngOnInit(): void;
13
+ private _renderCustomCell;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableInjectComponentDirective, never>;
15
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TableInjectComponentDirective, "[impdcTableInjectComponent]", never, { "columnDef": "columnDef"; "value": "value"; "rowItem": "rowItem"; "customCellComponents": "customCellComponents"; }, {}, never, never, false>;
16
+ }
@@ -1,15 +1,15 @@
1
1
  import * as i0 from "@angular/core";
2
2
  /**
3
- * The `TableComponent` (`<table impdcTable`) is a simple table wrapper that requires less code than the native table.
3
+ * The `TableDirective` (`<table impdcTable`) that adds Hex styling to a `table` element.
4
4
  * To use, import `TableModule` or another module that imports and exports that module from `@impartner/design-components`.
5
5
  */
6
- export declare class TableComponent {
6
+ export declare class TableDirective {
7
7
  /**
8
8
  * Stripes every other row in a slightly darker background color.
9
9
  */
10
10
  striped: boolean;
11
11
  private classTable;
12
12
  private get classTableStriped();
13
- static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, never>;
14
- static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "table[impdcTable]", never, { "striped": "striped"; }, {}, never, ["th", "tr"], false>;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableDirective, never>;
14
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TableDirective, "table[impdcTable]", never, { "striped": "striped"; }, {}, never, never, false>;
15
15
  }
@@ -0,0 +1 @@
1
+ export * from './table-column-type';
@@ -0,0 +1,18 @@
1
+ export declare enum TableColumnType {
2
+ Badge = "Badge",
3
+ Boolean = "Boolean",
4
+ Link = "Link",
5
+ Text = "Text",
6
+ Input = "Input",
7
+ Currency = "Currency",
8
+ Decimal = "Decimal",
9
+ Date = "Date",
10
+ DateTime = "DateTime",
11
+ Percentage = "Percentage",
12
+ CellRender = "CellRender",
13
+ SingleSelect = "SingleSelect",
14
+ MultiSelect = "MultiSelect",
15
+ Icon = "Icon",
16
+ Email = "Email",
17
+ Url = "Url"
18
+ }
@@ -0,0 +1 @@
1
+ export * from './table-theme.helper';
@@ -0,0 +1,7 @@
1
+ import { ITableColumnDef, ITableRowItem } from '../interfaces';
2
+ import { ComponentTheme } from '../../../types';
3
+ export declare class TableThemeHelper {
4
+ static getTheme({ fieldColor, color, colorGetter }: ITableColumnDef, currentRow: ITableRowItem): ComponentTheme | undefined;
5
+ static getCellColor(columnDefinition: ITableColumnDef, currentRow: ITableRowItem): string;
6
+ private static _getCellColor;
7
+ }
@@ -1,2 +1,7 @@
1
- export { TableComponent } from './table.component';
2
- export { TableModule } from './table.module';
1
+ export * from './table.module';
2
+ export * from './containers';
3
+ export * from './components';
4
+ export * from './directives';
5
+ export * from './helpers';
6
+ export * from './enumerations';
7
+ export * from './interfaces';
@@ -0,0 +1,6 @@
1
+ import { ITableRowItem, ITableRowItemValue, ITableRowItemValueTypes } from './table-row-item.interface';
2
+ export interface ICellRenderer<T = ITableRowItem, P = object> {
3
+ value: ITableRowItemValueTypes<ITableRowItemValue>;
4
+ rowItem: T;
5
+ params?: P;
6
+ }
@@ -0,0 +1,3 @@
1
+ import { Type } from '@angular/core';
2
+ import { ICellRenderer } from './index';
3
+ export declare type ICustomCellRendererComponents = Record<string, Type<ICellRenderer>>;
@@ -0,0 +1,8 @@
1
+ export * from './table-column-def.interface';
2
+ export * from './table-event-payload.interface';
3
+ export * from './sort-by-payload.interface';
4
+ export * from './table-row-item.interface';
5
+ export * from './cell-renderer.interface';
6
+ export * from './cell-renderer.interface';
7
+ export * from './custom-cell-renderer-components.type';
8
+ export * from './table-cell-option.interface';
@@ -0,0 +1,5 @@
1
+ export interface ISortByPayload {
2
+ field: string;
3
+ columnIndex: number;
4
+ direction: 'asc' | 'desc';
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface ITableCellOption {
2
+ value: string;
3
+ label: string;
4
+ }
@@ -0,0 +1,22 @@
1
+ import { TableColumnType } from '../enumerations/index';
2
+ import { ComponentTheme } from '../../../types';
3
+ import { ITableRowItem } from './table-row-item.interface';
4
+ import { ITableCellOption } from './table-cell-option.interface';
5
+ export interface ITableColumnDef<T = ITableRowItem> {
6
+ title: string;
7
+ field?: string;
8
+ valueGetter?: (record: T) => string;
9
+ color?: ComponentTheme;
10
+ colorGetter?: (record: T) => ComponentTheme;
11
+ fieldColor?: string;
12
+ columnType?: TableColumnType | string;
13
+ sorted?: boolean;
14
+ boldedText?: boolean;
15
+ truncated?: number;
16
+ cellRendererComponent?: string;
17
+ cellRendererParams?: object;
18
+ noPadding?: boolean;
19
+ values?: ITableCellOption[];
20
+ iconName?: string;
21
+ disabled?: boolean;
22
+ }
@@ -0,0 +1,6 @@
1
+ import { ITableRowItem } from './table-row-item.interface';
2
+ export interface ITableEventPayload<T = ITableRowItem> {
3
+ item: T;
4
+ columnIndex: number;
5
+ value?: string | number | boolean | string[];
6
+ }
@@ -0,0 +1,9 @@
1
+ export interface IIdentifiable {
2
+ id: string | number;
3
+ }
4
+ export declare type ITableRowItemValueTypes<T = never> = string | number | boolean | Array<string | number> | T | Array<T>;
5
+ export interface ITableRowItemBase<T = never> {
6
+ [field: string]: ITableRowItemValueTypes<T>;
7
+ }
8
+ export declare type ITableRowItemValue = ITableRowItemBase<ITableRowItemBase<ITableRowItemBase>>;
9
+ export declare type ITableRowItem = IIdentifiable & ITableRowItemValue;
@@ -1,9 +1,21 @@
1
1
  import * as i0 from "@angular/core";
2
- import * as i1 from "./table.component";
3
- import * as i2 from "../button/button.module";
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 "@angular/common";
8
+ import * as i7 from "../button/button.module";
9
+ import * as i8 from "../pagination/pagination.module";
10
+ import * as i9 from "../icon/icon.module";
11
+ import * as i10 from "../form-field/impdc-forms.module";
12
+ import * as i11 from "@angular/forms";
13
+ import * as i12 from "../spinner/spinner.module";
14
+ import * as i13 from "../badge/badge.module";
15
+ import * as i14 from "../branding/branding.module";
4
16
  export declare class TableModule {
5
17
  constructor();
6
18
  static ɵfac: i0.ɵɵFactoryDeclaration<TableModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<TableModule, [typeof i1.TableComponent], [typeof i2.ButtonModule], [typeof i2.ButtonModule, typeof i1.TableComponent]>;
19
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TableModule, [typeof i1.TableDirective, typeof i2.TableComponent, typeof i3.ColumnHeadingComponent, typeof i4.TableInjectComponentDirective, typeof i5.TableBulkActionsComponent], [typeof i6.CommonModule, typeof i7.ButtonModule, typeof i8.PaginationModule, typeof i9.IconModule, typeof i10.ImpdcFormsModule, typeof i11.FormsModule, typeof i12.SpinnerModule, typeof i13.BadgeModule, typeof i14.BrandingModule], [typeof i7.ButtonModule, typeof i1.TableDirective, typeof i3.ColumnHeadingComponent, typeof i5.TableBulkActionsComponent, typeof i8.PaginationModule, typeof i2.TableComponent, typeof i9.IconModule, typeof i4.TableInjectComponentDirective, typeof i14.BrandingModule]>;
8
20
  static ɵinj: i0.ɵɵInjectorDeclaration<TableModule>;
9
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@impartner/design-components",
3
- "version": "1.1.2",
3
+ "version": "1.2.0",
4
4
  "author": "Impartner",
5
5
  "license": "BSD-3-Clause",
6
6
  "private": false,
@@ -21,7 +21,8 @@
21
21
  "@popperjs/core": "^2.10.2",
22
22
  "nanoid": "^4.0.0",
23
23
  "rxjs": ">= 7",
24
- "sanitize-html": "^2.10.0"
24
+ "sanitize-html": "^2.10.0",
25
+ "lodash": "4.17.21"
25
26
  },
26
27
  "peerDependenciesMeta": {
27
28
  "@impartner/design": {
@@ -1,33 +0,0 @@
1
- import { Component, HostBinding, Input, ViewEncapsulation } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * The `TableComponent` (`<table impdcTable`) is a simple table wrapper that requires less code than the native table.
5
- * To use, import `TableModule` or another module that imports and exports that module from `@impartner/design-components`.
6
- */
7
- export class TableComponent {
8
- constructor() {
9
- /**
10
- * Stripes every other row in a slightly darker background color.
11
- */
12
- this.striped = false;
13
- this.classTable = true;
14
- }
15
- get classTableStriped() {
16
- return this.striped;
17
- }
18
- }
19
- TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
20
- TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TableComponent, selector: "table[impdcTable]", inputs: { striped: "striped" }, host: { properties: { "class.table": "this.classTable", "class.table-striped": "this.classTableStriped" } }, ngImport: i0, template: "<thead>\n <tr>\n <ng-content select=\"th\"></ng-content>\n </tr>\n</thead>\n<tbody>\n <ng-content select=\"tr\"></ng-content>\n</tbody>\n", encapsulation: i0.ViewEncapsulation.None });
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TableComponent, decorators: [{
22
- type: Component,
23
- args: [{ selector: 'table[impdcTable]', encapsulation: ViewEncapsulation.None, template: "<thead>\n <tr>\n <ng-content select=\"th\"></ng-content>\n </tr>\n</thead>\n<tbody>\n <ng-content select=\"tr\"></ng-content>\n</tbody>\n" }]
24
- }], propDecorators: { striped: [{
25
- type: Input
26
- }], classTable: [{
27
- type: HostBinding,
28
- args: ['class.table']
29
- }], classTableStriped: [{
30
- type: HostBinding,
31
- args: ['class.table-striped']
32
- }] } });
33
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZGVzaWduLWNvbXBvbmVudHMvc3JjL2xpYi90YWJsZS90YWJsZS5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9kZXNpZ24tY29tcG9uZW50cy9zcmMvbGliL3RhYmxlL3RhYmxlLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxTQUFTLEVBQ1QsV0FBVyxFQUNYLEtBQUssRUFDTCxpQkFBaUIsRUFDbEIsTUFBTSxlQUFlLENBQUM7O0FBRXZCOzs7R0FHRztBQU9ILE1BQU0sT0FBTyxjQUFjO0lBTjNCO1FBT0U7O1dBRUc7UUFFSCxZQUFPLEdBQUcsS0FBSyxDQUFDO1FBRW9CLGVBQVUsR0FBRyxJQUFJLENBQUM7S0FLdkQ7SUFIQyxJQUFnRCxpQkFBaUI7UUFDL0QsT0FBTyxJQUFJLENBQUMsT0FBTyxDQUFDO0lBQ3RCLENBQUM7OzRHQVhVLGNBQWM7Z0dBQWQsY0FBYyxzTUNqQjNCLGlKQVFBOzRGRFNhLGNBQWM7a0JBTjFCLFNBQVM7K0JBRUUsbUJBQW1CLGlCQUVkLGlCQUFpQixDQUFDLElBQUk7OEJBT3JDLE9BQU87c0JBRE4sS0FBSztnQkFHOEIsVUFBVTtzQkFBN0MsV0FBVzt1QkFBQyxhQUFhO2dCQUVzQixpQkFBaUI7c0JBQWhFLFdBQVc7dUJBQUMscUJBQXFCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgQ29tcG9uZW50LFxuICBIb3N0QmluZGluZyxcbiAgSW5wdXQsXG4gIFZpZXdFbmNhcHN1bGF0aW9uXG59IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG4vKipcbiAqIFRoZSBgVGFibGVDb21wb25lbnRgIChgPHRhYmxlIGltcGRjVGFibGVgKSBpcyBhIHNpbXBsZSB0YWJsZSB3cmFwcGVyIHRoYXQgcmVxdWlyZXMgbGVzcyBjb2RlIHRoYW4gdGhlIG5hdGl2ZSB0YWJsZS5cbiAqIFRvIHVzZSwgaW1wb3J0IGBUYWJsZU1vZHVsZWAgb3IgYW5vdGhlciBtb2R1bGUgdGhhdCBpbXBvcnRzIGFuZCBleHBvcnRzIHRoYXQgbW9kdWxlIGZyb20gYEBpbXBhcnRuZXIvZGVzaWduLWNvbXBvbmVudHNgLlxuICovXG5AQ29tcG9uZW50KHtcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEBhbmd1bGFyLWVzbGludC9jb21wb25lbnQtc2VsZWN0b3JcbiAgc2VsZWN0b3I6ICd0YWJsZVtpbXBkY1RhYmxlXScsXG4gIHRlbXBsYXRlVXJsOiAnLi90YWJsZS5jb21wb25lbnQuaHRtbCcsXG4gIGVuY2Fwc3VsYXRpb246IFZpZXdFbmNhcHN1bGF0aW9uLk5vbmVcbn0pXG5leHBvcnQgY2xhc3MgVGFibGVDb21wb25lbnQge1xuICAvKipcbiAgICogU3RyaXBlcyBldmVyeSBvdGhlciByb3cgaW4gYSBzbGlnaHRseSBkYXJrZXIgYmFja2dyb3VuZCBjb2xvci5cbiAgICovXG4gIEBJbnB1dCgpXG4gIHN0cmlwZWQgPSBmYWxzZTtcblxuICBASG9zdEJpbmRpbmcoJ2NsYXNzLnRhYmxlJykgcHJpdmF0ZSBjbGFzc1RhYmxlID0gdHJ1ZTtcblxuICBASG9zdEJpbmRpbmcoJ2NsYXNzLnRhYmxlLXN0cmlwZWQnKSBwcml2YXRlIGdldCBjbGFzc1RhYmxlU3RyaXBlZCgpIHtcbiAgICByZXR1cm4gdGhpcy5zdHJpcGVkO1xuICB9XG59XG4iLCI8dGhlYWQ+XG4gIDx0cj5cbiAgICA8bmctY29udGVudCBzZWxlY3Q9XCJ0aFwiPjwvbmctY29udGVudD5cbiAgPC90cj5cbjwvdGhlYWQ+XG48dGJvZHk+XG4gIDxuZy1jb250ZW50IHNlbGVjdD1cInRyXCI+PC9uZy1jb250ZW50PlxuPC90Ym9keT5cbiJdfQ==