ngssm-data 21.1.7 → 21.1.9

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.
@@ -279,10 +279,10 @@ class NgssmDataSourceValueSetter {
279
279
  throw new Error(`Data source '${datasourceKey}' is not initialized.`);
280
280
  }
281
281
  }
282
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgssmDataSourceValueSetter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
283
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgssmDataSourceValueSetter });
282
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NgssmDataSourceValueSetter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
283
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NgssmDataSourceValueSetter });
284
284
  }
285
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgssmDataSourceValueSetter, decorators: [{
285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NgssmDataSourceValueSetter, decorators: [{
286
286
  type: Injectable
287
287
  }] });
288
288
  const ngssmDataSourceValueSetter = () => TestBed.inject(NgssmDataSourceValueSetter);
@@ -1 +1 @@
1
- {"version":3,"file":"ngssm-data-testing.mjs","sources":["../../../projects/ngssm-data/testing/src/ngssm-data-source-value-setter.ts","../../../projects/ngssm-data/testing/src/provide-ngssm-data-testing.ts","../../../projects/ngssm-data/testing/ngssm-data-testing.ts"],"sourcesContent":["import { HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { TestBed } from '@angular/core/testing';\nimport { NgssmDataSourceValueStatus, selectNgssmDataSourceValue, updateNgssmDataState } from 'ngssm-data';\n\nimport { Store } from 'ngssm-store';\nimport { StoreMock } from 'ngssm-store/testing';\n\n/**\n * Utility service for setting and updating data source values, status, parameters, and additional properties\n * in the StoreMock during tests.\n *\n * Provides methods to:\n * - apply direct updates to a data source value (status, value, parameter),\n * - manage additional properties (set value/status and set per-property http errors),\n * - set/clear overall parameter validity (parameterIsValid) or partial validity entries\n * (parameterPartialValidity map) for per-field validation,\n * - mark a data source value as outdated (valueOutdated flag) when parameters change,\n * - set a top-level httpErrorResponse on the data source value (setDataSourceError).\n *\n * All methods return the NgssmDataSourceValueSetter instance for fluent chaining.\n */\n@Injectable()\nexport class NgssmDataSourceValueSetter {\n public readonly store = inject(Store) as unknown as StoreMock;\n\n /**\n * Sets the status of a data source in the StoreMock.\n * Throws an error if the data source is not found.\n * @param datasourceKey The key of the data source.\n * @param status The new status to set.\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setDataSourceStatus(datasourceKey: string, status: NgssmDataSourceValueStatus): NgssmDataSourceValueSetter {\n this.checkDataSource(datasourceKey);\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [datasourceKey]: {\n status: { $set: status }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets the value of a data source in the StoreMock.\n * Throws an error if the data source is not found.\n * @param datasourceKey The key of the data source.\n * @param value The value to set.\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setDataSourceValue<T>(datasourceKey: string, value?: T): NgssmDataSourceValueSetter {\n this.checkDataSource(datasourceKey);\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [datasourceKey]: {\n value: { $set: value }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets the parameter of a data source in the StoreMock.\n * Throws an error if the data source is not found.\n * @param datasourceKey The key of the data source.\n * @param value The parameter value to set.\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setDataSourceParameter<T>(datasourceKey: string, value?: T): NgssmDataSourceValueSetter {\n this.checkDataSource(datasourceKey);\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [datasourceKey]: {\n parameter: { $set: value }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets or clears the top-level HTTP error response for a data source in the StoreMock.\n *\n * This is useful in tests to simulate an error that occurred while loading the main data source value.\n * The method ensures the data source is initialized and updates the data source's httpErrorResponse\n * field with the provided HttpErrorResponse or clears it when undefined is passed.\n *\n * @param datasourceKey The key of the data source to update.\n * @param error Optional HttpErrorResponse to set; pass undefined to clear the error.\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setDataSourceError(datasourceKey: string, error?: HttpErrorResponse): NgssmDataSourceValueSetter {\n this.checkDataSource(datasourceKey);\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [datasourceKey]: {\n httpErrorResponse: { $set: error }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets an additional property for a data source in the StoreMock.\n * Throws an error if the data source is not found.\n * @param datasourceKey The key of the data source.\n * @param additionalProperty The name of the additional property.\n * @param value The value to set for the additional property.\n * @param status The status to set for the additional property (defaults to loaded).\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setAdditionalProperty<T>(\n datasourceKey: string,\n additionalProperty: string,\n value?: T,\n status: NgssmDataSourceValueStatus = NgssmDataSourceValueStatus.loaded\n ): NgssmDataSourceValueSetter {\n this.checkDataSource(datasourceKey);\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [datasourceKey]: {\n additionalProperties: {\n [additionalProperty]: {\n $set: {\n value,\n status\n }\n }\n }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets the HTTP error response for a specific additional property of a data source in the StoreMock.\n *\n * Use this in tests to simulate a failure when loading an additional property (e.g. row detail).\n * Ensures the data source is initialized and sets or clears the additional property's httpErrorResponse.\n *\n * @param datasourceKey The key of the data source that owns the additional property.\n * @param additionalProperty The name of the additional property to update.\n * @param error Optional HttpErrorResponse to set; pass undefined to clear the error.\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setAdditionalPropertyError(\n datasourceKey: string,\n additionalProperty: string,\n error?: HttpErrorResponse\n ): NgssmDataSourceValueSetter {\n this.checkDataSource(datasourceKey);\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [datasourceKey]: {\n additionalProperties: {\n [additionalProperty]: {\n httpErrorResponse: { $set: error }\n }\n }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets the validity of a data source parameter.\n *\n * If partialKey is provided, the method updates the parameterPartialValidity map for the\n * specified data source (creating the map if it does not exist) and sets the boolean validity\n * for that partial key. If partialKey is not provided, the method updates the overall\n * parameterIsValid boolean for the data source.\n *\n * This method returns the NgssmDataSourceValueSetter for chaining.\n *\n * @param dataSourceKey The key of the data source whose parameter validity should be updated.\n * @param isValid True when the (partial) parameter is valid, false otherwise.\n * @param partialKey Optional identifier of a parameter sub-field to set partial validity for.\n */\n public setParameterValidity(dataSourceKey: string, isValid: boolean, partialKey?: string): NgssmDataSourceValueSetter {\n // Ensure the data source is initialized before updating validity\n this.checkDataSource(dataSourceKey);\n\n if (partialKey) {\n if (selectNgssmDataSourceValue(this.store.stateValue, dataSourceKey)?.parameterPartialValidity) {\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [dataSourceKey]: {\n parameterPartialValidity: {\n [partialKey]: { $set: isValid }\n }\n }\n }\n });\n } else {\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [dataSourceKey]: {\n parameterPartialValidity: {\n $set: {\n [partialKey]: isValid\n }\n }\n }\n }\n });\n }\n } else {\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [dataSourceKey]: {\n parameterIsValid: {\n $set: isValid\n }\n }\n }\n });\n }\n\n return this;\n }\n\n /**\n * Clears parameter validity information for a data source.\n *\n * If partialKey is provided, removes the partial validity entry for that key (if present).\n * If partialKey is not provided, resets the overall parameterIsValid flag to undefined.\n *\n * Returns the NgssmDataSourceValueSetter instance to allow method chaining.\n *\n * @param dataSourceKey The key of the data source whose parameter validity should be cleared.\n * @param partialKey Optional identifier of a parameter sub-field to clear partial validity for.\n */\n public clearParameterValidity(dataSourceKey: string, partialKey?: string): NgssmDataSourceValueSetter {\n // Ensure the data source is initialized before clearing validity\n this.checkDataSource(dataSourceKey);\n\n if (partialKey) {\n if (selectNgssmDataSourceValue(this.store.stateValue, dataSourceKey)?.parameterPartialValidity) {\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [dataSourceKey]: {\n parameterPartialValidity: { $unset: [partialKey] }\n }\n }\n });\n }\n } else {\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [dataSourceKey]: {\n parameterIsValid: {\n $set: undefined\n }\n }\n }\n });\n }\n\n return this;\n }\n\n /**\n * Sets or clears the \"valueOutdated\" flag for a data source.\n *\n * The flag indicates that the current stored value is outdated relative to its parameter\n * (for example, the parameter has changed and the value should be reloaded).\n *\n * @param dataSourceKey The key of the data source to update.\n * @param outdated True to mark the value as outdated, false to mark it as up-to-date.\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setOutdatedValueFlag(dataSourceKey: string, outdated: boolean): NgssmDataSourceValueSetter {\n // Ensure the data source is initialized before updating the outdated flag\n this.checkDataSource(dataSourceKey);\n\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [dataSourceKey]: {\n valueOutdated: {\n $set: outdated\n }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Checks if the specified data source is initialized in the StoreMock.\n * Throws an error if the data source is not found.\n * @param datasourceKey The key of the data source to check.\n */\n public checkDataSource(datasourceKey: string) {\n const dataSourceValue = selectNgssmDataSourceValue(this.store.stateValue, datasourceKey);\n if (!dataSourceValue) {\n throw new Error(`Data source '${datasourceKey}' is not initialized.`);\n }\n }\n}\n\nexport const ngssmDataSourceValueSetter = () => TestBed.inject(NgssmDataSourceValueSetter);\n","import { EnvironmentProviders, inject, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';\n\nimport {\n NGSSM_DATA_SOURCE,\n NgssmDataSource,\n NgssmDataSourceValueStatus,\n NgssmDataStateSpecification,\n updateNgssmDataState\n} from 'ngssm-data';\nimport { Logger, Store } from 'ngssm-store';\nimport { StoreMock } from 'ngssm-store/testing';\n\nimport { NgssmDataSourceValueSetter } from './ngssm-data-source-value-setter';\n\nexport const ngssmDataStateAndSourcesInitializer = () => {\n const logger = inject(Logger);\n logger.information('[ngssm-data-testing] Initialization of state and sources');\n const store = inject(Store);\n if (!(store instanceof StoreMock)) {\n throw new Error('StoreMock is not registered.');\n }\n\n store.stateValue = {\n ...store.stateValue,\n [NgssmDataStateSpecification.featureStateKey]: NgssmDataStateSpecification.initialState\n };\n\n const dataSources = (inject(NGSSM_DATA_SOURCE, { optional: true }) as unknown as NgssmDataSource[]) ?? [];\n store.stateValue = dataSources.reduce((previous, current) => {\n return updateNgssmDataState(previous, {\n dataSourceValues: {\n [current.key]: {\n $set: {\n status: NgssmDataSourceValueStatus.none,\n additionalProperties: {}\n }\n }\n }\n });\n }, store.stateValue);\n};\n\nexport const provideNgssmDataTesting = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideAppInitializer(ngssmDataStateAndSourcesInitializer), NgssmDataSourceValueSetter]);\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAQA;;;;;;;;;;;;;AAaG;MAEU,0BAA0B,CAAA;AACrB,IAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAyB;AAE7D;;;;;;AAMG;IACI,mBAAmB,CAAC,aAAqB,EAAE,MAAkC,EAAA;AAClF,QAAA,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC;AACnC,QAAA,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAA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../../projects/ngssm-data/testing/src/provide-ngssm-data-testing.ts","../../../projects/ngssm-data/testing/ngssm-data-testing.ts"],"sourcesContent":["import { HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { TestBed } from '@angular/core/testing';\nimport { NgssmDataSourceValueStatus, selectNgssmDataSourceValue, updateNgssmDataState } from 'ngssm-data';\n\nimport { Store } from 'ngssm-store';\nimport { StoreMock } from 'ngssm-store/testing';\n\n/**\n * Utility service for setting and updating data source values, status, parameters, and additional properties\n * in the StoreMock during tests.\n *\n * Provides methods to:\n * - apply direct updates to a data source value (status, value, parameter),\n * - manage additional properties (set value/status and set per-property http errors),\n * - set/clear overall parameter validity (parameterIsValid) or partial validity entries\n * (parameterPartialValidity map) for per-field validation,\n * - mark a data source value as outdated (valueOutdated flag) when parameters change,\n * - set a top-level httpErrorResponse on the data source value (setDataSourceError).\n *\n * All methods return the NgssmDataSourceValueSetter instance for fluent chaining.\n */\n@Injectable()\nexport class NgssmDataSourceValueSetter {\n public readonly store = inject(Store) as unknown as StoreMock;\n\n /**\n * Sets the status of a data source in the StoreMock.\n * Throws an error if the data source is not found.\n * @param datasourceKey The key of the data source.\n * @param status The new status to set.\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setDataSourceStatus(datasourceKey: string, status: NgssmDataSourceValueStatus): NgssmDataSourceValueSetter {\n this.checkDataSource(datasourceKey);\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [datasourceKey]: {\n status: { $set: status }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets the value of a data source in the StoreMock.\n * Throws an error if the data source is not found.\n * @param datasourceKey The key of the data source.\n * @param value The value to set.\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setDataSourceValue<T>(datasourceKey: string, value?: T): NgssmDataSourceValueSetter {\n this.checkDataSource(datasourceKey);\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [datasourceKey]: {\n value: { $set: value }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets the parameter of a data source in the StoreMock.\n * Throws an error if the data source is not found.\n * @param datasourceKey The key of the data source.\n * @param value The parameter value to set.\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setDataSourceParameter<T>(datasourceKey: string, value?: T): NgssmDataSourceValueSetter {\n this.checkDataSource(datasourceKey);\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [datasourceKey]: {\n parameter: { $set: value }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets or clears the top-level HTTP error response for a data source in the StoreMock.\n *\n * This is useful in tests to simulate an error that occurred while loading the main data source value.\n * The method ensures the data source is initialized and updates the data source's httpErrorResponse\n * field with the provided HttpErrorResponse or clears it when undefined is passed.\n *\n * @param datasourceKey The key of the data source to update.\n * @param error Optional HttpErrorResponse to set; pass undefined to clear the error.\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setDataSourceError(datasourceKey: string, error?: HttpErrorResponse): NgssmDataSourceValueSetter {\n this.checkDataSource(datasourceKey);\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [datasourceKey]: {\n httpErrorResponse: { $set: error }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets an additional property for a data source in the StoreMock.\n * Throws an error if the data source is not found.\n * @param datasourceKey The key of the data source.\n * @param additionalProperty The name of the additional property.\n * @param value The value to set for the additional property.\n * @param status The status to set for the additional property (defaults to loaded).\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setAdditionalProperty<T>(\n datasourceKey: string,\n additionalProperty: string,\n value?: T,\n status: NgssmDataSourceValueStatus = NgssmDataSourceValueStatus.loaded\n ): NgssmDataSourceValueSetter {\n this.checkDataSource(datasourceKey);\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [datasourceKey]: {\n additionalProperties: {\n [additionalProperty]: {\n $set: {\n value,\n status\n }\n }\n }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets the HTTP error response for a specific additional property of a data source in the StoreMock.\n *\n * Use this in tests to simulate a failure when loading an additional property (e.g. row detail).\n * Ensures the data source is initialized and sets or clears the additional property's httpErrorResponse.\n *\n * @param datasourceKey The key of the data source that owns the additional property.\n * @param additionalProperty The name of the additional property to update.\n * @param error Optional HttpErrorResponse to set; pass undefined to clear the error.\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setAdditionalPropertyError(\n datasourceKey: string,\n additionalProperty: string,\n error?: HttpErrorResponse\n ): NgssmDataSourceValueSetter {\n this.checkDataSource(datasourceKey);\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [datasourceKey]: {\n additionalProperties: {\n [additionalProperty]: {\n httpErrorResponse: { $set: error }\n }\n }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets the validity of a data source parameter.\n *\n * If partialKey is provided, the method updates the parameterPartialValidity map for the\n * specified data source (creating the map if it does not exist) and sets the boolean validity\n * for that partial key. If partialKey is not provided, the method updates the overall\n * parameterIsValid boolean for the data source.\n *\n * This method returns the NgssmDataSourceValueSetter for chaining.\n *\n * @param dataSourceKey The key of the data source whose parameter validity should be updated.\n * @param isValid True when the (partial) parameter is valid, false otherwise.\n * @param partialKey Optional identifier of a parameter sub-field to set partial validity for.\n */\n public setParameterValidity(dataSourceKey: string, isValid: boolean, partialKey?: string): NgssmDataSourceValueSetter {\n // Ensure the data source is initialized before updating validity\n this.checkDataSource(dataSourceKey);\n\n if (partialKey) {\n if (selectNgssmDataSourceValue(this.store.stateValue, dataSourceKey)?.parameterPartialValidity) {\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [dataSourceKey]: {\n parameterPartialValidity: {\n [partialKey]: { $set: isValid }\n }\n }\n }\n });\n } else {\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [dataSourceKey]: {\n parameterPartialValidity: {\n $set: {\n [partialKey]: isValid\n }\n }\n }\n }\n });\n }\n } else {\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [dataSourceKey]: {\n parameterIsValid: {\n $set: isValid\n }\n }\n }\n });\n }\n\n return this;\n }\n\n /**\n * Clears parameter validity information for a data source.\n *\n * If partialKey is provided, removes the partial validity entry for that key (if present).\n * If partialKey is not provided, resets the overall parameterIsValid flag to undefined.\n *\n * Returns the NgssmDataSourceValueSetter instance to allow method chaining.\n *\n * @param dataSourceKey The key of the data source whose parameter validity should be cleared.\n * @param partialKey Optional identifier of a parameter sub-field to clear partial validity for.\n */\n public clearParameterValidity(dataSourceKey: string, partialKey?: string): NgssmDataSourceValueSetter {\n // Ensure the data source is initialized before clearing validity\n this.checkDataSource(dataSourceKey);\n\n if (partialKey) {\n if (selectNgssmDataSourceValue(this.store.stateValue, dataSourceKey)?.parameterPartialValidity) {\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [dataSourceKey]: {\n parameterPartialValidity: { $unset: [partialKey] }\n }\n }\n });\n }\n } else {\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [dataSourceKey]: {\n parameterIsValid: {\n $set: undefined\n }\n }\n }\n });\n }\n\n return this;\n }\n\n /**\n * Sets or clears the \"valueOutdated\" flag for a data source.\n *\n * The flag indicates that the current stored value is outdated relative to its parameter\n * (for example, the parameter has changed and the value should be reloaded).\n *\n * @param dataSourceKey The key of the data source to update.\n * @param outdated True to mark the value as outdated, false to mark it as up-to-date.\n * @returns The NgssmDataSourceValueSetter instance for chaining.\n */\n public setOutdatedValueFlag(dataSourceKey: string, outdated: boolean): NgssmDataSourceValueSetter {\n // Ensure the data source is initialized before updating the outdated flag\n this.checkDataSource(dataSourceKey);\n\n this.store.stateValue = updateNgssmDataState(this.store.stateValue, {\n dataSourceValues: {\n [dataSourceKey]: {\n valueOutdated: {\n $set: outdated\n }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Checks if the specified data source is initialized in the StoreMock.\n * Throws an error if the data source is not found.\n * @param datasourceKey The key of the data source to check.\n */\n public checkDataSource(datasourceKey: string) {\n const dataSourceValue = selectNgssmDataSourceValue(this.store.stateValue, datasourceKey);\n if (!dataSourceValue) {\n throw new Error(`Data source '${datasourceKey}' is not initialized.`);\n }\n }\n}\n\nexport const ngssmDataSourceValueSetter = () => TestBed.inject(NgssmDataSourceValueSetter);\n","import { EnvironmentProviders, inject, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';\n\nimport {\n NGSSM_DATA_SOURCE,\n NgssmDataSource,\n NgssmDataSourceValueStatus,\n NgssmDataStateSpecification,\n updateNgssmDataState\n} from 'ngssm-data';\nimport { Logger, Store } from 'ngssm-store';\nimport { StoreMock } from 'ngssm-store/testing';\n\nimport { NgssmDataSourceValueSetter } from './ngssm-data-source-value-setter';\n\nexport const ngssmDataStateAndSourcesInitializer = () => {\n const logger = inject(Logger);\n logger.information('[ngssm-data-testing] Initialization of state and sources');\n const store = inject(Store);\n if (!(store instanceof StoreMock)) {\n throw new Error('StoreMock is not registered.');\n }\n\n store.stateValue = {\n ...store.stateValue,\n [NgssmDataStateSpecification.featureStateKey]: NgssmDataStateSpecification.initialState\n };\n\n const dataSources = (inject(NGSSM_DATA_SOURCE, { optional: true }) as unknown as NgssmDataSource[]) ?? [];\n store.stateValue = dataSources.reduce((previous, current) => {\n return updateNgssmDataState(previous, {\n dataSourceValues: {\n [current.key]: {\n $set: {\n status: NgssmDataSourceValueStatus.none,\n additionalProperties: {}\n }\n }\n }\n });\n }, store.stateValue);\n};\n\nexport const provideNgssmDataTesting = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideAppInitializer(ngssmDataStateAndSourcesInitializer), NgssmDataSourceValueSetter]);\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAQA;;;;;;;;;;;;;AAaG;MAEU,0BAA0B,CAAA;AACrB,IAAA,K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uBAAuB,GAAG,MAA2B;IAChE,OAAO,wBAAwB,CAAC,CAAC,qBAAqB,CAAC,mCAAmC,CAAC,EAAE,0BAA0B,CAAC,CAAC;AAC3H;;AC5CA;;AAEG;;;;"}
@@ -359,10 +359,10 @@ class DataSourcesRegistrationReducer {
359
359
  }
360
360
  return state;
361
361
  }
362
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataSourcesRegistrationReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
363
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataSourcesRegistrationReducer });
362
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataSourcesRegistrationReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
363
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataSourcesRegistrationReducer });
364
364
  }
365
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataSourcesRegistrationReducer, decorators: [{
365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataSourcesRegistrationReducer, decorators: [{
366
366
  type: Injectable
367
367
  }] });
368
368
 
@@ -418,10 +418,10 @@ class DataSourceValueReducer {
418
418
  }
419
419
  return state;
420
420
  }
421
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataSourceValueReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
422
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataSourceValueReducer });
421
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataSourceValueReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
422
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataSourceValueReducer });
423
423
  }
424
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataSourceValueReducer, decorators: [{
424
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataSourceValueReducer, decorators: [{
425
425
  type: Injectable
426
426
  }] });
427
427
 
@@ -516,10 +516,10 @@ class LoadDataSourceValueReducer {
516
516
  }
517
517
  return state;
518
518
  }
519
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadDataSourceValueReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
520
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadDataSourceValueReducer });
519
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: LoadDataSourceValueReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
520
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: LoadDataSourceValueReducer });
521
521
  }
522
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadDataSourceValueReducer, decorators: [{
522
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: LoadDataSourceValueReducer, decorators: [{
523
523
  type: Injectable
524
524
  }] });
525
525
 
@@ -586,10 +586,10 @@ class DataSourceAdditionalPropertyValueReducer {
586
586
  }
587
587
  return state;
588
588
  }
589
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataSourceAdditionalPropertyValueReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
590
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataSourceAdditionalPropertyValueReducer });
589
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataSourceAdditionalPropertyValueReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
590
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataSourceAdditionalPropertyValueReducer });
591
591
  }
592
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataSourceAdditionalPropertyValueReducer, decorators: [{
592
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataSourceAdditionalPropertyValueReducer, decorators: [{
593
593
  type: Injectable
594
594
  }] });
595
595
 
@@ -747,10 +747,10 @@ class DataSourceParameterReducer {
747
747
  }
748
748
  });
749
749
  }
750
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataSourceParameterReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
751
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataSourceParameterReducer });
750
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataSourceParameterReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
751
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataSourceParameterReducer });
752
752
  }
753
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataSourceParameterReducer, decorators: [{
753
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataSourceParameterReducer, decorators: [{
754
754
  type: Injectable
755
755
  }] });
756
756
 
@@ -828,10 +828,10 @@ class DataLoadingEffect {
828
828
  }
829
829
  }
830
830
  }
831
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataLoadingEffect, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
832
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataLoadingEffect });
831
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataLoadingEffect, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
832
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataLoadingEffect });
833
833
  }
834
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataLoadingEffect, decorators: [{
834
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataLoadingEffect, decorators: [{
835
835
  type: Injectable
836
836
  }] });
837
837
 
@@ -967,10 +967,10 @@ class IsNgssmDataSourceValueStatusPipe {
967
967
  const itemStatus = selectNgssmDataSourceValue(value, key).status;
968
968
  return expectedStatuses.includes(itemStatus);
969
969
  }
970
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IsNgssmDataSourceValueStatusPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
971
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: IsNgssmDataSourceValueStatusPipe, isStandalone: true, name: "isNgssmDataSourceValueStatus" });
970
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: IsNgssmDataSourceValueStatusPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
971
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: IsNgssmDataSourceValueStatusPipe, isStandalone: true, name: "isNgssmDataSourceValueStatus" });
972
972
  }
973
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IsNgssmDataSourceValueStatusPipe, decorators: [{
973
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: IsNgssmDataSourceValueStatusPipe, decorators: [{
974
974
  type: Pipe,
975
975
  args: [{
976
976
  name: 'isNgssmDataSourceValueStatus'
@@ -981,6 +981,7 @@ class NgssmAutoReloadComponent {
981
981
  autoReloadAction = input(() => {
982
982
  // nothing by default
983
983
  }, ...(ngDevMode ? [{ debugName: "autoReloadAction" }] : /* istanbul ignore next */ []));
984
+ initialReloadType = input('Off', ...(ngDevMode ? [{ debugName: "initialReloadType" }] : /* istanbul ignore next */ []));
984
985
  reloadTypes = getNgssmDataSourceValueAutoReloadTypes();
985
986
  reloadTypeControl = new FormControl('Off');
986
987
  timerId;
@@ -1003,19 +1004,22 @@ class NgssmAutoReloadComponent {
1003
1004
  this.timerId = setInterval(this.autoReloadAction(), period);
1004
1005
  });
1005
1006
  }
1007
+ ngOnInit() {
1008
+ this.reloadTypeControl.setValue(this.initialReloadType());
1009
+ }
1006
1010
  ngOnDestroy() {
1007
1011
  if (this.timerId) {
1008
1012
  clearInterval(this.timerId);
1009
1013
  this.timerId = undefined;
1010
1014
  }
1011
1015
  }
1012
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgssmAutoReloadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1013
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: NgssmAutoReloadComponent, isStandalone: true, selector: "ngssm-auto-reload", inputs: { autoReloadAction: { classPropertyName: "autoReloadAction", publicName: "autoReloadAction", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-form-field>\n <mat-label>Select auto reload period</mat-label>\n <mat-select [formControl]=\"reloadTypeControl\">\n @for (option of reloadTypes; track option.value){\n <mat-option [value]=\"option.value\">\n {{option.label}}\n </mat-option>\n }\n </mat-select>\n</mat-form-field>", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1016
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NgssmAutoReloadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1017
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: NgssmAutoReloadComponent, isStandalone: true, selector: "ngssm-auto-reload", inputs: { autoReloadAction: { classPropertyName: "autoReloadAction", publicName: "autoReloadAction", isSignal: true, isRequired: false, transformFunction: null }, initialReloadType: { classPropertyName: "initialReloadType", publicName: "initialReloadType", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-form-field>\n <mat-label>Select auto reload period</mat-label>\n <mat-select [formControl]=\"reloadTypeControl\">\n @for (option of reloadTypes; track option.value){\n <mat-option [value]=\"option.value\">\n {{option.label}}\n </mat-option>\n }\n </mat-select>\n</mat-form-field>", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1014
1018
  }
1015
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgssmAutoReloadComponent, decorators: [{
1019
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NgssmAutoReloadComponent, decorators: [{
1016
1020
  type: Component,
1017
1021
  args: [{ selector: 'ngssm-auto-reload', imports: [ReactiveFormsModule, MatFormField, MatLabel, MatSelect, MatOption], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field>\n <mat-label>Select auto reload period</mat-label>\n <mat-select [formControl]=\"reloadTypeControl\">\n @for (option of reloadTypes; track option.value){\n <mat-option [value]=\"option.value\">\n {{option.label}}\n </mat-option>\n }\n </mat-select>\n</mat-form-field>" }]
1018
- }], ctorParameters: () => [], propDecorators: { autoReloadAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoReloadAction", required: false }] }] } });
1022
+ }], ctorParameters: () => [], propDecorators: { autoReloadAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoReloadAction", required: false }] }], initialReloadType: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialReloadType", required: false }] }] } });
1019
1023
 
1020
1024
  class NgssmDataReloadButtonComponent {
1021
1025
  label = input(undefined, ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
@@ -1070,10 +1074,10 @@ class NgssmDataReloadButtonComponent {
1070
1074
  }
1071
1075
  this.dataSourceKeys().forEach((key) => this.store.dispatchAction(new NgssmLoadDataSourceValueAction(key, { forceReload: true, keepAdditionalProperties: this.keepAdditionalProperties() })));
1072
1076
  }
1073
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgssmDataReloadButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1074
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: NgssmDataReloadButtonComponent, isStandalone: true, selector: "ngssm-data-reload-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, keepAdditionalProperties: { classPropertyName: "keepAdditionalProperties", publicName: "keepAdditionalProperties", isSignal: true, isRequired: false, transformFunction: null }, buttonIcon: { classPropertyName: "buttonIcon", publicName: "buttonIcon", isSignal: true, isRequired: false, transformFunction: null }, autoReloadEnabled: { classPropertyName: "autoReloadEnabled", publicName: "autoReloadEnabled", isSignal: true, isRequired: false, transformFunction: null }, dataSourceKeys: { classPropertyName: "dataSourceKeys", publicName: "dataSourceKeys", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex-row-center\">\n @if (label(); as buttonLabel) {\n <button\n mat-stroked-button\n [color]=\"color()\"\n class=\"mat-{{color()}}\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"buttonDisabled() === true\"\n id=\"reloadButton\">\n <div class=\"flex-row-center\">\n @if (loadInProgress()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon [ngClass]=\"buttonIcon()\" [color]=\"color()\"></mat-icon>\n }\n\n <span style=\"width: 0.5rem\"></span>\n\n {{ buttonLabel }}\n </div>\n </button>\n } @else {\n <button\n mat-icon-button\n [color]=\"color()\"\n class=\"mat-{{color()}}\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"buttonDisabled() === true\"\n id=\"reloadButton\">\n @if (loadInProgress()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon [ngClass]=\"buttonIcon()\" [color]=\"color()\"></mat-icon>\n }\n </button>\n }\n\n @if (autoReloadEnabled()) {\n <ngssm-auto-reload class=\"with-margin-left-8\" [autoReloadAction]=\"reloadAction\"></ngssm-auto-reload>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: NgssmAutoReloadComponent, selector: "ngssm-auto-reload", inputs: ["autoReloadAction"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1077
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NgssmDataReloadButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1078
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: NgssmDataReloadButtonComponent, isStandalone: true, selector: "ngssm-data-reload-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, keepAdditionalProperties: { classPropertyName: "keepAdditionalProperties", publicName: "keepAdditionalProperties", isSignal: true, isRequired: false, transformFunction: null }, buttonIcon: { classPropertyName: "buttonIcon", publicName: "buttonIcon", isSignal: true, isRequired: false, transformFunction: null }, autoReloadEnabled: { classPropertyName: "autoReloadEnabled", publicName: "autoReloadEnabled", isSignal: true, isRequired: false, transformFunction: null }, dataSourceKeys: { classPropertyName: "dataSourceKeys", publicName: "dataSourceKeys", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex-row-center\">\n @if (label(); as buttonLabel) {\n <button\n mat-stroked-button\n [color]=\"color()\"\n class=\"mat-{{color()}}\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"buttonDisabled() === true\"\n id=\"reloadButton\">\n <div class=\"flex-row-center\">\n @if (loadInProgress()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon [ngClass]=\"buttonIcon()\" [color]=\"color()\"></mat-icon>\n }\n\n <span style=\"width: 0.5rem\"></span>\n\n {{ buttonLabel }}\n </div>\n </button>\n } @else {\n <button\n mat-icon-button\n [color]=\"color()\"\n class=\"mat-{{color()}}\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"buttonDisabled() === true\"\n id=\"reloadButton\">\n @if (loadInProgress()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon [ngClass]=\"buttonIcon()\" [color]=\"color()\"></mat-icon>\n }\n </button>\n }\n\n @if (autoReloadEnabled()) {\n <ngssm-auto-reload class=\"with-margin-left-8\" [autoReloadAction]=\"reloadAction\"></ngssm-auto-reload>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: NgssmAutoReloadComponent, selector: "ngssm-auto-reload", inputs: ["autoReloadAction", "initialReloadType"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1075
1079
  }
1076
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgssmDataReloadButtonComponent, decorators: [{
1080
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NgssmDataReloadButtonComponent, decorators: [{
1077
1081
  type: Component,
1078
1082
  args: [{ selector: 'ngssm-data-reload-button', imports: [NgClass, MatButton, MatIconButton, MatTooltip, MatIcon, MatProgressSpinner, NgssmAutoReloadComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex-row-center\">\n @if (label(); as buttonLabel) {\n <button\n mat-stroked-button\n [color]=\"color()\"\n class=\"mat-{{color()}}\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"buttonDisabled() === true\"\n id=\"reloadButton\">\n <div class=\"flex-row-center\">\n @if (loadInProgress()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon [ngClass]=\"buttonIcon()\" [color]=\"color()\"></mat-icon>\n }\n\n <span style=\"width: 0.5rem\"></span>\n\n {{ buttonLabel }}\n </div>\n </button>\n } @else {\n <button\n mat-icon-button\n [color]=\"color()\"\n class=\"mat-{{color()}}\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"buttonDisabled() === true\"\n id=\"reloadButton\">\n @if (loadInProgress()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon [ngClass]=\"buttonIcon()\" [color]=\"color()\"></mat-icon>\n }\n </button>\n }\n\n @if (autoReloadEnabled()) {\n <ngssm-auto-reload class=\"with-margin-left-8\" [autoReloadAction]=\"reloadAction\"></ngssm-auto-reload>\n }\n</div>\n" }]
1079
1083
  }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], keepAdditionalProperties: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepAdditionalProperties", required: false }] }], buttonIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonIcon", required: false }] }], autoReloadEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoReloadEnabled", required: false }] }], dataSourceKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSourceKeys", required: false }] }] } });
@@ -1101,10 +1105,10 @@ class NgssmScopedDataSourceDirective {
1101
1105
  this.isInitialized = true;
1102
1106
  return value;
1103
1107
  }
1104
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgssmScopedDataSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1105
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: NgssmScopedDataSourceDirective, isStandalone: true, selector: "[ngssmScopedDataSource]", inputs: { ngssmScopedDataSource: { classPropertyName: "ngssmScopedDataSource", publicName: "ngssmScopedDataSource", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
1108
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NgssmScopedDataSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1109
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.12", type: NgssmScopedDataSourceDirective, isStandalone: true, selector: "[ngssmScopedDataSource]", inputs: { ngssmScopedDataSource: { classPropertyName: "ngssmScopedDataSource", publicName: "ngssmScopedDataSource", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
1106
1110
  }
1107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgssmScopedDataSourceDirective, decorators: [{
1111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NgssmScopedDataSourceDirective, decorators: [{
1108
1112
  type: Directive,
1109
1113
  args: [{
1110
1114
  selector: '[ngssmScopedDataSource]'
@@ -1 +1 @@
1
- {"version":3,"file":"ngssm-data.mjs","sources":["../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-data-action-type.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-data-source-value.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-load-data-source-value.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-set-data-source-value.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-register-data-sources.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-clear-data-source-value.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-set-data-source-parameter.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-load-data-source-additional-property-value.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-set-data-source-additional-property-value.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-register-data-source.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-unregister-data-source.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-update-data-source-parameter.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-set-data-source-parameter-validity.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/model/ngssm-data-source.ts","../../../projects/ngssm-data/src/lib/ngssm-data/model/ngssm-data-source-value.ts","../../../projects/ngssm-data/src/lib/ngssm-data/state/ngssm-data.state.ts","../../../projects/ngssm-data/src/lib/ngssm-data/reducers/data-sources-registration.reducer.ts","../../../projects/ngssm-data/src/lib/ngssm-data/reducers/data-source-value.reducer.ts","../../../projects/ngssm-data/src/lib/ngssm-data/reducers/load-data-source-value.reducer.ts","../../../projects/ngssm-data/src/lib/ngssm-data/reducers/data-source-additional-property-value.reducer.ts","../../../projects/ngssm-data/src/lib/ngssm-data/selectors.ts","../../../projects/ngssm-data/src/lib/ngssm-data/reducers/data-source-parameter.reducer.ts","../../../projects/ngssm-data/src/lib/ngssm-data/effects/data-loading.effect.ts","../../../projects/ngssm-data/src/lib/ngssm-data/post-loading-action-executor.ts","../../../projects/ngssm-data/src/lib/ngssm-data/data-sources-linker.ts","../../../projects/ngssm-data/src/lib/ngssm-data/data-source-with-dependency.ts","../../../projects/ngssm-data/src/lib/ngssm-data/provide-ngssm-data.ts","../../../projects/ngssm-data/src/lib/ngssm-data/components/is-ngssm-data-source-value-status.pipe.ts","../../../projects/ngssm-data/src/lib/ngssm-data/components/ngssm-auto-reload/ngssm-auto-reload.component.ts","../../../projects/ngssm-data/src/lib/ngssm-data/components/ngssm-auto-reload/ngssm-auto-reload.component.html","../../../projects/ngssm-data/src/lib/ngssm-data/components/ngssm-data-reload-button/ngssm-data-reload-button.component.ts","../../../projects/ngssm-data/src/lib/ngssm-data/components/ngssm-data-reload-button/ngssm-data-reload-button.component.html","../../../projects/ngssm-data/src/lib/ngssm-data/components/ngssm-scoped-data-source.directive.ts","../../../projects/ngssm-data/src/lib/ngssm-data/data-source-signal.ts","../../../projects/ngssm-data/src/lib/ngssm-data/post-loading-helpers.ts","../../../projects/ngssm-data/src/public-api.ts","../../../projects/ngssm-data/src/ngssm-data.ts"],"sourcesContent":["export enum NgssmDataActionType {\n // Used by the library to initialize all the data sources provided by the application\n registerDataSources = '[NgssmDataActionType] registerDataSources',\n\n // Could be used by the application to register or unregister a data source.\n // This can be used, for example, to limit the lifetime of a data source to the lifetime of a component\n registerDataSource = '[NgssmDataActionType] registerDataSource',\n unregisterDataSource = '[NgssmDataActionType] unregisterDataSource',\n\n // Used to call the loading method to get the value for the data source\n loadDataSourceValue = '[NgssmDataActionType] loadDataSourceValue',\n\n // Update the parameter used by the loading method, if one is required\n setDataSourceParameter = '[NgssmDataActionType] setDataSourceParameter',\n\n // Used to partially update the parameter. Usefull when creating a search component with multiple search criteria.\n updateDataSourceParameter = '[NgssmDataActionType] updateDataSourceParameter',\n\n // Update only the validity of the parameter. Usefull in case of a partial update of the parameter.\n setDataSourceParameterValidity = '[NgssmDataActionType] setDataSourceParameterValidity',\n\n // Clear the stored value associated to a data source\n clearDataSourceValue = '[NgssmDataActionType] clearDataSourceValue',\n\n // Store the value for a given data source\n setDataSourceValue = '[NgssmDataActionType] setDataSourceValue',\n\n // Call the loading method to get the value for an additional property of the data source\n loadDataSourceAdditionalPropertyValue = '[NgssmDataActionType] loadDataSourceAdditionalPropertyValue',\n\n // Store the value for an additional property of the data source\n setDataSourceAdditionalPropertyValue = '[NgssmDataActionType] setDataSourceAdditionalPropertyValue'\n}\n","import { Action } from 'ngssm-store';\n\nexport class NgssmDataSourceValueAction implements Action {\n constructor(\n public readonly type: string,\n public readonly key: string\n ) {}\n}\n","import { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\nimport { NgssmLoadDataSourceOptions } from '../model';\n\nexport class NgssmLoadDataSourceValueAction<TParameter = unknown> extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly options?: NgssmLoadDataSourceOptions<TParameter>\n ) {\n super(NgssmDataActionType.loadDataSourceValue, key);\n }\n}\n","import { HttpErrorResponse } from '@angular/common/http';\n\nimport { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\nimport { NgssmDataSourceValueStatus } from '../model';\n\nexport class NgssmSetDataSourceValueAction<TData = unknown> extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly status: NgssmDataSourceValueStatus,\n public readonly value?: TData,\n public readonly httpErrorResponse?: HttpErrorResponse\n ) {\n super(NgssmDataActionType.setDataSourceValue, key);\n }\n}\n","import { Action } from 'ngssm-store';\n\nimport { NgssmDataActionType } from './ngssm-data-action-type';\nimport { NgssmDataSource } from '../model';\n\nexport class NgssmRegisterDataSourcesAction implements Action {\n public readonly type: string = NgssmDataActionType.registerDataSources;\n\n constructor(public readonly dataSources: NgssmDataSource[]) {}\n}\n","import { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\n\nexport class NgssmClearDataSourceValueAction extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly clearParameter = false\n ) {\n super(NgssmDataActionType.clearDataSourceValue, key);\n }\n}\n","import { NgssmDataActionType } from './ngssm-data-action-type';\nimport { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\n\nexport class NgssmSetDataSourceParameterAction<TParameter = unknown> extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly parameter?: TParameter,\n public readonly parameterIsValid?: boolean,\n public readonly doNotMarkParameterAsModified?: boolean\n ) {\n super(NgssmDataActionType.setDataSourceParameter, key);\n }\n}\n","import { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\n\nexport class NgssmLoadDataSourceAdditionalPropertyValueAction extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly property: string,\n public readonly forceReload?: boolean,\n public readonly postLoadingAction?: () => void\n ) {\n super(NgssmDataActionType.loadDataSourceAdditionalPropertyValue, key);\n }\n}\n","import { HttpErrorResponse } from '@angular/common/http';\n\nimport { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\nimport { NgssmDataSourceValueStatus } from '../model';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\n\nexport class NgssmSetDataSourceAdditionalPropertyValueAction<TProperty = unknown> extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly property: string,\n public readonly status: NgssmDataSourceValueStatus,\n public readonly value?: TProperty,\n public readonly postLoadingAction?: () => void,\n public readonly httpErrorResponse?: HttpErrorResponse\n ) {\n super(NgssmDataActionType.setDataSourceAdditionalPropertyValue, key);\n }\n}\n","import { Action } from 'ngssm-store';\n\nimport { NgssmDataActionType } from './ngssm-data-action-type';\nimport { NgssmDataSource } from '../model';\n\nexport class NgssmRegisterDataSourceAction implements Action {\n public readonly type: string = NgssmDataActionType.registerDataSource;\n\n constructor(public readonly dataSource: NgssmDataSource) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\n\nexport class NgssmUnregisterDataSourceAction implements Action {\n public readonly type: string = NgssmDataActionType.unregisterDataSource;\n\n constructor(public readonly dataSourceKey: string) {}\n}\n","import { NgssmDataActionType } from './ngssm-data-action-type';\nimport { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\n\n/**\n * Action to update part (partial) of a data source parameter.\n *\n * This action carries a Partial<TParameter> that will be merged with the existing parameter\n * for the specified data source key. By default, updating the parameter will mark the data\n * source value as outdated so it can be reloaded; set doNotUpdateValueOutdated to true to\n * avoid changing the valueOutdated flag when dispatching this action.\n *\n * The update of the parameter in state is made with a shallow merge. So be carefull with\n * the parameter value set in action.\n *\n * @template TParameter Type of the parameter object for the data source.\n * @param key The data source key whose parameter should be updated.\n * @param parameter Partial parameter to merge into the existing parameter.\n * @param doNotUpdateValueOutdated Optional flag to prevent marking the value as outdated.\n */\nexport class NgssmUpdateDataSourceParameterAction<TParameter = unknown> extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly parameter: Partial<TParameter>,\n public readonly doNotUpdateValueOutdated?: boolean\n ) {\n super(NgssmDataActionType.updateDataSourceParameter, key);\n }\n}\n","import { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\n\n/**\n * Action used to set the validity state of a data source parameter.\n *\n * This action updates the overall parameter validity for the specified data source.\n * Optionally a partial validity key can be provided to indicate which sub-field or\n * portion of the parameter the validity refers to (useful when validating parameter\n * objects field-by-field).\n *\n * If `partialValidityKey` is provided the action targets only that partial entry and\n * does not change the global `parameterIsValid` flag. If `clearPartialValidities` is\n * true the reducer handling this action should clear the parameterPartialValidity map\n * (remove all partial validity entries) when applying the global validity update.\n *\n * @param key The data source key this validity applies to.\n * @param isValid True when the parameter (or partial parameter) is valid, false otherwise.\n * @param partialValidityKey Optional identifier for partial validity (e.g. the parameter field name).\n * If set, the global validity is not modified.\n * @param clearPartialValidities If true, instructs reducers to clear existing partial validity entries\n * when updating overall validity. Useful to reset per-field validity after\n * a full-parameter validation step.\n */\nexport class NgssmSetDataSourceParameterValidityAction extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly isValid: boolean,\n public readonly partialValidityKey?: string,\n public readonly clearPartialValidities?: boolean\n ) {\n super(NgssmDataActionType.setDataSourceParameterValidity, key);\n }\n}\n","import { EnvironmentProviders, InjectionToken, inject, makeEnvironmentProviders } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { State, Store } from 'ngssm-store';\nimport { NgssmLoadDataSourceValueAction } from '../actions';\n\n/**\n * Function signature for loading a data source value.\n * - state: the current global application state.\n * - dataSourceKey: the unique key of the data source being loaded.\n * - parameter: optional parameter passed to the loader.\n *\n * Must return an Observable that emits the requested data.\n */\nexport type NgssmDataLoading<TData = unknown, TParameter = unknown> = (\n state: State,\n dataSourceKey: string,\n parameter?: TParameter\n) => Observable<TData>;\n\n/**\n * Function signature for loading an additional property of a data source (e.g. row detail).\n * - state: the current global application state.\n * - dataSourceKey: the unique key of the data source.\n * - additionalProperty: the name of the additional property to load.\n *\n * Must return an Observable that emits the requested additional property data.\n */\nexport type NgssmAdditionalPropertyLoading<TData = unknown> = (\n state: State,\n dataSourceKey: string,\n additionalProperty: string\n) => Observable<TData>;\n\n/**\n * Callback invoked after data source loading succeeds.\n *\n * - state: current global application state\n * - dataSourceKey: source identifier\n * - parameter: parameter passed when loading\n * - value: loaded data\n */\nexport type NgssmDataSourceLoadSuccessCallback<TData = unknown, TParameter = unknown> = (\n state: State,\n dataSourceKey: string,\n parameter?: TParameter,\n value?: TData\n) => void;\n\n/**\n * Callback invoked after data source loading fails.\n *\n * - state: current global application state\n * - dataSourceKey: source identifier\n * - parameter: parameter passed when loading\n * - error: error returned by helper\n */\nexport type NgssmDataSourceLoadFailureCallback<TParameter = unknown> = (\n state: State,\n dataSourceKey: string,\n parameter?: TParameter,\n error?: unknown\n) => void;\n\n/**\n * Describes a data source and its optional behaviours.\n *\n * - key: unique identifier for the data source.\n * - dataLifetimeInSeconds: optional TTL for cached data (seconds).\n * - dataLoadingFunc: required function that loads the main data.\n * - additionalPropertyLoadingFunc: optional function to load named additional properties independently.\n * - initialParameter: optional parameter used initially when registering the data source.\n * - initialParameterInvalid: flag indicating the initial parameter should be considered invalid.\n * - linkedToDataSource: if specified, this data source is reloaded when the target source is updated.\n * - linkedDataSources: list of other data sources to reload when this source is updated.\n * - dependsOnDataSource: optional dependency key; when loading this source, the dependency will be loaded first.\n * - onLoaded: optional callback invoked after successful load (value is available).\n * - onLoadError: optional callback invoked after failed load (error is available).\n */\nexport interface NgssmDataSource<TData = unknown, TParameter = unknown, TAdditionalProperty = unknown> {\n key: string;\n dataLifetimeInSeconds?: number;\n dataLoadingFunc: NgssmDataLoading<TData, TParameter>;\n additionalPropertyLoadingFunc?: NgssmAdditionalPropertyLoading<TAdditionalProperty>;\n initialParameter?: TParameter;\n initialParameterInvalid?: boolean;\n linkedToDataSource?: string;\n linkedDataSources?: string[];\n dependsOnDataSource?: string;\n onLoaded?: NgssmDataSourceLoadSuccessCallback<TData, TParameter>;\n onLoadError?: NgssmDataSourceLoadFailureCallback<TParameter>;\n}\n\n/**\n * Injection token used to register data sources via DI.\n * Provide one or several NgssmDataSource objects using this token (multi: true).\n */\nexport const NGSSM_DATA_SOURCE = new InjectionToken<NgssmDataSource>('NGSSM_DATA_SOURCE');\n\n/**\n * Options accepted when providing a data source via provideNgssmDataSource.\n * See individual properties for behaviour.\n */\nexport interface NgssmDataSourceProvideOptions<TData = unknown, TParameter = unknown, TAdditionalProperty = unknown> {\n dataLifetimeInSeconds?: number;\n initialParameter?: TParameter;\n initialParameterInvalid?: boolean;\n additionalPropertyLoadingFunc?: NgssmAdditionalPropertyLoading<TAdditionalProperty>;\n linkedToDataSource?: string;\n linkedDataSources?: string[];\n dependsOnDataSource?: string;\n onLoaded?: NgssmDataSourceLoadSuccessCallback<TData, TParameter>;\n onLoadError?: NgssmDataSourceLoadFailureCallback<TParameter>;\n}\n\n/**\n * Helper function to register a data source in Angular's environment providers.\n * Use provideNgssmData() at app startup to pick up data sources registered via this helper.\n */\nexport const provideNgssmDataSource = <TData = unknown, TParameter = unknown, TAdditionalProperty = unknown>(\n key: string,\n loadingFunc: NgssmDataLoading<TData, TParameter>,\n options?: NgssmDataSourceProvideOptions<TData, TParameter, TAdditionalProperty>\n): EnvironmentProviders => {\n return makeEnvironmentProviders([\n {\n provide: NGSSM_DATA_SOURCE,\n useFactory: () => {\n const dataSource: NgssmDataSource<TData, TParameter, TAdditionalProperty> = {\n key,\n dataLifetimeInSeconds: options?.dataLifetimeInSeconds,\n dataLoadingFunc: loadingFunc,\n additionalPropertyLoadingFunc: options?.additionalPropertyLoadingFunc,\n onLoaded: options?.onLoaded,\n onLoadError: options?.onLoadError\n };\n\n if (options?.initialParameter) {\n dataSource.initialParameter = options?.initialParameter;\n }\n\n if (options?.initialParameterInvalid) {\n dataSource.initialParameterInvalid = options?.initialParameterInvalid;\n }\n\n if (options?.linkedToDataSource) {\n dataSource.linkedToDataSource = options?.linkedToDataSource;\n }\n\n if (options?.linkedDataSources) {\n dataSource.linkedDataSources = options?.linkedDataSources;\n }\n\n if (options?.dependsOnDataSource) {\n dataSource.dependsOnDataSource = options?.dependsOnDataSource;\n }\n\n return dataSource;\n },\n multi: true\n }\n ]);\n};\n\n/**\n * Guard / initializer helper that dispatches a NgssmLoadDataSourceValueAction for the given key.\n * Returns a function suitable for use in Router canActivate (or app initializers) that always returns true.\n */\nexport const ngssmLoadDataSourceValue = (key: string, forceReload = false): (() => boolean) => {\n return () => {\n inject(Store).dispatchAction(new NgssmLoadDataSourceValueAction(key, { forceReload }));\n return true;\n };\n};\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { DateTime } from 'luxon';\n\n/**\n * Enum describing the lifecycle status of a data source value.\n * - none: No value has been requested or initialized.\n * - notRegistered: The requested data source is not registered.\n * - loading: A load operation for the data source is currently in progress.\n * - loaded: The data source loaded successfully and a value is available.\n * - error: The last load attempt failed.\n */\nexport enum NgssmDataSourceValueStatus {\n none = 'none',\n notRegistered = 'notRegistered',\n loading = 'loading',\n loaded = 'loaded',\n error = 'error'\n}\n\n/**\n * Represents the status and optional metadata for an additional property of a data source.\n * Additional properties are values related to the main data source value that may be loaded independently\n * (for example, a row detail).\n *\n * @template TProperty Type of the additional property's value.\n * @property status Current load status of the additional property.\n * @property value Optional value of the additional property.\n * @property lastLoadingDate Optional timestamp of the last successful load (luxon DateTime).\n * @property httpErrorResponse Optional HTTP error returned during the last load attempt.\n */\nexport interface NgssmDataSourceAdditionalPropertyValue<TProperty = unknown> {\n status: NgssmDataSourceValueStatus;\n value?: TProperty;\n lastLoadingDate?: DateTime;\n httpErrorResponse?: HttpErrorResponse;\n}\n\n/**\n * Represents the stored value and metadata for a data source.\n *\n * @template TData Type of the data source value.\n * @template TParameter Type of the parameter used to load the data source.\n * @property status Current load status of the data source.\n * @property value Optional value returned by the data source loader.\n * @property parameter Optional parameter used when loading the data source.\n * @property lastLoadingDate Optional timestamp of the last successful load (luxon DateTime).\n * @property dataLifetimeInSeconds Optional TTL for cached data, in seconds.\n * @property additionalProperties Map of additional property values (see NgssmDataSourceAdditionalPropertyValue).\n * @property parameterIsValid Optional flag indicating if the current parameter is valid.\n * @property parameterPartialValidity Optional map storing partial validity of parameter sub-fields (e.g. { fieldA: true, fieldB: false }).\n * @property httpErrorResponse Optional HTTP error returned during the last load attempt.\n * @property valueOutdated Optional flag indicating that the parameter changed and the value is now outdated.\n */\nexport interface NgssmDataSourceValue<TData = unknown, TParameter = unknown> {\n status: NgssmDataSourceValueStatus;\n value?: TData;\n parameter?: TParameter;\n lastLoadingDate?: DateTime;\n dataLifetimeInSeconds?: number;\n additionalProperties: Record<string, NgssmDataSourceAdditionalPropertyValue>;\n parameterIsValid?: boolean;\n\n /**\n * Map storing partial validity information for the parameter.\n * Key is a parameter field name (or any identifier) and value is boolean validity.\n * Undefined when no partial validation data is present.\n */\n parameterPartialValidity?: Record<string, boolean>;\n\n httpErrorResponse?: HttpErrorResponse;\n\n // Parameter has been updated but not value\n valueOutdated?: boolean;\n}\n\n/**\n * Types and helper for automatic reload intervals of a data source value.\n * - NgssmDataSourceValueAutoReloadType: allowed string values for auto-reload selection.\n * - getNgssmDataSourceValueAutoReloadTypes: returns a list of label/value pairs usable for UI selects.\n */\nexport type NgssmDataSourceValueAutoReloadType = 'Off' | '1min' | '5min' | '15min';\nexport const getNgssmDataSourceValueAutoReloadTypes = (): { label: string; value: NgssmDataSourceValueAutoReloadType }[] => [\n { label: 'Off', value: 'Off' },\n { label: 'Every minute', value: '1min' },\n { label: 'Every 5 minutes', value: '5min' },\n { label: 'Every 15 minutes', value: '15min' }\n];\n\nexport const isNgssmDataSourceValueParameterValid = (dataSourceValue: NgssmDataSourceValue): boolean => {\n if (dataSourceValue.parameterPartialValidity) {\n let isValid = true;\n Object.values(dataSourceValue.parameterPartialValidity).forEach((isPartialValid) => {\n isValid = isValid && isPartialValid;\n });\n return isValid;\n }\n\n if (dataSourceValue.parameterIsValid === false) {\n return false;\n }\n\n return true;\n};\n","import update, { Spec } from 'immutability-helper';\n\nimport { Action, NgSsmFeatureState, State } from 'ngssm-store';\nimport { NgssmDataSource, NgssmDataSourceValue } from '../model';\n\nexport const selectNgssmDataState = (state: State): NgssmDataState => state[NgssmDataStateSpecification.featureStateKey] as NgssmDataState;\n\nexport const updateNgssmDataState = (state: State, command: Spec<NgssmDataState, never>): State =>\n update(state, {\n [NgssmDataStateSpecification.featureStateKey]: command\n });\n\nexport interface NgssmDataState {\n dataSourceValues: Record<string, NgssmDataSourceValue>;\n dataSources: Record<string, NgssmDataSource>;\n delayedActions: Record<string, Action>;\n}\n\n@NgSsmFeatureState({\n featureStateKey: NgssmDataStateSpecification.featureStateKey,\n initialState: NgssmDataStateSpecification.initialState\n})\nexport class NgssmDataStateSpecification {\n public static readonly featureStateKey = 'ngssm-data-state';\n public static readonly initialState: NgssmDataState = {\n dataSourceValues: {},\n dataSources: {},\n delayedActions: {}\n };\n}\n","import { Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport {\n NgssmDataActionType,\n NgssmRegisterDataSourceAction,\n NgssmRegisterDataSourcesAction,\n NgssmUnregisterDataSourceAction\n} from '../actions';\nimport { NgssmDataSource, NgssmDataSourceValue, NgssmDataSourceValueStatus } from '../model';\nimport { selectNgssmDataState, updateNgssmDataState } from '../state';\n\n@Injectable()\nexport class DataSourcesRegistrationReducer implements Reducer {\n public readonly processedActions: string[] = [\n NgssmDataActionType.registerDataSources,\n NgssmDataActionType.registerDataSource,\n NgssmDataActionType.unregisterDataSource\n ];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmDataActionType.registerDataSources: {\n const registerDataSourcesAction = action as NgssmRegisterDataSourcesAction;\n const dataSourceValues: Record<string, NgssmDataSourceValue> = {};\n const dataSources: Record<string, NgssmDataSource> = {};\n registerDataSourcesAction.dataSources.forEach((dataSource) => {\n if (selectNgssmDataState(state).dataSources[dataSource.key]) {\n return;\n }\n\n dataSourceValues[dataSource.key] = {\n status: NgssmDataSourceValueStatus.none,\n additionalProperties: {}\n };\n\n if (dataSource.dataLifetimeInSeconds) {\n dataSourceValues[dataSource.key].dataLifetimeInSeconds = dataSource.dataLifetimeInSeconds;\n }\n\n if (dataSource.initialParameter) {\n dataSourceValues[dataSource.key].parameter = dataSource.initialParameter;\n }\n\n if (dataSource.initialParameterInvalid) {\n dataSourceValues[dataSource.key].parameterIsValid = false;\n }\n\n dataSources[dataSource.key] = dataSource;\n });\n\n return updateNgssmDataState(state, {\n dataSourceValues: { $merge: dataSourceValues },\n dataSources: { $merge: dataSources }\n });\n }\n\n case NgssmDataActionType.registerDataSource: {\n const registerDataSourceAction = action as NgssmRegisterDataSourceAction;\n return this.updateState(state, new NgssmRegisterDataSourcesAction([registerDataSourceAction.dataSource]));\n }\n\n case NgssmDataActionType.unregisterDataSource: {\n const unregisterDataSource = action as NgssmUnregisterDataSourceAction;\n return updateNgssmDataState(state, {\n dataSourceValues: { $unset: [unregisterDataSource.dataSourceKey] },\n dataSources: { $unset: [unregisterDataSource.dataSourceKey] }\n });\n }\n }\n\n return state;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DateTime } from 'luxon';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NgssmClearDataSourceValueAction, NgssmDataActionType, NgssmSetDataSourceValueAction } from '../actions';\nimport { selectNgssmDataState, updateNgssmDataState } from '../state';\nimport { NgssmDataSourceValueStatus } from '../model';\n\n@Injectable()\nexport class DataSourceValueReducer implements Reducer {\n public readonly processedActions: string[] = [NgssmDataActionType.setDataSourceValue, NgssmDataActionType.clearDataSourceValue];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmDataActionType.setDataSourceValue: {\n const ngssmSetDataSourceValueAction = action as NgssmSetDataSourceValueAction;\n const dataSourceValue = selectNgssmDataState(state).dataSourceValues[ngssmSetDataSourceValueAction.key];\n if (!dataSourceValue) {\n break;\n }\n\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmSetDataSourceValueAction.key]: {\n status: { $set: ngssmSetDataSourceValueAction.status },\n value: { $set: ngssmSetDataSourceValueAction.value },\n lastLoadingDate: { $set: DateTime.now() },\n httpErrorResponse: { $set: ngssmSetDataSourceValueAction.httpErrorResponse }\n // leave parameterPartialValidity as-is on value set (no change here)\n }\n }\n });\n }\n\n case NgssmDataActionType.clearDataSourceValue: {\n const ngssmClearDataSourceValueAction = action as NgssmClearDataSourceValueAction;\n let currentState = state;\n if (ngssmClearDataSourceValueAction.clearParameter) {\n currentState = updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmClearDataSourceValueAction.key]: {\n parameter: { $set: undefined },\n parameterIsValid: { $set: undefined },\n // clear partial validity when parameter is cleared\n parameterPartialValidity: { $set: undefined }\n }\n }\n });\n }\n\n return updateNgssmDataState(currentState, {\n dataSourceValues: {\n [ngssmClearDataSourceValueAction.key]: {\n status: { $set: NgssmDataSourceValueStatus.none },\n value: { $set: undefined },\n lastLoadingDate: { $set: undefined },\n additionalProperties: { $set: {} },\n httpErrorResponse: { $set: undefined }\n }\n }\n });\n }\n }\n\n return state;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DateTime } from 'luxon';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NgssmDataActionType, NgssmLoadDataSourceValueAction } from '../actions';\nimport { selectNgssmDataState, updateNgssmDataState } from '../state';\nimport { NgssmDataSourceValueStatus } from '../model';\n\n@Injectable()\nexport class LoadDataSourceValueReducer implements Reducer {\n public readonly processedActions: string[] = [NgssmDataActionType.loadDataSourceValue];\n\n public updateState(state: State, action: Action): State {\n if (action.type !== NgssmDataActionType.loadDataSourceValue) {\n return state;\n }\n\n const loadDataSourceValue = action as NgssmLoadDataSourceValueAction;\n\n // If data source is not defined, return input state\n const dataSource = selectNgssmDataState(state).dataSources[loadDataSourceValue.key];\n if (!dataSource) {\n return state;\n }\n\n let currentState = state;\n\n // Check if source depends on another one\n if (dataSource.dependsOnDataSource) {\n const masterSourceValue = selectNgssmDataState(state).dataSourceValues[dataSource.dependsOnDataSource];\n if (masterSourceValue && masterSourceValue.status !== NgssmDataSourceValueStatus.loaded) {\n return updateNgssmDataState(state, {\n delayedActions: {\n [dataSource.dependsOnDataSource]: { $set: action }\n }\n });\n }\n\n if (selectNgssmDataState(state).delayedActions[dataSource.dependsOnDataSource] === action) {\n currentState = updateNgssmDataState(state, {\n delayedActions: { $unset: [dataSource.dependsOnDataSource] }\n });\n }\n }\n\n const dataSourceValue = selectNgssmDataState(state).dataSourceValues[loadDataSourceValue.key];\n if (!dataSourceValue) {\n return state;\n }\n\n let shouldReload = false;\n\n if (loadDataSourceValue.options?.parameter) {\n shouldReload = true;\n currentState = updateNgssmDataState(currentState, {\n dataSourceValues: {\n [loadDataSourceValue.key]: {\n parameter: { $set: loadDataSourceValue.options?.parameter.value }\n }\n }\n });\n }\n\n if (dataSourceValue.status === NgssmDataSourceValueStatus.loaded) {\n if (loadDataSourceValue.options?.forceReload === true || !dataSourceValue.dataLifetimeInSeconds || !dataSourceValue.lastLoadingDate) {\n shouldReload = true;\n } else {\n const dataLifetime = DateTime.now().diff(dataSourceValue.lastLoadingDate, 'second');\n if ((dataLifetime.toObject().seconds ?? 0) > dataSourceValue.dataLifetimeInSeconds) {\n shouldReload = true;\n }\n }\n } else {\n shouldReload = true;\n }\n\n if (dataSourceValue.parameterIsValid === false) {\n shouldReload = false;\n }\n\n if (shouldReload) {\n if (loadDataSourceValue.options?.keepAdditionalProperties !== true) {\n currentState = updateNgssmDataState(currentState, {\n dataSourceValues: {\n [loadDataSourceValue.key]: {\n additionalProperties: { $set: {} }\n }\n }\n });\n }\n\n if (loadDataSourceValue.options?.resetValue === true) {\n currentState = updateNgssmDataState(currentState, {\n dataSourceValues: {\n [loadDataSourceValue.key]: {\n value: { $set: undefined }\n }\n }\n });\n }\n\n return updateNgssmDataState(currentState, {\n dataSourceValues: {\n [loadDataSourceValue.key]: {\n status: { $set: NgssmDataSourceValueStatus.loading },\n valueOutdated: { $set: false }\n }\n }\n });\n }\n\n return state;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DateTime } from 'luxon';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport {\n NgssmDataActionType,\n NgssmLoadDataSourceAdditionalPropertyValueAction,\n NgssmSetDataSourceAdditionalPropertyValueAction\n} from '../actions';\nimport { selectNgssmDataState, updateNgssmDataState } from '../state';\nimport { NgssmDataSourceValueStatus } from '../model';\n\n@Injectable()\nexport class DataSourceAdditionalPropertyValueReducer implements Reducer {\n public readonly processedActions: string[] = [\n NgssmDataActionType.loadDataSourceAdditionalPropertyValue,\n NgssmDataActionType.setDataSourceAdditionalPropertyValue\n ];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmDataActionType.loadDataSourceAdditionalPropertyValue: {\n const ngssmLoadDataSourceAdditionalPropertyValueAction = action as NgssmLoadDataSourceAdditionalPropertyValueAction;\n const dataSourcePropertyValue =\n selectNgssmDataState(state).dataSourceValues[ngssmLoadDataSourceAdditionalPropertyValueAction.key]?.additionalProperties[\n ngssmLoadDataSourceAdditionalPropertyValueAction.property\n ];\n\n if (\n dataSourcePropertyValue?.status === NgssmDataSourceValueStatus.loaded &&\n ngssmLoadDataSourceAdditionalPropertyValueAction.forceReload !== true\n ) {\n break;\n }\n\n if (!dataSourcePropertyValue) {\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmLoadDataSourceAdditionalPropertyValueAction.key]: {\n additionalProperties: {\n [ngssmLoadDataSourceAdditionalPropertyValueAction.property]: {\n $set: {\n status: NgssmDataSourceValueStatus.loading\n }\n }\n }\n }\n }\n });\n }\n\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmLoadDataSourceAdditionalPropertyValueAction.key]: {\n additionalProperties: {\n [ngssmLoadDataSourceAdditionalPropertyValueAction.property]: {\n status: { $set: NgssmDataSourceValueStatus.loading }\n }\n }\n }\n }\n });\n }\n\n case NgssmDataActionType.setDataSourceAdditionalPropertyValue: {\n const ngssmSetDataSourceAdditionalPropertyValueAction = action as NgssmSetDataSourceAdditionalPropertyValueAction;\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmSetDataSourceAdditionalPropertyValueAction.key]: {\n additionalProperties: {\n [ngssmSetDataSourceAdditionalPropertyValueAction.property]: {\n $set: {\n status: ngssmSetDataSourceAdditionalPropertyValueAction.status,\n value: ngssmSetDataSourceAdditionalPropertyValueAction.value,\n lastLoadingDate: DateTime.now(),\n httpErrorResponse: ngssmSetDataSourceAdditionalPropertyValueAction.httpErrorResponse\n }\n }\n }\n }\n }\n });\n }\n }\n\n return state;\n }\n}\n","import { State } from 'ngssm-store';\n\nimport {\n isNgssmDataSourceValueParameterValid,\n NgssmDataSourceAdditionalPropertyValue,\n NgssmDataSourceValue,\n NgssmDataSourceValueStatus\n} from './model';\nimport { selectNgssmDataState } from './state/ngssm-data.state';\n\nexport const selectNgssmDataSourceValue = <TDataType = unknown, TParameter = unknown>(\n state: State,\n key: string\n): NgssmDataSourceValue<TDataType, TParameter> => {\n return (selectNgssmDataState(state).dataSourceValues[key] ?? {\n status: NgssmDataSourceValueStatus.notRegistered\n }) as NgssmDataSourceValue<TDataType, TParameter>;\n};\n\nexport const selectNgssmDataSourceAdditionalPropertyValue = <TProperty = unknown>(\n state: State,\n key: string,\n property: string\n): NgssmDataSourceAdditionalPropertyValue<TProperty> => {\n return (selectNgssmDataState(state).dataSourceValues[key]?.additionalProperties[property] ?? {\n status: NgssmDataSourceValueStatus.notRegistered\n }) as NgssmDataSourceAdditionalPropertyValue<TProperty>;\n};\n\n/**\n * Returns true if the specified data source is currently loading, false otherwise.\n * @param state The global application state.\n * @param dataSourceKey The unique key of the data source.\n */\nexport const isNgssmDataSourceLoading = (state: State, dataSourceKey: string): boolean =>\n selectNgssmDataSourceValue(state, dataSourceKey)?.status === NgssmDataSourceValueStatus.loading;\n\n/**\n * Determines whether the parameter for the specified data source should be considered valid.\n *\n * Rules:\n * - If parameterIsValid is explicitly true or false on the data source value, that value is returned.\n * - Otherwise, if parameterPartialValidity map exists, the function returns true only if all\n * partial entries are true (logical AND).\n * - If no explicit validity information is present, the parameter is considered valid (returns true).\n *\n * @param state The global application state.\n * @param dataSourceKey The key of the data source to check.\n * @returns True when the parameter (or all partial parameter entries) is valid, false otherwise.\n */\nexport const isNgssmDataSourceParameterValid = (state: State, dataSourceKey: string): boolean => {\n const dataSource = selectNgssmDataSourceValue(state, dataSourceKey);\n if (!dataSource) {\n return true;\n }\n\n return isNgssmDataSourceValueParameterValid(dataSource);\n};\n\n/**\n * Throws an Error if the data source value for the given key does not exist in the state.\n *\n * This is a convenience guard used by callers that require the data source value to be present.\n * Use throwIfSourceValueDoesNotExist(state, key) to validate presence before accessing the value.\n *\n * @param state The global application state.\n * @param dataSourceKey The key of the data source to check.\n * @throws Error when the data source value is not present in the state.\n */\nexport const throwIfSourceValueDoesNotExist = (state: State, dataSourceKey?: string) => {\n if (!dataSourceKey) {\n return;\n }\n\n const dataSource = selectNgssmDataSourceValue(state, dataSourceKey);\n if (!dataSource || dataSource.status === NgssmDataSourceValueStatus.notRegistered) {\n throw new Error(`Datasource ${dataSourceKey} does not exists.`);\n }\n};\n","import { Injectable } from '@angular/core';\n\nimport update from 'immutability-helper';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport {\n NgssmDataActionType,\n NgssmDataSourceValueAction,\n NgssmSetDataSourceParameterAction,\n NgssmSetDataSourceParameterValidityAction,\n NgssmUpdateDataSourceParameterAction\n} from '../actions';\nimport { updateNgssmDataState } from '../state';\nimport { selectNgssmDataSourceValue, throwIfSourceValueDoesNotExist } from '../selectors';\n\n@Injectable()\nexport class DataSourceParameterReducer implements Reducer {\n public readonly processedActions: string[] = [\n NgssmDataActionType.setDataSourceParameter,\n NgssmDataActionType.updateDataSourceParameter,\n NgssmDataActionType.setDataSourceParameterValidity\n ];\n\n public updateState(state: State, action: Action): State {\n throwIfSourceValueDoesNotExist(state, (action as NgssmDataSourceValueAction).key);\n\n switch (action.type) {\n case NgssmDataActionType.setDataSourceParameter: {\n const ngssmSetDataSourceParameterAction = action as NgssmSetDataSourceParameterAction;\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmSetDataSourceParameterAction.key]: {\n parameter: { $set: ngssmSetDataSourceParameterAction.parameter },\n parameterIsValid: { $set: ngssmSetDataSourceParameterAction.parameterIsValid },\n valueOutdated: { $set: ngssmSetDataSourceParameterAction.doNotMarkParameterAsModified === true ? false : true }\n // leave parameterPartialValidity as-is on value set (no change here)\n }\n }\n });\n }\n\n case NgssmDataActionType.updateDataSourceParameter: {\n const ngssmUpdateDataSourceParameterAction = action as NgssmUpdateDataSourceParameterAction;\n const newParameter = update<object, never>(\n selectNgssmDataSourceValue(state, ngssmUpdateDataSourceParameterAction.key)?.parameter as object,\n {\n $merge: ngssmUpdateDataSourceParameterAction.parameter\n }\n );\n\n const updatedState = updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmUpdateDataSourceParameterAction.key]: {\n parameter: { $set: newParameter }\n }\n }\n });\n\n if (ngssmUpdateDataSourceParameterAction.doNotUpdateValueOutdated === true) {\n return updatedState;\n }\n\n return updateNgssmDataState(updatedState, {\n dataSourceValues: {\n [ngssmUpdateDataSourceParameterAction.key]: {\n valueOutdated: { $set: true }\n }\n }\n });\n }\n\n case NgssmDataActionType.setDataSourceParameterValidity: {\n const ngssmSetDataSourceParameterValidityAction = action as NgssmSetDataSourceParameterValidityAction;\n if (ngssmSetDataSourceParameterValidityAction.partialValidityKey) {\n return this.setPartialValidity(\n state,\n ngssmSetDataSourceParameterValidityAction.key,\n ngssmSetDataSourceParameterValidityAction.isValid,\n ngssmSetDataSourceParameterValidityAction.partialValidityKey\n );\n }\n\n return this.setGlobalValidity(\n state,\n ngssmSetDataSourceParameterValidityAction.key,\n ngssmSetDataSourceParameterValidityAction.isValid,\n ngssmSetDataSourceParameterValidityAction.clearPartialValidities\n );\n }\n }\n\n return state;\n }\n\n private setGlobalValidity(state: State, key: string, isValid: boolean, clearPartialValidities?: boolean): State {\n if (clearPartialValidities === true) {\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [key]: {\n parameterIsValid: { $set: isValid },\n parameterPartialValidity: { $set: undefined }\n }\n }\n });\n }\n\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [key]: {\n parameterIsValid: { $set: isValid }\n }\n }\n });\n }\n\n private setPartialValidity(state: State, key: string, isValid: boolean, partialKey: string): State {\n if (selectNgssmDataSourceValue(state, key)?.parameterPartialValidity) {\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [key]: {\n parameterPartialValidity: {\n [partialKey]: { $set: isValid }\n }\n }\n }\n });\n }\n\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [key]: {\n parameterPartialValidity: {\n $set: {\n [partialKey]: isValid\n }\n }\n }\n }\n });\n }\n}\n","import { EnvironmentInjector, inject, Injectable, runInInjectionContext } from '@angular/core';\n\nimport { Effect, State, Action, Logger, ActionDispatcher } from 'ngssm-store';\n\nimport {\n NgssmDataActionType,\n NgssmDataSourceValueAction,\n NgssmLoadDataSourceAdditionalPropertyValueAction,\n NgssmSetDataSourceAdditionalPropertyValueAction,\n NgssmSetDataSourceValueAction\n} from '../actions';\nimport { selectNgssmDataState } from '../state';\nimport { NgssmDataSourceValueStatus } from '../model';\n\n@Injectable()\nexport class DataLoadingEffect implements Effect {\n public readonly processedActions: string[] = [\n NgssmDataActionType.loadDataSourceValue,\n NgssmDataActionType.loadDataSourceAdditionalPropertyValue\n ];\n\n private readonly injector = inject(EnvironmentInjector);\n private readonly logger = inject(Logger);\n\n public processAction(actiondispatcher: ActionDispatcher, state: State, action: Action): void {\n const key = (action as NgssmDataSourceValueAction).key;\n const dataSource = selectNgssmDataState(state).dataSources[key];\n if (!dataSource) {\n this.logger.error(`No data source setup for key '${key}'`);\n return;\n }\n\n const dataSourceValue = selectNgssmDataState(state).dataSourceValues[key];\n\n switch (action.type) {\n case NgssmDataActionType.loadDataSourceValue: {\n if (dataSourceValue?.status !== NgssmDataSourceValueStatus.loading) {\n this.logger.information(\n `Data source value for '${key}' is not in '${NgssmDataSourceValueStatus.loading}' status: '${dataSourceValue?.status}'`\n );\n return;\n }\n\n runInInjectionContext(this.injector, () => {\n dataSource.dataLoadingFunc(state, key, dataSourceValue.parameter).subscribe({\n next: (value) => {\n if (dataSource.onLoaded) {\n try {\n runInInjectionContext(this.injector, () => {\n dataSource.onLoaded!(state, key, dataSourceValue.parameter, value);\n });\n } catch (callbackError) {\n this.logger.error(`Error in onLoaded callback for '${key}'`, callbackError as Error);\n }\n }\n actiondispatcher.dispatchAction(new NgssmSetDataSourceValueAction(key, NgssmDataSourceValueStatus.loaded, value));\n },\n error: (error) => {\n this.logger.error(`Unable to load data for '${key}'`, error);\n if (dataSource.onLoadError) {\n try {\n runInInjectionContext(this.injector, () => {\n dataSource.onLoadError!(state, key, dataSourceValue.parameter, error);\n });\n } catch (callbackError) {\n this.logger.error(`Error in onLoadError callback for '${key}'`, callbackError as Error);\n }\n }\n actiondispatcher.dispatchAction(new NgssmSetDataSourceValueAction(key, NgssmDataSourceValueStatus.error, undefined, error));\n }\n });\n });\n\n break;\n }\n\n case NgssmDataActionType.loadDataSourceAdditionalPropertyValue: {\n const ngssmLoadDataSourceAdditionalPropertyValueAction = action as NgssmLoadDataSourceAdditionalPropertyValueAction;\n const property = ngssmLoadDataSourceAdditionalPropertyValueAction.property;\n if (dataSourceValue.additionalProperties[property]?.status !== NgssmDataSourceValueStatus.loading) {\n this.logger.information(\n `Data source additional property value for '${key}' and property '${property}' is not in '${NgssmDataSourceValueStatus.loading}' status: '${dataSourceValue?.status}'`\n );\n return;\n }\n\n runInInjectionContext(this.injector, () => {\n dataSource.additionalPropertyLoadingFunc?.(state, key, property).subscribe({\n next: (value) =>\n actiondispatcher.dispatchAction(\n new NgssmSetDataSourceAdditionalPropertyValueAction(\n key,\n property,\n NgssmDataSourceValueStatus.loaded,\n value,\n ngssmLoadDataSourceAdditionalPropertyValueAction.postLoadingAction\n )\n ),\n error: (error) => {\n this.logger.error(`Unable to load data for '${key}' and property '${property}'`, error);\n actiondispatcher.dispatchAction(\n new NgssmSetDataSourceAdditionalPropertyValueAction(\n key,\n property,\n NgssmDataSourceValueStatus.error,\n undefined,\n ngssmLoadDataSourceAdditionalPropertyValueAction.postLoadingAction,\n error\n )\n );\n }\n });\n });\n\n break;\n }\n }\n }\n}\n","import { effect, EnvironmentInjector, inject, runInInjectionContext } from '@angular/core';\n\nimport { Logger, Store } from 'ngssm-store';\n\nimport {\n NgssmDataActionType,\n NgssmLoadDataSourceAdditionalPropertyValueAction,\n NgssmSetDataSourceAdditionalPropertyValueAction\n} from './actions';\nimport { NgssmDataSourceValueStatus } from './model';\nimport { selectNgssmDataSourceAdditionalPropertyValue } from './selectors';\n\nexport const postLoadingActionExecutorInitializer = async () => {\n const injector = inject(EnvironmentInjector);\n const store = inject(Store);\n const logger = inject(Logger);\n\n effect(() => {\n const action = store.processedAction();\n if (action.type === NgssmDataActionType.loadDataSourceAdditionalPropertyValue) {\n const ngssmLoadDataSourceAdditionalPropertyValueAction = action as NgssmLoadDataSourceAdditionalPropertyValueAction;\n if (!ngssmLoadDataSourceAdditionalPropertyValueAction.postLoadingAction) {\n return;\n }\n\n const isLoaded =\n selectNgssmDataSourceAdditionalPropertyValue(\n store.state(),\n ngssmLoadDataSourceAdditionalPropertyValueAction.key,\n ngssmLoadDataSourceAdditionalPropertyValueAction.property\n )?.status === NgssmDataSourceValueStatus.loaded;\n\n if (isLoaded) {\n logger.information(`[postLoadingActionExecutor] Executing post loading action for ${action.type}`);\n runInInjectionContext(injector, ngssmLoadDataSourceAdditionalPropertyValueAction.postLoadingAction);\n }\n\n return;\n }\n\n if (action.type === NgssmDataActionType.setDataSourceAdditionalPropertyValue) {\n const ngssmSetDataSourceAdditionalPropertyValueAction = action as NgssmSetDataSourceAdditionalPropertyValueAction;\n if (!ngssmSetDataSourceAdditionalPropertyValueAction.postLoadingAction) {\n return;\n }\n\n logger.information(`[postLoadingActionExecutor] Executing post loading action for ${action.type}`);\n runInInjectionContext(injector, ngssmSetDataSourceAdditionalPropertyValueAction.postLoadingAction);\n }\n });\n\n return true;\n};\n","import { effect, inject, untracked } from '@angular/core';\n\nimport { Logger, State, Store } from 'ngssm-store';\n\nimport { NgssmSetDataSourceValueAction, NgssmDataActionType, NgssmLoadDataSourceValueAction } from './actions';\nimport { selectNgssmDataState } from './state';\n\nexport const dataSourcesLinkerInitializer = async () => {\n const store = inject(Store);\n const logger = inject(Logger);\n\n effect(() => {\n const action = store.processedAction();\n if (action.type !== NgssmDataActionType.setDataSourceValue) {\n return;\n }\n\n const setDataSourceValueAction = action as NgssmSetDataSourceValueAction;\n const state = selectNgssmDataState(untracked<State>(() => store.state())).dataSources;\n\n const linkedKeys = new Set(state[setDataSourceValueAction.key]?.linkedDataSources ?? []);\n for (const linkedKey of Object.keys(state).filter((key) => state[key].linkedToDataSource === setDataSourceValueAction.key)) {\n logger.information(`Force reload of data source'${linkedKey}' linked to '${setDataSourceValueAction.key}'`);\n linkedKeys.add(linkedKey);\n }\n\n for (const linkedKey of linkedKeys) {\n store.dispatchAction(\n new NgssmLoadDataSourceValueAction(linkedKey, {\n forceReload: true\n })\n );\n }\n });\n\n return true;\n};\n","import { effect, inject, untracked } from '@angular/core';\n\nimport { EffectFunc, State, Action, Logger, Store } from 'ngssm-store';\n\nimport { NgssmDataActionType, NgssmLoadDataSourceValueAction, NgssmSetDataSourceValueAction } from './actions';\nimport { selectNgssmDataSourceValue } from './selectors';\nimport { NgssmDataSourceValueStatus } from './model';\nimport { selectNgssmDataState } from './state';\n\n/**\n * Effect function that handles loading a data source with a dependency.\n *\n * This effect checks if the requested data source has a dependency that is not yet loaded.\n * If the data source is not currently loading and has a dependency, it dispatches an action\n * to load the dependency data source first. If the data source does not have a dependency,\n * it logs an error message.\n *\n * @param state - The current application state.\n * @param action - The action triggering the effect, expected to be of type NgssmLoadDataSourceValueAction.\n * @returns void\n */\nexport const loadDataSourceWithDependencyEffect: EffectFunc = (state: State, action: Action) => {\n const ngssmLoadDataSourceValueAction = action as NgssmLoadDataSourceValueAction;\n const dataSourceValue = selectNgssmDataSourceValue(state, ngssmLoadDataSourceValueAction.key);\n\n // We only take into account source with a dependency not already loaded. In that case, the status must not be loading.\n if (dataSourceValue.status === NgssmDataSourceValueStatus.loading) {\n return;\n }\n\n const dataSource = selectNgssmDataState(state).dataSources[ngssmLoadDataSourceValueAction.key];\n\n const dependency = dataSource.dependsOnDataSource;\n if (!dependency) {\n // Date source is already loaded and has no dependency.\n // This is the usual case with data source with a lifetime not null and reloaded without being forced when a page is opened.\n return;\n }\n\n const store = inject(Store);\n store.dispatchAction(new NgssmLoadDataSourceValueAction(dependency));\n};\n\n/**\n * Effect initializer that listens for NgssmSetDataSourceValueAction and dispatches any delayed loading actions\n * for dependent data sources. This ensures that when a data source is set, any queued actions for sources\n * waiting on this dependency are executed.\n */\nexport const dependentDataSourceLoadInitializer = async () => {\n const store = inject(Store);\n const logger = inject(Logger);\n\n effect(() => {\n const action = store.processedAction();\n if (action.type !== NgssmDataActionType.setDataSourceValue) {\n return;\n }\n\n const setDataSourceValueAction = action as NgssmSetDataSourceValueAction;\n const state = untracked<State>(() => store.state());\n\n const storedAction = selectNgssmDataState(state).delayedActions[setDataSourceValueAction.key];\n if (storedAction) {\n logger.information(`Dispatching delayed loading action for source ${(storedAction as NgssmLoadDataSourceValueAction).key}`);\n store.dispatchAction(storedAction);\n }\n });\n};\n","import { EnvironmentProviders, makeEnvironmentProviders, inject, provideAppInitializer } from '@angular/core';\n\nimport { Store, provideEffectFunc, provideEffects, provideReducers } from 'ngssm-store';\n\nimport { NGSSM_DATA_SOURCE, NgssmDataSource } from './model';\nimport {\n DataSourceAdditionalPropertyValueReducer,\n DataSourceParameterReducer,\n DataSourceValueReducer,\n DataSourcesRegistrationReducer,\n LoadDataSourceValueReducer\n} from './reducers';\nimport { DataLoadingEffect } from './effects';\nimport { NgssmDataActionType, NgssmRegisterDataSourcesAction } from './actions';\nimport { postLoadingActionExecutorInitializer } from './post-loading-action-executor';\nimport { dataSourcesLinkerInitializer } from './data-sources-linker';\nimport { dependentDataSourceLoadInitializer, loadDataSourceWithDependencyEffect } from './data-source-with-dependency';\n\nconst initDataSourceValues = () => {\n const store = inject(Store);\n const dataSources = (inject(NGSSM_DATA_SOURCE, { optional: true }) as unknown as NgssmDataSource[]) ?? [];\n if (dataSources.length > 0) {\n store.dispatchAction(new NgssmRegisterDataSourcesAction(dataSources));\n }\n};\n\nexport const provideNgssmData = (): EnvironmentProviders => {\n return makeEnvironmentProviders([\n provideAppInitializer(initDataSourceValues),\n provideAppInitializer(postLoadingActionExecutorInitializer),\n provideAppInitializer(dataSourcesLinkerInitializer),\n provideAppInitializer(dependentDataSourceLoadInitializer),\n provideReducers(\n DataSourcesRegistrationReducer,\n DataSourceValueReducer,\n LoadDataSourceValueReducer,\n DataSourceAdditionalPropertyValueReducer,\n DataSourceParameterReducer\n ),\n provideEffects(DataLoadingEffect),\n provideEffectFunc(NgssmDataActionType.loadDataSourceValue, loadDataSourceWithDependencyEffect)\n ]);\n};\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { State } from 'ngssm-store';\n\nimport { NgssmDataSourceValueStatus } from '../model';\nimport { selectNgssmDataSourceValue } from '../selectors';\n\n@Pipe({\n name: 'isNgssmDataSourceValueStatus'\n})\nexport class IsNgssmDataSourceValueStatusPipe implements PipeTransform {\n public transform(value: State, ...args: string[]): boolean {\n const key = args[0];\n const expectedStatuses = args.slice(1).map((a) => a as NgssmDataSourceValueStatus);\n const itemStatus = selectNgssmDataSourceValue(value, key).status;\n return expectedStatuses.includes(itemStatus);\n }\n}\n","import { Component, ChangeDetectionStrategy, input, OnDestroy } from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { MatOption, MatSelect } from '@angular/material/select';\nimport { MatFormField, MatLabel } from '@angular/material/form-field';\n\nimport { getNgssmDataSourceValueAutoReloadTypes, NgssmDataSourceValueAutoReloadType } from '../../model';\n\n@Component({\n selector: 'ngssm-auto-reload',\n imports: [ReactiveFormsModule, MatFormField, MatLabel, MatSelect, MatOption],\n templateUrl: './ngssm-auto-reload.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmAutoReloadComponent implements OnDestroy {\n public readonly autoReloadAction = input<() => void>(() => {\n // nothing by default\n });\n\n protected readonly reloadTypes = getNgssmDataSourceValueAutoReloadTypes();\n protected readonly reloadTypeControl = new FormControl<NgssmDataSourceValueAutoReloadType>('Off');\n\n private timerId: number | undefined;\n\n constructor() {\n this.reloadTypeControl.valueChanges.subscribe((v) => {\n if (v === 'Off' && this.timerId) {\n clearInterval(this.timerId);\n this.timerId = undefined;\n return;\n }\n\n let period = 60000;\n switch (v) {\n case '5min':\n period = 5 * period;\n break;\n\n case '15min':\n period = 15 * period;\n break;\n }\n\n this.timerId = setInterval(this.autoReloadAction(), period) as unknown as number;\n });\n }\n\n public ngOnDestroy(): void {\n if (this.timerId) {\n clearInterval(this.timerId);\n this.timerId = undefined;\n }\n }\n}\n","<mat-form-field>\n <mat-label>Select auto reload period</mat-label>\n <mat-select [formControl]=\"reloadTypeControl\">\n @for (option of reloadTypes; track option.value){\n <mat-option [value]=\"option.value\">\n {{option.label}}\n </mat-option>\n }\n </mat-select>\n</mat-form-field>","import { Component, ChangeDetectionStrategy, signal, input, effect, inject } from '@angular/core';\nimport { NgClass } from '@angular/common';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\nimport { MatButton, MatIconButton } from '@angular/material/button';\nimport { MatIcon } from '@angular/material/icon';\n\nimport { DateTime } from 'luxon';\n\nimport { createSignal, Store } from 'ngssm-store';\n\nimport { selectNgssmDataState } from '../../state';\nimport { isNgssmDataSourceValueParameterValid, NgssmDataSourceValue, NgssmDataSourceValueStatus } from '../../model';\nimport { NgssmLoadDataSourceValueAction } from '../../actions';\nimport { NgssmAutoReloadComponent } from '../ngssm-auto-reload/ngssm-auto-reload.component';\n\n@Component({\n selector: 'ngssm-data-reload-button',\n imports: [NgClass, MatButton, MatIconButton, MatTooltip, MatIcon, MatProgressSpinner, NgssmAutoReloadComponent],\n templateUrl: './ngssm-data-reload-button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmDataReloadButtonComponent {\n public readonly label = input<string | undefined>(undefined);\n public readonly keepAdditionalProperties = input(false);\n public readonly buttonIcon = input<string>('fa-solid fa-rotate-right');\n public readonly autoReloadEnabled = input(false);\n public readonly dataSourceKeys = input<string[]>([]);\n\n protected readonly loadInProgress = signal<boolean>(false);\n protected readonly buttonDisabled = signal<boolean>(true);\n protected readonly tooltipMessage = signal<string>('');\n protected readonly color = signal<string>('primary');\n\n private readonly store = inject(Store);\n private readonly dataSourceValues = createSignal<Record<string, NgssmDataSourceValue>>(\n (state) => selectNgssmDataState(state).dataSourceValues\n );\n\n constructor() {\n effect(() => {\n const values = this.dataSourceValues();\n const keys = this.dataSourceKeys();\n this.loadInProgress.set(keys.findIndex((v) => values[v]?.status === NgssmDataSourceValueStatus.loading) !== -1);\n let timestamp: DateTime | undefined;\n keys.forEach((key) => {\n const keyTimestamp = values[key]?.lastLoadingDate;\n if (keyTimestamp) {\n if (!timestamp || timestamp > keyTimestamp) {\n timestamp = keyTimestamp;\n }\n }\n });\n\n let tooltiMessage = 'Reload data.';\n if (timestamp) {\n tooltiMessage = [tooltiMessage, `Loaded at ${timestamp.toHTTP()}`].join('\\n');\n }\n this.tooltipMessage.set(tooltiMessage);\n\n if (this.loadInProgress()) {\n this.buttonDisabled.set(true);\n return;\n }\n\n const someHasAnInvalidParameter =\n keys.findIndex((key) => values[key] && isNgssmDataSourceValueParameterValid(values[key]) === false) !== -1;\n if (someHasAnInvalidParameter) {\n this.buttonDisabled.set(true);\n return;\n }\n\n this.buttonDisabled.set(keys.findIndex((v) => !!values[v]) === -1);\n\n const someHasAnOutdatedValue = keys.findIndex((key) => values[key]?.valueOutdated === true) !== -1;\n this.color.set(someHasAnOutdatedValue ? 'accent' : 'primary');\n });\n }\n\n protected readonly reloadAction = () => this.reload();\n\n protected reload(): void {\n const isDisabled = this.buttonDisabled();\n if (isDisabled) {\n return;\n }\n\n this.dataSourceKeys().forEach((key) =>\n this.store.dispatchAction(\n new NgssmLoadDataSourceValueAction(key, { forceReload: true, keepAdditionalProperties: this.keepAdditionalProperties() })\n )\n );\n }\n}\n","<div class=\"flex-row-center\">\n @if (label(); as buttonLabel) {\n <button\n mat-stroked-button\n [color]=\"color()\"\n class=\"mat-{{color()}}\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"buttonDisabled() === true\"\n id=\"reloadButton\">\n <div class=\"flex-row-center\">\n @if (loadInProgress()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon [ngClass]=\"buttonIcon()\" [color]=\"color()\"></mat-icon>\n }\n\n <span style=\"width: 0.5rem\"></span>\n\n {{ buttonLabel }}\n </div>\n </button>\n } @else {\n <button\n mat-icon-button\n [color]=\"color()\"\n class=\"mat-{{color()}}\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"buttonDisabled() === true\"\n id=\"reloadButton\">\n @if (loadInProgress()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon [ngClass]=\"buttonIcon()\" [color]=\"color()\"></mat-icon>\n }\n </button>\n }\n\n @if (autoReloadEnabled()) {\n <ngssm-auto-reload class=\"with-margin-left-8\" [autoReloadAction]=\"reloadAction\"></ngssm-auto-reload>\n }\n</div>\n","import { Directive, effect, inject, input, OnDestroy } from '@angular/core';\n\nimport { ACTION_DISPATCHER, ActionDispatcher } from 'ngssm-store';\n\nimport { NgssmDataSource } from '../model';\nimport { NgssmRegisterDataSourceAction, NgssmUnregisterDataSourceAction } from '../actions';\n\n@Directive({\n selector: '[ngssmScopedDataSource]'\n})\nexport class NgssmScopedDataSourceDirective implements OnDestroy {\n public readonly ngssmScopedDataSource = input.required<NgssmDataSource, NgssmDataSource>({\n transform: this.checkDataSoruce\n });\n\n private readonly actionDispatcher: ActionDispatcher = inject(ACTION_DISPATCHER);\n private isInitialized = false;\n\n constructor() {\n effect(() => {\n const dataSource = this.ngssmScopedDataSource();\n this.actionDispatcher.dispatchAction(new NgssmRegisterDataSourceAction(dataSource));\n });\n }\n\n public ngOnDestroy(): void {\n const key = this.ngssmScopedDataSource().key;\n if (key) {\n this.actionDispatcher.dispatchAction(new NgssmUnregisterDataSourceAction(key));\n }\n }\n\n private checkDataSoruce(value: NgssmDataSource): NgssmDataSource {\n if (this.isInitialized) {\n throw new Error('Data source is already set.');\n }\n\n this.isInitialized = true;\n\n return value;\n }\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { Store } from 'ngssm-store';\n\nimport { selectNgssmDataSourceValue } from './selectors';\n\nexport interface NgssmDataSourceSignal<T = unknown> {\n key: string;\n value: Signal<T>;\n}\n\nexport type NgssmDataSourceSignalType = 'value' | 'status' | 'parameter';\n\nexport interface NgssmDataSourceSignalOptions<T = unknown> {\n type?: NgssmDataSourceSignalType;\n defaultValue?: T;\n}\n\nexport const dataSourceToSignal = <T = unknown>(key: string, options?: NgssmDataSourceSignalOptions<T>): NgssmDataSourceSignal<T> => {\n const store = inject(Store);\n\n const usedOptions = options ?? { type: 'value' };\n if (!usedOptions.type) {\n usedOptions.type = 'value';\n }\n\n switch (usedOptions.type) {\n case 'status':\n return {\n key,\n value: computed(() => selectNgssmDataSourceValue(store.state(), key)?.status ?? options?.defaultValue) as Signal<T>\n };\n\n case 'value':\n return {\n key,\n value: computed(() => selectNgssmDataSourceValue<T>(store.state(), key)?.value ?? options?.defaultValue) as Signal<T>\n };\n\n case 'parameter':\n return {\n key,\n value: computed(() => selectNgssmDataSourceValue<T>(store.state(), key)?.parameter ?? options?.defaultValue) as Signal<T>\n };\n }\n};\n","import { Injector, effect, inject, runInInjectionContext } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { NgssmDataSourceValueStatus } from './model';\nimport { NgssmDataActionType, NgssmSetDataSourceValueAction } from './actions';\n\n/**\n * Creates a runner function that executes a post-loading action when the specified data source's value is set.\n * The runner listens for NgssmSetDataSourceValueAction for the given dataSourceKey and invokes the provided postLoadingAction\n * with the new status. The effect is automatically destroyed after the action is processed.\n *\n * @param dataSourceKey The key of the data source to monitor.\n * @param postLoadingAction A callback to execute with the new NgssmDataSourceValueStatus. It is called in an injection context.\n * @returns A function that, when called, sets up the effect and runner.\n */\nexport const postNgssmDataSourceLoadingActionRunnerBuilder = (\n dataSourceKey: string,\n postLoadingAction: (status: NgssmDataSourceValueStatus) => void\n): (() => void) => {\n const injector = inject(Injector);\n return () => {\n runInInjectionContext(injector, () => {\n const store = inject(Store);\n const effectRef = effect(() => {\n const action = store.processedAction();\n if (action.type === NgssmDataActionType.setDataSourceValue) {\n const typedAction = action as NgssmSetDataSourceValueAction;\n if (typedAction.key === dataSourceKey) {\n runInInjectionContext(injector, () => postLoadingAction(typedAction.status));\n effectRef.destroy();\n }\n }\n });\n });\n };\n};\n","/*\n * Public API Surface of ngssm-data\n */\n\nexport * from './lib/ngssm-data/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,mBAAmB,EAAA;;AAE7B,IAAA,mBAAA,CAAA,qBAAA,CAAA,GAAA,2CAAiE;;;AAIjE,IAAA,mBAAA,CAAA,oBAAA,CAAA,GAAA,0CAA+D;AAC/D,IAAA,mBAAA,CAAA,sBAAA,CAAA,GAAA,4CAAmE;;AAGnE,IAAA,mBAAA,CAAA,qBAAA,CAAA,GAAA,2CAAiE;;AAGjE,IAAA,mBAAA,CAAA,wBAAA,CAAA,GAAA,8CAAuE;;AAGvE,IAAA,mBAAA,CAAA,2BAAA,CAAA,GAAA,iDAA6E;;AAG7E,IAAA,mBAAA,CAAA,gCAAA,CAAA,GAAA,sDAAuF;;AAGvF,IAAA,mBAAA,CAAA,sBAAA,CAAA,GAAA,4CAAmE;;AAGnE,IAAA,mBAAA,CAAA,oBAAA,CAAA,GAAA,0CAA+D;;AAG/D,IAAA,mBAAA,CAAA,uCAAA,CAAA,GAAA,6DAAqG;;AAGrG,IAAA,mBAAA,CAAA,sCAAA,CAAA,GAAA,4DAAmG;AACrG,CAAC,EAhCW,mBAAm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/actions/ngssm-data-source-value.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-load-data-source-value.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-set-data-source-value.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-register-data-sources.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-clear-data-source-value.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-set-data-source-parameter.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-load-data-source-additional-property-value.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-set-data-source-additional-property-value.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-register-data-source.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-unregister-data-source.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-update-data-source-parameter.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/actions/ngssm-set-data-source-parameter-validity.action.ts","../../../projects/ngssm-data/src/lib/ngssm-data/model/ngssm-data-source.ts","../../../projects/ngssm-data/src/lib/ngssm-data/model/ngssm-data-source-value.ts","../../../projects/ngssm-data/src/lib/ngssm-data/state/ngssm-data.state.ts","../../../projects/ngssm-data/src/lib/ngssm-data/reducers/data-sources-registration.reducer.ts","../../../projects/ngssm-data/src/lib/ngssm-data/reducers/data-source-value.reducer.ts","../../../projects/ngssm-data/src/lib/ngssm-data/reducers/load-data-source-value.reducer.ts","../../../projects/ngssm-data/src/lib/ngssm-data/reducers/data-source-additional-property-value.reducer.ts","../../../projects/ngssm-data/src/lib/ngssm-data/selectors.ts","../../../projects/ngssm-data/src/lib/ngssm-data/reducers/data-source-parameter.reducer.ts","../../../projects/ngssm-data/src/lib/ngssm-data/effects/data-loading.effect.ts","../../../projects/ngssm-data/src/lib/ngssm-data/post-loading-action-executor.ts","../../../projects/ngssm-data/src/lib/ngssm-data/data-sources-linker.ts","../../../projects/ngssm-data/src/lib/ngssm-data/data-source-with-dependency.ts","../../../projects/ngssm-data/src/lib/ngssm-data/provide-ngssm-data.ts","../../../projects/ngssm-data/src/lib/ngssm-data/components/is-ngssm-data-source-value-status.pipe.ts","../../../projects/ngssm-data/src/lib/ngssm-data/components/ngssm-auto-reload/ngssm-auto-reload.component.ts","../../../projects/ngssm-data/src/lib/ngssm-data/components/ngssm-auto-reload/ngssm-auto-reload.component.html","../../../projects/ngssm-data/src/lib/ngssm-data/components/ngssm-data-reload-button/ngssm-data-reload-button.component.ts","../../../projects/ngssm-data/src/lib/ngssm-data/components/ngssm-data-reload-button/ngssm-data-reload-button.component.html","../../../projects/ngssm-data/src/lib/ngssm-data/components/ngssm-scoped-data-source.directive.ts","../../../projects/ngssm-data/src/lib/ngssm-data/data-source-signal.ts","../../../projects/ngssm-data/src/lib/ngssm-data/post-loading-helpers.ts","../../../projects/ngssm-data/src/public-api.ts","../../../projects/ngssm-data/src/ngssm-data.ts"],"sourcesContent":["export enum NgssmDataActionType {\n // Used by the library to initialize all the data sources provided by the application\n registerDataSources = '[NgssmDataActionType] registerDataSources',\n\n // Could be used by the application to register or unregister a data source.\n // This can be used, for example, to limit the lifetime of a data source to the lifetime of a component\n registerDataSource = '[NgssmDataActionType] registerDataSource',\n unregisterDataSource = '[NgssmDataActionType] unregisterDataSource',\n\n // Used to call the loading method to get the value for the data source\n loadDataSourceValue = '[NgssmDataActionType] loadDataSourceValue',\n\n // Update the parameter used by the loading method, if one is required\n setDataSourceParameter = '[NgssmDataActionType] setDataSourceParameter',\n\n // Used to partially update the parameter. Usefull when creating a search component with multiple search criteria.\n updateDataSourceParameter = '[NgssmDataActionType] updateDataSourceParameter',\n\n // Update only the validity of the parameter. Usefull in case of a partial update of the parameter.\n setDataSourceParameterValidity = '[NgssmDataActionType] setDataSourceParameterValidity',\n\n // Clear the stored value associated to a data source\n clearDataSourceValue = '[NgssmDataActionType] clearDataSourceValue',\n\n // Store the value for a given data source\n setDataSourceValue = '[NgssmDataActionType] setDataSourceValue',\n\n // Call the loading method to get the value for an additional property of the data source\n loadDataSourceAdditionalPropertyValue = '[NgssmDataActionType] loadDataSourceAdditionalPropertyValue',\n\n // Store the value for an additional property of the data source\n setDataSourceAdditionalPropertyValue = '[NgssmDataActionType] setDataSourceAdditionalPropertyValue'\n}\n","import { Action } from 'ngssm-store';\n\nexport class NgssmDataSourceValueAction implements Action {\n constructor(\n public readonly type: string,\n public readonly key: string\n ) {}\n}\n","import { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\nimport { NgssmLoadDataSourceOptions } from '../model';\n\nexport class NgssmLoadDataSourceValueAction<TParameter = unknown> extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly options?: NgssmLoadDataSourceOptions<TParameter>\n ) {\n super(NgssmDataActionType.loadDataSourceValue, key);\n }\n}\n","import { HttpErrorResponse } from '@angular/common/http';\n\nimport { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\nimport { NgssmDataSourceValueStatus } from '../model';\n\nexport class NgssmSetDataSourceValueAction<TData = unknown> extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly status: NgssmDataSourceValueStatus,\n public readonly value?: TData,\n public readonly httpErrorResponse?: HttpErrorResponse\n ) {\n super(NgssmDataActionType.setDataSourceValue, key);\n }\n}\n","import { Action } from 'ngssm-store';\n\nimport { NgssmDataActionType } from './ngssm-data-action-type';\nimport { NgssmDataSource } from '../model';\n\nexport class NgssmRegisterDataSourcesAction implements Action {\n public readonly type: string = NgssmDataActionType.registerDataSources;\n\n constructor(public readonly dataSources: NgssmDataSource[]) {}\n}\n","import { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\n\nexport class NgssmClearDataSourceValueAction extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly clearParameter = false\n ) {\n super(NgssmDataActionType.clearDataSourceValue, key);\n }\n}\n","import { NgssmDataActionType } from './ngssm-data-action-type';\nimport { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\n\nexport class NgssmSetDataSourceParameterAction<TParameter = unknown> extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly parameter?: TParameter,\n public readonly parameterIsValid?: boolean,\n public readonly doNotMarkParameterAsModified?: boolean\n ) {\n super(NgssmDataActionType.setDataSourceParameter, key);\n }\n}\n","import { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\n\nexport class NgssmLoadDataSourceAdditionalPropertyValueAction extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly property: string,\n public readonly forceReload?: boolean,\n public readonly postLoadingAction?: () => void\n ) {\n super(NgssmDataActionType.loadDataSourceAdditionalPropertyValue, key);\n }\n}\n","import { HttpErrorResponse } from '@angular/common/http';\n\nimport { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\nimport { NgssmDataSourceValueStatus } from '../model';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\n\nexport class NgssmSetDataSourceAdditionalPropertyValueAction<TProperty = unknown> extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly property: string,\n public readonly status: NgssmDataSourceValueStatus,\n public readonly value?: TProperty,\n public readonly postLoadingAction?: () => void,\n public readonly httpErrorResponse?: HttpErrorResponse\n ) {\n super(NgssmDataActionType.setDataSourceAdditionalPropertyValue, key);\n }\n}\n","import { Action } from 'ngssm-store';\n\nimport { NgssmDataActionType } from './ngssm-data-action-type';\nimport { NgssmDataSource } from '../model';\n\nexport class NgssmRegisterDataSourceAction implements Action {\n public readonly type: string = NgssmDataActionType.registerDataSource;\n\n constructor(public readonly dataSource: NgssmDataSource) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\n\nexport class NgssmUnregisterDataSourceAction implements Action {\n public readonly type: string = NgssmDataActionType.unregisterDataSource;\n\n constructor(public readonly dataSourceKey: string) {}\n}\n","import { NgssmDataActionType } from './ngssm-data-action-type';\nimport { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\n\n/**\n * Action to update part (partial) of a data source parameter.\n *\n * This action carries a Partial<TParameter> that will be merged with the existing parameter\n * for the specified data source key. By default, updating the parameter will mark the data\n * source value as outdated so it can be reloaded; set doNotUpdateValueOutdated to true to\n * avoid changing the valueOutdated flag when dispatching this action.\n *\n * The update of the parameter in state is made with a shallow merge. So be carefull with\n * the parameter value set in action.\n *\n * @template TParameter Type of the parameter object for the data source.\n * @param key The data source key whose parameter should be updated.\n * @param parameter Partial parameter to merge into the existing parameter.\n * @param doNotUpdateValueOutdated Optional flag to prevent marking the value as outdated.\n */\nexport class NgssmUpdateDataSourceParameterAction<TParameter = unknown> extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly parameter: Partial<TParameter>,\n public readonly doNotUpdateValueOutdated?: boolean\n ) {\n super(NgssmDataActionType.updateDataSourceParameter, key);\n }\n}\n","import { NgssmDataSourceValueAction } from './ngssm-data-source-value.action';\nimport { NgssmDataActionType } from './ngssm-data-action-type';\n\n/**\n * Action used to set the validity state of a data source parameter.\n *\n * This action updates the overall parameter validity for the specified data source.\n * Optionally a partial validity key can be provided to indicate which sub-field or\n * portion of the parameter the validity refers to (useful when validating parameter\n * objects field-by-field).\n *\n * If `partialValidityKey` is provided the action targets only that partial entry and\n * does not change the global `parameterIsValid` flag. If `clearPartialValidities` is\n * true the reducer handling this action should clear the parameterPartialValidity map\n * (remove all partial validity entries) when applying the global validity update.\n *\n * @param key The data source key this validity applies to.\n * @param isValid True when the parameter (or partial parameter) is valid, false otherwise.\n * @param partialValidityKey Optional identifier for partial validity (e.g. the parameter field name).\n * If set, the global validity is not modified.\n * @param clearPartialValidities If true, instructs reducers to clear existing partial validity entries\n * when updating overall validity. Useful to reset per-field validity after\n * a full-parameter validation step.\n */\nexport class NgssmSetDataSourceParameterValidityAction extends NgssmDataSourceValueAction {\n constructor(\n key: string,\n public readonly isValid: boolean,\n public readonly partialValidityKey?: string,\n public readonly clearPartialValidities?: boolean\n ) {\n super(NgssmDataActionType.setDataSourceParameterValidity, key);\n }\n}\n","import { EnvironmentProviders, InjectionToken, inject, makeEnvironmentProviders } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { State, Store } from 'ngssm-store';\nimport { NgssmLoadDataSourceValueAction } from '../actions';\n\n/**\n * Function signature for loading a data source value.\n * - state: the current global application state.\n * - dataSourceKey: the unique key of the data source being loaded.\n * - parameter: optional parameter passed to the loader.\n *\n * Must return an Observable that emits the requested data.\n */\nexport type NgssmDataLoading<TData = unknown, TParameter = unknown> = (\n state: State,\n dataSourceKey: string,\n parameter?: TParameter\n) => Observable<TData>;\n\n/**\n * Function signature for loading an additional property of a data source (e.g. row detail).\n * - state: the current global application state.\n * - dataSourceKey: the unique key of the data source.\n * - additionalProperty: the name of the additional property to load.\n *\n * Must return an Observable that emits the requested additional property data.\n */\nexport type NgssmAdditionalPropertyLoading<TData = unknown> = (\n state: State,\n dataSourceKey: string,\n additionalProperty: string\n) => Observable<TData>;\n\n/**\n * Callback invoked after data source loading succeeds.\n *\n * - state: current global application state\n * - dataSourceKey: source identifier\n * - parameter: parameter passed when loading\n * - value: loaded data\n */\nexport type NgssmDataSourceLoadSuccessCallback<TData = unknown, TParameter = unknown> = (\n state: State,\n dataSourceKey: string,\n parameter?: TParameter,\n value?: TData\n) => void;\n\n/**\n * Callback invoked after data source loading fails.\n *\n * - state: current global application state\n * - dataSourceKey: source identifier\n * - parameter: parameter passed when loading\n * - error: error returned by helper\n */\nexport type NgssmDataSourceLoadFailureCallback<TParameter = unknown> = (\n state: State,\n dataSourceKey: string,\n parameter?: TParameter,\n error?: unknown\n) => void;\n\n/**\n * Describes a data source and its optional behaviours.\n *\n * - key: unique identifier for the data source.\n * - dataLifetimeInSeconds: optional TTL for cached data (seconds).\n * - dataLoadingFunc: required function that loads the main data.\n * - additionalPropertyLoadingFunc: optional function to load named additional properties independently.\n * - initialParameter: optional parameter used initially when registering the data source.\n * - initialParameterInvalid: flag indicating the initial parameter should be considered invalid.\n * - linkedToDataSource: if specified, this data source is reloaded when the target source is updated.\n * - linkedDataSources: list of other data sources to reload when this source is updated.\n * - dependsOnDataSource: optional dependency key; when loading this source, the dependency will be loaded first.\n * - onLoaded: optional callback invoked after successful load (value is available).\n * - onLoadError: optional callback invoked after failed load (error is available).\n */\nexport interface NgssmDataSource<TData = unknown, TParameter = unknown, TAdditionalProperty = unknown> {\n key: string;\n dataLifetimeInSeconds?: number;\n dataLoadingFunc: NgssmDataLoading<TData, TParameter>;\n additionalPropertyLoadingFunc?: NgssmAdditionalPropertyLoading<TAdditionalProperty>;\n initialParameter?: TParameter;\n initialParameterInvalid?: boolean;\n linkedToDataSource?: string;\n linkedDataSources?: string[];\n dependsOnDataSource?: string;\n onLoaded?: NgssmDataSourceLoadSuccessCallback<TData, TParameter>;\n onLoadError?: NgssmDataSourceLoadFailureCallback<TParameter>;\n}\n\n/**\n * Injection token used to register data sources via DI.\n * Provide one or several NgssmDataSource objects using this token (multi: true).\n */\nexport const NGSSM_DATA_SOURCE = new InjectionToken<NgssmDataSource>('NGSSM_DATA_SOURCE');\n\n/**\n * Options accepted when providing a data source via provideNgssmDataSource.\n * See individual properties for behaviour.\n */\nexport interface NgssmDataSourceProvideOptions<TData = unknown, TParameter = unknown, TAdditionalProperty = unknown> {\n dataLifetimeInSeconds?: number;\n initialParameter?: TParameter;\n initialParameterInvalid?: boolean;\n additionalPropertyLoadingFunc?: NgssmAdditionalPropertyLoading<TAdditionalProperty>;\n linkedToDataSource?: string;\n linkedDataSources?: string[];\n dependsOnDataSource?: string;\n onLoaded?: NgssmDataSourceLoadSuccessCallback<TData, TParameter>;\n onLoadError?: NgssmDataSourceLoadFailureCallback<TParameter>;\n}\n\n/**\n * Helper function to register a data source in Angular's environment providers.\n * Use provideNgssmData() at app startup to pick up data sources registered via this helper.\n */\nexport const provideNgssmDataSource = <TData = unknown, TParameter = unknown, TAdditionalProperty = unknown>(\n key: string,\n loadingFunc: NgssmDataLoading<TData, TParameter>,\n options?: NgssmDataSourceProvideOptions<TData, TParameter, TAdditionalProperty>\n): EnvironmentProviders => {\n return makeEnvironmentProviders([\n {\n provide: NGSSM_DATA_SOURCE,\n useFactory: () => {\n const dataSource: NgssmDataSource<TData, TParameter, TAdditionalProperty> = {\n key,\n dataLifetimeInSeconds: options?.dataLifetimeInSeconds,\n dataLoadingFunc: loadingFunc,\n additionalPropertyLoadingFunc: options?.additionalPropertyLoadingFunc,\n onLoaded: options?.onLoaded,\n onLoadError: options?.onLoadError\n };\n\n if (options?.initialParameter) {\n dataSource.initialParameter = options?.initialParameter;\n }\n\n if (options?.initialParameterInvalid) {\n dataSource.initialParameterInvalid = options?.initialParameterInvalid;\n }\n\n if (options?.linkedToDataSource) {\n dataSource.linkedToDataSource = options?.linkedToDataSource;\n }\n\n if (options?.linkedDataSources) {\n dataSource.linkedDataSources = options?.linkedDataSources;\n }\n\n if (options?.dependsOnDataSource) {\n dataSource.dependsOnDataSource = options?.dependsOnDataSource;\n }\n\n return dataSource;\n },\n multi: true\n }\n ]);\n};\n\n/**\n * Guard / initializer helper that dispatches a NgssmLoadDataSourceValueAction for the given key.\n * Returns a function suitable for use in Router canActivate (or app initializers) that always returns true.\n */\nexport const ngssmLoadDataSourceValue = (key: string, forceReload = false): (() => boolean) => {\n return () => {\n inject(Store).dispatchAction(new NgssmLoadDataSourceValueAction(key, { forceReload }));\n return true;\n };\n};\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { DateTime } from 'luxon';\n\n/**\n * Enum describing the lifecycle status of a data source value.\n * - none: No value has been requested or initialized.\n * - notRegistered: The requested data source is not registered.\n * - loading: A load operation for the data source is currently in progress.\n * - loaded: The data source loaded successfully and a value is available.\n * - error: The last load attempt failed.\n */\nexport enum NgssmDataSourceValueStatus {\n none = 'none',\n notRegistered = 'notRegistered',\n loading = 'loading',\n loaded = 'loaded',\n error = 'error'\n}\n\n/**\n * Represents the status and optional metadata for an additional property of a data source.\n * Additional properties are values related to the main data source value that may be loaded independently\n * (for example, a row detail).\n *\n * @template TProperty Type of the additional property's value.\n * @property status Current load status of the additional property.\n * @property value Optional value of the additional property.\n * @property lastLoadingDate Optional timestamp of the last successful load (luxon DateTime).\n * @property httpErrorResponse Optional HTTP error returned during the last load attempt.\n */\nexport interface NgssmDataSourceAdditionalPropertyValue<TProperty = unknown> {\n status: NgssmDataSourceValueStatus;\n value?: TProperty;\n lastLoadingDate?: DateTime;\n httpErrorResponse?: HttpErrorResponse;\n}\n\n/**\n * Represents the stored value and metadata for a data source.\n *\n * @template TData Type of the data source value.\n * @template TParameter Type of the parameter used to load the data source.\n * @property status Current load status of the data source.\n * @property value Optional value returned by the data source loader.\n * @property parameter Optional parameter used when loading the data source.\n * @property lastLoadingDate Optional timestamp of the last successful load (luxon DateTime).\n * @property dataLifetimeInSeconds Optional TTL for cached data, in seconds.\n * @property additionalProperties Map of additional property values (see NgssmDataSourceAdditionalPropertyValue).\n * @property parameterIsValid Optional flag indicating if the current parameter is valid.\n * @property parameterPartialValidity Optional map storing partial validity of parameter sub-fields (e.g. { fieldA: true, fieldB: false }).\n * @property httpErrorResponse Optional HTTP error returned during the last load attempt.\n * @property valueOutdated Optional flag indicating that the parameter changed and the value is now outdated.\n */\nexport interface NgssmDataSourceValue<TData = unknown, TParameter = unknown> {\n status: NgssmDataSourceValueStatus;\n value?: TData;\n parameter?: TParameter;\n lastLoadingDate?: DateTime;\n dataLifetimeInSeconds?: number;\n additionalProperties: Record<string, NgssmDataSourceAdditionalPropertyValue>;\n parameterIsValid?: boolean;\n\n /**\n * Map storing partial validity information for the parameter.\n * Key is a parameter field name (or any identifier) and value is boolean validity.\n * Undefined when no partial validation data is present.\n */\n parameterPartialValidity?: Record<string, boolean>;\n\n httpErrorResponse?: HttpErrorResponse;\n\n // Parameter has been updated but not value\n valueOutdated?: boolean;\n}\n\n/**\n * Types and helper for automatic reload intervals of a data source value.\n * - NgssmDataSourceValueAutoReloadType: allowed string values for auto-reload selection.\n * - getNgssmDataSourceValueAutoReloadTypes: returns a list of label/value pairs usable for UI selects.\n */\nexport type NgssmDataSourceValueAutoReloadType = 'Off' | '1min' | '5min' | '15min';\nexport const getNgssmDataSourceValueAutoReloadTypes = (): { label: string; value: NgssmDataSourceValueAutoReloadType }[] => [\n { label: 'Off', value: 'Off' },\n { label: 'Every minute', value: '1min' },\n { label: 'Every 5 minutes', value: '5min' },\n { label: 'Every 15 minutes', value: '15min' }\n];\n\nexport const isNgssmDataSourceValueParameterValid = (dataSourceValue: NgssmDataSourceValue): boolean => {\n if (dataSourceValue.parameterPartialValidity) {\n let isValid = true;\n Object.values(dataSourceValue.parameterPartialValidity).forEach((isPartialValid) => {\n isValid = isValid && isPartialValid;\n });\n return isValid;\n }\n\n if (dataSourceValue.parameterIsValid === false) {\n return false;\n }\n\n return true;\n};\n","import update, { Spec } from 'immutability-helper';\n\nimport { Action, NgSsmFeatureState, State } from 'ngssm-store';\nimport { NgssmDataSource, NgssmDataSourceValue } from '../model';\n\nexport const selectNgssmDataState = (state: State): NgssmDataState => state[NgssmDataStateSpecification.featureStateKey] as NgssmDataState;\n\nexport const updateNgssmDataState = (state: State, command: Spec<NgssmDataState, never>): State =>\n update(state, {\n [NgssmDataStateSpecification.featureStateKey]: command\n });\n\nexport interface NgssmDataState {\n dataSourceValues: Record<string, NgssmDataSourceValue>;\n dataSources: Record<string, NgssmDataSource>;\n delayedActions: Record<string, Action>;\n}\n\n@NgSsmFeatureState({\n featureStateKey: NgssmDataStateSpecification.featureStateKey,\n initialState: NgssmDataStateSpecification.initialState\n})\nexport class NgssmDataStateSpecification {\n public static readonly featureStateKey = 'ngssm-data-state';\n public static readonly initialState: NgssmDataState = {\n dataSourceValues: {},\n dataSources: {},\n delayedActions: {}\n };\n}\n","import { Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport {\n NgssmDataActionType,\n NgssmRegisterDataSourceAction,\n NgssmRegisterDataSourcesAction,\n NgssmUnregisterDataSourceAction\n} from '../actions';\nimport { NgssmDataSource, NgssmDataSourceValue, NgssmDataSourceValueStatus } from '../model';\nimport { selectNgssmDataState, updateNgssmDataState } from '../state';\n\n@Injectable()\nexport class DataSourcesRegistrationReducer implements Reducer {\n public readonly processedActions: string[] = [\n NgssmDataActionType.registerDataSources,\n NgssmDataActionType.registerDataSource,\n NgssmDataActionType.unregisterDataSource\n ];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmDataActionType.registerDataSources: {\n const registerDataSourcesAction = action as NgssmRegisterDataSourcesAction;\n const dataSourceValues: Record<string, NgssmDataSourceValue> = {};\n const dataSources: Record<string, NgssmDataSource> = {};\n registerDataSourcesAction.dataSources.forEach((dataSource) => {\n if (selectNgssmDataState(state).dataSources[dataSource.key]) {\n return;\n }\n\n dataSourceValues[dataSource.key] = {\n status: NgssmDataSourceValueStatus.none,\n additionalProperties: {}\n };\n\n if (dataSource.dataLifetimeInSeconds) {\n dataSourceValues[dataSource.key].dataLifetimeInSeconds = dataSource.dataLifetimeInSeconds;\n }\n\n if (dataSource.initialParameter) {\n dataSourceValues[dataSource.key].parameter = dataSource.initialParameter;\n }\n\n if (dataSource.initialParameterInvalid) {\n dataSourceValues[dataSource.key].parameterIsValid = false;\n }\n\n dataSources[dataSource.key] = dataSource;\n });\n\n return updateNgssmDataState(state, {\n dataSourceValues: { $merge: dataSourceValues },\n dataSources: { $merge: dataSources }\n });\n }\n\n case NgssmDataActionType.registerDataSource: {\n const registerDataSourceAction = action as NgssmRegisterDataSourceAction;\n return this.updateState(state, new NgssmRegisterDataSourcesAction([registerDataSourceAction.dataSource]));\n }\n\n case NgssmDataActionType.unregisterDataSource: {\n const unregisterDataSource = action as NgssmUnregisterDataSourceAction;\n return updateNgssmDataState(state, {\n dataSourceValues: { $unset: [unregisterDataSource.dataSourceKey] },\n dataSources: { $unset: [unregisterDataSource.dataSourceKey] }\n });\n }\n }\n\n return state;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DateTime } from 'luxon';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NgssmClearDataSourceValueAction, NgssmDataActionType, NgssmSetDataSourceValueAction } from '../actions';\nimport { selectNgssmDataState, updateNgssmDataState } from '../state';\nimport { NgssmDataSourceValueStatus } from '../model';\n\n@Injectable()\nexport class DataSourceValueReducer implements Reducer {\n public readonly processedActions: string[] = [NgssmDataActionType.setDataSourceValue, NgssmDataActionType.clearDataSourceValue];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmDataActionType.setDataSourceValue: {\n const ngssmSetDataSourceValueAction = action as NgssmSetDataSourceValueAction;\n const dataSourceValue = selectNgssmDataState(state).dataSourceValues[ngssmSetDataSourceValueAction.key];\n if (!dataSourceValue) {\n break;\n }\n\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmSetDataSourceValueAction.key]: {\n status: { $set: ngssmSetDataSourceValueAction.status },\n value: { $set: ngssmSetDataSourceValueAction.value },\n lastLoadingDate: { $set: DateTime.now() },\n httpErrorResponse: { $set: ngssmSetDataSourceValueAction.httpErrorResponse }\n // leave parameterPartialValidity as-is on value set (no change here)\n }\n }\n });\n }\n\n case NgssmDataActionType.clearDataSourceValue: {\n const ngssmClearDataSourceValueAction = action as NgssmClearDataSourceValueAction;\n let currentState = state;\n if (ngssmClearDataSourceValueAction.clearParameter) {\n currentState = updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmClearDataSourceValueAction.key]: {\n parameter: { $set: undefined },\n parameterIsValid: { $set: undefined },\n // clear partial validity when parameter is cleared\n parameterPartialValidity: { $set: undefined }\n }\n }\n });\n }\n\n return updateNgssmDataState(currentState, {\n dataSourceValues: {\n [ngssmClearDataSourceValueAction.key]: {\n status: { $set: NgssmDataSourceValueStatus.none },\n value: { $set: undefined },\n lastLoadingDate: { $set: undefined },\n additionalProperties: { $set: {} },\n httpErrorResponse: { $set: undefined }\n }\n }\n });\n }\n }\n\n return state;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DateTime } from 'luxon';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NgssmDataActionType, NgssmLoadDataSourceValueAction } from '../actions';\nimport { selectNgssmDataState, updateNgssmDataState } from '../state';\nimport { NgssmDataSourceValueStatus } from '../model';\n\n@Injectable()\nexport class LoadDataSourceValueReducer implements Reducer {\n public readonly processedActions: string[] = [NgssmDataActionType.loadDataSourceValue];\n\n public updateState(state: State, action: Action): State {\n if (action.type !== NgssmDataActionType.loadDataSourceValue) {\n return state;\n }\n\n const loadDataSourceValue = action as NgssmLoadDataSourceValueAction;\n\n // If data source is not defined, return input state\n const dataSource = selectNgssmDataState(state).dataSources[loadDataSourceValue.key];\n if (!dataSource) {\n return state;\n }\n\n let currentState = state;\n\n // Check if source depends on another one\n if (dataSource.dependsOnDataSource) {\n const masterSourceValue = selectNgssmDataState(state).dataSourceValues[dataSource.dependsOnDataSource];\n if (masterSourceValue && masterSourceValue.status !== NgssmDataSourceValueStatus.loaded) {\n return updateNgssmDataState(state, {\n delayedActions: {\n [dataSource.dependsOnDataSource]: { $set: action }\n }\n });\n }\n\n if (selectNgssmDataState(state).delayedActions[dataSource.dependsOnDataSource] === action) {\n currentState = updateNgssmDataState(state, {\n delayedActions: { $unset: [dataSource.dependsOnDataSource] }\n });\n }\n }\n\n const dataSourceValue = selectNgssmDataState(state).dataSourceValues[loadDataSourceValue.key];\n if (!dataSourceValue) {\n return state;\n }\n\n let shouldReload = false;\n\n if (loadDataSourceValue.options?.parameter) {\n shouldReload = true;\n currentState = updateNgssmDataState(currentState, {\n dataSourceValues: {\n [loadDataSourceValue.key]: {\n parameter: { $set: loadDataSourceValue.options?.parameter.value }\n }\n }\n });\n }\n\n if (dataSourceValue.status === NgssmDataSourceValueStatus.loaded) {\n if (loadDataSourceValue.options?.forceReload === true || !dataSourceValue.dataLifetimeInSeconds || !dataSourceValue.lastLoadingDate) {\n shouldReload = true;\n } else {\n const dataLifetime = DateTime.now().diff(dataSourceValue.lastLoadingDate, 'second');\n if ((dataLifetime.toObject().seconds ?? 0) > dataSourceValue.dataLifetimeInSeconds) {\n shouldReload = true;\n }\n }\n } else {\n shouldReload = true;\n }\n\n if (dataSourceValue.parameterIsValid === false) {\n shouldReload = false;\n }\n\n if (shouldReload) {\n if (loadDataSourceValue.options?.keepAdditionalProperties !== true) {\n currentState = updateNgssmDataState(currentState, {\n dataSourceValues: {\n [loadDataSourceValue.key]: {\n additionalProperties: { $set: {} }\n }\n }\n });\n }\n\n if (loadDataSourceValue.options?.resetValue === true) {\n currentState = updateNgssmDataState(currentState, {\n dataSourceValues: {\n [loadDataSourceValue.key]: {\n value: { $set: undefined }\n }\n }\n });\n }\n\n return updateNgssmDataState(currentState, {\n dataSourceValues: {\n [loadDataSourceValue.key]: {\n status: { $set: NgssmDataSourceValueStatus.loading },\n valueOutdated: { $set: false }\n }\n }\n });\n }\n\n return state;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DateTime } from 'luxon';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport {\n NgssmDataActionType,\n NgssmLoadDataSourceAdditionalPropertyValueAction,\n NgssmSetDataSourceAdditionalPropertyValueAction\n} from '../actions';\nimport { selectNgssmDataState, updateNgssmDataState } from '../state';\nimport { NgssmDataSourceValueStatus } from '../model';\n\n@Injectable()\nexport class DataSourceAdditionalPropertyValueReducer implements Reducer {\n public readonly processedActions: string[] = [\n NgssmDataActionType.loadDataSourceAdditionalPropertyValue,\n NgssmDataActionType.setDataSourceAdditionalPropertyValue\n ];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmDataActionType.loadDataSourceAdditionalPropertyValue: {\n const ngssmLoadDataSourceAdditionalPropertyValueAction = action as NgssmLoadDataSourceAdditionalPropertyValueAction;\n const dataSourcePropertyValue =\n selectNgssmDataState(state).dataSourceValues[ngssmLoadDataSourceAdditionalPropertyValueAction.key]?.additionalProperties[\n ngssmLoadDataSourceAdditionalPropertyValueAction.property\n ];\n\n if (\n dataSourcePropertyValue?.status === NgssmDataSourceValueStatus.loaded &&\n ngssmLoadDataSourceAdditionalPropertyValueAction.forceReload !== true\n ) {\n break;\n }\n\n if (!dataSourcePropertyValue) {\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmLoadDataSourceAdditionalPropertyValueAction.key]: {\n additionalProperties: {\n [ngssmLoadDataSourceAdditionalPropertyValueAction.property]: {\n $set: {\n status: NgssmDataSourceValueStatus.loading\n }\n }\n }\n }\n }\n });\n }\n\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmLoadDataSourceAdditionalPropertyValueAction.key]: {\n additionalProperties: {\n [ngssmLoadDataSourceAdditionalPropertyValueAction.property]: {\n status: { $set: NgssmDataSourceValueStatus.loading }\n }\n }\n }\n }\n });\n }\n\n case NgssmDataActionType.setDataSourceAdditionalPropertyValue: {\n const ngssmSetDataSourceAdditionalPropertyValueAction = action as NgssmSetDataSourceAdditionalPropertyValueAction;\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmSetDataSourceAdditionalPropertyValueAction.key]: {\n additionalProperties: {\n [ngssmSetDataSourceAdditionalPropertyValueAction.property]: {\n $set: {\n status: ngssmSetDataSourceAdditionalPropertyValueAction.status,\n value: ngssmSetDataSourceAdditionalPropertyValueAction.value,\n lastLoadingDate: DateTime.now(),\n httpErrorResponse: ngssmSetDataSourceAdditionalPropertyValueAction.httpErrorResponse\n }\n }\n }\n }\n }\n });\n }\n }\n\n return state;\n }\n}\n","import { State } from 'ngssm-store';\n\nimport {\n isNgssmDataSourceValueParameterValid,\n NgssmDataSourceAdditionalPropertyValue,\n NgssmDataSourceValue,\n NgssmDataSourceValueStatus\n} from './model';\nimport { selectNgssmDataState } from './state/ngssm-data.state';\n\nexport const selectNgssmDataSourceValue = <TDataType = unknown, TParameter = unknown>(\n state: State,\n key: string\n): NgssmDataSourceValue<TDataType, TParameter> => {\n return (selectNgssmDataState(state).dataSourceValues[key] ?? {\n status: NgssmDataSourceValueStatus.notRegistered\n }) as NgssmDataSourceValue<TDataType, TParameter>;\n};\n\nexport const selectNgssmDataSourceAdditionalPropertyValue = <TProperty = unknown>(\n state: State,\n key: string,\n property: string\n): NgssmDataSourceAdditionalPropertyValue<TProperty> => {\n return (selectNgssmDataState(state).dataSourceValues[key]?.additionalProperties[property] ?? {\n status: NgssmDataSourceValueStatus.notRegistered\n }) as NgssmDataSourceAdditionalPropertyValue<TProperty>;\n};\n\n/**\n * Returns true if the specified data source is currently loading, false otherwise.\n * @param state The global application state.\n * @param dataSourceKey The unique key of the data source.\n */\nexport const isNgssmDataSourceLoading = (state: State, dataSourceKey: string): boolean =>\n selectNgssmDataSourceValue(state, dataSourceKey)?.status === NgssmDataSourceValueStatus.loading;\n\n/**\n * Determines whether the parameter for the specified data source should be considered valid.\n *\n * Rules:\n * - If parameterIsValid is explicitly true or false on the data source value, that value is returned.\n * - Otherwise, if parameterPartialValidity map exists, the function returns true only if all\n * partial entries are true (logical AND).\n * - If no explicit validity information is present, the parameter is considered valid (returns true).\n *\n * @param state The global application state.\n * @param dataSourceKey The key of the data source to check.\n * @returns True when the parameter (or all partial parameter entries) is valid, false otherwise.\n */\nexport const isNgssmDataSourceParameterValid = (state: State, dataSourceKey: string): boolean => {\n const dataSource = selectNgssmDataSourceValue(state, dataSourceKey);\n if (!dataSource) {\n return true;\n }\n\n return isNgssmDataSourceValueParameterValid(dataSource);\n};\n\n/**\n * Throws an Error if the data source value for the given key does not exist in the state.\n *\n * This is a convenience guard used by callers that require the data source value to be present.\n * Use throwIfSourceValueDoesNotExist(state, key) to validate presence before accessing the value.\n *\n * @param state The global application state.\n * @param dataSourceKey The key of the data source to check.\n * @throws Error when the data source value is not present in the state.\n */\nexport const throwIfSourceValueDoesNotExist = (state: State, dataSourceKey?: string) => {\n if (!dataSourceKey) {\n return;\n }\n\n const dataSource = selectNgssmDataSourceValue(state, dataSourceKey);\n if (!dataSource || dataSource.status === NgssmDataSourceValueStatus.notRegistered) {\n throw new Error(`Datasource ${dataSourceKey} does not exists.`);\n }\n};\n","import { Injectable } from '@angular/core';\n\nimport update from 'immutability-helper';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport {\n NgssmDataActionType,\n NgssmDataSourceValueAction,\n NgssmSetDataSourceParameterAction,\n NgssmSetDataSourceParameterValidityAction,\n NgssmUpdateDataSourceParameterAction\n} from '../actions';\nimport { updateNgssmDataState } from '../state';\nimport { selectNgssmDataSourceValue, throwIfSourceValueDoesNotExist } from '../selectors';\n\n@Injectable()\nexport class DataSourceParameterReducer implements Reducer {\n public readonly processedActions: string[] = [\n NgssmDataActionType.setDataSourceParameter,\n NgssmDataActionType.updateDataSourceParameter,\n NgssmDataActionType.setDataSourceParameterValidity\n ];\n\n public updateState(state: State, action: Action): State {\n throwIfSourceValueDoesNotExist(state, (action as NgssmDataSourceValueAction).key);\n\n switch (action.type) {\n case NgssmDataActionType.setDataSourceParameter: {\n const ngssmSetDataSourceParameterAction = action as NgssmSetDataSourceParameterAction;\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmSetDataSourceParameterAction.key]: {\n parameter: { $set: ngssmSetDataSourceParameterAction.parameter },\n parameterIsValid: { $set: ngssmSetDataSourceParameterAction.parameterIsValid },\n valueOutdated: { $set: ngssmSetDataSourceParameterAction.doNotMarkParameterAsModified === true ? false : true }\n // leave parameterPartialValidity as-is on value set (no change here)\n }\n }\n });\n }\n\n case NgssmDataActionType.updateDataSourceParameter: {\n const ngssmUpdateDataSourceParameterAction = action as NgssmUpdateDataSourceParameterAction;\n const newParameter = update<object, never>(\n selectNgssmDataSourceValue(state, ngssmUpdateDataSourceParameterAction.key)?.parameter as object,\n {\n $merge: ngssmUpdateDataSourceParameterAction.parameter\n }\n );\n\n const updatedState = updateNgssmDataState(state, {\n dataSourceValues: {\n [ngssmUpdateDataSourceParameterAction.key]: {\n parameter: { $set: newParameter }\n }\n }\n });\n\n if (ngssmUpdateDataSourceParameterAction.doNotUpdateValueOutdated === true) {\n return updatedState;\n }\n\n return updateNgssmDataState(updatedState, {\n dataSourceValues: {\n [ngssmUpdateDataSourceParameterAction.key]: {\n valueOutdated: { $set: true }\n }\n }\n });\n }\n\n case NgssmDataActionType.setDataSourceParameterValidity: {\n const ngssmSetDataSourceParameterValidityAction = action as NgssmSetDataSourceParameterValidityAction;\n if (ngssmSetDataSourceParameterValidityAction.partialValidityKey) {\n return this.setPartialValidity(\n state,\n ngssmSetDataSourceParameterValidityAction.key,\n ngssmSetDataSourceParameterValidityAction.isValid,\n ngssmSetDataSourceParameterValidityAction.partialValidityKey\n );\n }\n\n return this.setGlobalValidity(\n state,\n ngssmSetDataSourceParameterValidityAction.key,\n ngssmSetDataSourceParameterValidityAction.isValid,\n ngssmSetDataSourceParameterValidityAction.clearPartialValidities\n );\n }\n }\n\n return state;\n }\n\n private setGlobalValidity(state: State, key: string, isValid: boolean, clearPartialValidities?: boolean): State {\n if (clearPartialValidities === true) {\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [key]: {\n parameterIsValid: { $set: isValid },\n parameterPartialValidity: { $set: undefined }\n }\n }\n });\n }\n\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [key]: {\n parameterIsValid: { $set: isValid }\n }\n }\n });\n }\n\n private setPartialValidity(state: State, key: string, isValid: boolean, partialKey: string): State {\n if (selectNgssmDataSourceValue(state, key)?.parameterPartialValidity) {\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [key]: {\n parameterPartialValidity: {\n [partialKey]: { $set: isValid }\n }\n }\n }\n });\n }\n\n return updateNgssmDataState(state, {\n dataSourceValues: {\n [key]: {\n parameterPartialValidity: {\n $set: {\n [partialKey]: isValid\n }\n }\n }\n }\n });\n }\n}\n","import { EnvironmentInjector, inject, Injectable, runInInjectionContext } from '@angular/core';\n\nimport { Effect, State, Action, Logger, ActionDispatcher } from 'ngssm-store';\n\nimport {\n NgssmDataActionType,\n NgssmDataSourceValueAction,\n NgssmLoadDataSourceAdditionalPropertyValueAction,\n NgssmSetDataSourceAdditionalPropertyValueAction,\n NgssmSetDataSourceValueAction\n} from '../actions';\nimport { selectNgssmDataState } from '../state';\nimport { NgssmDataSourceValueStatus } from '../model';\n\n@Injectable()\nexport class DataLoadingEffect implements Effect {\n public readonly processedActions: string[] = [\n NgssmDataActionType.loadDataSourceValue,\n NgssmDataActionType.loadDataSourceAdditionalPropertyValue\n ];\n\n private readonly injector = inject(EnvironmentInjector);\n private readonly logger = inject(Logger);\n\n public processAction(actiondispatcher: ActionDispatcher, state: State, action: Action): void {\n const key = (action as NgssmDataSourceValueAction).key;\n const dataSource = selectNgssmDataState(state).dataSources[key];\n if (!dataSource) {\n this.logger.error(`No data source setup for key '${key}'`);\n return;\n }\n\n const dataSourceValue = selectNgssmDataState(state).dataSourceValues[key];\n\n switch (action.type) {\n case NgssmDataActionType.loadDataSourceValue: {\n if (dataSourceValue?.status !== NgssmDataSourceValueStatus.loading) {\n this.logger.information(\n `Data source value for '${key}' is not in '${NgssmDataSourceValueStatus.loading}' status: '${dataSourceValue?.status}'`\n );\n return;\n }\n\n runInInjectionContext(this.injector, () => {\n dataSource.dataLoadingFunc(state, key, dataSourceValue.parameter).subscribe({\n next: (value) => {\n if (dataSource.onLoaded) {\n try {\n runInInjectionContext(this.injector, () => {\n dataSource.onLoaded!(state, key, dataSourceValue.parameter, value);\n });\n } catch (callbackError) {\n this.logger.error(`Error in onLoaded callback for '${key}'`, callbackError as Error);\n }\n }\n actiondispatcher.dispatchAction(new NgssmSetDataSourceValueAction(key, NgssmDataSourceValueStatus.loaded, value));\n },\n error: (error) => {\n this.logger.error(`Unable to load data for '${key}'`, error);\n if (dataSource.onLoadError) {\n try {\n runInInjectionContext(this.injector, () => {\n dataSource.onLoadError!(state, key, dataSourceValue.parameter, error);\n });\n } catch (callbackError) {\n this.logger.error(`Error in onLoadError callback for '${key}'`, callbackError as Error);\n }\n }\n actiondispatcher.dispatchAction(new NgssmSetDataSourceValueAction(key, NgssmDataSourceValueStatus.error, undefined, error));\n }\n });\n });\n\n break;\n }\n\n case NgssmDataActionType.loadDataSourceAdditionalPropertyValue: {\n const ngssmLoadDataSourceAdditionalPropertyValueAction = action as NgssmLoadDataSourceAdditionalPropertyValueAction;\n const property = ngssmLoadDataSourceAdditionalPropertyValueAction.property;\n if (dataSourceValue.additionalProperties[property]?.status !== NgssmDataSourceValueStatus.loading) {\n this.logger.information(\n `Data source additional property value for '${key}' and property '${property}' is not in '${NgssmDataSourceValueStatus.loading}' status: '${dataSourceValue?.status}'`\n );\n return;\n }\n\n runInInjectionContext(this.injector, () => {\n dataSource.additionalPropertyLoadingFunc?.(state, key, property).subscribe({\n next: (value) =>\n actiondispatcher.dispatchAction(\n new NgssmSetDataSourceAdditionalPropertyValueAction(\n key,\n property,\n NgssmDataSourceValueStatus.loaded,\n value,\n ngssmLoadDataSourceAdditionalPropertyValueAction.postLoadingAction\n )\n ),\n error: (error) => {\n this.logger.error(`Unable to load data for '${key}' and property '${property}'`, error);\n actiondispatcher.dispatchAction(\n new NgssmSetDataSourceAdditionalPropertyValueAction(\n key,\n property,\n NgssmDataSourceValueStatus.error,\n undefined,\n ngssmLoadDataSourceAdditionalPropertyValueAction.postLoadingAction,\n error\n )\n );\n }\n });\n });\n\n break;\n }\n }\n }\n}\n","import { effect, EnvironmentInjector, inject, runInInjectionContext } from '@angular/core';\n\nimport { Logger, Store } from 'ngssm-store';\n\nimport {\n NgssmDataActionType,\n NgssmLoadDataSourceAdditionalPropertyValueAction,\n NgssmSetDataSourceAdditionalPropertyValueAction\n} from './actions';\nimport { NgssmDataSourceValueStatus } from './model';\nimport { selectNgssmDataSourceAdditionalPropertyValue } from './selectors';\n\nexport const postLoadingActionExecutorInitializer = async () => {\n const injector = inject(EnvironmentInjector);\n const store = inject(Store);\n const logger = inject(Logger);\n\n effect(() => {\n const action = store.processedAction();\n if (action.type === NgssmDataActionType.loadDataSourceAdditionalPropertyValue) {\n const ngssmLoadDataSourceAdditionalPropertyValueAction = action as NgssmLoadDataSourceAdditionalPropertyValueAction;\n if (!ngssmLoadDataSourceAdditionalPropertyValueAction.postLoadingAction) {\n return;\n }\n\n const isLoaded =\n selectNgssmDataSourceAdditionalPropertyValue(\n store.state(),\n ngssmLoadDataSourceAdditionalPropertyValueAction.key,\n ngssmLoadDataSourceAdditionalPropertyValueAction.property\n )?.status === NgssmDataSourceValueStatus.loaded;\n\n if (isLoaded) {\n logger.information(`[postLoadingActionExecutor] Executing post loading action for ${action.type}`);\n runInInjectionContext(injector, ngssmLoadDataSourceAdditionalPropertyValueAction.postLoadingAction);\n }\n\n return;\n }\n\n if (action.type === NgssmDataActionType.setDataSourceAdditionalPropertyValue) {\n const ngssmSetDataSourceAdditionalPropertyValueAction = action as NgssmSetDataSourceAdditionalPropertyValueAction;\n if (!ngssmSetDataSourceAdditionalPropertyValueAction.postLoadingAction) {\n return;\n }\n\n logger.information(`[postLoadingActionExecutor] Executing post loading action for ${action.type}`);\n runInInjectionContext(injector, ngssmSetDataSourceAdditionalPropertyValueAction.postLoadingAction);\n }\n });\n\n return true;\n};\n","import { effect, inject, untracked } from '@angular/core';\n\nimport { Logger, State, Store } from 'ngssm-store';\n\nimport { NgssmSetDataSourceValueAction, NgssmDataActionType, NgssmLoadDataSourceValueAction } from './actions';\nimport { selectNgssmDataState } from './state';\n\nexport const dataSourcesLinkerInitializer = async () => {\n const store = inject(Store);\n const logger = inject(Logger);\n\n effect(() => {\n const action = store.processedAction();\n if (action.type !== NgssmDataActionType.setDataSourceValue) {\n return;\n }\n\n const setDataSourceValueAction = action as NgssmSetDataSourceValueAction;\n const state = selectNgssmDataState(untracked<State>(() => store.state())).dataSources;\n\n const linkedKeys = new Set(state[setDataSourceValueAction.key]?.linkedDataSources ?? []);\n for (const linkedKey of Object.keys(state).filter((key) => state[key].linkedToDataSource === setDataSourceValueAction.key)) {\n logger.information(`Force reload of data source'${linkedKey}' linked to '${setDataSourceValueAction.key}'`);\n linkedKeys.add(linkedKey);\n }\n\n for (const linkedKey of linkedKeys) {\n store.dispatchAction(\n new NgssmLoadDataSourceValueAction(linkedKey, {\n forceReload: true\n })\n );\n }\n });\n\n return true;\n};\n","import { effect, inject, untracked } from '@angular/core';\n\nimport { EffectFunc, State, Action, Logger, Store } from 'ngssm-store';\n\nimport { NgssmDataActionType, NgssmLoadDataSourceValueAction, NgssmSetDataSourceValueAction } from './actions';\nimport { selectNgssmDataSourceValue } from './selectors';\nimport { NgssmDataSourceValueStatus } from './model';\nimport { selectNgssmDataState } from './state';\n\n/**\n * Effect function that handles loading a data source with a dependency.\n *\n * This effect checks if the requested data source has a dependency that is not yet loaded.\n * If the data source is not currently loading and has a dependency, it dispatches an action\n * to load the dependency data source first. If the data source does not have a dependency,\n * it logs an error message.\n *\n * @param state - The current application state.\n * @param action - The action triggering the effect, expected to be of type NgssmLoadDataSourceValueAction.\n * @returns void\n */\nexport const loadDataSourceWithDependencyEffect: EffectFunc = (state: State, action: Action) => {\n const ngssmLoadDataSourceValueAction = action as NgssmLoadDataSourceValueAction;\n const dataSourceValue = selectNgssmDataSourceValue(state, ngssmLoadDataSourceValueAction.key);\n\n // We only take into account source with a dependency not already loaded. In that case, the status must not be loading.\n if (dataSourceValue.status === NgssmDataSourceValueStatus.loading) {\n return;\n }\n\n const dataSource = selectNgssmDataState(state).dataSources[ngssmLoadDataSourceValueAction.key];\n\n const dependency = dataSource.dependsOnDataSource;\n if (!dependency) {\n // Date source is already loaded and has no dependency.\n // This is the usual case with data source with a lifetime not null and reloaded without being forced when a page is opened.\n return;\n }\n\n const store = inject(Store);\n store.dispatchAction(new NgssmLoadDataSourceValueAction(dependency));\n};\n\n/**\n * Effect initializer that listens for NgssmSetDataSourceValueAction and dispatches any delayed loading actions\n * for dependent data sources. This ensures that when a data source is set, any queued actions for sources\n * waiting on this dependency are executed.\n */\nexport const dependentDataSourceLoadInitializer = async () => {\n const store = inject(Store);\n const logger = inject(Logger);\n\n effect(() => {\n const action = store.processedAction();\n if (action.type !== NgssmDataActionType.setDataSourceValue) {\n return;\n }\n\n const setDataSourceValueAction = action as NgssmSetDataSourceValueAction;\n const state = untracked<State>(() => store.state());\n\n const storedAction = selectNgssmDataState(state).delayedActions[setDataSourceValueAction.key];\n if (storedAction) {\n logger.information(`Dispatching delayed loading action for source ${(storedAction as NgssmLoadDataSourceValueAction).key}`);\n store.dispatchAction(storedAction);\n }\n });\n};\n","import { EnvironmentProviders, makeEnvironmentProviders, inject, provideAppInitializer } from '@angular/core';\n\nimport { Store, provideEffectFunc, provideEffects, provideReducers } from 'ngssm-store';\n\nimport { NGSSM_DATA_SOURCE, NgssmDataSource } from './model';\nimport {\n DataSourceAdditionalPropertyValueReducer,\n DataSourceParameterReducer,\n DataSourceValueReducer,\n DataSourcesRegistrationReducer,\n LoadDataSourceValueReducer\n} from './reducers';\nimport { DataLoadingEffect } from './effects';\nimport { NgssmDataActionType, NgssmRegisterDataSourcesAction } from './actions';\nimport { postLoadingActionExecutorInitializer } from './post-loading-action-executor';\nimport { dataSourcesLinkerInitializer } from './data-sources-linker';\nimport { dependentDataSourceLoadInitializer, loadDataSourceWithDependencyEffect } from './data-source-with-dependency';\n\nconst initDataSourceValues = () => {\n const store = inject(Store);\n const dataSources = (inject(NGSSM_DATA_SOURCE, { optional: true }) as unknown as NgssmDataSource[]) ?? [];\n if (dataSources.length > 0) {\n store.dispatchAction(new NgssmRegisterDataSourcesAction(dataSources));\n }\n};\n\nexport const provideNgssmData = (): EnvironmentProviders => {\n return makeEnvironmentProviders([\n provideAppInitializer(initDataSourceValues),\n provideAppInitializer(postLoadingActionExecutorInitializer),\n provideAppInitializer(dataSourcesLinkerInitializer),\n provideAppInitializer(dependentDataSourceLoadInitializer),\n provideReducers(\n DataSourcesRegistrationReducer,\n DataSourceValueReducer,\n LoadDataSourceValueReducer,\n DataSourceAdditionalPropertyValueReducer,\n DataSourceParameterReducer\n ),\n provideEffects(DataLoadingEffect),\n provideEffectFunc(NgssmDataActionType.loadDataSourceValue, loadDataSourceWithDependencyEffect)\n ]);\n};\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { State } from 'ngssm-store';\n\nimport { NgssmDataSourceValueStatus } from '../model';\nimport { selectNgssmDataSourceValue } from '../selectors';\n\n@Pipe({\n name: 'isNgssmDataSourceValueStatus'\n})\nexport class IsNgssmDataSourceValueStatusPipe implements PipeTransform {\n public transform(value: State, ...args: string[]): boolean {\n const key = args[0];\n const expectedStatuses = args.slice(1).map((a) => a as NgssmDataSourceValueStatus);\n const itemStatus = selectNgssmDataSourceValue(value, key).status;\n return expectedStatuses.includes(itemStatus);\n }\n}\n","import { Component, ChangeDetectionStrategy, input, OnDestroy, OnInit } from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { MatOption, MatSelect } from '@angular/material/select';\nimport { MatFormField, MatLabel } from '@angular/material/form-field';\n\nimport { getNgssmDataSourceValueAutoReloadTypes, NgssmDataSourceValueAutoReloadType } from '../../model';\n\n@Component({\n selector: 'ngssm-auto-reload',\n imports: [ReactiveFormsModule, MatFormField, MatLabel, MatSelect, MatOption],\n templateUrl: './ngssm-auto-reload.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmAutoReloadComponent implements OnInit, OnDestroy {\n public readonly autoReloadAction = input<() => void>(() => {\n // nothing by default\n });\n public readonly initialReloadType = input<NgssmDataSourceValueAutoReloadType>('Off');\n\n protected readonly reloadTypes = getNgssmDataSourceValueAutoReloadTypes();\n protected readonly reloadTypeControl = new FormControl<NgssmDataSourceValueAutoReloadType>('Off');\n\n private timerId: number | undefined;\n\n constructor() {\n this.reloadTypeControl.valueChanges.subscribe((v) => {\n if (v === 'Off' && this.timerId) {\n clearInterval(this.timerId);\n this.timerId = undefined;\n return;\n }\n\n let period = 60000;\n switch (v) {\n case '5min':\n period = 5 * period;\n break;\n\n case '15min':\n period = 15 * period;\n break;\n }\n\n this.timerId = setInterval(this.autoReloadAction(), period) as unknown as number;\n });\n }\n\n public ngOnInit(): void {\n this.reloadTypeControl.setValue(this.initialReloadType());\n }\n\n public ngOnDestroy(): void {\n if (this.timerId) {\n clearInterval(this.timerId);\n this.timerId = undefined;\n }\n }\n}\n","<mat-form-field>\n <mat-label>Select auto reload period</mat-label>\n <mat-select [formControl]=\"reloadTypeControl\">\n @for (option of reloadTypes; track option.value){\n <mat-option [value]=\"option.value\">\n {{option.label}}\n </mat-option>\n }\n </mat-select>\n</mat-form-field>","import { Component, ChangeDetectionStrategy, signal, input, effect, inject } from '@angular/core';\nimport { NgClass } from '@angular/common';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\nimport { MatButton, MatIconButton } from '@angular/material/button';\nimport { MatIcon } from '@angular/material/icon';\n\nimport { DateTime } from 'luxon';\n\nimport { createSignal, Store } from 'ngssm-store';\n\nimport { selectNgssmDataState } from '../../state';\nimport { isNgssmDataSourceValueParameterValid, NgssmDataSourceValue, NgssmDataSourceValueStatus } from '../../model';\nimport { NgssmLoadDataSourceValueAction } from '../../actions';\nimport { NgssmAutoReloadComponent } from '../ngssm-auto-reload/ngssm-auto-reload.component';\n\n@Component({\n selector: 'ngssm-data-reload-button',\n imports: [NgClass, MatButton, MatIconButton, MatTooltip, MatIcon, MatProgressSpinner, NgssmAutoReloadComponent],\n templateUrl: './ngssm-data-reload-button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmDataReloadButtonComponent {\n public readonly label = input<string | undefined>(undefined);\n public readonly keepAdditionalProperties = input(false);\n public readonly buttonIcon = input<string>('fa-solid fa-rotate-right');\n public readonly autoReloadEnabled = input(false);\n public readonly dataSourceKeys = input<string[]>([]);\n\n protected readonly loadInProgress = signal<boolean>(false);\n protected readonly buttonDisabled = signal<boolean>(true);\n protected readonly tooltipMessage = signal<string>('');\n protected readonly color = signal<string>('primary');\n\n private readonly store = inject(Store);\n private readonly dataSourceValues = createSignal<Record<string, NgssmDataSourceValue>>(\n (state) => selectNgssmDataState(state).dataSourceValues\n );\n\n constructor() {\n effect(() => {\n const values = this.dataSourceValues();\n const keys = this.dataSourceKeys();\n this.loadInProgress.set(keys.findIndex((v) => values[v]?.status === NgssmDataSourceValueStatus.loading) !== -1);\n let timestamp: DateTime | undefined;\n keys.forEach((key) => {\n const keyTimestamp = values[key]?.lastLoadingDate;\n if (keyTimestamp) {\n if (!timestamp || timestamp > keyTimestamp) {\n timestamp = keyTimestamp;\n }\n }\n });\n\n let tooltiMessage = 'Reload data.';\n if (timestamp) {\n tooltiMessage = [tooltiMessage, `Loaded at ${timestamp.toHTTP()}`].join('\\n');\n }\n this.tooltipMessage.set(tooltiMessage);\n\n if (this.loadInProgress()) {\n this.buttonDisabled.set(true);\n return;\n }\n\n const someHasAnInvalidParameter =\n keys.findIndex((key) => values[key] && isNgssmDataSourceValueParameterValid(values[key]) === false) !== -1;\n if (someHasAnInvalidParameter) {\n this.buttonDisabled.set(true);\n return;\n }\n\n this.buttonDisabled.set(keys.findIndex((v) => !!values[v]) === -1);\n\n const someHasAnOutdatedValue = keys.findIndex((key) => values[key]?.valueOutdated === true) !== -1;\n this.color.set(someHasAnOutdatedValue ? 'accent' : 'primary');\n });\n }\n\n protected readonly reloadAction = () => this.reload();\n\n protected reload(): void {\n const isDisabled = this.buttonDisabled();\n if (isDisabled) {\n return;\n }\n\n this.dataSourceKeys().forEach((key) =>\n this.store.dispatchAction(\n new NgssmLoadDataSourceValueAction(key, { forceReload: true, keepAdditionalProperties: this.keepAdditionalProperties() })\n )\n );\n }\n}\n","<div class=\"flex-row-center\">\n @if (label(); as buttonLabel) {\n <button\n mat-stroked-button\n [color]=\"color()\"\n class=\"mat-{{color()}}\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"buttonDisabled() === true\"\n id=\"reloadButton\">\n <div class=\"flex-row-center\">\n @if (loadInProgress()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon [ngClass]=\"buttonIcon()\" [color]=\"color()\"></mat-icon>\n }\n\n <span style=\"width: 0.5rem\"></span>\n\n {{ buttonLabel }}\n </div>\n </button>\n } @else {\n <button\n mat-icon-button\n [color]=\"color()\"\n class=\"mat-{{color()}}\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"buttonDisabled() === true\"\n id=\"reloadButton\">\n @if (loadInProgress()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon [ngClass]=\"buttonIcon()\" [color]=\"color()\"></mat-icon>\n }\n </button>\n }\n\n @if (autoReloadEnabled()) {\n <ngssm-auto-reload class=\"with-margin-left-8\" [autoReloadAction]=\"reloadAction\"></ngssm-auto-reload>\n }\n</div>\n","import { Directive, effect, inject, input, OnDestroy } from '@angular/core';\n\nimport { ACTION_DISPATCHER, ActionDispatcher } from 'ngssm-store';\n\nimport { NgssmDataSource } from '../model';\nimport { NgssmRegisterDataSourceAction, NgssmUnregisterDataSourceAction } from '../actions';\n\n@Directive({\n selector: '[ngssmScopedDataSource]'\n})\nexport class NgssmScopedDataSourceDirective implements OnDestroy {\n public readonly ngssmScopedDataSource = input.required<NgssmDataSource, NgssmDataSource>({\n transform: this.checkDataSoruce\n });\n\n private readonly actionDispatcher: ActionDispatcher = inject(ACTION_DISPATCHER);\n private isInitialized = false;\n\n constructor() {\n effect(() => {\n const dataSource = this.ngssmScopedDataSource();\n this.actionDispatcher.dispatchAction(new NgssmRegisterDataSourceAction(dataSource));\n });\n }\n\n public ngOnDestroy(): void {\n const key = this.ngssmScopedDataSource().key;\n if (key) {\n this.actionDispatcher.dispatchAction(new NgssmUnregisterDataSourceAction(key));\n }\n }\n\n private checkDataSoruce(value: NgssmDataSource): NgssmDataSource {\n if (this.isInitialized) {\n throw new Error('Data source is already set.');\n }\n\n this.isInitialized = true;\n\n return value;\n }\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { Store } from 'ngssm-store';\n\nimport { selectNgssmDataSourceValue } from './selectors';\n\nexport interface NgssmDataSourceSignal<T = unknown> {\n key: string;\n value: Signal<T>;\n}\n\nexport type NgssmDataSourceSignalType = 'value' | 'status' | 'parameter';\n\nexport interface NgssmDataSourceSignalOptions<T = unknown> {\n type?: NgssmDataSourceSignalType;\n defaultValue?: T;\n}\n\nexport const dataSourceToSignal = <T = unknown>(key: string, options?: NgssmDataSourceSignalOptions<T>): NgssmDataSourceSignal<T> => {\n const store = inject(Store);\n\n const usedOptions = options ?? { type: 'value' };\n if (!usedOptions.type) {\n usedOptions.type = 'value';\n }\n\n switch (usedOptions.type) {\n case 'status':\n return {\n key,\n value: computed(() => selectNgssmDataSourceValue(store.state(), key)?.status ?? options?.defaultValue) as Signal<T>\n };\n\n case 'value':\n return {\n key,\n value: computed(() => selectNgssmDataSourceValue<T>(store.state(), key)?.value ?? options?.defaultValue) as Signal<T>\n };\n\n case 'parameter':\n return {\n key,\n value: computed(() => selectNgssmDataSourceValue<T>(store.state(), key)?.parameter ?? options?.defaultValue) as Signal<T>\n };\n }\n};\n","import { Injector, effect, inject, runInInjectionContext } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { NgssmDataSourceValueStatus } from './model';\nimport { NgssmDataActionType, NgssmSetDataSourceValueAction } from './actions';\n\n/**\n * Creates a runner function that executes a post-loading action when the specified data source's value is set.\n * The runner listens for NgssmSetDataSourceValueAction for the given dataSourceKey and invokes the provided postLoadingAction\n * with the new status. The effect is automatically destroyed after the action is processed.\n *\n * @param dataSourceKey The key of the data source to monitor.\n * @param postLoadingAction A callback to execute with the new NgssmDataSourceValueStatus. It is called in an injection context.\n * @returns A function that, when called, sets up the effect and runner.\n */\nexport const postNgssmDataSourceLoadingActionRunnerBuilder = (\n dataSourceKey: string,\n postLoadingAction: (status: NgssmDataSourceValueStatus) => void\n): (() => void) => {\n const injector = inject(Injector);\n return () => {\n runInInjectionContext(injector, () => {\n const store = inject(Store);\n const effectRef = effect(() => {\n const action = store.processedAction();\n if (action.type === NgssmDataActionType.setDataSourceValue) {\n const typedAction = action as NgssmSetDataSourceValueAction;\n if (typedAction.key === dataSourceKey) {\n runInInjectionContext(injector, () => postLoadingAction(typedAction.status));\n effectRef.destroy();\n }\n }\n });\n });\n };\n};\n","/*\n * Public API Surface of ngssm-data\n */\n\nexport * from './lib/ngssm-data/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,mBAAmB,EAAA;;AAE7B,IAAA,mBAAA,CAAA,qBAAA,CAAA,GAAA,2CAAiE;;;AAIjE,IAAA,mBAAA,CAAA,oBAAA,CAAA,GAAA,0CAA+D;AAC/D,IAAA,mBAAA,CAAA,sBAAA,CAAA,GAAA,4CAAmE;;AAGnE,IAAA,mBAAA,CAAA,qBAAA,CAAA,GAAA,2CAAiE;;AAGjE,IAAA,mBAAA,CAAA,wBAAA,CAAA,GAAA,8CAAuE;;AAGvE,IAAA,mBAAA,CAAA,2BAAA,CAAA,GAAA,iDAA6E;;AAG7E,IAAA,mBAAA,CAAA,gCAAA,CAAA,GAAA,sDAAuF;;AAGvF,IAAA,mBAAA,CAAA,sBAAA,CAAA,GAAA,4CAAmE;;AAGnE,IAAA,mBAAA,CAAA,oBAAA,CAAA,GAAA,0CAA+D;;AAG/D,IAAA,mBAAA,CAAA,uCAAA,CAAA,GAAA,6DAAqG;;AAGrG,IAAA,mBAAA,CAAA,sCAAA,CAAA,GAAA,4DAAmG;AACrG,CAAC,EAhCW,mBAAmB,KAAnB,mBAAmB,GAAA,EAAA,CAAA,CAAA;;MCElB,0BAA0B,CAAA;AAEnB,IAAA,IAAA;AACA,IAAA,GAAA;IAFlB,WAAA,CACkB,IAAY,EACZ,GAAW,EAAA;QADX,IAAA,CAAA,IAAI,GAAJ,IAAI;QACJ,IAAA,CAAA,GAAG,GAAH,GAAG;IAClB;AACJ;;ACHK,MAAO,8BAAqD,SAAQ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": "ngssm-data",
3
- "version": "21.1.7",
3
+ "version": "21.1.9",
4
4
  "description": "NgSsm - Library used to facilitate the management of data get from remote service or computed locally.",
5
5
  "author": "Lion Marc",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { EnvironmentProviders, InjectionToken, PipeTransform, OnDestroy, Signal } from '@angular/core';
2
+ import { EnvironmentProviders, InjectionToken, PipeTransform, OnDestroy, OnInit, Signal } from '@angular/core';
3
3
  import { Action, State } from 'ngssm-store';
4
4
  import { HttpErrorResponse } from '@angular/common/http';
5
5
  import { DateTime } from 'luxon';
@@ -366,8 +366,9 @@ declare class NgssmScopedDataSourceDirective implements OnDestroy {
366
366
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgssmScopedDataSourceDirective, "[ngssmScopedDataSource]", never, { "ngssmScopedDataSource": { "alias": "ngssmScopedDataSource"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
367
367
  }
368
368
 
369
- declare class NgssmAutoReloadComponent implements OnDestroy {
369
+ declare class NgssmAutoReloadComponent implements OnInit, OnDestroy {
370
370
  readonly autoReloadAction: _angular_core.InputSignal<() => void>;
371
+ readonly initialReloadType: _angular_core.InputSignal<NgssmDataSourceValueAutoReloadType>;
371
372
  protected readonly reloadTypes: {
372
373
  label: string;
373
374
  value: NgssmDataSourceValueAutoReloadType;
@@ -375,9 +376,10 @@ declare class NgssmAutoReloadComponent implements OnDestroy {
375
376
  protected readonly reloadTypeControl: FormControl<NgssmDataSourceValueAutoReloadType | null>;
376
377
  private timerId;
377
378
  constructor();
379
+ ngOnInit(): void;
378
380
  ngOnDestroy(): void;
379
381
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgssmAutoReloadComponent, never>;
380
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgssmAutoReloadComponent, "ngssm-auto-reload", never, { "autoReloadAction": { "alias": "autoReloadAction"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
382
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgssmAutoReloadComponent, "ngssm-auto-reload", never, { "autoReloadAction": { "alias": "autoReloadAction"; "required": false; "isSignal": true; }; "initialReloadType": { "alias": "initialReloadType"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
381
383
  }
382
384
 
383
385
  interface NgssmDataSourceSignal<T = unknown> {