@smallpearl/ngx-helper 0.31.6 → 0.31.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- export * from './src/entity-field-spec';
1
+ export * from './src/entity-field';
2
2
  export * from './src/provider';
@@ -1,5 +1,7 @@
1
1
  import { SPIntlDateFormat } from '@smallpearl/ngx-helper/locale';
2
2
  import { SPEntityFieldConfig } from './provider';
3
+ import { Observable } from 'rxjs';
4
+ type FieldValueTypes = string | number | Date | boolean;
3
5
  /**
4
6
  * This structure defines the data formatting details for a field of the
5
7
  * entity. All entity fields need not necessarily be actual entity object's
@@ -19,7 +21,7 @@ export type SPEntityFieldSpec<TEntity extends {
19
21
  alignment?: 'start' | 'center' | 'end';
20
22
  routerLink?: ((e: TEntity) => string[]) | [string];
21
23
  };
22
- valueFn?: (item: TEntity) => string | number | Date | boolean;
24
+ valueFn?: (item: TEntity) => FieldValueTypes | Observable<FieldValueTypes>;
23
25
  };
24
26
  /**
25
27
  * A class that represents a SPEntityFieldSpec<>. This is typically used
@@ -65,3 +67,4 @@ export declare class SPEntityField<TEntity extends {
65
67
  hasRouterLink(entity: TEntity): boolean;
66
68
  getRouterLink(entity: TEntity): string[];
67
69
  }
70
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { InjectionToken } from '@angular/core';
2
- import { SPEntityFieldSpec } from './entity-field-spec';
2
+ import { SPEntityFieldSpec } from './entity-field';
3
3
  export type FIELD_VALUE_FN = (entity: any, fieldName: string) => string | number | Date | boolean;
4
4
  /**
5
5
  * Global config for SPEntityField component.
@@ -1 +1 @@
1
- {"version":3,"file":"smallpearl-ngx-helper-entity-field.mjs","sources":["../../../../projects/smallpearl/ngx-helper/entity-field/src/entity-field-spec.ts","../../../../projects/smallpearl/ngx-helper/entity-field/src/provider.ts","../../../../projects/smallpearl/ngx-helper/entity-field/smallpearl-ngx-helper-entity-field.ts"],"sourcesContent":["import {\n spFormatCurrency,\n spFormatDate,\n SPIntlDateFormat,\n} from '@smallpearl/ngx-helper/locale';\nimport { SPEntityFieldConfig } from './provider';\n\n/**\n * This structure defines the data formatting details for a field of the\n * entity. All entity fields need not necessarily be actual entity object's\n * properties. Fields can also be computed fields, in which case the valueFn\n * should be initialized with a valid function to provide the field's value.\n */\nexport type SPEntityFieldSpec<TEntity extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'> = {\n // Column name. If valueFn is not specified, this will be used as the\n // key name to retrieve the value for the column from TEntity.\n name: string;\n // If omitted, 'name' will be used as field label.\n label?: string;\n // Column value specific formatting options. Currently, only used for\n // Date types.\n valueOptions?: {\n // Specify the same format string argument that is passed to DatePipe.\n dateTimeFormat?: SPIntlDateFormat;\n // If boolean, number field will be formatted using spFormatCurrency()\n // using the current currency or 'currency' value below.\n isCurrency?: boolean;\n // Currency code, if different from default locale.\n currency?: string;\n // CSS class name; if provided will be applied to field value's wrapper\n // element. This will be <td> & <th>.\n class?: string;\n // Alignment options. Field's value will be aligned based on this.\n alignment?: 'start'|'center'|'end';\n // A fixed string or a function that returns an array of strings\n // to be used as the routerlink for the column value.\n routerLink?: ((e: TEntity) => string[])|[string];\n };\n // If the column value cannot be derived by simple TEntity[name] lookup,\n // use this function to return a custom computed or formatted value.\n valueFn?: (item: TEntity) => string | number | Date | boolean;\n};\n\n/**\n * A class that represents a SPEntityFieldSpec<>. This is typically used\n * by the library to evaluate a SPEntityFieldSpec<> object.\n */\nexport class SPEntityField<TEntity extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'> {\n public _fieldSpec!: SPEntityFieldSpec<TEntity, IdKey>;\n\n constructor(\n spec: SPEntityFieldSpec<TEntity, IdKey> | string,\n public fieldConfig?: SPEntityFieldConfig\n ) {\n if (typeof spec === 'string') {\n this._fieldSpec = {\n name: spec,\n };\n } else {\n this._fieldSpec = spec;\n }\n }\n\n get spec() {\n return this._fieldSpec;\n }\n\n /**\n * Returns the effective fieldValueOptions by merging the global field\n * options (if one has been spefified) with the local field value options.\n * @returns SPEntityFieldSpec<any>['valueOptions']\n */\n get options() {\n let globalFieldValueOptions: SPEntityFieldSpec<any>['valueOptions'] = {};\n if (this.fieldConfig && this.fieldConfig?.fieldValueOptions && this.fieldConfig.fieldValueOptions.has(this._fieldSpec.name)) {\n globalFieldValueOptions = this.fieldConfig.fieldValueOptions.get(this._fieldSpec.name);\n }\n return {\n ...globalFieldValueOptions,\n ...(this._fieldSpec?.valueOptions ?? {})\n };\n }\n /**\n * @returns the label for the field.\n */\n label() {\n return this._fieldSpec.label ?? this._fieldSpec.name\n }\n\n /**\n * Given an entity, returns the value of the field matching the\n * SPEntityFieldSpec<> in fieldSpec.\n * @param entity TEntity instance which will be evaluated for\n * SPEntityFieldSpec<>.\n * @returns\n */\n value(entity: TEntity) {\n let val = undefined;\n if (!this._fieldSpec.valueFn) {\n if (\n this.fieldConfig &&\n this.fieldConfig?.fieldValueFns &&\n this.fieldConfig.fieldValueFns.has(this._fieldSpec.name)\n ) {\n val = this.fieldConfig.fieldValueFns.get(this._fieldSpec.name)!(entity, this._fieldSpec.name);\n } else {\n val = (entity as any)[this._fieldSpec.name];\n }\n } else {\n val = this._fieldSpec.valueFn(entity);\n }\n const valueOptions = this.options;\n if (val instanceof Date) {\n val = spFormatDate(val);\n } else if (\n typeof val === 'number' &&\n valueOptions?.isCurrency\n ) {\n val = spFormatCurrency(val, this._fieldSpec?.valueOptions?.currency);\n } else if (typeof val === 'boolean') {\n val = val ? '✔' : '✖';\n }\n return val;\n }\n\n /**\n * If specified, will be added to the CSS classes of the field's wrapper\n * element.\n */\n get class() {\n return this._fieldSpec?.valueOptions?.class ?? '';\n }\n\n hasRouterLink(entity: TEntity) {\n return !!this._fieldSpec?.valueOptions?.routerLink;\n }\n\n getRouterLink(entity: TEntity) {\n const rl = this._fieldSpec?.valueOptions?.routerLink;\n if (rl) {\n if (typeof rl == 'function') {\n return rl(entity);\n }\n return rl\n }\n return [];\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { SPEntityFieldSpec } from './entity-field-spec';\n\n\nexport type FIELD_VALUE_FN = (entity: any, fieldName: string) => string|number|Date|boolean;\n\n/**\n * Global config for SPEntityField component.\n */\nexport interface SPEntityFieldConfig {\n /**\n * These are global field value functions.\n *\n * If a value function for a field is not explicitly specified, this map is\n * looked up with the field name. If an entry exists in this table, it will\n * be used to render the field's value.\n *\n * This is useful for formatting certain fields which tend to have the\n * same name across the app. For instance fields such as 'amount', 'total'\n * or 'balance'. Or 'date', 'timestamp', etc.\n */\n fieldValueFns?: Map<string, FIELD_VALUE_FN>;\n /**\n * Similar to above, but allows setting the options for certain fields\n * globally. As in the case of `fieldValueFns`, the per field specification,\n * if one exists, takes precedence over the global setting.\n */\n fieldValueOptions?: Map<string, SPEntityFieldSpec<any>['valueOptions']>;\n}\n\nexport const SP_ENTITY_FIELD_CONFIG = new InjectionToken<SPEntityFieldConfig>(\n 'SPEntityFieldConfig'\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AA2CA;;;AAGG;MACU,aAAa,CAAA;AAKf,IAAA,WAAA;AAJF,IAAA,UAAU;IAEjB,WACE,CAAA,IAAgD,EACzC,WAAiC,EAAA;QAAjC,IAAW,CAAA,WAAA,GAAX,WAAW;AAElB,QAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC5B,IAAI,CAAC,UAAU,GAAG;AAChB,gBAAA,IAAI,EAAE,IAAI;aACX;;aACI;AACL,YAAA,IAAI,CAAC,UAAU,GAAG,IAAI;;;AAI1B,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,UAAU;;AAGxB;;;;AAIG;AACH,IAAA,IAAI,OAAO,GAAA;QACT,IAAI,uBAAuB,GAA2C,EAAE;QACxE,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,EAAE,iBAAiB,IAAI,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,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EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,EAAE,QAAQ,CAAC;;AAC/D,aAAA,IAAI,OAAO,GAAG,KAAK,SAAS,EAAE;YACnC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG;;AAEvB,QAAA,OAAO,GAAG;;AAGZ;;;AAGG;AACH,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,IAAI,EAAE;;AAGnD,IAAA,aAAa,CAAC,MAAe,EAAA;QAC3B,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU;;AAGpD,IAAA,aAAa,CAAC,MAAe,EAAA;QAC3B,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU;QACpD,IAAI,EAAE,EAAE;AACN,YAAA,IAAI,OAAO,EAAE,IAAI,UAAU,EAAE;AAC3B,gBAAA,OAAO,EAAE,CAAC,MAAM,CAAC;;AAEnB,YAAA,OAAO,EAAE;;AAEX,QAAA,OAAO,EAAE;;AAEZ;;MCrHY,sBAAsB,GAAG,IAAI,cAAc,CACtD,qBAAqB;;AC/BvB;;AAEG;;;;"}
1
+ {"version":3,"file":"smallpearl-ngx-helper-entity-field.mjs","sources":["../../../../projects/smallpearl/ngx-helper/entity-field/src/entity-field.ts","../../../../projects/smallpearl/ngx-helper/entity-field/src/provider.ts","../../../../projects/smallpearl/ngx-helper/entity-field/smallpearl-ngx-helper-entity-field.ts"],"sourcesContent":["import {\n spFormatCurrency,\n spFormatDate,\n SPIntlDateFormat,\n} from '@smallpearl/ngx-helper/locale';\nimport { SPEntityFieldConfig } from './provider';\nimport { Observable } from 'rxjs';\n\ntype FieldValueTypes = string | number | Date | boolean;\n\n/**\n * This structure defines the data formatting details for a field of the\n * entity. All entity fields need not necessarily be actual entity object's\n * properties. Fields can also be computed fields, in which case the valueFn\n * should be initialized with a valid function to provide the field's value.\n */\nexport type SPEntityFieldSpec<TEntity extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'> = {\n // Column name. If valueFn is not specified, this will be used as the\n // key name to retrieve the value for the column from TEntity.\n name: string;\n // If omitted, 'name' will be used as field label.\n label?: string;\n // Column value specific formatting options. Currently, only used for\n // Date types.\n valueOptions?: {\n // Specify the same format string argument that is passed to DatePipe.\n dateTimeFormat?: SPIntlDateFormat;\n // If boolean, number field will be formatted using spFormatCurrency()\n // using the current currency or 'currency' value below.\n isCurrency?: boolean;\n // Currency code, if different from default locale.\n currency?: string;\n // CSS class name; if provided will be applied to field value's wrapper\n // element. This will be <td> & <th>.\n class?: string;\n // Alignment options. Field's value will be aligned based on this.\n alignment?: 'start'|'center'|'end';\n // A fixed string or a function that returns an array of strings\n // to be used as the routerlink for the column value.\n routerLink?: ((e: TEntity) => string[])|[string];\n };\n // If the column value cannot be derived by simple TEntity[name] lookup,\n // use this function to return a custom computed or formatted value.\n valueFn?: (item: TEntity) => FieldValueTypes | Observable<FieldValueTypes>;\n};\n\n/**\n * A class that represents a SPEntityFieldSpec<>. This is typically used\n * by the library to evaluate a SPEntityFieldSpec<> object.\n */\nexport class SPEntityField<TEntity extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'> {\n public _fieldSpec!: SPEntityFieldSpec<TEntity, IdKey>;\n\n constructor(\n spec: SPEntityFieldSpec<TEntity, IdKey> | string,\n public fieldConfig?: SPEntityFieldConfig\n ) {\n if (typeof spec === 'string') {\n this._fieldSpec = {\n name: spec,\n };\n } else {\n this._fieldSpec = spec;\n }\n }\n\n get spec() {\n return this._fieldSpec;\n }\n\n /**\n * Returns the effective fieldValueOptions by merging the global field\n * options (if one has been spefified) with the local field value options.\n * @returns SPEntityFieldSpec<any>['valueOptions']\n */\n get options() {\n let globalFieldValueOptions: SPEntityFieldSpec<any>['valueOptions'] = {};\n if (this.fieldConfig && this.fieldConfig?.fieldValueOptions && this.fieldConfig.fieldValueOptions.has(this._fieldSpec.name)) {\n globalFieldValueOptions = this.fieldConfig.fieldValueOptions.get(this._fieldSpec.name);\n }\n return {\n ...globalFieldValueOptions,\n ...(this._fieldSpec?.valueOptions ?? {})\n };\n }\n /**\n * @returns the label for the field.\n */\n label() {\n return this._fieldSpec.label ?? this._fieldSpec.name\n }\n\n /**\n * Given an entity, returns the value of the field matching the\n * SPEntityFieldSpec<> in fieldSpec.\n * @param entity TEntity instance which will be evaluated for\n * SPEntityFieldSpec<>.\n * @returns\n */\n value(entity: TEntity) {\n let val = undefined;\n if (!this._fieldSpec.valueFn) {\n if (\n this.fieldConfig &&\n this.fieldConfig?.fieldValueFns &&\n this.fieldConfig.fieldValueFns.has(this._fieldSpec.name)\n ) {\n val = this.fieldConfig.fieldValueFns.get(this._fieldSpec.name)!(entity, this._fieldSpec.name);\n } else {\n val = (entity as any)[this._fieldSpec.name];\n }\n } else {\n val = this._fieldSpec.valueFn(entity);\n }\n const valueOptions = this.options;\n if (val instanceof Date) {\n val = spFormatDate(val);\n } else if (\n typeof val === 'number' &&\n valueOptions?.isCurrency\n ) {\n val = spFormatCurrency(val, this._fieldSpec?.valueOptions?.currency);\n } else if (typeof val === 'boolean') {\n val = val ? '✔' : '✖';\n }\n return val;\n }\n\n /**\n * If specified, will be added to the CSS classes of the field's wrapper\n * element.\n */\n get class() {\n return this._fieldSpec?.valueOptions?.class ?? '';\n }\n\n hasRouterLink(entity: TEntity) {\n return !!this._fieldSpec?.valueOptions?.routerLink;\n }\n\n getRouterLink(entity: TEntity) {\n const rl = this._fieldSpec?.valueOptions?.routerLink;\n if (rl) {\n if (typeof rl == 'function') {\n return rl(entity);\n }\n return rl\n }\n return [];\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { SPEntityFieldSpec } from './entity-field';\n\n\nexport type FIELD_VALUE_FN = (entity: any, fieldName: string) => string|number|Date|boolean;\n\n/**\n * Global config for SPEntityField component.\n */\nexport interface SPEntityFieldConfig {\n /**\n * These are global field value functions.\n *\n * If a value function for a field is not explicitly specified, this map is\n * looked up with the field name. If an entry exists in this table, it will\n * be used to render the field's value.\n *\n * This is useful for formatting certain fields which tend to have the\n * same name across the app. For instance fields such as 'amount', 'total'\n * or 'balance'. Or 'date', 'timestamp', etc.\n */\n fieldValueFns?: Map<string, FIELD_VALUE_FN>;\n /**\n * Similar to above, but allows setting the options for certain fields\n * globally. As in the case of `fieldValueFns`, the per field specification,\n * if one exists, takes precedence over the global setting.\n */\n fieldValueOptions?: Map<string, SPEntityFieldSpec<any>['valueOptions']>;\n}\n\nexport const SP_ENTITY_FIELD_CONFIG = new InjectionToken<SPEntityFieldConfig>(\n 'SPEntityFieldConfig'\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AA8CA;;;AAGG;MACU,aAAa,CAAA;AAKf,IAAA,WAAA;AAJF,IAAA,UAAU;IAEjB,WACE,CAAA,IAAgD,EACzC,WAAiC,EAAA;QAAjC,IAAW,CAAA,WAAA,GAAX,WAAW;AAElB,QAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC5B,IAAI,CAAC,UAAU,GAAG;AAChB,gBAAA,IAAI,EAAE,IAAI;aACX;;aACI;AACL,YAAA,IAAI,CAAC,UAAU,GAAG,IAAI;;;AAI1B,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,UAAU;;AAGxB;;;;AAIG;AACH,IAAA,IAAI,OAAO,GAAA;QACT,IAAI,uBAAuB,GAA2C,EAAE;QACxE,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,EAAE,iBAAiB,IAAI,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AAC3H,YAAA,uBAAuB,GAAG,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;;QAExF,OAAO;AACL,YAAA,GAAG,uBAAuB;YAC1B,IAAI,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IAAA,IAAI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,IAAI,EAAE;;AAGnD,IAAA,aAAa,CAAC,MAAe,EAAA;QAC3B,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU;;AAGpD,IAAA,aAAa,CAAC,MAAe,EAAA;QAC3B,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU;QACpD,IAAI,EAAE,EAAE;AACN,YAAA,IAAI,OAAO,EAAE,IAAI,UAAU,EAAE;AAC3B,gBAAA,OAAO,EAAE,CAAC,MAAM,CAAC;;AAEnB,YAAA,OAAO,EAAE;;AAEX,QAAA,OAAO,EAAE;;AAEZ;;MCxHY,sBAAsB,GAAG,IAAI,cAAc,CACtD,qBAAqB;;AC/BvB;;AAEG;;;;"}
@@ -647,6 +647,9 @@ class SPMatEntityListComponent {
647
647
  }
648
648
  return of(field._fieldSpec.name);
649
649
  }
650
+ isAsync(val) {
651
+ return val instanceof Observable;
652
+ }
650
653
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatEntityListComponent, deps: [{ token: i1.HttpClient }, { token: i2.DomSanitizer }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
651
654
  /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", type: SPMatEntityListComponent, isStandalone: true, selector: "sp-mat-entity-list", inputs: { entityName: { classPropertyName: "entityName", publicName: "entityName", isSignal: true, isRequired: true, transformFunction: null }, entityNamePlural: { classPropertyName: "entityNamePlural", publicName: "entityNamePlural", isSignal: true, isRequired: false, transformFunction: null }, endpoint: { classPropertyName: "endpoint", publicName: "endpoint", isSignal: true, isRequired: false, transformFunction: null }, entityLoaderFn: { classPropertyName: "entityLoaderFn", publicName: "entityLoaderFn", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, displayedColumns: { classPropertyName: "displayedColumns", publicName: "displayedColumns", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, idKey: { classPropertyName: "idKey", publicName: "idKey", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, paginator: { classPropertyName: "paginator", publicName: "paginator", isSignal: true, isRequired: false, transformFunction: null }, sorter: { classPropertyName: "sorter", publicName: "sorter", isSignal: true, isRequired: false, transformFunction: null }, disableSort: { classPropertyName: "disableSort", publicName: "disableSort", isSignal: true, isRequired: false, transformFunction: null }, infiniteScrollContainer: { classPropertyName: "infiniteScrollContainer", publicName: "infiniteScrollContainer", isSignal: true, isRequired: false, transformFunction: null }, infiniteScrollDistance: { classPropertyName: "infiniteScrollDistance", publicName: "infiniteScrollDistance", isSignal: true, isRequired: false, transformFunction: null }, infiniteScrollThrottle: { classPropertyName: "infiniteScrollThrottle", publicName: "infiniteScrollThrottle", isSignal: true, isRequired: false, transformFunction: null }, infiniteScrollWindow: { classPropertyName: "infiniteScrollWindow", publicName: "infiniteScrollWindow", isSignal: true, isRequired: false, transformFunction: null }, httpReqContext: { classPropertyName: "httpReqContext", publicName: "httpReqContext", isSignal: true, isRequired: false, transformFunction: null }, deferViewInit: { classPropertyName: "deferViewInit", publicName: "deferViewInit", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectEntity: "selectEntity" }, queries: [{ propertyName: "clientColumnDefs", predicate: MatColumnDef }], viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true, isSignal: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "viewColumnDefs", predicate: MatColumnDef, descendants: true, isSignal: true }], ngImport: i0, template: `
652
655
  <div
@@ -708,7 +711,7 @@ class SPMatEntityListComponent {
708
711
  mat-header-cell
709
712
  *matHeaderCellDef
710
713
  >
711
- {{ getColumnLabel(column) | async }}
714
+ {{ getColumnLabel(column) | async }}
712
715
  </th>
713
716
  } @else {
714
717
  <th
@@ -718,7 +721,7 @@ class SPMatEntityListComponent {
718
721
  mat-sort-header
719
722
  *matHeaderCellDef
720
723
  >
721
- {{ getColumnLabel(column) | async }}
724
+ {{ getColumnLabel(column) | async }}
722
725
  </th>
723
726
  }
724
727
  <td
@@ -732,8 +735,8 @@ class SPMatEntityListComponent {
732
735
  <a [routerLink]="column.getRouterLink(element)">
733
736
  <span [innerHTML]="column.value(element)"></span>
734
737
  </a>
735
- } @else {
736
- <span [innerHTML]="column.value(element)"></span>
738
+ } @else { @let val = column.value(element);
739
+ <span [innerHTML]="isAsync(val) ? (val | async) : val"></span>
737
740
  }
738
741
  </td>
739
742
  </ng-container>
@@ -819,7 +822,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
819
822
  mat-header-cell
820
823
  *matHeaderCellDef
821
824
  >
822
- {{ getColumnLabel(column) | async }}
825
+ {{ getColumnLabel(column) | async }}
823
826
  </th>
824
827
  } @else {
825
828
  <th
@@ -829,7 +832,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
829
832
  mat-sort-header
830
833
  *matHeaderCellDef
831
834
  >
832
- {{ getColumnLabel(column) | async }}
835
+ {{ getColumnLabel(column) | async }}
833
836
  </th>
834
837
  }
835
838
  <td
@@ -843,8 +846,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
843
846
  <a [routerLink]="column.getRouterLink(element)">
844
847
  <span [innerHTML]="column.value(element)"></span>
845
848
  </a>
846
- } @else {
847
- <span [innerHTML]="column.value(element)"></span>
849
+ } @else { @let val = column.value(element);
850
+ <span [innerHTML]="isAsync(val) ? (val | async) : val"></span>
848
851
  }
849
852
  </td>
850
853
  </ng-container>
@@ -1 +1 @@
1
- {"version":3,"file":"smallpearl-ngx-helper-mat-entity-list.mjs","sources":["../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/mat-entity-list-types.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/providers.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/config.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/mat-entity-list.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/smallpearl-ngx-helper-mat-entity-list.ts"],"sourcesContent":["import { HttpContextToken } from \"@angular/common/http\";\nimport { Observable } from \"rxjs\";\n\nexport interface SPMatEntityListHttpContext {\n entityName: string;\n entityNamePlural: string;\n endpoint: string;\n}\n\nexport const SP_MAT_ENTITY_LIST_HTTP_CONTEXT =\n new HttpContextToken<SPMatEntityListHttpContext>(() => ({\n entityName: '',\n entityNamePlural: '',\n endpoint: '',\n }));\n\n/**\n * Pagination HTTP request params. Actually copied from Angular's HttpParams\n * declaration. The ReadonlyArray<string|number|boolean> is a bit of an\n * overkill for pagination params, but what the heck. When you copy-paste,\n * do it in full!\n */\nexport type SPPageParams = { [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>; }\n\n/**\n * An interface that the clients should provide, either via a global config\n * (see above), that handles parsing the GET response and returns the entities\n * stored therein. This class will allow the entity-list component to be\n * used across different pagination response types as long as the appropriate\n * SPMatEntityListPaginator class is provided to the component.\n */\nexport interface SPMatEntityListPaginator {\n getRequestPageParams: (endpoint: string, pageIndex: number, pageSize: number) => SPPageParams;\n parseRequestResponse: <\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n >(\n entityName: string,\n entityNamePlural: string,\n endpoint: string,\n params: SPPageParams,\n resp: any\n ) => { total: number; entities: TEntity[] };\n}\n\n/**\n * 'entity' is really TEntity arg of SPMatEntityListComponent<TEntity>.\n * 'column' is the column name. This allows the same value function to support\n * multiple columns further enabing DRY.\n */\nexport type COLUMN_VALUE_FN = (entity: any, column: string) => string|number|Date|boolean;\n\n/**\n * Global config for SPMatEntityList component.\n */\nexport interface SPMatEntityListConfig {\n urlResolver?: (endpoint: string) => string;\n paginator?: SPMatEntityListPaginator;\n defaultPageSize?: number;\n pageSizes?: Array<number>;\n /**\n * Provide a method to return the labels for the columns. This is useful when\n * the columns are specified as the JSON object key names and the labels are\n * to be transformed into a uniform manner (uppercase) or when the labels\n * are to be dynamically localized. Note that the response can be an\n * Observable<string> if the label is to be fetched/changed asynchronously\n * (as that can happen in an app that supports dynamic changing of the UI\n * language).\n * @param entityName\n * @param columnName\n * @returns\n */\n columnLabelFn?: (entityName: string, columnName: string) => string | Observable<string>;\n}\n\n/**\n * Type for custom entities loader function, which if provided will be called\n * instead of HttpClient.get.\n */\nexport type SPMatEntityListEntityLoaderFn = (params: any) => Observable<any>;\n","import { InjectionToken } from '@angular/core';\nimport { SPMatEntityListConfig } from './mat-entity-list-types';\n\nexport const SP_MAT_ENTITY_LIST_CONFIG = new InjectionToken<SPMatEntityListConfig>(\n 'SPMatEntityListConfig'\n);\n","import { inject } from '@angular/core';\nimport { SPMatEntityListConfig } from './mat-entity-list-types';\nimport { SP_MAT_ENTITY_LIST_CONFIG } from './providers';\n\nexport const DefaultSPMatEntityListConfig: SPMatEntityListConfig = {\n urlResolver: (endpoint: string) => endpoint,\n paginator: undefined,\n defaultPageSize: 50,\n pageSizes: [10, 25, 50, 100],\n columnLabelFn: (entityName: string, columnName: string) => columnName,\n};\n\n/**\n * To be called from an object's constructor.\n */\nexport function getEntityListConfig(): SPMatEntityListConfig {\n const entityListConfig = inject(SP_MAT_ENTITY_LIST_CONFIG, {\n optional: true,\n });\n return {\n ...DefaultSPMatEntityListConfig,\n ...(entityListConfig ?? {}),\n };\n}\n","import { CommonModule } from '@angular/common';\nimport { HttpClient, HttpContext, HttpContextToken, HttpParams } from '@angular/common/http';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n ContentChildren,\n Directive,\n effect,\n ElementRef,\n EventEmitter,\n inject,\n Injector,\n input,\n OnDestroy,\n OnInit,\n Output,\n QueryList,\n runInInjectionContext,\n signal,\n viewChild,\n viewChildren\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatPaginatorModule, PageEvent } from '@angular/material/paginator';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatSort, MatSortModule } from '@angular/material/sort';\nimport {\n MatColumnDef,\n MatTable,\n MatTableDataSource,\n MatTableModule,\n} from '@angular/material/table';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { RouterModule } from '@angular/router';\nimport { createStore } from '@ngneat/elf';\nimport {\n addEntities,\n deleteEntities,\n getEntitiesCount,\n hasEntity,\n selectAllEntities,\n updateEntities,\n upsertEntities,\n withEntities,\n} from '@ngneat/elf-entities';\nimport {\n SP_ENTITY_FIELD_CONFIG,\n SPEntityField,\n SPEntityFieldSpec\n} from '@smallpearl/ngx-helper/entity-field';\nimport { InfiniteScrollDirective } from 'ngx-infinite-scroll';\nimport { plural } from 'pluralize';\nimport {\n distinctUntilChanged,\n filter,\n finalize,\n Observable,\n of,\n Subject,\n Subscription,\n switchMap,\n takeUntil,\n tap\n} from 'rxjs';\nimport { getEntityListConfig } from './config';\nimport {\n SP_MAT_ENTITY_LIST_HTTP_CONTEXT,\n SPMatEntityListEntityLoaderFn,\n SPMatEntityListPaginator\n} from './mat-entity-list-types';\n\n@Directive({\n selector: '[headerAlignment]',\n standalone: true\n})\nexport class HeaderAlignmentDirective implements AfterViewInit {\n\n headerAlignment = input<string>();\n\n constructor(private el: ElementRef) {\n // this.el.nativeElement.style.backgroundColor = 'yellow';\n }\n\n ngAfterViewInit(): void {\n if (this.headerAlignment()) {\n const sortHeader = this.el.nativeElement.querySelector('.mat-sort-header-container');\n if (sortHeader) {\n sortHeader.style.justifyContent = this.headerAlignment();\n } else {\n this.el.nativeElement.style.justifyContent = this.headerAlignment();\n }\n }\n }\n}\n\n/**\n * Represents a request to load entities from the remote. This is used to\n * compare two requests to determine if they are equal. This is useful to\n * prevent duplicate requests being sent to the remote.\n */\nclass LoadRequest {\n constructor(\n public endpoint: string,\n public params: HttpParams,\n public force = false\n ) {}\n\n // Returns true if two LoadRequest objects are equal and this object's\n // 'force' is not set to true.\n isEqualToAndNotForced(prev: LoadRequest): boolean {\n // console.log(\n // `isEqualToAndNotForced - ${this.endpoint}, ${this.params.toString()} ${\n // this.force\n // }, other: ${prev.endpoint}, ${prev.params.toString()}, ${prev.force}`\n // );\n return this.force\n ? false\n : this.endpoint.localeCompare(prev.endpoint) === 0 &&\n this.params.toString().localeCompare(prev.params.toString()) === 0;\n }\n}\n\n/**\n * A component to display a list of entities loaded from remote.\n */\n@Component({\n imports: [\n CommonModule,\n RouterModule,\n MatTableModule,\n MatSortModule,\n MatPaginatorModule,\n MatButtonModule,\n MatInputModule,\n MatProgressSpinnerModule,\n InfiniteScrollDirective,\n HeaderAlignmentDirective,\n ],\n selector: 'sp-mat-entity-list',\n template: `\n <div\n class=\"entities-list-wrapper\"\n infiniteScroll\n [infiniteScrollDistance]=\"infiniteScrollDistance()\"\n [infiniteScrollThrottle]=\"infiniteScrollThrottle()\"\n [infiniteScrollContainer]=\"infiniteScrollContainer()\"\n [scrollWindow]=\"infiniteScrollWindow()\"\n [infiniteScrollDisabled]=\"\n pagination() !== 'infinite' || !_paginator || !hasMore()\n \"\n (scrolled)=\"infiniteScrollLoadNextPage($event)\"\n >\n <div\n class=\"busy-overlay\"\n [ngClass]=\"{ show: pagination() === 'discrete' && loading() }\"\n >\n <ng-container *ngTemplateOutlet=\"busySpinner\"></ng-container>\n </div>\n <table mat-table [dataSource]=\"dataSource()\">\n <tr mat-header-row *matHeaderRowDef=\"_displayedColumns()\"></tr>\n <tr\n mat-row\n [class.active-row]=\"activeEntityId() === row[this.idKey()]\"\n *matRowDef=\"let row; columns: _displayedColumns()\"\n (click)=\"toggleActiveEntity(row)\"\n ></tr>\n </table>\n @if (pagination() == 'discrete' && _paginator) {\n <mat-paginator\n showFirstLastButtons\n [length]=\"entityCount()\"\n [pageSize]=\"_pageSize()\"\n [pageIndex]=\"pageIndex()\"\n [pageSizeOptions]=\"[]\"\n [hidePageSize]=\"true\"\n (page)=\"handlePageEvent($event)\"\n [disabled]=\"loading()\"\n aria-label=\"Select page\"\n ></mat-paginator>\n }\n <div\n class=\"infinite-scroll-loading\"\n [ngClass]=\"{ show: pagination() === 'infinite' && loading() }\"\n >\n <ng-container *ngTemplateOutlet=\"busySpinner\"></ng-container>\n </div>\n </div>\n <!-- We keep the column definitions outside the <table> so that they can\n be dynamically added to the MatTable. -->\n <span matSort=\"sorter()\">\n @for (column of __columns(); track $index) {\n <ng-container [matColumnDef]=\"column.spec.name\">\n @if (disableSort()) {\n <th\n [class]=\"column.class\"\n [headerAlignment]=\"column.options.alignment\"\n mat-header-cell\n *matHeaderCellDef\n >\n {{ getColumnLabel(column) | async }}\n </th>\n } @else {\n <th\n [class]=\"column.class\"\n [headerAlignment]=\"column.options.alignment\"\n mat-header-cell\n mat-sort-header\n *matHeaderCellDef\n >\n {{ getColumnLabel(column) | async }}\n </th>\n }\n <td\n [class]=\"column.class\"\n [style.text-align]=\"column.options.alignment\"\n mat-cell\n *matCellDef=\"let element\"\n [routerLink]=\"column.getRouterLink(element)\"\n >\n @if (column.hasRouterLink(element)) {\n <a [routerLink]=\"column.getRouterLink(element)\">\n <span [innerHTML]=\"column.value(element)\"></span>\n </a>\n } @else {\n <span [innerHTML]=\"column.value(element)\"></span>\n }\n </td>\n </ng-container>\n }\n </span>\n <ng-template #busySpinner>\n <div class=\"busy-spinner\">\n <mat-spinner mode=\"indeterminate\" diameter=\"28\"></mat-spinner>\n </div>\n </ng-template>\n `,\n styles: [\n `\n .entities-list-wrapper {\n position: relative;\n }\n .busy-overlay {\n display: none;\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0px;\n left: 0px;\n z-index: 1000;\n opacity: 0.6;\n background-color: transparent;\n }\n .show {\n display: block;\n }\n .busy-spinner {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .infinite-scroll-loading {\n display: none;\n width: 100%;\n padding: 8px;\n }\n .active-row {\n font-weight: bold;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SPMatEntityListComponent<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> implements OnInit, OnDestroy, AfterViewInit\n{\n /* CLIENT PROVIDED PARAMETERS */\n entityName = input.required<string>();\n entityNamePlural = input<string>();\n\n /**\n * The endpoint from where the entities are to be retrieved\n */\n endpoint = input<string>('');\n /**\n * Custom entities loader function, which if provided will be called\n * instead of HttpClient.get.\n */\n entityLoaderFn = input<SPMatEntityListEntityLoaderFn | undefined>(undefined);\n /**\n * The columns of the entity to be displayed. This is an array of\n * SPEntityFieldSpec objects. If there's a one-to-one mapping between the\n * column's field name, its title & the rendered value, a string can be\n * specified instead. That is, the value of this property is a heterogeneous\n * array consisting of SPEntityFieldSpec<> objects and strings.\n */\n columns = input<Array<SPEntityFieldSpec<TEntity, IdKey> | string>>([]);\n\n /**\n * Names of columns that are displayed. This will default to all the columns\n * listed in columns.\n */\n displayedColumns = input<string[]>([]); // ['name', 'cell', 'gender'];\n\n /**\n * Number of entities per page. If this is not set and paginator is defined,\n * the number of entities int in the first request, will be taken as the\n * page size.\n */\n pageSize = input<number>(0);\n /**\n * Entity idKey, if idKey is different from the default 'id'.\n */\n idKey = input<string>('id');\n /**\n * Type of pagination -- continuous or discrete. 'infinite' pagination\n * uses an 'infiniteScroll' and 'discrete' pagination uses a mat-paginator\n * at the bottom to navigate between pages.\n */\n pagination = input<'infinite' | 'discrete' | 'none'>('discrete');\n /**\n * Component specific paginator. Only used if pagination != 'none'.\n */\n paginator = input<SPMatEntityListPaginator>();\n /**\n *\n */\n sorter = input<MatSort>();\n /**\n * Disable sorting of rows\n */\n disableSort = input<boolean>(false);\n /**\n * Wrappers for infiniteScroll properties, for customization by the client\n */\n infiniteScrollContainer = input<any>('');\n infiniteScrollDistance = input<number>(1);\n infiniteScrollThrottle = input<number>(400);\n infiniteScrollWindow = input<boolean>(false);\n /**\n * Custom context to be set for HttpClient requests. In the client code\n * specify this property by initializing a member variable as:\n\n ```\n Component({\n ...\n template: `\n <sp-mat-entity-list\n [httpReqContext]=\"httpReqContext\"\n ></sp-mat-entity-list>\n `\n })\n export class YourComponent {\n httpReqContext: [HttpContextToken<any>, any] = [\n SIDELOAD_TO_COMPOSITE_PARAMS, 'customers'\n ];\n }\n ```\n *\n * Of course if you want to pass multiple context properties, declare the type\n * as an array of array. That is, `[[HttpContextToken<any>, any]]` and\n * initialize it appropriately.\n */\n httpReqContext = input<\n [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]\n >();\n /* END CLIENT PROVIDED PARAMETERS */\n\n // *** INTERNAL *** //\n _entityNamePlural = computed(() =>\n this.entityNamePlural()\n ? this.entityNamePlural()\n : plural(this.entityName())\n );\n\n _httpReqContext = computed(() => {\n let reqContext = this.httpReqContext();\n const context = new HttpContext();\n if (reqContext && Array.isArray(reqContext)) {\n if (reqContext.length == 2 && !Array.isArray(reqContext[0])) {\n // one dimensional array of a key, value pair.\n context.set(reqContext[0], reqContext[1]);\n } else {\n reqContext.forEach(([k, v]) => context.set(k, v));\n }\n }\n context.set(SP_MAT_ENTITY_LIST_HTTP_CONTEXT, {\n entityName: this.entityName(),\n entityNamePlural: this._entityNamePlural(),\n endpoint: this.endpoint(),\n });\n return context;\n });\n deferViewInit = input<boolean>(false);\n firstLoadDone = false;\n allColumnNames = signal<string[]>([]);\n _displayedColumns = computed(() =>\n this.displayedColumns().length > 0\n ? this.displayedColumns().filter(\n (colName) =>\n this.allColumnNames().find((name) => name === colName) !== undefined\n )\n : this.allColumnNames()\n );\n dataSource = signal<MatTableDataSource<TEntity>>(\n new MatTableDataSource<TEntity>()\n );\n\n table = viewChild(MatTable);\n sort = viewChild(MatSort);\n // These are our own <ng-container matColumnDef></ng-container>\n // which we create for each column that we create by the declaration:\n // <ng-container *ngFor=\"let column of columns()\" [matColumnDef]=\"column.name\">\n viewColumnDefs = viewChildren(MatColumnDef);\n // These are the <ng-container matColumnDef></ng-container> placed\n // inside <sp-mat-entity-list></<sp-mat-entity-list> by the client to override\n // the default <ng-container matColumnDef> created by the component.\n @ContentChildren(MatColumnDef) clientColumnDefs!: QueryList<MatColumnDef>;\n\n contentColumnDefs: MatColumnDef[] = [];\n\n subs$ = new Subscription();\n destroy$ = new Subject<void>();\n\n // Pagination state\n entityCount = signal<number>(0);\n pageIndex = signal<number>(0);\n\n // Mechanism to default pageSize to last entities length.\n lastFetchedEntitiesCount = signal<number>(0);\n _pageSize = computed<number>(() =>\n this.pageSize()\n ? this.pageSize()\n : this.entityListConfig.defaultPageSize ?? this.lastFetchedEntitiesCount()\n );\n // Effective columns, derived from columns(), which can either be an array\n // of objects of array of strings.\n _columns = computed<SPEntityFieldSpec<TEntity, IdKey>[]>(() => {\n const columns = this.columns();\n let fields: SPEntityField<TEntity, IdKey>[] = [];\n let cols: SPEntityFieldSpec<TEntity, IdKey>[] = [];\n columns.forEach((colDef) => {\n // fields.push(new SPEntityField(colDef))\n if (typeof colDef === 'string') {\n cols.push({ name: String(colDef) });\n } else if (typeof colDef === 'object') {\n cols.push(colDef as SPEntityFieldSpec<TEntity, IdKey>);\n }\n });\n return cols;\n });\n\n __columns = computed<SPEntityField<TEntity, IdKey>[]>(() =>\n this.columns().map(\n (colDef) => new SPEntityField<TEntity, IdKey>(colDef, this.fieldConfig)\n )\n );\n\n // We isolate retrieving items from the remote and providing the items\n // to the component into two distinct operations. The retrieval operation\n // retrieves data asynchronously and then stores the data in a local store.\n // The UI would be 'listening' to a reactive callback that would be triggered\n // whenever items in the store changes. This is because store is an immutable\n // data structure and any changes (addition/deletion) to it would result in\n // the entire store being replaced with a copy with the changes applied.\n\n // Ideally we should declare this as\n // store!: Store<...>. But @ngneat/elf does not provide a generic type\n // for Store<...>, which can be composed from its type arguments. Instead it\n // uses type composition using its arguments to generate store's type\n // implicitly. So we use the same mechanism to enforce type safety in our\n // code. The code below results in a type declaration for store that is\n // dependent on the components generic arguments. (Making use of TypeScript's\n // type deduction system from variable assignment). Later on in the\n // constructor we reassign this.store with a new object that uses the\n // client provided idKey() value as the identifying key for each entity in\n // the sore.\n store = createStore(\n { name: Math.random().toString(36).slice(2) },\n withEntities<TEntity, IdKey>({ idKey: this.idKey() as IdKey })\n );\n // We'll initialize this in ngOnInit() when 'store' is initialized with the\n // correct TEntity store that can be safely indexed using IdKey.\n entities$!: Observable<TEntity[]>;\n // Effective paginator, coalescing local paginator and paginator from global\n // config.\n _paginator!: SPMatEntityListPaginator | undefined;\n // We will toggle this during every entity load.\n loading = signal<boolean>(false);\n // We will update this after every load and pagination() == 'infinite'\n hasMore = signal<boolean>(true);\n\n activeEntity = signal<TEntity | undefined>(undefined);\n activeEntityId = computed(() =>\n this.activeEntity() ? (this.activeEntity() as any)[this.idKey()] : undefined\n );\n _prevActiveEntity!: TEntity | undefined;\n _activeEntityChange = effect(() => {\n runInInjectionContext(this.injector, () => {\n const activeEntity = this.activeEntity();\n // Though we can raise the selectEntity event directly from effect handler,\n // that would prevent the event handler from being able to update any\n // signals from inside it. So we generate the event asyncronously.\n // Also, this effect handler will be invoked for the initial 'undefined'\n // during which we shouldn't emit the selectEntity event. Therefore we\n // keep another state variable to filter out this state.\n if (activeEntity || this._prevActiveEntity) {\n setTimeout(() => {\n this._prevActiveEntity = activeEntity;\n this.selectEntity.emit(activeEntity);\n // if (this._prevActiveEntity && !activeEntity) {\n // this.selectEntity.emit(activeEntity);\n // } else if (activeEntity) {\n // this.selectEntity.emit(activeEntity);\n // }\n });\n }\n });\n });\n @Output() selectEntity = new EventEmitter<TEntity | undefined>();\n\n fieldConfig = inject(SP_ENTITY_FIELD_CONFIG, { optional: true })!;\n entityListConfig = getEntityListConfig();\n\n /**\n * A signal that can be used to trigger loading of more entities from the\n * remote. This can be visualized as the event loop of the entity list\n * component.\n */\n loadRequest$ = new Subject<LoadRequest>();\n\n endpointChanged = effect(() => {\n runInInjectionContext(this.injector, () => {\n if (this.endpoint()) {\n // console.log(`endpointChanged - ${this.endpoint()}`);\n setTimeout(() => {\n this.refresh();\n });\n }\n });\n });\n\n constructor(\n protected http: HttpClient,\n private sanitizer: DomSanitizer,\n private injector: Injector\n ) {}\n\n ngOnInit() {\n // This is the reactive callback that listens for changes to table entities\n // which are reflected in the mat-table.\n this.store = createStore(\n { name: Math.random().toString(36).slice(2) },\n withEntities<TEntity, IdKey>({ idKey: this.idKey() as IdKey })\n );\n this.entities$ = this.store.pipe(selectAllEntities());\n this._paginator = this.paginator()\n ? this.paginator()\n : this.entityListConfig?.paginator;\n\n this.entities$\n .pipe(\n takeUntil(this.destroy$),\n tap((entities) => {\n // .data is a setter property, which ought to trigger the necessary\n // signals resulting in mat-table picking up the changes without\n // requiring us to call cdr.detectChanges() explicitly.\n this.dataSource().data = entities;\n })\n )\n .subscribe();\n\n this.loadRequest$\n .pipe(\n takeUntil(this.destroy$),\n filter((lr) => lr.endpoint !== '' || lr.force === true),\n distinctUntilChanged((prev, current) =>\n current.isEqualToAndNotForced(prev)\n ),\n switchMap((lr: LoadRequest) => this.doActualLoad(lr))\n )\n .subscribe();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n ngAfterViewInit(): void {\n if (!this.deferViewInit()) {\n this.buildContentColumnDefs();\n this.buildColumns();\n this.setupSort();\n this.loadMoreEntities();\n }\n }\n\n /**\n * Clear all entities in store and reload them from endpoint as if\n * the entities are being loaded for the first time.\n */\n refresh(force = false) {\n this.pageIndex.set(0);\n this.loadMoreEntities(force);\n }\n\n addEntity(entity: TEntity) {\n const pagination = this.pagination();\n const count = this.store.query(getEntitiesCount());\n if (\n pagination === 'infinite' ||\n pagination === 'none' ||\n count < this._pageSize()\n ) {\n this.store.update(addEntities(entity));\n } else {\n // 'discrete' pagination, refresh the crud items from the beginning.\n // Let component client set the behavior using a property\n // this.pageIndex.set(0);\n // this.loadMoreEntities();\n }\n }\n\n /**\n * Update an entity with a modified version. Can be used by CRUD UPDATE\n * operation to update an entity in the local store that is used to as the\n * source of MatTableDataSource.\n * @param id\n * @param entity\n */\n updateEntity(id: TEntity[IdKey], entity: TEntity) {\n if (this.store.query(hasEntity(id))) {\n this.store.update(updateEntities(id, entity));\n }\n }\n\n /**\n * Clients can call this method when it has deleted and entity via a CRUD\n * operation. Depending on the pagination mode, MatEntityList implements\n * an appropriate behavior.\n *\n * If the pagination is 'infinite', the relevent entity is removed from our\n * entity list. View will be repained as data store has changed.\n *\n * If the pagination is 'discrete', the entity is removed from the page.\n * If this is the only entity in the page, the current pageNumber is\n * decremented by 1 if it's possible (if the current pageNumber > 1).\n * The page is reloaded from remote.\n */\n removeEntity(id: TEntity[IdKey]) {\n const paginator = this._paginator;\n if (paginator) {\n if (this.pagination() === 'infinite') {\n // This will cause store to mutate which will trigger this.entity$ to\n // emit which in turn will update our MatTableDataSource instance.\n this.store.update(deleteEntities(id));\n } else {\n // Logic\n this.store.update(deleteEntities(id));\n const count = this.store.query(getEntitiesCount());\n if (count == 0) {\n // No more entities in this page\n // Go back one page\n if (this.pageIndex() > 0) {\n this.pageIndex.set(this.pageIndex() - 1);\n }\n }\n // load the page again\n this.loadMoreEntities();\n }\n } else {\n // Just remove the entity that has been deleted.\n this.store.update(deleteEntities(id));\n }\n }\n\n /**\n * Build the contentColumnDefs array by enumerating all of client's projected\n * content with matColumnDef directive.\n */\n buildContentColumnDefs() {\n const clientColumnDefs = this.clientColumnDefs;\n if (clientColumnDefs) {\n this.contentColumnDefs = clientColumnDefs.toArray();\n }\n }\n\n /**\n * Build the effective columns by parsing our own <ng-container matColumnDef>\n * statements for each column in columns() property and client's\n * <ng-container matColumnDef> provided via content projection.\n */\n buildColumns() {\n const matTable = this.table();\n\n if (matTable) {\n const columnNames = new Set<string>();\n const columnDefs: MatColumnDef[] = [];\n\n this._columns().forEach((colDef) => {\n if (!columnNames.has(colDef.name)) {\n const matColDef = this.viewColumnDefs().find(\n (cd) => cd.name === colDef.name\n );\n const clientColDef = this.contentColumnDefs.find(\n (cd) => cd.name === colDef.name\n );\n const columnDef = clientColDef ? clientColDef : matColDef;\n if (columnDef) {\n columnDefs.push(columnDef);\n columnNames.add(colDef.name);\n }\n }\n });\n columnDefs.forEach((cd) => {\n matTable.addColumnDef(cd);\n });\n\n this.allColumnNames.set(Array.from(columnNames));\n // this.displayedColumns.set(Array.from(columnNames) as string[]);\n }\n }\n\n setupSort() {\n const matSort = this.sort();\n if (matSort) {\n this.dataSource().sort = matSort;\n }\n }\n\n infiniteScrollLoadNextPage(ev: any) {\n // console.log(`infiniteScrollLoadNextPage - ${JSON.stringify(ev)}`);\n if (this._paginator) {\n this.loadMoreEntities();\n }\n }\n\n loadMoreEntities(forceRefresh = false) {\n this.loadRequest$.next(this.createNextLoadRequest(forceRefresh));\n }\n\n /**\n * Creates a LoadRequest object for loading entities using the current state\n * of the component. Therefore, if the request is for next page of entities,\n * the LoadRequest object will have the updated page index. However, if\n * pagination has been reset (refer to refresh()), the LoadRequest object\n * will be for the first page of data. Note that when 'endpoint' value\n * changes, the component's pagination state is reset causing a refresh()\n * to be called, which in turn will create a new LoadRequest object for the\n * first page of data.\n * @returns LoadRequest object for the next load request.\n */\n private createNextLoadRequest(forceRefresh: boolean): LoadRequest {\n let pageParams = {};\n const parts = this.endpoint().split('?');\n const endpoint = parts[0];\n if (this._paginator) {\n pageParams = this._paginator.getRequestPageParams(\n endpoint,\n this.pageIndex(),\n this.pageSize()\n );\n }\n let httpParams = new HttpParams();\n for (const key in pageParams) {\n httpParams = httpParams.append(key, (pageParams as any)[key]);\n }\n if (parts.length > 1) {\n const embeddedParams = new HttpParams({ fromString: parts[1] });\n embeddedParams.keys().forEach((key) => {\n const value = embeddedParams.getAll(key);\n (value || []).forEach((v) => {\n httpParams = httpParams.append(key, v);\n });\n });\n }\n return new LoadRequest(\n endpoint,\n httpParams,\n forceRefresh || !!this.entityLoaderFn()\n );\n }\n\n /**\n * Does the actual load of entities from the remote or via calling the\n * entityLoaderFn. This method is the workhorse of the entity list\n * 'loader-loop'.\n * @param lr\n * @returns Observable that emits the response from the remote or from\n * entityLoaderFn().\n */\n private doActualLoad(lr: LoadRequest) {\n // console.log(`doActualLoad - endpoint: ${lr.endpoint}, params: ${lr.params.toString()}`);\n const loaderFn = this.entityLoaderFn();\n const params = lr.params;\n const obs =\n loaderFn !== undefined\n ? loaderFn({ params })\n : this.http.get<any>(this.getUrl(lr.endpoint), {\n context: this._httpReqContext(),\n params,\n });\n\n this.loading.set(true);\n return obs.pipe(\n tap((resp) => {\n // TODO: defer this to a pagination provider so that we can support\n // many types of pagination. DRF itself has different schemes. And\n // express may have yet another pagination protocol.\n this.firstLoadDone = true;\n if (this._paginator) {\n // Convert HttpParams to JS object\n const paramsObj: any = {};\n params.keys().forEach((key) => {\n paramsObj[key] = params.get(key);\n });\n const { entities, total } = this._paginator.parseRequestResponse(\n this.entityName(),\n this._entityNamePlural()!,\n this.endpoint(),\n paramsObj,\n resp\n );\n this.entityCount.set(total);\n this.lastFetchedEntitiesCount.set(entities.length);\n // this.pageIndex.set(this.pageIndex() + 1)\n // entities = this._paginator.getEntitiesFromResponse(entities);\n if (this.pagination() === 'discrete') {\n this.store.reset();\n } else if (this.pagination() === 'infinite') {\n const pageSize = this._pageSize();\n const entityCount = this.entityCount();\n if (pageSize > 0) {\n const pageCount =\n Math.floor(entityCount / pageSize) +\n (entityCount % pageSize ? 1 : 0);\n this.hasMore.set(this.pageIndex() === pageCount);\n } else {\n this.hasMore.set(false);\n }\n }\n // store the entities in the store\n // TODO: remove as any\n this.store.update(upsertEntities(entities as any));\n } else {\n this.store.update(\n upsertEntities(this.findArrayInResult(resp) as TEntity[])\n );\n }\n }),\n finalize(() => this.loading.set(false))\n );\n }\n\n private findArrayInResult(res: any): any[] | undefined {\n if (Array.isArray(res)) {\n return res;\n }\n for (const key in res) {\n if (Object.prototype.hasOwnProperty.call(res, key)) {\n const element = res[key];\n if (Array.isArray(element)) {\n return element;\n }\n }\n }\n return [];\n }\n\n handlePageEvent(e: PageEvent) {\n this.pageIndex.set(e.pageIndex);\n this.loadMoreEntities();\n }\n\n getUrl(endpoint: string) {\n return this.entityListConfig?.urlResolver\n ? this.entityListConfig?.urlResolver(endpoint)\n : endpoint;\n }\n\n toggleActiveEntity(entity: TEntity | undefined) {\n if (entity) {\n if (entity === this.activeEntity()) {\n this.activeEntity.set(undefined);\n } else {\n this.activeEntity.set(entity);\n }\n } else {\n this.activeEntity.set(undefined);\n }\n }\n\n getColumnLabel(field: SPEntityField<TEntity, IdKey>): Observable<string> {\n if (field._fieldSpec.label) {\n return of(field._fieldSpec.label);\n }\n if (this.entityListConfig && this.entityListConfig.columnLabelFn) {\n const label = this.entityListConfig.columnLabelFn(\n this.entityName(),\n field._fieldSpec.name\n );\n return label instanceof Observable ? label : of(label);\n }\n return of(field._fieldSpec.name);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AASa,MAAA,+BAA+B,GAC1C,IAAI,gBAAgB,CAA6B,OAAO;AACtD,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,QAAQ,EAAE,EAAE;AACb,CAAA,CAAC;;MCXS,yBAAyB,GAAG,IAAI,cAAc,CACzD,uBAAuB;;ACAlB,MAAM,4BAA4B,GAA0B;AACjE,IAAA,WAAW,EAAE,CAAC,QAAgB,KAAK,QAAQ;AAC3C,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;IAC5B,aAAa,EAAE,CAAC,UAAkB,EAAE,UAAkB,KAAK,UAAU;CACtE;AAED;;AAEG;SACa,mBAAmB,G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QAAA,EAAA,mCAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAAA,UAAA,EAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,uBAAuB,0WA5Dd,wBAAwB,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAuMxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBArJpC,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,OAAA,EAAA;wBACP,YAAY;wBACZ,YAAY;wBACZ,cAAc;wBACd,aAAa;wBACb,kBAAkB;wBAClB,eAAe;wBACf,cAAc;wBACd,wBAAwB;wBACxB,uBAAuB;wBACvB,wBAAwB;AACzB,qBAAA,EAAA,QAAA,EACS,oBAAoB,EACpB,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGT,EAqCgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,4XAAA,CAAA,EAAA;iIAoJhB,gBAAgB,EAAA,CAAA;sBAA9C,eAAe;uBAAC,YAAY;gBAsGnB,YAAY,EAAA,CAAA;sBAArB;;;AC7gBH;;AAEG;;;;"}
1
+ {"version":3,"file":"smallpearl-ngx-helper-mat-entity-list.mjs","sources":["../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/mat-entity-list-types.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/providers.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/config.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/mat-entity-list.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/smallpearl-ngx-helper-mat-entity-list.ts"],"sourcesContent":["import { HttpContextToken } from \"@angular/common/http\";\nimport { Observable } from \"rxjs\";\n\nexport interface SPMatEntityListHttpContext {\n entityName: string;\n entityNamePlural: string;\n endpoint: string;\n}\n\nexport const SP_MAT_ENTITY_LIST_HTTP_CONTEXT =\n new HttpContextToken<SPMatEntityListHttpContext>(() => ({\n entityName: '',\n entityNamePlural: '',\n endpoint: '',\n }));\n\n/**\n * Pagination HTTP request params. Actually copied from Angular's HttpParams\n * declaration. The ReadonlyArray<string|number|boolean> is a bit of an\n * overkill for pagination params, but what the heck. When you copy-paste,\n * do it in full!\n */\nexport type SPPageParams = { [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>; }\n\n/**\n * An interface that the clients should provide, either via a global config\n * (see above), that handles parsing the GET response and returns the entities\n * stored therein. This class will allow the entity-list component to be\n * used across different pagination response types as long as the appropriate\n * SPMatEntityListPaginator class is provided to the component.\n */\nexport interface SPMatEntityListPaginator {\n getRequestPageParams: (endpoint: string, pageIndex: number, pageSize: number) => SPPageParams;\n parseRequestResponse: <\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n >(\n entityName: string,\n entityNamePlural: string,\n endpoint: string,\n params: SPPageParams,\n resp: any\n ) => { total: number; entities: TEntity[] };\n}\n\n/**\n * 'entity' is really TEntity arg of SPMatEntityListComponent<TEntity>.\n * 'column' is the column name. This allows the same value function to support\n * multiple columns further enabing DRY.\n */\nexport type COLUMN_VALUE_FN = (entity: any, column: string) => string|number|Date|boolean;\n\n/**\n * Global config for SPMatEntityList component.\n */\nexport interface SPMatEntityListConfig {\n urlResolver?: (endpoint: string) => string;\n paginator?: SPMatEntityListPaginator;\n defaultPageSize?: number;\n pageSizes?: Array<number>;\n /**\n * Provide a method to return the labels for the columns. This is useful when\n * the columns are specified as the JSON object key names and the labels are\n * to be transformed into a uniform manner (uppercase) or when the labels\n * are to be dynamically localized. Note that the response can be an\n * Observable<string> if the label is to be fetched/changed asynchronously\n * (as that can happen in an app that supports dynamic changing of the UI\n * language).\n * @param entityName\n * @param columnName\n * @returns\n */\n columnLabelFn?: (entityName: string, columnName: string) => string | Observable<string>;\n}\n\n/**\n * Type for custom entities loader function, which if provided will be called\n * instead of HttpClient.get.\n */\nexport type SPMatEntityListEntityLoaderFn = (params: any) => Observable<any>;\n","import { InjectionToken } from '@angular/core';\nimport { SPMatEntityListConfig } from './mat-entity-list-types';\n\nexport const SP_MAT_ENTITY_LIST_CONFIG = new InjectionToken<SPMatEntityListConfig>(\n 'SPMatEntityListConfig'\n);\n","import { inject } from '@angular/core';\nimport { SPMatEntityListConfig } from './mat-entity-list-types';\nimport { SP_MAT_ENTITY_LIST_CONFIG } from './providers';\n\nexport const DefaultSPMatEntityListConfig: SPMatEntityListConfig = {\n urlResolver: (endpoint: string) => endpoint,\n paginator: undefined,\n defaultPageSize: 50,\n pageSizes: [10, 25, 50, 100],\n columnLabelFn: (entityName: string, columnName: string) => columnName,\n};\n\n/**\n * To be called from an object's constructor.\n */\nexport function getEntityListConfig(): SPMatEntityListConfig {\n const entityListConfig = inject(SP_MAT_ENTITY_LIST_CONFIG, {\n optional: true,\n });\n return {\n ...DefaultSPMatEntityListConfig,\n ...(entityListConfig ?? {}),\n };\n}\n","import { CommonModule } from '@angular/common';\nimport { HttpClient, HttpContext, HttpContextToken, HttpParams } from '@angular/common/http';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n ContentChildren,\n Directive,\n effect,\n ElementRef,\n EventEmitter,\n inject,\n Injector,\n input,\n OnDestroy,\n OnInit,\n Output,\n QueryList,\n runInInjectionContext,\n signal,\n viewChild,\n viewChildren\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatPaginatorModule, PageEvent } from '@angular/material/paginator';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatSort, MatSortModule } from '@angular/material/sort';\nimport {\n MatColumnDef,\n MatTable,\n MatTableDataSource,\n MatTableModule,\n} from '@angular/material/table';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { RouterModule } from '@angular/router';\nimport { createStore } from '@ngneat/elf';\nimport {\n addEntities,\n deleteEntities,\n getEntitiesCount,\n hasEntity,\n selectAllEntities,\n updateEntities,\n upsertEntities,\n withEntities,\n} from '@ngneat/elf-entities';\nimport {\n SP_ENTITY_FIELD_CONFIG,\n SPEntityField,\n SPEntityFieldSpec\n} from '@smallpearl/ngx-helper/entity-field';\nimport { InfiniteScrollDirective } from 'ngx-infinite-scroll';\nimport { plural } from 'pluralize';\nimport {\n distinctUntilChanged,\n filter,\n finalize,\n Observable,\n of,\n Subject,\n Subscription,\n switchMap,\n takeUntil,\n tap\n} from 'rxjs';\nimport { getEntityListConfig } from './config';\nimport {\n SP_MAT_ENTITY_LIST_HTTP_CONTEXT,\n SPMatEntityListEntityLoaderFn,\n SPMatEntityListPaginator\n} from './mat-entity-list-types';\n\n@Directive({\n selector: '[headerAlignment]',\n standalone: true\n})\nexport class HeaderAlignmentDirective implements AfterViewInit {\n\n headerAlignment = input<string>();\n\n constructor(private el: ElementRef) {\n // this.el.nativeElement.style.backgroundColor = 'yellow';\n }\n\n ngAfterViewInit(): void {\n if (this.headerAlignment()) {\n const sortHeader = this.el.nativeElement.querySelector('.mat-sort-header-container');\n if (sortHeader) {\n sortHeader.style.justifyContent = this.headerAlignment();\n } else {\n this.el.nativeElement.style.justifyContent = this.headerAlignment();\n }\n }\n }\n}\n\n/**\n * Represents a request to load entities from the remote. This is used to\n * compare two requests to determine if they are equal. This is useful to\n * prevent duplicate requests being sent to the remote.\n */\nclass LoadRequest {\n constructor(\n public endpoint: string,\n public params: HttpParams,\n public force = false\n ) {}\n\n // Returns true if two LoadRequest objects are equal and this object's\n // 'force' is not set to true.\n isEqualToAndNotForced(prev: LoadRequest): boolean {\n // console.log(\n // `isEqualToAndNotForced - ${this.endpoint}, ${this.params.toString()} ${\n // this.force\n // }, other: ${prev.endpoint}, ${prev.params.toString()}, ${prev.force}`\n // );\n return this.force\n ? false\n : this.endpoint.localeCompare(prev.endpoint) === 0 &&\n this.params.toString().localeCompare(prev.params.toString()) === 0;\n }\n}\n\n/**\n * A component to display a list of entities loaded from remote.\n */\n@Component({\n imports: [\n CommonModule,\n RouterModule,\n MatTableModule,\n MatSortModule,\n MatPaginatorModule,\n MatButtonModule,\n MatInputModule,\n MatProgressSpinnerModule,\n InfiniteScrollDirective,\n HeaderAlignmentDirective,\n ],\n selector: 'sp-mat-entity-list',\n template: `\n <div\n class=\"entities-list-wrapper\"\n infiniteScroll\n [infiniteScrollDistance]=\"infiniteScrollDistance()\"\n [infiniteScrollThrottle]=\"infiniteScrollThrottle()\"\n [infiniteScrollContainer]=\"infiniteScrollContainer()\"\n [scrollWindow]=\"infiniteScrollWindow()\"\n [infiniteScrollDisabled]=\"\n pagination() !== 'infinite' || !_paginator || !hasMore()\n \"\n (scrolled)=\"infiniteScrollLoadNextPage($event)\"\n >\n <div\n class=\"busy-overlay\"\n [ngClass]=\"{ show: pagination() === 'discrete' && loading() }\"\n >\n <ng-container *ngTemplateOutlet=\"busySpinner\"></ng-container>\n </div>\n <table mat-table [dataSource]=\"dataSource()\">\n <tr mat-header-row *matHeaderRowDef=\"_displayedColumns()\"></tr>\n <tr\n mat-row\n [class.active-row]=\"activeEntityId() === row[this.idKey()]\"\n *matRowDef=\"let row; columns: _displayedColumns()\"\n (click)=\"toggleActiveEntity(row)\"\n ></tr>\n </table>\n @if (pagination() == 'discrete' && _paginator) {\n <mat-paginator\n showFirstLastButtons\n [length]=\"entityCount()\"\n [pageSize]=\"_pageSize()\"\n [pageIndex]=\"pageIndex()\"\n [pageSizeOptions]=\"[]\"\n [hidePageSize]=\"true\"\n (page)=\"handlePageEvent($event)\"\n [disabled]=\"loading()\"\n aria-label=\"Select page\"\n ></mat-paginator>\n }\n <div\n class=\"infinite-scroll-loading\"\n [ngClass]=\"{ show: pagination() === 'infinite' && loading() }\"\n >\n <ng-container *ngTemplateOutlet=\"busySpinner\"></ng-container>\n </div>\n </div>\n <!-- We keep the column definitions outside the <table> so that they can\n be dynamically added to the MatTable. -->\n <span matSort=\"sorter()\">\n @for (column of __columns(); track $index) {\n <ng-container [matColumnDef]=\"column.spec.name\">\n @if (disableSort()) {\n <th\n [class]=\"column.class\"\n [headerAlignment]=\"column.options.alignment\"\n mat-header-cell\n *matHeaderCellDef\n >\n {{ getColumnLabel(column) | async }}\n </th>\n } @else {\n <th\n [class]=\"column.class\"\n [headerAlignment]=\"column.options.alignment\"\n mat-header-cell\n mat-sort-header\n *matHeaderCellDef\n >\n {{ getColumnLabel(column) | async }}\n </th>\n }\n <td\n [class]=\"column.class\"\n [style.text-align]=\"column.options.alignment\"\n mat-cell\n *matCellDef=\"let element\"\n [routerLink]=\"column.getRouterLink(element)\"\n >\n @if (column.hasRouterLink(element)) {\n <a [routerLink]=\"column.getRouterLink(element)\">\n <span [innerHTML]=\"column.value(element)\"></span>\n </a>\n } @else { @let val = column.value(element);\n <span [innerHTML]=\"isAsync(val) ? (val | async) : val\"></span>\n }\n </td>\n </ng-container>\n }\n </span>\n <ng-template #busySpinner>\n <div class=\"busy-spinner\">\n <mat-spinner mode=\"indeterminate\" diameter=\"28\"></mat-spinner>\n </div>\n </ng-template>\n `,\n styles: [\n `\n .entities-list-wrapper {\n position: relative;\n }\n .busy-overlay {\n display: none;\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0px;\n left: 0px;\n z-index: 1000;\n opacity: 0.6;\n background-color: transparent;\n }\n .show {\n display: block;\n }\n .busy-spinner {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .infinite-scroll-loading {\n display: none;\n width: 100%;\n padding: 8px;\n }\n .active-row {\n font-weight: bold;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SPMatEntityListComponent<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> implements OnInit, OnDestroy, AfterViewInit\n{\n /* CLIENT PROVIDED PARAMETERS */\n entityName = input.required<string>();\n entityNamePlural = input<string>();\n\n /**\n * The endpoint from where the entities are to be retrieved\n */\n endpoint = input<string>('');\n /**\n * Custom entities loader function, which if provided will be called\n * instead of HttpClient.get.\n */\n entityLoaderFn = input<SPMatEntityListEntityLoaderFn | undefined>(undefined);\n /**\n * The columns of the entity to be displayed. This is an array of\n * SPEntityFieldSpec objects. If there's a one-to-one mapping between the\n * column's field name, its title & the rendered value, a string can be\n * specified instead. That is, the value of this property is a heterogeneous\n * array consisting of SPEntityFieldSpec<> objects and strings.\n */\n columns = input<Array<SPEntityFieldSpec<TEntity, IdKey> | string>>([]);\n\n /**\n * Names of columns that are displayed. This will default to all the columns\n * listed in columns.\n */\n displayedColumns = input<string[]>([]); // ['name', 'cell', 'gender'];\n\n /**\n * Number of entities per page. If this is not set and paginator is defined,\n * the number of entities int in the first request, will be taken as the\n * page size.\n */\n pageSize = input<number>(0);\n /**\n * Entity idKey, if idKey is different from the default 'id'.\n */\n idKey = input<string>('id');\n /**\n * Type of pagination -- continuous or discrete. 'infinite' pagination\n * uses an 'infiniteScroll' and 'discrete' pagination uses a mat-paginator\n * at the bottom to navigate between pages.\n */\n pagination = input<'infinite' | 'discrete' | 'none'>('discrete');\n /**\n * Component specific paginator. Only used if pagination != 'none'.\n */\n paginator = input<SPMatEntityListPaginator>();\n /**\n *\n */\n sorter = input<MatSort>();\n /**\n * Disable sorting of rows\n */\n disableSort = input<boolean>(false);\n /**\n * Wrappers for infiniteScroll properties, for customization by the client\n */\n infiniteScrollContainer = input<any>('');\n infiniteScrollDistance = input<number>(1);\n infiniteScrollThrottle = input<number>(400);\n infiniteScrollWindow = input<boolean>(false);\n /**\n * Custom context to be set for HttpClient requests. In the client code\n * specify this property by initializing a member variable as:\n\n ```\n Component({\n ...\n template: `\n <sp-mat-entity-list\n [httpReqContext]=\"httpReqContext\"\n ></sp-mat-entity-list>\n `\n })\n export class YourComponent {\n httpReqContext: [HttpContextToken<any>, any] = [\n SIDELOAD_TO_COMPOSITE_PARAMS, 'customers'\n ];\n }\n ```\n *\n * Of course if you want to pass multiple context properties, declare the type\n * as an array of array. That is, `[[HttpContextToken<any>, any]]` and\n * initialize it appropriately.\n */\n httpReqContext = input<\n [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]\n >();\n /* END CLIENT PROVIDED PARAMETERS */\n\n // *** INTERNAL *** //\n _entityNamePlural = computed(() =>\n this.entityNamePlural()\n ? this.entityNamePlural()\n : plural(this.entityName())\n );\n\n _httpReqContext = computed(() => {\n let reqContext = this.httpReqContext();\n const context = new HttpContext();\n if (reqContext && Array.isArray(reqContext)) {\n if (reqContext.length == 2 && !Array.isArray(reqContext[0])) {\n // one dimensional array of a key, value pair.\n context.set(reqContext[0], reqContext[1]);\n } else {\n reqContext.forEach(([k, v]) => context.set(k, v));\n }\n }\n context.set(SP_MAT_ENTITY_LIST_HTTP_CONTEXT, {\n entityName: this.entityName(),\n entityNamePlural: this._entityNamePlural(),\n endpoint: this.endpoint(),\n });\n return context;\n });\n deferViewInit = input<boolean>(false);\n firstLoadDone = false;\n allColumnNames = signal<string[]>([]);\n _displayedColumns = computed(() =>\n this.displayedColumns().length > 0\n ? this.displayedColumns().filter(\n (colName) =>\n this.allColumnNames().find((name) => name === colName) !== undefined\n )\n : this.allColumnNames()\n );\n dataSource = signal<MatTableDataSource<TEntity>>(\n new MatTableDataSource<TEntity>()\n );\n\n table = viewChild(MatTable);\n sort = viewChild(MatSort);\n // These are our own <ng-container matColumnDef></ng-container>\n // which we create for each column that we create by the declaration:\n // <ng-container *ngFor=\"let column of columns()\" [matColumnDef]=\"column.name\">\n viewColumnDefs = viewChildren(MatColumnDef);\n // These are the <ng-container matColumnDef></ng-container> placed\n // inside <sp-mat-entity-list></<sp-mat-entity-list> by the client to override\n // the default <ng-container matColumnDef> created by the component.\n @ContentChildren(MatColumnDef) clientColumnDefs!: QueryList<MatColumnDef>;\n\n contentColumnDefs: MatColumnDef[] = [];\n\n subs$ = new Subscription();\n destroy$ = new Subject<void>();\n\n // Pagination state\n entityCount = signal<number>(0);\n pageIndex = signal<number>(0);\n\n // Mechanism to default pageSize to last entities length.\n lastFetchedEntitiesCount = signal<number>(0);\n _pageSize = computed<number>(() =>\n this.pageSize()\n ? this.pageSize()\n : this.entityListConfig.defaultPageSize ?? this.lastFetchedEntitiesCount()\n );\n // Effective columns, derived from columns(), which can either be an array\n // of objects of array of strings.\n _columns = computed<SPEntityFieldSpec<TEntity, IdKey>[]>(() => {\n const columns = this.columns();\n let fields: SPEntityField<TEntity, IdKey>[] = [];\n let cols: SPEntityFieldSpec<TEntity, IdKey>[] = [];\n columns.forEach((colDef) => {\n // fields.push(new SPEntityField(colDef))\n if (typeof colDef === 'string') {\n cols.push({ name: String(colDef) });\n } else if (typeof colDef === 'object') {\n cols.push(colDef as SPEntityFieldSpec<TEntity, IdKey>);\n }\n });\n return cols;\n });\n\n __columns = computed<SPEntityField<TEntity, IdKey>[]>(() =>\n this.columns().map(\n (colDef) => new SPEntityField<TEntity, IdKey>(colDef, this.fieldConfig)\n )\n );\n\n // We isolate retrieving items from the remote and providing the items\n // to the component into two distinct operations. The retrieval operation\n // retrieves data asynchronously and then stores the data in a local store.\n // The UI would be 'listening' to a reactive callback that would be triggered\n // whenever items in the store changes. This is because store is an immutable\n // data structure and any changes (addition/deletion) to it would result in\n // the entire store being replaced with a copy with the changes applied.\n\n // Ideally we should declare this as\n // store!: Store<...>. But @ngneat/elf does not provide a generic type\n // for Store<...>, which can be composed from its type arguments. Instead it\n // uses type composition using its arguments to generate store's type\n // implicitly. So we use the same mechanism to enforce type safety in our\n // code. The code below results in a type declaration for store that is\n // dependent on the components generic arguments. (Making use of TypeScript's\n // type deduction system from variable assignment). Later on in the\n // constructor we reassign this.store with a new object that uses the\n // client provided idKey() value as the identifying key for each entity in\n // the sore.\n store = createStore(\n { name: Math.random().toString(36).slice(2) },\n withEntities<TEntity, IdKey>({ idKey: this.idKey() as IdKey })\n );\n // We'll initialize this in ngOnInit() when 'store' is initialized with the\n // correct TEntity store that can be safely indexed using IdKey.\n entities$!: Observable<TEntity[]>;\n // Effective paginator, coalescing local paginator and paginator from global\n // config.\n _paginator!: SPMatEntityListPaginator | undefined;\n // We will toggle this during every entity load.\n loading = signal<boolean>(false);\n // We will update this after every load and pagination() == 'infinite'\n hasMore = signal<boolean>(true);\n\n activeEntity = signal<TEntity | undefined>(undefined);\n activeEntityId = computed(() =>\n this.activeEntity() ? (this.activeEntity() as any)[this.idKey()] : undefined\n );\n _prevActiveEntity!: TEntity | undefined;\n _activeEntityChange = effect(() => {\n runInInjectionContext(this.injector, () => {\n const activeEntity = this.activeEntity();\n // Though we can raise the selectEntity event directly from effect handler,\n // that would prevent the event handler from being able to update any\n // signals from inside it. So we generate the event asyncronously.\n // Also, this effect handler will be invoked for the initial 'undefined'\n // during which we shouldn't emit the selectEntity event. Therefore we\n // keep another state variable to filter out this state.\n if (activeEntity || this._prevActiveEntity) {\n setTimeout(() => {\n this._prevActiveEntity = activeEntity;\n this.selectEntity.emit(activeEntity);\n // if (this._prevActiveEntity && !activeEntity) {\n // this.selectEntity.emit(activeEntity);\n // } else if (activeEntity) {\n // this.selectEntity.emit(activeEntity);\n // }\n });\n }\n });\n });\n @Output() selectEntity = new EventEmitter<TEntity | undefined>();\n\n fieldConfig = inject(SP_ENTITY_FIELD_CONFIG, { optional: true })!;\n entityListConfig = getEntityListConfig();\n\n /**\n * A signal that can be used to trigger loading of more entities from the\n * remote. This can be visualized as the event loop of the entity list\n * component.\n */\n loadRequest$ = new Subject<LoadRequest>();\n\n endpointChanged = effect(() => {\n runInInjectionContext(this.injector, () => {\n if (this.endpoint()) {\n // console.log(`endpointChanged - ${this.endpoint()}`);\n setTimeout(() => {\n this.refresh();\n });\n }\n });\n });\n\n constructor(\n protected http: HttpClient,\n private sanitizer: DomSanitizer,\n private injector: Injector\n ) {}\n\n ngOnInit() {\n // This is the reactive callback that listens for changes to table entities\n // which are reflected in the mat-table.\n this.store = createStore(\n { name: Math.random().toString(36).slice(2) },\n withEntities<TEntity, IdKey>({ idKey: this.idKey() as IdKey })\n );\n this.entities$ = this.store.pipe(selectAllEntities());\n this._paginator = this.paginator()\n ? this.paginator()\n : this.entityListConfig?.paginator;\n\n this.entities$\n .pipe(\n takeUntil(this.destroy$),\n tap((entities) => {\n // .data is a setter property, which ought to trigger the necessary\n // signals resulting in mat-table picking up the changes without\n // requiring us to call cdr.detectChanges() explicitly.\n this.dataSource().data = entities;\n })\n )\n .subscribe();\n\n this.loadRequest$\n .pipe(\n takeUntil(this.destroy$),\n filter((lr) => lr.endpoint !== '' || lr.force === true),\n distinctUntilChanged((prev, current) =>\n current.isEqualToAndNotForced(prev)\n ),\n switchMap((lr: LoadRequest) => this.doActualLoad(lr))\n )\n .subscribe();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n ngAfterViewInit(): void {\n if (!this.deferViewInit()) {\n this.buildContentColumnDefs();\n this.buildColumns();\n this.setupSort();\n this.loadMoreEntities();\n }\n }\n\n /**\n * Clear all entities in store and reload them from endpoint as if\n * the entities are being loaded for the first time.\n */\n refresh(force = false) {\n this.pageIndex.set(0);\n this.loadMoreEntities(force);\n }\n\n addEntity(entity: TEntity) {\n const pagination = this.pagination();\n const count = this.store.query(getEntitiesCount());\n if (\n pagination === 'infinite' ||\n pagination === 'none' ||\n count < this._pageSize()\n ) {\n this.store.update(addEntities(entity));\n } else {\n // 'discrete' pagination, refresh the crud items from the beginning.\n // Let component client set the behavior using a property\n // this.pageIndex.set(0);\n // this.loadMoreEntities();\n }\n }\n\n /**\n * Update an entity with a modified version. Can be used by CRUD UPDATE\n * operation to update an entity in the local store that is used to as the\n * source of MatTableDataSource.\n * @param id\n * @param entity\n */\n updateEntity(id: TEntity[IdKey], entity: TEntity) {\n if (this.store.query(hasEntity(id))) {\n this.store.update(updateEntities(id, entity));\n }\n }\n\n /**\n * Clients can call this method when it has deleted and entity via a CRUD\n * operation. Depending on the pagination mode, MatEntityList implements\n * an appropriate behavior.\n *\n * If the pagination is 'infinite', the relevent entity is removed from our\n * entity list. View will be repained as data store has changed.\n *\n * If the pagination is 'discrete', the entity is removed from the page.\n * If this is the only entity in the page, the current pageNumber is\n * decremented by 1 if it's possible (if the current pageNumber > 1).\n * The page is reloaded from remote.\n */\n removeEntity(id: TEntity[IdKey]) {\n const paginator = this._paginator;\n if (paginator) {\n if (this.pagination() === 'infinite') {\n // This will cause store to mutate which will trigger this.entity$ to\n // emit which in turn will update our MatTableDataSource instance.\n this.store.update(deleteEntities(id));\n } else {\n // Logic\n this.store.update(deleteEntities(id));\n const count = this.store.query(getEntitiesCount());\n if (count == 0) {\n // No more entities in this page\n // Go back one page\n if (this.pageIndex() > 0) {\n this.pageIndex.set(this.pageIndex() - 1);\n }\n }\n // load the page again\n this.loadMoreEntities();\n }\n } else {\n // Just remove the entity that has been deleted.\n this.store.update(deleteEntities(id));\n }\n }\n\n /**\n * Build the contentColumnDefs array by enumerating all of client's projected\n * content with matColumnDef directive.\n */\n buildContentColumnDefs() {\n const clientColumnDefs = this.clientColumnDefs;\n if (clientColumnDefs) {\n this.contentColumnDefs = clientColumnDefs.toArray();\n }\n }\n\n /**\n * Build the effective columns by parsing our own <ng-container matColumnDef>\n * statements for each column in columns() property and client's\n * <ng-container matColumnDef> provided via content projection.\n */\n buildColumns() {\n const matTable = this.table();\n\n if (matTable) {\n const columnNames = new Set<string>();\n const columnDefs: MatColumnDef[] = [];\n\n this._columns().forEach((colDef) => {\n if (!columnNames.has(colDef.name)) {\n const matColDef = this.viewColumnDefs().find(\n (cd) => cd.name === colDef.name\n );\n const clientColDef = this.contentColumnDefs.find(\n (cd) => cd.name === colDef.name\n );\n const columnDef = clientColDef ? clientColDef : matColDef;\n if (columnDef) {\n columnDefs.push(columnDef);\n columnNames.add(colDef.name);\n }\n }\n });\n columnDefs.forEach((cd) => {\n matTable.addColumnDef(cd);\n });\n\n this.allColumnNames.set(Array.from(columnNames));\n // this.displayedColumns.set(Array.from(columnNames) as string[]);\n }\n }\n\n setupSort() {\n const matSort = this.sort();\n if (matSort) {\n this.dataSource().sort = matSort;\n }\n }\n\n infiniteScrollLoadNextPage(ev: any) {\n // console.log(`infiniteScrollLoadNextPage - ${JSON.stringify(ev)}`);\n if (this._paginator) {\n this.loadMoreEntities();\n }\n }\n\n loadMoreEntities(forceRefresh = false) {\n this.loadRequest$.next(this.createNextLoadRequest(forceRefresh));\n }\n\n /**\n * Creates a LoadRequest object for loading entities using the current state\n * of the component. Therefore, if the request is for next page of entities,\n * the LoadRequest object will have the updated page index. However, if\n * pagination has been reset (refer to refresh()), the LoadRequest object\n * will be for the first page of data. Note that when 'endpoint' value\n * changes, the component's pagination state is reset causing a refresh()\n * to be called, which in turn will create a new LoadRequest object for the\n * first page of data.\n * @returns LoadRequest object for the next load request.\n */\n private createNextLoadRequest(forceRefresh: boolean): LoadRequest {\n let pageParams = {};\n const parts = this.endpoint().split('?');\n const endpoint = parts[0];\n if (this._paginator) {\n pageParams = this._paginator.getRequestPageParams(\n endpoint,\n this.pageIndex(),\n this.pageSize()\n );\n }\n let httpParams = new HttpParams();\n for (const key in pageParams) {\n httpParams = httpParams.append(key, (pageParams as any)[key]);\n }\n if (parts.length > 1) {\n const embeddedParams = new HttpParams({ fromString: parts[1] });\n embeddedParams.keys().forEach((key) => {\n const value = embeddedParams.getAll(key);\n (value || []).forEach((v) => {\n httpParams = httpParams.append(key, v);\n });\n });\n }\n return new LoadRequest(\n endpoint,\n httpParams,\n forceRefresh || !!this.entityLoaderFn()\n );\n }\n\n /**\n * Does the actual load of entities from the remote or via calling the\n * entityLoaderFn. This method is the workhorse of the entity list\n * 'loader-loop'.\n * @param lr\n * @returns Observable that emits the response from the remote or from\n * entityLoaderFn().\n */\n private doActualLoad(lr: LoadRequest) {\n // console.log(`doActualLoad - endpoint: ${lr.endpoint}, params: ${lr.params.toString()}`);\n const loaderFn = this.entityLoaderFn();\n const params = lr.params;\n const obs =\n loaderFn !== undefined\n ? loaderFn({ params })\n : this.http.get<any>(this.getUrl(lr.endpoint), {\n context: this._httpReqContext(),\n params,\n });\n\n this.loading.set(true);\n return obs.pipe(\n tap((resp) => {\n // TODO: defer this to a pagination provider so that we can support\n // many types of pagination. DRF itself has different schemes. And\n // express may have yet another pagination protocol.\n this.firstLoadDone = true;\n if (this._paginator) {\n // Convert HttpParams to JS object\n const paramsObj: any = {};\n params.keys().forEach((key) => {\n paramsObj[key] = params.get(key);\n });\n const { entities, total } = this._paginator.parseRequestResponse(\n this.entityName(),\n this._entityNamePlural()!,\n this.endpoint(),\n paramsObj,\n resp\n );\n this.entityCount.set(total);\n this.lastFetchedEntitiesCount.set(entities.length);\n // this.pageIndex.set(this.pageIndex() + 1)\n // entities = this._paginator.getEntitiesFromResponse(entities);\n if (this.pagination() === 'discrete') {\n this.store.reset();\n } else if (this.pagination() === 'infinite') {\n const pageSize = this._pageSize();\n const entityCount = this.entityCount();\n if (pageSize > 0) {\n const pageCount =\n Math.floor(entityCount / pageSize) +\n (entityCount % pageSize ? 1 : 0);\n this.hasMore.set(this.pageIndex() === pageCount);\n } else {\n this.hasMore.set(false);\n }\n }\n // store the entities in the store\n // TODO: remove as any\n this.store.update(upsertEntities(entities as any));\n } else {\n this.store.update(\n upsertEntities(this.findArrayInResult(resp) as TEntity[])\n );\n }\n }),\n finalize(() => this.loading.set(false))\n );\n }\n\n private findArrayInResult(res: any): any[] | undefined {\n if (Array.isArray(res)) {\n return res;\n }\n for (const key in res) {\n if (Object.prototype.hasOwnProperty.call(res, key)) {\n const element = res[key];\n if (Array.isArray(element)) {\n return element;\n }\n }\n }\n return [];\n }\n\n handlePageEvent(e: PageEvent) {\n this.pageIndex.set(e.pageIndex);\n this.loadMoreEntities();\n }\n\n getUrl(endpoint: string) {\n return this.entityListConfig?.urlResolver\n ? this.entityListConfig?.urlResolver(endpoint)\n : endpoint;\n }\n\n toggleActiveEntity(entity: TEntity | undefined) {\n if (entity) {\n if (entity === this.activeEntity()) {\n this.activeEntity.set(undefined);\n } else {\n this.activeEntity.set(entity);\n }\n } else {\n this.activeEntity.set(undefined);\n }\n }\n\n getColumnLabel(field: SPEntityField<TEntity, IdKey>): Observable<string> {\n if (field._fieldSpec.label) {\n return of(field._fieldSpec.label);\n }\n if (this.entityListConfig && this.entityListConfig.columnLabelFn) {\n const label = this.entityListConfig.columnLabelFn(\n this.entityName(),\n field._fieldSpec.name\n );\n return label instanceof Observable ? label : of(label);\n }\n return of(field._fieldSpec.name);\n }\n\n isAsync(val: any) {\n return val instanceof Observable;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AASa,MAAA,+BAA+B,GAC1C,IAAI,gBAAgB,CAA6B,OAAO;AACtD,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,QAAQ,EAAE,EAAE;AACb,CAAA,CAAC;;MCXS,yBAAyB,GAAG,IAAI,cAAc,CACzD,uBAAuB;;ACAlB,MAAM,4BAA4B,GAA0B;AACjE,IAAA,WAAW,EAAE,CAAC,QAAgB,KAAK,QAAQ;AAC3C,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;IAC5B,aAAa,EAAE,CAAC,UAAkB,EAAE,UAAkB,KAAK,UAAU;CACtE;AAED;;AAEG;SACa,mBAAmB,GAAA;AACjC,IAAA,MAAM,gBAAgB,GAAG,MAAM,CAAC,yBAAyB,EAAE;AACzD,QAAA,QAAQ,EAAE,IAAI;AACf,KAAA,CAAC;IACF,OAAO;AACL,QAAA,GAAG,4BAA4B;AAC/B,QAAA,IAAI,gBAAgB,IAAI,EAAE,CAAC;KAC5B;AACH;;MCuDa,wBAAwB,CAA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A,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,uBAAuB,0WA5Dd,wBAAwB,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAuMxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBArJpC,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,OAAA,EAAA;wBACP,YAAY;wBACZ,YAAY;wBACZ,cAAc;wBACd,aAAa;wBACb,kBAAkB;wBAClB,eAAe;wBACf,cAAc;wBACd,wBAAwB;wBACxB,uBAAuB;wBACvB,wBAAwB;AACzB,qBAAA,EAAA,QAAA,EACS,oBAAoB,EACpB,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGT,EAqCgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,4XAAA,CAAA,EAAA;iIAoJhB,gBAAgB,EAAA,CAAA;sBAA9C,eAAe;uBAAC,YAAY;gBAsGnB,YAAY,EAAA,CAAA;sBAArB;;;AC7gBH;;AAEG;;;;"}
@@ -244,6 +244,7 @@ export declare class SPMatEntityListComponent<TEntity extends {
244
244
  getUrl(endpoint: string): string;
245
245
  toggleActiveEntity(entity: TEntity | undefined): void;
246
246
  getColumnLabel(field: SPEntityField<TEntity, IdKey>): Observable<string>;
247
+ isAsync(val: any): val is Observable<any>;
247
248
  static ɵfac: i0.ɵɵFactoryDeclaration<SPMatEntityListComponent<any, any>, never>;
248
249
  static ɵcmp: i0.ɵɵComponentDeclaration<SPMatEntityListComponent<any, any>, "sp-mat-entity-list", never, { "entityName": { "alias": "entityName"; "required": true; "isSignal": true; }; "entityNamePlural": { "alias": "entityNamePlural"; "required": false; "isSignal": true; }; "endpoint": { "alias": "endpoint"; "required": false; "isSignal": true; }; "entityLoaderFn": { "alias": "entityLoaderFn"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "displayedColumns": { "alias": "displayedColumns"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "idKey": { "alias": "idKey"; "required": false; "isSignal": true; }; "pagination": { "alias": "pagination"; "required": false; "isSignal": true; }; "paginator": { "alias": "paginator"; "required": false; "isSignal": true; }; "sorter": { "alias": "sorter"; "required": false; "isSignal": true; }; "disableSort": { "alias": "disableSort"; "required": false; "isSignal": true; }; "infiniteScrollContainer": { "alias": "infiniteScrollContainer"; "required": false; "isSignal": true; }; "infiniteScrollDistance": { "alias": "infiniteScrollDistance"; "required": false; "isSignal": true; }; "infiniteScrollThrottle": { "alias": "infiniteScrollThrottle"; "required": false; "isSignal": true; }; "infiniteScrollWindow": { "alias": "infiniteScrollWindow"; "required": false; "isSignal": true; }; "httpReqContext": { "alias": "httpReqContext"; "required": false; "isSignal": true; }; "deferViewInit": { "alias": "deferViewInit"; "required": false; "isSignal": true; }; }, { "selectEntity": "selectEntity"; }, ["clientColumnDefs"], never, true, never>;
249
250
  }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "path": "src/assets/i18n/"
7
7
  }
8
8
  ],
9
- "version": "0.31.6",
9
+ "version": "0.31.8",
10
10
  "peerDependencies": {
11
11
  "@angular/common": "^19.1.0",
12
12
  "@angular/core": "^19.1.0",
@@ -47,25 +47,25 @@
47
47
  "types": "./entity-field/index.d.ts",
48
48
  "default": "./fesm2022/smallpearl-ngx-helper-entity-field.mjs"
49
49
  },
50
- "./mat-busy-wheel": {
51
- "types": "./mat-busy-wheel/index.d.ts",
52
- "default": "./fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs"
50
+ "./forms": {
51
+ "types": "./forms/index.d.ts",
52
+ "default": "./fesm2022/smallpearl-ngx-helper-forms.mjs"
53
53
  },
54
- "./hover-dropdown": {
55
- "types": "./hover-dropdown/index.d.ts",
56
- "default": "./fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs"
54
+ "./mat-context-menu": {
55
+ "types": "./mat-context-menu/index.d.ts",
56
+ "default": "./fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs"
57
57
  },
58
58
  "./locale": {
59
59
  "types": "./locale/index.d.ts",
60
60
  "default": "./fesm2022/smallpearl-ngx-helper-locale.mjs"
61
61
  },
62
- "./mat-context-menu": {
63
- "types": "./mat-context-menu/index.d.ts",
64
- "default": "./fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs"
62
+ "./hover-dropdown": {
63
+ "types": "./hover-dropdown/index.d.ts",
64
+ "default": "./fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs"
65
65
  },
66
- "./forms": {
67
- "types": "./forms/index.d.ts",
68
- "default": "./fesm2022/smallpearl-ngx-helper-forms.mjs"
66
+ "./mat-busy-wheel": {
67
+ "types": "./mat-busy-wheel/index.d.ts",
68
+ "default": "./fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs"
69
69
  },
70
70
  "./mat-entity-crud": {
71
71
  "types": "./mat-entity-crud/index.d.ts",