@o3r/core 11.1.0-prerelease.9 → 11.1.0-rc.1

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.
Files changed (214) hide show
  1. package/builders/app-version/index.js.map +1 -0
  2. package/builders/app-version/schema.js.map +1 -0
  3. package/builders/lib-build/index.js.map +1 -0
  4. package/builders/lib-build/schema.js.map +1 -0
  5. package/builders/multi-watcher/index.js.map +1 -0
  6. package/builders/multi-watcher/schema.js.map +1 -0
  7. package/builders/ngc/index.js.map +1 -0
  8. package/builders/ngc/schema.js.map +1 -0
  9. package/builders/pattern-replacement/index.js.map +1 -0
  10. package/builders/pattern-replacement/schema.js.map +1 -0
  11. package/builders/run-script/index.js.map +1 -0
  12. package/builders/run-script/schema.js.map +1 -0
  13. package/builders/utils.js.map +1 -0
  14. package/core/application/build-properties.js +17 -0
  15. package/core/application/build-properties.js.map +1 -0
  16. package/core/application/dgp.interfaces.js +2 -0
  17. package/core/application/dgp.interfaces.js.map +1 -0
  18. package/core/application/index.js +4 -0
  19. package/core/application/index.js.map +1 -0
  20. package/core/application/runtime.js +2 -0
  21. package/core/application/runtime.js.map +1 -0
  22. package/core/common/index.js +3 -0
  23. package/core/common/index.js.map +1 -0
  24. package/core/common/interface-utils.js +2 -0
  25. package/core/common/interface-utils.js.map +1 -0
  26. package/core/common/label-value.js +2 -0
  27. package/core/common/label-value.js.map +1 -0
  28. package/core/devkit/devtools.interface.js +2 -0
  29. package/core/devkit/devtools.interface.js.map +1 -0
  30. package/core/devkit/index.js +2 -0
  31. package/core/devkit/index.js.map +1 -0
  32. package/core/index.js +7 -0
  33. package/core/index.js.map +1 -0
  34. package/core/interfaces/configuration.js +2 -0
  35. package/core/interfaces/configuration.js.map +1 -0
  36. package/core/interfaces/context.js +3 -0
  37. package/core/interfaces/context.js.map +1 -0
  38. package/core/interfaces/index.js +4 -0
  39. package/core/interfaces/index.js.map +1 -0
  40. package/core/interfaces/translation.js +2 -0
  41. package/core/interfaces/translation.js.map +1 -0
  42. package/core/metadata/component.decorator.d.ts.map +1 -1
  43. package/core/metadata/component.decorator.js +18 -0
  44. package/core/metadata/component.decorator.js.map +1 -0
  45. package/core/metadata/component.identifier.js +9 -0
  46. package/core/metadata/component.identifier.js.map +1 -0
  47. package/core/metadata/index.js +4 -0
  48. package/core/metadata/index.js.map +1 -0
  49. package/core/metadata/metadata.interface.js +2 -0
  50. package/core/metadata/metadata.interface.js.map +1 -0
  51. package/core/rules-engine/index.js +2 -0
  52. package/core/rules-engine/index.js.map +1 -0
  53. package/core/rules-engine/rules-engine.interfaces.js +2 -0
  54. package/core/rules-engine/rules-engine.interfaces.js.map +1 -0
  55. package/log/index.js +2 -0
  56. package/log/index.js.map +1 -0
  57. package/log/logger.js +2 -0
  58. package/log/logger.js.map +1 -0
  59. package/messages/common-message.interface.js +2 -0
  60. package/messages/common-message.interface.js.map +1 -0
  61. package/messages/index.js +4 -0
  62. package/messages/index.js.map +1 -0
  63. package/messages/message.helpers.d.ts +4 -4
  64. package/messages/message.helpers.d.ts.map +1 -1
  65. package/messages/message.helpers.js +52 -0
  66. package/messages/message.helpers.js.map +1 -0
  67. package/messages/message.interfaces.js +5 -0
  68. package/messages/message.interfaces.js.map +1 -0
  69. package/package.json +24 -24
  70. package/public_api.js +6 -0
  71. package/public_api.js.map +1 -0
  72. package/schematics/add-modules/index.js.map +1 -0
  73. package/schematics/add-modules/schema.js.map +1 -0
  74. package/schematics/component/container/index.js.map +1 -0
  75. package/schematics/component/container/schema.js.map +1 -0
  76. package/schematics/component/index.js.map +1 -0
  77. package/schematics/component/presenter/index.js.map +1 -0
  78. package/schematics/component/presenter/schema.js.map +1 -0
  79. package/schematics/component/schema.js.map +1 -0
  80. package/schematics/component/structures.types.js.map +1 -0
  81. package/schematics/context-to-component/index.js +2 -2
  82. package/schematics/context-to-component/index.js.map +1 -0
  83. package/schematics/context-to-component/schema.js.map +1 -0
  84. package/schematics/convert-component/index.js.map +1 -0
  85. package/schematics/convert-component/schema.js.map +1 -0
  86. package/schematics/ng-add/component-decorator/index.js.map +1 -0
  87. package/schematics/ng-add/index.js.map +1 -0
  88. package/schematics/ng-add/project-setup/index.js.map +1 -0
  89. package/schematics/ng-add/schema.js.map +1 -0
  90. package/schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.js +1 -2
  91. package/schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.js.map +1 -0
  92. package/schematics/ng-add/updates-for-v8/generators/update-generators-names.js +1 -2
  93. package/schematics/ng-add/updates-for-v8/generators/update-generators-names.js.map +1 -0
  94. package/schematics/ng-add/updates-for-v8/replaced-packages.js.map +1 -0
  95. package/schematics/ng-add/utils/index.js.map +1 -0
  96. package/schematics/ng-add/utils/linter/index.d.ts.map +1 -1
  97. package/schematics/ng-add/utils/linter/index.js.map +1 -0
  98. package/schematics/ng-add-create/index.js.map +1 -0
  99. package/schematics/ng-add-create/schema.js.map +1 -0
  100. package/schematics/ng-update/index.js.map +1 -0
  101. package/schematics/ng-update/v10.0/configuration.js.map +1 -0
  102. package/schematics/ng-update/v8.2/import-map.js.map +1 -0
  103. package/schematics/page/index.d.ts.map +1 -1
  104. package/schematics/page/index.js +23 -1
  105. package/schematics/page/index.js.map +1 -0
  106. package/schematics/page/schema.d.ts +1 -1
  107. package/schematics/page/schema.d.ts.map +1 -1
  108. package/schematics/page/schema.js.map +1 -0
  109. package/schematics/page/schema.json +2 -5
  110. package/schematics/renovate/index.js.map +1 -0
  111. package/schematics/renovate/schema.js.map +1 -0
  112. package/schematics/rule-factories/additional-modules/index.js +1 -2
  113. package/schematics/rule-factories/additional-modules/index.js.map +1 -0
  114. package/schematics/rule-factories/component/analytics.js.map +1 -0
  115. package/schematics/rule-factories/component/common.d.ts.map +1 -1
  116. package/schematics/rule-factories/component/common.js +0 -3
  117. package/schematics/rule-factories/component/common.js.map +1 -0
  118. package/schematics/rule-factories/component/configuration.d.ts +1 -1
  119. package/schematics/rule-factories/component/configuration.d.ts.map +1 -1
  120. package/schematics/rule-factories/component/configuration.js.map +1 -0
  121. package/schematics/rule-factories/component/context.d.ts +1 -1
  122. package/schematics/rule-factories/component/context.d.ts.map +1 -1
  123. package/schematics/rule-factories/component/context.js.map +1 -0
  124. package/schematics/rule-factories/component/design-token.d.ts +1 -1
  125. package/schematics/rule-factories/component/design-token.d.ts.map +1 -1
  126. package/schematics/rule-factories/component/design-token.js.map +1 -0
  127. package/schematics/rule-factories/component/fixture.d.ts +1 -1
  128. package/schematics/rule-factories/component/fixture.d.ts.map +1 -1
  129. package/schematics/rule-factories/component/fixture.js.map +1 -0
  130. package/schematics/rule-factories/component/localization.d.ts +1 -1
  131. package/schematics/rule-factories/component/localization.d.ts.map +1 -1
  132. package/schematics/rule-factories/component/localization.js.map +1 -0
  133. package/schematics/rule-factories/component/rules-engine.d.ts +1 -1
  134. package/schematics/rule-factories/component/rules-engine.d.ts.map +1 -1
  135. package/schematics/rule-factories/component/rules-engine.js.map +1 -0
  136. package/schematics/rule-factories/component/theming.d.ts +1 -1
  137. package/schematics/rule-factories/component/theming.d.ts.map +1 -1
  138. package/schematics/rule-factories/component/theming.js.map +1 -0
  139. package/schematics/rule-factories/customization-environment/index.js +1 -2
  140. package/schematics/rule-factories/customization-environment/index.js.map +1 -0
  141. package/schematics/rule-factories/index.js.map +1 -0
  142. package/schematics/rule-factories/o3r-basic-updates/index.js +1 -2
  143. package/schematics/rule-factories/o3r-basic-updates/index.js.map +1 -0
  144. package/schematics/rule-factories/otter-environment/index.d.ts.map +1 -1
  145. package/schematics/rule-factories/otter-environment/index.js +4 -12
  146. package/schematics/rule-factories/otter-environment/index.js.map +1 -0
  147. package/schematics/rule-factories/store/index.js +1 -2
  148. package/schematics/rule-factories/store/index.js.map +1 -0
  149. package/schematics/schematics-update/index.js.map +1 -0
  150. package/schematics/schematics-update/schema.js.map +1 -0
  151. package/schematics/scripts/exported-actions.js.map +1 -0
  152. package/schematics/scripts/sub-entry-imports.js.map +1 -0
  153. package/schematics/service/index.js.map +1 -0
  154. package/schematics/service/schema.js.map +1 -0
  155. package/schematics/shared/presets/all.preset.js +1 -2
  156. package/schematics/shared/presets/all.preset.js.map +1 -0
  157. package/schematics/shared/presets/basic.preset.js +1 -2
  158. package/schematics/shared/presets/basic.preset.js.map +1 -0
  159. package/schematics/shared/presets/cms.preset.js +1 -2
  160. package/schematics/shared/presets/cms.preset.js.map +1 -0
  161. package/schematics/shared/presets/external.preset.js +1 -2
  162. package/schematics/shared/presets/external.preset.js.map +1 -0
  163. package/schematics/shared/presets/helpers.js +1 -2
  164. package/schematics/shared/presets/helpers.js.map +1 -0
  165. package/schematics/shared/presets/index.js.map +1 -0
  166. package/schematics/shared/presets/preset.interface.js.map +1 -0
  167. package/schematics/show-modules/index.js.map +1 -0
  168. package/schematics/show-modules/schema.js.map +1 -0
  169. package/schematics/store/common/helpers.js.map +1 -0
  170. package/schematics/store/common/schema.js.map +1 -0
  171. package/schematics/store/entity-async/index.js.map +1 -0
  172. package/schematics/store/entity-async/schema.js.map +1 -0
  173. package/schematics/store/entity-sync/index.js.map +1 -0
  174. package/schematics/store/entity-sync/schema.js.map +1 -0
  175. package/schematics/store/index.js.map +1 -0
  176. package/schematics/store/schema.js.map +1 -0
  177. package/schematics/store/simple-async/index.js.map +1 -0
  178. package/schematics/store/simple-async/schema.js.map +1 -0
  179. package/schematics/store/simple-sync/index.js.map +1 -0
  180. package/schematics/store/simple-sync/schema.js.map +1 -0
  181. package/schematics/store-action/index.js.map +1 -0
  182. package/schematics/store-action/schema.js.map +1 -0
  183. package/store/async/async-entity.adapter.js +53 -0
  184. package/store/async/async-entity.adapter.js.map +1 -0
  185. package/store/async/async.adapter.js +93 -0
  186. package/store/async/async.adapter.js.map +1 -0
  187. package/store/async/async.helpers.js +25 -0
  188. package/store/async/async.helpers.js.map +1 -0
  189. package/store/async/async.interfaces.js +2 -0
  190. package/store/async/async.interfaces.js.map +1 -0
  191. package/store/async/async.operators.js +75 -0
  192. package/store/async/async.operators.js.map +1 -0
  193. package/store/async/async.props.d.ts.map +1 -1
  194. package/store/async/async.props.js +11 -0
  195. package/store/async/async.props.js.map +1 -0
  196. package/store/async/async.serializer.d.ts +1 -1
  197. package/store/async/async.serializer.d.ts.map +1 -1
  198. package/store/async/async.serializer.js +34 -0
  199. package/store/async/async.serializer.js.map +1 -0
  200. package/store/async/index.js +8 -0
  201. package/store/async/index.js.map +1 -0
  202. package/store/index.js +3 -0
  203. package/store/index.js.map +1 -0
  204. package/store/types.js +11 -0
  205. package/store/types.js.map +1 -0
  206. package/utils/debug/debug.helper.js +20 -0
  207. package/utils/debug/debug.helper.js.map +1 -0
  208. package/utils/deep-fill/deep-fill.js +69 -0
  209. package/utils/deep-fill/deep-fill.js.map +1 -0
  210. package/utils/index.js +4 -0
  211. package/utils/index.js.map +1 -0
  212. package/utils/rendering/rendering.helpers.d.ts.map +1 -1
  213. package/utils/rendering/rendering.helpers.js +32 -0
  214. package/utils/rendering/rendering.helpers.js.map +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"async.serializer.d.ts","sourceRoot":"","sources":["../../../src/store/async/async.serializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,cAAc,EAAE,KAAK,EAAE,CAAC,KAEjE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,CAAC;;EAOrG;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,CAAC,SAAS,cAAc,GAAG,WAAW,CAAC,cAAc,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;CAAE,CAAC,EAAE,KAAK,EAAE,CAAC;;gBAAlD,aAAa,CAAC,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC;;EAOtJ"}
1
+ {"version":3,"file":"async.serializer.d.ts","sourceRoot":"","sources":["../../../src/store/async/async.serializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,cAAc,EAAE,KAAK,EAAE,CAAC,KAEjE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,CAAC;;EAOrG;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,CAAC,SAAS,cAAc,GAAG,WAAW,CAAC,cAAc,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;CAAE,CAAC,EAAE,KAAK,EAAE,CAAC;;gBAAlD,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC;;EAOtJ"}
@@ -0,0 +1,34 @@
1
+ import { asyncStoreItemAdapter } from './async.adapter';
2
+ /**
3
+ * Serializer for asynchronous store.
4
+ * @param state State of an asynchronous store to serialize
5
+ * @returns a plain json object to pass to json.stringify
6
+ */
7
+ export function asyncSerializer(state) {
8
+ return asyncStoreItemAdapter.clearAsyncStoreItem(state);
9
+ }
10
+ /**
11
+ * Serializer for asynchronous entity store.
12
+ * @param state State of an asynchronous entity store to serialize
13
+ * @returns a plain json object to pass to json.stringify
14
+ */
15
+ export function asyncEntitySerializer(state) {
16
+ const entities = state.ids.reduce((entitiesAcc, entityId) => {
17
+ entitiesAcc[entityId] = asyncStoreItemAdapter.clearAsyncStoreItem(state.entities[entityId]);
18
+ return entitiesAcc;
19
+ }, {});
20
+ return { ...asyncStoreItemAdapter.clearAsyncStoreItem(state), entities };
21
+ }
22
+ /**
23
+ * Serializer for asynchronous entity store with status.
24
+ * @param state State of an asynchronous entity store with status to serialize
25
+ * @returns a plain json object to pass to json.stringify
26
+ */
27
+ export function asyncEntityWithStatusSerializer(state) {
28
+ const entities = state.ids.reduce((entitiesAcc, entityId) => {
29
+ entitiesAcc[entityId] = { ...asyncStoreItemAdapter.clearAsyncStoreItem(state.entities[entityId]), status: {} };
30
+ return entitiesAcc;
31
+ }, {});
32
+ return { ...asyncStoreItemAdapter.clearAsyncStoreItem(state), entities };
33
+ }
34
+ //# sourceMappingURL=async.serializer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async.serializer.js","sourceRoot":"","sources":["../../../src/store/async/async.serializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAA2B,KAAQ;IAChE,OAAO,qBAAqB,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAyD,KAAQ;IACpG,MAAM,QAAQ,GAAI,KAAK,CAAC,GAAgB,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,EAAE;QACxE,WAAW,CAAC,QAAQ,CAAC,GAAG,qBAAqB,CAAC,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAE,CAAC,CAAC;QAC7F,OAAO,WAAW,CAAC;IACrB,CAAC,EAAE,EAA2B,CAAC,CAAC;IAEhC,OAAO,EAAE,GAAG,qBAAqB,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;AAC3E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAA6G,KAAQ;IAClK,MAAM,QAAQ,GAAI,KAAK,CAAC,GAAgB,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,EAAE;QACxE,WAAW,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,qBAAqB,CAAC,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QAChH,OAAO,WAAW,CAAC;IACrB,CAAC,EAAE,EAA2B,CAAC,CAAC;IAEhC,OAAO,EAAE,GAAG,qBAAqB,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,8 @@
1
+ export * from './async.helpers';
2
+ export * from './async.interfaces';
3
+ export * from './async.adapter';
4
+ export * from './async-entity.adapter';
5
+ export * from './async.props';
6
+ export * from './async.operators';
7
+ export * from './async.serializer';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/store/async/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
package/store/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './async/index';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
package/store/types.js ADDED
@@ -0,0 +1,11 @@
1
+ export class StateSerializer {
2
+ constructor(serializer) {
3
+ this.reviver = (_, value) => value;
4
+ this.serialize = serializer.serialize || this.serialize;
5
+ this.deserialize = serializer.deserialize || this.deserialize;
6
+ this.reviver = serializer.reviver || this.reviver;
7
+ this.replacer = serializer.replacer || this.replacer;
8
+ this.initialState = serializer.initialState || this.initialState;
9
+ }
10
+ }
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/store/types.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,eAAe;IAM1B,YAAY,UAAyB;QAQ9B,YAAO,GAAG,CAAC,CAAS,EAAE,KAAU,EAAO,EAAE,CAAC,KAAK,CAAC;QAPrD,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC;QACxD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC;QAC9D,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC;QAClD,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC;QACrD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC;IACnE,CAAC;CAGF"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Pad number
3
+ * @param val
4
+ * @param digits
5
+ */
6
+ export function padNumber(val, digits = 2) {
7
+ const str = `${val}`;
8
+ return '0'.repeat(Math.max(0, digits - str.length)) + str;
9
+ }
10
+ /**
11
+ * Returns TRUE if bootstrap config environment is production FALSE otherwise
12
+ * @param dataset
13
+ * @returns TRUE if bootstrap config environment is production FALSE otherwise
14
+ */
15
+ export function isProductionEnvironment(dataset) {
16
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
17
+ const bootstrapConfig = dataset.bootstrapconfig && JSON.parse(dataset.bootstrapconfig);
18
+ return bootstrapConfig?.environment === 'prod';
19
+ }
20
+ //# sourceMappingURL=debug.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.helper.js","sourceRoot":"","sources":["../../../src/utils/debug/debug.helper.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,MAAM,GAAG,CAAC;IAC/C,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;IACrB,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,CAAC;AAC5D,CAAC;AAGD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,mEAAmE;IACnE,MAAM,eAAe,GAAoB,OAAO,CAAC,eAAe,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACxG,OAAO,eAAe,EAAE,WAAW,KAAK,MAAM,CAAC;AACjD,CAAC"}
@@ -0,0 +1,69 @@
1
+ const defaultConstruct = (data) => data;
2
+ const isDate = (data) => data instanceof Date && !isNaN(data);
3
+ /**
4
+ * Check if an object is not an array or a date
5
+ * @param obj
6
+ * @param additionalMappers
7
+ */
8
+ export function isObject(obj, additionalMappers) {
9
+ return obj instanceof Object && !Array.isArray(obj) && !additionalMappers?.some((mapper) => mapper.condition(obj)) && !isDate(obj);
10
+ }
11
+ /**
12
+ * Return a new reference of the given object
13
+ * @param obj
14
+ * @param additionalMappers
15
+ */
16
+ export function immutablePrimitive(obj, additionalMappers) {
17
+ if (Array.isArray(obj)) {
18
+ return obj.slice();
19
+ }
20
+ const matchingPrimitive = additionalMappers?.find((mapper) => mapper.condition(obj));
21
+ const resolvedType = matchingPrimitive && ((matchingPrimitive.construct || defaultConstruct)(obj));
22
+ if (resolvedType !== undefined) {
23
+ return resolvedType;
24
+ }
25
+ if (isDate(obj)) {
26
+ return new Date(obj);
27
+ }
28
+ else if (obj instanceof Object) {
29
+ // eslint-disable-next-line no-use-before-define
30
+ return deepFill(obj, obj, additionalMappers);
31
+ }
32
+ else {
33
+ return obj;
34
+ }
35
+ }
36
+ /**
37
+ * Deep fill of base object using source
38
+ * It will do a deep merge of the objects, overriding arrays
39
+ * All properties not present in source, but present in base, will remain
40
+ * @param base
41
+ * @param source
42
+ * @param additionalMappers Map of conditions of type mapper
43
+ */
44
+ export function deepFill(base, source, additionalMappers) {
45
+ if (typeof source === 'undefined') {
46
+ return deepFill(base, base, additionalMappers);
47
+ }
48
+ if (!isObject(base, additionalMappers)) {
49
+ return immutablePrimitive(typeof source !== 'undefined' ? source : base, additionalMappers);
50
+ }
51
+ const newObj = { ...base };
52
+ for (const key in base) {
53
+ if (key in source && typeof base[key] === typeof source[key]) {
54
+ const keyOfSource = source[key];
55
+ newObj[key] = typeof keyOfSource === 'undefined' ? immutablePrimitive(base[key], additionalMappers) : deepFill(base[key], source[key], additionalMappers);
56
+ }
57
+ else {
58
+ newObj[key] = immutablePrimitive(base[key], additionalMappers);
59
+ }
60
+ }
61
+ // getting keys present in source and not present in base
62
+ for (const key in source) {
63
+ if (!(key in newObj)) {
64
+ newObj[key] = immutablePrimitive(source[key], additionalMappers);
65
+ }
66
+ }
67
+ return newObj;
68
+ }
69
+ //# sourceMappingURL=deep-fill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-fill.js","sourceRoot":"","sources":["../../../src/utils/deep-fill/deep-fill.ts"],"names":[],"mappings":"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"}
package/utils/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from './debug/debug.helper';
2
+ export * from './deep-fill/deep-fill';
3
+ export * from './rendering/rendering.helpers';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rendering.helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/rendering/rendering.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,UAAU,EAAiB,MAAM,MAAM,CAAC;AAUhF;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,SAAI,EAAE,WAAW,SAAI,aAEtC,WAAW,CAAC,EAAE,CAAC,qBA+BjC"}
1
+ {"version":3,"file":"rendering.helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/rendering/rendering.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,UAAU,EAAiB,MAAM,MAAM,CAAC;AAUhF;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,SAAI,EAAE,WAAW,SAAI,aAEtC,UAAU,CAAC,CAAC,EAAE,CAAC,qBA+BjC"}
@@ -0,0 +1,32 @@
1
+ import { animationFrameScheduler, from, observeOn, of } from 'rxjs';
2
+ import { bufferCount, concatMap, delay, mergeMap, scan, tap } from 'rxjs/operators';
3
+ /**
4
+ * Buffers and emits data for lazy/progressive rendering of big lists
5
+ * That could solve issues with long-running tasks when trying to render an array
6
+ * of similar components.
7
+ * @param delayMs Delay between data emits
8
+ * @param concurrency Amount of elements that should be emitted at once
9
+ * @returns
10
+ */
11
+ export function lazyArray(delayMs = 0, concurrency = 2) {
12
+ let isFirstEmission = true;
13
+ return (source$) => {
14
+ return source$.pipe(mergeMap((items) => {
15
+ if (!isFirstEmission) {
16
+ return of(items);
17
+ }
18
+ const items$ = from(items);
19
+ return items$.pipe(bufferCount(concurrency), concatMap((value, index) => {
20
+ return of(value).pipe(observeOn(animationFrameScheduler), delay(index * delayMs));
21
+ }), scan((acc, steps) => {
22
+ return [...acc, ...steps];
23
+ }, []), tap((scannedItems) => {
24
+ const scanDidComplete = scannedItems.length === items.length;
25
+ if (scanDidComplete) {
26
+ isFirstEmission = false;
27
+ }
28
+ }));
29
+ }));
30
+ };
31
+ }
32
+ //# sourceMappingURL=rendering.helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rendering.helpers.js","sourceRoot":"","sources":["../../../src/utils/rendering/rendering.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,IAAI,EAAc,SAAS,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAChF,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,GAAG,EACJ,MAAM,gBAAgB,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAI,OAAO,GAAG,CAAC,EAAE,WAAW,GAAG,CAAC;IACvD,IAAI,eAAe,GAAG,IAAI,CAAC;IAC3B,OAAO,CAAC,OAAwB,EAAE,EAAE;QAClC,OAAO,OAAO,CAAC,IAAI,CACjB,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE;YACjB,IAAI,CAAC,eAAe,EAAE,CAAC;gBACrB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC;YAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;YAE3B,OAAO,MAAM,CAAC,IAAI,CAChB,WAAW,CAAC,WAAW,CAAC,EACxB,SAAS,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;gBACzB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,CACnB,SAAS,CAAC,uBAAuB,CAAC,EAClC,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC,CACvB,CAAC;YACJ,CAAC,CAAC,EACF,IAAI,CAAC,CAAC,GAAQ,EAAE,KAAU,EAAE,EAAE;gBAC5B,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC;YAC5B,CAAC,EAAE,EAAE,CAAC,EACN,GAAG,CAAC,CAAC,YAAiB,EAAE,EAAE;gBACxB,MAAM,eAAe,GAAG,YAAY,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC;gBAE7D,IAAI,eAAe,EAAE,CAAC;oBACpB,eAAe,GAAG,KAAK,CAAC;gBAC1B,CAAC;YACH,CAAC,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}