@apia/execution 4.0.30 → 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
  };
@@ -1190,12 +1196,12 @@ async function getApiaFunctions(execution) {
1190
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 @@ 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 @@ 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() {
@@ -1400,16 +1411,16 @@ class Button extends Field {
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
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 {
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
  };
@@ -1577,9 +1588,9 @@ class FieldWithAttribute extends Field {
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 {
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 {
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 {
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 {
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) {
@@ -4204,19 +4222,19 @@ class Grid extends Field {
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
@@ -5207,9 +5225,20 @@ class GridPaginated extends Grid {
5207
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,12 +5291,12 @@ 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
 
@@ -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,7 +5387,7 @@ 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
 
@@ -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;
@@ -5469,12 +5512,6 @@ 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 {
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(
@@ -5697,61 +5746,6 @@ const IProperty = {
5697
5746
  ...FormConstants
5698
5747
  };
5699
5748
 
5700
- class ButtonsAction {
5701
- constructor(button) {
5702
- this.button = button;
5703
- makeObservable(this, {
5704
- button: observable
5705
- });
5706
- }
5707
- update(props) {
5708
- if (this.button) {
5709
- this.button = { ...this.button, ...props };
5710
- }
5711
- }
5712
- get action() {
5713
- return this;
5714
- }
5715
- get disabled() {
5716
- return this.button.disabled;
5717
- }
5718
- get props() {
5719
- const properties = {
5720
- disabled: this.button.disabled,
5721
- hidden: this.button.hidden,
5722
- loading: this.button.isLoading
5723
- };
5724
- return properties;
5725
- }
5726
- get label() {
5727
- return this.button?.label;
5728
- }
5729
- get title() {
5730
- return this.button?.title ?? "";
5731
- }
5732
- get variant() {
5733
- return this.button?.variant ?? "";
5734
- }
5735
- set title(title) {
5736
- this.update({ title });
5737
- }
5738
- set variant(variant) {
5739
- this.update({ variant });
5740
- }
5741
- disable() {
5742
- this.update({ disabled: true });
5743
- }
5744
- enable() {
5745
- this.update({ disabled: false });
5746
- }
5747
- hide() {
5748
- this.update({ hidden: true });
5749
- }
5750
- show() {
5751
- this.update({ hidden: false });
5752
- }
5753
- }
5754
-
5755
5749
  var __defProp$8 = Object.defineProperty;
5756
5750
  var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5757
5751
  var __publicField$8 = (obj, key, value) => {
@@ -5761,6 +5755,7 @@ var __publicField$8 = (obj, key, value) => {
5761
5755
  const _ActionsController = class _ActionsController {
5762
5756
  constructor() {
5763
5757
  __publicField$8(this, "buttons", /* @__PURE__ */ new Map());
5758
+ makeAutoObservable(this);
5764
5759
  }
5765
5760
  static get instance() {
5766
5761
  if (!_ActionsController._instance) {
@@ -5768,26 +5763,29 @@ const _ActionsController = class _ActionsController {
5768
5763
  }
5769
5764
  return _ActionsController._instance;
5770
5765
  }
5771
- addButton(button) {
5772
- if (this.buttons.has(button.id))
5773
- return;
5774
- this.buttons.set(
5775
- button.id,
5776
- new ButtonsAction({
5777
- ...{
5778
- isLoading: false,
5779
- disabled: false,
5780
- hidden: false
5781
- },
5782
- ...button
5783
- })
5784
- );
5785
- }
5786
- getButton(id) {
5787
- if (this.buttons.has(id)) {
5788
- return this.buttons.get(id);
5766
+ get(id) {
5767
+ if (!this.buttons.has(id)) {
5768
+ this.buttons.set(id, {});
5789
5769
  }
5790
- throw Error("That button not exist");
5770
+ return this.buttons.get(id);
5771
+ }
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;
5791
5789
  }
5792
5790
  };
5793
5791
  __publicField$8(_ActionsController, "CONFIRM", 0);
@@ -5801,78 +5799,87 @@ __publicField$8(_ActionsController, "SHARE", 7);
5801
5799
  __publicField$8(_ActionsController, "PRINT", 8);
5802
5800
  __publicField$8(_ActionsController, "VIEW_DOCS", 9);
5803
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);
5804
5811
  __publicField$8(_ActionsController, "_instance");
5805
5812
  let ActionsController = _ActionsController;
5806
5813
 
5807
- var __accessCheck$h = (obj, member, msg) => {
5814
+ var __accessCheck$i = (obj, member, msg) => {
5808
5815
  if (!member.has(obj))
5809
5816
  throw TypeError("Cannot " + msg);
5810
5817
  };
5811
- var __privateGet$h = (obj, member, getter) => {
5812
- __accessCheck$h(obj, member, "read from private field");
5818
+ var __privateGet$i = (obj, member, getter) => {
5819
+ __accessCheck$i(obj, member, "read from private field");
5813
5820
  return getter ? getter.call(obj) : member.get(obj);
5814
5821
  };
5815
- var __privateAdd$h = (obj, member, value) => {
5822
+ var __privateAdd$i = (obj, member, value) => {
5816
5823
  if (member.has(obj))
5817
5824
  throw TypeError("Cannot add the same private member more than once");
5818
5825
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5819
5826
  };
5820
- var __privateSet$h = (obj, member, value, setter) => {
5821
- __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");
5822
5829
  member.set(obj, value);
5823
5830
  return value;
5824
5831
  };
5825
- var _execution$2, _field$e;
5832
+ var _execution$3, _field$e;
5826
5833
  class ApiaField {
5827
5834
  constructor(execution, field) {
5828
- __privateAdd$h(this, _execution$2, void 0);
5829
- __privateAdd$h(this, _field$e, void 0);
5830
- __privateSet$h(this, _execution$2, execution);
5831
- __privateSet$h(this, _field$e, field);
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);
5832
5839
  }
5833
5840
  get fldType() {
5834
- return __privateGet$h(this, _field$e).definition.fieldType;
5841
+ return __privateGet$i(this, _field$e).definition.fieldType;
5835
5842
  }
5836
5843
  get fldId() {
5837
- return __privateGet$h(this, _field$e).definition.id;
5844
+ return __privateGet$i(this, _field$e).definition.id;
5838
5845
  }
5839
5846
  get form() {
5840
- return new ApiaForm(__privateGet$h(this, _execution$2), __privateGet$h(this, _field$e).getForm());
5847
+ return new ApiaForm(__privateGet$i(this, _execution$3), __privateGet$i(this, _field$e).getForm());
5841
5848
  }
5842
5849
  get index() {
5843
- return __privateGet$h(this, _field$e).definition.index || 0;
5850
+ return __privateGet$i(this, _field$e).definition.index || 0;
5844
5851
  }
5845
5852
  setProperty(name, value) {
5846
- __privateGet$h(this, _field$e).setProperty(name, value);
5853
+ __privateGet$i(this, _field$e).setProperty(name, value);
5847
5854
  }
5848
5855
  getProperty(name) {
5849
- return __privateGet$h(this, _field$e).getProperty(name);
5856
+ return __privateGet$i(this, _field$e).getProperty(name);
5850
5857
  }
5851
5858
  setFocus() {
5852
5859
  throw new Error("Method not implemented. ");
5853
5860
  }
5854
5861
  isInGrid() {
5855
- return !!__privateGet$h(this, _field$e).properties.inGrid;
5862
+ return !!__privateGet$i(this, _field$e).properties.inGrid;
5856
5863
  }
5857
5864
  }
5858
- _execution$2 = new WeakMap();
5865
+ _execution$3 = new WeakMap();
5859
5866
  _field$e = new WeakMap();
5860
5867
 
5861
- var __accessCheck$g = (obj, member, msg) => {
5868
+ var __accessCheck$h = (obj, member, msg) => {
5862
5869
  if (!member.has(obj))
5863
5870
  throw TypeError("Cannot " + msg);
5864
5871
  };
5865
- var __privateGet$g = (obj, member, getter) => {
5866
- __accessCheck$g(obj, member, "read from private field");
5872
+ var __privateGet$h = (obj, member, getter) => {
5873
+ __accessCheck$h(obj, member, "read from private field");
5867
5874
  return getter ? getter.call(obj) : member.get(obj);
5868
5875
  };
5869
- var __privateAdd$g = (obj, member, value) => {
5876
+ var __privateAdd$h = (obj, member, value) => {
5870
5877
  if (member.has(obj))
5871
5878
  throw TypeError("Cannot add the same private member more than once");
5872
5879
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5873
5880
  };
5874
- var __privateSet$g = (obj, member, value, setter) => {
5875
- __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");
5876
5883
  member.set(obj, value);
5877
5884
  return value;
5878
5885
  };
@@ -5880,22 +5887,22 @@ var _field$d;
5880
5887
  class ButtonField extends ApiaField {
5881
5888
  constructor(execution, field) {
5882
5889
  super(execution, field);
5883
- __privateAdd$g(this, _field$d, void 0);
5884
- __privateSet$g(this, _field$d, field);
5890
+ __privateAdd$h(this, _field$d, void 0);
5891
+ __privateSet$h(this, _field$d, field);
5885
5892
  }
5886
5893
  fireClickEvent() {
5887
- if (__privateGet$g(this, _field$d).definition.id) {
5888
- __privateGet$g(this, _field$d).fireEvent("onClick");
5894
+ if (__privateGet$h(this, _field$d).definition.id) {
5895
+ __privateGet$h(this, _field$d).fireEvent("onClick");
5889
5896
  }
5890
5897
  }
5891
5898
  getValue() {
5892
- if (__privateGet$g(this, _field$d).definition.id) {
5893
- 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 ?? "";
5894
5901
  }
5895
5902
  return null;
5896
5903
  }
5897
5904
  clearValue() {
5898
- __privateGet$g(this, _field$d).properties.value = "";
5905
+ __privateGet$h(this, _field$d).properties.value = "";
5899
5906
  }
5900
5907
  setValue(value) {
5901
5908
  this.setProperty("value", value);
@@ -5903,64 +5910,64 @@ class ButtonField extends ApiaField {
5903
5910
  }
5904
5911
  _field$d = new WeakMap();
5905
5912
 
5906
- var __accessCheck$f = (obj, member, msg) => {
5913
+ var __accessCheck$g = (obj, member, msg) => {
5907
5914
  if (!member.has(obj))
5908
5915
  throw TypeError("Cannot " + msg);
5909
5916
  };
5910
- var __privateGet$f = (obj, member, getter) => {
5911
- __accessCheck$f(obj, member, "read from private field");
5917
+ var __privateGet$g = (obj, member, getter) => {
5918
+ __accessCheck$g(obj, member, "read from private field");
5912
5919
  return getter ? getter.call(obj) : member.get(obj);
5913
5920
  };
5914
- var __privateAdd$f = (obj, member, value) => {
5921
+ var __privateAdd$g = (obj, member, value) => {
5915
5922
  if (member.has(obj))
5916
5923
  throw TypeError("Cannot add the same private member more than once");
5917
5924
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5918
5925
  };
5919
- var __privateSet$f = (obj, member, value, setter) => {
5920
- __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");
5921
5928
  member.set(obj, value);
5922
5929
  return value;
5923
5930
  };
5924
5931
  var _attribute, _field$c;
5925
5932
  class ApiaAttribute {
5926
5933
  constructor(attribute) {
5927
- __privateAdd$f(this, _attribute, void 0);
5928
- __privateSet$f(this, _attribute, attribute);
5934
+ __privateAdd$g(this, _attribute, void 0);
5935
+ __privateSet$g(this, _attribute, attribute);
5929
5936
  }
5930
5937
  get attLabel() {
5931
- return __privateGet$f(this, _attribute).title;
5938
+ return __privateGet$g(this, _attribute).title;
5932
5939
  }
5933
5940
  get name() {
5934
- return __privateGet$f(this, _attribute).name;
5941
+ return __privateGet$g(this, _attribute).name;
5935
5942
  }
5936
5943
  get id() {
5937
- return __privateGet$f(this, _attribute).id;
5944
+ return __privateGet$g(this, _attribute).id;
5938
5945
  }
5939
5946
  get valueType() {
5940
- return __privateGet$f(this, _attribute).valueType;
5947
+ return __privateGet$g(this, _attribute).valueType;
5941
5948
  }
5942
5949
  }
5943
5950
  _attribute = new WeakMap();
5944
5951
  class ApiaFieldWithAttribute extends ApiaField {
5945
5952
  constructor(execution, field) {
5946
5953
  super(execution, field);
5947
- __privateAdd$f(this, _field$c, void 0);
5948
- __privateSet$f(this, _field$c, field);
5954
+ __privateAdd$g(this, _field$c, void 0);
5955
+ __privateSet$g(this, _field$c, field);
5949
5956
  }
5950
5957
  get attribute() {
5951
- return new ApiaAttribute(__privateGet$f(this, _field$c).attribute);
5958
+ return new ApiaAttribute(__privateGet$g(this, _field$c).attribute);
5952
5959
  }
5953
5960
  clearValue() {
5954
- __privateGet$f(this, _field$c).setValue("");
5961
+ __privateGet$g(this, _field$c).setValue("");
5955
5962
  }
5956
5963
  getValue() {
5957
- return __privateGet$f(this, _field$c).getValue();
5964
+ return __privateGet$g(this, _field$c).getValue();
5958
5965
  }
5959
5966
  setValue(v) {
5960
- __privateGet$f(this, _field$c).setValue(v);
5967
+ __privateGet$g(this, _field$c).setValue(v);
5961
5968
  }
5962
5969
  getLabel() {
5963
- return __privateGet$f(this, _field$c).attribute.title;
5970
+ return __privateGet$g(this, _field$c).attribute.title;
5964
5971
  }
5965
5972
  getProperty(name) {
5966
5973
  return super.getProperty(name);
@@ -5971,21 +5978,21 @@ _field$c = new WeakMap();
5971
5978
  class EditorField extends ApiaFieldWithAttribute {
5972
5979
  }
5973
5980
 
5974
- var __accessCheck$e = (obj, member, msg) => {
5981
+ var __accessCheck$f = (obj, member, msg) => {
5975
5982
  if (!member.has(obj))
5976
5983
  throw TypeError("Cannot " + msg);
5977
5984
  };
5978
- var __privateGet$e = (obj, member, getter) => {
5979
- __accessCheck$e(obj, member, "read from private field");
5985
+ var __privateGet$f = (obj, member, getter) => {
5986
+ __accessCheck$f(obj, member, "read from private field");
5980
5987
  return member.get(obj);
5981
5988
  };
5982
- var __privateAdd$e = (obj, member, value) => {
5989
+ var __privateAdd$f = (obj, member, value) => {
5983
5990
  if (member.has(obj))
5984
5991
  throw TypeError("Cannot add the same private member more than once");
5985
5992
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5986
5993
  };
5987
- var __privateSet$e = (obj, member, value, setter) => {
5988
- __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");
5989
5996
  member.set(obj, value);
5990
5997
  return value;
5991
5998
  };
@@ -5993,13 +6000,13 @@ var _field$b;
5993
6000
  class SelectField extends ApiaFieldWithAttribute {
5994
6001
  constructor(execution, field) {
5995
6002
  super(execution, field);
5996
- __privateAdd$e(this, _field$b, void 0);
5997
- __privateSet$e(this, _field$b, field);
6003
+ __privateAdd$f(this, _field$b, void 0);
6004
+ __privateSet$f(this, _field$b, field);
5998
6005
  }
5999
6006
  // get all select options either as array[] or object
6000
6007
  getOptions(asObject) {
6001
- if (__privateGet$e(this, _field$b).definition.id) {
6002
- 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);
6003
6010
  const obj = /* @__PURE__ */ new Map();
6004
6011
  if (asObject) {
6005
6012
  options.forEach((c) => obj.set(String(c.value), c));
@@ -6012,8 +6019,8 @@ class SelectField extends ApiaFieldWithAttribute {
6012
6019
  // adds a option to the select field
6013
6020
  addOption(optionValue, showValue, allowRepeatedValue) {
6014
6021
  let isValueRepeated = false;
6015
- if (__privateGet$e(this, _field$b).definition.id !== null) {
6016
- 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(
6017
6024
  (c) => c.value === optionValue
6018
6025
  ) && allowRepeatedValue) {
6019
6026
  isValueRepeated = true;
@@ -6021,7 +6028,7 @@ class SelectField extends ApiaFieldWithAttribute {
6021
6028
  isValueRepeated = false;
6022
6029
  }
6023
6030
  if (allowRepeatedValue || !isValueRepeated && !allowRepeatedValue)
6024
- arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue).push({
6031
+ arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue).push({
6025
6032
  value: optionValue,
6026
6033
  label: showValue
6027
6034
  });
@@ -6029,21 +6036,21 @@ class SelectField extends ApiaFieldWithAttribute {
6029
6036
  }
6030
6037
  // overwrite all options in select field
6031
6038
  setOptions(optionsArray) {
6032
- if (__privateGet$e(this, _field$b).definition.id) {
6033
- __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);
6034
6041
  }
6035
6042
  }
6036
6043
  removeOption(optionValue) {
6037
- if (__privateGet$e(this, _field$b).definition.id) {
6038
- 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(
6039
6046
  (c) => c.value !== optionValue
6040
6047
  );
6041
6048
  }
6042
6049
  }
6043
6050
  // get selected option either as array or object key/value
6044
6051
  getSelectedOption(asObject) {
6045
- const arr = arrayOrArray(__privateGet$e(this, _field$b).properties.possibleValue);
6046
- 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) {
6047
6054
  if (asObject) {
6048
6055
  let obj = null;
6049
6056
  arr.forEach((c) => {
@@ -6059,8 +6066,8 @@ class SelectField extends ApiaFieldWithAttribute {
6059
6066
  return null;
6060
6067
  }
6061
6068
  getSelectedText() {
6062
- if (__privateGet$e(this, _field$b).definition.id) {
6063
- 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(
6064
6071
  (c) => c.selected
6065
6072
  )?.label ?? "Not option selected";
6066
6073
  }
@@ -6068,8 +6075,8 @@ class SelectField extends ApiaFieldWithAttribute {
6068
6075
  }
6069
6076
  // // remove all select options
6070
6077
  clearOptions() {
6071
- if (__privateGet$e(this, _field$b).definition.id) {
6072
- 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(
6073
6080
  (c) => c.selected = false
6074
6081
  );
6075
6082
  }
@@ -6077,21 +6084,21 @@ class SelectField extends ApiaFieldWithAttribute {
6077
6084
  }
6078
6085
  _field$b = new WeakMap();
6079
6086
 
6080
- var __accessCheck$d = (obj, member, msg) => {
6087
+ var __accessCheck$e = (obj, member, msg) => {
6081
6088
  if (!member.has(obj))
6082
6089
  throw TypeError("Cannot " + msg);
6083
6090
  };
6084
- var __privateGet$d = (obj, member, getter) => {
6085
- __accessCheck$d(obj, member, "read from private field");
6091
+ var __privateGet$e = (obj, member, getter) => {
6092
+ __accessCheck$e(obj, member, "read from private field");
6086
6093
  return getter ? getter.call(obj) : member.get(obj);
6087
6094
  };
6088
- var __privateAdd$d = (obj, member, value) => {
6095
+ var __privateAdd$e = (obj, member, value) => {
6089
6096
  if (member.has(obj))
6090
6097
  throw TypeError("Cannot add the same private member more than once");
6091
6098
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6092
6099
  };
6093
- var __privateSet$d = (obj, member, value, setter) => {
6094
- __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");
6095
6102
  member.set(obj, value);
6096
6103
  return value;
6097
6104
  };
@@ -6099,37 +6106,37 @@ var _field$a;
6099
6106
  class InputField extends ApiaFieldWithAttribute {
6100
6107
  constructor(execution, field) {
6101
6108
  super(execution, field);
6102
- __privateAdd$d(this, _field$a, void 0);
6103
- __privateSet$d(this, _field$a, field);
6109
+ __privateAdd$e(this, _field$a, void 0);
6110
+ __privateSet$e(this, _field$a, field);
6104
6111
  }
6105
6112
  getObjectValue() {
6106
- return __privateGet$d(this, _field$a).getValue();
6113
+ return __privateGet$e(this, _field$a).getValue();
6107
6114
  }
6108
6115
  setValue(v) {
6109
- if (__privateGet$d(this, _field$a).attribute.valueType === "D") {
6110
- __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" });
6111
6118
  } else {
6112
- __privateGet$d(this, _field$a).setValue(v);
6119
+ __privateGet$e(this, _field$a).setValue(v);
6113
6120
  }
6114
6121
  }
6115
6122
  }
6116
6123
  _field$a = new WeakMap();
6117
6124
 
6118
- var __accessCheck$c = (obj, member, msg) => {
6125
+ var __accessCheck$d = (obj, member, msg) => {
6119
6126
  if (!member.has(obj))
6120
6127
  throw TypeError("Cannot " + msg);
6121
6128
  };
6122
- var __privateGet$c = (obj, member, getter) => {
6123
- __accessCheck$c(obj, member, "read from private field");
6129
+ var __privateGet$d = (obj, member, getter) => {
6130
+ __accessCheck$d(obj, member, "read from private field");
6124
6131
  return getter ? getter.call(obj) : member.get(obj);
6125
6132
  };
6126
- var __privateAdd$c = (obj, member, value) => {
6133
+ var __privateAdd$d = (obj, member, value) => {
6127
6134
  if (member.has(obj))
6128
6135
  throw TypeError("Cannot add the same private member more than once");
6129
6136
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6130
6137
  };
6131
- var __privateSet$c = (obj, member, value, setter) => {
6132
- __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");
6133
6140
  member.set(obj, value);
6134
6141
  return value;
6135
6142
  };
@@ -6137,11 +6144,11 @@ var _field$9;
6137
6144
  class TreeField extends ApiaFieldWithAttribute {
6138
6145
  constructor(execution, field) {
6139
6146
  super(execution, field);
6140
- __privateAdd$c(this, _field$9, void 0);
6141
- __privateSet$c(this, _field$9, field);
6147
+ __privateAdd$d(this, _field$9, void 0);
6148
+ __privateSet$d(this, _field$9, field);
6142
6149
  }
6143
6150
  setValue(v) {
6144
- __privateGet$c(this, _field$9).setValue(arrayOrArray(v));
6151
+ __privateGet$d(this, _field$9).setValue(arrayOrArray(v));
6145
6152
  }
6146
6153
  }
6147
6154
  _field$9 = new WeakMap();
@@ -6164,21 +6171,21 @@ class CheckField extends ApiaFieldWithAttribute {
6164
6171
  }
6165
6172
  }
6166
6173
 
6167
- var __accessCheck$b = (obj, member, msg) => {
6174
+ var __accessCheck$c = (obj, member, msg) => {
6168
6175
  if (!member.has(obj))
6169
6176
  throw TypeError("Cannot " + msg);
6170
6177
  };
6171
- var __privateGet$b = (obj, member, getter) => {
6172
- __accessCheck$b(obj, member, "read from private field");
6178
+ var __privateGet$c = (obj, member, getter) => {
6179
+ __accessCheck$c(obj, member, "read from private field");
6173
6180
  return member.get(obj);
6174
6181
  };
6175
- var __privateAdd$b = (obj, member, value) => {
6182
+ var __privateAdd$c = (obj, member, value) => {
6176
6183
  if (member.has(obj))
6177
6184
  throw TypeError("Cannot add the same private member more than once");
6178
6185
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6179
6186
  };
6180
- var __privateSet$b = (obj, member, value, setter) => {
6181
- __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");
6182
6189
  member.set(obj, value);
6183
6190
  return value;
6184
6191
  };
@@ -6186,12 +6193,12 @@ var _field$8;
6186
6193
  class RadioField extends ApiaFieldWithAttribute {
6187
6194
  constructor(execution, field) {
6188
6195
  super(execution, field);
6189
- __privateAdd$b(this, _field$8, void 0);
6190
- __privateSet$b(this, _field$8, field);
6196
+ __privateAdd$c(this, _field$8, void 0);
6197
+ __privateSet$c(this, _field$8, field);
6191
6198
  }
6192
6199
  getOptions(asObject) {
6193
- if (__privateGet$b(this, _field$8).definition.id) {
6194
- 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);
6195
6202
  if (asObject) {
6196
6203
  const options = /* @__PURE__ */ new Map();
6197
6204
  radioValues.forEach((c) => options.set(String(c.value), c));
@@ -6202,13 +6209,13 @@ class RadioField extends ApiaFieldWithAttribute {
6202
6209
  return null;
6203
6210
  }
6204
6211
  clearOptions() {
6205
- if (__privateGet$b(this, _field$8).definition.id) {
6206
- __privateGet$b(this, _field$8).properties.possibleValue = [];
6212
+ if (__privateGet$c(this, _field$8).definition.id) {
6213
+ __privateGet$c(this, _field$8).properties.possibleValue = [];
6207
6214
  }
6208
6215
  }
6209
6216
  addOption(radioValue, showValue, allowRepeatedValue) {
6210
- if (__privateGet$b(this, _field$8).definition.id) {
6211
- 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);
6212
6219
  const isValueIsRepeated = radioValues.some((c) => {
6213
6220
  return c.value === radioValue.toString();
6214
6221
  });
@@ -6221,19 +6228,19 @@ class RadioField extends ApiaFieldWithAttribute {
6221
6228
  }
6222
6229
  }
6223
6230
  setOptions(options) {
6224
- if (__privateGet$b(this, _field$8).definition.id) {
6225
- __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;
6226
6233
  }
6227
6234
  }
6228
6235
  removeOption(radioValue) {
6229
- if (__privateGet$b(this, _field$8).definition.id) {
6230
- 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(
6231
6238
  (c) => c.value !== radioValue
6232
6239
  );
6233
6240
  }
6234
6241
  }
6235
6242
  getSelectedOption(asObject) {
6236
- const radioValues = arrayOrArray(__privateGet$b(this, _field$8).properties.possibleValue);
6243
+ const radioValues = arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue);
6237
6244
  const selected = radioValues.find((c) => c.selected);
6238
6245
  if (!selected)
6239
6246
  return null;
@@ -6246,8 +6253,8 @@ class RadioField extends ApiaFieldWithAttribute {
6246
6253
  }
6247
6254
  }
6248
6255
  getSelectedText() {
6249
- if (__privateGet$b(this, _field$8).definition.id) {
6250
- 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);
6251
6258
  if (possibleValue) {
6252
6259
  return possibleValue.find((c) => c.selected)?.label;
6253
6260
  }
@@ -6257,21 +6264,21 @@ class RadioField extends ApiaFieldWithAttribute {
6257
6264
  }
6258
6265
  _field$8 = new WeakMap();
6259
6266
 
6260
- var __accessCheck$a = (obj, member, msg) => {
6267
+ var __accessCheck$b = (obj, member, msg) => {
6261
6268
  if (!member.has(obj))
6262
6269
  throw TypeError("Cannot " + msg);
6263
6270
  };
6264
- var __privateGet$a = (obj, member, getter) => {
6265
- __accessCheck$a(obj, member, "read from private field");
6271
+ var __privateGet$b = (obj, member, getter) => {
6272
+ __accessCheck$b(obj, member, "read from private field");
6266
6273
  return member.get(obj);
6267
6274
  };
6268
- var __privateAdd$a = (obj, member, value) => {
6275
+ var __privateAdd$b = (obj, member, value) => {
6269
6276
  if (member.has(obj))
6270
6277
  throw TypeError("Cannot add the same private member more than once");
6271
6278
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6272
6279
  };
6273
- var __privateSet$a = (obj, member, value, setter) => {
6274
- __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");
6275
6282
  member.set(obj, value);
6276
6283
  return value;
6277
6284
  };
@@ -6279,13 +6286,13 @@ var _field$7;
6279
6286
  class MultipleField extends ApiaFieldWithAttribute {
6280
6287
  constructor(execution, field) {
6281
6288
  super(execution, field);
6282
- __privateAdd$a(this, _field$7, void 0);
6283
- __privateSet$a(this, _field$7, field);
6289
+ __privateAdd$b(this, _field$7, void 0);
6290
+ __privateSet$b(this, _field$7, field);
6284
6291
  }
6285
6292
  addOption(optionValue, showValue, allowRepeatedValue) {
6286
6293
  let isValueRepeated = false;
6287
- if (__privateGet$a(this, _field$7).definition.id !== null) {
6288
- 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(
6289
6296
  (c) => c.value === optionValue
6290
6297
  ) && allowRepeatedValue) {
6291
6298
  isValueRepeated = true;
@@ -6293,28 +6300,28 @@ class MultipleField extends ApiaFieldWithAttribute {
6293
6300
  isValueRepeated = false;
6294
6301
  }
6295
6302
  if (allowRepeatedValue || !isValueRepeated && !allowRepeatedValue)
6296
- arrayOrArray(__privateGet$a(this, _field$7).properties.possibleValue).push({
6303
+ arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue).push({
6297
6304
  value: optionValue,
6298
6305
  label: showValue
6299
6306
  });
6300
6307
  }
6301
6308
  }
6302
6309
  setValue(value) {
6303
- if (__privateGet$a(this, _field$7).definition.id) {
6304
- __privateGet$a(this, _field$7).setValue(value);
6310
+ if (__privateGet$b(this, _field$7).definition.id) {
6311
+ __privateGet$b(this, _field$7).setValue(value);
6305
6312
  }
6306
6313
  }
6307
6314
  clearOptions() {
6308
- if (__privateGet$a(this, _field$7).definition.id) {
6309
- 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(
6310
6317
  (c) => c.selected = false
6311
6318
  );
6312
6319
  }
6313
6320
  }
6314
6321
  getSelectedOption(asObject) {
6315
- if (__privateGet$a(this, _field$7).definition.id) {
6322
+ if (__privateGet$b(this, _field$7).definition.id) {
6316
6323
  const selected = arrayOrArray(
6317
- __privateGet$a(this, _field$7).properties.possibleValue
6324
+ __privateGet$b(this, _field$7).properties.possibleValue
6318
6325
  ).filter((c) => c.selected);
6319
6326
  if (selected) {
6320
6327
  if (asObject) {
@@ -6328,8 +6335,8 @@ class MultipleField extends ApiaFieldWithAttribute {
6328
6335
  return null;
6329
6336
  }
6330
6337
  getOptions(asObject) {
6331
- if (__privateGet$a(this, _field$7).definition.id) {
6332
- 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);
6333
6340
  const obj = /* @__PURE__ */ new Map();
6334
6341
  if (asObject) {
6335
6342
  options.forEach((c) => obj.set(String(c.value), c));
@@ -6340,13 +6347,13 @@ class MultipleField extends ApiaFieldWithAttribute {
6340
6347
  return null;
6341
6348
  }
6342
6349
  setOptions(optionsArray) {
6343
- if (__privateGet$a(this, _field$7).definition.id) {
6344
- __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);
6345
6352
  }
6346
6353
  }
6347
6354
  removeOption(optionValue) {
6348
- if (__privateGet$a(this, _field$7).definition.id) {
6349
- 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(
6350
6357
  (c) => c.value !== optionValue
6351
6358
  );
6352
6359
  }
@@ -6360,21 +6367,21 @@ class HiddenField extends ApiaField {
6360
6367
  class AreaField extends ApiaFieldWithAttribute {
6361
6368
  }
6362
6369
 
6363
- var __accessCheck$9 = (obj, member, msg) => {
6370
+ var __accessCheck$a = (obj, member, msg) => {
6364
6371
  if (!member.has(obj))
6365
6372
  throw TypeError("Cannot " + msg);
6366
6373
  };
6367
- var __privateGet$9 = (obj, member, getter) => {
6368
- __accessCheck$9(obj, member, "read from private field");
6374
+ var __privateGet$a = (obj, member, getter) => {
6375
+ __accessCheck$a(obj, member, "read from private field");
6369
6376
  return member.get(obj);
6370
6377
  };
6371
- var __privateAdd$9 = (obj, member, value) => {
6378
+ var __privateAdd$a = (obj, member, value) => {
6372
6379
  if (member.has(obj))
6373
6380
  throw TypeError("Cannot add the same private member more than once");
6374
6381
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6375
6382
  };
6376
- var __privateSet$9 = (obj, member, value, setter) => {
6377
- __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");
6378
6385
  member.set(obj, value);
6379
6386
  return value;
6380
6387
  };
@@ -6382,34 +6389,34 @@ var _field$6;
6382
6389
  class ImageField extends ApiaField {
6383
6390
  constructor(execution, field) {
6384
6391
  super(execution, field);
6385
- __privateAdd$9(this, _field$6, void 0);
6386
- __privateSet$9(this, _field$6, field);
6392
+ __privateAdd$a(this, _field$6, void 0);
6393
+ __privateSet$a(this, _field$6, field);
6387
6394
  }
6388
6395
  clearValue() {
6389
- if (__privateGet$9(this, _field$6).definition.id) {
6396
+ if (__privateGet$a(this, _field$6).definition.id) {
6390
6397
  throw new Error(
6391
- `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`
6392
6399
  );
6393
6400
  }
6394
6401
  return null;
6395
6402
  }
6396
6403
  getLabel() {
6397
6404
  throw new Error(
6398
- `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`
6399
6406
  );
6400
6407
  }
6401
6408
  getValue() {
6402
- if (__privateGet$9(this, _field$6).definition.id) {
6409
+ if (__privateGet$a(this, _field$6).definition.id) {
6403
6410
  throw new Error(
6404
- `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`
6405
6412
  );
6406
6413
  }
6407
6414
  return null;
6408
6415
  }
6409
6416
  setValue() {
6410
- if (__privateGet$9(this, _field$6).definition.id) {
6417
+ if (__privateGet$a(this, _field$6).definition.id) {
6411
6418
  throw new Error(
6412
- `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`
6413
6420
  );
6414
6421
  }
6415
6422
  return null;
@@ -6417,21 +6424,21 @@ class ImageField extends ApiaField {
6417
6424
  }
6418
6425
  _field$6 = new WeakMap();
6419
6426
 
6420
- var __accessCheck$8 = (obj, member, msg) => {
6427
+ var __accessCheck$9 = (obj, member, msg) => {
6421
6428
  if (!member.has(obj))
6422
6429
  throw TypeError("Cannot " + msg);
6423
6430
  };
6424
- var __privateGet$8 = (obj, member, getter) => {
6425
- __accessCheck$8(obj, member, "read from private field");
6431
+ var __privateGet$9 = (obj, member, getter) => {
6432
+ __accessCheck$9(obj, member, "read from private field");
6426
6433
  return member.get(obj);
6427
6434
  };
6428
- var __privateAdd$8 = (obj, member, value) => {
6435
+ var __privateAdd$9 = (obj, member, value) => {
6429
6436
  if (member.has(obj))
6430
6437
  throw TypeError("Cannot add the same private member more than once");
6431
6438
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6432
6439
  };
6433
- var __privateSet$8 = (obj, member, value, setter) => {
6434
- __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");
6435
6442
  member.set(obj, value);
6436
6443
  return value;
6437
6444
  };
@@ -6439,34 +6446,34 @@ var _field$5;
6439
6446
  class LinkField extends ApiaField {
6440
6447
  constructor(execution, field) {
6441
6448
  super(execution, field);
6442
- __privateAdd$8(this, _field$5, void 0);
6443
- __privateSet$8(this, _field$5, field);
6449
+ __privateAdd$9(this, _field$5, void 0);
6450
+ __privateSet$9(this, _field$5, field);
6444
6451
  }
6445
6452
  getLabel() {
6446
- if (__privateGet$8(this, _field$5).definition.fieldType) {
6453
+ if (__privateGet$9(this, _field$5).definition.fieldType) {
6447
6454
  throw new Error(
6448
- `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`
6449
6456
  );
6450
6457
  }
6451
6458
  }
6452
6459
  }
6453
6460
  _field$5 = new WeakMap();
6454
6461
 
6455
- var __accessCheck$7 = (obj, member, msg) => {
6462
+ var __accessCheck$8 = (obj, member, msg) => {
6456
6463
  if (!member.has(obj))
6457
6464
  throw TypeError("Cannot " + msg);
6458
6465
  };
6459
- var __privateGet$7 = (obj, member, getter) => {
6460
- __accessCheck$7(obj, member, "read from private field");
6466
+ var __privateGet$8 = (obj, member, getter) => {
6467
+ __accessCheck$8(obj, member, "read from private field");
6461
6468
  return getter ? getter.call(obj) : member.get(obj);
6462
6469
  };
6463
- var __privateAdd$7 = (obj, member, value) => {
6470
+ var __privateAdd$8 = (obj, member, value) => {
6464
6471
  if (member.has(obj))
6465
6472
  throw TypeError("Cannot add the same private member more than once");
6466
6473
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6467
6474
  };
6468
- var __privateSet$7 = (obj, member, value, setter) => {
6469
- __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");
6470
6477
  member.set(obj, value);
6471
6478
  return value;
6472
6479
  };
@@ -6474,12 +6481,12 @@ var _field$4;
6474
6481
  class TextField extends ApiaField {
6475
6482
  constructor(execution, field) {
6476
6483
  super(execution, field);
6477
- __privateAdd$7(this, _field$4, void 0);
6478
- __privateSet$7(this, _field$4, field);
6484
+ __privateAdd$8(this, _field$4, void 0);
6485
+ __privateSet$8(this, _field$4, field);
6479
6486
  }
6480
6487
  getLabel() {
6481
6488
  throw new Error(
6482
- `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`
6483
6490
  );
6484
6491
  }
6485
6492
  setValue(value) {
@@ -6488,35 +6495,35 @@ class TextField extends ApiaField {
6488
6495
  }
6489
6496
  _field$4 = new WeakMap();
6490
6497
 
6491
- var __accessCheck$6 = (obj, member, msg) => {
6498
+ var __accessCheck$7 = (obj, member, msg) => {
6492
6499
  if (!member.has(obj))
6493
6500
  throw TypeError("Cannot " + msg);
6494
6501
  };
6495
- var __privateGet$6 = (obj, member, getter) => {
6496
- __accessCheck$6(obj, member, "read from private field");
6502
+ var __privateGet$7 = (obj, member, getter) => {
6503
+ __accessCheck$7(obj, member, "read from private field");
6497
6504
  return getter ? getter.call(obj) : member.get(obj);
6498
6505
  };
6499
- var __privateAdd$6 = (obj, member, value) => {
6506
+ var __privateAdd$7 = (obj, member, value) => {
6500
6507
  if (member.has(obj))
6501
6508
  throw TypeError("Cannot add the same private member more than once");
6502
6509
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6503
6510
  };
6504
- var __privateSet$6 = (obj, member, value, setter) => {
6505
- __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");
6506
6513
  member.set(obj, value);
6507
6514
  return value;
6508
6515
  };
6509
6516
  var _field$3;
6510
6517
  class CustomComponentField {
6511
6518
  constructor(field) {
6512
- __privateAdd$6(this, _field$3, void 0);
6513
- __privateSet$6(this, _field$3, field);
6519
+ __privateAdd$7(this, _field$3, void 0);
6520
+ __privateSet$7(this, _field$3, field);
6514
6521
  }
6515
6522
  fireEvent(name) {
6516
- __privateGet$6(this, _field$3).fireEvent(name);
6523
+ __privateGet$7(this, _field$3).fireEvent(name);
6517
6524
  }
6518
6525
  getProperty(name) {
6519
- return __privateGet$6(this, _field$3).getProperty(name);
6526
+ return __privateGet$7(this, _field$3).getProperty(name);
6520
6527
  }
6521
6528
  setFocus() {
6522
6529
  throw new Error("Method not implemented.");
@@ -6525,19 +6532,19 @@ class CustomComponentField {
6525
6532
  return false;
6526
6533
  }
6527
6534
  getStringValue(attName) {
6528
- return __privateGet$6(this, _field$3).getStringValue(attName);
6535
+ return __privateGet$7(this, _field$3).getStringValue(attName);
6529
6536
  }
6530
6537
  getValue(attName, index = 0) {
6531
- return __privateGet$6(this, _field$3).getValue(attName, index);
6538
+ return __privateGet$7(this, _field$3).getValue(attName, index);
6532
6539
  }
6533
6540
  setProperty(name, value) {
6534
- __privateGet$6(this, _field$3).setProperty(name, value);
6541
+ __privateGet$7(this, _field$3).setProperty(name, value);
6535
6542
  }
6536
6543
  setStringValue(attName, value) {
6537
- return __privateGet$6(this, _field$3).setStringValue(attName, value);
6544
+ return __privateGet$7(this, _field$3).setStringValue(attName, value);
6538
6545
  }
6539
6546
  setValue(attName, value, index = 0) {
6540
- return __privateGet$6(this, _field$3).setValue(attName, value, index);
6547
+ return __privateGet$7(this, _field$3).setValue(attName, value, index);
6541
6548
  }
6542
6549
  }
6543
6550
  _field$3 = new WeakMap();
@@ -6616,44 +6623,44 @@ var createApiaField = /*#__PURE__*/Object.freeze({
6616
6623
  createNewField: createNewField
6617
6624
  });
6618
6625
 
6619
- var __accessCheck$5 = (obj, member, msg) => {
6626
+ var __accessCheck$6 = (obj, member, msg) => {
6620
6627
  if (!member.has(obj))
6621
6628
  throw TypeError("Cannot " + msg);
6622
6629
  };
6623
- var __privateGet$5 = (obj, member, getter) => {
6624
- __accessCheck$5(obj, member, "read from private field");
6630
+ var __privateGet$6 = (obj, member, getter) => {
6631
+ __accessCheck$6(obj, member, "read from private field");
6625
6632
  return getter ? getter.call(obj) : member.get(obj);
6626
6633
  };
6627
- var __privateAdd$5 = (obj, member, value) => {
6634
+ var __privateAdd$6 = (obj, member, value) => {
6628
6635
  if (member.has(obj))
6629
6636
  throw TypeError("Cannot add the same private member more than once");
6630
6637
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6631
6638
  };
6632
- var __privateSet$5 = (obj, member, value, setter) => {
6633
- __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");
6634
6641
  member.set(obj, value);
6635
6642
  return value;
6636
6643
  };
6637
- var _execution$1, _field$2, _mutex;
6644
+ var _execution$2, _field$2, _mutex;
6638
6645
  class GridField extends ApiaField {
6639
6646
  constructor(execution, field) {
6640
6647
  super(execution, field);
6641
- __privateAdd$5(this, _execution$1, void 0);
6642
- __privateAdd$5(this, _field$2, void 0);
6643
- __privateAdd$5(this, _mutex, new Mutex());
6644
- __privateSet$5(this, _execution$1, execution);
6645
- __privateSet$5(this, _field$2, field);
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);
6646
6653
  }
6647
6654
  async addRow() {
6648
6655
  try {
6649
- await __privateGet$5(this, _mutex).acquire();
6650
- 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();
6651
6658
  if (result) {
6652
- return this.getRow(__privateGet$5(this, _field$2).finalIndex);
6659
+ return this.getRow(__privateGet$6(this, _field$2).finalIndex);
6653
6660
  }
6654
6661
  return [];
6655
6662
  } finally {
6656
- __privateGet$5(this, _mutex).release();
6663
+ __privateGet$6(this, _mutex).release();
6657
6664
  }
6658
6665
  }
6659
6666
  clearGrid() {
@@ -6664,8 +6671,8 @@ class GridField extends ApiaField {
6664
6671
  }
6665
6672
  async clearRow(index) {
6666
6673
  try {
6667
- await __privateGet$5(this, _mutex).acquire();
6668
- 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);
6669
6676
  if (!row) {
6670
6677
  throw new Error(`Row ${index} not found`);
6671
6678
  }
@@ -6674,19 +6681,19 @@ class GridField extends ApiaField {
6674
6681
  c.state.value = "";
6675
6682
  });
6676
6683
  } finally {
6677
- __privateGet$5(this, _mutex).release();
6684
+ __privateGet$6(this, _mutex).release();
6678
6685
  }
6679
6686
  }
6680
6687
  closeForm() {
6681
- __privateGet$5(this, _field$2).closeEditionModal();
6688
+ __privateGet$6(this, _field$2).closeEditionModal();
6682
6689
  return this;
6683
6690
  }
6684
6691
  async deleteAllRows() {
6685
6692
  try {
6686
- await __privateGet$5(this, _mutex).acquire();
6687
- await __privateGet$5(this, _field$2).deleteAllRows();
6693
+ await __privateGet$6(this, _mutex).acquire();
6694
+ await __privateGet$6(this, _field$2).deleteAllRows();
6688
6695
  } finally {
6689
- __privateGet$5(this, _mutex).release();
6696
+ __privateGet$6(this, _mutex).release();
6690
6697
  }
6691
6698
  }
6692
6699
  async deleteGrid() {
@@ -6697,62 +6704,62 @@ class GridField extends ApiaField {
6697
6704
  }
6698
6705
  async deleteRow(index) {
6699
6706
  try {
6700
- await __privateGet$5(this, _mutex).acquire();
6701
- __privateGet$5(this, _field$2).deleteRows(index);
6707
+ await __privateGet$6(this, _mutex).acquire();
6708
+ __privateGet$6(this, _field$2).deleteRows(index);
6702
6709
  } finally {
6703
- __privateGet$5(this, _mutex).release();
6710
+ __privateGet$6(this, _mutex).release();
6704
6711
  }
6705
6712
  }
6706
6713
  editRow(index) {
6707
- getWindow(__privateGet$5(this, _execution$1)).dispatchEvent(
6714
+ getWindow(__privateGet$6(this, _execution$2)).dispatchEvent(
6708
6715
  new CustomEvent("openGridEdition", {
6709
- detail: { index, grid: __privateGet$5(this, _field$2) }
6716
+ detail: { index, grid: __privateGet$6(this, _field$2) }
6710
6717
  })
6711
6718
  );
6712
6719
  }
6713
6720
  getAllColumns() {
6714
- return __privateGet$5(this, _field$2).getAllColumns().map(
6715
- (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))
6716
6723
  );
6717
6724
  }
6718
6725
  getColumn(fieldName) {
6719
- const fields = __privateGet$5(this, _field$2).getColumn(fieldName);
6726
+ const fields = __privateGet$6(this, _field$2).getColumn(fieldName);
6720
6727
  if (fields) {
6721
6728
  return arrayOrArray(fields).map(
6722
- (c) => createNewField(__privateGet$5(this, _field$2).getForm().execution, c)
6729
+ (c) => createNewField(__privateGet$6(this, _field$2).getForm().execution, c)
6723
6730
  );
6724
6731
  }
6725
6732
  return [];
6726
6733
  }
6727
6734
  getCurrentPage() {
6728
- return __privateGet$5(this, _field$2).getCurrentPage();
6735
+ return __privateGet$6(this, _field$2).getCurrentPage();
6729
6736
  }
6730
6737
  getField(fieldName, fieldIndex) {
6731
- const fields = __privateGet$5(this, _field$2).getField(fieldName, fieldIndex);
6738
+ const fields = __privateGet$6(this, _field$2).getField(fieldName, fieldIndex);
6732
6739
  if (fields) {
6733
6740
  return fieldIndex !== void 0 ? createNewField(
6734
- __privateGet$5(this, _field$2).getForm().execution,
6741
+ __privateGet$6(this, _field$2).getForm().execution,
6735
6742
  arrayOrArray(fields)[0]
6736
- ) : 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));
6737
6744
  }
6738
6745
  return null;
6739
6746
  }
6740
6747
  getPageCount() {
6741
- return __privateGet$5(this, _field$2).pageCount;
6748
+ return __privateGet$6(this, _field$2).pageCount;
6742
6749
  }
6743
6750
  getPageSize() {
6744
- return __privateGet$5(this, _field$2).pageSize;
6751
+ return __privateGet$6(this, _field$2).pageSize;
6745
6752
  }
6746
6753
  getRow(index) {
6747
- 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));
6748
6755
  }
6749
6756
  getSelection() {
6750
- const selected = __privateGet$5(this, _field$2).getSelectedRows();
6757
+ const selected = __privateGet$6(this, _field$2).getSelectedRows();
6751
6758
  const returnObj = [];
6752
6759
  selected.forEach((r) => {
6753
6760
  const row = [];
6754
6761
  r.forEach((c) => {
6755
- const fld = createNewField(__privateGet$5(this, _field$2).getForm().execution, c);
6762
+ const fld = createNewField(__privateGet$6(this, _field$2).getForm().execution, c);
6756
6763
  if (fld) {
6757
6764
  row.push(fld);
6758
6765
  }
@@ -6762,46 +6769,46 @@ class GridField extends ApiaField {
6762
6769
  return returnObj;
6763
6770
  }
6764
6771
  get id() {
6765
- return __privateGet$5(this, _field$2).definition.id;
6772
+ return __privateGet$6(this, _field$2).definition.id;
6766
6773
  }
6767
6774
  isPaged() {
6768
- return __privateGet$5(this, _field$2).properties.paged;
6775
+ return __privateGet$6(this, _field$2).properties.paged;
6769
6776
  }
6770
6777
  get rowsCount() {
6771
- return __privateGet$5(this, _field$2).length;
6778
+ return __privateGet$6(this, _field$2).length;
6772
6779
  }
6773
6780
  toggleColumnVisibility(fieldName, isShown) {
6774
- __privateGet$5(this, _field$2).toggleColumnVisibility(fieldName, isShown);
6781
+ __privateGet$6(this, _field$2).toggleColumnVisibility(fieldName, isShown);
6775
6782
  }
6776
6783
  toggleDeleteButton(index, isShown) {
6777
- __privateGet$5(this, _field$2).toggleDeleteButton(index, isShown);
6784
+ __privateGet$6(this, _field$2).toggleDeleteButton(index, isShown);
6778
6785
  }
6779
6786
  toggleEditFormButton(rowIndex, isShown) {
6780
- __privateGet$5(this, _field$2).toggleEditFormButton(rowIndex, isShown);
6787
+ __privateGet$6(this, _field$2).toggleEditFormButton(rowIndex, isShown);
6781
6788
  }
6782
6789
  }
6783
- _execution$1 = new WeakMap();
6790
+ _execution$2 = new WeakMap();
6784
6791
  _field$2 = new WeakMap();
6785
6792
  _mutex = new WeakMap();
6786
6793
 
6787
6794
  class CaptchaField extends ApiaField {
6788
6795
  }
6789
6796
 
6790
- var __accessCheck$4 = (obj, member, msg) => {
6797
+ var __accessCheck$5 = (obj, member, msg) => {
6791
6798
  if (!member.has(obj))
6792
6799
  throw TypeError("Cannot " + msg);
6793
6800
  };
6794
- var __privateGet$4 = (obj, member, getter) => {
6795
- __accessCheck$4(obj, member, "read from private field");
6801
+ var __privateGet$5 = (obj, member, getter) => {
6802
+ __accessCheck$5(obj, member, "read from private field");
6796
6803
  return getter ? getter.call(obj) : member.get(obj);
6797
6804
  };
6798
- var __privateAdd$4 = (obj, member, value) => {
6805
+ var __privateAdd$5 = (obj, member, value) => {
6799
6806
  if (member.has(obj))
6800
6807
  throw TypeError("Cannot add the same private member more than once");
6801
6808
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6802
6809
  };
6803
- var __privateSet$4 = (obj, member, value, setter) => {
6804
- __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");
6805
6812
  member.set(obj, value);
6806
6813
  return value;
6807
6814
  };
@@ -6809,24 +6816,24 @@ var _field$1;
6809
6816
  class FileUploaderField extends ApiaFieldWithAttribute {
6810
6817
  constructor(execution, field) {
6811
6818
  super(execution, field);
6812
- __privateAdd$4(this, _field$1, void 0);
6813
- __privateSet$4(this, _field$1, field);
6819
+ __privateAdd$5(this, _field$1, void 0);
6820
+ __privateSet$5(this, _field$1, field);
6814
6821
  }
6815
6822
  onChange(cb) {
6816
6823
  reaction(
6817
6824
  () => {
6818
- __privateGet$4(this, _field$1).getValue();
6825
+ __privateGet$5(this, _field$1).getValue();
6819
6826
  },
6820
6827
  () => {
6821
- cb(__privateGet$4(this, _field$1).getValue());
6828
+ cb(__privateGet$5(this, _field$1).getValue());
6822
6829
  },
6823
6830
  { fireImmediately: false }
6824
6831
  );
6825
6832
  }
6826
6833
  setValue() {
6827
- 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) {
6828
6835
  throw new Error(
6829
- `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`
6830
6837
  );
6831
6838
  }
6832
6839
  return null;
@@ -6837,21 +6844,21 @@ _field$1 = new WeakMap();
6837
6844
  class PasswordField extends ApiaField {
6838
6845
  }
6839
6846
 
6840
- var __accessCheck$3 = (obj, member, msg) => {
6847
+ var __accessCheck$4 = (obj, member, msg) => {
6841
6848
  if (!member.has(obj))
6842
6849
  throw TypeError("Cannot " + msg);
6843
6850
  };
6844
- var __privateGet$3 = (obj, member, getter) => {
6845
- __accessCheck$3(obj, member, "read from private field");
6851
+ var __privateGet$4 = (obj, member, getter) => {
6852
+ __accessCheck$4(obj, member, "read from private field");
6846
6853
  return getter ? getter.call(obj) : member.get(obj);
6847
6854
  };
6848
- var __privateAdd$3 = (obj, member, value) => {
6855
+ var __privateAdd$4 = (obj, member, value) => {
6849
6856
  if (member.has(obj))
6850
6857
  throw TypeError("Cannot add the same private member more than once");
6851
6858
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6852
6859
  };
6853
- var __privateSet$3 = (obj, member, value, setter) => {
6854
- __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");
6855
6862
  member.set(obj, value);
6856
6863
  return value;
6857
6864
  };
@@ -6859,96 +6866,96 @@ var _field;
6859
6866
  class ModalInputField extends ApiaFieldWithAttribute {
6860
6867
  constructor(execution, field) {
6861
6868
  super(execution, field);
6862
- __privateAdd$3(this, _field, void 0);
6863
- __privateSet$3(this, _field, field);
6869
+ __privateAdd$4(this, _field, void 0);
6870
+ __privateSet$4(this, _field, field);
6864
6871
  }
6865
6872
  getObjectValue() {
6866
- return __privateGet$3(this, _field).getValue();
6873
+ return __privateGet$4(this, _field).getValue();
6867
6874
  }
6868
6875
  setValue(v) {
6869
- __privateGet$3(this, _field).setValue(v);
6876
+ __privateGet$4(this, _field).setValue(v);
6870
6877
  }
6871
6878
  async setValueFromInputWrite(value) {
6872
- await __privateGet$3(this, _field).setValueFromInputWrite(value);
6879
+ await __privateGet$4(this, _field).setValueFromInputWrite(value);
6873
6880
  }
6874
6881
  }
6875
6882
  _field = new WeakMap();
6876
6883
 
6877
- var __accessCheck$2 = (obj, member, msg) => {
6884
+ var __accessCheck$3 = (obj, member, msg) => {
6878
6885
  if (!member.has(obj))
6879
6886
  throw TypeError("Cannot " + msg);
6880
6887
  };
6881
- var __privateGet$2 = (obj, member, getter) => {
6882
- __accessCheck$2(obj, member, "read from private field");
6888
+ var __privateGet$3 = (obj, member, getter) => {
6889
+ __accessCheck$3(obj, member, "read from private field");
6883
6890
  return getter ? getter.call(obj) : member.get(obj);
6884
6891
  };
6885
- var __privateAdd$2 = (obj, member, value) => {
6892
+ var __privateAdd$3 = (obj, member, value) => {
6886
6893
  if (member.has(obj))
6887
6894
  throw TypeError("Cannot add the same private member more than once");
6888
6895
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
6889
6896
  };
6890
- var __privateSet$2 = (obj, member, value, setter) => {
6891
- __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");
6892
6899
  member.set(obj, value);
6893
6900
  return value;
6894
6901
  };
6895
- var _form, _execution;
6902
+ var _form, _execution$1;
6896
6903
  class ApiaForm {
6897
6904
  constructor(execution, form) {
6898
- __privateAdd$2(this, _form, void 0);
6899
- __privateAdd$2(this, _execution, void 0);
6900
- __privateSet$2(this, _form, form);
6901
- __privateSet$2(this, _execution, execution);
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);
6902
6909
  }
6903
6910
  getFrmParent() {
6904
- return __privateGet$2(this, _form).definition.frmParent;
6911
+ return __privateGet$3(this, _form).definition.frmParent;
6905
6912
  }
6906
6913
  getFrmId() {
6907
- return __privateGet$2(this, _form).definition.id;
6914
+ return __privateGet$3(this, _form).definition.id;
6908
6915
  }
6909
6916
  getFormName() {
6910
- return __privateGet$2(this, _form).definition.formName;
6917
+ return __privateGet$3(this, _form).definition.formName;
6911
6918
  }
6912
6919
  getFormTitle() {
6913
- return __privateGet$2(this, _form).definition.formTitle;
6920
+ return __privateGet$3(this, _form).definition.formTitle;
6914
6921
  }
6915
6922
  openForm() {
6916
- __privateGet$2(this, _form).setProperty("prpFrmClosed", false);
6923
+ __privateGet$3(this, _form).setProperty("prpFrmClosed", false);
6917
6924
  }
6918
6925
  closeForm() {
6919
- __privateGet$2(this, _form).setProperty("prpFrmClosed", true);
6926
+ __privateGet$3(this, _form).setProperty("prpFrmClosed", true);
6920
6927
  }
6921
6928
  getProperty(name) {
6922
- return __privateGet$2(this, _form).getProperty(name);
6929
+ return __privateGet$3(this, _form).getProperty(name);
6923
6930
  }
6924
6931
  setProperty(name, value) {
6925
6932
  if (name === "readOnly") {
6926
6933
  throw new Error("Cannot update readonly property on forms");
6927
6934
  }
6928
- __privateGet$2(this, _form).setProperty(name, value);
6935
+ __privateGet$3(this, _form).setProperty(name, value);
6929
6936
  }
6930
6937
  getCustomComponent(attName) {
6931
- return __privateGet$2(this, _form).getCustomComponentByAttName(attName);
6938
+ return __privateGet$3(this, _form).getCustomComponentByAttName(attName);
6932
6939
  }
6933
6940
  getField(fld, index) {
6934
- const field = __privateGet$2(this, _form).getField(fld, index);
6941
+ const field = __privateGet$3(this, _form).getField(fld, index);
6935
6942
  if (field) {
6936
- return createNewField(__privateGet$2(this, _execution), field);
6943
+ return createNewField(__privateGet$3(this, _execution$1), field);
6937
6944
  }
6938
6945
  return void 0;
6939
6946
  }
6940
6947
  getFieldById(fldId) {
6941
- const field = __privateGet$2(this, _form).getFieldById(fldId);
6948
+ const field = __privateGet$3(this, _form).getFieldById(fldId);
6942
6949
  if (field) {
6943
- return createNewField(__privateGet$2(this, _execution), field);
6950
+ return createNewField(__privateGet$3(this, _execution$1), field);
6944
6951
  }
6945
6952
  return void 0;
6946
6953
  }
6947
6954
  getFieldColumn(name) {
6948
- return arrayOrArray(__privateGet$2(this, _form).getFieldByName(name)).map((c) => createNewField(__privateGet$2(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));
6949
6956
  }
6950
6957
  getAllFields() {
6951
- return __privateGet$2(this, _form).allFields.map((c) => createNewField(__privateGet$2(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));
6952
6959
  }
6953
6960
  clearForm(clearReadonlyFields, deleteGridsRows) {
6954
6961
  this.getAllFields().forEach((c) => {
@@ -6962,17 +6969,39 @@ class ApiaForm {
6962
6969
  }
6963
6970
  });
6964
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
+ }
6965
6978
  }
6966
6979
  _form = new WeakMap();
6967
- _execution = new WeakMap();
6980
+ _execution$1 = new WeakMap();
6968
6981
 
6969
- const OptionButton = {
6970
- BTN_VIEW_DOCS: 100,
6971
- BTN_PRINT: 101
6982
+ var __accessCheck$2 = (obj, member, msg) => {
6983
+ if (!member.has(obj))
6984
+ throw TypeError("Cannot " + msg);
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);
6972
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;
6973
7001
  class ApiaFunctions {
6974
7002
  constructor(execution) {
6975
- this.execution = execution;
7003
+ __privateAdd$2(this, _execution, void 0);
7004
+ __privateSet$2(this, _execution, execution);
6976
7005
  }
6977
7006
  toJSNumber(_value) {
6978
7007
  throw new Error("Deprecated, use ApiaUtil instead.");
@@ -6990,15 +7019,11 @@ class ApiaFunctions {
6990
7019
  throw new Error("Deprecated, use ApiaUtil instead.");
6991
7020
  }
6992
7021
  getFormByType(frmName, frmType) {
6993
- const form = this.execution.getFormByName(frmName, frmType);
7022
+ const form = __privateGet$2(this, _execution).getFormByName(frmName, frmType);
6994
7023
  if (form)
6995
- return new ApiaForm(this.execution, form);
7024
+ return new ApiaForm(__privateGet$2(this, _execution), form);
6996
7025
  return null;
6997
7026
  }
6998
- actionButton(id) {
6999
- const actualId = this.getButtonAction(id);
7000
- return ActionsController.instance.getButton(actualId);
7001
- }
7002
7027
  admEntity(entName, entNum, parameters, width, height) {
7003
7028
  }
7004
7029
  clearMessages() {
@@ -7007,56 +7032,50 @@ class ApiaFunctions {
7007
7032
  const id = Number(button);
7008
7033
  switch (id) {
7009
7034
  case ActionsController.CONFIRM:
7010
- this.execution.confirm();
7035
+ __privateGet$2(this, _execution).flow.confirm();
7011
7036
  break;
7012
7037
  case ActionsController.NEXT:
7013
- this.execution.next();
7038
+ __privateGet$2(this, _execution).flow.next();
7014
7039
  break;
7015
7040
  case ActionsController.PREVIOUS:
7016
- this.execution.doBack();
7041
+ __privateGet$2(this, _execution).flow.back();
7017
7042
  break;
7018
7043
  case ActionsController.SAVE:
7019
- this.execution.doSave();
7044
+ __privateGet$2(this, _execution).flow.save();
7020
7045
  break;
7021
7046
  case ActionsController.RELEASE:
7022
- this.execution.doFree();
7047
+ __privateGet$2(this, _execution).flow.release();
7023
7048
  break;
7024
7049
  case ActionsController.DELEGATE:
7025
- this.execution.delegate();
7050
+ __privateGet$2(this, _execution).flow.delegate();
7026
7051
  break;
7027
7052
  case ActionsController.SHARE:
7028
- this.execution.shareSocial();
7053
+ __privateGet$2(this, _execution).flow.share();
7029
7054
  break;
7030
- case OptionButton.BTN_VIEW_DOCS:
7031
- this.execution.viewDocs();
7055
+ case ActionsController.VIEW_DOCS:
7056
+ __privateGet$2(this, _execution).flow.viewDocs();
7032
7057
  break;
7033
- case OptionButton.BTN_PRINT:
7034
- 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();
7035
7063
  break;
7036
- default:
7037
- return;
7038
7064
  }
7039
7065
  }
7040
7066
  disableActionButton(id) {
7041
- const actualId = this.getButtonAction(id);
7042
- this.actionButton(actualId)?.disable();
7043
- }
7044
- disableOptionButton(id) {
7045
- this.disableActionButton(id);
7067
+ ActionsController.instance.disable(id);
7046
7068
  }
7047
7069
  enableActionButton(id) {
7048
- this.actionButton(id)?.enable();
7049
- }
7050
- enableOptionButton(id) {
7051
- this.enableActionButton(id);
7070
+ ActionsController.instance.enable(id);
7052
7071
  }
7053
7072
  getAllForms() {
7054
- 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));
7055
7074
  }
7056
7075
  getAllFormsByType(type) {
7057
- return this.execution.getAllForms().reduce((acc, c) => {
7076
+ return __privateGet$2(this, _execution).getAllForms().reduce((acc, c) => {
7058
7077
  if (c.definition.frmParent === type) {
7059
- acc.push(new ApiaForm(this.execution, c));
7078
+ acc.push(new ApiaForm(__privateGet$2(this, _execution), c));
7060
7079
  }
7061
7080
  return acc;
7062
7081
  }, []);
@@ -7068,58 +7087,17 @@ class ApiaFunctions {
7068
7087
  );
7069
7088
  return fields;
7070
7089
  }
7071
- getButtonAction(id) {
7072
- let btnId;
7073
- switch (id) {
7074
- case ActionsController.CLOSE:
7075
- btnId = "btnClose";
7076
- break;
7077
- case ActionsController.CONFIRM:
7078
- btnId = "btnCon";
7079
- break;
7080
- case ActionsController.DELEGATE:
7081
- btnId = "lblExeDelegar";
7082
- break;
7083
- case ActionsController.NEXT:
7084
- btnId = "btnSig";
7085
- break;
7086
- case ActionsController.PREVIOUS:
7087
- btnId = "btnAnt";
7088
- break;
7089
- case ActionsController.PRINT:
7090
- btnId = "btnStaPri";
7091
- break;
7092
- case ActionsController.RELEASE:
7093
- btnId = "btnEjeLib";
7094
- break;
7095
- case ActionsController.SAVE:
7096
- btnId = "btnGua";
7097
- break;
7098
- case ActionsController.SIGN:
7099
- btnId = "btnSig";
7100
- break;
7101
- case ActionsController.SHARE:
7102
- btnId = "lblShareMsg";
7103
- break;
7104
- case ActionsController.VIEW_DOCS:
7105
- btnId = "sbtEjeDoc";
7106
- break;
7107
- default:
7108
- throw new Error(`There is no button with id ${id}`);
7109
- }
7110
- return btnId;
7111
- }
7112
7090
  getCurrentLanguageCode() {
7113
- return getWindow(this.execution).LANG_CODE;
7091
+ return getWindow(__privateGet$2(this, _execution)).LANG_CODE;
7114
7092
  }
7115
7093
  getCurrentProcessName() {
7116
- return this.execution.environment.properties?.processName ?? "";
7094
+ return __privateGet$2(this, _execution).environment.properties?.processName ?? "";
7117
7095
  }
7118
7096
  getCurrentStep() {
7119
- return this.execution.currentStep;
7097
+ return __privateGet$2(this, _execution).currentStep;
7120
7098
  }
7121
7099
  getCurrentTaskName() {
7122
- return this.execution.environment.properties?.taskName ?? "";
7100
+ return __privateGet$2(this, _execution).environment.properties?.taskName ?? "";
7123
7101
  }
7124
7102
  getEntityForm(frmName) {
7125
7103
  const frm = this.getForm(frmName, "E");
@@ -7140,19 +7118,19 @@ class ApiaFunctions {
7140
7118
  return pForm;
7141
7119
  }
7142
7120
  getLastModalReturn() {
7143
- return this.execution.getLastModalReturn();
7121
+ return __privateGet$2(this, _execution).getLastModalReturn();
7144
7122
  }
7145
7123
  getModalReturn() {
7146
7124
  return this.getLastModalReturn();
7147
7125
  }
7148
7126
  getModalSelectedRow() {
7149
- return this.execution.getLastModalReturn()?.slice(2);
7127
+ return __privateGet$2(this, _execution).getLastModalReturn()?.slice(2);
7150
7128
  }
7151
7129
  getModalShowValue() {
7152
- return this.execution.getLastModalReturn()[1];
7130
+ return __privateGet$2(this, _execution).getLastModalReturn()[1];
7153
7131
  }
7154
7132
  getModalValue() {
7155
- return this.execution.getLastModalReturn()[0];
7133
+ return __privateGet$2(this, _execution).getLastModalReturn()[0];
7156
7134
  }
7157
7135
  getProcessForm(frmName) {
7158
7136
  const frm = this.getForm(frmName, "P");
@@ -7162,7 +7140,7 @@ class ApiaFunctions {
7162
7140
  }
7163
7141
  getRootPath() {
7164
7142
  try {
7165
- return getWindow(this.execution).APIA_ROOT_CONTEXT;
7143
+ return getWindow(__privateGet$2(this, _execution)).APIA_ROOT_CONTEXT;
7166
7144
  } catch (e) {
7167
7145
  if (e instanceof Error) {
7168
7146
  console.error(`Apia JSApi Error: ${e.message}`);
@@ -7171,33 +7149,31 @@ class ApiaFunctions {
7171
7149
  return null;
7172
7150
  }
7173
7151
  hideActionButton(id) {
7174
- this.actionButton(id)?.hide();
7152
+ ActionsController.instance.hide(id);
7175
7153
  }
7176
- hideOptionButton(id) {
7177
- this.hideActionButton(id);
7154
+ isActionButtonDisabled(id) {
7155
+ return ActionsController.instance.isDisabled(id);
7156
+ }
7157
+ isActionButtonHidden(id) {
7158
+ return ActionsController.instance.isHidden(id);
7178
7159
  }
7179
7160
  saveTask() {
7180
- this.execution.doSave().then((res) => {
7181
- if (res)
7182
- console.warn("Manage...");
7183
- });
7161
+ __privateGet$2(this, _execution).flow.save();
7184
7162
  }
7185
7163
  setLastModalReturn(value) {
7186
- getWindow(this.execution).lastModalReturn = value;
7164
+ getWindow(__privateGet$2(this, _execution)).lastModalReturn = value;
7187
7165
  }
7188
7166
  setStepTitle(stepNumber, stepTitle) {
7189
- this.execution.setStepTitle(stepNumber, stepTitle);
7167
+ __privateGet$2(this, _execution).setStepTitle(stepNumber, stepTitle);
7190
7168
  }
7191
7169
  showActionButton(id) {
7192
- this.actionButton(id)?.show();
7193
- }
7194
- showOptionButton(id) {
7195
- this.showActionButton(id);
7170
+ ActionsController.instance.show(id);
7196
7171
  }
7197
7172
  viewAdmEntity(entName, entNum) {
7198
7173
  this.admEntity(entName, entNum);
7199
7174
  }
7200
7175
  }
7176
+ _execution = new WeakMap();
7201
7177
 
7202
7178
  var ApiaFunctions$1 = /*#__PURE__*/Object.freeze({
7203
7179
  __proto__: null,
@@ -7870,26 +7846,31 @@ class Form extends WithProperties {
7870
7846
  (c) => c.evtName === eventName
7871
7847
  );
7872
7848
  if (events.length > 0) {
7873
- for (const event of events) {
7874
- try {
7875
- const fn = getWindow(this.execution)[event.fncName];
7876
- const result = await fn(
7877
- new ApiaForm(this.execution, this),
7878
- ...await this.getScriptEventParams(event.fncParams)
7879
- );
7880
- if (!result) {
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
+ );
7881
7869
  return false;
7882
7870
  }
7883
- } catch (e) {
7884
- console.error(e);
7885
- this.execution.notifications.add(
7886
- new MessageNotification({
7887
- message: labels.errorOnEvent(this.execution, event.fncName) + e,
7888
- type: "error"
7889
- })
7890
- );
7891
- return false;
7892
7871
  }
7872
+ } finally {
7873
+ unlock();
7893
7874
  }
7894
7875
  }
7895
7876
  return true;
@@ -8987,6 +8968,7 @@ class Execution extends EventEmitter$1 {
8987
8968
  __publicField(this, "entity", new Entity(this));
8988
8969
  __publicField(this, "process", new Process(this));
8989
8970
  __publicField(this, "observations", new Observations(this));
8971
+ __publicField(this, "executedOnLoadEvents", false);
8990
8972
  __publicField(this, "executionConfig", null);
8991
8973
  __publicField(this, "_steps", []);
8992
8974
  __publicField(this, "_currentStep", 1);
@@ -9003,11 +8985,43 @@ class Execution extends EventEmitter$1 {
9003
8985
  });
9004
8986
  __publicField(this, "state", {
9005
8987
  executionState: ExecutionState.LOADING,
9006
- locked: true,
8988
+ locked: 0,
9007
8989
  hasChangedAnything: false
9008
8990
  });
9009
8991
  __publicField(this, "hasInitializedFormsTabs", {});
9010
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
+ });
9011
9025
  this.fieldsMapping = { ...defaultFieldsMap, ...environment.fieldsMapping };
9012
9026
  this.notifications = new Notifications(this);
9013
9027
  makeObservable(this, { state: observable });
@@ -9057,88 +9071,111 @@ class Execution extends EventEmitter$1 {
9057
9071
  getCurrentTask() {
9058
9072
  return new Task({ task: { name: "TODO" } });
9059
9073
  }
9060
- async run(executionConfig) {
9061
- this._stepCount = noNaN$1(getWindow(this).STEP_QTY);
9062
- this._currentStep = noNaN$1(getWindow(this).CURRENT_STEP);
9063
- this.executionConfig = executionConfig;
9064
- this.environment.properties = {
9065
- taskName: getWindow(this).CURRENT_TASK_NAME || "",
9066
- processName: getWindow(this).CURRENT_PROCESS_NAME || ""
9067
- };
9068
- const errXML = unescapeMarkup(getWindow(this).EXEC_ERRORS);
9069
- if (errXML) {
9070
- const obj = parseXml(errXML);
9071
- arrayOrArray(obj.sysMessages?.message).forEach(
9072
- (c) => this.notifications.add(
9073
- new MessageNotification({
9074
- message: c.text,
9075
- type: "warning"
9076
- })
9077
- )
9078
- );
9079
- [
9080
- ...arrayOrArray(obj.exceptions?.exception),
9081
- ...arrayOrArray(obj.sysExceptions?.exception)
9082
- ].forEach(
9083
- (c) => this.notifications.add(
9084
- new MessageNotification({
9085
- message: c.text,
9086
- type: "error",
9087
- stackTrace: c.label
9088
- })
9089
- )
9090
- );
9091
- }
9092
- for (let i = 1; i < Number(getWindow(this).STEP_QTY) + 1; i++) {
9093
- if (i < this._currentStep) {
9094
- this._steps.push({
9095
- title: `Step ${i}`,
9096
- stepNumber: i,
9097
- status: "completed"
9098
- });
9099
- }
9100
- if (i > this._currentStep && i <= this._stepCount) {
9101
- this._steps.push({
9102
- title: `Step ${i}`,
9103
- stepNumber: i,
9104
- status: "pending"
9105
- });
9106
- }
9107
- if (i === this._currentStep) {
9108
- this._steps.push({
9109
- title: `Step ${i}`,
9110
- stepNumber: i,
9111
- status: "current"
9112
- });
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--;
9113
9084
  }
9114
- }
9115
- const res = await InitialData.getFormsDefinition(this);
9085
+ };
9086
+ }
9087
+ async run(executionConfig) {
9088
+ const unlock = this.lock();
9116
9089
  try {
9117
- for await (const formDefinition of res) {
9118
- const props = parseFakeJSON$1(formDefinition.properties);
9119
- if (!props.frmTab && !props.frmHidden && (arrayOrArray(formDefinition.field).length > 0 || arrayOrArray(formDefinition.customField).length > 0)) {
9120
- this.mustRenderForms.push(
9121
- formDefinition.frmParent + "_" + formDefinition.formName
9122
- );
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
+ });
9123
9142
  }
9124
9143
  }
9125
- for await (const formDefinition of res) {
9126
- const newForm = new Form(this, formDefinition);
9127
- await newForm.init();
9128
- if (formDefinition.frmParent === "E") {
9129
- this.forms.E.set(formDefinition.formName, newForm);
9130
- this.formsById.E.set(String(formDefinition.id), newForm);
9131
- } else {
9132
- this.forms.P.set(formDefinition.formName, newForm);
9133
- this.formsById.P.set(String(formDefinition.id), newForm);
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
+ }
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
+ }
9134
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;
9135
9176
  }
9136
- this.state.executionState = this.mustRenderForms.length === 0 ? ExecutionState.RUNNING : ExecutionState.RENDERING;
9137
- this.state.locked = false;
9138
- this.fireEvents("onLoad");
9139
- } catch (e) {
9140
- this.state.executionState = ExecutionState.FINISHED_WITH_ERROR;
9141
- throw e;
9177
+ } finally {
9178
+ unlock();
9142
9179
  }
9143
9180
  }
9144
9181
  getHiddenForms() {
@@ -9151,7 +9188,7 @@ class Execution extends EventEmitter$1 {
9151
9188
  this.mustRenderForms = this.mustRenderForms.filter(
9152
9189
  (c) => c !== frmParent + "_" + frmName
9153
9190
  );
9154
- if (this.mustRenderForms.length === 0) {
9191
+ if (this.mustRenderForms.length === 0 && this.executedOnLoadEvents) {
9155
9192
  this.state.executionState = ExecutionState.RUNNING;
9156
9193
  }
9157
9194
  }
@@ -9161,12 +9198,6 @@ class Execution extends EventEmitter$1 {
9161
9198
  async shareSocial() {
9162
9199
  console.warn("shareSocial not implemented yet");
9163
9200
  }
9164
- confirm() {
9165
- this.emit("confirm", null);
9166
- }
9167
- next() {
9168
- this.emit("next", null);
9169
- }
9170
9201
  sendToDesktop() {
9171
9202
  this.emit("sendToDesktop", null);
9172
9203
  }
@@ -9200,7 +9231,6 @@ class Execution extends EventEmitter$1 {
9200
9231
  }
9201
9232
  async doConfirm(status) {
9202
9233
  if (status && !status?.step && !status?.finishedWithError) {
9203
- this.state.locked = false;
9204
9234
  return false;
9205
9235
  } else {
9206
9236
  const validationResult = status !== void 0 || await this.validate();
@@ -9210,8 +9240,8 @@ class Execution extends EventEmitter$1 {
9210
9240
  const isValid = status !== void 0 || await this.fireEvents("onSubmit");
9211
9241
  const canConfirm = this.executionConfig?.canConfirm && isValid === true;
9212
9242
  if (canConfirm) {
9243
+ const unlock = this.lock();
9213
9244
  try {
9214
- this.state.locked = true;
9215
9245
  const result = await (this.executionConfig?.isEntity ? confirmEntity : confirm)(
9216
9246
  this,
9217
9247
  status || {
@@ -9221,10 +9251,8 @@ class Execution extends EventEmitter$1 {
9221
9251
  if (result instanceof FlowModal$1) {
9222
9252
  return result;
9223
9253
  }
9224
- this.state.locked = false;
9225
9254
  return result;
9226
9255
  } catch (error) {
9227
- this.state.locked = false;
9228
9256
  console.error("Confirmation process failed:", error);
9229
9257
  this.notifications.add(
9230
9258
  new MessageNotification({
@@ -9233,9 +9261,10 @@ class Execution extends EventEmitter$1 {
9233
9261
  })
9234
9262
  );
9235
9263
  return false;
9264
+ } finally {
9265
+ unlock();
9236
9266
  }
9237
9267
  } else {
9238
- this.state.locked = false;
9239
9268
  return isValid;
9240
9269
  }
9241
9270
  }
@@ -9277,6 +9306,7 @@ class Execution extends EventEmitter$1 {
9277
9306
  return isValid;
9278
9307
  const canGoNext = this.executionConfig?.canGoForward && isValid === true;
9279
9308
  if (canGoNext) {
9309
+ const unlock = this.lock();
9280
9310
  try {
9281
9311
  const checkLocksRes = await post(
9282
9312
  this,
@@ -9346,6 +9376,8 @@ class Execution extends EventEmitter$1 {
9346
9376
  })
9347
9377
  );
9348
9378
  return false;
9379
+ } finally {
9380
+ unlock();
9349
9381
  }
9350
9382
  }
9351
9383
  }
@@ -9353,23 +9385,24 @@ class Execution extends EventEmitter$1 {
9353
9385
  getWindow(this).print();
9354
9386
  }
9355
9387
  async doSave() {
9356
- const response = await post(
9357
- this,
9358
- makeApiaUrl(this, {
9359
- action: "saveTask",
9360
- asXML: true,
9361
- react: true
9362
- })
9363
- );
9364
- const canClose = response?.data?.load?.canClose;
9365
- if (canClose) {
9366
- getWindow(this).location.assign(
9388
+ const unlock = this.lock();
9389
+ try {
9390
+ const response = await post(
9391
+ this,
9367
9392
  makeApiaUrl(this, {
9368
- action: "refreshPage"
9393
+ action: "saveTask",
9394
+ asXML: true,
9395
+ react: true
9369
9396
  })
9370
9397
  );
9371
- return response;
9398
+ const canClose = response?.data?.load?.canClose;
9399
+ if (canClose) {
9400
+ return response;
9401
+ }
9402
+ } finally {
9403
+ unlock();
9372
9404
  }
9405
+ return false;
9373
9406
  }
9374
9407
  getStepTitle(step) {
9375
9408
  if (this._steps)
@@ -9418,20 +9451,25 @@ class Execution extends EventEmitter$1 {
9418
9451
  return this.lastModalReturn;
9419
9452
  }
9420
9453
  async fireEvents(evt) {
9454
+ const unlock = this.lock();
9421
9455
  let result = true;
9422
- for await (const f of this.forms.E.values()) {
9423
- result = result && await f.fireScriptEvent(evt);
9424
- if (!result) {
9425
- return false;
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
+ }
9426
9462
  }
9427
- }
9428
- for await (const f of this.forms.P.values()) {
9429
- result = result && await f.fireScriptEvent(evt);
9430
- if (!result) {
9431
- 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
+ }
9432
9468
  }
9469
+ return true;
9470
+ } finally {
9471
+ unlock();
9433
9472
  }
9434
- return true;
9435
9473
  }
9436
9474
  }
9437
9475