procode-lowcode-core 1.0.14 → 1.0.15

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 CHANGED
@@ -453,22 +453,13 @@ class CentralService {
453
453
  configurable: true,
454
454
  writable: true,
455
455
  value: (response, responseConfig) => {
456
- var _a, _b;
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 ((statusRelatedConfig === null || statusRelatedConfig === void 0 ? void 0 : statusRelatedConfig.alertType) === AlertType.FIELDVALIDATION) {
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
- ((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.message) ||
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,37 @@ 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
+ ];
18893
+
18872
18894
  var StandardValidationType;
18873
18895
  (function (StandardValidationType) {
18874
18896
  StandardValidationType["REQUIRED"] = "REQUIRED";
@@ -19348,7 +19370,16 @@ const useWidgetProps = (schemaElementProps, viewModel, validation, eventService,
19348
19370
  return;
19349
19371
  }
19350
19372
  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 }));
19373
+ 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 }));
19374
+ };
19375
+ const getResolvedBoundProps = () => {
19376
+ const resolved = {};
19377
+ BOUND_PROP_NAMES.forEach((name) => {
19378
+ if (name in schemaElementProps) {
19379
+ resolved[name] = resolveBoundValue(schemaElementProps[name], viewModel);
19380
+ }
19381
+ });
19382
+ return resolved;
19352
19383
  };
19353
19384
  const getEvents = () => {
19354
19385
  if (!(schemaElementProps === null || schemaElementProps === void 0 ? void 0 : schemaElementProps.events))
@@ -20637,5 +20668,5 @@ const coreStyles = './Assets/styles/index.scss';
20637
20668
  // Utility function to get styles path
20638
20669
  const getCoreStylesPath = () => coreStyles;
20639
20670
 
20640
- export { Core$1 as Core, EventService, coreStyles, Core$1 as default, getCoreStylesPath, resolveAppPath };
20671
+ export { BOUND_PROP_NAMES, Core$1 as Core, EventService, ValueReplacePolicy$1 as ValueReplacePolicy, coreStyles, Core$1 as default, getCoreStylesPath, resolveAppPath, resolveBoundValue };
20641
20672
  //# sourceMappingURL=index.esm.js.map