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