@acorex/core 6.0.0 → 6.0.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 (169) hide show
  1. package/.browserslistrc +16 -0
  2. package/config/ax-preset.js +186 -0
  3. package/config/index.ts +1 -0
  4. package/config/ng-package.json +6 -0
  5. package/config/public-api.ts +1 -0
  6. package/config/src/configs.ts +37 -0
  7. package/dateTime/index.ts +1 -0
  8. package/dateTime/ng-package.json +6 -0
  9. package/dateTime/{public-api.d.ts → public-api.ts} +1 -1
  10. package/dateTime/src/datetime.class.ts +452 -0
  11. package/dateTime/src/datetime.module.ts +29 -0
  12. package/dateTime/src/datetime.pipe.ts +21 -0
  13. package/dateTime/src/georgian.calendar.ts +205 -0
  14. package/dateTime/src/jalali.calendar.ts +416 -0
  15. package/events/index.ts +1 -0
  16. package/events/ng-package.json +6 -0
  17. package/events/public-api.ts +1 -0
  18. package/events/src/event.service.ts +31 -0
  19. package/http/index.ts +1 -0
  20. package/http/ng-package.json +6 -0
  21. package/http/{public-api.d.ts → public-api.ts} +1 -1
  22. package/http/src/{http-error.class.d.ts → http-error.class.ts} +2 -2
  23. package/http/src/{http-events.interceptor.d.ts → http-events.interceptor.ts} +7 -3
  24. package/http/src/{http-request.class.d.ts → http-request.class.ts} +5 -5
  25. package/http/src/http-result.class.ts +34 -0
  26. package/http/src/http.module.ts +25 -0
  27. package/http/src/http.service.ts +161 -0
  28. package/index.ts +1 -0
  29. package/karma.conf.js +44 -0
  30. package/ng-package.json +7 -0
  31. package/package.json +23 -106
  32. package/pipes/index.ts +1 -0
  33. package/pipes/ng-package.json +6 -0
  34. package/pipes/public-api.ts +2 -0
  35. package/pipes/src/pipes.module.ts +11 -0
  36. package/pipes/src/safe.pipe.ts +24 -0
  37. package/platform/index.ts +1 -0
  38. package/platform/ng-package.json +6 -0
  39. package/platform/public-api.ts +1 -0
  40. package/platform/src/platform.service.ts +207 -0
  41. package/public-api.ts +4 -0
  42. package/test.ts +27 -0
  43. package/translation/index.ts +1 -0
  44. package/translation/ng-package.json +6 -0
  45. package/translation/{public-api.d.ts → public-api.ts} +1 -1
  46. package/translation/src/translation.module.ts +12 -0
  47. package/translation/src/translator.pipe.ts +9 -0
  48. package/translation/src/translator.ts +49 -0
  49. package/tsconfig.lib.json +15 -0
  50. package/tsconfig.lib.prod.json +10 -0
  51. package/tsconfig.spec.json +17 -0
  52. package/utils/index.ts +1 -0
  53. package/utils/ng-package.json +6 -0
  54. package/utils/{public-api.d.ts → public-api.ts} +1 -1
  55. package/utils/src/color-util.ts +83 -0
  56. package/utils/src/drawing-util.ts +43 -0
  57. package/utils/src/object-util.ts +82 -0
  58. package/utils/src/string-util.ts +25 -0
  59. package/config/index.d.ts +0 -5
  60. package/config/public-api.d.ts +0 -1
  61. package/config/src/configs.d.ts +0 -9
  62. package/dateTime/index.d.ts +0 -5
  63. package/dateTime/src/datetime.class.d.ts +0 -100
  64. package/dateTime/src/datetime.module.d.ts +0 -8
  65. package/dateTime/src/datetime.pipe.d.ts +0 -8
  66. package/dateTime/src/georgian.calendar.d.ts +0 -20
  67. package/dateTime/src/jalali.calendar.d.ts +0 -35
  68. package/esm2020/acorex-core.mjs +0 -5
  69. package/esm2020/config/acorex-core-config.mjs +0 -5
  70. package/esm2020/config/public-api.mjs +0 -2
  71. package/esm2020/config/src/configs.mjs +0 -32
  72. package/esm2020/dateTime/acorex-core-dateTime.mjs +0 -5
  73. package/esm2020/dateTime/public-api.mjs +0 -6
  74. package/esm2020/dateTime/src/datetime.class.mjs +0 -295
  75. package/esm2020/dateTime/src/datetime.module.mjs +0 -33
  76. package/esm2020/dateTime/src/datetime.pipe.mjs +0 -26
  77. package/esm2020/dateTime/src/georgian.calendar.mjs +0 -189
  78. package/esm2020/dateTime/src/jalali.calendar.mjs +0 -359
  79. package/esm2020/events/acorex-core-events.mjs +0 -5
  80. package/esm2020/events/public-api.mjs +0 -2
  81. package/esm2020/events/src/event.service.mjs +0 -36
  82. package/esm2020/http/acorex-core-http.mjs +0 -5
  83. package/esm2020/http/public-api.mjs +0 -6
  84. package/esm2020/http/src/http-error.class.mjs +0 -2
  85. package/esm2020/http/src/http-events.interceptor.mjs +0 -3
  86. package/esm2020/http/src/http-request.class.mjs +0 -2
  87. package/esm2020/http/src/http-result.class.mjs +0 -21
  88. package/esm2020/http/src/http.module.mjs +0 -29
  89. package/esm2020/http/src/http.service.mjs +0 -147
  90. package/esm2020/pipes/acorex-core-pipes.mjs +0 -5
  91. package/esm2020/pipes/public-api.mjs +0 -3
  92. package/esm2020/pipes/src/pipes.module.mjs +0 -19
  93. package/esm2020/pipes/src/safe.pipe.mjs +0 -30
  94. package/esm2020/platform/acorex-core-platform.mjs +0 -5
  95. package/esm2020/platform/public-api.mjs +0 -2
  96. package/esm2020/platform/src/platform.service.mjs +0 -141
  97. package/esm2020/public-api.mjs +0 -5
  98. package/esm2020/translation/acorex-core-translation.mjs +0 -5
  99. package/esm2020/translation/public-api.mjs +0 -4
  100. package/esm2020/translation/src/translation.module.mjs +0 -18
  101. package/esm2020/translation/src/translator.mjs +0 -43
  102. package/esm2020/translation/src/translator.pipe.mjs +0 -15
  103. package/esm2020/utils/acorex-core-utils.mjs +0 -5
  104. package/esm2020/utils/public-api.mjs +0 -5
  105. package/esm2020/utils/src/color-util.mjs +0 -71
  106. package/esm2020/utils/src/drawing-util.mjs +0 -27
  107. package/esm2020/utils/src/object-util.mjs +0 -39
  108. package/esm2020/utils/src/string-util.mjs +0 -19
  109. package/events/index.d.ts +0 -5
  110. package/events/public-api.d.ts +0 -1
  111. package/events/src/event.service.d.ts +0 -9
  112. package/fesm2015/acorex-core-config.mjs +0 -39
  113. package/fesm2015/acorex-core-config.mjs.map +0 -1
  114. package/fesm2015/acorex-core-dateTime.mjs +0 -899
  115. package/fesm2015/acorex-core-dateTime.mjs.map +0 -1
  116. package/fesm2015/acorex-core-events.mjs +0 -43
  117. package/fesm2015/acorex-core-events.mjs.map +0 -1
  118. package/fesm2015/acorex-core-http.mjs +0 -201
  119. package/fesm2015/acorex-core-http.mjs.map +0 -1
  120. package/fesm2015/acorex-core-pipes.mjs +0 -53
  121. package/fesm2015/acorex-core-pipes.mjs.map +0 -1
  122. package/fesm2015/acorex-core-platform.mjs +0 -148
  123. package/fesm2015/acorex-core-platform.mjs.map +0 -1
  124. package/fesm2015/acorex-core-translation.mjs +0 -80
  125. package/fesm2015/acorex-core-translation.mjs.map +0 -1
  126. package/fesm2015/acorex-core-utils.mjs +0 -163
  127. package/fesm2015/acorex-core-utils.mjs.map +0 -1
  128. package/fesm2015/acorex-core.mjs +0 -11
  129. package/fesm2015/acorex-core.mjs.map +0 -1
  130. package/fesm2020/acorex-core-config.mjs +0 -39
  131. package/fesm2020/acorex-core-config.mjs.map +0 -1
  132. package/fesm2020/acorex-core-dateTime.mjs +0 -899
  133. package/fesm2020/acorex-core-dateTime.mjs.map +0 -1
  134. package/fesm2020/acorex-core-events.mjs +0 -43
  135. package/fesm2020/acorex-core-events.mjs.map +0 -1
  136. package/fesm2020/acorex-core-http.mjs +0 -200
  137. package/fesm2020/acorex-core-http.mjs.map +0 -1
  138. package/fesm2020/acorex-core-pipes.mjs +0 -53
  139. package/fesm2020/acorex-core-pipes.mjs.map +0 -1
  140. package/fesm2020/acorex-core-platform.mjs +0 -148
  141. package/fesm2020/acorex-core-platform.mjs.map +0 -1
  142. package/fesm2020/acorex-core-translation.mjs +0 -79
  143. package/fesm2020/acorex-core-translation.mjs.map +0 -1
  144. package/fesm2020/acorex-core-utils.mjs +0 -163
  145. package/fesm2020/acorex-core-utils.mjs.map +0 -1
  146. package/fesm2020/acorex-core.mjs +0 -11
  147. package/fesm2020/acorex-core.mjs.map +0 -1
  148. package/http/index.d.ts +0 -5
  149. package/http/src/http-result.class.d.ts +0 -11
  150. package/http/src/http.module.d.ts +0 -8
  151. package/http/src/http.service.d.ts +0 -23
  152. package/index.d.ts +0 -5
  153. package/pipes/index.d.ts +0 -5
  154. package/pipes/public-api.d.ts +0 -2
  155. package/pipes/src/pipes.module.d.ts +0 -8
  156. package/pipes/src/safe.pipe.d.ts +0 -10
  157. package/platform/index.d.ts +0 -5
  158. package/platform/public-api.d.ts +0 -1
  159. package/platform/src/platform.service.d.ts +0 -25
  160. package/public-api.d.ts +0 -1
  161. package/translation/index.d.ts +0 -5
  162. package/translation/src/translation.module.d.ts +0 -7
  163. package/translation/src/translator.d.ts +0 -11
  164. package/translation/src/translator.pipe.d.ts +0 -7
  165. package/utils/index.d.ts +0 -5
  166. package/utils/src/color-util.d.ts +0 -20
  167. package/utils/src/drawing-util.d.ts +0 -17
  168. package/utils/src/object-util.d.ts +0 -4
  169. package/utils/src/string-util.d.ts +0 -6
@@ -0,0 +1,12 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { AXTranslatorPipe } from './translator.pipe';
3
+
4
+ @NgModule({
5
+ imports: [],
6
+ exports: [AXTranslatorPipe],
7
+ declarations: [AXTranslatorPipe],
8
+ providers: [],
9
+ })
10
+ export class AXTranslationModule {
11
+
12
+ }
@@ -0,0 +1,9 @@
1
+ import { Pipe, PipeTransform } from '@angular/core';
2
+ import { AXTranslator } from './translator';
3
+
4
+ @Pipe({ name: 'trans', pure: true })
5
+ export class AXTranslatorPipe implements PipeTransform {
6
+ transform(value: string, arg1?: object | string, arg2?: object): string {
7
+ return AXTranslator.get(value, arg1, arg2);
8
+ }
9
+ }
@@ -0,0 +1,49 @@
1
+ import { Subject, Observable } from 'rxjs';
2
+ import merge from 'lodash-es/merge';
3
+ import * as _ from 'lodash';
4
+
5
+ // @dynamic
6
+ export class AXTranslator {
7
+ private static lang: string = 'en';
8
+ private static dataChangeSubject = new Subject<any>();
9
+ private static _varsRegx = /((\$\{[a-zA-Z_0-9\.]+\})+)/gm;
10
+ private static _varNameRegx = /[a-zA-Z_0-9\.]+/gm;
11
+
12
+
13
+ static get onChange(): Observable<any> {
14
+ return AXTranslator.dataChangeSubject.asObservable();
15
+ }
16
+
17
+ public static load(lang: string, value: any) {
18
+ if (typeof value === 'object') {
19
+ if (!AXTranslator[`__data__${lang}`]) {
20
+ AXTranslator[`__data__${lang}`] = {};
21
+ }
22
+ AXTranslator[`__data__${lang}`] = merge(AXTranslator[`__data__${lang}`], value);
23
+ }
24
+ }
25
+
26
+ public static use(lang: string) {
27
+ AXTranslator.lang = lang;
28
+ }
29
+
30
+ public static get(key: string, arg1?: object | string, arg2?: object): string {
31
+
32
+ const lang = arg1 && typeof arg1 == 'string' ? arg1 : AXTranslator.lang;
33
+ const params = arg1 && typeof arg1 == 'object' ? arg1 : arg2;
34
+ let result = _.get(AXTranslator[`__data__${lang}`], key, key);
35
+ const vars = typeof (result) == 'string' ? result?.match(this._varsRegx) : [];
36
+ if (vars?.length) {
37
+ vars.forEach((v:any) => {
38
+ const varKey = v.match(this._varNameRegx)?.length ? v.match(this._varNameRegx)[0] : null;
39
+ if (varKey) {
40
+ const p = _.get(params, varKey) || this.get(varKey, lang);
41
+ if (p) {
42
+ result = result.replace(v, p);
43
+ }
44
+ }
45
+ })
46
+ }
47
+ return typeof (result) == 'string' ? result : JSON.stringify(result);
48
+ }
49
+ }
@@ -0,0 +1,15 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../../out-tsc/lib",
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "inlineSources": true,
9
+ "types": []
10
+ },
11
+ "exclude": [
12
+ "src/test.ts",
13
+ "**/*.spec.ts"
14
+ ]
15
+ }
@@ -0,0 +1,10 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "./tsconfig.lib.json",
4
+ "compilerOptions": {
5
+ "declarationMap": false
6
+ },
7
+ "angularCompilerOptions": {
8
+ "compilationMode": "partial"
9
+ }
10
+ }
@@ -0,0 +1,17 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../../out-tsc/spec",
6
+ "types": [
7
+ "jasmine"
8
+ ]
9
+ },
10
+ "files": [
11
+ "src/test.ts"
12
+ ],
13
+ "include": [
14
+ "**/*.spec.ts",
15
+ "**/*.d.ts"
16
+ ]
17
+ }
package/utils/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './public-api';
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "lib": {
4
+ "entryFile": "public-api.ts"
5
+ }
6
+ }
@@ -1,4 +1,4 @@
1
1
  export * from './src/object-util';
2
2
  export * from './src/drawing-util';
3
3
  export * from './src/string-util';
4
- export * from './src/color-util';
4
+ export * from './src/color-util';
@@ -0,0 +1,83 @@
1
+ export type AXColorMode = 'rgba' | 'hex' | 'hsla' | 'hsva';
2
+
3
+ import tinycolor, { ColorInput } from 'tinycolor2';
4
+ import tinygradient from 'tinygradient'
5
+
6
+ export type AXColorFormat = ColorInput;
7
+
8
+ export class AXColorUtil {
9
+
10
+
11
+ static to(color: AXColorFormat, mode: AXColorMode): AXColorFormat {
12
+ const _color = tinycolor(color)
13
+ switch (mode) {
14
+ case 'rgba': ;
15
+ return _color.toRgb();
16
+ case 'hsla':
17
+ return _color.toHsl();
18
+ case 'hsva':
19
+ return _color.toHsv();
20
+ default:
21
+ return _color.toHex();
22
+ }
23
+ };
24
+
25
+ static toString(color: AXColorFormat, mode: AXColorMode): string {
26
+ const _color = tinycolor(color)
27
+ switch (mode) {
28
+ case 'rgba':
29
+ return _color.toRgbString();
30
+ case 'hsla':
31
+ return _color.toHslString();
32
+ case 'hsva':
33
+ return _color.toHsvString();
34
+ default:
35
+ return _color.toHexString();
36
+ }
37
+ };
38
+
39
+ static mix(baseColor: AXColorFormat, hex: AXColorFormat, percentage: number): string {
40
+ return tinycolor.mix(baseColor, hex, percentage).toString('rgb');
41
+ }
42
+
43
+ static multiply(color1: AXColorFormat, color2: AXColorFormat): string {
44
+ let rgb1 = tinycolor(color1).toRgb();
45
+ let rgb2 = tinycolor(color2).toRgb();
46
+ rgb1.b = Math.floor(rgb1.b * rgb2.b / 255);
47
+ rgb1.g = Math.floor(rgb1.g * rgb2.g / 255);
48
+ rgb1.r = Math.floor(rgb1.r * rgb2.r / 255);
49
+ return tinycolor('rgb ' + rgb1.r + ' ' + rgb1.g + ' ' + rgb1.b).toString('rgb');
50
+ }
51
+ static toHexSting(color: string): string {
52
+ const _color = tinycolor(color)
53
+ return _color.toHexString()
54
+ };
55
+
56
+ static toRGBString(color: AXColorFormat): string {
57
+ const _color = tinycolor(color)
58
+ return _color.toRgbString()
59
+ };
60
+
61
+ static contrastToWhite(color: AXColorFormat): number {
62
+ return tinycolor.readability("#fff", color);
63
+ };
64
+
65
+
66
+ static lighten(hex: AXColorFormat, percentage?: number) {
67
+ return tinycolor(hex).lighten(percentage)
68
+ }
69
+
70
+ static darken(hex: AXColorFormat, percentage?: number) {
71
+ return tinycolor(hex).darken(percentage)
72
+ }
73
+
74
+ static equal(color1: AXColorFormat, color2: AXColorFormat): boolean {
75
+ return tinycolor.equals(color1, color2);
76
+ }
77
+
78
+
79
+ static gradient(values: any[] | { color: any, pos: number }[]): tinygradient.Instance {
80
+ return tinygradient([...values])
81
+ }
82
+
83
+ }
@@ -0,0 +1,43 @@
1
+ export interface AXPoint {
2
+ x: number;
3
+ y: number;
4
+ }
5
+
6
+ export interface AXBoundingClientRect {
7
+ left?: number;
8
+ top?: number;
9
+ width?: number;
10
+ height?: number;
11
+ bottom?: number;
12
+ right?: number;
13
+ }
14
+ // @dynamic
15
+ export class AXDrawingUtil {
16
+ static collision(a: HTMLElement, b: HTMLElement): boolean {
17
+ const ac = a.getBoundingClientRect();
18
+ const bc = b.getBoundingClientRect();
19
+
20
+ if (ac.left < bc.left + bc.width && ac.left + ac.width > bc.left &&
21
+ ac.top < bc.top + bc.height && ac.top + ac.height > bc.top) {
22
+ return true;
23
+ }
24
+ else {
25
+ return false;
26
+ }
27
+ }
28
+
29
+ static isInElementBound(pos: AXPoint, element: HTMLElement): boolean {
30
+ const elBound = element.getBoundingClientRect();
31
+ return AXDrawingUtil.isInRecPoint(pos, {
32
+ left: elBound.x,
33
+ width: elBound.width,
34
+ top: elBound.y,
35
+ height: elBound.height
36
+ });
37
+ }
38
+
39
+ static isInRecPoint(pos: AXPoint, rec: AXBoundingClientRect | any): boolean {
40
+ return pos.x >= rec.left && pos.x <= (rec.left + rec.width) && pos.y >= rec.top && (pos.y <= (rec.top + rec.height));
41
+ }
42
+
43
+ }
@@ -0,0 +1,82 @@
1
+ // @dynamic
2
+ export class AXObjectUtil {
3
+ static deepJSONClone(obj: any): any {
4
+ return obj ? JSON.parse(JSON.stringify(obj)) : null;
5
+ }
6
+
7
+ static deepCopy(obj) {
8
+ let copy;
9
+ // Handle the 3 simple types, and null or undefined
10
+ if (null == obj || 'object' !== typeof obj) { return obj; }
11
+ // Handle Date
12
+ if (obj instanceof Date) {
13
+ copy = new Date();
14
+ copy.setTime(obj.getTime());
15
+ return copy;
16
+ }
17
+ // Handle Array
18
+ if (obj instanceof Array) {
19
+ copy = [];
20
+ for (let i = 0, len = obj.length; i < len; i++) {
21
+ copy[i] = AXObjectUtil.deepCopy(obj[i]);
22
+ }
23
+ return copy;
24
+ }
25
+ // Handle Object
26
+ if (obj instanceof Object) {
27
+ copy = {};
28
+ for (const attr in obj) {
29
+ if (obj.hasOwnProperty(attr)) { copy[attr] = AXObjectUtil.deepCopy(obj[attr]); }
30
+ }
31
+ return copy;
32
+ }
33
+ throw new Error('Unable to copy obj! Its type isn\'t supported.');
34
+ }
35
+
36
+ // static fetchProp(obj, prop: string) {
37
+ // if (typeof obj === 'undefined') {
38
+ // return false;
39
+ // }
40
+ // const index = prop.indexOf('.');
41
+
42
+ // if (index > -1) {
43
+ // return AXObjectUtil.fetchProp(obj[prop.substring(0, index)], prop.substr(index + 1));
44
+ // }
45
+
46
+ // return obj[prop];
47
+ // }
48
+
49
+ // static getPropByPath(obj, path, defaultVal?) {
50
+ // path = path
51
+ // .replace(/\[/g, '.')
52
+ // .replace(/]/g, '')
53
+ // .split('.');
54
+
55
+ // path.forEach((level) => {
56
+ // if (obj) {
57
+ // obj = obj[level];
58
+ // }
59
+ // });
60
+
61
+ // if (obj === undefined) {
62
+ // return defaultVal;
63
+ // }
64
+ // return obj;
65
+ // }
66
+
67
+ // static setPropByPath(obj, path, value) {
68
+ // if (Object(obj) !== obj) { return obj; } // When obj is not an object
69
+ // // If not yet an array, get the keys from the string-path
70
+ // if (!Array.isArray(path)) { path = path.toString().match(/[^.[\]]+/g) || []; }
71
+ // path.slice(0, -1).reduce((a, c, i) => // Iterate all of them except the last one
72
+ // Object(a[c]) === a[c] // Does the key exist and is its value an object?
73
+ // // Yes: then follow that path
74
+ // ? a[c]
75
+ // // No: create the key. Is the next key a potential array-index?
76
+ // : a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1]
77
+ // ? [] // Yes: assign a new array object
78
+ // : {}, // No: assign a new plain object
79
+ // obj)[path[path.length - 1]] = value; // Finally assign the value to the last key
80
+ // return obj; // Return the top-level object to allow chaining
81
+ // }
82
+ }
@@ -0,0 +1,25 @@
1
+ // @dynamic
2
+ export class AXStringUtil {
3
+
4
+ static getWordBoundsAtPosition(str: string, position: number): { start: number, end: number } {
5
+ const isSpace = (c) => /[^a-zA-Z0-9]+/i.test(c);
6
+ let start = position - 1;
7
+
8
+ while (start >= 0 && !isSpace(str[start])) {
9
+ start -= 1;
10
+ }
11
+ start = Math.max(0, start + 1);
12
+ const leftSideString:any = str.slice(start).match(/[a-zA-Z0-9]+/i);
13
+ start += leftSideString.index;
14
+ let end = start + leftSideString[0].length;
15
+ return {
16
+ start,
17
+ end
18
+ };
19
+ }
20
+
21
+
22
+
23
+
24
+
25
+ }
package/config/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@acorex/core/config" />
5
- export * from './public-api';
@@ -1 +0,0 @@
1
- export * from './src/configs';
@@ -1,9 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- export declare class AXConfig {
3
- private static dataModel;
4
- private static dataChangeSubject;
5
- static get onChange(): Observable<any>;
6
- static set(config: any): any;
7
- static set(path: string, value?: any): void;
8
- static get(path: string, defaultValue?: any): any;
9
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@acorex/core/dateTime" />
5
- export * from './public-api';
@@ -1,100 +0,0 @@
1
- export declare type TimeUnit = 'ms' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'week';
2
- export interface AXDateValue {
3
- year: number;
4
- month: number;
5
- date: number;
6
- hours?: number;
7
- minutes?: number;
8
- seconds?: number;
9
- ms?: number;
10
- calendar: string;
11
- }
12
- export interface AXCalendar {
13
- monthNames: string[];
14
- monthShortNames: string[];
15
- dayNames: string[];
16
- dayShortNames: string[];
17
- name(): string;
18
- dayOfMonth(date: Date): number;
19
- dayOfYear(date: Date): number;
20
- dayOfWeek(date: Date): number;
21
- monthOfYear(date: Date): number;
22
- weekOfYear(date: Date): number;
23
- year(date: Date): number;
24
- add(date: Date, unit: TimeUnit, amount: number): AXDateTime;
25
- set(date: Date, unit: TimeUnit, value: number): AXDateTime;
26
- startOf(date: Date, unit: TimeUnit): AXDateTime;
27
- endOf(date: Date, unit: TimeUnit): AXDateTime;
28
- create(value: AXDateValue): AXDateTime;
29
- }
30
- export declare class AXDateTime {
31
- static convert(value: Date | AXDateTime | string, calendar?: string): AXDateTime;
32
- static from(value?: AXDateValue): AXDateTime;
33
- static resolveCalendar(calendar: string | AXCalendar): AXCalendar;
34
- private _date;
35
- get date(): Date;
36
- private _calendar;
37
- get calendar(): AXCalendar;
38
- constructor(value?: Date | string, calendar?: string | AXCalendar);
39
- clone(): AXDateTime;
40
- get dayOfMonth(): number;
41
- get dayOfYear(): number;
42
- get dayOfWeek(): number;
43
- get hour(): number;
44
- get minute(): number;
45
- get second(): number;
46
- get year(): number;
47
- get monthOfYear(): number;
48
- get weekOfYear(): number;
49
- get month(): AXCalendarMonth;
50
- add(unit: TimeUnit, amount: number): AXDateTime;
51
- set(unit: TimeUnit, value: number): AXDateTime;
52
- duration(end: Date | AXDateTime, unit?: TimeUnit): AXTimeSpan;
53
- startOf(unit?: TimeUnit): AXDateTime;
54
- endOf(unit?: TimeUnit): AXDateTime;
55
- private _formatKeys;
56
- format(format?: string): string;
57
- private pad;
58
- toString(format?: string): string;
59
- equal(value: Date | AXDateTime, unit?: TimeUnit): boolean;
60
- compare(value: Date | AXDateTime, unit?: TimeUnit): number;
61
- convert(calendar: string): AXDateTime;
62
- }
63
- export declare class AXCalendarMonth {
64
- private _range;
65
- get range(): AXDateTimeRange;
66
- set range(v: AXDateTimeRange);
67
- constructor(date: AXDateTime);
68
- private readonly index;
69
- private readonly name;
70
- }
71
- export interface AXTimeSpanTotal {
72
- miliseconds: number;
73
- seconds: number;
74
- minutes: number;
75
- hours: number;
76
- days: number;
77
- weeks: number;
78
- months: number;
79
- years: number;
80
- }
81
- export interface AXTimeSpan {
82
- miliseconds: number;
83
- seconds: number;
84
- minutes: number;
85
- hours: number;
86
- days: number;
87
- months: number;
88
- years: number;
89
- total: AXTimeSpanTotal;
90
- }
91
- export declare class AXDateTimeRange {
92
- private _startTime;
93
- private _endTime;
94
- get startTime(): AXDateTime;
95
- get endTime(): AXDateTime;
96
- constructor(startTime: AXDateTime, endTime: AXDateTime);
97
- duration(): AXTimeSpan;
98
- enumurate(unit?: TimeUnit, amount?: number): AXDateTime[];
99
- includes(value: AXDateTime, unit?: TimeUnit): boolean;
100
- }
@@ -1,8 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./datetime.pipe";
3
- export declare class AXDateTimeModule {
4
- constructor();
5
- static ɵfac: i0.ɵɵFactoryDeclaration<AXDateTimeModule, never>;
6
- static ɵmod: i0.ɵɵNgModuleDeclaration<AXDateTimeModule, [typeof i1.AXDateTimePipe], never, [typeof i1.AXDateTimePipe]>;
7
- static ɵinj: i0.ɵɵInjectorDeclaration<AXDateTimeModule>;
8
- }
@@ -1,8 +0,0 @@
1
- import { PipeTransform } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class AXDateTimePipe implements PipeTransform {
4
- constructor();
5
- transform(value: any, format?: string, calendar?: string): string;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<AXDateTimePipe, never>;
7
- static ɵpipe: i0.ɵɵPipeDeclaration<AXDateTimePipe, "axDate", false>;
8
- }
@@ -1,20 +0,0 @@
1
- import { AXCalendar, AXDateTime, AXDateValue, TimeUnit } from "./datetime.class";
2
- export declare class GeorgianCalendar implements AXCalendar {
3
- monthNames: string[];
4
- monthShortNames: string[];
5
- dayNames: string[];
6
- dayShortNames: string[];
7
- create(value: AXDateValue): AXDateTime;
8
- name(): string;
9
- dayOfMonth(date: Date): number;
10
- dayOfYear(date: Date): number;
11
- dayOfWeek(date: Date): number;
12
- weekOfYear(date: Date): number;
13
- year(date: Date): number;
14
- monthOfYear(date: Date): number;
15
- add(date: Date, unit: TimeUnit, amount: number): AXDateTime;
16
- set(date: Date, unit: TimeUnit, value: number): AXDateTime;
17
- startOf(date: Date, unit: TimeUnit): AXDateTime;
18
- endOf(date: Date, unit: TimeUnit): AXDateTime;
19
- isLeap(date: Date): boolean;
20
- }
@@ -1,35 +0,0 @@
1
- import { AXCalendar, AXDateTime, AXDateValue, TimeUnit } from "./datetime.class";
2
- export declare class JalaliCalendar implements AXCalendar {
3
- monthNames: string[];
4
- monthShortNames: string[];
5
- dayNames: string[];
6
- dayShortNames: string[];
7
- create(value: AXDateValue): AXDateTime;
8
- name(): string;
9
- dayOfMonth(date: Date): number;
10
- dayOfYear(date: Date): number;
11
- dayOfWeek(date: Date): number;
12
- weekOfYear(date: Date): number;
13
- year(date: Date): number;
14
- monthOfYear(date: Date): number;
15
- add(date: Date, unit: TimeUnit, amount: number): AXDateTime;
16
- set(date: Date, unit: TimeUnit, value: number): AXDateTime;
17
- startOf(date: Date, unit: TimeUnit): AXDateTime;
18
- endOf(date: Date, unit: TimeUnit): AXDateTime;
19
- toJalali(date: Date): {
20
- year: number;
21
- month: number;
22
- day: number;
23
- };
24
- toGregorian(jy: any, jm: any, jd: any): Date;
25
- isValid(jy: any, jm: any, jd: any): boolean;
26
- isLeapYear(jy: any): boolean;
27
- monthLength(jy: any, jm: any): 31 | 30 | 29;
28
- private jalCal;
29
- private j2d;
30
- private d2j;
31
- private g2d;
32
- private d2g;
33
- private div;
34
- private mod;
35
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNvcmV4LWNvcmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9hY29yZXgvY29yZS9hY29yZXgtY29yZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNvcmV4LWNvcmUtY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYWNvcmV4L2NvcmUvY29uZmlnL2Fjb3JleC1jb3JlLWNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19
@@ -1,2 +0,0 @@
1
- export * from './src/configs';
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Fjb3JleC9jb3JlL2NvbmZpZy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsZUFBZSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9zcmMvY29uZmlncyc7Il19
@@ -1,32 +0,0 @@
1
- import { get, set, merge } from 'lodash-es';
2
- import { Subject } from 'rxjs';
3
- // @dynamic
4
- export class AXConfig {
5
- static get onChange() {
6
- return AXConfig.dataChangeSubject.asObservable();
7
- }
8
- static set(arg1, arg2) {
9
- if (arg1 && typeof arg1 == 'string') {
10
- set(AXConfig.dataModel, arg1, arg2);
11
- AXConfig.dataChangeSubject.next(AXConfig.dataModel);
12
- return true;
13
- }
14
- if (arg1 && typeof arg1 == 'object') {
15
- merge(AXConfig.dataModel, arg1);
16
- AXConfig.dataChangeSubject.next(AXConfig.dataModel);
17
- return true;
18
- }
19
- if (!arg1 && !arg2) {
20
- return AXConfig.dataChangeSubject.asObservable();
21
- }
22
- // TODO: Arash please check 'Not all code paths return a value.'.
23
- // if remove return you can see error on line 15.
24
- return '';
25
- }
26
- static get(path, defaultValue) {
27
- return get(AXConfig.dataModel, path, defaultValue);
28
- }
29
- }
30
- AXConfig.dataModel = {};
31
- AXConfig.dataChangeSubject = new Subject();
32
- //# sourceMappingURL=data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generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNvcmV4LWNvcmUtZGF0ZVRpbWUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hY29yZXgvY29yZS9kYXRlVGltZS9hY29yZXgtY29yZS1kYXRlVGltZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19
@@ -1,6 +0,0 @@
1
- export * from './src/datetime.class';
2
- export * from './src/datetime.module';
3
- export * from './src/datetime.pipe';
4
- export * from './src/georgian.calendar';
5
- export * from './src/jalali.calendar';
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Fjb3JleC9jb3JlL2RhdGVUaW1lL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxzQkFBc0IsQ0FBQztBQUNyQyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHVCQUF1QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9zcmMvZGF0ZXRpbWUuY2xhc3MnO1xyXG5leHBvcnQgKiBmcm9tICcuL3NyYy9kYXRldGltZS5tb2R1bGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL3NyYy9kYXRldGltZS5waXBlJztcclxuZXhwb3J0ICogZnJvbSAnLi9zcmMvZ2VvcmdpYW4uY2FsZW5kYXInO1xyXG5leHBvcnQgKiBmcm9tICcuL3NyYy9qYWxhbGkuY2FsZW5kYXInOyJdfQ==