procode-lowcode-core 1.0.14 → 1.0.16
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/dist/index.esm.js +46 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +58 -24
- package/dist/index.js.map +1 -1
- package/dist/types/Utils/resolveBoundValue.d.ts +10 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +1 -1
- package/src/Renderer/WidgetRenderer/useWidgetProps.ts +15 -0
- package/src/Services/CentralService.ts +2 -13
- package/src/Utils/resolveBoundValue.ts +50 -0
- package/src/index.ts +3 -0
package/dist/index.esm.js
CHANGED
|
@@ -453,22 +453,13 @@ class CentralService {
|
|
|
453
453
|
configurable: true,
|
|
454
454
|
writable: true,
|
|
455
455
|
value: (response, responseConfig) => {
|
|
456
|
-
var _a
|
|
456
|
+
var _a;
|
|
457
457
|
const statusRelatedConfig = (responseConfig !== null && responseConfig !== void 0 ? responseConfig : {})[response === null || response === void 0 ? void 0 : response.status];
|
|
458
458
|
let errorMessage = "";
|
|
459
|
-
if (
|
|
460
|
-
errorMessage = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message;
|
|
461
|
-
if (statusRelatedConfig === null || statusRelatedConfig === void 0 ? void 0 : statusRelatedConfig.enableMessage) {
|
|
462
|
-
errorMessage =
|
|
463
|
-
(statusRelatedConfig === null || statusRelatedConfig === void 0 ? void 0 : statusRelatedConfig.message) ||
|
|
464
|
-
errorMessage ||
|
|
465
|
-
ErrorMessageProvider.get(response.config.method, response === null || response === void 0 ? void 0 : response.status);
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
else if (statusRelatedConfig === null || statusRelatedConfig === void 0 ? void 0 : statusRelatedConfig.enableMessage) {
|
|
459
|
+
if (statusRelatedConfig === null || statusRelatedConfig === void 0 ? void 0 : statusRelatedConfig.enableMessage) {
|
|
469
460
|
errorMessage =
|
|
470
461
|
(statusRelatedConfig === null || statusRelatedConfig === void 0 ? void 0 : statusRelatedConfig.message) ||
|
|
471
|
-
((
|
|
462
|
+
((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message) ||
|
|
472
463
|
ErrorMessageProvider.get(response.config.method, response === null || response === void 0 ? void 0 : response.status);
|
|
473
464
|
}
|
|
474
465
|
return errorMessage;
|
|
@@ -18869,6 +18860,38 @@ class ActionInvoker {
|
|
|
18869
18860
|
}
|
|
18870
18861
|
}
|
|
18871
18862
|
|
|
18863
|
+
const isBoundOperand = (input) => typeof input === "object" &&
|
|
18864
|
+
input !== null &&
|
|
18865
|
+
"valueReplacePolicy" in input;
|
|
18866
|
+
const resolveBoundValue = (bound, viewModel) => {
|
|
18867
|
+
if (!isBoundOperand(bound))
|
|
18868
|
+
return bound;
|
|
18869
|
+
switch (bound.valueReplacePolicy) {
|
|
18870
|
+
case ValueReplacePolicy$1.SELF:
|
|
18871
|
+
return bound.value;
|
|
18872
|
+
case ValueReplacePolicy$1.STATE:
|
|
18873
|
+
return getValueFromNestedObject(bound.value, viewModel);
|
|
18874
|
+
default:
|
|
18875
|
+
return bound.value;
|
|
18876
|
+
}
|
|
18877
|
+
};
|
|
18878
|
+
const BOUND_PROP_NAMES = [
|
|
18879
|
+
"min",
|
|
18880
|
+
"max",
|
|
18881
|
+
"minDate",
|
|
18882
|
+
"maxDate",
|
|
18883
|
+
"minLength",
|
|
18884
|
+
"maxLength",
|
|
18885
|
+
"minResizeHeight",
|
|
18886
|
+
"maxResizeHeight",
|
|
18887
|
+
"minResizeWidth",
|
|
18888
|
+
"maxResizeWidth",
|
|
18889
|
+
"step",
|
|
18890
|
+
"placeHolder",
|
|
18891
|
+
"disabled",
|
|
18892
|
+
"format",
|
|
18893
|
+
];
|
|
18894
|
+
|
|
18872
18895
|
var StandardValidationType;
|
|
18873
18896
|
(function (StandardValidationType) {
|
|
18874
18897
|
StandardValidationType["REQUIRED"] = "REQUIRED";
|
|
@@ -19348,7 +19371,16 @@ const useWidgetProps = (schemaElementProps, viewModel, validation, eventService,
|
|
|
19348
19371
|
return;
|
|
19349
19372
|
}
|
|
19350
19373
|
const events = getEvents();
|
|
19351
|
-
setWidgetProps(Object.assign(Object.assign(Object.assign(Object.assign({}, schemaElementProps), { id: schemaElementProps === null || schemaElementProps === void 0 ? void 0 : schemaElementProps.id, value: getScreenDataFieldValue(), listData: getSupportiveDataFieldValue(), uiElementGroupData: getUiElementGroupData(), validations: getValidationProperty(), eventService: eventService, viewModel: viewModel }), events), { dynamicEvents: events }));
|
|
19374
|
+
setWidgetProps(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, schemaElementProps), getResolvedBoundProps()), { id: schemaElementProps === null || schemaElementProps === void 0 ? void 0 : schemaElementProps.id, value: getScreenDataFieldValue(), listData: getSupportiveDataFieldValue(), uiElementGroupData: getUiElementGroupData(), validations: getValidationProperty(), eventService: eventService, viewModel: viewModel }), events), { dynamicEvents: events }));
|
|
19375
|
+
};
|
|
19376
|
+
const getResolvedBoundProps = () => {
|
|
19377
|
+
const resolved = {};
|
|
19378
|
+
BOUND_PROP_NAMES.forEach((name) => {
|
|
19379
|
+
if (name in schemaElementProps) {
|
|
19380
|
+
resolved[name] = resolveBoundValue(schemaElementProps[name], viewModel);
|
|
19381
|
+
}
|
|
19382
|
+
});
|
|
19383
|
+
return resolved;
|
|
19352
19384
|
};
|
|
19353
19385
|
const getEvents = () => {
|
|
19354
19386
|
if (!(schemaElementProps === null || schemaElementProps === void 0 ? void 0 : schemaElementProps.events))
|
|
@@ -20637,5 +20669,5 @@ const coreStyles = './Assets/styles/index.scss';
|
|
|
20637
20669
|
// Utility function to get styles path
|
|
20638
20670
|
const getCoreStylesPath = () => coreStyles;
|
|
20639
20671
|
|
|
20640
|
-
export { Core$1 as Core, EventService, coreStyles, Core$1 as default, getCoreStylesPath, resolveAppPath };
|
|
20672
|
+
export { BOUND_PROP_NAMES, Core$1 as Core, EventService, ValueReplacePolicy$1 as ValueReplacePolicy, coreStyles, Core$1 as default, getCoreStylesPath, resolveAppPath, resolveBoundValue };
|
|
20641
20673
|
//# sourceMappingURL=index.esm.js.map
|