@cccteam/ccc-lib 0.0.24 → 0.0.25
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.
- package/fesm2022/cccteam-ccc-lib-auth-forms.mjs +13 -13
- package/fesm2022/cccteam-ccc-lib-auth-forms.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib-auth-has-permission.mjs +4 -4
- package/fesm2022/cccteam-ccc-lib-auth-has-permission.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib-auth-service.mjs +15 -8
- package/fesm2022/cccteam-ccc-lib-auth-service.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib-ccc-camel-case-to-title.mjs +3 -3
- package/fesm2022/cccteam-ccc-lib-ccc-grid.mjs +20 -20
- package/fesm2022/cccteam-ccc-lib-ccc-grid.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib-ccc-resource-modals.mjs +3 -3
- package/fesm2022/cccteam-ccc-lib-ccc-resource-services.mjs +5 -5
- package/fesm2022/cccteam-ccc-lib-ccc-resource-services.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib-ccc-resource.mjs +287 -281
- package/fesm2022/cccteam-ccc-lib-ccc-resource.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib-types.mjs +70 -18
- package/fesm2022/cccteam-ccc-lib-types.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib-ui-alert.mjs +3 -3
- package/fesm2022/cccteam-ccc-lib-ui-core-service.mjs +7 -7
- package/fesm2022/cccteam-ccc-lib-ui-core-service.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib-ui-idle-service.mjs +18 -11
- package/fesm2022/cccteam-ccc-lib-ui-idle-service.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib-ui-interceptor.mjs +3 -3
- package/fesm2022/cccteam-ccc-lib-ui-notification-service.mjs +5 -5
- package/fesm2022/cccteam-ccc-lib-ui-notification-service.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib-ui-sidenav.mjs +4 -4
- package/fesm2022/cccteam-ccc-lib-ui-sidenav.mjs.map +1 -1
- package/package.json +1 -1
- package/types/cccteam-ccc-lib-auth-service.d.ts +2 -1
- package/types/cccteam-ccc-lib-forms.d.ts +1 -1
- package/types/cccteam-ccc-lib-types.d.ts +45 -1
- package/types/cccteam-ccc-lib-ui-idle-service.d.ts +2 -1
|
@@ -45,7 +45,7 @@ import { cleanStringForm, sparseFormData } from '@cccteam/ccc-lib/forms';
|
|
|
45
45
|
import { AppGridComponent } from '@cccteam/ccc-lib/ccc-grid';
|
|
46
46
|
|
|
47
47
|
class ActionAccessControlWrapperComponent {
|
|
48
|
-
actionContext = input(
|
|
48
|
+
actionContext = input(...(ngDevMode ? [undefined, { debugName: "actionContext" }] : []));
|
|
49
49
|
showAction = computed(() => {
|
|
50
50
|
const context = this.actionContext();
|
|
51
51
|
let isActionPermittedForUser = true;
|
|
@@ -79,13 +79,13 @@ class ActionAccessControlWrapperComponent {
|
|
|
79
79
|
console.error(e);
|
|
80
80
|
}
|
|
81
81
|
return showAction;
|
|
82
|
-
},
|
|
83
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
84
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
82
|
+
}, ...(ngDevMode ? [{ debugName: "showAction" }] : []));
|
|
83
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ActionAccessControlWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
84
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ActionAccessControlWrapperComponent, isStandalone: true, selector: "action-access-control-wrapper", inputs: { actionContext: { classPropertyName: "actionContext", publicName: "actionContext", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `@if (showAction()) {
|
|
85
85
|
<ng-content />
|
|
86
86
|
}`, isInline: true, styles: [":host{margin-top:auto;margin-bottom:auto}\n"] });
|
|
87
87
|
}
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ActionAccessControlWrapperComponent, decorators: [{
|
|
89
89
|
type: Component,
|
|
90
90
|
args: [{ selector: 'action-access-control-wrapper', template: `@if (showAction()) {
|
|
91
91
|
<ng-content />
|
|
@@ -191,17 +191,17 @@ const resourceValidators = Object.freeze({
|
|
|
191
191
|
});
|
|
192
192
|
|
|
193
193
|
class PaddingElementComponent {
|
|
194
|
-
paddingElement = input.required(
|
|
194
|
+
paddingElement = input.required(...(ngDevMode ? [{ debugName: "paddingElement" }] : []));
|
|
195
195
|
class = 'col-6';
|
|
196
196
|
ngOnInit() {
|
|
197
197
|
if (this.paddingElement().cols) {
|
|
198
198
|
this.class = 'col-' + this.paddingElement()?.cols;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
202
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
201
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: PaddingElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
202
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.1", type: PaddingElementComponent, isStandalone: true, selector: "ccc-padding-element", inputs: { paddingElement: { classPropertyName: "paddingElement", publicName: "paddingElement", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<div class=\"padding-container\"></div>\n", styles: [".padding-container{height:52px}\n"] });
|
|
203
203
|
}
|
|
204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: PaddingElementComponent, decorators: [{
|
|
205
205
|
type: Component,
|
|
206
206
|
args: [{ selector: 'ccc-padding-element', imports: [], template: "<div class=\"padding-container\"></div>\n", styles: [".padding-container{height:52px}\n"] }]
|
|
207
207
|
}], propDecorators: { paddingElement: [{ type: i0.Input, args: [{ isSignal: true, alias: "paddingElement", required: true }] }], class: [{
|
|
@@ -210,9 +210,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
210
210
|
}] } });
|
|
211
211
|
|
|
212
212
|
class ComputedFieldComponent {
|
|
213
|
-
fieldConfig = input.required(
|
|
214
|
-
fieldClass = input(
|
|
215
|
-
formDataState = input(
|
|
213
|
+
fieldConfig = input.required(...(ngDevMode ? [{ debugName: "fieldConfig" }] : []));
|
|
214
|
+
fieldClass = input(...(ngDevMode ? [undefined, { debugName: "fieldClass" }] : []));
|
|
215
|
+
formDataState = input(...(ngDevMode ? [undefined, { debugName: "formDataState" }] : []));
|
|
216
216
|
computedValue = computed(() => {
|
|
217
217
|
try {
|
|
218
218
|
return this.fieldConfig().calculatedValue(this.formDataState());
|
|
@@ -222,7 +222,7 @@ class ComputedFieldComponent {
|
|
|
222
222
|
console.error(e);
|
|
223
223
|
return '';
|
|
224
224
|
}
|
|
225
|
-
},
|
|
225
|
+
}, ...(ngDevMode ? [{ debugName: "computedValue" }] : []));
|
|
226
226
|
showField = computed(() => {
|
|
227
227
|
const shouldRender = this.fieldConfig().shouldRender;
|
|
228
228
|
if (typeof shouldRender === 'boolean') {
|
|
@@ -236,17 +236,17 @@ class ComputedFieldComponent {
|
|
|
236
236
|
console.error(e);
|
|
237
237
|
return true;
|
|
238
238
|
}
|
|
239
|
-
},
|
|
239
|
+
}, ...(ngDevMode ? [{ debugName: "showField" }] : []));
|
|
240
240
|
class = '';
|
|
241
241
|
constructor() {
|
|
242
242
|
effect(() => {
|
|
243
243
|
this.class = this.showField() ? 'col-' + this.fieldConfig()?.cols : 'hidden-field';
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
247
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
246
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ComputedFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
247
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ComputedFieldComponent, isStandalone: true, selector: "ccc-computed-field", inputs: { fieldConfig: { classPropertyName: "fieldConfig", publicName: "fieldConfig", isSignal: true, isRequired: true, transformFunction: null }, fieldClass: { classPropertyName: "fieldClass", publicName: "fieldClass", isSignal: true, isRequired: false, transformFunction: null }, formDataState: { classPropertyName: "formDataState", publicName: "formDataState", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "@if (showField()) {\n <div class=\"readonly-field\">\n <mat-form-field class=\"field {{ fieldClass() }}\" [subscriptSizing]=\"'dynamic'\">\n <mat-label>{{ fieldConfig().label }}</mat-label>\n <input\n matInput\n (keydown.enter)=\"$event.preventDefault()\"\n [readonly]=\"true\"\n type=\"text\"\n [value]=\"computedValue()\" />\n </mat-form-field>\n </div>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] });
|
|
248
248
|
}
|
|
249
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ComputedFieldComponent, decorators: [{
|
|
250
250
|
type: Component,
|
|
251
251
|
args: [{ selector: 'ccc-computed-field', imports: [MatFormFieldModule, MatButtonModule, MatInputModule], template: "@if (showField()) {\n <div class=\"readonly-field\">\n <mat-form-field class=\"field {{ fieldClass() }}\" [subscriptSizing]=\"'dynamic'\">\n <mat-label>{{ fieldConfig().label }}</mat-label>\n <input\n matInput\n (keydown.enter)=\"$event.preventDefault()\"\n [readonly]=\"true\"\n type=\"text\"\n [value]=\"computedValue()\" />\n </mat-form-field>\n </div>\n}\n" }]
|
|
252
252
|
}], ctorParameters: () => [], propDecorators: { fieldConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldConfig", required: true }] }], fieldClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldClass", required: false }] }], formDataState: [{ type: i0.Input, args: [{ isSignal: true, alias: "formDataState", required: false }] }], class: [{
|
|
@@ -255,57 +255,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
255
255
|
}] } });
|
|
256
256
|
|
|
257
257
|
class EmptyReadonlyFieldComponent {
|
|
258
|
-
label = input.required(
|
|
258
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
259
259
|
displayValue = defaultEmptyFieldValue;
|
|
260
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
261
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
260
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: EmptyReadonlyFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
261
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.1", type: EmptyReadonlyFieldComponent, isStandalone: true, selector: "ccc-empty-readonly-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"readonly-field\">\n <mat-form-field class=\"field\" [subscriptSizing]=\"'dynamic'\">\n <mat-label>{{ label() }}</mat-label>\n <input\n matInput\n (keydown.enter)=\"$event.preventDefault()\"\n [readonly]=\"true\"\n type=\"text\"\n [value]=\"displayValue\"\n id=\"{{ label() }}-readonly-input-text\" />\n </mat-form-field>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] });
|
|
262
262
|
}
|
|
263
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
263
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: EmptyReadonlyFieldComponent, decorators: [{
|
|
264
264
|
type: Component,
|
|
265
265
|
args: [{ selector: 'ccc-empty-readonly-field', imports: [MatFormFieldModule, MatButtonModule, MatInputModule], template: "<div class=\"readonly-field\">\n <mat-form-field class=\"field\" [subscriptSizing]=\"'dynamic'\">\n <mat-label>{{ label() }}</mat-label>\n <input\n matInput\n (keydown.enter)=\"$event.preventDefault()\"\n [readonly]=\"true\"\n type=\"text\"\n [value]=\"displayValue\"\n id=\"{{ label() }}-readonly-input-text\" />\n </mat-form-field>\n</div>\n" }]
|
|
266
266
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }] } });
|
|
267
267
|
|
|
268
268
|
class ResourceStore {
|
|
269
|
-
resourceMeta = signal({},
|
|
270
|
-
resourceName = signal('',
|
|
271
|
-
filter = signal('',
|
|
272
|
-
disableCacheForFilterPii = signal(false,
|
|
273
|
-
searchTokens = signal('',
|
|
274
|
-
sorts = signal([],
|
|
275
|
-
listColumns = signal([],
|
|
276
|
-
requireSearchToDisplayResults = signal(false,
|
|
277
|
-
uuid = signal('',
|
|
278
|
-
error = signal('',
|
|
269
|
+
resourceMeta = signal({}, ...(ngDevMode ? [{ debugName: "resourceMeta" }] : []));
|
|
270
|
+
resourceName = signal('', ...(ngDevMode ? [{ debugName: "resourceName" }] : []));
|
|
271
|
+
filter = signal('', ...(ngDevMode ? [{ debugName: "filter" }] : []));
|
|
272
|
+
disableCacheForFilterPii = signal(false, ...(ngDevMode ? [{ debugName: "disableCacheForFilterPii" }] : []));
|
|
273
|
+
searchTokens = signal('', ...(ngDevMode ? [{ debugName: "searchTokens" }] : []));
|
|
274
|
+
sorts = signal([], ...(ngDevMode ? [{ debugName: "sorts" }] : []));
|
|
275
|
+
listColumns = signal([], ...(ngDevMode ? [{ debugName: "listColumns" }] : []));
|
|
276
|
+
requireSearchToDisplayResults = signal(false, ...(ngDevMode ? [{ debugName: "requireSearchToDisplayResults" }] : []));
|
|
277
|
+
uuid = signal('', ...(ngDevMode ? [{ debugName: "uuid" }] : []));
|
|
278
|
+
error = signal('', ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
279
279
|
notifications = inject(NotificationService);
|
|
280
280
|
http = inject(HttpClient);
|
|
281
281
|
router = inject(Router);
|
|
282
282
|
injector = inject(Injector);
|
|
283
283
|
apiUrl = inject(API_URL);
|
|
284
284
|
methodMeta = inject(METHOD_META);
|
|
285
|
-
resourceListRef = signal(undefined,
|
|
285
|
+
resourceListRef = signal(undefined, ...(ngDevMode ? [{ debugName: "resourceListRef" }] : []));
|
|
286
286
|
listData = computed(() => {
|
|
287
287
|
const ref = this.resourceListRef();
|
|
288
288
|
if (ref && ref.status() === 'resolved') {
|
|
289
289
|
return ref.value();
|
|
290
290
|
}
|
|
291
291
|
return [];
|
|
292
|
-
},
|
|
292
|
+
}, ...(ngDevMode ? [{ debugName: "listData" }] : []));
|
|
293
293
|
listStatus = computed(() => {
|
|
294
294
|
return this.resourceListRef()?.status();
|
|
295
|
-
},
|
|
296
|
-
resourceViewRef = signal(undefined,
|
|
295
|
+
}, ...(ngDevMode ? [{ debugName: "listStatus" }] : []));
|
|
296
|
+
resourceViewRef = signal(undefined, ...(ngDevMode ? [{ debugName: "resourceViewRef" }] : []));
|
|
297
297
|
viewData = computed(() => {
|
|
298
298
|
const ref = this.resourceViewRef();
|
|
299
299
|
if (ref && ref.status() === 'resolved') {
|
|
300
300
|
return ref.value();
|
|
301
301
|
}
|
|
302
302
|
return {};
|
|
303
|
-
},
|
|
303
|
+
}, ...(ngDevMode ? [{ debugName: "viewData" }] : []));
|
|
304
304
|
viewStatus = computed(() => {
|
|
305
305
|
return this.resourceViewRef()?.status();
|
|
306
|
-
},
|
|
307
|
-
overrideRoute = signal('',
|
|
308
|
-
resourceRoute = computed(() => this.resourceMeta()?.route,
|
|
306
|
+
}, ...(ngDevMode ? [{ debugName: "viewStatus" }] : []));
|
|
307
|
+
overrideRoute = signal('', ...(ngDevMode ? [{ debugName: "overrideRoute" }] : []));
|
|
308
|
+
resourceRoute = computed(() => this.resourceMeta()?.route, ...(ngDevMode ? [{ debugName: "resourceRoute" }] : []));
|
|
309
309
|
route = computed(() => {
|
|
310
310
|
if (this.overrideRoute()) {
|
|
311
311
|
return this.overrideRoute();
|
|
@@ -315,7 +315,7 @@ class ResourceStore {
|
|
|
315
315
|
return route;
|
|
316
316
|
}
|
|
317
317
|
return '';
|
|
318
|
-
},
|
|
318
|
+
}, ...(ngDevMode ? [{ debugName: "route" }] : []));
|
|
319
319
|
reloadViewData() {
|
|
320
320
|
this.resourceViewRef()?.reload();
|
|
321
321
|
}
|
|
@@ -335,7 +335,7 @@ class ResourceStore {
|
|
|
335
335
|
if (resourceMeta && resourceMeta.fields.some((field) => field.fieldName === 'id')) {
|
|
336
336
|
columnIds.push('id');
|
|
337
337
|
}
|
|
338
|
-
const uniqueColumns = signal([...new Set([...columnIds])],
|
|
338
|
+
const uniqueColumns = signal([...new Set([...columnIds])], ...(ngDevMode ? [{ debugName: "uniqueColumns" }] : []));
|
|
339
339
|
const ref = this.resourceList(this.route, this.filter, uniqueColumns, this.disableCacheForFilterPii, this.searchTokens, this.sorts);
|
|
340
340
|
this.resourceListRef.set(ref);
|
|
341
341
|
this.reloadListData();
|
|
@@ -457,10 +457,10 @@ class ResourceStore {
|
|
|
457
457
|
}
|
|
458
458
|
}));
|
|
459
459
|
}
|
|
460
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
461
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.
|
|
460
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
461
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceStore });
|
|
462
462
|
}
|
|
463
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
463
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceStore, decorators: [{
|
|
464
464
|
type: Injectable
|
|
465
465
|
}] });
|
|
466
466
|
|
|
@@ -536,15 +536,15 @@ class BaseInputComponent {
|
|
|
536
536
|
resourceMeta = inject(RESOURCE_META);
|
|
537
537
|
injector = inject(Injector);
|
|
538
538
|
store = inject(ResourceStore);
|
|
539
|
-
meta = input.required(
|
|
540
|
-
pristineValue = input(
|
|
541
|
-
editMode = input.required(
|
|
542
|
-
showField = input(
|
|
543
|
-
fieldConfig = input.required(
|
|
544
|
-
fieldClass = input(
|
|
545
|
-
fieldMeta = input.required(
|
|
546
|
-
form = input.required(
|
|
547
|
-
relatedData = input(
|
|
539
|
+
meta = input.required(...(ngDevMode ? [{ debugName: "meta" }] : []));
|
|
540
|
+
pristineValue = input(...(ngDevMode ? [undefined, { debugName: "pristineValue" }] : []));
|
|
541
|
+
editMode = input.required(...(ngDevMode ? [{ debugName: "editMode" }] : []));
|
|
542
|
+
showField = input(...(ngDevMode ? [undefined, { debugName: "showField" }] : []));
|
|
543
|
+
fieldConfig = input.required(...(ngDevMode ? [{ debugName: "fieldConfig" }] : []));
|
|
544
|
+
fieldClass = input(...(ngDevMode ? [undefined, { debugName: "fieldClass" }] : []));
|
|
545
|
+
fieldMeta = input.required(...(ngDevMode ? [{ debugName: "fieldMeta" }] : []));
|
|
546
|
+
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
547
|
+
relatedData = input(...(ngDevMode ? [undefined, { debugName: "relatedData" }] : []));
|
|
548
548
|
/**
|
|
549
549
|
* Resets the field back to its pristine value.
|
|
550
550
|
*/
|
|
@@ -591,7 +591,7 @@ class BaseInputComponent {
|
|
|
591
591
|
}
|
|
592
592
|
});
|
|
593
593
|
return builtPrefix;
|
|
594
|
-
},
|
|
594
|
+
}, ...(ngDevMode ? [{ debugName: "prefixString" }] : []));
|
|
595
595
|
suffixString = computed(() => {
|
|
596
596
|
const relatedData = this.relatedData();
|
|
597
597
|
let builtSuffix = '';
|
|
@@ -627,7 +627,7 @@ class BaseInputComponent {
|
|
|
627
627
|
}
|
|
628
628
|
});
|
|
629
629
|
return builtSuffix;
|
|
630
|
-
},
|
|
630
|
+
}, ...(ngDevMode ? [{ debugName: "suffixString" }] : []));
|
|
631
631
|
floatLabel = computed(() => {
|
|
632
632
|
if (this.fieldConfig().prefixes.length > 0 || this.fieldConfig().suffixes.length > 0) {
|
|
633
633
|
return 'always';
|
|
@@ -635,28 +635,28 @@ class BaseInputComponent {
|
|
|
635
635
|
else {
|
|
636
636
|
return 'auto';
|
|
637
637
|
}
|
|
638
|
-
},
|
|
639
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
640
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
638
|
+
}, ...(ngDevMode ? [{ debugName: "floatLabel" }] : []));
|
|
639
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: BaseInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
640
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: BaseInputComponent, isStandalone: true, inputs: { meta: { classPropertyName: "meta", publicName: "meta", isSignal: true, isRequired: true, transformFunction: null }, pristineValue: { classPropertyName: "pristineValue", publicName: "pristineValue", isSignal: true, isRequired: false, transformFunction: null }, editMode: { classPropertyName: "editMode", publicName: "editMode", isSignal: true, isRequired: true, transformFunction: null }, showField: { classPropertyName: "showField", publicName: "showField", isSignal: true, isRequired: false, transformFunction: null }, fieldConfig: { classPropertyName: "fieldConfig", publicName: "fieldConfig", isSignal: true, isRequired: true, transformFunction: null }, fieldClass: { classPropertyName: "fieldClass", publicName: "fieldClass", isSignal: true, isRequired: false, transformFunction: null }, fieldMeta: { classPropertyName: "fieldMeta", publicName: "fieldMeta", isSignal: true, isRequired: true, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, relatedData: { classPropertyName: "relatedData", publicName: "relatedData", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
641
641
|
}
|
|
642
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
642
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: BaseInputComponent, decorators: [{
|
|
643
643
|
type: Directive
|
|
644
644
|
}], propDecorators: { meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: true }] }], pristineValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "pristineValue", required: false }] }], editMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "editMode", required: true }] }], showField: [{ type: i0.Input, args: [{ isSignal: true, alias: "showField", required: false }] }], fieldConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldConfig", required: true }] }], fieldClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldClass", required: false }] }], fieldMeta: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldMeta", required: true }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], relatedData: [{ type: i0.Input, args: [{ isSignal: true, alias: "relatedData", required: false }] }] } });
|
|
645
645
|
|
|
646
646
|
class BooleanFieldComponent extends BaseInputComponent {
|
|
647
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
648
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
647
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: BooleanFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
648
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: BooleanFieldComponent, isStandalone: true, selector: "ccc-boolean-field", usesInheritance: true, ngImport: i0, template: "@if (showField()) {\n <ng-container [formGroup]=\"form()\">\n <div [class.readonly-field]=\"editMode() === 'view'\">\n <mat-checkbox\n class=\"field checkbox {{ fieldClass() }}\"\n [formControlName]=\"fieldConfig().name\"\n (keydown.enter)=\"$event.preventDefault()\">\n {{ fieldConfig().label }}\n </mat-checkbox>\n </div>\n </ng-container>\n} @else {\n <ng-container [formGroup]=\"form()\">\n <input type=\"hidden\" [formControlName]=\"fieldConfig().name\" />\n </ng-container>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }] });
|
|
649
649
|
}
|
|
650
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
650
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: BooleanFieldComponent, decorators: [{
|
|
651
651
|
type: Component,
|
|
652
652
|
args: [{ selector: 'ccc-boolean-field', imports: [MatFormFieldModule, MatInputModule, MatDatepickerModule, ReactiveFormsModule, MatCheckboxModule], template: "@if (showField()) {\n <ng-container [formGroup]=\"form()\">\n <div [class.readonly-field]=\"editMode() === 'view'\">\n <mat-checkbox\n class=\"field checkbox {{ fieldClass() }}\"\n [formControlName]=\"fieldConfig().name\"\n (keydown.enter)=\"$event.preventDefault()\">\n {{ fieldConfig().label }}\n </mat-checkbox>\n </div>\n </ng-container>\n} @else {\n <ng-container [formGroup]=\"form()\">\n <input type=\"hidden\" [formControlName]=\"fieldConfig().name\" />\n </ng-container>\n}\n" }]
|
|
653
653
|
}] });
|
|
654
654
|
|
|
655
655
|
class DateFieldComponent extends BaseInputComponent {
|
|
656
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
657
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
656
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: DateFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
657
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: DateFieldComponent, isStandalone: true, selector: "ccc-date-field", usesInheritance: true, ngImport: i0, template: "@if (showField()) {\n <div [class.readonly-field]=\"editMode() === 'view'\">\n <mat-form-field class=\"field {{ fieldClass() }}\" [formGroup]=\"form()\" [subscriptSizing]=\"'dynamic'\">\n <mat-label>{{ fieldConfig().label }}</mat-label>\n <input\n matInput\n [readonly]=\"editMode() === 'view'\"\n [matDatepicker]=\"picker\"\n type=\"text\"\n (keydown.enter)=\"$event.preventDefault()\"\n [formControlName]=\"fieldConfig().name\" />\n @if (editMode() === 'edit') {\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n }\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n </div>\n} @else {\n <ng-container [formGroup]=\"form()\">\n <input type=\"hidden\" [formControlName]=\"fieldConfig().name\" />\n </ng-container>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i3$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i3$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
658
658
|
}
|
|
659
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
659
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: DateFieldComponent, decorators: [{
|
|
660
660
|
type: Component,
|
|
661
661
|
args: [{ selector: 'ccc-date-field', imports: [MatFormFieldModule, MatInputModule, MatDatepickerModule, ReactiveFormsModule], template: "@if (showField()) {\n <div [class.readonly-field]=\"editMode() === 'view'\">\n <mat-form-field class=\"field {{ fieldClass() }}\" [formGroup]=\"form()\" [subscriptSizing]=\"'dynamic'\">\n <mat-label>{{ fieldConfig().label }}</mat-label>\n <input\n matInput\n [readonly]=\"editMode() === 'view'\"\n [matDatepicker]=\"picker\"\n type=\"text\"\n (keydown.enter)=\"$event.preventDefault()\"\n [formControlName]=\"fieldConfig().name\" />\n @if (editMode() === 'edit') {\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n }\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n </div>\n} @else {\n <ng-container [formGroup]=\"form()\">\n <input type=\"hidden\" [formControlName]=\"fieldConfig().name\" />\n </ng-container>\n}\n" }]
|
|
662
662
|
}] });
|
|
@@ -837,28 +837,28 @@ function camelCase(str) {
|
|
|
837
837
|
class EnumeratedFieldComponent extends BaseInputComponent {
|
|
838
838
|
activatedRoute = inject(ActivatedRoute);
|
|
839
839
|
router = inject(Router);
|
|
840
|
-
reloadSignal = signal(false,
|
|
841
|
-
query = signal('',
|
|
840
|
+
reloadSignal = signal(false, ...(ngDevMode ? [{ debugName: "reloadSignal" }] : []));
|
|
841
|
+
query = signal('', ...(ngDevMode ? [{ debugName: "query" }] : []));
|
|
842
842
|
resource = computed(() => {
|
|
843
843
|
if (this.fieldConfig()?.enumeratedConfig?.overrideResource) {
|
|
844
844
|
return this.fieldConfig()?.enumeratedConfig?.overrideResource;
|
|
845
845
|
}
|
|
846
846
|
return this.fieldMeta()?.enumeratedResource;
|
|
847
|
-
},
|
|
847
|
+
}, ...(ngDevMode ? [{ debugName: "resource" }] : []));
|
|
848
848
|
tooltipMessage = computed(() => {
|
|
849
849
|
const label = this.fieldConfig().label;
|
|
850
850
|
return 'View ' + label + ' details';
|
|
851
|
-
},
|
|
851
|
+
}, ...(ngDevMode ? [{ debugName: "tooltipMessage" }] : []));
|
|
852
852
|
route = computed(() => {
|
|
853
853
|
const resource = this.fieldMeta()?.enumeratedResource;
|
|
854
854
|
return this.resourceMeta(resource)?.route;
|
|
855
|
-
},
|
|
855
|
+
}, ...(ngDevMode ? [{ debugName: "route" }] : []));
|
|
856
856
|
viewDetails = computed(() => {
|
|
857
857
|
return this.editMode() === 'view' && this.fieldConfig().enumeratedConfig.viewDetails === true;
|
|
858
|
-
},
|
|
858
|
+
}, ...(ngDevMode ? [{ debugName: "viewDetails" }] : []));
|
|
859
859
|
sorts = computed(() => {
|
|
860
860
|
return this.fieldConfig().enumeratedConfig.sorts;
|
|
861
|
-
},
|
|
861
|
+
}, ...(ngDevMode ? [{ debugName: "sorts" }] : []));
|
|
862
862
|
singleEnumResourceRef = computed(() => {
|
|
863
863
|
this.editMode();
|
|
864
864
|
if (this.showField() === false) {
|
|
@@ -872,13 +872,13 @@ class EnumeratedFieldComponent extends BaseInputComponent {
|
|
|
872
872
|
return untracked(() => this.store.resourceView(this.route, signal(fieldValue)));
|
|
873
873
|
}
|
|
874
874
|
return undefined;
|
|
875
|
-
},
|
|
875
|
+
}, ...(ngDevMode ? [{ debugName: "singleEnumResourceRef" }] : []));
|
|
876
876
|
rootResourceRef = computed(() => {
|
|
877
877
|
const rootConfig = this.activatedRoute.snapshot.data['config'];
|
|
878
878
|
const uuid = (this.activatedRoute.snapshot.params['uuid'] || '');
|
|
879
879
|
const rootMeta = this.resourceMeta(rootConfig.parentConfig.primaryResource);
|
|
880
880
|
return this.store.resourceView(signal(rootMeta.route), signal(uuid));
|
|
881
|
-
},
|
|
881
|
+
}, ...(ngDevMode ? [{ debugName: "rootResourceRef" }] : []));
|
|
882
882
|
enumResourceRef = computed(() => {
|
|
883
883
|
if (this.showField() === false)
|
|
884
884
|
return undefined;
|
|
@@ -888,7 +888,7 @@ class EnumeratedFieldComponent extends BaseInputComponent {
|
|
|
888
888
|
? config?.filter?.(this.rootResourceRef()?.value() || {})
|
|
889
889
|
: config?.filter?.(this.relatedData() || {});
|
|
890
890
|
return this.store.resourceList(signal(enumeratedMeta.route), signal(filter), signal([]), signal(config.disableCacheForFilterPii), this.query, this.sorts);
|
|
891
|
-
},
|
|
891
|
+
}, ...(ngDevMode ? [{ debugName: "enumResourceRef" }] : []));
|
|
892
892
|
singleEnumDisplayText = computed(() => {
|
|
893
893
|
const showField = this.showField();
|
|
894
894
|
if (showField === false) {
|
|
@@ -906,7 +906,7 @@ class EnumeratedFieldComponent extends BaseInputComponent {
|
|
|
906
906
|
}
|
|
907
907
|
const enumeratedValues = this.toEnumerated(record, fieldConfig);
|
|
908
908
|
return enumeratedValues.display;
|
|
909
|
-
},
|
|
909
|
+
}, ...(ngDevMode ? [{ debugName: "singleEnumDisplayText" }] : []));
|
|
910
910
|
hasRequiredValidator = computed(() => {
|
|
911
911
|
const form = this.form();
|
|
912
912
|
const fieldConfig = this.fieldConfig();
|
|
@@ -918,7 +918,7 @@ class EnumeratedFieldComponent extends BaseInputComponent {
|
|
|
918
918
|
return false;
|
|
919
919
|
}
|
|
920
920
|
return control.hasValidator(Validators.required);
|
|
921
|
-
},
|
|
921
|
+
}, ...(ngDevMode ? [{ debugName: "hasRequiredValidator" }] : []));
|
|
922
922
|
singleEnumValue = computed(() => {
|
|
923
923
|
if (this.showField() === false)
|
|
924
924
|
return undefined;
|
|
@@ -929,7 +929,7 @@ class EnumeratedFieldComponent extends BaseInputComponent {
|
|
|
929
929
|
if (!record)
|
|
930
930
|
return [];
|
|
931
931
|
return [this.toEnumerated(record, this.fieldConfig())];
|
|
932
|
-
},
|
|
932
|
+
}, ...(ngDevMode ? [{ debugName: "singleEnumValue" }] : []));
|
|
933
933
|
listEnumValues = computed(() => {
|
|
934
934
|
if (this.showField() === false)
|
|
935
935
|
return [];
|
|
@@ -938,13 +938,17 @@ class EnumeratedFieldComponent extends BaseInputComponent {
|
|
|
938
938
|
if (!records || !records.length)
|
|
939
939
|
return currentValue || [];
|
|
940
940
|
return records.map((record) => this.toEnumerated(record, this.fieldConfig()));
|
|
941
|
-
},
|
|
941
|
+
}, ...(ngDevMode ? [{ debugName: "listEnumValues" }] : []));
|
|
942
942
|
availableEnumOptions = computed(() => {
|
|
943
|
-
|
|
944
|
-
|
|
943
|
+
const editMode = this.editMode() === 'edit';
|
|
944
|
+
const options = editMode ? this.listEnumValues() : this.singleEnumValue();
|
|
945
|
+
const meta = this.fieldMeta();
|
|
946
|
+
const metaRequired = 'required' in meta && meta.required;
|
|
947
|
+
if (editMode && !this.hasRequiredValidator() && options && options.length > 0 && !metaRequired) {
|
|
948
|
+
return [{ id: null, display: defaultEmptyFieldValue }, ...options];
|
|
945
949
|
}
|
|
946
|
-
return
|
|
947
|
-
},
|
|
950
|
+
return options;
|
|
951
|
+
}, ...(ngDevMode ? [{ debugName: "availableEnumOptions" }] : []));
|
|
948
952
|
toEnumerated(resource, element) {
|
|
949
953
|
const enumeratedConfig = element.enumeratedConfig;
|
|
950
954
|
const displayFields = this.editMode() === 'edit' && enumeratedConfig.listDisplay.length > 0
|
|
@@ -964,7 +968,9 @@ class EnumeratedFieldComponent extends BaseInputComponent {
|
|
|
964
968
|
return '';
|
|
965
969
|
if (typeof value === 'string') {
|
|
966
970
|
const option = this.availableEnumOptions()?.find((o) => o.id === value);
|
|
967
|
-
|
|
971
|
+
if (!option)
|
|
972
|
+
return '';
|
|
973
|
+
return option['display'] || (option.id !== null ? this.formatDisplay(option) : '');
|
|
968
974
|
}
|
|
969
975
|
return value['display'] || this.formatDisplay(value);
|
|
970
976
|
};
|
|
@@ -980,10 +986,10 @@ class EnumeratedFieldComponent extends BaseInputComponent {
|
|
|
980
986
|
this.form().markAsTouched();
|
|
981
987
|
this.reloadSignal.update((prev) => !prev);
|
|
982
988
|
}
|
|
983
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
984
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
989
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: EnumeratedFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
990
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: EnumeratedFieldComponent, isStandalone: true, selector: "ccc-enumerated-field", usesInheritance: true, ngImport: i0, template: "<ng-container [formGroup]=\"form()\">\n @if (showField()) {\n @let options = availableEnumOptions();\n @if (editMode() === 'edit') {\n <div class=\"enumerated-field-container\">\n <mat-form-field class=\"field {{ fieldClass() }}\" [subscriptSizing]=\"'dynamic'\">\n <mat-label>{{ fieldConfig().label }}</mat-label>\n @if (fieldConfig().enumeratedConfig.searchable) {\n <input\n #input\n type=\"text\"\n placeholder=\"Search\"\n matInput\n [matAutocomplete]=\"auto\"\n [formControlName]=\"fieldConfig().name\"\n (input)=\"search(input.value)\" />\n <mat-autocomplete\n (optionSelected)=\"select($event.option.value)\"\n #auto=\"matAutocomplete\"\n [displayWith]=\"getDisplayText\">\n @for (option of options; track option.id) {\n <mat-option [value]=\"option.id\">{{ option?.display }}</mat-option>\n }\n </mat-autocomplete>\n } @else {\n <mat-select\n [formControlName]=\"fieldConfig().name\"\n (keydown.enter)=\"$event.preventDefault()\"\n (selectionChange)=\"select($event.value)\"\n [ariaReadOnly]=\"editMode() === 'view'\">\n @for (option of options; track option.id) {\n @if (option?.id === form().get(this.fieldConfig().name)?.value) {\n <mat-option [value]=\"option?.id\" selected>{{ option?.display }}</mat-option>\n } @else {\n <mat-option [value]=\"option?.id\">{{ option?.display }}</mat-option>\n }\n }\n </mat-select>\n }\n </mat-form-field>\n </div>\n } @else {\n <div class=\"enumerated-field-container readonly-field\">\n <mat-form-field class=\"field {{ fieldClass() }}\" [subscriptSizing]=\"'dynamic'\">\n <mat-label>{{ fieldConfig().label }}</mat-label>\n <input\n id=\"{{ fieldConfig().name }}-readonly-input-text\"\n matInput\n (keydown.enter)=\"$event.preventDefault()\"\n [readonly]=\"true\"\n type=\"text\"\n [required]=\"hasRequiredValidator()\"\n [value]=\"singleEnumDisplayText()\" />\n </mat-form-field>\n @if (viewDetails()) {\n <a\n mat-icon-button\n color=\"accent\"\n [matTooltip]=\"tooltipMessage()\"\n matTooltipPosition=\"below\"\n [routerLink]=\"['/', route(), form().get(this.fieldConfig().name)?.value]\">\n <mat-icon>arrow_forward</mat-icon>\n </a>\n }\n </div>\n <input class=\"display-none\" [formControlName]=\"fieldConfig().name\" />\n }\n } @else {\n <input class=\"display-none\" [formControlName]=\"fieldConfig().name\" />\n }\n</ng-container>\n", styles: [".enumerated-field-container{display:flex;flex-direction:row;gap:10px}.display-none{display:none}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i9.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i10.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i10.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
985
991
|
}
|
|
986
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
992
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: EnumeratedFieldComponent, decorators: [{
|
|
987
993
|
type: Component,
|
|
988
994
|
args: [{ selector: 'ccc-enumerated-field', imports: [
|
|
989
995
|
MatFormFieldModule,
|
|
@@ -1011,7 +1017,7 @@ class NullBooleanFieldComponent extends BaseInputComponent {
|
|
|
1011
1017
|
valueMap.set(value.value, value.label);
|
|
1012
1018
|
});
|
|
1013
1019
|
return valueMap;
|
|
1014
|
-
},
|
|
1020
|
+
}, ...(ngDevMode ? [{ debugName: "availableEnumOptions" }] : []));
|
|
1015
1021
|
currentValue = computed(() => {
|
|
1016
1022
|
const form = this.form();
|
|
1017
1023
|
const fieldConfig = this.fieldConfig();
|
|
@@ -1019,7 +1025,7 @@ class NullBooleanFieldComponent extends BaseInputComponent {
|
|
|
1019
1025
|
return;
|
|
1020
1026
|
}
|
|
1021
1027
|
return form.get(fieldConfig.name)?.value;
|
|
1022
|
-
},
|
|
1028
|
+
}, ...(ngDevMode ? [{ debugName: "currentValue" }] : []));
|
|
1023
1029
|
currentDisplayText = computed(() => {
|
|
1024
1030
|
const value = this.currentValue();
|
|
1025
1031
|
const availableOptions = this.availableEnumOptions();
|
|
@@ -1027,7 +1033,7 @@ class NullBooleanFieldComponent extends BaseInputComponent {
|
|
|
1027
1033
|
return;
|
|
1028
1034
|
}
|
|
1029
1035
|
return availableOptions.get(value);
|
|
1030
|
-
},
|
|
1036
|
+
}, ...(ngDevMode ? [{ debugName: "currentDisplayText" }] : []));
|
|
1031
1037
|
hasRequiredValidator = computed(() => {
|
|
1032
1038
|
const form = this.form();
|
|
1033
1039
|
const fieldConfig = this.fieldConfig();
|
|
@@ -1039,11 +1045,11 @@ class NullBooleanFieldComponent extends BaseInputComponent {
|
|
|
1039
1045
|
return false;
|
|
1040
1046
|
}
|
|
1041
1047
|
return control.hasValidator(Validators.required);
|
|
1042
|
-
},
|
|
1043
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1044
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
1048
|
+
}, ...(ngDevMode ? [{ debugName: "hasRequiredValidator" }] : []));
|
|
1049
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: NullBooleanFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1050
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: NullBooleanFieldComponent, isStandalone: true, selector: "ccc-nullboolean-field", usesInheritance: true, ngImport: i0, template: "<ng-container [formGroup]=\"form()\">\n @if (showField()) {\n @let options = availableEnumOptions();\n @if (editMode() === 'edit') {\n <mat-form-field class=\"field {{ fieldClass() }}\" [subscriptSizing]=\"'dynamic'\">\n <mat-label>{{ fieldConfig().label }}</mat-label>\n <mat-select\n [formControlName]=\"fieldConfig().name\"\n (keydown.enter)=\"$event.preventDefault()\"\n [canSelectNullableOptions]=\"true\"\n [ariaReadOnly]=\"editMode() === 'view'\">\n @for (option of options; track option[0]) {\n @if (option[0] === currentValue()) {\n <mat-option [value]=\"option[0]\" selected>{{ option[1] }}</mat-option>\n } @else {\n <mat-option [value]=\"option[0]\">{{ option[1] }}</mat-option>\n }\n }\n </mat-select>\n </mat-form-field>\n } @else {\n <div class=\"readonly-field\">\n <mat-form-field class=\"field {{ fieldClass() }}\" [subscriptSizing]=\"'dynamic'\">\n <mat-label>{{ fieldConfig().label }}</mat-label>\n <input\n matInput\n (keydown.enter)=\"$event.preventDefault()\"\n [readonly]=\"true\"\n type=\"text\"\n [required]=\"hasRequiredValidator()\"\n [value]=\"currentDisplayText()\" />\n </mat-form-field>\n </div>\n }\n } @else {\n <input class=\"display-none\" [formControlName]=\"fieldConfig().name\" />\n }\n</ng-container>\n", styles: [".display-none{display:none}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: MatAutocompleteModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1045
1051
|
}
|
|
1046
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1052
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: NullBooleanFieldComponent, decorators: [{
|
|
1047
1053
|
type: Component,
|
|
1048
1054
|
args: [{ selector: 'ccc-nullboolean-field', imports: [
|
|
1049
1055
|
MatFormFieldModule,
|
|
@@ -1061,19 +1067,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
1061
1067
|
}] });
|
|
1062
1068
|
|
|
1063
1069
|
class NumberFieldComponent extends BaseInputComponent {
|
|
1064
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1065
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
1070
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: NumberFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1071
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: NumberFieldComponent, isStandalone: true, selector: "ccc-number-field", usesInheritance: true, ngImport: i0, template: "@if (showField()) {\n <div [class.readonly-field]=\"editMode() === 'view'\">\n <mat-form-field\n class=\"field {{ fieldClass() }}\"\n [formGroup]=\"form()\"\n [subscriptSizing]=\"'dynamic'\"\n [floatLabel]=\"floatLabel()\">\n <mat-label>{{ fieldConfig().label }}</mat-label>\n <span matTextPrefix class=\"prefix\">{{ prefixString() }}</span>\n <span matTextSuffix class=\"suffix\">{{ suffixString() }}</span>\n <input\n matInput\n (keydown.enter)=\"$event.preventDefault()\"\n [readonly]=\"editMode() === 'view'\"\n type=\"number\"\n [formControlName]=\"fieldConfig().name\" />\n </mat-form-field>\n </div>\n} @else {\n <ng-container [formGroup]=\"form()\">\n <input type=\"hidden\" [formControlName]=\"fieldConfig().name\" />\n </ng-container>\n}\n", styles: [".prefix,.suffix{font-style:italic;color:gray;padding-right:5px}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
1066
1072
|
}
|
|
1067
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1073
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: NumberFieldComponent, decorators: [{
|
|
1068
1074
|
type: Component,
|
|
1069
1075
|
args: [{ selector: 'ccc-number-field', imports: [MatFormFieldModule, MatInputModule, MatDatepickerModule, ReactiveFormsModule], template: "@if (showField()) {\n <div [class.readonly-field]=\"editMode() === 'view'\">\n <mat-form-field\n class=\"field {{ fieldClass() }}\"\n [formGroup]=\"form()\"\n [subscriptSizing]=\"'dynamic'\"\n [floatLabel]=\"floatLabel()\">\n <mat-label>{{ fieldConfig().label }}</mat-label>\n <span matTextPrefix class=\"prefix\">{{ prefixString() }}</span>\n <span matTextSuffix class=\"suffix\">{{ suffixString() }}</span>\n <input\n matInput\n (keydown.enter)=\"$event.preventDefault()\"\n [readonly]=\"editMode() === 'view'\"\n type=\"number\"\n [formControlName]=\"fieldConfig().name\" />\n </mat-form-field>\n </div>\n} @else {\n <ng-container [formGroup]=\"form()\">\n <input type=\"hidden\" [formControlName]=\"fieldConfig().name\" />\n </ng-container>\n}\n", styles: [".prefix,.suffix{font-style:italic;color:gray;padding-right:5px}\n"] }]
|
|
1070
1076
|
}] });
|
|
1071
1077
|
|
|
1072
1078
|
class TextFieldComponent extends BaseInputComponent {
|
|
1073
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1074
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
1079
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TextFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1080
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: TextFieldComponent, isStandalone: true, selector: "ccc-text-field", usesInheritance: true, ngImport: i0, template: "@if (showField()) {\n <div [class.readonly-field]=\"editMode() === 'view'\">\n <mat-form-field\n class=\"field {{ fieldClass() }}\"\n [formGroup]=\"form()\"\n [subscriptSizing]=\"'dynamic'\"\n [floatLabel]=\"floatLabel()\">\n <mat-label>{{ fieldConfig().label }}</mat-label>\n <span matTextPrefix class=\"prefix\">{{ prefixString() }}</span>\n <span matTextSuffix class=\"suffix\">{{ suffixString() }}</span>\n <input\n matInput\n (keydown.enter)=\"$event.preventDefault()\"\n [readonly]=\"editMode() === 'view'\"\n type=\"text\"\n [formControlName]=\"fieldConfig().name\"\n [class.dirty-input]=\"form().get(fieldConfig().name)?.dirty\" />\n @if (editMode() === 'edit' && form().get(fieldConfig().name)?.dirty) {\n <button matSuffix mat-icon-button (click)=\"reset()\" tabindex=\"-1\">\n <mat-icon>refresh</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n} @else {\n <ng-container [formGroup]=\"form()\">\n <input type=\"hidden\" [formControlName]=\"fieldConfig().name\" />\n </ng-container>\n}\n", styles: [".prefix,.suffix{font-style:italic;color:gray;padding-right:5px}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }] });
|
|
1075
1081
|
}
|
|
1076
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1082
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TextFieldComponent, decorators: [{
|
|
1077
1083
|
type: Component,
|
|
1078
1084
|
args: [{ selector: 'ccc-text-field', imports: [
|
|
1079
1085
|
MatFormFieldModule,
|
|
@@ -1086,25 +1092,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
1086
1092
|
}] });
|
|
1087
1093
|
|
|
1088
1094
|
class ResourceFieldComponent {
|
|
1089
|
-
fieldConfig = input.required(
|
|
1090
|
-
meta = input.required(
|
|
1091
|
-
fieldClass = input(
|
|
1092
|
-
editMode = input('edit',
|
|
1093
|
-
form = input.required(
|
|
1094
|
-
formDataState = input(
|
|
1095
|
-
pristineValue = input(
|
|
1096
|
-
data = input(
|
|
1095
|
+
fieldConfig = input.required(...(ngDevMode ? [{ debugName: "fieldConfig" }] : []));
|
|
1096
|
+
meta = input.required(...(ngDevMode ? [{ debugName: "meta" }] : []));
|
|
1097
|
+
fieldClass = input(...(ngDevMode ? [undefined, { debugName: "fieldClass" }] : []));
|
|
1098
|
+
editMode = input('edit', ...(ngDevMode ? [{ debugName: "editMode" }] : []));
|
|
1099
|
+
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1100
|
+
formDataState = input(...(ngDevMode ? [undefined, { debugName: "formDataState" }] : []));
|
|
1101
|
+
pristineValue = input(...(ngDevMode ? [undefined, { debugName: "pristineValue" }] : []));
|
|
1102
|
+
data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : []));
|
|
1097
1103
|
previouslyNulled = null;
|
|
1098
1104
|
fieldMeta = computed(() => {
|
|
1099
1105
|
return (this.meta().fields?.find((field) => field.fieldName === this.fieldConfig().name) ||
|
|
1100
1106
|
{});
|
|
1101
|
-
},
|
|
1107
|
+
}, ...(ngDevMode ? [{ debugName: "fieldMeta" }] : []));
|
|
1102
1108
|
mode = computed(() => {
|
|
1103
1109
|
if (this.fieldConfig().readOnly) {
|
|
1104
1110
|
return 'view';
|
|
1105
1111
|
}
|
|
1106
1112
|
return this.editMode();
|
|
1107
|
-
},
|
|
1113
|
+
}, ...(ngDevMode ? [{ debugName: "mode" }] : []));
|
|
1108
1114
|
showField = computed(() => {
|
|
1109
1115
|
const shouldRender = this.fieldConfig().shouldRender;
|
|
1110
1116
|
const conditionallyNull = this.fieldConfig().nullIfConditionallyHidden;
|
|
@@ -1143,7 +1149,7 @@ class ResourceFieldComponent {
|
|
|
1143
1149
|
console.error(e);
|
|
1144
1150
|
return true;
|
|
1145
1151
|
}
|
|
1146
|
-
},
|
|
1152
|
+
}, ...(ngDevMode ? [{ debugName: "showField" }] : []));
|
|
1147
1153
|
showEmptyField = computed(() => {
|
|
1148
1154
|
const editMode = this.mode();
|
|
1149
1155
|
const showField = this.showField();
|
|
@@ -1164,7 +1170,7 @@ class ResourceFieldComponent {
|
|
|
1164
1170
|
return true;
|
|
1165
1171
|
}
|
|
1166
1172
|
return false;
|
|
1167
|
-
},
|
|
1173
|
+
}, ...(ngDevMode ? [{ debugName: "showEmptyField" }] : []));
|
|
1168
1174
|
class = '';
|
|
1169
1175
|
booleanEditDisplayType = computed(() => {
|
|
1170
1176
|
const fieldConfig = this.fieldConfig();
|
|
@@ -1185,7 +1191,7 @@ class ResourceFieldComponent {
|
|
|
1185
1191
|
return 'nullboolean';
|
|
1186
1192
|
}
|
|
1187
1193
|
return 'boolean';
|
|
1188
|
-
},
|
|
1194
|
+
}, ...(ngDevMode ? [{ debugName: "booleanEditDisplayType" }] : []));
|
|
1189
1195
|
previousValidatorCount = 0;
|
|
1190
1196
|
constructor() {
|
|
1191
1197
|
effect(() => {
|
|
@@ -1222,10 +1228,10 @@ class ResourceFieldComponent {
|
|
|
1222
1228
|
}
|
|
1223
1229
|
});
|
|
1224
1230
|
}
|
|
1225
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1226
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
1231
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1232
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ResourceFieldComponent, isStandalone: true, selector: "ccc-resource-field", inputs: { fieldConfig: { classPropertyName: "fieldConfig", publicName: "fieldConfig", isSignal: true, isRequired: true, transformFunction: null }, meta: { classPropertyName: "meta", publicName: "meta", isSignal: true, isRequired: true, transformFunction: null }, fieldClass: { classPropertyName: "fieldClass", publicName: "fieldClass", isSignal: true, isRequired: false, transformFunction: null }, editMode: { classPropertyName: "editMode", publicName: "editMode", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, formDataState: { classPropertyName: "formDataState", publicName: "formDataState", isSignal: true, isRequired: false, transformFunction: null }, pristineValue: { classPropertyName: "pristineValue", publicName: "pristineValue", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<div [class.hidden-field]=\"!showField()\">\n @if (showEmptyField()) {\n <ccc-empty-readonly-field [label]=\"fieldConfig().label\"></ccc-empty-readonly-field>\n } @else {\n @switch (fieldMeta().displayType) {\n @case ('date') {\n <ccc-date-field\n [form]=\"form()\"\n [fieldConfig]=\"fieldConfig()\"\n [editMode]=\"mode()\"\n [fieldClass]=\"fieldClass()\"\n [meta]=\"meta()\"\n [pristineValue]=\"pristineValue()\"\n [relatedData]=\"data()\"\n [fieldMeta]=\"fieldMeta()\"\n [showField]=\"showField()\">\n </ccc-date-field>\n }\n\n @case ('civildate') {\n <ccc-date-field\n [form]=\"form()\"\n [fieldConfig]=\"fieldConfig()\"\n [editMode]=\"mode()\"\n [fieldClass]=\"fieldClass()\"\n [meta]=\"meta()\"\n [pristineValue]=\"pristineValue()\"\n [relatedData]=\"data()\"\n [fieldMeta]=\"fieldMeta()\"\n [showField]=\"showField()\">\n </ccc-date-field>\n }\n\n @case ('number') {\n <ccc-number-field\n [form]=\"form()\"\n [fieldConfig]=\"fieldConfig()\"\n [editMode]=\"mode()\"\n [fieldClass]=\"fieldClass()\"\n [meta]=\"meta()\"\n [pristineValue]=\"pristineValue()\"\n [relatedData]=\"data()\"\n [fieldMeta]=\"fieldMeta()\"\n [showField]=\"showField()\">\n </ccc-number-field>\n }\n\n @case ('boolean') {\n <ng-container *ngTemplateOutlet=\"booleanFragment\"></ng-container>\n }\n @case ('nullboolean') {\n <ng-container *ngTemplateOutlet=\"booleanFragment\"></ng-container>\n }\n\n @case ('enumerated') {\n <ccc-enumerated-field\n [form]=\"form()\"\n [fieldConfig]=\"fieldConfig()\"\n [editMode]=\"mode()\"\n [fieldClass]=\"fieldClass()\"\n [meta]=\"meta()\"\n [pristineValue]=\"pristineValue()\"\n [relatedData]=\"data()\"\n [fieldMeta]=\"fieldMeta()\"\n [showField]=\"showField()\">\n </ccc-enumerated-field>\n }\n\n @default {\n <ccc-text-field\n [form]=\"form()\"\n [fieldConfig]=\"fieldConfig()\"\n [editMode]=\"mode()\"\n [fieldClass]=\"fieldClass()\"\n [meta]=\"meta()\"\n [pristineValue]=\"pristineValue()\"\n [relatedData]=\"data()\"\n [fieldMeta]=\"fieldMeta()\"\n [showField]=\"showField()\">\n </ccc-text-field>\n }\n }\n }\n</div>\n\n<ng-template #booleanFragment>\n @if (booleanEditDisplayType() === 'boolean') {\n <ccc-boolean-field\n [form]=\"form()\"\n [fieldConfig]=\"fieldConfig()\"\n [editMode]=\"mode()\"\n [fieldClass]=\"fieldClass()\"\n [meta]=\"meta()\"\n [pristineValue]=\"pristineValue()\"\n [relatedData]=\"data()\"\n [fieldMeta]=\"fieldMeta()\"\n [showField]=\"showField()\">\n </ccc-boolean-field>\n } @else if (booleanEditDisplayType() === 'nullboolean') {\n <ccc-nullboolean-field\n [form]=\"form()\"\n [fieldConfig]=\"fieldConfig()\"\n [editMode]=\"mode()\"\n [fieldClass]=\"fieldClass()\"\n [meta]=\"meta()\"\n [pristineValue]=\"pristineValue()\"\n [relatedData]=\"data()\"\n [fieldMeta]=\"fieldMeta()\"\n [showField]=\"showField()\">\n </ccc-nullboolean-field>\n }\n</ng-template>\n", styles: [".checkbox{margin-top:10px}.dirty-input{background-color:#00617f26}\n"], dependencies: [{ kind: "component", type: DateFieldComponent, selector: "ccc-date-field" }, { kind: "component", type: BooleanFieldComponent, selector: "ccc-boolean-field" }, { kind: "component", type: TextFieldComponent, selector: "ccc-text-field" }, { kind: "component", type: NumberFieldComponent, selector: "ccc-number-field" }, { kind: "component", type: EnumeratedFieldComponent, selector: "ccc-enumerated-field" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: EmptyReadonlyFieldComponent, selector: "ccc-empty-readonly-field", inputs: ["label"] }, { kind: "component", type: NullBooleanFieldComponent, selector: "ccc-nullboolean-field" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1227
1233
|
}
|
|
1228
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceFieldComponent, decorators: [{
|
|
1229
1235
|
type: Component,
|
|
1230
1236
|
args: [{ selector: 'ccc-resource-field', imports: [
|
|
1231
1237
|
DateFieldComponent,
|
|
@@ -1244,16 +1250,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
1244
1250
|
}] } });
|
|
1245
1251
|
|
|
1246
1252
|
class ResourceLayoutComponent {
|
|
1247
|
-
element = input.required(
|
|
1248
|
-
meta = input.required(
|
|
1249
|
-
fieldClass = input(
|
|
1250
|
-
editMode = input.required(
|
|
1251
|
-
form = input.required(
|
|
1252
|
-
formDataState = model(
|
|
1253
|
-
pristineValue = input('',
|
|
1254
|
-
relatedData = input(
|
|
1255
|
-
parentClass = input(
|
|
1256
|
-
layoutNestingDepth = input(1,
|
|
1253
|
+
element = input.required(...(ngDevMode ? [{ debugName: "element" }] : []));
|
|
1254
|
+
meta = input.required(...(ngDevMode ? [{ debugName: "meta" }] : []));
|
|
1255
|
+
fieldClass = input(...(ngDevMode ? [undefined, { debugName: "fieldClass" }] : []));
|
|
1256
|
+
editMode = input.required(...(ngDevMode ? [{ debugName: "editMode" }] : []));
|
|
1257
|
+
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1258
|
+
formDataState = model(...(ngDevMode ? [undefined, { debugName: "formDataState" }] : []));
|
|
1259
|
+
pristineValue = input('', ...(ngDevMode ? [{ debugName: "pristineValue" }] : []));
|
|
1260
|
+
relatedData = input(...(ngDevMode ? [undefined, { debugName: "relatedData" }] : []));
|
|
1261
|
+
parentClass = input(...(ngDevMode ? [undefined, { debugName: "parentClass" }] : []));
|
|
1262
|
+
layoutNestingDepth = input(1, ...(ngDevMode ? [{ debugName: "layoutNestingDepth" }] : []));
|
|
1257
1263
|
maxLayoutNestingDepth = maxLayoutNestingDepth;
|
|
1258
1264
|
children = computed(() => {
|
|
1259
1265
|
const element = this.element();
|
|
@@ -1261,10 +1267,10 @@ class ResourceLayoutComponent {
|
|
|
1261
1267
|
return element.children;
|
|
1262
1268
|
}
|
|
1263
1269
|
return [];
|
|
1264
|
-
},
|
|
1270
|
+
}, ...(ngDevMode ? [{ debugName: "children" }] : []));
|
|
1265
1271
|
layoutChildrenConfig = computed(() => {
|
|
1266
1272
|
return flattenElements(this.children());
|
|
1267
|
-
},
|
|
1273
|
+
}, ...(ngDevMode ? [{ debugName: "layoutChildrenConfig" }] : []));
|
|
1268
1274
|
previouslyNulled = false;
|
|
1269
1275
|
nullIfConditionallyHidden = computed(() => {
|
|
1270
1276
|
const element = this.element();
|
|
@@ -1275,7 +1281,7 @@ class ResourceLayoutComponent {
|
|
|
1275
1281
|
return element.nullAllChildrenIfConditionallyHidden;
|
|
1276
1282
|
}
|
|
1277
1283
|
return false;
|
|
1278
|
-
},
|
|
1284
|
+
}, ...(ngDevMode ? [{ debugName: "nullIfConditionallyHidden" }] : []));
|
|
1279
1285
|
showLayout = computed(() => {
|
|
1280
1286
|
const element = this.element();
|
|
1281
1287
|
const shouldRender = element.shouldRender;
|
|
@@ -1322,7 +1328,7 @@ class ResourceLayoutComponent {
|
|
|
1322
1328
|
console.error(e);
|
|
1323
1329
|
return true;
|
|
1324
1330
|
}
|
|
1325
|
-
},
|
|
1331
|
+
}, ...(ngDevMode ? [{ debugName: "showLayout" }] : []));
|
|
1326
1332
|
class = '';
|
|
1327
1333
|
constructor() {
|
|
1328
1334
|
// TODO: Remove this effect once Angular supports signals in Reactive forms to obtain changes to form values.
|
|
@@ -1374,10 +1380,10 @@ class ResourceLayoutComponent {
|
|
|
1374
1380
|
}
|
|
1375
1381
|
return true;
|
|
1376
1382
|
}
|
|
1377
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1378
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
1383
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1384
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ResourceLayoutComponent, isStandalone: true, selector: "ccc-resource-layout-template", inputs: { element: { classPropertyName: "element", publicName: "element", isSignal: true, isRequired: true, transformFunction: null }, meta: { classPropertyName: "meta", publicName: "meta", isSignal: true, isRequired: true, transformFunction: null }, fieldClass: { classPropertyName: "fieldClass", publicName: "fieldClass", isSignal: true, isRequired: false, transformFunction: null }, editMode: { classPropertyName: "editMode", publicName: "editMode", isSignal: true, isRequired: true, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, formDataState: { classPropertyName: "formDataState", publicName: "formDataState", isSignal: true, isRequired: false, transformFunction: null }, pristineValue: { classPropertyName: "pristineValue", publicName: "pristineValue", isSignal: true, isRequired: false, transformFunction: null }, relatedData: { classPropertyName: "relatedData", publicName: "relatedData", isSignal: true, isRequired: false, transformFunction: null }, parentClass: { classPropertyName: "parentClass", publicName: "parentClass", isSignal: true, isRequired: false, transformFunction: null }, layoutNestingDepth: { classPropertyName: "layoutNestingDepth", publicName: "layoutNestingDepth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { formDataState: "formDataStateChange" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<div class=\"section {{ parentClass() }}\" [class.hidden-field]=\"!showLayout()\">\n @let parentElement = element();\n @if (children().length > 0) {\n <div\n class=\"section-elements dense-1 resource-layout-container\"\n [class]=\"layoutNestingDepth() % 2 === 0 ? 'resource-layout-container-even' : 'resource-layout-container-odd'\">\n @if (parentElement.type !== 'padding' && parentElement.label !== '') {\n <div class=\"label\">{{ parentElement.label }}</div>\n }\n @for (elementField of children(); track elementField) {\n @let childElement = elementField;\n @if (childElement.type === 'section') {\n @if (layoutNestingDepth() < maxLayoutNestingDepth) {\n <ccc-resource-layout-template\n [layoutNestingDepth]=\"layoutNestingDepth() + 1\"\n [element]=\"childElement\"\n [meta]=\"meta()\"\n [fieldClass]=\"fieldClass()\"\n [editMode]=\"editMode()\"\n [form]=\"form()\"\n [formDataState]=\"formDataState()\"\n [pristineValue]=\"pristineValue()\"\n [relatedData]=\"relatedData()\"\n [parentClass]=\"parentClass()\">\n </ccc-resource-layout-template>\n }\n } @else if (childElement.type === 'field') {\n <ccc-resource-field\n [meta]=\"meta()\"\n [fieldClass]=\"fieldClass()\"\n [fieldConfig]=\"childElement\"\n [editMode]=\"editMode()\"\n [form]=\"form()\"\n [formDataState]=\"formDataState()\"\n [pristineValue]=\"pristineValue()\"\n [data]=\"relatedData()\">\n </ccc-resource-field>\n } @else if (childElement.type === 'computedDisplayField') {\n <ccc-computed-field\n [fieldClass]=\"fieldClass()\"\n [fieldConfig]=\"childElement\"\n [formDataState]=\"formDataState()\"></ccc-computed-field>\n } @else if (childElement.type === 'padding') {\n <ccc-padding-element [paddingElement]=\"childElement\"></ccc-padding-element>\n }\n }\n </div>\n } @else {\n @if (parentElement.type === 'field') {\n <div\n class=\"section-elements dense-1 resource-layout-container\"\n [class]=\"layoutNestingDepth() % 2 === 0 ? 'resource-layout-container-even' : 'resource-layout-container-odd'\">\n <ccc-resource-field\n [meta]=\"meta()\"\n [fieldClass]=\"fieldClass()\"\n [fieldConfig]=\"parentElement\"\n [editMode]=\"editMode()\"\n [form]=\"form()\"\n [formDataState]=\"formDataState()\"\n [pristineValue]=\"pristineValue()\"\n [data]=\"relatedData()\">\n </ccc-resource-field>\n </div>\n } @else if (parentElement.type === 'computedDisplayField') {\n <ccc-computed-field\n [fieldClass]=\"fieldClass()\"\n [fieldConfig]=\"parentElement\"\n [formDataState]=\"formDataState()\"></ccc-computed-field>\n } @else if (parentElement.type === 'padding') {\n <ccc-padding-element [paddingElement]=\"parentElement\"></ccc-padding-element>\n }\n }\n</div>\n", styles: [".section{margin-top:15px}.section-elements{display:flex;flex-wrap:wrap;padding-bottom:4px}.label{position:absolute;top:-15px;left:20px;height:20px;background-color:var(--layout-label-background-color);border-radius:8px;margin:0 10px;padding:0 10px;text-align:center;z-index:10;font-weight:500;font:18px Roboto,sans-serif}\n"], dependencies: [{ kind: "component", type: ResourceLayoutComponent, selector: "ccc-resource-layout-template", inputs: ["element", "meta", "fieldClass", "editMode", "form", "formDataState", "pristineValue", "relatedData", "parentClass", "layoutNestingDepth"], outputs: ["formDataStateChange"] }, { kind: "component", type: PaddingElementComponent, selector: "ccc-padding-element", inputs: ["paddingElement"] }, { kind: "component", type: ResourceFieldComponent, selector: "ccc-resource-field", inputs: ["fieldConfig", "meta", "fieldClass", "editMode", "form", "formDataState", "pristineValue", "data"] }, { kind: "component", type: ComputedFieldComponent, selector: "ccc-computed-field", inputs: ["fieldConfig", "fieldClass", "formDataState"] }] });
|
|
1379
1385
|
}
|
|
1380
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1386
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceLayoutComponent, decorators: [{
|
|
1381
1387
|
type: Component,
|
|
1382
1388
|
args: [{ selector: 'ccc-resource-layout-template', imports: [PaddingElementComponent, ResourceFieldComponent, ComputedFieldComponent], template: "<div class=\"section {{ parentClass() }}\" [class.hidden-field]=\"!showLayout()\">\n @let parentElement = element();\n @if (children().length > 0) {\n <div\n class=\"section-elements dense-1 resource-layout-container\"\n [class]=\"layoutNestingDepth() % 2 === 0 ? 'resource-layout-container-even' : 'resource-layout-container-odd'\">\n @if (parentElement.type !== 'padding' && parentElement.label !== '') {\n <div class=\"label\">{{ parentElement.label }}</div>\n }\n @for (elementField of children(); track elementField) {\n @let childElement = elementField;\n @if (childElement.type === 'section') {\n @if (layoutNestingDepth() < maxLayoutNestingDepth) {\n <ccc-resource-layout-template\n [layoutNestingDepth]=\"layoutNestingDepth() + 1\"\n [element]=\"childElement\"\n [meta]=\"meta()\"\n [fieldClass]=\"fieldClass()\"\n [editMode]=\"editMode()\"\n [form]=\"form()\"\n [formDataState]=\"formDataState()\"\n [pristineValue]=\"pristineValue()\"\n [relatedData]=\"relatedData()\"\n [parentClass]=\"parentClass()\">\n </ccc-resource-layout-template>\n }\n } @else if (childElement.type === 'field') {\n <ccc-resource-field\n [meta]=\"meta()\"\n [fieldClass]=\"fieldClass()\"\n [fieldConfig]=\"childElement\"\n [editMode]=\"editMode()\"\n [form]=\"form()\"\n [formDataState]=\"formDataState()\"\n [pristineValue]=\"pristineValue()\"\n [data]=\"relatedData()\">\n </ccc-resource-field>\n } @else if (childElement.type === 'computedDisplayField') {\n <ccc-computed-field\n [fieldClass]=\"fieldClass()\"\n [fieldConfig]=\"childElement\"\n [formDataState]=\"formDataState()\"></ccc-computed-field>\n } @else if (childElement.type === 'padding') {\n <ccc-padding-element [paddingElement]=\"childElement\"></ccc-padding-element>\n }\n }\n </div>\n } @else {\n @if (parentElement.type === 'field') {\n <div\n class=\"section-elements dense-1 resource-layout-container\"\n [class]=\"layoutNestingDepth() % 2 === 0 ? 'resource-layout-container-even' : 'resource-layout-container-odd'\">\n <ccc-resource-field\n [meta]=\"meta()\"\n [fieldClass]=\"fieldClass()\"\n [fieldConfig]=\"parentElement\"\n [editMode]=\"editMode()\"\n [form]=\"form()\"\n [formDataState]=\"formDataState()\"\n [pristineValue]=\"pristineValue()\"\n [data]=\"relatedData()\">\n </ccc-resource-field>\n </div>\n } @else if (parentElement.type === 'computedDisplayField') {\n <ccc-computed-field\n [fieldClass]=\"fieldClass()\"\n [fieldConfig]=\"parentElement\"\n [formDataState]=\"formDataState()\"></ccc-computed-field>\n } @else if (parentElement.type === 'padding') {\n <ccc-padding-element [paddingElement]=\"parentElement\"></ccc-padding-element>\n }\n }\n</div>\n", styles: [".section{margin-top:15px}.section-elements{display:flex;flex-wrap:wrap;padding-bottom:4px}.label{position:absolute;top:-15px;left:20px;height:20px;background-color:var(--layout-label-background-color);border-radius:8px;margin:0 10px;padding:0 10px;text-align:center;z-index:10;font-weight:500;font:18px Roboto,sans-serif}\n"] }]
|
|
1383
1389
|
}], ctorParameters: () => [], propDecorators: { element: [{ type: i0.Input, args: [{ isSignal: true, alias: "element", required: true }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: true }] }], fieldClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldClass", required: false }] }], editMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "editMode", required: true }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], formDataState: [{ type: i0.Input, args: [{ isSignal: true, alias: "formDataState", required: false }] }, { type: i0.Output, args: ["formDataStateChange"] }], pristineValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "pristineValue", required: false }] }], relatedData: [{ type: i0.Input, args: [{ isSignal: true, alias: "relatedData", required: false }] }], parentClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "parentClass", required: false }] }], layoutNestingDepth: [{ type: i0.Input, args: [{ isSignal: true, alias: "layoutNestingDepth", required: false }] }], class: [{
|
|
@@ -1389,10 +1395,10 @@ class BaseRPCModalComponent {
|
|
|
1389
1395
|
methodMeta = inject(METHOD_META);
|
|
1390
1396
|
dialogRef = inject(MatDialogRef);
|
|
1391
1397
|
data = inject(MAT_DIALOG_DATA);
|
|
1392
|
-
formData = signal({},
|
|
1398
|
+
formData = signal({}, ...(ngDevMode ? [{ debugName: "formData" }] : []));
|
|
1393
1399
|
meta = computed(() => {
|
|
1394
1400
|
return this.methodMeta(this.formData().method);
|
|
1395
|
-
},
|
|
1401
|
+
}, ...(ngDevMode ? [{ debugName: "meta" }] : []));
|
|
1396
1402
|
constructor() {
|
|
1397
1403
|
this.formData.set(this.data);
|
|
1398
1404
|
if (this.data.width) {
|
|
@@ -1424,12 +1430,12 @@ class BaseRPCModalComponent {
|
|
|
1424
1430
|
}
|
|
1425
1431
|
}
|
|
1426
1432
|
return fg;
|
|
1427
|
-
},
|
|
1433
|
+
}, ...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1428
1434
|
pristineForm = {};
|
|
1429
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1430
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
1435
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: BaseRPCModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1436
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: BaseRPCModalComponent, isStandalone: true, selector: "ccc-base-rpc-modal", providers: [ResourceStore], ngImport: i0, template: "<div mat-dialog-title>{{ formData().label }}</div>\n<mat-dialog-content>\n <div class=\"resource-container\">\n <form [formGroup]=\"form()\">\n <div class=\"resource row\">\n @for (element of formData().elements; track element) {\n <ccc-resource-layout-template\n [element]=\"element\"\n [meta]=\"meta()\"\n [pristineValue]=\"pristineForm[element.name]\"\n editMode=\"edit\"\n [form]=\"form()\"></ccc-resource-layout-template>\n }\n </div>\n </form>\n </div>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button color=\"warn\" [mat-dialog-close]=\"false\">Cancel</button>\n <button mat-raised-button color=\"accent\" [mat-dialog-close]=\"form().getRawValue()\" [disabled]=\"!form().valid\">\n Complete\n </button>\n</mat-dialog-actions>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: ResourceLayoutComponent, selector: "ccc-resource-layout-template", inputs: ["element", "meta", "fieldClass", "editMode", "form", "formDataState", "pristineValue", "relatedData", "parentClass", "layoutNestingDepth"], outputs: ["formDataStateChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
1431
1437
|
}
|
|
1432
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1438
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: BaseRPCModalComponent, decorators: [{
|
|
1433
1439
|
type: Component,
|
|
1434
1440
|
args: [{ selector: 'ccc-base-rpc-modal', imports: [
|
|
1435
1441
|
MatDialogModule,
|
|
@@ -1451,14 +1457,14 @@ class RpcButtonComponent {
|
|
|
1451
1457
|
store = inject(ResourceStore);
|
|
1452
1458
|
methodMeta = inject(METHOD_META);
|
|
1453
1459
|
relatedData = input.required({ ...(ngDevMode ? { debugName: "relatedData" } : {}) });
|
|
1454
|
-
rpcConfig = input.required(
|
|
1455
|
-
primaryResource = input.required(
|
|
1456
|
-
dependentResources = input([],
|
|
1460
|
+
rpcConfig = input.required(...(ngDevMode ? [{ debugName: "rpcConfig" }] : []));
|
|
1461
|
+
primaryResource = input.required(...(ngDevMode ? [{ debugName: "primaryResource" }] : []));
|
|
1462
|
+
dependentResources = input([], ...(ngDevMode ? [{ debugName: "dependentResources" }] : []));
|
|
1457
1463
|
resourceConfigRouteSnapshot = computed(() => {
|
|
1458
1464
|
return (this.rpcConfig() ||
|
|
1459
1465
|
this.activatedRoute.snapshot.data['config']?.parentConfig ||
|
|
1460
1466
|
{});
|
|
1461
|
-
},
|
|
1467
|
+
}, ...(ngDevMode ? [{ debugName: "resourceConfigRouteSnapshot" }] : []));
|
|
1462
1468
|
showRPCButton = computed(() => {
|
|
1463
1469
|
const rpcConfig = this.rpcConfig();
|
|
1464
1470
|
if (!rpcConfig) {
|
|
@@ -1481,7 +1487,7 @@ class RpcButtonComponent {
|
|
|
1481
1487
|
}
|
|
1482
1488
|
}
|
|
1483
1489
|
return canView;
|
|
1484
|
-
},
|
|
1490
|
+
}, ...(ngDevMode ? [{ debugName: "showRPCButton" }] : []));
|
|
1485
1491
|
submitRPC() {
|
|
1486
1492
|
const rpcConfig = this.rpcConfig();
|
|
1487
1493
|
if (!rpcConfig) {
|
|
@@ -1584,10 +1590,10 @@ class RpcButtonComponent {
|
|
|
1584
1590
|
ref.reload();
|
|
1585
1591
|
}
|
|
1586
1592
|
}
|
|
1587
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1588
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
1593
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: RpcButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1594
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: RpcButtonComponent, isStandalone: true, selector: "ccc-rpc-button", inputs: { relatedData: { classPropertyName: "relatedData", publicName: "relatedData", isSignal: true, isRequired: true, transformFunction: null }, rpcConfig: { classPropertyName: "rpcConfig", publicName: "rpcConfig", isSignal: true, isRequired: true, transformFunction: null }, primaryResource: { classPropertyName: "primaryResource", publicName: "primaryResource", isSignal: true, isRequired: true, transformFunction: null }, dependentResources: { classPropertyName: "dependentResources", publicName: "dependentResources", isSignal: true, isRequired: false, transformFunction: null } }, providers: [ResourceStore], ngImport: i0, template: "@if (showRPCButton()) {\n <div class=\"button-container\">\n <button mat-raised-button color=\"accent\" (click)=\"submitRPC()\" [disabled]=\"formState.isDirty()\">\n {{ rpcConfig().label }}\n </button>\n </div>\n}\n", styles: [":host{display:flex;flex-direction:row;margin-top:auto;margin-bottom:auto;justify-content:right;flex-grow:1;gap:20px;margin-right:20px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
|
|
1589
1595
|
}
|
|
1590
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1596
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: RpcButtonComponent, decorators: [{
|
|
1591
1597
|
type: Component,
|
|
1592
1598
|
args: [{ selector: 'ccc-rpc-button', imports: [MatButtonModule], providers: [ResourceStore], template: "@if (showRPCButton()) {\n <div class=\"button-container\">\n <button mat-raised-button color=\"accent\" (click)=\"submitRPC()\" [disabled]=\"formState.isDirty()\">\n {{ rpcConfig().label }}\n </button>\n </div>\n}\n", styles: [":host{display:flex;flex-direction:row;margin-top:auto;margin-bottom:auto;justify-content:right;flex-grow:1;gap:20px;margin-right:20px}\n"] }]
|
|
1593
1599
|
}], propDecorators: { relatedData: [{ type: i0.Input, args: [{ isSignal: true, alias: "relatedData", required: true }] }], rpcConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "rpcConfig", required: true }] }], primaryResource: [{ type: i0.Input, args: [{ isSignal: true, alias: "primaryResource", required: true }] }], dependentResources: [{ type: i0.Input, args: [{ isSignal: true, alias: "dependentResources", required: false }] }] } });
|
|
@@ -1600,28 +1606,28 @@ class ResourceCreateComponent {
|
|
|
1600
1606
|
router = inject(Router);
|
|
1601
1607
|
destroyRef = inject(DestroyRef);
|
|
1602
1608
|
formState = inject(FormStateService);
|
|
1603
|
-
isDirty = signal(false,
|
|
1604
|
-
submitted = signal(false,
|
|
1609
|
+
isDirty = signal(false, ...(ngDevMode ? [{ debugName: "isDirty" }] : []));
|
|
1610
|
+
submitted = signal(false, ...(ngDevMode ? [{ debugName: "submitted" }] : []));
|
|
1605
1611
|
complete = output();
|
|
1606
|
-
resourceConfig = input(
|
|
1607
|
-
parentData = input({},
|
|
1608
|
-
loadCreatedResource = input(false,
|
|
1612
|
+
resourceConfig = input(...(ngDevMode ? [undefined, { debugName: "resourceConfig" }] : []));
|
|
1613
|
+
parentData = input({}, ...(ngDevMode ? [{ debugName: "parentData" }] : []));
|
|
1614
|
+
loadCreatedResource = input(false, ...(ngDevMode ? [{ debugName: "loadCreatedResource" }] : []));
|
|
1609
1615
|
rootConfig = computed(() => {
|
|
1610
1616
|
return this.activatedRoute.snapshot.data['config'];
|
|
1611
|
-
},
|
|
1617
|
+
}, ...(ngDevMode ? [{ debugName: "rootConfig" }] : []));
|
|
1612
1618
|
config = computed(() => {
|
|
1613
1619
|
const inputConfig = this.resourceConfig();
|
|
1614
1620
|
if (inputConfig !== undefined) {
|
|
1615
1621
|
return inputConfig;
|
|
1616
1622
|
}
|
|
1617
1623
|
return this.rootConfig().parentConfig;
|
|
1618
|
-
},
|
|
1624
|
+
}, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
1619
1625
|
indentTitle = computed(() => {
|
|
1620
1626
|
if (this.config().collapsible || this.resourceConfig() === undefined) {
|
|
1621
1627
|
return false;
|
|
1622
1628
|
}
|
|
1623
1629
|
return true;
|
|
1624
|
-
},
|
|
1630
|
+
}, ...(ngDevMode ? [{ debugName: "indentTitle" }] : []));
|
|
1625
1631
|
form = computed(() => {
|
|
1626
1632
|
const meta = this.store.resourceMeta();
|
|
1627
1633
|
const fg = new FormGroup({});
|
|
@@ -1669,13 +1675,13 @@ class ResourceCreateComponent {
|
|
|
1669
1675
|
fg.addControl(field.fieldName, control);
|
|
1670
1676
|
}
|
|
1671
1677
|
return fg;
|
|
1672
|
-
},
|
|
1678
|
+
}, ...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1673
1679
|
route = computed(() => {
|
|
1674
1680
|
const meta = this.store.resourceMeta();
|
|
1675
1681
|
if (!meta)
|
|
1676
1682
|
return '';
|
|
1677
1683
|
return meta.consolidatedRoute || meta.route;
|
|
1678
|
-
},
|
|
1684
|
+
}, ...(ngDevMode ? [{ debugName: "route" }] : []));
|
|
1679
1685
|
primaryKeys = computed(() => {
|
|
1680
1686
|
const meta = this.store.resourceMeta();
|
|
1681
1687
|
if (!meta)
|
|
@@ -1683,14 +1689,14 @@ class ResourceCreateComponent {
|
|
|
1683
1689
|
return meta.fields
|
|
1684
1690
|
.filter((field) => field.primaryKey)
|
|
1685
1691
|
.sort((a, b) => a.primaryKey.ordinalPosition - b.primaryKey.ordinalPosition);
|
|
1686
|
-
},
|
|
1692
|
+
}, ...(ngDevMode ? [{ debugName: "primaryKeys" }] : []));
|
|
1687
1693
|
hasRequiredPrimaryKey = computed(() => {
|
|
1688
1694
|
const meta = this.store.resourceMeta();
|
|
1689
1695
|
if (!meta) {
|
|
1690
1696
|
return false;
|
|
1691
1697
|
}
|
|
1692
1698
|
return meta.fields.some((field) => field.primaryKey && field.required);
|
|
1693
|
-
},
|
|
1699
|
+
}, ...(ngDevMode ? [{ debugName: "hasRequiredPrimaryKey" }] : []));
|
|
1694
1700
|
primaryKeyPath = computed(() => {
|
|
1695
1701
|
const meta = this.store.resourceMeta();
|
|
1696
1702
|
const isConsolidated = meta.consolidatedRoute !== undefined;
|
|
@@ -1705,7 +1711,7 @@ class ResourceCreateComponent {
|
|
|
1705
1711
|
return pathPrefix;
|
|
1706
1712
|
}
|
|
1707
1713
|
return pathPrefix + '/' + keyPath;
|
|
1708
|
-
},
|
|
1714
|
+
}, ...(ngDevMode ? [{ debugName: "primaryKeyPath" }] : []));
|
|
1709
1715
|
camelCaseToTitlePipe = new CamelCaseToTitlePipe();
|
|
1710
1716
|
ngOnInit() {
|
|
1711
1717
|
if (this.resourceMeta(this.config().primaryResource)) {
|
|
@@ -1802,10 +1808,10 @@ class ResourceCreateComponent {
|
|
|
1802
1808
|
.subscribe();
|
|
1803
1809
|
});
|
|
1804
1810
|
}
|
|
1805
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1806
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
1811
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceCreateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1812
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ResourceCreateComponent, isStandalone: true, selector: "ccc-resource-create", inputs: { resourceConfig: { classPropertyName: "resourceConfig", publicName: "resourceConfig", isSignal: true, isRequired: false, transformFunction: null }, parentData: { classPropertyName: "parentData", publicName: "parentData", isSignal: true, isRequired: false, transformFunction: null }, loadCreatedResource: { classPropertyName: "loadCreatedResource", publicName: "loadCreatedResource", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { complete: "complete" }, providers: [ResourceStore], ngImport: i0, template: "<div class=\"page-container\">\n <div class=\"header-container\">\n <div class=\"title\" [class.indent]=\"indentTitle()\">\n <h1>Create {{ config().title }}</h1>\n </div>\n\n <div class=\"state-buttons\">\n @if (!form().valid && submitted()) {\n <div class=\"invalid message\">Please complete or fix required fields.</div>\n }\n <button mat-raised-button color=\"primary\" (click)=\"cancelForm()\">Cancel</button>\n <button mat-raised-button color=\"accent\" (click)=\"saveForm()\" [disabled]=\"form().pristine\">Create</button>\n </div>\n </div>\n\n <div class=\"resource-container\">\n <form [formGroup]=\"form()\">\n <div class=\"resource row\">\n @for (element of config().elements; track element) {\n <ccc-resource-layout-template\n [element]=\"element\"\n [meta]=\"store.resourceMeta()\"\n [fieldClass]=\"config().fieldClass\"\n [relatedData]=\"parentData()\"\n editMode=\"edit\"\n [form]=\"form()\"></ccc-resource-layout-template>\n }\n </div>\n </form>\n </div>\n</div>\n", styles: [".container{border:1px solid #8e8e8e;border-radius:5px;position:relative;margin-bottom:20px;padding-top:10px}.label{position:absolute;top:-15px;left:20px;height:20px;background-color:#fff;margin:0 10px;padding:0 10px;text-align:center;z-index:10;font-weight:500;font:18px Roboto,sans-serif}.page-container{position:relative}.header-container{margin:20px 20px 0;display:flex;flex-direction:row;top:0;z-index:11;background:transparent}.title{display:flex;align-items:center;flex-shrink:0}.indent{padding-left:20px}.message{margin-top:auto;margin-bottom:auto}.state-buttons{display:flex;flex-direction:row;margin-top:auto;margin-bottom:auto;justify-content:right;flex-grow:1;gap:20px}.mode-text{margin-top:auto;margin-bottom:auto}.resource{margin:10px}.section h2{font-size:1.5em;border-bottom:2px solid #ccc;padding-bottom:8px;margin-bottom:100px}.section{margin-top:15px}.divider{margin:16px 0}.section-elements{display:flex;flex-wrap:wrap}.mat-input-element:disabled[readonly]{color:currentColor}.unsaved{color:#f44336}.edit-button{margin-top:auto;margin-bottom:auto;padding-left:10px}.button-text{display:flex;flex-direction:row;align-items:center}.button-text .edit{color:#003b49}.button-text .mat-icon{margin-right:8px}.shaded{background-color:#e9e9e9}.rounded{border-radius:8px}.dotted-outline{border:1px dotted #ccc;padding:8px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: ResourceLayoutComponent, selector: "ccc-resource-layout-template", inputs: ["element", "meta", "fieldClass", "editMode", "form", "formDataState", "pristineValue", "relatedData", "parentClass", "layoutNestingDepth"], outputs: ["formDataStateChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1807
1813
|
}
|
|
1808
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1814
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceCreateComponent, decorators: [{
|
|
1809
1815
|
type: Component,
|
|
1810
1816
|
args: [{ selector: 'ccc-resource-create', imports: [
|
|
1811
1817
|
FormsModule,
|
|
@@ -1824,13 +1830,13 @@ class ResourceArrayViewComponent {
|
|
|
1824
1830
|
resourceMeta = inject(RESOURCE_META);
|
|
1825
1831
|
store = inject(ResourceStore);
|
|
1826
1832
|
injector = inject(Injector);
|
|
1827
|
-
resourceConfig = input.required(
|
|
1828
|
-
parentData = input({},
|
|
1833
|
+
resourceConfig = input.required(...(ngDevMode ? [{ debugName: "resourceConfig" }] : []));
|
|
1834
|
+
parentData = input({}, ...(ngDevMode ? [{ debugName: "parentData" }] : []));
|
|
1829
1835
|
expPanel = viewChild('expPanel', { ...(ngDevMode ? { debugName: "expPanel" } : {}), read: MatExpansionPanel });
|
|
1830
1836
|
emptyOneToOne = output();
|
|
1831
|
-
createMode = signal(false,
|
|
1837
|
+
createMode = signal(false, ...(ngDevMode ? [{ debugName: "createMode" }] : []));
|
|
1832
1838
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1833
|
-
compoundResourceComponent = input.required(
|
|
1839
|
+
compoundResourceComponent = input.required(...(ngDevMode ? [{ debugName: "compoundResourceComponent" }] : []));
|
|
1834
1840
|
showCreateButton = computed(() => {
|
|
1835
1841
|
const list = this.store.listData();
|
|
1836
1842
|
const resourceConfig = this.resourceConfig();
|
|
@@ -1843,7 +1849,7 @@ class ResourceArrayViewComponent {
|
|
|
1843
1849
|
return true;
|
|
1844
1850
|
}
|
|
1845
1851
|
return false;
|
|
1846
|
-
},
|
|
1852
|
+
}, ...(ngDevMode ? [{ debugName: "showCreateButton" }] : []));
|
|
1847
1853
|
createActionConfig = computed(() => {
|
|
1848
1854
|
const config = this.resourceConfig();
|
|
1849
1855
|
const showCreate = this.showCreateButton();
|
|
@@ -1857,7 +1863,7 @@ class ResourceArrayViewComponent {
|
|
|
1857
1863
|
shouldRender: () => (showCreate && config.shouldRenderActions?.create?.(this.parentData())) ?? false,
|
|
1858
1864
|
resourceData: this.parentData(),
|
|
1859
1865
|
};
|
|
1860
|
-
},
|
|
1866
|
+
}, ...(ngDevMode ? [{ debugName: "createActionConfig" }] : []));
|
|
1861
1867
|
createConfig = computed(() => {
|
|
1862
1868
|
const config = this.resourceConfig();
|
|
1863
1869
|
if (config.createConfig && Object.keys(config.createConfig).length !== 0) {
|
|
@@ -1867,12 +1873,12 @@ class ResourceArrayViewComponent {
|
|
|
1867
1873
|
return config.iteratedConfig;
|
|
1868
1874
|
}
|
|
1869
1875
|
return config;
|
|
1870
|
-
},
|
|
1876
|
+
}, ...(ngDevMode ? [{ debugName: "createConfig" }] : []));
|
|
1871
1877
|
resourceListRoute = computed(() => {
|
|
1872
1878
|
const config = this.resourceConfig();
|
|
1873
1879
|
const meta = this.resourceMeta(config.connectorResource || config.primaryResource);
|
|
1874
1880
|
return meta.route;
|
|
1875
|
-
},
|
|
1881
|
+
}, ...(ngDevMode ? [{ debugName: "resourceListRoute" }] : []));
|
|
1876
1882
|
setCreateMode(value) {
|
|
1877
1883
|
this.createMode.set(value);
|
|
1878
1884
|
if (value && this.expPanel && this.expPanel()?.closed) {
|
|
@@ -1925,10 +1931,10 @@ class ResourceArrayViewComponent {
|
|
|
1925
1931
|
this.store.reloadListData();
|
|
1926
1932
|
this.setCreateMode(false);
|
|
1927
1933
|
}
|
|
1928
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1929
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
1934
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceArrayViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1935
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ResourceArrayViewComponent, isStandalone: true, selector: "ccc-resource-array-view", inputs: { resourceConfig: { classPropertyName: "resourceConfig", publicName: "resourceConfig", isSignal: true, isRequired: true, transformFunction: null }, parentData: { classPropertyName: "parentData", publicName: "parentData", isSignal: true, isRequired: false, transformFunction: null }, compoundResourceComponent: { classPropertyName: "compoundResourceComponent", publicName: "compoundResourceComponent", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { emptyOneToOne: "emptyOneToOne" }, providers: [ResourceStore], viewQueries: [{ propertyName: "expPanel", first: true, predicate: ["expPanel"], descendants: true, read: MatExpansionPanel, isSignal: true }], ngImport: i0, template: "@if (resourceConfig().title !== '') {\n <div class=\"resource-array-view\">\n <mat-expansion-panel\n #expPanel\n [@.disabled]=\"true\"\n [disabled]=\"!resourceConfig().collapsible\"\n [expanded]=\"!resourceConfig().collapsible\">\n <mat-expansion-panel-header>\n @if (resourceConfig().title) {\n <mat-panel-title>\n <h1 class=\"title\">\n {{ resourceConfig().title }}\n </h1>\n </mat-panel-title>\n }\n <action-access-control-wrapper [actionContext]=\"createActionConfig()\">\n <button\n mat-icon-button\n class=\"exp-panel-add-element-btn\"\n color=\"accent\"\n (click)=\"createResource($event)\"\n [matTooltip]=\"resourceConfig().createButtonLabel\"\n matTooltipPosition=\"above\">\n <mat-icon color=\"accent\">add_circle</mat-icon>\n </button>\n </action-access-control-wrapper>\n </mat-expansion-panel-header>\n\n @if (!resourceConfig().collapsible && !resourceConfig().title) {\n <div class=\"no-title-exp-panel-padding\"></div>\n }\n\n @if (createMode()) {\n <ccc-resource-create\n [resourceConfig]=\"createConfig()\"\n [parentData]=\"parentData()\"\n (complete)=\"onCreateCompleted()\">\n </ccc-resource-create>\n }\n @if (store.listStatus() === 'resolved') {\n @for (resource of store.listData(); track resource['id']; let i = $index) {\n @let resourceId = (resource[resourceConfig().connectorField] || resource['id']) + '';\n\n @if (parentData() && resourceConfig().iteratedConfig && resourceId && i + 1 <= resourceConfig().limit) {\n <ng-container *ngComponentOutlet=\"compoundResourceComponent();\n inputs: { \n uuid: resourceId, \n parentData: parentData(), \n isArrayChild: true, \n resourceConfig: resourceConfig().iteratedConfig \n }\">\n </ng-container>\n }\n }\n } @else {\n <div class=\"resource-container empty\">\n <div class=\"resource row\"></div>\n </div>\n }\n\n @if (store.listData().length === 0) {\n <div>No records found</div>\n }\n </mat-expansion-panel>\n </div>\n} @else {\n @if (createMode()) {\n <ccc-resource-create [resourceConfig]=\"createConfig()\" [parentData]=\"parentData()\" (complete)=\"onCreateCompleted()\">\n </ccc-resource-create>\n }\n @if (store.listStatus() === 'resolved') {\n @for (resource of store.listData(); track resource['id']; let i = $index) {\n @if (parentData() && resourceConfig().iteratedConfig && resource['id'] && i + 1 <= resourceConfig().limit) {\n <ng-container *ngComponentOutlet=\"compoundResourceComponent();\n inputs: { \n uuid: resource['id'] + '', \n parentData: parentData(), \n isArrayChild: true, \n resourceConfig: resourceConfig().iteratedConfig \n }\">\n </ng-container>\n }\n }\n } @else {\n <div class=\"resource-container empty\">\n <div class=\"resource row\"></div>\n </div>\n }\n\n @if (store.listData().length === 0) {\n <div>No records found</div>\n }\n}\n", styles: [".resource-array-view{display:flex;flex-direction:column;min-height:36px;padding:10px 0 0}.title{display:flex;align-items:center;flex-shrink:0}.exp-panel-add-element-btn{margin-right:10px;transform:scale(1.2)}.no-title-exp-panel-padding{padding:10px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "component", type: i2$3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i2$3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i2$3.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: ResourceCreateComponent, selector: "ccc-resource-create", inputs: ["resourceConfig", "parentData", "loadCreatedResource"], outputs: ["complete"] }, { kind: "component", type: ActionAccessControlWrapperComponent, selector: "action-access-control-wrapper", inputs: ["actionContext"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }] });
|
|
1930
1936
|
}
|
|
1931
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1937
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceArrayViewComponent, decorators: [{
|
|
1932
1938
|
type: Component,
|
|
1933
1939
|
args: [{ selector: 'ccc-resource-array-view', imports: [
|
|
1934
1940
|
MatButtonModule,
|
|
@@ -1980,19 +1986,19 @@ function formatDateString(formatString, value) {
|
|
|
1980
1986
|
|
|
1981
1987
|
class ResourceListComponent {
|
|
1982
1988
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1983
|
-
compoundResourceComponent = input.required(
|
|
1989
|
+
compoundResourceComponent = input.required(...(ngDevMode ? [{ debugName: "compoundResourceComponent" }] : []));
|
|
1984
1990
|
resourceMeta = inject(RESOURCE_META);
|
|
1985
1991
|
router = inject(Router);
|
|
1986
1992
|
store = inject(ResourceStore);
|
|
1987
1993
|
injector = inject(Injector);
|
|
1988
1994
|
activatedRoute = inject(ActivatedRoute);
|
|
1989
|
-
hideCreateButton = input(true,
|
|
1995
|
+
hideCreateButton = input(true, ...(ngDevMode ? [{ debugName: "hideCreateButton" }] : []));
|
|
1990
1996
|
createMode = output();
|
|
1991
|
-
resourceConfig = input(
|
|
1992
|
-
viewRoute = input(
|
|
1993
|
-
filter = input('',
|
|
1994
|
-
linkCreateType = input(false,
|
|
1995
|
-
isRootList = input(true,
|
|
1997
|
+
resourceConfig = input(...(ngDevMode ? [undefined, { debugName: "resourceConfig" }] : []));
|
|
1998
|
+
viewRoute = input(...(ngDevMode ? [undefined, { debugName: "viewRoute" }] : []));
|
|
1999
|
+
filter = input('', ...(ngDevMode ? [{ debugName: "filter" }] : []));
|
|
2000
|
+
linkCreateType = input(false, ...(ngDevMode ? [{ debugName: "linkCreateType" }] : []));
|
|
2001
|
+
isRootList = input(true, ...(ngDevMode ? [{ debugName: "isRootList" }] : []));
|
|
1996
2002
|
showCreateButton = computed(() => {
|
|
1997
2003
|
const config = this.config();
|
|
1998
2004
|
if (config.createTitle !== '' && !config.collapsible && !this.hideCreateButton()) {
|
|
@@ -2002,7 +2008,7 @@ class ResourceListComponent {
|
|
|
2002
2008
|
return true;
|
|
2003
2009
|
}
|
|
2004
2010
|
return false;
|
|
2005
|
-
},
|
|
2011
|
+
}, ...(ngDevMode ? [{ debugName: "showCreateButton" }] : []));
|
|
2006
2012
|
createButtonContext = computed(() => {
|
|
2007
2013
|
const config = this.resourceConfig();
|
|
2008
2014
|
const showCreate = this.showCreateButton();
|
|
@@ -2018,7 +2024,7 @@ class ResourceListComponent {
|
|
|
2018
2024
|
shouldRender: (data) => showCreate && config.shouldRenderActions.create(data),
|
|
2019
2025
|
resourceData: this.relatedData() ?? {},
|
|
2020
2026
|
};
|
|
2021
|
-
},
|
|
2027
|
+
}, ...(ngDevMode ? [{ debugName: "createButtonContext" }] : []));
|
|
2022
2028
|
searchableFields = computed(() => {
|
|
2023
2029
|
const meta = this.meta();
|
|
2024
2030
|
if (!meta)
|
|
@@ -2026,54 +2032,54 @@ class ResourceListComponent {
|
|
|
2026
2032
|
return `over fields of ${meta.route}`;
|
|
2027
2033
|
// TODO: implement searchable fields based on resource meta
|
|
2028
2034
|
// return meta.searchableFields.join(', ') || '';
|
|
2029
|
-
},
|
|
2030
|
-
relatedData = input(
|
|
2031
|
-
parentId = input(
|
|
2035
|
+
}, ...(ngDevMode ? [{ debugName: "searchableFields" }] : []));
|
|
2036
|
+
relatedData = input(...(ngDevMode ? [undefined, { debugName: "relatedData" }] : []));
|
|
2037
|
+
parentId = input(...(ngDevMode ? [undefined, { debugName: "parentId" }] : []));
|
|
2032
2038
|
routeConfig = computed(() => {
|
|
2033
2039
|
return this.activatedRoute.snapshot.data['config'];
|
|
2034
|
-
},
|
|
2040
|
+
}, ...(ngDevMode ? [{ debugName: "routeConfig" }] : []));
|
|
2035
2041
|
config = computed(() => {
|
|
2036
2042
|
return this.resourceConfig();
|
|
2037
|
-
},
|
|
2043
|
+
}, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
2038
2044
|
expansionConfig = computed(() => {
|
|
2039
2045
|
const config = this.config().rowExpansionConfig;
|
|
2040
2046
|
if (config.type !== 'Component' && config.type !== 'Array') {
|
|
2041
2047
|
config.showBackButton = false;
|
|
2042
2048
|
}
|
|
2043
2049
|
return config;
|
|
2044
|
-
},
|
|
2050
|
+
}, ...(ngDevMode ? [{ debugName: "expansionConfig" }] : []));
|
|
2045
2051
|
viewRouteFallback = computed(() => {
|
|
2046
2052
|
if (this.viewRoute()) {
|
|
2047
2053
|
return this.viewRoute();
|
|
2048
2054
|
}
|
|
2049
2055
|
return this.resourceMeta(this.config().primaryResource).route;
|
|
2050
|
-
},
|
|
2056
|
+
}, ...(ngDevMode ? [{ debugName: "viewRouteFallback" }] : []));
|
|
2051
2057
|
listTitle = computed(() => {
|
|
2052
2058
|
if (this.config()?.collapsible)
|
|
2053
2059
|
return '';
|
|
2054
2060
|
return this.config().title || '';
|
|
2055
|
-
},
|
|
2061
|
+
}, ...(ngDevMode ? [{ debugName: "listTitle" }] : []));
|
|
2056
2062
|
indentTitle = computed(() => {
|
|
2057
2063
|
if (this.config() === undefined) {
|
|
2058
2064
|
return false;
|
|
2059
2065
|
}
|
|
2060
2066
|
return true;
|
|
2061
|
-
},
|
|
2067
|
+
}, ...(ngDevMode ? [{ debugName: "indentTitle" }] : []));
|
|
2062
2068
|
createButtonLabel = computed(() => {
|
|
2063
2069
|
return this.config().createButtonLabel || 'Create';
|
|
2064
|
-
},
|
|
2070
|
+
}, ...(ngDevMode ? [{ debugName: "createButtonLabel" }] : []));
|
|
2065
2071
|
meta = computed(() => {
|
|
2066
2072
|
const config = this.config();
|
|
2067
2073
|
return this.resourceMeta(config.overrideResource || config.primaryResource);
|
|
2068
|
-
},
|
|
2069
|
-
resourceRefMap = signal(new Map(),
|
|
2074
|
+
}, ...(ngDevMode ? [{ debugName: "meta" }] : []));
|
|
2075
|
+
resourceRefMap = signal(new Map(), ...(ngDevMode ? [{ debugName: "resourceRefMap" }] : []));
|
|
2070
2076
|
primaryKeys = computed(() => {
|
|
2071
2077
|
const meta = this.meta();
|
|
2072
2078
|
if (!meta) {
|
|
2073
2079
|
return [];
|
|
2074
2080
|
}
|
|
2075
2081
|
return meta.fields.filter((field) => field.primaryKey !== undefined);
|
|
2076
|
-
},
|
|
2082
|
+
}, ...(ngDevMode ? [{ debugName: "primaryKeys" }] : []));
|
|
2077
2083
|
rootColumns = computed(() => {
|
|
2078
2084
|
const config = this.config();
|
|
2079
2085
|
const idCols = [];
|
|
@@ -2099,7 +2105,7 @@ class ResourceListComponent {
|
|
|
2099
2105
|
}
|
|
2100
2106
|
}
|
|
2101
2107
|
return [...new Set([...idCols, ...config.listColumns])];
|
|
2102
|
-
},
|
|
2108
|
+
}, ...(ngDevMode ? [{ debugName: "rootColumns" }] : []));
|
|
2103
2109
|
columns = computed(() => {
|
|
2104
2110
|
const refmap = this.resourceRefMap();
|
|
2105
2111
|
const cols = this.rootColumns();
|
|
@@ -2208,7 +2214,7 @@ class ResourceListComponent {
|
|
|
2208
2214
|
});
|
|
2209
2215
|
}
|
|
2210
2216
|
return columns;
|
|
2211
|
-
},
|
|
2217
|
+
}, ...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
2212
2218
|
reloadListData() {
|
|
2213
2219
|
this.store.reloadListData();
|
|
2214
2220
|
}
|
|
@@ -2234,7 +2240,7 @@ class ResourceListComponent {
|
|
|
2234
2240
|
}
|
|
2235
2241
|
return updatedRow;
|
|
2236
2242
|
});
|
|
2237
|
-
},
|
|
2243
|
+
}, ...(ngDevMode ? [{ debugName: "processedRowData" }] : []));
|
|
2238
2244
|
filters = computed(() => {
|
|
2239
2245
|
const configFilter = this.config().filter?.(this.relatedData()) || '';
|
|
2240
2246
|
const inputFilter = this.filter();
|
|
@@ -2245,7 +2251,7 @@ class ResourceListComponent {
|
|
|
2245
2251
|
return `(${inputFilter})`;
|
|
2246
2252
|
}
|
|
2247
2253
|
return configFilter || '';
|
|
2248
|
-
},
|
|
2254
|
+
}, ...(ngDevMode ? [{ debugName: "filters" }] : []));
|
|
2249
2255
|
createResource(event) {
|
|
2250
2256
|
event.stopPropagation();
|
|
2251
2257
|
this.createMode.emit(true);
|
|
@@ -2256,13 +2262,13 @@ class ResourceListComponent {
|
|
|
2256
2262
|
}
|
|
2257
2263
|
const parent = this.config().parentRelation?.parentKey;
|
|
2258
2264
|
return this.relatedData()?.[parent] || '';
|
|
2259
|
-
},
|
|
2265
|
+
}, ...(ngDevMode ? [{ debugName: "parentKey" }] : []));
|
|
2260
2266
|
childKey = computed(() => {
|
|
2261
2267
|
if (!this.config().parentRelation) {
|
|
2262
2268
|
return '';
|
|
2263
2269
|
}
|
|
2264
2270
|
return this.config().parentRelation?.childKey;
|
|
2265
|
-
},
|
|
2271
|
+
}, ...(ngDevMode ? [{ debugName: "childKey" }] : []));
|
|
2266
2272
|
getUniqueId(baseId, usedIds) {
|
|
2267
2273
|
if (!usedIds.has(baseId)) {
|
|
2268
2274
|
return baseId;
|
|
@@ -2299,8 +2305,8 @@ class ResourceListComponent {
|
|
|
2299
2305
|
if (meta === undefined) {
|
|
2300
2306
|
return;
|
|
2301
2307
|
}
|
|
2302
|
-
const route = signal(meta.route,
|
|
2303
|
-
const resource = signal(id.resource,
|
|
2308
|
+
const route = signal(meta.route, ...(ngDevMode ? [{ debugName: "route" }] : []));
|
|
2309
|
+
const resource = signal(id.resource, ...(ngDevMode ? [{ debugName: "resource" }] : []));
|
|
2304
2310
|
if (!this.resourceRefMap().has(resource())) {
|
|
2305
2311
|
const ref = this.store.resourceList(route);
|
|
2306
2312
|
if (ref === undefined) {
|
|
@@ -2319,10 +2325,10 @@ class ResourceListComponent {
|
|
|
2319
2325
|
});
|
|
2320
2326
|
});
|
|
2321
2327
|
}
|
|
2322
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
2323
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
2328
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2329
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ResourceListComponent, isStandalone: true, selector: "ccc-resource-list", inputs: { compoundResourceComponent: { classPropertyName: "compoundResourceComponent", publicName: "compoundResourceComponent", isSignal: true, isRequired: true, transformFunction: null }, hideCreateButton: { classPropertyName: "hideCreateButton", publicName: "hideCreateButton", isSignal: true, isRequired: false, transformFunction: null }, resourceConfig: { classPropertyName: "resourceConfig", publicName: "resourceConfig", isSignal: true, isRequired: false, transformFunction: null }, viewRoute: { classPropertyName: "viewRoute", publicName: "viewRoute", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, linkCreateType: { classPropertyName: "linkCreateType", publicName: "linkCreateType", isSignal: true, isRequired: false, transformFunction: null }, isRootList: { classPropertyName: "isRootList", publicName: "isRootList", isSignal: true, isRequired: false, transformFunction: null }, relatedData: { classPropertyName: "relatedData", publicName: "relatedData", isSignal: true, isRequired: false, transformFunction: null }, parentId: { classPropertyName: "parentId", publicName: "parentId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { createMode: "createMode" }, providers: [ResourceStore], ngImport: i0, template: "<div [class]=\"linkCreateType() ? 'page-container hide' : 'page-container'\">\n <div class=\"header-container\" [class.show-background]=\"!config().collapsible\" [class.indent]=\"indentTitle()\">\n <h1 class=\"title\">{{ listTitle() }}</h1>\n <action-access-control-wrapper [actionContext]=\"createButtonContext()\">\n <div class=\"create-button\">\n <button mat-raised-button color=\"accent\" (click)=\"createResource($event)\">\n <div class=\"edit-text\">\n <mat-icon>create</mat-icon>\n <span class=\"edit-button-text\"> {{ createButtonLabel() }} </span>\n </div>\n </button>\n </div>\n </action-access-control-wrapper>\n </div>\n <div class=\"resource-container\">\n @if (config().searchable) {\n <mat-form-field class=\"search\">\n <input matInput #qry (keyup)=\"store.searchTokens.set(qry.value)\" placeholder=\"Search\" aria-label=\"Search\" />\n @if (searchableFields() !== '') {\n <mat-hint>Search {{ searchableFields() }}</mat-hint>\n }\n <mat-icon matPrefix>search</mat-icon>\n </mat-form-field>\n }\n <ccc-grid\n [rowData]=\"processedRowData()\"\n [columnDefs]=\"columns()\"\n [enableRowExpansion]=\"config().enableRowExpansion\"\n [detailTemplate]=\"expandedRowTemplate\">\n </ccc-grid>\n </div>\n</div>\n\n<ng-template #expandedRowTemplate let-rowData>\n <ng-container\n *ngComponentOutlet=\"\n compoundResourceComponent();\n inputs: {\n uuid: rowData.id,\n navAfterDelete: false,\n deleted: store.reloadListData.bind(store),\n resourceConfig: expansionConfig(),\n }\n \">\n </ng-container>\n</ng-template>\n", styles: [".page-container{position:relative;margin:10px 0 0}.header-container{margin-top:10px;display:flex;flex-direction:row;justify-content:space-between;top:0;z-index:10;width:100%}.title{display:flex;align-items:center;flex-shrink:0}.create-button{margin-top:auto;margin-bottom:auto;padding-left:10px}.edit-text{display:flex;flex-direction:row;align-items:center}.edit-text .edit{color:#003b49}.edit-text .mat-icon{margin-right:8px}.edit-button-text{margin-top:auto;margin-bottom:auto}.exp-panel-add-element-btn{margin-right:10px;transform:scale(1.2)}.hide{display:none}.show-background{background-color:#fff;padding-bottom:20px}.indent{padding-left:20px}.search{width:100%}\n"], dependencies: [{ kind: "component", type: AppGridComponent, selector: "ccc-grid", inputs: ["rowData", "columnDefs", "enableRowExpansion", "detailTemplate", "selectionType"], outputs: ["selectedRows"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "component", type: ActionAccessControlWrapperComponent, selector: "action-access-control-wrapper", inputs: ["actionContext"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }] });
|
|
2324
2330
|
}
|
|
2325
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2331
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceListComponent, decorators: [{
|
|
2326
2332
|
type: Component,
|
|
2327
2333
|
args: [{ standalone: true, imports: [
|
|
2328
2334
|
AppGridComponent,
|
|
@@ -2340,59 +2346,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
2340
2346
|
|
|
2341
2347
|
class ResourceListCreateComponent {
|
|
2342
2348
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2343
|
-
compoundResourceComponent = input.required(
|
|
2349
|
+
compoundResourceComponent = input.required(...(ngDevMode ? [{ debugName: "compoundResourceComponent" }] : []));
|
|
2344
2350
|
injector = inject(Injector);
|
|
2345
2351
|
store = inject(ResourceStore);
|
|
2346
2352
|
listChild = viewChild('list', { ...(ngDevMode ? { debugName: "listChild" } : {}), read: ResourceListComponent });
|
|
2347
2353
|
route = inject(ActivatedRoute);
|
|
2348
2354
|
router = inject(Router);
|
|
2349
|
-
create = signal(false,
|
|
2350
|
-
parentId = input(
|
|
2351
|
-
parentData = input({},
|
|
2352
|
-
searchParams = input([],
|
|
2353
|
-
resourceConfig = input(
|
|
2354
|
-
isRootList = input(true,
|
|
2355
|
+
create = signal(false, ...(ngDevMode ? [{ debugName: "create" }] : []));
|
|
2356
|
+
parentId = input(...(ngDevMode ? [undefined, { debugName: "parentId" }] : []));
|
|
2357
|
+
parentData = input({}, ...(ngDevMode ? [{ debugName: "parentData" }] : []));
|
|
2358
|
+
searchParams = input([], ...(ngDevMode ? [{ debugName: "searchParams" }] : []));
|
|
2359
|
+
resourceConfig = input(...(ngDevMode ? [undefined, { debugName: "resourceConfig" }] : []));
|
|
2360
|
+
isRootList = input(true, ...(ngDevMode ? [{ debugName: "isRootList" }] : []));
|
|
2355
2361
|
childKey = computed(() => {
|
|
2356
2362
|
if (!this.config().parentRelation) {
|
|
2357
2363
|
return '';
|
|
2358
2364
|
}
|
|
2359
2365
|
return this.config().parentRelation?.childKey;
|
|
2360
|
-
},
|
|
2366
|
+
}, ...(ngDevMode ? [{ debugName: "childKey" }] : []));
|
|
2361
2367
|
filter = computed(() => {
|
|
2362
2368
|
const filters = [];
|
|
2363
2369
|
if (this.childKey() !== '' && this.parentKey() !== '') {
|
|
2364
2370
|
filters.push(`${this.childKey()}:eq:${this.parentKey()}`);
|
|
2365
2371
|
}
|
|
2366
2372
|
return filters.join(',');
|
|
2367
|
-
},
|
|
2373
|
+
}, ...(ngDevMode ? [{ debugName: "filter" }] : []));
|
|
2368
2374
|
parentKey = computed(() => {
|
|
2369
2375
|
if (this.parentData() === undefined || this.childKey() === undefined) {
|
|
2370
2376
|
return '';
|
|
2371
2377
|
}
|
|
2372
2378
|
const parent = this.config().parentRelation?.parentKey;
|
|
2373
2379
|
return this.parentData()?.[parent] || '';
|
|
2374
|
-
},
|
|
2380
|
+
}, ...(ngDevMode ? [{ debugName: "parentKey" }] : []));
|
|
2375
2381
|
config = computed(() => {
|
|
2376
2382
|
const inputConfig = this.resourceConfig();
|
|
2377
2383
|
if (inputConfig) {
|
|
2378
2384
|
return inputConfig;
|
|
2379
2385
|
}
|
|
2380
2386
|
return this.rootConfig().parentConfig;
|
|
2381
|
-
},
|
|
2387
|
+
}, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
2382
2388
|
expPanel = viewChild('expPanel', { ...(ngDevMode ? { debugName: "expPanel" } : {}), read: MatExpansionPanel });
|
|
2383
2389
|
rootConfig = computed(() => {
|
|
2384
2390
|
return this.route.snapshot.data['config'];
|
|
2385
|
-
},
|
|
2391
|
+
}, ...(ngDevMode ? [{ debugName: "rootConfig" }] : []));
|
|
2386
2392
|
createLinkType = computed(() => {
|
|
2387
2393
|
return this.config().loadCreatedResource && this.create();
|
|
2388
|
-
},
|
|
2394
|
+
}, ...(ngDevMode ? [{ debugName: "createLinkType" }] : []));
|
|
2389
2395
|
createConfig = computed(() => {
|
|
2390
2396
|
const config = this.config();
|
|
2391
2397
|
if (Object.keys(config.createConfig).length !== 0) {
|
|
2392
2398
|
return config.createConfig;
|
|
2393
2399
|
}
|
|
2394
2400
|
return config;
|
|
2395
|
-
},
|
|
2401
|
+
}, ...(ngDevMode ? [{ debugName: "createConfig" }] : []));
|
|
2396
2402
|
createResource(event) {
|
|
2397
2403
|
event.stopPropagation();
|
|
2398
2404
|
this.create.set(true);
|
|
@@ -2406,10 +2412,10 @@ class ResourceListCreateComponent {
|
|
|
2406
2412
|
this.create.set(false);
|
|
2407
2413
|
}
|
|
2408
2414
|
}
|
|
2409
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
2410
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
2415
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceListCreateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2416
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ResourceListCreateComponent, isStandalone: true, selector: "ccc-resource-list-create", inputs: { compoundResourceComponent: { classPropertyName: "compoundResourceComponent", publicName: "compoundResourceComponent", isSignal: true, isRequired: true, transformFunction: null }, parentId: { classPropertyName: "parentId", publicName: "parentId", isSignal: true, isRequired: false, transformFunction: null }, parentData: { classPropertyName: "parentData", publicName: "parentData", isSignal: true, isRequired: false, transformFunction: null }, searchParams: { classPropertyName: "searchParams", publicName: "searchParams", isSignal: true, isRequired: false, transformFunction: null }, resourceConfig: { classPropertyName: "resourceConfig", publicName: "resourceConfig", isSignal: true, isRequired: false, transformFunction: null }, isRootList: { classPropertyName: "isRootList", publicName: "isRootList", isSignal: true, isRequired: false, transformFunction: null } }, providers: [ResourceStore], viewQueries: [{ propertyName: "listChild", first: true, predicate: ["list"], descendants: true, read: ResourceListComponent, isSignal: true }, { propertyName: "expPanel", first: true, predicate: ["expPanel"], descendants: true, read: MatExpansionPanel, isSignal: true }], ngImport: i0, template: "@if (config().collapsible) {\n <div class=\"page-container\">\n <mat-expansion-panel\n #expPanel\n [@.disabled]=\"true\"\n disabled=\"{{ !config().collapsible }}\"\n expanded=\"{{ !config().collapsible }}\">\n @if (config().collapsible || config().title) {\n <mat-expansion-panel-header>\n <mat-panel-title>\n <h1 class=\"title\">\n {{ config().title }}\n </h1>\n </mat-panel-title>\n @if (config().createTitle !== '') {\n <button\n mat-icon-button\n class=\"exp-panel-add-element-btn\"\n color=\"accent\"\n (click)=\"createResource($event)\"\n matTooltip=\"{{ config().createButtonLabel }}\"\n matTooltipPosition=\"above\">\n <mat-icon color=\"accent\">add_circle</mat-icon>\n </button>\n }\n </mat-expansion-panel-header>\n } @else {\n <div class=\"no-title-exp-panel-padding\"></div>\n }\n\n <ng-container *ngTemplateOutlet=\"resourceComponents\"></ng-container>\n </mat-expansion-panel>\n </div>\n} @else {\n <ng-container *ngTemplateOutlet=\"resourceComponents\"></ng-container>\n}\n\n<ng-template #resourceComponents>\n @if (create()) {\n <ccc-resource-create\n [resourceConfig]=\"createConfig()\"\n [parentData]=\"parentData()\"\n [loadCreatedResource]=\"config().loadCreatedResource\"\n (complete)=\"makeCreatePatches()\">\n </ccc-resource-create>\n }\n\n <ccc-resource-list\n #list\n [viewRoute]=\"rootConfig().routeData.route\"\n [resourceConfig]=\"config()\"\n [filter]=\"filter()\"\n [hideCreateButton]=\"create()\"\n [relatedData]=\"parentData()\"\n [parentId]=\"parentId()\"\n [linkCreateType]=\"createLinkType()\"\n [isRootList]=\"isRootList()\"\n (createMode)=\"create.set($event)\"\n [compoundResourceComponent]=\"compoundResourceComponent()\">\n </ccc-resource-list>\n</ng-template>\n", styles: [".page-container{position:relative;margin:10px 0 0}.exp-panel-add-element-btn{margin-right:10px;transform:scale(1.2)}\n"], dependencies: [{ kind: "ngmodule", type: MatExpansionModule }, { kind: "component", type: i2$3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i2$3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i2$3.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: ResourceCreateComponent, selector: "ccc-resource-create", inputs: ["resourceConfig", "parentData", "loadCreatedResource"], outputs: ["complete"] }, { kind: "component", type: ResourceListComponent, selector: "ccc-resource-list", inputs: ["compoundResourceComponent", "hideCreateButton", "resourceConfig", "viewRoute", "filter", "linkCreateType", "isRootList", "relatedData", "parentId"], outputs: ["createMode"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
2411
2417
|
}
|
|
2412
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2418
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceListCreateComponent, decorators: [{
|
|
2413
2419
|
type: Component,
|
|
2414
2420
|
args: [{ standalone: true, selector: 'ccc-resource-list-create', imports: [
|
|
2415
2421
|
MatExpansionModule,
|
|
@@ -2424,13 +2430,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
2424
2430
|
|
|
2425
2431
|
class ResourceResolverComponent {
|
|
2426
2432
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2427
|
-
compoundResourceComponent = input.required(
|
|
2428
|
-
resourceConfig = input(
|
|
2433
|
+
compoundResourceComponent = input.required(...(ngDevMode ? [{ debugName: "compoundResourceComponent" }] : []));
|
|
2434
|
+
resourceConfig = input(...(ngDevMode ? [undefined, { debugName: "resourceConfig" }] : []));
|
|
2429
2435
|
config = computed(() => {
|
|
2430
2436
|
return this.resourceConfig();
|
|
2431
|
-
},
|
|
2437
|
+
}, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
2432
2438
|
dynamicSlot = viewChild.required('dynamicSlot', { read: ViewContainerRef });
|
|
2433
|
-
parentData = input.required(
|
|
2439
|
+
parentData = input.required(...(ngDevMode ? [{ debugName: "parentData" }] : []));
|
|
2434
2440
|
constructor() {
|
|
2435
2441
|
effect(() => {
|
|
2436
2442
|
const parentData = this.parentData();
|
|
@@ -2475,19 +2481,19 @@ class ResourceResolverComponent {
|
|
|
2475
2481
|
});
|
|
2476
2482
|
});
|
|
2477
2483
|
}
|
|
2478
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
2479
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.
|
|
2484
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceResolverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2485
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.1", type: ResourceResolverComponent, isStandalone: true, selector: "ccc-resource-resolver", inputs: { compoundResourceComponent: { classPropertyName: "compoundResourceComponent", publicName: "compoundResourceComponent", isSignal: true, isRequired: true, transformFunction: null }, resourceConfig: { classPropertyName: "resourceConfig", publicName: "resourceConfig", isSignal: true, isRequired: false, transformFunction: null }, parentData: { classPropertyName: "parentData", publicName: "parentData", isSignal: true, isRequired: true, transformFunction: null } }, providers: [ResourceStore], viewQueries: [{ propertyName: "dynamicSlot", first: true, predicate: ["dynamicSlot"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<ng-template #dynamicSlot></ng-template>", styles: [""] });
|
|
2480
2486
|
}
|
|
2481
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2487
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceResolverComponent, decorators: [{
|
|
2482
2488
|
type: Component,
|
|
2483
2489
|
args: [{ selector: 'ccc-resource-resolver', imports: [], providers: [ResourceStore], template: "<ng-template #dynamicSlot></ng-template>" }]
|
|
2484
2490
|
}], ctorParameters: () => [], propDecorators: { compoundResourceComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "compoundResourceComponent", required: true }] }], resourceConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "resourceConfig", required: false }] }], dynamicSlot: [{ type: i0.ViewChild, args: ['dynamicSlot', { ...{ read: ViewContainerRef }, isSignal: true }] }], parentData: [{ type: i0.Input, args: [{ isSignal: true, alias: "parentData", required: true }] }] } });
|
|
2485
2491
|
|
|
2486
2492
|
class DeleteResourceConfirmationModalComponent {
|
|
2487
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
2488
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.
|
|
2493
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: DeleteResourceConfirmationModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2494
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.1", type: DeleteResourceConfirmationModalComponent, isStandalone: true, selector: "ccc-delete-resource-confirmation-modal", ngImport: i0, template: "<div mat-dialog-title>Are you sure you want to delete this resource?</div>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button color=\"warn\" [mat-dialog-close]=\"false\">Cancel</button>\n <button mat-raised-button color=\"accent\" [mat-dialog-close]=\"true\">Confirm</button>\n</mat-dialog-actions>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatInputModule }] });
|
|
2489
2495
|
}
|
|
2490
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2496
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: DeleteResourceConfirmationModalComponent, decorators: [{
|
|
2491
2497
|
type: Component,
|
|
2492
2498
|
args: [{ selector: 'ccc-delete-resource-confirmation-modal', imports: [MatDialogModule, MatFormFieldModule, MatDialogActions, MatButtonModule, MatInputModule], template: "<div mat-dialog-title>Are you sure you want to delete this resource?</div>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button color=\"warn\" [mat-dialog-close]=\"false\">Cancel</button>\n <button mat-raised-button color=\"accent\" [mat-dialog-close]=\"true\">Confirm</button>\n</mat-dialog-actions>\n" }]
|
|
2493
2499
|
}] });
|
|
@@ -2503,25 +2509,25 @@ class ResourceViewComponent {
|
|
|
2503
2509
|
destroyRef = inject(DestroyRef);
|
|
2504
2510
|
formState = inject(FormStateService);
|
|
2505
2511
|
dialog = inject(MatDialog);
|
|
2506
|
-
editMode = signal('view',
|
|
2507
|
-
uuid = input.required(
|
|
2508
|
-
config = input.required(
|
|
2509
|
-
relatedData = input({},
|
|
2510
|
-
compoundResourceView = input(false,
|
|
2511
|
-
isDirty = signal(false,
|
|
2512
|
-
displayFormInvalidMessage = signal(false,
|
|
2512
|
+
editMode = signal('view', ...(ngDevMode ? [{ debugName: "editMode" }] : []));
|
|
2513
|
+
uuid = input.required(...(ngDevMode ? [{ debugName: "uuid" }] : []));
|
|
2514
|
+
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
2515
|
+
relatedData = input({}, ...(ngDevMode ? [{ debugName: "relatedData" }] : []));
|
|
2516
|
+
compoundResourceView = input(false, ...(ngDevMode ? [{ debugName: "compoundResourceView" }] : []));
|
|
2517
|
+
isDirty = signal(false, ...(ngDevMode ? [{ debugName: "isDirty" }] : []));
|
|
2518
|
+
displayFormInvalidMessage = signal(false, ...(ngDevMode ? [{ debugName: "displayFormInvalidMessage" }] : []));
|
|
2513
2519
|
deleted = output();
|
|
2514
|
-
navAfterDelete = input(true,
|
|
2515
|
-
showCreateForm = model(false,
|
|
2520
|
+
navAfterDelete = input(true, ...(ngDevMode ? [{ debugName: "navAfterDelete" }] : []));
|
|
2521
|
+
showCreateForm = model(false, ...(ngDevMode ? [{ debugName: "showCreateForm" }] : []));
|
|
2516
2522
|
createConfig = computed(() => {
|
|
2517
2523
|
if (Object.keys(this.config().createConfig || {}).length > 0) {
|
|
2518
2524
|
return this.config().createConfig;
|
|
2519
2525
|
}
|
|
2520
2526
|
return this.config();
|
|
2521
|
-
},
|
|
2527
|
+
}, ...(ngDevMode ? [{ debugName: "createConfig" }] : []));
|
|
2522
2528
|
rootConfig = computed(() => {
|
|
2523
2529
|
return this.activatedRoute.snapshot.data['config'];
|
|
2524
|
-
},
|
|
2530
|
+
}, ...(ngDevMode ? [{ debugName: "rootConfig" }] : []));
|
|
2525
2531
|
showCloseButton = computed(() => {
|
|
2526
2532
|
const config = this.config();
|
|
2527
2533
|
const showBackButton = config.showBackButton ?? true;
|
|
@@ -2529,7 +2535,7 @@ class ResourceViewComponent {
|
|
|
2529
2535
|
return showBackButton && config.primaryResource === this.rootConfig().parentConfig.primaryResource;
|
|
2530
2536
|
}
|
|
2531
2537
|
return showBackButton;
|
|
2532
|
-
},
|
|
2538
|
+
}, ...(ngDevMode ? [{ debugName: "showCloseButton" }] : []));
|
|
2533
2539
|
commonButtonConfig = computed(() => {
|
|
2534
2540
|
const config = this.config();
|
|
2535
2541
|
if (config === undefined) {
|
|
@@ -2543,7 +2549,7 @@ class ResourceViewComponent {
|
|
|
2543
2549
|
resourceData: this.relatedData(),
|
|
2544
2550
|
config,
|
|
2545
2551
|
};
|
|
2546
|
-
},
|
|
2552
|
+
}, ...(ngDevMode ? [{ debugName: "commonButtonConfig" }] : []));
|
|
2547
2553
|
editButtonContext = computed(() => {
|
|
2548
2554
|
const commonConfig = this.commonButtonConfig();
|
|
2549
2555
|
if (commonConfig === undefined) {
|
|
@@ -2555,7 +2561,7 @@ class ResourceViewComponent {
|
|
|
2555
2561
|
resourceData: commonConfig.resourceData,
|
|
2556
2562
|
shouldRender: commonConfig.config.shouldRenderActions.edit,
|
|
2557
2563
|
};
|
|
2558
|
-
},
|
|
2564
|
+
}, ...(ngDevMode ? [{ debugName: "editButtonContext" }] : []));
|
|
2559
2565
|
deleteButtonContext = computed(() => {
|
|
2560
2566
|
const commonConfig = this.commonButtonConfig();
|
|
2561
2567
|
if (commonConfig === undefined) {
|
|
@@ -2567,7 +2573,7 @@ class ResourceViewComponent {
|
|
|
2567
2573
|
resourceData: commonConfig.resourceData,
|
|
2568
2574
|
shouldRender: (data) => commonConfig.config.shouldRenderActions.delete(data),
|
|
2569
2575
|
};
|
|
2570
|
-
},
|
|
2576
|
+
}, ...(ngDevMode ? [{ debugName: "deleteButtonContext" }] : []));
|
|
2571
2577
|
inlineRpcConfigs = computed(() => {
|
|
2572
2578
|
const config = this.config();
|
|
2573
2579
|
if (config === undefined) {
|
|
@@ -2584,7 +2590,7 @@ class ResourceViewComponent {
|
|
|
2584
2590
|
},
|
|
2585
2591
|
};
|
|
2586
2592
|
});
|
|
2587
|
-
},
|
|
2593
|
+
}, ...(ngDevMode ? [{ debugName: "inlineRpcConfigs" }] : []));
|
|
2588
2594
|
endRpcConfigs = computed(() => {
|
|
2589
2595
|
const config = this.config();
|
|
2590
2596
|
if (config === undefined) {
|
|
@@ -2601,7 +2607,7 @@ class ResourceViewComponent {
|
|
|
2601
2607
|
},
|
|
2602
2608
|
};
|
|
2603
2609
|
});
|
|
2604
|
-
},
|
|
2610
|
+
}, ...(ngDevMode ? [{ debugName: "endRpcConfigs" }] : []));
|
|
2605
2611
|
useExpansionPanel = computed(() => {
|
|
2606
2612
|
const config = this.config();
|
|
2607
2613
|
// TODO: Investigate why we're doing this check, it's weird because viewType is not part of the input configs
|
|
@@ -2609,12 +2615,12 @@ class ResourceViewComponent {
|
|
|
2609
2615
|
return false;
|
|
2610
2616
|
}
|
|
2611
2617
|
return config.collapsible || !this.compoundResourceView();
|
|
2612
|
-
},
|
|
2618
|
+
}, ...(ngDevMode ? [{ debugName: "useExpansionPanel" }] : []));
|
|
2613
2619
|
resourceConfigRouteSnapshot = computed(() => {
|
|
2614
2620
|
return (this.config() ||
|
|
2615
2621
|
this.activatedRoute.snapshot.data['config']?.parentConfig ||
|
|
2616
2622
|
{});
|
|
2617
|
-
},
|
|
2623
|
+
}, ...(ngDevMode ? [{ debugName: "resourceConfigRouteSnapshot" }] : []));
|
|
2618
2624
|
emptyFormGroup = new FormGroup({});
|
|
2619
2625
|
form = computed(() => {
|
|
2620
2626
|
const meta = this.store.resourceMeta();
|
|
@@ -2653,14 +2659,14 @@ class ResourceViewComponent {
|
|
|
2653
2659
|
}
|
|
2654
2660
|
this.pristineFormValues = pristineValues;
|
|
2655
2661
|
return fg;
|
|
2656
|
-
},
|
|
2662
|
+
}, ...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
2657
2663
|
pristineFormValues = {};
|
|
2658
2664
|
route = computed(() => {
|
|
2659
2665
|
const meta = this.store.resourceMeta();
|
|
2660
2666
|
if (!meta)
|
|
2661
2667
|
return '';
|
|
2662
2668
|
return meta.consolidatedRoute || meta.route;
|
|
2663
|
-
},
|
|
2669
|
+
}, ...(ngDevMode ? [{ debugName: "route" }] : []));
|
|
2664
2670
|
primaryKeys = computed(() => {
|
|
2665
2671
|
const meta = this.store.resourceMeta();
|
|
2666
2672
|
if (!meta)
|
|
@@ -2668,7 +2674,7 @@ class ResourceViewComponent {
|
|
|
2668
2674
|
return meta.fields
|
|
2669
2675
|
.filter((field) => field.primaryKey)
|
|
2670
2676
|
.sort((a, b) => a.primaryKey.ordinalPosition - b.primaryKey.ordinalPosition);
|
|
2671
|
-
},
|
|
2677
|
+
}, ...(ngDevMode ? [{ debugName: "primaryKeys" }] : []));
|
|
2672
2678
|
primaryKeyPath = computed(() => {
|
|
2673
2679
|
const meta = this.store.resourceMeta();
|
|
2674
2680
|
const isConsolidated = !!meta.consolidatedRoute;
|
|
@@ -2681,7 +2687,7 @@ class ResourceViewComponent {
|
|
|
2681
2687
|
this.primaryKeys()
|
|
2682
2688
|
.map((field) => this.store.viewData()[field.fieldName])
|
|
2683
2689
|
.join('/'));
|
|
2684
|
-
},
|
|
2690
|
+
}, ...(ngDevMode ? [{ debugName: "primaryKeyPath" }] : []));
|
|
2685
2691
|
ngOnInit() {
|
|
2686
2692
|
if (this.resourceMeta(this.config().primaryResource)) {
|
|
2687
2693
|
this.store.resourceName.set(this.config().primaryResource);
|
|
@@ -2819,10 +2825,10 @@ class ResourceViewComponent {
|
|
|
2819
2825
|
this.showCreateForm.set(false);
|
|
2820
2826
|
this.store.buildStoreViewData();
|
|
2821
2827
|
}
|
|
2822
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
2823
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.2", type: ResourceViewComponent, isStandalone: true, selector: "ccc-resource-view", inputs: { uuid: { classPropertyName: "uuid", publicName: "uuid", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, relatedData: { classPropertyName: "relatedData", publicName: "relatedData", isSignal: true, isRequired: false, transformFunction: null }, compoundResourceView: { classPropertyName: "compoundResourceView", publicName: "compoundResourceView", isSignal: true, isRequired: false, transformFunction: null }, navAfterDelete: { classPropertyName: "navAfterDelete", publicName: "navAfterDelete", isSignal: true, isRequired: false, transformFunction: null }, showCreateForm: { classPropertyName: "showCreateForm", publicName: "showCreateForm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deleted: "deleted", showCreateForm: "showCreateFormChange" }, providers: [ResourceStore], ngImport: i0, template: "@if (useExpansionPanel()) {\n <div class=\"resource-view\">\n <mat-expansion-panel [@.disabled]=\"true\" [disabled]=\"!config().collapsible\" [expanded]=\"!config().collapsible\">\n @if (config().title) {\n <mat-expansion-panel-header>\n <mat-panel-title>\n <h1 class=\"title\">{{ showCreateForm() ? 'Create' : '' }}{{ config().title }}</h1>\n </mat-panel-title>\n </mat-expansion-panel-header>\n } @else {\n <div class=\"no-title-exp-panel-padding\"></div>\n }\n <ng-container *ngTemplateOutlet=\"headerSlot\"></ng-container>\n @if (store.viewStatus() === 'resolved') {\n <div class=\"resource-container\" [class.form-edit-mode]=\"editMode() === 'edit'\">\n <form [formGroup]=\"form()\">\n <div class=\"resource row\">\n @if (showCreateForm()) {\n <ccc-resource-create\n [resourceConfig]=\"createConfig()\"\n [parentData]=\"relatedData()\"\n (complete)=\"createResource()\">\n </ccc-resource-create>\n } @else {\n <ng-container *ngTemplateOutlet=\"formSlot\"></ng-container>\n }\n </div>\n </form>\n <ng-container *ngTemplateOutlet=\"footerSlot\"></ng-container>\n </div>\n } @else {\n <div class=\"resource-container empty\">\n <div class=\"resource row\"></div>\n </div>\n }\n </mat-expansion-panel>\n </div>\n} @else {\n <div class=\"page-container\">\n @if (!showCreateForm()) {\n <ng-container *ngTemplateOutlet=\"headerSlot\"></ng-container>\n }\n @if (store.viewStatus() === 'resolved') {\n <div class=\"resource-container base-container-bg\" [class.form-edit-mode]=\"editMode() === 'edit'\">\n <form [formGroup]=\"form()\">\n <div class=\"resource row\">\n @if (showCreateForm()) {\n <ccc-resource-create\n [resourceConfig]=\"createConfig()\"\n [parentData]=\"relatedData()\"\n (complete)=\"createResource()\">\n </ccc-resource-create>\n } @else {\n <ng-container *ngTemplateOutlet=\"formSlot\"></ng-container>\n }\n </div>\n </form>\n </div>\n } @else {\n <div class=\"resource-container\">\n <div class=\"resource row empty\"></div>\n </div>\n }\n <ng-container *ngTemplateOutlet=\"footerSlot\"></ng-container>\n </div>\n}\n\n<ng-template #formSlot>\n @for (element of config().elements; track element) {\n @if (element.type === 'section' || element.type === 'computedDisplayField' || element.type === 'padding') {\n <ccc-resource-layout-template\n [element]=\"element\"\n [meta]=\"store.resourceMeta()\"\n [fieldClass]=\"config().fieldClass\"\n [editMode]=\"editMode()\"\n [relatedData]=\"relatedData()\"\n [form]=\"form()\">\n </ccc-resource-layout-template>\n } @else {\n <ccc-resource-layout-template\n [element]=\"element\"\n [meta]=\"store.resourceMeta()\"\n [fieldClass]=\"config().fieldClass\"\n [pristineValue]=\"pristineFormValues[element.name]\"\n [editMode]=\"editMode()\"\n [relatedData]=\"relatedData()\"\n [form]=\"form()\">\n </ccc-resource-layout-template>\n }\n }\n</ng-template>\n\n<ng-template #headerSlot>\n <div class=\"header-container\">\n <div class=\"state-buttons\">\n @if (store.viewStatus() === 'resolved') {\n @for (rpc of inlineRpcConfigs(); track rpc.context) {\n <action-access-control-wrapper [actionContext]=\"rpc.context\">\n <ccc-rpc-button\n [rpcConfig]=\"rpc.config\"\n [relatedData]=\"relatedData()\"\n [primaryResource]=\"config().primaryResource\">\n </ccc-rpc-button>\n </action-access-control-wrapper>\n }\n @if (editMode() === 'view') {\n <action-access-control-wrapper [actionContext]=\"editButtonContext()\">\n <div class=\"edit-button\">\n <button mat-raised-button color=\"accent\" (click)=\"setEditMode('edit')\">\n <div class=\"button-text\">\n <mat-icon>edit</mat-icon>\n <span class=\"mode-text\"> Edit </span>\n </div>\n </button>\n </div>\n </action-access-control-wrapper>\n\n <action-access-control-wrapper [actionContext]=\"deleteButtonContext()\">\n <button mat-raised-button color=\"primary\" (click)=\"confirmDeleteResource()\">Delete</button>\n </action-access-control-wrapper>\n }\n\n @if (editMode() === 'edit') {\n @if (form().dirty) {\n <div class=\"unsaved message\">You have unsaved changes!</div>\n }\n @if (!form().valid && displayFormInvalidMessage()) {\n <div class=\"invalid message\">Please complete or fix required fields.</div>\n }\n <button mat-raised-button color=\"primary\" (click)=\"resetForm()\">Cancel</button>\n <button mat-raised-button color=\"accent\" (click)=\"saveForm()\" [disabled]=\"form().pristine\">Save</button>\n }\n\n @if (showCloseButton()) {\n <div class=\"close-button\">\n <button mat-icon-button color=\"warn\" (click)=\"location.back()\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n }\n }\n </div>\n </div>\n</ng-template>\n\n<ng-template #footerSlot>\n @for (rpc of endRpcConfigs(); track rpc) {\n <action-access-control-wrapper [actionContext]=\"rpc.context\">\n <ccc-rpc-button\n [rpcConfig]=\"rpc.config\"\n [relatedData]=\"relatedData()\"\n [primaryResource]=\"config().primaryResource\">\n </ccc-rpc-button>\n </action-access-control-wrapper>\n }\n</ng-template>\n", styles: [".container{border:1px solid #8e8e8e;border-radius:5px;position:relative;margin-bottom:20px;padding-top:10px}.label{position:absolute;top:-15px;left:20px;height:20px;background-color:#fff;margin:0 10px;padding:0 10px;text-align:center;z-index:10;font-weight:500;font:18px Roboto,sans-serif}.padding{width:100px}.page-container{position:relative}.header-container{display:flex;flex-direction:row;top:0;z-index:11;background:transparent}.title{display:flex;align-items:center;flex-shrink:0}.message{margin-top:auto;margin-bottom:auto}.state-buttons{display:flex;flex-direction:row;margin-top:auto;margin-bottom:auto;justify-content:right;flex-grow:1;gap:20px;margin-right:20px;min-height:36px}.action-button,.mode-text{margin-top:auto;margin-bottom:auto}.resource{margin:10px}.section h2{font-size:1.5em;border-bottom:2px solid #ccc;padding-bottom:8px;margin-bottom:100px}.section{margin-top:15px}.divider{margin:16px 0}.section-elements{display:flex;flex-wrap:wrap}.mat-input-element:disabled[readonly]{color:currentColor}.unsaved{color:#f44336}.edit-button{margin-top:auto;margin-bottom:auto;padding-left:10px}.button-text{display:flex;flex-direction:row;align-items:center}.button-text .edit{color:#003b49}.button-text .mat-icon{margin-right:8px}.shaded{background-color:#e9e9e9}.rounded{border-radius:8px}.dotted-outline{border:1px dotted #ccc;padding:8px}.margin-top{margin-top:50px}.resource-view{display:flex;flex-direction:column;min-height:36px;padding:10px 0 0}.no-title-exp-panel-padding{padding:10px}.base-container-bg{background-color:var(--app-background-color)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2$2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: ResourceLayoutComponent, selector: "ccc-resource-layout-template", inputs: ["element", "meta", "fieldClass", "editMode", "form", "formDataState", "pristineValue", "relatedData", "parentClass", "layoutNestingDepth"], outputs: ["formDataStateChange"] }, { kind: "component", type: MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: RpcButtonComponent, selector: "ccc-rpc-button", inputs: ["relatedData", "rpcConfig", "primaryResource", "dependentResources"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ActionAccessControlWrapperComponent, selector: "action-access-control-wrapper", inputs: ["actionContext"] }, { kind: "component", type: ResourceCreateComponent, selector: "ccc-resource-create", inputs: ["resourceConfig", "parentData", "loadCreatedResource"], outputs: ["complete"] }] });
|
|
2828
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2829
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ResourceViewComponent, isStandalone: true, selector: "ccc-resource-view", inputs: { uuid: { classPropertyName: "uuid", publicName: "uuid", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, relatedData: { classPropertyName: "relatedData", publicName: "relatedData", isSignal: true, isRequired: false, transformFunction: null }, compoundResourceView: { classPropertyName: "compoundResourceView", publicName: "compoundResourceView", isSignal: true, isRequired: false, transformFunction: null }, navAfterDelete: { classPropertyName: "navAfterDelete", publicName: "navAfterDelete", isSignal: true, isRequired: false, transformFunction: null }, showCreateForm: { classPropertyName: "showCreateForm", publicName: "showCreateForm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deleted: "deleted", showCreateForm: "showCreateFormChange" }, providers: [ResourceStore], ngImport: i0, template: "@if (useExpansionPanel()) {\n <div class=\"resource-view\">\n <mat-expansion-panel [@.disabled]=\"true\" [disabled]=\"!config().collapsible\" [expanded]=\"!config().collapsible\">\n @if (config().title) {\n <mat-expansion-panel-header>\n <mat-panel-title>\n <h1 class=\"title\">{{ showCreateForm() ? 'Create' : '' }}{{ config().title }}</h1>\n </mat-panel-title>\n </mat-expansion-panel-header>\n } @else {\n <div class=\"no-title-exp-panel-padding\"></div>\n }\n <ng-container *ngTemplateOutlet=\"headerSlot\"></ng-container>\n @if (store.viewStatus() === 'resolved') {\n <div class=\"resource-container\" [class.form-edit-mode]=\"editMode() === 'edit'\">\n <form [formGroup]=\"form()\">\n <div class=\"resource row\">\n @if (showCreateForm()) {\n <ccc-resource-create\n [resourceConfig]=\"createConfig()\"\n [parentData]=\"relatedData()\"\n (complete)=\"createResource()\">\n </ccc-resource-create>\n } @else {\n <ng-container *ngTemplateOutlet=\"formSlot\"></ng-container>\n }\n </div>\n </form>\n <ng-container *ngTemplateOutlet=\"footerSlot\"></ng-container>\n </div>\n } @else {\n <div class=\"resource-container empty\">\n <div class=\"resource row\"></div>\n </div>\n }\n </mat-expansion-panel>\n </div>\n} @else {\n <div class=\"page-container\">\n @if (!showCreateForm()) {\n <ng-container *ngTemplateOutlet=\"headerSlot\"></ng-container>\n }\n @if (store.viewStatus() === 'resolved') {\n <div class=\"resource-container base-container-bg\" [class.form-edit-mode]=\"editMode() === 'edit'\">\n <form [formGroup]=\"form()\">\n <div class=\"resource row\">\n @if (showCreateForm()) {\n <ccc-resource-create\n [resourceConfig]=\"createConfig()\"\n [parentData]=\"relatedData()\"\n (complete)=\"createResource()\">\n </ccc-resource-create>\n } @else {\n <ng-container *ngTemplateOutlet=\"formSlot\"></ng-container>\n }\n </div>\n </form>\n </div>\n } @else {\n <div class=\"resource-container\">\n <div class=\"resource row empty\"></div>\n </div>\n }\n <ng-container *ngTemplateOutlet=\"footerSlot\"></ng-container>\n </div>\n}\n\n<ng-template #formSlot>\n @for (element of config().elements; track element) {\n @if (element.type === 'section' || element.type === 'computedDisplayField' || element.type === 'padding') {\n <ccc-resource-layout-template\n [element]=\"element\"\n [meta]=\"store.resourceMeta()\"\n [fieldClass]=\"config().fieldClass\"\n [editMode]=\"editMode()\"\n [relatedData]=\"relatedData()\"\n [form]=\"form()\">\n </ccc-resource-layout-template>\n } @else {\n <ccc-resource-layout-template\n [element]=\"element\"\n [meta]=\"store.resourceMeta()\"\n [fieldClass]=\"config().fieldClass\"\n [pristineValue]=\"pristineFormValues[element.name]\"\n [editMode]=\"editMode()\"\n [relatedData]=\"relatedData()\"\n [form]=\"form()\">\n </ccc-resource-layout-template>\n }\n }\n</ng-template>\n\n<ng-template #headerSlot>\n <div class=\"header-container\">\n <div class=\"state-buttons\">\n @if (store.viewStatus() === 'resolved') {\n @for (rpc of inlineRpcConfigs(); track rpc.context) {\n <action-access-control-wrapper [actionContext]=\"rpc.context\">\n <ccc-rpc-button\n [rpcConfig]=\"rpc.config\"\n [relatedData]=\"relatedData()\"\n [primaryResource]=\"config().primaryResource\">\n </ccc-rpc-button>\n </action-access-control-wrapper>\n }\n @if (editMode() === 'view') {\n <action-access-control-wrapper [actionContext]=\"editButtonContext()\">\n <div class=\"edit-button\">\n <button mat-raised-button color=\"accent\" (click)=\"setEditMode('edit')\">\n <div class=\"button-text\">\n <mat-icon>edit</mat-icon>\n <span class=\"mode-text\"> Edit </span>\n </div>\n </button>\n </div>\n </action-access-control-wrapper>\n\n <action-access-control-wrapper [actionContext]=\"deleteButtonContext()\">\n <button mat-raised-button color=\"primary\" (click)=\"confirmDeleteResource()\">Delete</button>\n </action-access-control-wrapper>\n }\n\n @if (editMode() === 'edit') {\n @if (form().dirty) {\n <div class=\"unsaved message\">You have unsaved changes!</div>\n }\n @if (!form().valid && displayFormInvalidMessage()) {\n <div class=\"invalid message\">Please complete or fix required fields.</div>\n }\n <button mat-raised-button color=\"primary\" (click)=\"resetForm()\">Cancel</button>\n <button mat-raised-button color=\"accent\" (click)=\"saveForm()\" [disabled]=\"form().pristine\">Save</button>\n }\n\n @if (showCloseButton()) {\n <div class=\"close-button\">\n <button mat-icon-button color=\"warn\" (click)=\"location.back()\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n }\n }\n </div>\n </div>\n</ng-template>\n\n<ng-template #footerSlot>\n @for (rpc of endRpcConfigs(); track rpc) {\n <action-access-control-wrapper [actionContext]=\"rpc.context\">\n <ccc-rpc-button\n [rpcConfig]=\"rpc.config\"\n [relatedData]=\"relatedData()\"\n [primaryResource]=\"config().primaryResource\">\n </ccc-rpc-button>\n </action-access-control-wrapper>\n }\n</ng-template>\n", styles: [".container{border:1px solid #8e8e8e;border-radius:5px;position:relative;margin-bottom:20px;padding-top:10px}.label{position:absolute;top:-15px;left:20px;height:20px;background-color:#fff;margin:0 10px;padding:0 10px;text-align:center;z-index:10;font-weight:500;font:18px Roboto,sans-serif}.padding{width:100px}.page-container{position:relative}.header-container{display:flex;flex-direction:row;top:0;z-index:11;background:transparent}.title{display:flex;align-items:center;flex-shrink:0}.message{margin-top:auto;margin-bottom:auto}.state-buttons{display:flex;flex-direction:row;margin-top:auto;margin-bottom:auto;justify-content:right;flex-grow:1;gap:20px;margin-right:20px;min-height:36px}.action-button,.mode-text{margin-top:auto;margin-bottom:auto}.resource{margin:10px}.section h2{font-size:1.5em;border-bottom:2px solid #ccc;padding-bottom:8px;margin-bottom:100px}.section{margin-top:15px}.divider{margin:16px 0}.section-elements{display:flex;flex-wrap:wrap}.mat-input-element:disabled[readonly]{color:currentColor}.unsaved{color:#f44336}.edit-button{margin-top:auto;margin-bottom:auto;padding-left:10px}.button-text{display:flex;flex-direction:row;align-items:center}.button-text .edit{color:#003b49}.button-text .mat-icon{margin-right:8px}.shaded{background-color:#e9e9e9}.rounded{border-radius:8px}.dotted-outline{border:1px dotted #ccc;padding:8px}.margin-top{margin-top:50px}.resource-view{display:flex;flex-direction:column;min-height:36px;padding:10px 0 0}.no-title-exp-panel-padding{padding:10px}.base-container-bg{background-color:var(--app-background-color)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2$2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: ResourceLayoutComponent, selector: "ccc-resource-layout-template", inputs: ["element", "meta", "fieldClass", "editMode", "form", "formDataState", "pristineValue", "relatedData", "parentClass", "layoutNestingDepth"], outputs: ["formDataStateChange"] }, { kind: "component", type: MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: RpcButtonComponent, selector: "ccc-rpc-button", inputs: ["relatedData", "rpcConfig", "primaryResource", "dependentResources"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ActionAccessControlWrapperComponent, selector: "action-access-control-wrapper", inputs: ["actionContext"] }, { kind: "component", type: ResourceCreateComponent, selector: "ccc-resource-create", inputs: ["resourceConfig", "parentData", "loadCreatedResource"], outputs: ["complete"] }] });
|
|
2824
2830
|
}
|
|
2825
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2831
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceViewComponent, decorators: [{
|
|
2826
2832
|
type: Component,
|
|
2827
2833
|
args: [{ selector: 'ccc-resource-view', imports: [
|
|
2828
2834
|
FormsModule,
|
|
@@ -2852,26 +2858,26 @@ class CompoundResourceComponent {
|
|
|
2852
2858
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2853
2859
|
componentRef = CompoundResourceComponent;
|
|
2854
2860
|
resourceMeta = inject(RESOURCE_META);
|
|
2855
|
-
resourceConfig = input(
|
|
2856
|
-
isArrayChild = input(false,
|
|
2857
|
-
uuid = input.required(
|
|
2858
|
-
parentData = input(
|
|
2859
|
-
rootConfig = computed(() => this.route.snapshot.data['config'],
|
|
2860
|
-
emptyOneToOne = signal(false,
|
|
2861
|
-
missingRoot = input(false,
|
|
2861
|
+
resourceConfig = input(...(ngDevMode ? [undefined, { debugName: "resourceConfig" }] : []));
|
|
2862
|
+
isArrayChild = input(false, ...(ngDevMode ? [{ debugName: "isArrayChild" }] : []));
|
|
2863
|
+
uuid = input.required(...(ngDevMode ? [{ debugName: "uuid" }] : []));
|
|
2864
|
+
parentData = input(...(ngDevMode ? [undefined, { debugName: "parentData" }] : []));
|
|
2865
|
+
rootConfig = computed(() => this.route.snapshot.data['config'], ...(ngDevMode ? [{ debugName: "rootConfig" }] : []));
|
|
2866
|
+
emptyOneToOne = signal(false, ...(ngDevMode ? [{ debugName: "emptyOneToOne" }] : []));
|
|
2867
|
+
missingRoot = input(false, ...(ngDevMode ? [{ debugName: "missingRoot" }] : []));
|
|
2862
2868
|
resourceCreate = output();
|
|
2863
2869
|
deleted = output();
|
|
2864
|
-
navAfterDelete = input(true,
|
|
2870
|
+
navAfterDelete = input(true, ...(ngDevMode ? [{ debugName: "navAfterDelete" }] : []));
|
|
2865
2871
|
navAfterDeleteConsideringRoot = computed(() => {
|
|
2866
2872
|
const navAfterDeleteInput = this.navAfterDelete();
|
|
2867
2873
|
if (navAfterDeleteInput === undefined)
|
|
2868
2874
|
return true;
|
|
2869
2875
|
return false;
|
|
2870
|
-
},
|
|
2876
|
+
}, ...(ngDevMode ? [{ debugName: "navAfterDeleteConsideringRoot" }] : []));
|
|
2871
2877
|
hasElements = computed(() => {
|
|
2872
2878
|
const config = this.primaryConfig();
|
|
2873
2879
|
return config && (config.type === 'ListView' || config.type === 'View') && config.elements.length > 0;
|
|
2874
|
-
},
|
|
2880
|
+
}, ...(ngDevMode ? [{ debugName: "hasElements" }] : []));
|
|
2875
2881
|
primaryConfigParentId = computed(() => {
|
|
2876
2882
|
const config = this.primaryConfig();
|
|
2877
2883
|
const data = this.resolvedData();
|
|
@@ -2882,14 +2888,14 @@ class CompoundResourceComponent {
|
|
|
2882
2888
|
}
|
|
2883
2889
|
}
|
|
2884
2890
|
return this.uuid();
|
|
2885
|
-
},
|
|
2891
|
+
}, ...(ngDevMode ? [{ debugName: "primaryConfigParentId" }] : []));
|
|
2886
2892
|
primaryConfig = computed(() => {
|
|
2887
2893
|
const config = this.resourceConfig();
|
|
2888
2894
|
if (config) {
|
|
2889
2895
|
return config;
|
|
2890
2896
|
}
|
|
2891
2897
|
return this.rootConfig().parentConfig;
|
|
2892
|
-
},
|
|
2898
|
+
}, ...(ngDevMode ? [{ debugName: "primaryConfig" }] : []));
|
|
2893
2899
|
title = computed(() => {
|
|
2894
2900
|
if (this.isArrayChild()) {
|
|
2895
2901
|
return '';
|
|
@@ -2899,10 +2905,10 @@ class CompoundResourceComponent {
|
|
|
2899
2905
|
return config.title;
|
|
2900
2906
|
}
|
|
2901
2907
|
return '';
|
|
2902
|
-
},
|
|
2908
|
+
}, ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
2903
2909
|
isRootConfig = computed(() => {
|
|
2904
2910
|
return this.resourceConfig() === undefined;
|
|
2905
|
-
},
|
|
2911
|
+
}, ...(ngDevMode ? [{ debugName: "isRootConfig" }] : []));
|
|
2906
2912
|
configs = computed(() => {
|
|
2907
2913
|
if (this.hasElements() && this.emptyOneToOne()) {
|
|
2908
2914
|
return [];
|
|
@@ -2915,7 +2921,7 @@ class CompoundResourceComponent {
|
|
|
2915
2921
|
return config.relatedConfigs;
|
|
2916
2922
|
}
|
|
2917
2923
|
return [];
|
|
2918
|
-
},
|
|
2924
|
+
}, ...(ngDevMode ? [{ debugName: "configs" }] : []));
|
|
2919
2925
|
rpcConfigs = computed(() => {
|
|
2920
2926
|
const isRootConfig = this.isRootConfig();
|
|
2921
2927
|
const rootConfig = this.rootConfig();
|
|
@@ -2933,14 +2939,14 @@ class CompoundResourceComponent {
|
|
|
2933
2939
|
resourceData: this.resolvedData(),
|
|
2934
2940
|
},
|
|
2935
2941
|
}));
|
|
2936
|
-
},
|
|
2937
|
-
hasRpcConfigs = computed(() => !!this.rpcConfigs() && this.rpcConfigs().length > 0,
|
|
2942
|
+
}, ...(ngDevMode ? [{ debugName: "rpcConfigs" }] : []));
|
|
2943
|
+
hasRpcConfigs = computed(() => !!this.rpcConfigs() && this.rpcConfigs().length > 0, ...(ngDevMode ? [{ debugName: "hasRpcConfigs" }] : []));
|
|
2938
2944
|
resolvedData = computed(() => {
|
|
2939
2945
|
if (Object.keys(this.store.viewData()).length > 0) {
|
|
2940
2946
|
return this.store.viewData();
|
|
2941
2947
|
}
|
|
2942
2948
|
return this.parentData() || {};
|
|
2943
|
-
},
|
|
2949
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedData" }] : []));
|
|
2944
2950
|
ngOnInit() {
|
|
2945
2951
|
const resource = this.primaryConfig().primaryResource;
|
|
2946
2952
|
const meta = this.resourceMeta(resource);
|
|
@@ -2968,10 +2974,10 @@ class CompoundResourceComponent {
|
|
|
2968
2974
|
goBack() {
|
|
2969
2975
|
this.location.back();
|
|
2970
2976
|
}
|
|
2971
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
2972
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
2977
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: CompoundResourceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2978
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: CompoundResourceComponent, isStandalone: true, selector: "compound-resource", inputs: { resourceConfig: { classPropertyName: "resourceConfig", publicName: "resourceConfig", isSignal: true, isRequired: false, transformFunction: null }, isArrayChild: { classPropertyName: "isArrayChild", publicName: "isArrayChild", isSignal: true, isRequired: false, transformFunction: null }, uuid: { classPropertyName: "uuid", publicName: "uuid", isSignal: true, isRequired: true, transformFunction: null }, parentData: { classPropertyName: "parentData", publicName: "parentData", isSignal: true, isRequired: false, transformFunction: null }, missingRoot: { classPropertyName: "missingRoot", publicName: "missingRoot", isSignal: true, isRequired: false, transformFunction: null }, navAfterDelete: { classPropertyName: "navAfterDelete", publicName: "navAfterDelete", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { resourceCreate: "resourceCreate", deleted: "deleted" }, providers: [ResourceStore], ngImport: i0, template: "<div class=\"page-container\">\n <div class=\"header-container\">\n <div class=\"title\" [class.title-without-back]=\"title()\">\n @if (title() !== '') {\n <h1>{{ title() }}</h1>\n }\n </div>\n </div>\n\n @if (hasElements() || configs().length > 0) {\n <div class=\"resource-container\" [class.empty-elements]=\"!hasElements()\">\n @let primaryConfigRef = primaryConfig();\n @if (primaryConfigRef.type === 'View' || primaryConfigRef.type === 'ListView') {\n <ccc-resource-view\n [uuid]=\"uuid()\"\n [config]=\"primaryConfigRef\"\n [relatedData]=\"resolvedData()\"\n [showCreateForm]=\"missingRoot()\"\n [compoundResourceView]=\"true\"\n [navAfterDelete]=\"navAfterDeleteConsideringRoot()\"\n (createChange)=\"resourceCreate.emit()\"\n (deleted)=\"deleted.emit(true)\">\n </ccc-resource-view>\n }\n\n @for (config of configs(); track config) {\n @let hasrelatedConfigs = 'relatedConfigs' in config && config.relatedConfigs.length > 0;\n @if (hasrelatedConfigs) {\n <compound-resource [uuid]=\"primaryConfigParentId()\" [parentData]=\"resolvedData()\" [resourceConfig]=\"config\">\n </compound-resource>\n } @else if (config.type === 'ListView') {\n <ccc-resource-list-create\n [resourceConfig]=\"config\"\n [parentData]=\"resolvedData()\"\n [isRootList]=\"false\"\n [parentId]=\"primaryConfigParentId()\"\n [compoundResourceComponent]=\"componentRef\">\n </ccc-resource-list-create>\n } @else if (config.type === 'Array') {\n <ccc-resource-array-view\n [resourceConfig]=\"config\"\n [parentData]=\"store.viewData()\"\n [compoundResourceComponent]=\"componentRef\">\n </ccc-resource-array-view>\n } @else if (config.type === 'View') {\n @let relatedId = resolvedData()[config.parentRelation.parentKey] || primaryConfigParentId();\n @if (relatedId) {\n <ccc-resource-view\n [navAfterDelete]=\"navAfterDeleteConsideringRoot()\"\n [uuid]=\"relatedId + ''\"\n [config]=\"config\"\n [relatedData]=\"resolvedData()\"></ccc-resource-view>\n }\n } @else if (config.type === 'Component') {\n <ccc-resource-resolver\n [parentData]=\"resolvedData()\"\n [resourceConfig]=\"config\"\n [compoundResourceComponent]=\"componentRef\">\n </ccc-resource-resolver>\n }\n }\n @if (hasRpcConfigs()) {\n <div class=\"rpc-buttons-container\">\n @for (rpc of rpcConfigs(); track rpc.config.label) {\n <action-access-control-wrapper [actionContext]=\"rpc.context\">\n <ccc-rpc-button\n [rpcConfig]=\"rpc.config\"\n [relatedData]=\"resolvedData()\"\n [primaryResource]=\"primaryConfig().primaryResource\">\n </ccc-rpc-button>\n </action-access-control-wrapper>\n }\n </div>\n }\n </div>\n }\n</div>\n", styles: [".page-container{position:relative}.header-container{display:flex;flex-direction:row;position:absolute;top:0;z-index:11;background:transparent}.title{display:flex;align-items:center;flex-shrink:0}.title-without-back{margin-left:48px;height:48px}.message{margin-top:auto;margin-bottom:auto}.state-buttons{display:flex;flex-direction:row;margin-bottom:auto;justify-content:right;flex-grow:1;gap:20px;margin-right:32px}.mode-text{margin-top:auto;margin-bottom:auto}.resource{margin:10px}.mat-input-element:disabled[readonly]{color:currentColor}.unsaved{color:#f44336}.edit-button{margin-top:auto;margin-bottom:auto;padding-left:10px}.button-text{display:flex;flex-direction:row;align-items:center}.button-text .edit{color:#003b49}.button-text .mat-icon{margin-right:8px}.empty-elements{padding-top:30px}.rpc-buttons-container{display:flex;flex-direction:row;justify-content:flex-end;padding-bottom:10px}\n"], dependencies: [{ kind: "component", type: CompoundResourceComponent, selector: "compound-resource", inputs: ["resourceConfig", "isArrayChild", "uuid", "parentData", "missingRoot", "navAfterDelete"], outputs: ["resourceCreate", "deleted"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: RpcButtonComponent, selector: "ccc-rpc-button", inputs: ["relatedData", "rpcConfig", "primaryResource", "dependentResources"] }, { kind: "component", type: ResourceViewComponent, selector: "ccc-resource-view", inputs: ["uuid", "config", "relatedData", "compoundResourceView", "navAfterDelete", "showCreateForm"], outputs: ["deleted", "showCreateFormChange"] }, { kind: "component", type: ResourceListCreateComponent, selector: "ccc-resource-list-create", inputs: ["compoundResourceComponent", "parentId", "parentData", "searchParams", "resourceConfig", "isRootList"] }, { kind: "component", type: ResourceArrayViewComponent, selector: "ccc-resource-array-view", inputs: ["resourceConfig", "parentData", "compoundResourceComponent"], outputs: ["emptyOneToOne"] }, { kind: "component", type: ResourceResolverComponent, selector: "ccc-resource-resolver", inputs: ["compoundResourceComponent", "resourceConfig", "parentData"] }, { kind: "component", type: ActionAccessControlWrapperComponent, selector: "action-access-control-wrapper", inputs: ["actionContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2973
2979
|
}
|
|
2974
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2980
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: CompoundResourceComponent, decorators: [{
|
|
2975
2981
|
type: Component,
|
|
2976
2982
|
args: [{ selector: 'compound-resource', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
2977
2983
|
MatIconModule,
|