@apia/execution 4.0.30 → 4.0.32

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.js CHANGED
@@ -1,14 +1,16 @@
1
- import { makeObservable, observable, action, runInAction, reaction, computed, toJS } from 'mobx';
1
+ import { makeObservable, observable, action, runInAction, makeAutoObservable, reaction, computed, toJS } from 'mobx';
2
2
  import axios, { AxiosError } from 'axios';
3
3
  import xml2js from 'xml2js';
4
4
  import he from 'he';
5
5
  import { parseBooleans, parseNumbers } from 'xml2js/lib/processors';
6
6
  import QueryString from 'qs';
7
- import { arrayOrArray, EventEmitter as EventEmitter$1, isTrue, toBoolean, downloadUrl, addBoundary, formatMessage, parseAsSize, shallowEqual as shallowEqual$1, Mutex, awaitTime, noNaN as noNaN$1, getDateFormat, uniqueId, parseXMLRequestResponse, Url, postNavigation } from '@apia/util';
7
+ import { arrayOrArray, EventEmitter as EventEmitter$1, isTrue, toBoolean, downloadUrl, addBoundary, formatMessage, parseAsSize, shallowEqual as shallowEqual$1, Mutex, awaitTime, noNaN as noNaN$1, getDateFormat, decodeBase64ToUtf8 as decodeBase64ToUtf8$1, uniqueId, parseXMLRequestResponse, Url, postNavigation } from '@apia/util';
8
8
  import { Cell, TableController, Row, FocusControllerPlugin } from '@apia/table2-controller';
9
9
  import dayjs from 'dayjs';
10
+ import customParseFormat from 'dayjs/plugin/customParseFormat';
10
11
  import { MobXTree } from '@apia/tree2-controller';
11
12
  import { Scheduler } from '@apia/scheduler-controller';
13
+ import { ApiaUtil } from '@apia/components';
12
14
 
13
15
  const deepEqual = (a, b) => {
14
16
  if (Object.is(a, b))
@@ -46,16 +48,16 @@ const deepEqual = (a, b) => {
46
48
  return a === b;
47
49
  };
48
50
 
49
- var __defProp$s = Object.defineProperty;
50
- var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
51
- var __publicField$s = (obj, key, value) => {
52
- __defNormalProp$s(obj, key + "" , value);
51
+ var __defProp$t = Object.defineProperty;
52
+ var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
53
+ var __publicField$t = (obj, key, value) => {
54
+ __defNormalProp$t(obj, key + "" , value);
53
55
  return value;
54
56
  };
55
57
  class Notification {
56
58
  constructor(props) {
57
59
  this.props = props;
58
- __publicField$s(this, "state");
60
+ __publicField$t(this, "state");
59
61
  this.state = props;
60
62
  makeObservable(this, { state: observable });
61
63
  }
@@ -457,12 +459,14 @@ var ExecutionState = /* @__PURE__ */ ((ExecutionState2) => {
457
459
  })(ExecutionState || {});
458
460
 
459
461
  function dispatchMessage(execution, type, message) {
462
+ const definedType = message.type;
463
+ const actualType = [null, "success", "warning", "error"][definedType || 0];
460
464
  execution.notifications.add(
461
465
  new MessageNotification({
462
466
  message: message.text,
463
467
  stackTrace: message.label,
464
468
  title: message.title,
465
- type
469
+ type: actualType || type
466
470
  })
467
471
  );
468
472
  }
@@ -680,27 +684,27 @@ function makeApiaUrl(execution, props) {
680
684
  if (props?.queryString && props.queryString.includes("timestamp=") || queryString?.includes("timestamp=")) {
681
685
  timestamp = "";
682
686
  }
683
- const contextWord = CONTEXT.replaceAll("/", "");
687
+ const contextWord = CONTEXT.replace(/^\/?(.+?)\/?$/, "$1");
684
688
  actualAjaxUrl = actualAjaxUrl.match(
685
689
  new RegExp(`^(?:(?:/?${contextWord})?/)?(.+)$`)
686
690
  )?.[1];
687
691
  return `${contextWord ? "/" : ""}${contextWord}/${actualAjaxUrl}?${timestamp}${!props?.preventAsXmlParameter ? "asXml=true&" : ""}${props?.queryString ? `${props.queryString}&` : ""}${queryString ? `${queryString}&` : ""}${tabId}`;
688
692
  }
689
693
 
690
- var __defProp$r = Object.defineProperty;
691
- var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
692
- var __publicField$r = (obj, key, value) => {
693
- __defNormalProp$r(obj, typeof key !== "symbol" ? key + "" : key, value);
694
+ var __defProp$s = Object.defineProperty;
695
+ var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
696
+ var __publicField$s = (obj, key, value) => {
697
+ __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
694
698
  return value;
695
699
  };
696
700
  class EventEmitter {
697
701
  constructor() {
698
- __publicField$r(this, "callbacks", {
702
+ __publicField$s(this, "callbacks", {
699
703
  on: {},
700
704
  once: {}
701
705
  });
702
- __publicField$r(this, "enabled", true);
703
- __publicField$r(this, "debugMode", false);
706
+ __publicField$s(this, "enabled", true);
707
+ __publicField$s(this, "debugMode", false);
704
708
  }
705
709
  debug(enable = true) {
706
710
  this.debugMode = enable;
@@ -766,10 +770,10 @@ class EventEmitter {
766
770
  }
767
771
  }
768
772
 
769
- var __defProp$q = Object.defineProperty;
770
- var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
771
- var __publicField$q = (obj, key, value) => {
772
- __defNormalProp$q(obj, key + "" , value);
773
+ var __defProp$r = Object.defineProperty;
774
+ var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
775
+ var __publicField$r = (obj, key, value) => {
776
+ __defNormalProp$r(obj, key + "" , value);
773
777
  return value;
774
778
  };
775
779
  function isSetter(data) {
@@ -778,7 +782,7 @@ function isSetter(data) {
778
782
  class StatefulEmitter extends EventEmitter {
779
783
  constructor(initialState) {
780
784
  super();
781
- __publicField$q(this, "state", {});
785
+ __publicField$r(this, "state", {});
782
786
  this.state = Object.assign({}, initialState);
783
787
  }
784
788
  emit(event, data) {
@@ -813,18 +817,18 @@ class StatefulEmitter extends EventEmitter {
813
817
  }
814
818
  }
815
819
 
816
- var __defProp$p = Object.defineProperty;
817
- var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
818
- var __publicField$p = (obj, key, value) => {
819
- __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
820
+ var __defProp$q = Object.defineProperty;
821
+ var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
822
+ var __publicField$q = (obj, key, value) => {
823
+ __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
820
824
  return value;
821
825
  };
822
826
  const NullObject = Symbol("NullObject");
823
827
  class BouncingEmitter extends StatefulEmitter {
824
828
  constructor() {
825
829
  super(...arguments);
826
- __publicField$p(this, "bouncingTimeouts", {});
827
- __publicField$p(this, "defaultTiming", 100);
830
+ __publicField$q(this, "bouncingTimeouts", {});
831
+ __publicField$q(this, "defaultTiming", 100);
828
832
  /**
829
833
  * Throttles a event emit with the warranty that the data will be emitted at most every (timing)ms. Take the following event throttling, where each E is a call to this method and each character represents 20ms:
830
834
  *
@@ -836,8 +840,8 @@ class BouncingEmitter extends StatefulEmitter {
836
840
  *
837
841
  * @param configuration.emitOnStart - Emits an event on the first call to throttle when no pending throttle is stored. **If emitOnStart is true and an only call to throttle is made, it will emit an only event.**
838
842
  */
839
- __publicField$p(this, "throttleData", {});
840
- __publicField$p(this, "throttleEmittedOnInit", {});
843
+ __publicField$q(this, "throttleData", {});
844
+ __publicField$q(this, "throttleEmittedOnInit", {});
841
845
  }
842
846
  /**
843
847
  * Debounces a event emit with until there is no call to the emit methods by (timing)ms. Take the following event throttling, where each E is a call to this method and each character represents 20ms:
@@ -967,16 +971,16 @@ function parseFakeJSON$1(str) {
967
971
  return ret;
968
972
  }
969
973
 
970
- var __defProp$o = Object.defineProperty;
971
- var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
972
- var __publicField$o = (obj, key, value) => {
973
- __defNormalProp$o(obj, typeof key !== "symbol" ? key + "" : key, value);
974
+ var __defProp$p = Object.defineProperty;
975
+ var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
976
+ var __publicField$p = (obj, key, value) => {
977
+ __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
974
978
  return value;
975
979
  };
976
980
  class WithProperties {
977
981
  constructor(initialState) {
978
- __publicField$o(this, "properties", {});
979
- __publicField$o(this, "parentGrid", null);
982
+ __publicField$p(this, "properties", {});
983
+ __publicField$p(this, "parentGrid", null);
980
984
  if (initialState) {
981
985
  this.properties = initialState;
982
986
  }
@@ -1030,7 +1034,7 @@ const setAjaxFormResponse = async (execution, response) => {
1030
1034
  const [frmParent, id] = formId.split("_");
1031
1035
  const apiaForm = execution.getFormById(id, frmParent);
1032
1036
  arrayOrArray(form.cusCmp).forEach((c) => {
1033
- apiaForm?.getCustomComponentByFldId(Number.parseInt(String(c.id)))?.processResult({ state: c.state });
1037
+ apiaForm?.getCustomComponentByFldId(Number.parseInt(String(c.id)))?.processResult({ processResult: { state: c.state } });
1034
1038
  });
1035
1039
  const changedGrids = arrayOrArray(form.changedGrids.grdId);
1036
1040
  changedGrids.forEach(({ id: id2 }) => {
@@ -1109,7 +1113,10 @@ const setAjaxFormResponse = async (execution, response) => {
1109
1113
  }
1110
1114
  }
1111
1115
  if (apiField.attribute && value !== void 0) {
1112
- apiField.setValue(value);
1116
+ apiField.setValue(value, {
1117
+ force: true,
1118
+ synchronize: false
1119
+ });
1113
1120
  }
1114
1121
  }
1115
1122
  if (ajaxFields[f].e !== void 0) {
@@ -1153,27 +1160,27 @@ const asyncCreateNewField = async (execution, fld) => {
1153
1160
  return creator(execution, fld);
1154
1161
  };
1155
1162
 
1156
- var __defProp$n = Object.defineProperty;
1157
- var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1158
- var __publicField$n = (obj, key, value) => {
1159
- __defNormalProp$n(obj, typeof key !== "symbol" ? key + "" : key, value);
1163
+ var __defProp$o = Object.defineProperty;
1164
+ var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1165
+ var __publicField$o = (obj, key, value) => {
1166
+ __defNormalProp$o(obj, typeof key !== "symbol" ? key + "" : key, value);
1160
1167
  return value;
1161
1168
  };
1162
- var __accessCheck$k = (obj, member, msg) => {
1169
+ var __accessCheck$l = (obj, member, msg) => {
1163
1170
  if (!member.has(obj))
1164
1171
  throw TypeError("Cannot " + msg);
1165
1172
  };
1166
- var __privateGet$k = (obj, member, getter) => {
1167
- __accessCheck$k(obj, member, "read from private field");
1173
+ var __privateGet$l = (obj, member, getter) => {
1174
+ __accessCheck$l(obj, member, "read from private field");
1168
1175
  return member.get(obj);
1169
1176
  };
1170
- var __privateAdd$k = (obj, member, value) => {
1177
+ var __privateAdd$l = (obj, member, value) => {
1171
1178
  if (member.has(obj))
1172
1179
  throw TypeError("Cannot add the same private member more than once");
1173
1180
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
1174
1181
  };
1175
- var __privateSet$k = (obj, member, value, setter) => {
1176
- __accessCheck$k(obj, member, "write to private field");
1182
+ var __privateSet$l = (obj, member, value, setter) => {
1183
+ __accessCheck$l(obj, member, "write to private field");
1177
1184
  member.set(obj, value);
1178
1185
  return value;
1179
1186
  };
@@ -1190,12 +1197,12 @@ async function getApiaFunctions(execution) {
1190
1197
  class Field extends WithProperties {
1191
1198
  constructor({ properties, ...definition }) {
1192
1199
  super();
1193
- __publicField$n(this, "form", {});
1194
- __publicField$n(this, "definition");
1195
- __publicField$n(this, "state", {
1200
+ __publicField$o(this, "form", {});
1201
+ __publicField$o(this, "definition");
1202
+ __publicField$o(this, "state", {
1196
1203
  validation: { dirty: false, errorMessage: "", synchronizing: false }
1197
1204
  });
1198
- __privateAdd$k(this, _hasInited$1, false);
1205
+ __privateAdd$l(this, _hasInited$1, false);
1199
1206
  this.properties = properties;
1200
1207
  this.definition = definition;
1201
1208
  makeObservable(this, { state: observable, definition: observable });
@@ -1354,11 +1361,16 @@ class Field extends WithProperties {
1354
1361
  return true;
1355
1362
  }
1356
1363
  async fireEvent(eventName, params) {
1357
- let result = await this.fireScriptEvent(eventName);
1358
- if (result) {
1359
- result = await this.fireServerEvent(eventName, params);
1364
+ const unlock = this.form.execution.lock();
1365
+ try {
1366
+ let result = await this.fireScriptEvent(eventName);
1367
+ if (result) {
1368
+ result = await this.fireServerEvent(eventName, params);
1369
+ }
1370
+ return result;
1371
+ } finally {
1372
+ unlock();
1360
1373
  }
1361
- return result;
1362
1374
  }
1363
1375
  getForm() {
1364
1376
  return this.form;
@@ -1377,9 +1389,9 @@ class Field extends WithProperties {
1377
1389
  );
1378
1390
  }
1379
1391
  async init(form) {
1380
- if (__privateGet$k(this, _hasInited$1))
1392
+ if (__privateGet$l(this, _hasInited$1))
1381
1393
  throw new Error("Cannot init field twice");
1382
- __privateSet$k(this, _hasInited$1, true);
1394
+ __privateSet$l(this, _hasInited$1, true);
1383
1395
  this.form = form;
1384
1396
  }
1385
1397
  async validate() {
@@ -1400,16 +1412,16 @@ class Button extends Field {
1400
1412
  }
1401
1413
  }
1402
1414
 
1403
- var __defProp$m = Object.defineProperty;
1404
- var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1405
- var __publicField$m = (obj, key, value) => {
1406
- __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
1415
+ var __defProp$n = Object.defineProperty;
1416
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1417
+ var __publicField$n = (obj, key, value) => {
1418
+ __defNormalProp$n(obj, typeof key !== "symbol" ? key + "" : key, value);
1407
1419
  return value;
1408
1420
  };
1409
1421
  const _Captcha = class _Captcha extends Field {
1410
1422
  constructor(definition) {
1411
1423
  super(definition);
1412
- __publicField$m(this, "id", "");
1424
+ __publicField$n(this, "id", "");
1413
1425
  this.state.value = "";
1414
1426
  this.properties.name = "__captcha__";
1415
1427
  _Captcha.emitter.on("confirm", () => {
@@ -1460,8 +1472,8 @@ const _Captcha = class _Captcha extends Field {
1460
1472
  }
1461
1473
  }
1462
1474
  };
1463
- __publicField$m(_Captcha, "emitter", new EventEmitter$1());
1464
- __publicField$m(_Captcha, "confirmParams", {});
1475
+ __publicField$n(_Captcha, "emitter", new EventEmitter$1());
1476
+ __publicField$n(_Captcha, "confirmParams", {});
1465
1477
  let Captcha = _Captcha;
1466
1478
 
1467
1479
  class TooMuchRetriesException extends Error {
@@ -1534,27 +1546,27 @@ function isFieldShowAsText(f) {
1534
1546
  return isTrue(f.properties.disabled) || isTrue(f.getForm().definition.readonly) || isTrue(f.getForm().definition.readOnly) || isTrue(f.properties.inputAsText);
1535
1547
  }
1536
1548
 
1537
- var __defProp$l = Object.defineProperty;
1538
- var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1539
- var __publicField$l = (obj, key, value) => {
1540
- __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
1549
+ var __defProp$m = Object.defineProperty;
1550
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1551
+ var __publicField$m = (obj, key, value) => {
1552
+ __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
1541
1553
  return value;
1542
1554
  };
1543
- var __accessCheck$j = (obj, member, msg) => {
1555
+ var __accessCheck$k = (obj, member, msg) => {
1544
1556
  if (!member.has(obj))
1545
1557
  throw TypeError("Cannot " + msg);
1546
1558
  };
1547
- var __privateGet$j = (obj, member, getter) => {
1548
- __accessCheck$j(obj, member, "read from private field");
1559
+ var __privateGet$k = (obj, member, getter) => {
1560
+ __accessCheck$k(obj, member, "read from private field");
1549
1561
  return member.get(obj);
1550
1562
  };
1551
- var __privateAdd$j = (obj, member, value) => {
1563
+ var __privateAdd$k = (obj, member, value) => {
1552
1564
  if (member.has(obj))
1553
1565
  throw TypeError("Cannot add the same private member more than once");
1554
1566
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
1555
1567
  };
1556
- var __privateSet$j = (obj, member, value, setter) => {
1557
- __accessCheck$j(obj, member, "write to private field");
1568
+ var __privateSet$k = (obj, member, value, setter) => {
1569
+ __accessCheck$k(obj, member, "write to private field");
1558
1570
  member.set(obj, value);
1559
1571
  return value;
1560
1572
  };
@@ -1577,9 +1589,9 @@ class FieldWithAttribute extends Field {
1577
1589
  ...definition
1578
1590
  }) {
1579
1591
  super(definition);
1580
- __privateAdd$j(this, _lastOnChangeValue, null);
1581
- __publicField$l(this, "lastSynchronizationValue", null);
1582
- __publicField$l(this, "attribute");
1592
+ __privateAdd$k(this, _lastOnChangeValue, null);
1593
+ __publicField$m(this, "lastSynchronizationValue", null);
1594
+ __publicField$m(this, "attribute");
1583
1595
  this.attribute = new Attribute(attId, attName, attLabel, valueType);
1584
1596
  this.state.value = value;
1585
1597
  this.state.validation = {
@@ -1591,17 +1603,17 @@ class FieldWithAttribute extends Field {
1591
1603
  attribute: observable
1592
1604
  });
1593
1605
  }
1594
- async fireEvent(eventName) {
1606
+ async fireEvent(eventName, options) {
1595
1607
  if (this.getValidationState().dirty) {
1596
1608
  return Promise.resolve(false);
1597
1609
  }
1598
1610
  if (eventName === "onChange") {
1599
- if (this.getValue() === __privateGet$j(this, _lastOnChangeValue)) {
1611
+ if (this.getValue() === __privateGet$k(this, _lastOnChangeValue) && !options?.force) {
1600
1612
  return true;
1601
1613
  } else {
1602
1614
  const res = await super.fireEvent(eventName);
1603
1615
  if (res) {
1604
- __privateSet$j(this, _lastOnChangeValue, this.getValue());
1616
+ __privateSet$k(this, _lastOnChangeValue, this.getValue());
1605
1617
  return true;
1606
1618
  } else {
1607
1619
  return false;
@@ -1621,8 +1633,11 @@ class FieldWithAttribute extends Field {
1621
1633
  getValue() {
1622
1634
  return this.state.value;
1623
1635
  }
1636
+ canSetValue(newValue) {
1637
+ return isFieldShowAsText(this) || shallowEqual(newValue, this.getValue());
1638
+ }
1624
1639
  setValue(newValue, options) {
1625
- if (isFieldShowAsText(this) || shallowEqual(newValue, this.getValue()))
1640
+ if (!options?.force && (isFieldShowAsText(this) || shallowEqual(newValue, this.getValue())))
1626
1641
  return Promise.resolve(true);
1627
1642
  this.state.value = newValue;
1628
1643
  this.state.validation.errorMessage = null;
@@ -1635,7 +1650,7 @@ class FieldWithAttribute extends Field {
1635
1650
  if (options?.markAsDirty !== false) {
1636
1651
  this.form.execution.state.hasChangedAnything = true;
1637
1652
  }
1638
- return this.fireEvent("onChange");
1653
+ return this.fireEvent("onChange", { force: options?.force });
1639
1654
  }
1640
1655
  return Promise.resolve(false);
1641
1656
  });
@@ -1747,8 +1762,8 @@ class FieldWithAttribute extends Field {
1747
1762
  _lastOnChangeValue = new WeakMap();
1748
1763
 
1749
1764
  class Checkbox extends FieldWithAttribute {
1750
- fireEvent(eventName) {
1751
- return super.fireEvent(eventName);
1765
+ fireEvent(eventName, options) {
1766
+ return super.fireEvent(eventName, options);
1752
1767
  }
1753
1768
  getInitialValue({
1754
1769
  value,
@@ -1764,16 +1779,16 @@ class Checkbox extends FieldWithAttribute {
1764
1779
  }
1765
1780
  }
1766
1781
 
1767
- var __defProp$k = Object.defineProperty;
1768
- var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1769
- var __publicField$k = (obj, key, value) => {
1770
- __defNormalProp$k(obj, key + "" , value);
1782
+ var __defProp$l = Object.defineProperty;
1783
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1784
+ var __publicField$l = (obj, key, value) => {
1785
+ __defNormalProp$l(obj, key + "" , value);
1771
1786
  return value;
1772
1787
  };
1773
1788
  class Translation {
1774
1789
  constructor(execution, state) {
1775
1790
  this.execution = execution;
1776
- __publicField$k(this, "state");
1791
+ __publicField$l(this, "state");
1777
1792
  this.state = {
1778
1793
  ...state,
1779
1794
  hasChanged: false,
@@ -1838,19 +1853,19 @@ function parseFakeJSON(fakeJSON) {
1838
1853
  }));
1839
1854
  }
1840
1855
 
1841
- var __defProp$j = Object.defineProperty;
1842
- var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1843
- var __publicField$j = (obj, key, value) => {
1844
- __defNormalProp$j(obj, typeof key !== "symbol" ? key + "" : key, value);
1856
+ var __defProp$k = Object.defineProperty;
1857
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1858
+ var __publicField$k = (obj, key, value) => {
1859
+ __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
1845
1860
  return value;
1846
1861
  };
1847
1862
  class TranslatableField extends FieldWithAttribute {
1848
1863
  constructor(props) {
1849
1864
  super(props);
1850
- __publicField$j(this, "translations", /* @__PURE__ */ new Map());
1851
- __publicField$j(this, "selectedLanguageId", this.getLanguages()[0]?.id);
1852
- __publicField$j(this, "isTradLoading", false);
1853
- __publicField$j(this, "definitionTradParsed", {});
1865
+ __publicField$k(this, "translations", /* @__PURE__ */ new Map());
1866
+ __publicField$k(this, "selectedLanguageId", this.getLanguages()[0]?.id);
1867
+ __publicField$k(this, "isTradLoading", false);
1868
+ __publicField$k(this, "definitionTradParsed", {});
1854
1869
  makeObservable(this, {
1855
1870
  translations: observable,
1856
1871
  selectedLanguageId: observable,
@@ -1970,18 +1985,23 @@ class TranslatableField extends FieldWithAttribute {
1970
1985
  }
1971
1986
 
1972
1987
  class Editor extends TranslatableField {
1973
- fireEvent(eventName) {
1974
- return super.fireEvent(eventName);
1988
+ fireEvent(eventName, options) {
1989
+ return super.fireEvent(eventName, options);
1975
1990
  }
1976
1991
  isValidValue() {
1977
1992
  return !!new DOMParser().parseFromString(this.getValue(), "text/html").documentElement.textContent;
1978
1993
  }
1994
+ getSynchronizePostConfiguration(value) {
1995
+ const conf = super.getSynchronizePostConfiguration(value);
1996
+ conf.postData.clearValues = "true";
1997
+ return conf;
1998
+ }
1979
1999
  }
1980
2000
 
1981
- var __defProp$i = Object.defineProperty;
1982
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1983
- var __publicField$i = (obj, key, value) => {
1984
- __defNormalProp$i(obj, key + "" , value);
2001
+ var __defProp$j = Object.defineProperty;
2002
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2003
+ var __publicField$j = (obj, key, value) => {
2004
+ __defNormalProp$j(obj, key + "" , value);
1985
2005
  return value;
1986
2006
  };
1987
2007
  function getFileExtension(fileName) {
@@ -1996,6 +2016,7 @@ const getInitialState = (execution) => Object.freeze({
1996
2016
  },
1997
2017
  fromDirectoryFile: null,
1998
2018
  docFolder: void 0,
2019
+ docPath: void 0,
1999
2020
  docExpDate: void 0,
2000
2021
  description: "",
2001
2022
  isReadonly: false,
@@ -2017,7 +2038,7 @@ class UploaderModalController {
2017
2038
  this.api = api;
2018
2039
  this.modalConfig = modalConfig;
2019
2040
  this.conf = conf;
2020
- __publicField$i(this, "state");
2041
+ __publicField$j(this, "state");
2021
2042
  makeObservable(this, {
2022
2043
  state: observable
2023
2044
  });
@@ -2111,6 +2132,11 @@ class UploaderModalController {
2111
2132
  this.state = getInitialState(this.api.execution);
2112
2133
  this.api.clearState();
2113
2134
  }
2135
+ clearPartialState() {
2136
+ if (this.api.state.inProgressFiles.length === 0) {
2137
+ this.state = getInitialState(this.api.execution);
2138
+ }
2139
+ }
2114
2140
  onCloseModal() {
2115
2141
  this.clearState();
2116
2142
  }
@@ -2230,11 +2256,8 @@ class UploaderModalController {
2230
2256
  isValid = false;
2231
2257
  }
2232
2258
  if (c.value.trim() === "") {
2233
- c.errorMessage = getLabel(this.api.execution, "msgReqField").text;
2234
- isValid = false;
2235
- }
2236
- if (c.type === "N" && c.value.trim() === "") {
2237
- c.errorMessage = getLabel(this.api.execution, "msgMustBeNum").text;
2259
+ if (!c.errorMessage)
2260
+ c.errorMessage = getLabel(this.api.execution, "msgReqField").text;
2238
2261
  isValid = false;
2239
2262
  }
2240
2263
  }
@@ -2243,17 +2266,17 @@ class UploaderModalController {
2243
2266
  }
2244
2267
  }
2245
2268
 
2246
- var __defProp$h = Object.defineProperty;
2247
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2248
- var __publicField$h = (obj, key, value) => {
2249
- __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
2269
+ var __defProp$i = Object.defineProperty;
2270
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2271
+ var __publicField$i = (obj, key, value) => {
2272
+ __defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
2250
2273
  return value;
2251
2274
  };
2252
2275
  function returnExactlyTheSame(defaultParameters) {
2253
2276
  return defaultParameters;
2254
2277
  }
2255
- function isOneClickUploadEnabled(oneClickUploadProp) {
2256
- return !window.avoidOneClickUpload && (window.forceOneClickUpload || oneClickUploadProp || false);
2278
+ function isOneClickUploadEnabled(execution, oneClickUploadProp) {
2279
+ return !getWindow(execution).avoidOneClickUpload && (getWindow(execution).forceOneClickUpload || oneClickUploadProp || false);
2257
2280
  }
2258
2281
  const parseFileDefinition = (execution, fileDefinition, isSignRequired) => {
2259
2282
  const { lock, isLocked, lockedBy, userLocking, ...file } = fileDefinition;
@@ -2273,13 +2296,13 @@ class UploaderApi extends EventEmitter$1 {
2273
2296
  this.id = id;
2274
2297
  this.type = type;
2275
2298
  this.modalConfig = modalConfig;
2276
- __publicField$h(this, "maxFiles", Infinity);
2277
- __publicField$h(this, "modalController", null);
2278
- __publicField$h(this, "allowTranslations", false);
2279
- __publicField$h(this, "langs");
2280
- __publicField$h(this, "currentConfiguration");
2281
- __publicField$h(this, "docTypePermittedObjId");
2282
- __publicField$h(this, "state", {
2299
+ __publicField$i(this, "maxFiles", Infinity);
2300
+ __publicField$i(this, "modalController", null);
2301
+ __publicField$i(this, "allowTranslations", false);
2302
+ __publicField$i(this, "langs");
2303
+ __publicField$i(this, "currentConfiguration");
2304
+ __publicField$i(this, "docTypePermittedObjId");
2305
+ __publicField$i(this, "state", {
2283
2306
  progress: 0,
2284
2307
  allowedTypes: [],
2285
2308
  selectedDocTypeId: "1",
@@ -2291,18 +2314,18 @@ class UploaderApi extends EventEmitter$1 {
2291
2314
  translatedFiles: /* @__PURE__ */ new Map(),
2292
2315
  hasAllDocTypes: false
2293
2316
  });
2294
- __publicField$h(this, "getAjaxUploadFileStatusParameters", returnExactlyTheSame);
2295
- __publicField$h(this, "getAjaxUploadStartParameters", returnExactlyTheSame);
2296
- __publicField$h(this, "getConfirmDropModalParameters", returnExactlyTheSame);
2297
- __publicField$h(this, "getCheckLockDocumentParameters", returnExactlyTheSame);
2298
- __publicField$h(this, "getCheckWebDavLockParameters", returnExactlyTheSame);
2299
- __publicField$h(this, "getConfirmDropModalPostdata", returnExactlyTheSame);
2300
- __publicField$h(this, "getConfirmDropModalMetadataString", ({
2317
+ __publicField$i(this, "getAjaxUploadFileStatusParameters", returnExactlyTheSame);
2318
+ __publicField$i(this, "getAjaxUploadStartParameters", returnExactlyTheSame);
2319
+ __publicField$i(this, "getConfirmDropModalParameters", returnExactlyTheSame);
2320
+ __publicField$i(this, "getCheckLockDocumentParameters", returnExactlyTheSame);
2321
+ __publicField$i(this, "getCheckWebDavLockParameters", returnExactlyTheSame);
2322
+ __publicField$i(this, "getConfirmDropModalPostdata", returnExactlyTheSame);
2323
+ __publicField$i(this, "getConfirmDropModalMetadataString", ({
2301
2324
  metadata
2302
2325
  }) => {
2303
2326
  return metadata?.filter?.((current) => !!current.value).map((current) => `${current.id}~${current.type}~${current.value}`).join(";") ?? [];
2304
2327
  });
2305
- __publicField$h(this, "getConfirmDropModalPermissionsString", ({
2328
+ __publicField$i(this, "getConfirmDropModalPermissionsString", ({
2306
2329
  poolsPermissions,
2307
2330
  usersPermissions
2308
2331
  }) => {
@@ -2315,28 +2338,28 @@ class UploaderApi extends EventEmitter$1 {
2315
2338
  );
2316
2339
  return returnString;
2317
2340
  });
2318
- __publicField$h(this, "getConfirmDropModalAdditionalMetadataString", (additionalMetadata) => {
2341
+ __publicField$i(this, "getConfirmDropModalAdditionalMetadataString", (additionalMetadata) => {
2319
2342
  return Object.values(additionalMetadata).filter((current) => !!current?.value).map((current) => `${current.name}~${current.value}`).join(";");
2320
2343
  });
2321
- __publicField$h(this, "getDeleteDocumentParameters", returnExactlyTheSame);
2322
- __publicField$h(this, "getClearTempFilesParameters", returnExactlyTheSame);
2323
- __publicField$h(this, "getDocumentInfoParameters", returnExactlyTheSame);
2324
- __publicField$h(this, "getDownloadMultipleDocumentsParameters", returnExactlyTheSame);
2325
- __publicField$h(this, "getEditDocumentParameters", returnExactlyTheSame);
2326
- __publicField$h(this, "getLockDocumentParameters", returnExactlyTheSame);
2327
- __publicField$h(this, "getMarkFileToSignParameters", returnExactlyTheSame);
2328
- __publicField$h(this, "getProcessDroppedFilesParameters", returnExactlyTheSame);
2329
- __publicField$h(this, "getProcessDroppedFilesPostdata", returnExactlyTheSame);
2330
- __publicField$h(this, "getReloadMetadataParameters", returnExactlyTheSame);
2331
- __publicField$h(this, "getSaveDroppedFilesParameters", returnExactlyTheSame);
2332
- __publicField$h(this, "parseFileDefinition", (file) => {
2344
+ __publicField$i(this, "getDeleteDocumentParameters", returnExactlyTheSame);
2345
+ __publicField$i(this, "getClearTempFilesParameters", returnExactlyTheSame);
2346
+ __publicField$i(this, "getDocumentInfoParameters", returnExactlyTheSame);
2347
+ __publicField$i(this, "getDownloadMultipleDocumentsParameters", returnExactlyTheSame);
2348
+ __publicField$i(this, "getEditDocumentParameters", returnExactlyTheSame);
2349
+ __publicField$i(this, "getLockDocumentParameters", returnExactlyTheSame);
2350
+ __publicField$i(this, "getMarkFileToSignParameters", returnExactlyTheSame);
2351
+ __publicField$i(this, "getProcessDroppedFilesParameters", returnExactlyTheSame);
2352
+ __publicField$i(this, "getProcessDroppedFilesPostdata", returnExactlyTheSame);
2353
+ __publicField$i(this, "getReloadMetadataParameters", returnExactlyTheSame);
2354
+ __publicField$i(this, "getSaveDroppedFilesParameters", returnExactlyTheSame);
2355
+ __publicField$i(this, "parseFileDefinition", (file) => {
2333
2356
  return {
2334
2357
  ...parseFileDefinition(this.execution, file, false),
2335
2358
  canEdit: file.canEdit || file.canWrite,
2336
2359
  canRead: file.canRead
2337
2360
  };
2338
2361
  });
2339
- __publicField$h(this, "getLoadFileSystemStructureTree", () => ({
2362
+ __publicField$i(this, "getLoadFileSystemStructureTree", () => ({
2340
2363
  useDocTypePermitted: true,
2341
2364
  docTypePermittedObjId: this.docTypePermittedObjId,
2342
2365
  docTypePermittedObjType: this.type
@@ -2809,7 +2832,10 @@ class UploaderApi extends EventEmitter$1 {
2809
2832
  type: "success",
2810
2833
  message: getWindow(this.execution).FILE_UPLOADED_SUCCESSFULLY
2811
2834
  });
2812
- if (isOneClickUploadEnabled(this.modalConfig.oneClickUpload)) {
2835
+ if (isOneClickUploadEnabled(
2836
+ this.execution,
2837
+ this.modalConfig.oneClickUpload
2838
+ )) {
2813
2839
  if (langId && translatingFile)
2814
2840
  void this.confirmDropModal({ langId, translatingFile });
2815
2841
  else
@@ -2843,10 +2869,8 @@ class UploaderApi extends EventEmitter$1 {
2843
2869
  );
2844
2870
  if (isLocked?.data?.locked === true || isLocked?.data?.locked === void 0) {
2845
2871
  if (--tries > 0) {
2846
- this.execution.state.locked = true;
2847
2872
  setTimeout(() => void checkLockAction(), 1e3);
2848
2873
  } else {
2849
- this.execution.state.locked = false;
2850
2874
  this.notify({
2851
2875
  message: getWindow(this.execution).MSG_FAIL_SYNC_DOCUMENT
2852
2876
  });
@@ -2854,7 +2878,6 @@ class UploaderApi extends EventEmitter$1 {
2854
2878
  }
2855
2879
  } else {
2856
2880
  resolve(true);
2857
- this.execution.state.locked = false;
2858
2881
  }
2859
2882
  };
2860
2883
  void checkLockAction();
@@ -2989,6 +3012,7 @@ class UploaderApi extends EventEmitter$1 {
2989
3012
  this.modalController.state = {
2990
3013
  description: general.docDesc,
2991
3014
  docFolder: general.docFolder === "" ? void 0 : Number(general.docFolder),
3015
+ docPath: general.docFolderPath,
2992
3016
  permissions: {
2993
3017
  allowAllType: general.docAllPoolPerm,
2994
3018
  users: arrayOrArray(documentInfo.function.data.permissions?.user).map(
@@ -3033,6 +3057,8 @@ class UploaderApi extends EventEmitter$1 {
3033
3057
  const { permissions } = documentInfo.function.data;
3034
3058
  if (this.modalController) {
3035
3059
  this.modalController.addDirectoryFile(document);
3060
+ this.modalController.state.description = document.docDesc;
3061
+ this.modalController.state.docExpDate = document.docExpDate;
3036
3062
  this.modalController.state.permissions = {
3037
3063
  pools: arrayOrArray(permissions?.pool).map((c) => {
3038
3064
  return {
@@ -3489,10 +3515,10 @@ class UploaderApi extends EventEmitter$1 {
3489
3515
  }
3490
3516
  }
3491
3517
 
3492
- var __defProp$g = Object.defineProperty;
3493
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3494
- var __publicField$g = (obj, key, value) => {
3495
- __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
3518
+ var __defProp$h = Object.defineProperty;
3519
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3520
+ var __publicField$h = (obj, key, value) => {
3521
+ __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
3496
3522
  return value;
3497
3523
  };
3498
3524
  class FormsUploader extends UploaderApi {
@@ -3507,15 +3533,15 @@ class FormsUploader extends UploaderApi {
3507
3533
  this.type = type;
3508
3534
  this.modalConfig = modalConfig;
3509
3535
  this.field = field;
3510
- __publicField$g(this, "isEditionMode");
3511
- __publicField$g(this, "getAjaxUploadFileStatusParameters", (defaultParameters) => {
3536
+ __publicField$h(this, "isEditionMode");
3537
+ __publicField$h(this, "getAjaxUploadFileStatusParameters", (defaultParameters) => {
3512
3538
  return {
3513
3539
  ...defaultParameters,
3514
3540
  forceDocTypeId: this.field.properties.docType,
3515
3541
  ...this.getFormParameters()
3516
3542
  };
3517
3543
  });
3518
- __publicField$g(this, "getAjaxUploadStartParameters", ({
3544
+ __publicField$h(this, "getAjaxUploadStartParameters", ({
3519
3545
  useDocTypePermitted,
3520
3546
  docTypePermittedObjType,
3521
3547
  docTypePermittedObjId,
@@ -3527,7 +3553,7 @@ class FormsUploader extends UploaderApi {
3527
3553
  ...this.getFormParameters()
3528
3554
  };
3529
3555
  });
3530
- __publicField$g(this, "getCheckLockDocumentParameters", ({
3556
+ __publicField$h(this, "getCheckLockDocumentParameters", ({
3531
3557
  prefix,
3532
3558
  ...parameters
3533
3559
  }) => {
@@ -3536,7 +3562,7 @@ class FormsUploader extends UploaderApi {
3536
3562
  ...this.getFormParameters()
3537
3563
  };
3538
3564
  });
3539
- __publicField$g(this, "getCheckSignatureParameters", (parameters) => {
3565
+ __publicField$h(this, "getCheckSignatureParameters", (parameters) => {
3540
3566
  const { frmId, frmParent } = this.getFormParameters();
3541
3567
  return {
3542
3568
  ...parameters,
@@ -3544,7 +3570,7 @@ class FormsUploader extends UploaderApi {
3544
3570
  frmParent
3545
3571
  };
3546
3572
  });
3547
- __publicField$g(this, "getClearTempFilesParameters", ({
3573
+ __publicField$h(this, "getClearTempFilesParameters", ({
3548
3574
  elemType,
3549
3575
  ...rest
3550
3576
  }) => {
@@ -3557,15 +3583,16 @@ class FormsUploader extends UploaderApi {
3557
3583
  index
3558
3584
  };
3559
3585
  });
3560
- __publicField$g(this, "getConfirmDropModalParameters", (defaultParameters) => {
3586
+ __publicField$h(this, "getConfirmDropModalParameters", (defaultParameters) => {
3587
+ const { frmParent } = this.getFormParameters();
3561
3588
  return {
3562
3589
  ...defaultParameters,
3563
- elemType: this.elemId(),
3590
+ elemType: frmParent,
3564
3591
  forceDocTypeId: this.field.properties.docType,
3565
3592
  ...this.getFormParameters()
3566
3593
  };
3567
3594
  });
3568
- __publicField$g(this, "getConfirmDropModalPostdata", ({
3595
+ __publicField$h(this, "getConfirmDropModalPostdata", ({
3569
3596
  pe,
3570
3597
  ...parameters
3571
3598
  }) => {
@@ -3575,7 +3602,7 @@ class FormsUploader extends UploaderApi {
3575
3602
  editionMode
3576
3603
  };
3577
3604
  });
3578
- __publicField$g(this, "getDeleteDocumentParameters", ({
3605
+ __publicField$h(this, "getDeleteDocumentParameters", ({
3579
3606
  prefix,
3580
3607
  isAjax,
3581
3608
  ...currentParameters
@@ -3586,13 +3613,13 @@ class FormsUploader extends UploaderApi {
3586
3613
  ...rest
3587
3614
  };
3588
3615
  });
3589
- __publicField$g(this, "getDocumentInfoParameters", (parameters) => {
3616
+ __publicField$h(this, "getDocumentInfoParameters", (parameters) => {
3590
3617
  return {
3591
3618
  ...parameters,
3592
3619
  ajaxUrl: getWindow(this.execution).URL_REQUEST_AJAX
3593
3620
  };
3594
3621
  });
3595
- __publicField$g(this, "getEditDocumentParameters", ({ action, docId }) => {
3622
+ __publicField$h(this, "getEditDocumentParameters", ({ action, docId }) => {
3596
3623
  const { prefix, editionMode, ...rest } = this.getFormParameters();
3597
3624
  return {
3598
3625
  action,
@@ -3601,7 +3628,7 @@ class FormsUploader extends UploaderApi {
3601
3628
  ajaxUrl: "apia.execution.FormAction.run"
3602
3629
  };
3603
3630
  });
3604
- __publicField$g(this, "getLoadFilesForFolderParameters", () => {
3631
+ __publicField$h(this, "getLoadFilesForFolderParameters", () => {
3605
3632
  return {
3606
3633
  useDocTypePermitted: this.state.allowedTypes.length === 1 ? true : void 0,
3607
3634
  docTypeForcedId: this.state.allowedTypes.length === 1 ? this.state.allowedTypes[0].id : void 0,
@@ -3609,11 +3636,11 @@ class FormsUploader extends UploaderApi {
3609
3636
  loadFolders: true
3610
3637
  };
3611
3638
  });
3612
- __publicField$g(this, "getLoadFileSystemStructureTree", () => ({
3639
+ __publicField$h(this, "getLoadFileSystemStructureTree", () => ({
3613
3640
  useDocTypePermitted: this.state.allowedTypes.length === 1,
3614
3641
  docTypeForcedId: this.docTypePermittedObjId
3615
3642
  }));
3616
- __publicField$g(this, "getLockDocumentParameters", ({
3643
+ __publicField$h(this, "getLockDocumentParameters", ({
3617
3644
  prefix,
3618
3645
  isAjax,
3619
3646
  ...currentParameters
@@ -3624,7 +3651,7 @@ class FormsUploader extends UploaderApi {
3624
3651
  ...rest
3625
3652
  };
3626
3653
  });
3627
- __publicField$g(this, "getMarkFileToSignParameters", ({
3654
+ __publicField$h(this, "getMarkFileToSignParameters", ({
3628
3655
  docId,
3629
3656
  prefix,
3630
3657
  ...defaultParameters
@@ -3636,7 +3663,7 @@ class FormsUploader extends UploaderApi {
3636
3663
  ...this.getFormParameters()
3637
3664
  };
3638
3665
  });
3639
- __publicField$g(this, "getProcessDroppedFilesParameters", (defaultParameters) => {
3666
+ __publicField$h(this, "getProcessDroppedFilesParameters", (defaultParameters) => {
3640
3667
  const { prefix, ...rest } = this.getFormParameters();
3641
3668
  return {
3642
3669
  ...defaultParameters,
@@ -3645,7 +3672,7 @@ class FormsUploader extends UploaderApi {
3645
3672
  ...rest
3646
3673
  };
3647
3674
  });
3648
- __publicField$g(this, "getProcessDroppedFilesPostdata", ({
3675
+ __publicField$h(this, "getProcessDroppedFilesPostdata", ({
3649
3676
  useDocTypePermitted,
3650
3677
  docTypePermittedObjId,
3651
3678
  docTypePermittedObjType,
@@ -3653,14 +3680,14 @@ class FormsUploader extends UploaderApi {
3653
3680
  }) => {
3654
3681
  return { ...parameters, editionMode: this.getFormParameters().editionMode };
3655
3682
  });
3656
- __publicField$g(this, "getReloadMetadataParameters", (defaultParameters) => {
3683
+ __publicField$h(this, "getReloadMetadataParameters", (defaultParameters) => {
3657
3684
  return {
3658
3685
  ...defaultParameters,
3659
3686
  ...getWindow(this.execution).IS_EDIT_GRID ? { editionMode: true } : null,
3660
3687
  ...this.getFormParameters()
3661
3688
  };
3662
3689
  });
3663
- __publicField$g(this, "getSaveDroppedFilesParameters", (defaultParameters) => {
3690
+ __publicField$h(this, "getSaveDroppedFilesParameters", (defaultParameters) => {
3664
3691
  const elemId = this.elemId();
3665
3692
  const { prefix, ...rest } = this.getFormParameters();
3666
3693
  return {
@@ -3671,7 +3698,7 @@ class FormsUploader extends UploaderApi {
3671
3698
  ...rest
3672
3699
  };
3673
3700
  });
3674
- __publicField$g(this, "parseFileDefinition", (file) => {
3701
+ __publicField$h(this, "parseFileDefinition", (file) => {
3675
3702
  return {
3676
3703
  ...parseFileDefinition(
3677
3704
  this.execution,
@@ -3689,7 +3716,7 @@ class FormsUploader extends UploaderApi {
3689
3716
  return this.field.definition.multIdx ?? this.field.definition.index ?? 0;
3690
3717
  }
3691
3718
  elemId() {
3692
- return `dropUpprDiv${this.field.properties.id}_${this.index()}${getWindow(this.execution).IS_EDIT_GRID_MODAL ? "_true_Mdl" : ""}`;
3719
+ return `dropUpprDiv${this.field.getForm().definition.frmParent}_${this.field.getForm().definition.id}_${this.field.definition.id}_${this.index()}${getWindow(this.execution).IS_EDIT_GRID_MODAL ? "_true_Mdl" : ""}`;
3693
3720
  }
3694
3721
  filterByFilesAmountLimit(files) {
3695
3722
  const inProgressFiles = this.state.inProgressFiles;
@@ -3731,18 +3758,16 @@ class FormsUploader extends UploaderApi {
3731
3758
  }
3732
3759
  };
3733
3760
  }
3734
- async downloadDocument(fileId) {
3761
+ async downloadDocument(fileId, version) {
3735
3762
  const file = this.getDocument(fileId);
3736
- const { prefix, ...rest } = this.getFormParameters();
3737
3763
  if (!file)
3738
3764
  return;
3739
3765
  if (getWindow(this.execution).IN_MONITOR || await this.checkWebDavLock(file.docId))
3740
3766
  await downloadUrl(
3741
3767
  makeApiaUrl(this.execution, {
3742
- action: "download",
3768
+ action: "downloadDocument",
3743
3769
  docId: file.downloadDocId,
3744
- ajaxUrl: "/page/generic/downloadAttDoc.jsp",
3745
- ...rest
3770
+ version
3746
3771
  })
3747
3772
  );
3748
3773
  }
@@ -3754,16 +3779,16 @@ class FormsUploader extends UploaderApi {
3754
3779
  }
3755
3780
  }
3756
3781
 
3757
- var __defProp$f = Object.defineProperty;
3758
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3759
- var __publicField$f = (obj, key, value) => {
3760
- __defNormalProp$f(obj, key + "" , value);
3782
+ var __defProp$g = Object.defineProperty;
3783
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3784
+ var __publicField$g = (obj, key, value) => {
3785
+ __defNormalProp$g(obj, key + "" , value);
3761
3786
  return value;
3762
3787
  };
3763
3788
  class File extends FieldWithAttribute {
3764
3789
  constructor() {
3765
3790
  super(...arguments);
3766
- __publicField$f(this, "uploader", {});
3791
+ __publicField$g(this, "uploader", {});
3767
3792
  }
3768
3793
  async init(form) {
3769
3794
  await super.init(form);
@@ -3812,7 +3837,7 @@ class File extends FieldWithAttribute {
3812
3837
  }
3813
3838
  }
3814
3839
  async validate() {
3815
- if (this.properties.disabled || this.properties.noModify) {
3840
+ if (this.properties.disabled || this.properties.noModify || this.properties.visibilityHidden) {
3816
3841
  return true;
3817
3842
  } else if (this.properties.required && Object.values(this.uploader.state.files).length == 0) {
3818
3843
  this.state.validation.errorMessage = labels.errorFieldRequired(
@@ -3865,27 +3890,27 @@ function noNaN(number, defaultReturn = 0) {
3865
3890
  return returnNumber;
3866
3891
  }
3867
3892
 
3868
- var __defProp$e = Object.defineProperty;
3869
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3870
- var __publicField$e = (obj, key, value) => {
3871
- __defNormalProp$e(obj, key + "" , value);
3893
+ var __defProp$f = Object.defineProperty;
3894
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3895
+ var __publicField$f = (obj, key, value) => {
3896
+ __defNormalProp$f(obj, key + "" , value);
3872
3897
  return value;
3873
3898
  };
3874
- var __accessCheck$i = (obj, member, msg) => {
3899
+ var __accessCheck$j = (obj, member, msg) => {
3875
3900
  if (!member.has(obj))
3876
3901
  throw TypeError("Cannot " + msg);
3877
3902
  };
3878
- var __privateGet$i = (obj, member, getter) => {
3879
- __accessCheck$i(obj, member, "read from private field");
3903
+ var __privateGet$j = (obj, member, getter) => {
3904
+ __accessCheck$j(obj, member, "read from private field");
3880
3905
  return getter ? getter.call(obj) : member.get(obj);
3881
3906
  };
3882
- var __privateAdd$i = (obj, member, value) => {
3907
+ var __privateAdd$j = (obj, member, value) => {
3883
3908
  if (member.has(obj))
3884
3909
  throw TypeError("Cannot add the same private member more than once");
3885
3910
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
3886
3911
  };
3887
- var __privateSet$i = (obj, member, value, setter) => {
3888
- __accessCheck$i(obj, member, "write to private field");
3912
+ var __privateSet$j = (obj, member, value, setter) => {
3913
+ __accessCheck$j(obj, member, "write to private field");
3889
3914
  member.set(obj, value);
3890
3915
  return value;
3891
3916
  };
@@ -3893,17 +3918,17 @@ var _unsubscribeTableEvents;
3893
3918
  class GridFooterHandler {
3894
3919
  constructor(grid) {
3895
3920
  this.grid = grid;
3896
- __publicField$e(this, "state", {
3921
+ __publicField$f(this, "state", {
3897
3922
  isSortUpDisabled: true,
3898
3923
  isSortDownDisabled: true
3899
3924
  });
3900
- __privateAdd$i(this, _unsubscribeTableEvents, () => {
3925
+ __privateAdd$j(this, _unsubscribeTableEvents, () => {
3901
3926
  });
3902
3927
  makeObservable(this, { state: observable });
3903
3928
  this.init();
3904
3929
  }
3905
3930
  init() {
3906
- __privateGet$i(this, _unsubscribeTableEvents).call(this);
3931
+ __privateGet$j(this, _unsubscribeTableEvents).call(this);
3907
3932
  const controller = this.grid.controller;
3908
3933
  const u2 = controller.on("selectionChange", (selection) => {
3909
3934
  const { paged, currentPage, pages } = this.grid.properties;
@@ -3918,7 +3943,7 @@ class GridFooterHandler {
3918
3943
  ));
3919
3944
  });
3920
3945
  });
3921
- __privateSet$i(this, _unsubscribeTableEvents, () => {
3946
+ __privateSet$j(this, _unsubscribeTableEvents, () => {
3922
3947
  u2();
3923
3948
  });
3924
3949
  }
@@ -3993,15 +4018,15 @@ class HeaderCell extends Cell {
3993
4018
  }
3994
4019
  }
3995
4020
 
3996
- var __defProp$d = Object.defineProperty;
3997
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3998
- var __publicField$d = (obj, key, value) => {
3999
- __defNormalProp$d(obj, key + "" , value);
4021
+ var __defProp$e = Object.defineProperty;
4022
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4023
+ var __publicField$e = (obj, key, value) => {
4024
+ __defNormalProp$e(obj, key + "" , value);
4000
4025
  return value;
4001
4026
  };
4002
4027
  class FieldsCache {
4003
4028
  constructor() {
4004
- __publicField$d(this, "cached", {});
4029
+ __publicField$e(this, "cached", {});
4005
4030
  }
4006
4031
  getIndex(index) {
4007
4032
  if (!this.cached[index])
@@ -4034,10 +4059,10 @@ class FieldsCache {
4034
4059
  }
4035
4060
  }
4036
4061
 
4037
- var __defProp$c = Object.defineProperty;
4038
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4039
- var __publicField$c = (obj, key, value) => {
4040
- __defNormalProp$c(obj, key + "" , value);
4062
+ var __defProp$d = Object.defineProperty;
4063
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4064
+ var __publicField$d = (obj, key, value) => {
4065
+ __defNormalProp$d(obj, key + "" , value);
4041
4066
  return value;
4042
4067
  };
4043
4068
  class ModalInput extends FieldWithAttribute {
@@ -4049,11 +4074,11 @@ class ModalInput extends FieldWithAttribute {
4049
4074
  },
4050
4075
  value: { storeValue: value, showValue: definition.qry_show_value }
4051
4076
  });
4052
- __publicField$c(this, "isLoading", false);
4077
+ __publicField$d(this, "isLoading", false);
4053
4078
  makeObservable(this, { isLoading: observable });
4054
4079
  }
4055
- fireEvent(eventName) {
4056
- return super.fireEvent(eventName);
4080
+ fireEvent(eventName, options) {
4081
+ return super.fireEvent(eventName, options);
4057
4082
  }
4058
4083
  hasValue() {
4059
4084
  return this.getValue().showValue !== "" && this.getValue().storeValue !== "";
@@ -4140,7 +4165,7 @@ class ModalInput extends FieldWithAttribute {
4140
4165
  return true;
4141
4166
  }
4142
4167
  setValue(newValue, options) {
4143
- if (isFieldShowAsText(this) || shallowEqual$1(newValue, this.getValue()))
4168
+ if (!options?.force && (isFieldShowAsText(this) || shallowEqual$1(newValue, this.getValue())))
4144
4169
  return Promise.resolve(true);
4145
4170
  this.state.value = newValue;
4146
4171
  this.state.validation.errorMessage = null;
@@ -4172,10 +4197,10 @@ class ModalInput extends FieldWithAttribute {
4172
4197
  class Hidden extends FieldWithAttribute {
4173
4198
  }
4174
4199
 
4175
- var __defProp$b = Object.defineProperty;
4176
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4177
- var __publicField$b = (obj, key, value) => {
4178
- __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
4200
+ var __defProp$c = Object.defineProperty;
4201
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4202
+ var __publicField$c = (obj, key, value) => {
4203
+ __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
4179
4204
  return value;
4180
4205
  };
4181
4206
  async function inlineCaller(cb, _t) {
@@ -4204,19 +4229,19 @@ class Grid extends Field {
4204
4229
  hideDocInfoButton: String(properties.hideDocInfoButton) === "true"
4205
4230
  }
4206
4231
  });
4207
- __publicField$b(this, "rowId", 0);
4208
- __publicField$b(this, "cache", new FieldsCache());
4209
- __publicField$b(this, "mutex", new Mutex());
4210
- __publicField$b(this, "newRowStates", []);
4211
- __publicField$b(this, "initialStates");
4212
- __publicField$b(this, "fieldsDefinitions");
4213
- __publicField$b(this, "managedAttIds", /* @__PURE__ */ new Set());
4214
- __publicField$b(this, "managedAttNames", /* @__PURE__ */ new Set());
4215
- __publicField$b(this, "managedFieldIds", /* @__PURE__ */ new Set());
4216
- __publicField$b(this, "managedFieldsNames", /* @__PURE__ */ new Set());
4217
- __publicField$b(this, "_editionModalHandler", null);
4218
- __publicField$b(this, "_footerController");
4219
- __publicField$b(this, "tableController", new TableController({
4232
+ __publicField$c(this, "rowId", 0);
4233
+ __publicField$c(this, "cache", new FieldsCache());
4234
+ __publicField$c(this, "mutex", new Mutex());
4235
+ __publicField$c(this, "newRowStates", []);
4236
+ __publicField$c(this, "initialStates");
4237
+ __publicField$c(this, "fieldsDefinitions");
4238
+ __publicField$c(this, "managedAttIds", /* @__PURE__ */ new Set());
4239
+ __publicField$c(this, "managedAttNames", /* @__PURE__ */ new Set());
4240
+ __publicField$c(this, "managedFieldIds", /* @__PURE__ */ new Set());
4241
+ __publicField$c(this, "managedFieldsNames", /* @__PURE__ */ new Set());
4242
+ __publicField$c(this, "_editionModalHandler", null);
4243
+ __publicField$c(this, "_footerController");
4244
+ __publicField$c(this, "tableController", new TableController({
4220
4245
  allowEdition: true,
4221
4246
  allowSelection: true,
4222
4247
  isSelectionMultiple: true
@@ -5207,9 +5232,20 @@ class GridPaginated extends Grid {
5207
5232
  class Image extends Field {
5208
5233
  }
5209
5234
 
5235
+ var __defProp$b = Object.defineProperty;
5236
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5237
+ var __publicField$b = (obj, key, value) => {
5238
+ __defNormalProp$b(obj, key + "" , value);
5239
+ return value;
5240
+ };
5241
+ dayjs.extend(customParseFormat);
5210
5242
  class Input extends TranslatableField {
5211
- fireEvent(eventName) {
5212
- return super.fireEvent(eventName);
5243
+ constructor() {
5244
+ super(...arguments);
5245
+ __publicField$b(this, "validDate", true);
5246
+ }
5247
+ fireEvent(eventName, options) {
5248
+ return super.fireEvent(eventName, options);
5213
5249
  }
5214
5250
  async setValue(newValue, options) {
5215
5251
  if (this.attribute.valueType === "S") {
@@ -5221,16 +5257,36 @@ class Input extends TranslatableField {
5221
5257
  } else if (this.attribute.valueType === "N") {
5222
5258
  super.setValue(String(newValue), options);
5223
5259
  } else if (this.attribute.valueType === "D") {
5260
+ this.validDate = true;
5261
+ const inFmt = getDateFormat(options?.format);
5262
+ const outFmt = getDateFormat();
5224
5263
  if (typeof newValue === "string") {
5225
- const dateValue = dayjs(newValue, getDateFormat(options?.format));
5226
- return super.setValue(
5227
- dateValue.isValid() ? dateValue.format(getDateFormat()) : ""
5228
- );
5229
- } else if (newValue instanceof Date) {
5230
- const dateValue = dayjs(newValue);
5231
- return super.setValue(
5232
- dateValue.isValid() ? dateValue.format(getDateFormat()) : ""
5233
- );
5264
+ if (newValue.match(/^\d+$/)) {
5265
+ const value = new Date(Number.parseInt(newValue));
5266
+ const d = dayjs(value);
5267
+ return super.setValue(d.isValid() ? d.format(outFmt) : "", options);
5268
+ } else {
5269
+ const d = dayjs(newValue.trim(), inFmt, true);
5270
+ if (!d.isValid() && newValue.trim() !== "") {
5271
+ this.state.validation.errorMessage = getLabel(
5272
+ this.getForm().execution,
5273
+ "msgInvalidDate"
5274
+ ).text;
5275
+ this.validDate = false;
5276
+ }
5277
+ return super.setValue(d.isValid() ? d.format(outFmt) : "", options);
5278
+ }
5279
+ }
5280
+ if (newValue instanceof Date) {
5281
+ const d = dayjs(newValue);
5282
+ if (!d.isValid()) {
5283
+ this.state.validation.errorMessage = getLabel(
5284
+ this.getForm().execution,
5285
+ "msgInvalidDate"
5286
+ ).text;
5287
+ this.validDate = false;
5288
+ }
5289
+ return super.setValue(d.isValid() ? d.format(outFmt) : "", options);
5234
5290
  }
5235
5291
  }
5236
5292
  return false;
@@ -5248,12 +5304,12 @@ class Input extends TranslatableField {
5248
5304
  return true;
5249
5305
  }
5250
5306
  async validate() {
5251
- if (this.state.validation.errorMessage)
5307
+ if (this.state.validation.errorMessage && !this.validDate)
5252
5308
  return false;
5253
5309
  return super.validate();
5254
5310
  }
5255
5311
  isValidValue() {
5256
- return !!this.getValue().trim();
5312
+ return !!String(this.getValue()).trim();
5257
5313
  }
5258
5314
  }
5259
5315
 
@@ -5301,7 +5357,7 @@ class Multiple extends FieldWithAttribute {
5301
5357
 
5302
5358
  class Password extends FieldWithAttribute {
5303
5359
  isValidValue() {
5304
- return !!this.getValue().trim();
5360
+ return !!String(this.getValue()).trim();
5305
5361
  }
5306
5362
  }
5307
5363
 
@@ -5316,8 +5372,8 @@ class Radio extends FieldWithAttribute {
5316
5372
  await super.init(form);
5317
5373
  await this.fireEvent("onPopulate");
5318
5374
  }
5319
- fireEvent(eventName) {
5320
- return super.fireEvent(eventName);
5375
+ fireEvent(eventName, options) {
5376
+ return super.fireEvent(eventName, options);
5321
5377
  }
5322
5378
  }
5323
5379
 
@@ -5344,7 +5400,12 @@ class Select extends FieldWithAttribute {
5344
5400
 
5345
5401
  class Textarea extends TranslatableField {
5346
5402
  isValidValue() {
5347
- return !!this.getValue().trim();
5403
+ return !!String(this.getValue()).trim();
5404
+ }
5405
+ getSynchronizePostConfiguration(value) {
5406
+ const conf = super.getSynchronizePostConfiguration(value);
5407
+ conf.postData.clearValues = "true";
5408
+ return conf;
5348
5409
  }
5349
5410
  }
5350
5411
 
@@ -5404,8 +5465,8 @@ class Tree extends FieldWithAttribute {
5404
5465
  }
5405
5466
  };
5406
5467
  }
5407
- fireEvent(eventName) {
5408
- return super.fireEvent(eventName);
5468
+ fireEvent(eventName, options) {
5469
+ return super.fireEvent(eventName, options);
5409
5470
  }
5410
5471
  hasValue() {
5411
5472
  return this.state.value.length > 0;
@@ -5469,12 +5530,6 @@ class SchedulerField extends Field {
5469
5530
  constructor(definition) {
5470
5531
  super(definition);
5471
5532
  __publicField$9(this, "_schedController");
5472
- this._schedController = new Scheduler(this.parsedInitialProperties, {
5473
- loadWeek: this.loadWeek.bind(this),
5474
- deleteDate: this.deleteDate.bind(this),
5475
- markDay: this.markDay.bind(this),
5476
- loadInfo: this.loadInfo.bind(this)
5477
- });
5478
5533
  }
5479
5534
  async deleteDate() {
5480
5535
  const res = await get(
@@ -5510,7 +5565,19 @@ class SchedulerField extends Field {
5510
5565
  }
5511
5566
  async init(form) {
5512
5567
  await super.init(form);
5513
- this._schedController.loadWeek();
5568
+ this._schedController = new Scheduler(
5569
+ this.parsedInitialProperties,
5570
+ {
5571
+ loadWeek: this.loadWeek.bind(this),
5572
+ deleteDate: this.deleteDate.bind(this),
5573
+ markDay: this.markDay.bind(this),
5574
+ loadInfo: this.loadInfo.bind(this)
5575
+ },
5576
+ "Scheduler",
5577
+ getWindow(this.getForm().execution)
5578
+ );
5579
+ if (this._schedController)
5580
+ this._schedController.loadWeek();
5514
5581
  }
5515
5582
  async loadWeek(weekDay, schId, proId, proVerId, tskId) {
5516
5583
  const res = await get(
@@ -5697,61 +5764,6 @@ const IProperty = {
5697
5764
  ...FormConstants
5698
5765
  };
5699
5766
 
5700
- class ButtonsAction {
5701
- constructor(button) {
5702
- this.button = button;
5703
- makeObservable(this, {
5704
- button: observable
5705
- });
5706
- }
5707
- update(props) {
5708
- if (this.button) {
5709
- this.button = { ...this.button, ...props };
5710
- }
5711
- }
5712
- get action() {
5713
- return this;
5714
- }
5715
- get disabled() {
5716
- return this.button.disabled;
5717
- }
5718
- get props() {
5719
- const properties = {
5720
- disabled: this.button.disabled,
5721
- hidden: this.button.hidden,
5722
- loading: this.button.isLoading
5723
- };
5724
- return properties;
5725
- }
5726
- get label() {
5727
- return this.button?.label;
5728
- }
5729
- get title() {
5730
- return this.button?.title ?? "";
5731
- }
5732
- get variant() {
5733
- return this.button?.variant ?? "";
5734
- }
5735
- set title(title) {
5736
- this.update({ title });
5737
- }
5738
- set variant(variant) {
5739
- this.update({ variant });
5740
- }
5741
- disable() {
5742
- this.update({ disabled: true });
5743
- }
5744
- enable() {
5745
- this.update({ disabled: false });
5746
- }
5747
- hide() {
5748
- this.update({ hidden: true });
5749
- }
5750
- show() {
5751
- this.update({ hidden: false });
5752
- }
5753
- }
5754
-
5755
5767
  var __defProp$8 = Object.defineProperty;
5756
5768
  var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5757
5769
  var __publicField$8 = (obj, key, value) => {
@@ -5761,6 +5773,7 @@ var __publicField$8 = (obj, key, value) => {
5761
5773
  const _ActionsController = class _ActionsController {
5762
5774
  constructor() {
5763
5775
  __publicField$8(this, "buttons", /* @__PURE__ */ new Map());
5776
+ makeAutoObservable(this);
5764
5777
  }
5765
5778
  static get instance() {
5766
5779
  if (!_ActionsController._instance) {
@@ -5768,26 +5781,29 @@ const _ActionsController = class _ActionsController {
5768
5781
  }
5769
5782
  return _ActionsController._instance;
5770
5783
  }
5771
- addButton(button) {
5772
- if (this.buttons.has(button.id))
5773
- return;
5774
- this.buttons.set(
5775
- button.id,
5776
- new ButtonsAction({
5777
- ...{
5778
- isLoading: false,
5779
- disabled: false,
5780
- hidden: false
5781
- },
5782
- ...button
5783
- })
5784
- );
5785
- }
5786
- getButton(id) {
5787
- if (this.buttons.has(id)) {
5788
- return this.buttons.get(id);
5784
+ get(id) {
5785
+ if (!this.buttons.has(id)) {
5786
+ this.buttons.set(id, {});
5789
5787
  }
5790
- throw Error("That button not exist");
5788
+ return this.buttons.get(id);
5789
+ }
5790
+ disable(id) {
5791
+ this.get(id).disabled = true;
5792
+ }
5793
+ enable(id) {
5794
+ this.get(id).disabled = false;
5795
+ }
5796
+ hide(id) {
5797
+ this.get(id).hidden = true;
5798
+ }
5799
+ isDisabled(id) {
5800
+ return !!this.get(id).disabled;
5801
+ }
5802
+ isHidden(id) {
5803
+ return !!this.get(id).hidden;
5804
+ }
5805
+ show(id) {
5806
+ this.get(id).hidden = false;
5791
5807
  }
5792
5808
  };
5793
5809
  __publicField$8(_ActionsController, "CONFIRM", 0);
@@ -5801,78 +5817,87 @@ __publicField$8(_ActionsController, "SHARE", 7);
5801
5817
  __publicField$8(_ActionsController, "PRINT", 8);
5802
5818
  __publicField$8(_ActionsController, "VIEW_DOCS", 9);
5803
5819
  __publicField$8(_ActionsController, "CLOSE", 10);
5820
+ __publicField$8(_ActionsController, "SEND_TO_DESK", 11);
5821
+ __publicField$8(_ActionsController, "BTN_CONFIRM", _ActionsController.CONFIRM);
5822
+ __publicField$8(_ActionsController, "BTN_DELEGATE", _ActionsController.DELEGATE);
5823
+ __publicField$8(_ActionsController, "BTN_NEXT", _ActionsController.NEXT);
5824
+ __publicField$8(_ActionsController, "BTN_PERV", _ActionsController.PREVIOUS);
5825
+ __publicField$8(_ActionsController, "BTN_RELEASE", _ActionsController.RELEASE);
5826
+ __publicField$8(_ActionsController, "BTN_SAVE", _ActionsController.SAVE);
5827
+ __publicField$8(_ActionsController, "BTN_SHARE", _ActionsController.SHARE);
5828
+ __publicField$8(_ActionsController, "BTN_SIGN", _ActionsController.SIGN);
5804
5829
  __publicField$8(_ActionsController, "_instance");
5805
5830
  let ActionsController = _ActionsController;
5806
5831
 
5807
- var __accessCheck$h = (obj, member, msg) => {
5832
+ var __accessCheck$i = (obj, member, msg) => {
5808
5833
  if (!member.has(obj))
5809
5834
  throw TypeError("Cannot " + msg);
5810
5835
  };
5811
- var __privateGet$h = (obj, member, getter) => {
5812
- __accessCheck$h(obj, member, "read from private field");
5836
+ var __privateGet$i = (obj, member, getter) => {
5837
+ __accessCheck$i(obj, member, "read from private field");
5813
5838
  return getter ? getter.call(obj) : member.get(obj);
5814
5839
  };
5815
- var __privateAdd$h = (obj, member, value) => {
5840
+ var __privateAdd$i = (obj, member, value) => {
5816
5841
  if (member.has(obj))
5817
5842
  throw TypeError("Cannot add the same private member more than once");
5818
5843
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5819
5844
  };
5820
- var __privateSet$h = (obj, member, value, setter) => {
5821
- __accessCheck$h(obj, member, "write to private field");
5845
+ var __privateSet$i = (obj, member, value, setter) => {
5846
+ __accessCheck$i(obj, member, "write to private field");
5822
5847
  member.set(obj, value);
5823
5848
  return value;
5824
5849
  };
5825
- var _execution$2, _field$e;
5850
+ var _execution$3, _field$e;
5826
5851
  class ApiaField {
5827
5852
  constructor(execution, field) {
5828
- __privateAdd$h(this, _execution$2, void 0);
5829
- __privateAdd$h(this, _field$e, void 0);
5830
- __privateSet$h(this, _execution$2, execution);
5831
- __privateSet$h(this, _field$e, field);
5853
+ __privateAdd$i(this, _execution$3, void 0);
5854
+ __privateAdd$i(this, _field$e, void 0);
5855
+ __privateSet$i(this, _execution$3, execution);
5856
+ __privateSet$i(this, _field$e, field);
5832
5857
  }
5833
5858
  get fldType() {
5834
- return __privateGet$h(this, _field$e).definition.fieldType;
5859
+ return __privateGet$i(this, _field$e).definition.fieldType;
5835
5860
  }
5836
5861
  get fldId() {
5837
- return __privateGet$h(this, _field$e).definition.id;
5862
+ return __privateGet$i(this, _field$e).definition.id;
5838
5863
  }
5839
5864
  get form() {
5840
- return new ApiaForm(__privateGet$h(this, _execution$2), __privateGet$h(this, _field$e).getForm());
5865
+ return new ApiaForm(__privateGet$i(this, _execution$3), __privateGet$i(this, _field$e).getForm());
5841
5866
  }
5842
5867
  get index() {
5843
- return __privateGet$h(this, _field$e).definition.index || 0;
5868
+ return __privateGet$i(this, _field$e).definition.index || 0;
5844
5869
  }
5845
5870
  setProperty(name, value) {
5846
- __privateGet$h(this, _field$e).setProperty(name, value);
5871
+ __privateGet$i(this, _field$e).setProperty(name, value);
5847
5872
  }
5848
5873
  getProperty(name) {
5849
- return __privateGet$h(this, _field$e).getProperty(name);
5874
+ return __privateGet$i(this, _field$e).getProperty(name);
5850
5875
  }
5851
5876
  setFocus() {
5852
5877
  throw new Error("Method not implemented. ");
5853
5878
  }
5854
5879
  isInGrid() {
5855
- return !!__privateGet$h(this, _field$e).properties.inGrid;
5880
+ return !!__privateGet$i(this, _field$e).properties.inGrid;
5856
5881
  }
5857
5882
  }
5858
- _execution$2 = new WeakMap();
5883
+ _execution$3 = new WeakMap();
5859
5884
  _field$e = new WeakMap();
5860
5885
 
5861
- var __accessCheck$g = (obj, member, msg) => {
5886
+ var __accessCheck$h = (obj, member, msg) => {
5862
5887
  if (!member.has(obj))
5863
5888
  throw TypeError("Cannot " + msg);
5864
5889
  };
5865
- var __privateGet$g = (obj, member, getter) => {
5866
- __accessCheck$g(obj, member, "read from private field");
5890
+ var __privateGet$h = (obj, member, getter) => {
5891
+ __accessCheck$h(obj, member, "read from private field");
5867
5892
  return getter ? getter.call(obj) : member.get(obj);
5868
5893
  };
5869
- var __privateAdd$g = (obj, member, value) => {
5894
+ var __privateAdd$h = (obj, member, value) => {
5870
5895
  if (member.has(obj))
5871
5896
  throw TypeError("Cannot add the same private member more than once");
5872
5897
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5873
5898
  };
5874
- var __privateSet$g = (obj, member, value, setter) => {
5875
- __accessCheck$g(obj, member, "write to private field");
5899
+ var __privateSet$h = (obj, member, value, setter) => {
5900
+ __accessCheck$h(obj, member, "write to private field");
5876
5901
  member.set(obj, value);
5877
5902
  return value;
5878
5903
  };
@@ -5880,22 +5905,22 @@ var _field$d;
5880
5905
  class ButtonField extends ApiaField {
5881
5906
  constructor(execution, field) {
5882
5907
  super(execution, field);
5883
- __privateAdd$g(this, _field$d, void 0);
5884
- __privateSet$g(this, _field$d, field);
5908
+ __privateAdd$h(this, _field$d, void 0);
5909
+ __privateSet$h(this, _field$d, field);
5885
5910
  }
5886
5911
  fireClickEvent() {
5887
- if (__privateGet$g(this, _field$d).definition.id) {
5888
- __privateGet$g(this, _field$d).fireEvent("onClick");
5912
+ if (__privateGet$h(this, _field$d).definition.id) {
5913
+ __privateGet$h(this, _field$d).fireEvent("onClick");
5889
5914
  }
5890
5915
  }
5891
5916
  getValue() {
5892
- if (__privateGet$g(this, _field$d).definition.id) {
5893
- return __privateGet$g(this, _field$d).properties.value ?? "";
5917
+ if (__privateGet$h(this, _field$d).definition.id) {
5918
+ return __privateGet$h(this, _field$d).properties.value ?? "";
5894
5919
  }
5895
5920
  return null;
5896
5921
  }
5897
5922
  clearValue() {
5898
- __privateGet$g(this, _field$d).properties.value = "";
5923
+ __privateGet$h(this, _field$d).properties.value = "";
5899
5924
  }
5900
5925
  setValue(value) {
5901
5926
  this.setProperty("value", value);
@@ -5903,64 +5928,64 @@ class ButtonField extends ApiaField {
5903
5928
  }
5904
5929
  _field$d = new WeakMap();
5905
5930
 
5906
- var __accessCheck$f = (obj, member, msg) => {
5931
+ var __accessCheck$g = (obj, member, msg) => {
5907
5932
  if (!member.has(obj))
5908
5933
  throw TypeError("Cannot " + msg);
5909
5934
  };
5910
- var __privateGet$f = (obj, member, getter) => {
5911
- __accessCheck$f(obj, member, "read from private field");
5935
+ var __privateGet$g = (obj, member, getter) => {
5936
+ __accessCheck$g(obj, member, "read from private field");
5912
5937
  return getter ? getter.call(obj) : member.get(obj);
5913
5938
  };
5914
- var __privateAdd$f = (obj, member, value) => {
5939
+ var __privateAdd$g = (obj, member, value) => {
5915
5940
  if (member.has(obj))
5916
5941
  throw TypeError("Cannot add the same private member more than once");
5917
5942
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5918
5943
  };
5919
- var __privateSet$f = (obj, member, value, setter) => {
5920
- __accessCheck$f(obj, member, "write to private field");
5944
+ var __privateSet$g = (obj, member, value, setter) => {
5945
+ __accessCheck$g(obj, member, "write to private field");
5921
5946
  member.set(obj, value);
5922
5947
  return value;
5923
5948
  };
5924
5949
  var _attribute, _field$c;
5925
5950
  class ApiaAttribute {
5926
5951
  constructor(attribute) {
5927
- __privateAdd$f(this, _attribute, void 0);
5928
- __privateSet$f(this, _attribute, attribute);
5952
+ __privateAdd$g(this, _attribute, void 0);
5953
+ __privateSet$g(this, _attribute, attribute);
5929
5954
  }
5930
5955
  get attLabel() {
5931
- return __privateGet$f(this, _attribute).title;
5956
+ return __privateGet$g(this, _attribute).title;
5932
5957
  }
5933
5958
  get name() {
5934
- return __privateGet$f(this, _attribute).name;
5959
+ return __privateGet$g(this, _attribute).name;
5935
5960
  }
5936
5961
  get id() {
5937
- return __privateGet$f(this, _attribute).id;
5962
+ return __privateGet$g(this, _attribute).id;
5938
5963
  }
5939
5964
  get valueType() {
5940
- return __privateGet$f(this, _attribute).valueType;
5965
+ return __privateGet$g(this, _attribute).valueType;
5941
5966
  }
5942
5967
  }
5943
5968
  _attribute = new WeakMap();
5944
5969
  class ApiaFieldWithAttribute extends ApiaField {
5945
5970
  constructor(execution, field) {
5946
5971
  super(execution, field);
5947
- __privateAdd$f(this, _field$c, void 0);
5948
- __privateSet$f(this, _field$c, field);
5972
+ __privateAdd$g(this, _field$c, void 0);
5973
+ __privateSet$g(this, _field$c, field);
5949
5974
  }
5950
5975
  get attribute() {
5951
- return new ApiaAttribute(__privateGet$f(this, _field$c).attribute);
5976
+ return new ApiaAttribute(__privateGet$g(this, _field$c).attribute);
5952
5977
  }
5953
5978
  clearValue() {
5954
- __privateGet$f(this, _field$c).setValue("");
5979
+ __privateGet$g(this, _field$c).setValue("");
5955
5980
  }
5956
5981
  getValue() {
5957
- return __privateGet$f(this, _field$c).getValue();
5982
+ return __privateGet$g(this, _field$c).getValue();
5958
5983
  }
5959
5984
  setValue(v) {
5960
- __privateGet$f(this, _field$c).setValue(v);
5985
+ __privateGet$g(this, _field$c).setValue(v);
5961
5986
  }
5962
5987
  getLabel() {
5963
- return __privateGet$f(this, _field$c).attribute.title;
5988
+ return __privateGet$g(this, _field$c).attribute.title;
5964
5989
  }
5965
5990
  getProperty(name) {
5966
5991
  return super.getProperty(name);
@@ -5971,21 +5996,21 @@ _field$c = new WeakMap();
5971
5996
  class EditorField extends ApiaFieldWithAttribute {
5972
5997
  }
5973
5998
 
5974
- var __accessCheck$e = (obj, member, msg) => {
5999
+ var __accessCheck$f = (obj, member, msg) => {
5975
6000
  if (!member.has(obj))
5976
6001
  throw TypeError("Cannot " + msg);
5977
6002
  };
5978
- var __privateGet$e = (obj, member, getter) => {
5979
- __accessCheck$e(obj, member, "read from private field");
6003
+ var __privateGet$f = (obj, member, getter) => {
6004
+ __accessCheck$f(obj, member, "read from private field");
5980
6005
  return member.get(obj);
5981
6006
  };
5982
- var __privateAdd$e = (obj, member, value) => {
6007
+ var __privateAdd$f = (obj, member, value) => {
5983
6008
  if (member.has(obj))
5984
6009
  throw TypeError("Cannot add the same private member more than once");
5985
6010
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5986
6011
  };
5987
- var __privateSet$e = (obj, member, value, setter) => {
5988
- __accessCheck$e(obj, member, "write to private field");
6012
+ var __privateSet$f = (obj, member, value, setter) => {
6013
+ __accessCheck$f(obj, member, "write to private field");
5989
6014
  member.set(obj, value);
5990
6015
  return value;
5991
6016
  };
@@ -5993,13 +6018,13 @@ var _field$b;
5993
6018
  class SelectField extends ApiaFieldWithAttribute {
5994
6019
  constructor(execution, field) {
5995
6020
  super(execution, field);
5996
- __privateAdd$e(this, _field$b, void 0);
5997
- __privateSet$e(this, _field$b, field);
6021
+ __privateAdd$f(this, _field$b, void 0);
6022
+ __privateSet$f(this, _field$b, field);
5998
6023
  }
5999
6024
  // get all select options either as array[] or object
6000
6025
  getOptions(asObject) {
6001
- if (__privateGet$e(this, _field$b).definition.id) {
6002
- const options = arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue);
6026
+ if (__privateGet$f(this, _field$b).definition.id) {
6027
+ const options = arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue);
6003
6028
  const obj = /* @__PURE__ */ new Map();
6004
6029
  if (asObject) {
6005
6030
  options.forEach((c) => obj.set(String(c.value), c));
@@ -6012,8 +6037,8 @@ class SelectField extends ApiaFieldWithAttribute {
6012
6037
  // adds a option to the select field
6013
6038
  addOption(optionValue, showValue, allowRepeatedValue) {
6014
6039
  let isValueRepeated = false;
6015
- if (__privateGet$e(this, _field$b).definition.id !== null) {
6016
- if (arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue).find(
6040
+ if (__privateGet$f(this, _field$b).definition.id !== null) {
6041
+ if (arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue).find(
6017
6042
  (c) => c.value === optionValue
6018
6043
  ) && allowRepeatedValue) {
6019
6044
  isValueRepeated = true;
@@ -6021,7 +6046,7 @@ class SelectField extends ApiaFieldWithAttribute {
6021
6046
  isValueRepeated = false;
6022
6047
  }
6023
6048
  if (allowRepeatedValue || !isValueRepeated && !allowRepeatedValue)
6024
- arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue).push({
6049
+ arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue).push({
6025
6050
  value: optionValue,
6026
6051
  label: showValue
6027
6052
  });
@@ -6029,21 +6054,21 @@ class SelectField extends ApiaFieldWithAttribute {
6029
6054
  }
6030
6055
  // overwrite all options in select field
6031
6056
  setOptions(optionsArray) {
6032
- if (__privateGet$e(this, _field$b).definition.id) {
6033
- __privateGet$e(this, _field$b).properties.possibleValue = arrayOrArray(optionsArray);
6057
+ if (__privateGet$f(this, _field$b).definition.id) {
6058
+ __privateGet$f(this, _field$b).properties.possibleValue = arrayOrArray(optionsArray);
6034
6059
  }
6035
6060
  }
6036
6061
  removeOption(optionValue) {
6037
- if (__privateGet$e(this, _field$b).definition.id) {
6038
- arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue).filter(
6062
+ if (__privateGet$f(this, _field$b).definition.id) {
6063
+ arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue).filter(
6039
6064
  (c) => c.value !== optionValue
6040
6065
  );
6041
6066
  }
6042
6067
  }
6043
6068
  // get selected option either as array or object key/value
6044
6069
  getSelectedOption(asObject) {
6045
- const arr = arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue);
6046
- if (__privateGet$e(this, _field$b).definition.id) {
6070
+ const arr = arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue);
6071
+ if (__privateGet$f(this, _field$b).definition.id) {
6047
6072
  if (asObject) {
6048
6073
  let obj = null;
6049
6074
  arr.forEach((c) => {
@@ -6059,8 +6084,8 @@ class SelectField extends ApiaFieldWithAttribute {
6059
6084
  return null;
6060
6085
  }
6061
6086
  getSelectedText() {
6062
- if (__privateGet$e(this, _field$b).definition.id) {
6063
- return arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue).find(
6087
+ if (__privateGet$f(this, _field$b).definition.id) {
6088
+ return arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue).find(
6064
6089
  (c) => c.selected
6065
6090
  )?.label ?? "Not option selected";
6066
6091
  }
@@ -6068,8 +6093,8 @@ class SelectField extends ApiaFieldWithAttribute {
6068
6093
  }
6069
6094
  // // remove all select options
6070
6095
  clearOptions() {
6071
- if (__privateGet$e(this, _field$b).definition.id) {
6072
- arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue).forEach(
6096
+ if (__privateGet$f(this, _field$b).definition.id) {
6097
+ arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue).forEach(
6073
6098
  (c) => c.selected = false
6074
6099
  );
6075
6100
  }
@@ -6077,21 +6102,21 @@ class SelectField extends ApiaFieldWithAttribute {
6077
6102
  }
6078
6103
  _field$b = new WeakMap();
6079
6104
 
6080
- var __accessCheck$d = (obj, member, msg) => {
6105
+ var __accessCheck$e = (obj, member, msg) => {
6081
6106
  if (!member.has(obj))
6082
6107
  throw TypeError("Cannot " + msg);
6083
6108
  };
6084
- var __privateGet$d = (obj, member, getter) => {
6085
- __accessCheck$d(obj, member, "read from private field");
6109
+ var __privateGet$e = (obj, member, getter) => {
6110
+ __accessCheck$e(obj, member, "read from private field");
6086
6111
  return getter ? getter.call(obj) : member.get(obj);
6087
6112
  };
6088
- var __privateAdd$d = (obj, member, value) => {
6113
+ var __privateAdd$e = (obj, member, value) => {
6089
6114
  if (member.has(obj))
6090
6115
  throw TypeError("Cannot add the same private member more than once");
6091
6116
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6092
6117
  };
6093
- var __privateSet$d = (obj, member, value, setter) => {
6094
- __accessCheck$d(obj, member, "write to private field");
6118
+ var __privateSet$e = (obj, member, value, setter) => {
6119
+ __accessCheck$e(obj, member, "write to private field");
6095
6120
  member.set(obj, value);
6096
6121
  return value;
6097
6122
  };
@@ -6099,37 +6124,37 @@ var _field$a;
6099
6124
  class InputField extends ApiaFieldWithAttribute {
6100
6125
  constructor(execution, field) {
6101
6126
  super(execution, field);
6102
- __privateAdd$d(this, _field$a, void 0);
6103
- __privateSet$d(this, _field$a, field);
6127
+ __privateAdd$e(this, _field$a, void 0);
6128
+ __privateSet$e(this, _field$a, field);
6104
6129
  }
6105
6130
  getObjectValue() {
6106
- return __privateGet$d(this, _field$a).getValue();
6131
+ return __privateGet$e(this, _field$a).getValue();
6107
6132
  }
6108
6133
  setValue(v) {
6109
- if (__privateGet$d(this, _field$a).attribute.valueType === "D") {
6110
- __privateGet$d(this, _field$a).setValue(v, { format: "d/m/Y" });
6134
+ if (__privateGet$e(this, _field$a).attribute.valueType === "D") {
6135
+ __privateGet$e(this, _field$a).setValue(v, { format: "d/m/Y" });
6111
6136
  } else {
6112
- __privateGet$d(this, _field$a).setValue(v);
6137
+ __privateGet$e(this, _field$a).setValue(v);
6113
6138
  }
6114
6139
  }
6115
6140
  }
6116
6141
  _field$a = new WeakMap();
6117
6142
 
6118
- var __accessCheck$c = (obj, member, msg) => {
6143
+ var __accessCheck$d = (obj, member, msg) => {
6119
6144
  if (!member.has(obj))
6120
6145
  throw TypeError("Cannot " + msg);
6121
6146
  };
6122
- var __privateGet$c = (obj, member, getter) => {
6123
- __accessCheck$c(obj, member, "read from private field");
6147
+ var __privateGet$d = (obj, member, getter) => {
6148
+ __accessCheck$d(obj, member, "read from private field");
6124
6149
  return getter ? getter.call(obj) : member.get(obj);
6125
6150
  };
6126
- var __privateAdd$c = (obj, member, value) => {
6151
+ var __privateAdd$d = (obj, member, value) => {
6127
6152
  if (member.has(obj))
6128
6153
  throw TypeError("Cannot add the same private member more than once");
6129
6154
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6130
6155
  };
6131
- var __privateSet$c = (obj, member, value, setter) => {
6132
- __accessCheck$c(obj, member, "write to private field");
6156
+ var __privateSet$d = (obj, member, value, setter) => {
6157
+ __accessCheck$d(obj, member, "write to private field");
6133
6158
  member.set(obj, value);
6134
6159
  return value;
6135
6160
  };
@@ -6137,11 +6162,11 @@ var _field$9;
6137
6162
  class TreeField extends ApiaFieldWithAttribute {
6138
6163
  constructor(execution, field) {
6139
6164
  super(execution, field);
6140
- __privateAdd$c(this, _field$9, void 0);
6141
- __privateSet$c(this, _field$9, field);
6165
+ __privateAdd$d(this, _field$9, void 0);
6166
+ __privateSet$d(this, _field$9, field);
6142
6167
  }
6143
6168
  setValue(v) {
6144
- __privateGet$c(this, _field$9).setValue(arrayOrArray(v));
6169
+ __privateGet$d(this, _field$9).setValue(arrayOrArray(v));
6145
6170
  }
6146
6171
  }
6147
6172
  _field$9 = new WeakMap();
@@ -6164,21 +6189,21 @@ class CheckField extends ApiaFieldWithAttribute {
6164
6189
  }
6165
6190
  }
6166
6191
 
6167
- var __accessCheck$b = (obj, member, msg) => {
6192
+ var __accessCheck$c = (obj, member, msg) => {
6168
6193
  if (!member.has(obj))
6169
6194
  throw TypeError("Cannot " + msg);
6170
6195
  };
6171
- var __privateGet$b = (obj, member, getter) => {
6172
- __accessCheck$b(obj, member, "read from private field");
6196
+ var __privateGet$c = (obj, member, getter) => {
6197
+ __accessCheck$c(obj, member, "read from private field");
6173
6198
  return member.get(obj);
6174
6199
  };
6175
- var __privateAdd$b = (obj, member, value) => {
6200
+ var __privateAdd$c = (obj, member, value) => {
6176
6201
  if (member.has(obj))
6177
6202
  throw TypeError("Cannot add the same private member more than once");
6178
6203
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6179
6204
  };
6180
- var __privateSet$b = (obj, member, value, setter) => {
6181
- __accessCheck$b(obj, member, "write to private field");
6205
+ var __privateSet$c = (obj, member, value, setter) => {
6206
+ __accessCheck$c(obj, member, "write to private field");
6182
6207
  member.set(obj, value);
6183
6208
  return value;
6184
6209
  };
@@ -6186,12 +6211,12 @@ var _field$8;
6186
6211
  class RadioField extends ApiaFieldWithAttribute {
6187
6212
  constructor(execution, field) {
6188
6213
  super(execution, field);
6189
- __privateAdd$b(this, _field$8, void 0);
6190
- __privateSet$b(this, _field$8, field);
6214
+ __privateAdd$c(this, _field$8, void 0);
6215
+ __privateSet$c(this, _field$8, field);
6191
6216
  }
6192
6217
  getOptions(asObject) {
6193
- if (__privateGet$b(this, _field$8).definition.id) {
6194
- const radioValues = arrayOrArray(__privateGet$b(this, _field$8).properties.possibleValue);
6218
+ if (__privateGet$c(this, _field$8).definition.id) {
6219
+ const radioValues = arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue);
6195
6220
  if (asObject) {
6196
6221
  const options = /* @__PURE__ */ new Map();
6197
6222
  radioValues.forEach((c) => options.set(String(c.value), c));
@@ -6202,13 +6227,13 @@ class RadioField extends ApiaFieldWithAttribute {
6202
6227
  return null;
6203
6228
  }
6204
6229
  clearOptions() {
6205
- if (__privateGet$b(this, _field$8).definition.id) {
6206
- __privateGet$b(this, _field$8).properties.possibleValue = [];
6230
+ if (__privateGet$c(this, _field$8).definition.id) {
6231
+ __privateGet$c(this, _field$8).properties.possibleValue = [];
6207
6232
  }
6208
6233
  }
6209
6234
  addOption(radioValue, showValue, allowRepeatedValue) {
6210
- if (__privateGet$b(this, _field$8).definition.id) {
6211
- const radioValues = arrayOrArray(__privateGet$b(this, _field$8).properties.possibleValue);
6235
+ if (__privateGet$c(this, _field$8).definition.id) {
6236
+ const radioValues = arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue);
6212
6237
  const isValueIsRepeated = radioValues.some((c) => {
6213
6238
  return c.value === radioValue.toString();
6214
6239
  });
@@ -6221,19 +6246,19 @@ class RadioField extends ApiaFieldWithAttribute {
6221
6246
  }
6222
6247
  }
6223
6248
  setOptions(options) {
6224
- if (__privateGet$b(this, _field$8).definition.id) {
6225
- __privateGet$b(this, _field$8).properties.possibleValue = options;
6249
+ if (__privateGet$c(this, _field$8).definition.id) {
6250
+ __privateGet$c(this, _field$8).properties.possibleValue = options;
6226
6251
  }
6227
6252
  }
6228
6253
  removeOption(radioValue) {
6229
- if (__privateGet$b(this, _field$8).definition.id) {
6230
- arrayOrArray(__privateGet$b(this, _field$8).properties.possibleValue).filter(
6254
+ if (__privateGet$c(this, _field$8).definition.id) {
6255
+ arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue).filter(
6231
6256
  (c) => c.value !== radioValue
6232
6257
  );
6233
6258
  }
6234
6259
  }
6235
6260
  getSelectedOption(asObject) {
6236
- const radioValues = arrayOrArray(__privateGet$b(this, _field$8).properties.possibleValue);
6261
+ const radioValues = arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue);
6237
6262
  const selected = radioValues.find((c) => c.selected);
6238
6263
  if (!selected)
6239
6264
  return null;
@@ -6246,8 +6271,8 @@ class RadioField extends ApiaFieldWithAttribute {
6246
6271
  }
6247
6272
  }
6248
6273
  getSelectedText() {
6249
- if (__privateGet$b(this, _field$8).definition.id) {
6250
- const possibleValue = arrayOrArray(__privateGet$b(this, _field$8).properties.possibleValue);
6274
+ if (__privateGet$c(this, _field$8).definition.id) {
6275
+ const possibleValue = arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue);
6251
6276
  if (possibleValue) {
6252
6277
  return possibleValue.find((c) => c.selected)?.label;
6253
6278
  }
@@ -6257,21 +6282,21 @@ class RadioField extends ApiaFieldWithAttribute {
6257
6282
  }
6258
6283
  _field$8 = new WeakMap();
6259
6284
 
6260
- var __accessCheck$a = (obj, member, msg) => {
6285
+ var __accessCheck$b = (obj, member, msg) => {
6261
6286
  if (!member.has(obj))
6262
6287
  throw TypeError("Cannot " + msg);
6263
6288
  };
6264
- var __privateGet$a = (obj, member, getter) => {
6265
- __accessCheck$a(obj, member, "read from private field");
6289
+ var __privateGet$b = (obj, member, getter) => {
6290
+ __accessCheck$b(obj, member, "read from private field");
6266
6291
  return member.get(obj);
6267
6292
  };
6268
- var __privateAdd$a = (obj, member, value) => {
6293
+ var __privateAdd$b = (obj, member, value) => {
6269
6294
  if (member.has(obj))
6270
6295
  throw TypeError("Cannot add the same private member more than once");
6271
6296
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6272
6297
  };
6273
- var __privateSet$a = (obj, member, value, setter) => {
6274
- __accessCheck$a(obj, member, "write to private field");
6298
+ var __privateSet$b = (obj, member, value, setter) => {
6299
+ __accessCheck$b(obj, member, "write to private field");
6275
6300
  member.set(obj, value);
6276
6301
  return value;
6277
6302
  };
@@ -6279,13 +6304,13 @@ var _field$7;
6279
6304
  class MultipleField extends ApiaFieldWithAttribute {
6280
6305
  constructor(execution, field) {
6281
6306
  super(execution, field);
6282
- __privateAdd$a(this, _field$7, void 0);
6283
- __privateSet$a(this, _field$7, field);
6307
+ __privateAdd$b(this, _field$7, void 0);
6308
+ __privateSet$b(this, _field$7, field);
6284
6309
  }
6285
6310
  addOption(optionValue, showValue, allowRepeatedValue) {
6286
6311
  let isValueRepeated = false;
6287
- if (__privateGet$a(this, _field$7).definition.id !== null) {
6288
- if (arrayOrArray(__privateGet$a(this, _field$7).properties.possibleValue).find(
6312
+ if (__privateGet$b(this, _field$7).definition.id !== null) {
6313
+ if (arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue).find(
6289
6314
  (c) => c.value === optionValue
6290
6315
  ) && allowRepeatedValue) {
6291
6316
  isValueRepeated = true;
@@ -6293,28 +6318,28 @@ class MultipleField extends ApiaFieldWithAttribute {
6293
6318
  isValueRepeated = false;
6294
6319
  }
6295
6320
  if (allowRepeatedValue || !isValueRepeated && !allowRepeatedValue)
6296
- arrayOrArray(__privateGet$a(this, _field$7).properties.possibleValue).push({
6321
+ arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue).push({
6297
6322
  value: optionValue,
6298
6323
  label: showValue
6299
6324
  });
6300
6325
  }
6301
6326
  }
6302
6327
  setValue(value) {
6303
- if (__privateGet$a(this, _field$7).definition.id) {
6304
- __privateGet$a(this, _field$7).setValue(value);
6328
+ if (__privateGet$b(this, _field$7).definition.id) {
6329
+ __privateGet$b(this, _field$7).setValue(value);
6305
6330
  }
6306
6331
  }
6307
6332
  clearOptions() {
6308
- if (__privateGet$a(this, _field$7).definition.id) {
6309
- arrayOrArray(__privateGet$a(this, _field$7).properties.possibleValue).forEach(
6333
+ if (__privateGet$b(this, _field$7).definition.id) {
6334
+ arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue).forEach(
6310
6335
  (c) => c.selected = false
6311
6336
  );
6312
6337
  }
6313
6338
  }
6314
6339
  getSelectedOption(asObject) {
6315
- if (__privateGet$a(this, _field$7).definition.id) {
6340
+ if (__privateGet$b(this, _field$7).definition.id) {
6316
6341
  const selected = arrayOrArray(
6317
- __privateGet$a(this, _field$7).properties.possibleValue
6342
+ __privateGet$b(this, _field$7).properties.possibleValue
6318
6343
  ).filter((c) => c.selected);
6319
6344
  if (selected) {
6320
6345
  if (asObject) {
@@ -6328,8 +6353,8 @@ class MultipleField extends ApiaFieldWithAttribute {
6328
6353
  return null;
6329
6354
  }
6330
6355
  getOptions(asObject) {
6331
- if (__privateGet$a(this, _field$7).definition.id) {
6332
- const options = arrayOrArray(__privateGet$a(this, _field$7).properties.possibleValue);
6356
+ if (__privateGet$b(this, _field$7).definition.id) {
6357
+ const options = arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue);
6333
6358
  const obj = /* @__PURE__ */ new Map();
6334
6359
  if (asObject) {
6335
6360
  options.forEach((c) => obj.set(String(c.value), c));
@@ -6340,13 +6365,13 @@ class MultipleField extends ApiaFieldWithAttribute {
6340
6365
  return null;
6341
6366
  }
6342
6367
  setOptions(optionsArray) {
6343
- if (__privateGet$a(this, _field$7).definition.id) {
6344
- __privateGet$a(this, _field$7).properties.possibleValue = arrayOrArray(optionsArray);
6368
+ if (__privateGet$b(this, _field$7).definition.id) {
6369
+ __privateGet$b(this, _field$7).properties.possibleValue = arrayOrArray(optionsArray);
6345
6370
  }
6346
6371
  }
6347
6372
  removeOption(optionValue) {
6348
- if (__privateGet$a(this, _field$7).definition.id) {
6349
- arrayOrArray(__privateGet$a(this, _field$7).properties.possibleValue).filter(
6373
+ if (__privateGet$b(this, _field$7).definition.id) {
6374
+ arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue).filter(
6350
6375
  (c) => c.value !== optionValue
6351
6376
  );
6352
6377
  }
@@ -6360,21 +6385,21 @@ class HiddenField extends ApiaField {
6360
6385
  class AreaField extends ApiaFieldWithAttribute {
6361
6386
  }
6362
6387
 
6363
- var __accessCheck$9 = (obj, member, msg) => {
6388
+ var __accessCheck$a = (obj, member, msg) => {
6364
6389
  if (!member.has(obj))
6365
6390
  throw TypeError("Cannot " + msg);
6366
6391
  };
6367
- var __privateGet$9 = (obj, member, getter) => {
6368
- __accessCheck$9(obj, member, "read from private field");
6392
+ var __privateGet$a = (obj, member, getter) => {
6393
+ __accessCheck$a(obj, member, "read from private field");
6369
6394
  return member.get(obj);
6370
6395
  };
6371
- var __privateAdd$9 = (obj, member, value) => {
6396
+ var __privateAdd$a = (obj, member, value) => {
6372
6397
  if (member.has(obj))
6373
6398
  throw TypeError("Cannot add the same private member more than once");
6374
6399
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6375
6400
  };
6376
- var __privateSet$9 = (obj, member, value, setter) => {
6377
- __accessCheck$9(obj, member, "write to private field");
6401
+ var __privateSet$a = (obj, member, value, setter) => {
6402
+ __accessCheck$a(obj, member, "write to private field");
6378
6403
  member.set(obj, value);
6379
6404
  return value;
6380
6405
  };
@@ -6382,34 +6407,34 @@ var _field$6;
6382
6407
  class ImageField extends ApiaField {
6383
6408
  constructor(execution, field) {
6384
6409
  super(execution, field);
6385
- __privateAdd$9(this, _field$6, void 0);
6386
- __privateSet$9(this, _field$6, field);
6410
+ __privateAdd$a(this, _field$6, void 0);
6411
+ __privateSet$a(this, _field$6, field);
6387
6412
  }
6388
6413
  clearValue() {
6389
- if (__privateGet$9(this, _field$6).definition.id) {
6414
+ if (__privateGet$a(this, _field$6).definition.id) {
6390
6415
  throw new Error(
6391
- `Apia JSApi Error: The Field ${__privateGet$9(this, _field$6).definition.fieldType} does not support this function`
6416
+ `Apia JSApi Error: The Field ${__privateGet$a(this, _field$6).definition.fieldType} does not support this function`
6392
6417
  );
6393
6418
  }
6394
6419
  return null;
6395
6420
  }
6396
6421
  getLabel() {
6397
6422
  throw new Error(
6398
- `Apia JSApi Error: The field ${__privateGet$9(this, _field$6).definition.fieldType} does not use a label`
6423
+ `Apia JSApi Error: The field ${__privateGet$a(this, _field$6).definition.fieldType} does not use a label`
6399
6424
  );
6400
6425
  }
6401
6426
  getValue() {
6402
- if (__privateGet$9(this, _field$6).definition.id) {
6427
+ if (__privateGet$a(this, _field$6).definition.id) {
6403
6428
  throw new Error(
6404
- `Apia JSApi Error: The Field ${__privateGet$9(this, _field$6).definition.fieldType} does not support this function`
6429
+ `Apia JSApi Error: The Field ${__privateGet$a(this, _field$6).definition.fieldType} does not support this function`
6405
6430
  );
6406
6431
  }
6407
6432
  return null;
6408
6433
  }
6409
6434
  setValue() {
6410
- if (__privateGet$9(this, _field$6).definition.id) {
6435
+ if (__privateGet$a(this, _field$6).definition.id) {
6411
6436
  throw new Error(
6412
- `Apia JSApi Error: The Field ${__privateGet$9(this, _field$6).definition.fieldType} does not support this function`
6437
+ `Apia JSApi Error: The Field ${__privateGet$a(this, _field$6).definition.fieldType} does not support this function`
6413
6438
  );
6414
6439
  }
6415
6440
  return null;
@@ -6417,21 +6442,21 @@ class ImageField extends ApiaField {
6417
6442
  }
6418
6443
  _field$6 = new WeakMap();
6419
6444
 
6420
- var __accessCheck$8 = (obj, member, msg) => {
6445
+ var __accessCheck$9 = (obj, member, msg) => {
6421
6446
  if (!member.has(obj))
6422
6447
  throw TypeError("Cannot " + msg);
6423
6448
  };
6424
- var __privateGet$8 = (obj, member, getter) => {
6425
- __accessCheck$8(obj, member, "read from private field");
6449
+ var __privateGet$9 = (obj, member, getter) => {
6450
+ __accessCheck$9(obj, member, "read from private field");
6426
6451
  return member.get(obj);
6427
6452
  };
6428
- var __privateAdd$8 = (obj, member, value) => {
6453
+ var __privateAdd$9 = (obj, member, value) => {
6429
6454
  if (member.has(obj))
6430
6455
  throw TypeError("Cannot add the same private member more than once");
6431
6456
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6432
6457
  };
6433
- var __privateSet$8 = (obj, member, value, setter) => {
6434
- __accessCheck$8(obj, member, "write to private field");
6458
+ var __privateSet$9 = (obj, member, value, setter) => {
6459
+ __accessCheck$9(obj, member, "write to private field");
6435
6460
  member.set(obj, value);
6436
6461
  return value;
6437
6462
  };
@@ -6439,34 +6464,34 @@ var _field$5;
6439
6464
  class LinkField extends ApiaField {
6440
6465
  constructor(execution, field) {
6441
6466
  super(execution, field);
6442
- __privateAdd$8(this, _field$5, void 0);
6443
- __privateSet$8(this, _field$5, field);
6467
+ __privateAdd$9(this, _field$5, void 0);
6468
+ __privateSet$9(this, _field$5, field);
6444
6469
  }
6445
6470
  getLabel() {
6446
- if (__privateGet$8(this, _field$5).definition.fieldType) {
6471
+ if (__privateGet$9(this, _field$5).definition.fieldType) {
6447
6472
  throw new Error(
6448
- `Apia JSApi Error: The field ${__privateGet$8(this, _field$5).definition.fieldType} does not use a label`
6473
+ `Apia JSApi Error: The field ${__privateGet$9(this, _field$5).definition.fieldType} does not use a label`
6449
6474
  );
6450
6475
  }
6451
6476
  }
6452
6477
  }
6453
6478
  _field$5 = new WeakMap();
6454
6479
 
6455
- var __accessCheck$7 = (obj, member, msg) => {
6480
+ var __accessCheck$8 = (obj, member, msg) => {
6456
6481
  if (!member.has(obj))
6457
6482
  throw TypeError("Cannot " + msg);
6458
6483
  };
6459
- var __privateGet$7 = (obj, member, getter) => {
6460
- __accessCheck$7(obj, member, "read from private field");
6484
+ var __privateGet$8 = (obj, member, getter) => {
6485
+ __accessCheck$8(obj, member, "read from private field");
6461
6486
  return getter ? getter.call(obj) : member.get(obj);
6462
6487
  };
6463
- var __privateAdd$7 = (obj, member, value) => {
6488
+ var __privateAdd$8 = (obj, member, value) => {
6464
6489
  if (member.has(obj))
6465
6490
  throw TypeError("Cannot add the same private member more than once");
6466
6491
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6467
6492
  };
6468
- var __privateSet$7 = (obj, member, value, setter) => {
6469
- __accessCheck$7(obj, member, "write to private field");
6493
+ var __privateSet$8 = (obj, member, value, setter) => {
6494
+ __accessCheck$8(obj, member, "write to private field");
6470
6495
  member.set(obj, value);
6471
6496
  return value;
6472
6497
  };
@@ -6474,12 +6499,12 @@ var _field$4;
6474
6499
  class TextField extends ApiaField {
6475
6500
  constructor(execution, field) {
6476
6501
  super(execution, field);
6477
- __privateAdd$7(this, _field$4, void 0);
6478
- __privateSet$7(this, _field$4, field);
6502
+ __privateAdd$8(this, _field$4, void 0);
6503
+ __privateSet$8(this, _field$4, field);
6479
6504
  }
6480
6505
  getLabel() {
6481
6506
  throw new Error(
6482
- `Apia JSApi Error: The field ${__privateGet$7(this, _field$4).definition.fieldType} does not use a label`
6507
+ `Apia JSApi Error: The field ${__privateGet$8(this, _field$4).definition.fieldType} does not use a label`
6483
6508
  );
6484
6509
  }
6485
6510
  setValue(value) {
@@ -6488,35 +6513,35 @@ class TextField extends ApiaField {
6488
6513
  }
6489
6514
  _field$4 = new WeakMap();
6490
6515
 
6491
- var __accessCheck$6 = (obj, member, msg) => {
6516
+ var __accessCheck$7 = (obj, member, msg) => {
6492
6517
  if (!member.has(obj))
6493
6518
  throw TypeError("Cannot " + msg);
6494
6519
  };
6495
- var __privateGet$6 = (obj, member, getter) => {
6496
- __accessCheck$6(obj, member, "read from private field");
6520
+ var __privateGet$7 = (obj, member, getter) => {
6521
+ __accessCheck$7(obj, member, "read from private field");
6497
6522
  return getter ? getter.call(obj) : member.get(obj);
6498
6523
  };
6499
- var __privateAdd$6 = (obj, member, value) => {
6524
+ var __privateAdd$7 = (obj, member, value) => {
6500
6525
  if (member.has(obj))
6501
6526
  throw TypeError("Cannot add the same private member more than once");
6502
6527
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6503
6528
  };
6504
- var __privateSet$6 = (obj, member, value, setter) => {
6505
- __accessCheck$6(obj, member, "write to private field");
6529
+ var __privateSet$7 = (obj, member, value, setter) => {
6530
+ __accessCheck$7(obj, member, "write to private field");
6506
6531
  member.set(obj, value);
6507
6532
  return value;
6508
6533
  };
6509
6534
  var _field$3;
6510
6535
  class CustomComponentField {
6511
6536
  constructor(field) {
6512
- __privateAdd$6(this, _field$3, void 0);
6513
- __privateSet$6(this, _field$3, field);
6537
+ __privateAdd$7(this, _field$3, void 0);
6538
+ __privateSet$7(this, _field$3, field);
6514
6539
  }
6515
6540
  fireEvent(name) {
6516
- __privateGet$6(this, _field$3).fireEvent(name);
6541
+ __privateGet$7(this, _field$3).fireEvent(name);
6517
6542
  }
6518
6543
  getProperty(name) {
6519
- return __privateGet$6(this, _field$3).getProperty(name);
6544
+ return __privateGet$7(this, _field$3).getProperty(name);
6520
6545
  }
6521
6546
  setFocus() {
6522
6547
  throw new Error("Method not implemented.");
@@ -6525,19 +6550,19 @@ class CustomComponentField {
6525
6550
  return false;
6526
6551
  }
6527
6552
  getStringValue(attName) {
6528
- return __privateGet$6(this, _field$3).getStringValue(attName);
6553
+ return __privateGet$7(this, _field$3).getStringValue(attName);
6529
6554
  }
6530
6555
  getValue(attName, index = 0) {
6531
- return __privateGet$6(this, _field$3).getValue(attName, index);
6556
+ return __privateGet$7(this, _field$3).getValue(attName, index);
6532
6557
  }
6533
6558
  setProperty(name, value) {
6534
- __privateGet$6(this, _field$3).setProperty(name, value);
6559
+ __privateGet$7(this, _field$3).setProperty(name, value);
6535
6560
  }
6536
6561
  setStringValue(attName, value) {
6537
- return __privateGet$6(this, _field$3).setStringValue(attName, value);
6562
+ return __privateGet$7(this, _field$3).setStringValue(attName, value);
6538
6563
  }
6539
6564
  setValue(attName, value, index = 0) {
6540
- return __privateGet$6(this, _field$3).setValue(attName, value, index);
6565
+ return __privateGet$7(this, _field$3).setValue(attName, value, index);
6541
6566
  }
6542
6567
  }
6543
6568
  _field$3 = new WeakMap();
@@ -6616,44 +6641,44 @@ var createApiaField = /*#__PURE__*/Object.freeze({
6616
6641
  createNewField: createNewField
6617
6642
  });
6618
6643
 
6619
- var __accessCheck$5 = (obj, member, msg) => {
6644
+ var __accessCheck$6 = (obj, member, msg) => {
6620
6645
  if (!member.has(obj))
6621
6646
  throw TypeError("Cannot " + msg);
6622
6647
  };
6623
- var __privateGet$5 = (obj, member, getter) => {
6624
- __accessCheck$5(obj, member, "read from private field");
6648
+ var __privateGet$6 = (obj, member, getter) => {
6649
+ __accessCheck$6(obj, member, "read from private field");
6625
6650
  return getter ? getter.call(obj) : member.get(obj);
6626
6651
  };
6627
- var __privateAdd$5 = (obj, member, value) => {
6652
+ var __privateAdd$6 = (obj, member, value) => {
6628
6653
  if (member.has(obj))
6629
6654
  throw TypeError("Cannot add the same private member more than once");
6630
6655
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6631
6656
  };
6632
- var __privateSet$5 = (obj, member, value, setter) => {
6633
- __accessCheck$5(obj, member, "write to private field");
6657
+ var __privateSet$6 = (obj, member, value, setter) => {
6658
+ __accessCheck$6(obj, member, "write to private field");
6634
6659
  member.set(obj, value);
6635
6660
  return value;
6636
6661
  };
6637
- var _execution$1, _field$2, _mutex;
6662
+ var _execution$2, _field$2, _mutex;
6638
6663
  class GridField extends ApiaField {
6639
6664
  constructor(execution, field) {
6640
6665
  super(execution, field);
6641
- __privateAdd$5(this, _execution$1, void 0);
6642
- __privateAdd$5(this, _field$2, void 0);
6643
- __privateAdd$5(this, _mutex, new Mutex());
6644
- __privateSet$5(this, _execution$1, execution);
6645
- __privateSet$5(this, _field$2, field);
6666
+ __privateAdd$6(this, _execution$2, void 0);
6667
+ __privateAdd$6(this, _field$2, void 0);
6668
+ __privateAdd$6(this, _mutex, new Mutex());
6669
+ __privateSet$6(this, _execution$2, execution);
6670
+ __privateSet$6(this, _field$2, field);
6646
6671
  }
6647
6672
  async addRow() {
6648
6673
  try {
6649
- await __privateGet$5(this, _mutex).acquire();
6650
- const result = await __privateGet$5(this, _field$2).addRow();
6674
+ await __privateGet$6(this, _mutex).acquire();
6675
+ const result = await __privateGet$6(this, _field$2).addRow();
6651
6676
  if (result) {
6652
- return this.getRow(__privateGet$5(this, _field$2).finalIndex);
6677
+ return this.getRow(__privateGet$6(this, _field$2).finalIndex);
6653
6678
  }
6654
6679
  return [];
6655
6680
  } finally {
6656
- __privateGet$5(this, _mutex).release();
6681
+ __privateGet$6(this, _mutex).release();
6657
6682
  }
6658
6683
  }
6659
6684
  clearGrid() {
@@ -6664,8 +6689,8 @@ class GridField extends ApiaField {
6664
6689
  }
6665
6690
  async clearRow(index) {
6666
6691
  try {
6667
- await __privateGet$5(this, _mutex).acquire();
6668
- const row = __privateGet$5(this, _field$2).getRowByFieldIndex(index);
6692
+ await __privateGet$6(this, _mutex).acquire();
6693
+ const row = __privateGet$6(this, _field$2).getRowByFieldIndex(index);
6669
6694
  if (!row) {
6670
6695
  throw new Error(`Row ${index} not found`);
6671
6696
  }
@@ -6674,19 +6699,19 @@ class GridField extends ApiaField {
6674
6699
  c.state.value = "";
6675
6700
  });
6676
6701
  } finally {
6677
- __privateGet$5(this, _mutex).release();
6702
+ __privateGet$6(this, _mutex).release();
6678
6703
  }
6679
6704
  }
6680
6705
  closeForm() {
6681
- __privateGet$5(this, _field$2).closeEditionModal();
6706
+ __privateGet$6(this, _field$2).closeEditionModal();
6682
6707
  return this;
6683
6708
  }
6684
6709
  async deleteAllRows() {
6685
6710
  try {
6686
- await __privateGet$5(this, _mutex).acquire();
6687
- await __privateGet$5(this, _field$2).deleteAllRows();
6711
+ await __privateGet$6(this, _mutex).acquire();
6712
+ await __privateGet$6(this, _field$2).deleteAllRows();
6688
6713
  } finally {
6689
- __privateGet$5(this, _mutex).release();
6714
+ __privateGet$6(this, _mutex).release();
6690
6715
  }
6691
6716
  }
6692
6717
  async deleteGrid() {
@@ -6697,62 +6722,62 @@ class GridField extends ApiaField {
6697
6722
  }
6698
6723
  async deleteRow(index) {
6699
6724
  try {
6700
- await __privateGet$5(this, _mutex).acquire();
6701
- __privateGet$5(this, _field$2).deleteRows(index);
6725
+ await __privateGet$6(this, _mutex).acquire();
6726
+ __privateGet$6(this, _field$2).deleteRows(index);
6702
6727
  } finally {
6703
- __privateGet$5(this, _mutex).release();
6728
+ __privateGet$6(this, _mutex).release();
6704
6729
  }
6705
6730
  }
6706
6731
  editRow(index) {
6707
- getWindow(__privateGet$5(this, _execution$1)).dispatchEvent(
6732
+ getWindow(__privateGet$6(this, _execution$2)).dispatchEvent(
6708
6733
  new CustomEvent("openGridEdition", {
6709
- detail: { index, grid: __privateGet$5(this, _field$2) }
6734
+ detail: { index, grid: __privateGet$6(this, _field$2) }
6710
6735
  })
6711
6736
  );
6712
6737
  }
6713
6738
  getAllColumns() {
6714
- return __privateGet$5(this, _field$2).getAllColumns().map(
6715
- (c) => c.map((f) => createNewField(__privateGet$5(this, _field$2).getForm().execution, f))
6739
+ return __privateGet$6(this, _field$2).getAllColumns().map(
6740
+ (c) => c.map((f) => createNewField(__privateGet$6(this, _field$2).getForm().execution, f))
6716
6741
  );
6717
6742
  }
6718
6743
  getColumn(fieldName) {
6719
- const fields = __privateGet$5(this, _field$2).getColumn(fieldName);
6744
+ const fields = __privateGet$6(this, _field$2).getColumn(fieldName);
6720
6745
  if (fields) {
6721
6746
  return arrayOrArray(fields).map(
6722
- (c) => createNewField(__privateGet$5(this, _field$2).getForm().execution, c)
6747
+ (c) => createNewField(__privateGet$6(this, _field$2).getForm().execution, c)
6723
6748
  );
6724
6749
  }
6725
6750
  return [];
6726
6751
  }
6727
6752
  getCurrentPage() {
6728
- return __privateGet$5(this, _field$2).getCurrentPage();
6753
+ return __privateGet$6(this, _field$2).getCurrentPage();
6729
6754
  }
6730
6755
  getField(fieldName, fieldIndex) {
6731
- const fields = __privateGet$5(this, _field$2).getField(fieldName, fieldIndex);
6756
+ const fields = __privateGet$6(this, _field$2).getField(fieldName, fieldIndex);
6732
6757
  if (fields) {
6733
6758
  return fieldIndex !== void 0 ? createNewField(
6734
- __privateGet$5(this, _field$2).getForm().execution,
6759
+ __privateGet$6(this, _field$2).getForm().execution,
6735
6760
  arrayOrArray(fields)[0]
6736
- ) : arrayOrArray(fields).map((c) => createNewField(__privateGet$5(this, _field$2).getForm().execution, c)).filter((c) => Boolean(c));
6761
+ ) : arrayOrArray(fields).map((c) => createNewField(__privateGet$6(this, _field$2).getForm().execution, c)).filter((c) => Boolean(c));
6737
6762
  }
6738
6763
  return null;
6739
6764
  }
6740
6765
  getPageCount() {
6741
- return __privateGet$5(this, _field$2).pageCount;
6766
+ return __privateGet$6(this, _field$2).pageCount;
6742
6767
  }
6743
6768
  getPageSize() {
6744
- return __privateGet$5(this, _field$2).pageSize;
6769
+ return __privateGet$6(this, _field$2).pageSize;
6745
6770
  }
6746
6771
  getRow(index) {
6747
- return __privateGet$5(this, _field$2).getRowByFieldIndex(index)?.map((c) => createNewField(__privateGet$5(this, _field$2).getForm().execution, c));
6772
+ return __privateGet$6(this, _field$2).getRowByFieldIndex(index)?.map((c) => createNewField(__privateGet$6(this, _field$2).getForm().execution, c));
6748
6773
  }
6749
6774
  getSelection() {
6750
- const selected = __privateGet$5(this, _field$2).getSelectedRows();
6775
+ const selected = __privateGet$6(this, _field$2).getSelectedRows();
6751
6776
  const returnObj = [];
6752
6777
  selected.forEach((r) => {
6753
6778
  const row = [];
6754
6779
  r.forEach((c) => {
6755
- const fld = createNewField(__privateGet$5(this, _field$2).getForm().execution, c);
6780
+ const fld = createNewField(__privateGet$6(this, _field$2).getForm().execution, c);
6756
6781
  if (fld) {
6757
6782
  row.push(fld);
6758
6783
  }
@@ -6762,46 +6787,46 @@ class GridField extends ApiaField {
6762
6787
  return returnObj;
6763
6788
  }
6764
6789
  get id() {
6765
- return __privateGet$5(this, _field$2).definition.id;
6790
+ return __privateGet$6(this, _field$2).definition.id;
6766
6791
  }
6767
6792
  isPaged() {
6768
- return __privateGet$5(this, _field$2).properties.paged;
6793
+ return __privateGet$6(this, _field$2).properties.paged;
6769
6794
  }
6770
6795
  get rowsCount() {
6771
- return __privateGet$5(this, _field$2).length;
6796
+ return __privateGet$6(this, _field$2).length;
6772
6797
  }
6773
6798
  toggleColumnVisibility(fieldName, isShown) {
6774
- __privateGet$5(this, _field$2).toggleColumnVisibility(fieldName, isShown);
6799
+ __privateGet$6(this, _field$2).toggleColumnVisibility(fieldName, isShown);
6775
6800
  }
6776
6801
  toggleDeleteButton(index, isShown) {
6777
- __privateGet$5(this, _field$2).toggleDeleteButton(index, isShown);
6802
+ __privateGet$6(this, _field$2).toggleDeleteButton(index, isShown);
6778
6803
  }
6779
6804
  toggleEditFormButton(rowIndex, isShown) {
6780
- __privateGet$5(this, _field$2).toggleEditFormButton(rowIndex, isShown);
6805
+ __privateGet$6(this, _field$2).toggleEditFormButton(rowIndex, isShown);
6781
6806
  }
6782
6807
  }
6783
- _execution$1 = new WeakMap();
6808
+ _execution$2 = new WeakMap();
6784
6809
  _field$2 = new WeakMap();
6785
6810
  _mutex = new WeakMap();
6786
6811
 
6787
6812
  class CaptchaField extends ApiaField {
6788
6813
  }
6789
6814
 
6790
- var __accessCheck$4 = (obj, member, msg) => {
6815
+ var __accessCheck$5 = (obj, member, msg) => {
6791
6816
  if (!member.has(obj))
6792
6817
  throw TypeError("Cannot " + msg);
6793
6818
  };
6794
- var __privateGet$4 = (obj, member, getter) => {
6795
- __accessCheck$4(obj, member, "read from private field");
6819
+ var __privateGet$5 = (obj, member, getter) => {
6820
+ __accessCheck$5(obj, member, "read from private field");
6796
6821
  return getter ? getter.call(obj) : member.get(obj);
6797
6822
  };
6798
- var __privateAdd$4 = (obj, member, value) => {
6823
+ var __privateAdd$5 = (obj, member, value) => {
6799
6824
  if (member.has(obj))
6800
6825
  throw TypeError("Cannot add the same private member more than once");
6801
6826
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6802
6827
  };
6803
- var __privateSet$4 = (obj, member, value, setter) => {
6804
- __accessCheck$4(obj, member, "write to private field");
6828
+ var __privateSet$5 = (obj, member, value, setter) => {
6829
+ __accessCheck$5(obj, member, "write to private field");
6805
6830
  member.set(obj, value);
6806
6831
  return value;
6807
6832
  };
@@ -6809,24 +6834,24 @@ var _field$1;
6809
6834
  class FileUploaderField extends ApiaFieldWithAttribute {
6810
6835
  constructor(execution, field) {
6811
6836
  super(execution, field);
6812
- __privateAdd$4(this, _field$1, void 0);
6813
- __privateSet$4(this, _field$1, field);
6837
+ __privateAdd$5(this, _field$1, void 0);
6838
+ __privateSet$5(this, _field$1, field);
6814
6839
  }
6815
6840
  onChange(cb) {
6816
6841
  reaction(
6817
6842
  () => {
6818
- __privateGet$4(this, _field$1).getValue();
6843
+ __privateGet$5(this, _field$1).getValue();
6819
6844
  },
6820
6845
  () => {
6821
- cb(__privateGet$4(this, _field$1).getValue());
6846
+ cb(__privateGet$5(this, _field$1).getValue());
6822
6847
  },
6823
6848
  { fireImmediately: false }
6824
6849
  );
6825
6850
  }
6826
6851
  setValue() {
6827
- if (__privateGet$4(this, _field$1).definition.id && __privateGet$4(this, _field$1).definition.fieldType) {
6852
+ if (__privateGet$5(this, _field$1).definition.id && __privateGet$5(this, _field$1).definition.fieldType) {
6828
6853
  throw new Error(
6829
- `Apia JSApi Error: The Field ${__privateGet$4(this, _field$1).definition.fieldType} does not support this function`
6854
+ `Apia JSApi Error: The Field ${__privateGet$5(this, _field$1).definition.fieldType} does not support this function`
6830
6855
  );
6831
6856
  }
6832
6857
  return null;
@@ -6837,21 +6862,21 @@ _field$1 = new WeakMap();
6837
6862
  class PasswordField extends ApiaField {
6838
6863
  }
6839
6864
 
6840
- var __accessCheck$3 = (obj, member, msg) => {
6865
+ var __accessCheck$4 = (obj, member, msg) => {
6841
6866
  if (!member.has(obj))
6842
6867
  throw TypeError("Cannot " + msg);
6843
6868
  };
6844
- var __privateGet$3 = (obj, member, getter) => {
6845
- __accessCheck$3(obj, member, "read from private field");
6869
+ var __privateGet$4 = (obj, member, getter) => {
6870
+ __accessCheck$4(obj, member, "read from private field");
6846
6871
  return getter ? getter.call(obj) : member.get(obj);
6847
6872
  };
6848
- var __privateAdd$3 = (obj, member, value) => {
6873
+ var __privateAdd$4 = (obj, member, value) => {
6849
6874
  if (member.has(obj))
6850
6875
  throw TypeError("Cannot add the same private member more than once");
6851
6876
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6852
6877
  };
6853
- var __privateSet$3 = (obj, member, value, setter) => {
6854
- __accessCheck$3(obj, member, "write to private field");
6878
+ var __privateSet$4 = (obj, member, value, setter) => {
6879
+ __accessCheck$4(obj, member, "write to private field");
6855
6880
  member.set(obj, value);
6856
6881
  return value;
6857
6882
  };
@@ -6859,96 +6884,96 @@ var _field;
6859
6884
  class ModalInputField extends ApiaFieldWithAttribute {
6860
6885
  constructor(execution, field) {
6861
6886
  super(execution, field);
6862
- __privateAdd$3(this, _field, void 0);
6863
- __privateSet$3(this, _field, field);
6887
+ __privateAdd$4(this, _field, void 0);
6888
+ __privateSet$4(this, _field, field);
6864
6889
  }
6865
6890
  getObjectValue() {
6866
- return __privateGet$3(this, _field).getValue();
6891
+ return __privateGet$4(this, _field).getValue();
6867
6892
  }
6868
6893
  setValue(v) {
6869
- __privateGet$3(this, _field).setValue(v);
6894
+ __privateGet$4(this, _field).setValue(v);
6870
6895
  }
6871
6896
  async setValueFromInputWrite(value) {
6872
- await __privateGet$3(this, _field).setValueFromInputWrite(value);
6897
+ await __privateGet$4(this, _field).setValueFromInputWrite(value);
6873
6898
  }
6874
6899
  }
6875
6900
  _field = new WeakMap();
6876
6901
 
6877
- var __accessCheck$2 = (obj, member, msg) => {
6902
+ var __accessCheck$3 = (obj, member, msg) => {
6878
6903
  if (!member.has(obj))
6879
6904
  throw TypeError("Cannot " + msg);
6880
6905
  };
6881
- var __privateGet$2 = (obj, member, getter) => {
6882
- __accessCheck$2(obj, member, "read from private field");
6906
+ var __privateGet$3 = (obj, member, getter) => {
6907
+ __accessCheck$3(obj, member, "read from private field");
6883
6908
  return getter ? getter.call(obj) : member.get(obj);
6884
6909
  };
6885
- var __privateAdd$2 = (obj, member, value) => {
6910
+ var __privateAdd$3 = (obj, member, value) => {
6886
6911
  if (member.has(obj))
6887
6912
  throw TypeError("Cannot add the same private member more than once");
6888
6913
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6889
6914
  };
6890
- var __privateSet$2 = (obj, member, value, setter) => {
6891
- __accessCheck$2(obj, member, "write to private field");
6915
+ var __privateSet$3 = (obj, member, value, setter) => {
6916
+ __accessCheck$3(obj, member, "write to private field");
6892
6917
  member.set(obj, value);
6893
6918
  return value;
6894
6919
  };
6895
- var _form, _execution;
6920
+ var _form, _execution$1;
6896
6921
  class ApiaForm {
6897
6922
  constructor(execution, form) {
6898
- __privateAdd$2(this, _form, void 0);
6899
- __privateAdd$2(this, _execution, void 0);
6900
- __privateSet$2(this, _form, form);
6901
- __privateSet$2(this, _execution, execution);
6923
+ __privateAdd$3(this, _form, void 0);
6924
+ __privateAdd$3(this, _execution$1, void 0);
6925
+ __privateSet$3(this, _form, form);
6926
+ __privateSet$3(this, _execution$1, execution);
6902
6927
  }
6903
6928
  getFrmParent() {
6904
- return __privateGet$2(this, _form).definition.frmParent;
6929
+ return __privateGet$3(this, _form).definition.frmParent;
6905
6930
  }
6906
6931
  getFrmId() {
6907
- return __privateGet$2(this, _form).definition.id;
6932
+ return __privateGet$3(this, _form).definition.id;
6908
6933
  }
6909
6934
  getFormName() {
6910
- return __privateGet$2(this, _form).definition.formName;
6935
+ return __privateGet$3(this, _form).definition.formName;
6911
6936
  }
6912
6937
  getFormTitle() {
6913
- return __privateGet$2(this, _form).definition.formTitle;
6938
+ return __privateGet$3(this, _form).definition.formTitle;
6914
6939
  }
6915
6940
  openForm() {
6916
- __privateGet$2(this, _form).setProperty("prpFrmClosed", false);
6941
+ __privateGet$3(this, _form).setProperty("prpFrmClosed", false);
6917
6942
  }
6918
6943
  closeForm() {
6919
- __privateGet$2(this, _form).setProperty("prpFrmClosed", true);
6944
+ __privateGet$3(this, _form).setProperty("prpFrmClosed", true);
6920
6945
  }
6921
6946
  getProperty(name) {
6922
- return __privateGet$2(this, _form).getProperty(name);
6947
+ return __privateGet$3(this, _form).getProperty(name);
6923
6948
  }
6924
6949
  setProperty(name, value) {
6925
6950
  if (name === "readOnly") {
6926
6951
  throw new Error("Cannot update readonly property on forms");
6927
6952
  }
6928
- __privateGet$2(this, _form).setProperty(name, value);
6953
+ __privateGet$3(this, _form).setProperty(name, value);
6929
6954
  }
6930
6955
  getCustomComponent(attName) {
6931
- return __privateGet$2(this, _form).getCustomComponentByAttName(attName);
6956
+ return __privateGet$3(this, _form).getCustomComponentByAttName(attName);
6932
6957
  }
6933
6958
  getField(fld, index) {
6934
- const field = __privateGet$2(this, _form).getField(fld, index);
6959
+ const field = __privateGet$3(this, _form).getField(fld, index);
6935
6960
  if (field) {
6936
- return createNewField(__privateGet$2(this, _execution), field);
6961
+ return createNewField(__privateGet$3(this, _execution$1), field);
6937
6962
  }
6938
6963
  return void 0;
6939
6964
  }
6940
6965
  getFieldById(fldId) {
6941
- const field = __privateGet$2(this, _form).getFieldById(fldId);
6966
+ const field = __privateGet$3(this, _form).getFieldById(fldId);
6942
6967
  if (field) {
6943
- return createNewField(__privateGet$2(this, _execution), field);
6968
+ return createNewField(__privateGet$3(this, _execution$1), field);
6944
6969
  }
6945
6970
  return void 0;
6946
6971
  }
6947
6972
  getFieldColumn(name) {
6948
- return arrayOrArray(__privateGet$2(this, _form).getFieldByName(name)).map((c) => createNewField(__privateGet$2(this, _execution), c)).filter((f) => Boolean(f));
6973
+ return arrayOrArray(__privateGet$3(this, _form).getFieldByName(name)).map((c) => createNewField(__privateGet$3(this, _execution$1), c)).filter((f) => Boolean(f));
6949
6974
  }
6950
6975
  getAllFields() {
6951
- return __privateGet$2(this, _form).allFields.map((c) => createNewField(__privateGet$2(this, _execution), c)).filter((f) => Boolean(f));
6976
+ return __privateGet$3(this, _form).allFields.map((c) => createNewField(__privateGet$3(this, _execution$1), c)).filter((f) => Boolean(f));
6952
6977
  }
6953
6978
  clearForm(clearReadonlyFields, deleteGridsRows) {
6954
6979
  this.getAllFields().forEach((c) => {
@@ -6962,17 +6987,39 @@ class ApiaForm {
6962
6987
  }
6963
6988
  });
6964
6989
  }
6990
+ hideModal() {
6991
+ __privateGet$3(this, _execution$1).emit("hideFormModal", __privateGet$3(this, _form));
6992
+ }
6993
+ showAsModal() {
6994
+ __privateGet$3(this, _execution$1).emit("showFormAsModal", __privateGet$3(this, _form));
6995
+ }
6965
6996
  }
6966
6997
  _form = new WeakMap();
6967
- _execution = new WeakMap();
6998
+ _execution$1 = new WeakMap();
6968
6999
 
6969
- const OptionButton = {
6970
- BTN_VIEW_DOCS: 100,
6971
- BTN_PRINT: 101
7000
+ var __accessCheck$2 = (obj, member, msg) => {
7001
+ if (!member.has(obj))
7002
+ throw TypeError("Cannot " + msg);
7003
+ };
7004
+ var __privateGet$2 = (obj, member, getter) => {
7005
+ __accessCheck$2(obj, member, "read from private field");
7006
+ return getter ? getter.call(obj) : member.get(obj);
6972
7007
  };
7008
+ var __privateAdd$2 = (obj, member, value) => {
7009
+ if (member.has(obj))
7010
+ throw TypeError("Cannot add the same private member more than once");
7011
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
7012
+ };
7013
+ var __privateSet$2 = (obj, member, value, setter) => {
7014
+ __accessCheck$2(obj, member, "write to private field");
7015
+ member.set(obj, value);
7016
+ return value;
7017
+ };
7018
+ var _execution;
6973
7019
  class ApiaFunctions {
6974
7020
  constructor(execution) {
6975
- this.execution = execution;
7021
+ __privateAdd$2(this, _execution, void 0);
7022
+ __privateSet$2(this, _execution, execution);
6976
7023
  }
6977
7024
  toJSNumber(_value) {
6978
7025
  throw new Error("Deprecated, use ApiaUtil instead.");
@@ -6990,15 +7037,11 @@ class ApiaFunctions {
6990
7037
  throw new Error("Deprecated, use ApiaUtil instead.");
6991
7038
  }
6992
7039
  getFormByType(frmName, frmType) {
6993
- const form = this.execution.getFormByName(frmName, frmType);
7040
+ const form = __privateGet$2(this, _execution).getFormByName(frmName, frmType);
6994
7041
  if (form)
6995
- return new ApiaForm(this.execution, form);
7042
+ return new ApiaForm(__privateGet$2(this, _execution), form);
6996
7043
  return null;
6997
7044
  }
6998
- actionButton(id) {
6999
- const actualId = this.getButtonAction(id);
7000
- return ActionsController.instance.getButton(actualId);
7001
- }
7002
7045
  admEntity(entName, entNum, parameters, width, height) {
7003
7046
  }
7004
7047
  clearMessages() {
@@ -7007,56 +7050,50 @@ class ApiaFunctions {
7007
7050
  const id = Number(button);
7008
7051
  switch (id) {
7009
7052
  case ActionsController.CONFIRM:
7010
- this.execution.confirm();
7053
+ __privateGet$2(this, _execution).flow.confirm();
7011
7054
  break;
7012
7055
  case ActionsController.NEXT:
7013
- this.execution.next();
7056
+ __privateGet$2(this, _execution).flow.next();
7014
7057
  break;
7015
7058
  case ActionsController.PREVIOUS:
7016
- this.execution.doBack();
7059
+ __privateGet$2(this, _execution).flow.back();
7017
7060
  break;
7018
7061
  case ActionsController.SAVE:
7019
- this.execution.doSave();
7062
+ __privateGet$2(this, _execution).flow.save();
7020
7063
  break;
7021
7064
  case ActionsController.RELEASE:
7022
- this.execution.doFree();
7065
+ __privateGet$2(this, _execution).flow.release();
7023
7066
  break;
7024
7067
  case ActionsController.DELEGATE:
7025
- this.execution.delegate();
7068
+ __privateGet$2(this, _execution).flow.delegate();
7026
7069
  break;
7027
7070
  case ActionsController.SHARE:
7028
- this.execution.shareSocial();
7071
+ __privateGet$2(this, _execution).flow.share();
7072
+ break;
7073
+ case ActionsController.VIEW_DOCS:
7074
+ __privateGet$2(this, _execution).flow.viewDocs();
7029
7075
  break;
7030
- case OptionButton.BTN_VIEW_DOCS:
7031
- this.execution.viewDocs();
7076
+ case ActionsController.PRINT:
7077
+ __privateGet$2(this, _execution).flow.print();
7032
7078
  break;
7033
- case OptionButton.BTN_PRINT:
7034
- this.execution.doPrint();
7079
+ case ActionsController.SEND_TO_DESK:
7080
+ __privateGet$2(this, _execution).sendToDesktop();
7035
7081
  break;
7036
- default:
7037
- return;
7038
7082
  }
7039
7083
  }
7040
7084
  disableActionButton(id) {
7041
- const actualId = this.getButtonAction(id);
7042
- this.actionButton(actualId)?.disable();
7043
- }
7044
- disableOptionButton(id) {
7045
- this.disableActionButton(id);
7085
+ ActionsController.instance.disable(id);
7046
7086
  }
7047
7087
  enableActionButton(id) {
7048
- this.actionButton(id)?.enable();
7049
- }
7050
- enableOptionButton(id) {
7051
- this.enableActionButton(id);
7088
+ ActionsController.instance.enable(id);
7052
7089
  }
7053
7090
  getAllForms() {
7054
- return this.execution.getAllForms().map((c) => new ApiaForm(this.execution, c));
7091
+ return __privateGet$2(this, _execution).getAllForms().map((c) => new ApiaForm(__privateGet$2(this, _execution), c));
7055
7092
  }
7056
7093
  getAllFormsByType(type) {
7057
- return this.execution.getAllForms().reduce((acc, c) => {
7094
+ return __privateGet$2(this, _execution).getAllForms().reduce((acc, c) => {
7058
7095
  if (c.definition.frmParent === type) {
7059
- acc.push(new ApiaForm(this.execution, c));
7096
+ acc.push(new ApiaForm(__privateGet$2(this, _execution), c));
7060
7097
  }
7061
7098
  return acc;
7062
7099
  }, []);
@@ -7068,58 +7105,17 @@ class ApiaFunctions {
7068
7105
  );
7069
7106
  return fields;
7070
7107
  }
7071
- getButtonAction(id) {
7072
- let btnId;
7073
- switch (id) {
7074
- case ActionsController.CLOSE:
7075
- btnId = "btnClose";
7076
- break;
7077
- case ActionsController.CONFIRM:
7078
- btnId = "btnCon";
7079
- break;
7080
- case ActionsController.DELEGATE:
7081
- btnId = "lblExeDelegar";
7082
- break;
7083
- case ActionsController.NEXT:
7084
- btnId = "btnSig";
7085
- break;
7086
- case ActionsController.PREVIOUS:
7087
- btnId = "btnAnt";
7088
- break;
7089
- case ActionsController.PRINT:
7090
- btnId = "btnStaPri";
7091
- break;
7092
- case ActionsController.RELEASE:
7093
- btnId = "btnEjeLib";
7094
- break;
7095
- case ActionsController.SAVE:
7096
- btnId = "btnGua";
7097
- break;
7098
- case ActionsController.SIGN:
7099
- btnId = "btnSig";
7100
- break;
7101
- case ActionsController.SHARE:
7102
- btnId = "lblShareMsg";
7103
- break;
7104
- case ActionsController.VIEW_DOCS:
7105
- btnId = "sbtEjeDoc";
7106
- break;
7107
- default:
7108
- throw new Error(`There is no button with id ${id}`);
7109
- }
7110
- return btnId;
7111
- }
7112
7108
  getCurrentLanguageCode() {
7113
- return getWindow(this.execution).LANG_CODE;
7109
+ return getWindow(__privateGet$2(this, _execution)).LANG_CODE;
7114
7110
  }
7115
7111
  getCurrentProcessName() {
7116
- return this.execution.environment.properties?.processName ?? "";
7112
+ return __privateGet$2(this, _execution).environment.properties?.processName ?? "";
7117
7113
  }
7118
7114
  getCurrentStep() {
7119
- return this.execution.currentStep;
7115
+ return __privateGet$2(this, _execution).currentStep;
7120
7116
  }
7121
7117
  getCurrentTaskName() {
7122
- return this.execution.environment.properties?.taskName ?? "";
7118
+ return __privateGet$2(this, _execution).environment.properties?.taskName ?? "";
7123
7119
  }
7124
7120
  getEntityForm(frmName) {
7125
7121
  const frm = this.getForm(frmName, "E");
@@ -7140,19 +7136,19 @@ class ApiaFunctions {
7140
7136
  return pForm;
7141
7137
  }
7142
7138
  getLastModalReturn() {
7143
- return this.execution.getLastModalReturn();
7139
+ return __privateGet$2(this, _execution).getLastModalReturn();
7144
7140
  }
7145
7141
  getModalReturn() {
7146
7142
  return this.getLastModalReturn();
7147
7143
  }
7148
7144
  getModalSelectedRow() {
7149
- return this.execution.getLastModalReturn()?.slice(2);
7145
+ return __privateGet$2(this, _execution).getLastModalReturn()?.slice(2);
7150
7146
  }
7151
7147
  getModalShowValue() {
7152
- return this.execution.getLastModalReturn()[1];
7148
+ return __privateGet$2(this, _execution).getLastModalReturn()[1];
7153
7149
  }
7154
7150
  getModalValue() {
7155
- return this.execution.getLastModalReturn()[0];
7151
+ return __privateGet$2(this, _execution).getLastModalReturn()[0];
7156
7152
  }
7157
7153
  getProcessForm(frmName) {
7158
7154
  const frm = this.getForm(frmName, "P");
@@ -7162,7 +7158,7 @@ class ApiaFunctions {
7162
7158
  }
7163
7159
  getRootPath() {
7164
7160
  try {
7165
- return getWindow(this.execution).APIA_ROOT_CONTEXT;
7161
+ return getWindow(__privateGet$2(this, _execution)).APIA_ROOT_CONTEXT;
7166
7162
  } catch (e) {
7167
7163
  if (e instanceof Error) {
7168
7164
  console.error(`Apia JSApi Error: ${e.message}`);
@@ -7171,33 +7167,31 @@ class ApiaFunctions {
7171
7167
  return null;
7172
7168
  }
7173
7169
  hideActionButton(id) {
7174
- this.actionButton(id)?.hide();
7170
+ ActionsController.instance.hide(id);
7171
+ }
7172
+ isActionButtonDisabled(id) {
7173
+ return ActionsController.instance.isDisabled(id);
7175
7174
  }
7176
- hideOptionButton(id) {
7177
- this.hideActionButton(id);
7175
+ isActionButtonHidden(id) {
7176
+ return ActionsController.instance.isHidden(id);
7178
7177
  }
7179
7178
  saveTask() {
7180
- this.execution.doSave().then((res) => {
7181
- if (res)
7182
- console.warn("Manage...");
7183
- });
7179
+ __privateGet$2(this, _execution).flow.save();
7184
7180
  }
7185
7181
  setLastModalReturn(value) {
7186
- getWindow(this.execution).lastModalReturn = value;
7182
+ getWindow(__privateGet$2(this, _execution)).lastModalReturn = value;
7187
7183
  }
7188
7184
  setStepTitle(stepNumber, stepTitle) {
7189
- this.execution.setStepTitle(stepNumber, stepTitle);
7185
+ __privateGet$2(this, _execution).setStepTitle(stepNumber, stepTitle);
7190
7186
  }
7191
7187
  showActionButton(id) {
7192
- this.actionButton(id)?.show();
7193
- }
7194
- showOptionButton(id) {
7195
- this.showActionButton(id);
7188
+ ActionsController.instance.show(id);
7196
7189
  }
7197
7190
  viewAdmEntity(entName, entNum) {
7198
7191
  this.admEntity(entName, entNum);
7199
7192
  }
7200
7193
  }
7194
+ _execution = new WeakMap();
7201
7195
 
7202
7196
  var ApiaFunctions$1 = /*#__PURE__*/Object.freeze({
7203
7197
  __proto__: null,
@@ -7277,7 +7271,9 @@ class CustomComponent {
7277
7271
  }
7278
7272
  }
7279
7273
  arrayOrArray(o.attribute).forEach((c) => {
7280
- this._state.attributes[c.name] = arrayOrArray(JSON.parse(atob(c.values)));
7274
+ this._state.attributes[c.name] = arrayOrArray(
7275
+ JSON.parse(decodeBase64ToUtf8$1(c.values))
7276
+ );
7281
7277
  });
7282
7278
  arrayOrArray(o.property).forEach((c) => {
7283
7279
  this._state.properties[c.name] = c.value;
@@ -7870,26 +7866,31 @@ class Form extends WithProperties {
7870
7866
  (c) => c.evtName === eventName
7871
7867
  );
7872
7868
  if (events.length > 0) {
7873
- for (const event of events) {
7874
- try {
7875
- const fn = getWindow(this.execution)[event.fncName];
7876
- const result = await fn(
7877
- new ApiaForm(this.execution, this),
7878
- ...await this.getScriptEventParams(event.fncParams)
7879
- );
7880
- if (!result) {
7869
+ const unlock = this.execution.lock();
7870
+ try {
7871
+ for (const event of events) {
7872
+ try {
7873
+ const fn = getWindow(this.execution)[event.fncName];
7874
+ const result = await fn(
7875
+ new ApiaForm(this.execution, this),
7876
+ ...await this.getScriptEventParams(event.fncParams)
7877
+ );
7878
+ if (!result) {
7879
+ return false;
7880
+ }
7881
+ } catch (e) {
7882
+ console.error(e);
7883
+ this.execution.notifications.add(
7884
+ new MessageNotification({
7885
+ message: labels.errorOnEvent(this.execution, event.fncName) + e,
7886
+ type: "error"
7887
+ })
7888
+ );
7881
7889
  return false;
7882
7890
  }
7883
- } catch (e) {
7884
- console.error(e);
7885
- this.execution.notifications.add(
7886
- new MessageNotification({
7887
- message: labels.errorOnEvent(this.execution, event.fncName) + e,
7888
- type: "error"
7889
- })
7890
- );
7891
- return false;
7892
7891
  }
7892
+ } finally {
7893
+ unlock();
7893
7894
  }
7894
7895
  }
7895
7896
  return true;
@@ -8234,6 +8235,24 @@ class Entity {
8234
8235
  }
8235
8236
  }
8236
8237
  }
8238
+ addAssociation() {
8239
+ const id = String(uniqueId());
8240
+ this.state.associations.push({
8241
+ asocId: id,
8242
+ asocName: "",
8243
+ asocRelName: ""
8244
+ });
8245
+ const row = new Row(id);
8246
+ row.build({
8247
+ id: String(uniqueId()),
8248
+ cells: [{ colName: "name" }, { colName: "relName" }],
8249
+ isSelected: true
8250
+ });
8251
+ this.controller.body.addRow(row);
8252
+ this.controller.setSelection([
8253
+ this.controller.body.getState("rows").length
8254
+ ]);
8255
+ }
8237
8256
  getConfirmParams() {
8238
8257
  const result = {
8239
8258
  busEntSta: this.state?.status.value ?? ""
@@ -8281,27 +8300,46 @@ class Entity {
8281
8300
  return newRow;
8282
8301
  });
8283
8302
  }
8284
- deleteRow() {
8303
+ deleteAssociation() {
8285
8304
  const selectedRows = this.controller.getState("selection");
8286
- [...selectedRows.values()].map((row, rowIndex) => {
8287
- this.state.associations = this.state?.associations.filter((_, idx) => rowIndex !== idx) ?? [];
8305
+ const lastIdx = Array.from(selectedRows).pop()?.index;
8306
+ [...selectedRows.values()].forEach((row) => {
8307
+ this.state.associations = this.state?.associations.filter((_, idx) => row.index !== idx) ?? [];
8288
8308
  this.controller.body.removeRow(row);
8289
8309
  });
8310
+ if (lastIdx)
8311
+ this.controller.setSelection([lastIdx - 1]);
8290
8312
  }
8291
- addRow() {
8292
- const id = String(uniqueId());
8293
- this.state.associations.push({
8294
- asocId: id,
8295
- asocName: "",
8296
- asocRelName: ""
8297
- });
8298
- const row = new Row(id);
8299
- row.build({
8300
- id: String(uniqueId()),
8301
- cells: [{ colName: "name" }, { colName: "relName" }],
8302
- isSelected: true
8303
- });
8304
- this.controller.body.addRow(row);
8313
+ deleteVisibility(id) {
8314
+ if (this.state) {
8315
+ this.state.visibilities = this.state.visibilities.filter(
8316
+ (c) => c.poolId !== id
8317
+ );
8318
+ }
8319
+ }
8320
+ validateAssociations() {
8321
+ if (this.state?.associations.length === 0)
8322
+ return true;
8323
+ if (this.state) {
8324
+ const invalidAssociations = this.state.associations.filter(
8325
+ (c) => !c.asocName || !c.asocRelName
8326
+ );
8327
+ if (invalidAssociations.length > 0) {
8328
+ invalidAssociations.forEach((c, idx) => {
8329
+ c.errorRelNameMessage = "";
8330
+ c.errorNameMessage = "";
8331
+ c.focusTarget = void 0;
8332
+ if (idx === 0)
8333
+ c.focusTarget = true;
8334
+ if (c.asocName === "")
8335
+ c.errorNameMessage = labels.errorFieldRequired(this.execution);
8336
+ if (c.asocRelName === "")
8337
+ c.errorRelNameMessage = labels.errorFieldRequired(this.execution);
8338
+ });
8339
+ return false;
8340
+ }
8341
+ }
8342
+ return true;
8305
8343
  }
8306
8344
  }
8307
8345
 
@@ -8923,17 +8961,21 @@ async function defaultConfirm(execution, status) {
8923
8961
  setAjaxFormResponse(execution, checkConfirmEntity.data?.form);
8924
8962
  }
8925
8963
  const url = arrayOrArray(confirmResponse.data.actions?.action.param)[1];
8926
- const c = new Url(url);
8927
- getWindow(execution).location.assign(
8928
- makeApiaUrl(execution, {
8929
- ajaxUrl: c.base,
8930
- action: c.getParameter("action")
8931
- })
8932
- );
8933
- (getWindow(execution)?.top?.ApiaUtil).notifications.notify({
8934
- message: confirmResponse?.data?.load?.text?.label,
8935
- type: "success"
8936
- });
8964
+ if (url === "callNavigateClose") {
8965
+ ApiaUtil.instance.tabs.currentTab.close(true);
8966
+ } else {
8967
+ const c = new Url(url);
8968
+ getWindow(execution).location.assign(
8969
+ makeApiaUrl(execution, {
8970
+ ajaxUrl: c.base,
8971
+ action: c.getParameter("action")
8972
+ })
8973
+ );
8974
+ (getWindow(execution)?.top?.ApiaUtil).notifications.notify({
8975
+ message: confirmResponse?.data?.load?.text?.label,
8976
+ type: "success"
8977
+ });
8978
+ }
8937
8979
  }
8938
8980
  return {
8939
8981
  ...status,
@@ -8987,6 +9029,7 @@ class Execution extends EventEmitter$1 {
8987
9029
  __publicField(this, "entity", new Entity(this));
8988
9030
  __publicField(this, "process", new Process(this));
8989
9031
  __publicField(this, "observations", new Observations(this));
9032
+ __publicField(this, "executedOnLoadEvents", false);
8990
9033
  __publicField(this, "executionConfig", null);
8991
9034
  __publicField(this, "_steps", []);
8992
9035
  __publicField(this, "_currentStep", 1);
@@ -9003,11 +9046,43 @@ class Execution extends EventEmitter$1 {
9003
9046
  });
9004
9047
  __publicField(this, "state", {
9005
9048
  executionState: ExecutionState.LOADING,
9006
- locked: true,
9049
+ locked: 0,
9007
9050
  hasChangedAnything: false
9008
9051
  });
9009
9052
  __publicField(this, "hasInitializedFormsTabs", {});
9010
9053
  __publicField(this, "mustRenderForms", []);
9054
+ __publicField(this, "flow", {
9055
+ back: () => {
9056
+ this.emit("flow", "previous");
9057
+ },
9058
+ confirm: () => {
9059
+ this.emit("flow", "confirm");
9060
+ },
9061
+ next: () => {
9062
+ this.emit("flow", "next");
9063
+ },
9064
+ previous: () => {
9065
+ this.emit("flow", "previous");
9066
+ },
9067
+ save: () => {
9068
+ this.emit("flow", "save");
9069
+ },
9070
+ release: () => {
9071
+ this.emit("flow", "release");
9072
+ },
9073
+ delegate: () => {
9074
+ this.emit("flow", "delegate");
9075
+ },
9076
+ share: () => {
9077
+ this.emit("flow", "share");
9078
+ },
9079
+ viewDocs: () => {
9080
+ this.emit("flow", "viewDocs");
9081
+ },
9082
+ print: () => {
9083
+ this.emit("flow", "print");
9084
+ }
9085
+ });
9011
9086
  this.fieldsMapping = { ...defaultFieldsMap, ...environment.fieldsMapping };
9012
9087
  this.notifications = new Notifications(this);
9013
9088
  makeObservable(this, { state: observable });
@@ -9057,88 +9132,111 @@ class Execution extends EventEmitter$1 {
9057
9132
  getCurrentTask() {
9058
9133
  return new Task({ task: { name: "TODO" } });
9059
9134
  }
9060
- async run(executionConfig) {
9061
- this._stepCount = noNaN$1(getWindow(this).STEP_QTY);
9062
- this._currentStep = noNaN$1(getWindow(this).CURRENT_STEP);
9063
- this.executionConfig = executionConfig;
9064
- this.environment.properties = {
9065
- taskName: getWindow(this).CURRENT_TASK_NAME || "",
9066
- processName: getWindow(this).CURRENT_PROCESS_NAME || ""
9067
- };
9068
- const errXML = unescapeMarkup(getWindow(this).EXEC_ERRORS);
9069
- if (errXML) {
9070
- const obj = parseXml(errXML);
9071
- arrayOrArray(obj.sysMessages?.message).forEach(
9072
- (c) => this.notifications.add(
9073
- new MessageNotification({
9074
- message: c.text,
9075
- type: "warning"
9076
- })
9077
- )
9078
- );
9079
- [
9080
- ...arrayOrArray(obj.exceptions?.exception),
9081
- ...arrayOrArray(obj.sysExceptions?.exception)
9082
- ].forEach(
9083
- (c) => this.notifications.add(
9084
- new MessageNotification({
9085
- message: c.text,
9086
- type: "error",
9087
- stackTrace: c.label
9088
- })
9089
- )
9090
- );
9091
- }
9092
- for (let i = 1; i < Number(getWindow(this).STEP_QTY) + 1; i++) {
9093
- if (i < this._currentStep) {
9094
- this._steps.push({
9095
- title: `Step ${i}`,
9096
- stepNumber: i,
9097
- status: "completed"
9098
- });
9099
- }
9100
- if (i > this._currentStep && i <= this._stepCount) {
9101
- this._steps.push({
9102
- title: `Step ${i}`,
9103
- stepNumber: i,
9104
- status: "pending"
9105
- });
9106
- }
9107
- if (i === this._currentStep) {
9108
- this._steps.push({
9109
- title: `Step ${i}`,
9110
- stepNumber: i,
9111
- status: "current"
9112
- });
9135
+ get locked() {
9136
+ return this.state.locked > 0;
9137
+ }
9138
+ lock() {
9139
+ this.state.locked++;
9140
+ let unlocked = false;
9141
+ return () => {
9142
+ if (!unlocked) {
9143
+ unlocked = true;
9144
+ this.state.locked--;
9113
9145
  }
9114
- }
9115
- const res = await InitialData.getFormsDefinition(this);
9146
+ };
9147
+ }
9148
+ async run(executionConfig) {
9149
+ const unlock = this.lock();
9116
9150
  try {
9117
- for await (const formDefinition of res) {
9118
- const props = parseFakeJSON$1(formDefinition.properties);
9119
- if (!props.frmTab && !props.frmHidden && (arrayOrArray(formDefinition.field).length > 0 || arrayOrArray(formDefinition.customField).length > 0)) {
9120
- this.mustRenderForms.push(
9121
- formDefinition.frmParent + "_" + formDefinition.formName
9122
- );
9151
+ this._stepCount = noNaN$1(getWindow(this).STEP_QTY);
9152
+ this._currentStep = noNaN$1(getWindow(this).CURRENT_STEP);
9153
+ this.executionConfig = executionConfig;
9154
+ this.environment.properties = {
9155
+ taskName: getWindow(this).CURRENT_TASK_NAME || "",
9156
+ processName: getWindow(this).CURRENT_PROCESS_NAME || ""
9157
+ };
9158
+ const errXML = unescapeMarkup(getWindow(this).EXEC_ERRORS);
9159
+ if (errXML) {
9160
+ const obj = parseXml(errXML);
9161
+ arrayOrArray(obj.sysMessages?.message).forEach(
9162
+ (c) => this.notifications.add(
9163
+ new MessageNotification({
9164
+ message: c.text,
9165
+ type: "warning"
9166
+ })
9167
+ )
9168
+ );
9169
+ [
9170
+ ...arrayOrArray(obj.exceptions?.exception),
9171
+ ...arrayOrArray(obj.sysExceptions?.exception)
9172
+ ].forEach(
9173
+ (c) => this.notifications.add(
9174
+ new MessageNotification({
9175
+ message: c.text,
9176
+ type: "error",
9177
+ stackTrace: c.label
9178
+ })
9179
+ )
9180
+ );
9181
+ }
9182
+ for (let i = 1; i < Number(getWindow(this).STEP_QTY) + 1; i++) {
9183
+ if (i < this._currentStep) {
9184
+ this._steps.push({
9185
+ title: `Step ${i}`,
9186
+ stepNumber: i,
9187
+ status: "completed"
9188
+ });
9189
+ }
9190
+ if (i > this._currentStep && i <= this._stepCount) {
9191
+ this._steps.push({
9192
+ title: `Step ${i}`,
9193
+ stepNumber: i,
9194
+ status: "pending"
9195
+ });
9196
+ }
9197
+ if (i === this._currentStep) {
9198
+ this._steps.push({
9199
+ title: `Step ${i}`,
9200
+ stepNumber: i,
9201
+ status: "current"
9202
+ });
9123
9203
  }
9124
9204
  }
9125
- for await (const formDefinition of res) {
9126
- const newForm = new Form(this, formDefinition);
9127
- await newForm.init();
9128
- if (formDefinition.frmParent === "E") {
9129
- this.forms.E.set(formDefinition.formName, newForm);
9130
- this.formsById.E.set(String(formDefinition.id), newForm);
9131
- } else {
9132
- this.forms.P.set(formDefinition.formName, newForm);
9133
- this.formsById.P.set(String(formDefinition.id), newForm);
9205
+ const res = await InitialData.getFormsDefinition(this);
9206
+ try {
9207
+ for await (const formDefinition of res) {
9208
+ const props = parseFakeJSON$1(formDefinition.properties);
9209
+ if (!props.frmTab && !props.frmHidden && arrayOrArray(formDefinition.field).every(
9210
+ (c) => !c.properties?.visibilityHidden
9211
+ ) && (arrayOrArray(formDefinition.field).length > 0 || arrayOrArray(formDefinition.customField).length > 0)) {
9212
+ this.mustRenderForms.push(
9213
+ formDefinition.frmParent + "_" + formDefinition.formName
9214
+ );
9215
+ }
9134
9216
  }
9217
+ for await (const formDefinition of res) {
9218
+ const newForm = new Form(this, formDefinition);
9219
+ await newForm.init();
9220
+ if (formDefinition.frmParent === "E") {
9221
+ this.forms.E.set(formDefinition.formName, newForm);
9222
+ this.formsById.E.set(String(formDefinition.id), newForm);
9223
+ } else {
9224
+ this.forms.P.set(formDefinition.formName, newForm);
9225
+ this.formsById.P.set(String(formDefinition.id), newForm);
9226
+ }
9227
+ }
9228
+ this.state.executionState = this.mustRenderForms.length === 0 ? ExecutionState.RUNNING : ExecutionState.RENDERING;
9229
+ await this.fireEvents("onLoad");
9230
+ this.executedOnLoadEvents = true;
9231
+ if (this.mustRenderForms.length === 0 && this.state.executionState === ExecutionState.RENDERING) {
9232
+ this.state.executionState = ExecutionState.RUNNING;
9233
+ }
9234
+ } catch (e) {
9235
+ this.state.executionState = ExecutionState.FINISHED_WITH_ERROR;
9236
+ throw e;
9135
9237
  }
9136
- this.state.executionState = this.mustRenderForms.length === 0 ? ExecutionState.RUNNING : ExecutionState.RENDERING;
9137
- this.state.locked = false;
9138
- this.fireEvents("onLoad");
9139
- } catch (e) {
9140
- this.state.executionState = ExecutionState.FINISHED_WITH_ERROR;
9141
- throw e;
9238
+ } finally {
9239
+ unlock();
9142
9240
  }
9143
9241
  }
9144
9242
  getHiddenForms() {
@@ -9151,7 +9249,7 @@ class Execution extends EventEmitter$1 {
9151
9249
  this.mustRenderForms = this.mustRenderForms.filter(
9152
9250
  (c) => c !== frmParent + "_" + frmName
9153
9251
  );
9154
- if (this.mustRenderForms.length === 0) {
9252
+ if (this.mustRenderForms.length === 0 && this.executedOnLoadEvents) {
9155
9253
  this.state.executionState = ExecutionState.RUNNING;
9156
9254
  }
9157
9255
  }
@@ -9161,12 +9259,6 @@ class Execution extends EventEmitter$1 {
9161
9259
  async shareSocial() {
9162
9260
  console.warn("shareSocial not implemented yet");
9163
9261
  }
9164
- confirm() {
9165
- this.emit("confirm", null);
9166
- }
9167
- next() {
9168
- this.emit("next", null);
9169
- }
9170
9262
  sendToDesktop() {
9171
9263
  this.emit("sendToDesktop", null);
9172
9264
  }
@@ -9200,18 +9292,20 @@ class Execution extends EventEmitter$1 {
9200
9292
  }
9201
9293
  async doConfirm(status) {
9202
9294
  if (status && !status?.step && !status?.finishedWithError) {
9203
- this.state.locked = false;
9204
9295
  return false;
9205
9296
  } else {
9206
9297
  const validationResult = status !== void 0 || await this.validate();
9207
9298
  if (validationResult !== true) {
9208
9299
  return validationResult;
9209
9300
  }
9301
+ if (this.executionConfig?.isEntity && !this.entity.validateAssociations()) {
9302
+ return false;
9303
+ }
9210
9304
  const isValid = status !== void 0 || await this.fireEvents("onSubmit");
9211
9305
  const canConfirm = this.executionConfig?.canConfirm && isValid === true;
9212
9306
  if (canConfirm) {
9307
+ const unlock = this.lock();
9213
9308
  try {
9214
- this.state.locked = true;
9215
9309
  const result = await (this.executionConfig?.isEntity ? confirmEntity : confirm)(
9216
9310
  this,
9217
9311
  status || {
@@ -9221,10 +9315,8 @@ class Execution extends EventEmitter$1 {
9221
9315
  if (result instanceof FlowModal$1) {
9222
9316
  return result;
9223
9317
  }
9224
- this.state.locked = false;
9225
9318
  return result;
9226
9319
  } catch (error) {
9227
- this.state.locked = false;
9228
9320
  console.error("Confirmation process failed:", error);
9229
9321
  this.notifications.add(
9230
9322
  new MessageNotification({
@@ -9233,9 +9325,10 @@ class Execution extends EventEmitter$1 {
9233
9325
  })
9234
9326
  );
9235
9327
  return false;
9328
+ } finally {
9329
+ unlock();
9236
9330
  }
9237
9331
  } else {
9238
- this.state.locked = false;
9239
9332
  return isValid;
9240
9333
  }
9241
9334
  }
@@ -9277,6 +9370,7 @@ class Execution extends EventEmitter$1 {
9277
9370
  return isValid;
9278
9371
  const canGoNext = this.executionConfig?.canGoForward && isValid === true;
9279
9372
  if (canGoNext) {
9373
+ const unlock = this.lock();
9280
9374
  try {
9281
9375
  const checkLocksRes = await post(
9282
9376
  this,
@@ -9346,6 +9440,8 @@ class Execution extends EventEmitter$1 {
9346
9440
  })
9347
9441
  );
9348
9442
  return false;
9443
+ } finally {
9444
+ unlock();
9349
9445
  }
9350
9446
  }
9351
9447
  }
@@ -9353,23 +9449,24 @@ class Execution extends EventEmitter$1 {
9353
9449
  getWindow(this).print();
9354
9450
  }
9355
9451
  async doSave() {
9356
- const response = await post(
9357
- this,
9358
- makeApiaUrl(this, {
9359
- action: "saveTask",
9360
- asXML: true,
9361
- react: true
9362
- })
9363
- );
9364
- const canClose = response?.data?.load?.canClose;
9365
- if (canClose) {
9366
- getWindow(this).location.assign(
9452
+ const unlock = this.lock();
9453
+ try {
9454
+ const response = await post(
9455
+ this,
9367
9456
  makeApiaUrl(this, {
9368
- action: "refreshPage"
9457
+ action: "saveTask",
9458
+ asXML: true,
9459
+ react: true
9369
9460
  })
9370
9461
  );
9371
- return response;
9462
+ const canClose = response?.data?.load?.canClose;
9463
+ if (canClose) {
9464
+ return response;
9465
+ }
9466
+ } finally {
9467
+ unlock();
9372
9468
  }
9469
+ return false;
9373
9470
  }
9374
9471
  getStepTitle(step) {
9375
9472
  if (this._steps)
@@ -9418,20 +9515,25 @@ class Execution extends EventEmitter$1 {
9418
9515
  return this.lastModalReturn;
9419
9516
  }
9420
9517
  async fireEvents(evt) {
9518
+ const unlock = this.lock();
9421
9519
  let result = true;
9422
- for await (const f of this.forms.E.values()) {
9423
- result = result && await f.fireScriptEvent(evt);
9424
- if (!result) {
9425
- return false;
9520
+ try {
9521
+ for await (const f of this.forms.E.values()) {
9522
+ result = result && await f.fireScriptEvent(evt);
9523
+ if (!result) {
9524
+ return false;
9525
+ }
9426
9526
  }
9427
- }
9428
- for await (const f of this.forms.P.values()) {
9429
- result = result && await f.fireScriptEvent(evt);
9430
- if (!result) {
9431
- return false;
9527
+ for await (const f of this.forms.P.values()) {
9528
+ result = result && await f.fireScriptEvent(evt);
9529
+ if (!result) {
9530
+ return false;
9531
+ }
9432
9532
  }
9533
+ return true;
9534
+ } finally {
9535
+ unlock();
9433
9536
  }
9434
- return true;
9435
9537
  }
9436
9538
  }
9437
9539