@masterteam/properties 0.0.68 → 0.0.70
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/README.md
CHANGED
|
@@ -1,10 +1,38 @@
|
|
|
1
|
-
# @masterteam/properties
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
# @masterteam/properties
|
|
2
|
+
|
|
3
|
+
## Property form scope
|
|
4
|
+
|
|
5
|
+
`PropertyForm` accepts a typed `scope` input. Route hosts should map their URL
|
|
6
|
+
parameters to this domain contract instead of making the package understand
|
|
7
|
+
application-specific route names.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { type PropertiesScope, PropertyForm } from '@masterteam/properties';
|
|
11
|
+
|
|
12
|
+
readonly scope: PropertiesScope = {
|
|
13
|
+
target: { type: 'module', id: 21 },
|
|
14
|
+
parent: { type: 'level', id: 7 },
|
|
15
|
+
};
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<mt-property-form [propertyId]="propertyId" [scope]="scope" />
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
When `scope` is supplied, the form applies it to `PropertiesFacade` and waits
|
|
23
|
+
for that dispatch to complete before loading an existing property. This is
|
|
24
|
+
required for cold create/edit routes because property requests, formula schema
|
|
25
|
+
IDs, and save endpoints all depend on the effective scope. Visiting a list page
|
|
26
|
+
first must never be required.
|
|
27
|
+
|
|
28
|
+
For backward compatibility, hosts that already initialize
|
|
29
|
+
`PropertiesFacade.setModuleInfo(...)` before constructing the form can omit the
|
|
30
|
+
input. New route and embedded integrations should prefer the explicit scope.
|
|
31
|
+
|
|
32
|
+
## 🤝 Contributing
|
|
33
|
+
|
|
34
|
+
Contributions are welcome\! Please feel free to open an issue or submit a pull request.
|
|
35
|
+
|
|
36
|
+
## 📄 License
|
|
37
|
+
|
|
38
|
+
This project is licensed under the MIT License.
|
|
@@ -5,7 +5,7 @@ import { Table } from '@masterteam/components/table';
|
|
|
5
5
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
6
6
|
import { HttpClient, HttpContextToken } from '@angular/common/http';
|
|
7
7
|
import { Action, Selector, State, Store, select } from '@ngxs/store';
|
|
8
|
-
import { of, finalize, startWith, map, distinctUntilChanged, EMPTY, Subscription } from 'rxjs';
|
|
8
|
+
import { of, finalize, startWith, map, distinctUntilChanged, EMPTY, switchMap, Subscription } from 'rxjs';
|
|
9
9
|
import { CrudStateBase, handleApiRequest, ValidatorConfig, PickListFieldConfig, ColorPickerFieldConfig } from '@masterteam/components';
|
|
10
10
|
import { Breadcrumb } from '@masterteam/components/breadcrumb';
|
|
11
11
|
import { Card } from '@masterteam/components/card';
|
|
@@ -30,6 +30,12 @@ import { ToggleField } from '@masterteam/components/toggle-field';
|
|
|
30
30
|
import { ModalService } from '@masterteam/components/modal';
|
|
31
31
|
import { ModalRef } from '@masterteam/components/dialog';
|
|
32
32
|
|
|
33
|
+
function buildPropertiesScopeContextKey(scope) {
|
|
34
|
+
return [scope.parent, scope.target]
|
|
35
|
+
.filter((target) => target != null)
|
|
36
|
+
.map((target) => `${target.type}:${target.id}`)
|
|
37
|
+
.join('/');
|
|
38
|
+
}
|
|
33
39
|
var PropertiesActionKey;
|
|
34
40
|
(function (PropertiesActionKey) {
|
|
35
41
|
PropertiesActionKey["GetAll"] = "getAll";
|
|
@@ -222,6 +228,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
222
228
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
223
229
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
224
230
|
};
|
|
231
|
+
var PropertiesState_1;
|
|
225
232
|
const DEFAULT_STATE = {
|
|
226
233
|
properties: [],
|
|
227
234
|
selectedProperty: null,
|
|
@@ -244,6 +251,7 @@ const DEFAULT_STATE = {
|
|
|
244
251
|
defaultViewType: null,
|
|
245
252
|
};
|
|
246
253
|
let PropertiesState = class PropertiesState extends CrudStateBase {
|
|
254
|
+
static { PropertiesState_1 = this; }
|
|
247
255
|
http = inject(HttpClient);
|
|
248
256
|
baseUrl = 'Properties';
|
|
249
257
|
lookupsUrl = 'Lookups';
|
|
@@ -267,6 +275,24 @@ let PropertiesState = class PropertiesState extends CrudStateBase {
|
|
|
267
275
|
static parentModuleId(state) {
|
|
268
276
|
return state.parentModuleId ?? null;
|
|
269
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* Canonical formula-builder context key for the current scope, in the same
|
|
280
|
+
* format used for the catalog request: `Level:5/Module:10` (module under a
|
|
281
|
+
* level), `Level:5` (level), or `Module:10` (standalone module). Returns
|
|
282
|
+
* null when no scope is set. This lets the formula builder address a
|
|
283
|
+
* standalone module as `Module:{id}` instead of mistaking it for a level.
|
|
284
|
+
*/
|
|
285
|
+
static formulaContextKey(state) {
|
|
286
|
+
if (state.moduleType == null || state.moduleId == null) {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
return buildPropertiesScopeContextKey({
|
|
290
|
+
target: { type: state.moduleType, id: state.moduleId },
|
|
291
|
+
parent: state.parentModuleType != null && state.parentModuleId != null
|
|
292
|
+
? { type: state.parentModuleType, id: state.parentModuleId }
|
|
293
|
+
: undefined,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
270
296
|
static lookups(state) {
|
|
271
297
|
return state.lookups;
|
|
272
298
|
}
|
|
@@ -324,14 +350,7 @@ let PropertiesState = class PropertiesState extends CrudStateBase {
|
|
|
324
350
|
lastQueryParams: action.params ?? null,
|
|
325
351
|
});
|
|
326
352
|
// Build contextKey in format "Level:5/Module:10" or "Level:5" or "Module:10"
|
|
327
|
-
const
|
|
328
|
-
if (state.parentModuleType && state.parentModuleId) {
|
|
329
|
-
contextParts.push(`${state.parentModuleType}:${state.parentModuleId}`);
|
|
330
|
-
}
|
|
331
|
-
if (state.moduleType && state.moduleId) {
|
|
332
|
-
contextParts.push(`${state.moduleType}:${state.moduleId}`);
|
|
333
|
-
}
|
|
334
|
-
const contextKey = contextParts.join('/');
|
|
353
|
+
const contextKey = PropertiesState_1.formulaContextKey(state) ?? '';
|
|
335
354
|
const params = {
|
|
336
355
|
...action.params,
|
|
337
356
|
contextKey,
|
|
@@ -816,6 +835,9 @@ __decorate([
|
|
|
816
835
|
__decorate([
|
|
817
836
|
Selector()
|
|
818
837
|
], PropertiesState, "parentModuleId", null);
|
|
838
|
+
__decorate([
|
|
839
|
+
Selector()
|
|
840
|
+
], PropertiesState, "formulaContextKey", null);
|
|
819
841
|
__decorate([
|
|
820
842
|
Selector()
|
|
821
843
|
], PropertiesState, "lookups", null);
|
|
@@ -858,7 +880,7 @@ __decorate([
|
|
|
858
880
|
__decorate([
|
|
859
881
|
Selector()
|
|
860
882
|
], PropertiesState, "propertyById", null);
|
|
861
|
-
PropertiesState = __decorate([
|
|
883
|
+
PropertiesState = PropertiesState_1 = __decorate([
|
|
862
884
|
State({
|
|
863
885
|
name: 'properties',
|
|
864
886
|
defaults: DEFAULT_STATE,
|
|
@@ -894,6 +916,7 @@ class PropertiesFacade {
|
|
|
894
916
|
selected = select(PropertiesState.selectedProperty);
|
|
895
917
|
moduleId = select(PropertiesState.moduleId);
|
|
896
918
|
parentModuleId = select(PropertiesState.parentModuleId);
|
|
919
|
+
formulaContextKey = select(PropertiesState.formulaContextKey);
|
|
897
920
|
lookups = select(PropertiesState.lookups);
|
|
898
921
|
configProperties = select(PropertiesState.configTypeProperties);
|
|
899
922
|
groups = select(PropertiesState.groups);
|
|
@@ -969,6 +992,9 @@ class PropertiesFacade {
|
|
|
969
992
|
setModuleInfo(moduleType, moduleId, parentModuleType, parentModuleId, parentPath) {
|
|
970
993
|
return this.store.dispatch(new SetPropertiesModuleInfo(moduleType, moduleId, parentModuleType, parentModuleId, parentPath));
|
|
971
994
|
}
|
|
995
|
+
setScope(scope) {
|
|
996
|
+
return this.setModuleInfo(scope.target.type, scope.target.id, scope.parent?.type, scope.parent?.id, scope.parentPath);
|
|
997
|
+
}
|
|
972
998
|
loadLookups() {
|
|
973
999
|
return this.store.dispatch(new GetLookups());
|
|
974
1000
|
}
|
|
@@ -1612,7 +1638,7 @@ class CheckListFormConfiguration {
|
|
|
1612
1638
|
this.propertiesFacade.resetConfigProperties();
|
|
1613
1639
|
}
|
|
1614
1640
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CheckListFormConfiguration, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1615
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: CheckListFormConfiguration, isStandalone: true, selector: "mt-check-list-form-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
1641
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: CheckListFormConfiguration, isStandalone: true, selector: "mt-check-list-form-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "forcedDisabledFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
1616
1642
|
{ provide: ControlContainer, useExisting: FormGroupDirective },
|
|
1617
1643
|
] });
|
|
1618
1644
|
}
|
|
@@ -1763,7 +1789,7 @@ class EntityListConfiguration {
|
|
|
1763
1789
|
this.propertiesFacade.resetConfigProperties();
|
|
1764
1790
|
}
|
|
1765
1791
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListConfiguration, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1766
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: EntityListConfiguration, isStandalone: true, selector: "mt-entity-list-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
1792
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: EntityListConfiguration, isStandalone: true, selector: "mt-entity-list-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "forcedDisabledFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
1767
1793
|
{ provide: ControlContainer, useExisting: FormGroupDirective },
|
|
1768
1794
|
] });
|
|
1769
1795
|
}
|
|
@@ -1814,7 +1840,7 @@ class LocationConfiguration {
|
|
|
1814
1840
|
});
|
|
1815
1841
|
}
|
|
1816
1842
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LocationConfiguration, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1817
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: LocationConfiguration, isStandalone: true, selector: "mt-location-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
1843
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: LocationConfiguration, isStandalone: true, selector: "mt-location-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "forcedDisabledFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
1818
1844
|
{ provide: ControlContainer, useExisting: FormGroupDirective },
|
|
1819
1845
|
] });
|
|
1820
1846
|
}
|
|
@@ -1862,7 +1888,7 @@ class LookupConfiguration {
|
|
|
1862
1888
|
});
|
|
1863
1889
|
}
|
|
1864
1890
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LookupConfiguration, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1865
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: LookupConfiguration, isStandalone: true, selector: "mt-lookup-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
1891
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: LookupConfiguration, isStandalone: true, selector: "mt-lookup-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "forcedDisabledFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
1866
1892
|
{ provide: ControlContainer, useExisting: FormGroupDirective },
|
|
1867
1893
|
] });
|
|
1868
1894
|
}
|
|
@@ -1896,7 +1922,7 @@ class PercentageConfiguration {
|
|
|
1896
1922
|
],
|
|
1897
1923
|
}, ...(ngDevMode ? [{ debugName: "formConfig" }] : /* istanbul ignore next */ []));
|
|
1898
1924
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: PercentageConfiguration, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1899
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: PercentageConfiguration, isStandalone: true, selector: "mt-percentage-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
1925
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: PercentageConfiguration, isStandalone: true, selector: "mt-percentage-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "forcedDisabledFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
1900
1926
|
{ provide: ControlContainer, useExisting: FormGroupDirective },
|
|
1901
1927
|
] });
|
|
1902
1928
|
}
|
|
@@ -1913,6 +1939,7 @@ class StatusItemForm {
|
|
|
1913
1939
|
facade = inject(PropertiesFacade);
|
|
1914
1940
|
transloco = inject(TranslocoService);
|
|
1915
1941
|
propertyId = input.required(...(ngDevMode ? [{ debugName: "propertyId" }] : /* istanbul ignore next */ []));
|
|
1942
|
+
contextKey = input(undefined, ...(ngDevMode ? [{ debugName: "contextKey" }] : /* istanbul ignore next */ []));
|
|
1916
1943
|
levelSchemaId = input(undefined, ...(ngDevMode ? [{ debugName: "levelSchemaId" }] : /* istanbul ignore next */ []));
|
|
1917
1944
|
moduleId = input(undefined, ...(ngDevMode ? [{ debugName: "moduleId" }] : /* istanbul ignore next */ []));
|
|
1918
1945
|
statusData = input(null, ...(ngDevMode ? [{ debugName: "statusData" }] : /* istanbul ignore next */ []));
|
|
@@ -2073,7 +2100,7 @@ class StatusItemForm {
|
|
|
2073
2100
|
});
|
|
2074
2101
|
}
|
|
2075
2102
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StatusItemForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2076
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StatusItemForm, isStandalone: true, selector: "mt-status-item-form", inputs: { propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: true, transformFunction: null }, levelSchemaId: { classPropertyName: "levelSchemaId", publicName: "levelSchemaId", isSignal: true, isRequired: false, transformFunction: null }, moduleId: { classPropertyName: "moduleId", publicName: "moduleId", isSignal: true, isRequired: false, transformFunction: null }, statusData: { classPropertyName: "statusData", publicName: "statusData", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\r\n [class]=\"\r\n 'flex max-h-[75vh] flex-col gap-4 overflow-y-auto p-4 my-4 ' +\r\n modal.contentClass\r\n \"\r\n>\r\n <form class=\"space-y-6\">\r\n <mt-dynamic-form\r\n class=\"block\"\r\n [formConfig]=\"statusFormConfig()\"\r\n [formControl]=\"statusFormControl\"\r\n />\r\n\r\n @if (showFormula()) {\r\n <div class=\"rounded-xl border border-surface-200 bg-content px-4 py-4\">\r\n <div class=\"mb-3 font-medium text-surface-700\">\r\n {{ \"properties.form.statusFormula\" | transloco }}\r\n <span class=\"text-red-500 dark:text-red-600\" aria-hidden=\"true\"\r\n >*</span\r\n >\r\n </div>\r\n\r\n <mt-formula-builder\r\n [formControl]=\"formulaControl\"\r\n [levelSchemaId]=\"levelSchemaId()\"\r\n [moduleId]=\"moduleId()\"\r\n />\r\n </div>\r\n }\r\n </form>\r\n</div>\r\n\r\n<div [class]=\"modal.footerClass\" class=\"mt-7\">\r\n <mt-button [label]=\"cancelLabel()\" variant=\"outlined\" (click)=\"ref.close()\" />\r\n <mt-button\r\n [label]=\"buttonLabel()\"\r\n (click)=\"onSubmit()\"\r\n [loading]=\"isSubmitting()\"\r\n [disabled]=\"\r\n statusFormControl.invalid ||\r\n (showFormula() && formulaControl.invalid) ||\r\n isSubmitting()\r\n \"\r\n />\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "component", type: FormulaBuilder, selector: "mt-formula-builder", inputs: ["propertiesByPath", "levelSchemaId", "moduleId", "contextEntityTypeKey", "templateId", "placeholder", "hideToolbar", "hideStatusBar", "toolbarTabs", "codeOnly", "isProcessBuilder"], outputs: ["validationChange", "tokensChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }] });
|
|
2103
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StatusItemForm, isStandalone: true, selector: "mt-status-item-form", inputs: { propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: true, transformFunction: null }, contextKey: { classPropertyName: "contextKey", publicName: "contextKey", isSignal: true, isRequired: false, transformFunction: null }, levelSchemaId: { classPropertyName: "levelSchemaId", publicName: "levelSchemaId", isSignal: true, isRequired: false, transformFunction: null }, moduleId: { classPropertyName: "moduleId", publicName: "moduleId", isSignal: true, isRequired: false, transformFunction: null }, statusData: { classPropertyName: "statusData", publicName: "statusData", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\r\n [class]=\"\r\n 'flex max-h-[75vh] flex-col gap-4 overflow-y-auto p-4 my-4 ' +\r\n modal.contentClass\r\n \"\r\n>\r\n <form class=\"space-y-6\">\r\n <mt-dynamic-form\r\n class=\"block\"\r\n [formConfig]=\"statusFormConfig()\"\r\n [formControl]=\"statusFormControl\"\r\n />\r\n\r\n @if (showFormula()) {\r\n <div class=\"rounded-xl border border-surface-200 bg-content px-4 py-4\">\r\n <div class=\"mb-3 font-medium text-surface-700\">\r\n {{ \"properties.form.statusFormula\" | transloco }}\r\n <span class=\"text-red-500 dark:text-red-600\" aria-hidden=\"true\"\r\n >*</span\r\n >\r\n </div>\r\n\r\n <mt-formula-builder\r\n [formControl]=\"formulaControl\"\r\n [contextKey]=\"contextKey()\"\r\n [levelSchemaId]=\"levelSchemaId()\"\r\n [moduleId]=\"moduleId()\"\r\n />\r\n </div>\r\n }\r\n </form>\r\n</div>\r\n\r\n<div [class]=\"modal.footerClass\" class=\"mt-7\">\r\n <mt-button [label]=\"cancelLabel()\" variant=\"outlined\" (click)=\"ref.close()\" />\r\n <mt-button\r\n [label]=\"buttonLabel()\"\r\n (click)=\"onSubmit()\"\r\n [loading]=\"isSubmitting()\"\r\n [disabled]=\"\r\n statusFormControl.invalid ||\r\n (showFormula() && formulaControl.invalid) ||\r\n isSubmitting()\r\n \"\r\n />\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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", "forcedHiddenFieldKeys", "forcedDisabledFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "component", type: FormulaBuilder, selector: "mt-formula-builder", inputs: ["propertiesByPath", "levelSchemaId", "moduleId", "contextEntityTypeKey", "templateId", "placeholder", "hideToolbar", "hideStatusBar", "toolbarTabs", "codeOnly", "builderOnly", "valueMode", "isProcessBuilder"], outputs: ["validationChange", "tokensChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }] });
|
|
2077
2104
|
}
|
|
2078
2105
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StatusItemForm, decorators: [{
|
|
2079
2106
|
type: Component,
|
|
@@ -2084,8 +2111,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
2084
2111
|
FormulaBuilder,
|
|
2085
2112
|
ReactiveFormsModule,
|
|
2086
2113
|
TranslocoModule,
|
|
2087
|
-
], template: "<div\r\n [class]=\"\r\n 'flex max-h-[75vh] flex-col gap-4 overflow-y-auto p-4 my-4 ' +\r\n modal.contentClass\r\n \"\r\n>\r\n <form class=\"space-y-6\">\r\n <mt-dynamic-form\r\n class=\"block\"\r\n [formConfig]=\"statusFormConfig()\"\r\n [formControl]=\"statusFormControl\"\r\n />\r\n\r\n @if (showFormula()) {\r\n <div class=\"rounded-xl border border-surface-200 bg-content px-4 py-4\">\r\n <div class=\"mb-3 font-medium text-surface-700\">\r\n {{ \"properties.form.statusFormula\" | transloco }}\r\n <span class=\"text-red-500 dark:text-red-600\" aria-hidden=\"true\"\r\n >*</span\r\n >\r\n </div>\r\n\r\n <mt-formula-builder\r\n [formControl]=\"formulaControl\"\r\n [levelSchemaId]=\"levelSchemaId()\"\r\n [moduleId]=\"moduleId()\"\r\n />\r\n </div>\r\n }\r\n </form>\r\n</div>\r\n\r\n<div [class]=\"modal.footerClass\" class=\"mt-7\">\r\n <mt-button [label]=\"cancelLabel()\" variant=\"outlined\" (click)=\"ref.close()\" />\r\n <mt-button\r\n [label]=\"buttonLabel()\"\r\n (click)=\"onSubmit()\"\r\n [loading]=\"isSubmitting()\"\r\n [disabled]=\"\r\n statusFormControl.invalid ||\r\n (showFormula() && formulaControl.invalid) ||\r\n isSubmitting()\r\n \"\r\n />\r\n</div>\r\n" }]
|
|
2088
|
-
}], ctorParameters: () => [], propDecorators: { propertyId: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyId", required: true }] }], levelSchemaId: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelSchemaId", required: false }] }], moduleId: [{ type: i0.Input, args: [{ isSignal: true, alias: "moduleId", required: false }] }], statusData: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusData", required: false }] }] } });
|
|
2114
|
+
], template: "<div\r\n [class]=\"\r\n 'flex max-h-[75vh] flex-col gap-4 overflow-y-auto p-4 my-4 ' +\r\n modal.contentClass\r\n \"\r\n>\r\n <form class=\"space-y-6\">\r\n <mt-dynamic-form\r\n class=\"block\"\r\n [formConfig]=\"statusFormConfig()\"\r\n [formControl]=\"statusFormControl\"\r\n />\r\n\r\n @if (showFormula()) {\r\n <div class=\"rounded-xl border border-surface-200 bg-content px-4 py-4\">\r\n <div class=\"mb-3 font-medium text-surface-700\">\r\n {{ \"properties.form.statusFormula\" | transloco }}\r\n <span class=\"text-red-500 dark:text-red-600\" aria-hidden=\"true\"\r\n >*</span\r\n >\r\n </div>\r\n\r\n <mt-formula-builder\r\n [formControl]=\"formulaControl\"\r\n [contextKey]=\"contextKey()\"\r\n [levelSchemaId]=\"levelSchemaId()\"\r\n [moduleId]=\"moduleId()\"\r\n />\r\n </div>\r\n }\r\n </form>\r\n</div>\r\n\r\n<div [class]=\"modal.footerClass\" class=\"mt-7\">\r\n <mt-button [label]=\"cancelLabel()\" variant=\"outlined\" (click)=\"ref.close()\" />\r\n <mt-button\r\n [label]=\"buttonLabel()\"\r\n (click)=\"onSubmit()\"\r\n [loading]=\"isSubmitting()\"\r\n [disabled]=\"\r\n statusFormControl.invalid ||\r\n (showFormula() && formulaControl.invalid) ||\r\n isSubmitting()\r\n \"\r\n />\r\n</div>\r\n" }]
|
|
2115
|
+
}], ctorParameters: () => [], propDecorators: { propertyId: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyId", required: true }] }], contextKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextKey", required: false }] }], levelSchemaId: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelSchemaId", required: false }] }], moduleId: [{ type: i0.Input, args: [{ isSignal: true, alias: "moduleId", required: false }] }], statusData: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusData", required: false }] }] } });
|
|
2089
2116
|
|
|
2090
2117
|
class StatusConfiguration {
|
|
2091
2118
|
facade = inject(PropertiesFacade);
|
|
@@ -2094,6 +2121,7 @@ class StatusConfiguration {
|
|
|
2094
2121
|
lastLoadedPropertyId = signal(null, ...(ngDevMode ? [{ debugName: "lastLoadedPropertyId" }] : /* istanbul ignore next */ []));
|
|
2095
2122
|
colorTpl = viewChild.required('colorTpl');
|
|
2096
2123
|
propertyId = input(null, ...(ngDevMode ? [{ debugName: "propertyId" }] : /* istanbul ignore next */ []));
|
|
2124
|
+
contextKey = input(undefined, ...(ngDevMode ? [{ debugName: "contextKey" }] : /* istanbul ignore next */ []));
|
|
2097
2125
|
levelSchemaId = input(undefined, ...(ngDevMode ? [{ debugName: "levelSchemaId" }] : /* istanbul ignore next */ []));
|
|
2098
2126
|
moduleId = input(undefined, ...(ngDevMode ? [{ debugName: "moduleId" }] : /* istanbul ignore next */ []));
|
|
2099
2127
|
deletingRowIds = signal([], ...(ngDevMode ? [{ debugName: "deletingRowIds" }] : /* istanbul ignore next */ []));
|
|
@@ -2197,6 +2225,7 @@ class StatusConfiguration {
|
|
|
2197
2225
|
dismissableMask: true,
|
|
2198
2226
|
inputValues: {
|
|
2199
2227
|
propertyId,
|
|
2228
|
+
contextKey: this.contextKey(),
|
|
2200
2229
|
levelSchemaId: this.levelSchemaId(),
|
|
2201
2230
|
moduleId: this.moduleId(),
|
|
2202
2231
|
statusData,
|
|
@@ -2234,12 +2263,12 @@ class StatusConfiguration {
|
|
|
2234
2263
|
return Number.isFinite(parsed) ? parsed : null;
|
|
2235
2264
|
}
|
|
2236
2265
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StatusConfiguration, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2237
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StatusConfiguration, isStandalone: true, selector: "mt-status-configuration", inputs: { propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null }, levelSchemaId: { classPropertyName: "levelSchemaId", publicName: "levelSchemaId", isSignal: true, isRequired: false, transformFunction: null }, moduleId: { classPropertyName: "moduleId", publicName: "moduleId", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "colorTpl", first: true, predicate: ["colorTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "<mt-card [title]=\"'properties.form.statusesSection' | transloco\">\r\n @if (canManageStatuses()) {\r\n <mt-table\r\n [data]=\"statuses()\"\r\n [columns]=\"tableColumns()\"\r\n [actions]=\"tableActions()\"\r\n [rowActions]=\"rowActions()\"\r\n [generalSearch]=\"true\"\r\n [loading]=\"loading()\"\r\n [updating]=\"reordering()\"\r\n [reorderableRows]=\"true\"\r\n dataKey=\"id\"\r\n storageKey=\"properties-status-configuration-table\"\r\n (rowReorder)=\"onRowReorder($event)\"\r\n >\r\n <ng-template #colorTpl let-row>\r\n @if (row.color) {\r\n <span\r\n class=\"inline-block h-5 w-5 rounded-full border border-surface-300\"\r\n [style.background-color]=\"row.color\"\r\n [title]=\"row.color\"\r\n ></span>\r\n } @else {\r\n <span class=\"text-surface-400\">\u2014</span>\r\n }\r\n </ng-template>\r\n </mt-table>\r\n } @else {\r\n <div\r\n class=\"rounded-xl border border-dashed border-surface-300 bg-surface-50 px-4 py-6 text-sm text-surface-600\"\r\n >\r\n {{ \"properties.form.statusesSavePrompt\" | transloco }}\r\n </div>\r\n }\r\n</mt-card>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }] });
|
|
2266
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StatusConfiguration, isStandalone: true, selector: "mt-status-configuration", inputs: { propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null }, contextKey: { classPropertyName: "contextKey", publicName: "contextKey", isSignal: true, isRequired: false, transformFunction: null }, levelSchemaId: { classPropertyName: "levelSchemaId", publicName: "levelSchemaId", isSignal: true, isRequired: false, transformFunction: null }, moduleId: { classPropertyName: "moduleId", publicName: "moduleId", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "colorTpl", first: true, predicate: ["colorTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "<mt-card [title]=\"'properties.form.statusesSection' | transloco\">\r\n @if (canManageStatuses()) {\r\n <mt-table\r\n [data]=\"statuses()\"\r\n [columns]=\"tableColumns()\"\r\n [actions]=\"tableActions()\"\r\n [rowActions]=\"rowActions()\"\r\n [generalSearch]=\"true\"\r\n [loading]=\"loading()\"\r\n [updating]=\"reordering()\"\r\n [reorderableRows]=\"true\"\r\n dataKey=\"id\"\r\n storageKey=\"properties-status-configuration-table\"\r\n (rowReorder)=\"onRowReorder($event)\"\r\n >\r\n <ng-template #colorTpl let-row>\r\n @if (row.color) {\r\n <span\r\n class=\"inline-block h-5 w-5 rounded-full border border-surface-300\"\r\n [style.background-color]=\"row.color\"\r\n [title]=\"row.color\"\r\n ></span>\r\n } @else {\r\n <span class=\"text-surface-400\">\u2014</span>\r\n }\r\n </ng-template>\r\n </mt-table>\r\n } @else {\r\n <div\r\n class=\"rounded-xl border border-dashed border-surface-300 bg-surface-50 px-4 py-6 text-sm text-surface-600\"\r\n >\r\n {{ \"properties.form.statusesSavePrompt\" | transloco }}\r\n </div>\r\n }\r\n</mt-card>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }] });
|
|
2238
2267
|
}
|
|
2239
2268
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StatusConfiguration, decorators: [{
|
|
2240
2269
|
type: Component,
|
|
2241
2270
|
args: [{ selector: 'mt-status-configuration', standalone: true, imports: [CommonModule, Card, Table, TranslocoModule], template: "<mt-card [title]=\"'properties.form.statusesSection' | transloco\">\r\n @if (canManageStatuses()) {\r\n <mt-table\r\n [data]=\"statuses()\"\r\n [columns]=\"tableColumns()\"\r\n [actions]=\"tableActions()\"\r\n [rowActions]=\"rowActions()\"\r\n [generalSearch]=\"true\"\r\n [loading]=\"loading()\"\r\n [updating]=\"reordering()\"\r\n [reorderableRows]=\"true\"\r\n dataKey=\"id\"\r\n storageKey=\"properties-status-configuration-table\"\r\n (rowReorder)=\"onRowReorder($event)\"\r\n >\r\n <ng-template #colorTpl let-row>\r\n @if (row.color) {\r\n <span\r\n class=\"inline-block h-5 w-5 rounded-full border border-surface-300\"\r\n [style.background-color]=\"row.color\"\r\n [title]=\"row.color\"\r\n ></span>\r\n } @else {\r\n <span class=\"text-surface-400\">\u2014</span>\r\n }\r\n </ng-template>\r\n </mt-table>\r\n } @else {\r\n <div\r\n class=\"rounded-xl border border-dashed border-surface-300 bg-surface-50 px-4 py-6 text-sm text-surface-600\"\r\n >\r\n {{ \"properties.form.statusesSavePrompt\" | transloco }}\r\n </div>\r\n }\r\n</mt-card>\r\n" }]
|
|
2242
|
-
}], ctorParameters: () => [], propDecorators: { colorTpl: [{ type: i0.ViewChild, args: ['colorTpl', { isSignal: true }] }], propertyId: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyId", required: false }] }], levelSchemaId: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelSchemaId", required: false }] }], moduleId: [{ type: i0.Input, args: [{ isSignal: true, alias: "moduleId", required: false }] }] } });
|
|
2271
|
+
}], ctorParameters: () => [], propDecorators: { colorTpl: [{ type: i0.ViewChild, args: ['colorTpl', { isSignal: true }] }], propertyId: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyId", required: false }] }], contextKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextKey", required: false }] }], levelSchemaId: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelSchemaId", required: false }] }], moduleId: [{ type: i0.Input, args: [{ isSignal: true, alias: "moduleId", required: false }] }] } });
|
|
2243
2272
|
|
|
2244
2273
|
class UserConfiguration {
|
|
2245
2274
|
facade = inject(PropertiesFacade);
|
|
@@ -2312,7 +2341,7 @@ class UserConfiguration {
|
|
|
2312
2341
|
});
|
|
2313
2342
|
}
|
|
2314
2343
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: UserConfiguration, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2315
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: UserConfiguration, isStandalone: true, selector: "mt-user-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
2344
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: UserConfiguration, isStandalone: true, selector: "mt-user-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "forcedDisabledFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
2316
2345
|
{ provide: ControlContainer, useExisting: FormGroupDirective },
|
|
2317
2346
|
] });
|
|
2318
2347
|
}
|
|
@@ -2463,7 +2492,7 @@ class AttachmentConfiguration {
|
|
|
2463
2492
|
],
|
|
2464
2493
|
}, ...(ngDevMode ? [{ debugName: "formConfig" }] : /* istanbul ignore next */ []));
|
|
2465
2494
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: AttachmentConfiguration, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2466
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: AttachmentConfiguration, isStandalone: true, selector: "mt-attachment-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
2495
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: AttachmentConfiguration, isStandalone: true, selector: "mt-attachment-configuration", ngImport: i0, template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n", styles: [""], dependencies: [{ kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "forcedDisabledFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
2467
2496
|
{ provide: ControlContainer, useExisting: FormGroupDirective },
|
|
2468
2497
|
] });
|
|
2469
2498
|
}
|
|
@@ -2474,6 +2503,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
2474
2503
|
], template: "<mt-dynamic-form formControlName=\"configuration\" [formConfig]=\"formConfig()\" />\r\n" }]
|
|
2475
2504
|
}] });
|
|
2476
2505
|
|
|
2506
|
+
function createPropertyFormRequest(operations, scope, propertyId) {
|
|
2507
|
+
if (scope) {
|
|
2508
|
+
const scopeRequest$ = operations.setScope(scope);
|
|
2509
|
+
return propertyId
|
|
2510
|
+
? scopeRequest$.pipe(switchMap(() => operations.loadOne(propertyId)))
|
|
2511
|
+
: scopeRequest$;
|
|
2512
|
+
}
|
|
2513
|
+
return propertyId ? operations.loadOne(propertyId) : null;
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2477
2516
|
class PropertyForm {
|
|
2478
2517
|
facade = inject(PropertiesFacade);
|
|
2479
2518
|
router = inject(Router);
|
|
@@ -2484,6 +2523,7 @@ class PropertyForm {
|
|
|
2484
2523
|
initialValue: this.transloco.getActiveLang(),
|
|
2485
2524
|
});
|
|
2486
2525
|
propertyId = input('', ...(ngDevMode ? [{ debugName: "propertyId" }] : /* istanbul ignore next */ []));
|
|
2526
|
+
scope = input(null, ...(ngDevMode ? [{ debugName: "scope" }] : /* istanbul ignore next */ []));
|
|
2487
2527
|
propertyTypes = this.facade.propertyTypes;
|
|
2488
2528
|
legacyReplacedViewTypes = [
|
|
2489
2529
|
'DynamicList',
|
|
@@ -2538,13 +2578,31 @@ class PropertyForm {
|
|
|
2538
2578
|
normalizedKey === 'modulecode' ||
|
|
2539
2579
|
normalizedKey === 'levelmodulecode');
|
|
2540
2580
|
}, ...(ngDevMode ? [{ debugName: "hideFormulaBuilder" }] : /* istanbul ignore next */ []));
|
|
2541
|
-
|
|
2581
|
+
/**
|
|
2582
|
+
* Canonical context key (`Level:5/Module:10` | `Level:5` | `Module:10`) the
|
|
2583
|
+
* formula builder uses as the source of truth for the context kind — so a
|
|
2584
|
+
* standalone module is addressed as `Module:{id}` rather than mistaken for a
|
|
2585
|
+
* level. Undefined when no scope is set.
|
|
2586
|
+
*/
|
|
2587
|
+
formulaContextKey = computed(() => {
|
|
2588
|
+
const scope = this.scope();
|
|
2589
|
+
return scope
|
|
2590
|
+
? buildPropertiesScopeContextKey(scope)
|
|
2591
|
+
: (this.facade.formulaContextKey() ?? undefined);
|
|
2592
|
+
}, ...(ngDevMode ? [{ debugName: "formulaContextKey" }] : /* istanbul ignore next */ []));
|
|
2593
|
+
formulaSchemaId = computed(() => {
|
|
2594
|
+
const scope = this.scope();
|
|
2595
|
+
return this.resolveSchemaId(scope
|
|
2596
|
+
? (scope.parent?.id ?? scope.target.id)
|
|
2597
|
+
: (this.facade.parentModuleId() ?? this.facade.moduleId()));
|
|
2598
|
+
}, ...(ngDevMode ? [{ debugName: "formulaSchemaId" }] : /* istanbul ignore next */ []));
|
|
2542
2599
|
formulaModuleId = computed(() => {
|
|
2543
|
-
const
|
|
2600
|
+
const scope = this.scope();
|
|
2601
|
+
const parentModuleId = this.resolveSchemaId(scope ? (scope.parent?.id ?? null) : this.facade.parentModuleId());
|
|
2544
2602
|
if (parentModuleId === undefined) {
|
|
2545
2603
|
return undefined;
|
|
2546
2604
|
}
|
|
2547
|
-
return this.resolveSchemaId(this.facade.moduleId());
|
|
2605
|
+
return this.resolveSchemaId(scope ? scope.target.id : this.facade.moduleId());
|
|
2548
2606
|
}, ...(ngDevMode ? [{ debugName: "formulaModuleId" }] : /* istanbul ignore next */ []));
|
|
2549
2607
|
selectedViewType = computed(() => this.propertyType() ??
|
|
2550
2608
|
this.facade.selected()?.viewType, ...(ngDevMode ? [{ debugName: "selectedViewType" }] : /* istanbul ignore next */ []));
|
|
@@ -2674,11 +2732,18 @@ class PropertyForm {
|
|
|
2674
2732
|
}), ...(ngDevMode ? [{ debugName: "dynamicFormConfigMain" }] : /* istanbul ignore next */ []));
|
|
2675
2733
|
constructor() {
|
|
2676
2734
|
this.subscriptions.add(this.mainControl.valueChanges.subscribe((value) => this.mainValue.set(value)));
|
|
2677
|
-
//
|
|
2678
|
-
effect
|
|
2679
|
-
|
|
2680
|
-
|
|
2735
|
+
// Apply an explicit scope before loading an edit. This must remain one
|
|
2736
|
+
// serialized effect: separate context/load effects have no ordering
|
|
2737
|
+
// guarantee during the initial change-detection pass.
|
|
2738
|
+
effect((onCleanup) => {
|
|
2739
|
+
const scope = this.scope();
|
|
2740
|
+
const propertyId = this.propertyId();
|
|
2741
|
+
const request$ = createPropertyFormRequest(this.facade, scope, propertyId);
|
|
2742
|
+
if (!request$) {
|
|
2743
|
+
return;
|
|
2681
2744
|
}
|
|
2745
|
+
const subscription = request$.subscribe();
|
|
2746
|
+
onCleanup(() => subscription.unsubscribe());
|
|
2682
2747
|
});
|
|
2683
2748
|
// Patch viewType from store when creating new property
|
|
2684
2749
|
effect(() => {
|
|
@@ -2978,7 +3043,7 @@ class PropertyForm {
|
|
|
2978
3043
|
this.subscriptions.unsubscribe();
|
|
2979
3044
|
}
|
|
2980
3045
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: PropertyForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2981
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: PropertyForm, isStandalone: true, selector: "mt-property-form", inputs: { propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "statusConfigurationSection", first: true, predicate: ["statusConfigurationSection"], descendants: true, isSignal: true }, { propertyName: "configurationHost", first: true, predicate: ["configurationHost"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<mt-page\r\n [title]=\"\r\n propertyId()\r\n ? ('properties.form.editProperty' | transloco)\r\n : ('properties.form.createNewProperty' | transloco)\r\n \"\r\n avatarIcon=\"custom.products-and-services\"\r\n [avatarStyle]=\"{\r\n '--p-avatar-background': 'var(--p-sky-50)',\r\n '--p-avatar-color': 'var(--p-sky-700)',\r\n }\"\r\n (backButtonClick)=\"goBack()\"\r\n backButton\r\n class=\"h-full\"\r\n>\r\n <ng-template #headerEnd>\r\n <mt-button\r\n class=\"mx-2\"\r\n [label]=\"submitLabel()\"\r\n [icon]=\"isEditing() ? 'custom.pencil' : 'general.plus'\"\r\n [loading]=\"submitting()\"\r\n [disabled]=\"submitDisabled() || this.propertyForm.invalid\"\r\n (click)=\"createOrEditProperty($event)\"\r\n />\r\n </ng-template>\r\n <div\r\n [formGroup]=\"propertyForm\"\r\n class=\"h-full py-4 h-full overflow-y-auto flex justify-center\"\r\n >\r\n <div class=\"w-2/3 flex flex-col gap-6\">\r\n @if (loading()) {\r\n <!-- Skeleton Loading State -->\r\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\r\n <div class=\"flex justify-between items-center gap-6\">\r\n <p-skeleton width=\"50%\" height=\"3rem\"></p-skeleton>\r\n <p-skeleton width=\"8rem\" height=\"2.5rem\"></p-skeleton>\r\n </div>\r\n </div>\r\n\r\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\r\n <p-skeleton\r\n width=\"12rem\"\r\n height=\"1.5rem\"\r\n styleClass=\"mb-4\"\r\n ></p-skeleton>\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"6rem\" styleClass=\"md:col-span-2\"></p-skeleton>\r\n <p-skeleton height=\"3rem\" styleClass=\"md:col-span-2\"></p-skeleton>\r\n </div>\r\n </div>\r\n\r\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\r\n <p-skeleton\r\n width=\"10rem\"\r\n height=\"1.5rem\"\r\n styleClass=\"mb-4\"\r\n ></p-skeleton>\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"8rem\" styleClass=\"md:col-span-2\"></p-skeleton>\r\n </div>\r\n </div>\r\n } @else {\r\n <mt-dynamic-form\r\n [formConfig]=\"dynamicFormConfigMain()\"\r\n [formControlName]=\"'main'\"\r\n />\r\n @if (configurationFormConfig()) {\r\n <mt-dynamic-form\r\n formControlName=\"configuration\"\r\n [formConfig]=\"configurationFormConfig()!\"\r\n />\r\n } @else {\r\n <ng-container #configurationHost></ng-container>\r\n @if (!configurationComponentExists()) {\r\n @switch (propertyType()) {\r\n @case (\"User\") {\r\n <mt-user-configuration />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-percentage-configuration />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-lookup-configuration />\r\n }\r\n @case (\"LookupMultiSelect\") {\r\n <mt-lookup-configuration />\r\n }\r\n @case (\"EntityList\") {\r\n <mt-entity-list-configuration />\r\n }\r\n @case (\"API\") {\r\n <mt-api-configuration formControlName=\"configuration\" />\r\n }\r\n @case (\"Status\") {\r\n <section #statusConfigurationSection>\r\n <mt-status-configuration\r\n [propertyId]=\"statusPropertyId()\"\r\n [levelSchemaId]=\"formulaSchemaId()\"\r\n [moduleId]=\"formulaModuleId()\"\r\n />\r\n </section>\r\n }\r\n <!-- @case('ViewList') { REMOVED FOR NOW\r\n <mt-view-list-configuration />\r\n } -->\r\n @case (\"Attachment\") {\r\n <mt-attachment-configuration />\r\n }\r\n <!-- @case('ReferenceProperty') { REMOVED FOR NOW\r\n } -->\r\n @case (\"LookupModuleCheckList\") {\r\n <mt-check-list-form-configuration />\r\n }\r\n <!-- @case('LookupMatrix') { REMOVED FOR NOW\r\n <mt-lookup-configuration />\r\n } -->\r\n @case (\"Location\") {\r\n <mt-location-configuration />\r\n }\r\n }\r\n }\r\n }\r\n @if (isCalculated() && !hideFormulaBuilder()) {\r\n <mt-card>\r\n <ng-template #headless>\r\n <div\r\n class=\"flex items-center justify-between px-4 py-5 border-b border-surface\"\r\n >\r\n <h3 class=\"text-xl font-semibold\">\r\n {{ \"properties.form.formula\" | transloco }}\r\n <span class=\"text-red-500\">*</span>\r\n </h3>\r\n </div>\r\n <div class=\"flex-1 min-h-0 p-4\">\r\n <mt-formula-builder\r\n formControlName=\"formula\"\r\n [levelSchemaId]=\"formulaSchemaId()\"\r\n [moduleId]=\"formulaModuleId()\"\r\n />\r\n </div>\r\n </ng-template>\r\n </mt-card>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</mt-page>\r\n", styles: [""], dependencies: [{ kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }, { 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: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],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: FormulaBuilder, selector: "mt-formula-builder", inputs: ["propertiesByPath", "levelSchemaId", "moduleId", "contextEntityTypeKey", "templateId", "placeholder", "hideToolbar", "hideStatusBar", "toolbarTabs", "codeOnly", "isProcessBuilder"], outputs: ["validationChange", "tokensChange"] }, { kind: "component", type: ApiConfiguration, selector: "mt-api-configuration" }, { kind: "component", type: CheckListFormConfiguration, selector: "mt-check-list-form-configuration" }, { kind: "component", type: EntityListConfiguration, selector: "mt-entity-list-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: StatusConfiguration, selector: "mt-status-configuration", inputs: ["propertyId", "levelSchemaId", "moduleId"] }, { kind: "component", type: UserConfiguration, selector: "mt-user-configuration" }, { kind: "component", type: AttachmentConfiguration, selector: "mt-attachment-configuration" }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }] });
|
|
3046
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: PropertyForm, isStandalone: true, selector: "mt-property-form", inputs: { propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null }, scope: { classPropertyName: "scope", publicName: "scope", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "statusConfigurationSection", first: true, predicate: ["statusConfigurationSection"], descendants: true, isSignal: true }, { propertyName: "configurationHost", first: true, predicate: ["configurationHost"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<mt-page\r\n [title]=\"\r\n propertyId()\r\n ? ('properties.form.editProperty' | transloco)\r\n : ('properties.form.createNewProperty' | transloco)\r\n \"\r\n avatarIcon=\"custom.products-and-services\"\r\n [avatarStyle]=\"{\r\n '--p-avatar-background': 'var(--p-sky-50)',\r\n '--p-avatar-color': 'var(--p-sky-700)',\r\n }\"\r\n (backButtonClick)=\"goBack()\"\r\n backButton\r\n class=\"h-full\"\r\n>\r\n <ng-template #headerEnd>\r\n <mt-button\r\n class=\"mx-2\"\r\n [label]=\"submitLabel()\"\r\n [icon]=\"isEditing() ? 'custom.pencil' : 'general.plus'\"\r\n [loading]=\"submitting()\"\r\n [disabled]=\"submitDisabled() || this.propertyForm.invalid\"\r\n (click)=\"createOrEditProperty($event)\"\r\n />\r\n </ng-template>\r\n <div\r\n [formGroup]=\"propertyForm\"\r\n class=\"h-full py-4 h-full overflow-y-auto flex justify-center\"\r\n >\r\n <div class=\"w-2/3 flex flex-col gap-6\">\r\n @if (loading()) {\r\n <!-- Skeleton Loading State -->\r\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\r\n <div class=\"flex justify-between items-center gap-6\">\r\n <p-skeleton width=\"50%\" height=\"3rem\"></p-skeleton>\r\n <p-skeleton width=\"8rem\" height=\"2.5rem\"></p-skeleton>\r\n </div>\r\n </div>\r\n\r\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\r\n <p-skeleton\r\n width=\"12rem\"\r\n height=\"1.5rem\"\r\n styleClass=\"mb-4\"\r\n ></p-skeleton>\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"6rem\" styleClass=\"md:col-span-2\"></p-skeleton>\r\n <p-skeleton height=\"3rem\" styleClass=\"md:col-span-2\"></p-skeleton>\r\n </div>\r\n </div>\r\n\r\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\r\n <p-skeleton\r\n width=\"10rem\"\r\n height=\"1.5rem\"\r\n styleClass=\"mb-4\"\r\n ></p-skeleton>\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"8rem\" styleClass=\"md:col-span-2\"></p-skeleton>\r\n </div>\r\n </div>\r\n } @else {\r\n <mt-dynamic-form\r\n [formConfig]=\"dynamicFormConfigMain()\"\r\n [formControlName]=\"'main'\"\r\n />\r\n @if (configurationFormConfig()) {\r\n <mt-dynamic-form\r\n formControlName=\"configuration\"\r\n [formConfig]=\"configurationFormConfig()!\"\r\n />\r\n } @else {\r\n <ng-container #configurationHost></ng-container>\r\n @if (!configurationComponentExists()) {\r\n @switch (propertyType()) {\r\n @case (\"User\") {\r\n <mt-user-configuration />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-percentage-configuration />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-lookup-configuration />\r\n }\r\n @case (\"LookupMultiSelect\") {\r\n <mt-lookup-configuration />\r\n }\r\n @case (\"EntityList\") {\r\n <mt-entity-list-configuration />\r\n }\r\n @case (\"API\") {\r\n <mt-api-configuration formControlName=\"configuration\" />\r\n }\r\n @case (\"Status\") {\r\n <section #statusConfigurationSection>\r\n <mt-status-configuration\r\n [propertyId]=\"statusPropertyId()\"\r\n [contextKey]=\"formulaContextKey()\"\r\n [levelSchemaId]=\"formulaSchemaId()\"\r\n [moduleId]=\"formulaModuleId()\"\r\n />\r\n </section>\r\n }\r\n <!-- @case('ViewList') { REMOVED FOR NOW\r\n <mt-view-list-configuration />\r\n } -->\r\n @case (\"Attachment\") {\r\n <mt-attachment-configuration />\r\n }\r\n <!-- @case('ReferenceProperty') { REMOVED FOR NOW\r\n } -->\r\n @case (\"LookupModuleCheckList\") {\r\n <mt-check-list-form-configuration />\r\n }\r\n <!-- @case('LookupMatrix') { REMOVED FOR NOW\r\n <mt-lookup-configuration />\r\n } -->\r\n @case (\"Location\") {\r\n <mt-location-configuration />\r\n }\r\n }\r\n }\r\n }\r\n @if (isCalculated() && !hideFormulaBuilder()) {\r\n <mt-card>\r\n <ng-template #headless>\r\n <div\r\n class=\"flex items-center justify-between px-4 py-5 border-b border-surface\"\r\n >\r\n <h3 class=\"text-xl font-semibold\">\r\n {{ \"properties.form.formula\" | transloco }}\r\n <span class=\"text-red-500\">*</span>\r\n </h3>\r\n </div>\r\n <div class=\"flex-1 min-h-0 p-4\">\r\n <mt-formula-builder\r\n formControlName=\"formula\"\r\n [contextKey]=\"formulaContextKey()\"\r\n [levelSchemaId]=\"formulaSchemaId()\"\r\n [moduleId]=\"formulaModuleId()\"\r\n />\r\n </div>\r\n </ng-template>\r\n </mt-card>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</mt-page>\r\n", styles: [""], dependencies: [{ kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }, { 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: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "forcedDisabledFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues"], outputs: ["runtimeMessagesChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],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: FormulaBuilder, selector: "mt-formula-builder", inputs: ["propertiesByPath", "levelSchemaId", "moduleId", "contextEntityTypeKey", "templateId", "placeholder", "hideToolbar", "hideStatusBar", "toolbarTabs", "codeOnly", "builderOnly", "valueMode", "isProcessBuilder"], outputs: ["validationChange", "tokensChange"] }, { kind: "component", type: ApiConfiguration, selector: "mt-api-configuration" }, { kind: "component", type: CheckListFormConfiguration, selector: "mt-check-list-form-configuration" }, { kind: "component", type: EntityListConfiguration, selector: "mt-entity-list-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: StatusConfiguration, selector: "mt-status-configuration", inputs: ["propertyId", "contextKey", "levelSchemaId", "moduleId"] }, { kind: "component", type: UserConfiguration, selector: "mt-user-configuration" }, { kind: "component", type: AttachmentConfiguration, selector: "mt-attachment-configuration" }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }] });
|
|
2982
3047
|
}
|
|
2983
3048
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: PropertyForm, decorators: [{
|
|
2984
3049
|
type: Component,
|
|
@@ -3000,8 +3065,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
3000
3065
|
AttachmentConfiguration,
|
|
3001
3066
|
SkeletonModule,
|
|
3002
3067
|
TranslocoModule,
|
|
3003
|
-
], template: "<mt-page\r\n [title]=\"\r\n propertyId()\r\n ? ('properties.form.editProperty' | transloco)\r\n : ('properties.form.createNewProperty' | transloco)\r\n \"\r\n avatarIcon=\"custom.products-and-services\"\r\n [avatarStyle]=\"{\r\n '--p-avatar-background': 'var(--p-sky-50)',\r\n '--p-avatar-color': 'var(--p-sky-700)',\r\n }\"\r\n (backButtonClick)=\"goBack()\"\r\n backButton\r\n class=\"h-full\"\r\n>\r\n <ng-template #headerEnd>\r\n <mt-button\r\n class=\"mx-2\"\r\n [label]=\"submitLabel()\"\r\n [icon]=\"isEditing() ? 'custom.pencil' : 'general.plus'\"\r\n [loading]=\"submitting()\"\r\n [disabled]=\"submitDisabled() || this.propertyForm.invalid\"\r\n (click)=\"createOrEditProperty($event)\"\r\n />\r\n </ng-template>\r\n <div\r\n [formGroup]=\"propertyForm\"\r\n class=\"h-full py-4 h-full overflow-y-auto flex justify-center\"\r\n >\r\n <div class=\"w-2/3 flex flex-col gap-6\">\r\n @if (loading()) {\r\n <!-- Skeleton Loading State -->\r\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\r\n <div class=\"flex justify-between items-center gap-6\">\r\n <p-skeleton width=\"50%\" height=\"3rem\"></p-skeleton>\r\n <p-skeleton width=\"8rem\" height=\"2.5rem\"></p-skeleton>\r\n </div>\r\n </div>\r\n\r\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\r\n <p-skeleton\r\n width=\"12rem\"\r\n height=\"1.5rem\"\r\n styleClass=\"mb-4\"\r\n ></p-skeleton>\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"6rem\" styleClass=\"md:col-span-2\"></p-skeleton>\r\n <p-skeleton height=\"3rem\" styleClass=\"md:col-span-2\"></p-skeleton>\r\n </div>\r\n </div>\r\n\r\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\r\n <p-skeleton\r\n width=\"10rem\"\r\n height=\"1.5rem\"\r\n styleClass=\"mb-4\"\r\n ></p-skeleton>\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"8rem\" styleClass=\"md:col-span-2\"></p-skeleton>\r\n </div>\r\n </div>\r\n } @else {\r\n <mt-dynamic-form\r\n [formConfig]=\"dynamicFormConfigMain()\"\r\n [formControlName]=\"'main'\"\r\n />\r\n @if (configurationFormConfig()) {\r\n <mt-dynamic-form\r\n formControlName=\"configuration\"\r\n [formConfig]=\"configurationFormConfig()!\"\r\n />\r\n } @else {\r\n <ng-container #configurationHost></ng-container>\r\n @if (!configurationComponentExists()) {\r\n @switch (propertyType()) {\r\n @case (\"User\") {\r\n <mt-user-configuration />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-percentage-configuration />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-lookup-configuration />\r\n }\r\n @case (\"LookupMultiSelect\") {\r\n <mt-lookup-configuration />\r\n }\r\n @case (\"EntityList\") {\r\n <mt-entity-list-configuration />\r\n }\r\n @case (\"API\") {\r\n <mt-api-configuration formControlName=\"configuration\" />\r\n }\r\n @case (\"Status\") {\r\n <section #statusConfigurationSection>\r\n <mt-status-configuration\r\n [propertyId]=\"statusPropertyId()\"\r\n [levelSchemaId]=\"formulaSchemaId()\"\r\n [moduleId]=\"formulaModuleId()\"\r\n />\r\n </section>\r\n }\r\n <!-- @case('ViewList') { REMOVED FOR NOW\r\n <mt-view-list-configuration />\r\n } -->\r\n @case (\"Attachment\") {\r\n <mt-attachment-configuration />\r\n }\r\n <!-- @case('ReferenceProperty') { REMOVED FOR NOW\r\n } -->\r\n @case (\"LookupModuleCheckList\") {\r\n <mt-check-list-form-configuration />\r\n }\r\n <!-- @case('LookupMatrix') { REMOVED FOR NOW\r\n <mt-lookup-configuration />\r\n } -->\r\n @case (\"Location\") {\r\n <mt-location-configuration />\r\n }\r\n }\r\n }\r\n }\r\n @if (isCalculated() && !hideFormulaBuilder()) {\r\n <mt-card>\r\n <ng-template #headless>\r\n <div\r\n class=\"flex items-center justify-between px-4 py-5 border-b border-surface\"\r\n >\r\n <h3 class=\"text-xl font-semibold\">\r\n {{ \"properties.form.formula\" | transloco }}\r\n <span class=\"text-red-500\">*</span>\r\n </h3>\r\n </div>\r\n <div class=\"flex-1 min-h-0 p-4\">\r\n <mt-formula-builder\r\n formControlName=\"formula\"\r\n [levelSchemaId]=\"formulaSchemaId()\"\r\n [moduleId]=\"formulaModuleId()\"\r\n />\r\n </div>\r\n </ng-template>\r\n </mt-card>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</mt-page>\r\n" }]
|
|
3004
|
-
}], ctorParameters: () => [], propDecorators: { propertyId: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyId", required: false }] }], configurationHost: [{
|
|
3068
|
+
], template: "<mt-page\r\n [title]=\"\r\n propertyId()\r\n ? ('properties.form.editProperty' | transloco)\r\n : ('properties.form.createNewProperty' | transloco)\r\n \"\r\n avatarIcon=\"custom.products-and-services\"\r\n [avatarStyle]=\"{\r\n '--p-avatar-background': 'var(--p-sky-50)',\r\n '--p-avatar-color': 'var(--p-sky-700)',\r\n }\"\r\n (backButtonClick)=\"goBack()\"\r\n backButton\r\n class=\"h-full\"\r\n>\r\n <ng-template #headerEnd>\r\n <mt-button\r\n class=\"mx-2\"\r\n [label]=\"submitLabel()\"\r\n [icon]=\"isEditing() ? 'custom.pencil' : 'general.plus'\"\r\n [loading]=\"submitting()\"\r\n [disabled]=\"submitDisabled() || this.propertyForm.invalid\"\r\n (click)=\"createOrEditProperty($event)\"\r\n />\r\n </ng-template>\r\n <div\r\n [formGroup]=\"propertyForm\"\r\n class=\"h-full py-4 h-full overflow-y-auto flex justify-center\"\r\n >\r\n <div class=\"w-2/3 flex flex-col gap-6\">\r\n @if (loading()) {\r\n <!-- Skeleton Loading State -->\r\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\r\n <div class=\"flex justify-between items-center gap-6\">\r\n <p-skeleton width=\"50%\" height=\"3rem\"></p-skeleton>\r\n <p-skeleton width=\"8rem\" height=\"2.5rem\"></p-skeleton>\r\n </div>\r\n </div>\r\n\r\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\r\n <p-skeleton\r\n width=\"12rem\"\r\n height=\"1.5rem\"\r\n styleClass=\"mb-4\"\r\n ></p-skeleton>\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"6rem\" styleClass=\"md:col-span-2\"></p-skeleton>\r\n <p-skeleton height=\"3rem\" styleClass=\"md:col-span-2\"></p-skeleton>\r\n </div>\r\n </div>\r\n\r\n <div class=\"rounded-xl bg-white shadow-sm p-6 space-y-4\">\r\n <p-skeleton\r\n width=\"10rem\"\r\n height=\"1.5rem\"\r\n styleClass=\"mb-4\"\r\n ></p-skeleton>\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"3rem\"></p-skeleton>\r\n <p-skeleton height=\"8rem\" styleClass=\"md:col-span-2\"></p-skeleton>\r\n </div>\r\n </div>\r\n } @else {\r\n <mt-dynamic-form\r\n [formConfig]=\"dynamicFormConfigMain()\"\r\n [formControlName]=\"'main'\"\r\n />\r\n @if (configurationFormConfig()) {\r\n <mt-dynamic-form\r\n formControlName=\"configuration\"\r\n [formConfig]=\"configurationFormConfig()!\"\r\n />\r\n } @else {\r\n <ng-container #configurationHost></ng-container>\r\n @if (!configurationComponentExists()) {\r\n @switch (propertyType()) {\r\n @case (\"User\") {\r\n <mt-user-configuration />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-percentage-configuration />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-lookup-configuration />\r\n }\r\n @case (\"LookupMultiSelect\") {\r\n <mt-lookup-configuration />\r\n }\r\n @case (\"EntityList\") {\r\n <mt-entity-list-configuration />\r\n }\r\n @case (\"API\") {\r\n <mt-api-configuration formControlName=\"configuration\" />\r\n }\r\n @case (\"Status\") {\r\n <section #statusConfigurationSection>\r\n <mt-status-configuration\r\n [propertyId]=\"statusPropertyId()\"\r\n [contextKey]=\"formulaContextKey()\"\r\n [levelSchemaId]=\"formulaSchemaId()\"\r\n [moduleId]=\"formulaModuleId()\"\r\n />\r\n </section>\r\n }\r\n <!-- @case('ViewList') { REMOVED FOR NOW\r\n <mt-view-list-configuration />\r\n } -->\r\n @case (\"Attachment\") {\r\n <mt-attachment-configuration />\r\n }\r\n <!-- @case('ReferenceProperty') { REMOVED FOR NOW\r\n } -->\r\n @case (\"LookupModuleCheckList\") {\r\n <mt-check-list-form-configuration />\r\n }\r\n <!-- @case('LookupMatrix') { REMOVED FOR NOW\r\n <mt-lookup-configuration />\r\n } -->\r\n @case (\"Location\") {\r\n <mt-location-configuration />\r\n }\r\n }\r\n }\r\n }\r\n @if (isCalculated() && !hideFormulaBuilder()) {\r\n <mt-card>\r\n <ng-template #headless>\r\n <div\r\n class=\"flex items-center justify-between px-4 py-5 border-b border-surface\"\r\n >\r\n <h3 class=\"text-xl font-semibold\">\r\n {{ \"properties.form.formula\" | transloco }}\r\n <span class=\"text-red-500\">*</span>\r\n </h3>\r\n </div>\r\n <div class=\"flex-1 min-h-0 p-4\">\r\n <mt-formula-builder\r\n formControlName=\"formula\"\r\n [contextKey]=\"formulaContextKey()\"\r\n [levelSchemaId]=\"formulaSchemaId()\"\r\n [moduleId]=\"formulaModuleId()\"\r\n />\r\n </div>\r\n </ng-template>\r\n </mt-card>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</mt-page>\r\n" }]
|
|
3069
|
+
}], ctorParameters: () => [], propDecorators: { propertyId: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyId", required: false }] }], scope: [{ type: i0.Input, args: [{ isSignal: true, alias: "scope", required: false }] }], configurationHost: [{
|
|
3005
3070
|
type: ViewChild,
|
|
3006
3071
|
args: ['configurationHost', { read: ViewContainerRef }]
|
|
3007
3072
|
}], statusConfigurationSection: [{ type: i0.ViewChild, args: ['statusConfigurationSection', { isSignal: true }] }] } });
|
|
@@ -3014,5 +3079,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
3014
3079
|
* Generated bundle index. Do not edit.
|
|
3015
3080
|
*/
|
|
3016
3081
|
|
|
3017
|
-
export { CreateProperty, CreatePropertyStatus, DeleteProperty, DeletePropertyStatus, GetConfigAsType, GetCountries, GetGroups, GetLookups, GetProperties, GetPropertiesForConfigType, GetProperty, GetPropertyStatuses, PropertiesActionKey, PropertiesFacade, PropertiesList, PropertiesState, PropertyForm, REQUEST_CONTEXT, ReorderPropertyStatuses, ResetApiConfiguration, ResetConfigProperties, ResetConfigScopes, ResetPropertyStatuses, ResetSelectedProperty, SetBreadcrumb, SetDefaultViewType, SetPropertiesModuleInfo, SetPropertyTypes, TestApiConfiguration, UpdateProperty, UpdatePropertyStatus };
|
|
3082
|
+
export { CreateProperty, CreatePropertyStatus, DeleteProperty, DeletePropertyStatus, GetConfigAsType, GetCountries, GetGroups, GetLookups, GetProperties, GetPropertiesForConfigType, GetProperty, GetPropertyStatuses, PropertiesActionKey, PropertiesFacade, PropertiesList, PropertiesState, PropertyForm, REQUEST_CONTEXT, ReorderPropertyStatuses, ResetApiConfiguration, ResetConfigProperties, ResetConfigScopes, ResetPropertyStatuses, ResetSelectedProperty, SetBreadcrumb, SetDefaultViewType, SetPropertiesModuleInfo, SetPropertyTypes, TestApiConfiguration, UpdateProperty, UpdatePropertyStatus, buildPropertiesScopeContextKey };
|
|
3018
3083
|
//# sourceMappingURL=masterteam-properties.mjs.map
|