@angular-generic-table/core 5.0.0-rc.2 → 5.0.0-rc.20

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 (76) hide show
  1. package/esm2020/angular-generic-table-core.mjs +5 -0
  2. package/esm2020/lib/core.component.mjs +560 -0
  3. package/esm2020/lib/core.module.mjs +47 -0
  4. package/esm2020/lib/core.service.mjs +14 -0
  5. package/esm2020/lib/gt-delta/gt-delta.component.mjs +126 -0
  6. package/esm2020/lib/models/gt-pagination.mjs +2 -0
  7. package/esm2020/lib/models/table-column.interface.mjs +2 -0
  8. package/esm2020/lib/models/table-config.interface.mjs +2 -0
  9. package/esm2020/lib/models/table-events.interface.mjs +2 -0
  10. package/esm2020/lib/models/table-info.interface.mjs +2 -0
  11. package/esm2020/lib/models/table-meta.interface.mjs +2 -0
  12. package/esm2020/lib/models/table-row.interface.mjs +2 -0
  13. package/esm2020/lib/models/table-sort.interface.mjs +2 -0
  14. package/esm2020/lib/pagination/pagination.component.mjs +157 -0
  15. package/esm2020/lib/pagination/pagination.module.mjs +17 -0
  16. package/esm2020/lib/pipes/capital-case.pipe.mjs +18 -0
  17. package/esm2020/lib/pipes/dash-case.pipe.mjs +18 -0
  18. package/esm2020/lib/pipes/dynamic.pipe.mjs +26 -0
  19. package/esm2020/lib/pipes/highlight.pipe.mjs +49 -0
  20. package/esm2020/lib/pipes/row-selection.pipe.mjs +17 -0
  21. package/esm2020/lib/pipes/sort-class.pipe.mjs +40 -0
  22. package/esm2020/lib/utilities/utilities.mjs +186 -0
  23. package/esm2020/public-api.mjs +24 -0
  24. package/fesm2015/angular-generic-table-core.mjs +1253 -0
  25. package/fesm2015/angular-generic-table-core.mjs.map +1 -0
  26. package/fesm2020/angular-generic-table-core.mjs +1240 -0
  27. package/fesm2020/angular-generic-table-core.mjs.map +1 -0
  28. package/index.d.ts +5 -0
  29. package/lib/core.component.d.ts +123 -18
  30. package/lib/core.module.d.ts +13 -0
  31. package/lib/core.service.d.ts +3 -0
  32. package/lib/gt-delta/gt-delta.component.d.ts +32 -0
  33. package/lib/models/gt-pagination.d.ts +18 -0
  34. package/lib/models/table-column.interface.d.ts +15 -3
  35. package/lib/models/table-config.interface.d.ts +44 -6
  36. package/lib/models/table-events.interface.d.ts +27 -0
  37. package/lib/models/table-info.interface.d.ts +3 -1
  38. package/lib/models/table-meta.interface.d.ts +8 -0
  39. package/lib/models/table-row.interface.d.ts +1 -1
  40. package/lib/models/table-sort.interface.d.ts +6 -4
  41. package/lib/pagination/pagination.component.d.ts +62 -0
  42. package/lib/pagination/pagination.module.d.ts +8 -0
  43. package/lib/pipes/capital-case.pipe.d.ts +7 -0
  44. package/lib/pipes/dash-case.pipe.d.ts +3 -0
  45. package/lib/pipes/dynamic.pipe.d.ts +9 -0
  46. package/lib/pipes/highlight.pipe.d.ts +3 -0
  47. package/lib/pipes/row-selection.pipe.d.ts +8 -0
  48. package/lib/pipes/sort-class.pipe.d.ts +5 -5
  49. package/lib/utilities/utilities.d.ts +32 -0
  50. package/package.json +22 -10
  51. package/public-api.d.ts +12 -0
  52. package/scss/index.scss +319 -0
  53. package/angular-generic-table-core.d.ts +0 -7
  54. package/angular-generic-table-core.metadata.json +0 -1
  55. package/bundles/angular-generic-table-core.umd.js +0 -594
  56. package/bundles/angular-generic-table-core.umd.js.map +0 -1
  57. package/bundles/angular-generic-table-core.umd.min.js +0 -2
  58. package/bundles/angular-generic-table-core.umd.min.js.map +0 -1
  59. package/esm2015/angular-generic-table-core.js +0 -8
  60. package/esm2015/lib/core.component.js +0 -107
  61. package/esm2015/lib/core.module.js +0 -16
  62. package/esm2015/lib/core.service.js +0 -13
  63. package/esm2015/lib/enums/order.enum.js +0 -6
  64. package/esm2015/lib/models/table-column.interface.js +0 -2
  65. package/esm2015/lib/models/table-config.interface.js +0 -2
  66. package/esm2015/lib/models/table-info.interface.js +0 -2
  67. package/esm2015/lib/models/table-row.interface.js +0 -2
  68. package/esm2015/lib/models/table-sort.interface.js +0 -2
  69. package/esm2015/lib/pipes/dash-case.pipe.js +0 -13
  70. package/esm2015/lib/pipes/highlight.pipe.js +0 -44
  71. package/esm2015/lib/pipes/sort-class.pipe.js +0 -12
  72. package/esm2015/lib/utilities/utilities.js +0 -25
  73. package/esm2015/public-api.js +0 -12
  74. package/fesm2015/angular-generic-table-core.js +0 -234
  75. package/fesm2015/angular-generic-table-core.js.map +0 -1
  76. package/lib/enums/order.enum.d.ts +0 -4
@@ -1,4 +1,6 @@
1
1
  export interface TableInfo {
2
- records: number;
2
+ numberOfRecords: number;
3
+ pageSize: number;
3
4
  pageTotal: number;
5
+ lazyLoaded?: boolean;
4
6
  }
@@ -0,0 +1,8 @@
1
+ import { TableRow } from './table-row.interface';
2
+ import { TableConfig } from './table-config.interface';
3
+ import { TableInfo } from './table-info.interface';
4
+ export interface TableMeta<R = TableRow> {
5
+ data: Array<Array<R>>;
6
+ config: TableConfig<R>;
7
+ info: TableInfo;
8
+ }
@@ -1,3 +1,3 @@
1
1
  export interface TableRow {
2
- [key: string]: number | string | boolean;
2
+ [key: string]: number | string | boolean | any;
3
3
  }
@@ -1,5 +1,7 @@
1
- import { Order } from '../enums/order.enum';
2
- export interface TableSort {
3
- sortBy: string;
4
- sortByOrder: Order;
1
+ import { TableRow } from './table-row.interface';
2
+ export type GtSortOrder<R = TableRow> = Array<GtSortConfig<R>>;
3
+ export interface GtSortConfig<R = {}> {
4
+ key: keyof R;
5
+ order: GtOrder;
5
6
  }
7
+ export type GtOrder = 'asc' | 'desc';
@@ -0,0 +1,62 @@
1
+ import { CoreComponent } from '../core.component';
2
+ import { GtPaginationAriaLabels, GtPaginationClasses, GtPaginationInfo } from '../models/gt-pagination';
3
+ import * as i0 from "@angular/core";
4
+ export declare class PaginationComponent {
5
+ get pagingInfo(): GtPaginationInfo;
6
+ /** pagingInfo
7
+ * @description when provided, pagination component will use this information to render pagination instead of data from table. Use this option when pagination is handled by backend (server side).
8
+ * @type info - metadata for pagination component
9
+ */
10
+ set pagingInfo(info: GtPaginationInfo);
11
+ get paginationLength(): number;
12
+ /** paginationLength
13
+ * @description number of buttons to show in pagination
14
+ * @type length - number of buttons to show. Defaults to: `5`
15
+ */
16
+ set paginationLength(length: number);
17
+ get classes(): GtPaginationClasses;
18
+ /** classes
19
+ * @description classes that should be used within pagination component for different elements
20
+ * @type classes - classes to be used. Defaults to: `{
21
+ * ul: 'pagination',
22
+ * li: 'page-item',
23
+ * button: 'page-link',
24
+ * }`
25
+ */
26
+ set classes(classes: GtPaginationClasses);
27
+ get ariaLabels(): GtPaginationAriaLabels;
28
+ /** ariaLabels
29
+ * @description aria labels that describe pagination component
30
+ * @type labels - aria labels for pagination. Defaults to: `{
31
+ * nav: 'Table pagination',
32
+ * button: 'Go to page ',
33
+ * }`
34
+ */
35
+ set ariaLabels(labels: GtPaginationAriaLabels);
36
+ get table(): CoreComponent;
37
+ /** table
38
+ * @description table component to which pagination is attached
39
+ * @type tableRef - table component
40
+ */
41
+ set table(tableRef: CoreComponent);
42
+ private _pagingInfo;
43
+ private _table$;
44
+ private _table;
45
+ private _ariaLabels;
46
+ private _classes;
47
+ private _paginationLength;
48
+ /** paginationListItems$ - observable for page numbers to show based on number of pages and current position */
49
+ paginationListItems$: import("rxjs").Observable<number[]>;
50
+ /** generate list - generate an array with page numbers to show based on number of pages and current position
51
+ * @param numberOfPages number of pages to show
52
+ * @param currentPosition current position (page index) being shown in table
53
+ * @returns Array<number> array of page numbers to show
54
+ */
55
+ private _generateList;
56
+ /** go to page
57
+ * @param index - page index to go to
58
+ */
59
+ goToPage(index: number): void;
60
+ static ɵfac: i0.ɵɵFactoryDeclaration<PaginationComponent, never>;
61
+ static ɵcmp: i0.ɵɵComponentDeclaration<PaginationComponent, "angular-generic-table-pagination", never, { "pagingInfo": "pagingInfo"; "paginationLength": "paginationLength"; "classes": "classes"; "ariaLabels": "ariaLabels"; "table": "table"; }, {}, never, never, true, never>;
62
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/common";
3
+ import * as i2 from "./pagination.component";
4
+ export declare class GenericTablePaginationModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<GenericTablePaginationModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<GenericTablePaginationModule, never, [typeof i1.CommonModule, typeof i2.PaginationComponent], [typeof i2.PaginationComponent]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<GenericTablePaginationModule>;
8
+ }
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class CapitalCasePipe implements PipeTransform {
4
+ transform(s: string): any;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<CapitalCasePipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<CapitalCasePipe, "capitalCase", true>;
7
+ }
@@ -1,4 +1,7 @@
1
1
  import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
2
3
  export declare class DashCasePipe implements PipeTransform {
3
4
  transform(s: string): any;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<DashCasePipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<DashCasePipe, "dashCase", true>;
4
7
  }
@@ -0,0 +1,9 @@
1
+ import { Injector, PipeTransform, Type } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DynamicPipe implements PipeTransform {
4
+ private injector;
5
+ constructor(injector: Injector);
6
+ transform(value: any, requiredPipe: Type<any>, pipeArgs: any[]): any;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicPipe, never>;
8
+ static ɵpipe: i0.ɵɵPipeDeclaration<DynamicPipe, "dynamicPipe", true>;
9
+ }
@@ -1,4 +1,7 @@
1
1
  import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
2
3
  export declare class HighlightPipe implements PipeTransform {
3
4
  transform(text: any, searchTerm: string | null): string;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<HighlightPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<HighlightPipe, "highlight", true>;
4
7
  }
@@ -0,0 +1,8 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { TableRow } from '../models/table-row.interface';
3
+ import * as i0 from "@angular/core";
4
+ export declare class RowSelectionPipe implements PipeTransform {
5
+ transform(row: TableRow, selection: any, comparator: (row: TableRow, selection: any) => boolean, className?: string): string;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<RowSelectionPipe, never>;
7
+ static ɵpipe: i0.ɵɵPipeDeclaration<RowSelectionPipe, "rowSelection", true>;
8
+ }
@@ -1,8 +1,8 @@
1
1
  import { PipeTransform } from '@angular/core';
2
- import { Order } from '../enums/order.enum';
2
+ import { GtSortOrder } from '../models/table-sort.interface';
3
+ import * as i0 from "@angular/core";
3
4
  export declare class SortClassPipe implements PipeTransform {
4
- transform(selection: {
5
- sortBy: string;
6
- sortByOrder: Order;
7
- } | any, property: string): string;
5
+ transform(sortOrder: GtSortOrder | null, key: string, context?: 'class' | 'aria' | 'order'): string | null;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<SortClassPipe, never>;
7
+ static ɵpipe: i0.ɵɵPipeDeclaration<SortClassPipe, "sortClass", true>;
8
8
  }
@@ -1,5 +1,37 @@
1
1
  import { TableRow } from '../models/table-row.interface';
2
2
  import { TableConfig } from '../models/table-config.interface';
3
+ import { GtSortConfig, GtSortOrder } from '../models/table-sort.interface';
4
+ import { GtSortEvent } from '../models/table-events.interface';
3
5
  export declare let dashed: (s: string) => string;
6
+ export declare let capitalize: (s: string) => string;
4
7
  export declare let chunk: (array: Array<any>, chunkSize: number) => Array<Array<TableRow>>;
5
8
  export declare let search: (text: string, caseSensitive: boolean, data: Array<TableRow>, config: TableConfig) => TableRow[];
9
+ export declare let calculate: (data: Array<TableRow>, config: TableConfig) => {
10
+ calculated: any;
11
+ calculations: string[];
12
+ calculatedColumnsCount: number;
13
+ };
14
+ /** sortOnMultipleKeys
15
+ * @description Sort data on multiple keys
16
+ * @param {GtSortOrder} keys - array with sort config objects to sort on, data will be sorted according to array order
17
+ * @returns sort function
18
+ */
19
+ export declare const sortOnMultipleKeys: (keys: GtSortOrder<TableRow>) => (a: TableRow, b: TableRow) => number;
20
+ /** parseSortOrderParams
21
+ * @description Convert sort order query param to array with sort config objects
22
+ * @param sortParams - Query param string where each sort config object is separated by comma and order is indicated by + (ascending) or - (descending), e.g. _'name,-age'_
23
+ * @returns GtSortOrder - Array with sort config objects
24
+ */
25
+ export declare const parseSortOrderParams: (sortParams: string) => GtSortOrder<TableRow>;
26
+ /** sortOrderConfigToParam
27
+ * @description Convert sort config object to string that can be used as query param when sorting is implemented server side
28
+ * @param sortConfig - Sort config object
29
+ * @returns string - Query param string where order is indicated by + (ascending) or - (descending), e.g. _'-name'_
30
+ */
31
+ export declare const sortOrderConfigToParam: (sortConfig: GtSortEvent | GtSortConfig) => string;
32
+ /** sortOrderToParams
33
+ * @description Convert sort order array to string that can be used as query param when sorting is implemented server side
34
+ * @param sortOrder - Array with sort config objects
35
+ * @returns string - Query param string where each sort config object is separated by comma and order is indicated by + (ascending) or - (descending), e.g. _'name,-age'_
36
+ */
37
+ export declare const sortOrderToParams: (sortOrder: GtSortOrder<TableRow>) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-generic-table/core",
3
- "version": "5.0.0-rc.2",
3
+ "version": "5.0.0-rc.20",
4
4
  "author": "Robert Hjalmers <opensource@rhj.se> (http://www.linkedin.com/in/robert-hjalmers/)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -8,18 +8,30 @@
8
8
  "url": "https://github.com/hjalmers/angular-generic-table.git"
9
9
  },
10
10
  "peerDependencies": {
11
- "@angular/common": "^11.0.6",
12
- "@angular/core": "^11.0.6"
11
+ "@angular/common": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
12
+ "@angular/core": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0"
13
13
  },
14
14
  "dependencies": {
15
15
  "tslib": "^2.0.0"
16
16
  },
17
- "main": "bundles/angular-generic-table-core.umd.js",
18
- "module": "fesm2015/angular-generic-table-core.js",
19
- "es2015": "fesm2015/angular-generic-table-core.js",
20
- "esm2015": "esm2015/angular-generic-table-core.js",
21
- "fesm2015": "fesm2015/angular-generic-table-core.js",
22
- "typings": "angular-generic-table-core.d.ts",
23
- "metadata": "angular-generic-table-core.metadata.json",
17
+ "module": "fesm2015/angular-generic-table-core.mjs",
18
+ "es2020": "fesm2020/angular-generic-table-core.mjs",
19
+ "esm2020": "esm2020/angular-generic-table-core.mjs",
20
+ "fesm2020": "fesm2020/angular-generic-table-core.mjs",
21
+ "fesm2015": "fesm2015/angular-generic-table-core.mjs",
22
+ "typings": "index.d.ts",
23
+ "exports": {
24
+ "./package.json": {
25
+ "default": "./package.json"
26
+ },
27
+ ".": {
28
+ "types": "./index.d.ts",
29
+ "esm2020": "./esm2020/angular-generic-table-core.mjs",
30
+ "es2020": "./fesm2020/angular-generic-table-core.mjs",
31
+ "es2015": "./fesm2015/angular-generic-table-core.mjs",
32
+ "node": "./fesm2015/angular-generic-table-core.mjs",
33
+ "default": "./fesm2020/angular-generic-table-core.mjs"
34
+ }
35
+ },
24
36
  "sideEffects": false
25
37
  }
package/public-api.d.ts CHANGED
@@ -1,8 +1,20 @@
1
1
  export * from './lib/core.service';
2
2
  export * from './lib/core.component';
3
3
  export * from './lib/core.module';
4
+ export * from './lib/gt-delta/gt-delta.component';
5
+ export * from './lib/pagination/pagination.component';
6
+ export * from './lib/pagination/pagination.module';
4
7
  export * from './lib/models/table-config.interface';
5
8
  export * from './lib/models/table-column.interface';
6
9
  export * from './lib/models/table-info.interface';
7
10
  export * from './lib/models/table-row.interface';
8
11
  export * from './lib/models/table-sort.interface';
12
+ export * from './lib/models/table-meta.interface';
13
+ export * from './lib/models/table-events.interface';
14
+ export * from './lib/models/gt-pagination';
15
+ export * from './lib/utilities/utilities';
16
+ export * from './lib/pipes/capital-case.pipe';
17
+ export * from './lib/pipes/dash-case.pipe';
18
+ export * from './lib/pipes/dynamic.pipe';
19
+ export * from './lib/pipes/highlight.pipe';
20
+ export * from './lib/pipes/sort-class.pipe';
@@ -0,0 +1,319 @@
1
+ $highlight-background-color: #ffdd00 !default;
2
+ $style-selector: '.table' !default;
3
+ $footer-header-font-weight: 400 !default;
4
+ $footer-cell-font-weight: 500 !default;
5
+ $footer-header-text-align: end !default;
6
+ $footer-border-top: solid 2px var(--bs-table-color, #000) !default;
7
+ $mobile-style-selector: 'table.table-mobile:not(.table-horizontal)' !default;
8
+ $mobile-style-max-width: 576px !default;
9
+ $mobile-style-header-font-weight: 500 !default;
10
+ $mobile-style-header-background-color: var(--bs-body-bg, #fff) !default;
11
+ $mobile-style-button-selector: '.btn-sm' !default;
12
+ $mobile-style-border-bottom: var(--bs-border-style, solid) var(--bs-border-width, 1px) var(--bs-border-color, #dedede) !default;
13
+ $mobile-style-button-font-size: 1rem !default;
14
+ $mobile-style-button-padding: 0.375rem 0.75rem !default;
15
+ $pagination-ellipsis-content: '...' !default;
16
+ $pagination-active-color: var(--bs-light, #000) !default;
17
+ $pagination-justify-content: center !default;
18
+ $cell-padding-y: 0.5rem !default;
19
+ $cell-padding-x: 0.5rem !default;
20
+ $sort-selector: '.gt-sort' !default;
21
+
22
+ $table-column-header-bg: var(--bs-body-bg);
23
+ $table-row-header-bg: var(--bs-body-bg);
24
+
25
+ $delta-positive-prefix: '+' !default;
26
+
27
+ $sort-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 448 644'%3E%3Cpath transform='translate(0 240)' d='M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z'/%3E%3Cpath transform='translate(0 -100)' d='M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z'/%3E%3C/svg%3E") !default;
28
+ //$sort-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='icon icon-tabler icon-tabler-arrows-sort' width='24' height='24' viewBox='0 0 24 24' stroke-width='2' stroke='currentColor' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M3 9l4 -4l4 4m-4 -4v14'%3E%3C/path%3E%3Cpath d='M21 15l-4 4l-4 -4m4 4v-14'%3E%3C/path%3E%3C/svg%3E") !default;
29
+ $sort-icon-size: 1rem;
30
+ $sort-icon-color: rgba(var(--bs-secondary-rgb, #000),0.25) !default;
31
+ $sort-icon-color-active: var(--bs-primary, #000) !default;
32
+ $ascending-sort-gradient: linear-gradient(1turn,
33
+ $sort-icon-color 50%,
34
+ $sort-icon-color-active 50%
35
+ ) !default;
36
+ $descending-sort-gradient: linear-gradient(
37
+ $sort-icon-color 50%,
38
+ $sort-icon-color-active 50%
39
+ ) !default;
40
+ /*$ascending-sort-gradient: linear-gradient(0.25turn,
41
+ $sort-icon-color 50%,
42
+ $sort-icon-color-active 50%
43
+ ) !default;
44
+ $descending-sort-gradient: linear-gradient(0.75turn,
45
+ $sort-icon-color 50%,
46
+ $sort-icon-color-active 50%
47
+ ) !default;
48
+ */
49
+
50
+ $skeleton-loader-highlight-color: var(--bs-gray-300, rgb(200,200,200)) !default;
51
+ $skeleton-loader-background-color: var(--bs-gray-200, rgb(240,240,240)) !default;
52
+ $skeleton-loader-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' id='a' viewBox='0 0 768 135'%3E%3Cdefs/%3E%3Cpath fill='%23FFF' d='M114 10h100v24H114V10ZM114 55h120v24H114V55ZM114 100h130v24H114v-24ZM268 10h100v24H268V10ZM268 55h80v24h-80V55ZM268 100h100v24H268v-24ZM402 10h90v24h-90V10ZM402 55h70v24h-70V55ZM402 100h80v24h-80v-24ZM516 10h90v24h-90V10ZM516 55h110v24H516V55ZM516 100h120v24H516v-24ZM660 100h74v24h-74v-24ZM660 55h64v24h-64V55ZM660 10h84v24h-84V10ZM0 100h80v24H0v-24ZM0 55h70v24H0V55ZM0 10h90v24H0V10ZM0 134h768v1H0v-1ZM0 89h768v1H0v-1ZM0 44h768v1H0v-1Z' class='b'/%3E%3C/svg%3E") !default;
53
+ $skeleton-loader-mask-size: 768px 135px !default;
54
+
55
+ $skeleton-height: var(--gt-skeleton-height, 169px) !default;
56
+ @mixin styles() {
57
+ @include default-style;
58
+ @include footer-style;
59
+ @include search-style;
60
+ @include mobile-style;
61
+ @include pagination-style;
62
+ @include delta-style;
63
+ @include sticky-style;
64
+ @include skeleton-loader-styles;
65
+ }
66
+
67
+ @mixin default-style {
68
+ #{$style-selector} {
69
+ thead tr th {
70
+ // sort button
71
+ &[aria-sort],
72
+ &.gt-sortable {
73
+ > #{$sort-selector} {
74
+ appearance: none;
75
+ font: inherit;
76
+ margin: 0;
77
+ padding: $cell-padding-y $cell-padding-x;
78
+ margin: -#{$cell-padding-y} -#{$cell-padding-x};
79
+ border: none;
80
+ background: none;
81
+ color: inherit;
82
+ width: 100%;
83
+ text-align: left;
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: inherit;
87
+ transition: box-shadow 0.25s ease-in-out;
88
+ &[data-sort-order]::before {
89
+ content: attr(data-sort-order);
90
+ order: 2;
91
+ font-variant: diagonal-fractions;
92
+ font-weight: normal;
93
+ align-self: flex-start;
94
+ line-height: initial;
95
+ }
96
+ &::after {
97
+ content: '';
98
+ background: $sort-icon-color;
99
+ width: $sort-icon-size;
100
+ height: $sort-icon-size;
101
+ margin-left: 0.25rem;
102
+ mask-image: $sort-icon;
103
+ mask-repeat: no-repeat;
104
+ mask-size: cover;
105
+ mask-position: right;
106
+ display: block;
107
+ flex-shrink: 0;
108
+ }
109
+ &:focus-visible {
110
+ box-shadow: inset rgba(var(--bs-primary-rgb, (0,0,0)),0.35) 0 0 0 4px;
111
+ outline: none;
112
+ border-radius: 4px;
113
+ }
114
+ }
115
+ }
116
+ &[aria-sort='ascending'] {
117
+ #{$sort-selector}::after {
118
+ background: $ascending-sort-gradient;
119
+ }
120
+ }
121
+ &[aria-sort='descending'] {
122
+ #{$sort-selector}::after {
123
+ background: $descending-sort-gradient;
124
+ }
125
+ }
126
+ }
127
+ tr {
128
+ th, td {
129
+ padding: $cell-padding-y $cell-padding-x;
130
+ }
131
+ }
132
+ tfoot {
133
+ th {
134
+ font-weight: $footer-header-font-weight;
135
+ text-align: $footer-header-text-align;
136
+ }
137
+ td[data-header]:first-child {
138
+ display: flex;
139
+ justify-content: space-between;
140
+ align-items: center;
141
+ border-top: none !important;
142
+ &::before {
143
+ content: attr(data-header);
144
+ display: block;
145
+ font-weight: $footer-header-font-weight;
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
151
+
152
+ @mixin footer-style {
153
+ tfoot tr:first-child {
154
+ border-top: $footer-border-top;
155
+ }
156
+ tfoot tr th {
157
+ font-weight: $footer-header-font-weight;
158
+ }
159
+ tfoot tr td {
160
+ font-weight: $footer-cell-font-weight;
161
+ }
162
+ }
163
+
164
+ @mixin search-style {
165
+ .gt-highlight-search {
166
+ background: $highlight-background-color;
167
+ }
168
+ }
169
+ @mixin mobile-style($selector: $mobile-style-selector) {
170
+ @media (max-width: $mobile-style-max-width) {
171
+ #{$selector} {
172
+ table-layout: fixed;
173
+ border-bottom: none;
174
+ thead {
175
+ position: sticky;
176
+ top: 0;
177
+ display: block;
178
+ @media (hover: none) and (pointer: coarse) {
179
+ display: table-header-group;
180
+ }
181
+ background: $mobile-style-header-background-color;
182
+ tr {
183
+ display: flex;
184
+ overflow: auto;
185
+ &::-webkit-scrollbar {
186
+ display: none;
187
+ }
188
+ th {
189
+ flex: auto;
190
+ text-align: left !important;
191
+ white-space: nowrap;
192
+ }
193
+ }
194
+ }
195
+ tbody, tfoot {
196
+ tr {
197
+ display: flex;
198
+ flex-direction: column;
199
+ border-bottom: $mobile-style-border-bottom;
200
+ }
201
+ td {
202
+ display: flex;
203
+ justify-content: space-between;
204
+ align-items: center;
205
+ border-top: none !important;
206
+ &::before {
207
+ content: attr(data-label);
208
+ display: block;
209
+ font-weight: $mobile-style-header-font-weight;
210
+ }
211
+
212
+ #{$mobile-style-button-selector} {
213
+ width: 100%;
214
+ font-size: $mobile-style-button-font-size;
215
+ padding: $mobile-style-button-padding;
216
+ }
217
+ }
218
+ }
219
+ tfoot {
220
+ td:first-child::before {
221
+ font-weight: $mobile-style-header-font-weight;
222
+ }
223
+ td::before {
224
+ font-weight: normal;
225
+ }
226
+ td:not(:first-child).gt-no-content {
227
+ display: none;
228
+ }
229
+ }
230
+ }
231
+ }
232
+ }
233
+ @mixin pagination-style() {
234
+ nav.gt-pagination {
235
+ display: flex;
236
+ justify-content: $pagination-justify-content;
237
+ ul {
238
+ display: inline-flex;
239
+ list-style: none;
240
+ margin: 0;
241
+ padding: 0;
242
+ li {
243
+ &.gt-ellipsis > button::after {
244
+ content: $pagination-ellipsis-content;
245
+ display: inline-flex;
246
+ }
247
+ &.active button {
248
+ color: $pagination-active-color;
249
+ }
250
+ }
251
+ }
252
+ }
253
+ }
254
+
255
+ @mixin delta-style() {
256
+ .gt-delta {
257
+ display: flex;
258
+ &.gt-delta-positive > span {
259
+ display: inline-flex;
260
+ &::before {
261
+ display: block;
262
+ content: $delta-positive-prefix;
263
+ }
264
+ }
265
+ }
266
+ }
267
+ @mixin sticky-style() {
268
+ .gt-sticky-column-header thead tr th {
269
+ position: sticky;
270
+ top: 0;
271
+ background: $table-column-header-bg;
272
+ z-index: 2;
273
+ white-space: nowrap;
274
+ }
275
+
276
+ .gt-sticky-row-header {
277
+ tbody tr th.row-header, thead tr th:first-child {
278
+ position: sticky;
279
+ left: 0;
280
+ background: $table-row-header-bg;
281
+ z-index: 1;
282
+ white-space: nowrap;
283
+ }
284
+ thead tr th:first-child {
285
+ z-index: 3;
286
+ }
287
+ }
288
+ }
289
+
290
+ @mixin skeleton-loader-styles() {
291
+ .gt-skeleton-loader {
292
+ margin:0 0 0.625rem 0;
293
+ --gt-skeleton-loader-mask: #{$skeleton-loader-mask};
294
+ --gt-skeleton-loader-highlight-color: #{$skeleton-loader-highlight-color};
295
+ --gt-skeleton-loader-bg-color: #{$skeleton-loader-background-color};
296
+ @keyframes skeleton-loader {
297
+ 0% {
298
+ background-position: 0 0;
299
+ }
300
+ 25%,
301
+ 100% {
302
+ background-position: 200vw 0;
303
+ }
304
+ }
305
+ height: $skeleton-height;
306
+ mask-image: var(--gt-skeleton-loader-mask);
307
+ mask-size: $skeleton-loader-mask-size;
308
+ background: linear-gradient(
309
+ 280deg,
310
+ $skeleton-loader-background-color 12.5%,
311
+ $skeleton-loader-highlight-color 17.5%,
312
+ $skeleton-loader-background-color 37.5%
313
+ );
314
+ background-size: 200vw 100vw;
315
+ background-position: 0 0;
316
+ animation: skeleton-loader 3000ms linear infinite;
317
+ }
318
+ }
319
+
@@ -1,7 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
5
- export { DashCasePipe as ɵb } from './lib/pipes/dash-case.pipe';
6
- export { HighlightPipe as ɵc } from './lib/pipes/highlight.pipe';
7
- export { SortClassPipe as ɵa } from './lib/pipes/sort-class.pipe';
@@ -1 +0,0 @@
1
- {"__symbolic":"module","version":4,"metadata":{"CoreService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":2,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}]},"statics":{"ɵprov":{}}},"CoreComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":12,"character":1},"arguments":[{"selector":"angular-generic-table","styles":[],"changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":16,"character":19},"member":"OnPush"},"template":"<table class=\"table text-nowrap mb-0\" id=\"agreementList_table\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of (tableConfig$ | async)!.columns | keyvalue: columnOrder\">\n <th\n *ngIf=\"!column.value?.hidden\"\n ngClass=\"{{ column.value?.sortable ? 'sort ' : '' }} {{ sortBy$ | async | sortClass: column.key }} {{\n (column.key | dashCase) + '-column'\n }}\"\n [class.disabled]=\"loading$ | async\"\n (click)=\"!column.value.sortable || sort(column.key)\"\n >\n <span>{{ column.value?.header || column.key }}</span>\n </th>\n </ng-container>\n </tr>\n </thead>\n <tbody *ngIf=\"false !== false; else tableContent\">\n <tr>\n <!-- <td class=\"p-0\" [colSpan]=\"colspan$ | async\">-->\n <td class=\"p-0\">\n <div class=\"skeleton-loader skeleton-loader-table\"></div>\n </td>\n </tr>\n </tbody>\n</table>\n<ng-template #tableContent>\n <ng-container\n *ngIf=\"(table$ | async)! as table\"\n >\n <tbody id=\"agreementList_tableContent\" *ngIf=\"table!.data!.length > 0; else noData\">\n <tr *ngFor=\"let row of table!.data![(currentPage$ | async) || 0]; let i = index\" [attr.id]=\"'tableRow_' + i\">\n <ng-container *ngFor=\"let column of table.config?.columns | keyvalue: columnOrder\">\n <td *ngIf=\"!column.value?.hidden\">\n <!--<ng-container *ngIf=\"column.value.template === 'actions'\">\n <ng-container\n *ngTemplateOutlet=\"actionsColumn; context: { agreement: agreement, index: i }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column.value.template === 'date'\">\n <ng-container\n *ngTemplateOutlet=\"dateColumn; context: { agreement: agreement, column: column.key }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column.value.template === 'name'\">\n <ng-container *ngTemplateOutlet=\"nameColumn; context: { agreement: agreement }\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column.value.template === 'badge'\">\n <ng-container *ngTemplateOutlet=\"badgeColumn; context: { agreement: agreement }\"></ng-container>\n </ng-container>-->\n <ng-container [ngTemplateOutlet]=\"(searchBy$ | async) && !table.config.columns[column.key].templateRef ? highlighted:\n table.config.columns[column.key].templateRef ? templateRef :\n rawData\" [ngTemplateOutletContext]=\"{row: row, column: column, search: (searchBy$ | async), templateRef: table.config.columns[column.key].templateRef, index: i}\"></ng-container></td>\n </ng-container>\n </tr>\n </tbody>\n </ng-container>\n</ng-template>\n<ng-template #noData></ng-template>\n<ng-template #highlighted let-row=\"row\" let-column=\"column\" let-search=\"search\">\n <div [innerHTML]=\"(row[column.key] | highlight: search)\"></div>\n</ng-template>\n<ng-template #rawData let-row=\"row\" let-column=\"column\">\n {{row[column.key]}}\n</ng-template>\n<ng-template #templateRef let-row=\"row\" let-column=\"column\" let-index=\"index\" let-templateRef=\"templateRef\">\n <ng-container [ngTemplateOutlet]=\"templateRef\" [ngTemplateOutletContext]=\"{row: row, col: column, index: index}\"></ng-container>\n</ng-template>\n"}]}],"members":{"page":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":3}}]}],"search":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":24,"character":3}}]}],"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}}]}],"data":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"sort":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}]}},"GenericTableCoreModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"CoreComponent"},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"ɵb"},{"__symbolic":"reference","name":"ɵc"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":9,"character":12}],"exports":[{"__symbolic":"reference","name":"CoreComponent"}]}]}],"members":{}},"TableConfig":{"__symbolic":"interface"},"TableColumn":{"__symbolic":"interface"},"TableInfo":{"__symbolic":"interface"},"TableRow":{"__symbolic":"interface"},"TableSort":{"__symbolic":"interface"},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Pipe","line":3,"character":1},"arguments":[{"name":"sortClass"}]}],"members":{"transform":[{"__symbolic":"method"}]}},"ɵb":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Pipe","line":3,"character":1},"arguments":[{"name":"dashCase"}]}],"members":{"transform":[{"__symbolic":"method"}]}},"ɵc":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Pipe","line":2,"character":1},"arguments":[{"name":"highlight"}]}],"members":{"transform":[{"__symbolic":"method"}]}}},"origins":{"CoreService":"./lib/core.service","CoreComponent":"./lib/core.component","GenericTableCoreModule":"./lib/core.module","TableConfig":"./lib/models/table-config.interface","TableColumn":"./lib/models/table-column.interface","TableInfo":"./lib/models/table-info.interface","TableRow":"./lib/models/table-row.interface","TableSort":"./lib/models/table-sort.interface","ɵa":"./lib/pipes/sort-class.pipe","ɵb":"./lib/pipes/dash-case.pipe","ɵc":"./lib/pipes/highlight.pipe"},"importAs":"@angular-generic-table/core"}