@geosdi/ngx-model 1.2.4 → 2.0.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/README.md CHANGED
@@ -66,7 +66,8 @@ mediator.getColleague("delete"); // the DeleteAction
66
66
  mediator.getColleague("missing"); // null
67
67
  ```
68
68
 
69
- - the colleagues are indexed once, in the constructor: to change them, build a new mediator;
69
+ - the colleagues are indexed once, in the constructor: to change them, build a new mediator.
70
+ `initColleagues()` is public, but calling it again only re-adds the same array to the map;
70
71
  - **two colleagues with the same key**: the last one wins, with no warning;
71
72
  - `getColleague` returns `null` for an unknown key;
72
73
  - `NgxMediator` is a plain class, not an Angular service: to inject it, provide it yourself (for
@@ -74,7 +75,15 @@ mediator.getColleague("missing"); // null
74
75
 
75
76
  ## Model
76
77
 
77
- `Model` is the base interface of an entity: an optional `id`, a string or a number.
78
+ `Model` is the base interface of an entity: an optional `id`, a string, a number or `null`.
79
+
80
+ ## Changes in 2.0.0
81
+
82
+ - **A major version**, released together with the other `@geosdi` libraries rebuilt for Angular 22.
83
+ For this library nothing changes: it has no peer dependencies and its API is the same.
84
+ - Compiled with Angular 22. The library still has no dependencies.
85
+ - This README: `initColleagues()` and the `null` id.
86
+ - The code is unchanged.
78
87
 
79
88
  ## Changes in 1.2.4
80
89
 
@@ -1,53 +1,24 @@
1
- /**
2
- * @author Vito Salvia - CNR IMAA geoSDI Group
3
- * @email vito.salvia@gmail.com
4
- */
5
- class NgxChainHandler {
6
- /**
7
- *
8
- */
9
- set successor(_successor) {
10
- this._successor = _successor;
11
- }
12
- }
13
-
14
- class NgxColleague {
15
- }
16
-
17
- /**
18
- * @author Vito Salvia - CNR IMAA geoSDI Group
19
- * @email vito.salvia@gmail.com
20
- */
21
- class NgxMediator {
22
- constructor(colleagues) {
23
- this.colleagues = colleagues;
24
- this.colleaguesMap = new Map();
25
- this.initColleagues();
26
- }
27
- /**
28
- *
29
- */
30
- initColleagues() {
31
- this.colleagues.forEach((c) => {
32
- this.colleaguesMap.set(c.getKey(), c);
33
- });
34
- }
35
- /**
36
- *
37
- * @param key
38
- */
39
- getColleague(key) {
40
- return this.colleaguesMap.has(key) ? this.colleaguesMap.get(key) : null;
41
- }
42
- }
43
-
44
- /*
45
- * Public API Surface of ngx-model
46
- */
47
-
48
- /**
49
- * Generated bundle index. Do not edit.
50
- */
51
-
1
+ var NgxChainHandler = class {
2
+ set successor(_successor) {
3
+ this._successor = _successor;
4
+ }
5
+ };
6
+ var NgxColleague = class {};
7
+ var NgxMediator = class {
8
+ constructor(colleagues) {
9
+ this.colleagues = colleagues;
10
+ this.colleaguesMap = /* @__PURE__ */ new Map();
11
+ this.initColleagues();
12
+ }
13
+ initColleagues() {
14
+ this.colleagues.forEach((c) => {
15
+ this.colleaguesMap.set(c.getKey(), c);
16
+ });
17
+ }
18
+ getColleague(key) {
19
+ return this.colleaguesMap.has(key) ? this.colleaguesMap.get(key) : null;
20
+ }
21
+ };
52
22
  export { NgxChainHandler, NgxColleague, NgxMediator };
53
- //# sourceMappingURL=geosdi-ngx-model.mjs.map
23
+
24
+ //# sourceMappingURL=geosdi-ngx-model.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"geosdi-ngx-model.mjs","sources":["../../../../projects/geosdi/support/ngx-model/src/lib/ngx-chain-handler.ts","../../../../projects/geosdi/support/ngx-model/src/lib/ngx-colleague.ts","../../../../projects/geosdi/support/ngx-model/src/lib/ngx-mediator.service.ts","../../../../projects/geosdi/support/ngx-model/src/index.ts","../../../../projects/geosdi/support/ngx-model/src/geosdi-ngx-model.ts"],"sourcesContent":["/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\nexport abstract class NgxChainHandler<B extends NgxChainHandler<B>> {\n protected _successor: B;\n\n /**\n *\n */\n public set successor(_successor: B) {\n this._successor = _successor;\n }\n}\n","/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\nexport interface INgxColleague {\n /**\n *\n */\n getKey(): any;\n}\n\nexport abstract class NgxColleague implements INgxColleague {\n /**\n *\n */\n abstract getKey(): any;\n}\n","import { INgxColleague } from \"./ngx-colleague\";\n\n/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\nexport class NgxMediator<C extends INgxColleague> {\n protected colleaguesMap: Map<string, C> = new Map();\n\n constructor(private colleagues: ReadonlyArray<C>) {\n this.initColleagues();\n }\n\n /**\n *\n */\n initColleagues() {\n this.colleagues.forEach((c) => {\n this.colleaguesMap.set(c.getKey(), c);\n });\n }\n\n /**\n *\n * @param key\n */\n getColleague(key: string) {\n return this.colleaguesMap.has(key) ? this.colleaguesMap.get(key) : null;\n }\n}\n","/*\n * Public API Surface of ngx-model\n */\n\nexport * from \"./lib/ngx-model\";\nexport * from \"./lib/ngx-chain-handler\";\nexport * from \"./lib/ngx-colleague\";\nexport * from \"./lib/ngx-mediator.service\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;;AAGG;MACmB,eAAe,CAAA;AAGjC;;AAEG;IACH,IAAW,SAAS,CAAC,UAAa,EAAA;AAC9B,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU;IAChC;AACH;;MCFqB,YAAY,CAAA;AAKjC;;ACdD;;;AAGG;MACU,WAAW,CAAA;AAGpB,IAAA,WAAA,CAAoB,UAA4B,EAAA;QAA5B,IAAA,CAAA,UAAU,GAAV,UAAU;AAFpB,QAAA,IAAA,CAAA,aAAa,GAAmB,IAAI,GAAG,EAAE;QAG/C,IAAI,CAAC,cAAc,EAAE;IACzB;AAEA;;AAEG;IACH,cAAc,GAAA;QACV,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,KAAI;AAC1B,YAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACzC,QAAA,CAAC,CAAC;IACN;AAEA;;;AAGG;AACH,IAAA,YAAY,CAAC,GAAW,EAAA;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI;IAC3E;AACH;;AC7BD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"geosdi-ngx-model.mjs","names":[],"sources":["../../../../projects/geosdi/support/ngx-model/src/lib/ngx-chain-handler.ts","../../../../projects/geosdi/support/ngx-model/src/lib/ngx-colleague.ts","../../../../projects/geosdi/support/ngx-model/src/lib/ngx-mediator.service.ts"],"sourcesContent":["/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\nexport abstract class NgxChainHandler<B extends NgxChainHandler<B>> {\n protected _successor: B;\n\n /**\n *\n */\n public set successor(_successor: B) {\n this._successor = _successor;\n }\n}\n","/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\nexport interface INgxColleague {\n /**\n *\n */\n getKey(): any;\n}\n\nexport abstract class NgxColleague implements INgxColleague {\n /**\n *\n */\n abstract getKey(): any;\n}\n","import { INgxColleague } from \"./ngx-colleague\";\n\n/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\nexport class NgxMediator<C extends INgxColleague> {\n protected colleaguesMap: Map<string, C> = new Map();\n\n constructor(private colleagues: ReadonlyArray<C>) {\n this.initColleagues();\n }\n\n /**\n *\n */\n initColleagues() {\n this.colleagues.forEach((c) => {\n this.colleaguesMap.set(c.getKey(), c);\n });\n }\n\n /**\n *\n * @param key\n */\n getColleague(key: string) {\n return this.colleaguesMap.has(key) ? this.colleaguesMap.get(key) : null;\n }\n}\n"],"mappings":"AAIA,IAAsB,kBAAtB,MAAqC;CAMjC,IAAW,UAAU,YAAa;EAC9B,KAAK,aAAa;CACtB;AACH;ACFD,IAAsB,eAAtB,MAAkC,CAKjC;ACVD,IAAa,cAAb,MAAwB;CAGpB,YAAoB,YAA4B;EAA5B,KAAA,aAAA;EAFV,KAAA,gCAAgC,IAAI,IAAG;EAG7C,KAAK,eAAc;CACvB;CAKA,iBAAc;EACV,KAAK,WAAW,SAAS,MAAK;GAC1B,KAAK,cAAc,IAAI,EAAE,OAAM,GAAI,CAAC;EACxC,CAAC;CACL;CAMA,aAAa,KAAW;EACpB,OAAO,KAAK,cAAc,IAAI,GAAG,IAAI,KAAK,cAAc,IAAI,GAAG,IAAI;CACvE;AACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geosdi/ngx-model",
3
- "version": "1.2.4",
3
+ "version": "2.0.0",
4
4
  "description": "Model class",
5
5
  "author": "Salvia Vito (vito.salvia@gmail.com)",
6
6
  "keywords": [
@@ -2,57 +2,51 @@
2
2
  * @author Vito Salvia - CNR IMAA geoSDI Group
3
3
  * @email vito.salvia@gmail.com
4
4
  */
5
- interface Model {
6
- id?: string | number | null;
5
+ export interface Model {
6
+ id?: string | number | null;
7
7
  }
8
-
9
8
  /**
10
9
  * @author Vito Salvia - CNR IMAA geoSDI Group
11
10
  * @email vito.salvia@gmail.com
12
11
  */
13
- declare abstract class NgxChainHandler<B extends NgxChainHandler<B>> {
14
- protected _successor: B;
15
- /**
16
- *
17
- */
18
- set successor(_successor: B);
12
+ export declare abstract class NgxChainHandler<B extends NgxChainHandler<B>> {
13
+ protected _successor: B;
14
+ /**
15
+ *
16
+ */
17
+ set successor(_successor: B);
19
18
  }
20
-
21
19
  /**
22
20
  * @author Vito Salvia - CNR IMAA geoSDI Group
23
21
  * @email vito.salvia@gmail.com
24
22
  */
25
- interface INgxColleague {
26
- /**
27
- *
28
- */
29
- getKey(): any;
23
+ export interface INgxColleague {
24
+ /**
25
+ *
26
+ */
27
+ getKey(): any;
30
28
  }
31
- declare abstract class NgxColleague implements INgxColleague {
32
- /**
33
- *
34
- */
35
- abstract getKey(): any;
29
+ export declare abstract class NgxColleague implements INgxColleague {
30
+ /**
31
+ *
32
+ */
33
+ abstract getKey(): any;
36
34
  }
37
-
38
35
  /**
39
36
  * @author Vito Salvia - CNR IMAA geoSDI Group
40
37
  * @email vito.salvia@gmail.com
41
38
  */
42
- declare class NgxMediator<C extends INgxColleague> {
43
- private colleagues;
44
- protected colleaguesMap: Map<string, C>;
45
- constructor(colleagues: ReadonlyArray<C>);
46
- /**
47
- *
48
- */
49
- initColleagues(): void;
50
- /**
51
- *
52
- * @param key
53
- */
54
- getColleague(key: string): C;
55
- }
56
-
57
- export { NgxChainHandler, NgxColleague, NgxMediator };
58
- export type { INgxColleague, Model };
39
+ export declare class NgxMediator<C extends INgxColleague> {
40
+ private colleagues;
41
+ protected colleaguesMap: Map<string, C>;
42
+ constructor(colleagues: ReadonlyArray<C>);
43
+ /**
44
+ *
45
+ */
46
+ initColleagues(): void;
47
+ /**
48
+ *
49
+ * @param key
50
+ */
51
+ getColleague(key: string): C;
52
+ }