@acorex/core 6.0.1 → 6.0.7
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.
- package/README.md +24 -24
- package/config/index.d.ts +5 -0
- package/config/public-api.d.ts +1 -0
- package/config/src/configs.d.ts +9 -0
- package/dateTime/index.d.ts +5 -0
- package/dateTime/{public-api.ts → public-api.d.ts} +1 -1
- package/dateTime/src/datetime.class.d.ts +100 -0
- package/dateTime/src/datetime.module.d.ts +8 -0
- package/dateTime/src/datetime.pipe.d.ts +8 -0
- package/dateTime/src/georgian.calendar.d.ts +20 -0
- package/dateTime/src/jalali.calendar.d.ts +35 -0
- package/esm2020/acorex-core.mjs +5 -0
- package/esm2020/config/acorex-core-config.mjs +5 -0
- package/esm2020/config/public-api.mjs +2 -0
- package/esm2020/config/src/configs.mjs +32 -0
- package/esm2020/dateTime/acorex-core-dateTime.mjs +5 -0
- package/esm2020/dateTime/public-api.mjs +6 -0
- package/esm2020/dateTime/src/datetime.class.mjs +296 -0
- package/esm2020/dateTime/src/datetime.module.mjs +33 -0
- package/esm2020/dateTime/src/datetime.pipe.mjs +26 -0
- package/esm2020/dateTime/src/georgian.calendar.mjs +189 -0
- package/esm2020/dateTime/src/jalali.calendar.mjs +359 -0
- package/esm2020/events/acorex-core-events.mjs +5 -0
- package/esm2020/events/public-api.mjs +2 -0
- package/esm2020/events/src/event.service.mjs +36 -0
- package/esm2020/http/acorex-core-http.mjs +5 -0
- package/esm2020/http/public-api.mjs +6 -0
- package/esm2020/http/src/http-error.class.mjs +2 -0
- package/esm2020/http/src/http-events.interceptor.mjs +3 -0
- package/esm2020/http/src/http-request.class.mjs +2 -0
- package/esm2020/http/src/http-result.class.mjs +21 -0
- package/esm2020/http/src/http.module.mjs +29 -0
- package/esm2020/http/src/http.service.mjs +147 -0
- package/esm2020/pipes/acorex-core-pipes.mjs +5 -0
- package/esm2020/pipes/public-api.mjs +3 -0
- package/esm2020/pipes/src/pipes.module.mjs +19 -0
- package/esm2020/pipes/src/safe.pipe.mjs +30 -0
- package/esm2020/platform/acorex-core-platform.mjs +5 -0
- package/esm2020/platform/public-api.mjs +2 -0
- package/esm2020/platform/src/platform.service.mjs +141 -0
- package/esm2020/public-api.mjs +5 -0
- package/esm2020/translation/acorex-core-translation.mjs +5 -0
- package/esm2020/translation/public-api.mjs +4 -0
- package/esm2020/translation/src/translation.module.mjs +18 -0
- package/esm2020/translation/src/translator.mjs +43 -0
- package/esm2020/translation/src/translator.pipe.mjs +15 -0
- package/esm2020/utils/acorex-core-utils.mjs +5 -0
- package/esm2020/utils/public-api.mjs +5 -0
- package/esm2020/utils/src/color-util.mjs +71 -0
- package/esm2020/utils/src/drawing-util.mjs +27 -0
- package/esm2020/utils/src/object-util.mjs +39 -0
- package/esm2020/utils/src/string-util.mjs +19 -0
- package/events/index.d.ts +5 -0
- package/events/public-api.d.ts +1 -0
- package/events/src/event.service.d.ts +9 -0
- package/fesm2015/acorex-core-config.mjs +39 -0
- package/fesm2015/acorex-core-config.mjs.map +1 -0
- package/fesm2015/acorex-core-dateTime.mjs +900 -0
- package/fesm2015/acorex-core-dateTime.mjs.map +1 -0
- package/fesm2015/acorex-core-events.mjs +43 -0
- package/fesm2015/acorex-core-events.mjs.map +1 -0
- package/fesm2015/acorex-core-http.mjs +201 -0
- package/fesm2015/acorex-core-http.mjs.map +1 -0
- package/fesm2015/acorex-core-pipes.mjs +53 -0
- package/fesm2015/acorex-core-pipes.mjs.map +1 -0
- package/fesm2015/acorex-core-platform.mjs +148 -0
- package/fesm2015/acorex-core-platform.mjs.map +1 -0
- package/fesm2015/acorex-core-translation.mjs +80 -0
- package/fesm2015/acorex-core-translation.mjs.map +1 -0
- package/fesm2015/acorex-core-utils.mjs +163 -0
- package/fesm2015/acorex-core-utils.mjs.map +1 -0
- package/fesm2015/acorex-core.mjs +11 -0
- package/fesm2015/acorex-core.mjs.map +1 -0
- package/fesm2020/acorex-core-config.mjs +39 -0
- package/fesm2020/acorex-core-config.mjs.map +1 -0
- package/fesm2020/acorex-core-dateTime.mjs +900 -0
- package/fesm2020/acorex-core-dateTime.mjs.map +1 -0
- package/fesm2020/acorex-core-events.mjs +43 -0
- package/fesm2020/acorex-core-events.mjs.map +1 -0
- package/fesm2020/acorex-core-http.mjs +200 -0
- package/fesm2020/acorex-core-http.mjs.map +1 -0
- package/fesm2020/acorex-core-pipes.mjs +53 -0
- package/fesm2020/acorex-core-pipes.mjs.map +1 -0
- package/fesm2020/acorex-core-platform.mjs +148 -0
- package/fesm2020/acorex-core-platform.mjs.map +1 -0
- package/fesm2020/acorex-core-translation.mjs +79 -0
- package/fesm2020/acorex-core-translation.mjs.map +1 -0
- package/fesm2020/acorex-core-utils.mjs +163 -0
- package/fesm2020/acorex-core-utils.mjs.map +1 -0
- package/fesm2020/acorex-core.mjs +11 -0
- package/fesm2020/acorex-core.mjs.map +1 -0
- package/http/index.d.ts +5 -0
- package/http/{public-api.ts → public-api.d.ts} +1 -1
- package/http/src/{http-error.class.ts → http-error.class.d.ts} +2 -2
- package/http/src/{http-events.interceptor.ts → http-events.interceptor.d.ts} +3 -7
- package/http/src/{http-request.class.ts → http-request.class.d.ts} +5 -5
- package/http/src/http-result.class.d.ts +11 -0
- package/http/src/http.module.d.ts +8 -0
- package/http/src/http.service.d.ts +23 -0
- package/index.d.ts +5 -0
- package/package.json +106 -23
- package/pipes/index.d.ts +5 -0
- package/pipes/public-api.d.ts +2 -0
- package/pipes/src/pipes.module.d.ts +8 -0
- package/pipes/src/safe.pipe.d.ts +10 -0
- package/platform/index.d.ts +5 -0
- package/platform/public-api.d.ts +1 -0
- package/platform/src/platform.service.d.ts +25 -0
- package/public-api.d.ts +1 -0
- package/translation/index.d.ts +5 -0
- package/translation/{public-api.ts → public-api.d.ts} +1 -1
- package/translation/src/translation.module.d.ts +7 -0
- package/translation/src/translator.d.ts +11 -0
- package/translation/src/translator.pipe.d.ts +7 -0
- package/utils/index.d.ts +5 -0
- package/utils/{public-api.ts → public-api.d.ts} +1 -1
- package/utils/src/color-util.d.ts +20 -0
- package/utils/src/drawing-util.d.ts +17 -0
- package/utils/src/object-util.d.ts +4 -0
- package/utils/src/string-util.d.ts +6 -0
- package/.browserslistrc +0 -16
- package/config/ax-preset.js +0 -186
- package/config/index.ts +0 -1
- package/config/ng-package.json +0 -6
- package/config/public-api.ts +0 -1
- package/config/src/configs.ts +0 -37
- package/dateTime/index.ts +0 -1
- package/dateTime/ng-package.json +0 -6
- package/dateTime/src/datetime.class.ts +0 -452
- package/dateTime/src/datetime.module.ts +0 -29
- package/dateTime/src/datetime.pipe.ts +0 -21
- package/dateTime/src/georgian.calendar.ts +0 -205
- package/dateTime/src/jalali.calendar.ts +0 -416
- package/events/index.ts +0 -1
- package/events/ng-package.json +0 -6
- package/events/public-api.ts +0 -1
- package/events/src/event.service.ts +0 -31
- package/http/index.ts +0 -1
- package/http/ng-package.json +0 -6
- package/http/src/http-result.class.ts +0 -34
- package/http/src/http.module.ts +0 -25
- package/http/src/http.service.ts +0 -161
- package/index.ts +0 -1
- package/karma.conf.js +0 -44
- package/ng-package.json +0 -7
- package/pipes/index.ts +0 -1
- package/pipes/ng-package.json +0 -6
- package/pipes/public-api.ts +0 -2
- package/pipes/src/pipes.module.ts +0 -11
- package/pipes/src/safe.pipe.ts +0 -24
- package/platform/index.ts +0 -1
- package/platform/ng-package.json +0 -6
- package/platform/public-api.ts +0 -1
- package/platform/src/platform.service.ts +0 -207
- package/public-api.ts +0 -4
- package/test.ts +0 -27
- package/translation/index.ts +0 -1
- package/translation/ng-package.json +0 -6
- package/translation/src/translation.module.ts +0 -12
- package/translation/src/translator.pipe.ts +0 -9
- package/translation/src/translator.ts +0 -49
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
- package/utils/index.ts +0 -1
- package/utils/ng-package.json +0 -6
- package/utils/src/color-util.ts +0 -83
- package/utils/src/drawing-util.ts +0 -43
- package/utils/src/object-util.ts +0 -82
- package/utils/src/string-util.ts +0 -25
package/utils/src/object-util.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
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
|
-
}
|
package/utils/src/string-util.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
}
|