@smallpearl/ngx-helper 0.33.14 → 0.33.15

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,6 +1,6 @@
1
1
  import { SPIntlDateFormat } from '@smallpearl/ngx-helper/locale';
2
- import { SPEntityFieldConfig } from './provider';
3
2
  import { Observable } from 'rxjs';
3
+ import { SPEntityFieldConfig } from './provider';
4
4
  type FieldValueTypes = string | number | Date | boolean;
5
5
  /**
6
6
  * This structure defines the data formatting details for a field of the
@@ -50,7 +50,7 @@ export declare class SPEntityField<TEntity extends {
50
50
  /**
51
51
  * @returns the label for the field.
52
52
  */
53
- label(): string | Observable<string>;
53
+ label(): Observable<string>;
54
54
  /**
55
55
  * Given an entity, returns the value of the field matching the
56
56
  * SPEntityFieldSpec<> in fieldSpec.
@@ -1,4 +1,5 @@
1
1
  import { spFormatDate, spFormatCurrency } from '@smallpearl/ngx-helper/locale';
2
+ import { Observable, of } from 'rxjs';
2
3
  import { InjectionToken } from '@angular/core';
3
4
 
4
5
  /**
@@ -41,7 +42,18 @@ class SPEntityField {
41
42
  * @returns the label for the field.
42
43
  */
43
44
  label() {
44
- return this._fieldSpec.label ?? this._fieldSpec.name;
45
+ const label = this._fieldSpec.label;
46
+ if (label) {
47
+ if (label instanceof Observable) {
48
+ return label;
49
+ }
50
+ else {
51
+ if (typeof label === 'string') {
52
+ return of(label);
53
+ }
54
+ }
55
+ }
56
+ return of(this._fieldSpec.name);
45
57
  }
46
58
  /**
47
59
  * Given an entity, returns the value of the field matching the
@@ -1 +1 @@
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|Observable<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,CAA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A,GAAG,GAAG,gBAAgB,CAAC,GAAG,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;;MCxHY,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 { Observable, of } from 'rxjs';\nimport { SPEntityFieldConfig } from './provider';\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|Observable<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(): Observable<string> {\n const label = this._fieldSpec.label;\n if (label) {\n if (label instanceof Observable) {\n return label;\n } else {\n if (typeof label === 'string') {\n return of(label);\n }\n }\n }\n return of(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,IA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,IAAI,EAAE;AACvB,YAAA,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC;;aAClB,IACL,OAAO,GAAG,KAAK,QAAQ;YACvB,YAAY,EAAE,UAAU,EACxB;AACA,YAAA,GAAG,GAAG,gBAAgB,CAAC,GAAG,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;;MClIY,sBAAsB,GAAG,IAAI,cAAc,CACtD,qBAAqB;;AC/BvB;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i1 from '@angular/common';
2
- import { CommonModule, UpperCasePipe } from '@angular/common';
2
+ import { AsyncPipe, CommonModule, UpperCasePipe } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
4
  import { input, computed, Component, ChangeDetectionStrategy, inject } from '@angular/core';
5
5
  import { SP_ENTITY_FIELD_CONFIG, SPEntityField } from '@smallpearl/ngx-helper/entity-field';
@@ -73,7 +73,7 @@ class FieldsRendererComponent {
73
73
  <tbody>
74
74
  @for (field of fields(); track $index) {
75
75
  <tr>
76
- <td [class]="field.class">{{ field.label() }}&colon;</td>
76
+ <td [class]="field.class">{{ field.label() | async }}&colon;</td>
77
77
  <td [class]="field.class">{{ field.value(entity()) }}</td>
78
78
  </tr>
79
79
  }
@@ -81,11 +81,11 @@ class FieldsRendererComponent {
81
81
  </table>
82
82
  </div>
83
83
  }
84
- `, isInline: true, styles: [".field-values{padding:.2em 0;text-align:end}tr td:first-of-type{padding-right:1em}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
84
+ `, isInline: true, styles: [".field-values{padding:.2em 0;text-align:end}tr td:first-of-type{padding-right:1em}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
85
85
  }
86
86
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: FieldsRendererComponent, decorators: [{
87
87
  type: Component,
88
- args: [{ imports: [], selector: 'sp-fields-renderer', template: `
88
+ args: [{ imports: [AsyncPipe], selector: 'sp-fields-renderer', template: `
89
89
  @if (isString()) {
90
90
  {{ stringValue() }}
91
91
  } @else {
@@ -94,7 +94,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
94
94
  <tbody>
95
95
  @for (field of fields(); track $index) {
96
96
  <tr>
97
- <td [class]="field.class">{{ field.label() }}&colon;</td>
97
+ <td [class]="field.class">{{ field.label() | async }}&colon;</td>
98
98
  <td [class]="field.class">{{ field.value(entity()) }}</td>
99
99
  </tr>
100
100
  }
@@ -160,7 +160,10 @@ class StationaryWithLineItemsComponent {
160
160
  }
161
161
  fieldLabel(field) {
162
162
  const label = field.label();
163
- return label instanceof Observable ? label : of(label);
163
+ if (label) {
164
+ return label instanceof Observable ? label : of(label);
165
+ }
166
+ return of('');
164
167
  }
165
168
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: StationaryWithLineItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
166
169
  /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", type: StationaryWithLineItemsComponent, isStandalone: true, selector: "sp-stationary-with-line-items", inputs: { entity: { classPropertyName: "entity", publicName: "entity", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, number: { classPropertyName: "number", publicName: "number", isSignal: true, isRequired: false, transformFunction: null }, leftHeader: { classPropertyName: "leftHeader", publicName: "leftHeader", isSignal: true, isRequired: false, transformFunction: null }, leftHeaderTemplate: { classPropertyName: "leftHeaderTemplate", publicName: "leftHeaderTemplate", isSignal: true, isRequired: false, transformFunction: null }, rightHeader: { classPropertyName: "rightHeader", publicName: "rightHeader", isSignal: true, isRequired: false, transformFunction: null }, rightHeaderTemplate: { classPropertyName: "rightHeaderTemplate", publicName: "rightHeaderTemplate", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, leftFooter: { classPropertyName: "leftFooter", publicName: "leftFooter", isSignal: true, isRequired: false, transformFunction: null }, leftFooterTemplate: { classPropertyName: "leftFooterTemplate", publicName: "leftFooterTemplate", isSignal: true, isRequired: false, transformFunction: null }, rightFooter: { classPropertyName: "rightFooter", publicName: "rightFooter", isSignal: true, isRequired: false, transformFunction: null }, rightFooterTemplate: { classPropertyName: "rightFooterTemplate", publicName: "rightFooterTemplate", isSignal: true, isRequired: false, transformFunction: null }, itemFieldName: { classPropertyName: "itemFieldName", publicName: "itemFieldName", isSignal: true, isRequired: false, transformFunction: null }, itemColumnFields: { classPropertyName: "itemColumnFields", publicName: "itemColumnFields", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
@@ -1 +1 @@
1
- {"version":3,"file":"smallpearl-ngx-helper-stationary-with-line-items.mjs","sources":["../../../../projects/smallpearl/ngx-helper/stationary-with-line-items/src/stationary-with-line-items.component.ts","../../../../projects/smallpearl/ngx-helper/stationary-with-line-items/smallpearl-ngx-helper-stationary-with-line-items.ts"],"sourcesContent":["import { CommonModule, UpperCasePipe } from '@angular/common';\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, computed, inject, input, OnInit, TemplateRef } from '@angular/core';\nimport { SP_ENTITY_FIELD_CONFIG, SPEntityField, SPEntityFieldSpec } from '@smallpearl/ngx-helper/entity-field';\nimport { Observable, of } from 'rxjs';\n\n\n// @Component({\n// standalone: true,\n// imports: [],\n// selector: 'sp-string-or-object-renderer',\n// template: `\n// @if (isString()) {\n// {{ value() }}\n// } @else {\n// <table>\n// @for (row of objectAsArray(); track $index) {\n// <tr>\n// @for (col of row; track $index) {\n// <td [style]=\"'text-align: ' + valueAlignment()\">{{ col }}</td>\n// }\n// </tr>\n// }\n// </table>\n// }\n// `,\n// changeDetection: ChangeDetectionStrategy.OnPush\n// })\n// export class StringOrObjectRendererComponent implements OnInit {\n// value = input.required<any>();\n// valueAlignment = input<string>()\n// isString = computed(() => typeof this.value() === 'string');\n// objectAsArray = computed(() => {\n// const arrayValues = [];\n// const value = this.value();\n// if (typeof value !== 'string') {\n// for (const key in this.value()) {\n// const keyValue = this.value()[key];\n// arrayValues.push([key, keyValue]);\n// }\n// }\n// return arrayValues;\n// });\n\n// constructor() { }\n\n// ngOnInit() { }\n// }\n\n@Component({\n imports: [],\n selector: 'sp-fields-renderer',\n template: `\n @if (isString()) {\n {{ stringValue() }}\n } @else {\n <div class=\"\">\n <table>\n <tbody>\n @for (field of fields(); track $index) {\n <tr>\n <td [class]=\"field.class\">{{ field.label() }}&colon;</td>\n <td [class]=\"field.class\">{{ field.value(entity()) }}</td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n `,\n styles: `\n .field-values {\n padding: 0.2em 0;\n text-align: end;\n }\n tr td:first-of-type {\n padding-right: 1em;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FieldsRendererComponent<TEntity extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'> implements OnInit {\n entity = input.required<TEntity>();\n fields = input.required<SPEntityField<TEntity, IdKey>[]>();\n\n isString = computed(() => typeof this.fields() === 'string');\n // If the field is a single string, looks up entity's properties\n // for matching field name as the string and if it doesn't exist returns\n // the string itself as the value.\n stringValue = computed(() => {\n const fields = this.fields();\n if (typeof fields === 'string') {\n return (this.entity() as any)[fields] ?? fields;\n }\n return '';\n });\n\n constructor(public cdr: ChangeDetectorRef) {}\n\n ngOnInit() {}\n}\n\n/**\n * A component that renders a stationary with line items, such as invoice,\n * payment receipt, bill, bill payment record, journal entry, etc. All these\n * documents have a uniform format and this component abstracts out the\n * information displayed in this type of document as properties that the client\n * can provide while it takes care of the rendering.\n *\n * Ideally we would declare this as a wrapper class with the actual rendering\n * to be performed by an inner replaceable component. This way the app will be\n * able to support multiple stationary designs, which eventually can be\n * chosen by the user. Perhaps even providing them a feature to design the\n * stationary.\n *\n * This is the first towards that long path ahead.\n */\n@Component({\n imports: [\n CommonModule,\n UpperCasePipe,\n FieldsRendererComponent\n ],\n selector: 'sp-stationary-with-line-items',\n template: `\n <div class=\"stationary-wrapper mat-body\">\n <div class=\"title\">{{ title() }}</div>\n @if (number()) {\n <div class=\"number\">#{{ number() }}</div>\n }\n <div class=\"header\">\n <div class=\"left-header\">\n @if (leftHeaderTemplate()) {\n <ng-container *ngTemplateOutlet=\"leftHeaderTemplate() ?? null\"></ng-container>\n } @else {\n @if (leftHeader()) {\n @if (isString(leftHeader())) {\n {{ leftHeader() }}\n } @else {\n <sp-fields-renderer\n [entity]=\"entity()\"\n [fields]=\"_leftHeaderFields()\"\n ></sp-fields-renderer>\n }\n }\n }\n </div>\n <div class=\"right-header\">\n @if (rightHeaderTemplate()) {\n <ng-container *ngTemplateOutlet=\"rightHeaderTemplate() ?? null\"></ng-container>\n } @else {\n @if (rightHeader()) {\n @if (isString(rightHeader())) {\n {{ rightHeader() }}\n } @else {\n <sp-fields-renderer\n [entity]=\"entity()\"\n [fields]=\"_rightHeaderFields()\"\n ></sp-fields-renderer>\n }\n }\n }\n </div>\n </div> <!-- end <div class=\"header\"> -->\n\n <!-- items -->\n @if (itemColumnFields()) {\n <div class=\"items\">\n <table>\n <thead>\n @for (field of _itemColumnFields(); track $index) {\n <th [class]=\"field.class\" [style.text-align]=\"field.spec.valueOptions?.alignment\">{{ (fieldLabel(field) | async) | uppercase }}</th>\n }\n </thead>\n <tbody>\n <!-- enumerate each element of the 'items' array and render the\n specified columns for each. -->\n @for (row of _items(); track $index) {\n <tr>\n @for (field of _itemColumnFields(); track $index) {\n <td [class]=\"field.class\" [style.text-align]=\"field.spec.valueOptions?.alignment\" [innerHtml]=\"field.value(row)\"></td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n <!-- end items -->\n\n <!-- footer -->\n <div class=\"footer\">\n <div class=\"left-footer\">\n @if (leftFooterTemplate()) {\n <ng-container *ngTemplateOutlet=\"leftFooterTemplate() ?? null\"></ng-container>\n } @else {\n @if (leftFooter()) {\n @if (isString(leftFooter())) {\n {{ leftFooter() }}\n } @else {\n <sp-fields-renderer\n [entity]=\"entity()\"\n [fields]=\"_leftFooterFields()\"\n ></sp-fields-renderer>\n }\n }\n }\n </div>\n <div class=\"right-footer\">\n @if (rightFooterTemplate()) {\n <ng-container *ngTemplateOutlet=\"rightFooterTemplate() ?? null\"></ng-container>\n } @else {\n @if (rightFooter()) {\n @if (isString(rightFooter())) {\n {{ rightFooter() }}\n } @else {\n <sp-fields-renderer\n [entity]=\"entity()\"\n [fields]=\"_rightFooterFields()\"\n ></sp-fields-renderer>\n }\n }\n }\n </div>\n </div>\n </div>\n `,\n styles: `\n .stationary-wrapper {\n padding: 2em 1em;\n }\n .title {\n font-size: 1.6em;\n font-weight: 600;\n text-align: end;\n margin-bottom: 0.5em;\n }\n .number {\n font-size: 1.1em;\n font-weight: 500;\n text-align: end;\n margin-bottom: 0.5em;\n }\n .header, .footer {\n display: flex;\n flex-direction: row;\n margin-top: 1em;\n }\n .left-header, .left-footer {\n display: flex;\n align-items: bottom;\n text-align: start;\n padding-right: 1em;\n min-width: 50%;\n overflow-wrap: break-word;\n text-wrap: wrap;\n }\n .right-header, .right-footer {\n display: flex;\n justify-content: flex-end;\n min-width: 50%;\n overflow: clip;\n }\n .items {\n margin: 2em 0;\n }\n .items table {\n width: 100%;\n border: 0px solid lightgray;\n }\n .items table thead {\n background-color: black;\n color: white;\n & th {\n padding: 0.4em;\n }\n }\n .items table td {\n padding: 0.8em 0.4em;\n border-bottom: 1px solid lightgray;\n border-right: 0px solid lightgray\n }\n .footer {\n\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class StationaryWithLineItemsComponent<TEntity extends { [P in IdKey]: PropertyKey }, TEntityLineItem extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'> implements OnInit {\n entity = input.required<TEntity>();\n title = input.required<string>();\n number = input<string|number>();\n\n leftHeader = input<Array<SPEntityFieldSpec<TEntity, IdKey> | string>|string>();\n _leftHeaderFields = computed(() => this.getSPEntityFields(this.leftHeader()));\n leftHeaderTemplate = input<TemplateRef<any>>();\n\n rightHeader = input<Array<SPEntityFieldSpec<TEntity, IdKey> | string>|string>();\n _rightHeaderFields = computed(() => this.getSPEntityFields(this.rightHeader()));\n rightHeaderTemplate = input<TemplateRef<any>>();\n\n items = input<{[key: string]: string}[]>();\n\n leftFooter = input<Array<SPEntityFieldSpec<TEntity, IdKey> | string>|string>();\n _leftFooterFields = computed(() => this.getSPEntityFields(this.leftFooter()));\n leftFooterTemplate = input<TemplateRef<any>>();\n\n rightFooter = input<Array<SPEntityFieldSpec<TEntity, IdKey> | string>|string>();\n _rightFooterFields = computed(() => this.getSPEntityFields(this.rightFooter()));\n rightFooterTemplate = input<TemplateRef<any>>();\n\n itemFieldName = input<string>('items');\n itemColumnFields = input<Array<SPEntityFieldSpec<TEntity, IdKey> | string>>();\n _itemColumnFields = computed(() => this.getSPEntityFields(this.itemColumnFields()));\n\n _items = computed(() => (this.entity() as any)[this.itemFieldName()]);\n\n ngxEntityFieldConfig = inject(SP_ENTITY_FIELD_CONFIG, { optional: true })!;\n\n constructor() {}\n\n ngOnInit() {}\n\n isString(value: any) {\n return typeof value === 'string';\n }\n\n /**\n * Make the method a generic as we'll be using it for both TEntity and its\n * child TEntityLineItem objects.\n * @param fieldSpecs\n * @returns\n */\n getSPEntityFields<T>(fieldSpecs: Array<SPEntityFieldSpec<TEntity, IdKey> | string>|string|undefined): Array<SPEntityField<TEntity, IdKey>> {\n if (fieldSpecs && typeof fieldSpecs !== 'string') {\n return fieldSpecs.map(spec => new SPEntityField<TEntity, IdKey>(spec, this.ngxEntityFieldConfig));\n }\n return [];\n }\n\n fieldLabel(field: SPEntityField<TEntity, IdKey>): Observable<string> {\n const label = field.label()\n return label instanceof Observable ? label : of(label);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;MAkCa,uBAAuB,CAAA;AAgBf,IAAA,GAAA;AAfnB,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAW;AAClC,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAmC;AAE1D,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,OAAO,IAAI,CAAC,MAAM,EAAE,KAAK,QAAQ,CAAC;;;;AAI5D,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;AAC1B,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;AAC5B,QAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAC9B,OA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QAAA,EACS,+BAA+B,EAC/B,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGX,EA4DkB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,8uBAAA,CAAA,EAAA;;;AC7RnD;;AAEG;;;;"}
1
+ {"version":3,"file":"smallpearl-ngx-helper-stationary-with-line-items.mjs","sources":["../../../../projects/smallpearl/ngx-helper/stationary-with-line-items/src/stationary-with-line-items.component.ts","../../../../projects/smallpearl/ngx-helper/stationary-with-line-items/smallpearl-ngx-helper-stationary-with-line-items.ts"],"sourcesContent":["import { AsyncPipe, CommonModule, UpperCasePipe } from '@angular/common';\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, computed, inject, input, OnInit, TemplateRef } from '@angular/core';\nimport { SP_ENTITY_FIELD_CONFIG, SPEntityField, SPEntityFieldSpec } from '@smallpearl/ngx-helper/entity-field';\nimport { Observable, of } from 'rxjs';\n\n\n// @Component({\n// standalone: true,\n// imports: [],\n// selector: 'sp-string-or-object-renderer',\n// template: `\n// @if (isString()) {\n// {{ value() }}\n// } @else {\n// <table>\n// @for (row of objectAsArray(); track $index) {\n// <tr>\n// @for (col of row; track $index) {\n// <td [style]=\"'text-align: ' + valueAlignment()\">{{ col }}</td>\n// }\n// </tr>\n// }\n// </table>\n// }\n// `,\n// changeDetection: ChangeDetectionStrategy.OnPush\n// })\n// export class StringOrObjectRendererComponent implements OnInit {\n// value = input.required<any>();\n// valueAlignment = input<string>()\n// isString = computed(() => typeof this.value() === 'string');\n// objectAsArray = computed(() => {\n// const arrayValues = [];\n// const value = this.value();\n// if (typeof value !== 'string') {\n// for (const key in this.value()) {\n// const keyValue = this.value()[key];\n// arrayValues.push([key, keyValue]);\n// }\n// }\n// return arrayValues;\n// });\n\n// constructor() { }\n\n// ngOnInit() { }\n// }\n\n@Component({\n imports: [AsyncPipe],\n selector: 'sp-fields-renderer',\n template: `\n @if (isString()) {\n {{ stringValue() }}\n } @else {\n <div class=\"\">\n <table>\n <tbody>\n @for (field of fields(); track $index) {\n <tr>\n <td [class]=\"field.class\">{{ field.label() | async }}&colon;</td>\n <td [class]=\"field.class\">{{ field.value(entity()) }}</td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n `,\n styles: `\n .field-values {\n padding: 0.2em 0;\n text-align: end;\n }\n tr td:first-of-type {\n padding-right: 1em;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FieldsRendererComponent<TEntity extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'> implements OnInit {\n entity = input.required<TEntity>();\n fields = input.required<SPEntityField<TEntity, IdKey>[]>();\n\n isString = computed(() => typeof this.fields() === 'string');\n // If the field is a single string, looks up entity's properties\n // for matching field name as the string and if it doesn't exist returns\n // the string itself as the value.\n stringValue = computed(() => {\n const fields = this.fields();\n if (typeof fields === 'string') {\n return (this.entity() as any)[fields] ?? fields;\n }\n return '';\n });\n\n constructor(public cdr: ChangeDetectorRef) {}\n\n ngOnInit() {}\n}\n\n/**\n * A component that renders a stationary with line items, such as invoice,\n * payment receipt, bill, bill payment record, journal entry, etc. All these\n * documents have a uniform format and this component abstracts out the\n * information displayed in this type of document as properties that the client\n * can provide while it takes care of the rendering.\n *\n * Ideally we would declare this as a wrapper class with the actual rendering\n * to be performed by an inner replaceable component. This way the app will be\n * able to support multiple stationary designs, which eventually can be\n * chosen by the user. Perhaps even providing them a feature to design the\n * stationary.\n *\n * This is the first towards that long path ahead.\n */\n@Component({\n imports: [\n CommonModule,\n UpperCasePipe,\n FieldsRendererComponent\n ],\n selector: 'sp-stationary-with-line-items',\n template: `\n <div class=\"stationary-wrapper mat-body\">\n <div class=\"title\">{{ title() }}</div>\n @if (number()) {\n <div class=\"number\">#{{ number() }}</div>\n }\n <div class=\"header\">\n <div class=\"left-header\">\n @if (leftHeaderTemplate()) {\n <ng-container *ngTemplateOutlet=\"leftHeaderTemplate() ?? null\"></ng-container>\n } @else {\n @if (leftHeader()) {\n @if (isString(leftHeader())) {\n {{ leftHeader() }}\n } @else {\n <sp-fields-renderer\n [entity]=\"entity()\"\n [fields]=\"_leftHeaderFields()\"\n ></sp-fields-renderer>\n }\n }\n }\n </div>\n <div class=\"right-header\">\n @if (rightHeaderTemplate()) {\n <ng-container *ngTemplateOutlet=\"rightHeaderTemplate() ?? null\"></ng-container>\n } @else {\n @if (rightHeader()) {\n @if (isString(rightHeader())) {\n {{ rightHeader() }}\n } @else {\n <sp-fields-renderer\n [entity]=\"entity()\"\n [fields]=\"_rightHeaderFields()\"\n ></sp-fields-renderer>\n }\n }\n }\n </div>\n </div> <!-- end <div class=\"header\"> -->\n\n <!-- items -->\n @if (itemColumnFields()) {\n <div class=\"items\">\n <table>\n <thead>\n @for (field of _itemColumnFields(); track $index) {\n <th [class]=\"field.class\" [style.text-align]=\"field.spec.valueOptions?.alignment\">{{ (fieldLabel(field) | async) | uppercase }}</th>\n }\n </thead>\n <tbody>\n <!-- enumerate each element of the 'items' array and render the\n specified columns for each. -->\n @for (row of _items(); track $index) {\n <tr>\n @for (field of _itemColumnFields(); track $index) {\n <td [class]=\"field.class\" [style.text-align]=\"field.spec.valueOptions?.alignment\" [innerHtml]=\"field.value(row)\"></td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n <!-- end items -->\n\n <!-- footer -->\n <div class=\"footer\">\n <div class=\"left-footer\">\n @if (leftFooterTemplate()) {\n <ng-container *ngTemplateOutlet=\"leftFooterTemplate() ?? null\"></ng-container>\n } @else {\n @if (leftFooter()) {\n @if (isString(leftFooter())) {\n {{ leftFooter() }}\n } @else {\n <sp-fields-renderer\n [entity]=\"entity()\"\n [fields]=\"_leftFooterFields()\"\n ></sp-fields-renderer>\n }\n }\n }\n </div>\n <div class=\"right-footer\">\n @if (rightFooterTemplate()) {\n <ng-container *ngTemplateOutlet=\"rightFooterTemplate() ?? null\"></ng-container>\n } @else {\n @if (rightFooter()) {\n @if (isString(rightFooter())) {\n {{ rightFooter() }}\n } @else {\n <sp-fields-renderer\n [entity]=\"entity()\"\n [fields]=\"_rightFooterFields()\"\n ></sp-fields-renderer>\n }\n }\n }\n </div>\n </div>\n </div>\n `,\n styles: `\n .stationary-wrapper {\n padding: 2em 1em;\n }\n .title {\n font-size: 1.6em;\n font-weight: 600;\n text-align: end;\n margin-bottom: 0.5em;\n }\n .number {\n font-size: 1.1em;\n font-weight: 500;\n text-align: end;\n margin-bottom: 0.5em;\n }\n .header, .footer {\n display: flex;\n flex-direction: row;\n margin-top: 1em;\n }\n .left-header, .left-footer {\n display: flex;\n align-items: bottom;\n text-align: start;\n padding-right: 1em;\n min-width: 50%;\n overflow-wrap: break-word;\n text-wrap: wrap;\n }\n .right-header, .right-footer {\n display: flex;\n justify-content: flex-end;\n min-width: 50%;\n overflow: clip;\n }\n .items {\n margin: 2em 0;\n }\n .items table {\n width: 100%;\n border: 0px solid lightgray;\n }\n .items table thead {\n background-color: black;\n color: white;\n & th {\n padding: 0.4em;\n }\n }\n .items table td {\n padding: 0.8em 0.4em;\n border-bottom: 1px solid lightgray;\n border-right: 0px solid lightgray\n }\n .footer {\n\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class StationaryWithLineItemsComponent<TEntity extends { [P in IdKey]: PropertyKey }, TEntityLineItem extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'> implements OnInit {\n entity = input.required<TEntity>();\n title = input.required<string>();\n number = input<string|number>();\n\n leftHeader = input<Array<SPEntityFieldSpec<TEntity, IdKey> | string>|string>();\n _leftHeaderFields = computed(() => this.getSPEntityFields(this.leftHeader()));\n leftHeaderTemplate = input<TemplateRef<any>>();\n\n rightHeader = input<Array<SPEntityFieldSpec<TEntity, IdKey> | string>|string>();\n _rightHeaderFields = computed(() => this.getSPEntityFields(this.rightHeader()));\n rightHeaderTemplate = input<TemplateRef<any>>();\n\n items = input<{[key: string]: string}[]>();\n\n leftFooter = input<Array<SPEntityFieldSpec<TEntity, IdKey> | string>|string>();\n _leftFooterFields = computed(() => this.getSPEntityFields(this.leftFooter()));\n leftFooterTemplate = input<TemplateRef<any>>();\n\n rightFooter = input<Array<SPEntityFieldSpec<TEntity, IdKey> | string>|string>();\n _rightFooterFields = computed(() => this.getSPEntityFields(this.rightFooter()));\n rightFooterTemplate = input<TemplateRef<any>>();\n\n itemFieldName = input<string>('items');\n itemColumnFields = input<Array<SPEntityFieldSpec<TEntity, IdKey> | string>>();\n _itemColumnFields = computed(() => this.getSPEntityFields(this.itemColumnFields()));\n\n _items = computed(() => (this.entity() as any)[this.itemFieldName()]);\n\n ngxEntityFieldConfig = inject(SP_ENTITY_FIELD_CONFIG, { optional: true })!;\n\n constructor() {}\n\n ngOnInit() {}\n\n isString(value: any) {\n return typeof value === 'string';\n }\n\n /**\n * Make the method a generic as we'll be using it for both TEntity and its\n * child TEntityLineItem objects.\n * @param fieldSpecs\n * @returns\n */\n getSPEntityFields<T>(fieldSpecs: Array<SPEntityFieldSpec<TEntity, IdKey> | string>|string|undefined): Array<SPEntityField<TEntity, IdKey>> {\n if (fieldSpecs && typeof fieldSpecs !== 'string') {\n return fieldSpecs.map(spec => new SPEntityField<TEntity, IdKey>(spec, this.ngxEntityFieldConfig));\n }\n return [];\n }\n\n fieldLabel(field: SPEntityField<TEntity, IdKey>): Observable<string> {\n const label = field.label()\n if (label) {\n return label instanceof Observable ? label : of(label as string);\n }\n return of('');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;MAkCa,uBAAuB,CAAA;AAg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AA,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGX,EA3GK,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,8uBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,YAAY,wTAtCP,uBAAuB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FA+MvB,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBA3K5C,SAAS;AACG,YAAA,IAAA,EAAA,CAAA,EAAA,OAAA,EAAA;wBACL,YAAY;wBACZ,aAAa;wBACb;AACH,qBAAA,EAAA,QAAA,EACS,+BAA+B,EAC/B,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGX,EA4DkB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,8uBAAA,CAAA,EAAA;;;AC7RnD;;AAEG;;;;"}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "path": "src/assets/i18n/"
7
7
  }
8
8
  ],
9
- "version": "0.33.14",
9
+ "version": "0.33.15",
10
10
  "peerDependencies": {
11
11
  "@angular/common": "^19.1.0",
12
12
  "@angular/core": "^19.1.0",
@@ -48,13 +48,9 @@
48
48
  "types": "./entities/index.d.ts",
49
49
  "default": "./fesm2022/smallpearl-ngx-helper-entities.mjs"
50
50
  },
51
- "./forms": {
52
- "types": "./forms/index.d.ts",
53
- "default": "./fesm2022/smallpearl-ngx-helper-forms.mjs"
54
- },
55
- "./hover-dropdown": {
56
- "types": "./hover-dropdown/index.d.ts",
57
- "default": "./fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs"
51
+ "./entity-field": {
52
+ "types": "./entity-field/index.d.ts",
53
+ "default": "./fesm2022/smallpearl-ngx-helper-entity-field.mjs"
58
54
  },
59
55
  "./locale": {
60
56
  "types": "./locale/index.d.ts",
@@ -64,9 +60,13 @@
64
60
  "types": "./mat-busy-wheel/index.d.ts",
65
61
  "default": "./fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs"
66
62
  },
67
- "./entity-field": {
68
- "types": "./entity-field/index.d.ts",
69
- "default": "./fesm2022/smallpearl-ngx-helper-entity-field.mjs"
63
+ "./forms": {
64
+ "types": "./forms/index.d.ts",
65
+ "default": "./fesm2022/smallpearl-ngx-helper-forms.mjs"
66
+ },
67
+ "./hover-dropdown": {
68
+ "types": "./hover-dropdown/index.d.ts",
69
+ "default": "./fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs"
70
70
  },
71
71
  "./mat-context-menu": {
72
72
  "types": "./mat-context-menu/index.d.ts",