@acorex/core 16.0.2 → 17.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (311) hide show
  1. package/common/README.md +3 -0
  2. package/common/countries/countries.data.d.ts +2 -0
  3. package/common/countries/country.d.ts +13 -0
  4. package/common/index.d.ts +2 -0
  5. package/config/README.md +3 -0
  6. package/config/index.d.ts +2 -0
  7. package/config/lib/configs.d.ts +6 -0
  8. package/config/lib/configs.service.d.ts +12 -0
  9. package/date-time/README.md +3 -0
  10. package/date-time/index.d.ts +10 -0
  11. package/date-time/lib/calendar.service.d.ts +27 -0
  12. package/date-time/lib/dateTime.config.d.ts +12 -0
  13. package/date-time/lib/datetime.class.d.ts +138 -0
  14. package/date-time/lib/datetime.module.d.ts +8 -0
  15. package/date-time/lib/datetime.pipe.d.ts +12 -0
  16. package/date-time/lib/formatters/datetime-formatter.d.ts +19 -0
  17. package/date-time/lib/formatters/timeleft-formatter.d.ts +16 -0
  18. package/date-time/lib/georgian.calendar.d.ts +21 -0
  19. package/date-time/lib/holidays.loader.d.ts +21 -0
  20. package/date-time/lib/jalali.calendar.d.ts +40 -0
  21. package/esm2022/common/acorex-core-common.mjs +5 -0
  22. package/esm2022/common/countries/countries.data.mjs +2625 -0
  23. package/esm2022/common/countries/country.mjs +2 -0
  24. package/esm2022/common/index.mjs +3 -0
  25. package/esm2022/config/acorex-core-config.mjs +5 -0
  26. package/esm2022/config/index.mjs +3 -0
  27. package/esm2022/config/lib/configs.mjs +7 -0
  28. package/esm2022/config/lib/configs.service.mjs +27 -0
  29. package/esm2022/date-time/acorex-core-date-time.mjs +5 -0
  30. package/esm2022/date-time/index.mjs +11 -0
  31. package/esm2022/date-time/lib/calendar.service.mjs +100 -0
  32. package/esm2022/date-time/lib/dateTime.config.mjs +50 -0
  33. package/esm2022/date-time/lib/datetime.class.mjs +337 -0
  34. package/esm2022/date-time/lib/datetime.module.mjs +27 -0
  35. package/esm2022/date-time/lib/datetime.pipe.mjs +29 -0
  36. package/esm2022/date-time/lib/formatters/datetime-formatter.mjs +32 -0
  37. package/esm2022/date-time/lib/formatters/timeleft-formatter.mjs +91 -0
  38. package/esm2022/date-time/lib/georgian.calendar.mjs +203 -0
  39. package/esm2022/date-time/lib/holidays.loader.mjs +13 -0
  40. package/esm2022/date-time/lib/jalali.calendar.mjs +440 -0
  41. package/esm2022/events/acorex-core-events.mjs +5 -0
  42. package/esm2022/events/index.mjs +3 -0
  43. package/esm2022/events/lib/event.service.mjs +43 -0
  44. package/esm2022/events/lib/event.type.mjs +6 -0
  45. package/esm2022/file/acorex-core-file.mjs +5 -0
  46. package/esm2022/file/index.mjs +7 -0
  47. package/esm2022/file/lib/file-download-ref.class.mjs +12 -0
  48. package/esm2022/file/lib/file-download-result.class.mjs +45 -0
  49. package/esm2022/file/lib/file-size-formatter.mjs +24 -0
  50. package/esm2022/file/lib/file-upload-ref.class.mjs +12 -0
  51. package/esm2022/file/lib/file.module.mjs +20 -0
  52. package/esm2022/file/lib/file.service.mjs +103 -0
  53. package/esm2022/format/acorex-core-format.mjs +5 -0
  54. package/esm2022/format/index.mjs +8 -0
  55. package/esm2022/format/lib/format.config.mjs +3 -0
  56. package/esm2022/format/lib/format.module.mjs +64 -0
  57. package/esm2022/format/lib/format.pipe.mjs +37 -0
  58. package/esm2022/format/lib/format.service.mjs +95 -0
  59. package/esm2022/format/lib/format.types.mjs +2 -0
  60. package/esm2022/format/lib/formatters/number-formatter.mjs +74 -0
  61. package/esm2022/format/lib/formatters/string-formatter.mjs +15 -0
  62. package/esm2022/image/acorex-core-image.mjs +5 -0
  63. package/esm2022/image/index.mjs +2 -0
  64. package/esm2022/image/lib/image.service.mjs +43 -0
  65. package/esm2022/index.mjs +2 -44
  66. package/esm2022/memorize/acorex-core-memorize.mjs +5 -0
  67. package/esm2022/memorize/index.mjs +2 -0
  68. package/esm2022/memorize/lib/memorize.decorator.mjs +19 -0
  69. package/esm2022/pipes/acorex-core-pipes.mjs +5 -0
  70. package/esm2022/pipes/index.mjs +2 -0
  71. package/esm2022/pipes/lib/safe/safe.pipe.mjs +38 -0
  72. package/esm2022/platform/acorex-core-platform.mjs +5 -0
  73. package/esm2022/platform/index.mjs +2 -0
  74. package/esm2022/platform/lib/platform.service.mjs +225 -0
  75. package/esm2022/storage/acorex-core-storage.mjs +5 -0
  76. package/esm2022/storage/cookie-storage.service.mjs +202 -0
  77. package/esm2022/storage/index.mjs +5 -0
  78. package/esm2022/storage/local-storage.service.mjs +58 -0
  79. package/esm2022/storage/session-storage.service.mjs +22 -0
  80. package/esm2022/storage/storage.interface.mjs +2 -0
  81. package/esm2022/translation/acorex-core-translation.mjs +5 -0
  82. package/esm2022/translation/index.mjs +9 -0
  83. package/esm2022/translation/lib/translation-scope.resolver.mjs +11 -0
  84. package/esm2022/translation/lib/translation.config.mjs +20 -0
  85. package/esm2022/translation/lib/translation.loader.mjs +14 -0
  86. package/esm2022/translation/lib/translation.module.mjs +40 -0
  87. package/esm2022/translation/lib/translation.service.mjs +173 -0
  88. package/esm2022/translation/lib/translation.types.mjs +2 -0
  89. package/esm2022/translation/lib/translator.directive.mjs +28 -0
  90. package/esm2022/translation/lib/translator.pipe.mjs +23 -0
  91. package/esm2022/types/acorex-core-types.mjs +5 -0
  92. package/esm2022/types/index.mjs +2 -0
  93. package/esm2022/utils/acorex-core-utils.mjs +5 -0
  94. package/esm2022/utils/index.mjs +6 -0
  95. package/esm2022/utils/lib/auto-unsubscribe.mjs +36 -0
  96. package/esm2022/utils/lib/color-util.mjs +111 -0
  97. package/esm2022/utils/lib/drawing-util.mjs +35 -0
  98. package/esm2022/utils/lib/html-util.mjs +39 -0
  99. package/esm2022/utils/lib/string-util.mjs +19 -0
  100. package/esm2022/validation/acorex-core-validation.mjs +5 -0
  101. package/esm2022/validation/index.mjs +18 -0
  102. package/esm2022/validation/lib/rules/between-rule.mjs +31 -0
  103. package/esm2022/validation/lib/rules/callback-rule.mjs +29 -0
  104. package/esm2022/validation/lib/rules/equal-rule.mjs +26 -0
  105. package/esm2022/validation/lib/rules/greater-than.mjs +29 -0
  106. package/esm2022/validation/lib/rules/length-rule.mjs +26 -0
  107. package/esm2022/validation/lib/rules/less-than-rule.mjs +29 -0
  108. package/esm2022/validation/lib/rules/maxlength-rule.mjs +27 -0
  109. package/esm2022/validation/lib/rules/minlength-rule.mjs +26 -0
  110. package/esm2022/validation/lib/rules/regex-rule.mjs +49 -0
  111. package/esm2022/validation/lib/rules/required-rule.mjs +36 -0
  112. package/esm2022/validation/lib/validation.config.mjs +33 -0
  113. package/esm2022/validation/lib/validation.module.mjs +84 -0
  114. package/esm2022/validation/lib/validation.service.mjs +98 -0
  115. package/esm2022/validation/lib/validation.types.mjs +3 -0
  116. package/events/README.md +3 -0
  117. package/events/index.d.ts +2 -0
  118. package/{lib/services → events/lib}/event.service.d.ts +8 -0
  119. package/events/lib/event.type.d.ts +5 -0
  120. package/fesm2022/acorex-core-common.mjs +2631 -0
  121. package/fesm2022/acorex-core-common.mjs.map +1 -0
  122. package/fesm2022/acorex-core-config.mjs +39 -0
  123. package/fesm2022/acorex-core-config.mjs.map +1 -0
  124. package/fesm2022/acorex-core-date-time.mjs +1305 -0
  125. package/fesm2022/acorex-core-date-time.mjs.map +1 -0
  126. package/fesm2022/acorex-core-events.mjs +56 -0
  127. package/fesm2022/acorex-core-events.mjs.map +1 -0
  128. package/fesm2022/acorex-core-file.mjs +214 -0
  129. package/fesm2022/acorex-core-file.mjs.map +1 -0
  130. package/fesm2022/acorex-core-format.mjs +282 -0
  131. package/fesm2022/acorex-core-format.mjs.map +1 -0
  132. package/fesm2022/acorex-core-image.mjs +50 -0
  133. package/fesm2022/acorex-core-image.mjs.map +1 -0
  134. package/fesm2022/acorex-core-memorize.mjs +26 -0
  135. package/fesm2022/acorex-core-memorize.mjs.map +1 -0
  136. package/fesm2022/acorex-core-pipes.mjs +44 -0
  137. package/fesm2022/acorex-core-pipes.mjs.map +1 -0
  138. package/fesm2022/acorex-core-platform.mjs +232 -0
  139. package/fesm2022/acorex-core-platform.mjs.map +1 -0
  140. package/fesm2022/acorex-core-storage.mjs +285 -0
  141. package/fesm2022/acorex-core-storage.mjs.map +1 -0
  142. package/fesm2022/acorex-core-translation.mjs +293 -0
  143. package/fesm2022/acorex-core-translation.mjs.map +1 -0
  144. package/fesm2022/acorex-core-types.mjs +6 -0
  145. package/fesm2022/acorex-core-types.mjs.map +1 -0
  146. package/fesm2022/acorex-core-utils.mjs +247 -0
  147. package/fesm2022/acorex-core-utils.mjs.map +1 -0
  148. package/fesm2022/acorex-core-validation.mjs +488 -0
  149. package/fesm2022/acorex-core-validation.mjs.map +1 -0
  150. package/fesm2022/acorex-core.mjs +2 -2309
  151. package/fesm2022/acorex-core.mjs.map +1 -1
  152. package/file/README.md +3 -0
  153. package/file/index.d.ts +6 -0
  154. package/file/lib/file-download-ref.class.d.ts +6 -0
  155. package/file/lib/file-download-result.class.d.ts +8 -0
  156. package/file/lib/file-size-formatter.d.ts +16 -0
  157. package/file/lib/file-upload-ref.class.d.ts +5 -0
  158. package/file/lib/file.module.d.ts +7 -0
  159. package/file/lib/file.service.d.ts +18 -0
  160. package/format/README.md +3 -0
  161. package/format/index.d.ts +7 -0
  162. package/format/lib/format.config.d.ts +5 -0
  163. package/format/lib/format.module.d.ts +18 -0
  164. package/format/lib/format.pipe.d.ts +12 -0
  165. package/format/lib/format.service.d.ts +43 -0
  166. package/format/lib/format.types.d.ts +4 -0
  167. package/format/lib/formatters/number-formatter.d.ts +23 -0
  168. package/format/lib/formatters/string-formatter.d.ts +14 -0
  169. package/image/README.md +3 -0
  170. package/image/index.d.ts +1 -0
  171. package/image/lib/image.service.d.ts +11 -0
  172. package/index.d.ts +1 -43
  173. package/memorize/README.md +3 -0
  174. package/memorize/index.d.ts +1 -0
  175. package/memorize/lib/memorize.decorator.d.ts +1 -0
  176. package/package.json +98 -5
  177. package/pipes/README.md +3 -0
  178. package/pipes/index.d.ts +1 -0
  179. package/pipes/lib/safe/safe.pipe.d.ts +10 -0
  180. package/platform/README.md +3 -0
  181. package/platform/index.d.ts +1 -0
  182. package/{lib/platform → platform/lib}/platform.service.d.ts +14 -6
  183. package/storage/README.md +3 -0
  184. package/storage/cookie-storage.service.d.ts +104 -0
  185. package/storage/index.d.ts +4 -0
  186. package/storage/local-storage.service.d.ts +16 -0
  187. package/storage/session-storage.service.d.ts +10 -0
  188. package/storage/storage.interface.d.ts +14 -0
  189. package/translation/README.md +3 -0
  190. package/translation/index.d.ts +8 -0
  191. package/translation/lib/translation-scope.resolver.d.ts +2 -0
  192. package/translation/lib/translation.config.d.ts +14 -0
  193. package/translation/lib/translation.loader.d.ts +14 -0
  194. package/translation/lib/translation.module.d.ts +8 -0
  195. package/translation/lib/translation.service.d.ts +31 -0
  196. package/translation/lib/translation.types.d.ts +10 -0
  197. package/translation/lib/translator.directive.d.ts +12 -0
  198. package/translation/lib/translator.pipe.d.ts +12 -0
  199. package/types/README.md +3 -0
  200. package/types/index.d.ts +2 -0
  201. package/utils/README.md +3 -0
  202. package/utils/index.d.ts +5 -0
  203. package/utils/lib/auto-unsubscribe.d.ts +12 -0
  204. package/utils/lib/color-util.d.ts +24 -0
  205. package/utils/lib/drawing-util.d.ts +18 -0
  206. package/utils/lib/html-util.d.ts +5 -0
  207. package/utils/lib/string-util.d.ts +6 -0
  208. package/validation/README.md +3 -0
  209. package/validation/index.d.ts +14 -0
  210. package/validation/lib/rules/between-rule.d.ts +18 -0
  211. package/validation/lib/rules/callback-rule.d.ts +23 -0
  212. package/validation/lib/rules/equal-rule.d.ts +17 -0
  213. package/validation/lib/rules/greater-than.d.ts +17 -0
  214. package/validation/lib/rules/length-rule.d.ts +17 -0
  215. package/validation/lib/rules/less-than-rule.d.ts +17 -0
  216. package/validation/lib/rules/maxlength-rule.d.ts +16 -0
  217. package/validation/lib/rules/minlength-rule.d.ts +16 -0
  218. package/validation/lib/rules/regex-rule.d.ts +17 -0
  219. package/validation/lib/rules/required-rule.d.ts +16 -0
  220. package/validation/lib/validation.config.d.ts +15 -0
  221. package/validation/lib/validation.module.d.ts +17 -0
  222. package/validation/lib/validation.service.d.ts +35 -0
  223. package/validation/lib/validation.types.d.ts +21 -0
  224. package/esm2022/lib/classes/base-page.class.mjs +0 -26
  225. package/esm2022/lib/classes/color.class.mjs +0 -49
  226. package/esm2022/lib/classes/datetime.class.mjs +0 -323
  227. package/esm2022/lib/classes/menu.class.mjs +0 -35
  228. package/esm2022/lib/classes/navigator.class.mjs +0 -2
  229. package/esm2022/lib/classes/popup.class.mjs +0 -2
  230. package/esm2022/lib/classes/promise.class.mjs +0 -21
  231. package/esm2022/lib/classes/sectionlist.class.mjs +0 -2
  232. package/esm2022/lib/classes/select.class.mjs +0 -8
  233. package/esm2022/lib/core.module.mjs +0 -27
  234. package/esm2022/lib/error/error.class.mjs +0 -2
  235. package/esm2022/lib/error/error.module.mjs +0 -19
  236. package/esm2022/lib/error/error.service.mjs +0 -22
  237. package/esm2022/lib/events/keyboard.mjs +0 -2
  238. package/esm2022/lib/http/http-error.class.mjs +0 -2
  239. package/esm2022/lib/http/http-events.interceptor.mjs +0 -3
  240. package/esm2022/lib/http/http-request.class.mjs +0 -2
  241. package/esm2022/lib/http/http-result.class.mjs +0 -25
  242. package/esm2022/lib/http/http.module.mjs +0 -35
  243. package/esm2022/lib/http/http.service.mjs +0 -148
  244. package/esm2022/lib/locale/en.json +0 -255
  245. package/esm2022/lib/locale/fa.json +0 -245
  246. package/esm2022/lib/pipe/datetime.pipe.mjs +0 -25
  247. package/esm2022/lib/pipe/htmlToText.pipe.mjs +0 -25
  248. package/esm2022/lib/platform/index.mjs +0 -2
  249. package/esm2022/lib/platform/platform.service.mjs +0 -152
  250. package/esm2022/lib/services/config.mjs +0 -29
  251. package/esm2022/lib/services/event.service.mjs +0 -34
  252. package/esm2022/lib/services/navigator.service.mjs +0 -10
  253. package/esm2022/lib/services/storage.service.mjs +0 -16
  254. package/esm2022/lib/translator/translator.mjs +0 -26
  255. package/esm2022/lib/translator/translator.module.mjs +0 -25
  256. package/esm2022/lib/translator/translator.pipe.mjs +0 -24
  257. package/esm2022/lib/translator/translator.service.mjs +0 -21
  258. package/esm2022/lib/utils/array/array-util.mjs +0 -133
  259. package/esm2022/lib/utils/html/html-util.mjs +0 -200
  260. package/esm2022/lib/utils/html/html.module.mjs +0 -19
  261. package/esm2022/lib/utils/math/math-util.mjs +0 -6
  262. package/esm2022/lib/utils/object/object-util.mjs +0 -83
  263. package/esm2022/lib/utils/render/on-demand-preload-strategy.service.mjs +0 -21
  264. package/esm2022/lib/utils/render/render.service.mjs +0 -109
  265. package/esm2022/lib/utils/render/rendering.module.mjs +0 -35
  266. package/esm2022/lib/utils/scroll/scroll.directive.mjs +0 -56
  267. package/esm2022/lib/utils/scroll/scroll.module.mjs +0 -19
  268. package/esm2022/lib/utils/separator/separator.module.mjs +0 -19
  269. package/esm2022/lib/utils/separator/separator.pipe.mjs +0 -33
  270. package/lib/classes/base-page.class.d.ts +0 -13
  271. package/lib/classes/color.class.d.ts +0 -17
  272. package/lib/classes/datetime.class.d.ts +0 -63
  273. package/lib/classes/menu.class.d.ts +0 -34
  274. package/lib/classes/navigator.class.d.ts +0 -5
  275. package/lib/classes/popup.class.d.ts +0 -12
  276. package/lib/classes/promise.class.d.ts +0 -7
  277. package/lib/classes/sectionlist.class.d.ts +0 -8
  278. package/lib/classes/select.class.d.ts +0 -7
  279. package/lib/core.module.d.ts +0 -9
  280. package/lib/error/error.class.d.ts +0 -4
  281. package/lib/error/error.module.d.ts +0 -7
  282. package/lib/error/error.service.d.ts +0 -13
  283. package/lib/events/keyboard.d.ts +0 -2
  284. package/lib/http/http-error.class.d.ts +0 -7
  285. package/lib/http/http-events.interceptor.d.ts +0 -10
  286. package/lib/http/http-request.class.d.ts +0 -14
  287. package/lib/http/http-result.class.d.ts +0 -11
  288. package/lib/http/http.module.d.ts +0 -10
  289. package/lib/http/http.service.d.ts +0 -23
  290. package/lib/pipe/datetime.pipe.d.ts +0 -8
  291. package/lib/pipe/htmlToText.pipe.d.ts +0 -7
  292. package/lib/platform/index.d.ts +0 -1
  293. package/lib/services/config.d.ts +0 -9
  294. package/lib/services/navigator.service.d.ts +0 -8
  295. package/lib/services/storage.service.d.ts +0 -7
  296. package/lib/translator/translator.d.ts +0 -9
  297. package/lib/translator/translator.module.d.ts +0 -8
  298. package/lib/translator/translator.pipe.d.ts +0 -8
  299. package/lib/translator/translator.service.d.ts +0 -8
  300. package/lib/utils/array/array-util.d.ts +0 -6
  301. package/lib/utils/html/html-util.d.ts +0 -62
  302. package/lib/utils/html/html.module.d.ts +0 -8
  303. package/lib/utils/math/math-util.d.ts +0 -3
  304. package/lib/utils/object/object-util.d.ts +0 -7
  305. package/lib/utils/render/on-demand-preload-strategy.service.d.ts +0 -10
  306. package/lib/utils/render/render.service.d.ts +0 -18
  307. package/lib/utils/render/rendering.module.d.ts +0 -8
  308. package/lib/utils/scroll/scroll.directive.d.ts +0 -18
  309. package/lib/utils/scroll/scroll.module.d.ts +0 -8
  310. package/lib/utils/separator/separator.module.d.ts +0 -8
  311. package/lib/utils/separator/separator.pipe.d.ts +0 -8
@@ -0,0 +1,173 @@
1
+ import { Injectable, inject } from '@angular/core';
2
+ import { BehaviorSubject, catchError, finalize, firstValueFrom, forkJoin, map, of, shareReplay, startWith, switchMap, take, tap, } from 'rxjs';
3
+ import { AX_TRANSLATION_LOADER } from './translation.loader';
4
+ import { set as lodashSet, get as lodashGet } from 'lodash-es';
5
+ import { AX_TRANSLATION_CONFIG } from './translation.config';
6
+ import { AXEventService, AXEventTypes } from '@acorex/core/events';
7
+ import * as i0 from "@angular/core";
8
+ let service;
9
+ export function translateSync(key, options) {
10
+ return service.translateSync(key, options);
11
+ }
12
+ export class AXTranslationService {
13
+ /**
14
+ * @ignore
15
+ */
16
+ constructor() {
17
+ this.loader = inject(AX_TRANSLATION_LOADER);
18
+ this.config = inject(AX_TRANSLATION_CONFIG);
19
+ this.eventService = inject(AXEventService);
20
+ this.translationCache = {};
21
+ this.ongoingRequests = new Map();
22
+ this.activeLang = new BehaviorSubject(this.getDefaultLang());
23
+ this.langChanges$ = this.activeLang.asObservable();
24
+ this.lastActiveLang = null;
25
+ service = this;
26
+ }
27
+ loadLanguagesAndScopes(languages, scopes) {
28
+ const requests = languages.flatMap((lang) => scopes.map((scope) => {
29
+ // Check if translations are already cached
30
+ if (this.translationCache[lang]?.[scope]) {
31
+ return of(this.translationCache[lang][scope]);
32
+ }
33
+ // Use the new method to handle ongoing requests and loading
34
+ return this.getOrLoadTranslations(lang, scope);
35
+ }));
36
+ return forkJoin(requests);
37
+ }
38
+ getOrLoadTranslations(lang, scope) {
39
+ const requestKey = `${lang}_${scope}`;
40
+ // Return existing observable if the request is already in progress
41
+ if (this.ongoingRequests.has(requestKey)) {
42
+ return this.ongoingRequests.get(requestKey);
43
+ }
44
+ // Load translations if not in cache or ongoing requests
45
+ const translationObservable = this.loader
46
+ .getTranslation({ lang, scope })
47
+ .pipe(tap((translations) => this.cacheTranslations(lang, scope, translations)), catchError((error) => {
48
+ console.error(`Error loading translations for lang: ${lang}, scope: ${scope}`, error);
49
+ return of(null);
50
+ }), finalize(() => {
51
+ this.eventService.emitEvent({
52
+ type: AXEventTypes.AXLanguageLoaded,
53
+ payload: lang,
54
+ });
55
+ this.ongoingRequests.delete(requestKey);
56
+ }), shareReplay(1));
57
+ this.ongoingRequests.set(requestKey, translationObservable);
58
+ return translationObservable;
59
+ }
60
+ cacheTranslations(lang, scope, translations) {
61
+ lodashSet(this.translationCache, `${lang}.${scope}`, translations);
62
+ }
63
+ getDefaultLang() {
64
+ return this.config.defaultLang;
65
+ }
66
+ getActiveLang() {
67
+ return this.activeLang.getValue();
68
+ }
69
+ setActiveLang(lang) {
70
+ if (lang != this.getActiveLang()) {
71
+ this.lastActiveLang = this.getActiveLang(); // Update last active language
72
+ this.activeLang.next(lang);
73
+ this.eventService.emitEvent({
74
+ type: AXEventTypes.AXLanguageChanged,
75
+ payload: lang,
76
+ });
77
+ }
78
+ }
79
+ load(key, options = {}) {
80
+ const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options;
81
+ // Function to fetch translation
82
+ const fetchTranslation = (language) => {
83
+ // Check if translations are available in the cache
84
+ if (this.translationCache[language]?.[scope]) {
85
+ return of(this.getTranslation(key, language, scope, options.params));
86
+ }
87
+ // Use the new method to handle ongoing requests and loading
88
+ return this.getOrLoadTranslations(language, scope).pipe(map(() => {
89
+ const translation = this.translationCache[language]?.[scope]?.[key] || key;
90
+ return this.getTranslation(translation, language, scope, options.params);
91
+ }), switchMap((translatedText) => {
92
+ if (translatedText === key && language !== this.getDefaultLang()) {
93
+ // If the translation is not found and the language is not default,
94
+ // try fetching from the default language
95
+ return fetchTranslation(this.getDefaultLang());
96
+ }
97
+ return of(translatedText);
98
+ }));
99
+ };
100
+ // First, try to fetch the translation for the requested language
101
+ const translationForRequestedLang = fetchTranslation(lang);
102
+ // If lastActiveLang is available and different from the requested language, use it as a fallback
103
+ if (this.lastActiveLang && this.lastActiveLang !== lang) {
104
+ const translationForLastActiveLang = this.getTranslation(key, this.lastActiveLang, scope, options.params);
105
+ return translationForRequestedLang.pipe(startWith(translationForLastActiveLang));
106
+ }
107
+ return translationForRequestedLang;
108
+ }
109
+ getTranslation(key, lang, scope, params) {
110
+ let translation = (lodashGet(this.translationCache, `${lang}.${scope}.${key}`) || key);
111
+ // Replace params like {{ name }}
112
+ if (params) {
113
+ Object.keys(params).forEach((paramKey) => {
114
+ const paramValue = params[paramKey];
115
+ translation = translation.replace(new RegExp(`{{\\s*${paramKey}\\s*}}`, 'g'), paramValue);
116
+ });
117
+ }
118
+ // Replace translations like {{ t('key') }}
119
+ const translationPattern = /{{\s*t\('([^']+)'\)\s*}}/g;
120
+ translation = translation.replace(translationPattern, (match, innerKey) => {
121
+ return this.getTranslation(innerKey, lang, scope, params);
122
+ });
123
+ return translation;
124
+ }
125
+ translate(key, options) {
126
+ if (options?.lang) {
127
+ return this.load(key, options);
128
+ }
129
+ return this.langChanges$.pipe(startWith(this.getActiveLang()), switchMap((lang) => {
130
+ return this.load(key, { ...options, lang: lang });
131
+ }));
132
+ }
133
+ async translateAsync(key, options) {
134
+ const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};
135
+ let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);
136
+ if (!translation) {
137
+ // If the translation is not in the cache, load it
138
+ await firstValueFrom(this.load(key, { lang, scope }).pipe(take(1)));
139
+ translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);
140
+ }
141
+ // If still not available, try the last active language or default language
142
+ if (!translation && this.lastActiveLang) {
143
+ translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);
144
+ }
145
+ if (!translation) {
146
+ translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);
147
+ }
148
+ // Perform parameter replacement
149
+ return this.getTranslation((translation || key), lang, scope, options?.params);
150
+ }
151
+ translateSync(key, options) {
152
+ const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};
153
+ // Check if the translation for the active language is available
154
+ let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);
155
+ // If not available, check lastActiveLang
156
+ if (!translation && this.lastActiveLang) {
157
+ translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);
158
+ }
159
+ // If still not available, use the default language
160
+ if (!translation) {
161
+ translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);
162
+ }
163
+ // Perform parameter replacement
164
+ return this.getTranslation((translation || key), lang, scope, options?.params);
165
+ }
166
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXTranslationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
167
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXTranslationService, providedIn: 'root' }); }
168
+ }
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXTranslationService, decorators: [{
170
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dlIGlzIGF2YWlsYWJsZVxuICAgIGxldCB0cmFuc2xhdGlvbiA9IGxvZGFzaEdldChcbiAgICAgIHRoaXMudHJhbnNsYXRpb25DYWNoZSxcbiAgICAgIGAke2xhbmd9LiR7c2NvcGV9LiR7a2V5fWBcbiAgICApO1xuXG4gICAgLy8gSWYgbm90IGF2YWlsYWJsZSwgY2hlY2sgbGFzdEFjdGl2ZUxhbmdcbiAgICBpZiAoIXRyYW5zbGF0aW9uICYmIHRoaXMubGFzdEFjdGl2ZUxhbmcpIHtcbiAgICAgIHRyYW5zbGF0aW9uID0gbG9kYXNoR2V0KFxuICAgICAgICB0aGlzLnRyYW5zbGF0aW9uQ2FjaGUsXG4gICAgICAgIGAke3RoaXMubGFzdEFjdGl2ZUxhbmd9LiR7c2NvcGV9LiR7a2V5fWBcbiAgICAgICk7XG4gICAgfVxuXG4gICAgLy8gSWYgc3RpbGwgbm90IGF2YWlsYWJsZSwgdXNlIHRoZSBkZWZhdWx0IGxhbmd1YWdlXG4gICAgaWYgKCF0cmFuc2xhdGlvbikge1xuICAgICAgdHJhbnNsYXRpb24gPSBsb2Rhc2hHZXQoXG4gICAgICAgIHRoaXMudHJhbnNsYXRpb25DYWNoZSxcbiAgICAgICAgYCR7dGhpcy5nZXREZWZhdWx0TGFuZygpfS4ke3Njb3BlfS4ke2tleX1gXG4gICAgICApO1xuICAgIH1cblxuICAgIC8vIFBlcmZvcm0gcGFyYW1ldGVyIHJlcGxhY2VtZW50XG4gICAgcmV0dXJuIHRoaXMuZ2V0VHJhbnNsYXRpb24oXG4gICAgICAodHJhbnNsYXRpb24gfHwga2V5KSBhcyBhbnksXG4gICAgICBsYW5nLFxuICAgICAgc2NvcGUsXG4gICAgICBvcHRpb25zPy5wYXJhbXNcbiAgICApO1xuICB9XG59XG4iXX0=
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb24udHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdHJhbnNsYXRpb24vc3JjL2xpYi90cmFuc2xhdGlvbi50eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgQVhUcmFuc2xhdGVQYXJhbXM8VCA9IHVua25vd24+ID0gUmVjb3JkPHN0cmluZywgVD47XG5leHBvcnQgdHlwZSBBWFRyYW5zbGF0ZUhhc2hNYXA8VCA9IHVua25vd24+ID0gUmVjb3JkPHN0cmluZywgVD47XG5leHBvcnQgdHlwZSBBWFRyYW5zbGF0aW9uID0gUmVjb3JkPHN0cmluZywgc3RyaW5nPjtcbmV4cG9ydCB0eXBlIEFYVHJhbnNsYXRlTGFuZyA9IHN0cmluZztcblxuZXhwb3J0IHR5cGUgQVhUcmFuc2xhdGVTY29wZSA9IHN0cmluZztcblxuZXhwb3J0IGludGVyZmFjZSBBWFRyYW5zbGF0ZU9wdGlvbnMge1xuICBsYW5nPzogQVhUcmFuc2xhdGVMYW5nO1xuICBzY29wZT86IEFYVHJhbnNsYXRlU2NvcGU7XG4gIHBhcmFtcz86IEFYVHJhbnNsYXRlUGFyYW1zO1xufVxuIl19
@@ -0,0 +1,28 @@
1
+ import { Directive, TemplateRef, ViewContainerRef, } from '@angular/core';
2
+ import { AXTranslationService } from './translation.service';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "./translation.service";
5
+ export class AXTranslatorDirective {
6
+ constructor(templateRef, viewContainer, translationService) {
7
+ this.templateRef = templateRef;
8
+ this.viewContainer = viewContainer;
9
+ this.translationService = translationService;
10
+ }
11
+ ngOnInit() {
12
+ this.viewContainer.clear();
13
+ this.viewContainer.createEmbeddedView(this.templateRef, {
14
+ $implicit: (key, options) => {
15
+ return this.translationService.translate(key, options);
16
+ },
17
+ });
18
+ }
19
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXTranslatorDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i1.AXTranslationService }], target: i0.ɵɵFactoryTarget.Directive }); }
20
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.2", type: AXTranslatorDirective, selector: "[translate]", ngImport: i0 }); }
21
+ }
22
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXTranslatorDirective, decorators: [{
23
+ type: Directive,
24
+ args: [{
25
+ selector: '[translate]',
26
+ }]
27
+ }], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i1.AXTranslationService }] });
28
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRvci5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdHJhbnNsYXRpb24vc3JjL2xpYi90cmFuc2xhdG9yLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsU0FBUyxFQUVULFdBQVcsRUFDWCxnQkFBZ0IsR0FDakIsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sdUJBQXVCLENBQUM7OztBQU03RCxNQUFNLE9BQU8scUJBQXFCO0lBQ2hDLFlBQ1UsV0FBNkIsRUFDN0IsYUFBK0IsRUFDL0Isa0JBQXdDO1FBRnhDLGdCQUFXLEdBQVgsV0FBVyxDQUFrQjtRQUM3QixrQkFBYSxHQUFiLGFBQWEsQ0FBa0I7UUFDL0IsdUJBQWtCLEdBQWxCLGtCQUFrQixDQUFzQjtJQUMvQyxDQUFDO0lBRUosUUFBUTtRQU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ZhdGUgdHJhbnNsYXRpb25TZXJ2aWNlOiBBWFRyYW5zbGF0aW9uU2VydmljZVxuICApIHt9XG5cbiAgbmdPbkluaXQoKSB7XG4gICAgdGhpcy52aWV3Q29udGFpbmVyLmNsZWFyKCk7XG4gICAgdGhpcy52aWV3Q29udGFpbmVyLmNyZWF0ZUVtYmVkZGVkVmlldyh0aGlzLnRlbXBsYXRlUmVmLCB7XG4gICAgICAkaW1wbGljaXQ6IChrZXk6IHN0cmluZywgb3B0aW9ucz86IEFYVHJhbnNsYXRlT3B0aW9ucykgPT4ge1xuICAgICAgICByZXR1cm4gdGhpcy50cmFuc2xhdGlvblNlcnZpY2UudHJhbnNsYXRlKGtleSwgb3B0aW9ucyk7XG4gICAgICB9LFxuICAgIH0pO1xuICB9XG59XG4iXX0=
@@ -0,0 +1,23 @@
1
+ import { Pipe } from '@angular/core';
2
+ import { AXTranslationService } from './translation.service';
3
+ import { of } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "./translation.service";
6
+ export class AXTranslatorPipe {
7
+ constructor(service) {
8
+ this.service = service;
9
+ }
10
+ transform(key, options) {
11
+ if (!key) {
12
+ return of(''); // Return an empty observable if the key is not provided
13
+ }
14
+ return this.service.translate(key, options);
15
+ }
16
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXTranslatorPipe, deps: [{ token: i1.AXTranslationService }], target: i0.ɵɵFactoryTarget.Pipe }); }
17
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: AXTranslatorPipe, name: "translate" }); }
18
+ }
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXTranslatorPipe, decorators: [{
20
+ type: Pipe,
21
+ args: [{ name: 'translate', pure: true }]
22
+ }], ctorParameters: () => [{ type: i1.AXTranslationService }] });
23
+ //# sourceMappingURL=data:application/json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L3RyYW5zbGF0aW9uLnNlcnZpY2UnO1xuaW1wb3J0IHsgT2JzZXJ2YWJsZSwgb2YgfSBmcm9tICdyeGpzJztcbmltcG9ydCB7IEFYVHJhbnNsYXRlT3B0aW9ucyB9IGZyb20gJy4vdHJhbnNsYXRpb24udHlwZXMnO1xuXG5AUGlwZSh7IG5hbWU6ICd0cmFuc2xhdGUnLCBwdXJlOiB0cnVlIH0pIC8vIFRoZSBwaXBlIGNhbiBub3cgYmUgcHVyZVxuZXhwb3J0IGNsYXNzIEFYVHJhbnNsYXRvclBpcGUgaW1wbGVtZW50cyBQaXBlVHJhbnNmb3JtIHtcbiAgY29uc3RydWN0b3IocHJpdmF0ZSBzZXJ2aWNlOiBBWFRyYW5zbGF0aW9uU2VydmljZSkge31cblxuICB0cmFuc2Zvcm0oa2V5OiBzdHJpbmcsIG9wdGlvbnM/OiBBWFRyYW5zbGF0ZU9wdGlvbnMpOiBPYnNlcnZhYmxlPHN0cmluZz4ge1xuICAgIGlmICgha2V5KSB7XG4gICAgICByZXR1cm4gb2YoJycpOyAvLyBSZXR1cm4gYW4gZW1wdHkgb2JzZXJ2YWJsZSBpZiB0aGUga2V5IGlzIG5vdCBwcm92aWRlZFxuICAgIH1cbiAgICByZXR1cm4gdGhpcy5zZXJ2aWNlLnRyYW5zbGF0ZShrZXksIG9wdGlvbnMpO1xuICB9XG59XG4iXX0=
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNvcmV4LWNvcmUtdHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdHlwZXMvc3JjL2Fjb3JleC1jb3JlLXR5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -0,0 +1,2 @@
1
+ export default {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdHlwZXMvc3JjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQWUsRUFBRSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQge307XG4iXX0=
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNvcmV4LWNvcmUtdXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdXRpbHMvc3JjL2Fjb3JleC1jb3JlLXV0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -0,0 +1,6 @@
1
+ export * from './lib/auto-unsubscribe';
2
+ export * from './lib/color-util';
3
+ export * from './lib/drawing-util';
4
+ export * from './lib/html-util';
5
+ export * from './lib/string-util';
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdXRpbHMvc3JjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxtQkFBbUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbGliL2F1dG8tdW5zdWJzY3JpYmUnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29sb3ItdXRpbCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9kcmF3aW5nLXV0aWwnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvaHRtbC11dGlsJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3N0cmluZy11dGlsJztcbiJdfQ==
@@ -0,0 +1,36 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { Subject, takeUntil } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ export function AXAutoUnsubscriber() {
5
+ return function (constructor) {
6
+ const orig = constructor.prototype.ngOnDestroy;
7
+ constructor.prototype.ngOnDestroy = function () {
8
+ for (const prop in this) {
9
+ const property = this[prop];
10
+ if (typeof property.subscribe === 'function') {
11
+ property.unsubscribe();
12
+ }
13
+ }
14
+ orig.apply();
15
+ };
16
+ };
17
+ }
18
+ export class AXUnsubscriber {
19
+ constructor() {
20
+ this._destroy$ = new Subject();
21
+ this.takeUntilDestroy = (origin) => origin.pipe(takeUntil(this._destroy$));
22
+ }
23
+ unsubscribe() {
24
+ this._destroy$.next();
25
+ this._destroy$.complete();
26
+ }
27
+ ngOnDestroy() {
28
+ this.unsubscribe();
29
+ }
30
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXUnsubscriber, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
31
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXUnsubscriber }); }
32
+ }
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXUnsubscriber, decorators: [{
34
+ type: Injectable
35
+ }] });
36
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0by11bnN1YnNjcmliZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS91dGlscy9zcmMvbGliL2F1dG8tdW5zdWJzY3JpYmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBYSxNQUFNLGVBQWUsQ0FBQztBQUN0RCxPQUFPLEVBQWMsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLE1BQU0sQ0FBQzs7QUFFdEQsTUFBTSxVQUFVLGtCQUFrQjtJQUNoQyxPQUFPLFVBQVUsV0FBVztRQUMxQixNQUFNLElBQUksR0FBRyxXQUFXLENBQUMsU0FBUyxDQUFDLFdBQVcsQ0FBQztRQUMvQyxXQUFXLENBQUMsU0FBUyxDQUFDLFdBQVcsR0FBRztZQUNsQyxLQUFLLE1BQU0sSUFBSSxJQUFJLElBQUksRUFBRSxDQUFDO2dCQUN4QixNQUFNLFFBQVEsR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7Z0JBQzVCLElBQUksT0FBTyxRQUFRLENBQUMsU0FBUyxLQUFLLFVBQVUsRUFBRSxDQUFDO29CQUM3QyxRQUFRLENBQUMsV0FBVyxFQUFFLENBQUM7Z0JBQ3pCLENBQUM7WUFDSCxDQUFDO1lBQ0QsSUFBS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gY29uc3QgcHJvcGVydHkgPSB0aGlzW3Byb3BdO1xuICAgICAgICBpZiAodHlwZW9mIHByb3BlcnR5LnN1YnNjcmliZSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgIHByb3BlcnR5LnVuc3Vic2NyaWJlKCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIG9yaWcuYXBwbHkoKTtcbiAgICB9O1xuICB9O1xufVxuXG5ASW5qZWN0YWJsZSgpXG5leHBvcnQgY2xhc3MgQVhVbnN1YnNjcmliZXIgaW1wbGVtZW50cyBPbkRlc3Ryb3kge1xuICBwcml2YXRlIHJlYWRvbmx5IF9kZXN0cm95JCA9IG5ldyBTdWJqZWN0PHZvaWQ+KCk7XG5cbiAgcHVibGljIHJlYWRvbmx5IHRha2VVbnRpbERlc3Ryb3kgPSA8VD4oXG4gICAgb3JpZ2luOiBPYnNlcnZhYmxlPFQ+IHwgU3ViamVjdDxUPlxuICApOiBPYnNlcnZhYmxlPFQ+IHwgU3ViamVjdDxUPiA9PiBvcmlnaW4ucGlwZSh0YWtlVW50aWwodGhpcy5fZGVzdHJveSQpKTtcblxuICBwdWJsaWMgdW5zdWJzY3JpYmUoKTogdm9pZCB7XG4gICAgdGhpcy5fZGVzdHJveSQubmV4dCgpO1xuICAgIHRoaXMuX2Rlc3Ryb3kkLmNvbXBsZXRlKCk7XG4gIH1cblxuICBwdWJsaWMgbmdPbkRlc3Ryb3koKTogdm9pZCB7XG4gICAgdGhpcy51bnN1YnNjcmliZSgpO1xuICB9XG59XG4iXX0=
@@ -0,0 +1,111 @@
1
+ import tinycolor from 'tinycolor2';
2
+ import tinygradient from 'tinygradient-es';
3
+ export class AXColorUtil {
4
+ static to(color, mode) {
5
+ const _color = tinycolor(color);
6
+ switch (mode) {
7
+ case 'rgba':
8
+ return _color.toRgb();
9
+ case 'hsla':
10
+ return _color.toHsl();
11
+ case 'hsva':
12
+ return _color.toHsv();
13
+ default:
14
+ return _color.toHex();
15
+ }
16
+ }
17
+ static toString(color, mode = null) {
18
+ const _color = tinycolor(color);
19
+ switch (mode) {
20
+ case 'rgba':
21
+ return _color.toRgbString();
22
+ case 'hsla':
23
+ return _color.toHslString();
24
+ case 'hsva':
25
+ return _color.toHsvString();
26
+ case 'hex': {
27
+ const rgba = _color.toRgb();
28
+ return rgba.a != 1 ? _color.toHex8String() : _color.toHexString();
29
+ }
30
+ default: {
31
+ if (typeof color == 'string') {
32
+ if (color.toLowerCase().startsWith('#'))
33
+ return this.toString(color, 'hex');
34
+ else
35
+ return this.toString(color, 'rgba');
36
+ }
37
+ else {
38
+ return this.toString(color, 'rgba');
39
+ }
40
+ }
41
+ }
42
+ }
43
+ static isValid(color) {
44
+ const _color = tinycolor(color);
45
+ return _color.isValid();
46
+ }
47
+ static mix(baseColor, hex, percentage) {
48
+ return tinycolor.mix(baseColor, hex, percentage).toString('rgb');
49
+ }
50
+ static multiply(color1, color2) {
51
+ const rgb1 = tinycolor(color1).toRgb();
52
+ const rgb2 = tinycolor(color2).toRgb();
53
+ rgb1.b = Math.floor((rgb1.b * rgb2.b) / 255);
54
+ rgb1.g = Math.floor((rgb1.g * rgb2.g) / 255);
55
+ rgb1.r = Math.floor((rgb1.r * rgb2.r) / 255);
56
+ return tinycolor('rgb ' + rgb1.r + ' ' + rgb1.g + ' ' + rgb1.b).toString('rgb');
57
+ }
58
+ static contrastToWhite(color) {
59
+ return tinycolor.readability('#fff', color);
60
+ }
61
+ static lighten(hex, percentage) {
62
+ return tinycolor(hex).lighten(percentage);
63
+ }
64
+ static darken(hex, percentage) {
65
+ return tinycolor(hex).darken(percentage);
66
+ }
67
+ static brighten(hex, percentage) {
68
+ return tinycolor(hex).brighten(percentage);
69
+ }
70
+ static saturate(hex, percentage) {
71
+ return tinycolor(hex).saturate(percentage);
72
+ }
73
+ static desaturate(hex) {
74
+ return tinycolor(hex).getLuminance();
75
+ }
76
+ static equal(color1, color2) {
77
+ return tinycolor.equals(color1, color2);
78
+ }
79
+ static gradient(values) {
80
+ return tinygradient([...values]);
81
+ }
82
+ static getLuminance(hex) {
83
+ return tinycolor(hex).getLuminance();
84
+ }
85
+ static xyToRgb(vX, vY) {
86
+ vY = vY || 0.00000000001;
87
+ const Y = 1;
88
+ const X = (Y / vY) * vX;
89
+ const Z = (Y / vY) * (1 - vX - vY);
90
+ // Convert to RGB using Wide RGB D65 conversion.
91
+ let rgb = [
92
+ X * 1.656492 - Y * 0.354851 - Z * 0.255038,
93
+ -X * 0.707196 + Y * 1.655397 + Z * 0.036152,
94
+ X * 0.051713 - Y * 0.121364 + Z * 1.01153,
95
+ ];
96
+ // Apply reverse gamma correction.
97
+ rgb = rgb.map((x) => x <= 0.0031308
98
+ ? 12.92 * x
99
+ : (1.0 + 0.055) * Math.pow(x, 1.0 / 2.4) - 0.055);
100
+ // Bring all negative components to zero.
101
+ rgb = rgb.map((x) => Math.max(0, x));
102
+ // If one component is greater than 1, weight components by that value.
103
+ const max = Math.max(...rgb);
104
+ if (max > 1) {
105
+ rgb = rgb.map((x) => x / max);
106
+ }
107
+ rgb = rgb.map((x) => Math.round(x * 255));
108
+ return 'rgb(' + rgb.join(',') + ')';
109
+ }
110
+ }
111
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sb3ItdXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS91dGlscy9zcmMvbGliL2NvbG9yLXV0aWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxTQUF5QixNQUFNLFlBQVksQ0FBQztBQUNuRCxPQUFPLFlBQTBCLE1BQU0saUJBQWlCLENBQUM7QUFJekQsTUFBTSxPQUFPLFdBQVc7SUFDdEIsTUFBTSxDQUFDLEVBQUUsQ0FBQyxLQUFvQixFQUFFLElBQWlCO1FBQy9DLE1BQU0sTUFBTSxHQUFHLFNBQVMsQ0FBQyxLQU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wKCh4KSA9PiBNYXRoLm1heCgwLCB4KSk7XG5cbiAgICAvLyBJZiBvbmUgY29tcG9uZW50IGlzIGdyZWF0ZXIgdGhhbiAxLCB3ZWlnaHQgY29tcG9uZW50cyBieSB0aGF0IHZhbHVlLlxuICAgIGNvbnN0IG1heCA9IE1hdGgubWF4KC4uLnJnYik7XG4gICAgaWYgKG1heCA+IDEpIHtcbiAgICAgIHJnYiA9IHJnYi5tYXAoKHgpID0+IHggLyBtYXgpO1xuICAgIH1cblxuICAgIHJnYiA9IHJnYi5tYXAoKHgpID0+IE1hdGgucm91bmQoeCAqIDI1NSkpO1xuXG4gICAgcmV0dXJuICdyZ2IoJyArIHJnYi5qb2luKCcsJykgKyAnKSc7XG4gIH1cbn1cbiJdfQ==
@@ -0,0 +1,35 @@
1
+ // @dynamic
2
+ export class AXDrawingUtil {
3
+ static collision(a, b) {
4
+ const ac = a.getBoundingClientRect();
5
+ const bc = b.getBoundingClientRect();
6
+ if (ac.left < bc.left + bc.width &&
7
+ ac.left + ac.width > bc.left &&
8
+ ac.top < bc.top + bc.height &&
9
+ ac.top + ac.height > bc.top) {
10
+ return true;
11
+ }
12
+ else {
13
+ return false;
14
+ }
15
+ }
16
+ static isInElementBound(pos, element) {
17
+ const elBound = element.getBoundingClientRect();
18
+ return AXDrawingUtil.isInRecPoint(pos, {
19
+ left: elBound.x,
20
+ width: elBound.width,
21
+ top: elBound.y,
22
+ height: elBound.height,
23
+ });
24
+ }
25
+ static isInRecPoint(pos, rec) {
26
+ return (pos.x >= rec.left &&
27
+ pos.x <= rec.left + rec.width &&
28
+ pos.y >= rec.top &&
29
+ pos.y <= rec.top + rec.height);
30
+ }
31
+ static convertRemToPixels(rem) {
32
+ return (rem * parseFloat(getComputedStyle(document.documentElement).fontSize));
33
+ }
34
+ }
35
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJhd2luZy11dGlsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdX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ByZWMubGVmdCArIHJlYy53aWR0aCAmJlxuICAgICAgcG9zLnkgPj0gcmVjLnRvcCAmJlxuICAgICAgcG9zLnkgPD0gcmVjLnRvcCArIHJlYy5oZWlnaHRcbiAgICApO1xuICB9XG5cbiAgc3RhdGljIGNvbnZlcnRSZW1Ub1BpeGVscyhyZW06IG51bWJlcik6IG51bWJlciB7XG4gICAgcmV0dXJuIChcbiAgICAgIHJlbSAqIHBhcnNlRmxvYXQoZ2V0Q29tcHV0ZWRTdHlsZShkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQpLmZvbnRTaXplKVxuICAgICk7XG4gIH1cbn1cbiJdfQ==
@@ -0,0 +1,39 @@
1
+ // @dynamic
2
+ export class AXHtmlUtil {
3
+ static focusElement(element) {
4
+ const list = [
5
+ 'button',
6
+ 'input',
7
+ '[href]',
8
+ 'select',
9
+ 'textarea',
10
+ '[tabindex]',
11
+ ].map((c) => c + ':not([tabindex="-1"])');
12
+ const focusable = element.querySelector(list.join(', '));
13
+ if (focusable) {
14
+ focusable.focus();
15
+ return focusable;
16
+ }
17
+ return null;
18
+ }
19
+ static blurElement(element) {
20
+ const list = [
21
+ 'button',
22
+ 'input',
23
+ '[href]',
24
+ 'select',
25
+ 'textarea',
26
+ '[tabindex]',
27
+ ].map((c) => c + ':not([tabindex="-1"])');
28
+ const focusable = element.querySelector(list.join(', '));
29
+ if (focusable) {
30
+ focusable.blur();
31
+ return focusable;
32
+ }
33
+ return null;
34
+ }
35
+ static hasFocus(element) {
36
+ return element.matches(':focus-within') || element.matches(':focus');
37
+ }
38
+ }
39
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHRtbC11dGlsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb3JlL3V0aWxzL3NyYy9saWIvaHRtbC11dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFB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MgKyAnOm5vdChbdGFiaW5kZXg9XCItMVwiXSknKTtcbiAgICBjb25zdCBmb2N1c2FibGUgPSBlbGVtZW50LnF1ZXJ5U2VsZWN0b3I8SFRNTEVsZW1lbnQ+KGxpc3Quam9pbignLCAnKSk7XG4gICAgaWYgKGZvY3VzYWJsZSkge1xuICAgICAgZm9jdXNhYmxlLmJsdXIoKTtcbiAgICAgIHJldHVybiBmb2N1c2FibGU7XG4gICAgfVxuICAgIHJldHVybiBudWxsO1xuICB9XG5cbiAgc3RhdGljIGhhc0ZvY3VzKGVsZW1lbnQ6IEhUTUxFbGVtZW50KSB7XG4gICAgcmV0dXJuIGVsZW1lbnQubWF0Y2hlcygnOmZvY3VzLXdpdGhpbicpIHx8IGVsZW1lbnQubWF0Y2hlcygnOmZvY3VzJyk7XG4gIH1cbn1cbiJdfQ==
@@ -0,0 +1,19 @@
1
+ // @dynamic
2
+ export class AXStringUtil {
3
+ static getWordBoundsAtPosition(str, position) {
4
+ const isSpace = (c) => /[^a-zA-Z0-9]+/i.test(c);
5
+ let start = position - 1;
6
+ while (start >= 0 && !isSpace(str[start])) {
7
+ start -= 1;
8
+ }
9
+ start = Math.max(0, start + 1);
10
+ const leftSideString = str.slice(start).match(/[a-zA-Z0-9]+/i);
11
+ start += leftSideString.index;
12
+ let end = start + leftSideString[0].length;
13
+ return {
14
+ start,
15
+ end,
16
+ };
17
+ }
18
+ }
19
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaW5nLXV0aWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdXRpbHMvc3JjL2xpYi9zdHJpbmctdXRpbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxXQUFXO0FBQ1gsTUFBTSxPQUFPLFlBQVk7SUFDdkIsTUFBTSxDQUFDLHVCQUF1QixDQUM1QixHQUFXLEVBQ1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dGFydCA9IHBvc2l0aW9uIC0gMTtcblxuICAgIHdoaWxlIChzdGFydCA+PSAwICYmICFpc1NwYWNlKHN0cltzdGFydF0pKSB7XG4gICAgICBzdGFydCAtPSAxO1xuICAgIH1cbiAgICBzdGFydCA9IE1hdGgubWF4KDAsIHN0YXJ0ICsgMSk7XG4gICAgY29uc3QgbGVmdFNpZGVTdHJpbmc6IGFueSA9IHN0ci5zbGljZShzdGFydCkubWF0Y2goL1thLXpBLVowLTldKy9pKTtcbiAgICBzdGFydCArPSBsZWZ0U2lkZVN0cmluZy5pbmRleDtcbiAgICBsZXQgZW5kID0gc3RhcnQgKyBsZWZ0U2lkZVN0cmluZ1swXS5sZW5ndGg7XG4gICAgcmV0dXJuIHtcbiAgICAgIHN0YXJ0LFxuICAgICAgZW5kLFxuICAgIH07XG4gIH1cbn1cbiJdfQ==
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNvcmV4LWNvcmUtdmFsaWRhdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS92YWxpZGF0aW9uL3NyYy9hY29yZXgtY29yZS12YWxpZGF0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -0,0 +1,18 @@
1
+ export * from './lib/rules/callback-rule';
2
+ export * from './lib/rules/regex-rule';
3
+ export * from './lib/rules/required-rule';
4
+ //
5
+ export * from './lib/rules/length-rule';
6
+ export * from './lib/rules/maxlength-rule';
7
+ export * from './lib/rules/minlength-rule';
8
+ //
9
+ export * from './lib/rules/between-rule';
10
+ export * from './lib/rules/equal-rule';
11
+ export * from './lib/rules/greater-than';
12
+ export * from './lib/rules/less-than-rule';
13
+ //
14
+ export * from './lib/validation.config';
15
+ export * from './lib/validation.module';
16
+ export * from './lib/validation.service';
17
+ export * from './lib/validation.types';
18
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdmFsaWRhdGlvbi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsRUFBRTtBQUNGLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsY0FBYyw0QkFBNEIsQ0FBQztBQUMzQyxjQUFjLDRCQUE0QixDQUFDO0FBQzNDLEVBQUU7QUFDRixjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLDRCQUE0QixDQUFDO0FBQzNDLEVBQUU7QUFDRixjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLHdCQUF3QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9saWIvcnVsZXMvY2FsbGJhY2stcnVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9ydWxlcy9yZWdleC1ydWxlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3J1bGVzL3JlcXVpcmVkLXJ1bG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