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.
Files changed (203) hide show
  1. package/README.md +63 -1
  2. package/components/index.d.ts +5 -0
  3. package/components/lib/coer-accordion/coer-accordion.component.d.ts +32 -0
  4. package/components/lib/coer-button/coer-button.component.d.ts +46 -0
  5. package/components/lib/coer-checkbox/coer-checkbox.component.d.ts +29 -0
  6. package/components/lib/coer-datebox/coer-datebox.component.d.ts +58 -0
  7. package/components/lib/coer-dropdown/coer-dropdown.component.d.ts +69 -0
  8. package/components/lib/coer-filebox/coer-filebox.component.d.ts +36 -0
  9. package/components/lib/coer-form/coer-form.component.d.ts +36 -0
  10. package/components/lib/coer-grid/coer-grid.component.d.ts +53 -0
  11. package/components/lib/coer-grid/coer-grid.extension.d.ts +111 -0
  12. package/components/lib/coer-list/coer-list.component.d.ts +57 -0
  13. package/components/lib/coer-modal/coer-modal.component.d.ts +38 -0
  14. package/components/lib/coer-numberbox/coer-numberbox.component.d.ts +56 -0
  15. package/components/lib/coer-page-title/coer-page-title.component.d.ts +14 -0
  16. package/components/lib/coer-selectbox/coer-selectbox.component.d.ts +79 -0
  17. package/components/lib/coer-sidenav/coer-menu-option/coer-menu-option.component.d.ts +22 -0
  18. package/components/lib/coer-sidenav/coer-sidenav.component.d.ts +49 -0
  19. package/components/lib/coer-sidenav/coer-toolbar/coer-toolbar.component.d.ts +32 -0
  20. package/components/lib/coer-sidenav/coer-tree-accordion/coer-tree-accordion.component.d.ts +43 -0
  21. package/components/lib/coer-switch/coer-switch.component.d.ts +32 -0
  22. package/components/lib/coer-tab/coer-tab.component.d.ts +36 -0
  23. package/components/lib/coer-textarea/coer-textarea.component.d.ts +52 -0
  24. package/components/lib/coer-textbox/coer-textbox.component.d.ts +66 -0
  25. package/components/lib/components.module.d.ts +46 -0
  26. package/components/public-api.d.ts +21 -0
  27. package/directives/index.d.ts +5 -0
  28. package/directives/lib/coer-ref.directive.d.ts +14 -0
  29. package/directives/lib/directives.module.d.ts +8 -0
  30. package/directives/lib/life-cycle.directive.d.ts +16 -0
  31. package/directives/public-api.d.ts +3 -0
  32. package/extensions/index.d.ts +5 -0
  33. package/extensions/lib/object.extension.d.ts +1 -0
  34. package/extensions/lib/string.extension.d.ts +19 -0
  35. package/extensions/public-api.d.ts +2 -0
  36. package/fesm2022/coer-elements-components.mjs +4040 -0
  37. package/fesm2022/coer-elements-components.mjs.map +1 -0
  38. package/fesm2022/coer-elements-directives.mjs +84 -0
  39. package/fesm2022/coer-elements-directives.mjs.map +1 -0
  40. package/fesm2022/coer-elements-extensions.mjs +68 -0
  41. package/fesm2022/coer-elements-extensions.mjs.map +1 -0
  42. package/fesm2022/coer-elements-guards.mjs +28 -0
  43. package/fesm2022/coer-elements-guards.mjs.map +1 -0
  44. package/fesm2022/coer-elements-interceptors.mjs +64 -0
  45. package/fesm2022/coer-elements-interceptors.mjs.map +1 -0
  46. package/fesm2022/coer-elements-interfaces.mjs +6 -0
  47. package/fesm2022/coer-elements-interfaces.mjs.map +1 -0
  48. package/fesm2022/coer-elements-pages.mjs +441 -0
  49. package/fesm2022/coer-elements-pages.mjs.map +1 -0
  50. package/fesm2022/coer-elements-pipes.mjs +87 -0
  51. package/fesm2022/coer-elements-pipes.mjs.map +1 -0
  52. package/fesm2022/coer-elements-signals.mjs +35 -0
  53. package/fesm2022/coer-elements-signals.mjs.map +1 -0
  54. package/fesm2022/coer-elements-tools.mjs +1960 -0
  55. package/fesm2022/coer-elements-tools.mjs.map +1 -0
  56. package/fesm2022/coer-elements.mjs +68 -0
  57. package/fesm2022/coer-elements.mjs.map +1 -0
  58. package/guards/index.d.ts +5 -0
  59. package/guards/lib/login.guard.d.ts +2 -0
  60. package/guards/lib/page.guard.d.ts +2 -0
  61. package/guards/public-api.d.ts +2 -0
  62. package/images/loading.gif +0 -0
  63. package/images/no-image.png +0 -0
  64. package/images/no-user.png +0 -0
  65. package/index.d.ts +12 -0
  66. package/interceptors/index.d.ts +5 -0
  67. package/interceptors/lib/user.interceptor.d.ts +8 -0
  68. package/interceptors/lib/utc-offset.interceptor.d.ts +8 -0
  69. package/interceptors/public-api.d.ts +1 -0
  70. package/interfaces/index.d.ts +5 -0
  71. package/interfaces/lib/app-source.interface.d.ts +4 -0
  72. package/interfaces/lib/box-button.interface.d.ts +6 -0
  73. package/interfaces/lib/bulk-load.interface.d.ts +5 -0
  74. package/interfaces/lib/coer-filebox/file-image.interface.d.ts +14 -0
  75. package/interfaces/lib/coer-filebox/file.interface.d.ts +5 -0
  76. package/interfaces/lib/coer-grid/grid-button-by-row.interface.d.ts +6 -0
  77. package/interfaces/lib/coer-grid/grid-checkbox.interface.d.ts +5 -0
  78. package/interfaces/lib/coer-grid/grid-coer-numberbox.interface.d.ts +12 -0
  79. package/interfaces/lib/coer-grid/grid-coer-selectbox.interface.d.ts +9 -0
  80. package/interfaces/lib/coer-grid/grid-coer-switch.interface.d.ts +6 -0
  81. package/interfaces/lib/coer-grid/grid-coer-textbox.interface.d.ts +11 -0
  82. package/interfaces/lib/coer-grid/grid-column.interface.d.ts +24 -0
  83. package/interfaces/lib/coer-grid/grid-data-source.interface.d.ts +6 -0
  84. package/interfaces/lib/coer-grid/grid-header-button.interface.d.ts +8 -0
  85. package/interfaces/lib/coer-grid/grid-header-export-button.interface.d.ts +10 -0
  86. package/interfaces/lib/coer-grid/grid-header.interface.d.ts +5 -0
  87. package/interfaces/lib/coer-grid/grid-import.interface.d.ts +4 -0
  88. package/interfaces/lib/coer-grid/grid-input-checkbox.interface.d.ts +5 -0
  89. package/interfaces/lib/coer-grid/grid-input-switch-change.interface.d.ts +5 -0
  90. package/interfaces/lib/coer-grid/grid-input-textbox.interface.d.ts +5 -0
  91. package/interfaces/lib/coer-grid/grid-item.interface.d.ts +5 -0
  92. package/interfaces/lib/coer-grid/grid-keyup-enter.interface.d.ts +6 -0
  93. package/interfaces/lib/coer-grid/grid-length.interface.d.ts +5 -0
  94. package/interfaces/lib/coer-grid/grid-search.interface.d.ts +5 -0
  95. package/interfaces/lib/coer-grid/grid-sort.interface.d.ts +5 -0
  96. package/interfaces/lib/coer-menu/menu-access.interface.d.ts +7 -0
  97. package/interfaces/lib/coer-menu/menu-option-selected.interface.d.ts +9 -0
  98. package/interfaces/lib/coer-menu/menu-selected.interface.d.ts +10 -0
  99. package/interfaces/lib/coer-menu/menu.interface.d.ts +10 -0
  100. package/interfaces/lib/coer-ref.interface.d.ts +10 -0
  101. package/interfaces/lib/image.interface.d.ts +11 -0
  102. package/interfaces/lib/login-response.interface.d.ts +10 -0
  103. package/interfaces/lib/login.interface.d.ts +4 -0
  104. package/interfaces/lib/page-title/breadcrumb.interface.d.ts +6 -0
  105. package/interfaces/lib/page-title/go-back.interface.d.ts +6 -0
  106. package/interfaces/lib/page-title/information.interface.d.ts +4 -0
  107. package/interfaces/lib/screen-size.interface.d.ts +5 -0
  108. package/interfaces/lib/service/http-request.interface.d.ts +12 -0
  109. package/interfaces/lib/service/http-response.interface.d.ts +6 -0
  110. package/interfaces/lib/service/patch.interface.d.ts +5 -0
  111. package/interfaces/lib/toolbar-menu.interface.d.ts +5 -0
  112. package/interfaces/public-api.d.ts +41 -0
  113. package/package.json +67 -38
  114. package/pages/index.d.ts +5 -0
  115. package/pages/lib/coer-loading/loading.component.d.ts +5 -0
  116. package/pages/lib/coer-menu/coer-menu.component.d.ts +12 -0
  117. package/pages/lib/coer-system/coer-system.component.d.ts +64 -0
  118. package/pages/lib/coer-system/login/login.component.d.ts +31 -0
  119. package/pages/lib/home/home.component.d.ts +7 -0
  120. package/pages/lib/pages.module.d.ts +18 -0
  121. package/pages/public-api.d.ts +5 -0
  122. package/pipes/index.d.ts +5 -0
  123. package/pipes/lib/html.pipe.d.ts +10 -0
  124. package/pipes/lib/no-image.pipe.d.ts +7 -0
  125. package/pipes/lib/numeric-format.pipe.d.ts +7 -0
  126. package/pipes/lib/pipes.module.d.ts +9 -0
  127. package/pipes/public-api.d.ts +4 -0
  128. package/signals/index.d.ts +5 -0
  129. package/signals/lib/breakpoint.signal.d.ts +1 -0
  130. package/signals/lib/is-loading.signal.d.ts +1 -0
  131. package/signals/lib/is-menu-open.signal.d.ts +1 -0
  132. package/signals/lib/is-modal-open.signal.d.ts +1 -0
  133. package/signals/lib/menu-selected.signal.d.ts +2 -0
  134. package/signals/lib/navigation.signal.d.ts +2 -0
  135. package/signals/public-api.d.ts +6 -0
  136. package/styles/angular-material.scss +20 -0
  137. package/styles/animations.scss +11 -0
  138. package/styles/bootstrap.scss +1 -14
  139. package/styles/coer-elements.css +2054 -0
  140. package/styles/colors.scss +90 -49
  141. package/styles/containers.scss +44 -0
  142. package/styles/cursores.scss +19 -0
  143. package/styles/index.scss +58 -0
  144. package/styles/layout.scss +49 -0
  145. package/styles/position.scss +7 -0
  146. package/styles/scroll-bar.scss +20 -0
  147. package/tools/index.d.ts +5 -0
  148. package/tools/lib/breadcrumbs.class.d.ts +18 -0
  149. package/tools/lib/coer-alert/coer-alert.component.d.ts +23 -0
  150. package/tools/lib/coer-grid.templates.d.ts +11 -0
  151. package/tools/lib/colors.class.d.ts +21 -0
  152. package/tools/lib/control-value.class.d.ts +25 -0
  153. package/tools/lib/date-time.class.d.ts +21 -0
  154. package/tools/lib/elements-html.class.d.ts +8 -0
  155. package/tools/lib/files.class.d.ts +16 -0
  156. package/tools/lib/filters.class.d.ts +11 -0
  157. package/tools/lib/menu.class.d.ts +9 -0
  158. package/tools/lib/page.class.d.ts +83 -0
  159. package/tools/lib/screen.class.d.ts +13 -0
  160. package/tools/lib/section.class.d.ts +33 -0
  161. package/tools/lib/service.class.d.ts +42 -0
  162. package/tools/lib/source.class.d.ts +20 -0
  163. package/tools/lib/tools.d.ts +42 -0
  164. package/tools/lib/user.class.d.ts +11 -0
  165. package/tools/public-api.d.ts +17 -0
  166. package/Signals/index.ts +0 -7
  167. package/Tools/Breadcrumbs.class.ts +0 -84
  168. package/Tools/ControlValue.ts +0 -63
  169. package/Tools/DateTime.class.ts +0 -27
  170. package/Tools/Files.class.ts +0 -119
  171. package/Tools/Page.class.ts +0 -197
  172. package/Tools/Screen.class.ts +0 -50
  173. package/Tools/Source.class.ts +0 -107
  174. package/Tools/Tools.ts +0 -212
  175. package/components/coer-alert/coer-alert.component.html +0 -56
  176. package/components/coer-alert/coer-alert.component.scss +0 -100
  177. package/components/coer-alert/coer-alert.component.ts +0 -249
  178. package/components/index.ts +0 -96
  179. package/dist_browser/Tools/Breadcrumbs.class.js +0 -66
  180. package/dist_browser/Tools/ControlValue.js +0 -49
  181. package/dist_browser/Tools/DateTime.class.js +0 -25
  182. package/dist_browser/Tools/Files.class.js +0 -99
  183. package/dist_browser/Tools/Page.class.js +0 -213
  184. package/dist_browser/Tools/Screen.class.js +0 -68
  185. package/dist_browser/Tools/Source.class.js +0 -83
  186. package/dist_browser/Tools/Tools.js +0 -227
  187. package/dist_browser/components/coer-alert/coer-alert.component.js +0 -314
  188. package/dist_browser/index.js +0 -8
  189. package/dist_node/Tools/Breadcrumbs.class.js +0 -69
  190. package/dist_node/Tools/ControlValue.js +0 -53
  191. package/dist_node/Tools/DateTime.class.js +0 -28
  192. package/dist_node/Tools/Files.class.js +0 -102
  193. package/dist_node/Tools/Page.class.js +0 -216
  194. package/dist_node/Tools/Screen.class.js +0 -71
  195. package/dist_node/Tools/Source.class.js +0 -86
  196. package/dist_node/Tools/Tools.js +0 -230
  197. package/dist_node/components/coer-alert/coer-alert.component.js +0 -317
  198. package/dist_node/index.js +0 -24
  199. package/dist_node/interfaces/index.js +0 -2
  200. package/index.ts +0 -8
  201. package/interfaces/index.ts +0 -47
  202. package/styles/coer.scss +0 -95
  203. 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,11 @@
1
+ export declare class User {
2
+ private static readonly storage;
3
+ /** */
4
+ static Set<T>(user: T): void;
5
+ /** */
6
+ static Get<T>(): T | null;
7
+ /** */
8
+ static LogIn(): boolean;
9
+ /** */
10
+ static LogOut(): void;
11
+ }
@@ -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
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }