@falcon-ng/tailwind 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +71 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +11 -0
  4. package/src/lib/base-control.ts +142 -0
  5. package/src/lib/base-form-component.ts +363 -0
  6. package/src/lib/component/auto-complete/auto-complete.component.html +39 -0
  7. package/src/lib/component/auto-complete/auto-complete.component.scss +0 -0
  8. package/src/lib/component/auto-complete/auto-complete.component.spec.ts +23 -0
  9. package/src/lib/component/auto-complete/auto-complete.component.ts +31 -0
  10. package/src/lib/component/bottom-sheet/bottom-sheet.component.html +9 -0
  11. package/src/lib/component/bottom-sheet/bottom-sheet.component.scss +0 -0
  12. package/src/lib/component/bottom-sheet/bottom-sheet.component.spec.ts +23 -0
  13. package/src/lib/component/bottom-sheet/bottom-sheet.component.ts +19 -0
  14. package/src/lib/component/button/button.component.css +0 -0
  15. package/src/lib/component/button/button.component.html +54 -0
  16. package/src/lib/component/button/button.component.spec.ts +23 -0
  17. package/src/lib/component/button/button.component.ts +17 -0
  18. package/src/lib/component/button-toggle/button-toggle.component.html +21 -0
  19. package/src/lib/component/button-toggle/button-toggle.component.scss +0 -0
  20. package/src/lib/component/button-toggle/button-toggle.component.spec.ts +23 -0
  21. package/src/lib/component/button-toggle/button-toggle.component.ts +26 -0
  22. package/src/lib/component/checkbox/checkbox.component.html +6 -0
  23. package/src/lib/component/checkbox/checkbox.component.scss +0 -0
  24. package/src/lib/component/checkbox/checkbox.component.spec.ts +23 -0
  25. package/src/lib/component/checkbox/checkbox.component.ts +17 -0
  26. package/src/lib/component/chips/chip.component.html +75 -0
  27. package/src/lib/component/chips/chip.component.scss +3 -0
  28. package/src/lib/component/chips/chip.component.spec.ts +23 -0
  29. package/src/lib/component/chips/chip.component.ts +125 -0
  30. package/src/lib/component/date-picker/date-picker.component.html +18 -0
  31. package/src/lib/component/date-picker/date-picker.component.scss +0 -0
  32. package/src/lib/component/date-picker/date-picker.component.spec.ts +23 -0
  33. package/src/lib/component/date-picker/date-picker.component.ts +13 -0
  34. package/src/lib/component/dialog/dialog.component.html +12 -0
  35. package/src/lib/component/dialog/dialog.component.scss +3 -0
  36. package/src/lib/component/dialog/dialog.component.spec.ts +23 -0
  37. package/src/lib/component/dialog/dialog.component.ts +12 -0
  38. package/src/lib/component/pagination/pagination.component.html +10 -0
  39. package/src/lib/component/pagination/pagination.component.scss +0 -0
  40. package/src/lib/component/pagination/pagination.component.spec.ts +23 -0
  41. package/src/lib/component/pagination/pagination.component.ts +86 -0
  42. package/src/lib/component/progress-bar/progress-bar.component.html +1 -0
  43. package/src/lib/component/progress-bar/progress-bar.component.scss +0 -0
  44. package/src/lib/component/progress-bar/progress-bar.component.spec.ts +23 -0
  45. package/src/lib/component/progress-bar/progress-bar.component.ts +15 -0
  46. package/src/lib/component/progress-spinner/progress-spinner.component.html +7 -0
  47. package/src/lib/component/progress-spinner/progress-spinner.component.scss +0 -0
  48. package/src/lib/component/progress-spinner/progress-spinner.component.spec.ts +23 -0
  49. package/src/lib/component/progress-spinner/progress-spinner.component.ts +16 -0
  50. package/src/lib/component/radio/radio.component.html +13 -0
  51. package/src/lib/component/radio/radio.component.scss +14 -0
  52. package/src/lib/component/radio/radio.component.spec.ts +23 -0
  53. package/src/lib/component/radio/radio.component.ts +29 -0
  54. package/src/lib/component/rich-text-editor/rich-text-editor.component.html +10 -0
  55. package/src/lib/component/rich-text-editor/rich-text-editor.component.scss +0 -0
  56. package/src/lib/component/rich-text-editor/rich-text-editor.component.spec.ts +23 -0
  57. package/src/lib/component/rich-text-editor/rich-text-editor.component.ts +13 -0
  58. package/src/lib/component/select/select.component.html +25 -0
  59. package/src/lib/component/select/select.component.scss +0 -0
  60. package/src/lib/component/select/select.component.spec.ts +23 -0
  61. package/src/lib/component/select/select.component.ts +32 -0
  62. package/src/lib/component/slide-toggle/slide-toggle.component.html +7 -0
  63. package/src/lib/component/slide-toggle/slide-toggle.component.scss +0 -0
  64. package/src/lib/component/slide-toggle/slide-toggle.component.spec.ts +23 -0
  65. package/src/lib/component/slide-toggle/slide-toggle.component.ts +13 -0
  66. package/src/lib/component/slider/slider.component.html +11 -0
  67. package/src/lib/component/slider/slider.component.scss +0 -0
  68. package/src/lib/component/slider/slider.component.spec.ts +23 -0
  69. package/src/lib/component/slider/slider.component.ts +13 -0
  70. package/src/lib/component/snack-bar/snack-bar.component.html +1 -0
  71. package/src/lib/component/snack-bar/snack-bar.component.scss +0 -0
  72. package/src/lib/component/snack-bar/snack-bar.component.spec.ts +23 -0
  73. package/src/lib/component/snack-bar/snack-bar.component.ts +10 -0
  74. package/src/lib/component/table/table.component.html +82 -0
  75. package/src/lib/component/table/table.component.scss +17 -0
  76. package/src/lib/component/table/table.component.spec.ts +23 -0
  77. package/src/lib/component/table/table.component.ts +54 -0
  78. package/src/lib/component/textarea/textarea.component.html +22 -0
  79. package/src/lib/component/textarea/textarea.component.scss +3 -0
  80. package/src/lib/component/textarea/textarea.component.spec.ts +23 -0
  81. package/src/lib/component/textarea/textarea.component.ts +13 -0
  82. package/src/lib/component/textbox/textbox.component.html +27 -0
  83. package/src/lib/component/textbox/textbox.component.scss +3 -0
  84. package/src/lib/component/textbox/textbox.component.spec.ts +23 -0
  85. package/src/lib/component/textbox/textbox.component.ts +13 -0
  86. package/src/lib/control-builder/control-builder.component.html +5 -0
  87. package/src/lib/control-builder/control-builder.component.scss +0 -0
  88. package/src/lib/control-builder/control-builder.component.ts +14 -0
  89. package/src/lib/control-type/AutoComplete.ts +6 -0
  90. package/src/lib/control-type/Button.ts +6 -0
  91. package/src/lib/control-type/ButtonToggle.ts +6 -0
  92. package/src/lib/control-type/CheckBox.ts +6 -0
  93. package/src/lib/control-type/Chip.ts +6 -0
  94. package/src/lib/control-type/DatePicker.ts +6 -0
  95. package/src/lib/control-type/Divider.ts +6 -0
  96. package/src/lib/control-type/Editor.ts +6 -0
  97. package/src/lib/control-type/Radio.ts +6 -0
  98. package/src/lib/control-type/RichTextEditor.ts +6 -0
  99. package/src/lib/control-type/SlideToggle.ts +6 -0
  100. package/src/lib/control-type/Slider.ts +6 -0
  101. package/src/lib/control-type/select.ts +6 -0
  102. package/src/lib/control-type/textarea.ts +6 -0
  103. package/src/lib/control-type/textbox.ts +6 -0
  104. package/src/lib/falcon-core.module.ts +141 -0
  105. package/src/lib/model/constant.ts +32 -0
  106. package/src/lib/model/enum.ts +151 -0
  107. package/src/lib/model/environments.ts +28 -0
  108. package/src/lib/model/interface.ts +310 -0
  109. package/src/lib/model/ivalidator.ts +18 -0
  110. package/src/lib/module/angularmaterial.module.ts +98 -0
  111. package/src/lib/reactive-field.directive.ts +24 -0
  112. package/src/lib/service/appsetting.service.ts +57 -0
  113. package/src/lib/service/http/generic-http-client.ts +205 -0
  114. package/src/lib/service/http/httpInterceptor.ts +36 -0
  115. package/src/lib/service/http/igeneric-http-client.ts +110 -0
  116. package/src/lib/service/logger.service.ts +75 -0
  117. package/src/lib/service/open-id/TokenHelperService.ts +76 -0
  118. package/src/lib/service/open-id/auth-guard.service.ts +25 -0
  119. package/src/lib/service/open-id/auth.service.ts +179 -0
  120. package/src/public-api.ts +35 -0
  121. package/tsconfig.lib.json +15 -0
  122. package/tsconfig.lib.prod.json +10 -0
  123. package/tsconfig.spec.json +14 -0
@@ -0,0 +1,151 @@
1
+ /**
2
+ * @description
3
+ * Enum use for setting the form control Types.
4
+ * @usageNotes
5
+ * ```ts
6
+ * export class Textbox extends BaseControl<string>{
7
+ * override controlType = ControlType.Select;
8
+ * }
9
+ * ```
10
+ */
11
+ export const enum ControlType {
12
+ TextBox = 0,
13
+ TextArea = 1,
14
+ Select = 2,
15
+ DatePicker = 3,
16
+ Radio = 4,
17
+ Checkbox = 5,
18
+ Button = 6,
19
+ SlideToggle = 7,
20
+ Slider = 8,
21
+ ButtonToggle = 9,
22
+ AutoComplete = 10,
23
+ Chip = 11,
24
+ Editor = 12,
25
+ Divider = 13,
26
+ }
27
+
28
+ /**
29
+ * @description
30
+ * Enum use for Appearance of the control.
31
+ * @usageNotes
32
+ * Before and After property should be only use for Checkbox and Radio button
33
+ * ```ts
34
+ * if (componentType == ComponentType.Radio && componentType == ComponentType.Checkbox) THEN
35
+ * only use Appearance Before and After
36
+ * ```
37
+ */
38
+ export const enum Appearance {
39
+ /**
40
+ * @usageNotes Should be only use for input, textbox, and select
41
+ */
42
+ Plain = 'plain',
43
+ Legacy = 'legacy',
44
+ Standard = 'standard',
45
+ Fill = 'fill',
46
+ Outline = 'outline',
47
+ /**
48
+ * @usageNotes Should be only use for label position
49
+ */
50
+ Before = 'before',
51
+ After = 'after',
52
+ /**
53
+ * @usageNotes Should be only use for select
54
+ */
55
+ Multiple = 'true',
56
+
57
+ /**
58
+ * @usageNotes Should be only use for Buttom
59
+ */
60
+ Basic = 0,
61
+ Raised = 1,
62
+ Stroked = 2,
63
+ Flat = 3,
64
+ Icon = 4,
65
+ FAB = 5,
66
+ MiniFAB = 6,
67
+ routeLink = 7,
68
+ routeHref = 8,
69
+ }
70
+
71
+ /**
72
+ * @description
73
+ * Enum use for setting the attribute Types.
74
+ * @usageNotes
75
+ * ```ts
76
+ * componentProperty: {
77
+ * attrType: InputTypes.Text
78
+ * }
79
+ * ```
80
+ */
81
+ export const enum InputTypes {
82
+ Color = 'color',
83
+ Date = 'date',
84
+ DatetimeLocal = 'datetime-local',
85
+ Email = 'email',
86
+ Month = 'month',
87
+ Number = 'number',
88
+ Password = 'password',
89
+ Search = 'search',
90
+ Tel = 'tel',
91
+ Text = 'text',
92
+ Time = 'time',
93
+ Url = 'url',
94
+ Week = 'week',
95
+ /**
96
+ * @usageNotes Should be only use for Buttom
97
+ */
98
+ Button = 'button',
99
+ Submit = 'submit',
100
+ DragDrop = 'dragDrop',
101
+ }
102
+
103
+ /**
104
+ * @description
105
+ * Enum use for setting HTTP method.
106
+ * @usageNotes
107
+ * ```ts
108
+ * this.genericHttpClientService.Delete(this.deleteUserUrl).subscribe(item => {}, error => {});
109
+ * ```
110
+ */
111
+ export const enum HttpMethod {
112
+ Get = 'GET',
113
+ Post = 'POST',
114
+ Put = 'PUT',
115
+ Patch = 'PATCH',
116
+ Delete = 'DELETE',
117
+ }
118
+
119
+ /**
120
+ * @description
121
+ * Enum use for Table actions
122
+ */
123
+ export const enum TableAction {
124
+ View,
125
+ Edit,
126
+ Delete,
127
+ RightArrow,
128
+ }
129
+
130
+ /**
131
+ * @description
132
+ * Enum use for setting the Floating label.
133
+ * @usageNotes
134
+ * ```ts
135
+ * componentProperty: {
136
+ * floatLabel: Floatinglabel.Always
137
+ * }
138
+ * ```
139
+ */
140
+ export const enum Floatinglabel {
141
+ Auto = 'auto',
142
+ Always = 'always',
143
+ }
144
+
145
+ export const enum LoggingLevel {
146
+ None = 'None',
147
+ Verbose = 'Verbose',
148
+ Info = 'Info',
149
+ Warnings = 'Warnings',
150
+ Errors = 'Errors'
151
+ }
@@ -0,0 +1,28 @@
1
+ export abstract class EnvironmentViewModel {
2
+ abstract readonly production: boolean;
3
+ abstract readonly openID?: IOpenIdViewModel;
4
+ abstract readonly baseUrl?: string;
5
+ abstract readonly snackBarEnable?: boolean
6
+ }
7
+
8
+
9
+ /**
10
+ * @description
11
+ * Interface use for an app setting configuration for Open Id Client setting.
12
+ */
13
+ export declare interface IOpenIdViewModel {
14
+ authority?: string;
15
+ client_id?: string;
16
+ redirect_uri?: string;
17
+ response_type?: string;
18
+ scope?: string;
19
+ silent_redirect_uri?: string;
20
+ post_logout_redirect_uri?: string;
21
+ filterProtocolClaims?: boolean
22
+ loadUserInfo?: boolean
23
+ automaticSilentRenew?: boolean;
24
+ monitorSession?: boolean;
25
+ accessTokenExpiringNotificationTime?: number;
26
+ checkSessionInterval?: number;
27
+ silentRequestTimeout?: number;
28
+ }
@@ -0,0 +1,310 @@
1
+ import { HttpHeaders, HttpParams } from '@angular/common/http';
2
+ import { LoggingLevel } from './enum';
3
+ import { EventEmitter } from '@angular/core';
4
+ /**
5
+ * @description
6
+ * Interface use for IRequestOptions.
7
+ * @usageNotes
8
+ * ```ts
9
+ * {
10
+ * headers : "application/json",
11
+ * observe : "body",
12
+ * params : {},
13
+ * reportProgress : true,
14
+ * responseType : "application/json",
15
+ * withCredentials : true,
16
+ * body : {"username" : "test@test.com", "password": "xxxxxx"},
17
+ * }
18
+ * ```
19
+ */
20
+ export declare interface IRequestOptions {
21
+ headers?: HttpHeaders | { [header: string]: string | string[] };
22
+ observe?: 'body' | 'events' | 'response';
23
+ params?: HttpParams | { [param: string]: string | string[] };
24
+ reportProgress?: boolean;
25
+ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
26
+ withCredentials?: boolean;
27
+ body?: any;
28
+ }
29
+
30
+ /**
31
+ * @description
32
+ * Interface use for mat table header and column.
33
+ * @usageNotes
34
+ * ```ts
35
+ * columns: MatTable[] = [
36
+ * {
37
+ * columnDef: 'position',
38
+ * header: 'No.',
39
+ * cell: (element: any) => `${element.position}`
40
+ * }
41
+ * ]
42
+ * ```
43
+ */
44
+ export declare interface MatTable {
45
+ columnDef?: string;
46
+ header?: string;
47
+ cell?: any;
48
+ link?: IRouteLink;
49
+ }
50
+
51
+ /**
52
+ * @description
53
+ * Interface use for mat table configuration.
54
+ * @usageNotes
55
+ * ```ts
56
+ * {
57
+ * columns : MatTable[] = [{
58
+ * columnDef: 'position',
59
+ * header: 'No.',
60
+ * cell: (element: any) => `${element.position}`
61
+ * }, filter : true,
62
+ * pagination : true
63
+ * ]}
64
+ * ```
65
+ */
66
+ export declare interface MatTableConfig {
67
+ columns?: MatTable[];
68
+ dataSource?: any;
69
+ filter?: boolean;
70
+ paginationConfig?: MatTablePaginationConfig;
71
+ progressBar?: boolean;
72
+ action?: ITableAction;
73
+ property?: IMatTableStyle;
74
+ }
75
+
76
+ /**
77
+ * @description
78
+ * Interface use for mat table style
79
+ */
80
+ export declare interface IMatTableStyle {
81
+ css?: string;
82
+ style?: string;
83
+ }
84
+
85
+ /**
86
+ * @description
87
+ * Interface use for mat table pagination configuration.
88
+ */
89
+ export declare interface MatTablePaginationConfig {
90
+ pagination?: boolean;
91
+ pageSizeOptions?: number[];
92
+ }
93
+ /**
94
+ * @description
95
+ * Interface use for mat table action button configuration.
96
+ * view - action for view only
97
+ * edit - action for edit the row
98
+ * delete - action for delete the row
99
+ * menu - context menu for more action
100
+ */
101
+ export declare interface ITableAction {
102
+ view?: boolean;
103
+ edit?: boolean;
104
+ delete?: boolean;
105
+ arrowRight?: boolean;
106
+ isMenu: boolean;
107
+ menu?: IMatHint[];
108
+ }
109
+
110
+ /**
111
+ * @description
112
+ * Interface use for material hint component.
113
+ */
114
+ export declare interface IMatHint {
115
+ isIcon: boolean;
116
+ icon?: IIcon;
117
+ text?: string;
118
+ link?: IRouteLink;
119
+ disabled?: boolean;
120
+ show?: boolean;
121
+ }
122
+
123
+ /**
124
+ * @description
125
+ * Interface for icons
126
+ */
127
+ export declare interface IIcon {
128
+ iconText?: string;
129
+ iconColor?: string;
130
+ }
131
+
132
+ /**
133
+ * @description
134
+ * Interface for routerLink
135
+ */
136
+ export declare interface IRouteLink {
137
+ routerLink: string | any;
138
+ queryParams?: string;
139
+ isLink?: boolean;
140
+ }
141
+
142
+ /**
143
+ * @description
144
+ * Interface for Dialog Data
145
+ */
146
+ export declare interface IDialogData {
147
+ title: string;
148
+ cancelBtnText: string;
149
+ mainbtnText?: string;
150
+ bodyMessage?: string;
151
+ }
152
+ /**
153
+ * @description
154
+ * Interface use for setting the suffix and prefix.
155
+ * @usageNotes
156
+ * ```ts
157
+ * new Textbox({
158
+ * label: "Prefix & Suffix icon",
159
+ * appearance: Appearance.Outline,
160
+ * placeHolder: "Prefix & Suffix icon",
161
+ * attrType: InputTypes.Text,
162
+ * prefix : {
163
+ * isIcon : true,
164
+ * text : "euro"
165
+ * },
166
+ * suffix : {
167
+ * isIcon: true,
168
+ * text : "done"
169
+ * }
170
+ * });
171
+ * ```
172
+ */
173
+ export declare interface ISuffixPrefixConfig {
174
+ isIcon?: boolean;
175
+ text?: string;
176
+ toolTipText?: string;
177
+ }
178
+
179
+ /**
180
+ * @description
181
+ * Interface use for an app setting configuration.
182
+ */
183
+ export declare interface IAppSettingViewModel {
184
+ baseUrl?: string;
185
+ loggingLevel?: LoggingLevel;
186
+ }
187
+
188
+ /**
189
+ * View model for snack bar Message and Action Text
190
+ */
191
+ export interface SnackbarModel {
192
+ messageText: string;
193
+ actionText: string;
194
+ }
195
+
196
+ /**
197
+ * @description
198
+ * Interface use for setting the TextArea Property.
199
+ * @usageNotes
200
+ * ```ts
201
+ * componentProperty: {
202
+ * textAreaProperty : {
203
+ * cdkTextareaAutosize : true,
204
+ * cdkAutosizeMinRows : 1,
205
+ * cdkAutosizeMaxRows : 2,
206
+ * rows : 2,
207
+ * cols : 2
208
+ * }
209
+ * }
210
+ * ```
211
+ */
212
+ export declare interface ITextAreaProperty {
213
+ cdkTextareaAutosize?: boolean;
214
+ cdkAutosizeMinRows?: number;
215
+ cdkAutosizeMaxRows?: number;
216
+ rows?: number;
217
+ cols?: number;
218
+ }
219
+
220
+ /**
221
+ * @description
222
+ * Interface use for setting the options meta for select control.
223
+ * @usageNotes
224
+ * ```ts
225
+ * componentProperty: {
226
+ * selectProperty: {multiple : true};
227
+ * }
228
+ * ```
229
+ */
230
+ export declare interface ISelectOptions {
231
+ single?: boolean;
232
+ multiple?: boolean;
233
+ }
234
+
235
+ /**
236
+ * @description
237
+ * Interface use for setting the options meta.
238
+ * Disable is used for select option values
239
+ * @usageNotes
240
+ * ```ts
241
+ * componentProperty: {
242
+ * options: [{key : 'key-1', value : 'value-1', icon: 'material_icon', disabled: true}];
243
+ * }
244
+ * ```
245
+ */
246
+ export declare interface IOptions {
247
+ key?: any;
248
+ value?: any;
249
+ icon?: string;
250
+ class?: string;
251
+ disabled?: boolean;
252
+ }
253
+
254
+ /**
255
+ * @description
256
+ * @param change change event for the control
257
+ * @param click click event for the control
258
+ * Events for controls
259
+ */
260
+ export declare interface IComponentEvent<T> {
261
+ change?: EventEmitter<T>;
262
+ click?: EventEmitter<T>;
263
+ keyboardEnter?: EventEmitter<T>;
264
+ }
265
+ /**
266
+ * @description
267
+ * Interface use for setting the Mat Slider Property.
268
+ * @usageNotes
269
+ * ```ts
270
+ * componentProperty: {
271
+ * sliderProperty : {
272
+ * invert : true,
273
+ * step : 1,
274
+ * thumbLabel : false,
275
+ * vertical : true,
276
+ * horizontal : false
277
+ * }
278
+ * }
279
+ * ```
280
+ */
281
+ export declare interface ISliderProperty {
282
+ invert?: boolean;
283
+ thumbLabel?: boolean;
284
+ vertical?: boolean;
285
+ min?: number;
286
+ max?: number;
287
+ step?: number;
288
+ tickInterval?: string | number;
289
+ }
290
+
291
+ /**
292
+ * @description
293
+ * Interface use for mat table header and column.
294
+ * @usageNotes
295
+ * ```ts
296
+ * columns: MatTable[] = [
297
+ * {
298
+ * columnDef: 'position',
299
+ * header: 'No.',
300
+ * cell: (element: any) => `${element.position}`
301
+ * }
302
+ * ]
303
+ * ```
304
+ */
305
+ export declare interface MatTable {
306
+ columnDef?: string;
307
+ header?: string;
308
+ cell?: any;
309
+ link?: IRouteLink;
310
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @description
3
+ * Interface use for validation config.
4
+ * @usageNotes
5
+ * ```ts
6
+ * validations: [
7
+ * {
8
+ * name: "required",
9
+ * validator: Validators.required,
10
+ * message: "Required Field"
11
+ * }]
12
+ * ```
13
+ */
14
+ export declare interface IValidator {
15
+ name: string;
16
+ validator: any;
17
+ message: string;
18
+ }
@@ -0,0 +1,98 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import {ScrollingModule} from "@angular/cdk/scrolling";
4
+ import {PortalModule} from "@angular/cdk/portal";
5
+ import {OverlayModule} from "@angular/cdk/overlay";
6
+ import {MatTreeModule} from "@angular/material/tree";
7
+ import {MatTooltipModule} from "@angular/material/tooltip";
8
+ import {MatToolbarModule} from "@angular/material/toolbar";
9
+ import {MatTabsModule} from "@angular/material/tabs";
10
+ import {MatTableModule} from "@angular/material/table";
11
+ import {MatSortModule} from "@angular/material/sort";
12
+ import {MatSnackBarModule} from "@angular/material/snack-bar";
13
+ import {MatSlideToggleModule} from "@angular/material/slide-toggle";
14
+ import {MatSliderModule} from "@angular/material/slider";
15
+ import {MatSidenavModule} from "@angular/material/sidenav";
16
+ import {MatSelectModule} from "@angular/material/select";
17
+ import {MatNativeDateModule, MatRippleModule} from "@angular/material/core";
18
+ import {MatRadioModule} from "@angular/material/radio";
19
+ import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
20
+ import {MatProgressBarModule} from "@angular/material/progress-bar";
21
+ import {MatPaginatorModule} from "@angular/material/paginator";
22
+ import {MatMenuModule} from "@angular/material/menu";
23
+ import {MatListModule} from "@angular/material/list";
24
+ import {MatInputModule} from "@angular/material/input";
25
+ import {MatIconModule} from "@angular/material/icon";
26
+ import {MatGridListModule} from "@angular/material/grid-list";
27
+ import {MatExpansionModule} from "@angular/material/expansion";
28
+ import {MatDividerModule} from "@angular/material/divider";
29
+ import {MatDialogModule} from "@angular/material/dialog";
30
+ import {MatDatepickerModule} from "@angular/material/datepicker";
31
+ import {MatStepperModule} from "@angular/material/stepper";
32
+ import {MatChipsModule} from "@angular/material/chips";
33
+ import {MatCheckboxModule} from "@angular/material/checkbox";
34
+ import {MatCardModule} from "@angular/material/card";
35
+ import {MatButtonToggleModule} from "@angular/material/button-toggle";
36
+ import {MatButtonModule} from "@angular/material/button";
37
+ import {MatBottomSheetModule} from "@angular/material/bottom-sheet";
38
+ import {MatBadgeModule} from "@angular/material/badge";
39
+ import {MatAutocompleteModule} from "@angular/material/autocomplete";
40
+ import {DragDropModule} from "@angular/cdk/drag-drop";
41
+ import {CdkTreeModule} from "@angular/cdk/tree";
42
+ import {CdkTableModule} from "@angular/cdk/table";
43
+ import {CdkStepperModule} from "@angular/cdk/stepper";
44
+ import {ClipboardModule} from "@angular/cdk/clipboard";
45
+ import {A11yModule} from "@angular/cdk/a11y";
46
+
47
+
48
+
49
+ @NgModule({
50
+ declarations: [],
51
+ exports: [
52
+ A11yModule,
53
+ ClipboardModule,
54
+ CdkStepperModule,
55
+ CdkTableModule,
56
+ CdkTreeModule,
57
+ DragDropModule,
58
+ MatAutocompleteModule,
59
+ MatBadgeModule,
60
+ MatBottomSheetModule,
61
+ MatButtonModule,
62
+ MatButtonToggleModule,
63
+ MatCardModule,
64
+ MatCheckboxModule,
65
+ MatChipsModule,
66
+ MatStepperModule,
67
+ MatDatepickerModule,
68
+ MatDialogModule,
69
+ MatDividerModule,
70
+ MatExpansionModule,
71
+ MatGridListModule,
72
+ MatIconModule,
73
+ MatInputModule,
74
+ MatListModule,
75
+ MatMenuModule,
76
+ MatNativeDateModule,
77
+ MatPaginatorModule,
78
+ MatProgressBarModule,
79
+ MatProgressSpinnerModule,
80
+ MatRadioModule,
81
+ MatRippleModule,
82
+ MatSelectModule,
83
+ MatSidenavModule,
84
+ MatSliderModule,
85
+ MatSlideToggleModule,
86
+ MatSnackBarModule,
87
+ MatSortModule,
88
+ MatTableModule,
89
+ MatTabsModule,
90
+ MatToolbarModule,
91
+ MatTooltipModule,
92
+ MatTreeModule,
93
+ OverlayModule,
94
+ PortalModule,
95
+ ScrollingModule
96
+ ]
97
+ })
98
+ export class AngularmaterialModule { }
@@ -0,0 +1,24 @@
1
+ import {ComponentRef, Directive, Input, OnInit, ViewContainerRef} from '@angular/core';
2
+ import {BaseControl} from "./base-control";
3
+ import {FormGroup} from "@angular/forms";
4
+ import {Constant} from "./model/constant";
5
+
6
+ @Directive({
7
+ selector: '[reactiveField]'
8
+ })
9
+ export class ReactiveFieldDirective implements OnInit {
10
+ @Input() control!: BaseControl<string>;
11
+ @Input() formGroup!: FormGroup;
12
+ private componentRef!: ComponentRef<any>;
13
+ constructor(private viewContainerRef: ViewContainerRef) {
14
+ }
15
+
16
+ ngOnInit(): void {
17
+ if (this.control !== undefined) {
18
+ this.componentRef = this.viewContainerRef.createComponent(Constant.ComponentMapper[this.control.controlType]);
19
+ this.componentRef.instance.control = this.control;
20
+ this.componentRef.instance.formGroup = this.formGroup;
21
+ }
22
+ }
23
+
24
+ }
@@ -0,0 +1,57 @@
1
+ import {Injectable} from '@angular/core';
2
+ import {HttpClient} from '@angular/common/http';
3
+ import {Subject, Observable, from} from 'rxjs';
4
+ import {LoggerService} from './logger.service';
5
+
6
+ @Injectable({
7
+ providedIn: 'root'
8
+ })
9
+ export class AppSettingService {
10
+ static APP_SETTINGS_LOADED = "APP_SETTINGS_LOADED";
11
+ private listeners: any;
12
+ initialized: boolean = false;
13
+ private eventsSubject: Subject<any>;
14
+ public isServiceReady: Subject<boolean> = new Subject<boolean>();
15
+ private events: Observable<any>;
16
+ private appSettings: any;
17
+
18
+ constructor(private http: HttpClient, private logger: LoggerService) {
19
+ this.listeners = {};
20
+ this.eventsSubject = new Subject<any>();
21
+
22
+ this.events = from(this.eventsSubject);
23
+ this.events.subscribe(
24
+ ({name, args}) => {
25
+ if (this.listeners[name]) {
26
+ for (let listener of this.listeners[name]) {
27
+ listener(...args);
28
+ }
29
+ }
30
+ });
31
+ }
32
+
33
+ async load() {
34
+ if (this.initialized) return;
35
+ let data = await this.http.get('assets/appsetting.json').toPromise();
36
+ this.appSettings = data;
37
+ this.initialized = true;
38
+ this.isServiceReady.next(this.initialized);
39
+ this.logger.info("[AppSettingService] load --> isServiceReady", this.initialized);
40
+ }
41
+
42
+ on(name: any, listener: any) {
43
+ if (!this.listeners[name]) {
44
+ this.listeners[name] = [];
45
+ }
46
+
47
+ this.listeners[name].push(listener);
48
+ }
49
+
50
+ public getAppsettingValue<T>(): T | null {
51
+ return this.appSettings ? <T>this.appSettings : null;
52
+ }
53
+ }
54
+
55
+ export function appSettingsFactory(appSettings: AppSettingService) {
56
+ return async () => await appSettings.load();
57
+ };