@acorex/core 7.2.7 → 7.3.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 (50) hide show
  1. package/config/lib/configs.service.d.ts +2 -0
  2. package/esm2022/acorex-core.mjs +1 -1
  3. package/esm2022/config/lib/configs.service.mjs +18 -6
  4. package/esm2022/dateTime/lib/datetime.class.mjs +3 -3
  5. package/esm2022/dateTime/lib/datetime.module.mjs +4 -4
  6. package/esm2022/dateTime/lib/datetime.pipe.mjs +3 -3
  7. package/esm2022/events/lib/event.service.mjs +3 -3
  8. package/esm2022/file/lib/file.service.mjs +3 -3
  9. package/esm2022/http/lib/http.module.mjs +4 -4
  10. package/esm2022/http/lib/http.service.mjs +3 -3
  11. package/esm2022/image/lib/image.service.mjs +3 -3
  12. package/esm2022/index.mjs +1 -1
  13. package/esm2022/intl/acorex-core-intl.mjs +5 -0
  14. package/esm2022/intl/index.mjs +3 -0
  15. package/esm2022/intl/lib/numbers/number-format-options.mjs +10 -0
  16. package/esm2022/intl/lib/numbers/numbers-utils.mjs +39 -0
  17. package/esm2022/pipes/lib/pipes.module.mjs +4 -4
  18. package/esm2022/pipes/lib/safe.pipe.mjs +3 -3
  19. package/esm2022/platform/lib/platform.service.mjs +3 -3
  20. package/esm2022/translation/lib/translation.module.mjs +4 -4
  21. package/esm2022/translation/lib/translator.mjs +7 -7
  22. package/esm2022/translation/lib/translator.pipe.mjs +3 -3
  23. package/esm2022/utils/index.mjs +2 -1
  24. package/esm2022/utils/lib/auto-unsubscribe.mjs +36 -0
  25. package/esm2022/utils/lib/color-util.mjs +25 -34
  26. package/fesm2022/acorex-core-config.mjs +17 -5
  27. package/fesm2022/acorex-core-config.mjs.map +1 -1
  28. package/fesm2022/acorex-core-dateTime.mjs +9 -9
  29. package/fesm2022/acorex-core-dateTime.mjs.map +1 -1
  30. package/fesm2022/acorex-core-events.mjs +3 -3
  31. package/fesm2022/acorex-core-file.mjs +3 -3
  32. package/fesm2022/acorex-core-http.mjs +7 -7
  33. package/fesm2022/acorex-core-image.mjs +3 -3
  34. package/fesm2022/acorex-core-intl.mjs +54 -0
  35. package/fesm2022/acorex-core-intl.mjs.map +1 -0
  36. package/fesm2022/acorex-core-pipes.mjs +7 -7
  37. package/fesm2022/acorex-core-platform.mjs +3 -3
  38. package/fesm2022/acorex-core-translation.mjs +13 -13
  39. package/fesm2022/acorex-core-translation.mjs.map +1 -1
  40. package/fesm2022/acorex-core-utils.mjs +61 -34
  41. package/fesm2022/acorex-core-utils.mjs.map +1 -1
  42. package/fesm2022/acorex-core.mjs.map +1 -1
  43. package/intl/README.md +3 -0
  44. package/intl/index.d.ts +2 -0
  45. package/intl/lib/numbers/number-format-options.d.ts +7 -0
  46. package/intl/lib/numbers/numbers-utils.d.ts +3 -0
  47. package/package.json +16 -11
  48. package/utils/index.d.ts +1 -0
  49. package/utils/lib/auto-unsubscribe.d.ts +12 -0
  50. package/utils/lib/color-util.d.ts +2 -2
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Pipe, NgModule } from '@angular/core';
3
- import { Subject } from 'rxjs';
3
+ import { get } from 'lodash-es';
4
4
  import merge from 'lodash-es/merge';
5
- import * as _ from 'lodash';
5
+ import { Subject } from 'rxjs';
6
6
 
7
7
  // @dynamic
8
8
  class AXTranslator {
@@ -27,20 +27,20 @@ class AXTranslator {
27
27
  static get(key, arg1, arg2) {
28
28
  const lang = arg1 && typeof arg1 == 'string' ? arg1 : AXTranslator.lang;
29
29
  const params = arg1 && typeof arg1 == 'object' ? arg1 : arg2;
30
- let result = _.get(AXTranslator[`__data__${lang}`], key, key);
31
- const vars = typeof (result) == 'string' ? result?.match(this._varsRegx) : [];
30
+ let result = get(AXTranslator[`__data__${lang}`], key, key);
31
+ const vars = typeof result == 'string' ? result?.match(this._varsRegx) : [];
32
32
  if (vars?.length) {
33
33
  vars.forEach((v) => {
34
34
  const varKey = v.match(this._varNameRegx)?.length ? v.match(this._varNameRegx)[0] : null;
35
35
  if (varKey) {
36
- const p = _.get(params, varKey) || this.get(varKey, lang);
36
+ const p = get(params, varKey) || this.get(varKey, lang);
37
37
  if (p) {
38
38
  result = result.replace(v, p);
39
39
  }
40
40
  }
41
41
  });
42
42
  }
43
- return typeof (result) == 'string' ? result : JSON.stringify(result);
43
+ return typeof result == 'string' ? result : JSON.stringify(result);
44
44
  }
45
45
  }
46
46
 
@@ -48,20 +48,20 @@ class AXTranslatorPipe {
48
48
  transform(value, arg1, arg2) {
49
49
  return AXTranslator.get(value, arg1, arg2);
50
50
  }
51
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: AXTranslatorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
52
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.5", ngImport: i0, type: AXTranslatorPipe, name: "trans" }); }
51
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: AXTranslatorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
52
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: AXTranslatorPipe, name: "trans" }); }
53
53
  }
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: AXTranslatorPipe, decorators: [{
54
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: AXTranslatorPipe, decorators: [{
55
55
  type: Pipe,
56
56
  args: [{ name: 'trans', pure: true }]
57
57
  }] });
58
58
 
59
59
  class AXTranslationModule {
60
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: AXTranslationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
61
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.5", ngImport: i0, type: AXTranslationModule, declarations: [AXTranslatorPipe], exports: [AXTranslatorPipe] }); }
62
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: AXTranslationModule }); }
60
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: AXTranslationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
61
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: AXTranslationModule, declarations: [AXTranslatorPipe], exports: [AXTranslatorPipe] }); }
62
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: AXTranslationModule }); }
63
63
  }
64
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: AXTranslationModule, decorators: [{
64
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: AXTranslationModule, decorators: [{
65
65
  type: NgModule,
66
66
  args: [{
67
67
  imports: [],
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-translation.mjs","sources":["../../../../libs/core/translation/src/lib/translator.ts","../../../../libs/core/translation/src/lib/translator.pipe.ts","../../../../libs/core/translation/src/lib/translation.module.ts","../../../../libs/core/translation/src/acorex-core-translation.ts"],"sourcesContent":["import { Subject, Observable } from 'rxjs';\nimport merge from 'lodash-es/merge';\nimport * as _ from 'lodash';\n\n// @dynamic\nexport class AXTranslator {\n private static lang: string = 'en';\n private static dataChangeSubject = new Subject<any>();\n private static _varsRegx = /((\\$\\{[a-zA-Z_0-9\\.]+\\})+)/gm;\n private static _varNameRegx = /[a-zA-Z_0-9\\.]+/gm;\n\n\n static get onChange(): Observable<any> {\n return AXTranslator.dataChangeSubject.asObservable();\n }\n\n public static load(lang: string, value: any) {\n if (typeof value === 'object') {\n if (!AXTranslator[`__data__${lang}`]) {\n AXTranslator[`__data__${lang}`] = {};\n }\n AXTranslator[`__data__${lang}`] = merge(AXTranslator[`__data__${lang}`], value);\n }\n }\n\n public static use(lang: string) {\n AXTranslator.lang = lang;\n }\n\n public static get(key: string, arg1?: object | string, arg2?: object): string {\n\n const lang = arg1 && typeof arg1 == 'string' ? arg1 : AXTranslator.lang;\n const params = arg1 && typeof arg1 == 'object' ? arg1 : arg2;\n let result = _.get(AXTranslator[`__data__${lang}`], key, key);\n const vars = typeof (result) == 'string' ? result?.match(this._varsRegx) : [];\n if (vars?.length) {\n vars.forEach((v:any) => {\n const varKey = v.match(this._varNameRegx)?.length ? v.match(this._varNameRegx)[0] : null;\n if (varKey) {\n const p = _.get(params, varKey) || this.get(varKey, lang);\n if (p) {\n result = result.replace(v, p);\n }\n }\n })\n }\n return typeof (result) == 'string' ? result : JSON.stringify(result);\n }\n}","import { Pipe, PipeTransform } from '@angular/core';\nimport { AXTranslator } from './translator';\n\n@Pipe({ name: 'trans', pure: true })\nexport class AXTranslatorPipe implements PipeTransform {\n transform(value: string, arg1?: object | string, arg2?: object): string {\n return AXTranslator.get(value, arg1, arg2);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { AXTranslatorPipe } from './translator.pipe';\n\n@NgModule({\n imports: [],\n exports: [AXTranslatorPipe],\n declarations: [AXTranslatorPipe],\n providers: [],\n})\nexport class AXTranslationModule {\n \n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAIA;MACa,YAAY,CAAA;aACN,IAAI,CAAA,IAAA,GAAW,IAAI,CAAC,EAAA;AACpB,IAAA,SAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,OAAO,EAAO,CAAC,EAAA;aACvC,IAAS,CAAA,SAAA,GAAG,8BAA8B,CAAC,EAAA;aAC3C,IAAY,CAAA,YAAA,GAAG,mBAAmB,CAAC,EAAA;AAGl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,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GAAnB,mBAAmB,EAAA,YAAA,EAAA,CAHb,gBAAgB,CAAA,EAAA,OAAA,EAAA,CADrB,gBAAgB,CAAA,EAAA,CAAA,CAAA,EAAA;+GAIjB,mBAAmB,EAAA,CAAA,CAAA,EAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAN/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,EAAE;oBACX,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,SAAS,EAAE,EAAE;AAChB,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-translation.mjs","sources":["../../../../libs/core/translation/src/lib/translator.ts","../../../../libs/core/translation/src/lib/translator.pipe.ts","../../../../libs/core/translation/src/lib/translation.module.ts","../../../../libs/core/translation/src/acorex-core-translation.ts"],"sourcesContent":["import { get } from 'lodash-es';\nimport merge from 'lodash-es/merge';\nimport { Observable, Subject } from 'rxjs';\n\n// @dynamic\nexport class AXTranslator {\n private static lang: string = 'en';\n private static dataChangeSubject = new Subject<any>();\n private static _varsRegx = /((\\$\\{[a-zA-Z_0-9\\.]+\\})+)/gm;\n private static _varNameRegx = /[a-zA-Z_0-9\\.]+/gm;\n\n static get onChange(): Observable<any> {\n return AXTranslator.dataChangeSubject.asObservable();\n }\n\n public static load(lang: string, value: any) {\n if (typeof value === 'object') {\n if (!AXTranslator[`__data__${lang}`]) {\n AXTranslator[`__data__${lang}`] = {};\n }\n AXTranslator[`__data__${lang}`] = merge(AXTranslator[`__data__${lang}`], value);\n }\n }\n\n public static use(lang: string) {\n AXTranslator.lang = lang;\n }\n\n public static get(key: string, arg1?: object | string, arg2?: object): string {\n const lang = arg1 && typeof arg1 == 'string' ? arg1 : AXTranslator.lang;\n const params = arg1 && typeof arg1 == 'object' ? arg1 : arg2;\n let result = get(AXTranslator[`__data__${lang}`], key, key);\n const vars = typeof result == 'string' ? result?.match(this._varsRegx) : [];\n if (vars?.length) {\n vars.forEach((v: any) => {\n const varKey = v.match(this._varNameRegx)?.length ? v.match(this._varNameRegx)[0] : null;\n if (varKey) {\n const p = get(params, varKey) || this.get(varKey, lang);\n if (p) {\n result = result.replace(v, p);\n }\n }\n });\n }\n return typeof result == 'string' ? result : JSON.stringify(result);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { AXTranslator } from './translator';\n\n@Pipe({ name: 'trans', pure: true })\nexport class AXTranslatorPipe implements PipeTransform {\n transform(value: string, arg1?: object | string, arg2?: object): string {\n return AXTranslator.get(value, arg1, arg2);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { AXTranslatorPipe } from './translator.pipe';\n\n@NgModule({\n imports: [],\n exports: [AXTranslatorPipe],\n declarations: [AXTranslatorPipe],\n providers: [],\n})\nexport class AXTranslationModule {\n \n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAIA;MACa,YAAY,CAAA;aACR,IAAI,CAAA,IAAA,GAAW,IAAI,CAAC,EAAA;AACpB,IAAA,SAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,OAAO,EAAO,CAAC,EAAA;aACvC,IAAS,CAAA,SAAA,GAAG,8BAA8B,CAAC,EAAA;aAC3C,IAAY,CAAA,YAAA,GAAG,mBAAmB,CAAC,EAAA;AAElD,IAAA,WAAW,QAAQ,GAAA;AACjB,QAAA,OAAO,YAAY,CAAC,iBAAiB,CAAC,YAAY,EAAE,CAAC;KACtD;AAEM,IAAA,OAAO,IAAI,CAAC,IAAY,EAAE,KAAU,EAAA;AACzC,QAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,YAAA,IAAI,CAAC,YAAY,CAAC,WAAW,IAAI,CAAA,CAAE,CAAC,EAAE;AACpC,gBAAA,YAA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O,EAAE,EAAE;oBACX,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,SAAS,EAAE,EAAE;AAChB,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
@@ -1,12 +1,47 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+ import { Subject, takeUntil } from 'rxjs';
1
4
  import tinycolor from 'tinycolor2';
2
5
  import tinygradient from 'tinygradient';
3
6
 
7
+ function AXAutoUnsubscriber() {
8
+ return function (constructor) {
9
+ const orig = constructor.prototype.ngOnDestroy;
10
+ constructor.prototype.ngOnDestroy = function () {
11
+ for (const prop in this) {
12
+ const property = this[prop];
13
+ if (typeof property.subscribe === 'function') {
14
+ property.unsubscribe();
15
+ }
16
+ }
17
+ orig.apply();
18
+ };
19
+ };
20
+ }
21
+ class AXUnsubscriber {
22
+ constructor() {
23
+ this._destroy$ = new Subject();
24
+ this.takeUntilDestroy = (origin) => origin.pipe(takeUntil(this._destroy$));
25
+ }
26
+ unsubscribe() {
27
+ this._destroy$.next();
28
+ this._destroy$.complete();
29
+ }
30
+ ngOnDestroy() {
31
+ this.unsubscribe();
32
+ }
33
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: AXUnsubscriber, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
34
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: AXUnsubscriber }); }
35
+ }
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: AXUnsubscriber, decorators: [{
37
+ type: Injectable
38
+ }] });
39
+
4
40
  class AXColorUtil {
5
41
  static to(color, mode) {
6
42
  const _color = tinycolor(color);
7
43
  switch (mode) {
8
44
  case 'rgba':
9
- ;
10
45
  return _color.toRgb();
11
46
  case 'hsla':
12
47
  return _color.toHsl();
@@ -16,7 +51,6 @@ class AXColorUtil {
16
51
  return _color.toHex();
17
52
  }
18
53
  }
19
- ;
20
54
  static toString(color, mode = null) {
21
55
  const _color = tinycolor(color);
22
56
  switch (mode) {
@@ -26,48 +60,41 @@ class AXColorUtil {
26
60
  return _color.toHslString();
27
61
  case 'hsva':
28
62
  return _color.toHsvString();
29
- case 'hsva':
30
- return _color.toHsvString();
31
- case 'hex':
32
- {
33
- const rgba = _color.toRgb();
34
- return rgba.a != 1 ? _color.toHex8String() : _color.toHexString();
63
+ case 'hex': {
64
+ const rgba = _color.toRgb();
65
+ return rgba.a != 1 ? _color.toHex8String() : _color.toHexString();
66
+ }
67
+ default: {
68
+ if (typeof color == 'string') {
69
+ if (color.toLowerCase().startsWith('#'))
70
+ return this.toString(color, 'hex');
71
+ else
72
+ return this.toString(color, 'rgba');
35
73
  }
36
- default:
37
- {
38
- if (typeof color == 'string') {
39
- if (color.toLowerCase().startsWith("#"))
40
- return this.toString(color, "hex");
41
- else
42
- return this.toString(color, "rgba");
43
- }
44
- else {
45
- return this.toString(color, "rgba");
46
- }
74
+ else {
75
+ return this.toString(color, 'rgba');
47
76
  }
77
+ }
48
78
  }
49
79
  }
50
- ;
51
80
  static isValid(color) {
52
81
  const _color = tinycolor(color);
53
82
  return _color.isValid();
54
83
  }
55
- ;
56
84
  static mix(baseColor, hex, percentage) {
57
85
  return tinycolor.mix(baseColor, hex, percentage).toString('rgb');
58
86
  }
59
87
  static multiply(color1, color2) {
60
- let rgb1 = tinycolor(color1).toRgb();
61
- let rgb2 = tinycolor(color2).toRgb();
62
- rgb1.b = Math.floor(rgb1.b * rgb2.b / 255);
63
- rgb1.g = Math.floor(rgb1.g * rgb2.g / 255);
64
- rgb1.r = Math.floor(rgb1.r * rgb2.r / 255);
88
+ const rgb1 = tinycolor(color1).toRgb();
89
+ const rgb2 = tinycolor(color2).toRgb();
90
+ rgb1.b = Math.floor((rgb1.b * rgb2.b) / 255);
91
+ rgb1.g = Math.floor((rgb1.g * rgb2.g) / 255);
92
+ rgb1.r = Math.floor((rgb1.r * rgb2.r) / 255);
65
93
  return tinycolor('rgb ' + rgb1.r + ' ' + rgb1.g + ' ' + rgb1.b).toString('rgb');
66
94
  }
67
95
  static contrastToWhite(color) {
68
- return tinycolor.readability("#fff", color);
96
+ return tinycolor.readability('#fff', color);
69
97
  }
70
- ;
71
98
  static lighten(hex, percentage) {
72
99
  return tinycolor(hex).lighten(percentage);
73
100
  }
@@ -98,18 +125,18 @@ class AXColorUtil {
98
125
  let rgb = [
99
126
  X * 1.656492 - Y * 0.354851 - Z * 0.255038,
100
127
  -X * 0.707196 + Y * 1.655397 + Z * 0.036152,
101
- X * 0.051713 - Y * 0.121364 + Z * 1.011530
128
+ X * 0.051713 - Y * 0.121364 + Z * 1.01153,
102
129
  ];
103
130
  // Apply reverse gamma correction.
104
- rgb = rgb.map(x => x <= 0.0031308 ? 12.92 * x : (1.0 + 0.055) * Math.pow(x, 1.0 / 2.4) - 0.055);
131
+ rgb = rgb.map((x) => x <= 0.0031308 ? 12.92 * x : (1.0 + 0.055) * Math.pow(x, 1.0 / 2.4) - 0.055);
105
132
  // Bring all negative components to zero.
106
- rgb = rgb.map(x => Math.max(0, x));
133
+ rgb = rgb.map((x) => Math.max(0, x));
107
134
  // If one component is greater than 1, weight components by that value.
108
135
  const max = Math.max(...rgb);
109
136
  if (max > 1) {
110
- rgb = rgb.map(x => x / max);
137
+ rgb = rgb.map((x) => x / max);
111
138
  }
112
- rgb = rgb.map(x => Math.round(x * 255));
139
+ rgb = rgb.map((x) => Math.round(x * 255));
113
140
  return 'rgb(' + rgb.join(',') + ')';
114
141
  }
115
142
  }
@@ -221,5 +248,5 @@ class AXStringUtil {
221
248
  * Generated bundle index. Do not edit.
222
249
  */
223
250
 
224
- export { AXColorUtil, AXDrawingUtil, AXHtmlUtil, AXObjectUtil, AXStringUtil };
251
+ export { AXAutoUnsubscriber, AXColorUtil, AXDrawingUtil, AXHtmlUtil, AXObjectUtil, AXStringUtil, AXUnsubscriber };
225
252
  //# sourceMappingURL=acorex-core-utils.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-utils.mjs","sources":["../../../../libs/core/utils/src/lib/color-util.ts","../../../../libs/core/utils/src/lib/drawing-util.ts","../../../../libs/core/utils/src/lib/html-util.ts","../../../../libs/core/utils/src/lib/object-util.ts","../../../../libs/core/utils/src/lib/string-util.ts","../../../../libs/core/utils/src/acorex-core-utils.ts"],"sourcesContent":["export type AXColorMode = 'rgba' | 'hex' | 'hsla' | 'hsva';\n\nimport tinycolor, { ColorInput } from 'tinycolor2';\nimport tinygradient from 'tinygradient'\n\nexport type AXColorFormat = ColorInput;\n\nexport class AXColorUtil {\n\n\n static to(color: AXColorFormat, mode: AXColorMode): AXColorFormat {\n\n const _color = tinycolor(color)\n switch (mode) {\n case 'rgba': ;\n return _color.toRgb();\n case 'hsla':\n return _color.toHsl();\n case 'hsva':\n return _color.toHsv();\n default:\n return _color.toHex();\n }\n };\n\n static toString(color: AXColorFormat, mode: AXColorMode = null): string {\n const _color = tinycolor(color)\n switch (mode) {\n case 'rgba':\n return _color.toRgbString();\n case 'hsla':\n return _color.toHslString();\n case 'hsva':\n return _color.toHsvString();\n case 'hsva':\n return _color.toHsvString();\n case 'hex':\n {\n const rgba = _color.toRgb();\n return rgba.a != 1 ? _color.toHex8String() : _color.toHexString();\n }\n default:\n {\n if (typeof color == 'string') {\n if (color.toLowerCase().startsWith(\"#\"))\n return this.toString(color, \"hex\");\n else\n return this.toString(color, \"rgba\");\n }\n else {\n return this.toString(color, \"rgba\");\n }\n }\n }\n };\n\n static isValid(color: AXColorFormat): boolean {\n const _color = tinycolor(color)\n return _color.isValid();\n };\n\n static mix(baseColor: AXColorFormat, hex: AXColorFormat, percentage: number): string {\n return tinycolor.mix(baseColor, hex, percentage).toString('rgb');\n }\n\n static multiply(color1: AXColorFormat, color2: AXColorFormat): string {\n let rgb1 = tinycolor(color1).toRgb();\n let rgb2 = tinycolor(color2).toRgb();\n rgb1.b = Math.floor(rgb1.b * rgb2.b / 255);\n rgb1.g = Math.floor(rgb1.g * rgb2.g / 255);\n rgb1.r = Math.floor(rgb1.r * rgb2.r / 255);\n return tinycolor('rgb ' + rgb1.r + ' ' + rgb1.g + ' ' + rgb1.b).toString('rgb');\n }\n\n static contrastToWhite(color: AXColorFormat): number {\n return tinycolor.readability(\"#fff\", color);\n };\n\n static lighten(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).lighten(percentage)\n }\n\n static darken(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).darken(percentage)\n }\n\n static brighten(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).brighten(percentage)\n }\n\n static saturate(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).saturate(percentage)\n }\n\n static desaturate(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).getLuminance()\n }\n\n static equal(color1: AXColorFormat, color2: AXColorFormat): boolean {\n return tinycolor.equals(color1, color2);\n }\n\n static gradient(values: any[] | { color: any, pos: number }[]): tinygradient.Instance {\n return tinygradient([...values])\n }\n\n static xyToRgb(vX, vY): string {\n vY = vY || 0.00000000001;\n const Y = 1;\n const X = (Y / vY) * vX;\n const Z = (Y / vY) * (1 - vX - vY);\n\n // Convert to RGB using Wide RGB D65 conversion.\n let rgb = [\n X * 1.656492 - Y * 0.354851 - Z * 0.255038,\n -X * 0.707196 + Y * 1.655397 + Z * 0.036152,\n X * 0.051713 - Y * 0.121364 + Z * 1.011530\n ];\n\n // Apply reverse gamma correction.\n rgb = rgb.map(x =>\n x <= 0.0031308 ? 12.92 * x : (1.0 + 0.055) * Math.pow(x, 1.0 / 2.4) - 0.055\n );\n\n // Bring all negative components to zero.\n rgb = rgb.map(x => Math.max(0, x));\n\n // If one component is greater than 1, weight components by that value.\n const max = Math.max(...rgb);\n if (max > 1) {\n rgb = rgb.map(x => x / max);\n }\n\n rgb = rgb.map(x => Math.round(x * 255));\n\n return 'rgb(' + rgb.join(',') + ')';\n }\n\n}","export interface AXPoint {\n x: number;\n y: number;\n}\n\nexport interface AXBoundingClientRect {\n left?: number;\n top?: number;\n width?: number;\n height?: number;\n bottom?: number;\n right?: number;\n}\n// @dynamic\nexport class AXDrawingUtil {\n static collision(a: HTMLElement, b: HTMLElement): boolean {\n const ac = a.getBoundingClientRect();\n const bc = b.getBoundingClientRect();\n\n if (ac.left < bc.left + bc.width && ac.left + ac.width > bc.left && ac.top < bc.top + bc.height && ac.top + ac.height > bc.top) {\n return true;\n } else {\n return false;\n }\n }\n\n static isInElementBound(pos: AXPoint, element: HTMLElement): boolean {\n const elBound = element.getBoundingClientRect();\n return AXDrawingUtil.isInRecPoint(pos, {\n left: elBound.x,\n width: elBound.width,\n top: elBound.y,\n height: elBound.height,\n });\n }\n\n static isInRecPoint(pos: AXPoint, rec: AXBoundingClientRect | any): boolean {\n return pos.x >= rec.left && pos.x <= rec.left + rec.width && pos.y >= rec.top && pos.y <= rec.top + rec.height;\n }\n\n static convertRemToPixels(rem: number): number {\n return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);\n }\n}\n","// @dynamic\nexport class AXHtmlUtil {\n static focusElement(element: HTMLElement): HTMLElement {\n const list = ['button', 'input', '[href]', 'select', 'textarea', '[tabindex]'].map(c => c + ':not([tabindex=\"-1\"])');\n const focusable = element.querySelector<HTMLElement>(list.join(', '));\n if (focusable) {\n focusable.focus();\n return focusable;\n }\n return null;\n }\n\n\n static hasFocus(element: HTMLElement)\n {\n return element.matches(':focus-within') || element.matches(':focus');\n }\n}","// @dynamic\nexport class AXObjectUtil {\n static deepJSONClone(obj: any): any {\n return obj ? JSON.parse(JSON.stringify(obj)) : null;\n }\n\n static deepCopy(obj) {\n let copy;\n // Handle the 3 simple types, and null or undefined\n if (null == obj || 'object' !== typeof obj) { return obj; }\n // Handle Date\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n // Handle Array\n if (obj instanceof Array) {\n copy = [];\n for (let i = 0, len = obj.length; i < len; i++) {\n copy[i] = AXObjectUtil.deepCopy(obj[i]);\n }\n return copy;\n }\n // Handle Object\n if (obj instanceof Object) {\n copy = {};\n for (const attr in obj) {\n if (obj.hasOwnProperty(attr)) { copy[attr] = AXObjectUtil.deepCopy(obj[attr]); }\n }\n return copy;\n }\n throw new Error('Unable to copy obj! Its type isn\\'t supported.');\n }\n\n // static fetchProp(obj, prop: string) {\n // if (typeof obj === 'undefined') {\n // return false;\n // }\n // const index = prop.indexOf('.');\n\n // if (index > -1) {\n // return AXObjectUtil.fetchProp(obj[prop.substring(0, index)], prop.substr(index + 1));\n // }\n\n // return obj[prop];\n // }\n\n // static getPropByPath(obj, path, defaultVal?) {\n // path = path\n // .replace(/\\[/g, '.')\n // .replace(/]/g, '')\n // .split('.');\n\n // path.forEach((level) => {\n // if (obj) {\n // obj = obj[level];\n // }\n // });\n\n // if (obj === undefined) {\n // return defaultVal;\n // }\n // return obj;\n // }\n\n // static setPropByPath(obj, path, value) {\n // if (Object(obj) !== obj) { return obj; } // When obj is not an object\n // // If not yet an array, get the keys from the string-path\n // if (!Array.isArray(path)) { path = path.toString().match(/[^.[\\]]+/g) || []; }\n // path.slice(0, -1).reduce((a, c, i) => // Iterate all of them except the last one\n // Object(a[c]) === a[c] // Does the key exist and is its value an object?\n // // Yes: then follow that path\n // ? a[c]\n // // No: create the key. Is the next key a potential array-index?\n // : a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1]\n // ? [] // Yes: assign a new array object\n // : {}, // No: assign a new plain object\n // obj)[path[path.length - 1]] = value; // Finally assign the value to the last key\n // return obj; // Return the top-level object to allow chaining\n // }\n}","// @dynamic\nexport class AXStringUtil {\n\n static getWordBoundsAtPosition(str: string, position: number): { start: number, end: number } {\n const isSpace = (c) => /[^a-zA-Z0-9]+/i.test(c);\n let start = position - 1;\n\n while (start >= 0 && !isSpace(str[start])) {\n start -= 1;\n }\n start = Math.max(0, start + 1);\n const leftSideString:any = str.slice(start).match(/[a-zA-Z0-9]+/i);\n start += leftSideString.index;\n let end = start + leftSideString[0].length;\n return {\n start,\n end\n };\n }\n\n\n\n\n\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAOa,WAAW,CAAA;AAGpB,IAAA,OAAO,EAAE,CAAC,KAAoB,EAAE,IAAiB,EAAA;AAE7C,QAAA,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AAC/B,QAAA,QAAQ,IAAI;AACR,YAAA,KAAK,MAAM;gBAAE,CAAC;AACV,gBAAA,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;AAC1B,YAAA,KAAK,MAAM;AACP,gBAAA,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;AAC1B,YAAA,KAAK,MAAM;AACP,gBAAA,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;AAC1B,YAAA;AACI,gBAAA,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;AAC7B,SAAA;KACJ;;AAED,IAAA,OAAO,QAAQ,CAAC,KAAoB,EAAE,OAAoB,IAAI,EAAA;AAC1D,QAAA,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AAC/B,QAAA,QAAQ,IAAI;AACR,YAAA,KAAK,MAAM;AACP,gBAAA,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;AAChC,YAAA,KAAK,MAAM;AACP,gBAAA,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;AAChC,YAAA,KAAK,MAAM;AACP,gBAAA,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;AAChC,YAAA,KAAK,MAAM;AACP,gBAAA,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;AAChC,YAAA,KAAK,KAAK;AACN,gBAAA;AACI,oBAAA,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;AAC5B,oBAAA,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,MAA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,CAAC,GAAW,EAAE,QAAgB,EAAA;AACxD,QAAA,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAChD,QAAA,IAAI,KAAK,GAAG,QAAQ,GAAG,CAAC,CAAC;AAEzB,QAAA,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YACvC,KAAK,IAAI,CAAC,CAAC;AACd,SAAA;QACD,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AAC/B,QAAA,MAAM,cAAc,GAAO,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;AACnE,QAAA,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC;QAC9B,IAAI,GAAG,GAAG,KAAK,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC3C,OAAO;YACH,KAAK;YACL,GAAG;SACN,CAAC;KACL;AAMJ;;ACxBD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-utils.mjs","sources":["../../../../libs/core/utils/src/lib/auto-unsubscribe.ts","../../../../libs/core/utils/src/lib/color-util.ts","../../../../libs/core/utils/src/lib/drawing-util.ts","../../../../libs/core/utils/src/lib/html-util.ts","../../../../libs/core/utils/src/lib/object-util.ts","../../../../libs/core/utils/src/lib/string-util.ts","../../../../libs/core/utils/src/acorex-core-utils.ts"],"sourcesContent":["import { Injectable, OnDestroy } from '@angular/core';\nimport { Observable, Subject, takeUntil } from 'rxjs';\n\nexport function AXAutoUnsubscriber() {\n return function (constructor) {\n const orig = constructor.prototype.ngOnDestroy;\n constructor.prototype.ngOnDestroy = function () {\n for (const prop in this) {\n const property = this[prop];\n if (typeof property.subscribe === 'function') {\n property.unsubscribe();\n }\n }\n orig.apply();\n };\n };\n}\n\n@Injectable()\nexport class AXUnsubscriber implements OnDestroy {\n private readonly _destroy$ = new Subject<void>();\n\n public readonly takeUntilDestroy = <T>(origin: Observable<T>): Observable<T> =>\n origin.pipe(takeUntil(this._destroy$));\n\n public unsubscribe(): void {\n this._destroy$.next();\n this._destroy$.complete();\n }\n\n public ngOnDestroy(): void {\n this.unsubscribe();\n }\n}\n","export type AXColorMode = 'rgba' | 'hex' | 'hsla' | 'hsva';\n\nimport tinycolor, { ColorInput } from 'tinycolor2';\nimport tinygradient, { Instance } from 'tinygradient';\n\nexport type AXColorFormat = ColorInput;\n\nexport class AXColorUtil {\n static to(color: AXColorFormat, mode: AXColorMode): AXColorFormat {\n const _color = tinycolor(color);\n switch (mode) {\n case 'rgba':\n return _color.toRgb();\n case 'hsla':\n return _color.toHsl();\n case 'hsva':\n return _color.toHsv();\n default:\n return _color.toHex();\n }\n }\n\n static toString(color: AXColorFormat, mode: AXColorMode = null): string {\n const _color = tinycolor(color);\n switch (mode) {\n case 'rgba':\n return _color.toRgbString();\n case 'hsla':\n return _color.toHslString();\n case 'hsva':\n return _color.toHsvString();\n\n case 'hex': {\n const rgba = _color.toRgb();\n return rgba.a != 1 ? _color.toHex8String() : _color.toHexString();\n }\n default: {\n if (typeof color == 'string') {\n if (color.toLowerCase().startsWith('#')) return this.toString(color, 'hex');\n else return this.toString(color, 'rgba');\n } else {\n return this.toString(color, 'rgba');\n }\n }\n }\n }\n\n static isValid(color: AXColorFormat): boolean {\n const _color = tinycolor(color);\n return _color.isValid();\n }\n\n static mix(baseColor: AXColorFormat, hex: AXColorFormat, percentage: number): string {\n return tinycolor.mix(baseColor, hex, percentage).toString('rgb');\n }\n\n static multiply(color1: AXColorFormat, color2: AXColorFormat): string {\n const rgb1 = tinycolor(color1).toRgb();\n const rgb2 = tinycolor(color2).toRgb();\n rgb1.b = Math.floor((rgb1.b * rgb2.b) / 255);\n rgb1.g = Math.floor((rgb1.g * rgb2.g) / 255);\n rgb1.r = Math.floor((rgb1.r * rgb2.r) / 255);\n return tinycolor('rgb ' + rgb1.r + ' ' + rgb1.g + ' ' + rgb1.b).toString('rgb');\n }\n\n static contrastToWhite(color: AXColorFormat): number {\n return tinycolor.readability('#fff', color);\n }\n\n static lighten(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).lighten(percentage);\n }\n\n static darken(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).darken(percentage);\n }\n\n static brighten(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).brighten(percentage);\n }\n\n static saturate(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).saturate(percentage);\n }\n\n static desaturate(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).getLuminance();\n }\n\n static equal(color1: AXColorFormat, color2: AXColorFormat): boolean {\n return tinycolor.equals(color1, color2);\n }\n\n static gradient(values: any[] | { color: any; pos: number }[]): Instance {\n return tinygradient([...values]);\n }\n\n static xyToRgb(vX, vY): string {\n vY = vY || 0.00000000001;\n const Y = 1;\n const X = (Y / vY) * vX;\n const Z = (Y / vY) * (1 - vX - vY);\n\n // Convert to RGB using Wide RGB D65 conversion.\n let rgb = [\n X * 1.656492 - Y * 0.354851 - Z * 0.255038,\n -X * 0.707196 + Y * 1.655397 + Z * 0.036152,\n X * 0.051713 - Y * 0.121364 + Z * 1.01153,\n ];\n\n // Apply reverse gamma correction.\n rgb = rgb.map((x) =>\n x <= 0.0031308 ? 12.92 * x : (1.0 + 0.055) * Math.pow(x, 1.0 / 2.4) - 0.055\n );\n\n // Bring all negative components to zero.\n rgb = rgb.map((x) => Math.max(0, x));\n\n // If one component is greater than 1, weight components by that value.\n const max = Math.max(...rgb);\n if (max > 1) {\n rgb = rgb.map((x) => x / max);\n }\n\n rgb = rgb.map((x) => Math.round(x * 255));\n\n return 'rgb(' + rgb.join(',') + ')';\n }\n}\n","export interface AXPoint {\n x: number;\n y: number;\n}\n\nexport interface AXBoundingClientRect {\n left?: number;\n top?: number;\n width?: number;\n height?: number;\n bottom?: number;\n right?: number;\n}\n// @dynamic\nexport class AXDrawingUtil {\n static collision(a: HTMLElement, b: HTMLElement): boolean {\n const ac = a.getBoundingClientRect();\n const bc = b.getBoundingClientRect();\n\n if (ac.left < bc.left + bc.width && ac.left + ac.width > bc.left && ac.top < bc.top + bc.height && ac.top + ac.height > bc.top) {\n return true;\n } else {\n return false;\n }\n }\n\n static isInElementBound(pos: AXPoint, element: HTMLElement): boolean {\n const elBound = element.getBoundingClientRect();\n return AXDrawingUtil.isInRecPoint(pos, {\n left: elBound.x,\n width: elBound.width,\n top: elBound.y,\n height: elBound.height,\n });\n }\n\n static isInRecPoint(pos: AXPoint, rec: AXBoundingClientRect | any): boolean {\n return pos.x >= rec.left && pos.x <= rec.left + rec.width && pos.y >= rec.top && pos.y <= rec.top + rec.height;\n }\n\n static convertRemToPixels(rem: number): number {\n return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);\n }\n}\n","// @dynamic\nexport class AXHtmlUtil {\n static focusElement(element: HTMLElement): HTMLElement {\n const list = ['button', 'input', '[href]', 'select', 'textarea', '[tabindex]'].map(c => c + ':not([tabindex=\"-1\"])');\n const focusable = element.querySelector<HTMLElement>(list.join(', '));\n if (focusable) {\n focusable.focus();\n return focusable;\n }\n return null;\n }\n\n\n static hasFocus(element: HTMLElement)\n {\n return element.matches(':focus-within') || element.matches(':focus');\n }\n}","// @dynamic\nexport class AXObjectUtil {\n static deepJSONClone(obj: any): any {\n return obj ? JSON.parse(JSON.stringify(obj)) : null;\n }\n\n static deepCopy(obj) {\n let copy;\n // Handle the 3 simple types, and null or undefined\n if (null == obj || 'object' !== typeof obj) { return obj; }\n // Handle Date\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n // Handle Array\n if (obj instanceof Array) {\n copy = [];\n for (let i = 0, len = obj.length; i < len; i++) {\n copy[i] = AXObjectUtil.deepCopy(obj[i]);\n }\n return copy;\n }\n // Handle Object\n if (obj instanceof Object) {\n copy = {};\n for (const attr in obj) {\n if (obj.hasOwnProperty(attr)) { copy[attr] = AXObjectUtil.deepCopy(obj[attr]); }\n }\n return copy;\n }\n throw new Error('Unable to copy obj! Its type isn\\'t supported.');\n }\n\n // static fetchProp(obj, prop: string) {\n // if (typeof obj === 'undefined') {\n // return false;\n // }\n // const index = prop.indexOf('.');\n\n // if (index > -1) {\n // return AXObjectUtil.fetchProp(obj[prop.substring(0, index)], prop.substr(index + 1));\n // }\n\n // return obj[prop];\n // }\n\n // static getPropByPath(obj, path, defaultVal?) {\n // path = path\n // .replace(/\\[/g, '.')\n // .replace(/]/g, '')\n // .split('.');\n\n // path.forEach((level) => {\n // if (obj) {\n // obj = obj[level];\n // }\n // });\n\n // if (obj === undefined) {\n // return defaultVal;\n // }\n // return obj;\n // }\n\n // static setPropByPath(obj, path, value) {\n // if (Object(obj) !== obj) { return obj; } // When obj is not an object\n // // If not yet an array, get the keys from the string-path\n // if (!Array.isArray(path)) { path = path.toString().match(/[^.[\\]]+/g) || []; }\n // path.slice(0, -1).reduce((a, c, i) => // Iterate all of them except the last one\n // Object(a[c]) === a[c] // Does the key exist and is its value an object?\n // // Yes: then follow that path\n // ? a[c]\n // // No: create the key. Is the next key a potential array-index?\n // : a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1]\n // ? [] // Yes: assign a new array object\n // : {}, // No: assign a new plain object\n // obj)[path[path.length - 1]] = value; // Finally assign the value to the last key\n // return obj; // Return the top-level object to allow chaining\n // }\n}","// @dynamic\nexport class AXStringUtil {\n\n static getWordBoundsAtPosition(str: string, position: number): { start: number, end: number } {\n const isSpace = (c) => /[^a-zA-Z0-9]+/i.test(c);\n let start = position - 1;\n\n while (start >= 0 && !isSpace(str[start])) {\n start -= 1;\n }\n start = Math.max(0, start + 1);\n const leftSideString:any = str.slice(start).match(/[a-zA-Z0-9]+/i);\n start += leftSideString.index;\n let end = start + leftSideString[0].length;\n return {\n start,\n end\n };\n }\n\n\n\n\n\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './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C,CAAC;AACd,SAAA;QACD,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AAC/B,QAAA,MAAM,cAAc,GAAO,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;AACnE,QAAA,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC;QAC9B,IAAI,GAAG,GAAG,KAAK,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC3C,OAAO;YACH,KAAK;YACL,GAAG;SACN,CAAC;KACL;AAMJ;;ACxBD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core.mjs","sources":["../../../../libs/core/src/index.ts","../../../../libs/core/src/acorex-core.ts"],"sourcesContent":["export default {};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA,YAAe,EAAE;;ACAjB;;AAEG"}
1
+ {"version":3,"file":"acorex-core.mjs","sources":["../../../../libs/core/index.ts","../../../../libs/core/acorex-core.ts"],"sourcesContent":["export default {};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA,YAAe,EAAE;;ACAjB;;AAEG"}
package/intl/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @acorex/core/pipes
2
+
3
+ Secondary entry point of `@acorex/core`. It can be used by importing from `@acorex/core/pipes`.
@@ -0,0 +1,2 @@
1
+ export * from './lib/numbers/number-format-options';
2
+ export * from './lib/numbers/numbers-utils';
@@ -0,0 +1,7 @@
1
+ export declare class AXNumberFormatOptions {
2
+ scale: number;
3
+ thousandsSeparator?: string | null;
4
+ fractionalSeparator: string | null;
5
+ currency?: string | null;
6
+ style: 'currency' | 'percent' | 'number';
7
+ }
@@ -0,0 +1,3 @@
1
+ import { AXNumberFormatOptions } from "./number-format-options";
2
+ export declare const AXDefaultNumberOptions: AXNumberFormatOptions;
3
+ export declare function parseNumberOptions(input: string): AXNumberFormatOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex/core",
3
- "version": "7.2.7",
3
+ "version": "7.3.1",
4
4
  "sideEffects": false,
5
5
  "module": "fesm2022/acorex-core.mjs",
6
6
  "typings": "index.d.ts",
@@ -26,18 +26,18 @@
26
26
  "esm": "./esm2022/dateTime/acorex-core-dateTime.mjs",
27
27
  "default": "./fesm2022/acorex-core-dateTime.mjs"
28
28
  },
29
- "./events": {
30
- "types": "./events/index.d.ts",
31
- "esm2022": "./esm2022/events/acorex-core-events.mjs",
32
- "esm": "./esm2022/events/acorex-core-events.mjs",
33
- "default": "./fesm2022/acorex-core-events.mjs"
34
- },
35
29
  "./file": {
36
30
  "types": "./file/index.d.ts",
37
31
  "esm2022": "./esm2022/file/acorex-core-file.mjs",
38
32
  "esm": "./esm2022/file/acorex-core-file.mjs",
39
33
  "default": "./fesm2022/acorex-core-file.mjs"
40
34
  },
35
+ "./events": {
36
+ "types": "./events/index.d.ts",
37
+ "esm2022": "./esm2022/events/acorex-core-events.mjs",
38
+ "esm": "./esm2022/events/acorex-core-events.mjs",
39
+ "default": "./fesm2022/acorex-core-events.mjs"
40
+ },
41
41
  "./http": {
42
42
  "types": "./http/index.d.ts",
43
43
  "esm2022": "./esm2022/http/acorex-core-http.mjs",
@@ -50,6 +50,12 @@
50
50
  "esm": "./esm2022/image/acorex-core-image.mjs",
51
51
  "default": "./fesm2022/acorex-core-image.mjs"
52
52
  },
53
+ "./intl": {
54
+ "types": "./intl/index.d.ts",
55
+ "esm2022": "./esm2022/intl/acorex-core-intl.mjs",
56
+ "esm": "./esm2022/intl/acorex-core-intl.mjs",
57
+ "default": "./fesm2022/acorex-core-intl.mjs"
58
+ },
53
59
  "./pipes": {
54
60
  "types": "./pipes/index.d.ts",
55
61
  "esm2022": "./esm2022/pipes/acorex-core-pipes.mjs",
@@ -79,12 +85,11 @@
79
85
  "tslib": "^2.3.0"
80
86
  },
81
87
  "peerDependencies": {
82
- "@angular/core": "16.1.5",
88
+ "@angular/core": "16.1.7",
83
89
  "lodash-es": "4.17.21",
84
90
  "rxjs": "7.8.1",
85
- "lodash": "4.17.21",
86
- "@angular/common": "16.1.5",
87
- "@angular/platform-browser": "16.1.5",
91
+ "@angular/common": "16.1.7",
92
+ "@angular/platform-browser": "16.1.7",
88
93
  "tinycolor2": "1.6.0",
89
94
  "tinygradient": "1.1.5"
90
95
  }
package/utils/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './lib/auto-unsubscribe';
1
2
  export * from './lib/color-util';
2
3
  export * from './lib/drawing-util';
3
4
  export * from './lib/html-util';
@@ -0,0 +1,12 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ export declare function AXAutoUnsubscriber(): (constructor: any) => void;
5
+ export declare class AXUnsubscriber implements OnDestroy {
6
+ private readonly _destroy$;
7
+ readonly takeUntilDestroy: <T>(origin: Observable<T>) => Observable<T>;
8
+ unsubscribe(): void;
9
+ ngOnDestroy(): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXUnsubscriber, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXUnsubscriber>;
12
+ }
@@ -1,6 +1,6 @@
1
1
  export type AXColorMode = 'rgba' | 'hex' | 'hsla' | 'hsva';
2
2
  import tinycolor, { ColorInput } from 'tinycolor2';
3
- import tinygradient from 'tinygradient';
3
+ import { Instance } from 'tinygradient';
4
4
  export type AXColorFormat = ColorInput;
5
5
  export declare class AXColorUtil {
6
6
  static to(color: AXColorFormat, mode: AXColorMode): AXColorFormat;
@@ -18,6 +18,6 @@ export declare class AXColorUtil {
18
18
  static gradient(values: any[] | {
19
19
  color: any;
20
20
  pos: number;
21
- }[]): tinygradient.Instance;
21
+ }[]): Instance;
22
22
  static xyToRgb(vX: any, vY: any): string;
23
23
  }