@apia/execution 4.0.29 → 4.0.31

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,4 +1,4 @@
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';
@@ -7,6 +7,7 @@ import QueryString from 'qs';
7
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';
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';
12
13
 
@@ -46,16 +47,16 @@ const deepEqual = (a, b) => {
46
47
  return a === b;
47
48
  };
48
49
 
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);
50
+ var __defProp$t = Object.defineProperty;
51
+ var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
52
+ var __publicField$t = (obj, key, value) => {
53
+ __defNormalProp$t(obj, key + "" , value);
53
54
  return value;
54
55
  };
55
56
  class Notification {
56
57
  constructor(props) {
57
58
  this.props = props;
58
- __publicField$s(this, "state");
59
+ __publicField$t(this, "state");
59
60
  this.state = props;
60
61
  makeObservable(this, { state: observable });
61
62
  }
@@ -457,12 +458,14 @@ var ExecutionState = /* @__PURE__ */ ((ExecutionState2) => {
457
458
  })(ExecutionState || {});
458
459
 
459
460
  function dispatchMessage(execution, type, message) {
461
+ const definedType = message.type;
462
+ const actualType = [null, "success", "warning", "error"][definedType || 0];
460
463
  execution.notifications.add(
461
464
  new MessageNotification({
462
465
  message: message.text,
463
466
  stackTrace: message.label,
464
467
  title: message.title,
465
- type
468
+ type: actualType || type
466
469
  })
467
470
  );
468
471
  }
@@ -687,20 +690,20 @@ function makeApiaUrl(execution, props) {
687
690
  return `${contextWord ? "/" : ""}${contextWord}/${actualAjaxUrl}?${timestamp}${!props?.preventAsXmlParameter ? "asXml=true&" : ""}${props?.queryString ? `${props.queryString}&` : ""}${queryString ? `${queryString}&` : ""}${tabId}`;
688
691
  }
689
692
 
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);
693
+ var __defProp$s = Object.defineProperty;
694
+ var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
695
+ var __publicField$s = (obj, key, value) => {
696
+ __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
694
697
  return value;
695
698
  };
696
699
  class EventEmitter {
697
700
  constructor() {
698
- __publicField$r(this, "callbacks", {
701
+ __publicField$s(this, "callbacks", {
699
702
  on: {},
700
703
  once: {}
701
704
  });
702
- __publicField$r(this, "enabled", true);
703
- __publicField$r(this, "debugMode", false);
705
+ __publicField$s(this, "enabled", true);
706
+ __publicField$s(this, "debugMode", false);
704
707
  }
705
708
  debug(enable = true) {
706
709
  this.debugMode = enable;
@@ -766,10 +769,10 @@ class EventEmitter {
766
769
  }
767
770
  }
768
771
 
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);
772
+ var __defProp$r = Object.defineProperty;
773
+ var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
774
+ var __publicField$r = (obj, key, value) => {
775
+ __defNormalProp$r(obj, key + "" , value);
773
776
  return value;
774
777
  };
775
778
  function isSetter(data) {
@@ -778,7 +781,7 @@ function isSetter(data) {
778
781
  class StatefulEmitter extends EventEmitter {
779
782
  constructor(initialState) {
780
783
  super();
781
- __publicField$q(this, "state", {});
784
+ __publicField$r(this, "state", {});
782
785
  this.state = Object.assign({}, initialState);
783
786
  }
784
787
  emit(event, data) {
@@ -813,18 +816,18 @@ class StatefulEmitter extends EventEmitter {
813
816
  }
814
817
  }
815
818
 
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);
819
+ var __defProp$q = Object.defineProperty;
820
+ var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
821
+ var __publicField$q = (obj, key, value) => {
822
+ __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
820
823
  return value;
821
824
  };
822
825
  const NullObject = Symbol("NullObject");
823
826
  class BouncingEmitter extends StatefulEmitter {
824
827
  constructor() {
825
828
  super(...arguments);
826
- __publicField$p(this, "bouncingTimeouts", {});
827
- __publicField$p(this, "defaultTiming", 100);
829
+ __publicField$q(this, "bouncingTimeouts", {});
830
+ __publicField$q(this, "defaultTiming", 100);
828
831
  /**
829
832
  * 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
833
  *
@@ -836,8 +839,8 @@ class BouncingEmitter extends StatefulEmitter {
836
839
  *
837
840
  * @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
841
  */
839
- __publicField$p(this, "throttleData", {});
840
- __publicField$p(this, "throttleEmittedOnInit", {});
842
+ __publicField$q(this, "throttleData", {});
843
+ __publicField$q(this, "throttleEmittedOnInit", {});
841
844
  }
842
845
  /**
843
846
  * 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 +970,16 @@ function parseFakeJSON$1(str) {
967
970
  return ret;
968
971
  }
969
972
 
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);
973
+ var __defProp$p = Object.defineProperty;
974
+ var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
975
+ var __publicField$p = (obj, key, value) => {
976
+ __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
974
977
  return value;
975
978
  };
976
979
  class WithProperties {
977
980
  constructor(initialState) {
978
- __publicField$o(this, "properties", {});
979
- __publicField$o(this, "parentGrid", null);
981
+ __publicField$p(this, "properties", {});
982
+ __publicField$p(this, "parentGrid", null);
980
983
  if (initialState) {
981
984
  this.properties = initialState;
982
985
  }
@@ -1030,7 +1033,7 @@ const setAjaxFormResponse = async (execution, response) => {
1030
1033
  const [frmParent, id] = formId.split("_");
1031
1034
  const apiaForm = execution.getFormById(id, frmParent);
1032
1035
  arrayOrArray(form.cusCmp).forEach((c) => {
1033
- apiaForm?.getCustomComponentByFldId(Number.parseInt(String(c.id)))?.processResult({ state: c.state });
1036
+ apiaForm?.getCustomComponentByFldId(Number.parseInt(String(c.id)))?.processResult({ processResult: { state: c.state } });
1034
1037
  });
1035
1038
  const changedGrids = arrayOrArray(form.changedGrids.grdId);
1036
1039
  changedGrids.forEach(({ id: id2 }) => {
@@ -1109,7 +1112,10 @@ const setAjaxFormResponse = async (execution, response) => {
1109
1112
  }
1110
1113
  }
1111
1114
  if (apiField.attribute && value !== void 0) {
1112
- apiField.setValue(value);
1115
+ apiField.setValue(value, {
1116
+ force: true,
1117
+ synchronize: false
1118
+ });
1113
1119
  }
1114
1120
  }
1115
1121
  if (ajaxFields[f].e !== void 0) {
@@ -1153,27 +1159,27 @@ const asyncCreateNewField = async (execution, fld) => {
1153
1159
  return creator(execution, fld);
1154
1160
  };
1155
1161
 
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);
1162
+ var __defProp$o = Object.defineProperty;
1163
+ var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1164
+ var __publicField$o = (obj, key, value) => {
1165
+ __defNormalProp$o(obj, typeof key !== "symbol" ? key + "" : key, value);
1160
1166
  return value;
1161
1167
  };
1162
- var __accessCheck$k = (obj, member, msg) => {
1168
+ var __accessCheck$l = (obj, member, msg) => {
1163
1169
  if (!member.has(obj))
1164
1170
  throw TypeError("Cannot " + msg);
1165
1171
  };
1166
- var __privateGet$k = (obj, member, getter) => {
1167
- __accessCheck$k(obj, member, "read from private field");
1172
+ var __privateGet$l = (obj, member, getter) => {
1173
+ __accessCheck$l(obj, member, "read from private field");
1168
1174
  return member.get(obj);
1169
1175
  };
1170
- var __privateAdd$k = (obj, member, value) => {
1176
+ var __privateAdd$l = (obj, member, value) => {
1171
1177
  if (member.has(obj))
1172
1178
  throw TypeError("Cannot add the same private member more than once");
1173
1179
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
1174
1180
  };
1175
- var __privateSet$k = (obj, member, value, setter) => {
1176
- __accessCheck$k(obj, member, "write to private field");
1181
+ var __privateSet$l = (obj, member, value, setter) => {
1182
+ __accessCheck$l(obj, member, "write to private field");
1177
1183
  member.set(obj, value);
1178
1184
  return value;
1179
1185
  };
@@ -1187,15 +1193,15 @@ async function getApiaFunctions(execution) {
1187
1193
  }
1188
1194
  return af;
1189
1195
  }
1190
- let Field$1 = class Field extends WithProperties {
1196
+ class Field extends WithProperties {
1191
1197
  constructor({ properties, ...definition }) {
1192
1198
  super();
1193
- __publicField$n(this, "form", {});
1194
- __publicField$n(this, "definition");
1195
- __publicField$n(this, "state", {
1199
+ __publicField$o(this, "form", {});
1200
+ __publicField$o(this, "definition");
1201
+ __publicField$o(this, "state", {
1196
1202
  validation: { dirty: false, errorMessage: "", synchronizing: false }
1197
1203
  });
1198
- __privateAdd$k(this, _hasInited$1, false);
1204
+ __privateAdd$l(this, _hasInited$1, false);
1199
1205
  this.properties = properties;
1200
1206
  this.definition = definition;
1201
1207
  makeObservable(this, { state: observable, definition: observable });
@@ -1354,11 +1360,16 @@ let Field$1 = class Field extends WithProperties {
1354
1360
  return true;
1355
1361
  }
1356
1362
  async fireEvent(eventName, params) {
1357
- let result = await this.fireScriptEvent(eventName);
1358
- if (result) {
1359
- result = await this.fireServerEvent(eventName, params);
1363
+ const unlock = this.form.execution.lock();
1364
+ try {
1365
+ let result = await this.fireScriptEvent(eventName);
1366
+ if (result) {
1367
+ result = await this.fireServerEvent(eventName, params);
1368
+ }
1369
+ return result;
1370
+ } finally {
1371
+ unlock();
1360
1372
  }
1361
- return result;
1362
1373
  }
1363
1374
  getForm() {
1364
1375
  return this.form;
@@ -1377,9 +1388,9 @@ let Field$1 = class Field extends WithProperties {
1377
1388
  );
1378
1389
  }
1379
1390
  async init(form) {
1380
- if (__privateGet$k(this, _hasInited$1))
1391
+ if (__privateGet$l(this, _hasInited$1))
1381
1392
  throw new Error("Cannot init field twice");
1382
- __privateSet$k(this, _hasInited$1, true);
1393
+ __privateSet$l(this, _hasInited$1, true);
1383
1394
  this.form = form;
1384
1395
  }
1385
1396
  async validate() {
@@ -1391,25 +1402,25 @@ let Field$1 = class Field extends WithProperties {
1391
1402
  this.definition.index
1392
1403
  );
1393
1404
  }
1394
- };
1405
+ }
1395
1406
  _hasInited$1 = new WeakMap();
1396
1407
 
1397
- class Button extends Field$1 {
1408
+ class Button extends Field {
1398
1409
  fireEvent(eventName) {
1399
1410
  return super.fireEvent(eventName);
1400
1411
  }
1401
1412
  }
1402
1413
 
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);
1414
+ var __defProp$n = Object.defineProperty;
1415
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1416
+ var __publicField$n = (obj, key, value) => {
1417
+ __defNormalProp$n(obj, typeof key !== "symbol" ? key + "" : key, value);
1407
1418
  return value;
1408
1419
  };
1409
- const _Captcha = class _Captcha extends Field$1 {
1420
+ const _Captcha = class _Captcha extends Field {
1410
1421
  constructor(definition) {
1411
1422
  super(definition);
1412
- __publicField$m(this, "id", "");
1423
+ __publicField$n(this, "id", "");
1413
1424
  this.state.value = "";
1414
1425
  this.properties.name = "__captcha__";
1415
1426
  _Captcha.emitter.on("confirm", () => {
@@ -1460,8 +1471,8 @@ const _Captcha = class _Captcha extends Field$1 {
1460
1471
  }
1461
1472
  }
1462
1473
  };
1463
- __publicField$m(_Captcha, "emitter", new EventEmitter$1());
1464
- __publicField$m(_Captcha, "confirmParams", {});
1474
+ __publicField$n(_Captcha, "emitter", new EventEmitter$1());
1475
+ __publicField$n(_Captcha, "confirmParams", {});
1465
1476
  let Captcha = _Captcha;
1466
1477
 
1467
1478
  class TooMuchRetriesException extends Error {
@@ -1534,27 +1545,27 @@ function isFieldShowAsText(f) {
1534
1545
  return isTrue(f.properties.disabled) || isTrue(f.getForm().definition.readonly) || isTrue(f.getForm().definition.readOnly) || isTrue(f.properties.inputAsText);
1535
1546
  }
1536
1547
 
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);
1548
+ var __defProp$m = Object.defineProperty;
1549
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1550
+ var __publicField$m = (obj, key, value) => {
1551
+ __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
1541
1552
  return value;
1542
1553
  };
1543
- var __accessCheck$j = (obj, member, msg) => {
1554
+ var __accessCheck$k = (obj, member, msg) => {
1544
1555
  if (!member.has(obj))
1545
1556
  throw TypeError("Cannot " + msg);
1546
1557
  };
1547
- var __privateGet$j = (obj, member, getter) => {
1548
- __accessCheck$j(obj, member, "read from private field");
1558
+ var __privateGet$k = (obj, member, getter) => {
1559
+ __accessCheck$k(obj, member, "read from private field");
1549
1560
  return member.get(obj);
1550
1561
  };
1551
- var __privateAdd$j = (obj, member, value) => {
1562
+ var __privateAdd$k = (obj, member, value) => {
1552
1563
  if (member.has(obj))
1553
1564
  throw TypeError("Cannot add the same private member more than once");
1554
1565
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
1555
1566
  };
1556
- var __privateSet$j = (obj, member, value, setter) => {
1557
- __accessCheck$j(obj, member, "write to private field");
1567
+ var __privateSet$k = (obj, member, value, setter) => {
1568
+ __accessCheck$k(obj, member, "write to private field");
1558
1569
  member.set(obj, value);
1559
1570
  return value;
1560
1571
  };
@@ -1567,7 +1578,7 @@ class Attribute {
1567
1578
  this.valueType = valueType;
1568
1579
  }
1569
1580
  }
1570
- class FieldWithAttribute extends Field$1 {
1581
+ class FieldWithAttribute extends Field {
1571
1582
  constructor({
1572
1583
  attId,
1573
1584
  attName,
@@ -1577,9 +1588,9 @@ class FieldWithAttribute extends Field$1 {
1577
1588
  ...definition
1578
1589
  }) {
1579
1590
  super(definition);
1580
- __privateAdd$j(this, _lastOnChangeValue, null);
1581
- __publicField$l(this, "lastSynchronizationValue", null);
1582
- __publicField$l(this, "attribute");
1591
+ __privateAdd$k(this, _lastOnChangeValue, null);
1592
+ __publicField$m(this, "lastSynchronizationValue", null);
1593
+ __publicField$m(this, "attribute");
1583
1594
  this.attribute = new Attribute(attId, attName, attLabel, valueType);
1584
1595
  this.state.value = value;
1585
1596
  this.state.validation = {
@@ -1591,17 +1602,17 @@ class FieldWithAttribute extends Field$1 {
1591
1602
  attribute: observable
1592
1603
  });
1593
1604
  }
1594
- async fireEvent(eventName) {
1605
+ async fireEvent(eventName, options) {
1595
1606
  if (this.getValidationState().dirty) {
1596
1607
  return Promise.resolve(false);
1597
1608
  }
1598
1609
  if (eventName === "onChange") {
1599
- if (this.getValue() === __privateGet$j(this, _lastOnChangeValue)) {
1610
+ if (this.getValue() === __privateGet$k(this, _lastOnChangeValue) && !options?.force) {
1600
1611
  return true;
1601
1612
  } else {
1602
1613
  const res = await super.fireEvent(eventName);
1603
1614
  if (res) {
1604
- __privateSet$j(this, _lastOnChangeValue, this.getValue());
1615
+ __privateSet$k(this, _lastOnChangeValue, this.getValue());
1605
1616
  return true;
1606
1617
  } else {
1607
1618
  return false;
@@ -1621,8 +1632,11 @@ class FieldWithAttribute extends Field$1 {
1621
1632
  getValue() {
1622
1633
  return this.state.value;
1623
1634
  }
1635
+ canSetValue(newValue) {
1636
+ return isFieldShowAsText(this) || shallowEqual(newValue, this.getValue());
1637
+ }
1624
1638
  setValue(newValue, options) {
1625
- if (isFieldShowAsText(this) || shallowEqual(newValue, this.getValue()))
1639
+ if (!options?.force && (isFieldShowAsText(this) || shallowEqual(newValue, this.getValue())))
1626
1640
  return Promise.resolve(true);
1627
1641
  this.state.value = newValue;
1628
1642
  this.state.validation.errorMessage = null;
@@ -1635,7 +1649,7 @@ class FieldWithAttribute extends Field$1 {
1635
1649
  if (options?.markAsDirty !== false) {
1636
1650
  this.form.execution.state.hasChangedAnything = true;
1637
1651
  }
1638
- return this.fireEvent("onChange");
1652
+ return this.fireEvent("onChange", { force: options?.force });
1639
1653
  }
1640
1654
  return Promise.resolve(false);
1641
1655
  });
@@ -1747,8 +1761,8 @@ class FieldWithAttribute extends Field$1 {
1747
1761
  _lastOnChangeValue = new WeakMap();
1748
1762
 
1749
1763
  class Checkbox extends FieldWithAttribute {
1750
- fireEvent(eventName) {
1751
- return super.fireEvent(eventName);
1764
+ fireEvent(eventName, options) {
1765
+ return super.fireEvent(eventName, options);
1752
1766
  }
1753
1767
  getInitialValue({
1754
1768
  value,
@@ -1764,16 +1778,16 @@ class Checkbox extends FieldWithAttribute {
1764
1778
  }
1765
1779
  }
1766
1780
 
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);
1781
+ var __defProp$l = Object.defineProperty;
1782
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1783
+ var __publicField$l = (obj, key, value) => {
1784
+ __defNormalProp$l(obj, key + "" , value);
1771
1785
  return value;
1772
1786
  };
1773
1787
  class Translation {
1774
1788
  constructor(execution, state) {
1775
1789
  this.execution = execution;
1776
- __publicField$k(this, "state");
1790
+ __publicField$l(this, "state");
1777
1791
  this.state = {
1778
1792
  ...state,
1779
1793
  hasChanged: false,
@@ -1838,19 +1852,19 @@ function parseFakeJSON(fakeJSON) {
1838
1852
  }));
1839
1853
  }
1840
1854
 
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);
1855
+ var __defProp$k = Object.defineProperty;
1856
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1857
+ var __publicField$k = (obj, key, value) => {
1858
+ __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
1845
1859
  return value;
1846
1860
  };
1847
1861
  class TranslatableField extends FieldWithAttribute {
1848
1862
  constructor(props) {
1849
1863
  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", {});
1864
+ __publicField$k(this, "translations", /* @__PURE__ */ new Map());
1865
+ __publicField$k(this, "selectedLanguageId", this.getLanguages()[0]?.id);
1866
+ __publicField$k(this, "isTradLoading", false);
1867
+ __publicField$k(this, "definitionTradParsed", {});
1854
1868
  makeObservable(this, {
1855
1869
  translations: observable,
1856
1870
  selectedLanguageId: observable,
@@ -1970,18 +1984,18 @@ class TranslatableField extends FieldWithAttribute {
1970
1984
  }
1971
1985
 
1972
1986
  class Editor extends TranslatableField {
1973
- fireEvent(eventName) {
1974
- return super.fireEvent(eventName);
1987
+ fireEvent(eventName, options) {
1988
+ return super.fireEvent(eventName, options);
1975
1989
  }
1976
1990
  isValidValue() {
1977
1991
  return !!new DOMParser().parseFromString(this.getValue(), "text/html").documentElement.textContent;
1978
1992
  }
1979
1993
  }
1980
1994
 
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);
1995
+ var __defProp$j = Object.defineProperty;
1996
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1997
+ var __publicField$j = (obj, key, value) => {
1998
+ __defNormalProp$j(obj, key + "" , value);
1985
1999
  return value;
1986
2000
  };
1987
2001
  function getFileExtension(fileName) {
@@ -1996,6 +2010,7 @@ const getInitialState = (execution) => Object.freeze({
1996
2010
  },
1997
2011
  fromDirectoryFile: null,
1998
2012
  docFolder: void 0,
2013
+ docPath: void 0,
1999
2014
  docExpDate: void 0,
2000
2015
  description: "",
2001
2016
  isReadonly: false,
@@ -2017,7 +2032,7 @@ class UploaderModalController {
2017
2032
  this.api = api;
2018
2033
  this.modalConfig = modalConfig;
2019
2034
  this.conf = conf;
2020
- __publicField$i(this, "state");
2035
+ __publicField$j(this, "state");
2021
2036
  makeObservable(this, {
2022
2037
  state: observable
2023
2038
  });
@@ -2111,6 +2126,11 @@ class UploaderModalController {
2111
2126
  this.state = getInitialState(this.api.execution);
2112
2127
  this.api.clearState();
2113
2128
  }
2129
+ clearPartialState() {
2130
+ if (this.api.state.inProgressFiles.length === 0) {
2131
+ this.state = getInitialState(this.api.execution);
2132
+ }
2133
+ }
2114
2134
  onCloseModal() {
2115
2135
  this.clearState();
2116
2136
  }
@@ -2233,27 +2253,23 @@ class UploaderModalController {
2233
2253
  c.errorMessage = getLabel(this.api.execution, "msgReqField").text;
2234
2254
  isValid = false;
2235
2255
  }
2236
- if (c.type === "N" && c.value.trim() === "") {
2237
- c.errorMessage = getLabel(this.api.execution, "msgMustBeNum").text;
2238
- isValid = false;
2239
- }
2240
2256
  }
2241
2257
  });
2242
2258
  return isValid;
2243
2259
  }
2244
2260
  }
2245
2261
 
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);
2262
+ var __defProp$i = Object.defineProperty;
2263
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2264
+ var __publicField$i = (obj, key, value) => {
2265
+ __defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
2250
2266
  return value;
2251
2267
  };
2252
2268
  function returnExactlyTheSame(defaultParameters) {
2253
2269
  return defaultParameters;
2254
2270
  }
2255
- function isOneClickUploadEnabled(oneClickUploadProp) {
2256
- return !window.avoidOneClickUpload && (window.forceOneClickUpload || oneClickUploadProp || false);
2271
+ function isOneClickUploadEnabled(execution, oneClickUploadProp) {
2272
+ return !getWindow(execution).avoidOneClickUpload && (getWindow(execution).forceOneClickUpload || oneClickUploadProp || false);
2257
2273
  }
2258
2274
  const parseFileDefinition = (execution, fileDefinition, isSignRequired) => {
2259
2275
  const { lock, isLocked, lockedBy, userLocking, ...file } = fileDefinition;
@@ -2273,13 +2289,13 @@ class UploaderApi extends EventEmitter$1 {
2273
2289
  this.id = id;
2274
2290
  this.type = type;
2275
2291
  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", {
2292
+ __publicField$i(this, "maxFiles", Infinity);
2293
+ __publicField$i(this, "modalController", null);
2294
+ __publicField$i(this, "allowTranslations", false);
2295
+ __publicField$i(this, "langs");
2296
+ __publicField$i(this, "currentConfiguration");
2297
+ __publicField$i(this, "docTypePermittedObjId");
2298
+ __publicField$i(this, "state", {
2283
2299
  progress: 0,
2284
2300
  allowedTypes: [],
2285
2301
  selectedDocTypeId: "1",
@@ -2291,18 +2307,18 @@ class UploaderApi extends EventEmitter$1 {
2291
2307
  translatedFiles: /* @__PURE__ */ new Map(),
2292
2308
  hasAllDocTypes: false
2293
2309
  });
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", ({
2310
+ __publicField$i(this, "getAjaxUploadFileStatusParameters", returnExactlyTheSame);
2311
+ __publicField$i(this, "getAjaxUploadStartParameters", returnExactlyTheSame);
2312
+ __publicField$i(this, "getConfirmDropModalParameters", returnExactlyTheSame);
2313
+ __publicField$i(this, "getCheckLockDocumentParameters", returnExactlyTheSame);
2314
+ __publicField$i(this, "getCheckWebDavLockParameters", returnExactlyTheSame);
2315
+ __publicField$i(this, "getConfirmDropModalPostdata", returnExactlyTheSame);
2316
+ __publicField$i(this, "getConfirmDropModalMetadataString", ({
2301
2317
  metadata
2302
2318
  }) => {
2303
2319
  return metadata?.filter?.((current) => !!current.value).map((current) => `${current.id}~${current.type}~${current.value}`).join(";") ?? [];
2304
2320
  });
2305
- __publicField$h(this, "getConfirmDropModalPermissionsString", ({
2321
+ __publicField$i(this, "getConfirmDropModalPermissionsString", ({
2306
2322
  poolsPermissions,
2307
2323
  usersPermissions
2308
2324
  }) => {
@@ -2315,28 +2331,28 @@ class UploaderApi extends EventEmitter$1 {
2315
2331
  );
2316
2332
  return returnString;
2317
2333
  });
2318
- __publicField$h(this, "getConfirmDropModalAdditionalMetadataString", (additionalMetadata) => {
2334
+ __publicField$i(this, "getConfirmDropModalAdditionalMetadataString", (additionalMetadata) => {
2319
2335
  return Object.values(additionalMetadata).filter((current) => !!current?.value).map((current) => `${current.name}~${current.value}`).join(";");
2320
2336
  });
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) => {
2337
+ __publicField$i(this, "getDeleteDocumentParameters", returnExactlyTheSame);
2338
+ __publicField$i(this, "getClearTempFilesParameters", returnExactlyTheSame);
2339
+ __publicField$i(this, "getDocumentInfoParameters", returnExactlyTheSame);
2340
+ __publicField$i(this, "getDownloadMultipleDocumentsParameters", returnExactlyTheSame);
2341
+ __publicField$i(this, "getEditDocumentParameters", returnExactlyTheSame);
2342
+ __publicField$i(this, "getLockDocumentParameters", returnExactlyTheSame);
2343
+ __publicField$i(this, "getMarkFileToSignParameters", returnExactlyTheSame);
2344
+ __publicField$i(this, "getProcessDroppedFilesParameters", returnExactlyTheSame);
2345
+ __publicField$i(this, "getProcessDroppedFilesPostdata", returnExactlyTheSame);
2346
+ __publicField$i(this, "getReloadMetadataParameters", returnExactlyTheSame);
2347
+ __publicField$i(this, "getSaveDroppedFilesParameters", returnExactlyTheSame);
2348
+ __publicField$i(this, "parseFileDefinition", (file) => {
2333
2349
  return {
2334
2350
  ...parseFileDefinition(this.execution, file, false),
2335
2351
  canEdit: file.canEdit || file.canWrite,
2336
2352
  canRead: file.canRead
2337
2353
  };
2338
2354
  });
2339
- __publicField$h(this, "getLoadFileSystemStructureTree", () => ({
2355
+ __publicField$i(this, "getLoadFileSystemStructureTree", () => ({
2340
2356
  useDocTypePermitted: true,
2341
2357
  docTypePermittedObjId: this.docTypePermittedObjId,
2342
2358
  docTypePermittedObjType: this.type
@@ -2809,7 +2825,10 @@ class UploaderApi extends EventEmitter$1 {
2809
2825
  type: "success",
2810
2826
  message: getWindow(this.execution).FILE_UPLOADED_SUCCESSFULLY
2811
2827
  });
2812
- if (isOneClickUploadEnabled(this.modalConfig.oneClickUpload)) {
2828
+ if (isOneClickUploadEnabled(
2829
+ this.execution,
2830
+ this.modalConfig.oneClickUpload
2831
+ ) && !this.state.versioningFile) {
2813
2832
  if (langId && translatingFile)
2814
2833
  void this.confirmDropModal({ langId, translatingFile });
2815
2834
  else
@@ -2843,10 +2862,8 @@ class UploaderApi extends EventEmitter$1 {
2843
2862
  );
2844
2863
  if (isLocked?.data?.locked === true || isLocked?.data?.locked === void 0) {
2845
2864
  if (--tries > 0) {
2846
- this.execution.state.locked = true;
2847
2865
  setTimeout(() => void checkLockAction(), 1e3);
2848
2866
  } else {
2849
- this.execution.state.locked = false;
2850
2867
  this.notify({
2851
2868
  message: getWindow(this.execution).MSG_FAIL_SYNC_DOCUMENT
2852
2869
  });
@@ -2854,7 +2871,6 @@ class UploaderApi extends EventEmitter$1 {
2854
2871
  }
2855
2872
  } else {
2856
2873
  resolve(true);
2857
- this.execution.state.locked = false;
2858
2874
  }
2859
2875
  };
2860
2876
  void checkLockAction();
@@ -2989,6 +3005,7 @@ class UploaderApi extends EventEmitter$1 {
2989
3005
  this.modalController.state = {
2990
3006
  description: general.docDesc,
2991
3007
  docFolder: general.docFolder === "" ? void 0 : Number(general.docFolder),
3008
+ docPath: general.docFolderPath,
2992
3009
  permissions: {
2993
3010
  allowAllType: general.docAllPoolPerm,
2994
3011
  users: arrayOrArray(documentInfo.function.data.permissions?.user).map(
@@ -3033,6 +3050,8 @@ class UploaderApi extends EventEmitter$1 {
3033
3050
  const { permissions } = documentInfo.function.data;
3034
3051
  if (this.modalController) {
3035
3052
  this.modalController.addDirectoryFile(document);
3053
+ this.modalController.state.description = document.docDesc;
3054
+ this.modalController.state.docExpDate = document.docExpDate;
3036
3055
  this.modalController.state.permissions = {
3037
3056
  pools: arrayOrArray(permissions?.pool).map((c) => {
3038
3057
  return {
@@ -3489,10 +3508,10 @@ class UploaderApi extends EventEmitter$1 {
3489
3508
  }
3490
3509
  }
3491
3510
 
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);
3511
+ var __defProp$h = Object.defineProperty;
3512
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3513
+ var __publicField$h = (obj, key, value) => {
3514
+ __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
3496
3515
  return value;
3497
3516
  };
3498
3517
  class FormsUploader extends UploaderApi {
@@ -3507,15 +3526,15 @@ class FormsUploader extends UploaderApi {
3507
3526
  this.type = type;
3508
3527
  this.modalConfig = modalConfig;
3509
3528
  this.field = field;
3510
- __publicField$g(this, "isEditionMode");
3511
- __publicField$g(this, "getAjaxUploadFileStatusParameters", (defaultParameters) => {
3529
+ __publicField$h(this, "isEditionMode");
3530
+ __publicField$h(this, "getAjaxUploadFileStatusParameters", (defaultParameters) => {
3512
3531
  return {
3513
3532
  ...defaultParameters,
3514
3533
  forceDocTypeId: this.field.properties.docType,
3515
3534
  ...this.getFormParameters()
3516
3535
  };
3517
3536
  });
3518
- __publicField$g(this, "getAjaxUploadStartParameters", ({
3537
+ __publicField$h(this, "getAjaxUploadStartParameters", ({
3519
3538
  useDocTypePermitted,
3520
3539
  docTypePermittedObjType,
3521
3540
  docTypePermittedObjId,
@@ -3527,7 +3546,7 @@ class FormsUploader extends UploaderApi {
3527
3546
  ...this.getFormParameters()
3528
3547
  };
3529
3548
  });
3530
- __publicField$g(this, "getCheckLockDocumentParameters", ({
3549
+ __publicField$h(this, "getCheckLockDocumentParameters", ({
3531
3550
  prefix,
3532
3551
  ...parameters
3533
3552
  }) => {
@@ -3536,7 +3555,7 @@ class FormsUploader extends UploaderApi {
3536
3555
  ...this.getFormParameters()
3537
3556
  };
3538
3557
  });
3539
- __publicField$g(this, "getCheckSignatureParameters", (parameters) => {
3558
+ __publicField$h(this, "getCheckSignatureParameters", (parameters) => {
3540
3559
  const { frmId, frmParent } = this.getFormParameters();
3541
3560
  return {
3542
3561
  ...parameters,
@@ -3544,7 +3563,7 @@ class FormsUploader extends UploaderApi {
3544
3563
  frmParent
3545
3564
  };
3546
3565
  });
3547
- __publicField$g(this, "getClearTempFilesParameters", ({
3566
+ __publicField$h(this, "getClearTempFilesParameters", ({
3548
3567
  elemType,
3549
3568
  ...rest
3550
3569
  }) => {
@@ -3557,15 +3576,16 @@ class FormsUploader extends UploaderApi {
3557
3576
  index
3558
3577
  };
3559
3578
  });
3560
- __publicField$g(this, "getConfirmDropModalParameters", (defaultParameters) => {
3579
+ __publicField$h(this, "getConfirmDropModalParameters", (defaultParameters) => {
3580
+ const { frmParent } = this.getFormParameters();
3561
3581
  return {
3562
3582
  ...defaultParameters,
3563
- elemType: this.elemId(),
3583
+ elemType: frmParent,
3564
3584
  forceDocTypeId: this.field.properties.docType,
3565
3585
  ...this.getFormParameters()
3566
3586
  };
3567
3587
  });
3568
- __publicField$g(this, "getConfirmDropModalPostdata", ({
3588
+ __publicField$h(this, "getConfirmDropModalPostdata", ({
3569
3589
  pe,
3570
3590
  ...parameters
3571
3591
  }) => {
@@ -3575,7 +3595,7 @@ class FormsUploader extends UploaderApi {
3575
3595
  editionMode
3576
3596
  };
3577
3597
  });
3578
- __publicField$g(this, "getDeleteDocumentParameters", ({
3598
+ __publicField$h(this, "getDeleteDocumentParameters", ({
3579
3599
  prefix,
3580
3600
  isAjax,
3581
3601
  ...currentParameters
@@ -3586,13 +3606,13 @@ class FormsUploader extends UploaderApi {
3586
3606
  ...rest
3587
3607
  };
3588
3608
  });
3589
- __publicField$g(this, "getDocumentInfoParameters", (parameters) => {
3609
+ __publicField$h(this, "getDocumentInfoParameters", (parameters) => {
3590
3610
  return {
3591
3611
  ...parameters,
3592
3612
  ajaxUrl: getWindow(this.execution).URL_REQUEST_AJAX
3593
3613
  };
3594
3614
  });
3595
- __publicField$g(this, "getEditDocumentParameters", ({ action, docId }) => {
3615
+ __publicField$h(this, "getEditDocumentParameters", ({ action, docId }) => {
3596
3616
  const { prefix, editionMode, ...rest } = this.getFormParameters();
3597
3617
  return {
3598
3618
  action,
@@ -3601,7 +3621,7 @@ class FormsUploader extends UploaderApi {
3601
3621
  ajaxUrl: "apia.execution.FormAction.run"
3602
3622
  };
3603
3623
  });
3604
- __publicField$g(this, "getLoadFilesForFolderParameters", () => {
3624
+ __publicField$h(this, "getLoadFilesForFolderParameters", () => {
3605
3625
  return {
3606
3626
  useDocTypePermitted: this.state.allowedTypes.length === 1 ? true : void 0,
3607
3627
  docTypeForcedId: this.state.allowedTypes.length === 1 ? this.state.allowedTypes[0].id : void 0,
@@ -3609,11 +3629,11 @@ class FormsUploader extends UploaderApi {
3609
3629
  loadFolders: true
3610
3630
  };
3611
3631
  });
3612
- __publicField$g(this, "getLoadFileSystemStructureTree", () => ({
3632
+ __publicField$h(this, "getLoadFileSystemStructureTree", () => ({
3613
3633
  useDocTypePermitted: this.state.allowedTypes.length === 1,
3614
3634
  docTypeForcedId: this.docTypePermittedObjId
3615
3635
  }));
3616
- __publicField$g(this, "getLockDocumentParameters", ({
3636
+ __publicField$h(this, "getLockDocumentParameters", ({
3617
3637
  prefix,
3618
3638
  isAjax,
3619
3639
  ...currentParameters
@@ -3624,7 +3644,7 @@ class FormsUploader extends UploaderApi {
3624
3644
  ...rest
3625
3645
  };
3626
3646
  });
3627
- __publicField$g(this, "getMarkFileToSignParameters", ({
3647
+ __publicField$h(this, "getMarkFileToSignParameters", ({
3628
3648
  docId,
3629
3649
  prefix,
3630
3650
  ...defaultParameters
@@ -3636,7 +3656,7 @@ class FormsUploader extends UploaderApi {
3636
3656
  ...this.getFormParameters()
3637
3657
  };
3638
3658
  });
3639
- __publicField$g(this, "getProcessDroppedFilesParameters", (defaultParameters) => {
3659
+ __publicField$h(this, "getProcessDroppedFilesParameters", (defaultParameters) => {
3640
3660
  const { prefix, ...rest } = this.getFormParameters();
3641
3661
  return {
3642
3662
  ...defaultParameters,
@@ -3645,7 +3665,7 @@ class FormsUploader extends UploaderApi {
3645
3665
  ...rest
3646
3666
  };
3647
3667
  });
3648
- __publicField$g(this, "getProcessDroppedFilesPostdata", ({
3668
+ __publicField$h(this, "getProcessDroppedFilesPostdata", ({
3649
3669
  useDocTypePermitted,
3650
3670
  docTypePermittedObjId,
3651
3671
  docTypePermittedObjType,
@@ -3653,14 +3673,14 @@ class FormsUploader extends UploaderApi {
3653
3673
  }) => {
3654
3674
  return { ...parameters, editionMode: this.getFormParameters().editionMode };
3655
3675
  });
3656
- __publicField$g(this, "getReloadMetadataParameters", (defaultParameters) => {
3676
+ __publicField$h(this, "getReloadMetadataParameters", (defaultParameters) => {
3657
3677
  return {
3658
3678
  ...defaultParameters,
3659
3679
  ...getWindow(this.execution).IS_EDIT_GRID ? { editionMode: true } : null,
3660
3680
  ...this.getFormParameters()
3661
3681
  };
3662
3682
  });
3663
- __publicField$g(this, "getSaveDroppedFilesParameters", (defaultParameters) => {
3683
+ __publicField$h(this, "getSaveDroppedFilesParameters", (defaultParameters) => {
3664
3684
  const elemId = this.elemId();
3665
3685
  const { prefix, ...rest } = this.getFormParameters();
3666
3686
  return {
@@ -3671,7 +3691,7 @@ class FormsUploader extends UploaderApi {
3671
3691
  ...rest
3672
3692
  };
3673
3693
  });
3674
- __publicField$g(this, "parseFileDefinition", (file) => {
3694
+ __publicField$h(this, "parseFileDefinition", (file) => {
3675
3695
  return {
3676
3696
  ...parseFileDefinition(
3677
3697
  this.execution,
@@ -3689,7 +3709,7 @@ class FormsUploader extends UploaderApi {
3689
3709
  return this.field.definition.multIdx ?? this.field.definition.index ?? 0;
3690
3710
  }
3691
3711
  elemId() {
3692
- return `dropUpprDiv${this.field.properties.id}_${this.index()}${getWindow(this.execution).IS_EDIT_GRID_MODAL ? "_true_Mdl" : ""}`;
3712
+ 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
3713
  }
3694
3714
  filterByFilesAmountLimit(files) {
3695
3715
  const inProgressFiles = this.state.inProgressFiles;
@@ -3731,18 +3751,16 @@ class FormsUploader extends UploaderApi {
3731
3751
  }
3732
3752
  };
3733
3753
  }
3734
- async downloadDocument(fileId) {
3754
+ async downloadDocument(fileId, version) {
3735
3755
  const file = this.getDocument(fileId);
3736
- const { prefix, ...rest } = this.getFormParameters();
3737
3756
  if (!file)
3738
3757
  return;
3739
3758
  if (getWindow(this.execution).IN_MONITOR || await this.checkWebDavLock(file.docId))
3740
3759
  await downloadUrl(
3741
3760
  makeApiaUrl(this.execution, {
3742
- action: "download",
3761
+ action: "downloadDocument",
3743
3762
  docId: file.downloadDocId,
3744
- ajaxUrl: "/page/generic/downloadAttDoc.jsp",
3745
- ...rest
3763
+ version
3746
3764
  })
3747
3765
  );
3748
3766
  }
@@ -3754,16 +3772,16 @@ class FormsUploader extends UploaderApi {
3754
3772
  }
3755
3773
  }
3756
3774
 
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);
3775
+ var __defProp$g = Object.defineProperty;
3776
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3777
+ var __publicField$g = (obj, key, value) => {
3778
+ __defNormalProp$g(obj, key + "" , value);
3761
3779
  return value;
3762
3780
  };
3763
3781
  class File extends FieldWithAttribute {
3764
3782
  constructor() {
3765
3783
  super(...arguments);
3766
- __publicField$f(this, "uploader", {});
3784
+ __publicField$g(this, "uploader", {});
3767
3785
  }
3768
3786
  async init(form) {
3769
3787
  await super.init(form);
@@ -3812,7 +3830,7 @@ class File extends FieldWithAttribute {
3812
3830
  }
3813
3831
  }
3814
3832
  async validate() {
3815
- if (this.properties.disabled || this.properties.noModify) {
3833
+ if (this.properties.disabled || this.properties.noModify || this.properties.visibilityHidden) {
3816
3834
  return true;
3817
3835
  } else if (this.properties.required && Object.values(this.uploader.state.files).length == 0) {
3818
3836
  this.state.validation.errorMessage = labels.errorFieldRequired(
@@ -3865,27 +3883,27 @@ function noNaN(number, defaultReturn = 0) {
3865
3883
  return returnNumber;
3866
3884
  }
3867
3885
 
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);
3886
+ var __defProp$f = Object.defineProperty;
3887
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3888
+ var __publicField$f = (obj, key, value) => {
3889
+ __defNormalProp$f(obj, key + "" , value);
3872
3890
  return value;
3873
3891
  };
3874
- var __accessCheck$i = (obj, member, msg) => {
3892
+ var __accessCheck$j = (obj, member, msg) => {
3875
3893
  if (!member.has(obj))
3876
3894
  throw TypeError("Cannot " + msg);
3877
3895
  };
3878
- var __privateGet$i = (obj, member, getter) => {
3879
- __accessCheck$i(obj, member, "read from private field");
3896
+ var __privateGet$j = (obj, member, getter) => {
3897
+ __accessCheck$j(obj, member, "read from private field");
3880
3898
  return getter ? getter.call(obj) : member.get(obj);
3881
3899
  };
3882
- var __privateAdd$i = (obj, member, value) => {
3900
+ var __privateAdd$j = (obj, member, value) => {
3883
3901
  if (member.has(obj))
3884
3902
  throw TypeError("Cannot add the same private member more than once");
3885
3903
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
3886
3904
  };
3887
- var __privateSet$i = (obj, member, value, setter) => {
3888
- __accessCheck$i(obj, member, "write to private field");
3905
+ var __privateSet$j = (obj, member, value, setter) => {
3906
+ __accessCheck$j(obj, member, "write to private field");
3889
3907
  member.set(obj, value);
3890
3908
  return value;
3891
3909
  };
@@ -3893,17 +3911,17 @@ var _unsubscribeTableEvents;
3893
3911
  class GridFooterHandler {
3894
3912
  constructor(grid) {
3895
3913
  this.grid = grid;
3896
- __publicField$e(this, "state", {
3914
+ __publicField$f(this, "state", {
3897
3915
  isSortUpDisabled: true,
3898
3916
  isSortDownDisabled: true
3899
3917
  });
3900
- __privateAdd$i(this, _unsubscribeTableEvents, () => {
3918
+ __privateAdd$j(this, _unsubscribeTableEvents, () => {
3901
3919
  });
3902
3920
  makeObservable(this, { state: observable });
3903
3921
  this.init();
3904
3922
  }
3905
3923
  init() {
3906
- __privateGet$i(this, _unsubscribeTableEvents).call(this);
3924
+ __privateGet$j(this, _unsubscribeTableEvents).call(this);
3907
3925
  const controller = this.grid.controller;
3908
3926
  const u2 = controller.on("selectionChange", (selection) => {
3909
3927
  const { paged, currentPage, pages } = this.grid.properties;
@@ -3918,7 +3936,7 @@ class GridFooterHandler {
3918
3936
  ));
3919
3937
  });
3920
3938
  });
3921
- __privateSet$i(this, _unsubscribeTableEvents, () => {
3939
+ __privateSet$j(this, _unsubscribeTableEvents, () => {
3922
3940
  u2();
3923
3941
  });
3924
3942
  }
@@ -3993,15 +4011,15 @@ class HeaderCell extends Cell {
3993
4011
  }
3994
4012
  }
3995
4013
 
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);
4014
+ var __defProp$e = Object.defineProperty;
4015
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4016
+ var __publicField$e = (obj, key, value) => {
4017
+ __defNormalProp$e(obj, key + "" , value);
4000
4018
  return value;
4001
4019
  };
4002
4020
  class FieldsCache {
4003
4021
  constructor() {
4004
- __publicField$d(this, "cached", {});
4022
+ __publicField$e(this, "cached", {});
4005
4023
  }
4006
4024
  getIndex(index) {
4007
4025
  if (!this.cached[index])
@@ -4034,10 +4052,10 @@ class FieldsCache {
4034
4052
  }
4035
4053
  }
4036
4054
 
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);
4055
+ var __defProp$d = Object.defineProperty;
4056
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4057
+ var __publicField$d = (obj, key, value) => {
4058
+ __defNormalProp$d(obj, key + "" , value);
4041
4059
  return value;
4042
4060
  };
4043
4061
  class ModalInput extends FieldWithAttribute {
@@ -4049,11 +4067,11 @@ class ModalInput extends FieldWithAttribute {
4049
4067
  },
4050
4068
  value: { storeValue: value, showValue: definition.qry_show_value }
4051
4069
  });
4052
- __publicField$c(this, "isLoading", false);
4070
+ __publicField$d(this, "isLoading", false);
4053
4071
  makeObservable(this, { isLoading: observable });
4054
4072
  }
4055
- fireEvent(eventName) {
4056
- return super.fireEvent(eventName);
4073
+ fireEvent(eventName, options) {
4074
+ return super.fireEvent(eventName, options);
4057
4075
  }
4058
4076
  hasValue() {
4059
4077
  return this.getValue().showValue !== "" && this.getValue().storeValue !== "";
@@ -4140,7 +4158,7 @@ class ModalInput extends FieldWithAttribute {
4140
4158
  return true;
4141
4159
  }
4142
4160
  setValue(newValue, options) {
4143
- if (isFieldShowAsText(this) || shallowEqual$1(newValue, this.getValue()))
4161
+ if (!options?.force && (isFieldShowAsText(this) || shallowEqual$1(newValue, this.getValue())))
4144
4162
  return Promise.resolve(true);
4145
4163
  this.state.value = newValue;
4146
4164
  this.state.validation.errorMessage = null;
@@ -4172,10 +4190,10 @@ class ModalInput extends FieldWithAttribute {
4172
4190
  class Hidden extends FieldWithAttribute {
4173
4191
  }
4174
4192
 
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);
4193
+ var __defProp$c = Object.defineProperty;
4194
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4195
+ var __publicField$c = (obj, key, value) => {
4196
+ __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
4179
4197
  return value;
4180
4198
  };
4181
4199
  async function inlineCaller(cb, _t) {
@@ -4185,7 +4203,7 @@ async function inlineTimeout(cb, _t) {
4185
4203
  setTimeout(cb, _t);
4186
4204
  return Promise.resolve(true);
4187
4205
  }
4188
- class Grid extends Field$1 {
4206
+ class Grid extends Field {
4189
4207
  constructor({ properties, field, ...definition }) {
4190
4208
  super({
4191
4209
  ...definition,
@@ -4204,19 +4222,19 @@ class Grid extends Field$1 {
4204
4222
  hideDocInfoButton: String(properties.hideDocInfoButton) === "true"
4205
4223
  }
4206
4224
  });
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({
4225
+ __publicField$c(this, "rowId", 0);
4226
+ __publicField$c(this, "cache", new FieldsCache());
4227
+ __publicField$c(this, "mutex", new Mutex());
4228
+ __publicField$c(this, "newRowStates", []);
4229
+ __publicField$c(this, "initialStates");
4230
+ __publicField$c(this, "fieldsDefinitions");
4231
+ __publicField$c(this, "managedAttIds", /* @__PURE__ */ new Set());
4232
+ __publicField$c(this, "managedAttNames", /* @__PURE__ */ new Set());
4233
+ __publicField$c(this, "managedFieldIds", /* @__PURE__ */ new Set());
4234
+ __publicField$c(this, "managedFieldsNames", /* @__PURE__ */ new Set());
4235
+ __publicField$c(this, "_editionModalHandler", null);
4236
+ __publicField$c(this, "_footerController");
4237
+ __publicField$c(this, "tableController", new TableController({
4220
4238
  allowEdition: true,
4221
4239
  allowSelection: true,
4222
4240
  isSelectionMultiple: true
@@ -4768,7 +4786,7 @@ class Grid extends Field$1 {
4768
4786
  for await (const row of this.tableController.body.rows) {
4769
4787
  for await (const cell of row.cells) {
4770
4788
  const field = cell.getState("properties")?.field;
4771
- if (field instanceof Field$1) {
4789
+ if (field instanceof Field) {
4772
4790
  const result = await field.validate();
4773
4791
  if (!result && isValid && !firstInvalid) {
4774
4792
  isValid = false;
@@ -5204,12 +5222,23 @@ class GridPaginated extends Grid {
5204
5222
  }
5205
5223
  }
5206
5224
 
5207
- class Image extends Field$1 {
5225
+ class Image extends Field {
5208
5226
  }
5209
5227
 
5228
+ var __defProp$b = Object.defineProperty;
5229
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5230
+ var __publicField$b = (obj, key, value) => {
5231
+ __defNormalProp$b(obj, key + "" , value);
5232
+ return value;
5233
+ };
5234
+ dayjs.extend(customParseFormat);
5210
5235
  class Input extends TranslatableField {
5211
- fireEvent(eventName) {
5212
- return super.fireEvent(eventName);
5236
+ constructor() {
5237
+ super(...arguments);
5238
+ __publicField$b(this, "validDate", true);
5239
+ }
5240
+ fireEvent(eventName, options) {
5241
+ return super.fireEvent(eventName, options);
5213
5242
  }
5214
5243
  async setValue(newValue, options) {
5215
5244
  if (this.attribute.valueType === "S") {
@@ -5221,16 +5250,30 @@ class Input extends TranslatableField {
5221
5250
  } else if (this.attribute.valueType === "N") {
5222
5251
  super.setValue(String(newValue), options);
5223
5252
  } else if (this.attribute.valueType === "D") {
5253
+ this.validDate = true;
5254
+ const inFmt = getDateFormat(options?.format);
5255
+ const outFmt = getDateFormat();
5224
5256
  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
- );
5257
+ const d = dayjs(newValue.trim(), inFmt, true);
5258
+ if (!d.isValid() && newValue.trim() !== "") {
5259
+ this.state.validation.errorMessage = getLabel(
5260
+ this.getForm().execution,
5261
+ "msgInvalidDate"
5262
+ ).text;
5263
+ this.validDate = false;
5264
+ }
5265
+ return super.setValue(d.isValid() ? d.format(outFmt) : "", options);
5266
+ }
5267
+ if (newValue instanceof Date) {
5268
+ const d = dayjs(newValue);
5269
+ if (!d.isValid()) {
5270
+ this.state.validation.errorMessage = getLabel(
5271
+ this.getForm().execution,
5272
+ "msgInvalidDate"
5273
+ ).text;
5274
+ this.validDate = false;
5275
+ }
5276
+ return super.setValue(d.isValid() ? d.format(outFmt) : "", options);
5234
5277
  }
5235
5278
  }
5236
5279
  return false;
@@ -5248,19 +5291,19 @@ class Input extends TranslatableField {
5248
5291
  return true;
5249
5292
  }
5250
5293
  async validate() {
5251
- if (this.state.validation.errorMessage)
5294
+ if (this.state.validation.errorMessage && !this.validDate)
5252
5295
  return false;
5253
5296
  return super.validate();
5254
5297
  }
5255
5298
  isValidValue() {
5256
- return !!this.getValue().trim();
5299
+ return !!String(this.getValue()).trim();
5257
5300
  }
5258
5301
  }
5259
5302
 
5260
- class Label extends Field$1 {
5303
+ class Label extends Field {
5261
5304
  }
5262
5305
 
5263
- class Link extends Field$1 {
5306
+ class Link extends Field {
5264
5307
  }
5265
5308
 
5266
5309
  class Multiple extends FieldWithAttribute {
@@ -5301,7 +5344,7 @@ class Multiple extends FieldWithAttribute {
5301
5344
 
5302
5345
  class Password extends FieldWithAttribute {
5303
5346
  isValidValue() {
5304
- return !!this.getValue().trim();
5347
+ return !!String(this.getValue()).trim();
5305
5348
  }
5306
5349
  }
5307
5350
 
@@ -5316,8 +5359,8 @@ class Radio extends FieldWithAttribute {
5316
5359
  await super.init(form);
5317
5360
  await this.fireEvent("onPopulate");
5318
5361
  }
5319
- fireEvent(eventName) {
5320
- return super.fireEvent(eventName);
5362
+ fireEvent(eventName, options) {
5363
+ return super.fireEvent(eventName, options);
5321
5364
  }
5322
5365
  }
5323
5366
 
@@ -5344,11 +5387,11 @@ class Select extends FieldWithAttribute {
5344
5387
 
5345
5388
  class Textarea extends TranslatableField {
5346
5389
  isValidValue() {
5347
- return !!this.getValue().trim();
5390
+ return !!String(this.getValue()).trim();
5348
5391
  }
5349
5392
  }
5350
5393
 
5351
- class Title extends Field$1 {
5394
+ class Title extends Field {
5352
5395
  }
5353
5396
 
5354
5397
  var __defProp$a = Object.defineProperty;
@@ -5404,8 +5447,8 @@ class Tree extends FieldWithAttribute {
5404
5447
  }
5405
5448
  };
5406
5449
  }
5407
- fireEvent(eventName) {
5408
- return super.fireEvent(eventName);
5450
+ fireEvent(eventName, options) {
5451
+ return super.fireEvent(eventName, options);
5409
5452
  }
5410
5453
  hasValue() {
5411
5454
  return this.state.value.length > 0;
@@ -5465,16 +5508,10 @@ var __publicField$9 = (obj, key, value) => {
5465
5508
  __defNormalProp$9(obj, key + "" , value);
5466
5509
  return value;
5467
5510
  };
5468
- class SchedulerField extends Field$1 {
5511
+ class SchedulerField extends Field {
5469
5512
  constructor(definition) {
5470
5513
  super(definition);
5471
5514
  __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
5515
  }
5479
5516
  async deleteDate() {
5480
5517
  const res = await get(
@@ -5510,7 +5547,19 @@ class SchedulerField extends Field$1 {
5510
5547
  }
5511
5548
  async init(form) {
5512
5549
  await super.init(form);
5513
- this._schedController.loadWeek();
5550
+ this._schedController = new Scheduler(
5551
+ this.parsedInitialProperties,
5552
+ {
5553
+ loadWeek: this.loadWeek.bind(this),
5554
+ deleteDate: this.deleteDate.bind(this),
5555
+ markDay: this.markDay.bind(this),
5556
+ loadInfo: this.loadInfo.bind(this)
5557
+ },
5558
+ "Scheduler",
5559
+ getWindow(this.getForm().execution)
5560
+ );
5561
+ if (this._schedController)
5562
+ this._schedController.loadWeek();
5514
5563
  }
5515
5564
  async loadWeek(weekDay, schId, proId, proVerId, tskId) {
5516
5565
  const res = await get(
@@ -5558,7 +5607,7 @@ class SchedulerField extends Field$1 {
5558
5607
  }
5559
5608
  }
5560
5609
 
5561
- const Field = {
5610
+ const FieldConstants = Object.freeze({
5562
5611
  // field types
5563
5612
  TYPE_INPUT: "input",
5564
5613
  TYPE_SELECT: "select",
@@ -5578,16 +5627,6 @@ const Field = {
5578
5627
  TYPE_EDITOR: "editor",
5579
5628
  TYPE_TREE: "tree",
5580
5629
  TYPE_CAPTCHA: "captcha",
5581
- // field functions
5582
- FUNC_CLICK: "onclick",
5583
- FUNC_CHANGE: "onchange",
5584
- FUNC_MODAL_RETURN: "onmodalreturn",
5585
- FUNC_ROW_ADD: "onrowadd",
5586
- FUNC_ROW_DELETE: "onrowdelete",
5587
- FUNC_ROW_SORT: "onrowsort",
5588
- FUNC_COL_SELECT: "oncolselect",
5589
- // Attribute w/ props json for fields
5590
- FIELD_PROPERTIES: "properties",
5591
5630
  // Field properties
5592
5631
  PROPERTY_NAME: "name",
5593
5632
  PROPERTY_SIZE: "size",
@@ -5691,84 +5730,22 @@ const Field = {
5691
5730
  PROPERTY_INPUT_TYPE: "inputType",
5692
5731
  PROPERTY_PLACE_HOLDER: "placeHolder",
5693
5732
  PROPERTY_TITLE: "title"
5694
- };
5733
+ });
5695
5734
 
5696
- const Form$1 = {
5697
- FUNC_LOAD: "onload",
5698
- FUNC_RELOAD: "onreload",
5699
- PROPERTY_FORM_INVISIBLE: "frmInvisible",
5735
+ const FormConstants = Object.freeze({
5700
5736
  PROPERTY_FORM_HIDDEN: "frmHidden",
5737
+ PROPERTY_FORM_HIGHLIGHT: "frmHighlight",
5701
5738
  PROPERTY_FORM_CLOSED: "prpFrmClosed",
5702
5739
  PROPERTY_FORM_TAB: "frmTab",
5703
- PROPERTY_FORM_HIGHLIGHT: "frmHighlight",
5704
5740
  PROPERTY_FORM_DONT_FIRE: "frmDontFire",
5705
- PROPERTY_FORM_READONLY: "readOnly",
5706
- SIGNABLE_FORM: "signableForm",
5707
- MARKED_TO_SIGN: "markedToSign",
5708
- REQUIRED_SIGN: "requiredSignableForm",
5709
- LANGUAGES: "langs"
5710
- };
5741
+ PROPERTY_FORM_READONLY: "readOnly"
5742
+ });
5711
5743
 
5712
5744
  const IProperty = {
5713
- ...Field,
5714
- ...Form$1
5745
+ ...FieldConstants,
5746
+ ...FormConstants
5715
5747
  };
5716
5748
 
5717
- class ButtonsAction {
5718
- constructor(button) {
5719
- this.button = button;
5720
- makeObservable(this, {
5721
- button: observable
5722
- });
5723
- }
5724
- update(props) {
5725
- if (this.button) {
5726
- this.button = { ...this.button, ...props };
5727
- }
5728
- }
5729
- get action() {
5730
- return this;
5731
- }
5732
- get disabled() {
5733
- return this.button.disabled;
5734
- }
5735
- get props() {
5736
- const properties = {
5737
- disabled: this.button.disabled,
5738
- hidden: this.button.hidden,
5739
- loading: this.button.isLoading
5740
- };
5741
- return properties;
5742
- }
5743
- get label() {
5744
- return this.button?.label;
5745
- }
5746
- get title() {
5747
- return this.button?.title ?? "";
5748
- }
5749
- get variant() {
5750
- return this.button?.variant ?? "";
5751
- }
5752
- set title(title) {
5753
- this.update({ title });
5754
- }
5755
- set variant(variant) {
5756
- this.update({ variant });
5757
- }
5758
- disable() {
5759
- this.update({ disabled: true });
5760
- }
5761
- enable() {
5762
- this.update({ disabled: false });
5763
- }
5764
- hide() {
5765
- this.update({ hidden: true });
5766
- }
5767
- show() {
5768
- this.update({ hidden: false });
5769
- }
5770
- }
5771
-
5772
5749
  var __defProp$8 = Object.defineProperty;
5773
5750
  var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5774
5751
  var __publicField$8 = (obj, key, value) => {
@@ -5778,6 +5755,7 @@ var __publicField$8 = (obj, key, value) => {
5778
5755
  const _ActionsController = class _ActionsController {
5779
5756
  constructor() {
5780
5757
  __publicField$8(this, "buttons", /* @__PURE__ */ new Map());
5758
+ makeAutoObservable(this);
5781
5759
  }
5782
5760
  static get instance() {
5783
5761
  if (!_ActionsController._instance) {
@@ -5785,29 +5763,32 @@ const _ActionsController = class _ActionsController {
5785
5763
  }
5786
5764
  return _ActionsController._instance;
5787
5765
  }
5788
- addButton(button) {
5789
- if (this.buttons.has(button.id))
5790
- return;
5791
- this.buttons.set(
5792
- button.id,
5793
- new ButtonsAction({
5794
- ...{
5795
- isLoading: false,
5796
- disabled: false,
5797
- hidden: false
5798
- },
5799
- ...button
5800
- })
5801
- );
5802
- }
5803
- getButton(id) {
5804
- if (this.buttons.has(id)) {
5805
- return this.buttons.get(id);
5766
+ get(id) {
5767
+ if (!this.buttons.has(id)) {
5768
+ this.buttons.set(id, {});
5806
5769
  }
5807
- throw Error("That button not exist");
5770
+ return this.buttons.get(id);
5808
5771
  }
5809
- };
5810
- __publicField$8(_ActionsController, "CONFIRM", 0);
5772
+ disable(id) {
5773
+ this.get(id).disabled = true;
5774
+ }
5775
+ enable(id) {
5776
+ this.get(id).disabled = false;
5777
+ }
5778
+ hide(id) {
5779
+ this.get(id).hidden = true;
5780
+ }
5781
+ isDisabled(id) {
5782
+ return !!this.get(id).disabled;
5783
+ }
5784
+ isHidden(id) {
5785
+ return !!this.get(id).hidden;
5786
+ }
5787
+ show(id) {
5788
+ this.get(id).hidden = false;
5789
+ }
5790
+ };
5791
+ __publicField$8(_ActionsController, "CONFIRM", 0);
5811
5792
  __publicField$8(_ActionsController, "NEXT", 1);
5812
5793
  __publicField$8(_ActionsController, "PREVIOUS", 2);
5813
5794
  __publicField$8(_ActionsController, "SIGN", 3);
@@ -5818,76 +5799,87 @@ __publicField$8(_ActionsController, "SHARE", 7);
5818
5799
  __publicField$8(_ActionsController, "PRINT", 8);
5819
5800
  __publicField$8(_ActionsController, "VIEW_DOCS", 9);
5820
5801
  __publicField$8(_ActionsController, "CLOSE", 10);
5802
+ __publicField$8(_ActionsController, "SEND_TO_DESK", 11);
5803
+ __publicField$8(_ActionsController, "BTN_CONFIRM", _ActionsController.CONFIRM);
5804
+ __publicField$8(_ActionsController, "BTN_DELEGATE", _ActionsController.DELEGATE);
5805
+ __publicField$8(_ActionsController, "BTN_NEXT", _ActionsController.NEXT);
5806
+ __publicField$8(_ActionsController, "BTN_PERV", _ActionsController.PREVIOUS);
5807
+ __publicField$8(_ActionsController, "BTN_RELEASE", _ActionsController.RELEASE);
5808
+ __publicField$8(_ActionsController, "BTN_SAVE", _ActionsController.SAVE);
5809
+ __publicField$8(_ActionsController, "BTN_SHARE", _ActionsController.SHARE);
5810
+ __publicField$8(_ActionsController, "BTN_SIGN", _ActionsController.SIGN);
5821
5811
  __publicField$8(_ActionsController, "_instance");
5822
5812
  let ActionsController = _ActionsController;
5823
5813
 
5824
- var __accessCheck$h = (obj, member, msg) => {
5814
+ var __accessCheck$i = (obj, member, msg) => {
5825
5815
  if (!member.has(obj))
5826
5816
  throw TypeError("Cannot " + msg);
5827
5817
  };
5828
- var __privateGet$h = (obj, member, getter) => {
5829
- __accessCheck$h(obj, member, "read from private field");
5818
+ var __privateGet$i = (obj, member, getter) => {
5819
+ __accessCheck$i(obj, member, "read from private field");
5830
5820
  return getter ? getter.call(obj) : member.get(obj);
5831
5821
  };
5832
- var __privateAdd$h = (obj, member, value) => {
5822
+ var __privateAdd$i = (obj, member, value) => {
5833
5823
  if (member.has(obj))
5834
5824
  throw TypeError("Cannot add the same private member more than once");
5835
5825
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5836
5826
  };
5837
- var __privateSet$h = (obj, member, value, setter) => {
5838
- __accessCheck$h(obj, member, "write to private field");
5827
+ var __privateSet$i = (obj, member, value, setter) => {
5828
+ __accessCheck$i(obj, member, "write to private field");
5839
5829
  member.set(obj, value);
5840
5830
  return value;
5841
5831
  };
5842
- var _field$e;
5832
+ var _execution$3, _field$e;
5843
5833
  class ApiaField {
5844
5834
  constructor(execution, field) {
5845
- this.execution = execution;
5846
- __privateAdd$h(this, _field$e, void 0);
5847
- __privateSet$h(this, _field$e, field);
5835
+ __privateAdd$i(this, _execution$3, void 0);
5836
+ __privateAdd$i(this, _field$e, void 0);
5837
+ __privateSet$i(this, _execution$3, execution);
5838
+ __privateSet$i(this, _field$e, field);
5848
5839
  }
5849
5840
  get fldType() {
5850
- return __privateGet$h(this, _field$e).definition.fieldType;
5841
+ return __privateGet$i(this, _field$e).definition.fieldType;
5851
5842
  }
5852
5843
  get fldId() {
5853
- return __privateGet$h(this, _field$e).definition.id;
5844
+ return __privateGet$i(this, _field$e).definition.id;
5854
5845
  }
5855
5846
  get form() {
5856
- return new ApiaForm(this.execution, __privateGet$h(this, _field$e).getForm());
5847
+ return new ApiaForm(__privateGet$i(this, _execution$3), __privateGet$i(this, _field$e).getForm());
5857
5848
  }
5858
5849
  get index() {
5859
- return __privateGet$h(this, _field$e).definition.index || 0;
5850
+ return __privateGet$i(this, _field$e).definition.index || 0;
5860
5851
  }
5861
5852
  setProperty(name, value) {
5862
- __privateGet$h(this, _field$e).setProperty(name, value);
5853
+ __privateGet$i(this, _field$e).setProperty(name, value);
5863
5854
  }
5864
5855
  getProperty(name) {
5865
- return __privateGet$h(this, _field$e).getProperty(name);
5856
+ return __privateGet$i(this, _field$e).getProperty(name);
5866
5857
  }
5867
5858
  setFocus() {
5868
5859
  throw new Error("Method not implemented. ");
5869
5860
  }
5870
5861
  isInGrid() {
5871
- return !!__privateGet$h(this, _field$e).properties.inGrid;
5862
+ return !!__privateGet$i(this, _field$e).properties.inGrid;
5872
5863
  }
5873
5864
  }
5865
+ _execution$3 = new WeakMap();
5874
5866
  _field$e = new WeakMap();
5875
5867
 
5876
- var __accessCheck$g = (obj, member, msg) => {
5868
+ var __accessCheck$h = (obj, member, msg) => {
5877
5869
  if (!member.has(obj))
5878
5870
  throw TypeError("Cannot " + msg);
5879
5871
  };
5880
- var __privateGet$g = (obj, member, getter) => {
5881
- __accessCheck$g(obj, member, "read from private field");
5872
+ var __privateGet$h = (obj, member, getter) => {
5873
+ __accessCheck$h(obj, member, "read from private field");
5882
5874
  return getter ? getter.call(obj) : member.get(obj);
5883
5875
  };
5884
- var __privateAdd$g = (obj, member, value) => {
5876
+ var __privateAdd$h = (obj, member, value) => {
5885
5877
  if (member.has(obj))
5886
5878
  throw TypeError("Cannot add the same private member more than once");
5887
5879
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5888
5880
  };
5889
- var __privateSet$g = (obj, member, value, setter) => {
5890
- __accessCheck$g(obj, member, "write to private field");
5881
+ var __privateSet$h = (obj, member, value, setter) => {
5882
+ __accessCheck$h(obj, member, "write to private field");
5891
5883
  member.set(obj, value);
5892
5884
  return value;
5893
5885
  };
@@ -5895,22 +5887,22 @@ var _field$d;
5895
5887
  class ButtonField extends ApiaField {
5896
5888
  constructor(execution, field) {
5897
5889
  super(execution, field);
5898
- __privateAdd$g(this, _field$d, void 0);
5899
- __privateSet$g(this, _field$d, field);
5890
+ __privateAdd$h(this, _field$d, void 0);
5891
+ __privateSet$h(this, _field$d, field);
5900
5892
  }
5901
5893
  fireClickEvent() {
5902
- if (__privateGet$g(this, _field$d).definition.id) {
5903
- __privateGet$g(this, _field$d).fireEvent("onClick");
5894
+ if (__privateGet$h(this, _field$d).definition.id) {
5895
+ __privateGet$h(this, _field$d).fireEvent("onClick");
5904
5896
  }
5905
5897
  }
5906
5898
  getValue() {
5907
- if (__privateGet$g(this, _field$d).definition.id) {
5908
- return __privateGet$g(this, _field$d).properties.value ?? "";
5899
+ if (__privateGet$h(this, _field$d).definition.id) {
5900
+ return __privateGet$h(this, _field$d).properties.value ?? "";
5909
5901
  }
5910
5902
  return null;
5911
5903
  }
5912
5904
  clearValue() {
5913
- __privateGet$g(this, _field$d).properties.value = "";
5905
+ __privateGet$h(this, _field$d).properties.value = "";
5914
5906
  }
5915
5907
  setValue(value) {
5916
5908
  this.setProperty("value", value);
@@ -5918,65 +5910,64 @@ class ButtonField extends ApiaField {
5918
5910
  }
5919
5911
  _field$d = new WeakMap();
5920
5912
 
5921
- var __accessCheck$f = (obj, member, msg) => {
5913
+ var __accessCheck$g = (obj, member, msg) => {
5922
5914
  if (!member.has(obj))
5923
5915
  throw TypeError("Cannot " + msg);
5924
5916
  };
5925
- var __privateGet$f = (obj, member, getter) => {
5926
- __accessCheck$f(obj, member, "read from private field");
5917
+ var __privateGet$g = (obj, member, getter) => {
5918
+ __accessCheck$g(obj, member, "read from private field");
5927
5919
  return getter ? getter.call(obj) : member.get(obj);
5928
5920
  };
5929
- var __privateAdd$f = (obj, member, value) => {
5921
+ var __privateAdd$g = (obj, member, value) => {
5930
5922
  if (member.has(obj))
5931
5923
  throw TypeError("Cannot add the same private member more than once");
5932
5924
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5933
5925
  };
5934
- var __privateSet$f = (obj, member, value, setter) => {
5935
- __accessCheck$f(obj, member, "write to private field");
5926
+ var __privateSet$g = (obj, member, value, setter) => {
5927
+ __accessCheck$g(obj, member, "write to private field");
5936
5928
  member.set(obj, value);
5937
5929
  return value;
5938
5930
  };
5939
5931
  var _attribute, _field$c;
5940
5932
  class ApiaAttribute {
5941
5933
  constructor(attribute) {
5942
- __privateAdd$f(this, _attribute, void 0);
5943
- __privateSet$f(this, _attribute, attribute);
5934
+ __privateAdd$g(this, _attribute, void 0);
5935
+ __privateSet$g(this, _attribute, attribute);
5944
5936
  }
5945
5937
  get attLabel() {
5946
- return __privateGet$f(this, _attribute).title;
5938
+ return __privateGet$g(this, _attribute).title;
5947
5939
  }
5948
5940
  get name() {
5949
- return __privateGet$f(this, _attribute).name;
5941
+ return __privateGet$g(this, _attribute).name;
5950
5942
  }
5951
5943
  get id() {
5952
- return __privateGet$f(this, _attribute).id;
5944
+ return __privateGet$g(this, _attribute).id;
5953
5945
  }
5954
5946
  get valueType() {
5955
- return __privateGet$f(this, _attribute).valueType;
5947
+ return __privateGet$g(this, _attribute).valueType;
5956
5948
  }
5957
5949
  }
5958
5950
  _attribute = new WeakMap();
5959
5951
  class ApiaFieldWithAttribute extends ApiaField {
5960
5952
  constructor(execution, field) {
5961
5953
  super(execution, field);
5962
- this.execution = execution;
5963
- __privateAdd$f(this, _field$c, void 0);
5964
- __privateSet$f(this, _field$c, field);
5954
+ __privateAdd$g(this, _field$c, void 0);
5955
+ __privateSet$g(this, _field$c, field);
5965
5956
  }
5966
5957
  get attribute() {
5967
- return new ApiaAttribute(__privateGet$f(this, _field$c).attribute);
5958
+ return new ApiaAttribute(__privateGet$g(this, _field$c).attribute);
5968
5959
  }
5969
5960
  clearValue() {
5970
- __privateGet$f(this, _field$c).setValue("");
5961
+ __privateGet$g(this, _field$c).setValue("");
5971
5962
  }
5972
5963
  getValue() {
5973
- return __privateGet$f(this, _field$c).getValue();
5964
+ return __privateGet$g(this, _field$c).getValue();
5974
5965
  }
5975
5966
  setValue(v) {
5976
- __privateGet$f(this, _field$c).setValue(v);
5967
+ __privateGet$g(this, _field$c).setValue(v);
5977
5968
  }
5978
5969
  getLabel() {
5979
- return __privateGet$f(this, _field$c).attribute.title;
5970
+ return __privateGet$g(this, _field$c).attribute.title;
5980
5971
  }
5981
5972
  getProperty(name) {
5982
5973
  return super.getProperty(name);
@@ -5987,21 +5978,21 @@ _field$c = new WeakMap();
5987
5978
  class EditorField extends ApiaFieldWithAttribute {
5988
5979
  }
5989
5980
 
5990
- var __accessCheck$e = (obj, member, msg) => {
5981
+ var __accessCheck$f = (obj, member, msg) => {
5991
5982
  if (!member.has(obj))
5992
5983
  throw TypeError("Cannot " + msg);
5993
5984
  };
5994
- var __privateGet$e = (obj, member, getter) => {
5995
- __accessCheck$e(obj, member, "read from private field");
5985
+ var __privateGet$f = (obj, member, getter) => {
5986
+ __accessCheck$f(obj, member, "read from private field");
5996
5987
  return member.get(obj);
5997
5988
  };
5998
- var __privateAdd$e = (obj, member, value) => {
5989
+ var __privateAdd$f = (obj, member, value) => {
5999
5990
  if (member.has(obj))
6000
5991
  throw TypeError("Cannot add the same private member more than once");
6001
5992
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6002
5993
  };
6003
- var __privateSet$e = (obj, member, value, setter) => {
6004
- __accessCheck$e(obj, member, "write to private field");
5994
+ var __privateSet$f = (obj, member, value, setter) => {
5995
+ __accessCheck$f(obj, member, "write to private field");
6005
5996
  member.set(obj, value);
6006
5997
  return value;
6007
5998
  };
@@ -6009,13 +6000,13 @@ var _field$b;
6009
6000
  class SelectField extends ApiaFieldWithAttribute {
6010
6001
  constructor(execution, field) {
6011
6002
  super(execution, field);
6012
- __privateAdd$e(this, _field$b, void 0);
6013
- __privateSet$e(this, _field$b, field);
6003
+ __privateAdd$f(this, _field$b, void 0);
6004
+ __privateSet$f(this, _field$b, field);
6014
6005
  }
6015
6006
  // get all select options either as array[] or object
6016
6007
  getOptions(asObject) {
6017
- if (__privateGet$e(this, _field$b).definition.id) {
6018
- const options = arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue);
6008
+ if (__privateGet$f(this, _field$b).definition.id) {
6009
+ const options = arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue);
6019
6010
  const obj = /* @__PURE__ */ new Map();
6020
6011
  if (asObject) {
6021
6012
  options.forEach((c) => obj.set(String(c.value), c));
@@ -6028,8 +6019,8 @@ class SelectField extends ApiaFieldWithAttribute {
6028
6019
  // adds a option to the select field
6029
6020
  addOption(optionValue, showValue, allowRepeatedValue) {
6030
6021
  let isValueRepeated = false;
6031
- if (__privateGet$e(this, _field$b).definition.id !== null) {
6032
- if (arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue).find(
6022
+ if (__privateGet$f(this, _field$b).definition.id !== null) {
6023
+ if (arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue).find(
6033
6024
  (c) => c.value === optionValue
6034
6025
  ) && allowRepeatedValue) {
6035
6026
  isValueRepeated = true;
@@ -6037,7 +6028,7 @@ class SelectField extends ApiaFieldWithAttribute {
6037
6028
  isValueRepeated = false;
6038
6029
  }
6039
6030
  if (allowRepeatedValue || !isValueRepeated && !allowRepeatedValue)
6040
- arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue).push({
6031
+ arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue).push({
6041
6032
  value: optionValue,
6042
6033
  label: showValue
6043
6034
  });
@@ -6045,21 +6036,21 @@ class SelectField extends ApiaFieldWithAttribute {
6045
6036
  }
6046
6037
  // overwrite all options in select field
6047
6038
  setOptions(optionsArray) {
6048
- if (__privateGet$e(this, _field$b).definition.id) {
6049
- __privateGet$e(this, _field$b).properties.possibleValue = arrayOrArray(optionsArray);
6039
+ if (__privateGet$f(this, _field$b).definition.id) {
6040
+ __privateGet$f(this, _field$b).properties.possibleValue = arrayOrArray(optionsArray);
6050
6041
  }
6051
6042
  }
6052
6043
  removeOption(optionValue) {
6053
- if (__privateGet$e(this, _field$b).definition.id) {
6054
- arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue).filter(
6044
+ if (__privateGet$f(this, _field$b).definition.id) {
6045
+ arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue).filter(
6055
6046
  (c) => c.value !== optionValue
6056
6047
  );
6057
6048
  }
6058
6049
  }
6059
6050
  // get selected option either as array or object key/value
6060
6051
  getSelectedOption(asObject) {
6061
- const arr = arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue);
6062
- if (__privateGet$e(this, _field$b).definition.id) {
6052
+ const arr = arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue);
6053
+ if (__privateGet$f(this, _field$b).definition.id) {
6063
6054
  if (asObject) {
6064
6055
  let obj = null;
6065
6056
  arr.forEach((c) => {
@@ -6075,8 +6066,8 @@ class SelectField extends ApiaFieldWithAttribute {
6075
6066
  return null;
6076
6067
  }
6077
6068
  getSelectedText() {
6078
- if (__privateGet$e(this, _field$b).definition.id) {
6079
- return arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue).find(
6069
+ if (__privateGet$f(this, _field$b).definition.id) {
6070
+ return arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue).find(
6080
6071
  (c) => c.selected
6081
6072
  )?.label ?? "Not option selected";
6082
6073
  }
@@ -6084,8 +6075,8 @@ class SelectField extends ApiaFieldWithAttribute {
6084
6075
  }
6085
6076
  // // remove all select options
6086
6077
  clearOptions() {
6087
- if (__privateGet$e(this, _field$b).definition.id) {
6088
- arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue).forEach(
6078
+ if (__privateGet$f(this, _field$b).definition.id) {
6079
+ arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue).forEach(
6089
6080
  (c) => c.selected = false
6090
6081
  );
6091
6082
  }
@@ -6093,21 +6084,21 @@ class SelectField extends ApiaFieldWithAttribute {
6093
6084
  }
6094
6085
  _field$b = new WeakMap();
6095
6086
 
6096
- var __accessCheck$d = (obj, member, msg) => {
6087
+ var __accessCheck$e = (obj, member, msg) => {
6097
6088
  if (!member.has(obj))
6098
6089
  throw TypeError("Cannot " + msg);
6099
6090
  };
6100
- var __privateGet$d = (obj, member, getter) => {
6101
- __accessCheck$d(obj, member, "read from private field");
6091
+ var __privateGet$e = (obj, member, getter) => {
6092
+ __accessCheck$e(obj, member, "read from private field");
6102
6093
  return getter ? getter.call(obj) : member.get(obj);
6103
6094
  };
6104
- var __privateAdd$d = (obj, member, value) => {
6095
+ var __privateAdd$e = (obj, member, value) => {
6105
6096
  if (member.has(obj))
6106
6097
  throw TypeError("Cannot add the same private member more than once");
6107
6098
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6108
6099
  };
6109
- var __privateSet$d = (obj, member, value, setter) => {
6110
- __accessCheck$d(obj, member, "write to private field");
6100
+ var __privateSet$e = (obj, member, value, setter) => {
6101
+ __accessCheck$e(obj, member, "write to private field");
6111
6102
  member.set(obj, value);
6112
6103
  return value;
6113
6104
  };
@@ -6115,37 +6106,37 @@ var _field$a;
6115
6106
  class InputField extends ApiaFieldWithAttribute {
6116
6107
  constructor(execution, field) {
6117
6108
  super(execution, field);
6118
- __privateAdd$d(this, _field$a, void 0);
6119
- __privateSet$d(this, _field$a, field);
6109
+ __privateAdd$e(this, _field$a, void 0);
6110
+ __privateSet$e(this, _field$a, field);
6120
6111
  }
6121
6112
  getObjectValue() {
6122
- return __privateGet$d(this, _field$a).getValue();
6113
+ return __privateGet$e(this, _field$a).getValue();
6123
6114
  }
6124
6115
  setValue(v) {
6125
- if (__privateGet$d(this, _field$a).attribute.valueType === "D") {
6126
- __privateGet$d(this, _field$a).setValue(v, { format: "d/m/Y" });
6116
+ if (__privateGet$e(this, _field$a).attribute.valueType === "D") {
6117
+ __privateGet$e(this, _field$a).setValue(v, { format: "d/m/Y" });
6127
6118
  } else {
6128
- __privateGet$d(this, _field$a).setValue(v);
6119
+ __privateGet$e(this, _field$a).setValue(v);
6129
6120
  }
6130
6121
  }
6131
6122
  }
6132
6123
  _field$a = new WeakMap();
6133
6124
 
6134
- var __accessCheck$c = (obj, member, msg) => {
6125
+ var __accessCheck$d = (obj, member, msg) => {
6135
6126
  if (!member.has(obj))
6136
6127
  throw TypeError("Cannot " + msg);
6137
6128
  };
6138
- var __privateGet$c = (obj, member, getter) => {
6139
- __accessCheck$c(obj, member, "read from private field");
6129
+ var __privateGet$d = (obj, member, getter) => {
6130
+ __accessCheck$d(obj, member, "read from private field");
6140
6131
  return getter ? getter.call(obj) : member.get(obj);
6141
6132
  };
6142
- var __privateAdd$c = (obj, member, value) => {
6133
+ var __privateAdd$d = (obj, member, value) => {
6143
6134
  if (member.has(obj))
6144
6135
  throw TypeError("Cannot add the same private member more than once");
6145
6136
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6146
6137
  };
6147
- var __privateSet$c = (obj, member, value, setter) => {
6148
- __accessCheck$c(obj, member, "write to private field");
6138
+ var __privateSet$d = (obj, member, value, setter) => {
6139
+ __accessCheck$d(obj, member, "write to private field");
6149
6140
  member.set(obj, value);
6150
6141
  return value;
6151
6142
  };
@@ -6153,11 +6144,11 @@ var _field$9;
6153
6144
  class TreeField extends ApiaFieldWithAttribute {
6154
6145
  constructor(execution, field) {
6155
6146
  super(execution, field);
6156
- __privateAdd$c(this, _field$9, void 0);
6157
- __privateSet$c(this, _field$9, field);
6147
+ __privateAdd$d(this, _field$9, void 0);
6148
+ __privateSet$d(this, _field$9, field);
6158
6149
  }
6159
6150
  setValue(v) {
6160
- __privateGet$c(this, _field$9).setValue(arrayOrArray(v));
6151
+ __privateGet$d(this, _field$9).setValue(arrayOrArray(v));
6161
6152
  }
6162
6153
  }
6163
6154
  _field$9 = new WeakMap();
@@ -6180,21 +6171,21 @@ class CheckField extends ApiaFieldWithAttribute {
6180
6171
  }
6181
6172
  }
6182
6173
 
6183
- var __accessCheck$b = (obj, member, msg) => {
6174
+ var __accessCheck$c = (obj, member, msg) => {
6184
6175
  if (!member.has(obj))
6185
6176
  throw TypeError("Cannot " + msg);
6186
6177
  };
6187
- var __privateGet$b = (obj, member, getter) => {
6188
- __accessCheck$b(obj, member, "read from private field");
6178
+ var __privateGet$c = (obj, member, getter) => {
6179
+ __accessCheck$c(obj, member, "read from private field");
6189
6180
  return member.get(obj);
6190
6181
  };
6191
- var __privateAdd$b = (obj, member, value) => {
6182
+ var __privateAdd$c = (obj, member, value) => {
6192
6183
  if (member.has(obj))
6193
6184
  throw TypeError("Cannot add the same private member more than once");
6194
6185
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6195
6186
  };
6196
- var __privateSet$b = (obj, member, value, setter) => {
6197
- __accessCheck$b(obj, member, "write to private field");
6187
+ var __privateSet$c = (obj, member, value, setter) => {
6188
+ __accessCheck$c(obj, member, "write to private field");
6198
6189
  member.set(obj, value);
6199
6190
  return value;
6200
6191
  };
@@ -6202,12 +6193,12 @@ var _field$8;
6202
6193
  class RadioField extends ApiaFieldWithAttribute {
6203
6194
  constructor(execution, field) {
6204
6195
  super(execution, field);
6205
- __privateAdd$b(this, _field$8, void 0);
6206
- __privateSet$b(this, _field$8, field);
6196
+ __privateAdd$c(this, _field$8, void 0);
6197
+ __privateSet$c(this, _field$8, field);
6207
6198
  }
6208
6199
  getOptions(asObject) {
6209
- if (__privateGet$b(this, _field$8).definition.id) {
6210
- const radioValues = arrayOrArray(__privateGet$b(this, _field$8).properties.possibleValue);
6200
+ if (__privateGet$c(this, _field$8).definition.id) {
6201
+ const radioValues = arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue);
6211
6202
  if (asObject) {
6212
6203
  const options = /* @__PURE__ */ new Map();
6213
6204
  radioValues.forEach((c) => options.set(String(c.value), c));
@@ -6218,13 +6209,13 @@ class RadioField extends ApiaFieldWithAttribute {
6218
6209
  return null;
6219
6210
  }
6220
6211
  clearOptions() {
6221
- if (__privateGet$b(this, _field$8).definition.id) {
6222
- __privateGet$b(this, _field$8).properties.possibleValue = [];
6212
+ if (__privateGet$c(this, _field$8).definition.id) {
6213
+ __privateGet$c(this, _field$8).properties.possibleValue = [];
6223
6214
  }
6224
6215
  }
6225
6216
  addOption(radioValue, showValue, allowRepeatedValue) {
6226
- if (__privateGet$b(this, _field$8).definition.id) {
6227
- const radioValues = arrayOrArray(__privateGet$b(this, _field$8).properties.possibleValue);
6217
+ if (__privateGet$c(this, _field$8).definition.id) {
6218
+ const radioValues = arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue);
6228
6219
  const isValueIsRepeated = radioValues.some((c) => {
6229
6220
  return c.value === radioValue.toString();
6230
6221
  });
@@ -6237,19 +6228,19 @@ class RadioField extends ApiaFieldWithAttribute {
6237
6228
  }
6238
6229
  }
6239
6230
  setOptions(options) {
6240
- if (__privateGet$b(this, _field$8).definition.id) {
6241
- __privateGet$b(this, _field$8).properties.possibleValue = options;
6231
+ if (__privateGet$c(this, _field$8).definition.id) {
6232
+ __privateGet$c(this, _field$8).properties.possibleValue = options;
6242
6233
  }
6243
6234
  }
6244
6235
  removeOption(radioValue) {
6245
- if (__privateGet$b(this, _field$8).definition.id) {
6246
- arrayOrArray(__privateGet$b(this, _field$8).properties.possibleValue).filter(
6236
+ if (__privateGet$c(this, _field$8).definition.id) {
6237
+ arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue).filter(
6247
6238
  (c) => c.value !== radioValue
6248
6239
  );
6249
6240
  }
6250
6241
  }
6251
6242
  getSelectedOption(asObject) {
6252
- const radioValues = arrayOrArray(__privateGet$b(this, _field$8).properties.possibleValue);
6243
+ const radioValues = arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue);
6253
6244
  const selected = radioValues.find((c) => c.selected);
6254
6245
  if (!selected)
6255
6246
  return null;
@@ -6262,8 +6253,8 @@ class RadioField extends ApiaFieldWithAttribute {
6262
6253
  }
6263
6254
  }
6264
6255
  getSelectedText() {
6265
- if (__privateGet$b(this, _field$8).definition.id) {
6266
- const possibleValue = arrayOrArray(__privateGet$b(this, _field$8).properties.possibleValue);
6256
+ if (__privateGet$c(this, _field$8).definition.id) {
6257
+ const possibleValue = arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue);
6267
6258
  if (possibleValue) {
6268
6259
  return possibleValue.find((c) => c.selected)?.label;
6269
6260
  }
@@ -6273,21 +6264,21 @@ class RadioField extends ApiaFieldWithAttribute {
6273
6264
  }
6274
6265
  _field$8 = new WeakMap();
6275
6266
 
6276
- var __accessCheck$a = (obj, member, msg) => {
6267
+ var __accessCheck$b = (obj, member, msg) => {
6277
6268
  if (!member.has(obj))
6278
6269
  throw TypeError("Cannot " + msg);
6279
6270
  };
6280
- var __privateGet$a = (obj, member, getter) => {
6281
- __accessCheck$a(obj, member, "read from private field");
6271
+ var __privateGet$b = (obj, member, getter) => {
6272
+ __accessCheck$b(obj, member, "read from private field");
6282
6273
  return member.get(obj);
6283
6274
  };
6284
- var __privateAdd$a = (obj, member, value) => {
6275
+ var __privateAdd$b = (obj, member, value) => {
6285
6276
  if (member.has(obj))
6286
6277
  throw TypeError("Cannot add the same private member more than once");
6287
6278
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6288
6279
  };
6289
- var __privateSet$a = (obj, member, value, setter) => {
6290
- __accessCheck$a(obj, member, "write to private field");
6280
+ var __privateSet$b = (obj, member, value, setter) => {
6281
+ __accessCheck$b(obj, member, "write to private field");
6291
6282
  member.set(obj, value);
6292
6283
  return value;
6293
6284
  };
@@ -6295,13 +6286,13 @@ var _field$7;
6295
6286
  class MultipleField extends ApiaFieldWithAttribute {
6296
6287
  constructor(execution, field) {
6297
6288
  super(execution, field);
6298
- __privateAdd$a(this, _field$7, void 0);
6299
- __privateSet$a(this, _field$7, field);
6289
+ __privateAdd$b(this, _field$7, void 0);
6290
+ __privateSet$b(this, _field$7, field);
6300
6291
  }
6301
6292
  addOption(optionValue, showValue, allowRepeatedValue) {
6302
6293
  let isValueRepeated = false;
6303
- if (__privateGet$a(this, _field$7).definition.id !== null) {
6304
- if (arrayOrArray(__privateGet$a(this, _field$7).properties.possibleValue).find(
6294
+ if (__privateGet$b(this, _field$7).definition.id !== null) {
6295
+ if (arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue).find(
6305
6296
  (c) => c.value === optionValue
6306
6297
  ) && allowRepeatedValue) {
6307
6298
  isValueRepeated = true;
@@ -6309,28 +6300,28 @@ class MultipleField extends ApiaFieldWithAttribute {
6309
6300
  isValueRepeated = false;
6310
6301
  }
6311
6302
  if (allowRepeatedValue || !isValueRepeated && !allowRepeatedValue)
6312
- arrayOrArray(__privateGet$a(this, _field$7).properties.possibleValue).push({
6303
+ arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue).push({
6313
6304
  value: optionValue,
6314
6305
  label: showValue
6315
6306
  });
6316
6307
  }
6317
6308
  }
6318
6309
  setValue(value) {
6319
- if (__privateGet$a(this, _field$7).definition.id) {
6320
- __privateGet$a(this, _field$7).setValue(value);
6310
+ if (__privateGet$b(this, _field$7).definition.id) {
6311
+ __privateGet$b(this, _field$7).setValue(value);
6321
6312
  }
6322
6313
  }
6323
6314
  clearOptions() {
6324
- if (__privateGet$a(this, _field$7).definition.id) {
6325
- arrayOrArray(__privateGet$a(this, _field$7).properties.possibleValue).forEach(
6315
+ if (__privateGet$b(this, _field$7).definition.id) {
6316
+ arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue).forEach(
6326
6317
  (c) => c.selected = false
6327
6318
  );
6328
6319
  }
6329
6320
  }
6330
6321
  getSelectedOption(asObject) {
6331
- if (__privateGet$a(this, _field$7).definition.id) {
6322
+ if (__privateGet$b(this, _field$7).definition.id) {
6332
6323
  const selected = arrayOrArray(
6333
- __privateGet$a(this, _field$7).properties.possibleValue
6324
+ __privateGet$b(this, _field$7).properties.possibleValue
6334
6325
  ).filter((c) => c.selected);
6335
6326
  if (selected) {
6336
6327
  if (asObject) {
@@ -6344,8 +6335,8 @@ class MultipleField extends ApiaFieldWithAttribute {
6344
6335
  return null;
6345
6336
  }
6346
6337
  getOptions(asObject) {
6347
- if (__privateGet$a(this, _field$7).definition.id) {
6348
- const options = arrayOrArray(__privateGet$a(this, _field$7).properties.possibleValue);
6338
+ if (__privateGet$b(this, _field$7).definition.id) {
6339
+ const options = arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue);
6349
6340
  const obj = /* @__PURE__ */ new Map();
6350
6341
  if (asObject) {
6351
6342
  options.forEach((c) => obj.set(String(c.value), c));
@@ -6356,13 +6347,13 @@ class MultipleField extends ApiaFieldWithAttribute {
6356
6347
  return null;
6357
6348
  }
6358
6349
  setOptions(optionsArray) {
6359
- if (__privateGet$a(this, _field$7).definition.id) {
6360
- __privateGet$a(this, _field$7).properties.possibleValue = arrayOrArray(optionsArray);
6350
+ if (__privateGet$b(this, _field$7).definition.id) {
6351
+ __privateGet$b(this, _field$7).properties.possibleValue = arrayOrArray(optionsArray);
6361
6352
  }
6362
6353
  }
6363
6354
  removeOption(optionValue) {
6364
- if (__privateGet$a(this, _field$7).definition.id) {
6365
- arrayOrArray(__privateGet$a(this, _field$7).properties.possibleValue).filter(
6355
+ if (__privateGet$b(this, _field$7).definition.id) {
6356
+ arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue).filter(
6366
6357
  (c) => c.value !== optionValue
6367
6358
  );
6368
6359
  }
@@ -6376,21 +6367,21 @@ class HiddenField extends ApiaField {
6376
6367
  class AreaField extends ApiaFieldWithAttribute {
6377
6368
  }
6378
6369
 
6379
- var __accessCheck$9 = (obj, member, msg) => {
6370
+ var __accessCheck$a = (obj, member, msg) => {
6380
6371
  if (!member.has(obj))
6381
6372
  throw TypeError("Cannot " + msg);
6382
6373
  };
6383
- var __privateGet$9 = (obj, member, getter) => {
6384
- __accessCheck$9(obj, member, "read from private field");
6374
+ var __privateGet$a = (obj, member, getter) => {
6375
+ __accessCheck$a(obj, member, "read from private field");
6385
6376
  return member.get(obj);
6386
6377
  };
6387
- var __privateAdd$9 = (obj, member, value) => {
6378
+ var __privateAdd$a = (obj, member, value) => {
6388
6379
  if (member.has(obj))
6389
6380
  throw TypeError("Cannot add the same private member more than once");
6390
6381
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6391
6382
  };
6392
- var __privateSet$9 = (obj, member, value, setter) => {
6393
- __accessCheck$9(obj, member, "write to private field");
6383
+ var __privateSet$a = (obj, member, value, setter) => {
6384
+ __accessCheck$a(obj, member, "write to private field");
6394
6385
  member.set(obj, value);
6395
6386
  return value;
6396
6387
  };
@@ -6398,34 +6389,34 @@ var _field$6;
6398
6389
  class ImageField extends ApiaField {
6399
6390
  constructor(execution, field) {
6400
6391
  super(execution, field);
6401
- __privateAdd$9(this, _field$6, void 0);
6402
- __privateSet$9(this, _field$6, field);
6392
+ __privateAdd$a(this, _field$6, void 0);
6393
+ __privateSet$a(this, _field$6, field);
6403
6394
  }
6404
6395
  clearValue() {
6405
- if (__privateGet$9(this, _field$6).definition.id) {
6396
+ if (__privateGet$a(this, _field$6).definition.id) {
6406
6397
  throw new Error(
6407
- `Apia JSApi Error: The Field ${__privateGet$9(this, _field$6).definition.fieldType} does not support this function`
6398
+ `Apia JSApi Error: The Field ${__privateGet$a(this, _field$6).definition.fieldType} does not support this function`
6408
6399
  );
6409
6400
  }
6410
6401
  return null;
6411
6402
  }
6412
6403
  getLabel() {
6413
6404
  throw new Error(
6414
- `Apia JSApi Error: The field ${__privateGet$9(this, _field$6).definition.fieldType} does not use a label`
6405
+ `Apia JSApi Error: The field ${__privateGet$a(this, _field$6).definition.fieldType} does not use a label`
6415
6406
  );
6416
6407
  }
6417
6408
  getValue() {
6418
- if (__privateGet$9(this, _field$6).definition.id) {
6409
+ if (__privateGet$a(this, _field$6).definition.id) {
6419
6410
  throw new Error(
6420
- `Apia JSApi Error: The Field ${__privateGet$9(this, _field$6).definition.fieldType} does not support this function`
6411
+ `Apia JSApi Error: The Field ${__privateGet$a(this, _field$6).definition.fieldType} does not support this function`
6421
6412
  );
6422
6413
  }
6423
6414
  return null;
6424
6415
  }
6425
6416
  setValue() {
6426
- if (__privateGet$9(this, _field$6).definition.id) {
6417
+ if (__privateGet$a(this, _field$6).definition.id) {
6427
6418
  throw new Error(
6428
- `Apia JSApi Error: The Field ${__privateGet$9(this, _field$6).definition.fieldType} does not support this function`
6419
+ `Apia JSApi Error: The Field ${__privateGet$a(this, _field$6).definition.fieldType} does not support this function`
6429
6420
  );
6430
6421
  }
6431
6422
  return null;
@@ -6433,21 +6424,21 @@ class ImageField extends ApiaField {
6433
6424
  }
6434
6425
  _field$6 = new WeakMap();
6435
6426
 
6436
- var __accessCheck$8 = (obj, member, msg) => {
6427
+ var __accessCheck$9 = (obj, member, msg) => {
6437
6428
  if (!member.has(obj))
6438
6429
  throw TypeError("Cannot " + msg);
6439
6430
  };
6440
- var __privateGet$8 = (obj, member, getter) => {
6441
- __accessCheck$8(obj, member, "read from private field");
6431
+ var __privateGet$9 = (obj, member, getter) => {
6432
+ __accessCheck$9(obj, member, "read from private field");
6442
6433
  return member.get(obj);
6443
6434
  };
6444
- var __privateAdd$8 = (obj, member, value) => {
6435
+ var __privateAdd$9 = (obj, member, value) => {
6445
6436
  if (member.has(obj))
6446
6437
  throw TypeError("Cannot add the same private member more than once");
6447
6438
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6448
6439
  };
6449
- var __privateSet$8 = (obj, member, value, setter) => {
6450
- __accessCheck$8(obj, member, "write to private field");
6440
+ var __privateSet$9 = (obj, member, value, setter) => {
6441
+ __accessCheck$9(obj, member, "write to private field");
6451
6442
  member.set(obj, value);
6452
6443
  return value;
6453
6444
  };
@@ -6455,34 +6446,34 @@ var _field$5;
6455
6446
  class LinkField extends ApiaField {
6456
6447
  constructor(execution, field) {
6457
6448
  super(execution, field);
6458
- __privateAdd$8(this, _field$5, void 0);
6459
- __privateSet$8(this, _field$5, field);
6449
+ __privateAdd$9(this, _field$5, void 0);
6450
+ __privateSet$9(this, _field$5, field);
6460
6451
  }
6461
6452
  getLabel() {
6462
- if (__privateGet$8(this, _field$5).definition.fieldType) {
6453
+ if (__privateGet$9(this, _field$5).definition.fieldType) {
6463
6454
  throw new Error(
6464
- `Apia JSApi Error: The field ${__privateGet$8(this, _field$5).definition.fieldType} does not use a label`
6455
+ `Apia JSApi Error: The field ${__privateGet$9(this, _field$5).definition.fieldType} does not use a label`
6465
6456
  );
6466
6457
  }
6467
6458
  }
6468
6459
  }
6469
6460
  _field$5 = new WeakMap();
6470
6461
 
6471
- var __accessCheck$7 = (obj, member, msg) => {
6462
+ var __accessCheck$8 = (obj, member, msg) => {
6472
6463
  if (!member.has(obj))
6473
6464
  throw TypeError("Cannot " + msg);
6474
6465
  };
6475
- var __privateGet$7 = (obj, member, getter) => {
6476
- __accessCheck$7(obj, member, "read from private field");
6466
+ var __privateGet$8 = (obj, member, getter) => {
6467
+ __accessCheck$8(obj, member, "read from private field");
6477
6468
  return getter ? getter.call(obj) : member.get(obj);
6478
6469
  };
6479
- var __privateAdd$7 = (obj, member, value) => {
6470
+ var __privateAdd$8 = (obj, member, value) => {
6480
6471
  if (member.has(obj))
6481
6472
  throw TypeError("Cannot add the same private member more than once");
6482
6473
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6483
6474
  };
6484
- var __privateSet$7 = (obj, member, value, setter) => {
6485
- __accessCheck$7(obj, member, "write to private field");
6475
+ var __privateSet$8 = (obj, member, value, setter) => {
6476
+ __accessCheck$8(obj, member, "write to private field");
6486
6477
  member.set(obj, value);
6487
6478
  return value;
6488
6479
  };
@@ -6490,12 +6481,12 @@ var _field$4;
6490
6481
  class TextField extends ApiaField {
6491
6482
  constructor(execution, field) {
6492
6483
  super(execution, field);
6493
- __privateAdd$7(this, _field$4, void 0);
6494
- __privateSet$7(this, _field$4, field);
6484
+ __privateAdd$8(this, _field$4, void 0);
6485
+ __privateSet$8(this, _field$4, field);
6495
6486
  }
6496
6487
  getLabel() {
6497
6488
  throw new Error(
6498
- `Apia JSApi Error: The field ${__privateGet$7(this, _field$4).definition.fieldType} does not use a label`
6489
+ `Apia JSApi Error: The field ${__privateGet$8(this, _field$4).definition.fieldType} does not use a label`
6499
6490
  );
6500
6491
  }
6501
6492
  setValue(value) {
@@ -6504,35 +6495,35 @@ class TextField extends ApiaField {
6504
6495
  }
6505
6496
  _field$4 = new WeakMap();
6506
6497
 
6507
- var __accessCheck$6 = (obj, member, msg) => {
6498
+ var __accessCheck$7 = (obj, member, msg) => {
6508
6499
  if (!member.has(obj))
6509
6500
  throw TypeError("Cannot " + msg);
6510
6501
  };
6511
- var __privateGet$6 = (obj, member, getter) => {
6512
- __accessCheck$6(obj, member, "read from private field");
6502
+ var __privateGet$7 = (obj, member, getter) => {
6503
+ __accessCheck$7(obj, member, "read from private field");
6513
6504
  return getter ? getter.call(obj) : member.get(obj);
6514
6505
  };
6515
- var __privateAdd$6 = (obj, member, value) => {
6506
+ var __privateAdd$7 = (obj, member, value) => {
6516
6507
  if (member.has(obj))
6517
6508
  throw TypeError("Cannot add the same private member more than once");
6518
6509
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6519
6510
  };
6520
- var __privateSet$6 = (obj, member, value, setter) => {
6521
- __accessCheck$6(obj, member, "write to private field");
6511
+ var __privateSet$7 = (obj, member, value, setter) => {
6512
+ __accessCheck$7(obj, member, "write to private field");
6522
6513
  member.set(obj, value);
6523
6514
  return value;
6524
6515
  };
6525
6516
  var _field$3;
6526
6517
  class CustomComponentField {
6527
6518
  constructor(field) {
6528
- __privateAdd$6(this, _field$3, void 0);
6529
- __privateSet$6(this, _field$3, field);
6519
+ __privateAdd$7(this, _field$3, void 0);
6520
+ __privateSet$7(this, _field$3, field);
6530
6521
  }
6531
6522
  fireEvent(name) {
6532
- __privateGet$6(this, _field$3).fireEvent(name);
6523
+ __privateGet$7(this, _field$3).fireEvent(name);
6533
6524
  }
6534
6525
  getProperty(name) {
6535
- return __privateGet$6(this, _field$3).getProperty(name);
6526
+ return __privateGet$7(this, _field$3).getProperty(name);
6536
6527
  }
6537
6528
  setFocus() {
6538
6529
  throw new Error("Method not implemented.");
@@ -6541,19 +6532,19 @@ class CustomComponentField {
6541
6532
  return false;
6542
6533
  }
6543
6534
  getStringValue(attName) {
6544
- return __privateGet$6(this, _field$3).getStringValue(attName);
6535
+ return __privateGet$7(this, _field$3).getStringValue(attName);
6545
6536
  }
6546
6537
  getValue(attName, index = 0) {
6547
- return __privateGet$6(this, _field$3).getValue(attName, index);
6538
+ return __privateGet$7(this, _field$3).getValue(attName, index);
6548
6539
  }
6549
6540
  setProperty(name, value) {
6550
- __privateGet$6(this, _field$3).setProperty(name, value);
6541
+ __privateGet$7(this, _field$3).setProperty(name, value);
6551
6542
  }
6552
6543
  setStringValue(attName, value) {
6553
- return __privateGet$6(this, _field$3).setStringValue(attName, value);
6544
+ return __privateGet$7(this, _field$3).setStringValue(attName, value);
6554
6545
  }
6555
6546
  setValue(attName, value, index = 0) {
6556
- return __privateGet$6(this, _field$3).setValue(attName, value, index);
6547
+ return __privateGet$7(this, _field$3).setValue(attName, value, index);
6557
6548
  }
6558
6549
  }
6559
6550
  _field$3 = new WeakMap();
@@ -6568,58 +6559,58 @@ const createNewField = (execution, field) => {
6568
6559
  return new ModalInputField(execution, field);
6569
6560
  }
6570
6561
  switch (fieldType) {
6571
- case Field.TYPE_INPUT:
6562
+ case FieldConstants.TYPE_INPUT:
6572
6563
  newField = new InputField(execution, field);
6573
6564
  break;
6574
- case Field.TYPE_PASSWORD:
6565
+ case FieldConstants.TYPE_PASSWORD:
6575
6566
  newField = new PasswordField(execution, field);
6576
6567
  break;
6577
- case Field.TYPE_SELECT:
6568
+ case FieldConstants.TYPE_SELECT:
6578
6569
  newField = new SelectField(execution, field);
6579
6570
  break;
6580
- case Field.TYPE_RADIO:
6571
+ case FieldConstants.TYPE_RADIO:
6581
6572
  newField = new RadioField(execution, field);
6582
6573
  break;
6583
- case Field.TYPE_CHECK:
6574
+ case FieldConstants.TYPE_CHECK:
6584
6575
  newField = new CheckField(execution, field);
6585
6576
  break;
6586
- case Field.TYPE_BUTTON:
6577
+ case FieldConstants.TYPE_BUTTON:
6587
6578
  newField = new ButtonField(execution, field);
6588
6579
  break;
6589
- case Field.TYPE_MULTIPLE:
6580
+ case FieldConstants.TYPE_MULTIPLE:
6590
6581
  newField = new MultipleField(execution, field);
6591
6582
  break;
6592
- case Field.TYPE_HIDDEN:
6583
+ case FieldConstants.TYPE_HIDDEN:
6593
6584
  newField = new HiddenField(execution, field);
6594
6585
  break;
6595
- case Field.TYPE_AREA:
6586
+ case FieldConstants.TYPE_AREA:
6596
6587
  newField = new AreaField(execution, field);
6597
6588
  break;
6598
- case Field.TYPE_GRID:
6589
+ case FieldConstants.TYPE_GRID:
6599
6590
  newField = new GridField(execution, field);
6600
6591
  break;
6601
- case Field.TYPE_IMAGE:
6592
+ case FieldConstants.TYPE_IMAGE:
6602
6593
  newField = new ImageField(execution, field);
6603
6594
  break;
6604
- case Field.TYPE_HREF:
6595
+ case FieldConstants.TYPE_HREF:
6605
6596
  newField = new LinkField(execution, field);
6606
6597
  break;
6607
- case Field.TYPE_LABEL:
6598
+ case FieldConstants.TYPE_LABEL:
6608
6599
  newField = new TextField(execution, field);
6609
6600
  break;
6610
- case Field.TYPE_TITLE:
6601
+ case FieldConstants.TYPE_TITLE:
6611
6602
  newField = new TextField(execution, field);
6612
6603
  break;
6613
- case Field.TYPE_FILE:
6604
+ case FieldConstants.TYPE_FILE:
6614
6605
  newField = new FileUploaderField(execution, field);
6615
6606
  break;
6616
- case Field.TYPE_CAPTCHA:
6607
+ case FieldConstants.TYPE_CAPTCHA:
6617
6608
  newField = new CaptchaField(execution, field);
6618
6609
  break;
6619
- case Field.TYPE_TREE:
6610
+ case FieldConstants.TYPE_TREE:
6620
6611
  newField = new TreeField(execution, field);
6621
6612
  break;
6622
- case Field.TYPE_EDITOR:
6613
+ case FieldConstants.TYPE_EDITOR:
6623
6614
  newField = new EditorField(execution, field);
6624
6615
  break;
6625
6616
  }
@@ -6632,42 +6623,44 @@ var createApiaField = /*#__PURE__*/Object.freeze({
6632
6623
  createNewField: createNewField
6633
6624
  });
6634
6625
 
6635
- var __accessCheck$5 = (obj, member, msg) => {
6626
+ var __accessCheck$6 = (obj, member, msg) => {
6636
6627
  if (!member.has(obj))
6637
6628
  throw TypeError("Cannot " + msg);
6638
6629
  };
6639
- var __privateGet$5 = (obj, member, getter) => {
6640
- __accessCheck$5(obj, member, "read from private field");
6630
+ var __privateGet$6 = (obj, member, getter) => {
6631
+ __accessCheck$6(obj, member, "read from private field");
6641
6632
  return getter ? getter.call(obj) : member.get(obj);
6642
6633
  };
6643
- var __privateAdd$5 = (obj, member, value) => {
6634
+ var __privateAdd$6 = (obj, member, value) => {
6644
6635
  if (member.has(obj))
6645
6636
  throw TypeError("Cannot add the same private member more than once");
6646
6637
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6647
6638
  };
6648
- var __privateSet$5 = (obj, member, value, setter) => {
6649
- __accessCheck$5(obj, member, "write to private field");
6639
+ var __privateSet$6 = (obj, member, value, setter) => {
6640
+ __accessCheck$6(obj, member, "write to private field");
6650
6641
  member.set(obj, value);
6651
6642
  return value;
6652
6643
  };
6653
- var _field$2, _mutex;
6644
+ var _execution$2, _field$2, _mutex;
6654
6645
  class GridField extends ApiaField {
6655
6646
  constructor(execution, field) {
6656
6647
  super(execution, field);
6657
- __privateAdd$5(this, _field$2, void 0);
6658
- __privateAdd$5(this, _mutex, new Mutex());
6659
- __privateSet$5(this, _field$2, field);
6648
+ __privateAdd$6(this, _execution$2, void 0);
6649
+ __privateAdd$6(this, _field$2, void 0);
6650
+ __privateAdd$6(this, _mutex, new Mutex());
6651
+ __privateSet$6(this, _execution$2, execution);
6652
+ __privateSet$6(this, _field$2, field);
6660
6653
  }
6661
6654
  async addRow() {
6662
6655
  try {
6663
- await __privateGet$5(this, _mutex).acquire();
6664
- const result = await __privateGet$5(this, _field$2).addRow();
6656
+ await __privateGet$6(this, _mutex).acquire();
6657
+ const result = await __privateGet$6(this, _field$2).addRow();
6665
6658
  if (result) {
6666
- return this.getRow(__privateGet$5(this, _field$2).finalIndex);
6659
+ return this.getRow(__privateGet$6(this, _field$2).finalIndex);
6667
6660
  }
6668
6661
  return [];
6669
6662
  } finally {
6670
- __privateGet$5(this, _mutex).release();
6663
+ __privateGet$6(this, _mutex).release();
6671
6664
  }
6672
6665
  }
6673
6666
  clearGrid() {
@@ -6678,8 +6671,8 @@ class GridField extends ApiaField {
6678
6671
  }
6679
6672
  async clearRow(index) {
6680
6673
  try {
6681
- await __privateGet$5(this, _mutex).acquire();
6682
- const row = __privateGet$5(this, _field$2).getRowByFieldIndex(index);
6674
+ await __privateGet$6(this, _mutex).acquire();
6675
+ const row = __privateGet$6(this, _field$2).getRowByFieldIndex(index);
6683
6676
  if (!row) {
6684
6677
  throw new Error(`Row ${index} not found`);
6685
6678
  }
@@ -6688,19 +6681,19 @@ class GridField extends ApiaField {
6688
6681
  c.state.value = "";
6689
6682
  });
6690
6683
  } finally {
6691
- __privateGet$5(this, _mutex).release();
6684
+ __privateGet$6(this, _mutex).release();
6692
6685
  }
6693
6686
  }
6694
6687
  closeForm() {
6695
- __privateGet$5(this, _field$2).closeEditionModal();
6688
+ __privateGet$6(this, _field$2).closeEditionModal();
6696
6689
  return this;
6697
6690
  }
6698
6691
  async deleteAllRows() {
6699
6692
  try {
6700
- await __privateGet$5(this, _mutex).acquire();
6701
- await __privateGet$5(this, _field$2).deleteAllRows();
6693
+ await __privateGet$6(this, _mutex).acquire();
6694
+ await __privateGet$6(this, _field$2).deleteAllRows();
6702
6695
  } finally {
6703
- __privateGet$5(this, _mutex).release();
6696
+ __privateGet$6(this, _mutex).release();
6704
6697
  }
6705
6698
  }
6706
6699
  async deleteGrid() {
@@ -6711,62 +6704,62 @@ class GridField extends ApiaField {
6711
6704
  }
6712
6705
  async deleteRow(index) {
6713
6706
  try {
6714
- await __privateGet$5(this, _mutex).acquire();
6715
- __privateGet$5(this, _field$2).deleteRows(index);
6707
+ await __privateGet$6(this, _mutex).acquire();
6708
+ __privateGet$6(this, _field$2).deleteRows(index);
6716
6709
  } finally {
6717
- __privateGet$5(this, _mutex).release();
6710
+ __privateGet$6(this, _mutex).release();
6718
6711
  }
6719
6712
  }
6720
6713
  editRow(index) {
6721
- getWindow(this.execution).dispatchEvent(
6714
+ getWindow(__privateGet$6(this, _execution$2)).dispatchEvent(
6722
6715
  new CustomEvent("openGridEdition", {
6723
- detail: { index, grid: __privateGet$5(this, _field$2) }
6716
+ detail: { index, grid: __privateGet$6(this, _field$2) }
6724
6717
  })
6725
6718
  );
6726
6719
  }
6727
6720
  getAllColumns() {
6728
- return __privateGet$5(this, _field$2).getAllColumns().map(
6729
- (c) => c.map((f) => createNewField(__privateGet$5(this, _field$2).getForm().execution, f))
6721
+ return __privateGet$6(this, _field$2).getAllColumns().map(
6722
+ (c) => c.map((f) => createNewField(__privateGet$6(this, _field$2).getForm().execution, f))
6730
6723
  );
6731
6724
  }
6732
6725
  getColumn(fieldName) {
6733
- const fields = __privateGet$5(this, _field$2).getColumn(fieldName);
6726
+ const fields = __privateGet$6(this, _field$2).getColumn(fieldName);
6734
6727
  if (fields) {
6735
6728
  return arrayOrArray(fields).map(
6736
- (c) => createNewField(__privateGet$5(this, _field$2).getForm().execution, c)
6729
+ (c) => createNewField(__privateGet$6(this, _field$2).getForm().execution, c)
6737
6730
  );
6738
6731
  }
6739
6732
  return [];
6740
6733
  }
6741
6734
  getCurrentPage() {
6742
- return __privateGet$5(this, _field$2).getCurrentPage();
6735
+ return __privateGet$6(this, _field$2).getCurrentPage();
6743
6736
  }
6744
6737
  getField(fieldName, fieldIndex) {
6745
- const fields = __privateGet$5(this, _field$2).getField(fieldName, fieldIndex);
6738
+ const fields = __privateGet$6(this, _field$2).getField(fieldName, fieldIndex);
6746
6739
  if (fields) {
6747
6740
  return fieldIndex !== void 0 ? createNewField(
6748
- __privateGet$5(this, _field$2).getForm().execution,
6741
+ __privateGet$6(this, _field$2).getForm().execution,
6749
6742
  arrayOrArray(fields)[0]
6750
- ) : arrayOrArray(fields).map((c) => createNewField(__privateGet$5(this, _field$2).getForm().execution, c)).filter((c) => Boolean(c));
6743
+ ) : arrayOrArray(fields).map((c) => createNewField(__privateGet$6(this, _field$2).getForm().execution, c)).filter((c) => Boolean(c));
6751
6744
  }
6752
6745
  return null;
6753
6746
  }
6754
6747
  getPageCount() {
6755
- return __privateGet$5(this, _field$2).pageCount;
6748
+ return __privateGet$6(this, _field$2).pageCount;
6756
6749
  }
6757
6750
  getPageSize() {
6758
- return __privateGet$5(this, _field$2).pageSize;
6751
+ return __privateGet$6(this, _field$2).pageSize;
6759
6752
  }
6760
6753
  getRow(index) {
6761
- return __privateGet$5(this, _field$2).getRowByFieldIndex(index)?.map((c) => createNewField(__privateGet$5(this, _field$2).getForm().execution, c));
6754
+ return __privateGet$6(this, _field$2).getRowByFieldIndex(index)?.map((c) => createNewField(__privateGet$6(this, _field$2).getForm().execution, c));
6762
6755
  }
6763
6756
  getSelection() {
6764
- const selected = __privateGet$5(this, _field$2).getSelectedRows();
6757
+ const selected = __privateGet$6(this, _field$2).getSelectedRows();
6765
6758
  const returnObj = [];
6766
6759
  selected.forEach((r) => {
6767
6760
  const row = [];
6768
6761
  r.forEach((c) => {
6769
- const fld = createNewField(__privateGet$5(this, _field$2).getForm().execution, c);
6762
+ const fld = createNewField(__privateGet$6(this, _field$2).getForm().execution, c);
6770
6763
  if (fld) {
6771
6764
  row.push(fld);
6772
6765
  }
@@ -6776,45 +6769,46 @@ class GridField extends ApiaField {
6776
6769
  return returnObj;
6777
6770
  }
6778
6771
  get id() {
6779
- return __privateGet$5(this, _field$2).definition.id;
6772
+ return __privateGet$6(this, _field$2).definition.id;
6780
6773
  }
6781
6774
  isPaged() {
6782
- return __privateGet$5(this, _field$2).properties.paged;
6775
+ return __privateGet$6(this, _field$2).properties.paged;
6783
6776
  }
6784
6777
  get rowsCount() {
6785
- return __privateGet$5(this, _field$2).length;
6778
+ return __privateGet$6(this, _field$2).length;
6786
6779
  }
6787
6780
  toggleColumnVisibility(fieldName, isShown) {
6788
- __privateGet$5(this, _field$2).toggleColumnVisibility(fieldName, isShown);
6781
+ __privateGet$6(this, _field$2).toggleColumnVisibility(fieldName, isShown);
6789
6782
  }
6790
6783
  toggleDeleteButton(index, isShown) {
6791
- __privateGet$5(this, _field$2).toggleDeleteButton(index, isShown);
6784
+ __privateGet$6(this, _field$2).toggleDeleteButton(index, isShown);
6792
6785
  }
6793
6786
  toggleEditFormButton(rowIndex, isShown) {
6794
- __privateGet$5(this, _field$2).toggleEditFormButton(rowIndex, isShown);
6787
+ __privateGet$6(this, _field$2).toggleEditFormButton(rowIndex, isShown);
6795
6788
  }
6796
6789
  }
6790
+ _execution$2 = new WeakMap();
6797
6791
  _field$2 = new WeakMap();
6798
6792
  _mutex = new WeakMap();
6799
6793
 
6800
6794
  class CaptchaField extends ApiaField {
6801
6795
  }
6802
6796
 
6803
- var __accessCheck$4 = (obj, member, msg) => {
6797
+ var __accessCheck$5 = (obj, member, msg) => {
6804
6798
  if (!member.has(obj))
6805
6799
  throw TypeError("Cannot " + msg);
6806
6800
  };
6807
- var __privateGet$4 = (obj, member, getter) => {
6808
- __accessCheck$4(obj, member, "read from private field");
6801
+ var __privateGet$5 = (obj, member, getter) => {
6802
+ __accessCheck$5(obj, member, "read from private field");
6809
6803
  return getter ? getter.call(obj) : member.get(obj);
6810
6804
  };
6811
- var __privateAdd$4 = (obj, member, value) => {
6805
+ var __privateAdd$5 = (obj, member, value) => {
6812
6806
  if (member.has(obj))
6813
6807
  throw TypeError("Cannot add the same private member more than once");
6814
6808
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6815
6809
  };
6816
- var __privateSet$4 = (obj, member, value, setter) => {
6817
- __accessCheck$4(obj, member, "write to private field");
6810
+ var __privateSet$5 = (obj, member, value, setter) => {
6811
+ __accessCheck$5(obj, member, "write to private field");
6818
6812
  member.set(obj, value);
6819
6813
  return value;
6820
6814
  };
@@ -6822,24 +6816,24 @@ var _field$1;
6822
6816
  class FileUploaderField extends ApiaFieldWithAttribute {
6823
6817
  constructor(execution, field) {
6824
6818
  super(execution, field);
6825
- __privateAdd$4(this, _field$1, void 0);
6826
- __privateSet$4(this, _field$1, field);
6819
+ __privateAdd$5(this, _field$1, void 0);
6820
+ __privateSet$5(this, _field$1, field);
6827
6821
  }
6828
6822
  onChange(cb) {
6829
6823
  reaction(
6830
6824
  () => {
6831
- __privateGet$4(this, _field$1).getValue();
6825
+ __privateGet$5(this, _field$1).getValue();
6832
6826
  },
6833
6827
  () => {
6834
- cb(__privateGet$4(this, _field$1).getValue());
6828
+ cb(__privateGet$5(this, _field$1).getValue());
6835
6829
  },
6836
6830
  { fireImmediately: false }
6837
6831
  );
6838
6832
  }
6839
6833
  setValue() {
6840
- if (__privateGet$4(this, _field$1).definition.id && __privateGet$4(this, _field$1).definition.fieldType) {
6834
+ if (__privateGet$5(this, _field$1).definition.id && __privateGet$5(this, _field$1).definition.fieldType) {
6841
6835
  throw new Error(
6842
- `Apia JSApi Error: The Field ${__privateGet$4(this, _field$1).definition.fieldType} does not support this function`
6836
+ `Apia JSApi Error: The Field ${__privateGet$5(this, _field$1).definition.fieldType} does not support this function`
6843
6837
  );
6844
6838
  }
6845
6839
  return null;
@@ -6850,21 +6844,21 @@ _field$1 = new WeakMap();
6850
6844
  class PasswordField extends ApiaField {
6851
6845
  }
6852
6846
 
6853
- var __accessCheck$3 = (obj, member, msg) => {
6847
+ var __accessCheck$4 = (obj, member, msg) => {
6854
6848
  if (!member.has(obj))
6855
6849
  throw TypeError("Cannot " + msg);
6856
6850
  };
6857
- var __privateGet$3 = (obj, member, getter) => {
6858
- __accessCheck$3(obj, member, "read from private field");
6851
+ var __privateGet$4 = (obj, member, getter) => {
6852
+ __accessCheck$4(obj, member, "read from private field");
6859
6853
  return getter ? getter.call(obj) : member.get(obj);
6860
6854
  };
6861
- var __privateAdd$3 = (obj, member, value) => {
6855
+ var __privateAdd$4 = (obj, member, value) => {
6862
6856
  if (member.has(obj))
6863
6857
  throw TypeError("Cannot add the same private member more than once");
6864
6858
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6865
6859
  };
6866
- var __privateSet$3 = (obj, member, value, setter) => {
6867
- __accessCheck$3(obj, member, "write to private field");
6860
+ var __privateSet$4 = (obj, member, value, setter) => {
6861
+ __accessCheck$4(obj, member, "write to private field");
6868
6862
  member.set(obj, value);
6869
6863
  return value;
6870
6864
  };
@@ -6872,92 +6866,96 @@ var _field;
6872
6866
  class ModalInputField extends ApiaFieldWithAttribute {
6873
6867
  constructor(execution, field) {
6874
6868
  super(execution, field);
6875
- __privateAdd$3(this, _field, void 0);
6876
- __privateSet$3(this, _field, field);
6869
+ __privateAdd$4(this, _field, void 0);
6870
+ __privateSet$4(this, _field, field);
6877
6871
  }
6878
6872
  getObjectValue() {
6879
- return __privateGet$3(this, _field).getValue();
6873
+ return __privateGet$4(this, _field).getValue();
6880
6874
  }
6881
6875
  setValue(v) {
6882
- __privateGet$3(this, _field).setValue(v);
6876
+ __privateGet$4(this, _field).setValue(v);
6883
6877
  }
6884
6878
  async setValueFromInputWrite(value) {
6885
- await __privateGet$3(this, _field).setValueFromInputWrite(value);
6879
+ await __privateGet$4(this, _field).setValueFromInputWrite(value);
6886
6880
  }
6887
6881
  }
6888
6882
  _field = new WeakMap();
6889
6883
 
6890
- var __accessCheck$2 = (obj, member, msg) => {
6884
+ var __accessCheck$3 = (obj, member, msg) => {
6891
6885
  if (!member.has(obj))
6892
6886
  throw TypeError("Cannot " + msg);
6893
6887
  };
6894
- var __privateGet$2 = (obj, member, getter) => {
6895
- __accessCheck$2(obj, member, "read from private field");
6888
+ var __privateGet$3 = (obj, member, getter) => {
6889
+ __accessCheck$3(obj, member, "read from private field");
6896
6890
  return getter ? getter.call(obj) : member.get(obj);
6897
6891
  };
6898
- var __privateAdd$2 = (obj, member, value) => {
6892
+ var __privateAdd$3 = (obj, member, value) => {
6899
6893
  if (member.has(obj))
6900
6894
  throw TypeError("Cannot add the same private member more than once");
6901
6895
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6902
6896
  };
6903
- var __privateSet$2 = (obj, member, value, setter) => {
6904
- __accessCheck$2(obj, member, "write to private field");
6897
+ var __privateSet$3 = (obj, member, value, setter) => {
6898
+ __accessCheck$3(obj, member, "write to private field");
6905
6899
  member.set(obj, value);
6906
6900
  return value;
6907
6901
  };
6908
- var _form;
6902
+ var _form, _execution$1;
6909
6903
  class ApiaForm {
6910
6904
  constructor(execution, form) {
6911
- this.execution = execution;
6912
- __privateAdd$2(this, _form, void 0);
6913
- __privateSet$2(this, _form, form);
6905
+ __privateAdd$3(this, _form, void 0);
6906
+ __privateAdd$3(this, _execution$1, void 0);
6907
+ __privateSet$3(this, _form, form);
6908
+ __privateSet$3(this, _execution$1, execution);
6914
6909
  }
6915
6910
  getFrmParent() {
6916
- return __privateGet$2(this, _form).definition.frmParent;
6911
+ return __privateGet$3(this, _form).definition.frmParent;
6917
6912
  }
6918
6913
  getFrmId() {
6919
- return __privateGet$2(this, _form).definition.id;
6914
+ return __privateGet$3(this, _form).definition.id;
6920
6915
  }
6921
6916
  getFormName() {
6922
- return __privateGet$2(this, _form).definition.formName;
6917
+ return __privateGet$3(this, _form).definition.formName;
6923
6918
  }
6924
6919
  getFormTitle() {
6925
- return __privateGet$2(this, _form).definition.formTitle;
6920
+ return __privateGet$3(this, _form).definition.formTitle;
6926
6921
  }
6927
6922
  openForm() {
6928
- __privateGet$2(this, _form).setProperty("prpFrmClosed", false);
6923
+ __privateGet$3(this, _form).setProperty("prpFrmClosed", false);
6929
6924
  }
6930
6925
  closeForm() {
6931
- __privateGet$2(this, _form).setProperty("prpFrmClosed", true);
6926
+ __privateGet$3(this, _form).setProperty("prpFrmClosed", true);
6932
6927
  }
6933
6928
  getProperty(name) {
6934
- return __privateGet$2(this, _form).getProperty(name);
6929
+ return __privateGet$3(this, _form).getProperty(name);
6935
6930
  }
6936
6931
  setProperty(name, value) {
6937
- __privateGet$2(this, _form).setProperty(name, value);
6932
+ if (name === "readOnly") {
6933
+ throw new Error("Cannot update readonly property on forms");
6934
+ }
6935
+ __privateGet$3(this, _form).setProperty(name, value);
6938
6936
  }
6939
6937
  getCustomComponent(attName) {
6940
- return __privateGet$2(this, _form).getCustomComponentByAttName(attName);
6938
+ return __privateGet$3(this, _form).getCustomComponentByAttName(attName);
6941
6939
  }
6942
6940
  getField(fld, index) {
6943
- const field = __privateGet$2(this, _form).getField(fld, index);
6941
+ const field = __privateGet$3(this, _form).getField(fld, index);
6944
6942
  if (field) {
6945
- return createNewField(this.execution, field);
6943
+ return createNewField(__privateGet$3(this, _execution$1), field);
6946
6944
  }
6947
6945
  return void 0;
6948
6946
  }
6949
6947
  getFieldById(fldId) {
6950
- const field = __privateGet$2(this, _form).getFieldById(fldId);
6948
+ const field = __privateGet$3(this, _form).getFieldById(fldId);
6951
6949
  if (field) {
6952
- return createNewField(this.execution, field);
6950
+ return createNewField(__privateGet$3(this, _execution$1), field);
6953
6951
  }
6954
6952
  return void 0;
6955
6953
  }
6956
6954
  getFieldColumn(name) {
6957
- return arrayOrArray(__privateGet$2(this, _form).getFieldByName(name)).map((c) => createNewField(this.execution, c)).filter((f) => Boolean(f));
6955
+ return arrayOrArray(__privateGet$3(this, _form).getFieldByName(name)).map((c) => createNewField(__privateGet$3(this, _execution$1), c)).filter((f) => Boolean(f));
6958
6956
  }
6959
6957
  getAllFields() {
6960
- return __privateGet$2(this, _form).allFields.map((c) => createNewField(this.execution, c)).filter((f) => Boolean(f));
6958
+ return __privateGet$3(this, _form).allFields.map((c) => createNewField(__privateGet$3(this, _execution$1), c)).filter((f) => Boolean(f));
6961
6959
  }
6962
6960
  clearForm(clearReadonlyFields, deleteGridsRows) {
6963
6961
  this.getAllFields().forEach((c) => {
@@ -6971,16 +6969,39 @@ class ApiaForm {
6971
6969
  }
6972
6970
  });
6973
6971
  }
6972
+ hideModal() {
6973
+ __privateGet$3(this, _execution$1).emit("hideFormModal", __privateGet$3(this, _form));
6974
+ }
6975
+ showAsModal() {
6976
+ __privateGet$3(this, _execution$1).emit("showFormAsModal", __privateGet$3(this, _form));
6977
+ }
6974
6978
  }
6975
6979
  _form = new WeakMap();
6980
+ _execution$1 = new WeakMap();
6976
6981
 
6977
- const OptionButton = {
6978
- BTN_VIEW_DOCS: 100,
6979
- BTN_PRINT: 101
6982
+ var __accessCheck$2 = (obj, member, msg) => {
6983
+ if (!member.has(obj))
6984
+ throw TypeError("Cannot " + msg);
6980
6985
  };
6986
+ var __privateGet$2 = (obj, member, getter) => {
6987
+ __accessCheck$2(obj, member, "read from private field");
6988
+ return getter ? getter.call(obj) : member.get(obj);
6989
+ };
6990
+ var __privateAdd$2 = (obj, member, value) => {
6991
+ if (member.has(obj))
6992
+ throw TypeError("Cannot add the same private member more than once");
6993
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6994
+ };
6995
+ var __privateSet$2 = (obj, member, value, setter) => {
6996
+ __accessCheck$2(obj, member, "write to private field");
6997
+ member.set(obj, value);
6998
+ return value;
6999
+ };
7000
+ var _execution;
6981
7001
  class ApiaFunctions {
6982
7002
  constructor(execution) {
6983
- this.execution = execution;
7003
+ __privateAdd$2(this, _execution, void 0);
7004
+ __privateSet$2(this, _execution, execution);
6984
7005
  }
6985
7006
  toJSNumber(_value) {
6986
7007
  throw new Error("Deprecated, use ApiaUtil instead.");
@@ -6998,15 +7019,11 @@ class ApiaFunctions {
6998
7019
  throw new Error("Deprecated, use ApiaUtil instead.");
6999
7020
  }
7000
7021
  getFormByType(frmName, frmType) {
7001
- const form = this.execution.getFormByName(frmName, frmType);
7022
+ const form = __privateGet$2(this, _execution).getFormByName(frmName, frmType);
7002
7023
  if (form)
7003
- return new ApiaForm(this.execution, form);
7024
+ return new ApiaForm(__privateGet$2(this, _execution), form);
7004
7025
  return null;
7005
7026
  }
7006
- actionButton(id) {
7007
- const actualId = this.getButtonAction(id);
7008
- return ActionsController.instance.getButton(actualId);
7009
- }
7010
7027
  admEntity(entName, entNum, parameters, width, height) {
7011
7028
  }
7012
7029
  clearMessages() {
@@ -7015,56 +7032,50 @@ class ApiaFunctions {
7015
7032
  const id = Number(button);
7016
7033
  switch (id) {
7017
7034
  case ActionsController.CONFIRM:
7018
- this.execution.confirm();
7035
+ __privateGet$2(this, _execution).flow.confirm();
7019
7036
  break;
7020
7037
  case ActionsController.NEXT:
7021
- this.execution.next();
7038
+ __privateGet$2(this, _execution).flow.next();
7022
7039
  break;
7023
7040
  case ActionsController.PREVIOUS:
7024
- this.execution.doBack();
7041
+ __privateGet$2(this, _execution).flow.back();
7025
7042
  break;
7026
7043
  case ActionsController.SAVE:
7027
- this.execution.doSave();
7044
+ __privateGet$2(this, _execution).flow.save();
7028
7045
  break;
7029
7046
  case ActionsController.RELEASE:
7030
- this.execution.doFree();
7047
+ __privateGet$2(this, _execution).flow.release();
7031
7048
  break;
7032
7049
  case ActionsController.DELEGATE:
7033
- this.execution.delegate();
7050
+ __privateGet$2(this, _execution).flow.delegate();
7034
7051
  break;
7035
7052
  case ActionsController.SHARE:
7036
- this.execution.shareSocial();
7053
+ __privateGet$2(this, _execution).flow.share();
7037
7054
  break;
7038
- case OptionButton.BTN_VIEW_DOCS:
7039
- this.execution.viewDocs();
7055
+ case ActionsController.VIEW_DOCS:
7056
+ __privateGet$2(this, _execution).flow.viewDocs();
7040
7057
  break;
7041
- case OptionButton.BTN_PRINT:
7042
- this.execution.doPrint();
7058
+ case ActionsController.PRINT:
7059
+ __privateGet$2(this, _execution).flow.print();
7060
+ break;
7061
+ case ActionsController.SEND_TO_DESK:
7062
+ __privateGet$2(this, _execution).sendToDesktop();
7043
7063
  break;
7044
- default:
7045
- return;
7046
7064
  }
7047
7065
  }
7048
7066
  disableActionButton(id) {
7049
- const actualId = this.getButtonAction(id);
7050
- this.actionButton(actualId)?.disable();
7051
- }
7052
- disableOptionButton(id) {
7053
- this.disableActionButton(id);
7067
+ ActionsController.instance.disable(id);
7054
7068
  }
7055
7069
  enableActionButton(id) {
7056
- this.actionButton(id)?.enable();
7057
- }
7058
- enableOptionButton(id) {
7059
- this.enableActionButton(id);
7070
+ ActionsController.instance.enable(id);
7060
7071
  }
7061
7072
  getAllForms() {
7062
- return this.execution.getAllForms().map((c) => new ApiaForm(this.execution, c));
7073
+ return __privateGet$2(this, _execution).getAllForms().map((c) => new ApiaForm(__privateGet$2(this, _execution), c));
7063
7074
  }
7064
7075
  getAllFormsByType(type) {
7065
- return this.execution.getAllForms().reduce((acc, c) => {
7076
+ return __privateGet$2(this, _execution).getAllForms().reduce((acc, c) => {
7066
7077
  if (c.definition.frmParent === type) {
7067
- acc.push(new ApiaForm(this.execution, c));
7078
+ acc.push(new ApiaForm(__privateGet$2(this, _execution), c));
7068
7079
  }
7069
7080
  return acc;
7070
7081
  }, []);
@@ -7076,58 +7087,17 @@ class ApiaFunctions {
7076
7087
  );
7077
7088
  return fields;
7078
7089
  }
7079
- getButtonAction(id) {
7080
- let btnId;
7081
- switch (id) {
7082
- case ActionsController.CLOSE:
7083
- btnId = "btnClose";
7084
- break;
7085
- case ActionsController.CONFIRM:
7086
- btnId = "btnCon";
7087
- break;
7088
- case ActionsController.DELEGATE:
7089
- btnId = "lblExeDelegar";
7090
- break;
7091
- case ActionsController.NEXT:
7092
- btnId = "btnSig";
7093
- break;
7094
- case ActionsController.PREVIOUS:
7095
- btnId = "btnAnt";
7096
- break;
7097
- case ActionsController.PRINT:
7098
- btnId = "btnStaPri";
7099
- break;
7100
- case ActionsController.RELEASE:
7101
- btnId = "btnEjeLib";
7102
- break;
7103
- case ActionsController.SAVE:
7104
- btnId = "btnGua";
7105
- break;
7106
- case ActionsController.SIGN:
7107
- btnId = "btnSig";
7108
- break;
7109
- case ActionsController.SHARE:
7110
- btnId = "lblShareMsg";
7111
- break;
7112
- case ActionsController.VIEW_DOCS:
7113
- btnId = "sbtEjeDoc";
7114
- break;
7115
- default:
7116
- throw new Error(`There is no button with id ${id}`);
7117
- }
7118
- return btnId;
7119
- }
7120
7090
  getCurrentLanguageCode() {
7121
- return getWindow(this.execution).LANG_CODE;
7091
+ return getWindow(__privateGet$2(this, _execution)).LANG_CODE;
7122
7092
  }
7123
7093
  getCurrentProcessName() {
7124
- return this.execution.environment.properties?.processName ?? "";
7094
+ return __privateGet$2(this, _execution).environment.properties?.processName ?? "";
7125
7095
  }
7126
7096
  getCurrentStep() {
7127
- return this.execution.currentStep;
7097
+ return __privateGet$2(this, _execution).currentStep;
7128
7098
  }
7129
7099
  getCurrentTaskName() {
7130
- return this.execution.environment.properties?.taskName ?? "";
7100
+ return __privateGet$2(this, _execution).environment.properties?.taskName ?? "";
7131
7101
  }
7132
7102
  getEntityForm(frmName) {
7133
7103
  const frm = this.getForm(frmName, "E");
@@ -7148,19 +7118,19 @@ class ApiaFunctions {
7148
7118
  return pForm;
7149
7119
  }
7150
7120
  getLastModalReturn() {
7151
- return this.execution.getLastModalReturn();
7121
+ return __privateGet$2(this, _execution).getLastModalReturn();
7152
7122
  }
7153
7123
  getModalReturn() {
7154
7124
  return this.getLastModalReturn();
7155
7125
  }
7156
7126
  getModalSelectedRow() {
7157
- return this.execution.getLastModalReturn()?.slice(2);
7127
+ return __privateGet$2(this, _execution).getLastModalReturn()?.slice(2);
7158
7128
  }
7159
7129
  getModalShowValue() {
7160
- return this.execution.getLastModalReturn()[1];
7130
+ return __privateGet$2(this, _execution).getLastModalReturn()[1];
7161
7131
  }
7162
7132
  getModalValue() {
7163
- return this.execution.getLastModalReturn()[0];
7133
+ return __privateGet$2(this, _execution).getLastModalReturn()[0];
7164
7134
  }
7165
7135
  getProcessForm(frmName) {
7166
7136
  const frm = this.getForm(frmName, "P");
@@ -7170,7 +7140,7 @@ class ApiaFunctions {
7170
7140
  }
7171
7141
  getRootPath() {
7172
7142
  try {
7173
- return getWindow(this.execution).APIA_ROOT_CONTEXT;
7143
+ return getWindow(__privateGet$2(this, _execution)).APIA_ROOT_CONTEXT;
7174
7144
  } catch (e) {
7175
7145
  if (e instanceof Error) {
7176
7146
  console.error(`Apia JSApi Error: ${e.message}`);
@@ -7179,33 +7149,31 @@ class ApiaFunctions {
7179
7149
  return null;
7180
7150
  }
7181
7151
  hideActionButton(id) {
7182
- this.actionButton(id)?.hide();
7152
+ ActionsController.instance.hide(id);
7153
+ }
7154
+ isActionButtonDisabled(id) {
7155
+ return ActionsController.instance.isDisabled(id);
7183
7156
  }
7184
- hideOptionButton(id) {
7185
- this.hideActionButton(id);
7157
+ isActionButtonHidden(id) {
7158
+ return ActionsController.instance.isHidden(id);
7186
7159
  }
7187
7160
  saveTask() {
7188
- this.execution.doSave().then((res) => {
7189
- if (res)
7190
- console.warn("Manage...");
7191
- });
7161
+ __privateGet$2(this, _execution).flow.save();
7192
7162
  }
7193
7163
  setLastModalReturn(value) {
7194
- getWindow(this.execution).lastModalReturn = value;
7164
+ getWindow(__privateGet$2(this, _execution)).lastModalReturn = value;
7195
7165
  }
7196
7166
  setStepTitle(stepNumber, stepTitle) {
7197
- this.execution.setStepTitle(stepNumber, stepTitle);
7167
+ __privateGet$2(this, _execution).setStepTitle(stepNumber, stepTitle);
7198
7168
  }
7199
7169
  showActionButton(id) {
7200
- this.actionButton(id)?.show();
7201
- }
7202
- showOptionButton(id) {
7203
- this.showActionButton(id);
7170
+ ActionsController.instance.show(id);
7204
7171
  }
7205
7172
  viewAdmEntity(entName, entNum) {
7206
7173
  this.admEntity(entName, entNum);
7207
7174
  }
7208
7175
  }
7176
+ _execution = new WeakMap();
7209
7177
 
7210
7178
  var ApiaFunctions$1 = /*#__PURE__*/Object.freeze({
7211
7179
  __proto__: null,
@@ -7267,6 +7235,9 @@ class CustomComponent {
7267
7235
  getAdditional() {
7268
7236
  return this.state.additional;
7269
7237
  }
7238
+ getCurrentForm() {
7239
+ return new ApiaForm(this.execution, this.form);
7240
+ }
7270
7241
  async init(form) {
7271
7242
  if (__privateGet$1(this, _hasInited))
7272
7243
  throw new Error("Cannot init field twice");
@@ -7875,26 +7846,31 @@ class Form extends WithProperties {
7875
7846
  (c) => c.evtName === eventName
7876
7847
  );
7877
7848
  if (events.length > 0) {
7878
- for (const event of events) {
7879
- try {
7880
- const fn = getWindow(this.execution)[event.fncName];
7881
- const result = await fn(
7882
- new ApiaForm(this.execution, this),
7883
- ...await this.getScriptEventParams(event.fncParams)
7884
- );
7885
- if (!result) {
7849
+ const unlock = this.execution.lock();
7850
+ try {
7851
+ for (const event of events) {
7852
+ try {
7853
+ const fn = getWindow(this.execution)[event.fncName];
7854
+ const result = await fn(
7855
+ new ApiaForm(this.execution, this),
7856
+ ...await this.getScriptEventParams(event.fncParams)
7857
+ );
7858
+ if (!result) {
7859
+ return false;
7860
+ }
7861
+ } catch (e) {
7862
+ console.error(e);
7863
+ this.execution.notifications.add(
7864
+ new MessageNotification({
7865
+ message: labels.errorOnEvent(this.execution, event.fncName) + e,
7866
+ type: "error"
7867
+ })
7868
+ );
7886
7869
  return false;
7887
7870
  }
7888
- } catch (e) {
7889
- console.error(e);
7890
- this.execution.notifications.add(
7891
- new MessageNotification({
7892
- message: labels.errorOnEvent(this.execution, event.fncName) + e,
7893
- type: "error"
7894
- })
7895
- );
7896
- return false;
7897
7871
  }
7872
+ } finally {
7873
+ unlock();
7898
7874
  }
7899
7875
  }
7900
7876
  return true;
@@ -7902,6 +7878,9 @@ class Form extends WithProperties {
7902
7878
  async validate() {
7903
7879
  let isValid = true;
7904
7880
  let firstInvalid = null;
7881
+ if (this.properties.frmHidden) {
7882
+ return true;
7883
+ }
7905
7884
  for await (const field of this.allFields) {
7906
7885
  if (field.definition.fieldType === "grid") {
7907
7886
  const result = await field.validate();
@@ -7911,7 +7890,7 @@ class Form extends WithProperties {
7911
7890
  } else {
7912
7891
  isValid = isValid && result === true;
7913
7892
  }
7914
- } else if (field instanceof Field$1) {
7893
+ } else if (field instanceof Field) {
7915
7894
  isValid = await field.validate() && isValid;
7916
7895
  if (!isValid && !firstInvalid) {
7917
7896
  firstInvalid = field;
@@ -7920,6 +7899,12 @@ class Form extends WithProperties {
7920
7899
  }
7921
7900
  return isValid || firstInvalid;
7922
7901
  }
7902
+ getProperty(propName) {
7903
+ if (propName === "readOnly") {
7904
+ return this.definition.readOnly || this.definition.readonly;
7905
+ }
7906
+ return super.getProperty(propName);
7907
+ }
7923
7908
  }
7924
7909
 
7925
7910
  function decodeBase64ToUtf8(base64String) {
@@ -8983,6 +8968,7 @@ class Execution extends EventEmitter$1 {
8983
8968
  __publicField(this, "entity", new Entity(this));
8984
8969
  __publicField(this, "process", new Process(this));
8985
8970
  __publicField(this, "observations", new Observations(this));
8971
+ __publicField(this, "executedOnLoadEvents", false);
8986
8972
  __publicField(this, "executionConfig", null);
8987
8973
  __publicField(this, "_steps", []);
8988
8974
  __publicField(this, "_currentStep", 1);
@@ -8999,11 +8985,43 @@ class Execution extends EventEmitter$1 {
8999
8985
  });
9000
8986
  __publicField(this, "state", {
9001
8987
  executionState: ExecutionState.LOADING,
9002
- locked: true,
8988
+ locked: 0,
9003
8989
  hasChangedAnything: false
9004
8990
  });
9005
8991
  __publicField(this, "hasInitializedFormsTabs", {});
9006
8992
  __publicField(this, "mustRenderForms", []);
8993
+ __publicField(this, "flow", {
8994
+ back: () => {
8995
+ this.emit("flow", "previous");
8996
+ },
8997
+ confirm: () => {
8998
+ this.emit("flow", "confirm");
8999
+ },
9000
+ next: () => {
9001
+ this.emit("flow", "next");
9002
+ },
9003
+ previous: () => {
9004
+ this.emit("flow", "previous");
9005
+ },
9006
+ save: () => {
9007
+ this.emit("flow", "save");
9008
+ },
9009
+ release: () => {
9010
+ this.emit("flow", "release");
9011
+ },
9012
+ delegate: () => {
9013
+ this.emit("flow", "delegate");
9014
+ },
9015
+ share: () => {
9016
+ this.emit("flow", "share");
9017
+ },
9018
+ viewDocs: () => {
9019
+ this.emit("flow", "viewDocs");
9020
+ },
9021
+ print: () => {
9022
+ this.emit("flow", "print");
9023
+ }
9024
+ });
9007
9025
  this.fieldsMapping = { ...defaultFieldsMap, ...environment.fieldsMapping };
9008
9026
  this.notifications = new Notifications(this);
9009
9027
  makeObservable(this, { state: observable });
@@ -9053,88 +9071,111 @@ class Execution extends EventEmitter$1 {
9053
9071
  getCurrentTask() {
9054
9072
  return new Task({ task: { name: "TODO" } });
9055
9073
  }
9056
- async run(executionConfig) {
9057
- this._stepCount = noNaN$1(getWindow(this).STEP_QTY);
9058
- this._currentStep = noNaN$1(getWindow(this).CURRENT_STEP);
9059
- this.executionConfig = executionConfig;
9060
- this.environment.properties = {
9061
- taskName: getWindow(this).CURRENT_TASK_NAME || "",
9062
- processName: getWindow(this).CURRENT_PROCESS_NAME || ""
9063
- };
9064
- const errXML = unescapeMarkup(getWindow(this).EXEC_ERRORS);
9065
- if (errXML) {
9066
- const obj = parseXml(errXML);
9067
- arrayOrArray(obj.sysMessages?.message).forEach(
9068
- (c) => this.notifications.add(
9069
- new MessageNotification({
9070
- message: c.text,
9071
- type: "warning"
9072
- })
9073
- )
9074
- );
9075
- [
9076
- ...arrayOrArray(obj.exceptions?.exception),
9077
- ...arrayOrArray(obj.sysExceptions?.exception)
9078
- ].forEach(
9079
- (c) => this.notifications.add(
9080
- new MessageNotification({
9081
- message: c.text,
9082
- type: "error",
9083
- stackTrace: c.label
9084
- })
9085
- )
9086
- );
9087
- }
9088
- for (let i = 1; i < Number(getWindow(this).STEP_QTY) + 1; i++) {
9089
- if (i < this._currentStep) {
9090
- this._steps.push({
9091
- title: `Step ${i}`,
9092
- stepNumber: i,
9093
- status: "completed"
9094
- });
9095
- }
9096
- if (i > this._currentStep && i <= this._stepCount) {
9097
- this._steps.push({
9098
- title: `Step ${i}`,
9099
- stepNumber: i,
9100
- status: "pending"
9101
- });
9102
- }
9103
- if (i === this._currentStep) {
9104
- this._steps.push({
9105
- title: `Step ${i}`,
9106
- stepNumber: i,
9107
- status: "current"
9108
- });
9074
+ get locked() {
9075
+ return this.state.locked > 0;
9076
+ }
9077
+ lock() {
9078
+ this.state.locked++;
9079
+ let unlocked = false;
9080
+ return () => {
9081
+ if (!unlocked) {
9082
+ unlocked = true;
9083
+ this.state.locked--;
9109
9084
  }
9110
- }
9111
- const res = await InitialData.getFormsDefinition(this);
9085
+ };
9086
+ }
9087
+ async run(executionConfig) {
9088
+ const unlock = this.lock();
9112
9089
  try {
9113
- for await (const formDefinition of res) {
9114
- const props = parseFakeJSON$1(formDefinition.properties);
9115
- if (!props.frmTab && !props.frmHidden && (arrayOrArray(formDefinition.field).length > 0 || arrayOrArray(formDefinition.customField).length > 0)) {
9116
- this.mustRenderForms.push(
9117
- formDefinition.frmParent + "_" + formDefinition.formName
9118
- );
9090
+ this._stepCount = noNaN$1(getWindow(this).STEP_QTY);
9091
+ this._currentStep = noNaN$1(getWindow(this).CURRENT_STEP);
9092
+ this.executionConfig = executionConfig;
9093
+ this.environment.properties = {
9094
+ taskName: getWindow(this).CURRENT_TASK_NAME || "",
9095
+ processName: getWindow(this).CURRENT_PROCESS_NAME || ""
9096
+ };
9097
+ const errXML = unescapeMarkup(getWindow(this).EXEC_ERRORS);
9098
+ if (errXML) {
9099
+ const obj = parseXml(errXML);
9100
+ arrayOrArray(obj.sysMessages?.message).forEach(
9101
+ (c) => this.notifications.add(
9102
+ new MessageNotification({
9103
+ message: c.text,
9104
+ type: "warning"
9105
+ })
9106
+ )
9107
+ );
9108
+ [
9109
+ ...arrayOrArray(obj.exceptions?.exception),
9110
+ ...arrayOrArray(obj.sysExceptions?.exception)
9111
+ ].forEach(
9112
+ (c) => this.notifications.add(
9113
+ new MessageNotification({
9114
+ message: c.text,
9115
+ type: "error",
9116
+ stackTrace: c.label
9117
+ })
9118
+ )
9119
+ );
9120
+ }
9121
+ for (let i = 1; i < Number(getWindow(this).STEP_QTY) + 1; i++) {
9122
+ if (i < this._currentStep) {
9123
+ this._steps.push({
9124
+ title: `Step ${i}`,
9125
+ stepNumber: i,
9126
+ status: "completed"
9127
+ });
9128
+ }
9129
+ if (i > this._currentStep && i <= this._stepCount) {
9130
+ this._steps.push({
9131
+ title: `Step ${i}`,
9132
+ stepNumber: i,
9133
+ status: "pending"
9134
+ });
9135
+ }
9136
+ if (i === this._currentStep) {
9137
+ this._steps.push({
9138
+ title: `Step ${i}`,
9139
+ stepNumber: i,
9140
+ status: "current"
9141
+ });
9119
9142
  }
9120
9143
  }
9121
- for await (const formDefinition of res) {
9122
- const newForm = new Form(this, formDefinition);
9123
- await newForm.init();
9124
- if (formDefinition.frmParent === "E") {
9125
- this.forms.E.set(formDefinition.formName, newForm);
9126
- this.formsById.E.set(String(formDefinition.id), newForm);
9127
- } else {
9128
- this.forms.P.set(formDefinition.formName, newForm);
9129
- this.formsById.P.set(String(formDefinition.id), newForm);
9144
+ const res = await InitialData.getFormsDefinition(this);
9145
+ try {
9146
+ for await (const formDefinition of res) {
9147
+ const props = parseFakeJSON$1(formDefinition.properties);
9148
+ if (!props.frmTab && !props.frmHidden && arrayOrArray(formDefinition.field).every(
9149
+ (c) => !c.properties?.visibilityHidden
9150
+ ) && (arrayOrArray(formDefinition.field).length > 0 || arrayOrArray(formDefinition.customField).length > 0)) {
9151
+ this.mustRenderForms.push(
9152
+ formDefinition.frmParent + "_" + formDefinition.formName
9153
+ );
9154
+ }
9130
9155
  }
9156
+ for await (const formDefinition of res) {
9157
+ const newForm = new Form(this, formDefinition);
9158
+ await newForm.init();
9159
+ if (formDefinition.frmParent === "E") {
9160
+ this.forms.E.set(formDefinition.formName, newForm);
9161
+ this.formsById.E.set(String(formDefinition.id), newForm);
9162
+ } else {
9163
+ this.forms.P.set(formDefinition.formName, newForm);
9164
+ this.formsById.P.set(String(formDefinition.id), newForm);
9165
+ }
9166
+ }
9167
+ this.state.executionState = this.mustRenderForms.length === 0 ? ExecutionState.RUNNING : ExecutionState.RENDERING;
9168
+ await this.fireEvents("onLoad");
9169
+ this.executedOnLoadEvents = true;
9170
+ if (this.mustRenderForms.length === 0 && this.state.executionState === ExecutionState.RENDERING) {
9171
+ this.state.executionState = ExecutionState.RUNNING;
9172
+ }
9173
+ } catch (e) {
9174
+ this.state.executionState = ExecutionState.FINISHED_WITH_ERROR;
9175
+ throw e;
9131
9176
  }
9132
- this.state.executionState = this.mustRenderForms.length === 0 ? ExecutionState.RUNNING : ExecutionState.RENDERING;
9133
- this.state.locked = false;
9134
- this.fireEvents("onLoad");
9135
- } catch (e) {
9136
- this.state.executionState = ExecutionState.FINISHED_WITH_ERROR;
9137
- throw e;
9177
+ } finally {
9178
+ unlock();
9138
9179
  }
9139
9180
  }
9140
9181
  getHiddenForms() {
@@ -9147,7 +9188,7 @@ class Execution extends EventEmitter$1 {
9147
9188
  this.mustRenderForms = this.mustRenderForms.filter(
9148
9189
  (c) => c !== frmParent + "_" + frmName
9149
9190
  );
9150
- if (this.mustRenderForms.length === 0) {
9191
+ if (this.mustRenderForms.length === 0 && this.executedOnLoadEvents) {
9151
9192
  this.state.executionState = ExecutionState.RUNNING;
9152
9193
  }
9153
9194
  }
@@ -9157,12 +9198,6 @@ class Execution extends EventEmitter$1 {
9157
9198
  async shareSocial() {
9158
9199
  console.warn("shareSocial not implemented yet");
9159
9200
  }
9160
- confirm() {
9161
- this.emit("confirm", null);
9162
- }
9163
- next() {
9164
- this.emit("next", null);
9165
- }
9166
9201
  sendToDesktop() {
9167
9202
  this.emit("sendToDesktop", null);
9168
9203
  }
@@ -9196,7 +9231,6 @@ class Execution extends EventEmitter$1 {
9196
9231
  }
9197
9232
  async doConfirm(status) {
9198
9233
  if (status && !status?.step && !status?.finishedWithError) {
9199
- this.state.locked = false;
9200
9234
  return false;
9201
9235
  } else {
9202
9236
  const validationResult = status !== void 0 || await this.validate();
@@ -9206,8 +9240,8 @@ class Execution extends EventEmitter$1 {
9206
9240
  const isValid = status !== void 0 || await this.fireEvents("onSubmit");
9207
9241
  const canConfirm = this.executionConfig?.canConfirm && isValid === true;
9208
9242
  if (canConfirm) {
9243
+ const unlock = this.lock();
9209
9244
  try {
9210
- this.state.locked = true;
9211
9245
  const result = await (this.executionConfig?.isEntity ? confirmEntity : confirm)(
9212
9246
  this,
9213
9247
  status || {
@@ -9217,10 +9251,8 @@ class Execution extends EventEmitter$1 {
9217
9251
  if (result instanceof FlowModal$1) {
9218
9252
  return result;
9219
9253
  }
9220
- this.state.locked = false;
9221
9254
  return result;
9222
9255
  } catch (error) {
9223
- this.state.locked = false;
9224
9256
  console.error("Confirmation process failed:", error);
9225
9257
  this.notifications.add(
9226
9258
  new MessageNotification({
@@ -9229,9 +9261,10 @@ class Execution extends EventEmitter$1 {
9229
9261
  })
9230
9262
  );
9231
9263
  return false;
9264
+ } finally {
9265
+ unlock();
9232
9266
  }
9233
9267
  } else {
9234
- this.state.locked = false;
9235
9268
  return isValid;
9236
9269
  }
9237
9270
  }
@@ -9273,6 +9306,7 @@ class Execution extends EventEmitter$1 {
9273
9306
  return isValid;
9274
9307
  const canGoNext = this.executionConfig?.canGoForward && isValid === true;
9275
9308
  if (canGoNext) {
9309
+ const unlock = this.lock();
9276
9310
  try {
9277
9311
  const checkLocksRes = await post(
9278
9312
  this,
@@ -9342,6 +9376,8 @@ class Execution extends EventEmitter$1 {
9342
9376
  })
9343
9377
  );
9344
9378
  return false;
9379
+ } finally {
9380
+ unlock();
9345
9381
  }
9346
9382
  }
9347
9383
  }
@@ -9349,23 +9385,24 @@ class Execution extends EventEmitter$1 {
9349
9385
  getWindow(this).print();
9350
9386
  }
9351
9387
  async doSave() {
9352
- const response = await post(
9353
- this,
9354
- makeApiaUrl(this, {
9355
- action: "saveTask",
9356
- asXML: true,
9357
- react: true
9358
- })
9359
- );
9360
- const canClose = response?.data?.load?.canClose;
9361
- if (canClose) {
9362
- getWindow(this).location.assign(
9388
+ const unlock = this.lock();
9389
+ try {
9390
+ const response = await post(
9391
+ this,
9363
9392
  makeApiaUrl(this, {
9364
- action: "refreshPage"
9393
+ action: "saveTask",
9394
+ asXML: true,
9395
+ react: true
9365
9396
  })
9366
9397
  );
9367
- return response;
9398
+ const canClose = response?.data?.load?.canClose;
9399
+ if (canClose) {
9400
+ return response;
9401
+ }
9402
+ } finally {
9403
+ unlock();
9368
9404
  }
9405
+ return false;
9369
9406
  }
9370
9407
  getStepTitle(step) {
9371
9408
  if (this._steps)
@@ -9414,22 +9451,27 @@ class Execution extends EventEmitter$1 {
9414
9451
  return this.lastModalReturn;
9415
9452
  }
9416
9453
  async fireEvents(evt) {
9454
+ const unlock = this.lock();
9417
9455
  let result = true;
9418
- for await (const f of this.forms.E.values()) {
9419
- result = result && await f.fireScriptEvent(evt);
9420
- if (!result) {
9421
- return false;
9456
+ try {
9457
+ for await (const f of this.forms.E.values()) {
9458
+ result = result && await f.fireScriptEvent(evt);
9459
+ if (!result) {
9460
+ return false;
9461
+ }
9422
9462
  }
9423
- }
9424
- for await (const f of this.forms.P.values()) {
9425
- result = result && await f.fireScriptEvent(evt);
9426
- if (!result) {
9427
- return false;
9463
+ for await (const f of this.forms.P.values()) {
9464
+ result = result && await f.fireScriptEvent(evt);
9465
+ if (!result) {
9466
+ return false;
9467
+ }
9428
9468
  }
9469
+ return true;
9470
+ } finally {
9471
+ unlock();
9429
9472
  }
9430
- return true;
9431
9473
  }
9432
9474
  }
9433
9475
 
9434
- export { ActionsController, AdditionalCell, ApiaAttribute, ApiaField, ApiaFieldWithAttribute, ApiaForm, ApiaFunctions, BouncingEmitter, Button, ButtonField, Captcha, CaptchaField, CheckField, Checkbox, CustomComponent, GridField as DataGridField, Editor, EditorField, EventEmitter, Execution, ExecutionState, Field$1 as Field, FieldWithAttribute, File, FileUploaderField, FlowModal$1 as FlowModal, Form, FormsUploader, Grid, GridCell, GridField, GridPaginated, HeaderCell, Hidden, HiddenField, IProperty, Image, ImageField, Input, InputField, InvalidSessionException, Label, Link, LinkField, MessageNotification, ModalInput, ModalInputField, Multiple, MultipleField, Notifications, Password, PasswordField, Radio, RadioField, SchedulerField, Select, SelectField, ShowConfirmMessage, ShowPathSelection, ShowPoolSelection, ShowSign$1 as ShowSign, ShowSignSelection$1 as ShowSignSelection, StatefulEmitter, StatusNotification, AreaField as TextAreaField, TextField, Textarea, Title, TranslatableField, Translation, Tree, TreeField, UploaderApi, UploaderModalController, createNewField, deepEqual, get, getLabel, isHtmlResponse, isJsonResponse, isOneClickUploadEnabled, isXmlResponse, makeApiaUrl, parseFakeJSON$1 as parseFakeJSON, parseFileDefinition, parseSuccessfulResponse, parseXml, post, returnExactlyTheSame, shallowEqual };
9476
+ export { ActionsController, AdditionalCell, ApiaAttribute, ApiaField, ApiaFieldWithAttribute, ApiaForm, ApiaFunctions, BouncingEmitter, Button, ButtonField, Captcha, CaptchaField, CheckField, Checkbox, CustomComponent, GridField as DataGridField, Editor, EditorField, EventEmitter, Execution, ExecutionState, Field, FieldWithAttribute, File, FileUploaderField, FlowModal$1 as FlowModal, Form, FormsUploader, Grid, GridCell, GridField, GridPaginated, HeaderCell, Hidden, HiddenField, IProperty, Image, ImageField, Input, InputField, InvalidSessionException, Label, Link, LinkField, MessageNotification, ModalInput, ModalInputField, Multiple, MultipleField, Notifications, Password, PasswordField, Radio, RadioField, SchedulerField, Select, SelectField, ShowConfirmMessage, ShowPathSelection, ShowPoolSelection, ShowSign$1 as ShowSign, ShowSignSelection$1 as ShowSignSelection, StatefulEmitter, StatusNotification, AreaField as TextAreaField, TextField, Textarea, Title, TranslatableField, Translation, Tree, TreeField, UploaderApi, UploaderModalController, createNewField, deepEqual, get, getLabel, isHtmlResponse, isJsonResponse, isOneClickUploadEnabled, isXmlResponse, makeApiaUrl, parseFakeJSON$1 as parseFakeJSON, parseFileDefinition, parseSuccessfulResponse, parseXml, post, returnExactlyTheSame, shallowEqual };
9435
9477
  //# sourceMappingURL=index.js.map