@abp/ng.core 5.0.0 → 5.1.2

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 (198) hide show
  1. package/{esm2015/abp-ng.core.js → esm2020/abp-ng.core.mjs} +0 -0
  2. package/{esm2015/lib/abstracts/index.js → esm2020/lib/abstracts/index.mjs} +0 -0
  3. package/{esm2015/lib/abstracts/ng-model.component.js → esm2020/lib/abstracts/ng-model.component.mjs} +4 -4
  4. package/esm2020/lib/components/dynamic-layout.component.mjs +88 -0
  5. package/{esm2015/lib/components/index.js → esm2020/lib/components/index.mjs} +0 -0
  6. package/{esm2015/lib/components/replaceable-route-container.component.js → esm2020/lib/components/replaceable-route-container.component.mjs} +4 -4
  7. package/{esm2015/lib/components/router-outlet.component.js → esm2020/lib/components/router-outlet.component.mjs} +4 -4
  8. package/{esm2015/lib/constants/different-locales.js → esm2020/lib/constants/different-locales.mjs} +0 -0
  9. package/{esm2015/lib/constants/index.js → esm2020/lib/constants/index.mjs} +0 -0
  10. package/esm2020/lib/core.module.mjs +281 -0
  11. package/{esm2015/lib/directives/autofocus.directive.js → esm2020/lib/directives/autofocus.directive.mjs} +4 -4
  12. package/{esm2015/lib/directives/debounce.directive.js → esm2020/lib/directives/debounce.directive.mjs} +4 -4
  13. package/{esm2015/lib/directives/for.directive.js → esm2020/lib/directives/for.directive.mjs} +4 -4
  14. package/{esm2015/lib/directives/form-submit.directive.js → esm2020/lib/directives/form-submit.directive.mjs} +4 -4
  15. package/{esm2015/lib/directives/index.js → esm2020/lib/directives/index.mjs} +0 -0
  16. package/{esm2015/lib/directives/init.directive.js → esm2020/lib/directives/init.directive.mjs} +4 -4
  17. package/{esm2015/lib/directives/permission.directive.js → esm2020/lib/directives/permission.directive.mjs} +4 -4
  18. package/esm2020/lib/directives/replaceable-template.directive.mjs +126 -0
  19. package/{esm2015/lib/directives/stop-propagation.directive.js → esm2020/lib/directives/stop-propagation.directive.mjs} +4 -4
  20. package/{esm2015/lib/enums/common.js → esm2020/lib/enums/common.mjs} +0 -0
  21. package/{esm2015/lib/enums/index.js → esm2020/lib/enums/index.mjs} +0 -0
  22. package/{esm2015/lib/guards/auth.guard.js → esm2020/lib/guards/auth.guard.mjs} +4 -4
  23. package/{esm2015/lib/guards/index.js → esm2020/lib/guards/index.mjs} +0 -0
  24. package/{esm2015/lib/guards/permission.guard.js → esm2020/lib/guards/permission.guard.mjs} +5 -5
  25. package/{esm2015/lib/handlers/oauth-configuration.handler.js → esm2020/lib/handlers/oauth-configuration.handler.mjs} +4 -4
  26. package/esm2020/lib/handlers/routes.handler.mjs +49 -0
  27. package/esm2020/lib/interceptors/api.interceptor.mjs +54 -0
  28. package/{esm2015/lib/interceptors/index.js → esm2020/lib/interceptors/index.mjs} +0 -0
  29. package/{esm2015/lib/localization.module.js → esm2020/lib/localization.module.mjs} +5 -5
  30. package/{esm2015/lib/models/auth.js → esm2020/lib/models/auth.mjs} +0 -0
  31. package/{esm2015/lib/models/common.js → esm2020/lib/models/common.mjs} +0 -0
  32. package/{esm2015/lib/models/dtos.js → esm2020/lib/models/dtos.mjs} +0 -0
  33. package/{esm2015/lib/models/environment.js → esm2020/lib/models/environment.mjs} +0 -0
  34. package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +0 -0
  35. package/{esm2015/lib/models/localization.js → esm2020/lib/models/localization.mjs} +0 -0
  36. package/{esm2015/lib/models/replaceable-components.js → esm2020/lib/models/replaceable-components.mjs} +0 -0
  37. package/{esm2015/lib/models/rest.js → esm2020/lib/models/rest.mjs} +0 -0
  38. package/{esm2015/lib/models/session.js → esm2020/lib/models/session.mjs} +0 -0
  39. package/{esm2015/lib/models/utility.js → esm2020/lib/models/utility.mjs} +0 -0
  40. package/{esm2015/lib/pipes/index.js → esm2020/lib/pipes/index.mjs} +2 -1
  41. package/{esm2015/lib/pipes/localization.pipe.js → esm2020/lib/pipes/localization.pipe.mjs} +5 -5
  42. package/{esm2015/lib/pipes/sort.pipe.js → esm2020/lib/pipes/sort.pipe.mjs} +5 -5
  43. package/esm2020/lib/pipes/to-injector.pipe.mjs +29 -0
  44. package/{esm2015/lib/providers/cookie-language.provider.js → esm2020/lib/providers/cookie-language.provider.mjs} +0 -0
  45. package/{esm2015/lib/providers/locale.provider.js → esm2020/lib/providers/locale.provider.mjs} +0 -0
  46. package/{esm2015/lib/proxy/pages/abp/multi-tenancy/abp-tenant.service.js → esm2020/lib/proxy/pages/abp/multi-tenancy/abp-tenant.service.mjs} +4 -4
  47. package/{esm2015/lib/proxy/pages/abp/multi-tenancy/index.js → esm2020/lib/proxy/pages/abp/multi-tenancy/index.mjs} +0 -0
  48. package/{esm2015/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/abp-api-definition.service.js → esm2020/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/abp-api-definition.service.mjs} +4 -4
  49. package/{esm2015/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/index.js → esm2020/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/index.mjs} +0 -0
  50. package/{esm2015/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service.js → esm2020/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service.mjs} +4 -4
  51. package/{esm2015/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/index.js → esm2020/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/index.mjs} +0 -0
  52. package/{esm2015/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/models.js → esm2020/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/models.mjs} +0 -0
  53. package/{esm2015/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/index.js → esm2020/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/index.mjs} +0 -0
  54. package/{esm2015/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/models.js → esm2020/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/models.mjs} +0 -0
  55. package/{esm2015/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/index.js → esm2020/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/index.mjs} +0 -0
  56. package/{esm2015/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models.js → esm2020/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models.mjs} +0 -0
  57. package/{esm2015/lib/proxy/volo/abp/http/modeling/index.js → esm2020/lib/proxy/volo/abp/http/modeling/index.mjs} +0 -0
  58. package/{esm2015/lib/proxy/volo/abp/http/modeling/models.js → esm2020/lib/proxy/volo/abp/http/modeling/models.mjs} +0 -0
  59. package/{esm2015/lib/proxy/volo/abp/localization/index.js → esm2020/lib/proxy/volo/abp/localization/index.mjs} +0 -0
  60. package/{esm2015/lib/proxy/volo/abp/localization/models.js → esm2020/lib/proxy/volo/abp/localization/models.mjs} +0 -0
  61. package/{esm2015/lib/proxy/volo/abp/models.js → esm2020/lib/proxy/volo/abp/models.mjs} +0 -0
  62. package/esm2020/lib/services/auth.service.mjs +44 -0
  63. package/{esm2015/lib/services/config-state.service.js → esm2020/lib/services/config-state.service.mjs} +13 -16
  64. package/{esm2015/lib/services/content-projection.service.js → esm2020/lib/services/content-projection.service.mjs} +4 -4
  65. package/{esm2015/lib/services/dom-insertion.service.js → esm2020/lib/services/dom-insertion.service.mjs} +4 -4
  66. package/{esm2015/lib/services/environment.service.js → esm2020/lib/services/environment.service.mjs} +4 -4
  67. package/{esm2015/lib/services/http-error-reporter.service.js → esm2020/lib/services/http-error-reporter.service.mjs} +4 -4
  68. package/{esm2015/lib/services/http-wait.service.js → esm2020/lib/services/http-wait.service.mjs} +4 -4
  69. package/{esm2015/lib/services/index.js → esm2020/lib/services/index.mjs} +0 -0
  70. package/{esm2015/lib/services/lazy-load.service.js → esm2020/lib/services/lazy-load.service.mjs} +4 -4
  71. package/{esm2015/lib/services/list.service.js → esm2020/lib/services/list.service.mjs} +4 -4
  72. package/esm2020/lib/services/localization.service.mjs +182 -0
  73. package/{esm2015/lib/services/multi-tenancy.service.js → esm2020/lib/services/multi-tenancy.service.mjs} +4 -4
  74. package/{esm2015/lib/services/permission.service.js → esm2020/lib/services/permission.service.mjs} +5 -6
  75. package/{esm2015/lib/services/replaceable-components.service.js → esm2020/lib/services/replaceable-components.service.mjs} +4 -4
  76. package/{esm2015/lib/services/resource-wait.service.js → esm2020/lib/services/resource-wait.service.mjs} +4 -4
  77. package/esm2020/lib/services/rest.service.mjs +66 -0
  78. package/{esm2015/lib/services/router-events.service.js → esm2020/lib/services/router-events.service.mjs} +4 -4
  79. package/{esm2015/lib/services/router-wait.service.js → esm2020/lib/services/router-wait.service.mjs} +4 -4
  80. package/esm2020/lib/services/routes.service.mjs +145 -0
  81. package/{esm2015/lib/services/session-state.service.js → esm2020/lib/services/session-state.service.mjs} +5 -5
  82. package/{esm2015/lib/services/subscription.service.js → esm2020/lib/services/subscription.service.mjs} +4 -4
  83. package/{esm2015/lib/services/track-by.service.js → esm2020/lib/services/track-by.service.mjs} +4 -4
  84. package/esm2020/lib/strategies/auth-flow.strategy.mjs +190 -0
  85. package/{esm2015/lib/strategies/container.strategy.js → esm2020/lib/strategies/container.strategy.mjs} +0 -0
  86. package/{esm2015/lib/strategies/content-security.strategy.js → esm2020/lib/strategies/content-security.strategy.mjs} +0 -0
  87. package/{esm2015/lib/strategies/content.strategy.js → esm2020/lib/strategies/content.strategy.mjs} +0 -0
  88. package/{esm2015/lib/strategies/context.strategy.js → esm2020/lib/strategies/context.strategy.mjs} +0 -0
  89. package/{esm2015/lib/strategies/cross-origin.strategy.js → esm2020/lib/strategies/cross-origin.strategy.mjs} +0 -0
  90. package/{esm2015/lib/strategies/dom.strategy.js → esm2020/lib/strategies/dom.strategy.mjs} +0 -0
  91. package/{esm2015/lib/strategies/index.js → esm2020/lib/strategies/index.mjs} +0 -0
  92. package/{esm2015/lib/strategies/loading.strategy.js → esm2020/lib/strategies/loading.strategy.mjs} +0 -0
  93. package/{esm2015/lib/strategies/projection.strategy.js → esm2020/lib/strategies/projection.strategy.mjs} +0 -0
  94. package/{esm2015/lib/tokens/app-config.token.js → esm2020/lib/tokens/app-config.token.mjs} +0 -0
  95. package/{esm2015/lib/tokens/cookie-language-key.token.js → esm2020/lib/tokens/cookie-language-key.token.mjs} +0 -0
  96. package/{esm2015/lib/tokens/index.js → esm2020/lib/tokens/index.mjs} +0 -0
  97. package/{esm2015/lib/tokens/list.token.js → esm2020/lib/tokens/list.token.mjs} +0 -0
  98. package/{esm2015/lib/tokens/localization.token.js → esm2020/lib/tokens/localization.token.mjs} +0 -0
  99. package/{esm2015/lib/tokens/lodaer-delay.token.js → esm2020/lib/tokens/lodaer-delay.token.mjs} +0 -0
  100. package/{esm2015/lib/tokens/manage-profile.token.js → esm2020/lib/tokens/manage-profile.token.mjs} +0 -0
  101. package/esm2020/lib/tokens/options.token.mjs +8 -0
  102. package/{esm2015/lib/tokens/tenant-key.token.js → esm2020/lib/tokens/tenant-key.token.mjs} +0 -0
  103. package/esm2020/lib/utils/array-utils.mjs +7 -0
  104. package/{esm2015/lib/utils/auth-utils.js → esm2020/lib/utils/auth-utils.mjs} +0 -0
  105. package/{esm2015/lib/utils/common-utils.js → esm2020/lib/utils/common-utils.mjs} +0 -0
  106. package/{esm2015/lib/utils/date-extensions.js → esm2020/lib/utils/date-extensions.mjs} +0 -0
  107. package/{esm2015/lib/utils/date-utils.js → esm2020/lib/utils/date-utils.mjs} +0 -0
  108. package/{esm2015/lib/utils/environment-utils.js → esm2020/lib/utils/environment-utils.mjs} +0 -0
  109. package/{esm2015/lib/utils/factory-utils.js → esm2020/lib/utils/factory-utils.mjs} +0 -0
  110. package/{esm2015/lib/utils/file-utils.js → esm2020/lib/utils/file-utils.mjs} +0 -0
  111. package/{esm2015/lib/utils/form-utils.js → esm2020/lib/utils/form-utils.mjs} +0 -0
  112. package/{esm2015/lib/utils/generator-utils.js → esm2020/lib/utils/generator-utils.mjs} +0 -0
  113. package/{esm2015/lib/utils/http-utils.js → esm2020/lib/utils/http-utils.mjs} +0 -0
  114. package/{esm2015/lib/utils/index.js → esm2020/lib/utils/index.mjs} +0 -0
  115. package/esm2020/lib/utils/initial-utils.mjs +63 -0
  116. package/esm2020/lib/utils/internal-store-utils.mjs +36 -0
  117. package/{esm2015/lib/utils/lazy-load-utils.js → esm2020/lib/utils/lazy-load-utils.mjs} +0 -0
  118. package/esm2020/lib/utils/localization-utils.mjs +49 -0
  119. package/esm2020/lib/utils/multi-tenancy-utils.mjs +78 -0
  120. package/{esm2015/lib/utils/number-utils.js → esm2020/lib/utils/number-utils.mjs} +0 -0
  121. package/{esm2015/lib/utils/object-utils.js → esm2020/lib/utils/object-utils.mjs} +0 -0
  122. package/esm2020/lib/utils/route-utils.mjs +26 -0
  123. package/esm2020/lib/utils/string-utils.mjs +30 -0
  124. package/{esm2015/lib/utils/tree-utils.js → esm2020/lib/utils/tree-utils.mjs} +1 -1
  125. package/{esm2015/lib/validators/age.validator.js → esm2020/lib/validators/age.validator.mjs} +0 -0
  126. package/{esm2015/lib/validators/credit-card.validator.js → esm2020/lib/validators/credit-card.validator.mjs} +0 -0
  127. package/{esm2015/lib/validators/index.js → esm2020/lib/validators/index.mjs} +0 -0
  128. package/{esm2015/lib/validators/range.validator.js → esm2020/lib/validators/range.validator.mjs} +0 -0
  129. package/{esm2015/lib/validators/required.validator.js → esm2020/lib/validators/required.validator.mjs} +0 -0
  130. package/{esm2015/lib/validators/string-length.validator.js → esm2020/lib/validators/string-length.validator.mjs} +0 -0
  131. package/{esm2015/lib/validators/url.validator.js → esm2020/lib/validators/url.validator.mjs} +0 -0
  132. package/{esm2015/locale/abp-ng.core-locale.js → esm2020/locale/abp-ng.core-locale.mjs} +0 -0
  133. package/{esm2015/locale/public-api.js → esm2020/locale/public-api.mjs} +0 -0
  134. package/esm2020/locale/utils/register-locale.mjs +47 -0
  135. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  136. package/{esm2015/testing/abp-ng.core-testing.js → esm2020/testing/abp-ng.core-testing.mjs} +0 -0
  137. package/esm2020/testing/lib/core-testing.module.mjs +63 -0
  138. package/{esm2015/testing/lib/services/index.js → esm2020/testing/lib/services/index.mjs} +0 -0
  139. package/{esm2015/testing/lib/services/mock-permission.service.js → esm2020/testing/lib/services/mock-permission.service.mjs} +4 -4
  140. package/{esm2015/testing/lib/services/mock-rest.service.js → esm2020/testing/lib/services/mock-rest.service.mjs} +4 -4
  141. package/{esm2015/testing/lib/utils/clear-page.util.js → esm2020/testing/lib/utils/clear-page.util.mjs} +0 -0
  142. package/{esm2015/testing/lib/utils/index.js → esm2020/testing/lib/utils/index.mjs} +0 -0
  143. package/{esm2015/testing/lib/utils/wait.util.js → esm2020/testing/lib/utils/wait.util.mjs} +0 -0
  144. package/{esm2015/testing/public-api.js → esm2020/testing/public-api.mjs} +0 -0
  145. package/fesm2015/{abp-ng.core-locale.js → abp-ng.core-locale.mjs} +11 -4
  146. package/fesm2015/abp-ng.core-locale.mjs.map +1 -0
  147. package/fesm2015/{abp-ng.core-testing.js → abp-ng.core-testing.mjs} +18 -16
  148. package/fesm2015/abp-ng.core-testing.mjs.map +1 -0
  149. package/fesm2015/{abp-ng.core.js → abp-ng.core.mjs} +817 -768
  150. package/fesm2015/abp-ng.core.mjs.map +1 -0
  151. package/fesm2020/abp-ng.core-locale.mjs +54 -0
  152. package/fesm2020/abp-ng.core-locale.mjs.map +1 -0
  153. package/fesm2020/abp-ng.core-testing.mjs +140 -0
  154. package/fesm2020/abp-ng.core-testing.mjs.map +1 -0
  155. package/fesm2020/abp-ng.core.mjs +4216 -0
  156. package/fesm2020/abp-ng.core.mjs.map +1 -0
  157. package/lib/core.module.d.ts +9 -8
  158. package/lib/pipes/index.d.ts +1 -0
  159. package/lib/pipes/to-injector.pipe.d.ts +10 -0
  160. package/lib/services/environment.service.d.ts +1 -0
  161. package/lib/services/list.service.d.ts +1 -1
  162. package/lib/services/subscription.service.d.ts +2 -2
  163. package/lib/utils/array-utils.d.ts +1 -1
  164. package/lib/utils/string-utils.d.ts +1 -0
  165. package/lib/utils/tree-utils.d.ts +2 -2
  166. package/locale/package.json +5 -5
  167. package/package.json +37 -8
  168. package/src/lib/proxy/README.md +17 -0
  169. package/testing/package.json +5 -5
  170. package/bundles/abp-ng.core-locale.umd.js +0 -381
  171. package/bundles/abp-ng.core-locale.umd.js.map +0 -1
  172. package/bundles/abp-ng.core-testing.umd.js +0 -494
  173. package/bundles/abp-ng.core-testing.umd.js.map +0 -1
  174. package/bundles/abp-ng.core.umd.js +0 -5277
  175. package/bundles/abp-ng.core.umd.js.map +0 -1
  176. package/esm2015/lib/components/dynamic-layout.component.js +0 -89
  177. package/esm2015/lib/core.module.js +0 -281
  178. package/esm2015/lib/directives/replaceable-template.directive.js +0 -121
  179. package/esm2015/lib/handlers/routes.handler.js +0 -47
  180. package/esm2015/lib/interceptors/api.interceptor.js +0 -54
  181. package/esm2015/lib/services/auth.service.js +0 -47
  182. package/esm2015/lib/services/localization.service.js +0 -182
  183. package/esm2015/lib/services/rest.service.js +0 -63
  184. package/esm2015/lib/services/routes.service.js +0 -147
  185. package/esm2015/lib/strategies/auth-flow.strategy.js +0 -202
  186. package/esm2015/lib/tokens/options.token.js +0 -8
  187. package/esm2015/lib/utils/array-utils.js +0 -7
  188. package/esm2015/lib/utils/initial-utils.js +0 -64
  189. package/esm2015/lib/utils/internal-store-utils.js +0 -36
  190. package/esm2015/lib/utils/localization-utils.js +0 -50
  191. package/esm2015/lib/utils/multi-tenancy-utils.js +0 -83
  192. package/esm2015/lib/utils/route-utils.js +0 -27
  193. package/esm2015/lib/utils/string-utils.js +0 -21
  194. package/esm2015/locale/utils/register-locale.js +0 -43
  195. package/esm2015/testing/lib/core-testing.module.js +0 -62
  196. package/fesm2015/abp-ng.core-locale.js.map +0 -1
  197. package/fesm2015/abp-ng.core-testing.js.map +0 -1
  198. package/fesm2015/abp-ng.core.js.map +0 -1
@@ -0,0 +1,54 @@
1
+ import { differentLocales } from '@abp/ng.core';
2
+ import { isDevMode } from '@angular/core';
3
+
4
+ let localeMap = {};
5
+ function registerLocale({ cultureNameLocaleFileMap = {}, errorHandlerFn = defaultLocalErrorHandlerFn, } = {}) {
6
+ return (locale) => {
7
+ localeMap = { ...differentLocales, ...cultureNameLocaleFileMap };
8
+ const localePath = `/locales/${localeMap[locale] || locale}`;
9
+ return new Promise((resolve, reject) => {
10
+ return import(
11
+ /* webpackMode: "lazy-once" */
12
+ /* webpackChunkName: "locales"*/
13
+ /* webpackInclude: /[/\\](ar|cs|en|en-GB|es|de|fi|fr|hi|hu|is|it|pt|tr|ru|ro|sk|sl|zh-Hans|zh-Hant)\.(mjs|js)$/ */
14
+ /* webpackExclude: /[/\\]global|extra/ */
15
+ `@angular/common${localePath}`)
16
+ .then(val => {
17
+ let module = val;
18
+ while (module.default) {
19
+ module = module.default;
20
+ }
21
+ resolve({ default: module });
22
+ })
23
+ .catch(error => {
24
+ errorHandlerFn({
25
+ resolve,
26
+ reject,
27
+ error,
28
+ locale,
29
+ });
30
+ });
31
+ });
32
+ };
33
+ }
34
+ const extraLocales = {};
35
+ function storeLocaleData(data, localeId) {
36
+ extraLocales[localeId] = data;
37
+ }
38
+ async function defaultLocalErrorHandlerFn({ locale, resolve }) {
39
+ if (extraLocales[locale]) {
40
+ resolve({ default: extraLocales[localeMap[locale] || locale] });
41
+ return;
42
+ }
43
+ if (isDevMode) {
44
+ console.error(`Cannot find the ${locale} locale file. You can check how can add new culture at https://docs.abp.io/en/abp/latest/UI/Angular/Localization#adding-a-new-culture`);
45
+ }
46
+ resolve();
47
+ }
48
+
49
+ /**
50
+ * Generated bundle index. Do not edit.
51
+ */
52
+
53
+ export { defaultLocalErrorHandlerFn, registerLocale, storeLocaleData };
54
+ //# sourceMappingURL=abp-ng.core-locale.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abp-ng.core-locale.mjs","sources":["../../../../packages/core/locale/src/utils/register-locale.ts","../../../../packages/core/locale/src/abp-ng.core-locale.ts"],"sourcesContent":["import { differentLocales } from '@abp/ng.core';\r\nimport { isDevMode } from '@angular/core';\r\n\r\nexport interface LocaleErrorHandlerData {\r\n resolve: any;\r\n reject: any;\r\n error: any;\r\n locale: string;\r\n}\r\n\r\nlet localeMap = {};\r\n\r\nexport interface RegisterLocaleData {\r\n cultureNameLocaleFileMap?: Record<string, string>;\r\n errorHandlerFn?: (data: LocaleErrorHandlerData) => any;\r\n}\r\n\r\nexport function registerLocale(\r\n {\r\n cultureNameLocaleFileMap = {},\r\n errorHandlerFn = defaultLocalErrorHandlerFn,\r\n } = {} as RegisterLocaleData,\r\n) {\r\n return (locale: string): Promise<any> => {\r\n localeMap = { ...differentLocales, ...cultureNameLocaleFileMap };\r\n const localePath = `/locales/${localeMap[locale] || locale}`;\r\n return new Promise((resolve, reject) => {\r\n return import(\r\n /* webpackMode: \"lazy-once\" */\r\n /* webpackChunkName: \"locales\"*/\r\n /* webpackInclude: /[/\\\\](ar|cs|en|en-GB|es|de|fi|fr|hi|hu|is|it|pt|tr|ru|ro|sk|sl|zh-Hans|zh-Hant)\\.(mjs|js)$/ */\r\n /* webpackExclude: /[/\\\\]global|extra/ */\r\n `@angular/common${localePath}`\r\n )\r\n .then(val => {\r\n let module = val;\r\n while (module.default) {\r\n module = module.default;\r\n }\r\n resolve({ default: module });\r\n })\r\n .catch(error => {\r\n errorHandlerFn({\r\n resolve,\r\n reject,\r\n error,\r\n locale,\r\n });\r\n });\r\n });\r\n };\r\n}\r\n\r\nconst extraLocales = {};\r\nexport function storeLocaleData(data: any, localeId: string) {\r\n extraLocales[localeId] = data;\r\n}\r\n\r\nexport async function defaultLocalErrorHandlerFn({ locale, resolve }: LocaleErrorHandlerData) {\r\n if (extraLocales[locale]) {\r\n resolve({ default: extraLocales[localeMap[locale] || locale] });\r\n return;\r\n }\r\n\r\n if (isDevMode) {\r\n console.error(\r\n `Cannot find the ${locale} locale file. You can check how can add new culture at https://docs.abp.io/en/abp/latest/UI/Angular/Localization#adding-a-new-culture`,\r\n );\r\n }\r\n\r\n resolve();\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAUA,IAAI,SAAS,GAAG,EAAE,CAAC;SAOH,cAAc,CAC5B,EACE,wBAAwB,GAAG,EAAE,EAC7B,cAAc,GAAG,0BAA0B,MACzC,EAAwB;IAE5B,OAAO,CAAC,MAAc;QACpB,SAAS,GAAG,EAAE,GAAG,gBAAgB,EAAE,GAAG,wBAAwB,EAAE,CAAC;QACjE,MAAM,UAAU,GAAG,YAAY,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QAC7D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM;YACjC,OAAO;;;;;YAKL,kBAAkB,UAAU,EAAE,CAC/B;iBACE,IAAI,CAAC,GAAG;gBACP,IAAI,MAAM,GAAG,GAAG,CAAC;gBACjB,OAAO,MAAM,CAAC,OAAO,EAAE;oBACrB,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;iBACzB;gBACD,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;aAC9B,CAAC;iBACD,KAAK,CAAC,KAAK;gBACV,cAAc,CAAC;oBACb,OAAO;oBACP,MAAM;oBACN,KAAK;oBACL,MAAM;iBACP,CAAC,CAAC;aACJ,CAAC,CAAC;SACN,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG,EAAE,CAAC;SACR,eAAe,CAAC,IAAS,EAAE,QAAgB;IACzD,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;AAChC,CAAC;AAEM,eAAe,0BAA0B,CAAC,EAAE,MAAM,EAAE,OAAO,EAA0B;IAC1F,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE;QACxB,OAAO,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC;QAChE,OAAO;KACR;IAED,IAAI,SAAS,EAAE;QACb,OAAO,CAAC,KAAK,CACX,mBAAmB,MAAM,uIAAuI,CACjK,CAAC;KACH;IAED,OAAO,EAAE,CAAC;AACZ;;ACvEA;;;;;;"}
@@ -0,0 +1,140 @@
1
+ import * as i1 from '@abp/ng.core';
2
+ import { PermissionService, RestService, CORE_OPTIONS, coreOptionsFactory, LIST_QUERY_DEBOUNCE_TIME, LOADER_DELAY, BaseCoreModule } from '@abp/ng.core';
3
+ import { APP_BASE_HREF } from '@angular/common';
4
+ import * as i0 from '@angular/core';
5
+ import { Injectable, Inject, NgModule } from '@angular/core';
6
+ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
7
+ import { provideRoutes } from '@angular/router';
8
+ import { RouterTestingModule } from '@angular/router/testing';
9
+ import * as i1$1 from '@angular/common/http';
10
+ import { throwError } from 'rxjs';
11
+
12
+ class MockPermissionService extends PermissionService {
13
+ constructor(configState) {
14
+ super(configState);
15
+ this.configState = configState;
16
+ this.grantAllPolicies();
17
+ }
18
+ grantAllPolicies() {
19
+ const grantedPolicies = new Proxy({}, {
20
+ get() {
21
+ return true;
22
+ },
23
+ });
24
+ this.configState['store'].deepPatch({ auth: { grantedPolicies } });
25
+ }
26
+ grantPolicies(keys) {
27
+ const grantedPolicies = keys.reduce((policies, key) => {
28
+ policies[key] = true;
29
+ return policies;
30
+ }, {});
31
+ this.configState['store'].deepPatch({ auth: { grantedPolicies } });
32
+ }
33
+ }
34
+ MockPermissionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MockPermissionService, deps: [{ token: i1.ConfigStateService }], target: i0.ɵɵFactoryTarget.Injectable });
35
+ MockPermissionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MockPermissionService, providedIn: 'root' });
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MockPermissionService, decorators: [{
37
+ type: Injectable,
38
+ args: [{
39
+ providedIn: 'root',
40
+ }]
41
+ }], ctorParameters: function () { return [{ type: i1.ConfigStateService }]; } });
42
+
43
+ class MockRestService extends RestService {
44
+ constructor(options, http, environment) {
45
+ super(options, http, environment, null);
46
+ this.options = options;
47
+ this.http = http;
48
+ this.environment = environment;
49
+ }
50
+ handleError(err) {
51
+ return throwError(err);
52
+ }
53
+ }
54
+ MockRestService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MockRestService, deps: [{ token: CORE_OPTIONS }, { token: i1$1.HttpClient }, { token: i1.EnvironmentService }], target: i0.ɵɵFactoryTarget.Injectable });
55
+ MockRestService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MockRestService, providedIn: 'root' });
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MockRestService, decorators: [{
57
+ type: Injectable,
58
+ args: [{
59
+ providedIn: 'root',
60
+ }]
61
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
62
+ type: Inject,
63
+ args: [CORE_OPTIONS]
64
+ }] }, { type: i1$1.HttpClient }, { type: i1.EnvironmentService }]; } });
65
+
66
+ /**
67
+ * CoreTestingModule is the module that will be used in tests
68
+ * and it provides mock alternatives
69
+ */
70
+ class CoreTestingModule {
71
+ static withConfig({ baseHref = '/', listQueryDebounceTime = 0, routes = [], ...options } = {}) {
72
+ return {
73
+ ngModule: CoreTestingModule,
74
+ providers: [
75
+ { provide: APP_BASE_HREF, useValue: baseHref },
76
+ {
77
+ provide: 'CORE_OPTIONS',
78
+ useValue: {
79
+ skipGetAppConfiguration: true,
80
+ ...options,
81
+ },
82
+ },
83
+ {
84
+ provide: CORE_OPTIONS,
85
+ useFactory: coreOptionsFactory,
86
+ deps: ['CORE_OPTIONS'],
87
+ },
88
+ {
89
+ provide: LIST_QUERY_DEBOUNCE_TIME,
90
+ useValue: listQueryDebounceTime,
91
+ },
92
+ {
93
+ provide: PermissionService,
94
+ useClass: MockPermissionService,
95
+ },
96
+ {
97
+ provide: RestService,
98
+ useClass: MockRestService,
99
+ },
100
+ {
101
+ provide: LOADER_DELAY,
102
+ useValue: 0,
103
+ },
104
+ provideRoutes(routes),
105
+ ],
106
+ };
107
+ }
108
+ }
109
+ CoreTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CoreTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
110
+ CoreTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CoreTestingModule, imports: [NoopAnimationsModule, RouterTestingModule, BaseCoreModule], exports: [RouterTestingModule, BaseCoreModule] });
111
+ CoreTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CoreTestingModule, imports: [[NoopAnimationsModule, RouterTestingModule, BaseCoreModule], RouterTestingModule, BaseCoreModule] });
112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CoreTestingModule, decorators: [{
113
+ type: NgModule,
114
+ args: [{
115
+ exports: [RouterTestingModule, BaseCoreModule],
116
+ imports: [NoopAnimationsModule, RouterTestingModule, BaseCoreModule],
117
+ }]
118
+ }] });
119
+
120
+ function clearPage(_fixture) {
121
+ if (!document)
122
+ return;
123
+ const elements = document.querySelectorAll('body > *');
124
+ elements.forEach(element => {
125
+ if (/^(abp|ngb)-/i.test(element.tagName))
126
+ document.body.removeChild(element);
127
+ });
128
+ }
129
+
130
+ function wait(fixture, timeout = 0) {
131
+ fixture.detectChanges();
132
+ return new Promise(res => setTimeout(res, timeout));
133
+ }
134
+
135
+ /**
136
+ * Generated bundle index. Do not edit.
137
+ */
138
+
139
+ export { CoreTestingModule, MockPermissionService, MockRestService, clearPage, wait };
140
+ //# sourceMappingURL=abp-ng.core-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abp-ng.core-testing.mjs","sources":["../../../../packages/core/testing/src/lib/services/mock-permission.service.ts","../../../../packages/core/testing/src/lib/services/mock-rest.service.ts","../../../../packages/core/testing/src/lib/core-testing.module.ts","../../../../packages/core/testing/src/lib/utils/clear-page.util.ts","../../../../packages/core/testing/src/lib/utils/wait.util.ts","../../../../packages/core/testing/src/abp-ng.core-testing.ts"],"sourcesContent":["import { ConfigStateService, PermissionService } from '@abp/ng.core';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class MockPermissionService extends PermissionService {\r\n constructor(protected configState: ConfigStateService) {\r\n super(configState);\r\n this.grantAllPolicies();\r\n }\r\n\r\n grantAllPolicies() {\r\n const grantedPolicies = new Proxy(\r\n {},\r\n {\r\n get() {\r\n return true;\r\n },\r\n },\r\n );\r\n\r\n this.configState['store'].deepPatch({ auth: { grantedPolicies } });\r\n }\r\n\r\n grantPolicies(keys: string[]) {\r\n const grantedPolicies = keys.reduce((policies, key) => {\r\n policies[key] = true;\r\n return policies;\r\n }, {});\r\n\r\n this.configState['store'].deepPatch({ auth: { grantedPolicies } });\r\n }\r\n}\r\n","import { ABP, CORE_OPTIONS, EnvironmentService, RestService } from '@abp/ng.core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { Inject, Injectable } from '@angular/core';\r\nimport { Observable, throwError } from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class MockRestService extends RestService {\r\n constructor(\r\n @Inject(CORE_OPTIONS) protected options: ABP.Root,\r\n protected http: HttpClient,\r\n protected environment: EnvironmentService,\r\n ) {\r\n super(options, http, environment, null);\r\n }\r\n\r\n handleError(err: any): Observable<any> {\r\n return throwError(err);\r\n }\r\n}\r\n","import {\r\n ABP,\r\n BaseCoreModule,\r\n coreOptionsFactory,\r\n CORE_OPTIONS,\r\n LIST_QUERY_DEBOUNCE_TIME,\r\n LOADER_DELAY,\r\n PermissionService,\r\n RestService,\r\n} from '@abp/ng.core';\r\nimport { APP_BASE_HREF } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule } from '@angular/core';\r\nimport { NoopAnimationsModule } from '@angular/platform-browser/animations';\r\nimport { provideRoutes } from '@angular/router';\r\nimport { RouterTestingModule } from '@angular/router/testing';\r\nimport { MockPermissionService } from './services/mock-permission.service';\r\nimport { MockRestService } from './services/mock-rest.service';\r\n\r\n/**\r\n * CoreTestingModule is the module that will be used in tests\r\n * and it provides mock alternatives\r\n */\r\n@NgModule({\r\n exports: [RouterTestingModule, BaseCoreModule],\r\n imports: [NoopAnimationsModule, RouterTestingModule, BaseCoreModule],\r\n})\r\nexport class CoreTestingModule {\r\n static withConfig(\r\n { baseHref = '/', listQueryDebounceTime = 0, routes = [], ...options } = {} as ABP.Test,\r\n ): ModuleWithProviders<CoreTestingModule> {\r\n return {\r\n ngModule: CoreTestingModule,\r\n providers: [\r\n { provide: APP_BASE_HREF, useValue: baseHref },\r\n {\r\n provide: 'CORE_OPTIONS',\r\n useValue: {\r\n skipGetAppConfiguration: true,\r\n ...options,\r\n },\r\n },\r\n {\r\n provide: CORE_OPTIONS,\r\n useFactory: coreOptionsFactory,\r\n deps: ['CORE_OPTIONS'],\r\n },\r\n {\r\n provide: LIST_QUERY_DEBOUNCE_TIME,\r\n useValue: listQueryDebounceTime,\r\n },\r\n {\r\n provide: PermissionService,\r\n useClass: MockPermissionService,\r\n },\r\n {\r\n provide: RestService,\r\n useClass: MockRestService,\r\n },\r\n {\r\n provide: LOADER_DELAY,\r\n useValue: 0,\r\n },\r\n provideRoutes(routes),\r\n ],\r\n };\r\n }\r\n}\r\n","import { ComponentFixture } from '@angular/core/testing';\r\n\r\nexport function clearPage<T extends any>(_fixture: ComponentFixture<T>) {\r\n if (!document) return;\r\n\r\n const elements = document.querySelectorAll('body > *');\r\n elements.forEach(element => {\r\n if (/^(abp|ngb)-/i.test(element.tagName)) document.body.removeChild(element);\r\n });\r\n}\r\n","import { ComponentFixture } from '@angular/core/testing';\r\n\r\nexport function wait<T extends any>(fixture: ComponentFixture<T>, timeout = 0) {\r\n fixture.detectChanges();\r\n return new Promise(res => setTimeout(res, timeout));\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;MAMa,qBAAsB,SAAQ,iBAAiB;IAC1D,YAAsB,WAA+B;QACnD,KAAK,CAAC,WAAW,CAAC,CAAC;QADC,gBAAW,GAAX,WAAW,CAAoB;QAEnD,IAAI,CAAC,gBAAgB,EAAE,CAAC;KACzB;IAED,gBAAgB;QACd,MAAM,eAAe,GAAG,IAAI,KAAK,CAC/B,EAAE,EACF;YACE,GAAG;gBACD,OAAO,IAAI,CAAC;aACb;SACF,CACF,CAAC;QAEF,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC;KACpE;IAED,aAAa,CAAC,IAAc;QAC1B,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,GAAG;YAChD,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;YACrB,OAAO,QAAQ,CAAC;SACjB,EAAE,EAAE,CAAC,CAAC;QAEP,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC;KACpE;;kHA1BU,qBAAqB;sHAArB,qBAAqB,cAFpB,MAAM;2FAEP,qBAAqB;kBAHjC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;MCGY,eAAgB,SAAQ,WAAW;IAC9C,YACkC,OAAiB,EACvC,IAAgB,EAChB,WAA+B;QAEzC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;QAJR,YAAO,GAAP,OAAO,CAAU;QACvC,SAAI,GAAJ,IAAI,CAAY;QAChB,gBAAW,GAAX,WAAW,CAAoB;KAG1C;IAED,WAAW,CAAC,GAAQ;QAClB,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;KACxB;;4GAXU,eAAe,kBAEhB,YAAY;gHAFX,eAAe,cAFd,MAAM;2FAEP,eAAe;kBAH3B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;0BAGI,MAAM;2BAAC,YAAY;;;ACQxB;;;;MAQa,iBAAiB;IAC5B,OAAO,UAAU,CACf,EAAE,QAAQ,GAAG,GAAG,EAAE,qBAAqB,GAAG,CAAC,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,OAAO,KAAK,EAAc;QAEvF,OAAO;YACL,QAAQ,EAAE,iBAAiB;YAC3B,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE;gBAC9C;oBACE,OAAO,EAAE,cAAc;oBACvB,QAAQ,EAAE;wBACR,uBAAuB,EAAE,IAAI;wBAC7B,GAAG,OAAO;qBACX;iBACF;gBACD;oBACE,OAAO,EAAE,YAAY;oBACrB,UAAU,EAAE,kBAAkB;oBAC9B,IAAI,EAAE,CAAC,cAAc,CAAC;iBACvB;gBACD;oBACE,OAAO,EAAE,wBAAwB;oBACjC,QAAQ,EAAE,qBAAqB;iBAChC;gBACD;oBACE,OAAO,EAAE,iBAAiB;oBAC1B,QAAQ,EAAE,qBAAqB;iBAChC;gBACD;oBACE,OAAO,EAAE,WAAW;oBACpB,QAAQ,EAAE,eAAe;iBAC1B;gBACD;oBACE,OAAO,EAAE,YAAY;oBACrB,QAAQ,EAAE,CAAC;iBACZ;gBACD,aAAa,CAAC,MAAM,CAAC;aACtB;SACF,CAAC;KACH;;8GAvCU,iBAAiB;+GAAjB,iBAAiB,YAFlB,oBAAoB,EAAE,mBAAmB,EAAE,cAAc,aADzD,mBAAmB,EAAE,cAAc;+GAGlC,iBAAiB,YAFnB,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,cAAc,CAAC,EAD1D,mBAAmB,EAAE,cAAc;2FAGlC,iBAAiB;kBAJ7B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,mBAAmB,EAAE,cAAc,CAAC;oBAC9C,OAAO,EAAE,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,cAAc,CAAC;iBACrE;;;SCvBe,SAAS,CAAgB,QAA6B;IACpE,IAAI,CAAC,QAAQ;QAAE,OAAO;IAEtB,MAAM,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACvD,QAAQ,CAAC,OAAO,CAAC,OAAO;QACtB,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAC9E,CAAC,CAAC;AACL;;SCPgB,IAAI,CAAgB,OAA4B,EAAE,OAAO,GAAG,CAAC;IAC3E,OAAO,CAAC,aAAa,EAAE,CAAC;IACxB,OAAO,IAAI,OAAO,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACtD;;ACLA;;;;;;"}