@abp/ng.theme.shared 5.0.0-rc.1 → 5.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 (207) hide show
  1. package/abp-ng.theme.shared.d.ts +5 -5
  2. package/bundles/abp-ng.theme.shared-extensions.umd.js +1749 -1748
  3. package/bundles/abp-ng.theme.shared-extensions.umd.js.map +1 -1
  4. package/bundles/abp-ng.theme.shared-testing.umd.js +41 -41
  5. package/bundles/abp-ng.theme.shared.umd.js +2316 -2316
  6. package/bundles/abp-ng.theme.shared.umd.js.map +1 -1
  7. package/esm2015/abp-ng.theme.shared.js +4 -4
  8. package/esm2015/extensions/abp-ng.theme.shared-extensions.js +4 -4
  9. package/esm2015/extensions/lib/adapters/date-time.adapter.js +33 -33
  10. package/esm2015/extensions/lib/adapters/date.adapter.js +40 -40
  11. package/esm2015/extensions/lib/adapters/time.adapter.js +35 -35
  12. package/esm2015/extensions/lib/components/abstract-actions/abstract-actions.component.js +24 -24
  13. package/esm2015/extensions/lib/components/date-time-picker/date-time-picker.component.js +73 -73
  14. package/esm2015/extensions/lib/components/extensible-form/extensible-form-prop.component.js +164 -164
  15. package/esm2015/extensions/lib/components/extensible-form/extensible-form.component.js +70 -70
  16. package/esm2015/extensions/lib/components/extensible-table/extensible-table.component.js +133 -133
  17. package/esm2015/extensions/lib/components/grid-actions/grid-actions.component.js +45 -45
  18. package/esm2015/extensions/lib/components/page-toolbar/page-toolbar.component.js +45 -45
  19. package/esm2015/extensions/lib/constants/extra-properties.js +1 -1
  20. package/esm2015/extensions/lib/directives/disabled.directive.js +28 -28
  21. package/esm2015/extensions/lib/directives/prop-data.directive.js +40 -40
  22. package/esm2015/extensions/lib/enums/props.enum.js +1 -1
  23. package/esm2015/extensions/lib/models/actions.js +45 -45
  24. package/esm2015/extensions/lib/models/entity-actions.js +28 -28
  25. package/esm2015/extensions/lib/models/entity-props.js +36 -34
  26. package/esm2015/extensions/lib/models/form-props.js +51 -51
  27. package/esm2015/extensions/lib/models/internal/object-extensions.js +1 -1
  28. package/esm2015/extensions/lib/models/object-extensions.js +2 -2
  29. package/esm2015/extensions/lib/models/props.js +49 -49
  30. package/esm2015/extensions/lib/models/toolbar-actions.js +40 -40
  31. package/esm2015/extensions/lib/services/extensions.service.js +23 -23
  32. package/esm2015/extensions/lib/tokens/extensions.token.js +6 -6
  33. package/esm2015/extensions/lib/ui-extensions.module.js +91 -91
  34. package/esm2015/extensions/lib/utils/actions.util.js +8 -8
  35. package/esm2015/extensions/lib/utils/enum.util.js +41 -41
  36. package/esm2015/extensions/lib/utils/factory.util.js +3 -3
  37. package/esm2015/extensions/lib/utils/form-props.util.js +50 -50
  38. package/esm2015/extensions/lib/utils/localization.util.js +12 -12
  39. package/esm2015/extensions/lib/utils/props.util.js +13 -13
  40. package/esm2015/extensions/lib/utils/state.util.js +123 -123
  41. package/esm2015/extensions/lib/utils/typeahead.util.js +51 -51
  42. package/esm2015/extensions/lib/utils/validation.util.js +10 -10
  43. package/esm2015/extensions/public-api.js +27 -27
  44. package/esm2015/lib/animations/bounce.animations.js +16 -16
  45. package/esm2015/lib/animations/collapse.animations.js +49 -49
  46. package/esm2015/lib/animations/fade.animations.js +37 -37
  47. package/esm2015/lib/animations/index.js +6 -6
  48. package/esm2015/lib/animations/modal.animations.js +10 -10
  49. package/esm2015/lib/animations/slide.animations.js +7 -7
  50. package/esm2015/lib/animations/toast.animations.js +12 -12
  51. package/esm2015/lib/components/breadcrumb/breadcrumb.component.js +48 -48
  52. package/esm2015/lib/components/breadcrumb-items/breadcrumb-items.component.js +21 -21
  53. package/esm2015/lib/components/button/button.component.js +71 -71
  54. package/esm2015/lib/components/confirmation/confirmation.component.js +39 -39
  55. package/esm2015/lib/components/http-error-wrapper/http-error-wrapper.component.js +65 -65
  56. package/esm2015/lib/components/index.js +12 -12
  57. package/esm2015/lib/components/loader-bar/loader-bar.component.js +101 -101
  58. package/esm2015/lib/components/loading/loading.component.js +17 -17
  59. package/esm2015/lib/components/modal/modal-close.directive.js +27 -27
  60. package/esm2015/lib/components/modal/modal-ref.service.js +25 -25
  61. package/esm2015/lib/components/modal/modal.component.js +188 -188
  62. package/esm2015/lib/components/toast/toast.component.js +60 -60
  63. package/esm2015/lib/components/toast-container/toast-container.component.js +48 -48
  64. package/esm2015/lib/constants/styles.js +1 -1
  65. package/esm2015/lib/constants/validation.js +14 -14
  66. package/esm2015/lib/directives/ellipsis.directive.js +62 -62
  67. package/esm2015/lib/directives/index.js +4 -4
  68. package/esm2015/lib/directives/loading.directive.js +89 -89
  69. package/esm2015/lib/directives/ngx-datatable-default.directive.js +74 -74
  70. package/esm2015/lib/directives/ngx-datatable-list.directive.js +93 -93
  71. package/esm2015/lib/enums/index.js +1 -1
  72. package/esm2015/lib/enums/route-names.js +1 -1
  73. package/esm2015/lib/handlers/document-dir.handler.js +32 -32
  74. package/esm2015/lib/handlers/error.handler.js +291 -291
  75. package/esm2015/lib/handlers/index.js +2 -2
  76. package/esm2015/lib/models/common.js +1 -1
  77. package/esm2015/lib/models/confirmation.js +9 -9
  78. package/esm2015/lib/models/index.js +5 -5
  79. package/esm2015/lib/models/nav-item.js +6 -6
  80. package/esm2015/lib/models/statistics.js +1 -1
  81. package/esm2015/lib/models/toaster.js +1 -1
  82. package/esm2015/lib/providers/index.js +2 -2
  83. package/esm2015/lib/providers/ng-bootstrap-config.provider.js +16 -16
  84. package/esm2015/lib/providers/route.provider.js +17 -17
  85. package/esm2015/lib/services/confirmation.service.js +67 -67
  86. package/esm2015/lib/services/index.js +4 -4
  87. package/esm2015/lib/services/nav-items.service.js +50 -50
  88. package/esm2015/lib/services/page-alert.service.js +25 -25
  89. package/esm2015/lib/services/toaster.service.js +102 -102
  90. package/esm2015/lib/theme-shared.module.js +164 -164
  91. package/esm2015/lib/tokens/append-content.token.js +10 -10
  92. package/esm2015/lib/tokens/http-error.token.js +9 -9
  93. package/esm2015/lib/tokens/index.js +4 -4
  94. package/esm2015/lib/tokens/ngx-datatable-messages.token.js +7 -7
  95. package/esm2015/lib/tokens/suppress-unsaved-changes-warning.token.js +2 -2
  96. package/esm2015/lib/utils/date-parser-formatter.js +58 -58
  97. package/esm2015/lib/utils/index.js +2 -2
  98. package/esm2015/lib/utils/validation-utils.js +32 -32
  99. package/esm2015/public-api.js +15 -15
  100. package/esm2015/testing/abp-ng.theme.shared-testing.js +4 -4
  101. package/esm2015/testing/lib/models/config.js +1 -1
  102. package/esm2015/testing/lib/models/index.js +1 -1
  103. package/esm2015/testing/lib/theme-shared-testing.module.js +42 -42
  104. package/esm2015/testing/public-api.js +3 -3
  105. package/extensions/abp-ng.theme.shared-extensions.d.ts +5 -5
  106. package/extensions/lib/adapters/date-time.adapter.d.ts +11 -11
  107. package/extensions/lib/adapters/date.adapter.d.ts +9 -9
  108. package/extensions/lib/adapters/time.adapter.d.ts +8 -8
  109. package/extensions/lib/components/abstract-actions/abstract-actions.component.d.ts +14 -14
  110. package/extensions/lib/components/date-time-picker/date-time-picker.component.d.ts +16 -16
  111. package/extensions/lib/components/extensible-form/extensible-form-prop.component.d.ts +37 -37
  112. package/extensions/lib/components/extensible-form/extensible-form.component.d.ts +24 -24
  113. package/extensions/lib/components/extensible-table/extensible-table.component.d.ts +35 -35
  114. package/extensions/lib/components/grid-actions/grid-actions.component.d.ts +13 -13
  115. package/extensions/lib/components/page-toolbar/page-toolbar.component.d.ts +12 -12
  116. package/extensions/lib/constants/extra-properties.d.ts +1 -1
  117. package/extensions/lib/directives/disabled.directive.d.ts +11 -11
  118. package/extensions/lib/directives/prop-data.directive.d.ts +19 -19
  119. package/extensions/lib/enums/props.enum.d.ts +15 -15
  120. package/extensions/lib/models/actions.d.ts +35 -35
  121. package/extensions/lib/models/entity-actions.d.ts +22 -22
  122. package/extensions/lib/models/entity-props.d.ts +29 -29
  123. package/extensions/lib/models/form-props.d.ts +42 -42
  124. package/extensions/lib/models/internal/object-extensions.d.ts +85 -85
  125. package/extensions/lib/models/object-extensions.d.ts +2 -2
  126. package/extensions/lib/models/props.d.ts +39 -39
  127. package/extensions/lib/models/toolbar-actions.d.ts +29 -29
  128. package/extensions/lib/services/extensions.service.d.ts +14 -14
  129. package/extensions/lib/tokens/extensions.token.d.ts +14 -14
  130. package/extensions/lib/ui-extensions.module.d.ts +23 -23
  131. package/extensions/lib/utils/actions.util.d.ts +7 -7
  132. package/extensions/lib/utils/enum.util.d.ts +7 -7
  133. package/extensions/lib/utils/factory.util.d.ts +1 -1
  134. package/extensions/lib/utils/form-props.util.d.ts +3 -3
  135. package/extensions/lib/utils/localization.util.d.ts +3 -3
  136. package/extensions/lib/utils/props.util.d.ts +8 -8
  137. package/extensions/lib/utils/state.util.d.ts +5 -5
  138. package/extensions/lib/utils/typeahead.util.d.ts +11 -11
  139. package/extensions/lib/utils/validation.util.d.ts +3 -3
  140. package/extensions/public-api.d.ts +27 -27
  141. package/fesm2015/abp-ng.theme.shared-extensions.js +1227 -1226
  142. package/fesm2015/abp-ng.theme.shared-extensions.js.map +1 -1
  143. package/fesm2015/abp-ng.theme.shared-testing.js +37 -37
  144. package/fesm2015/abp-ng.theme.shared.js +1858 -1858
  145. package/fesm2015/abp-ng.theme.shared.js.map +1 -1
  146. package/lib/animations/bounce.animations.d.ts +1 -1
  147. package/lib/animations/collapse.animations.d.ts +9 -9
  148. package/lib/animations/fade.animations.d.ts +10 -10
  149. package/lib/animations/index.d.ts +6 -6
  150. package/lib/animations/modal.animations.d.ts +2 -2
  151. package/lib/animations/slide.animations.d.ts +1 -1
  152. package/lib/animations/toast.animations.d.ts +1 -1
  153. package/lib/components/breadcrumb/breadcrumb.component.d.ts +16 -16
  154. package/lib/components/breadcrumb-items/breadcrumb-items.component.d.ts +7 -7
  155. package/lib/components/button/button.component.d.ts +25 -25
  156. package/lib/components/confirmation/confirmation.component.d.ts +14 -14
  157. package/lib/components/http-error-wrapper/http-error-wrapper.component.d.ts +27 -27
  158. package/lib/components/index.d.ts +12 -12
  159. package/lib/components/loader-bar/loader-bar.component.d.ts +33 -33
  160. package/lib/components/loading/loading.component.d.ts +5 -5
  161. package/lib/components/modal/modal-close.directive.d.ts +9 -9
  162. package/lib/components/modal/modal-ref.service.d.ts +13 -13
  163. package/lib/components/modal/modal.component.d.ts +50 -50
  164. package/lib/components/toast/toast.component.d.ts +14 -14
  165. package/lib/components/toast-container/toast-container.component.d.ts +18 -18
  166. package/lib/constants/styles.d.ts +2 -2
  167. package/lib/constants/validation.d.ts +14 -14
  168. package/lib/directives/ellipsis.directive.d.ts +21 -21
  169. package/lib/directives/index.d.ts +4 -4
  170. package/lib/directives/loading.directive.d.ts +25 -25
  171. package/lib/directives/ngx-datatable-default.directive.d.ts +30 -30
  172. package/lib/directives/ngx-datatable-list.directive.d.ts +24 -24
  173. package/lib/enums/index.d.ts +1 -1
  174. package/lib/enums/route-names.d.ts +3 -3
  175. package/lib/handlers/document-dir.handler.d.ts +13 -13
  176. package/lib/handlers/error.handler.d.ts +82 -82
  177. package/lib/handlers/index.d.ts +2 -2
  178. package/lib/models/common.d.ts +19 -19
  179. package/lib/models/confirmation.d.ts +25 -25
  180. package/lib/models/index.d.ts +5 -5
  181. package/lib/models/nav-item.d.ts +11 -11
  182. package/lib/models/statistics.d.ts +12 -12
  183. package/lib/models/toaster.d.ts +30 -30
  184. package/lib/providers/index.d.ts +2 -2
  185. package/lib/providers/ng-bootstrap-config.provider.d.ts +8 -8
  186. package/lib/providers/route.provider.d.ts +8 -8
  187. package/lib/services/confirmation.service.d.ts +21 -21
  188. package/lib/services/index.d.ts +4 -4
  189. package/lib/services/nav-items.service.d.ts +13 -13
  190. package/lib/services/page-alert.service.d.ts +18 -18
  191. package/lib/services/toaster.service.d.ts +60 -60
  192. package/lib/theme-shared.module.d.ts +33 -33
  193. package/lib/tokens/append-content.token.d.ts +2 -2
  194. package/lib/tokens/http-error.token.d.ts +5 -5
  195. package/lib/tokens/index.d.ts +4 -4
  196. package/lib/tokens/ngx-datatable-messages.token.d.ts +12 -12
  197. package/lib/tokens/suppress-unsaved-changes-warning.token.d.ts +2 -2
  198. package/lib/utils/date-parser-formatter.d.ts +12 -12
  199. package/lib/utils/index.d.ts +2 -2
  200. package/lib/utils/validation-utils.d.ts +3 -3
  201. package/package.json +4 -4
  202. package/public-api.d.ts +12 -12
  203. package/testing/abp-ng.theme.shared-testing.d.ts +5 -5
  204. package/testing/lib/models/config.d.ts +4 -4
  205. package/testing/lib/models/index.d.ts +1 -1
  206. package/testing/lib/theme-shared-testing.module.d.ts +14 -14
  207. package/testing/public-api.d.ts +3 -3
@@ -10,231 +10,231 @@ import { LinkedList } from '@abp/utils';
10
10
  import * as i6 from '@ngx-validate/core';
11
11
  import { NgxValidateCoreModule } from '@ngx-validate/core';
12
12
  import * as i1 from '@abp/ng.core';
13
- import { RestService, AbpValidators, PermissionService, getShortDateShortTimeFormat, getShortTimeFormat, getShortDateFormat, CoreModule, LocalizationService, createLocalizationPipeKeyGenerator } from '@abp/ng.core';
13
+ import { RestService, AbpValidators, escapeHtmlChars, PermissionService, getShortDateShortTimeFormat, getShortTimeFormat, getShortDateFormat, CoreModule, LocalizationService, createLocalizationPipeKeyGenerator } from '@abp/ng.core';
14
14
  import { of, merge, pipe, zip } from 'rxjs';
15
15
  import { map, debounceTime, distinctUntilChanged, switchMap, filter, take } from 'rxjs/operators';
16
16
  import * as i2$2 from '@swimlane/ngx-datatable';
17
17
  import * as i4 from '@abp/ng.theme.shared';
18
18
  import { ThemeSharedModule } from '@abp/ng.theme.shared';
19
19
 
20
- class DateTimeAdapter {
21
- fromModel(value) {
22
- if (!value)
23
- return null;
24
- const date = new Date(value);
25
- if (isNaN(date))
26
- return null;
27
- this.value = {
28
- year: date.getFullYear(),
29
- month: date.getMonth() + 1,
30
- day: date.getDate(),
31
- hour: date.getHours(),
32
- minute: date.getMinutes(),
33
- second: date.getSeconds(),
34
- };
35
- return this.value;
36
- }
37
- toModel(value) {
38
- if (!value)
39
- return '';
40
- //const now = new Date();
41
- value = Object.assign(Object.assign({}, this.value), value);
42
- const date = new Date(value.year, value.month - 1, value.day, value.hour, value.minute, value.second);
43
- return new Date(date).toISOString();
44
- }
45
- }
46
- DateTimeAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateTimeAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
47
- DateTimeAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateTimeAdapter });
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateTimeAdapter, decorators: [{
49
- type: Injectable
20
+ class DateTimeAdapter {
21
+ fromModel(value) {
22
+ if (!value)
23
+ return null;
24
+ const date = new Date(value);
25
+ if (isNaN(date))
26
+ return null;
27
+ this.value = {
28
+ year: date.getFullYear(),
29
+ month: date.getMonth() + 1,
30
+ day: date.getDate(),
31
+ hour: date.getHours(),
32
+ minute: date.getMinutes(),
33
+ second: date.getSeconds(),
34
+ };
35
+ return this.value;
36
+ }
37
+ toModel(value) {
38
+ if (!value)
39
+ return '';
40
+ //const now = new Date();
41
+ value = Object.assign(Object.assign({}, this.value), value);
42
+ const date = new Date(value.year, value.month - 1, value.day, value.hour, value.minute, value.second);
43
+ return new Date(date).toISOString();
44
+ }
45
+ }
46
+ DateTimeAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateTimeAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
47
+ DateTimeAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateTimeAdapter });
48
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateTimeAdapter, decorators: [{
49
+ type: Injectable
50
50
  }] });
51
51
 
52
- class DateAdapter extends NgbDateAdapter {
53
- fromModel(value) {
54
- if (!value)
55
- return null;
56
- let date;
57
- if (typeof value === 'string') {
58
- date = this.dateOf(value);
59
- }
60
- else {
61
- date = new Date(value);
62
- }
63
- if (isNaN(date))
64
- return null;
65
- return {
66
- day: date.getDate(),
67
- month: date.getMonth() + 1,
68
- year: date.getFullYear(),
69
- };
70
- }
71
- toModel(value) {
72
- if (!value)
73
- return '';
74
- const date = new Date(value.year, value.month - 1, value.day);
75
- const formattedDate = formatDate(date, 'yyyy-MM-dd', 'en');
76
- return formattedDate;
77
- }
78
- dateOf(value) {
79
- const dateUtc = new Date(Date.parse(value));
80
- return new Date(dateUtc.getTime() + Math.abs(dateUtc.getTimezoneOffset() * 60000));
81
- }
82
- }
83
- DateAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
84
- DateAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateAdapter });
85
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateAdapter, decorators: [{
86
- type: Injectable
52
+ class DateAdapter extends NgbDateAdapter {
53
+ fromModel(value) {
54
+ if (!value)
55
+ return null;
56
+ let date;
57
+ if (typeof value === 'string') {
58
+ date = this.dateOf(value);
59
+ }
60
+ else {
61
+ date = new Date(value);
62
+ }
63
+ if (isNaN(date))
64
+ return null;
65
+ return {
66
+ day: date.getDate(),
67
+ month: date.getMonth() + 1,
68
+ year: date.getFullYear(),
69
+ };
70
+ }
71
+ toModel(value) {
72
+ if (!value)
73
+ return '';
74
+ const date = new Date(value.year, value.month - 1, value.day);
75
+ const formattedDate = formatDate(date, 'yyyy-MM-dd', 'en');
76
+ return formattedDate;
77
+ }
78
+ dateOf(value) {
79
+ const dateUtc = new Date(Date.parse(value));
80
+ return new Date(dateUtc.getTime() + Math.abs(dateUtc.getTimezoneOffset() * 60000));
81
+ }
82
+ }
83
+ DateAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
84
+ DateAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateAdapter });
85
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateAdapter, decorators: [{
86
+ type: Injectable
87
87
  }] });
88
88
 
89
- class TimeAdapter extends NgbTimeAdapter {
90
- fromModel(value) {
91
- if (!value)
92
- return null;
93
- const date = isTimeStr(value)
94
- ? new Date(0, 0, 1, ...value.split(':').map(Number))
95
- : new Date(value);
96
- if (isNaN(date))
97
- return null;
98
- return {
99
- hour: date.getHours(),
100
- minute: date.getMinutes(),
101
- second: date.getSeconds(),
102
- };
103
- }
104
- toModel(value) {
105
- if (!value)
106
- return '';
107
- const date = new Date(0, 0, 1, value.hour, value.minute, value.second);
108
- const formattedDate = formatDate(date, 'HH:mm', 'en');
109
- return formattedDate;
110
- }
111
- }
112
- TimeAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TimeAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
113
- TimeAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TimeAdapter });
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TimeAdapter, decorators: [{
115
- type: Injectable
116
- }] });
117
- function isTimeStr(value) {
118
- return /^((2[123])|[01][0-9])(\:[0-5][0-9]){1,2}$/.test(String(value));
89
+ class TimeAdapter extends NgbTimeAdapter {
90
+ fromModel(value) {
91
+ if (!value)
92
+ return null;
93
+ const date = isTimeStr(value)
94
+ ? new Date(0, 0, 1, ...value.split(':').map(Number))
95
+ : new Date(value);
96
+ if (isNaN(date))
97
+ return null;
98
+ return {
99
+ hour: date.getHours(),
100
+ minute: date.getMinutes(),
101
+ second: date.getSeconds(),
102
+ };
103
+ }
104
+ toModel(value) {
105
+ if (!value)
106
+ return '';
107
+ const date = new Date(0, 0, 1, value.hour, value.minute, value.second);
108
+ const formattedDate = formatDate(date, 'HH:mm', 'en');
109
+ return formattedDate;
110
+ }
111
+ }
112
+ TimeAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TimeAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
113
+ TimeAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TimeAdapter });
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TimeAdapter, decorators: [{
115
+ type: Injectable
116
+ }] });
117
+ function isTimeStr(value) {
118
+ return /^((2[123])|[01][0-9])(\:[0-5][0-9]){1,2}$/.test(String(value));
119
119
  }
120
120
 
121
- class PropList extends LinkedList {
122
- }
123
- class PropData {
124
- get data() {
125
- return {
126
- getInjected: this.getInjected,
127
- index: this.index,
128
- record: this.record,
129
- };
130
- }
131
- }
132
- class Prop {
133
- constructor(type, name, displayName, permission, visible = _ => true, isExtra = false) {
134
- this.type = type;
135
- this.name = name;
136
- this.displayName = displayName;
137
- this.permission = permission;
138
- this.visible = visible;
139
- this.isExtra = isExtra;
140
- this.displayName = this.displayName || this.name;
141
- }
142
- }
143
- class PropsFactory {
144
- constructor() {
145
- this.contributorCallbacks = {};
146
- }
147
- get(name) {
148
- this.contributorCallbacks[name] = this.contributorCallbacks[name] || [];
149
- return new this._ctor(this.contributorCallbacks[name]);
150
- }
151
- }
152
- class Props {
153
- constructor(callbackList) {
154
- this.callbackList = callbackList;
155
- }
156
- get props() {
157
- const propList = new this._ctor();
158
- this.callbackList.forEach(callback => callback(propList));
159
- return propList;
160
- }
161
- addContributor(contributeCallback) {
162
- this.callbackList.push(contributeCallback);
163
- }
164
- clearContributors() {
165
- while (this.callbackList.length)
166
- this.callbackList.pop();
167
- }
121
+ class PropList extends LinkedList {
122
+ }
123
+ class PropData {
124
+ get data() {
125
+ return {
126
+ getInjected: this.getInjected,
127
+ index: this.index,
128
+ record: this.record,
129
+ };
130
+ }
131
+ }
132
+ class Prop {
133
+ constructor(type, name, displayName, permission, visible = _ => true, isExtra = false) {
134
+ this.type = type;
135
+ this.name = name;
136
+ this.displayName = displayName;
137
+ this.permission = permission;
138
+ this.visible = visible;
139
+ this.isExtra = isExtra;
140
+ this.displayName = this.displayName || this.name;
141
+ }
142
+ }
143
+ class PropsFactory {
144
+ constructor() {
145
+ this.contributorCallbacks = {};
146
+ }
147
+ get(name) {
148
+ this.contributorCallbacks[name] = this.contributorCallbacks[name] || [];
149
+ return new this._ctor(this.contributorCallbacks[name]);
150
+ }
151
+ }
152
+ class Props {
153
+ constructor(callbackList) {
154
+ this.callbackList = callbackList;
155
+ }
156
+ get props() {
157
+ const propList = new this._ctor();
158
+ this.callbackList.forEach(callback => callback(propList));
159
+ return propList;
160
+ }
161
+ addContributor(contributeCallback) {
162
+ this.callbackList.push(contributeCallback);
163
+ }
164
+ clearContributors() {
165
+ while (this.callbackList.length)
166
+ this.callbackList.pop();
167
+ }
168
168
  }
169
169
 
170
- class FormPropList extends PropList {
171
- }
172
- class FormProps extends Props {
173
- constructor() {
174
- super(...arguments);
175
- this._ctor = FormPropList;
176
- }
177
- }
178
- class CreateFormPropsFactory extends PropsFactory {
179
- constructor() {
180
- super(...arguments);
181
- this._ctor = FormProps;
182
- }
183
- }
184
- class EditFormPropsFactory extends PropsFactory {
185
- constructor() {
186
- super(...arguments);
187
- this._ctor = FormProps;
188
- }
189
- }
190
- class FormProp extends Prop {
191
- constructor(options) {
192
- super(options.type, options.name, options.displayName, options.permission, options.visible, options.isExtra);
193
- this.asyncValidators = options.asyncValidators || (_ => []);
194
- this.validators = options.validators || (_ => []);
195
- this.disabled = options.disabled || (_ => false);
196
- this.readonly = options.readonly || (_ => false);
197
- this.autocomplete = options.autocomplete || 'off';
198
- this.options = options.options;
199
- this.id = options.id || options.name;
200
- const defaultValue = options.defaultValue;
201
- this.defaultValue = isFalsyValue(defaultValue) ? defaultValue : defaultValue || null;
202
- }
203
- static create(options) {
204
- return new FormProp(options);
205
- }
206
- static createMany(arrayOfOptions) {
207
- return arrayOfOptions.map(FormProp.create);
208
- }
209
- }
210
- class FormPropData extends PropData {
211
- constructor(injector, record) {
212
- super();
213
- this.record = record;
214
- this.getInjected = injector.get.bind(injector);
215
- }
216
- }
217
- function isFalsyValue(defaultValue) {
218
- return [0, '', false].indexOf(defaultValue) > -1;
170
+ class FormPropList extends PropList {
171
+ }
172
+ class FormProps extends Props {
173
+ constructor() {
174
+ super(...arguments);
175
+ this._ctor = FormPropList;
176
+ }
177
+ }
178
+ class CreateFormPropsFactory extends PropsFactory {
179
+ constructor() {
180
+ super(...arguments);
181
+ this._ctor = FormProps;
182
+ }
183
+ }
184
+ class EditFormPropsFactory extends PropsFactory {
185
+ constructor() {
186
+ super(...arguments);
187
+ this._ctor = FormProps;
188
+ }
189
+ }
190
+ class FormProp extends Prop {
191
+ constructor(options) {
192
+ super(options.type, options.name, options.displayName, options.permission, options.visible, options.isExtra);
193
+ this.asyncValidators = options.asyncValidators || (_ => []);
194
+ this.validators = options.validators || (_ => []);
195
+ this.disabled = options.disabled || (_ => false);
196
+ this.readonly = options.readonly || (_ => false);
197
+ this.autocomplete = options.autocomplete || 'off';
198
+ this.options = options.options;
199
+ this.id = options.id || options.name;
200
+ const defaultValue = options.defaultValue;
201
+ this.defaultValue = isFalsyValue(defaultValue) ? defaultValue : defaultValue || null;
202
+ }
203
+ static create(options) {
204
+ return new FormProp(options);
205
+ }
206
+ static createMany(arrayOfOptions) {
207
+ return arrayOfOptions.map(FormProp.create);
208
+ }
209
+ }
210
+ class FormPropData extends PropData {
211
+ constructor(injector, record) {
212
+ super();
213
+ this.record = record;
214
+ this.getInjected = injector.get.bind(injector);
215
+ }
216
+ }
217
+ function isFalsyValue(defaultValue) {
218
+ return [0, '', false].indexOf(defaultValue) > -1;
219
219
  }
220
220
 
221
- function selfFactory(dependency) {
222
- return dependency;
221
+ function selfFactory(dependency) {
222
+ return dependency;
223
223
  }
224
224
 
225
- class DateTimePickerComponent {
226
- constructor(cdRef) {
227
- this.cdRef = cdRef;
228
- this.meridian = false;
229
- }
230
- setDate(datestr) {
231
- this.date.writeValue(datestr);
232
- }
233
- setTime(datestr) {
234
- this.time.writeValue(datestr);
235
- }
236
- }
237
- DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
225
+ class DateTimePickerComponent {
226
+ constructor(cdRef) {
227
+ this.cdRef = cdRef;
228
+ this.meridian = false;
229
+ }
230
+ setDate(datestr) {
231
+ this.date.writeValue(datestr);
232
+ }
233
+ setTime(datestr) {
234
+ this.time.writeValue(datestr);
235
+ }
236
+ }
237
+ DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
238
238
  DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: DateTimePickerComponent, selector: "abp-date-time-picker", inputs: { prop: "prop", meridian: "meridian" }, viewQueries: [{ propertyName: "date", first: true, predicate: NgbInputDatepicker, descendants: true }, { propertyName: "time", first: true, predicate: NgbTimepicker, descendants: true }], exportAs: ["abpDateTimePicker"], ngImport: i0, template: `
239
239
  <input
240
240
  [id]="prop.id"
@@ -253,26 +253,26 @@ DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
253
253
  (ngModelChange)="setDate($event)"
254
254
  [meridian]="meridian"
255
255
  ></ngb-timepicker>
256
- `, isInline: true, components: [{ type: i2.NgbTimepicker, selector: "ngb-timepicker", inputs: ["meridian", "spinners", "seconds", "hourStep", "minuteStep", "secondStep", "readonlyInputs", "size"] }], directives: [{ type: i2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["disabled", "autoClose", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6.ValidationDirective, selector: "[formControl],[formControlName]", inputs: ["blueprints", "errorTemplate", "invalidClasses", "mapErrorsFn", "skipValidation", "targetSelector", "validateOnSubmit"] }], viewProviders: [
257
- {
258
- provide: ControlContainer,
259
- useFactory: selfFactory,
260
- deps: [[new Optional(), new SkipSelf(), ControlContainer]],
261
- },
262
- {
263
- provide: NgbDateAdapter,
264
- useClass: DateTimeAdapter,
265
- },
266
- {
267
- provide: NgbTimeAdapter,
268
- useClass: DateTimeAdapter,
269
- },
270
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
271
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateTimePickerComponent, decorators: [{
272
- type: Component,
273
- args: [{
274
- exportAs: 'abpDateTimePicker',
275
- selector: 'abp-date-time-picker',
256
+ `, isInline: true, components: [{ type: i2.NgbTimepicker, selector: "ngb-timepicker", inputs: ["meridian", "spinners", "seconds", "hourStep", "minuteStep", "secondStep", "readonlyInputs", "size"] }], directives: [{ type: i2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["disabled", "autoClose", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }], viewProviders: [
257
+ {
258
+ provide: ControlContainer,
259
+ useFactory: selfFactory,
260
+ deps: [[new Optional(), new SkipSelf(), ControlContainer]],
261
+ },
262
+ {
263
+ provide: NgbDateAdapter,
264
+ useClass: DateTimeAdapter,
265
+ },
266
+ {
267
+ provide: NgbTimeAdapter,
268
+ useClass: DateTimeAdapter,
269
+ },
270
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
271
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DateTimePickerComponent, decorators: [{
272
+ type: Component,
273
+ args: [{
274
+ exportAs: 'abpDateTimePicker',
275
+ selector: 'abp-date-time-picker',
276
276
  template: `
277
277
  <input
278
278
  [id]="prop.id"
@@ -291,1059 +291,1060 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
291
291
  (ngModelChange)="setDate($event)"
292
292
  [meridian]="meridian"
293
293
  ></ngb-timepicker>
294
- `,
295
- changeDetection: ChangeDetectionStrategy.OnPush,
296
- viewProviders: [
297
- {
298
- provide: ControlContainer,
299
- useFactory: selfFactory,
300
- deps: [[new Optional(), new SkipSelf(), ControlContainer]],
301
- },
302
- {
303
- provide: NgbDateAdapter,
304
- useClass: DateTimeAdapter,
305
- },
306
- {
307
- provide: NgbTimeAdapter,
308
- useClass: DateTimeAdapter,
309
- },
310
- ],
311
- }]
312
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { prop: [{
313
- type: Input
314
- }], meridian: [{
315
- type: Input
316
- }], date: [{
317
- type: ViewChild,
318
- args: [NgbInputDatepicker]
319
- }], time: [{
320
- type: ViewChild,
321
- args: [NgbTimepicker]
294
+ `,
295
+ changeDetection: ChangeDetectionStrategy.OnPush,
296
+ viewProviders: [
297
+ {
298
+ provide: ControlContainer,
299
+ useFactory: selfFactory,
300
+ deps: [[new Optional(), new SkipSelf(), ControlContainer]],
301
+ },
302
+ {
303
+ provide: NgbDateAdapter,
304
+ useClass: DateTimeAdapter,
305
+ },
306
+ {
307
+ provide: NgbTimeAdapter,
308
+ useClass: DateTimeAdapter,
309
+ },
310
+ ],
311
+ }]
312
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { prop: [{
313
+ type: Input
314
+ }], meridian: [{
315
+ type: Input
316
+ }], date: [{
317
+ type: ViewChild,
318
+ args: [NgbInputDatepicker]
319
+ }], time: [{
320
+ type: ViewChild,
321
+ args: [NgbTimepicker]
322
322
  }] } });
323
323
 
324
324
  const EXTRA_PROPERTIES_KEY = 'extraProperties';
325
325
 
326
- const TYPEAHEAD_TEXT_SUFFIX = '_Text';
327
- const TYPEAHEAD_TEXT_SUFFIX_REGEX = /_Text$/;
328
- function createTypeaheadOptions(lookup) {
329
- return (data, searchText) => searchText && data
330
- ? data
331
- .getInjected(RestService)
332
- .request({
333
- method: 'GET',
334
- url: lookup.url || '',
335
- params: {
336
- [lookup.filterParamName || '']: searchText,
337
- },
338
- }, { apiName: 'Default' })
339
- .pipe(map((response) => {
340
- const list = response[lookup.resultListPropertyName || ''];
341
- const mapToOption = (item) => ({
342
- key: item[lookup.displayPropertyName || ''],
343
- value: item[lookup.valuePropertyName || ''],
344
- });
345
- return list.map(mapToOption);
346
- }))
347
- : of([]);
348
- }
349
- function getTypeaheadType(lookup, name) {
350
- return Boolean(lookup.url)
351
- ? "typeahead" /* Typeahead */
352
- : name.endsWith(TYPEAHEAD_TEXT_SUFFIX)
353
- ? "hidden" /* Hidden */
354
- : undefined;
355
- }
356
- function createTypeaheadDisplayNameGenerator(displayNameGeneratorFn, properties) {
357
- return (displayName, fallback) => {
358
- const name = removeTypeaheadTextSuffix(fallback.name || '');
359
- return displayNameGeneratorFn(displayName || properties[name].displayName, {
360
- name,
361
- resource: fallback.resource,
362
- });
363
- };
364
- }
365
- function addTypeaheadTextSuffix(name) {
366
- return name + TYPEAHEAD_TEXT_SUFFIX;
367
- }
368
- function hasTypeaheadTextSuffix(name) {
369
- return TYPEAHEAD_TEXT_SUFFIX_REGEX.test(name);
370
- }
371
- function removeTypeaheadTextSuffix(name) {
372
- return name.replace(TYPEAHEAD_TEXT_SUFFIX_REGEX, '');
326
+ const TYPEAHEAD_TEXT_SUFFIX = '_Text';
327
+ const TYPEAHEAD_TEXT_SUFFIX_REGEX = /_Text$/;
328
+ function createTypeaheadOptions(lookup) {
329
+ return (data, searchText) => searchText && data
330
+ ? data
331
+ .getInjected(RestService)
332
+ .request({
333
+ method: 'GET',
334
+ url: lookup.url || '',
335
+ params: {
336
+ [lookup.filterParamName || '']: searchText,
337
+ },
338
+ }, { apiName: 'Default' })
339
+ .pipe(map((response) => {
340
+ const list = response[lookup.resultListPropertyName || ''];
341
+ const mapToOption = (item) => ({
342
+ key: item[lookup.displayPropertyName || ''],
343
+ value: item[lookup.valuePropertyName || ''],
344
+ });
345
+ return list.map(mapToOption);
346
+ }))
347
+ : of([]);
348
+ }
349
+ function getTypeaheadType(lookup, name) {
350
+ return Boolean(lookup.url)
351
+ ? "typeahead" /* Typeahead */
352
+ : name.endsWith(TYPEAHEAD_TEXT_SUFFIX)
353
+ ? "hidden" /* Hidden */
354
+ : undefined;
355
+ }
356
+ function createTypeaheadDisplayNameGenerator(displayNameGeneratorFn, properties) {
357
+ return (displayName, fallback) => {
358
+ const name = removeTypeaheadTextSuffix(fallback.name || '');
359
+ return displayNameGeneratorFn(displayName || properties[name].displayName, {
360
+ name,
361
+ resource: fallback.resource,
362
+ });
363
+ };
364
+ }
365
+ function addTypeaheadTextSuffix(name) {
366
+ return name + TYPEAHEAD_TEXT_SUFFIX;
367
+ }
368
+ function hasTypeaheadTextSuffix(name) {
369
+ return TYPEAHEAD_TEXT_SUFFIX_REGEX.test(name);
370
+ }
371
+ function removeTypeaheadTextSuffix(name) {
372
+ return name.replace(TYPEAHEAD_TEXT_SUFFIX_REGEX, '');
373
373
  }
374
374
 
375
- class DisabledDirective {
376
- constructor(ngControl) {
377
- this.ngControl = ngControl;
378
- this.abpDisabled = false;
379
- }
380
- // Related issue: https://github.com/angular/angular/issues/35330
381
- ngOnChanges({ abpDisabled }) {
382
- if (this.ngControl.control && abpDisabled) {
383
- this.ngControl.control[abpDisabled.currentValue ? 'disable' : 'enable']();
384
- }
385
- }
386
- }
387
- DisabledDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DisabledDirective, deps: [{ token: i2$1.NgControl, host: true }], target: i0.ɵɵFactoryTarget.Directive });
388
- DisabledDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: DisabledDirective, selector: "[abpDisabled]", inputs: { abpDisabled: "abpDisabled" }, usesOnChanges: true, ngImport: i0 });
389
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DisabledDirective, decorators: [{
390
- type: Directive,
391
- args: [{
392
- selector: '[abpDisabled]',
393
- }]
394
- }], ctorParameters: function () { return [{ type: i2$1.NgControl, decorators: [{
395
- type: Host
396
- }] }]; }, propDecorators: { abpDisabled: [{
397
- type: Input
375
+ class DisabledDirective {
376
+ constructor(ngControl) {
377
+ this.ngControl = ngControl;
378
+ this.abpDisabled = false;
379
+ }
380
+ // Related issue: https://github.com/angular/angular/issues/35330
381
+ ngOnChanges({ abpDisabled }) {
382
+ if (this.ngControl.control && abpDisabled) {
383
+ this.ngControl.control[abpDisabled.currentValue ? 'disable' : 'enable']();
384
+ }
385
+ }
386
+ }
387
+ DisabledDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DisabledDirective, deps: [{ token: i2$1.NgControl, host: true }], target: i0.ɵɵFactoryTarget.Directive });
388
+ DisabledDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: DisabledDirective, selector: "[abpDisabled]", inputs: { abpDisabled: "abpDisabled" }, usesOnChanges: true, ngImport: i0 });
389
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DisabledDirective, decorators: [{
390
+ type: Directive,
391
+ args: [{
392
+ selector: '[abpDisabled]',
393
+ }]
394
+ }], ctorParameters: function () { return [{ type: i2$1.NgControl, decorators: [{
395
+ type: Host
396
+ }] }]; }, propDecorators: { abpDisabled: [{
397
+ type: Input
398
398
  }] } });
399
399
 
400
- class ExtensibleFormPropComponent {
401
- constructor(cdRef, track, configState, groupDirective) {
402
- this.cdRef = cdRef;
403
- this.track = track;
404
- this.configState = configState;
405
- this.asterisk = '';
406
- this.options$ = of([]);
407
- this.validators = [];
408
- this.search = (text$) => text$
409
- ? text$.pipe(debounceTime(300), distinctUntilChanged(), switchMap(text => this.prop.options(this.data, text)))
410
- : of([]);
411
- this.typeaheadFormatter = (option) => option.key;
412
- this.form = groupDirective.form;
413
- }
414
- setTypeaheadValue(selectedOption) {
415
- this.typeaheadModel = selectedOption || { key: null, value: null };
416
- const { key, value } = this.typeaheadModel;
417
- const [keyControl, valueControl] = this.getTypeaheadControls();
418
- if ((valueControl === null || valueControl === void 0 ? void 0 : valueControl.value) && !value)
419
- valueControl.markAsDirty();
420
- keyControl === null || keyControl === void 0 ? void 0 : keyControl.setValue(key);
421
- valueControl === null || valueControl === void 0 ? void 0 : valueControl.setValue(value);
422
- }
423
- get meridian() {
424
- return (this.configState.getDeep('localization.currentCulture.dateTimeFormat.shortTimePattern') || '').includes('tt');
425
- }
426
- get isInvalid() {
427
- const control = this.form.get(this.prop.name);
428
- return control.touched && control.invalid;
429
- }
430
- getTypeaheadControls() {
431
- const { name } = this.prop;
432
- const extraPropName = `${EXTRA_PROPERTIES_KEY}.${name}`;
433
- const keyControl = this.form.get(addTypeaheadTextSuffix(extraPropName)) ||
434
- this.form.get(addTypeaheadTextSuffix(name));
435
- const valueControl = this.form.get(extraPropName) || this.form.get(name);
436
- return [keyControl, valueControl];
437
- }
438
- setAsterisk() {
439
- this.asterisk = this.validators.some(isRequired) ? '*' : '';
440
- }
441
- ngAfterViewInit() {
442
- if (this.first && this.fieldRef) {
443
- this.fieldRef.nativeElement.focus();
444
- }
445
- }
446
- getComponent(prop) {
447
- switch (prop.type) {
448
- case "boolean" /* Boolean */:
449
- return 'checkbox';
450
- case "date" /* Date */:
451
- return 'date';
452
- case "dateTime" /* DateTime */:
453
- return 'dateTime';
454
- case "hidden" /* Hidden */:
455
- return 'hidden';
456
- case "multiselect" /* MultiSelect */:
457
- return 'multiselect';
458
- case "text" /* Text */:
459
- return 'textarea';
460
- case "time" /* Time */:
461
- return 'time';
462
- case "typeahead" /* Typeahead */:
463
- return 'typeahead';
464
- default:
465
- return prop.options ? 'select' : 'input';
466
- }
467
- }
468
- getType(prop) {
469
- switch (prop.type) {
470
- case "date" /* Date */:
471
- case "string" /* String */:
472
- return 'text';
473
- case "boolean" /* Boolean */:
474
- return 'checkbox';
475
- case "number" /* Number */:
476
- return 'number';
477
- case "email" /* Email */:
478
- return 'email';
479
- case "password" /* Password */:
480
- return 'password';
481
- default:
482
- return 'hidden';
483
- }
484
- }
485
- ngOnChanges({ prop }) {
486
- const currentProp = prop === null || prop === void 0 ? void 0 : prop.currentValue;
487
- const { options, readonly, disabled, validators } = currentProp || {};
488
- if (options)
489
- this.options$ = options(this.data);
490
- if (readonly)
491
- this.readonly = readonly(this.data);
492
- if (disabled)
493
- this.disabled = disabled(this.data);
494
- if (validators) {
495
- this.validators = validators(this.data);
496
- this.setAsterisk();
497
- }
498
- const [keyControl, valueControl] = this.getTypeaheadControls();
499
- if (keyControl && valueControl)
500
- this.typeaheadModel = { key: keyControl.value, value: valueControl.value };
501
- }
502
- }
503
- ExtensibleFormPropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensibleFormPropComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.TrackByService }, { token: i1.ConfigStateService }, { token: i2$1.FormGroupDirective }], target: i0.ɵɵFactoryTarget.Component });
504
- ExtensibleFormPropComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ExtensibleFormPropComponent, selector: "abp-extensible-form-prop", inputs: { data: "data", prop: "prop", first: "first" }, viewQueries: [{ propertyName: "fieldRef", first: true, predicate: ["field"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"mb-3 form-group\" *abpPermission=\"prop.permission\" [ngSwitch]=\"getComponent(prop)\">\n <ng-template ngSwitchCase=\"input\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <input\n #field\n [id]=\"prop.id\"\n [formControlName]=\"prop.name\"\n [autocomplete]=\"prop.autocomplete\"\n [type]=\"getType(prop)\"\n [abpDisabled]=\"disabled\"\n [readonly]=\"readonly\"\n class=\"form-control\"\n />\n </ng-template>\n\n <ng-template ngSwitchCase=\"hidden\">\n <input [formControlName]=\"prop.name\" type=\"hidden\" />\n </ng-template>\n\n <ng-template ngSwitchCase=\"checkbox\">\n <div class=\"form-check\" validationTarget>\n <input\n #field\n [id]=\"prop.id\"\n [formControlName]=\"prop.name\"\n [abpDisabled]=\"disabled\"\n type=\"checkbox\"\n class=\"form-check-input\"\n />\n <ng-template\n [ngTemplateOutlet]=\"label\"\n [ngTemplateOutletContext]=\"{ $implicit: 'form-check-label' }\"\n ></ng-template>\n </div>\n </ng-template>\n\n <ng-template ngSwitchCase=\"select\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <select\n #field\n [id]=\"prop.id\"\n [formControlName]=\"prop.name\"\n [abpDisabled]=\"disabled\"\n class=\"form-select form-control\"\n >\n <option\n *ngFor=\"let option of options$ | async; trackBy: track.by('value')\"\n [ngValue]=\"option.value\"\n >\n {{ option.key }}\n </option>\n </select>\n </ng-template>\n\n <ng-template ngSwitchCase=\"multiselect\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <select\n #field\n [id]=\"prop.id\"\n [formControlName]=\"prop.name\"\n [abpDisabled]=\"disabled\"\n multiple=\"multiple\"\n class=\"form-select form-control\"\n >\n <option\n *ngFor=\"let option of options$ | async; trackBy: track.by('value')\"\n [ngValue]=\"option.value\"\n >\n {{ option.key }}\n </option>\n </select>\n </ng-template>\n\n <ng-template ngSwitchCase=\"typeahead\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <div #typeahead class=\"position-relative\" validationStyle validationTarget>\n <input\n #field\n [id]=\"prop.id\"\n [autocomplete]=\"prop.autocomplete\"\n [abpDisabled]=\"disabled\"\n [ngbTypeahead]=\"search\"\n [editable]=\"false\"\n [inputFormatter]=\"typeaheadFormatter\"\n [resultFormatter]=\"typeaheadFormatter\"\n [ngModelOptions]=\"{ standalone: true }\"\n [(ngModel)]=\"typeaheadModel\"\n (selectItem)=\"setTypeaheadValue($event.item)\"\n (blur)=\"setTypeaheadValue(typeaheadModel)\"\n [class.is-invalid]=\"typeahead.classList.contains('is-invalid')\"\n class=\"form-control\"\n />\n <input [formControlName]=\"prop.name\" type=\"hidden\" />\n </div>\n </ng-template>\n\n <ng-template ngSwitchCase=\"date\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <input\n [id]=\"prop.id\"\n [formControlName]=\"prop.name\"\n (click)=\"datepicker.open()\"\n (keyup.space)=\"datepicker.open()\"\n ngbDatepicker\n #datepicker=\"ngbDatepicker\"\n type=\"text\"\n class=\"form-control\"\n />\n </ng-template>\n\n <ng-template ngSwitchCase=\"time\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <ngb-timepicker [formControlName]=\"prop.name\"></ngb-timepicker>\n </ng-template>\n\n <ng-template ngSwitchCase=\"dateTime\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <abp-date-time-picker [prop]=\"prop\" [meridian]=\"meridian\"></abp-date-time-picker>\n </ng-template>\n\n <ng-template ngSwitchCase=\"textarea\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <textarea\n #field\n [id]=\"prop.id\"\n [formControlName]=\"prop.name\"\n [abpDisabled]=\"disabled\"\n [readonly]=\"readonly\"\n class=\"form-control\"\n ></textarea>\n </ng-template>\n</div>\n\n<ng-template #label let-classes>\n <label [htmlFor]=\"prop.id\" [ngClass]=\"classes || 'form-label'\"\n >{{ prop.displayName | abpLocalization }} {{ asterisk }}</label\n >\n</ng-template>\n", components: [{ type: i2.NgbTimepicker, selector: "ngb-timepicker", inputs: ["meridian", "spinners", "seconds", "hourStep", "minuteStep", "secondStep", "readonlyInputs", "size"] }, { type: DateTimePickerComponent, selector: "abp-date-time-picker", inputs: ["prop", "meridian"], exportAs: ["abpDateTimePicker"] }], directives: [{ type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission"] }, { type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6.ValidationDirective, selector: "[formControl],[formControlName]", inputs: ["blueprints", "errorTemplate", "invalidClasses", "mapErrorsFn", "skipValidation", "targetSelector", "validateOnSubmit"] }, { type: DisabledDirective, selector: "[abpDisabled]", inputs: ["abpDisabled"] }, { type: i6.ValidationTargetDirective, selector: "[validationTarget]" }, { type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i2$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2$1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { type: i6.ValidationStyleDirective, selector: "[validationStyle]" }, { type: i2.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate", "popupClass"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["disabled", "autoClose", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "async": i5.AsyncPipe, "abpLocalization": i1.LocalizationPipe }, viewProviders: [
505
- {
506
- provide: ControlContainer,
507
- useFactory: selfFactory,
508
- deps: [[new Optional(), new SkipSelf(), ControlContainer]],
509
- },
510
- { provide: NgbDateAdapter, useClass: DateAdapter },
511
- { provide: NgbTimeAdapter, useClass: TimeAdapter },
512
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
513
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensibleFormPropComponent, decorators: [{
514
- type: Component,
515
- args: [{
516
- selector: 'abp-extensible-form-prop',
517
- templateUrl: './extensible-form-prop.component.html',
518
- changeDetection: ChangeDetectionStrategy.OnPush,
519
- viewProviders: [
520
- {
521
- provide: ControlContainer,
522
- useFactory: selfFactory,
523
- deps: [[new Optional(), new SkipSelf(), ControlContainer]],
524
- },
525
- { provide: NgbDateAdapter, useClass: DateAdapter },
526
- { provide: NgbTimeAdapter, useClass: TimeAdapter },
527
- ],
528
- }]
529
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.TrackByService }, { type: i1.ConfigStateService }, { type: i2$1.FormGroupDirective }]; }, propDecorators: { data: [{
530
- type: Input
531
- }], prop: [{
532
- type: Input
533
- }], first: [{
534
- type: Input
535
- }], fieldRef: [{
536
- type: ViewChild,
537
- args: ['field']
538
- }] } });
539
- function isRequired(validator) {
540
- return validator === Validators.required || validator === AbpValidators.required;
400
+ class ExtensibleFormPropComponent {
401
+ constructor(cdRef, track, configState, groupDirective) {
402
+ this.cdRef = cdRef;
403
+ this.track = track;
404
+ this.configState = configState;
405
+ this.asterisk = '';
406
+ this.options$ = of([]);
407
+ this.validators = [];
408
+ this.search = (text$) => text$
409
+ ? text$.pipe(debounceTime(300), distinctUntilChanged(), switchMap(text => this.prop.options(this.data, text)))
410
+ : of([]);
411
+ this.typeaheadFormatter = (option) => option.key;
412
+ this.form = groupDirective.form;
413
+ }
414
+ setTypeaheadValue(selectedOption) {
415
+ this.typeaheadModel = selectedOption || { key: null, value: null };
416
+ const { key, value } = this.typeaheadModel;
417
+ const [keyControl, valueControl] = this.getTypeaheadControls();
418
+ if ((valueControl === null || valueControl === void 0 ? void 0 : valueControl.value) && !value)
419
+ valueControl.markAsDirty();
420
+ keyControl === null || keyControl === void 0 ? void 0 : keyControl.setValue(key);
421
+ valueControl === null || valueControl === void 0 ? void 0 : valueControl.setValue(value);
422
+ }
423
+ get meridian() {
424
+ return (this.configState.getDeep('localization.currentCulture.dateTimeFormat.shortTimePattern') || '').includes('tt');
425
+ }
426
+ get isInvalid() {
427
+ const control = this.form.get(this.prop.name);
428
+ return control.touched && control.invalid;
429
+ }
430
+ getTypeaheadControls() {
431
+ const { name } = this.prop;
432
+ const extraPropName = `${EXTRA_PROPERTIES_KEY}.${name}`;
433
+ const keyControl = this.form.get(addTypeaheadTextSuffix(extraPropName)) ||
434
+ this.form.get(addTypeaheadTextSuffix(name));
435
+ const valueControl = this.form.get(extraPropName) || this.form.get(name);
436
+ return [keyControl, valueControl];
437
+ }
438
+ setAsterisk() {
439
+ this.asterisk = this.validators.some(isRequired) ? '*' : '';
440
+ }
441
+ ngAfterViewInit() {
442
+ if (this.first && this.fieldRef) {
443
+ this.fieldRef.nativeElement.focus();
444
+ }
445
+ }
446
+ getComponent(prop) {
447
+ switch (prop.type) {
448
+ case "boolean" /* Boolean */:
449
+ return 'checkbox';
450
+ case "date" /* Date */:
451
+ return 'date';
452
+ case "dateTime" /* DateTime */:
453
+ return 'dateTime';
454
+ case "hidden" /* Hidden */:
455
+ return 'hidden';
456
+ case "multiselect" /* MultiSelect */:
457
+ return 'multiselect';
458
+ case "text" /* Text */:
459
+ return 'textarea';
460
+ case "time" /* Time */:
461
+ return 'time';
462
+ case "typeahead" /* Typeahead */:
463
+ return 'typeahead';
464
+ default:
465
+ return prop.options ? 'select' : 'input';
466
+ }
467
+ }
468
+ getType(prop) {
469
+ switch (prop.type) {
470
+ case "date" /* Date */:
471
+ case "string" /* String */:
472
+ return 'text';
473
+ case "boolean" /* Boolean */:
474
+ return 'checkbox';
475
+ case "number" /* Number */:
476
+ return 'number';
477
+ case "email" /* Email */:
478
+ return 'email';
479
+ case "password" /* Password */:
480
+ return 'password';
481
+ default:
482
+ return 'hidden';
483
+ }
484
+ }
485
+ ngOnChanges({ prop }) {
486
+ const currentProp = prop === null || prop === void 0 ? void 0 : prop.currentValue;
487
+ const { options, readonly, disabled, validators } = currentProp || {};
488
+ if (options)
489
+ this.options$ = options(this.data);
490
+ if (readonly)
491
+ this.readonly = readonly(this.data);
492
+ if (disabled)
493
+ this.disabled = disabled(this.data);
494
+ if (validators) {
495
+ this.validators = validators(this.data);
496
+ this.setAsterisk();
497
+ }
498
+ const [keyControl, valueControl] = this.getTypeaheadControls();
499
+ if (keyControl && valueControl)
500
+ this.typeaheadModel = { key: keyControl.value, value: valueControl.value };
501
+ }
502
+ }
503
+ ExtensibleFormPropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensibleFormPropComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.TrackByService }, { token: i1.ConfigStateService }, { token: i2$1.FormGroupDirective }], target: i0.ɵɵFactoryTarget.Component });
504
+ ExtensibleFormPropComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ExtensibleFormPropComponent, selector: "abp-extensible-form-prop", inputs: { data: "data", prop: "prop", first: "first" }, viewQueries: [{ propertyName: "fieldRef", first: true, predicate: ["field"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"mb-3 form-group\" *abpPermission=\"prop.permission\" [ngSwitch]=\"getComponent(prop)\">\n <ng-template ngSwitchCase=\"input\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <input\n #field\n [id]=\"prop.id\"\n [formControlName]=\"prop.name\"\n [autocomplete]=\"prop.autocomplete\"\n [type]=\"getType(prop)\"\n [abpDisabled]=\"disabled\"\n [readonly]=\"readonly\"\n class=\"form-control\"\n />\n </ng-template>\n\n <ng-template ngSwitchCase=\"hidden\">\n <input [formControlName]=\"prop.name\" type=\"hidden\" />\n </ng-template>\n\n <ng-template ngSwitchCase=\"checkbox\">\n <div class=\"form-check\" validationTarget>\n <input\n #field\n [id]=\"prop.id\"\n [formControlName]=\"prop.name\"\n [abpDisabled]=\"disabled\"\n type=\"checkbox\"\n class=\"form-check-input\"\n />\n <ng-template\n [ngTemplateOutlet]=\"label\"\n [ngTemplateOutletContext]=\"{ $implicit: 'form-check-label' }\"\n ></ng-template>\n </div>\n </ng-template>\n\n <ng-template ngSwitchCase=\"select\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <select\n #field\n [id]=\"prop.id\"\n [formControlName]=\"prop.name\"\n [abpDisabled]=\"disabled\"\n class=\"form-select form-control\"\n >\n <option\n *ngFor=\"let option of options$ | async; trackBy: track.by('value')\"\n [ngValue]=\"option.value\"\n >\n {{ option.key }}\n </option>\n </select>\n </ng-template>\n\n <ng-template ngSwitchCase=\"multiselect\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <select\n #field\n [id]=\"prop.id\"\n [formControlName]=\"prop.name\"\n [abpDisabled]=\"disabled\"\n multiple=\"multiple\"\n class=\"form-select form-control\"\n >\n <option\n *ngFor=\"let option of options$ | async; trackBy: track.by('value')\"\n [ngValue]=\"option.value\"\n >\n {{ option.key }}\n </option>\n </select>\n </ng-template>\n\n <ng-template ngSwitchCase=\"typeahead\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <div #typeahead class=\"position-relative\" validationStyle validationTarget>\n <input\n #field\n [id]=\"prop.id\"\n [autocomplete]=\"prop.autocomplete\"\n [abpDisabled]=\"disabled\"\n [ngbTypeahead]=\"search\"\n [editable]=\"false\"\n [inputFormatter]=\"typeaheadFormatter\"\n [resultFormatter]=\"typeaheadFormatter\"\n [ngModelOptions]=\"{ standalone: true }\"\n [(ngModel)]=\"typeaheadModel\"\n (selectItem)=\"setTypeaheadValue($event.item)\"\n (blur)=\"setTypeaheadValue(typeaheadModel)\"\n [class.is-invalid]=\"typeahead.classList.contains('is-invalid')\"\n class=\"form-control\"\n />\n <input [formControlName]=\"prop.name\" type=\"hidden\" />\n </div>\n </ng-template>\n\n <ng-template ngSwitchCase=\"date\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <input\n [id]=\"prop.id\"\n [formControlName]=\"prop.name\"\n (click)=\"datepicker.open()\"\n (keyup.space)=\"datepicker.open()\"\n ngbDatepicker\n #datepicker=\"ngbDatepicker\"\n type=\"text\"\n class=\"form-control\"\n />\n </ng-template>\n\n <ng-template ngSwitchCase=\"time\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <ngb-timepicker [formControlName]=\"prop.name\"></ngb-timepicker>\n </ng-template>\n\n <ng-template ngSwitchCase=\"dateTime\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <abp-date-time-picker [prop]=\"prop\" [meridian]=\"meridian\"></abp-date-time-picker>\n </ng-template>\n\n <ng-template ngSwitchCase=\"textarea\">\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\n <textarea\n #field\n [id]=\"prop.id\"\n [formControlName]=\"prop.name\"\n [abpDisabled]=\"disabled\"\n [readonly]=\"readonly\"\n class=\"form-control\"\n ></textarea>\n </ng-template>\n</div>\n\n<ng-template #label let-classes>\n <label [htmlFor]=\"prop.id\" [ngClass]=\"classes || 'form-label'\"\n >{{ prop.displayName | abpLocalization }} {{ asterisk }}</label\n >\n</ng-template>\n", components: [{ type: i2.NgbTimepicker, selector: "ngb-timepicker", inputs: ["meridian", "spinners", "seconds", "hourStep", "minuteStep", "secondStep", "readonlyInputs", "size"] }, { type: DateTimePickerComponent, selector: "abp-date-time-picker", inputs: ["prop", "meridian"], exportAs: ["abpDateTimePicker"] }], directives: [{ type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission"] }, { type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { type: DisabledDirective, selector: "[abpDisabled]", inputs: ["abpDisabled"] }, { type: i6.ValidationTargetDirective, selector: "[validationTarget]", exportAs: ["validationTarget"] }, { type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i2$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2$1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { type: i6.ValidationStyleDirective, selector: "[validationStyle]", exportAs: ["validationStyle"] }, { type: i2.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate", "popupClass"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["disabled", "autoClose", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "async": i5.AsyncPipe, "abpLocalization": i1.LocalizationPipe }, viewProviders: [
505
+ {
506
+ provide: ControlContainer,
507
+ useFactory: selfFactory,
508
+ deps: [[new Optional(), new SkipSelf(), ControlContainer]],
509
+ },
510
+ { provide: NgbDateAdapter, useClass: DateAdapter },
511
+ { provide: NgbTimeAdapter, useClass: TimeAdapter },
512
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
513
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensibleFormPropComponent, decorators: [{
514
+ type: Component,
515
+ args: [{
516
+ selector: 'abp-extensible-form-prop',
517
+ templateUrl: './extensible-form-prop.component.html',
518
+ changeDetection: ChangeDetectionStrategy.OnPush,
519
+ viewProviders: [
520
+ {
521
+ provide: ControlContainer,
522
+ useFactory: selfFactory,
523
+ deps: [[new Optional(), new SkipSelf(), ControlContainer]],
524
+ },
525
+ { provide: NgbDateAdapter, useClass: DateAdapter },
526
+ { provide: NgbTimeAdapter, useClass: TimeAdapter },
527
+ ],
528
+ }]
529
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.TrackByService }, { type: i1.ConfigStateService }, { type: i2$1.FormGroupDirective }]; }, propDecorators: { data: [{
530
+ type: Input
531
+ }], prop: [{
532
+ type: Input
533
+ }], first: [{
534
+ type: Input
535
+ }], fieldRef: [{
536
+ type: ViewChild,
537
+ args: ['field']
538
+ }] } });
539
+ function isRequired(validator) {
540
+ return validator === Validators.required || validator === AbpValidators.required;
541
541
  }
542
542
 
543
- class ActionList extends LinkedList {
544
- }
545
- class ActionData {
546
- get data() {
547
- return {
548
- getInjected: this.getInjected,
549
- index: this.index,
550
- record: this.record,
551
- };
552
- }
553
- }
554
- class Action {
555
- constructor(permission, visible = _ => true, action = _ => { }) {
556
- this.permission = permission;
557
- this.visible = visible;
558
- this.action = action;
559
- }
560
- }
561
- class ActionsFactory {
562
- constructor() {
563
- this.contributorCallbacks = {};
564
- }
565
- get(name) {
566
- this.contributorCallbacks[name] = this.contributorCallbacks[name] || [];
567
- return new this._ctor(this.contributorCallbacks[name]);
568
- }
569
- }
570
- class Actions {
571
- constructor(callbackList) {
572
- this.callbackList = callbackList;
573
- }
574
- get actions() {
575
- const actionList = new this._ctor();
576
- this.callbackList.forEach(callback => callback(actionList));
577
- return actionList;
578
- }
579
- addContributor(contributeCallback) {
580
- this.callbackList.push(contributeCallback);
581
- }
582
- clearContributors() {
583
- while (this.callbackList.length)
584
- this.callbackList.pop();
585
- }
543
+ class ActionList extends LinkedList {
544
+ }
545
+ class ActionData {
546
+ get data() {
547
+ return {
548
+ getInjected: this.getInjected,
549
+ index: this.index,
550
+ record: this.record,
551
+ };
552
+ }
553
+ }
554
+ class Action {
555
+ constructor(permission, visible = _ => true, action = _ => { }) {
556
+ this.permission = permission;
557
+ this.visible = visible;
558
+ this.action = action;
559
+ }
560
+ }
561
+ class ActionsFactory {
562
+ constructor() {
563
+ this.contributorCallbacks = {};
564
+ }
565
+ get(name) {
566
+ this.contributorCallbacks[name] = this.contributorCallbacks[name] || [];
567
+ return new this._ctor(this.contributorCallbacks[name]);
568
+ }
569
+ }
570
+ class Actions {
571
+ constructor(callbackList) {
572
+ this.callbackList = callbackList;
573
+ }
574
+ get actions() {
575
+ const actionList = new this._ctor();
576
+ this.callbackList.forEach(callback => callback(actionList));
577
+ return actionList;
578
+ }
579
+ addContributor(contributeCallback) {
580
+ this.callbackList.push(contributeCallback);
581
+ }
582
+ clearContributors() {
583
+ while (this.callbackList.length)
584
+ this.callbackList.pop();
585
+ }
586
586
  }
587
587
 
588
- class EntityActionList extends ActionList {
589
- }
590
- class EntityActions extends Actions {
591
- constructor() {
592
- super(...arguments);
593
- this._ctor = EntityActionList;
594
- }
595
- }
596
- class EntityActionsFactory extends ActionsFactory {
597
- constructor() {
598
- super(...arguments);
599
- this._ctor = EntityActions;
600
- }
601
- }
602
- class EntityAction extends Action {
603
- constructor(options) {
604
- super(options.permission, options.visible, options.action);
605
- this.text = options.text;
606
- this.icon = options.icon || '';
607
- }
608
- static create(options) {
609
- return new EntityAction(options);
610
- }
611
- static createMany(arrayOfOptions) {
612
- return arrayOfOptions.map(EntityAction.create);
613
- }
588
+ class EntityActionList extends ActionList {
589
+ }
590
+ class EntityActions extends Actions {
591
+ constructor() {
592
+ super(...arguments);
593
+ this._ctor = EntityActionList;
594
+ }
595
+ }
596
+ class EntityActionsFactory extends ActionsFactory {
597
+ constructor() {
598
+ super(...arguments);
599
+ this._ctor = EntityActions;
600
+ }
601
+ }
602
+ class EntityAction extends Action {
603
+ constructor(options) {
604
+ super(options.permission, options.visible, options.action);
605
+ this.text = options.text;
606
+ this.icon = options.icon || '';
607
+ }
608
+ static create(options) {
609
+ return new EntityAction(options);
610
+ }
611
+ static createMany(arrayOfOptions) {
612
+ return arrayOfOptions.map(EntityAction.create);
613
+ }
614
614
  }
615
615
 
616
- class EntityPropList extends PropList {
617
- }
618
- class EntityProps extends Props {
619
- constructor() {
620
- super(...arguments);
621
- this._ctor = EntityPropList;
622
- }
623
- }
624
- class EntityPropsFactory extends PropsFactory {
625
- constructor() {
626
- super(...arguments);
627
- this._ctor = EntityProps;
628
- }
629
- }
630
- class EntityProp extends Prop {
631
- constructor(options) {
632
- super(options.type, options.name, options.displayName, options.permission, options.visible, options.isExtra);
633
- this.columnWidth = options.columnWidth;
634
- this.sortable = options.sortable || false;
635
- this.valueResolver = options.valueResolver || (data => of(data.record[this.name]));
636
- this.action = options.action;
637
- this.component = options.component;
638
- this.enumList = options.enumList;
639
- }
640
- static create(options) {
641
- return new EntityProp(options);
642
- }
643
- static createMany(arrayOfOptions) {
644
- return arrayOfOptions.map(EntityProp.create);
645
- }
616
+ class EntityPropList extends PropList {
617
+ }
618
+ class EntityProps extends Props {
619
+ constructor() {
620
+ super(...arguments);
621
+ this._ctor = EntityPropList;
622
+ }
623
+ }
624
+ class EntityPropsFactory extends PropsFactory {
625
+ constructor() {
626
+ super(...arguments);
627
+ this._ctor = EntityProps;
628
+ }
629
+ }
630
+ class EntityProp extends Prop {
631
+ constructor(options) {
632
+ super(options.type, options.name, options.displayName, options.permission, options.visible, options.isExtra);
633
+ this.columnWidth = options.columnWidth;
634
+ this.sortable = options.sortable || false;
635
+ this.valueResolver =
636
+ options.valueResolver || (data => of(escapeHtmlChars(data.record[this.name])));
637
+ this.action = options.action;
638
+ this.component = options.component;
639
+ this.enumList = options.enumList;
640
+ }
641
+ static create(options) {
642
+ return new EntityProp(options);
643
+ }
644
+ static createMany(arrayOfOptions) {
645
+ return arrayOfOptions.map(EntityProp.create);
646
+ }
646
647
  }
647
648
 
648
- class ToolbarActionList extends ActionList {
649
- }
650
- class ToolbarActions extends Actions {
651
- constructor() {
652
- super(...arguments);
653
- this._ctor = ToolbarActionList;
654
- }
655
- }
656
- class ToolbarActionsFactory extends ActionsFactory {
657
- constructor() {
658
- super(...arguments);
659
- this._ctor = ToolbarActions;
660
- }
661
- }
662
- class ToolbarAction extends Action {
663
- constructor(options) {
664
- super(options.permission || '', options.visible, options.action);
665
- this.text = options.text;
666
- this.icon = options.icon || '';
667
- }
668
- static create(options) {
669
- return new ToolbarAction(options);
670
- }
671
- static createMany(arrayOfOptions) {
672
- return arrayOfOptions.map(ToolbarAction.create);
673
- }
674
- }
675
- class ToolbarComponent extends Action {
676
- constructor(options) {
677
- super(options.permission || '', options.visible, options.action);
678
- this.component = options.component;
679
- }
680
- static create(options) {
681
- return new ToolbarComponent(options);
682
- }
683
- static createMany(arrayOfOptions) {
684
- return arrayOfOptions.map(ToolbarComponent.create);
685
- }
649
+ class ToolbarActionList extends ActionList {
650
+ }
651
+ class ToolbarActions extends Actions {
652
+ constructor() {
653
+ super(...arguments);
654
+ this._ctor = ToolbarActionList;
655
+ }
656
+ }
657
+ class ToolbarActionsFactory extends ActionsFactory {
658
+ constructor() {
659
+ super(...arguments);
660
+ this._ctor = ToolbarActions;
661
+ }
662
+ }
663
+ class ToolbarAction extends Action {
664
+ constructor(options) {
665
+ super(options.permission || '', options.visible, options.action);
666
+ this.text = options.text;
667
+ this.icon = options.icon || '';
668
+ }
669
+ static create(options) {
670
+ return new ToolbarAction(options);
671
+ }
672
+ static createMany(arrayOfOptions) {
673
+ return arrayOfOptions.map(ToolbarAction.create);
674
+ }
675
+ }
676
+ class ToolbarComponent extends Action {
677
+ constructor(options) {
678
+ super(options.permission || '', options.visible, options.action);
679
+ this.component = options.component;
680
+ }
681
+ static create(options) {
682
+ return new ToolbarComponent(options);
683
+ }
684
+ static createMany(arrayOfOptions) {
685
+ return arrayOfOptions.map(ToolbarComponent.create);
686
+ }
686
687
  }
687
688
 
688
- class ExtensionsService {
689
- constructor() {
690
- this.entityActions = new EntityActionsFactory();
691
- this.toolbarActions = new ToolbarActionsFactory();
692
- this.entityProps = new EntityPropsFactory();
693
- this.createFormProps = new CreateFormPropsFactory();
694
- this.editFormProps = new EditFormPropsFactory();
695
- }
696
- }
697
- ExtensionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
698
- ExtensionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensionsService, providedIn: 'root' });
699
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensionsService, decorators: [{
700
- type: Injectable,
701
- args: [{
702
- providedIn: 'root',
703
- }]
689
+ class ExtensionsService {
690
+ constructor() {
691
+ this.entityActions = new EntityActionsFactory();
692
+ this.toolbarActions = new ToolbarActionsFactory();
693
+ this.entityProps = new EntityPropsFactory();
694
+ this.createFormProps = new CreateFormPropsFactory();
695
+ this.editFormProps = new EditFormPropsFactory();
696
+ }
697
+ }
698
+ ExtensionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
699
+ ExtensionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensionsService, providedIn: 'root' });
700
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensionsService, decorators: [{
701
+ type: Injectable,
702
+ args: [{
703
+ providedIn: 'root',
704
+ }]
704
705
  }] });
705
706
 
706
- const EXTENSIONS_IDENTIFIER = new InjectionToken('EXTENSIONS_IDENTIFIER');
707
- const EXTENSIONS_ACTION_TYPE = new InjectionToken('EXTENSIONS_ACTION_TYPE');
708
- const EXTENSIONS_ACTION_DATA = new InjectionToken('EXTENSIONS_ACTION_DATA');
709
- const EXTENSIONS_ACTION_CALLBACK = new InjectionToken('EXTENSIONS_ACTION_DATA');
707
+ const EXTENSIONS_IDENTIFIER = new InjectionToken('EXTENSIONS_IDENTIFIER');
708
+ const EXTENSIONS_ACTION_TYPE = new InjectionToken('EXTENSIONS_ACTION_TYPE');
709
+ const EXTENSIONS_ACTION_DATA = new InjectionToken('EXTENSIONS_ACTION_DATA');
710
+ const EXTENSIONS_ACTION_CALLBACK = new InjectionToken('EXTENSIONS_ACTION_DATA');
710
711
  const PROP_DATA_STREAM = new InjectionToken('PROP_DATA_STREAM');
711
712
 
712
- /* eslint-disable @angular-eslint/no-input-rename */
713
- class PropDataDirective extends PropData {
714
- constructor(tempRef, vcRef, injector) {
715
- super();
716
- this.tempRef = tempRef;
717
- this.vcRef = vcRef;
718
- this.getInjected = injector.get.bind(injector);
719
- }
720
- ngOnChanges() {
721
- this.vcRef.clear();
722
- this.vcRef.createEmbeddedView(this.tempRef, {
723
- $implicit: this.data,
724
- index: 0,
725
- });
726
- }
727
- ngOnDestroy() {
728
- this.vcRef.clear();
729
- }
730
- }
731
- PropDataDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PropDataDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
732
- PropDataDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: PropDataDirective, selector: "[abpPropData]", inputs: { propList: ["abpPropDataFromList", "propList"], record: ["abpPropDataWithRecord", "record"], index: ["abpPropDataAtIndex", "index"] }, exportAs: ["abpPropData"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
733
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PropDataDirective, decorators: [{
734
- type: Directive,
735
- args: [{
736
- exportAs: 'abpPropData',
737
- selector: '[abpPropData]',
738
- }]
739
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i0.Injector }]; }, propDecorators: { propList: [{
740
- type: Input,
741
- args: ['abpPropDataFromList']
742
- }], record: [{
743
- type: Input,
744
- args: ['abpPropDataWithRecord']
745
- }], index: [{
746
- type: Input,
747
- args: ['abpPropDataAtIndex']
713
+ /* eslint-disable @angular-eslint/no-input-rename */
714
+ class PropDataDirective extends PropData {
715
+ constructor(tempRef, vcRef, injector) {
716
+ super();
717
+ this.tempRef = tempRef;
718
+ this.vcRef = vcRef;
719
+ this.getInjected = injector.get.bind(injector);
720
+ }
721
+ ngOnChanges() {
722
+ this.vcRef.clear();
723
+ this.vcRef.createEmbeddedView(this.tempRef, {
724
+ $implicit: this.data,
725
+ index: 0,
726
+ });
727
+ }
728
+ ngOnDestroy() {
729
+ this.vcRef.clear();
730
+ }
731
+ }
732
+ PropDataDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PropDataDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
733
+ PropDataDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: PropDataDirective, selector: "[abpPropData]", inputs: { propList: ["abpPropDataFromList", "propList"], record: ["abpPropDataWithRecord", "record"], index: ["abpPropDataAtIndex", "index"] }, exportAs: ["abpPropData"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
734
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PropDataDirective, decorators: [{
735
+ type: Directive,
736
+ args: [{
737
+ exportAs: 'abpPropData',
738
+ selector: '[abpPropData]',
739
+ }]
740
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i0.Injector }]; }, propDecorators: { propList: [{
741
+ type: Input,
742
+ args: ['abpPropDataFromList']
743
+ }], record: [{
744
+ type: Input,
745
+ args: ['abpPropDataWithRecord']
746
+ }], index: [{
747
+ type: Input,
748
+ args: ['abpPropDataAtIndex']
748
749
  }] } });
749
750
 
750
- class ExtensibleFormComponent {
751
- constructor(cdRef, track, container, extensions, identifier) {
752
- this.cdRef = cdRef;
753
- this.track = track;
754
- this.container = container;
755
- this.extensions = extensions;
756
- this.identifier = identifier;
757
- this.extraPropertiesKey = EXTRA_PROPERTIES_KEY;
758
- }
759
- set selectedRecord(record) {
760
- const type = !record || JSON.stringify(record) === '{}' ? 'create' : 'edit';
761
- this.propList = this.extensions[`${type}FormProps`].get(this.identifier).props;
762
- this.record = record;
763
- }
764
- get form() {
765
- return (this.container ? this.container.control : { controls: {} });
766
- }
767
- get extraProperties() {
768
- return (this.form.controls.extraProperties || { controls: {} });
769
- }
770
- }
771
- ExtensibleFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensibleFormComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.TrackByService }, { token: i2$1.ControlContainer }, { token: ExtensionsService }, { token: EXTENSIONS_IDENTIFIER }], target: i0.ɵɵFactoryTarget.Component });
772
- ExtensibleFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ExtensibleFormComponent, selector: "abp-extensible-form", inputs: { selectedRecord: "selectedRecord" }, viewQueries: [{ propertyName: "formProps", predicate: ExtensibleFormPropComponent, descendants: true }], exportAs: ["abpExtensibleForm"], ngImport: i0, template: "<ng-container *ngIf=\"form\">\n <ng-container *abpPropData=\"let data; fromList: propList; withRecord: record\">\n <ng-container *ngFor=\"let prop of propList; let first = first; trackBy: track.by('name')\">\n <ng-container *ngIf=\"prop.visible(data)\">\n <ng-container\n [formGroupName]=\"extraPropertiesKey\"\n *ngIf=\"extraProperties.controls[prop.name]; else tempDefault\"\n >\n <abp-extensible-form-prop [prop]=\"prop\" [data]=\"data\"></abp-extensible-form-prop>\n </ng-container>\n\n <ng-template #tempDefault>\n <abp-extensible-form-prop\n *ngIf=\"form.get(prop.name)\"\n [prop]=\"prop\"\n [data]=\"data\"\n [first]=\"first\"\n ></abp-extensible-form-prop>\n </ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-container>\n", components: [{ type: ExtensibleFormPropComponent, selector: "abp-extensible-form-prop", inputs: ["data", "prop", "first"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: PropDataDirective, selector: "[abpPropData]", inputs: ["abpPropDataFromList", "abpPropDataWithRecord", "abpPropDataAtIndex"], exportAs: ["abpPropData"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: i6.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", inputs: ["blueprints", "errorTemplate", "invalidClasses", "mapErrorsFn", "skipValidation", "targetSelector", "validateOnSubmit"] }], viewProviders: [
773
- {
774
- provide: ControlContainer,
775
- useFactory: selfFactory,
776
- deps: [[new Optional(), new SkipSelf(), ControlContainer]],
777
- },
778
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
779
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensibleFormComponent, decorators: [{
780
- type: Component,
781
- args: [{
782
- exportAs: 'abpExtensibleForm',
783
- selector: 'abp-extensible-form',
784
- templateUrl: './extensible-form.component.html',
785
- changeDetection: ChangeDetectionStrategy.OnPush,
786
- viewProviders: [
787
- {
788
- provide: ControlContainer,
789
- useFactory: selfFactory,
790
- deps: [[new Optional(), new SkipSelf(), ControlContainer]],
791
- },
792
- ],
793
- }]
794
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.TrackByService }, { type: i2$1.ControlContainer }, { type: ExtensionsService }, { type: undefined, decorators: [{
795
- type: Inject,
796
- args: [EXTENSIONS_IDENTIFIER]
797
- }] }]; }, propDecorators: { formProps: [{
798
- type: ViewChildren,
799
- args: [ExtensibleFormPropComponent]
800
- }], selectedRecord: [{
801
- type: Input
751
+ class ExtensibleFormComponent {
752
+ constructor(cdRef, track, container, extensions, identifier) {
753
+ this.cdRef = cdRef;
754
+ this.track = track;
755
+ this.container = container;
756
+ this.extensions = extensions;
757
+ this.identifier = identifier;
758
+ this.extraPropertiesKey = EXTRA_PROPERTIES_KEY;
759
+ }
760
+ set selectedRecord(record) {
761
+ const type = !record || JSON.stringify(record) === '{}' ? 'create' : 'edit';
762
+ this.propList = this.extensions[`${type}FormProps`].get(this.identifier).props;
763
+ this.record = record;
764
+ }
765
+ get form() {
766
+ return (this.container ? this.container.control : { controls: {} });
767
+ }
768
+ get extraProperties() {
769
+ return (this.form.controls.extraProperties || { controls: {} });
770
+ }
771
+ }
772
+ ExtensibleFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensibleFormComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.TrackByService }, { token: i2$1.ControlContainer }, { token: ExtensionsService }, { token: EXTENSIONS_IDENTIFIER }], target: i0.ɵɵFactoryTarget.Component });
773
+ ExtensibleFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ExtensibleFormComponent, selector: "abp-extensible-form", inputs: { selectedRecord: "selectedRecord" }, viewQueries: [{ propertyName: "formProps", predicate: ExtensibleFormPropComponent, descendants: true }], exportAs: ["abpExtensibleForm"], ngImport: i0, template: "<ng-container *ngIf=\"form\">\n <ng-container *abpPropData=\"let data; fromList: propList; withRecord: record\">\n <ng-container *ngFor=\"let prop of propList; let first = first; trackBy: track.by('name')\">\n <ng-container *ngIf=\"prop.visible(data)\">\n <ng-container\n [formGroupName]=\"extraPropertiesKey\"\n *ngIf=\"extraProperties.controls[prop.name]; else tempDefault\"\n >\n <abp-extensible-form-prop [prop]=\"prop\" [data]=\"data\"></abp-extensible-form-prop>\n </ng-container>\n\n <ng-template #tempDefault>\n <abp-extensible-form-prop\n *ngIf=\"form.get(prop.name)\"\n [prop]=\"prop\"\n [data]=\"data\"\n [first]=\"first\"\n ></abp-extensible-form-prop>\n </ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-container>\n", components: [{ type: ExtensibleFormPropComponent, selector: "abp-extensible-form-prop", inputs: ["data", "prop", "first"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: PropDataDirective, selector: "[abpPropData]", inputs: ["abpPropDataFromList", "abpPropDataWithRecord", "abpPropDataAtIndex"], exportAs: ["abpPropData"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: i6.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }], viewProviders: [
774
+ {
775
+ provide: ControlContainer,
776
+ useFactory: selfFactory,
777
+ deps: [[new Optional(), new SkipSelf(), ControlContainer]],
778
+ },
779
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
780
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensibleFormComponent, decorators: [{
781
+ type: Component,
782
+ args: [{
783
+ exportAs: 'abpExtensibleForm',
784
+ selector: 'abp-extensible-form',
785
+ templateUrl: './extensible-form.component.html',
786
+ changeDetection: ChangeDetectionStrategy.OnPush,
787
+ viewProviders: [
788
+ {
789
+ provide: ControlContainer,
790
+ useFactory: selfFactory,
791
+ deps: [[new Optional(), new SkipSelf(), ControlContainer]],
792
+ },
793
+ ],
794
+ }]
795
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.TrackByService }, { type: i2$1.ControlContainer }, { type: ExtensionsService }, { type: undefined, decorators: [{
796
+ type: Inject,
797
+ args: [EXTENSIONS_IDENTIFIER]
798
+ }] }]; }, propDecorators: { formProps: [{
799
+ type: ViewChildren,
800
+ args: [ExtensibleFormPropComponent]
801
+ }], selectedRecord: [{
802
+ type: Input
802
803
  }] } });
803
804
 
804
- // Fix for https://github.com/angular/angular/issues/23904
805
- // @dynamic
806
- class AbstractActionsComponent extends ActionData {
807
- constructor(injector) {
808
- super();
809
- this.getInjected = injector.get.bind(injector);
810
- const extensions = injector.get(ExtensionsService);
811
- const name = injector.get(EXTENSIONS_IDENTIFIER);
812
- const type = injector.get(EXTENSIONS_ACTION_TYPE);
813
- this.actionList = extensions[type].get(name).actions;
814
- }
815
- }
816
- AbstractActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AbstractActionsComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
817
- AbstractActionsComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: AbstractActionsComponent, inputs: { record: "record" }, usesInheritance: true, ngImport: i0 });
818
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AbstractActionsComponent, decorators: [{
819
- type: Directive
820
- }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { record: [{
821
- type: Input
805
+ // Fix for https://github.com/angular/angular/issues/23904
806
+ // @dynamic
807
+ class AbstractActionsComponent extends ActionData {
808
+ constructor(injector) {
809
+ super();
810
+ this.getInjected = injector.get.bind(injector);
811
+ const extensions = injector.get(ExtensionsService);
812
+ const name = injector.get(EXTENSIONS_IDENTIFIER);
813
+ const type = injector.get(EXTENSIONS_ACTION_TYPE);
814
+ this.actionList = extensions[type].get(name).actions;
815
+ }
816
+ }
817
+ AbstractActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AbstractActionsComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
818
+ AbstractActionsComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: AbstractActionsComponent, inputs: { record: "record" }, usesInheritance: true, ngImport: i0 });
819
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AbstractActionsComponent, decorators: [{
820
+ type: Directive
821
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { record: [{
822
+ type: Input
822
823
  }] } });
823
824
 
824
- class GridActionsComponent extends AbstractActionsComponent {
825
- constructor(injector) {
826
- super(injector);
827
- this.icon = 'fa fa-cog';
828
- this.text = '';
829
- this.trackByFn = (_, item) => item.text;
830
- }
831
- }
832
- GridActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: GridActionsComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
833
- GridActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: GridActionsComponent, selector: "abp-grid-actions", inputs: { icon: "icon", index: "index", text: "text" }, providers: [
834
- {
835
- provide: EXTENSIONS_ACTION_TYPE,
836
- useValue: 'entityActions',
837
- },
838
- ], exportAs: ["abpGridActions"], usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"actionList.length > 1\" ngbDropdown container=\"body\" class=\"d-inline-block\">\n <button\n class=\"btn btn-primary btn-sm dropdown-toggle\"\n data-toggle=\"dropdown\"\n aria-haspopup=\"true\"\n ngbDropdownToggle\n >\n <i [ngClass]=\"icon\" [class.me-1]=\"icon\"></i>{{ text | abpLocalization }}\n </button>\n <div ngbDropdownMenu>\n <ng-container\n *ngFor=\"let action of actionList; trackBy: trackByFn\"\n [ngTemplateOutlet]=\"btnItem\"\n [ngTemplateOutletContext]=\"{ $implicit: action }\"\n >\n </ng-container>\n </div>\n</div>\n\n<ng-container\n *ngIf=\"actionList.length === 1\"\n [ngTemplateOutlet]=\"btnItem\"\n [ngTemplateOutletContext]=\"{ $implicit: actionList.get(0).value }\"\n></ng-container>\n\n<ng-template #btnItem let-action>\n <ng-container *ngIf=\"action.visible(data)\">\n <button\n ngbDropdownItem\n *abpPermission=\"action.permission\"\n (click)=\"action.action(data)\"\n type=\"button\"\n class=\"{{ actionList.length === 1 ? 'btn btn-primary' : '' }}\"\n [class.text-center]=\"actionList.length === 1\"\n >\n <i [ngClass]=\"action.icon\" [class.me-1]=\"action.icon\"></i>\n <span *ngIf=\"action.icon; else ellipsis\">{{ action.text | abpLocalization }}</span>\n <ng-template #ellipsis>\n <div abpEllipsis>{{ action.text | abpLocalization }}</div>\n </ng-template>\n </button>\n </ng-container>\n</ng-template>\n", directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgbDropdown, selector: "[ngbDropdown]", inputs: ["open", "placement", "container", "autoClose", "display", "dropdownClass"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { type: i2.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission"] }, { type: i2.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { type: i4.EllipsisDirective, selector: "[abpEllipsis]", inputs: ["abpEllipsis", "title", "abpEllipsisEnabled"] }], pipes: { "abpLocalization": i1.LocalizationPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
839
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: GridActionsComponent, decorators: [{
840
- type: Component,
841
- args: [{
842
- exportAs: 'abpGridActions',
843
- selector: 'abp-grid-actions',
844
- templateUrl: './grid-actions.component.html',
845
- providers: [
846
- {
847
- provide: EXTENSIONS_ACTION_TYPE,
848
- useValue: 'entityActions',
849
- },
850
- ],
851
- changeDetection: ChangeDetectionStrategy.OnPush,
852
- }]
853
- }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { icon: [{
854
- type: Input
855
- }], index: [{
856
- type: Input
857
- }], text: [{
858
- type: Input
825
+ class GridActionsComponent extends AbstractActionsComponent {
826
+ constructor(injector) {
827
+ super(injector);
828
+ this.icon = 'fa fa-cog';
829
+ this.text = '';
830
+ this.trackByFn = (_, item) => item.text;
831
+ }
832
+ }
833
+ GridActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: GridActionsComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
834
+ GridActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: GridActionsComponent, selector: "abp-grid-actions", inputs: { icon: "icon", index: "index", text: "text" }, providers: [
835
+ {
836
+ provide: EXTENSIONS_ACTION_TYPE,
837
+ useValue: 'entityActions',
838
+ },
839
+ ], exportAs: ["abpGridActions"], usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"actionList.length > 1\" ngbDropdown container=\"body\" class=\"d-inline-block\">\n <button\n class=\"btn btn-primary btn-sm dropdown-toggle\"\n data-toggle=\"dropdown\"\n aria-haspopup=\"true\"\n ngbDropdownToggle\n >\n <i [ngClass]=\"icon\" [class.me-1]=\"icon\"></i>{{ text | abpLocalization }}\n </button>\n <div ngbDropdownMenu>\n <ng-container\n *ngFor=\"let action of actionList; trackBy: trackByFn\"\n [ngTemplateOutlet]=\"dropDownBtnItemTmp\"\n [ngTemplateOutletContext]=\"{ $implicit: action }\"\n >\n </ng-container>\n </div>\n</div>\n\n<ng-container\n *ngIf=\"actionList.length === 1\"\n [ngTemplateOutlet]=\"btnTmp\"\n [ngTemplateOutletContext]=\"{ $implicit: actionList.get(0).value }\"\n></ng-container>\n\n<ng-template #dropDownBtnItemTmp let-action>\n <ng-container *ngIf=\"action.visible(data)\">\n <button\n ngbDropdownItem\n *abpPermission=\"action.permission\"\n (click)=\"action.action(data)\"\n type=\"button\"\n >\n <ng-container\n *ngTemplateOutlet=\"buttonContentTmp; context: { $implicit: action }\"\n ></ng-container>\n </button>\n </ng-container>\n</ng-template>\n\n<ng-template #buttonContentTmp let-action>\n <i [ngClass]=\"action.icon\" [class.me-1]=\"action.icon\"></i>\n <span *ngIf=\"action.icon; else ellipsis\">{{ action.text | abpLocalization }}</span>\n <ng-template #ellipsis>\n <div abpEllipsis>{{ action.text | abpLocalization }}</div>\n </ng-template>\n</ng-template>\n\n<ng-template #btnTmp let-action>\n <ng-container *ngIf=\"action.visible(data)\">\n <button\n *abpPermission=\"action.permission\"\n (click)=\"action.action(data)\"\n type=\"button\"\n class=\"btn btn-primary text-center\"\n >\n <ng-container\n *ngTemplateOutlet=\"buttonContentTmp; context: { $implicit: action }\"\n ></ng-container>\n </button>\n </ng-container>\n</ng-template>\n", directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgbDropdown, selector: "[ngbDropdown]", inputs: ["open", "placement", "container", "autoClose", "display", "dropdownClass"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { type: i2.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission"] }, { type: i2.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { type: i4.EllipsisDirective, selector: "[abpEllipsis]", inputs: ["abpEllipsis", "title", "abpEllipsisEnabled"] }], pipes: { "abpLocalization": i1.LocalizationPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
840
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: GridActionsComponent, decorators: [{
841
+ type: Component,
842
+ args: [{
843
+ exportAs: 'abpGridActions',
844
+ selector: 'abp-grid-actions',
845
+ templateUrl: './grid-actions.component.html',
846
+ providers: [
847
+ {
848
+ provide: EXTENSIONS_ACTION_TYPE,
849
+ useValue: 'entityActions',
850
+ },
851
+ ],
852
+ changeDetection: ChangeDetectionStrategy.OnPush,
853
+ }]
854
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { icon: [{
855
+ type: Input
856
+ }], index: [{
857
+ type: Input
858
+ }], text: [{
859
+ type: Input
859
860
  }] } });
860
861
 
861
- const DEFAULT_ACTIONS_COLUMN_WIDTH = 150;
862
- class ExtensibleTableComponent {
863
- constructor(locale, config, injector) {
864
- this.locale = locale;
865
- this.config = config;
866
- this.injector = injector;
867
- this.trackByFn = (_, item) => item.name;
868
- this.getInjected = injector.get.bind(injector);
869
- const extensions = injector.get(ExtensionsService);
870
- const name = injector.get(EXTENSIONS_IDENTIFIER);
871
- this.propList = extensions.entityProps.get(name).props;
872
- this.actionList = extensions['entityActions'].get(name)
873
- .actions;
874
- const permissionService = injector.get(PermissionService);
875
- this.hasAtLeastOnePermittedAction =
876
- permissionService.filterItemsByPolicy(this.actionList.toArray().map(action => ({ requiredPolicy: action.permission }))).length > 0;
877
- this.setColumnWidths(DEFAULT_ACTIONS_COLUMN_WIDTH);
878
- }
879
- set actionsText(value) {
880
- this._actionsText = value;
881
- }
882
- get actionsText() {
883
- var _a;
884
- return (_a = this._actionsText) !== null && _a !== void 0 ? _a : (this.actionList.length > 1 ? 'AbpUi::Actions' : '');
885
- }
886
- set actionsColumnWidth(width) {
887
- this.setColumnWidths(width ? Number(width) : undefined);
888
- }
889
- setColumnWidths(actionsColumn) {
890
- const widths = [actionsColumn];
891
- this.propList.forEach(({ value: prop }) => {
892
- widths.push(prop.columnWidth);
893
- });
894
- this.columnWidths = widths;
895
- }
896
- getDate(value, format) {
897
- return value ? formatDate(value, format, this.locale) : '';
898
- }
899
- getIcon(value) {
900
- return value
901
- ? '<div class="text-center text-success"><i class="fa fa-check"></i></div>'
902
- : '<div class="text-center text-danger"><i class="fa fa-times"></i></div>';
903
- }
904
- getEnum(rowValue, list) {
905
- if (!list)
906
- return rowValue;
907
- const { key } = list.find(({ value }) => value === rowValue);
908
- return key;
909
- }
910
- getContent(prop, data) {
911
- return prop.valueResolver(data).pipe(map(value => {
912
- switch (prop.type) {
913
- case "boolean" /* Boolean */:
914
- return this.getIcon(value);
915
- case "date" /* Date */:
916
- return this.getDate(value, getShortDateFormat(this.config));
917
- case "time" /* Time */:
918
- return this.getDate(value, getShortTimeFormat(this.config));
919
- case "dateTime" /* DateTime */:
920
- return this.getDate(value, getShortDateShortTimeFormat(this.config));
921
- case "enum" /* Enum */:
922
- return this.getEnum(value, prop.enumList);
923
- default:
924
- return value;
925
- // More types can be handled in the future
926
- }
927
- }));
928
- }
929
- ngOnChanges({ data }) {
930
- if (!(data === null || data === void 0 ? void 0 : data.currentValue))
931
- return;
932
- this.data = data.currentValue.map((record, index) => {
933
- this.propList.forEach(prop => {
934
- const propData = { getInjected: this.getInjected, record, index };
935
- const value = this.getContent(prop.value, propData);
936
- const propKey = `_${prop.value.name}`;
937
- record[propKey] = {
938
- visible: prop.value.visible(propData),
939
- value,
940
- };
941
- if (prop.value.component) {
942
- const injector = Injector.create([
943
- {
944
- provide: PROP_DATA_STREAM,
945
- useValue: value,
946
- },
947
- ], this.injector);
948
- record[propKey].injector = injector;
949
- record[propKey].component = prop.value.component;
950
- }
951
- });
952
- return record;
953
- });
954
- }
955
- }
956
- ExtensibleTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensibleTableComponent, deps: [{ token: LOCALE_ID }, { token: i1.ConfigStateService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
957
- ExtensibleTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ExtensibleTableComponent, selector: "abp-extensible-table", inputs: { actionsText: "actionsText", data: "data", list: "list", recordsTotal: "recordsTotal", actionsColumnWidth: "actionsColumnWidth", actionsTemplate: "actionsTemplate" }, exportAs: ["abpExtensibleTable"], usesOnChanges: true, ngImport: i0, template: "<ngx-datatable default [rows]=\"data\" [count]=\"recordsTotal\" [list]=\"list\">\n <ngx-datatable-column\n *ngIf=\"actionsTemplate || (actionList.length && hasAtLeastOnePermittedAction)\"\n [name]=\"actionsText | abpLocalization\"\n [maxWidth]=\"columnWidths[0]\"\n [width]=\"columnWidths[0]\"\n [sortable]=\"false\"\n >\n <ng-template let-row=\"row\" let-i=\"rowIndex\" ngx-datatable-cell-template>\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate || gridActions; context: { $implicit: row, index: i }\"\n ></ng-container>\n <ng-template #gridActions>\n <abp-grid-actions [index]=\"i\" [record]=\"row\" text=\"AbpUi::Actions\"></abp-grid-actions>\n </ng-template>\n </ng-template>\n </ngx-datatable-column>\n\n <ng-container *ngFor=\"let prop of propList; let i = index; trackBy: trackByFn\">\n <ngx-datatable-column\n [width]=\"columnWidths[i + 1] || 200\"\n [name]=\"prop.displayName | abpLocalization\"\n [prop]=\"prop.name\"\n [sortable]=\"prop.sortable\"\n >\n <ng-template let-row=\"row\" let-i=\"index\" ngx-datatable-cell-template>\n <ng-container *abpPermission=\"prop.permission\">\n <ng-container *ngIf=\"row['_' + prop.name]?.visible\">\n <div\n *ngIf=\"!row['_' + prop.name].component; else component\"\n [innerHTML]=\"row['_' + prop.name]?.value | async\"\n (click)=\"\n prop.action && prop.action({ getInjected: getInjected, record: row, index: i })\n \"\n [class.pointer]=\"prop.action\"\n ></div>\n </ng-container>\n <ng-template #component>\n <ng-container\n *ngComponentOutlet=\"\n row['_' + prop.name].component;\n injector: row['_' + prop.name].injector\n \"\n ></ng-container>\n </ng-template>\n </ng-container>\n </ng-template>\n </ngx-datatable-column>\n </ng-container>\n</ngx-datatable>\n", components: [{ type: i2$2.DatatableComponent, selector: "ngx-datatable", inputs: ["selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "loadingIndicator", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "groupExpansionDefault", "selectAllRowsOnPage", "virtualization", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity", "rows", "groupedRows", "groupRowsBy", "columns", "limit", "count", "offset", "targetMarkerTemplate", "selectionType", "rowClass", "selectCheck", "displayCheck", "trackByProp", "treeFromRelation", "treeToRelation"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { type: GridActionsComponent, selector: "abp-grid-actions", inputs: ["icon", "index", "text"], exportAs: ["abpGridActions"] }], directives: [{ type: i4.NgxDatatableDefaultDirective, selector: "ngx-datatable[default]", inputs: ["class"], exportAs: ["ngxDatatableDefault"] }, { type: i4.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$2.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { type: i2$2.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission"] }, { type: i5.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModuleFactory"] }], pipes: { "abpLocalization": i1.LocalizationPipe, "async": i5.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
958
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensibleTableComponent, decorators: [{
959
- type: Component,
960
- args: [{
961
- exportAs: 'abpExtensibleTable',
962
- selector: 'abp-extensible-table',
963
- templateUrl: './extensible-table.component.html',
964
- changeDetection: ChangeDetectionStrategy.OnPush,
965
- }]
966
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
967
- type: Inject,
968
- args: [LOCALE_ID]
969
- }] }, { type: i1.ConfigStateService }, { type: i0.Injector }]; }, propDecorators: { actionsText: [{
970
- type: Input
971
- }], data: [{
972
- type: Input
973
- }], list: [{
974
- type: Input
975
- }], recordsTotal: [{
976
- type: Input
977
- }], actionsColumnWidth: [{
978
- type: Input
979
- }], actionsTemplate: [{
980
- type: Input
862
+ const DEFAULT_ACTIONS_COLUMN_WIDTH = 150;
863
+ class ExtensibleTableComponent {
864
+ constructor(locale, config, injector) {
865
+ this.locale = locale;
866
+ this.config = config;
867
+ this.injector = injector;
868
+ this.trackByFn = (_, item) => item.name;
869
+ this.getInjected = injector.get.bind(injector);
870
+ const extensions = injector.get(ExtensionsService);
871
+ const name = injector.get(EXTENSIONS_IDENTIFIER);
872
+ this.propList = extensions.entityProps.get(name).props;
873
+ this.actionList = extensions['entityActions'].get(name)
874
+ .actions;
875
+ const permissionService = injector.get(PermissionService);
876
+ this.hasAtLeastOnePermittedAction =
877
+ permissionService.filterItemsByPolicy(this.actionList.toArray().map(action => ({ requiredPolicy: action.permission }))).length > 0;
878
+ this.setColumnWidths(DEFAULT_ACTIONS_COLUMN_WIDTH);
879
+ }
880
+ set actionsText(value) {
881
+ this._actionsText = value;
882
+ }
883
+ get actionsText() {
884
+ var _a;
885
+ return (_a = this._actionsText) !== null && _a !== void 0 ? _a : (this.actionList.length > 1 ? 'AbpUi::Actions' : '');
886
+ }
887
+ set actionsColumnWidth(width) {
888
+ this.setColumnWidths(width ? Number(width) : undefined);
889
+ }
890
+ setColumnWidths(actionsColumn) {
891
+ const widths = [actionsColumn];
892
+ this.propList.forEach(({ value: prop }) => {
893
+ widths.push(prop.columnWidth);
894
+ });
895
+ this.columnWidths = widths;
896
+ }
897
+ getDate(value, format) {
898
+ return value ? formatDate(value, format, this.locale) : '';
899
+ }
900
+ getIcon(value) {
901
+ return value
902
+ ? '<div class="text-center text-success"><i class="fa fa-check"></i></div>'
903
+ : '<div class="text-center text-danger"><i class="fa fa-times"></i></div>';
904
+ }
905
+ getEnum(rowValue, list) {
906
+ if (!list)
907
+ return rowValue;
908
+ const { key } = list.find(({ value }) => value === rowValue);
909
+ return key;
910
+ }
911
+ getContent(prop, data) {
912
+ return prop.valueResolver(data).pipe(map(value => {
913
+ switch (prop.type) {
914
+ case "boolean" /* Boolean */:
915
+ return this.getIcon(value);
916
+ case "date" /* Date */:
917
+ return this.getDate(value, getShortDateFormat(this.config));
918
+ case "time" /* Time */:
919
+ return this.getDate(value, getShortTimeFormat(this.config));
920
+ case "dateTime" /* DateTime */:
921
+ return this.getDate(value, getShortDateShortTimeFormat(this.config));
922
+ case "enum" /* Enum */:
923
+ return this.getEnum(value, prop.enumList);
924
+ default:
925
+ return value;
926
+ // More types can be handled in the future
927
+ }
928
+ }));
929
+ }
930
+ ngOnChanges({ data }) {
931
+ if (!(data === null || data === void 0 ? void 0 : data.currentValue))
932
+ return;
933
+ this.data = data.currentValue.map((record, index) => {
934
+ this.propList.forEach(prop => {
935
+ const propData = { getInjected: this.getInjected, record, index };
936
+ const value = this.getContent(prop.value, propData);
937
+ const propKey = `_${prop.value.name}`;
938
+ record[propKey] = {
939
+ visible: prop.value.visible(propData),
940
+ value,
941
+ };
942
+ if (prop.value.component) {
943
+ const injector = Injector.create([
944
+ {
945
+ provide: PROP_DATA_STREAM,
946
+ useValue: value,
947
+ },
948
+ ], this.injector);
949
+ record[propKey].injector = injector;
950
+ record[propKey].component = prop.value.component;
951
+ }
952
+ });
953
+ return record;
954
+ });
955
+ }
956
+ }
957
+ ExtensibleTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensibleTableComponent, deps: [{ token: LOCALE_ID }, { token: i1.ConfigStateService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
958
+ ExtensibleTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ExtensibleTableComponent, selector: "abp-extensible-table", inputs: { actionsText: "actionsText", data: "data", list: "list", recordsTotal: "recordsTotal", actionsColumnWidth: "actionsColumnWidth", actionsTemplate: "actionsTemplate" }, exportAs: ["abpExtensibleTable"], usesOnChanges: true, ngImport: i0, template: "<ngx-datatable default [rows]=\"data\" [count]=\"recordsTotal\" [list]=\"list\">\n <ngx-datatable-column\n *ngIf=\"actionsTemplate || (actionList.length && hasAtLeastOnePermittedAction)\"\n [name]=\"actionsText | abpLocalization\"\n [maxWidth]=\"columnWidths[0]\"\n [width]=\"columnWidths[0]\"\n [sortable]=\"false\"\n >\n <ng-template let-row=\"row\" let-i=\"rowIndex\" ngx-datatable-cell-template>\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate || gridActions; context: { $implicit: row, index: i }\"\n ></ng-container>\n <ng-template #gridActions>\n <abp-grid-actions [index]=\"i\" [record]=\"row\" text=\"AbpUi::Actions\"></abp-grid-actions>\n </ng-template>\n </ng-template>\n </ngx-datatable-column>\n\n <ng-container *ngFor=\"let prop of propList; let i = index; trackBy: trackByFn\">\n <ngx-datatable-column\n [width]=\"columnWidths[i + 1] || 200\"\n [name]=\"prop.displayName | abpLocalization\"\n [prop]=\"prop.name\"\n [sortable]=\"prop.sortable\"\n >\n <ng-template let-row=\"row\" let-i=\"index\" ngx-datatable-cell-template>\n <ng-container *abpPermission=\"prop.permission\">\n <ng-container *ngIf=\"row['_' + prop.name]?.visible\">\n <div\n *ngIf=\"!row['_' + prop.name].component; else component\"\n [innerHTML]=\"row['_' + prop.name]?.value | async\"\n (click)=\"\n prop.action && prop.action({ getInjected: getInjected, record: row, index: i })\n \"\n [class.pointer]=\"prop.action\"\n ></div>\n </ng-container>\n <ng-template #component>\n <ng-container\n *ngComponentOutlet=\"\n row['_' + prop.name].component;\n injector: row['_' + prop.name].injector\n \"\n ></ng-container>\n </ng-template>\n </ng-container>\n </ng-template>\n </ngx-datatable-column>\n </ng-container>\n</ngx-datatable>\n", components: [{ type: i2$2.DatatableComponent, selector: "ngx-datatable", inputs: ["selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "loadingIndicator", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "groupExpansionDefault", "selectAllRowsOnPage", "virtualization", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity", "rows", "groupedRows", "groupRowsBy", "columns", "limit", "count", "offset", "targetMarkerTemplate", "selectionType", "rowClass", "selectCheck", "displayCheck", "trackByProp", "treeFromRelation", "treeToRelation"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { type: GridActionsComponent, selector: "abp-grid-actions", inputs: ["icon", "index", "text"], exportAs: ["abpGridActions"] }], directives: [{ type: i4.NgxDatatableDefaultDirective, selector: "ngx-datatable[default]", inputs: ["class"], exportAs: ["ngxDatatableDefault"] }, { type: i4.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$2.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { type: i2$2.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission"] }, { type: i5.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModuleFactory"] }], pipes: { "abpLocalization": i1.LocalizationPipe, "async": i5.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExtensibleTableComponent, decorators: [{
960
+ type: Component,
961
+ args: [{
962
+ exportAs: 'abpExtensibleTable',
963
+ selector: 'abp-extensible-table',
964
+ templateUrl: './extensible-table.component.html',
965
+ changeDetection: ChangeDetectionStrategy.OnPush,
966
+ }]
967
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
968
+ type: Inject,
969
+ args: [LOCALE_ID]
970
+ }] }, { type: i1.ConfigStateService }, { type: i0.Injector }]; }, propDecorators: { actionsText: [{
971
+ type: Input
972
+ }], data: [{
973
+ type: Input
974
+ }], list: [{
975
+ type: Input
976
+ }], recordsTotal: [{
977
+ type: Input
978
+ }], actionsColumnWidth: [{
979
+ type: Input
980
+ }], actionsTemplate: [{
981
+ type: Input
981
982
  }] } });
982
983
 
983
- class PageToolbarComponent extends AbstractActionsComponent {
984
- constructor(injector) {
985
- super(injector);
986
- this.injector = injector;
987
- this.trackByFn = (_, item) => item.action || item.component;
988
- }
989
- createInjector(action) {
990
- const get = (token, notFoundValue, flags) => {
991
- return token === EXTENSIONS_ACTION_DATA
992
- ? this.data
993
- : token === EXTENSIONS_ACTION_CALLBACK
994
- ? (data = this.data) => action.action(data)
995
- : this.getInjected.call(this.injector, token, notFoundValue, flags);
996
- };
997
- return { get };
998
- }
999
- }
1000
- PageToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PageToolbarComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1001
- PageToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: PageToolbarComponent, selector: "abp-page-toolbar", providers: [
1002
- {
1003
- provide: EXTENSIONS_ACTION_TYPE,
1004
- useValue: 'toolbarActions',
1005
- },
1006
- ], exportAs: ["abpPageToolbar"], usesInheritance: true, ngImport: i0, template: "<div class=\"row justify-content-end mx-0\" id=\"AbpContentToolbar\">\n <div\n class=\"col-auto px-1 pt-0 pt-md-2\"\n [class.pe-0]=\"last\"\n *ngFor=\"let action of actionList; trackBy: trackByFn; let last = last\"\n >\n <ng-container *ngIf=\"action.visible(data)\">\n <ng-container *abpPermission=\"action.permission\">\n <ng-container *ngIf=\"action.component as component; else button\">\n <ng-container\n *ngComponentOutlet=\"component; injector: createInjector(action)\"\n ></ng-container>\n </ng-container>\n\n <ng-template #button>\n <button (click)=\"action.action(data)\" type=\"button\" class=\"btn btn-primary btn-sm\">\n <i [ngClass]=\"action.icon\" [class.me-1]=\"action.icon\"></i>\n {{ action.text | abpLocalization }}\n </button>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n</div>\n", directives: [{ type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission"] }, { type: i5.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModuleFactory"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "abpLocalization": i1.LocalizationPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1007
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PageToolbarComponent, decorators: [{
1008
- type: Component,
1009
- args: [{
1010
- exportAs: 'abpPageToolbar',
1011
- selector: 'abp-page-toolbar',
1012
- templateUrl: './page-toolbar.component.html',
1013
- providers: [
1014
- {
1015
- provide: EXTENSIONS_ACTION_TYPE,
1016
- useValue: 'toolbarActions',
1017
- },
1018
- ],
1019
- changeDetection: ChangeDetectionStrategy.OnPush,
1020
- }]
984
+ class PageToolbarComponent extends AbstractActionsComponent {
985
+ constructor(injector) {
986
+ super(injector);
987
+ this.injector = injector;
988
+ this.trackByFn = (_, item) => item.action || item.component;
989
+ }
990
+ createInjector(action) {
991
+ const get = (token, notFoundValue, flags) => {
992
+ return token === EXTENSIONS_ACTION_DATA
993
+ ? this.data
994
+ : token === EXTENSIONS_ACTION_CALLBACK
995
+ ? (data = this.data) => action.action(data)
996
+ : this.getInjected.call(this.injector, token, notFoundValue, flags);
997
+ };
998
+ return { get };
999
+ }
1000
+ }
1001
+ PageToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PageToolbarComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1002
+ PageToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: PageToolbarComponent, selector: "abp-page-toolbar", providers: [
1003
+ {
1004
+ provide: EXTENSIONS_ACTION_TYPE,
1005
+ useValue: 'toolbarActions',
1006
+ },
1007
+ ], exportAs: ["abpPageToolbar"], usesInheritance: true, ngImport: i0, template: "<div class=\"row justify-content-end mx-0\" id=\"AbpContentToolbar\">\n <div\n class=\"col-auto px-1 pt-0 pt-md-2\"\n [class.pe-0]=\"last\"\n *ngFor=\"let action of actionList; trackBy: trackByFn; let last = last\"\n >\n <ng-container *ngIf=\"action.visible(data)\">\n <ng-container *abpPermission=\"action.permission\">\n <ng-container *ngIf=\"action.component as component; else button\">\n <ng-container\n *ngComponentOutlet=\"component; injector: createInjector(action)\"\n ></ng-container>\n </ng-container>\n\n <ng-template #button>\n <button (click)=\"action.action(data)\" type=\"button\" class=\"btn btn-primary btn-sm\">\n <i [ngClass]=\"action.icon\" [class.me-1]=\"action.icon\"></i>\n {{ action.text | abpLocalization }}\n </button>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n</div>\n", directives: [{ type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission"] }, { type: i5.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModuleFactory"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "abpLocalization": i1.LocalizationPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1008
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PageToolbarComponent, decorators: [{
1009
+ type: Component,
1010
+ args: [{
1011
+ exportAs: 'abpPageToolbar',
1012
+ selector: 'abp-page-toolbar',
1013
+ templateUrl: './page-toolbar.component.html',
1014
+ providers: [
1015
+ {
1016
+ provide: EXTENSIONS_ACTION_TYPE,
1017
+ useValue: 'toolbarActions',
1018
+ },
1019
+ ],
1020
+ changeDetection: ChangeDetectionStrategy.OnPush,
1021
+ }]
1021
1022
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
1022
1023
 
1023
1024
  var objectExtensions = /*#__PURE__*/Object.freeze({
1024
1025
  __proto__: null
1025
1026
  });
1026
1027
 
1027
- class BaseUiExtensionsModule {
1028
- }
1029
- BaseUiExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: BaseUiExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1030
- BaseUiExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: BaseUiExtensionsModule, declarations: [DateTimePickerComponent,
1031
- PageToolbarComponent,
1032
- GridActionsComponent,
1033
- ExtensibleFormPropComponent,
1034
- ExtensibleFormComponent,
1035
- ExtensibleTableComponent,
1036
- PropDataDirective,
1037
- DisabledDirective], imports: [CoreModule,
1038
- ThemeSharedModule,
1039
- NgxValidateCoreModule,
1040
- NgbDatepickerModule,
1041
- NgbDropdownModule,
1042
- NgbTimepickerModule,
1043
- NgbTypeaheadModule], exports: [DateTimePickerComponent,
1044
- PageToolbarComponent,
1045
- GridActionsComponent,
1046
- ExtensibleFormComponent,
1047
- ExtensibleTableComponent,
1048
- PropDataDirective,
1049
- DisabledDirective] });
1050
- BaseUiExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: BaseUiExtensionsModule, imports: [[
1051
- CoreModule,
1052
- ThemeSharedModule,
1053
- NgxValidateCoreModule,
1054
- NgbDatepickerModule,
1055
- NgbDropdownModule,
1056
- NgbTimepickerModule,
1057
- NgbTypeaheadModule,
1058
- ]] });
1059
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: BaseUiExtensionsModule, decorators: [{
1060
- type: NgModule,
1061
- args: [{
1062
- exports: [
1063
- DateTimePickerComponent,
1064
- PageToolbarComponent,
1065
- GridActionsComponent,
1066
- ExtensibleFormComponent,
1067
- ExtensibleTableComponent,
1068
- PropDataDirective,
1069
- DisabledDirective,
1070
- ],
1071
- declarations: [
1072
- DateTimePickerComponent,
1073
- PageToolbarComponent,
1074
- GridActionsComponent,
1075
- ExtensibleFormPropComponent,
1076
- ExtensibleFormComponent,
1077
- ExtensibleTableComponent,
1078
- PropDataDirective,
1079
- DisabledDirective,
1080
- ],
1081
- imports: [
1082
- CoreModule,
1083
- ThemeSharedModule,
1084
- NgxValidateCoreModule,
1085
- NgbDatepickerModule,
1086
- NgbDropdownModule,
1087
- NgbTimepickerModule,
1088
- NgbTypeaheadModule,
1089
- ],
1090
- }]
1091
- }] });
1092
- class UiExtensionsModule {
1093
- }
1094
- UiExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: UiExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1095
- UiExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: UiExtensionsModule, imports: [BaseUiExtensionsModule], exports: [BaseUiExtensionsModule] });
1096
- UiExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: UiExtensionsModule, imports: [[BaseUiExtensionsModule], BaseUiExtensionsModule] });
1097
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: UiExtensionsModule, decorators: [{
1098
- type: NgModule,
1099
- args: [{
1100
- exports: [BaseUiExtensionsModule],
1101
- imports: [BaseUiExtensionsModule],
1102
- }]
1028
+ class BaseUiExtensionsModule {
1029
+ }
1030
+ BaseUiExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: BaseUiExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1031
+ BaseUiExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: BaseUiExtensionsModule, declarations: [DateTimePickerComponent,
1032
+ PageToolbarComponent,
1033
+ GridActionsComponent,
1034
+ ExtensibleFormPropComponent,
1035
+ ExtensibleFormComponent,
1036
+ ExtensibleTableComponent,
1037
+ PropDataDirective,
1038
+ DisabledDirective], imports: [CoreModule,
1039
+ ThemeSharedModule,
1040
+ NgxValidateCoreModule,
1041
+ NgbDatepickerModule,
1042
+ NgbDropdownModule,
1043
+ NgbTimepickerModule,
1044
+ NgbTypeaheadModule], exports: [DateTimePickerComponent,
1045
+ PageToolbarComponent,
1046
+ GridActionsComponent,
1047
+ ExtensibleFormComponent,
1048
+ ExtensibleTableComponent,
1049
+ PropDataDirective,
1050
+ DisabledDirective] });
1051
+ BaseUiExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: BaseUiExtensionsModule, imports: [[
1052
+ CoreModule,
1053
+ ThemeSharedModule,
1054
+ NgxValidateCoreModule,
1055
+ NgbDatepickerModule,
1056
+ NgbDropdownModule,
1057
+ NgbTimepickerModule,
1058
+ NgbTypeaheadModule,
1059
+ ]] });
1060
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: BaseUiExtensionsModule, decorators: [{
1061
+ type: NgModule,
1062
+ args: [{
1063
+ exports: [
1064
+ DateTimePickerComponent,
1065
+ PageToolbarComponent,
1066
+ GridActionsComponent,
1067
+ ExtensibleFormComponent,
1068
+ ExtensibleTableComponent,
1069
+ PropDataDirective,
1070
+ DisabledDirective,
1071
+ ],
1072
+ declarations: [
1073
+ DateTimePickerComponent,
1074
+ PageToolbarComponent,
1075
+ GridActionsComponent,
1076
+ ExtensibleFormPropComponent,
1077
+ ExtensibleFormComponent,
1078
+ ExtensibleTableComponent,
1079
+ PropDataDirective,
1080
+ DisabledDirective,
1081
+ ],
1082
+ imports: [
1083
+ CoreModule,
1084
+ ThemeSharedModule,
1085
+ NgxValidateCoreModule,
1086
+ NgbDatepickerModule,
1087
+ NgbDropdownModule,
1088
+ NgbTimepickerModule,
1089
+ NgbTypeaheadModule,
1090
+ ],
1091
+ }]
1092
+ }] });
1093
+ class UiExtensionsModule {
1094
+ }
1095
+ UiExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: UiExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1096
+ UiExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: UiExtensionsModule, imports: [BaseUiExtensionsModule], exports: [BaseUiExtensionsModule] });
1097
+ UiExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: UiExtensionsModule, imports: [[BaseUiExtensionsModule], BaseUiExtensionsModule] });
1098
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: UiExtensionsModule, decorators: [{
1099
+ type: NgModule,
1100
+ args: [{
1101
+ exports: [BaseUiExtensionsModule],
1102
+ imports: [BaseUiExtensionsModule],
1103
+ }]
1103
1104
  }] });
1104
1105
 
1105
- function mergeWithDefaultActions(extension, defaultActions, ...contributors) {
1106
- Object.keys(defaultActions).forEach((name) => {
1107
- const actions = extension.get(name);
1108
- actions.clearContributors();
1109
- actions.addContributor((actionList) => actionList.addManyTail(defaultActions[name]));
1110
- contributors.forEach(contributor => (contributor[name] || []).forEach((callback) => actions.addContributor(callback)));
1111
- });
1106
+ function mergeWithDefaultActions(extension, defaultActions, ...contributors) {
1107
+ Object.keys(defaultActions).forEach((name) => {
1108
+ const actions = extension.get(name);
1109
+ actions.clearContributors();
1110
+ actions.addContributor((actionList) => actionList.addManyTail(defaultActions[name]));
1111
+ contributors.forEach(contributor => (contributor[name] || []).forEach((callback) => actions.addContributor(callback)));
1112
+ });
1112
1113
  }
1113
1114
 
1114
- function generateFormFromProps(data) {
1115
- const extensions = data.getInjected(ExtensionsService);
1116
- const identifier = data.getInjected(EXTENSIONS_IDENTIFIER);
1117
- const form = new FormGroup({});
1118
- const extraForm = new FormGroup({});
1119
- form.addControl(EXTRA_PROPERTIES_KEY, extraForm);
1120
- const record = data.record || {};
1121
- const type = JSON.stringify(record) === '{}' ? 'create' : 'edit';
1122
- const props = extensions[`${type}FormProps`].get(identifier).props;
1123
- const extraProperties = record[EXTRA_PROPERTIES_KEY] || {};
1124
- props.forEach(({ value: prop }) => {
1125
- const name = prop.name;
1126
- const isExtraProperty = prop.isExtra || name in extraProperties;
1127
- let value = isExtraProperty ? extraProperties[name] : name in record ? record[name] : undefined;
1128
- if (typeof value === 'undefined')
1129
- value = prop.defaultValue;
1130
- if (value) {
1131
- let adapter;
1132
- switch (prop.type) {
1133
- case "date" /* Date */:
1134
- adapter = new DateAdapter();
1135
- value = adapter.toModel(adapter.fromModel(value));
1136
- break;
1137
- case "time" /* Time */:
1138
- adapter = new TimeAdapter();
1139
- value = adapter.toModel(adapter.fromModel(value));
1140
- break;
1141
- case "dateTime" /* DateTime */:
1142
- adapter = new DateTimeAdapter();
1143
- value = adapter.toModel(adapter.fromModel(value));
1144
- break;
1145
- default:
1146
- break;
1147
- }
1148
- }
1149
- const formControl = new FormControl(value, {
1150
- asyncValidators: prop.asyncValidators(data),
1151
- validators: prop.validators(data),
1152
- });
1153
- (isExtraProperty ? extraForm : form).addControl(name, formControl);
1154
- });
1155
- return form;
1115
+ function generateFormFromProps(data) {
1116
+ const extensions = data.getInjected(ExtensionsService);
1117
+ const identifier = data.getInjected(EXTENSIONS_IDENTIFIER);
1118
+ const form = new FormGroup({});
1119
+ const extraForm = new FormGroup({});
1120
+ form.addControl(EXTRA_PROPERTIES_KEY, extraForm);
1121
+ const record = data.record || {};
1122
+ const type = JSON.stringify(record) === '{}' ? 'create' : 'edit';
1123
+ const props = extensions[`${type}FormProps`].get(identifier).props;
1124
+ const extraProperties = record[EXTRA_PROPERTIES_KEY] || {};
1125
+ props.forEach(({ value: prop }) => {
1126
+ const name = prop.name;
1127
+ const isExtraProperty = prop.isExtra || name in extraProperties;
1128
+ let value = isExtraProperty ? extraProperties[name] : name in record ? record[name] : undefined;
1129
+ if (typeof value === 'undefined')
1130
+ value = prop.defaultValue;
1131
+ if (value) {
1132
+ let adapter;
1133
+ switch (prop.type) {
1134
+ case "date" /* Date */:
1135
+ adapter = new DateAdapter();
1136
+ value = adapter.toModel(adapter.fromModel(value));
1137
+ break;
1138
+ case "time" /* Time */:
1139
+ adapter = new TimeAdapter();
1140
+ value = adapter.toModel(adapter.fromModel(value));
1141
+ break;
1142
+ case "dateTime" /* DateTime */:
1143
+ adapter = new DateTimeAdapter();
1144
+ value = adapter.toModel(adapter.fromModel(value));
1145
+ break;
1146
+ default:
1147
+ break;
1148
+ }
1149
+ }
1150
+ const formControl = new FormControl(value, {
1151
+ asyncValidators: prop.asyncValidators(data),
1152
+ validators: prop.validators(data),
1153
+ });
1154
+ (isExtraProperty ? extraForm : form).addControl(name, formControl);
1155
+ });
1156
+ return form;
1156
1157
  }
1157
1158
 
1158
- function createExtraPropertyValueResolver(name) {
1159
- return (data) => of(data.record[EXTRA_PROPERTIES_KEY][name]);
1160
- }
1161
- function mergeWithDefaultProps(extension, defaultProps, ...contributors) {
1162
- Object.keys(defaultProps).forEach((name) => {
1163
- const props = extension.get(name);
1164
- props.clearContributors();
1165
- props.addContributor((propList) => propList.addManyTail(defaultProps[name]));
1166
- contributors.forEach(contributor => (contributor[name] || []).forEach((callback) => props.addContributor(callback)));
1167
- });
1159
+ function createExtraPropertyValueResolver(name) {
1160
+ return (data) => of(data.record[EXTRA_PROPERTIES_KEY][name]);
1161
+ }
1162
+ function mergeWithDefaultProps(extension, defaultProps, ...contributors) {
1163
+ Object.keys(defaultProps).forEach((name) => {
1164
+ const props = extension.get(name);
1165
+ props.clearContributors();
1166
+ props.addContributor((propList) => propList.addManyTail(defaultProps[name]));
1167
+ contributors.forEach(contributor => (contributor[name] || []).forEach((callback) => props.addContributor(callback)));
1168
+ });
1168
1169
  }
1169
1170
 
1170
- function createEnum(members) {
1171
- const enumObject = {};
1172
- members.forEach(({ name = '', value }) => {
1173
- enumObject[(enumObject[name] = value)] = name;
1174
- });
1175
- return enumObject;
1176
- }
1177
- function createEnumValueResolver(enumType, lookupEnum, propName) {
1178
- return data => {
1179
- const value = data.record[EXTRA_PROPERTIES_KEY][propName];
1180
- const key = lookupEnum.transformed[value];
1181
- const l10n = data.getInjected(LocalizationService);
1182
- const localizeEnum = createEnumLocalizer(l10n, enumType, lookupEnum);
1183
- return createLocalizationStream(l10n, localizeEnum(key));
1184
- };
1185
- }
1186
- function createEnumOptions(enumType, lookupEnum) {
1187
- return data => {
1188
- const l10n = data.getInjected(LocalizationService);
1189
- const localizeEnum = createEnumLocalizer(l10n, enumType, lookupEnum);
1190
- return createLocalizationStream(l10n, lookupEnum.fields.map(({ name = '', value }) => ({
1191
- key: localizeEnum(name),
1192
- value,
1193
- })));
1194
- };
1195
- }
1196
- function createLocalizationStream(l10n, mapTarget) {
1197
- return merge(of(null), l10n.languageChange$).pipe(map(() => mapTarget));
1198
- }
1199
- function createEnumLocalizer(l10n, enumType, lookupEnum) {
1200
- const resource = lookupEnum.localizationResource;
1201
- const shortType = getShortEnumType(enumType);
1202
- return key => l10n.localizeWithFallbackSync([resource || ''], ['Enum:' + shortType + '.' + key, shortType + '.' + key, key], key);
1203
- }
1204
- function getShortEnumType(enumType) {
1205
- return enumType.split('.').pop();
1171
+ function createEnum(members) {
1172
+ const enumObject = {};
1173
+ members.forEach(({ name = '', value }) => {
1174
+ enumObject[(enumObject[name] = value)] = name;
1175
+ });
1176
+ return enumObject;
1177
+ }
1178
+ function createEnumValueResolver(enumType, lookupEnum, propName) {
1179
+ return data => {
1180
+ const value = data.record[EXTRA_PROPERTIES_KEY][propName];
1181
+ const key = lookupEnum.transformed[value];
1182
+ const l10n = data.getInjected(LocalizationService);
1183
+ const localizeEnum = createEnumLocalizer(l10n, enumType, lookupEnum);
1184
+ return createLocalizationStream(l10n, localizeEnum(key));
1185
+ };
1186
+ }
1187
+ function createEnumOptions(enumType, lookupEnum) {
1188
+ return data => {
1189
+ const l10n = data.getInjected(LocalizationService);
1190
+ const localizeEnum = createEnumLocalizer(l10n, enumType, lookupEnum);
1191
+ return createLocalizationStream(l10n, lookupEnum.fields.map(({ name = '', value }) => ({
1192
+ key: localizeEnum(name),
1193
+ value,
1194
+ })));
1195
+ };
1196
+ }
1197
+ function createLocalizationStream(l10n, mapTarget) {
1198
+ return merge(of(null), l10n.languageChange$).pipe(map(() => mapTarget));
1199
+ }
1200
+ function createEnumLocalizer(l10n, enumType, lookupEnum) {
1201
+ const resource = lookupEnum.localizationResource;
1202
+ const shortType = getShortEnumType(enumType);
1203
+ return key => l10n.localizeWithFallbackSync([resource || ''], ['Enum:' + shortType + '.' + key, shortType + '.' + key, key], key);
1204
+ }
1205
+ function getShortEnumType(enumType) {
1206
+ return enumType.split('.').pop();
1206
1207
  }
1207
1208
 
1208
- function createDisplayNameLocalizationPipeKeyGenerator(localization) {
1209
- const generateLocalizationPipeKey = createLocalizationPipeKeyGenerator(localization);
1210
- return (displayName, fallback) => {
1211
- if (displayName && displayName.name)
1212
- return generateLocalizationPipeKey([displayName.resource || ''], [displayName.name], displayName.name);
1213
- const key = generateLocalizationPipeKey([fallback.resource || ''], ['DisplayName:' + fallback.name], undefined);
1214
- if (key)
1215
- return key;
1216
- return generateLocalizationPipeKey([fallback.resource || ''], [fallback.name || ''], fallback.name);
1217
- };
1209
+ function createDisplayNameLocalizationPipeKeyGenerator(localization) {
1210
+ const generateLocalizationPipeKey = createLocalizationPipeKeyGenerator(localization);
1211
+ return (displayName, fallback) => {
1212
+ if (displayName && displayName.name)
1213
+ return generateLocalizationPipeKey([displayName.resource || ''], [displayName.name], displayName.name);
1214
+ const key = generateLocalizationPipeKey([fallback.resource || ''], ['DisplayName:' + fallback.name], undefined);
1215
+ if (key)
1216
+ return key;
1217
+ return generateLocalizationPipeKey([fallback.resource || ''], [fallback.name || ''], fallback.name);
1218
+ };
1218
1219
  }
1219
1220
 
1220
- function getValidatorsFromProperty(property) {
1221
- const validators = [];
1222
- property.attributes.forEach(attr => {
1223
- if (attr.typeSimple && attr.typeSimple in AbpValidators) {
1224
- validators.push(AbpValidators[attr.typeSimple](attr.config));
1225
- }
1226
- });
1227
- return validators;
1221
+ function getValidatorsFromProperty(property) {
1222
+ const validators = [];
1223
+ property.attributes.forEach(attr => {
1224
+ if (attr.typeSimple && attr.typeSimple in AbpValidators) {
1225
+ validators.push(AbpValidators[attr.typeSimple](attr.config));
1226
+ }
1227
+ });
1228
+ return validators;
1228
1229
  }
1229
1230
 
1230
- function selectObjectExtensions(configState) {
1231
- return configState.getOne$('objectExtensions');
1232
- }
1233
- function selectLocalization(configState) {
1234
- return configState.getOne$('localization');
1235
- }
1236
- function selectEnums(configState) {
1237
- return selectObjectExtensions(configState).pipe(map((extensions) => Object.keys(extensions.enums).reduce((acc, key) => {
1238
- const { fields, localizationResource } = extensions.enums[key];
1239
- acc[key] = {
1240
- fields,
1241
- localizationResource,
1242
- transformed: createEnum(fields),
1243
- };
1244
- return acc;
1245
- }, {})));
1246
- }
1247
- function getObjectExtensionEntitiesFromStore(configState, moduleKey) {
1248
- return selectObjectExtensions(configState).pipe(map(extensions => {
1249
- if (!extensions)
1250
- return null;
1251
- return (extensions.modules[moduleKey] || {})
1252
- .entities;
1253
- }), map(entities => (isUndefined(entities) ? {} : entities)), filter(Boolean), take(1));
1254
- }
1255
- function mapEntitiesToContributors(configState, resource) {
1256
- return pipe(switchMap((entities) => zip(selectLocalization(configState), selectEnums(configState)).pipe(map(([localization, enums]) => {
1257
- const generateDisplayName = createDisplayNameLocalizationPipeKeyGenerator(localization);
1258
- return Object.keys(entities).reduce((acc, key) => {
1259
- acc.prop[key] = [];
1260
- acc.createForm[key] = [];
1261
- acc.editForm[key] = [];
1262
- const entity = entities[key];
1263
- if (!entity)
1264
- return acc;
1265
- const properties = entity.properties;
1266
- if (!properties)
1267
- return acc;
1268
- const mapPropertiesToContributors = createPropertiesToContributorsMapper(generateDisplayName, resource, enums);
1269
- return mapPropertiesToContributors(properties, acc, key);
1270
- }, {
1271
- prop: {},
1272
- createForm: {},
1273
- editForm: {},
1274
- });
1275
- }))), take(1));
1276
- }
1277
- function createPropertiesToContributorsMapper(generateDisplayName, resource, enums) {
1278
- return (properties, contributors, key) => {
1279
- const isExtra = true;
1280
- const generateTypeaheadDisplayName = createTypeaheadDisplayNameGenerator(generateDisplayName, properties);
1281
- Object.keys(properties).forEach((name) => {
1282
- const property = properties[name];
1283
- const propName = name;
1284
- const lookup = property.ui.lookup || {};
1285
- const type = getTypeaheadType(lookup, name) || getTypeFromProperty(property);
1286
- const generateDN = hasTypeaheadTextSuffix(name)
1287
- ? generateTypeaheadDisplayName
1288
- : generateDisplayName;
1289
- const displayName = generateDN(property.displayName, { name, resource });
1290
- if (property.ui.onTable.isVisible) {
1291
- const sortable = Boolean(property.ui.onTable.isSortable);
1292
- const columnWidth = type === "boolean" /* Boolean */ ? 150 : 250;
1293
- const valueResolver = type === "enum" /* Enum */
1294
- ? createEnumValueResolver(property.type, enums[property.type], propName)
1295
- : createExtraPropertyValueResolver(propName);
1296
- const entityProp = new EntityProp({
1297
- type,
1298
- name: propName,
1299
- displayName,
1300
- sortable,
1301
- columnWidth,
1302
- valueResolver,
1303
- isExtra,
1304
- });
1305
- const contributor = (propList) => propList.addTail(entityProp);
1306
- contributors.prop[key].push(contributor);
1307
- }
1308
- const isOnCreateForm = property.ui.onCreateForm.isVisible;
1309
- const isOnEditForm = property.ui.onEditForm.isVisible;
1310
- if (isOnCreateForm || isOnEditForm) {
1311
- const defaultValue = property.defaultValue;
1312
- const validators = () => getValidatorsFromProperty(property);
1313
- let options;
1314
- if (type === "enum" /* Enum */)
1315
- options = createEnumOptions(propName, enums[property.type || '']);
1316
- else if (type === "typeahead" /* Typeahead */)
1317
- options = createTypeaheadOptions(lookup);
1318
- const formProp = new FormProp({
1319
- type,
1320
- name: propName,
1321
- displayName,
1322
- options,
1323
- defaultValue,
1324
- validators,
1325
- isExtra,
1326
- });
1327
- const formContributor = (propList) => propList.addTail(formProp);
1328
- if (isOnCreateForm)
1329
- contributors.createForm[key].push(formContributor);
1330
- if (isOnEditForm)
1331
- contributors.editForm[key].push(formContributor);
1332
- }
1333
- });
1334
- return contributors;
1335
- };
1336
- }
1337
- function getTypeFromProperty(property) {
1338
- var _a;
1339
- return (_a = property === null || property === void 0 ? void 0 : property.typeSimple) === null || _a === void 0 ? void 0 : _a.replace(/\?$/, '');
1340
- }
1341
- function isUndefined(obj) {
1342
- return typeof obj === 'undefined';
1231
+ function selectObjectExtensions(configState) {
1232
+ return configState.getOne$('objectExtensions');
1233
+ }
1234
+ function selectLocalization(configState) {
1235
+ return configState.getOne$('localization');
1236
+ }
1237
+ function selectEnums(configState) {
1238
+ return selectObjectExtensions(configState).pipe(map((extensions) => Object.keys(extensions.enums).reduce((acc, key) => {
1239
+ const { fields, localizationResource } = extensions.enums[key];
1240
+ acc[key] = {
1241
+ fields,
1242
+ localizationResource,
1243
+ transformed: createEnum(fields),
1244
+ };
1245
+ return acc;
1246
+ }, {})));
1247
+ }
1248
+ function getObjectExtensionEntitiesFromStore(configState, moduleKey) {
1249
+ return selectObjectExtensions(configState).pipe(map(extensions => {
1250
+ if (!extensions)
1251
+ return null;
1252
+ return (extensions.modules[moduleKey] || {})
1253
+ .entities;
1254
+ }), map(entities => (isUndefined(entities) ? {} : entities)), filter(Boolean), take(1));
1255
+ }
1256
+ function mapEntitiesToContributors(configState, resource) {
1257
+ return pipe(switchMap((entities) => zip(selectLocalization(configState), selectEnums(configState)).pipe(map(([localization, enums]) => {
1258
+ const generateDisplayName = createDisplayNameLocalizationPipeKeyGenerator(localization);
1259
+ return Object.keys(entities).reduce((acc, key) => {
1260
+ acc.prop[key] = [];
1261
+ acc.createForm[key] = [];
1262
+ acc.editForm[key] = [];
1263
+ const entity = entities[key];
1264
+ if (!entity)
1265
+ return acc;
1266
+ const properties = entity.properties;
1267
+ if (!properties)
1268
+ return acc;
1269
+ const mapPropertiesToContributors = createPropertiesToContributorsMapper(generateDisplayName, resource, enums);
1270
+ return mapPropertiesToContributors(properties, acc, key);
1271
+ }, {
1272
+ prop: {},
1273
+ createForm: {},
1274
+ editForm: {},
1275
+ });
1276
+ }))), take(1));
1277
+ }
1278
+ function createPropertiesToContributorsMapper(generateDisplayName, resource, enums) {
1279
+ return (properties, contributors, key) => {
1280
+ const isExtra = true;
1281
+ const generateTypeaheadDisplayName = createTypeaheadDisplayNameGenerator(generateDisplayName, properties);
1282
+ Object.keys(properties).forEach((name) => {
1283
+ const property = properties[name];
1284
+ const propName = name;
1285
+ const lookup = property.ui.lookup || {};
1286
+ const type = getTypeaheadType(lookup, name) || getTypeFromProperty(property);
1287
+ const generateDN = hasTypeaheadTextSuffix(name)
1288
+ ? generateTypeaheadDisplayName
1289
+ : generateDisplayName;
1290
+ const displayName = generateDN(property.displayName, { name, resource });
1291
+ if (property.ui.onTable.isVisible) {
1292
+ const sortable = Boolean(property.ui.onTable.isSortable);
1293
+ const columnWidth = type === "boolean" /* Boolean */ ? 150 : 250;
1294
+ const valueResolver = type === "enum" /* Enum */
1295
+ ? createEnumValueResolver(property.type, enums[property.type], propName)
1296
+ : createExtraPropertyValueResolver(propName);
1297
+ const entityProp = new EntityProp({
1298
+ type,
1299
+ name: propName,
1300
+ displayName,
1301
+ sortable,
1302
+ columnWidth,
1303
+ valueResolver,
1304
+ isExtra,
1305
+ });
1306
+ const contributor = (propList) => propList.addTail(entityProp);
1307
+ contributors.prop[key].push(contributor);
1308
+ }
1309
+ const isOnCreateForm = property.ui.onCreateForm.isVisible;
1310
+ const isOnEditForm = property.ui.onEditForm.isVisible;
1311
+ if (isOnCreateForm || isOnEditForm) {
1312
+ const defaultValue = property.defaultValue;
1313
+ const validators = () => getValidatorsFromProperty(property);
1314
+ let options;
1315
+ if (type === "enum" /* Enum */)
1316
+ options = createEnumOptions(propName, enums[property.type || '']);
1317
+ else if (type === "typeahead" /* Typeahead */)
1318
+ options = createTypeaheadOptions(lookup);
1319
+ const formProp = new FormProp({
1320
+ type,
1321
+ name: propName,
1322
+ displayName,
1323
+ options,
1324
+ defaultValue,
1325
+ validators,
1326
+ isExtra,
1327
+ });
1328
+ const formContributor = (propList) => propList.addTail(formProp);
1329
+ if (isOnCreateForm)
1330
+ contributors.createForm[key].push(formContributor);
1331
+ if (isOnEditForm)
1332
+ contributors.editForm[key].push(formContributor);
1333
+ }
1334
+ });
1335
+ return contributors;
1336
+ };
1337
+ }
1338
+ function getTypeFromProperty(property) {
1339
+ var _a;
1340
+ return (_a = property === null || property === void 0 ? void 0 : property.typeSimple) === null || _a === void 0 ? void 0 : _a.replace(/\?$/, '');
1341
+ }
1342
+ function isUndefined(obj) {
1343
+ return typeof obj === 'undefined';
1343
1344
  }
1344
1345
 
1345
- /**
1346
- * Generated bundle index. Do not edit.
1346
+ /**
1347
+ * Generated bundle index. Do not edit.
1347
1348
  */
1348
1349
 
1349
1350
  export { ActionList, BaseUiExtensionsModule, CreateFormPropsFactory, DateAdapter, DateTimeAdapter, DateTimePickerComponent, DisabledDirective, EXTENSIONS_ACTION_CALLBACK, EXTENSIONS_ACTION_DATA, EXTENSIONS_ACTION_TYPE, EXTENSIONS_IDENTIFIER, EXTRA_PROPERTIES_KEY, EditFormPropsFactory, EntityAction, EntityActionList, EntityActions, EntityActionsFactory, EntityProp, EntityPropList, EntityProps, EntityPropsFactory, ExtensibleFormComponent, ExtensibleFormPropComponent, ExtensibleTableComponent, ExtensionsService, FormProp, FormPropData, FormPropList, FormProps, GridActionsComponent, objectExtensions as ObjectExtensions, PROP_DATA_STREAM, PageToolbarComponent, PropDataDirective, PropList, TimeAdapter, ToolbarAction, ToolbarActionList, ToolbarActions, ToolbarActionsFactory, ToolbarComponent, UiExtensionsModule, createExtraPropertyValueResolver, generateFormFromProps, getObjectExtensionEntitiesFromStore, mapEntitiesToContributors, mergeWithDefaultActions, mergeWithDefaultProps };