coer-elements 1.0.18 → 1.1.1

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 +1899 -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 +10 -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 +40 -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
@@ -1,100 +0,0 @@
1
- @import "../../styles/colors.scss";
2
-
3
- aside.toast-container {
4
- position: fixed;
5
- bottom: 0px;
6
- right: 0px;
7
- padding: 15px !important;
8
- z-index: 2000 !important;
9
-
10
- i, svg {
11
- display: flex;
12
- align-items: center;
13
- }
14
-
15
- strong {
16
- margin: 0px auto 0px 5px;
17
- }
18
-
19
- div.toast,
20
- div.toast-header {
21
- border-top-left-radius: 10px;
22
- border-top-right-radius: 10px;
23
- color: $white;
24
- }
25
-
26
- div.toast,
27
- div.toast-body {
28
- border-bottom-left-radius: 10px;
29
- border-bottom-right-radius: 10px;
30
- color: $white;
31
- }
32
-
33
- div.toast-body {
34
- min-height: 36px;
35
- }
36
-
37
- pre {
38
- font-family: Roboto, RobotoFallback, "Noto Kufi Arabic", Helvetica, Arial, sans-serif;
39
- white-space: pre-wrap;
40
- font-size: medium;
41
- }
42
-
43
- button {
44
- margin: 0px 2px !important;
45
- width: 10px !important;
46
- height: 10px !important;
47
- box-shadow: none !important;
48
- outline: none !important;
49
- border: none !important;
50
- }
51
-
52
- div#alert-success div.toast-header,
53
- div#alert-success div.toast-body {
54
- background-color: $green;
55
- }
56
-
57
- div#alert-info div.toast-header,
58
- div#alert-info div.toast-body {
59
- background-color: $blue;
60
- }
61
-
62
- div#alert-error div.toast-header,
63
- div#alert-error div.toast-body {
64
- background-color: $red;
65
- }
66
-
67
- div#alert-warning div.toast-header,
68
- div#alert-warning div.toast-body {
69
- background-color: $yellow;
70
- border-color: $black;
71
- color: $black;
72
- }
73
-
74
- div#alert-success:hover,
75
- div#alert-info:hover,
76
- div#alert-error:hover,
77
- div#alert-warning:hover {
78
- transform: scale(1.01);
79
- box-shadow: 2px 2px 10px lightslategray;
80
- cursor: default;
81
- }
82
- }
83
-
84
- button.sweet-alert-button {
85
- width: 100px !important;
86
- height: 40px !important;
87
- display: flex !important;
88
- align-items: center !important;
89
- justify-content: center !important;
90
- margin: 0px 5px !important;
91
- outline: none !important;
92
- border: none !important;
93
- box-shadow: none !important;
94
- }
95
-
96
- aside.toast-container > * {
97
- border: none !important;
98
- z-index: 2000 !important;
99
- margin: 15px 0px 0px 0px !important;
100
- }
@@ -1,249 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import * as bootstrap from 'bootstrap';
3
- import Swal from 'sweetalert2'
4
-
5
- @Component({
6
- selector: 'coer-alert',
7
- templateUrl: './coer-alert.component.html',
8
- styleUrls: ['./coer-alert.component.scss']
9
- })
10
- export class CoerAlert {
11
-
12
- /** */
13
- public Success(message: string | null = null, title: string | null = null, icon: string | null = null, autohide: number | null = 3000): void {
14
- //Title
15
- if (!title || title == '') title = 'Success';
16
- const alertSuccessTitle = document.getElementById('alert-success-title')!;
17
- alertSuccessTitle.textContent = title;
18
-
19
- //Icon
20
- icon = this.GetIcon(title, icon, 'bi-check-circle fa-beat');
21
- const alertSuccessIcon = document.getElementById('alert-success-icon')!;
22
- this.SetIcon(alertSuccessIcon, icon);
23
-
24
- //Message
25
- if (!message) message = '';
26
- const alertSuccessMessage = document.getElementById('alert-success-message')!;
27
- alertSuccessMessage.innerHTML = message;
28
-
29
- //Toast
30
- const alertSuccess = document.getElementById('alert-success')!;
31
- this.SetAutoHide(alertSuccess, autohide);
32
-
33
- const toast = bootstrap.Toast.getOrCreateInstance(alertSuccess);
34
- toast.show();
35
- }
36
-
37
-
38
- /** */
39
- public Error(message: string | null = null, title: string | null = null, icon: string | null = null, autohide: number | null = 3000): void {
40
- //Title
41
- if (!title || title == '') title = 'Error';
42
- const alertErrorTitle = document.getElementById('alert-error-title')!;
43
- alertErrorTitle.textContent = title;
44
-
45
- //Icon
46
- icon = this.GetIcon(title, icon, 'bi-exclamation-octagon fa-beat');
47
- const alertErrorIcon = document.getElementById('alert-error-icon')!;
48
- this.SetIcon(alertErrorIcon, icon);
49
-
50
- //Message
51
- if (!message) message = '';
52
- const alertErrorBody = document.getElementById('alert-error-message')!;
53
- alertErrorBody.innerHTML = message;
54
-
55
- //Toast
56
- const alertError = document.getElementById('alert-error')!;
57
- this.SetAutoHide(alertError, autohide);
58
-
59
- const toast = bootstrap.Toast.getOrCreateInstance(alertError);
60
- toast.show();
61
- }
62
-
63
-
64
- /** */
65
- public Info(message: string | null = null, title: string | null = null, icon: string | null = null, autohide: number | null = 3000): void {
66
- //Title
67
- if (!title || title == '') title = 'Info';
68
- const alertInfoTitle = document.getElementById('alert-info-title')!;
69
- alertInfoTitle.textContent = title;
70
-
71
- //Icon
72
- icon = this.GetIcon(title, icon, 'bi-info-circle fa-beat');
73
- const alertInfoIcon = document.getElementById('alert-info-icon')!;
74
- this.SetIcon(alertInfoIcon, icon);
75
-
76
- //Message
77
- if (!message) message = '';
78
- const alertInfoBody = document.getElementById('alert-info-message')!;
79
- alertInfoBody.innerHTML = message;
80
-
81
- //Toast
82
- const alertInfo = document.getElementById('alert-info')!;
83
- this.SetAutoHide(alertInfo, autohide);
84
-
85
- const toast = bootstrap.Toast.getOrCreateInstance(alertInfo);
86
- toast.show();
87
- }
88
-
89
-
90
- /** */
91
- public Warning(message: string | null = null, title: string | null = null, icon: string | null = null, autohide: number | null = 3000): void {
92
- //Title
93
- if (!title || title == '') title = 'Warning';
94
- const alertWarningTitle = document.getElementById('alert-warning-title')!;
95
- alertWarningTitle.textContent = title;
96
-
97
- //Icon
98
- icon = this.GetIcon(title, icon, 'bi-exclamation-triangle-fill fa-beat');
99
- const alertWarningIcon = document.getElementById('alert-warning-icon')!;
100
- this.SetIcon(alertWarningIcon, icon);
101
-
102
- //Message
103
- if (!message) message = '';
104
- const alertWarningBody = document.getElementById('alert-warning-message')!;
105
- alertWarningBody.innerHTML = message;
106
-
107
- //Toast
108
- const alertWarning = document.getElementById('alert-warning')!;
109
- this.SetAutoHide(alertWarning, autohide);
110
-
111
- const toast = bootstrap.Toast.getOrCreateInstance(alertWarning);
112
- toast.show();
113
- }
114
-
115
-
116
- /** */
117
- protected Close(alert: 'alert-success' | 'alert-error' | 'alert-info' | 'alert-warning') {
118
- return new Promise<void>(Resolve => {
119
- const element = document.getElementById(alert)!;
120
- const toast = bootstrap.Toast.getOrCreateInstance(element);
121
- toast.hide();
122
-
123
- setTimeout(() => { Resolve() }, 200);
124
- })
125
- }
126
-
127
-
128
- /** */
129
- public Confirm(
130
- message: string = 'Proceed?',
131
- alertType: 'warning' | 'danger' | 'success' | 'info' = 'warning',
132
- icon: string | null = null) {
133
- return new Promise<boolean>(Resolve => {
134
- let color: string;
135
- let iconType: 'warning' | 'error' | 'success' | 'info';
136
- switch(alertType) {
137
- case 'danger': {
138
- if (icon == null) icon = 'bi-exclamation-octagon';
139
- iconType = 'error';
140
- color = '#dc3545';
141
- break;
142
- };
143
-
144
- case 'success': {
145
- if (icon == null) icon = 'bi-check-circle';
146
- iconType = 'info';
147
- color = '#198754';
148
- break;
149
- };
150
-
151
- case 'info': {
152
- if (icon == null) icon = 'bi-info-circle';
153
- iconType = 'error';
154
- color = '#0d6efd';
155
- break
156
- };
157
-
158
- default: {
159
- if (icon == null) icon = 'bi-exclamation-triangle-fill';
160
- iconType = 'warning';
161
- color = '#ffc107';
162
- break;
163
- }
164
- }
165
-
166
- switch(icon) {
167
- case 'delete': icon = 'fa-regular fa-trash-can'; break;
168
- }
169
-
170
- Swal.fire({
171
- icon: iconType,
172
- iconColor: 'transparent',
173
- iconHtml: `<i class="${icon}" style="color: ${color};"></i>`,
174
- html: message,
175
- showConfirmButton: true,
176
- confirmButtonText: 'Yes',
177
- confirmButtonColor: color,
178
- focusConfirm: true,
179
- showDenyButton: true,
180
- denyButtonColor: color,
181
- focusDeny: false,
182
- reverseButtons: true,
183
- allowOutsideClick: false,
184
- allowEscapeKey: false,
185
- allowEnterKey: true,
186
- customClass: {
187
- denyButton: 'sweet-alert-button',
188
- confirmButton: 'sweet-alert-button'
189
- }
190
- }).then(({ value }) => setTimeout(() => Resolve(value)));
191
- });
192
- }
193
-
194
-
195
- /** */
196
- private SetIcon(element: HTMLElement, icon: string): void {
197
- for (const item of [...element.classList.value.split(' ')]) {
198
- if (item.length > 0) {
199
- element.classList.remove(item);
200
- element.classList.remove('q');
201
- }
202
- }
203
-
204
- icon = icon.trim();
205
- const hasWhiteSpaces: RegExp = / /;
206
- if (hasWhiteSpaces.test(icon)) {
207
- const classes = icon.split(' ');
208
- for (const icon of classes) element.classList.add(icon);
209
- }
210
-
211
- else element.classList.add(icon);
212
- }
213
-
214
-
215
- /** */
216
- private SetAutoHide(element: HTMLElement, autohide: number | null): void {
217
- element.removeAttribute('data-bs-autohide');
218
- element.removeAttribute('data-bs-delay');
219
-
220
- if (autohide && autohide > 0) {
221
- if (autohide < 1000) autohide = 1000;
222
- element.setAttribute('data-bs-autohide', 'true');
223
- element.setAttribute('data-bs-delay', String(autohide));
224
- }
225
-
226
- else element.setAttribute('data-bs-autohide', 'false');
227
- }
228
-
229
-
230
- /** */
231
- private GetIcon(title: string, icon: string | null, iconDefault: string): string {
232
- if (icon == null || icon == '') {
233
- title = title.replaceAll(' ', '').toUpperCase();
234
-
235
- switch(title) {
236
- case 'ENABLED': return 'fa-solid fa-thumbs-up fa-flip-horizontal';
237
- case 'ACTIVE': return 'fa-solid fa-thumbs-up fa-flip-horizontal';
238
- case 'ACTIVED': return 'fa-solid fa-thumbs-up fa-flip-horizontal';
239
- case 'DISABLE': return 'fa-solid fa-thumbs-down fa-flip-horizontal';
240
- case 'DISABLED': return 'fa-solid fa-thumbs-down fa-flip-horizontal';
241
- case 'DELETE': return 'fa-regular fa-trash-can';
242
- case 'DELETED': return 'fa-regular fa-trash-can';
243
- default: return iconDefault;
244
- }
245
- }
246
-
247
- return icon;
248
- }
249
- }
@@ -1,96 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { RouterModule } from '@angular/router';
3
- import { CommonModule } from '@angular/common';
4
- //import { DirectivesModule } from 'src/app/shared/directives/directives.module';
5
- //import { PipesModule } from 'src/app/shared/pipes/pipes.module';
6
-
7
- //Angular Material
8
- //import { MatButtonModule } from '@angular/material/button';
9
- //import { MatCheckboxModule } from '@angular/material/checkbox';
10
- //import { MatInputModule } from '@angular/material/input';
11
- //import { MatFormFieldModule } from '@angular/material/form-field';
12
- //import { MatSlideToggleModule } from '@angular/material/slide-toggle';
13
- //import { MatTabsModule } from '@angular/material/tabs';
14
-
15
- //Components
16
- import { CoerAlert } from './coer-alert/coer-alert.component';
17
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
18
- //import { CoerButton } from './coer-button/coer-button.component';
19
- //import { CoerCheckbox } from './coer-checkbox/coer-checkbox.component';
20
- //import { CoerFilebox } from './coer-filebox/coer-filebox.component';
21
- //import { CoerForm } from './coer-form/coer-form.component';
22
- //import { CoerGrid } from './coer-grid/coer-grid.component';
23
- //import { CoerModal } from './coer-modal/coer-modal.component';
24
- //import { CoerNumberBox } from './coer-numberbox/coer-numberbox.component';
25
- //import { CoerPageTitle } from './coer-page-title/coer-page-title.component';
26
- //import { CoerSelectbox } from './coer-selectbox/coer-selectbox.component';
27
- //import { CoerSwitch } from './coer-switch/coer-switch.component';
28
- //import { CoerTab } from './coer-tab/coer-tab.component';
29
- //import { CoerTextarea } from './coer-textarea/coer-textarea.component';
30
- //import { CoerTextBox } from './coer-textbox/coer-textbox.component';
31
-
32
- @NgModule({
33
- imports: [
34
- CommonModule,
35
- RouterModule,
36
- FormsModule,
37
- ReactiveFormsModule,
38
- //PipesModule,
39
- //MatButtonModule,
40
- //MatCheckboxModule,
41
- //MatInputModule,
42
- //MatFormFieldModule,
43
- //MatSlideToggleModule,
44
- //MatTabsModule,
45
- //DirectivesModule
46
- ],
47
- declarations: [
48
- CoerAlert,
49
- //CoerButton,
50
- //CoerCheckbox,
51
- //CoerFilebox,
52
- //CoerForm,
53
- //CoerGrid,
54
- //CoerModal,
55
- //CoerNumberBox,
56
- //CoerPageTitle,
57
- //CoerSelectbox,
58
- //CoerSwitch,
59
- //CoerTextarea,
60
- //CoerTab,
61
- //CoerTextBox,
62
- ],
63
- exports: [
64
- CoerAlert,
65
- //CoerButton,
66
- //CoerCheckbox,
67
- //CoerFilebox,
68
- //CoerForm,
69
- //CoerGrid,
70
- //CoerModal,
71
- //CoerNumberBox,
72
- //CoerPageTitle,
73
- //CoerSelectbox,
74
- //CoerSwitch,
75
- //CoerTextarea,
76
- //CoerTab,
77
- //CoerTextBox,
78
- ]
79
- })
80
- export class ComponentsModule { }
81
- //export * from './coer-button/coer-button.component';
82
- //export * from './coer-checkbox/coer-checkbox.component';
83
- //export * from './coer-filebox/coer-filebox.component';
84
- //export * from './coer-filebox/coer-filebox.interface';
85
- //export * from './coer-form/coer-form.component';
86
- //export * from './coer-grid/coer-grid.component';
87
- //export * from './coer-grid/coer-grid.interface';
88
- //export * from './coer-grid/coer-grid.templates';
89
- //export * from './coer-modal/coer-modal.component';
90
- //export * from './coer-numberbox/coer-numberbox.component';
91
- //export * from './coer-page-title/coer-page-title.component';
92
- //export * from './coer-page-title/pageTitle.interface';
93
- //export * from './coer-selectbox/coer-selectbox.component';
94
- //export * from './coer-switch/coer-switch.component';
95
- //export * from './coer-tab/coer-tab.component';
96
- //export * from './coer-textbox/coer-textbox.component';
@@ -1,66 +0,0 @@
1
- import { Tools } from './Tools';
2
- var Breadcrumbs = /** @class */ (function () {
3
- function Breadcrumbs() {
4
- }
5
- /** */
6
- Breadcrumbs.Add = function (page, path) {
7
- var breadcrumbs = this.Get();
8
- var paths = breadcrumbs.map(function (item) { return item.path; });
9
- if (!paths.includes(path)) {
10
- breadcrumbs.push({ page: page, path: path });
11
- this.Save(breadcrumbs);
12
- }
13
- };
14
- /** */
15
- Breadcrumbs.Get = function () {
16
- var storage = sessionStorage.getItem(this.storage);
17
- if (storage) {
18
- storage = JSON.parse(storage);
19
- if (storage.hasOwnProperty('breadcrumbs')) {
20
- return Tools.BreakReference(storage.breadcrumbs);
21
- }
22
- }
23
- return [];
24
- };
25
- /** Source */
26
- Breadcrumbs.GetFirst = function () {
27
- var breadcrumbs = this.Get();
28
- return (breadcrumbs.length > 0) ? breadcrumbs.shift() : null;
29
- };
30
- /** */
31
- Breadcrumbs.Save = function (breadcrumbs) {
32
- var storage = sessionStorage.getItem(this.storage);
33
- if (storage)
34
- storage = JSON.parse(storage);
35
- storage = Object.assign({}, storage, { breadcrumbs: breadcrumbs });
36
- sessionStorage.setItem(this.storage, JSON.stringify(storage));
37
- };
38
- /** */
39
- Breadcrumbs.Remove = function (path) {
40
- var breadcrumbs = this.Get();
41
- var index = breadcrumbs.findIndex(function (x) { return x.path.toLowerCase().trim() === path.toLowerCase().trim(); });
42
- if (index >= 0) {
43
- breadcrumbs = Tools.BreakReference(breadcrumbs).splice(0, index + 1);
44
- this.Save(breadcrumbs);
45
- }
46
- };
47
- /** */
48
- Breadcrumbs.SetLast = function (page, path) {
49
- var breadcrumbs = this.Get();
50
- if (breadcrumbs.length > 0) {
51
- breadcrumbs[breadcrumbs.length - 1] = { page: page, path: path };
52
- this.Save(breadcrumbs);
53
- }
54
- };
55
- /** */
56
- Breadcrumbs.RemoveLast = function () {
57
- var breadcrumbs = this.Get();
58
- if (breadcrumbs.length > 0) {
59
- breadcrumbs.pop();
60
- this.Save(breadcrumbs);
61
- }
62
- };
63
- Breadcrumbs.storage = 'COER-System';
64
- return Breadcrumbs;
65
- }());
66
- export { Breadcrumbs };
@@ -1,49 +0,0 @@
1
- import { NG_VALUE_ACCESSOR } from "@angular/forms";
2
- import { forwardRef } from "@angular/core";
3
- export var CONTROL_VALUE = function (component) {
4
- return {
5
- provide: NG_VALUE_ACCESSOR,
6
- useExisting: forwardRef(function () { return component; }),
7
- multi: true
8
- };
9
- };
10
- var ControlValue = /** @class */ (function () {
11
- function ControlValue() {
12
- this._isTouched = false;
13
- }
14
- Object.defineProperty(ControlValue.prototype, "isTouched", {
15
- get: function () {
16
- return this._isTouched;
17
- },
18
- enumerable: false,
19
- configurable: true
20
- });
21
- /** */
22
- ControlValue.prototype.SetValue = function (value) {
23
- if (typeof this._UpdateValue === 'function') {
24
- this._UpdateValue(value);
25
- }
26
- this._value = value;
27
- };
28
- /** */
29
- ControlValue.prototype.SetTouched = function (isTouched) {
30
- if (typeof this._IsTouched === 'function') {
31
- this._IsTouched(isTouched);
32
- }
33
- this._isTouched = isTouched;
34
- };
35
- /** */
36
- ControlValue.prototype.writeValue = function (value) {
37
- this._value = value;
38
- };
39
- /** */
40
- ControlValue.prototype.registerOnChange = function (callback) {
41
- this._UpdateValue = callback;
42
- };
43
- /** */
44
- ControlValue.prototype.registerOnTouched = function (callback) {
45
- this._IsTouched = callback;
46
- };
47
- return ControlValue;
48
- }());
49
- export { ControlValue };
@@ -1,25 +0,0 @@
1
- import moment from "moment";
2
- var DateTime = /** @class */ (function () {
3
- function DateTime() {
4
- }
5
- /** Get UTC Offset */
6
- DateTime.GetUTCOffset = function () {
7
- return moment().utcOffset();
8
- };
9
- /** Convert UTC Date to Local Zone */
10
- DateTime.ToLocalZone = function (utcDate) {
11
- return moment(utcDate).add(DateTime.GetUTCOffset(), 'minutes').format('YYYY-MM-DD HH:mm:ss');
12
- };
13
- /** Convert Local Zone Date to UTC */
14
- DateTime.ToUTC = function (utcDate) {
15
- return moment(utcDate).subtract(DateTime.GetUTCOffset(), 'minutes').format('YYYY-MM-DD HH:mm:ss');
16
- };
17
- /** DD MMM YYYY */
18
- DateTime.GetDateFormat = function (date) {
19
- if ((typeof date === 'string'))
20
- date = date.replaceAll('/', '-');
21
- return moment(date).parseZone().local(true).format('DD MMM YYYY');
22
- };
23
- return DateTime;
24
- }());
25
- export { DateTime };
@@ -1,99 +0,0 @@
1
- import { Tools } from "./Tools";
2
- import * as XLSX from 'xlsx';
3
- var Files = /** @class */ (function () {
4
- function Files() {
5
- }
6
- /** Get Extension File */
7
- Files.GetExtension = function (file) {
8
- var fileName = file.name;
9
- if (fileName.includes('.')) {
10
- var worlds = fileName.split('.');
11
- if (worlds.length > 0) {
12
- var extension = worlds.pop();
13
- extension = extension.trim().toLowerCase();
14
- if (extension.length > 0)
15
- return extension;
16
- }
17
- }
18
- return null;
19
- };
20
- /** Is Excel File */
21
- Files.IsExcel = function (file) {
22
- var EXTENSION = Files.GetExtension(file);
23
- return Tools.IsNotNull(EXTENSION)
24
- ? this.EXCEL_EXTENSIONS.includes(EXTENSION)
25
- : false;
26
- };
27
- /** Read excel file */
28
- Files.ReadExcel = function (file) {
29
- return new Promise(function (Resolve) {
30
- var columns = [];
31
- var rows = [];
32
- var reader = new FileReader();
33
- reader.readAsArrayBuffer(file);
34
- reader.onload = function () {
35
- var dataBytes = new Uint8Array(reader.result);
36
- if (dataBytes) {
37
- var workbook = XLSX.read(dataBytes, {});
38
- var sheet = workbook.Sheets[workbook.SheetNames[0]];
39
- var dataSheet = XLSX.utils.sheet_to_json(sheet, {
40
- 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']
41
- });
42
- //Get Headers
43
- for (var column in dataSheet[0]) {
44
- columns.push(Tools.FirstCharToLower(String(dataSheet[0][column]).replaceAll(' ', '')));
45
- }
46
- //Get Rows
47
- rows = XLSX.utils.sheet_to_json(sheet, { header: columns });
48
- rows.shift();
49
- rows = rows.map(function (row) {
50
- var item = Tools.BreakReference(row);
51
- delete item['__rowNum__'];
52
- return item;
53
- });
54
- }
55
- Resolve({ columns: columns, rows: rows });
56
- };
57
- reader.onerror = function () { Resolve({ columns: columns, rows: rows }); };
58
- });
59
- };
60
- /** Export to excel file */
61
- Files.ExportExcel = function (data, fileName, sheetName) {
62
- if (fileName === void 0) { fileName = 'coer_report'; }
63
- if (sheetName === void 0) { sheetName = 'Sheet1'; }
64
- sheetName = Tools.CleanUpBlanks(sheetName);
65
- fileName = Tools.CleanUpBlanks(fileName);
66
- if (fileName.endsWith('.xls') || fileName.endsWith('.xlsx') || fileName.endsWith('.csv')) {
67
- if (fileName.includes('.xls')) {
68
- fileName = fileName.replaceAll('.xls', '.xlsx');
69
- }
70
- if (fileName.includes('.csv')) {
71
- fileName = fileName.replaceAll('.csv', '.xlsx');
72
- }
73
- }
74
- else {
75
- fileName += '.xlsx';
76
- }
77
- var WORK_SHEET = XLSX.utils.json_to_sheet(data);
78
- var WORK_BOOK = XLSX.utils.book_new();
79
- XLSX.utils.book_append_sheet(WORK_BOOK, WORK_SHEET, 'Sheet1');
80
- XLSX.writeFile(WORK_BOOK, fileName);
81
- };
82
- /** Convert file to string base64 */
83
- Files.ConvertToBase64 = function (file) {
84
- return new Promise(function (Resolve) {
85
- var reader = new FileReader();
86
- reader.readAsDataURL(file);
87
- reader.onload = function () {
88
- var _a;
89
- Resolve(((_a = reader.result) === null || _a === void 0 ? void 0 : _a.toString()) || '');
90
- };
91
- reader.onerror = function () {
92
- Resolve('');
93
- };
94
- });
95
- };
96
- Files.EXCEL_EXTENSIONS = ['xls', 'xlsx', 'csv'];
97
- return Files;
98
- }());
99
- export { Files };