ngssm-ag-grid 22.0.1 → 22.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ngssm-ag-grid-testing.mjs +14 -29
- package/fesm2022/ngssm-ag-grid-testing.mjs.map +1 -1
- package/fesm2022/ngssm-ag-grid.mjs +751 -748
- package/fesm2022/ngssm-ag-grid.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngssm-ag-grid-testing.d.ts +3 -6
- package/types/ngssm-ag-grid.d.ts +248 -341
|
@@ -1,34 +1,19 @@
|
|
|
1
|
-
import { inject, makeEnvironmentProviders, provideAppInitializer } from
|
|
2
|
-
import { Logger, Store } from
|
|
3
|
-
import { StoreMock } from
|
|
4
|
-
import { AgGridStateSpecification } from
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* App initializer that sets up the AgGrid state in the StoreMock for testing purposes.
|
|
8
|
-
* Throws an error if StoreMock is not registered.
|
|
9
|
-
*/
|
|
1
|
+
import { inject, makeEnvironmentProviders, provideAppInitializer } from "@angular/core";
|
|
2
|
+
import { Logger, Store } from "ngssm-store";
|
|
3
|
+
import { StoreMock } from "ngssm-store/testing";
|
|
4
|
+
import { AgGridStateSpecification } from "ngssm-ag-grid";
|
|
10
5
|
const ngssmAgGridStateInitializer = () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
...store.stateValue,
|
|
19
|
-
[AgGridStateSpecification.featureStateKey]: AgGridStateSpecification.initialState
|
|
20
|
-
};
|
|
6
|
+
inject(Logger).information("[ngssm-ag-grid-testing] Initialization of state and sources");
|
|
7
|
+
const store = inject(Store);
|
|
8
|
+
if (!(store instanceof StoreMock)) throw new Error("StoreMock is not registered.");
|
|
9
|
+
store.stateValue = {
|
|
10
|
+
...store.stateValue,
|
|
11
|
+
[AgGridStateSpecification.featureStateKey]: AgGridStateSpecification.initialState
|
|
12
|
+
};
|
|
21
13
|
};
|
|
22
|
-
/**
|
|
23
|
-
* Provides environment providers for AgGrid testing, including the state initializer.
|
|
24
|
-
*/
|
|
25
14
|
const provideNgssmAgGridTesting = () => {
|
|
26
|
-
|
|
15
|
+
return makeEnvironmentProviders([provideAppInitializer(ngssmAgGridStateInitializer)]);
|
|
27
16
|
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Generated bundle index. Do not edit.
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
17
|
export { ngssmAgGridStateInitializer, provideNgssmAgGridTesting };
|
|
34
|
-
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=ngssm-ag-grid-testing.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngssm-ag-grid-testing.mjs","sources":["../../../projects/ngssm-ag-grid/testing/src/provide-ngssm-ag-grid-testing.ts"
|
|
1
|
+
{"version":3,"file":"ngssm-ag-grid-testing.mjs","names":[],"sources":["../../../projects/ngssm-ag-grid/testing/src/provide-ngssm-ag-grid-testing.ts"],"sourcesContent":["import { EnvironmentProviders, inject, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';\n\nimport { Logger, Store } from 'ngssm-store';\nimport { StoreMock } from 'ngssm-store/testing';\nimport { AgGridStateSpecification } from 'ngssm-ag-grid';\n\n/**\n * App initializer that sets up the AgGrid state in the StoreMock for testing purposes.\n * Throws an error if StoreMock is not registered.\n */\nexport const ngssmAgGridStateInitializer = () => {\n const logger = inject(Logger);\n logger.information('[ngssm-ag-grid-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 [AgGridStateSpecification.featureStateKey]: AgGridStateSpecification.initialState\n };\n};\n\n/**\n * Provides environment providers for AgGrid testing, including the state initializer.\n */\nexport const provideNgssmAgGridTesting = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideAppInitializer(ngssmAgGridStateInitializer)]);\n};\n"],"mappings":";;;;AAUA,MAAa,oCAAmC;CAE9C,AADe,OAAO,MACtB,CAAA,CAAO,YAAY,6DAA6D;CAChF,MAAM,QAAQ,OAAO,KAAK;CAC1B,IAAI,EAAE,iBAAiB,YACrB,MAAM,IAAI,MAAM,8BAA8B;CAGhD,MAAM,aAAa;EACjB,GAAG,MAAM;GACR,yBAAyB,kBAAkB,yBAAyB;CACtE;AACH;AAKA,MAAa,kCAAuD;CAClE,OAAO,yBAAyB,CAAC,sBAAsB,2BAA2B,CAAC,CAAC;AACtF"}
|