coer-elements 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/interfaces/index.mjs +7 -0
- package/esm2022/interfaces/lib/app-source.interface.mjs +2 -0
- package/esm2022/interfaces/lib/breadcrumb.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-ref.interface.mjs +2 -0
- package/esm2022/interfaces/lib/go-back.interface.mjs +2 -0
- package/esm2022/interfaces/lib/patch.interface.mjs +2 -0
- package/esm2022/interfaces/lib/screen-size.interface.mjs +2 -0
- package/esm2022/public_api.mjs +2 -1
- package/esm2022/signals/index.mjs +4 -0
- package/esm2022/signals/lib/breakpoint.signal.mjs +4 -0
- package/esm2022/signals/lib/is-loading.signal.mjs +3 -0
- package/esm2022/signals/lib/is-modal-open.signal.mjs +3 -0
- package/esm2022/tools/index.mjs +9 -2
- package/esm2022/tools/lib/breadcrumbs.class.mjs +63 -0
- package/esm2022/tools/lib/control-value.class.mjs +46 -0
- package/esm2022/tools/lib/date-time.class.mjs +22 -0
- package/esm2022/tools/lib/files.class.mjs +91 -0
- package/esm2022/tools/lib/generi-tools.mjs +199 -0
- package/esm2022/tools/lib/page.class.mjs +156 -0
- package/esm2022/tools/lib/screen.class.mjs +43 -0
- package/esm2022/tools/lib/source.class.mjs +80 -0
- package/fesm2022/coer-elements.mjs +649 -3
- package/fesm2022/coer-elements.mjs.map +1 -1
- package/interfaces/index.d.ts +6 -0
- package/interfaces/lib/app-source.interface.d.ts +4 -0
- package/interfaces/lib/breadcrumb.interface.d.ts +6 -0
- package/interfaces/lib/coer-ref.interface.d.ts +10 -0
- package/interfaces/lib/go-back.interface.d.ts +6 -0
- package/interfaces/lib/patch.interface.d.ts +5 -0
- package/interfaces/lib/screen-size.interface.d.ts +5 -0
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/signals/index.d.ts +3 -0
- package/signals/lib/breakpoint.signal.d.ts +1 -0
- package/signals/lib/is-loading.signal.d.ts +1 -0
- package/signals/lib/is-modal-open.signal.d.ts +1 -0
- package/src/interfaces/index.ts +6 -0
- package/src/interfaces/lib/app-source.interface.ts +4 -0
- package/src/interfaces/lib/breadcrumb.interface.ts +6 -0
- package/src/interfaces/lib/coer-ref.interface.ts +11 -0
- package/src/interfaces/lib/go-back.interface.ts +6 -0
- package/src/interfaces/lib/patch.interface.ts +5 -0
- package/src/interfaces/lib/screen-size.interface.ts +5 -0
- package/tools/index.d.ts +8 -1
- package/tools/lib/breadcrumbs.class.d.ts +18 -0
- package/tools/lib/date-time.class.d.ts +11 -0
- package/tools/lib/files.class.d.ts +16 -0
- package/tools/lib/generi-tools.d.ts +32 -0
- package/tools/lib/page.class.d.ts +60 -0
- package/tools/lib/screen.class.d.ts +11 -0
- package/tools/lib/source.class.d.ts +20 -0
- package/esm2022/tools/lib/controlValue.mjs +0 -46
- /package/tools/lib/{controlValue.d.ts → control-value.class.d.ts} +0 -0
@@ -0,0 +1,7 @@
|
|
1
|
+
export * from './lib/app-source.interface';
|
2
|
+
export * from './lib/breadcrumb.interface';
|
3
|
+
export * from './lib/coer-ref.interface';
|
4
|
+
export * from './lib/go-back.interface';
|
5
|
+
export * from './lib/patch.interface';
|
6
|
+
export * from './lib/screen-size.interface';
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9jb2VyLWVsZW1lbnRzL3NyYy9pbnRlcmZhY2VzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsNEJBQTRCLENBQUM7QUFDM0MsY0FBYyw0QkFBNEIsQ0FBQztBQUMzQyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLDZCQUE2QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9saWIvYXBwLXNvdXJjZS5pbnRlcmZhY2UnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9icmVhZGNydW1iLmludGVyZmFjZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2NvZXItcmVmLmludGVyZmFjZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2dvLWJhY2suaW50ZXJmYWNlJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvcGF0Y2guaW50ZXJmYWNlJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvc2NyZWVuLXNpemUuaW50ZXJmYWNlJzsiXX0=
|
@@ -0,0 +1,2 @@
|
|
1
|
+
export {};
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLXNvdXJjZS5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb2VyLWVsZW1lbnRzL3NyYy9pbnRlcmZhY2VzL2xpYi9hcHAtc291cmNlLmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBJQXBwU291cmNlIHtcclxuICAgIHBhZ2U6IHN0cmluZztcclxuICAgIHBhdGg6IHN0cmluZztcclxufSJdfQ==
|
@@ -0,0 +1,2 @@
|
|
1
|
+
export {};
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnJlYWRjcnVtYi5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb2VyLWVsZW1lbnRzL3NyYy9pbnRlcmZhY2VzL2xpYi9icmVhZGNydW1iLmludGVyZmFjZS50cyJdLCJuYW1lcyI6W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
|
1
|
+
export {};
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ28tYmFjay5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb2VyLWVsZW1lbnRzL3NyYy9pbnRlcmZhY2VzL2xpYi9nby1iYWNrLmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBJR29CYWNrIHtcclxuICAgIHNob3c6IGJvb2xlYW47XHJcbiAgICBwYXRoPzogc3RyaW5nIHwgbnVsbDtcclxuICAgIHF1ZXJ5UGFyYW1zPzogYW55O1xyXG4gICAgY2xpY2s/OiAoKCkgPT4gYW55KTtcclxufSJdfQ==
|
@@ -0,0 +1,2 @@
|
|
1
|
+
export {};
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF0Y2guaW50ZXJmYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29lci1lbGVtZW50cy9zcmMvaW50ZXJmYWNlcy9saWIvcGF0Y2guaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIElQYXRjaCB7XHJcbiAgICBvcDogJ3JlbW92ZScgfCAnYWRkJyB8ICdyZXBsYWNlJztcclxuICAgIHBhdGg6IHN0cmluZztcclxuICAgIHZhbHVlOiBhbnk7XHJcbn0iXX0=
|
@@ -0,0 +1,2 @@
|
|
1
|
+
export {};
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NyZWVuLXNpemUuaW50ZXJmYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29lci1lbGVtZW50cy9zcmMvaW50ZXJmYWNlcy9saWIvc2NyZWVuLXNpemUuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIElTY3JlZW5TaXplIHtcclxuICAgIHdpZHRoOiBudW1iZXI7XHJcbiAgICBoZWlnaHQ6IG51bWJlcjtcclxuICAgIGJyZWFrcG9pbjogJ3hzJyB8ICdzbScgfCAnbWQnIHwgJ2xnJyB8ICd4bCcgfCAneHhsJztcclxufSJdfQ==
|
package/esm2022/public_api.mjs
CHANGED
@@ -1,3 +1,4 @@
|
|
1
1
|
export * from './components';
|
2
|
+
export * from './signals';
|
2
3
|
export * from './tools';
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2NvZXItZWxlbWVudHMvc3JjL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2NvbXBvbmVudHMnO1xyXG5leHBvcnQgKiBmcm9tICcuL3NpZ25hbHMnO1xyXG5leHBvcnQgKiBmcm9tICcuL3Rvb2xzJzsiXX0=
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export * from './lib/breakpoint.signal';
|
2
|
+
export * from './lib/is-loading.signal';
|
3
|
+
export * from './lib/is-modal-open.signal';
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9jb2VyLWVsZW1lbnRzL3NyYy9zaWduYWxzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLDRCQUE0QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9saWIvYnJlYWtwb2ludC5zaWduYWwnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9pcy1sb2FkaW5nLnNpZ25hbCc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2lzLW1vZGFsLW9wZW4uc2lnbmFsJzsiXX0=
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { signal } from '@angular/core';
|
2
|
+
import { Screen } from '../../tools';
|
3
|
+
export const breakpointSIGNAL = signal(Screen?.BREAKPOINT || 'xs');
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnJlYWtwb2ludC5zaWduYWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb2VyLWVsZW1lbnRzL3NyYy9zaWduYWxzL2xpYi9icmVha3BvaW50LnNpZ25hbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3ZDLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDckMsTUFBTSxDQUFDLE1BQU0sZ0JBQWdCLEdBQUcsTUFBTSxDQUEyQyxNQUFNLEVBQUUsVUFBVSxJQUFJLElBQUksQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgc2lnbmFsIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XHJcbmltcG9ydCB7IFNjcmVlbiB9IGZyb20gJy4uLy4uL3Rvb2xzJztcclxuZXhwb3J0IGNvbnN0IGJyZWFrcG9pbnRTSUdOQUwgPSBzaWduYWw8J3hzJyB8ICdzbScgfCAnbWQnIHwgJ2xnJyB8ICd4bCcgfCAneHhsJz4oU2NyZWVuPy5CUkVBS1BPSU5UIHx8ICd4cycpOyJdfQ==
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { signal } from "@angular/core";
|
2
|
+
export const isLoadingSIG = signal(false);
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXMtbG9hZGluZy5zaWduYWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb2VyLWVsZW1lbnRzL3NyYy9zaWduYWxzL2xpYi9pcy1sb2FkaW5nLnNpZ25hbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3ZDLE1BQU0sQ0FBQyxNQUFNLFlBQVksR0FBRyxNQUFNLENBQVUsS0FBSyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzaWduYWwgfSBmcm9tIFwiQGFuZ3VsYXIvY29yZVwiO1xyXG5leHBvcnQgY29uc3QgaXNMb2FkaW5nU0lHID0gc2lnbmFsPGJvb2xlYW4+KGZhbHNlKTsiXX0=
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { signal } from "@angular/core";
|
2
|
+
export const isModalOpenSIG = signal(false);
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXMtbW9kYWwtb3Blbi5zaWduYWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb2VyLWVsZW1lbnRzL3NyYy9zaWduYWxzL2xpYi9pcy1tb2RhbC1vcGVuLnNpZ25hbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3ZDLE1BQU0sQ0FBQyxNQUFNLGNBQWMsR0FBRyxNQUFNLENBQVUsS0FBSyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzaWduYWwgfSBmcm9tIFwiQGFuZ3VsYXIvY29yZVwiO1xyXG5leHBvcnQgY29uc3QgaXNNb2RhbE9wZW5TSUcgPSBzaWduYWw8Ym9vbGVhbj4oZmFsc2UpOyJdfQ==
|
package/esm2022/tools/index.mjs
CHANGED
@@ -1,2 +1,9 @@
|
|
1
|
-
export * from './lib/
|
2
|
-
|
1
|
+
export * from './lib/breadcrumbs.class';
|
2
|
+
export * from './lib/control-value.class';
|
3
|
+
export * from './lib/date-time.class';
|
4
|
+
export * from './lib/files.class';
|
5
|
+
export * from './lib/generi-tools';
|
6
|
+
export * from './lib/page.class';
|
7
|
+
export * from './lib/screen.class';
|
8
|
+
export * from './lib/source.class';
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9jb2VyLWVsZW1lbnRzL3NyYy90b29scy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsb0JBQW9CLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2xpYi9icmVhZGNydW1icy5jbGFzcyc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2NvbnRyb2wtdmFsdWUuY2xhc3MnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9kYXRlLXRpbWUuY2xhc3MnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9maWxlcy5jbGFzcyc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2dlbmVyaS10b29scyc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3BhZ2UuY2xhc3MnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zY3JlZW4uY2xhc3MnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zb3VyY2UuY2xhc3MnO1xyXG4iXX0=
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { Tools } from './generi-tools';
|
2
|
+
export class Breadcrumbs {
|
3
|
+
static { this.storage = 'COER-System'; }
|
4
|
+
/** */
|
5
|
+
static Add(page, path) {
|
6
|
+
const breadcrumbs = this.Get();
|
7
|
+
const paths = breadcrumbs.map(item => item.path);
|
8
|
+
if (!paths.includes(path)) {
|
9
|
+
breadcrumbs.push({ page, path });
|
10
|
+
this.Save(breadcrumbs);
|
11
|
+
}
|
12
|
+
}
|
13
|
+
/** */
|
14
|
+
static Get() {
|
15
|
+
let storage = sessionStorage.getItem(this.storage);
|
16
|
+
if (storage) {
|
17
|
+
storage = JSON.parse(storage);
|
18
|
+
if (storage.hasOwnProperty('breadcrumbs')) {
|
19
|
+
return Tools.BreakReference(storage.breadcrumbs);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
return [];
|
23
|
+
}
|
24
|
+
/** */
|
25
|
+
static GetFirst() {
|
26
|
+
const breadcrumbs = this.Get();
|
27
|
+
return (breadcrumbs.length > 0) ? breadcrumbs.shift() : null;
|
28
|
+
}
|
29
|
+
/** */
|
30
|
+
static Save(breadcrumbs) {
|
31
|
+
let storage = sessionStorage.getItem(this.storage);
|
32
|
+
if (storage)
|
33
|
+
storage = JSON.parse(storage);
|
34
|
+
storage = Object.assign({}, storage, { breadcrumbs });
|
35
|
+
sessionStorage.setItem(this.storage, JSON.stringify(storage));
|
36
|
+
}
|
37
|
+
/** */
|
38
|
+
static Remove(path) {
|
39
|
+
let breadcrumbs = this.Get();
|
40
|
+
const index = breadcrumbs.findIndex(x => x.path.toLowerCase().trim() === path.toLowerCase().trim());
|
41
|
+
if (index >= 0) {
|
42
|
+
breadcrumbs = Tools.BreakReference(breadcrumbs).splice(0, index + 1);
|
43
|
+
this.Save(breadcrumbs);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
/** */
|
47
|
+
static SetLast(page, path) {
|
48
|
+
const breadcrumbs = this.Get();
|
49
|
+
if (breadcrumbs.length > 0) {
|
50
|
+
breadcrumbs[breadcrumbs.length - 1] = { page, path };
|
51
|
+
this.Save(breadcrumbs);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
/** */
|
55
|
+
static RemoveLast() {
|
56
|
+
const breadcrumbs = this.Get();
|
57
|
+
if (breadcrumbs.length > 0) {
|
58
|
+
breadcrumbs.pop();
|
59
|
+
this.Save(breadcrumbs);
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnJlYWRjcnVtYnMuY2xhc3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb2VyLWVsZW1lbnRzL3NyYy90b29scy9saWIvYnJlYWRjcnVtYnMuY2xhc3MudH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S50cmltKCkpO1xyXG5cclxuICAgICAgICBpZiAoaW5kZXggPj0gMCkge1xyXG4gICAgICAgICAgICBicmVhZGNydW1icyA9IFRvb2xzLkJyZWFrUmVmZXJlbmNlKGJyZWFkY3J1bWJzKS5zcGxpY2UoMCwgaW5kZXggKyAxKTtcclxuICAgICAgICAgICAgdGhpcy5TYXZlKGJyZWFkY3J1bWJzKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG5cclxuICAgIC8qKiAqL1xyXG4gICAgcHVibGljIHN0YXRpYyBTZXRMYXN0KHBhZ2U6IHN0cmluZywgcGF0aDogc3RyaW5nKTogdm9pZCB7XHJcbiAgICAgICAgY29uc3QgYnJlYWRjcnVtYnMgPSB0aGlzLkdldCgpO1xyXG5cclxuICAgICAgICBpZiAoYnJlYWRjcnVtYnMubGVuZ3RoID4gMCkge1xyXG4gICAgICAgICAgICBicmVhZGNydW1ic1ticmVhZGNydW1icy5sZW5ndGggLSAxXSA9IHsgcGFnZSwgcGF0aCB9O1xyXG4gICAgICAgICAgICB0aGlzLlNhdmUoYnJlYWRjcnVtYnMpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcblxyXG4gICAgLyoqICovXHJcbiAgICBwdWJsaWMgc3RhdGljIFJlbW92ZUxhc3QoKTogdm9pZCB7XHJcbiAgICAgICAgY29uc3QgYnJlYWRjcnVtYnMgPSB0aGlzLkdldCgpO1xyXG5cclxuICAgICAgICBpZiAoYnJlYWRjcnVtYnMubGVuZ3RoID4gMCkge1xyXG4gICAgICAgICAgICBicmVhZGNydW1icy5wb3AoKTtcclxuICAgICAgICAgICAgdGhpcy5TYXZlKGJyZWFkY3J1bWJzKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn0iXX0=
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
2
|
+
import { forwardRef } from "@angular/core";
|
3
|
+
export const CONTROL_VALUE = (component) => {
|
4
|
+
return {
|
5
|
+
provide: NG_VALUE_ACCESSOR,
|
6
|
+
useExisting: forwardRef(() => component),
|
7
|
+
multi: true
|
8
|
+
};
|
9
|
+
};
|
10
|
+
export class ControlValue {
|
11
|
+
constructor() {
|
12
|
+
this._isTouched = false;
|
13
|
+
}
|
14
|
+
get isTouched() {
|
15
|
+
return this._isTouched;
|
16
|
+
}
|
17
|
+
/** */
|
18
|
+
SetValue(value) {
|
19
|
+
if (typeof this._UpdateValue === 'function') {
|
20
|
+
this._UpdateValue(value);
|
21
|
+
}
|
22
|
+
this._value = value;
|
23
|
+
}
|
24
|
+
/** */
|
25
|
+
SetTouched(isTouched) {
|
26
|
+
if (typeof this._IsTouched === 'function') {
|
27
|
+
this._IsTouched(isTouched);
|
28
|
+
}
|
29
|
+
this._isTouched = isTouched;
|
30
|
+
}
|
31
|
+
/** */
|
32
|
+
writeValue(value) {
|
33
|
+
this._value = value;
|
34
|
+
}
|
35
|
+
/** */
|
36
|
+
registerOnChange(callback) {
|
37
|
+
this._UpdateValue = callback;
|
38
|
+
}
|
39
|
+
/** */
|
40
|
+
registerOnTouched(callback) {
|
41
|
+
this._IsTouched = callback;
|
42
|
+
}
|
43
|
+
/** */
|
44
|
+
setDisabledState(isDisabled) { }
|
45
|
+
}
|
46
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJvbC12YWx1ZS5jbGFzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NvZXItZWxlbWVudHMvc3JjL3Rvb2xzL2xpYi9jb250cm9sLXZhbHVlLmNsYXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBd0IsaUJBQWlCLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUN6RSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE1BQ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cy5fSXNUb3VjaGVkID0gY2FsbGJhY2s7XHJcbiAgICB9XHJcblxyXG4gICAgXHJcbiAgICAvKiogKi9cclxuICAgIHB1YmxpYyBzZXREaXNhYmxlZFN0YXRlKGlzRGlzYWJsZWQ6IGJvb2xlYW4pOiB2b2lkIHt9XHJcbn0iXX0=
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import moment from "moment";
|
2
|
+
export class DateTime {
|
3
|
+
/** Get UTC Offset */
|
4
|
+
static GetOffset() {
|
5
|
+
return moment().utcOffset();
|
6
|
+
}
|
7
|
+
/** Convert UTC Date to Local Zone */
|
8
|
+
static ToLocalZone(utcDate) {
|
9
|
+
return moment(utcDate).add(DateTime.GetOffset(), 'minutes').format('YYYY-MM-DD HH:mm:ss');
|
10
|
+
}
|
11
|
+
/** Convert Local Zone Date to UTC */
|
12
|
+
static ToUTC(utcDate) {
|
13
|
+
return moment(utcDate).subtract(DateTime.GetOffset(), 'minutes').format('YYYY-MM-DD HH:mm:ss');
|
14
|
+
}
|
15
|
+
/** DD MMM YYYY */
|
16
|
+
static GetDateFormat(date) {
|
17
|
+
if ((typeof date === 'string'))
|
18
|
+
date = date.replaceAll('/', '-');
|
19
|
+
return moment(date).parseZone().local(true).format('DD MMM YYYY');
|
20
|
+
}
|
21
|
+
}
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS10aW1lLmNsYXNzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29lci1lbGVtZW50cy9zcmMvdG9vbHMvbGliL2RhdGUtdGltZS5jbGFzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLE1BQU0sTUFBTSxRQUFRLENBQUM7QUFFNUIsTUFBTSxPQUFPLFFBQVE7SUFDakIscUJBQXFCO0lBQ2QsTUFBTSxDQUFDLFNBQVM7UUFDbkIsT0F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AgfVxyXG59Il19
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import { Tools } from "../";
|
2
|
+
import * as XLSX from 'xlsx';
|
3
|
+
export class Files {
|
4
|
+
static { this.EXCEL_EXTENSIONS = ['xls', 'xlsx', 'csv']; }
|
5
|
+
/** Get Extension File */
|
6
|
+
static GetExtension(file) {
|
7
|
+
const fileName = file.name;
|
8
|
+
if (fileName.includes('.')) {
|
9
|
+
let worlds = fileName.split('.');
|
10
|
+
if (worlds.length > 0) {
|
11
|
+
let extension = worlds.pop();
|
12
|
+
extension = extension.trim().toLowerCase();
|
13
|
+
if (extension.length > 0)
|
14
|
+
return extension;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
return null;
|
18
|
+
}
|
19
|
+
/** Is Excel File */
|
20
|
+
static IsExcel(file) {
|
21
|
+
const EXTENSION = Files.GetExtension(file);
|
22
|
+
return Tools.IsNotNull(EXTENSION)
|
23
|
+
? this.EXCEL_EXTENSIONS.includes(EXTENSION)
|
24
|
+
: false;
|
25
|
+
}
|
26
|
+
/** Read excel file */
|
27
|
+
static ReadExcel(file) {
|
28
|
+
return new Promise(Resolve => {
|
29
|
+
let columns = [];
|
30
|
+
let rows = [];
|
31
|
+
const reader = new FileReader();
|
32
|
+
reader.readAsArrayBuffer(file);
|
33
|
+
reader.onload = () => {
|
34
|
+
const dataBytes = new Uint8Array(reader.result);
|
35
|
+
if (dataBytes) {
|
36
|
+
const workbook = XLSX.read(dataBytes, {});
|
37
|
+
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
38
|
+
let dataSheet = XLSX.utils.sheet_to_json(sheet, {
|
39
|
+
header: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
|
40
|
+
});
|
41
|
+
//Get Headers
|
42
|
+
for (const column in dataSheet[0]) {
|
43
|
+
columns.push(Tools.FirstCharToLower(String(dataSheet[0][column]).replaceAll(' ', '')));
|
44
|
+
}
|
45
|
+
//Get Rows
|
46
|
+
rows = XLSX.utils.sheet_to_json(sheet, { header: columns });
|
47
|
+
rows.shift();
|
48
|
+
rows = rows.map(row => {
|
49
|
+
const item = Tools.BreakReference(row);
|
50
|
+
delete item['__rowNum__'];
|
51
|
+
return item;
|
52
|
+
});
|
53
|
+
}
|
54
|
+
Resolve({ columns, rows });
|
55
|
+
};
|
56
|
+
reader.onerror = () => { Resolve({ columns, rows }); };
|
57
|
+
});
|
58
|
+
}
|
59
|
+
/** Export to excel file */
|
60
|
+
static ExportExcel(data, fileName = 'coer_report', sheetName = 'Sheet1') {
|
61
|
+
sheetName = Tools.CleanUpBlanks(sheetName);
|
62
|
+
fileName = Tools.CleanUpBlanks(fileName);
|
63
|
+
if (fileName.endsWith('.xls') || fileName.endsWith('.xlsx') || fileName.endsWith('.csv')) {
|
64
|
+
if (fileName.includes('.xls')) {
|
65
|
+
fileName = fileName.replaceAll('.xls', '.xlsx');
|
66
|
+
}
|
67
|
+
if (fileName.includes('.csv')) {
|
68
|
+
fileName = fileName.replaceAll('.csv', '.xlsx');
|
69
|
+
}
|
70
|
+
}
|
71
|
+
else {
|
72
|
+
fileName += '.xlsx';
|
73
|
+
}
|
74
|
+
const WORK_SHEET = XLSX.utils.json_to_sheet(data);
|
75
|
+
const WORK_BOOK = XLSX.utils.book_new();
|
76
|
+
XLSX.utils.book_append_sheet(WORK_BOOK, WORK_SHEET, sheetName);
|
77
|
+
XLSX.writeFile(WORK_BOOK, fileName);
|
78
|
+
}
|
79
|
+
/** Convert file to string base64 */
|
80
|
+
static ConvertToBase64(file) {
|
81
|
+
return new Promise(Resolve => {
|
82
|
+
const reader = new FileReader();
|
83
|
+
reader.readAsDataURL(file);
|
84
|
+
reader.onload = () => {
|
85
|
+
Resolve(reader.result?.toString() || '');
|
86
|
+
};
|
87
|
+
reader.onerror = () => Resolve('');
|
88
|
+
});
|
89
|
+
}
|
90
|
+
}
|
91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bHMgfSBmcm9tIFwiLi4vXCI7XHJcbmltcG9ydCAqIGFzIFhMU1ggZnJvbSAneGxzeCc7XHJcblxyXG5leHBvcnQgY2xhc3MgRmlsZXMge1xyXG4gICAgcHVibGljIHN0YXRpYyByZWFkb25seSBFWENFTF9FWFRFTlNJT05TOiBzdHJpbmdbXSA9IFsneGxzJywgJ3hsc3gnLCAnY3N2J107XHJcblxyXG4gICAgLyoqIEdldCBFeHRlbnNpb24gRmlsZSAqL1xyXG4gICAgcHVibGljIHN0YXRpYyBHZXRFeHRlbnNpb24oZmlsZTogRmlsZSk6IHN0cmluZyB8IG51bGwge1xyXG4gICAgICAgIGNvbnN0IGZpbGVOYW1lID0gZmlsZS5uYW1lO1xyXG5cclxuICAgICAgICBpZiAoZmlsZU5hbWUuaW5jbHVkZXMoJy4nKSkge1xyXG4gICAgICAgICAgICBsZXQgd29ybGRzID0gZmlsZU5hbWUuc3BsaXQoJy4nKSBhcyBzdHJpbmdbXTtcclxuXHJcbiAgICAgICAgICAgIGlmICh3b3JsZHMubGVuZ3RoID4gMCkge1xyXG4gICAgICAgICAgICAgICAgbGV0IGV4dGVuc2lvbiA9IHdvcmxkcy5wb3AoKSE7XHJcbiAgICAgICAgICAgICAgICBleHRlbnNpb24gPSBleHRlbnNpb24udHJpbSgpLnRvTG93ZXJDYXNlKCk7XHJcbiAgICAgICAgICAgICAgICBpZiAoZXh0ZW5zaW9uLmxlbmd0aCA+IDApIHJldHVybiBleHRlbnNpb247XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgfVxyXG5cclxuXHJcbiAgICAvKiogSXMgRXhjZWwgRmlsZSAqL1xyXG4gICAgcHVibGljIHN0YXRpYyBJc0V4Y2VsKGZpbGU6IEZpbGUpOiBib29sZWFuIHtcclxuICAgICAgICBjb25zdCBFWFRFTlNJT04gPSBGaWxlcy5HZXRFeHRlbnNpb24oZmlsZSk7XHJcblxyXG4gICAgICAgIHJldHVybiBUb29scy5Jc05vdE51bGwoRVhURU5TSU9OKVxyXG4gICAgICAgICAgICA/IHRoaXMuRVhDRUxfRVhURU5TSU9OUy5pbmNsdWRlcyhFWFRFTlNJT04hKVxyXG4gICAgICAgICAgICA6IGZhbHNlO1xyXG4gICAgfVxyXG5cclxuXHJcbiAgICAvKiogUmVhZCBleGNlbCBmaWxlICovXHJcbiAgICBwdWJsaWMgc3RhdGljIFJlYWRFeGNlbDxUPihmaWxlOiBGaWxlKSB7XHJcbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlPHsgY29sdW1uczogc3RyaW5nW107IHJvd3M6IFRbXTsgfT4oUmVzb2x2ZSA9PiB7XHJcbiAgICAgICAgICAgIGxldCBjb2x1bW5zOiBzdHJpbmdbXSA9IFtdO1xyXG4gICAgICAgICAgICBsZXQgcm93czogVFtdID0gW107XHJcblxyXG4gICAgICAgICAgICBjb25zdCByZWFkZXIgPSBuZXcgRmlsZVJlYWRlcigpO1xyXG4gICAgICAgICAgICByZWFkZXIucmVhZEFzQXJyYXlCdWZmZXIoZmlsZSk7XHJcblxyXG4gICAgICAgICAgICByZWFkZXIub25sb2FkID0gKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZGF0YUJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkocmVhZGVyLnJlc3VsdCBhcyBhbnkpO1xyXG5cclxuICAgICAgICAgICAgICAgIGlmIChkYXRhQnl0ZXMpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCB3b3JrYm9vayA9IFhMU1gucmVhZChkYXRhQnl0ZXMsIHt9KTtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzaGVldCA9IHdvcmtib29rLlNoZWV0c1t3b3JrYm9vay5TaGVldE5hbWVzWzBdXTtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YVNoZWV0OiBhbnlbXSA9IFhMU1gudXRpbHMuc2hlZXRfdG9fanNvbihzaGVldCwge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXI6IFsnQScsICdCJywgJ0MnLCAnRCcsICdFJywgJ0YnLCAnRycsICdIJywgJ0knLCAnSicsICdLJywgJ0wnLCAnTScsICdOJywgJ08nLCAnUCcsICdRJywgJ1InLCAnUycsICdUJywgJ1UnLCAnVicsICdXJywgJ1gnLCAnWScsICdaJ11cclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLy9HZXQgSGVhZGVyc1xyXG4gICAgICAgICAgICAgICAgICAgIGZvcihjb25zdCBjb2x1bW4gaW4gZGF0YVNoZWV0WzBdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtbnMucHVzaChUb29scy5GaXJzdENoYXJUb0xvd2VyKFN0cmluZyhkYXRhU2hlZXRbMF1bY29sdW1uXSkucmVwbGFjZUFsbCgnICcsICcnKSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLy9HZXQgUm93c1xyXG4gICAgICAgICAgICAgICAgICAgIHJvd3MgPSBYTFNYLnV0aWxzLnNoZWV0X3RvX2pzb24oc2hlZXQsIHsgaGVhZGVyOiBjb2x1bW5zIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIHJvd3Muc2hpZnQoKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgcm93cyA9IHJvd3MubWFwKHJvdyA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGl0ZW0gPSBUb29scy5CcmVha1JlZmVyZW5jZTxhbnk+KHJvdyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBpdGVtWydfX3Jvd051bV9fJ107XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpdGVtO1xyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAg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FtZSArPSAnLnhsc3gnO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgY29uc3QgV09SS19TSEVFVCA9IFhMU1gudXRpbHMuanNvbl90b19zaGVldChkYXRhKTtcclxuICAgICAgICBjb25zdCBXT1JLX0JPT0sgPSBYTFNYLnV0aWxzLmJvb2tfbmV3KCk7XHJcbiAgICAgICAgWExTWC51dGlscy5ib29rX2FwcGVuZF9zaGVldChXT1JLX0JPT0ssIFdPUktfU0hFRVQsIHNoZWV0TmFtZSk7XHJcbiAgICAgICAgWExTWC53cml0ZUZpbGUoV09SS19CT09LLCBmaWxlTmFtZSk7XHJcbiAgICB9XHJcblxyXG5cclxuICAgIC8qKiBDb252ZXJ0IGZpbGUgdG8gc3RyaW5nIGJhc2U2NCAqL1xyXG4gICAgcHVibGljIHN0YXRpYyBDb252ZXJ0VG9CYXNlNjQoZmlsZTogRmlsZSkge1xyXG4gICAgICAgIHJldHVybiBuZXcgUHJvbWlzZTxzdHJpbmc+KFJlc29sdmUgPT4ge1xyXG4gICAgICAgICAgICBjb25zdCByZWFkZXIgPSBuZXcgRmlsZVJlYWRlcigpO1xyXG4gICAgICAgICAgICByZWFkZXIucmVhZEFzRGF0YVVSTChmaWxlKTtcclxuXHJcbiAgICAgICAgICAgIHJlYWRlci5vbmxvYWQgPSAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBSZXNvbHZlKHJlYWRlci5yZXN1bHQ/LnRvU3RyaW5nKCkgfHwgJycpO1xyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICByZWFkZXIub25lcnJvciA9ICgpID0+IFJlc29sdmUoJycpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG59Il19
|
@@ -0,0 +1,199 @@
|
|
1
|
+
import { signal } from "@angular/core";
|
2
|
+
const reference_signal = signal({});
|
3
|
+
export const Tools = {
|
4
|
+
/** Generate a Guid */
|
5
|
+
GetGuid: (seed = 'coer-system') => {
|
6
|
+
let time = new Date().getTime();
|
7
|
+
seed = seed.toString().trim();
|
8
|
+
return seed + `-xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g, (c) => {
|
9
|
+
const random = (time + Math.random() * 16) % 16 | 0;
|
10
|
+
time = Math.floor(time / 16);
|
11
|
+
return (c == 'x' ? random : (random & 0x3 | 0x8)).toString(16);
|
12
|
+
});
|
13
|
+
},
|
14
|
+
/** Returns true if the value is null or undefined, false otherwise */
|
15
|
+
IsNull: (value) => {
|
16
|
+
if (value === undefined)
|
17
|
+
return true;
|
18
|
+
if (value === null)
|
19
|
+
return true;
|
20
|
+
return false;
|
21
|
+
},
|
22
|
+
/** Returns true if the value is not null or undefined, false otherwise */
|
23
|
+
IsNotNull: (value) => {
|
24
|
+
if (value === undefined)
|
25
|
+
return false;
|
26
|
+
if (value === null)
|
27
|
+
return false;
|
28
|
+
return true;
|
29
|
+
},
|
30
|
+
/** Returns true if the value is null or undefined or contains only whitespace, false otherwise */
|
31
|
+
IsOnlyWhiteSpace: (value) => {
|
32
|
+
if (value === undefined)
|
33
|
+
return true;
|
34
|
+
if (value === null)
|
35
|
+
return true;
|
36
|
+
if (value.toString().trim() === '')
|
37
|
+
return true;
|
38
|
+
return false;
|
39
|
+
},
|
40
|
+
/** Break reference of a object or array */
|
41
|
+
BreakReference: (object) => {
|
42
|
+
if (object === undefined)
|
43
|
+
return undefined;
|
44
|
+
if (object === null)
|
45
|
+
return null;
|
46
|
+
const OBJECT = JSON.parse(JSON.stringify(object));
|
47
|
+
return (Array.isArray(OBJECT)) ? [...OBJECT] : { ...OBJECT };
|
48
|
+
},
|
49
|
+
/** Clean extra whitespaces */
|
50
|
+
CleanUpBlanks: (text) => {
|
51
|
+
if (Tools.IsNull(text))
|
52
|
+
return '';
|
53
|
+
let worlds = String(text).split(' ');
|
54
|
+
worlds = worlds.filter(x => x.length > 0);
|
55
|
+
return worlds.join(' ');
|
56
|
+
},
|
57
|
+
/** Get properties of an object */
|
58
|
+
GetObjectProperties: (obj) => {
|
59
|
+
const properties = [];
|
60
|
+
if (Tools.IsNull(obj))
|
61
|
+
return properties;
|
62
|
+
for (const property in obj)
|
63
|
+
properties.push(String(property));
|
64
|
+
return properties;
|
65
|
+
},
|
66
|
+
/**
|
67
|
+
* Set an index and merge more arrays of the same type
|
68
|
+
* */
|
69
|
+
SetIndex: (array, ...args) => {
|
70
|
+
let index = 0;
|
71
|
+
for (const arg of args) {
|
72
|
+
array = Tools.BreakReference(array).concat(Tools.BreakReference(arg));
|
73
|
+
}
|
74
|
+
return Tools.BreakReference(array).map(item => Object.assign({ index: index++ }, item));
|
75
|
+
},
|
76
|
+
/** Set First Char To Lower */
|
77
|
+
FirstCharToLower: (text) => {
|
78
|
+
if (Tools.IsNull(text))
|
79
|
+
return '';
|
80
|
+
const textArray = [];
|
81
|
+
for (let i = 0; i < text.length; i++) {
|
82
|
+
if (i === 0)
|
83
|
+
textArray.push(text[i].toLowerCase());
|
84
|
+
else
|
85
|
+
textArray.push(text[i]);
|
86
|
+
}
|
87
|
+
return textArray.join('');
|
88
|
+
},
|
89
|
+
/** Set First Char To Upper */
|
90
|
+
FirstCharToUpper: (text) => {
|
91
|
+
if (Tools.IsNull(text))
|
92
|
+
return '';
|
93
|
+
const textArray = [];
|
94
|
+
for (let i = 0; i < text.length; i++) {
|
95
|
+
if (i === 0)
|
96
|
+
textArray.push(text[i].toUpperCase());
|
97
|
+
else
|
98
|
+
textArray.push(text[i]);
|
99
|
+
}
|
100
|
+
return textArray.join('');
|
101
|
+
},
|
102
|
+
/** Sort an array in ascending order by property */
|
103
|
+
SortBy: (array, property, propertyType = 'string') => {
|
104
|
+
switch (propertyType) {
|
105
|
+
case 'string': {
|
106
|
+
return array.sort((x, y) => {
|
107
|
+
if (String(x[property]).toUpperCase().trim() < String(y[property]).toUpperCase().trim())
|
108
|
+
return -1;
|
109
|
+
else if (String(x[property]).toUpperCase().trim() > String(y[property]).toUpperCase().trim())
|
110
|
+
return 1;
|
111
|
+
else
|
112
|
+
return 0;
|
113
|
+
});
|
114
|
+
}
|
115
|
+
case 'number': {
|
116
|
+
return array.sort((x, y) => Number(x[property] - Number(y[property])));
|
117
|
+
}
|
118
|
+
}
|
119
|
+
},
|
120
|
+
/** Sort an array in descending order by property */
|
121
|
+
SortByDesc: (array, property, propertyType = 'string') => {
|
122
|
+
switch (propertyType) {
|
123
|
+
case 'string': {
|
124
|
+
return array.sort((x, y) => {
|
125
|
+
if (String(x[property]).toUpperCase().trim() < String(y[property]).toUpperCase().trim())
|
126
|
+
return 1;
|
127
|
+
else if (String(x[property]).toUpperCase().trim() > String(y[property]).toUpperCase().trim())
|
128
|
+
return -1;
|
129
|
+
else
|
130
|
+
return 0;
|
131
|
+
});
|
132
|
+
}
|
133
|
+
case 'number': {
|
134
|
+
return array.sort((x, y) => Number(Number(y[property])) - x[property]);
|
135
|
+
}
|
136
|
+
}
|
137
|
+
},
|
138
|
+
/** Return a string with forman numeric */
|
139
|
+
GetNumericFormat: (value, decimals = 0) => {
|
140
|
+
if (value == undefined
|
141
|
+
|| value == null
|
142
|
+
|| value.toString().trim() == ''
|
143
|
+
|| isNaN(Number(value))) {
|
144
|
+
return '0';
|
145
|
+
}
|
146
|
+
let valueInteger = '';
|
147
|
+
let valueDecimal = '';
|
148
|
+
value = value.toString().replaceAll(' ', '');
|
149
|
+
if (value.includes('.') || (decimals > 0)) {
|
150
|
+
valueInteger = value.includes('.') ? value.split('.')[0] : value;
|
151
|
+
if (decimals > 0) {
|
152
|
+
const PADDING = decimals - valueDecimal.length;
|
153
|
+
valueDecimal = value.includes('.') ? value.split('.')[1] : '';
|
154
|
+
for (let i = 0; i < PADDING; i++)
|
155
|
+
valueDecimal += '0';
|
156
|
+
valueDecimal = valueDecimal.substring(0, decimals);
|
157
|
+
valueDecimal = `.${valueDecimal}`;
|
158
|
+
}
|
159
|
+
}
|
160
|
+
else {
|
161
|
+
valueInteger = value;
|
162
|
+
}
|
163
|
+
let counter = 0;
|
164
|
+
const VALUE_INTEGER_ARRAY = [];
|
165
|
+
for (const char of valueInteger.split('').reverse()) {
|
166
|
+
if (counter == 3) {
|
167
|
+
VALUE_INTEGER_ARRAY.push(',');
|
168
|
+
counter = 0;
|
169
|
+
}
|
170
|
+
VALUE_INTEGER_ARRAY.push(char);
|
171
|
+
++counter;
|
172
|
+
}
|
173
|
+
valueInteger = VALUE_INTEGER_ARRAY.reverse().join('');
|
174
|
+
return `${valueInteger}${valueDecimal}`;
|
175
|
+
},
|
176
|
+
/** Wait the time indicated */
|
177
|
+
Sleep: (milliseconds = 0, reference = null) => {
|
178
|
+
if (Tools.IsNull(reference)) {
|
179
|
+
return new Promise(Resolve => setTimeout(Resolve, milliseconds));
|
180
|
+
}
|
181
|
+
else
|
182
|
+
return new Promise(Resolve => {
|
183
|
+
reference = reference.replaceAll(' ', '_').toLowerCase();
|
184
|
+
if (reference_signal().hasOwnProperty(reference)) {
|
185
|
+
clearInterval(reference_signal()[reference]);
|
186
|
+
}
|
187
|
+
reference_signal.set(Object.assign(reference_signal(), {
|
188
|
+
[reference]: setTimeout(() => {
|
189
|
+
Resolve();
|
190
|
+
clearInterval(reference_signal()[reference]);
|
191
|
+
const _reference = { ...reference_signal() };
|
192
|
+
delete _reference[reference];
|
193
|
+
reference_signal.set({ ..._reference });
|
194
|
+
}, milliseconds)
|
195
|
+
}));
|
196
|
+
});
|
197
|
+
}
|
198
|
+
};
|
199
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJpLXRvb2xzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29lci1lbGVtZW50cy9zcmMvdG9vbHMvbGliL2dlbmVyaS10b29scy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3ZDLE1BQU0sZ0JBQWd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biAgICAgICAgICAgIGlmKGkgPT09IDApIHRleHRBcnJheS5wdXNoKHRleHQhW2ldLnRvVXBwZXJDYXNlKCkpO1xyXG4gICAgICAgICAgICBlbHNlIHRleHRBcnJheS5wdXNoKHRleHQhW2ldKTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiB0ZXh0QXJyYXkuam9pbignJyk7XHJcbiAgICB9LFxyXG5cclxuXHJcbiAgICAvKiogU29ydCBhbiBhcnJheSBpbiBhc2NlbmRpbmcgb3JkZXIgYnkgcHJvcGVydHkgKi9cclxuICAgIFNvcnRCeTogPFQ+KGFycmF5OiBUW10sIHByb3BlcnR5OiBzdHJpbmcsIHByb3BlcnR5VHlwZTogJ3N0cmluZycgfCAnbnVtYmVyJyA9ICdzdHJpbmcnKTogVFtdID0+IHtcclxuICAgICAgICBzd2l0Y2ggKHByb3BlcnR5VHlwZSkge1xyXG4gICAgICAgICAgICBjYXNlICdzdHJpbmcnOiB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gYXJyYXkuc29ydCgoeDogYW55LCB5OiBhbnkpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoU3RyaW5nKHhbcHJvcGVydHldKS50b1VwcGVyQ2FzZSgpLnRyaW0oKSA8IFN0cmluZyh5W3Byb3BlcnR5XSkudG9VcHBlckNhc2UoKS50cmltKCkpIHJldHVybiAtMTtcclxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChTdHJpbmcoeFtwcm9wZXJ0eV0pLnRvVXBwZXJDYXNlKCkudHJpbSgpID4gU3RyaW5nKHlbcHJvcGVydHldKS50b1VwcGVyQ2FzZSgpLnRyaW0oKSkgcmV0dXJuIDE7XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSByZXR1cm4gMDtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICBjYXNlICdudW1iZXInOiB7XHJcbiAgICAgICAgICAgICAgICByZXR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x1ZURlY2ltYWwgPSB2YWx1ZS5pbmNsdWRlcygnLicpID8gdmFsdWUuc3BsaXQoJy4nKVsxXSA6ICcnO1xyXG4gICAgICAgICAgICAgICAgZm9yKGxldCBpID0gMDsgaSA8IFBBRERJTkc7IGkrKykgdmFsdWVEZWNpbWFsICs9ICcwJztcclxuICAgICAgICAgICAgICAgIHZhbHVlRGVjaW1hbCA9IHZhbHVlRGVjaW1hbC5zdWJzdHJpbmcoMCwgZGVjaW1hbHMpO1xyXG4gICAgICAgICAgICAgICAgdmFsdWVEZWNpbWFsID0gYC4ke3ZhbHVlRGVjaW1hbH1gO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgdmFsdWVJbnRlZ2VyID0gdmFsdWU7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBsZXQgY291bnRlciA9IDA7XHJcbiAgICAgICAgY29uc3QgVkFMVUVfSU5URUdFUl9BUlJBWTogc3RyaW5nW10gPSBbXTtcclxuICAgICAgICBmb3IoY29uc3QgY2hhciBvZiB2YWx1ZUludGVnZXIuc3BsaXQoJycpLnJldmVyc2UoKSkge1xyXG4gICAgICAgICAgICBpZiAoY291bnRlciA9PSAzKSB7XHJcbiAgICAgICAgICAgICAgICBWQUxVRV9JTlRFR0VSX0FSUkFZLnB1c2goJywnKTtcclxuICAgICAgICAgICAgICAgIGNvdW50ZXIgPSAwO1xyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICBWQUxVRV9JTlRFR0VSX0FSUkFZLnB1c2goY2hhcik7XHJcbiAgICAgICAgICAgICsrY291bnRlcjtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHZhbHVlSW50ZWdlciA9IFZBTFVFX0lOVEVHRVJfQVJSQVkucmV2ZXJzZSgpLmpvaW4oJycpO1xyXG4gICAgICAgIHJldHVybiBgJHt2YWx1ZUludGVnZXJ9JHt2YWx1ZURlY2ltYWx9YDtcclxuICAgIH0sXHJcblxyXG5cclxuICAgIC8qKiBXYWl0IHRoZSB0aW1lIGluZGljYXRlZCAqL1xyXG4gICAgU2xlZXA6IChtaWxsaXNlY29uZHM6IG51bWJlciA9IDAsIHJlZmVyZW5jZTogc3RyaW5nIHwgbnVsbCA9IG51bGwpID0+IHtcclxuICAgICAgICBpZiAoVG9vbHMuSXNOdWxsKHJlZmVyZW5jZSkpIHtcclxuICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKFJlc29sdmUgPT4gc2V0VGltZW91dChSZXNvbHZlLCBtaWxsaXNlY29uZHMpKTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGVsc2UgcmV0dXJuIG5ldyBQcm9taXNlPHZvaWQ+KFJlc29sdmUgPT4ge1xyXG4gICAgICAgICAgICByZWZlcmVuY2UgPSByZWZlcmVuY2UhLnJlcGxhY2VBbGwoJyAnLCAnXycpLnRvTG93ZXJDYXNlKCk7XHJcblxyXG4gICAgICAgICAgICBpZiAocmVmZXJlbmNlX3NpZ25hbCgpLmhhc093blByb3BlcnR5KHJlZmVyZW5jZSkpIHtcclxuICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwocmVmZXJlbmNlX3NpZ25hbCgpW3JlZmVyZW5jZSFdKTtcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgcmVmZXJlbmNlX3NpZ25hbC5zZXQoT2JqZWN0LmFzc2lnbihyZWZlcmVuY2Vfc2lnbmFsKCksIHtcclxuICAgICAgICAgICAgICAgIFtyZWZlcmVuY2UhXTogc2V0VGltZW91dCgoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgUmVzb2x2ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwocmVmZXJlbmNlX3NpZ25hbCgpW3JlZmVyZW5jZSFdKTtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBfcmVmZXJlbmNlID0geyAuLi5yZWZlcmVuY2Vfc2lnbmFsKCkgfTtcclxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgX3JlZmVyZW5jZVtyZWZlcmVuY2UhXTtcclxuICAgICAgICAgICAgICAgICAgICByZWZlcmVuY2Vfc2lnbmFsLnNldCh7IC4uLl9yZWZlcmVuY2UgfSk7XHJcbiAgICAgICAgICAgICAgICB9LCBtaWxsaXNlY29uZHMpXHJcbiAgICAgICAgICAgIH0pKTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxufTsiXX0=
|