coer-elements 1.0.18 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +63 -1
- package/components/index.d.ts +5 -0
- package/components/lib/coer-accordion/coer-accordion.component.d.ts +32 -0
- package/components/lib/coer-button/coer-button.component.d.ts +46 -0
- package/components/lib/coer-checkbox/coer-checkbox.component.d.ts +29 -0
- package/components/lib/coer-datebox/coer-datebox.component.d.ts +58 -0
- package/components/lib/coer-dropdown/coer-dropdown.component.d.ts +69 -0
- package/components/lib/coer-filebox/coer-filebox.component.d.ts +36 -0
- package/components/lib/coer-form/coer-form.component.d.ts +36 -0
- package/components/lib/coer-grid/coer-grid.component.d.ts +53 -0
- package/components/lib/coer-grid/coer-grid.extension.d.ts +111 -0
- package/components/lib/coer-list/coer-list.component.d.ts +57 -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 +14 -0
- package/components/lib/coer-selectbox/coer-selectbox.component.d.ts +79 -0
- package/components/lib/coer-sidenav/coer-menu-option/coer-menu-option.component.d.ts +22 -0
- package/components/lib/coer-sidenav/coer-sidenav.component.d.ts +49 -0
- package/components/lib/coer-sidenav/coer-toolbar/coer-toolbar.component.d.ts +32 -0
- package/components/lib/coer-sidenav/coer-tree-accordion/coer-tree-accordion.component.d.ts +43 -0
- package/components/lib/coer-switch/coer-switch.component.d.ts +32 -0
- package/components/lib/coer-tab/coer-tab.component.d.ts +36 -0
- package/components/lib/coer-textarea/coer-textarea.component.d.ts +52 -0
- package/components/lib/coer-textbox/coer-textbox.component.d.ts +66 -0
- package/components/lib/components.module.d.ts +46 -0
- package/components/public-api.d.ts +21 -0
- package/directives/index.d.ts +5 -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 +16 -0
- package/directives/public-api.d.ts +3 -0
- package/extensions/index.d.ts +5 -0
- package/extensions/lib/object.extension.d.ts +1 -0
- package/extensions/lib/string.extension.d.ts +19 -0
- package/extensions/public-api.d.ts +2 -0
- package/fesm2022/coer-elements-components.mjs +4040 -0
- package/fesm2022/coer-elements-components.mjs.map +1 -0
- package/fesm2022/coer-elements-directives.mjs +84 -0
- package/fesm2022/coer-elements-directives.mjs.map +1 -0
- package/fesm2022/coer-elements-extensions.mjs +68 -0
- package/fesm2022/coer-elements-extensions.mjs.map +1 -0
- package/fesm2022/coer-elements-guards.mjs +28 -0
- package/fesm2022/coer-elements-guards.mjs.map +1 -0
- package/fesm2022/coer-elements-interceptors.mjs +64 -0
- package/fesm2022/coer-elements-interceptors.mjs.map +1 -0
- package/fesm2022/coer-elements-interfaces.mjs +6 -0
- package/fesm2022/coer-elements-interfaces.mjs.map +1 -0
- package/fesm2022/coer-elements-pages.mjs +441 -0
- package/fesm2022/coer-elements-pages.mjs.map +1 -0
- package/fesm2022/coer-elements-pipes.mjs +87 -0
- package/fesm2022/coer-elements-pipes.mjs.map +1 -0
- package/fesm2022/coer-elements-signals.mjs +35 -0
- package/fesm2022/coer-elements-signals.mjs.map +1 -0
- package/fesm2022/coer-elements-tools.mjs +1960 -0
- package/fesm2022/coer-elements-tools.mjs.map +1 -0
- package/fesm2022/coer-elements.mjs +68 -0
- package/fesm2022/coer-elements.mjs.map +1 -0
- package/guards/index.d.ts +5 -0
- package/guards/lib/login.guard.d.ts +2 -0
- package/guards/lib/page.guard.d.ts +2 -0
- package/guards/public-api.d.ts +2 -0
- package/images/loading.gif +0 -0
- package/images/no-image.png +0 -0
- package/images/no-user.png +0 -0
- package/index.d.ts +12 -0
- package/interceptors/index.d.ts +5 -0
- package/interceptors/lib/user.interceptor.d.ts +8 -0
- package/interceptors/lib/utc-offset.interceptor.d.ts +8 -0
- package/interceptors/public-api.d.ts +1 -0
- package/interfaces/index.d.ts +5 -0
- package/interfaces/lib/app-source.interface.d.ts +4 -0
- package/interfaces/lib/box-button.interface.d.ts +6 -0
- package/interfaces/lib/bulk-load.interface.d.ts +5 -0
- 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 +24 -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 +5 -0
- package/interfaces/lib/coer-grid/grid-sort.interface.d.ts +5 -0
- package/interfaces/lib/coer-menu/menu-access.interface.d.ts +7 -0
- package/interfaces/lib/coer-menu/menu-option-selected.interface.d.ts +9 -0
- package/interfaces/lib/coer-menu/menu-selected.interface.d.ts +10 -0
- package/interfaces/lib/coer-menu/menu.interface.d.ts +10 -0
- package/interfaces/lib/coer-ref.interface.d.ts +10 -0
- package/interfaces/lib/image.interface.d.ts +11 -0
- package/interfaces/lib/login-response.interface.d.ts +10 -0
- package/interfaces/lib/login.interface.d.ts +4 -0
- package/interfaces/lib/page-title/breadcrumb.interface.d.ts +6 -0
- package/interfaces/lib/page-title/go-back.interface.d.ts +6 -0
- package/interfaces/lib/page-title/information.interface.d.ts +4 -0
- package/interfaces/lib/screen-size.interface.d.ts +5 -0
- package/interfaces/lib/service/http-request.interface.d.ts +12 -0
- package/interfaces/lib/service/http-response.interface.d.ts +6 -0
- package/interfaces/lib/service/patch.interface.d.ts +5 -0
- package/interfaces/lib/toolbar-menu.interface.d.ts +5 -0
- package/interfaces/public-api.d.ts +41 -0
- package/package.json +67 -38
- package/pages/index.d.ts +5 -0
- package/pages/lib/coer-loading/loading.component.d.ts +5 -0
- package/pages/lib/coer-menu/coer-menu.component.d.ts +12 -0
- package/pages/lib/coer-system/coer-system.component.d.ts +64 -0
- package/pages/lib/coer-system/login/login.component.d.ts +31 -0
- package/pages/lib/home/home.component.d.ts +7 -0
- package/pages/lib/pages.module.d.ts +18 -0
- package/pages/public-api.d.ts +5 -0
- package/pipes/index.d.ts +5 -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/pipes/public-api.d.ts +4 -0
- package/signals/index.d.ts +5 -0
- package/signals/lib/breakpoint.signal.d.ts +1 -0
- package/signals/lib/is-loading.signal.d.ts +1 -0
- package/signals/lib/is-menu-open.signal.d.ts +1 -0
- package/signals/lib/is-modal-open.signal.d.ts +1 -0
- package/signals/lib/menu-selected.signal.d.ts +2 -0
- package/signals/lib/navigation.signal.d.ts +2 -0
- package/signals/public-api.d.ts +6 -0
- package/styles/angular-material.scss +20 -0
- package/styles/animations.scss +11 -0
- package/styles/bootstrap.scss +1 -14
- package/styles/coer-elements.css +2054 -0
- package/styles/colors.scss +90 -49
- package/styles/containers.scss +44 -0
- package/styles/cursores.scss +19 -0
- package/styles/index.scss +58 -0
- package/styles/layout.scss +49 -0
- package/styles/position.scss +7 -0
- package/styles/scroll-bar.scss +20 -0
- package/tools/index.d.ts +5 -0
- package/tools/lib/breadcrumbs.class.d.ts +18 -0
- package/tools/lib/coer-alert/coer-alert.component.d.ts +23 -0
- package/tools/lib/coer-grid.templates.d.ts +11 -0
- package/tools/lib/colors.class.d.ts +21 -0
- package/tools/lib/control-value.class.d.ts +25 -0
- package/tools/lib/date-time.class.d.ts +21 -0
- package/tools/lib/elements-html.class.d.ts +8 -0
- package/tools/lib/files.class.d.ts +16 -0
- package/tools/lib/filters.class.d.ts +11 -0
- package/tools/lib/menu.class.d.ts +9 -0
- package/tools/lib/page.class.d.ts +83 -0
- package/tools/lib/screen.class.d.ts +13 -0
- package/tools/lib/section.class.d.ts +33 -0
- package/tools/lib/service.class.d.ts +42 -0
- package/tools/lib/source.class.d.ts +20 -0
- package/tools/lib/tools.d.ts +42 -0
- package/tools/lib/user.class.d.ts +11 -0
- package/tools/public-api.d.ts +17 -0
- package/Signals/index.ts +0 -7
- package/Tools/Breadcrumbs.class.ts +0 -84
- package/Tools/ControlValue.ts +0 -63
- package/Tools/DateTime.class.ts +0 -27
- package/Tools/Files.class.ts +0 -119
- package/Tools/Page.class.ts +0 -197
- package/Tools/Screen.class.ts +0 -50
- package/Tools/Source.class.ts +0 -107
- package/Tools/Tools.ts +0 -212
- package/components/coer-alert/coer-alert.component.html +0 -56
- package/components/coer-alert/coer-alert.component.scss +0 -100
- package/components/coer-alert/coer-alert.component.ts +0 -249
- package/components/index.ts +0 -96
- package/dist_browser/Tools/Breadcrumbs.class.js +0 -66
- package/dist_browser/Tools/ControlValue.js +0 -49
- package/dist_browser/Tools/DateTime.class.js +0 -25
- package/dist_browser/Tools/Files.class.js +0 -99
- package/dist_browser/Tools/Page.class.js +0 -213
- package/dist_browser/Tools/Screen.class.js +0 -68
- package/dist_browser/Tools/Source.class.js +0 -83
- package/dist_browser/Tools/Tools.js +0 -227
- package/dist_browser/components/coer-alert/coer-alert.component.js +0 -314
- package/dist_browser/index.js +0 -8
- package/dist_node/Tools/Breadcrumbs.class.js +0 -69
- package/dist_node/Tools/ControlValue.js +0 -53
- package/dist_node/Tools/DateTime.class.js +0 -28
- package/dist_node/Tools/Files.class.js +0 -102
- package/dist_node/Tools/Page.class.js +0 -216
- package/dist_node/Tools/Screen.class.js +0 -71
- package/dist_node/Tools/Source.class.js +0 -86
- package/dist_node/Tools/Tools.js +0 -230
- package/dist_node/components/coer-alert/coer-alert.component.js +0 -317
- package/dist_node/index.js +0 -24
- package/dist_node/interfaces/index.js +0 -2
- package/index.ts +0 -8
- package/interfaces/index.ts +0 -47
- package/styles/coer.scss +0 -95
- package/tsconfig.json +0 -29
@@ -0,0 +1,83 @@
|
|
1
|
+
import { Router } from '@angular/router';
|
2
|
+
import { AfterViewInit, OnDestroy } from '@angular/core';
|
3
|
+
import { IBreadcrumb, IGoBack } from 'coer-elements/interfaces';
|
4
|
+
import { CoerAlert } from './coer-alert/coer-alert.component';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
export declare class Page implements AfterViewInit, OnDestroy {
|
7
|
+
protected readonly alert: CoerAlert;
|
8
|
+
protected readonly router: Router;
|
9
|
+
private readonly activatedRoute;
|
10
|
+
/** */
|
11
|
+
protected isUpdate: boolean;
|
12
|
+
/** */
|
13
|
+
protected isLoading: boolean;
|
14
|
+
/** */
|
15
|
+
protected isReadonlyPage: boolean;
|
16
|
+
/** */
|
17
|
+
protected isReadyPage: boolean;
|
18
|
+
/** */
|
19
|
+
protected enableAnimations: boolean;
|
20
|
+
/** */
|
21
|
+
protected routeParams: any;
|
22
|
+
/** */
|
23
|
+
protected queryParams: any;
|
24
|
+
/** */
|
25
|
+
protected breadcrumbs: IBreadcrumb[];
|
26
|
+
/** */
|
27
|
+
protected pageResponse: any;
|
28
|
+
/** */
|
29
|
+
protected pageFilters: any;
|
30
|
+
/** */
|
31
|
+
protected goBack: IGoBack;
|
32
|
+
private _path;
|
33
|
+
private _page;
|
34
|
+
private _source;
|
35
|
+
private _preventDestroy;
|
36
|
+
constructor(page: string);
|
37
|
+
ngAfterViewInit(): Promise<void>;
|
38
|
+
ngOnDestroy(): void;
|
39
|
+
/** Main method. Starts after ngAfterViewInit() */
|
40
|
+
protected RunPage(): void;
|
41
|
+
/** Rename the last breadcrumb and update the url id */
|
42
|
+
protected SetPageName(name: string, id?: string | number | null): void;
|
43
|
+
/** */
|
44
|
+
private __SetSource;
|
45
|
+
/** */
|
46
|
+
private __GetSource;
|
47
|
+
/** */
|
48
|
+
private __GetPageResponse;
|
49
|
+
/** */
|
50
|
+
private __GetNavigation;
|
51
|
+
/** */
|
52
|
+
private __SetGoBack;
|
53
|
+
/** */
|
54
|
+
private __GetPageMode;
|
55
|
+
/** */
|
56
|
+
private GoBack;
|
57
|
+
/** Navigate to previous page */
|
58
|
+
protected GoToSource<T>(pageResponse?: T | null): void;
|
59
|
+
/** */
|
60
|
+
protected SetPageResponse<T>(pageResponse?: T | null): void;
|
61
|
+
/** */
|
62
|
+
protected ReloadPage(): void;
|
63
|
+
/** */
|
64
|
+
protected SetPageFilters<T>(filters: T): void;
|
65
|
+
/** */
|
66
|
+
private __GetPageFilter;
|
67
|
+
/** */
|
68
|
+
protected RemovePageFilter(): void;
|
69
|
+
/** */
|
70
|
+
protected Log(value: any, log?: string | null): void;
|
71
|
+
protected isActiveTemplate: (item: import("coer-elements/interfaces").IGridItem<any>) => string;
|
72
|
+
protected coerSwitchTemplate: (item: import("coer-elements/interfaces").IGridItem<any>) => import("coer-elements/interfaces").IGridCoerSwitch;
|
73
|
+
protected coerTextboxTemplate: (item: import("coer-elements/interfaces").IGridItem<any>) => import("coer-elements/interfaces").IGridCoerTextBox;
|
74
|
+
protected coerIconTemplate: (icon: string, color?: string) => string;
|
75
|
+
protected IsNull: (value: any) => boolean;
|
76
|
+
protected IsNotNull: (value: any) => boolean;
|
77
|
+
protected IsOnlyWhiteSpace: (value: any) => boolean;
|
78
|
+
protected IsNotOnlyWhiteSpace: (value: any) => boolean;
|
79
|
+
protected Sleep: (milliseconds?: number, reference?: string | null) => Promise<void>;
|
80
|
+
protected IsInvalidElement: (element: any) => boolean;
|
81
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Page, never>;
|
82
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Page, "ng-component", never, {}, {}, never, never, true, never>;
|
83
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { IScreenSize } from "coer-elements/interfaces";
|
2
|
+
import { Observable } from "rxjs";
|
3
|
+
export declare class Screen {
|
4
|
+
static get WINDOW_WIDTH(): number;
|
5
|
+
static get WINDOW_HEIGHT(): number;
|
6
|
+
static get DEVICE_WIDTH(): number;
|
7
|
+
static get DEVICE_HEIGHT(): number;
|
8
|
+
static get BREAKPOINT(): 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
9
|
+
/** */
|
10
|
+
static Resize: Observable<IScreenSize>;
|
11
|
+
/** */
|
12
|
+
static BackButtonBrowser: Observable<string>;
|
13
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { Router } from '@angular/router';
|
2
|
+
import { AfterViewInit, OnDestroy } from '@angular/core';
|
3
|
+
import { CoerAlert } from './coer-alert/coer-alert.component';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export declare class Section<T> implements AfterViewInit, OnDestroy {
|
6
|
+
protected readonly alert: CoerAlert;
|
7
|
+
protected readonly router: Router;
|
8
|
+
isLoading: import("@angular/core").InputSignal<boolean>;
|
9
|
+
isUpdate: import("@angular/core").InputSignal<boolean>;
|
10
|
+
onReady: import("@angular/core").OutputEmitterRef<void>;
|
11
|
+
onDestroy: import("@angular/core").OutputEmitterRef<any>;
|
12
|
+
onIsLoading: import("@angular/core").OutputEmitterRef<boolean>;
|
13
|
+
onUpdated: import("@angular/core").OutputEmitterRef<T | null>;
|
14
|
+
protected enableAnimations: boolean;
|
15
|
+
ngAfterViewInit(): void;
|
16
|
+
ngOnDestroy(): void;
|
17
|
+
/** Main method. Starts after ngAfterViewInit() */
|
18
|
+
protected RunSection(): void;
|
19
|
+
/** */
|
20
|
+
protected Log(value: any, log?: string | null): void;
|
21
|
+
protected isActiveTemplate: (item: import("coer-elements/interfaces").IGridItem<any>) => string;
|
22
|
+
protected coerSwitchTemplate: (item: import("coer-elements/interfaces").IGridItem<any>) => import("coer-elements/interfaces").IGridCoerSwitch;
|
23
|
+
protected coerTextboxTemplate: (item: import("coer-elements/interfaces").IGridItem<any>) => import("coer-elements/interfaces").IGridCoerTextBox;
|
24
|
+
protected coerIconTemplate: (icon: string, color?: string) => string;
|
25
|
+
protected IsNull: (value: any) => boolean;
|
26
|
+
protected IsNotNull: (value: any) => boolean;
|
27
|
+
protected IsOnlyWhiteSpace: (value: any) => boolean;
|
28
|
+
protected IsNotOnlyWhiteSpace: (value: any) => boolean;
|
29
|
+
protected Sleep: (milliseconds?: number, reference?: string | null) => Promise<void>;
|
30
|
+
protected IsInvalidElement: (element: any) => boolean;
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Section<any>, never>;
|
32
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Section<any>, "ng-component", never, { "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "isUpdate": { "alias": "isUpdate"; "required": false; "isSignal": true; }; }, { "onReady": "onReady"; "onDestroy": "onDestroy"; "onIsLoading": "onIsLoading"; "onUpdated": "onUpdated"; }, never, never, true, never>;
|
33
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { HttpClient } from "@angular/common/http";
|
2
|
+
import { CoerAlert } from "./coer-alert/coer-alert.component";
|
3
|
+
import { IHttpRequest, IHttpResponse } from "coer-elements/interfaces";
|
4
|
+
export declare class Service {
|
5
|
+
protected readonly alert: CoerAlert;
|
6
|
+
protected readonly http: HttpClient;
|
7
|
+
protected httpCode: {
|
8
|
+
Ok: number;
|
9
|
+
Created: number;
|
10
|
+
NoContent: number;
|
11
|
+
BadRequest: number;
|
12
|
+
Unauthorize: number;
|
13
|
+
Forbidden: number;
|
14
|
+
NotFound: number;
|
15
|
+
NotAllowed: number;
|
16
|
+
NotAcceptable: number;
|
17
|
+
Conflict: number;
|
18
|
+
PayloadTooLarge: number;
|
19
|
+
InnerError: number;
|
20
|
+
};
|
21
|
+
private _GET$;
|
22
|
+
private _POST$;
|
23
|
+
private _PUT$;
|
24
|
+
private _PATCH$;
|
25
|
+
private _DELETE$;
|
26
|
+
/** */
|
27
|
+
private ReleaseSubscription;
|
28
|
+
/** HTTP GET */
|
29
|
+
protected HTTP_GET<T>(request: IHttpRequest<T>, cancelPrevious?: boolean): Promise<IHttpResponse<T>>;
|
30
|
+
/** HTTP POST */
|
31
|
+
protected HTTP_POST<T>(request: IHttpRequest<T>, cancelPrevious?: boolean): Promise<IHttpResponse<T>>;
|
32
|
+
/** HTTP PUT */
|
33
|
+
protected HTTP_PUT<T>(request: IHttpRequest<T>, cancelPrevious?: boolean): Promise<IHttpResponse<void>>;
|
34
|
+
/** HTTP PATCH */
|
35
|
+
protected HTTP_PATCH<T>(request: IHttpRequest<T>, cancelPrevious?: boolean): Promise<IHttpResponse<void>>;
|
36
|
+
/** HTTP DELETE */
|
37
|
+
protected HTTP_DELETE<T>(request: IHttpRequest<T>, cancelPrevious?: boolean): Promise<IHttpResponse<void>>;
|
38
|
+
/** */
|
39
|
+
protected DOWNLOAD_CSV(buffer: ArrayBuffer, fileName?: string): Blob;
|
40
|
+
/** */
|
41
|
+
private AlertError;
|
42
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { IAppSource } from "coer-elements/interfaces";
|
2
|
+
export declare class Source {
|
3
|
+
private static readonly storage;
|
4
|
+
/** */
|
5
|
+
static Set(page: string): void;
|
6
|
+
/** */
|
7
|
+
private static Save;
|
8
|
+
/** */
|
9
|
+
static Get(): IAppSource | null;
|
10
|
+
/** */
|
11
|
+
static GetRoot(): IAppSource | null;
|
12
|
+
/** */
|
13
|
+
static SetPageResponse<T>(pageResponse: T): void;
|
14
|
+
/** */
|
15
|
+
static GetPageResponse<T>(): T | null;
|
16
|
+
/** */
|
17
|
+
static ClearPageResponse(): void;
|
18
|
+
/** */
|
19
|
+
static Reset(): void;
|
20
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
export declare const Tools: {
|
2
|
+
/** Generate a Guid */
|
3
|
+
GetGuid: (seed?: string) => string;
|
4
|
+
/** Returns true if the value is null or undefined, false otherwise */
|
5
|
+
IsNull: (value: any) => boolean;
|
6
|
+
/** Returns true if the value is not null or undefined, false otherwise */
|
7
|
+
IsNotNull: (value: any) => boolean;
|
8
|
+
/** Returns true if the value is null or undefined or contains only whitespace, false otherwise */
|
9
|
+
IsOnlyWhiteSpace: (value: any) => boolean;
|
10
|
+
/** Returns true if has string value and is not only whitespace, false otherwise */
|
11
|
+
IsNotOnlyWhiteSpace: (value: any) => boolean;
|
12
|
+
/** Avoid Null value */
|
13
|
+
AvoidNull: <T>(value: T | null | undefined, type?: "string" | "number" | "boolean" | null) => T;
|
14
|
+
/** */
|
15
|
+
RemoveAccents: (value: string | null | undefined) => string;
|
16
|
+
/** Break reference of a object or array */
|
17
|
+
BreakReference: <T>(object: T) => T;
|
18
|
+
/** Clean extra whitespaces */
|
19
|
+
CleanUpBlanks: (text: string | number) => string;
|
20
|
+
/** Get properties of an object */
|
21
|
+
GetPropertyList: <T>(object: T | null | undefined) => string[];
|
22
|
+
/**
|
23
|
+
* Set an index and merge more arrays of the same type
|
24
|
+
* */
|
25
|
+
SetIndex: <T>(array: T[], ...args: T[][]) => T[];
|
26
|
+
/** Set First Char To Lower */
|
27
|
+
FirstCharToLower: (text: string | null | undefined) => string;
|
28
|
+
/** Set First Char To Upper */
|
29
|
+
FirstCharToUpper: (text: string | null | undefined) => string;
|
30
|
+
/** Sort an array in ascending order by property */
|
31
|
+
SortBy: <T>(array: T[], property: string, propertyType?: "string" | "number") => T[];
|
32
|
+
/** Sort an array in descending order by property */
|
33
|
+
SortByDesc: <T>(array: T[], property: string, propertyType?: "string" | "number") => T[];
|
34
|
+
/** Return a string with forman numeric */
|
35
|
+
GetNumericFormat: (value: string | number | null | undefined, decimals?: number) => string;
|
36
|
+
/** Wait the time indicated */
|
37
|
+
Sleep: (milliseconds?: number, reference?: string | null) => Promise<void>;
|
38
|
+
/** */
|
39
|
+
Distinct: <T>(array: T[], ...args: T[][]) => T[];
|
40
|
+
/** */
|
41
|
+
Except: <T>(array: T[], filter: any[], ...properties: string[]) => T[];
|
42
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export * from './lib/coer-alert/coer-alert.component';
|
2
|
+
export * from './lib/breadcrumbs.class';
|
3
|
+
export * from './lib/coer-grid.templates';
|
4
|
+
export * from './lib/colors.class';
|
5
|
+
export * from './lib/control-value.class';
|
6
|
+
export * from './lib/date-time.class';
|
7
|
+
export * from './lib/elements-html.class';
|
8
|
+
export * from './lib/files.class';
|
9
|
+
export * from './lib/user.class';
|
10
|
+
export * from './lib/filters.class';
|
11
|
+
export * from './lib/menu.class';
|
12
|
+
export * from './lib/page.class';
|
13
|
+
export * from './lib/screen.class';
|
14
|
+
export * from './lib/section.class';
|
15
|
+
export * from './lib/service.class';
|
16
|
+
export * from './lib/source.class';
|
17
|
+
export * from './lib/tools';
|
package/Signals/index.ts
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
import { signal } from "@angular/core";
|
2
|
-
import { Screen } from './../Tools/Screen.class';
|
3
|
-
|
4
|
-
export const breakpoint_signal = signal<'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'>(Screen?.BREAKPOINT || 'xs');
|
5
|
-
export const isReady_signal = signal<boolean>(false);
|
6
|
-
export const isLoading_signal = signal<boolean>(false);
|
7
|
-
export const isModalOpen_signal = signal<boolean>(false);
|
@@ -1,84 +0,0 @@
|
|
1
|
-
import { IAppSource } from "../interfaces";
|
2
|
-
import { Tools } from './Tools';
|
3
|
-
|
4
|
-
export class Breadcrumbs {
|
5
|
-
|
6
|
-
private static readonly storage = 'COER-System';
|
7
|
-
|
8
|
-
/** */
|
9
|
-
public static Add(page: string, path: string): void {
|
10
|
-
const breadcrumbs = this.Get();
|
11
|
-
const paths = breadcrumbs.map(item => item.path);
|
12
|
-
|
13
|
-
if (!paths.includes(path)) {
|
14
|
-
breadcrumbs.push({ page, path });
|
15
|
-
this.Save(breadcrumbs);
|
16
|
-
}
|
17
|
-
}
|
18
|
-
|
19
|
-
|
20
|
-
/** */
|
21
|
-
public static Get(): IAppSource[] {
|
22
|
-
let storage = sessionStorage.getItem(this.storage) as any;
|
23
|
-
|
24
|
-
if (storage) {
|
25
|
-
storage = JSON.parse(storage);
|
26
|
-
|
27
|
-
if (storage.hasOwnProperty('breadcrumbs')) {
|
28
|
-
return Tools.BreakReference(storage.breadcrumbs);
|
29
|
-
}
|
30
|
-
}
|
31
|
-
|
32
|
-
return [];
|
33
|
-
}
|
34
|
-
|
35
|
-
|
36
|
-
/** Source */
|
37
|
-
public static GetFirst(): IAppSource | null {
|
38
|
-
const breadcrumbs = this.Get();
|
39
|
-
return (breadcrumbs.length > 0) ? breadcrumbs.shift()! : null;
|
40
|
-
}
|
41
|
-
|
42
|
-
|
43
|
-
/** */
|
44
|
-
public static Save(breadcrumbs: IAppSource[]): void {
|
45
|
-
let storage = sessionStorage.getItem(this.storage) as any;
|
46
|
-
if (storage) storage = JSON.parse(storage);
|
47
|
-
storage = Object.assign({}, storage, { breadcrumbs });
|
48
|
-
sessionStorage.setItem(this.storage, JSON.stringify(storage));
|
49
|
-
}
|
50
|
-
|
51
|
-
|
52
|
-
/** */
|
53
|
-
public static Remove(path: string): void {
|
54
|
-
let breadcrumbs = this.Get();
|
55
|
-
const index = breadcrumbs.findIndex(x => x.path.toLowerCase().trim() === path.toLowerCase().trim());
|
56
|
-
|
57
|
-
if (index >= 0) {
|
58
|
-
breadcrumbs = Tools.BreakReference(breadcrumbs).splice(0, index + 1);
|
59
|
-
this.Save(breadcrumbs);
|
60
|
-
}
|
61
|
-
}
|
62
|
-
|
63
|
-
|
64
|
-
/** */
|
65
|
-
public static SetLast(page: string, path: string): void {
|
66
|
-
const breadcrumbs = this.Get();
|
67
|
-
|
68
|
-
if (breadcrumbs.length > 0) {
|
69
|
-
breadcrumbs[breadcrumbs.length - 1] = { page, path };
|
70
|
-
this.Save(breadcrumbs);
|
71
|
-
}
|
72
|
-
}
|
73
|
-
|
74
|
-
|
75
|
-
/** */
|
76
|
-
public static RemoveLast(): void {
|
77
|
-
const breadcrumbs = this.Get();
|
78
|
-
|
79
|
-
if (breadcrumbs.length > 0) {
|
80
|
-
breadcrumbs.pop();
|
81
|
-
this.Save(breadcrumbs);
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
package/Tools/ControlValue.ts
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
|
2
|
-
import { forwardRef } from "@angular/core";
|
3
|
-
|
4
|
-
export const CONTROL_VALUE = <T>(component: T) => {
|
5
|
-
return {
|
6
|
-
provide: NG_VALUE_ACCESSOR,
|
7
|
-
useExisting: forwardRef(() => component),
|
8
|
-
multi: true
|
9
|
-
}
|
10
|
-
}
|
11
|
-
|
12
|
-
|
13
|
-
export class ControlValue implements ControlValueAccessor {
|
14
|
-
|
15
|
-
//Variables
|
16
|
-
protected _value: any;
|
17
|
-
private _isTouched: boolean = false;
|
18
|
-
protected _UpdateValue!: Function;
|
19
|
-
private _IsTouched!: Function;
|
20
|
-
|
21
|
-
|
22
|
-
public get isTouched() {
|
23
|
-
return this._isTouched;
|
24
|
-
}
|
25
|
-
|
26
|
-
|
27
|
-
/** */
|
28
|
-
protected SetValue(value: any): void {
|
29
|
-
if(typeof this._UpdateValue === 'function') {
|
30
|
-
this._UpdateValue(value);
|
31
|
-
}
|
32
|
-
|
33
|
-
this._value = value;
|
34
|
-
}
|
35
|
-
|
36
|
-
|
37
|
-
/** */
|
38
|
-
public SetTouched(isTouched: boolean): void {
|
39
|
-
if(typeof this._IsTouched === 'function') {
|
40
|
-
this._IsTouched(isTouched);
|
41
|
-
}
|
42
|
-
|
43
|
-
this._isTouched = isTouched;
|
44
|
-
}
|
45
|
-
|
46
|
-
|
47
|
-
/** */
|
48
|
-
public writeValue(value: any): void {
|
49
|
-
this._value = value;
|
50
|
-
}
|
51
|
-
|
52
|
-
|
53
|
-
/** */
|
54
|
-
public registerOnChange(callback: Function): void {
|
55
|
-
this._UpdateValue = callback;
|
56
|
-
}
|
57
|
-
|
58
|
-
|
59
|
-
/** */
|
60
|
-
public registerOnTouched(callback: Function): void {
|
61
|
-
this._IsTouched = callback;
|
62
|
-
}
|
63
|
-
}
|
package/Tools/DateTime.class.ts
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
import moment from "moment";
|
2
|
-
|
3
|
-
export class DateTime {
|
4
|
-
/** Get UTC Offset */
|
5
|
-
public static GetUTCOffset(): number {
|
6
|
-
return moment().utcOffset();
|
7
|
-
}
|
8
|
-
|
9
|
-
|
10
|
-
/** Convert UTC Date to Local Zone */
|
11
|
-
public static ToLocalZone(utcDate: string | Date | moment.Moment): string {
|
12
|
-
return moment(utcDate).add(DateTime.GetUTCOffset(), 'minutes').format('YYYY-MM-DD HH:mm:ss');
|
13
|
-
}
|
14
|
-
|
15
|
-
|
16
|
-
/** Convert Local Zone Date to UTC */
|
17
|
-
public static ToUTC(utcDate: string | Date | moment.Moment): string {
|
18
|
-
return moment(utcDate).subtract(DateTime.GetUTCOffset(), 'minutes').format('YYYY-MM-DD HH:mm:ss');
|
19
|
-
}
|
20
|
-
|
21
|
-
|
22
|
-
/** DD MMM YYYY */
|
23
|
-
public static GetDateFormat(date: string | Date | moment.Moment): string {
|
24
|
-
if ((typeof date === 'string')) date = date.replaceAll('/', '-');
|
25
|
-
return moment(date).parseZone().local(true).format('DD MMM YYYY');
|
26
|
-
}
|
27
|
-
}
|
package/Tools/Files.class.ts
DELETED
@@ -1,119 +0,0 @@
|
|
1
|
-
import { Tools } from "./Tools";
|
2
|
-
import * as XLSX from 'xlsx';
|
3
|
-
|
4
|
-
export class Files {
|
5
|
-
public static readonly EXCEL_EXTENSIONS: string[] = ['xls', 'xlsx', 'csv'];
|
6
|
-
|
7
|
-
/** Get Extension File */
|
8
|
-
public static GetExtension(file: File): string | null {
|
9
|
-
const fileName = file.name;
|
10
|
-
|
11
|
-
if (fileName.includes('.')) {
|
12
|
-
let worlds = fileName.split('.') as string[];
|
13
|
-
|
14
|
-
if (worlds.length > 0) {
|
15
|
-
let extension = worlds.pop()!;
|
16
|
-
extension = extension.trim().toLowerCase();
|
17
|
-
if (extension.length > 0) return extension;
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
return null;
|
22
|
-
}
|
23
|
-
|
24
|
-
|
25
|
-
/** Is Excel File */
|
26
|
-
public static IsExcel(file: File): boolean {
|
27
|
-
const EXTENSION = Files.GetExtension(file);
|
28
|
-
|
29
|
-
return Tools.IsNotNull(EXTENSION)
|
30
|
-
? this.EXCEL_EXTENSIONS.includes(EXTENSION!)
|
31
|
-
: false;
|
32
|
-
}
|
33
|
-
|
34
|
-
|
35
|
-
/** Read excel file */
|
36
|
-
public static ReadExcel<T>(file: File) {
|
37
|
-
return new Promise<{ columns: string[]; rows: T[]; }>(Resolve => {
|
38
|
-
let columns: string[] = [];
|
39
|
-
let rows: T[] = [];
|
40
|
-
|
41
|
-
const reader = new FileReader();
|
42
|
-
reader.readAsArrayBuffer(file);
|
43
|
-
|
44
|
-
reader.onload = () => {
|
45
|
-
const dataBytes = new Uint8Array(reader.result as any);
|
46
|
-
|
47
|
-
if (dataBytes) {
|
48
|
-
const workbook = XLSX.read(dataBytes, {});
|
49
|
-
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
50
|
-
let dataSheet: any[] = XLSX.utils.sheet_to_json(sheet, {
|
51
|
-
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']
|
52
|
-
});
|
53
|
-
|
54
|
-
//Get Headers
|
55
|
-
for(const column in dataSheet[0]) {
|
56
|
-
columns.push(Tools.FirstCharToLower(String(dataSheet[0][column]).replaceAll(' ', '')));
|
57
|
-
}
|
58
|
-
|
59
|
-
//Get Rows
|
60
|
-
rows = XLSX.utils.sheet_to_json(sheet, { header: columns });
|
61
|
-
rows.shift();
|
62
|
-
|
63
|
-
rows = rows.map(row => {
|
64
|
-
const item = Tools.BreakReference<any>(row);
|
65
|
-
delete item['__rowNum__'];
|
66
|
-
return item;
|
67
|
-
});
|
68
|
-
}
|
69
|
-
|
70
|
-
Resolve({ columns, rows });
|
71
|
-
}
|
72
|
-
|
73
|
-
reader.onerror = () => { Resolve({ columns, rows }) }
|
74
|
-
});
|
75
|
-
}
|
76
|
-
|
77
|
-
|
78
|
-
/** Export to excel file */
|
79
|
-
public static ExportExcel<T>(data: T[], fileName: string = 'coer_report', sheetName: string = 'Sheet1') {
|
80
|
-
sheetName = Tools.CleanUpBlanks(sheetName);
|
81
|
-
fileName = Tools.CleanUpBlanks(fileName);
|
82
|
-
|
83
|
-
if(fileName.endsWith('.xls') || fileName.endsWith('.xlsx') || fileName.endsWith('.csv')) {
|
84
|
-
if (fileName.includes('.xls')) {
|
85
|
-
fileName = fileName.replaceAll('.xls', '.xlsx');
|
86
|
-
}
|
87
|
-
|
88
|
-
if (fileName.includes('.csv')) {
|
89
|
-
fileName = fileName.replaceAll('.csv', '.xlsx');
|
90
|
-
}
|
91
|
-
}
|
92
|
-
|
93
|
-
else {
|
94
|
-
fileName += '.xlsx';
|
95
|
-
}
|
96
|
-
|
97
|
-
const WORK_SHEET = XLSX.utils.json_to_sheet(data);
|
98
|
-
const WORK_BOOK = XLSX.utils.book_new();
|
99
|
-
XLSX.utils.book_append_sheet(WORK_BOOK, WORK_SHEET, 'Sheet1');
|
100
|
-
XLSX.writeFile(WORK_BOOK, fileName);
|
101
|
-
}
|
102
|
-
|
103
|
-
|
104
|
-
/** Convert file to string base64 */
|
105
|
-
public static ConvertToBase64(file: File) {
|
106
|
-
return new Promise<string>(Resolve => {
|
107
|
-
const reader = new FileReader();
|
108
|
-
reader.readAsDataURL(file);
|
109
|
-
|
110
|
-
reader.onload = () => {
|
111
|
-
Resolve(reader.result?.toString() || '');
|
112
|
-
}
|
113
|
-
|
114
|
-
reader.onerror = () => {
|
115
|
-
Resolve('');
|
116
|
-
}
|
117
|
-
});
|
118
|
-
}
|
119
|
-
}
|