coer-elements 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- package/components/index.d.ts +12 -0
- package/components/lib/coer-button/coer-button.component.d.ts +3 -3
- package/components/lib/coer-checkbox/coer-checkbox.component.d.ts +28 -0
- package/components/lib/coer-filebox/coer-filebox.component.d.ts +33 -0
- package/components/lib/coer-form/coer-form.component.d.ts +33 -0
- package/components/lib/coer-grid/coer-grid.component.d.ts +53 -0
- package/components/lib/coer-grid/coer-grid.extension.d.ts +105 -0
- package/components/lib/coer-modal/coer-modal.component.d.ts +38 -0
- package/components/lib/coer-numberbox/coer-numberbox.component.d.ts +56 -0
- package/components/lib/coer-page-title/coer-page-title.component.d.ts +12 -0
- package/components/lib/coer-selectbox/coer-selectbox.component.d.ts +75 -0
- package/components/lib/coer-switch/coer-switch.component.d.ts +31 -0
- package/components/lib/coer-tab/coer-tab.component.d.ts +35 -0
- package/components/lib/coer-textarea/coer-textarea.component.d.ts +51 -0
- package/components/lib/coer-textbox/coer-textbox.component.d.ts +57 -0
- package/components/lib/components.module.d.ts +24 -5
- package/directives/index.d.ts +3 -0
- package/directives/lib/coer-ref.directive.d.ts +14 -0
- package/directives/lib/directives.module.d.ts +8 -0
- package/directives/lib/life-cycle.directive.d.ts +14 -0
- package/esm2022/components/index.mjs +13 -1
- package/esm2022/components/lib/coer-button/coer-button.component.mjs +2 -2
- package/esm2022/components/lib/coer-checkbox/coer-checkbox.component.mjs +84 -0
- package/esm2022/components/lib/coer-filebox/coer-filebox.component.mjs +104 -0
- package/esm2022/components/lib/coer-form/coer-form.component.mjs +102 -0
- package/esm2022/components/lib/coer-grid/coer-grid.component.mjs +515 -0
- package/esm2022/components/lib/coer-grid/coer-grid.extension.mjs +412 -0
- package/esm2022/components/lib/coer-modal/coer-modal.component.mjs +108 -0
- package/esm2022/components/lib/coer-numberbox/coer-numberbox.component.mjs +260 -0
- package/esm2022/components/lib/coer-page-title/coer-page-title.component.mjs +44 -0
- package/esm2022/components/lib/coer-selectbox/coer-selectbox.component.mjs +339 -0
- package/esm2022/components/lib/coer-switch/coer-switch.component.mjs +94 -0
- package/esm2022/components/lib/coer-tab/coer-tab.component.mjs +116 -0
- package/esm2022/components/lib/coer-textarea/coer-textarea.component.mjs +157 -0
- package/esm2022/components/lib/coer-textbox/coer-textbox.component.mjs +196 -0
- package/esm2022/components/lib/components.module.mjs +93 -57
- package/esm2022/directives/index.mjs +4 -0
- package/esm2022/directives/lib/coer-ref.directive.mjs +23 -0
- package/esm2022/directives/lib/directives.module.mjs +25 -0
- package/esm2022/directives/lib/life-cycle.directive.mjs +29 -0
- package/esm2022/interfaces/coer-filebox/index.mjs +3 -0
- package/esm2022/interfaces/coer-grid/index.mjs +21 -0
- package/esm2022/interfaces/index.mjs +1 -3
- package/esm2022/interfaces/lib/coer-filebox/file-image.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-filebox/file.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-button-by-row.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-checkbox.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-coer-numberbox.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-coer-selectbox.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-coer-switch.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-coer-textbox.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-column.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-data-source.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-header-button.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-header-export-button.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-header.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-import.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-input-checkbox.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-input-switch-change.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-input-textbox.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-item.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-keyup-enter.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-length.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-search.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-sort.interface.mjs +2 -0
- package/esm2022/interfaces/lib/menu/menu-option-selected.interface.mjs +2 -0
- package/esm2022/interfaces/lib/menu/menu.interface.mjs +2 -0
- package/esm2022/interfaces/lib/page-title/breadcrumb.interface.mjs +2 -0
- package/esm2022/interfaces/lib/page-title/go-back.interface.mjs +2 -0
- package/esm2022/interfaces/page-title/index.mjs +3 -0
- package/esm2022/pipes/index.mjs +5 -0
- package/esm2022/pipes/lib/html.pipe.mjs +18 -0
- package/esm2022/pipes/lib/no-image.pipe.mjs +23 -0
- package/esm2022/pipes/lib/numeric-format.pipe.mjs +15 -0
- package/esm2022/pipes/lib/pipes.module.mjs +31 -0
- package/esm2022/public_api.mjs +3 -1
- package/esm2022/signals/lib/breakpoint.signal.mjs +2 -2
- package/esm2022/signals/lib/is-loading.signal.mjs +2 -2
- package/esm2022/signals/lib/is-modal-open.signal.mjs +2 -2
- package/esm2022/tools/index.mjs +3 -2
- package/esm2022/tools/lib/breadcrumbs.class.mjs +2 -2
- package/esm2022/tools/lib/date-time.class.mjs +14 -7
- package/esm2022/tools/lib/files.class.mjs +2 -2
- package/esm2022/tools/lib/menu.class.mjs +23 -0
- package/esm2022/tools/lib/page.class.mjs +6 -6
- package/esm2022/tools/lib/screen.class.mjs +9 -1
- package/esm2022/tools/lib/source.class.mjs +3 -3
- package/esm2022/tools/lib/tools.mjs +220 -0
- package/fesm2022/coer-elements.mjs +3266 -603
- package/fesm2022/coer-elements.mjs.map +1 -1
- package/interfaces/coer-filebox/index.d.ts +2 -0
- package/interfaces/coer-grid/index.d.ts +20 -0
- package/interfaces/index.d.ts +0 -2
- package/interfaces/lib/coer-filebox/file-image.interface.d.ts +14 -0
- package/interfaces/lib/coer-filebox/file.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-button-by-row.interface.d.ts +6 -0
- package/interfaces/lib/coer-grid/grid-checkbox.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-coer-numberbox.interface.d.ts +12 -0
- package/interfaces/lib/coer-grid/grid-coer-selectbox.interface.d.ts +9 -0
- package/interfaces/lib/coer-grid/grid-coer-switch.interface.d.ts +6 -0
- package/interfaces/lib/coer-grid/grid-coer-textbox.interface.d.ts +11 -0
- package/interfaces/lib/coer-grid/grid-column.interface.d.ts +22 -0
- package/interfaces/lib/coer-grid/grid-data-source.interface.d.ts +6 -0
- package/interfaces/lib/coer-grid/grid-header-button.interface.d.ts +8 -0
- package/interfaces/lib/coer-grid/grid-header-export-button.interface.d.ts +10 -0
- package/interfaces/lib/coer-grid/grid-header.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-import.interface.d.ts +4 -0
- package/interfaces/lib/coer-grid/grid-input-checkbox.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-input-switch-change.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-input-textbox.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-item.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-keyup-enter.interface.d.ts +6 -0
- package/interfaces/lib/coer-grid/grid-length.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-search.interface.d.ts +4 -0
- package/interfaces/lib/coer-grid/grid-sort.interface.d.ts +5 -0
- package/interfaces/lib/menu/menu-option-selected.interface.d.ts +9 -0
- package/interfaces/lib/menu/menu.interface.d.ts +6 -0
- package/interfaces/page-title/index.d.ts +2 -0
- package/package.json +1 -1
- package/pipes/index.d.ts +4 -0
- package/pipes/lib/html.pipe.d.ts +10 -0
- package/pipes/lib/no-image.pipe.d.ts +7 -0
- package/pipes/lib/numeric-format.pipe.d.ts +7 -0
- package/pipes/lib/pipes.module.d.ts +9 -0
- package/public_api.d.ts +2 -0
- package/signals/lib/is-loading.signal.d.ts +1 -1
- package/signals/lib/is-modal-open.signal.d.ts +1 -1
- package/src/interfaces/coer-filebox/index.ts +2 -0
- package/src/interfaces/coer-grid/index.ts +20 -0
- package/src/interfaces/index.ts +1 -3
- package/src/interfaces/lib/coer-filebox/file-image.interface.ts +14 -0
- package/src/interfaces/lib/coer-filebox/file.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-button-by-row.interface.ts +7 -0
- package/src/interfaces/lib/coer-grid/grid-checkbox.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-coer-numberbox.interface.ts +12 -0
- package/src/interfaces/lib/coer-grid/grid-coer-selectbox.interface.ts +9 -0
- package/src/interfaces/lib/coer-grid/grid-coer-switch.interface.ts +6 -0
- package/src/interfaces/lib/coer-grid/grid-coer-textbox.interface.ts +11 -0
- package/src/interfaces/lib/coer-grid/grid-column.interface.ts +23 -0
- package/src/interfaces/lib/coer-grid/grid-data-source.interface.ts +6 -0
- package/src/interfaces/lib/coer-grid/grid-header-button.interface.ts +8 -0
- package/src/interfaces/lib/coer-grid/grid-header-export-button.interface.ts +10 -0
- package/src/interfaces/lib/coer-grid/grid-header.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-import.interface.ts +4 -0
- package/src/interfaces/lib/coer-grid/grid-input-checkbox.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-input-switch-change.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-input-textbox.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-item.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-keyup-enter.interface.ts +6 -0
- package/src/interfaces/lib/coer-grid/grid-length.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-search.interface.ts +4 -0
- package/src/interfaces/lib/coer-grid/grid-sort.interface.ts +5 -0
- package/src/interfaces/lib/menu/menu-option-selected.interface.ts +10 -0
- package/src/interfaces/lib/menu/menu-selected.interface.ts +11 -0
- package/src/interfaces/lib/menu/menu.interface.ts +6 -0
- package/src/interfaces/menu/index.ts +3 -0
- package/src/interfaces/page-title/index.ts +2 -0
- package/tools/index.d.ts +2 -1
- package/tools/lib/breadcrumbs.class.d.ts +1 -1
- package/tools/lib/date-time.class.d.ts +4 -2
- package/tools/lib/menu.class.d.ts +8 -0
- package/tools/lib/page.class.d.ts +4 -3
- package/tools/lib/screen.class.d.ts +3 -1
- package/tools/lib/source.class.d.ts +1 -1
- package/tools/lib/{generi-tools.d.ts → tools.d.ts} +7 -5
- package/esm2022/interfaces/lib/breadcrumb.interface.mjs +0 -2
- package/esm2022/interfaces/lib/go-back.interface.mjs +0 -2
- package/esm2022/tools/lib/generi-tools.mjs +0 -199
- /package/interfaces/lib/{breadcrumb.interface.d.ts → page-title/breadcrumb.interface.d.ts} +0 -0
- /package/interfaces/lib/{go-back.interface.d.ts → page-title/go-back.interface.d.ts} +0 -0
- /package/src/interfaces/lib/{breadcrumb.interface.ts → page-title/breadcrumb.interface.ts} +0 -0
- /package/src/interfaces/lib/{go-back.interface.ts → page-title/go-back.interface.ts} +0 -0
- /package/src/styles/{coer-elements.scss → index.scss} +0 -0
@@ -2,10 +2,12 @@ import moment from "moment";
|
|
2
2
|
export declare class DateTime {
|
3
3
|
/** Get UTC Offset */
|
4
4
|
static GetOffset(): number;
|
5
|
+
/** YYYY-MM-DD HH:mm:ss */
|
6
|
+
static GetFormatDB(date: string | Date | moment.Moment): string;
|
5
7
|
/** Convert UTC Date to Local Zone */
|
6
|
-
static ToLocalZone(
|
8
|
+
static ToLocalZone(date: string | Date | moment.Moment): string;
|
7
9
|
/** Convert Local Zone Date to UTC */
|
8
|
-
static ToUTC(
|
10
|
+
static ToUTC(date: string | Date | moment.Moment): string;
|
9
11
|
/** DD MMM YYYY */
|
10
12
|
static GetDateFormat(date: string | Date | moment.Moment): string;
|
11
13
|
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { IMenuOptionSelected } from "../../interfaces/lib/menu/menu-option-selected.interface";
|
2
|
+
export declare class Menu {
|
3
|
+
private static readonly storage;
|
4
|
+
/** */
|
5
|
+
static Set(menu: IMenuOptionSelected): void;
|
6
|
+
/** */
|
7
|
+
static Get(): IMenuOptionSelected | null;
|
8
|
+
}
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import { AfterViewInit, OnDestroy } from '@angular/core';
|
2
1
|
import { Router } from '@angular/router';
|
3
|
-
import {
|
4
|
-
import {
|
2
|
+
import { AfterViewInit, OnDestroy } from '@angular/core';
|
3
|
+
import { IBreadcrumb } from '../../interfaces/lib/page-title/breadcrumb.interface';
|
4
|
+
import { IGoBack } from '../../interfaces/lib/page-title/go-back.interface';
|
5
|
+
import { CoerAlert } from '../../components/lib/coer-alert/coer-alert.component';
|
5
6
|
import * as i0 from "@angular/core";
|
6
7
|
export declare class Page implements AfterViewInit, OnDestroy {
|
7
8
|
protected readonly alert: CoerAlert;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Observable } from "rxjs";
|
2
|
-
import { IScreenSize } from "../../interfaces";
|
2
|
+
import { IScreenSize } from "../../interfaces/lib/screen-size.interface";
|
3
3
|
export declare class Screen {
|
4
4
|
static get WINDOW_WIDTH(): number;
|
5
5
|
static get WINDOW_HEIGHT(): number;
|
@@ -8,4 +8,6 @@ export declare class Screen {
|
|
8
8
|
static get BREAKPOINT(): 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
9
9
|
/** */
|
10
10
|
static Resize: Observable<IScreenSize>;
|
11
|
+
/** */
|
12
|
+
static BackButtonBrowser: Observable<string>;
|
11
13
|
}
|
@@ -7,24 +7,26 @@ export declare const Tools: {
|
|
7
7
|
IsNotNull: <T_1>(value: T_1 | null | undefined) => boolean;
|
8
8
|
/** Returns true if the value is null or undefined or contains only whitespace, false otherwise */
|
9
9
|
IsOnlyWhiteSpace: <T_2>(value: T_2 | null | undefined) => boolean;
|
10
|
+
/** Returns true if has string value and is not only whitespace, false otherwise */
|
11
|
+
IsNotOnlyWhiteSpace: <T_3>(value: T_3 | null | undefined) => boolean;
|
10
12
|
/** Break reference of a object or array */
|
11
|
-
BreakReference: <
|
13
|
+
BreakReference: <T_4>(object: T_4) => T_4;
|
12
14
|
/** Clean extra whitespaces */
|
13
15
|
CleanUpBlanks: (text: string | number) => string;
|
14
16
|
/** Get properties of an object */
|
15
|
-
GetObjectProperties: <
|
17
|
+
GetObjectProperties: <T_5>(obj: T_5 | null | undefined) => string[];
|
16
18
|
/**
|
17
19
|
* Set an index and merge more arrays of the same type
|
18
20
|
* */
|
19
|
-
SetIndex: <
|
21
|
+
SetIndex: <T_6>(array: T_6[], ...args: T_6[][]) => T_6[];
|
20
22
|
/** Set First Char To Lower */
|
21
23
|
FirstCharToLower: (text: string | null | undefined) => string;
|
22
24
|
/** Set First Char To Upper */
|
23
25
|
FirstCharToUpper: (text: string | null | undefined) => string;
|
24
26
|
/** Sort an array in ascending order by property */
|
25
|
-
SortBy: <
|
27
|
+
SortBy: <T_7>(array: T_7[], property: string, propertyType?: 'string' | 'number') => T_7[];
|
26
28
|
/** Sort an array in descending order by property */
|
27
|
-
SortByDesc: <
|
29
|
+
SortByDesc: <T_8>(array: T_8[], property: string, propertyType?: 'string' | 'number') => T_8[];
|
28
30
|
/** Return a string with forman numeric */
|
29
31
|
GetNumericFormat: (value: string | number | null | undefined, decimals?: number) => string;
|
30
32
|
/** Wait the time indicated */
|
@@ -1,2 +0,0 @@
|
|
1
|
-
export {};
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnJlYWRjcnVtYi5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb2VyLWVsZW1lbnRzL3NyYy9pbnRlcmZhY2VzL2xpYi9icmVhZGNydW1iLmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBJQnJlYWRjcnVtYiB7XHJcbiAgICBwYWdlOiBzdHJpbmc7XHJcbiAgICBwYXRoPzogc3RyaW5nIHwgbnVsbDtcclxuICAgIHF1ZXJ5UGFyYW1zPzogYW55O1xyXG4gICAgY2xpY2s/OiAoKCkgPT4gYW55KTtcclxufSJdfQ==
|
@@ -1,2 +0,0 @@
|
|
1
|
-
export {};
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ28tYmFjay5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb2VyLWVsZW1lbnRzL3NyYy9pbnRlcmZhY2VzL2xpYi9nby1iYWNrLmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBJR29CYWNrIHtcclxuICAgIHNob3c6IGJvb2xlYW47XHJcbiAgICBwYXRoPzogc3RyaW5nIHwgbnVsbDtcclxuICAgIHF1ZXJ5UGFyYW1zPzogYW55O1xyXG4gICAgY2xpY2s/OiAoKCkgPT4gYW55KTtcclxufSJdfQ==
|
@@ -1,199 +0,0 @@
|
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJpLXRvb2xzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29lci1lbGVtZW50cy9zcmMvdG9vbHMvbGliL2dlbmVyaS10b29scy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3ZDLE1BQU0sZ0JBQWdCLEdBQUcsTUFBTSxDQUFNLEVBQUUsQ0FBQyxDQUFDO0FBRXpDLE1BQU0sQ0FBQyxNQUFNLEtBQUssR0FBRztJQUNqQixzQkFBc0I7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5nW10gPSBTdHJpbmcodGV4dCkuc3BsaXQoJyAnKTtcclxuICAgICAgICB3b3JsZHMgPSB3b3JsZHMuZmlsdGVyKHggPT4geC5sZW5ndGggPiAwKTtcclxuICAgICAgICByZXR1cm4gd29ybGRzLmpvaW4oJyAnKTtcclxuICAgIH0sXHJcblxyXG5cclxuICAgIC8qKiBHZXQgcHJvcGVydGllcyBvZiBhbiBvYmplY3QgKi9cclxuICAgIEdldE9iamVjdFByb3BlcnRpZXM6IDxUPihvYmo6IFQgfCBudWxsIHwgdW5kZWZpbmVkKTogc3RyaW5nW10gPT4ge1xyXG4gICAgICAgIGNvbnN0IHByb3BlcnRpZXM6IHN0cmluZ1tdID0gW107XHJcbiAgICAgICAgaWYoVG9vbHMuSXNOdWxsKG9iaikpIHJldHVybiBwcm9wZXJ0aWVzO1xyXG4gICAgICAgIGZvcihjb25zdCBwcm9wZXJ0eSBpbiBvYmopIHByb3BlcnRpZXMucHVzaChTdHJpbmcocHJvcGVydHkpKTtcclxuICAgICAgICByZXR1cm4gcHJvcGVydGllcztcclxuICAgIH0sXHJcblxyXG5cclxuICAgIC8qKlxyXG4gICAgICogU2V0IGFuIGluZGV4IGFuZCBtZXJnZSBtb3JlIGFycmF5cyBvZiB0aGUgc2FtZSB0eXBlXHJcbiAgICAgKiAqL1xyXG4gICAgU2V0SW5kZXg6IDxUPihhcnJheTogVFtdLCAuLi5hcmdzOiBUW11bXSk6IFRbXSA9PiB7XHJcbiAgICAgICAgbGV0IGluZGV4ID0gMDtcclxuICAgICAgICBmb3IgKGNvbnN0IGFyZyBvZiBhcmdzKSB7XHJcbiAgICAgICAgICAgIGFycmF5ID0gVG9vbHMuQnJlYWtSZWZlcmVuY2UoYXJyYXkpLmNvbmNhdChUb29scy5CcmVha1JlZmVyZW5jZShhcmcpKTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiBUb29scy5CcmVha1JlZmVyZW5jZShhcnJheSkubWFwKGl0ZW0gPT4gT2JqZWN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IHRleHRBcnJheS5wdXNoKHRleHQhW2ldKTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiB0ZXh0QXJyYXkuam9pbignJyk7XHJcbiAgICB9LFxyXG5cclxuXHJcbiAgICAvKiogU29ydCBhbiBhcnJheSBpbiBhc2NlbmRpbmcgb3JkZXIgYnkgcHJvcGVydHkgKi9cclxuICAgIFNvcnRCeTogPFQ+KGFycmF5OiBUW10sIHByb3BlcnR5OiBzdHJpbmcsIHByb3BlcnR5VHlwZTogJ3N0cmluZycgfCAnbnVtYmVyJyA9ICdzdHJpbmcnKTogVFtdID0+IHtcclxuICAgICAgICBzd2l0Y2ggKHByb3BlcnR5VHlwZSkge1xyXG4gICAgICAgICAgICBjYXNlICdzdHJpbmcnOiB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gYXJyYXkuc29ydCgoeDogYW55LCB5OiBhbnkpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoU3RyaW5nKHhbcHJvcGVydHldKS50b1VwcGVyQ2FzZSgpLnRyaW0oKSA8IFN0cmluZyh5W3Byb3BlcnR5XSkudG9VcHBlckNhc2UoKS50cmltKCkpIHJldHVybiAtMTtcclxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChTdHJpbmcoeFtwcm9wZXJ0eV0pLnRvVXBwZXJDYXNlKCkudHJpbSgpID4gU3RyaW5nKHlbcHJvcGVydHldKS50b1VwcGVyQ2FzZSgpLnRyaW0oKSkgcmV0dXJuIDE7XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSByZXR1cm4gMDtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICBjYXNlICdudW1iZXInOiB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gYXJyYXkuc29ydCgoeDogYW55LCB5OiBhbnkpID0+IE51bWJlcih4W3Byb3BlcnR5XSAtIE51bWJlcih5W3Byb3BlcnR5XSkpKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH0sXHJcblxyXG5cclxuICAgIC8qKiBTb3J0IGFuIGFycmF5IGluIGRlc2NlbmRpbmcgb3JkZXIgYnkgcHJvcGVydHkgKi9cclxuICAgIFNvcnRCeURlc2M6IDxUPihhcnJheTogVFtdLCBwcm9wZXJ0eTogc3RyaW5nLCBwcm9wZXJ0eVR5cGU6ICdzdHJpbmcnIHwgJ251bWJlcicgPSAnc3RyaW5nJyk6IFRbXSA9PiB7XHJcbiAgICAgICAgc3dpdGNoIChwcm9wZXJ0eVR5cGUpIHtcclxuICAgICAgICAgICAgY2FzZSAnc3RyaW5nJzoge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGFycmF5LnNvcnQoKHg6IGFueSwgeTogYW55KSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKFN0cmluZyh4W3Byb3BlcnR5XSkudG9VcHBlckNhc2UoKS50cmltKCkgPCBTdHJpbmcoeVtwcm9wZXJ0eV0pLnRvVXBwZXJDYXNlKCkudHJpbSgpKSByZXR1cm4gMTtcclxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChTdHJpbmcoeFtwcm9wZXJ0eV0pLnRvVXBwZXJDYXNlKCkudHJpbSgpID4gU3RyaW5nKHlbcHJvcGVydHldKS50b1VwcGVyQ2FzZSgpLnRyaW0oKSkgcmV0dXJuIC0xO1xyXG4gICAgICAgICAgICAgICAgICAgIGVsc2UgcmV0dXJuIDA7XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgY2FzZSAnbnVtYmVyJzoge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGFycmF5LnNvcnQoKHg6IGFueSwgeTogYW55KSA9PiBOdW1iZXIoTnVtYmVyKHlbcHJvcGVydHldKSkgLSB4W3Byb3BlcnR5XSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9LFx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m9yKGxldCBpID0gMDsgaSA8IFBBRERJTkc7IGkrKykgdmFsdWVEZWNpbWFsICs9ICcwJztcclxuICAgICAgICAgICAgICAgIHZhbHVlRGVjaW1hbCA9IHZhbHVlRGVjaW1hbC5zdWJzdHJpbmcoMCwgZGVjaW1hbHMpO1xyXG4gICAgICAgICAgICAgICAgdmFsdWVEZWNpbWFsID0gYC4ke3ZhbHVlRGVjaW1hbH1gO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgdmFsdWVJbnRlZ2VyID0gdmFsdWU7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBsZXQgY291bnRlciA9IDA7XHJcbiAgICAgICAgY29uc3QgVkFMVUVfSU5URUdFUl9BUlJBWTogc3RyaW5nW10gPSBbXTtcclxuICAgICAgICBmb3IoY29uc3QgY2hhciBvZiB2YWx1ZUludGVnZXIuc3BsaXQoJycpLnJldmVyc2UoKSkge1xyXG4gICAgICAgICAgICBpZiAoY291bnRlciA9PSAzKSB7XHJcbiAgICAgICAgICAgICAgICBWQUxVRV9JTlRFR0VSX0FSUkFZLnB1c2goJywnKTtcclxuICAgICAgICAgICAgICAgIGNvdW50ZXIgPSAwO1xyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICBWQUxVRV9JTlRFR0VSX0FSUkFZLnB1c2goY2hhcik7XHJcbiAgICAgICAgICAgICsrY291bnRlcjtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHZhbHVlSW50ZWdlciA9IFZBTFVFX0lOVEVHRVJfQVJSQVkucmV2ZXJzZSgpLmpvaW4oJycpO1xyXG4gICAgICAgIHJldHVybiBgJHt2YWx1ZUludGVnZXJ9JHt2YWx1ZURlY2ltYWx9YDtcclxuICAgIH0sXHJcblxyXG5cclxuICAgIC8qKiBXYWl0IHRoZSB0aW1lIGluZGljYXRlZCAqL1xyXG4gICAgU2xlZXA6IChtaWxsaXNlY29uZHM6IG51bWJlciA9IDAsIHJlZmVyZW5jZTogc3RyaW5nIHwgbnVsbCA9IG51bGwpID0+IHtcclxuICAgICAgICBpZiAoVG9vbHMuSXNOdWxsKHJlZmVyZW5jZSkpIHtcclxuICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKFJlc29sdmUgPT4gc2V0VGltZW91dChSZXNvbHZlLCBtaWxsaXNlY29uZHMpKTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGVsc2UgcmV0dXJuIG5ldyBQcm9taXNlPHZvaWQ+KFJlc29sdmUgPT4ge1xyXG4gICAgICAgICAgICByZWZlcmVuY2UgPSByZWZlcmVuY2UhLnJlcGxhY2VBbGwoJyAnLCAnXycpLnRvTG93ZXJDYXNlKCk7XHJcblxyXG4gICAgICAgICAgICBpZiAocmVmZXJlbmNlX3NpZ25hbCgpLmhhc093blByb3BlcnR5KHJlZmVyZW5jZSkpIHtcclxuICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwocmVmZXJlbmNlX3NpZ25hbCgpW3JlZmVyZW5jZSFdKTtcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgcmVmZXJlbmNlX3NpZ25hbC5zZXQoT2JqZWN0LmFzc2lnbihyZWZlcmVuY2Vfc2lnbmFsKCksIHtcclxuICAgICAgICAgICAgICAgIFtyZWZlcmVuY2UhXTogc2V0VGltZW91dCgoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgUmVzb2x2ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwocmVmZXJlbmNlX3NpZ25hbCgpW3JlZmVyZW5jZSFdKTtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBfcmVmZXJlbmNlID0geyAuLi5yZWZlcmVuY2Vfc2lnbmFsKCkgfTtcclxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgX3JlZmVyZW5jZVtyZWZlcmVuY2UhXTtcclxuICAgICAgICAgICAgICAgICAgICByZWZlcmVuY2Vfc2lnbmFsLnNldCh7IC4uLl9yZWZlcmVuY2UgfSk7XHJcbiAgICAgICAgICAgICAgICB9LCBtaWxsaXNlY29uZHMpXHJcbiAgICAgICAgICAgIH0pKTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxufTsiXX0=
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|