@masterteam/properties 0.0.6 → 0.0.8
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/assets/properties.css +2 -2
- package/fesm2022/masterteam-properties.mjs +210 -147
- package/fesm2022/masterteam-properties.mjs.map +1 -1
- package/index.d.ts +28 -12
- package/package.json +1 -1
|
@@ -15,6 +15,8 @@ import { DynamicForm } from '@masterteam/forms/dynamic-form';
|
|
|
15
15
|
import { PickListFieldConfig, ValidatorConfig } from '@masterteam/components';
|
|
16
16
|
import * as i1 from '@angular/forms';
|
|
17
17
|
import { FormGroup, FormControl, FormArray, Validators, ReactiveFormsModule, NG_VALUE_ACCESSOR, ControlContainer, FormGroupDirective } from '@angular/forms';
|
|
18
|
+
import * as i2 from 'primeng/skeleton';
|
|
19
|
+
import { SkeletonModule } from 'primeng/skeleton';
|
|
18
20
|
import { SelectField } from '@masterteam/components/select-field';
|
|
19
21
|
import { TextField } from '@masterteam/components/text-field';
|
|
20
22
|
import { ToggleField } from '@masterteam/components/toggle-field';
|
|
@@ -66,8 +68,12 @@ class GetLookups {
|
|
|
66
68
|
class GetGroups {
|
|
67
69
|
static type = '[Properties] Get Groups';
|
|
68
70
|
}
|
|
69
|
-
class
|
|
70
|
-
|
|
71
|
+
class GetConfigAsType {
|
|
72
|
+
viewType;
|
|
73
|
+
static type = '[Properties] Get Config As Type';
|
|
74
|
+
constructor(viewType) {
|
|
75
|
+
this.viewType = viewType;
|
|
76
|
+
}
|
|
71
77
|
}
|
|
72
78
|
class GetCountries {
|
|
73
79
|
static type = '[Properties] Get Countries';
|
|
@@ -96,6 +102,9 @@ class GetPropertiesForConfigType {
|
|
|
96
102
|
class ResetConfigProperties {
|
|
97
103
|
static type = '[Properties] Reset Config Properties';
|
|
98
104
|
}
|
|
105
|
+
class ResetConfigScopes {
|
|
106
|
+
static type = '[Properties] Reset Config Scopes';
|
|
107
|
+
}
|
|
99
108
|
class ResetSelectedProperty {
|
|
100
109
|
static type = '[Properties] Reset Selected Property';
|
|
101
110
|
}
|
|
@@ -156,7 +165,7 @@ const DEFAULT_STATE = {
|
|
|
156
165
|
lookups: [],
|
|
157
166
|
configTypeProperties: [],
|
|
158
167
|
groups: [],
|
|
159
|
-
|
|
168
|
+
configScopes: [],
|
|
160
169
|
countries: [],
|
|
161
170
|
apiSchema: null,
|
|
162
171
|
apiProperties: [],
|
|
@@ -167,7 +176,6 @@ let PropertiesState = class PropertiesState {
|
|
|
167
176
|
lookupsUrl = 'Lookups';
|
|
168
177
|
configPropertiesUrl = 'Properties';
|
|
169
178
|
groupsUrl = 'identity/Groups';
|
|
170
|
-
logsUrl = 'Logs';
|
|
171
179
|
countriesUrl = '/assets/countries/countries.json';
|
|
172
180
|
apiTestUrl = 'app/testAPI';
|
|
173
181
|
apiDetectUrl = 'app/detect';
|
|
@@ -186,8 +194,8 @@ let PropertiesState = class PropertiesState {
|
|
|
186
194
|
static groups(state) {
|
|
187
195
|
return state.groups;
|
|
188
196
|
}
|
|
189
|
-
static
|
|
190
|
-
return state.
|
|
197
|
+
static configScopes(state) {
|
|
198
|
+
return state.configScopes;
|
|
191
199
|
}
|
|
192
200
|
static countries(state) {
|
|
193
201
|
return state.countries;
|
|
@@ -281,20 +289,24 @@ let PropertiesState = class PropertiesState {
|
|
|
281
289
|
return of([]);
|
|
282
290
|
}), finalize(() => endLoading(ctx, 'getGroups')));
|
|
283
291
|
}
|
|
284
|
-
|
|
292
|
+
getConfigAsType(ctx, action) {
|
|
285
293
|
const state = ctx.getState();
|
|
286
|
-
if
|
|
287
|
-
|
|
294
|
+
// Don't reload if we already have data for this viewType
|
|
295
|
+
if (state.configScopes.length) {
|
|
296
|
+
return of(state.configScopes);
|
|
288
297
|
}
|
|
289
|
-
startLoading(ctx, '
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
298
|
+
startLoading(ctx, 'getConfigAsType');
|
|
299
|
+
const url = `${this.baseUrl}/${action.viewType}/GetViewTypeProperties`;
|
|
300
|
+
return this.http.get(url).pipe(tap((response) => {
|
|
301
|
+
const configScopes = Array.isArray(response?.data) ? response.data : [];
|
|
302
|
+
ctx.patchState({ configScopes });
|
|
293
303
|
}), catchError((error) => {
|
|
294
|
-
const message = error?.error?.message ??
|
|
295
|
-
|
|
304
|
+
const message = error?.error?.message ??
|
|
305
|
+
error?.message ??
|
|
306
|
+
'Failed to load configuration scopes';
|
|
307
|
+
setLoadingError(ctx, 'getConfigAsType', message);
|
|
296
308
|
return of([]);
|
|
297
|
-
}), finalize(() => endLoading(ctx, '
|
|
309
|
+
}), finalize(() => endLoading(ctx, 'getConfigAsType')));
|
|
298
310
|
}
|
|
299
311
|
getCountries(ctx, _action) {
|
|
300
312
|
const state = ctx.getState();
|
|
@@ -421,6 +433,9 @@ let PropertiesState = class PropertiesState {
|
|
|
421
433
|
resetConfigProperties(ctx) {
|
|
422
434
|
ctx.patchState({ configTypeProperties: [] });
|
|
423
435
|
}
|
|
436
|
+
resetConfigScopes(ctx) {
|
|
437
|
+
ctx.patchState({ configScopes: [] });
|
|
438
|
+
}
|
|
424
439
|
resetSelectedProperty(ctx) {
|
|
425
440
|
ctx.patchState({ selectedProperty: null });
|
|
426
441
|
}
|
|
@@ -533,8 +548,8 @@ __decorate([
|
|
|
533
548
|
Action(GetGroups)
|
|
534
549
|
], PropertiesState.prototype, "getGroups", null);
|
|
535
550
|
__decorate([
|
|
536
|
-
Action(
|
|
537
|
-
], PropertiesState.prototype, "
|
|
551
|
+
Action(GetConfigAsType)
|
|
552
|
+
], PropertiesState.prototype, "getConfigAsType", null);
|
|
538
553
|
__decorate([
|
|
539
554
|
Action(GetCountries)
|
|
540
555
|
], PropertiesState.prototype, "getCountries", null);
|
|
@@ -550,6 +565,9 @@ __decorate([
|
|
|
550
565
|
__decorate([
|
|
551
566
|
Action(ResetConfigProperties)
|
|
552
567
|
], PropertiesState.prototype, "resetConfigProperties", null);
|
|
568
|
+
__decorate([
|
|
569
|
+
Action(ResetConfigScopes)
|
|
570
|
+
], PropertiesState.prototype, "resetConfigScopes", null);
|
|
553
571
|
__decorate([
|
|
554
572
|
Action(ResetSelectedProperty)
|
|
555
573
|
], PropertiesState.prototype, "resetSelectedProperty", null);
|
|
@@ -585,7 +603,7 @@ __decorate([
|
|
|
585
603
|
], PropertiesState, "groups", null);
|
|
586
604
|
__decorate([
|
|
587
605
|
Selector()
|
|
588
|
-
], PropertiesState, "
|
|
606
|
+
], PropertiesState, "configScopes", null);
|
|
589
607
|
__decorate([
|
|
590
608
|
Selector()
|
|
591
609
|
], PropertiesState, "countries", null);
|
|
@@ -615,7 +633,7 @@ PropertiesState = __decorate([
|
|
|
615
633
|
], PropertiesState);
|
|
616
634
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: PropertiesState, decorators: [{
|
|
617
635
|
type: Injectable
|
|
618
|
-
}], propDecorators: { getAll: [], getOne: [], getLookups: [], getGroups: [],
|
|
636
|
+
}], propDecorators: { getAll: [], getOne: [], getLookups: [], getGroups: [], getConfigAsType: [], getCountries: [], testApiConfiguration: [], resetApiConfiguration: [], getPropertiesForConfigType: [], resetConfigProperties: [], resetConfigScopes: [], resetSelectedProperty: [], setModuleInfo: [], create: [], update: [], delete: [], SetPropertyTypes: [] } });
|
|
619
637
|
|
|
620
638
|
class PropertiesFacade {
|
|
621
639
|
store = inject(Store);
|
|
@@ -625,7 +643,7 @@ class PropertiesFacade {
|
|
|
625
643
|
lookups = select(PropertiesState.lookups);
|
|
626
644
|
configProperties = select(PropertiesState.configTypeProperties);
|
|
627
645
|
groups = select(PropertiesState.groups);
|
|
628
|
-
|
|
646
|
+
configScopes = select(PropertiesState.configScopes);
|
|
629
647
|
countries = select(PropertiesState.countries);
|
|
630
648
|
apiSchema = select(PropertiesState.apiSchema);
|
|
631
649
|
apiProperties = select(PropertiesState.apiProperties);
|
|
@@ -659,8 +677,8 @@ class PropertiesFacade {
|
|
|
659
677
|
loadGroups() {
|
|
660
678
|
return this.store.dispatch(new GetGroups());
|
|
661
679
|
}
|
|
662
|
-
|
|
663
|
-
return this.store.dispatch(new
|
|
680
|
+
loadConfigAsType(viewType) {
|
|
681
|
+
return this.store.dispatch(new GetConfigAsType(viewType));
|
|
664
682
|
}
|
|
665
683
|
loadCountries() {
|
|
666
684
|
return this.store.dispatch(new GetCountries());
|
|
@@ -683,6 +701,9 @@ class PropertiesFacade {
|
|
|
683
701
|
resetConfigProperties() {
|
|
684
702
|
return this.store.dispatch(new ResetConfigProperties());
|
|
685
703
|
}
|
|
704
|
+
resetConfigScopes() {
|
|
705
|
+
return this.store.dispatch(new ResetConfigScopes());
|
|
706
|
+
}
|
|
686
707
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: PropertiesFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
687
708
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: PropertiesFacade, providedIn: 'root' });
|
|
688
709
|
}
|
|
@@ -713,7 +734,7 @@ class PropertiesList {
|
|
|
713
734
|
], ...(ngDevMode ? [{ debugName: "tabs" }] : []));
|
|
714
735
|
activeTab = signal('all', ...(ngDevMode ? [{ debugName: "activeTab" }] : []));
|
|
715
736
|
tableColumns = signal([
|
|
716
|
-
{ key: '
|
|
737
|
+
{ key: 'title', label: 'Name' },
|
|
717
738
|
{ key: 'viewType', label: 'Type' },
|
|
718
739
|
{ key: 'required', label: 'Required', type: 'boolean' },
|
|
719
740
|
], ...(ngDevMode ? [{ debugName: "tableColumns" }] : []));
|
|
@@ -776,11 +797,11 @@ class PropertiesList {
|
|
|
776
797
|
});
|
|
777
798
|
}
|
|
778
799
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: PropertiesList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
779
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.3", type: PropertiesList, isStandalone: true, selector: "mt-properties-list", ngImport: i0, template: "<div class=\"py-4 px-6 space-y-3\">\n <div class=\"flex items-center justify-between\">\n <div class=\"space-y-1\">\n <h1 class=\"text-xl font-semibold text-slate-900 tracking-tight\">\n All Properties\n </h1>\n <p class=\"text-sm text-slate-500\">PMO - Project - Properties</p>\n </div>\n </div>\n\n <mt-table\n [tabs]=\"tabs()\"\n [(activeTab)]=\"activeTab\"\n [data]=\"tableData()\"\n [actions]=\"tableActions()\"\n [columns]=\"tableColumns()\"\n [rowActions]=\"rowActions()\"\n [generalSearch]=\"true\"\n [
|
|
800
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.3", type: PropertiesList, isStandalone: true, selector: "mt-properties-list", ngImport: i0, template: "<div class=\"py-4 px-6 space-y-3\">\n <div class=\"flex items-center justify-between\">\n <div class=\"space-y-1\">\n <h1 class=\"text-xl font-semibold text-slate-900 tracking-tight\">\n All Properties\n </h1>\n <p class=\"text-sm text-slate-500\">PMO - Project - Properties</p>\n </div>\n </div>\n\n <mt-table\n [tabs]=\"tabs()\"\n [(activeTab)]=\"activeTab\"\n [data]=\"tableData()\"\n [actions]=\"tableActions()\"\n [columns]=\"tableColumns()\"\n [rowActions]=\"rowActions()\"\n [generalSearch]=\"true\"\n [loading]=\"loading()\"\n paginatorPosition=\"center\"\n >\n </mt-table>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Table, selector: "mt-table", inputs: ["data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "generalSearch", "showFilters", "loading", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "paginatorPosition", "pageSize", "currentPage", "first", "filterTerm"], outputs: ["selectionChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange"] }] });
|
|
780
801
|
}
|
|
781
802
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: PropertiesList, decorators: [{
|
|
782
803
|
type: Component,
|
|
783
|
-
args: [{ selector: 'mt-properties-list', standalone: true, imports: [CommonModule, Table], template: "<div class=\"py-4 px-6 space-y-3\">\n <div class=\"flex items-center justify-between\">\n <div class=\"space-y-1\">\n <h1 class=\"text-xl font-semibold text-slate-900 tracking-tight\">\n All Properties\n </h1>\n <p class=\"text-sm text-slate-500\">PMO - Project - Properties</p>\n </div>\n </div>\n\n <mt-table\n [tabs]=\"tabs()\"\n [(activeTab)]=\"activeTab\"\n [data]=\"tableData()\"\n [actions]=\"tableActions()\"\n [columns]=\"tableColumns()\"\n [rowActions]=\"rowActions()\"\n [generalSearch]=\"true\"\n [
|
|
804
|
+
args: [{ selector: 'mt-properties-list', standalone: true, imports: [CommonModule, Table], template: "<div class=\"py-4 px-6 space-y-3\">\n <div class=\"flex items-center justify-between\">\n <div class=\"space-y-1\">\n <h1 class=\"text-xl font-semibold text-slate-900 tracking-tight\">\n All Properties\n </h1>\n <p class=\"text-sm text-slate-500\">PMO - Project - Properties</p>\n </div>\n </div>\n\n <mt-table\n [tabs]=\"tabs()\"\n [(activeTab)]=\"activeTab\"\n [data]=\"tableData()\"\n [actions]=\"tableActions()\"\n [columns]=\"tableColumns()\"\n [rowActions]=\"rowActions()\"\n [generalSearch]=\"true\"\n [loading]=\"loading()\"\n paginatorPosition=\"center\"\n >\n </mt-table>\n</div>\n" }]
|
|
784
805
|
}] });
|
|
785
806
|
|
|
786
807
|
class ApiConfiguration {
|
|
@@ -966,10 +987,13 @@ class CheckListFormConfiguration {
|
|
|
966
987
|
controlContainer = inject(ControlContainer);
|
|
967
988
|
parentGroup = this.controlContainer.control;
|
|
968
989
|
lookups = this.propertiesFacade.lookups;
|
|
969
|
-
|
|
990
|
+
configScopes = this.propertiesFacade.configScopes;
|
|
970
991
|
configProperties = this.propertiesFacade.configProperties;
|
|
971
|
-
prevLogId = signal(null, ...(ngDevMode ? [{ debugName: "prevLogId" }] : []));
|
|
972
992
|
configuration = toSignal(this.parentGroup.valueChanges.pipe(startWith(this.parentGroup.value), map((value) => value?.configuration), distinctUntilChanged()), { initialValue: this.parentGroup.value?.configuration });
|
|
993
|
+
scopeItems = computed(() => {
|
|
994
|
+
const scope = this.configScopes()[0];
|
|
995
|
+
return scope?.items ?? [];
|
|
996
|
+
}, ...(ngDevMode ? [{ debugName: "scopeItems" }] : []));
|
|
973
997
|
formConfig = linkedSignal(() => ({
|
|
974
998
|
sections: [
|
|
975
999
|
{
|
|
@@ -987,21 +1011,23 @@ class CheckListFormConfiguration {
|
|
|
987
1011
|
label: 'Select Lookup',
|
|
988
1012
|
optionLabel: 'displayName',
|
|
989
1013
|
optionValue: 'id',
|
|
1014
|
+
filter: true,
|
|
990
1015
|
options: this.lookups(),
|
|
991
1016
|
},
|
|
992
1017
|
{
|
|
993
|
-
key: '
|
|
1018
|
+
key: 'scopeId',
|
|
994
1019
|
type: 'select',
|
|
995
|
-
label: 'Select
|
|
996
|
-
optionLabel: '
|
|
1020
|
+
label: 'Select Scope',
|
|
1021
|
+
optionLabel: 'title',
|
|
997
1022
|
optionValue: 'id',
|
|
998
|
-
options: this.
|
|
1023
|
+
options: this.scopeItems(),
|
|
1024
|
+
filter: true,
|
|
999
1025
|
},
|
|
1000
1026
|
new PickListFieldConfig({
|
|
1001
1027
|
key: 'properties',
|
|
1002
1028
|
cssClass: 'md:col-span-2',
|
|
1003
1029
|
options: this.configProperties(),
|
|
1004
|
-
optionLabel: '
|
|
1030
|
+
optionLabel: 'title',
|
|
1005
1031
|
optionValue: 'key',
|
|
1006
1032
|
sourceHeader: 'Available Properties',
|
|
1007
1033
|
targetHeader: 'Selected Properties',
|
|
@@ -1017,18 +1043,12 @@ class CheckListFormConfiguration {
|
|
|
1017
1043
|
}
|
|
1018
1044
|
});
|
|
1019
1045
|
effect(() => {
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
const logId = this.configuration()?.log;
|
|
1026
|
-
if (logId) {
|
|
1027
|
-
if (this.prevLogId() == logId) {
|
|
1028
|
-
return;
|
|
1046
|
+
const scopeId = this.configuration()?.scopeId;
|
|
1047
|
+
if (scopeId) {
|
|
1048
|
+
const scopeType = this.configScopes()[0]?.scope;
|
|
1049
|
+
if (scopeType) {
|
|
1050
|
+
this.propertiesFacade.loadPropertiesForConfigType(scopeType, scopeId);
|
|
1029
1051
|
}
|
|
1030
|
-
this.prevLogId.set(logId);
|
|
1031
|
-
this.propertiesFacade.loadPropertiesForConfigType('Log', logId);
|
|
1032
1052
|
}
|
|
1033
1053
|
});
|
|
1034
1054
|
}
|
|
@@ -1051,10 +1071,13 @@ class DynamicListConfiguration {
|
|
|
1051
1071
|
propertiesFacade = inject(PropertiesFacade);
|
|
1052
1072
|
controlContainer = inject(ControlContainer);
|
|
1053
1073
|
parentGroup = this.controlContainer.control;
|
|
1054
|
-
|
|
1074
|
+
configScopes = this.propertiesFacade.configScopes;
|
|
1055
1075
|
configProperties = this.propertiesFacade.configProperties;
|
|
1056
|
-
prevLogId = signal(null, ...(ngDevMode ? [{ debugName: "prevLogId" }] : []));
|
|
1057
1076
|
configuration = toSignal(this.parentGroup.valueChanges.pipe(startWith(this.parentGroup.value), map((value) => value?.configuration), distinctUntilChanged()), { initialValue: this.parentGroup.value?.configuration });
|
|
1077
|
+
scopeItems = computed(() => {
|
|
1078
|
+
const scope = this.configScopes()[0];
|
|
1079
|
+
return scope?.items ?? [];
|
|
1080
|
+
}, ...(ngDevMode ? [{ debugName: "scopeItems" }] : []));
|
|
1058
1081
|
formConfig = linkedSignal(() => ({
|
|
1059
1082
|
sections: [
|
|
1060
1083
|
{
|
|
@@ -1067,18 +1090,19 @@ class DynamicListConfiguration {
|
|
|
1067
1090
|
bodyClass: 'grid grid-cols-1 md:grid-cols-2 gap-3',
|
|
1068
1091
|
fields: [
|
|
1069
1092
|
{
|
|
1070
|
-
key: '
|
|
1093
|
+
key: 'scopeId',
|
|
1071
1094
|
type: 'select',
|
|
1072
|
-
label: 'Select
|
|
1073
|
-
optionLabel: '
|
|
1095
|
+
label: 'Select Scope',
|
|
1096
|
+
optionLabel: 'title',
|
|
1074
1097
|
optionValue: 'id',
|
|
1075
|
-
|
|
1098
|
+
filter: true,
|
|
1099
|
+
options: this.scopeItems(),
|
|
1076
1100
|
},
|
|
1077
1101
|
new PickListFieldConfig({
|
|
1078
1102
|
key: 'properties',
|
|
1079
1103
|
cssClass: 'md:col-span-2',
|
|
1080
1104
|
options: this.configProperties(),
|
|
1081
|
-
optionLabel: '
|
|
1105
|
+
optionLabel: 'title',
|
|
1082
1106
|
optionValue: 'key',
|
|
1083
1107
|
sourceHeader: 'Available Properties',
|
|
1084
1108
|
targetHeader: 'Selected Properties',
|
|
@@ -1095,18 +1119,12 @@ class DynamicListConfiguration {
|
|
|
1095
1119
|
}));
|
|
1096
1120
|
constructor() {
|
|
1097
1121
|
effect(() => {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
const logId = this.configuration()?.logId;
|
|
1104
|
-
if (logId) {
|
|
1105
|
-
if (this.prevLogId() == logId) {
|
|
1106
|
-
return;
|
|
1122
|
+
const scopeId = this.configuration()?.scopeId;
|
|
1123
|
+
if (scopeId) {
|
|
1124
|
+
const scopeType = this.configScopes()[0]?.scope;
|
|
1125
|
+
if (scopeType) {
|
|
1126
|
+
this.propertiesFacade.loadPropertiesForConfigType(scopeType, scopeId);
|
|
1107
1127
|
}
|
|
1108
|
-
this.prevLogId.set(logId);
|
|
1109
|
-
this.propertiesFacade.loadPropertiesForConfigType('Log', logId);
|
|
1110
1128
|
}
|
|
1111
1129
|
});
|
|
1112
1130
|
}
|
|
@@ -1129,10 +1147,13 @@ class EditableListViewConfiguration {
|
|
|
1129
1147
|
propertiesFacade = inject(PropertiesFacade);
|
|
1130
1148
|
controlContainer = inject(ControlContainer);
|
|
1131
1149
|
parentGroup = this.controlContainer.control;
|
|
1132
|
-
|
|
1150
|
+
configScopes = this.propertiesFacade.configScopes;
|
|
1133
1151
|
configProperties = this.propertiesFacade.configProperties;
|
|
1134
|
-
prevLogId = signal(null, ...(ngDevMode ? [{ debugName: "prevLogId" }] : []));
|
|
1135
1152
|
configuration = toSignal(this.parentGroup.valueChanges.pipe(startWith(this.parentGroup.value), map((value) => value?.configuration), distinctUntilChanged()), { initialValue: this.parentGroup.value?.configuration });
|
|
1153
|
+
scopeItems = computed(() => {
|
|
1154
|
+
const scope = this.configScopes()[0];
|
|
1155
|
+
return scope?.items ?? [];
|
|
1156
|
+
}, ...(ngDevMode ? [{ debugName: "scopeItems" }] : []));
|
|
1136
1157
|
formConfig = linkedSignal(() => ({
|
|
1137
1158
|
sections: [
|
|
1138
1159
|
{
|
|
@@ -1145,18 +1166,18 @@ class EditableListViewConfiguration {
|
|
|
1145
1166
|
bodyClass: 'grid grid-cols-1 md:grid-cols-2 gap-3',
|
|
1146
1167
|
fields: [
|
|
1147
1168
|
{
|
|
1148
|
-
key: '
|
|
1169
|
+
key: 'scopeId',
|
|
1149
1170
|
type: 'select',
|
|
1150
|
-
label: 'Select
|
|
1151
|
-
optionLabel: '
|
|
1171
|
+
label: 'Select Scope',
|
|
1172
|
+
optionLabel: 'title',
|
|
1152
1173
|
optionValue: 'id',
|
|
1153
|
-
options: this.
|
|
1174
|
+
options: this.scopeItems(),
|
|
1154
1175
|
},
|
|
1155
1176
|
new PickListFieldConfig({
|
|
1156
1177
|
key: 'Properties',
|
|
1157
1178
|
cssClass: 'md:col-span-2',
|
|
1158
1179
|
options: this.configProperties(),
|
|
1159
|
-
optionLabel: '
|
|
1180
|
+
optionLabel: 'title',
|
|
1160
1181
|
optionValue: 'key',
|
|
1161
1182
|
sourceHeader: 'Available Properties',
|
|
1162
1183
|
targetHeader: 'Selected Properties',
|
|
@@ -1177,18 +1198,12 @@ class EditableListViewConfiguration {
|
|
|
1177
1198
|
}));
|
|
1178
1199
|
constructor() {
|
|
1179
1200
|
effect(() => {
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
const logId = this.configuration()?.logId;
|
|
1186
|
-
if (logId) {
|
|
1187
|
-
if (this.prevLogId() == logId) {
|
|
1188
|
-
return;
|
|
1201
|
+
const scopeId = this.configuration()?.scopeId;
|
|
1202
|
+
if (scopeId) {
|
|
1203
|
+
const scopeType = this.configScopes()[0]?.scope;
|
|
1204
|
+
if (scopeType) {
|
|
1205
|
+
this.propertiesFacade.loadPropertiesForConfigType(scopeType, scopeId);
|
|
1189
1206
|
}
|
|
1190
|
-
this.prevLogId.set(logId);
|
|
1191
|
-
this.propertiesFacade.loadPropertiesForConfigType('Log', logId);
|
|
1192
1207
|
}
|
|
1193
1208
|
});
|
|
1194
1209
|
}
|
|
@@ -1215,9 +1230,16 @@ class InternalModuleConfiguration {
|
|
|
1215
1230
|
cc = inject(ControlContainer);
|
|
1216
1231
|
parentGroup = this.cc.control;
|
|
1217
1232
|
configProperties = this.propertiesFacade.configProperties;
|
|
1218
|
-
|
|
1233
|
+
configScopes = this.propertiesFacade.configScopes;
|
|
1219
1234
|
configuration = toSignal(this.parentGroup.valueChanges.pipe(startWith(this.parentGroup.value), map((v) => v?.configuration), distinctUntilChanged()), { initialValue: this.parentGroup.value?.configuration });
|
|
1220
1235
|
PrevModuleId = signal(null, ...(ngDevMode ? [{ debugName: "PrevModuleId" }] : []));
|
|
1236
|
+
scopeItems = computed(() => {
|
|
1237
|
+
const selectedType = this.configuration()?.type;
|
|
1238
|
+
if (!selectedType)
|
|
1239
|
+
return [];
|
|
1240
|
+
const scope = this.configScopes().find((s) => s.scope === selectedType);
|
|
1241
|
+
return scope?.items ?? [];
|
|
1242
|
+
}, ...(ngDevMode ? [{ debugName: "scopeItems" }] : []));
|
|
1221
1243
|
formConfig = linkedSignal(() => ({
|
|
1222
1244
|
sections: [
|
|
1223
1245
|
{
|
|
@@ -1233,50 +1255,24 @@ class InternalModuleConfiguration {
|
|
|
1233
1255
|
key: 'type',
|
|
1234
1256
|
type: 'select',
|
|
1235
1257
|
label: 'Type',
|
|
1236
|
-
optionLabel: '
|
|
1237
|
-
optionValue: '
|
|
1238
|
-
options:
|
|
1239
|
-
{ label: 'Level', value: 'Level' },
|
|
1240
|
-
{ label: 'Log', value: 'Log' },
|
|
1241
|
-
],
|
|
1242
|
-
},
|
|
1243
|
-
{
|
|
1244
|
-
key: 'levelId',
|
|
1245
|
-
type: 'select',
|
|
1246
|
-
hidden: true,
|
|
1247
|
-
label: 'Select Level',
|
|
1248
|
-
optionLabel: 'name.en',
|
|
1249
|
-
optionValue: 'id',
|
|
1250
|
-
options: this.levels(),
|
|
1251
|
-
relations: [
|
|
1252
|
-
{
|
|
1253
|
-
key: 'type',
|
|
1254
|
-
value: 'Level',
|
|
1255
|
-
action: 'show',
|
|
1256
|
-
},
|
|
1257
|
-
],
|
|
1258
|
+
optionLabel: 'scope',
|
|
1259
|
+
optionValue: 'scope',
|
|
1260
|
+
options: this.configScopes(),
|
|
1258
1261
|
},
|
|
1259
1262
|
{
|
|
1260
|
-
key: '
|
|
1263
|
+
key: 'scopeId',
|
|
1261
1264
|
type: 'select',
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
optionLabel: 'name',
|
|
1265
|
+
label: 'Select Scope',
|
|
1266
|
+
optionLabel: 'title',
|
|
1265
1267
|
optionValue: 'id',
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
{
|
|
1269
|
-
key: 'type',
|
|
1270
|
-
value: 'Log',
|
|
1271
|
-
action: 'show',
|
|
1272
|
-
},
|
|
1273
|
-
],
|
|
1268
|
+
filter: true,
|
|
1269
|
+
options: this.scopeItems(),
|
|
1274
1270
|
},
|
|
1275
1271
|
{
|
|
1276
1272
|
type: 'select',
|
|
1277
1273
|
key: 'property',
|
|
1278
1274
|
label: 'Value Property',
|
|
1279
|
-
optionLabel: '
|
|
1275
|
+
optionLabel: 'title',
|
|
1280
1276
|
optionValue: 'key',
|
|
1281
1277
|
options: this.configProperties(),
|
|
1282
1278
|
},
|
|
@@ -1284,7 +1280,7 @@ class InternalModuleConfiguration {
|
|
|
1284
1280
|
cssClass: 'md:col-span-2 mt-2',
|
|
1285
1281
|
key: 'propertyDetails',
|
|
1286
1282
|
options: this.configProperties(),
|
|
1287
|
-
optionLabel: '
|
|
1283
|
+
optionLabel: 'title',
|
|
1288
1284
|
optionValue: 'key',
|
|
1289
1285
|
sourceHeader: 'Available Properties',
|
|
1290
1286
|
targetHeader: 'Selected Properties',
|
|
@@ -1301,20 +1297,9 @@ class InternalModuleConfiguration {
|
|
|
1301
1297
|
}));
|
|
1302
1298
|
constructor() {
|
|
1303
1299
|
effect(() => {
|
|
1304
|
-
if (this.configuration()?.
|
|
1305
|
-
if (!this.logs().length) {
|
|
1306
|
-
this.propertiesFacade.loadLogs();
|
|
1307
|
-
}
|
|
1308
|
-
this.parentGroup.get('levelId')?.setValue(null);
|
|
1309
|
-
}
|
|
1310
|
-
else if (this.configuration()?.type === 'Level') {
|
|
1311
|
-
this.parentGroup.get('logId')?.setValue(null);
|
|
1312
|
-
}
|
|
1313
|
-
if (this.configuration()?.logId || this.configuration()?.levelId) {
|
|
1300
|
+
if (this.configuration()?.scopeId) {
|
|
1314
1301
|
const moduleType = this.configuration()?.type;
|
|
1315
|
-
const moduleId =
|
|
1316
|
-
? this.configuration()?.logId
|
|
1317
|
-
: this.configuration()?.levelId;
|
|
1302
|
+
const moduleId = this.configuration()?.scopeId;
|
|
1318
1303
|
if (moduleId == this.PrevModuleId()) {
|
|
1319
1304
|
return;
|
|
1320
1305
|
}
|
|
@@ -1361,6 +1346,7 @@ class LocationConfiguration {
|
|
|
1361
1346
|
optionLabel: 'name',
|
|
1362
1347
|
optionValue: 'name',
|
|
1363
1348
|
options: this.countries(),
|
|
1349
|
+
filter: true,
|
|
1364
1350
|
},
|
|
1365
1351
|
],
|
|
1366
1352
|
},
|
|
@@ -1406,6 +1392,7 @@ class LookupConfiguration {
|
|
|
1406
1392
|
optionLabel: 'displayName',
|
|
1407
1393
|
optionValue: 'id',
|
|
1408
1394
|
options: this.lookups(),
|
|
1395
|
+
filter: true,
|
|
1409
1396
|
},
|
|
1410
1397
|
],
|
|
1411
1398
|
},
|
|
@@ -1484,6 +1471,7 @@ class UserConfiguration {
|
|
|
1484
1471
|
optionLabel: 'name',
|
|
1485
1472
|
optionValue: 'id',
|
|
1486
1473
|
options: this.groups(),
|
|
1474
|
+
filter: true,
|
|
1487
1475
|
},
|
|
1488
1476
|
],
|
|
1489
1477
|
},
|
|
@@ -1682,6 +1670,7 @@ class PropertyForm {
|
|
|
1682
1670
|
configurationControl = this.propertyForm.get('configuration');
|
|
1683
1671
|
creating = this.facade.isLoading('create');
|
|
1684
1672
|
updating = this.facade.isLoading('update');
|
|
1673
|
+
loading = this.facade.isLoading('getOne');
|
|
1685
1674
|
submitting = computed(() => this.creating() || this.updating(), ...(ngDevMode ? [{ debugName: "submitting" }] : []));
|
|
1686
1675
|
propertyType = toSignal(this.mainControl.valueChanges.pipe(map((v) => v?.viewType), distinctUntilChanged()));
|
|
1687
1676
|
selectedPropertyTypeConfiguration = computed(() => {
|
|
@@ -1725,12 +1714,65 @@ class PropertyForm {
|
|
|
1725
1714
|
cssClass: 'w-1/2',
|
|
1726
1715
|
options: this.propertyTypes()?.value,
|
|
1727
1716
|
disabled: this.isEditing(),
|
|
1717
|
+
filter: true,
|
|
1728
1718
|
},
|
|
1729
1719
|
{
|
|
1730
1720
|
key: 'isCalculated',
|
|
1731
1721
|
type: 'toggle',
|
|
1732
1722
|
label: 'Calculated',
|
|
1733
1723
|
cssClass: 'justify-self-end',
|
|
1724
|
+
relations: [
|
|
1725
|
+
{
|
|
1726
|
+
action: 'show',
|
|
1727
|
+
key: 'viewType',
|
|
1728
|
+
value: 'Text',
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
action: 'show',
|
|
1732
|
+
key: 'viewType',
|
|
1733
|
+
value: 'LongText',
|
|
1734
|
+
},
|
|
1735
|
+
{
|
|
1736
|
+
action: 'show',
|
|
1737
|
+
key: 'viewType',
|
|
1738
|
+
value: 'Percentage',
|
|
1739
|
+
},
|
|
1740
|
+
{
|
|
1741
|
+
action: 'show',
|
|
1742
|
+
key: 'viewType',
|
|
1743
|
+
value: 'Date',
|
|
1744
|
+
},
|
|
1745
|
+
{
|
|
1746
|
+
action: 'show',
|
|
1747
|
+
key: 'viewType',
|
|
1748
|
+
value: 'Currency',
|
|
1749
|
+
},
|
|
1750
|
+
{
|
|
1751
|
+
action: 'show',
|
|
1752
|
+
key: 'viewType',
|
|
1753
|
+
value: 'Number',
|
|
1754
|
+
},
|
|
1755
|
+
{
|
|
1756
|
+
action: 'show',
|
|
1757
|
+
key: 'viewType',
|
|
1758
|
+
value: 'Checkbox',
|
|
1759
|
+
},
|
|
1760
|
+
{
|
|
1761
|
+
action: 'show',
|
|
1762
|
+
key: 'viewType',
|
|
1763
|
+
value: 'Lookup',
|
|
1764
|
+
},
|
|
1765
|
+
{
|
|
1766
|
+
action: 'show',
|
|
1767
|
+
key: 'viewType',
|
|
1768
|
+
value: 'LookupMultiSelect',
|
|
1769
|
+
},
|
|
1770
|
+
{
|
|
1771
|
+
action: 'show',
|
|
1772
|
+
key: 'viewType',
|
|
1773
|
+
value: 'Time',
|
|
1774
|
+
},
|
|
1775
|
+
],
|
|
1734
1776
|
},
|
|
1735
1777
|
],
|
|
1736
1778
|
},
|
|
@@ -1742,15 +1784,15 @@ class PropertyForm {
|
|
|
1742
1784
|
bodyClass: 'grid grid-cols-1 md:grid-cols-2 gap-3',
|
|
1743
1785
|
fields: [
|
|
1744
1786
|
{
|
|
1745
|
-
key: '
|
|
1746
|
-
label: 'Name
|
|
1747
|
-
placeholder: 'Name
|
|
1787
|
+
key: 'title.en',
|
|
1788
|
+
label: 'English Name',
|
|
1789
|
+
placeholder: 'English Name',
|
|
1748
1790
|
validators: [new ValidatorConfig({ type: 'required' })],
|
|
1749
1791
|
},
|
|
1750
1792
|
{
|
|
1751
|
-
key: '
|
|
1752
|
-
label: 'Name
|
|
1753
|
-
placeholder: 'Name
|
|
1793
|
+
key: 'title.ar',
|
|
1794
|
+
label: 'Arabic Name',
|
|
1795
|
+
placeholder: 'Arabic Name',
|
|
1754
1796
|
validators: [new ValidatorConfig({ type: 'required' })],
|
|
1755
1797
|
},
|
|
1756
1798
|
{
|
|
@@ -1759,11 +1801,11 @@ class PropertyForm {
|
|
|
1759
1801
|
type: 'textarea',
|
|
1760
1802
|
cssClass: 'md:col-span-2',
|
|
1761
1803
|
},
|
|
1762
|
-
{
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
},
|
|
1804
|
+
// {
|
|
1805
|
+
// key: 'defaultValue',
|
|
1806
|
+
// label: 'Default Value',
|
|
1807
|
+
// cssClass: 'md:col-span-2',
|
|
1808
|
+
// },
|
|
1767
1809
|
],
|
|
1768
1810
|
},
|
|
1769
1811
|
],
|
|
@@ -1779,11 +1821,29 @@ class PropertyForm {
|
|
|
1779
1821
|
let prev;
|
|
1780
1822
|
effect(() => {
|
|
1781
1823
|
const currentPropertyType = this.propertyType();
|
|
1782
|
-
if (!currentPropertyType || !prev || prev == currentPropertyType)
|
|
1824
|
+
if (!currentPropertyType || !prev || prev == currentPropertyType) {
|
|
1825
|
+
prev = this.propertyType();
|
|
1783
1826
|
return;
|
|
1784
|
-
|
|
1827
|
+
}
|
|
1785
1828
|
this.configurationControl.reset(null);
|
|
1786
1829
|
});
|
|
1830
|
+
effect(() => {
|
|
1831
|
+
const currentPropertyType = this.propertyType();
|
|
1832
|
+
if (!currentPropertyType)
|
|
1833
|
+
return;
|
|
1834
|
+
// Reset config scopes before loading new ones
|
|
1835
|
+
this.facade.resetConfigScopes();
|
|
1836
|
+
// Load config scopes for specific property types
|
|
1837
|
+
const supportedTypes = [
|
|
1838
|
+
'InternalModule',
|
|
1839
|
+
'DynamicList',
|
|
1840
|
+
'EditableListView',
|
|
1841
|
+
'LookupLog',
|
|
1842
|
+
];
|
|
1843
|
+
if (supportedTypes.includes(currentPropertyType)) {
|
|
1844
|
+
this.facade.loadConfigAsType(currentPropertyType);
|
|
1845
|
+
}
|
|
1846
|
+
});
|
|
1787
1847
|
effect(() => {
|
|
1788
1848
|
const property = this.facade.selected();
|
|
1789
1849
|
this.syncFormWithSelectedProperty(property);
|
|
@@ -1899,7 +1959,9 @@ class PropertyForm {
|
|
|
1899
1959
|
syncFormWithSelectedProperty(property) {
|
|
1900
1960
|
if (!property)
|
|
1901
1961
|
return;
|
|
1902
|
-
this.mainControl.patchValue(property
|
|
1962
|
+
this.mainControl.patchValue(property, {
|
|
1963
|
+
emitEvent: false,
|
|
1964
|
+
});
|
|
1903
1965
|
this.configurationControl.setValue(property?.configuration);
|
|
1904
1966
|
}
|
|
1905
1967
|
goBack() {
|
|
@@ -1913,7 +1975,7 @@ class PropertyForm {
|
|
|
1913
1975
|
this.destroyConfigurationComponent();
|
|
1914
1976
|
}
|
|
1915
1977
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: PropertyForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1916
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: PropertyForm, isStandalone: true, selector: "mt-property-form", inputs: { propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "configurationHost", first: true, predicate: ["configurationHost"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<mt-card class=\"h-full\">\n <ng-template #headless>\n <div class=\"flex justify-between items-center p-3 border-b border-surface\">\n <div class=\"flex gap-2 items-center\">\n <mt-button\n [text]=\"true\"\n icon=\"arrow.arrow-narrow-left\"\n size=\"large\"\n (click)=\"goBack()\"\n ></mt-button>\n <mt-avatar size=\"normal\" icon=\"custom.user-pp\" />\n <h3 class=\"font-bold text-lg\">\n {{ propertyId() ? \"Edit Property\" : \"Create New Property\" }}\n </h3>\n </div>\n <mt-button\n class=\"mx-2\"\n [label]=\"submitLabel()\"\n [icon]=\"isEditing() ? 'custom.pencil' : 'general.plus'\"\n [loading]=\"submitting()\"\n [disabled]=\"submitDisabled() || this.propertyForm.invalid\"\n (click)=\"createOrEditProperty()\"\n />\n </div>\n <div\n [formGroup]=\"propertyForm\"\n class=\"h-full py-4 bg-[radial-gradient(120%_80%_at_100%_0%,_#EBEFFF_0%,_#F6F8FC_45%,_#F6F8FC_100%)] flex justify-center\"\n >\n <div class=\"w-1/2 flex flex-col gap-6\">\n <mt-dynamic-form\n
|
|
1978
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: PropertyForm, isStandalone: true, selector: "mt-property-form", inputs: { propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "configurationHost", first: true, predicate: ["configurationHost"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<mt-card class=\"h-full\">\n <ng-template #headless>\n <div class=\"flex justify-between items-center p-3 border-b border-surface\">\n <div class=\"flex gap-2 items-center\">\n <mt-button\n [text]=\"true\"\n icon=\"arrow.arrow-narrow-left\"\n size=\"large\"\n (click)=\"goBack()\"\n ></mt-button>\n <mt-avatar size=\"normal\" icon=\"custom.user-pp\" />\n <h3 class=\"font-bold text-lg\">\n {{ propertyId() ? \"Edit Property\" : \"Create New Property\" }}\n </h3>\n </div>\n <mt-button\n class=\"mx-2\"\n [label]=\"submitLabel()\"\n [icon]=\"isEditing() ? 'custom.pencil' : 'general.plus'\"\n [loading]=\"submitting()\"\n [disabled]=\"submitDisabled() || this.propertyForm.invalid\"\n (click)=\"createOrEditProperty()\"\n />\n </div>\n <div\n [formGroup]=\"propertyForm\"\n class=\"h-full py-4 bg-[radial-gradient(120%_80%_at_100%_0%,_#EBEFFF_0%,_#F6F8FC_45%,_#F6F8FC_100%)] flex justify-center\"\n >\n <div class=\"w-1/2 flex flex-col gap-6\">\n @if (loading()) {\n <!-- Skeleton Loading State -->\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\n <div class=\"flex justify-between items-center gap-6\">\n <p-skeleton width=\"50%\" height=\"3rem\"></p-skeleton>\n <p-skeleton width=\"8rem\" height=\"2.5rem\"></p-skeleton>\n </div>\n </div>\n\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\n <p-skeleton\n width=\"12rem\"\n height=\"1.5rem\"\n styleClass=\"mb-4\"\n ></p-skeleton>\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <p-skeleton height=\"3rem\"></p-skeleton>\n <p-skeleton height=\"3rem\"></p-skeleton>\n <p-skeleton height=\"6rem\" styleClass=\"md:col-span-2\"></p-skeleton>\n <p-skeleton height=\"3rem\" styleClass=\"md:col-span-2\"></p-skeleton>\n </div>\n </div>\n\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\n <p-skeleton\n width=\"10rem\"\n height=\"1.5rem\"\n styleClass=\"mb-4\"\n ></p-skeleton>\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <p-skeleton height=\"3rem\"></p-skeleton>\n <p-skeleton height=\"3rem\"></p-skeleton>\n <p-skeleton height=\"8rem\" styleClass=\"md:col-span-2\"></p-skeleton>\n </div>\n </div>\n } @else {\n <mt-dynamic-form\n [formConfig]=\"dynamicFormConfigMain()\"\n [formControlName]=\"'main'\"\n />\n @if (configurationFormConfig()) {\n <mt-dynamic-form\n formControlName=\"configuration\"\n [formConfig]=\"configurationFormConfig()!\"\n />\n } @else {\n <ng-container #configurationHost></ng-container>\n @if (!configurationComponentExists()) {\n @switch (propertyType()) {\n @case (\"User\") {\n <mt-user-configuration />\n }\n @case (\"Percentage\") {\n <mt-percentage-configuration />\n }\n @case (\"Lookup\") {\n <mt-lookup-configuration />\n }\n @case (\"LookupMultiSelect\") {\n <mt-lookup-configuration />\n }\n @case (\"InternalModule\") {\n <mt-internal-module-configuration />\n }\n @case (\"DynamicList\") {\n <mt-dynamic-list-configuration />\n }\n @case (\"API\") {\n <mt-api-configuration formControlName=\"configuration\" />\n }\n <!-- @case('ViewList') { REMOVED FOR NOW\n <mt-view-list-configuration />\n } -->\n @case (\"Attachment\") {\n <mt-attachment-configuration />\n }\n <!-- @case('ReferenceProperty') { REMOVED FOR NOW\n } -->\n @case (\"EditableListView\") {\n <mt-editable-list-view-configuration />\n }\n @case (\"LookupLog\") {\n <mt-check-list-form-configuration />\n }\n <!-- @case('LookupMatrix') { REMOVED FOR NOW\n <mt-lookup-configuration />\n } -->\n @case (\"Location\") {\n <mt-location-configuration />\n }\n }\n }\n }\n }\n </div>\n </div>\n </ng-template>\n</mt-card>\n", styles: [""], dependencies: [{ kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: ApiConfiguration, selector: "mt-api-configuration" }, { kind: "component", type: CheckListFormConfiguration, selector: "mt-check-list-form-configuration" }, { kind: "component", type: DynamicListConfiguration, selector: "mt-dynamic-list-configuration" }, { kind: "component", type: EditableListViewConfiguration, selector: "mt-editable-list-view-configuration" }, { kind: "component", type: InternalModuleConfiguration, selector: "mt-internal-module-configuration" }, { kind: "component", type: LocationConfiguration, selector: "mt-location-configuration" }, { kind: "component", type: LookupConfiguration, selector: "mt-lookup-configuration" }, { kind: "component", type: PercentageConfiguration, selector: "mt-percentage-configuration" }, { kind: "component", type: UserConfiguration, selector: "mt-user-configuration" }, { kind: "component", type: AttachmentConfiguration, selector: "mt-attachment-configuration" }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
|
|
1917
1979
|
}
|
|
1918
1980
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: PropertyForm, decorators: [{
|
|
1919
1981
|
type: Component,
|
|
@@ -1933,7 +1995,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
|
1933
1995
|
PercentageConfiguration,
|
|
1934
1996
|
UserConfiguration,
|
|
1935
1997
|
AttachmentConfiguration,
|
|
1936
|
-
|
|
1998
|
+
SkeletonModule,
|
|
1999
|
+
], template: "<mt-card class=\"h-full\">\n <ng-template #headless>\n <div class=\"flex justify-between items-center p-3 border-b border-surface\">\n <div class=\"flex gap-2 items-center\">\n <mt-button\n [text]=\"true\"\n icon=\"arrow.arrow-narrow-left\"\n size=\"large\"\n (click)=\"goBack()\"\n ></mt-button>\n <mt-avatar size=\"normal\" icon=\"custom.user-pp\" />\n <h3 class=\"font-bold text-lg\">\n {{ propertyId() ? \"Edit Property\" : \"Create New Property\" }}\n </h3>\n </div>\n <mt-button\n class=\"mx-2\"\n [label]=\"submitLabel()\"\n [icon]=\"isEditing() ? 'custom.pencil' : 'general.plus'\"\n [loading]=\"submitting()\"\n [disabled]=\"submitDisabled() || this.propertyForm.invalid\"\n (click)=\"createOrEditProperty()\"\n />\n </div>\n <div\n [formGroup]=\"propertyForm\"\n class=\"h-full py-4 bg-[radial-gradient(120%_80%_at_100%_0%,_#EBEFFF_0%,_#F6F8FC_45%,_#F6F8FC_100%)] flex justify-center\"\n >\n <div class=\"w-1/2 flex flex-col gap-6\">\n @if (loading()) {\n <!-- Skeleton Loading State -->\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\n <div class=\"flex justify-between items-center gap-6\">\n <p-skeleton width=\"50%\" height=\"3rem\"></p-skeleton>\n <p-skeleton width=\"8rem\" height=\"2.5rem\"></p-skeleton>\n </div>\n </div>\n\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\n <p-skeleton\n width=\"12rem\"\n height=\"1.5rem\"\n styleClass=\"mb-4\"\n ></p-skeleton>\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <p-skeleton height=\"3rem\"></p-skeleton>\n <p-skeleton height=\"3rem\"></p-skeleton>\n <p-skeleton height=\"6rem\" styleClass=\"md:col-span-2\"></p-skeleton>\n <p-skeleton height=\"3rem\" styleClass=\"md:col-span-2\"></p-skeleton>\n </div>\n </div>\n\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\n <p-skeleton\n width=\"10rem\"\n height=\"1.5rem\"\n styleClass=\"mb-4\"\n ></p-skeleton>\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <p-skeleton height=\"3rem\"></p-skeleton>\n <p-skeleton height=\"3rem\"></p-skeleton>\n <p-skeleton height=\"8rem\" styleClass=\"md:col-span-2\"></p-skeleton>\n </div>\n </div>\n } @else {\n <mt-dynamic-form\n [formConfig]=\"dynamicFormConfigMain()\"\n [formControlName]=\"'main'\"\n />\n @if (configurationFormConfig()) {\n <mt-dynamic-form\n formControlName=\"configuration\"\n [formConfig]=\"configurationFormConfig()!\"\n />\n } @else {\n <ng-container #configurationHost></ng-container>\n @if (!configurationComponentExists()) {\n @switch (propertyType()) {\n @case (\"User\") {\n <mt-user-configuration />\n }\n @case (\"Percentage\") {\n <mt-percentage-configuration />\n }\n @case (\"Lookup\") {\n <mt-lookup-configuration />\n }\n @case (\"LookupMultiSelect\") {\n <mt-lookup-configuration />\n }\n @case (\"InternalModule\") {\n <mt-internal-module-configuration />\n }\n @case (\"DynamicList\") {\n <mt-dynamic-list-configuration />\n }\n @case (\"API\") {\n <mt-api-configuration formControlName=\"configuration\" />\n }\n <!-- @case('ViewList') { REMOVED FOR NOW\n <mt-view-list-configuration />\n } -->\n @case (\"Attachment\") {\n <mt-attachment-configuration />\n }\n <!-- @case('ReferenceProperty') { REMOVED FOR NOW\n } -->\n @case (\"EditableListView\") {\n <mt-editable-list-view-configuration />\n }\n @case (\"LookupLog\") {\n <mt-check-list-form-configuration />\n }\n <!-- @case('LookupMatrix') { REMOVED FOR NOW\n <mt-lookup-configuration />\n } -->\n @case (\"Location\") {\n <mt-location-configuration />\n }\n }\n }\n }\n }\n </div>\n </div>\n </ng-template>\n</mt-card>\n" }]
|
|
1937
2000
|
}], ctorParameters: () => [], propDecorators: { configurationHost: [{
|
|
1938
2001
|
type: ViewChild,
|
|
1939
2002
|
args: ['configurationHost', { read: ViewContainerRef }]
|
|
@@ -1947,5 +2010,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
|
1947
2010
|
* Generated bundle index. Do not edit.
|
|
1948
2011
|
*/
|
|
1949
2012
|
|
|
1950
|
-
export { CreateProperty, DeleteProperty, GetCountries, GetGroups,
|
|
2013
|
+
export { CreateProperty, DeleteProperty, GetConfigAsType, GetCountries, GetGroups, GetLookups, GetProperties, GetPropertiesForConfigType, GetProperty, PropertiesFacade, PropertiesList, PropertiesState, PropertyForm, REQUEST_CONTEXT, ResetApiConfiguration, ResetConfigProperties, ResetConfigScopes, ResetSelectedProperty, SetPropertiesModuleInfo, SetPropertyTypes, TestApiConfiguration, UpdateProperty };
|
|
1951
2014
|
//# sourceMappingURL=masterteam-properties.mjs.map
|