@apia/execution 4.0.102 → 4.0.104
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.d.ts +24 -21
- package/dist/index.js +87 -76
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -175,6 +175,8 @@ type TApiaFieldWithAttributeBaseProps<T extends Record<any, any>> = TApiaFieldBa
|
|
|
175
175
|
attId: string;
|
|
176
176
|
attName: string;
|
|
177
177
|
attLabel: string;
|
|
178
|
+
attDescription?: string;
|
|
179
|
+
attDesc?: string;
|
|
178
180
|
qry_show_value?: any;
|
|
179
181
|
value: any;
|
|
180
182
|
valueType: TApiaFieldValueType;
|
|
@@ -620,14 +622,15 @@ declare class Attribute {
|
|
|
620
622
|
readonly id: string;
|
|
621
623
|
readonly name: string;
|
|
622
624
|
readonly title: string;
|
|
625
|
+
readonly description: string;
|
|
623
626
|
readonly valueType: TApiaFieldValueType;
|
|
624
|
-
constructor(id: string, name: string, title: string, valueType: TApiaFieldValueType);
|
|
627
|
+
constructor(id: string, name: string, title: string, description: string, valueType: TApiaFieldValueType);
|
|
625
628
|
}
|
|
626
629
|
declare abstract class FieldWithAttribute<FieldProps extends TApiaFieldWithAttributeProperties = TApiaFieldWithAttributeProperties, ValueType = any, FieldDefinition extends TApiaFieldWithAttributeBaseProps<FieldProps> = TApiaFieldWithAttributeBaseProps<FieldProps>> extends Field<FieldProps, FieldDefinition, FieldWithAttributeState<FieldDefinition, FieldProps, ValueType>> {
|
|
627
630
|
#private;
|
|
628
631
|
protected lastSynchronizationValue: ValueType | null;
|
|
629
632
|
readonly attribute: Attribute;
|
|
630
|
-
constructor({ attId, attName, attLabel, valueType, value, ...definition }: TApiaFieldWithAttributeBaseProps<FieldProps>);
|
|
633
|
+
constructor({ attId, attName, attLabel, attDescription, attDesc, valueType, value, ...definition }: TApiaFieldWithAttributeBaseProps<FieldProps>);
|
|
631
634
|
fireEvent(eventName: string, options?: TFireEventOptions): Promise<boolean>;
|
|
632
635
|
protected getInitialValue({ value, }: TApiaFieldWithAttributeBaseProps<FieldProps>): Promise<ValueType>;
|
|
633
636
|
getValidationState(): FieldValidationState;
|
|
@@ -1109,10 +1112,10 @@ declare class ApiaFieldWithAttribute<T = string | boolean> extends ApiaField {
|
|
|
1109
1112
|
#private;
|
|
1110
1113
|
constructor(execution: Execution, field: FieldWithAttribute);
|
|
1111
1114
|
get attribute(): ApiaAttribute;
|
|
1112
|
-
clearValue():
|
|
1115
|
+
clearValue(): Promise<boolean>;
|
|
1113
1116
|
getValue(): any;
|
|
1114
|
-
setValue(v: T):
|
|
1115
|
-
protected _setValue(v: T, options: SetValueOptions):
|
|
1117
|
+
setValue(v: T): Promise<boolean>;
|
|
1118
|
+
protected _setValue(v: T, options: SetValueOptions): Promise<boolean>;
|
|
1116
1119
|
getLabel(): string | null | void;
|
|
1117
1120
|
getProperty<K extends keyof TApiaFieldWithAttributeProperties>(name: TApiaFieldWithAttributeProperties[K]): unknown;
|
|
1118
1121
|
}
|
|
@@ -1138,18 +1141,18 @@ declare class InputField extends ApiaFieldWithAttribute {
|
|
|
1138
1141
|
#private;
|
|
1139
1142
|
constructor(execution: Execution, field: Input);
|
|
1140
1143
|
getObjectValue(): number | string | boolean | null;
|
|
1141
|
-
setValue(v: string):
|
|
1144
|
+
setValue(v: string): Promise<boolean>;
|
|
1142
1145
|
}
|
|
1143
1146
|
|
|
1144
1147
|
declare class TreeField extends ApiaFieldWithAttribute<string | number | (string | number)[]> {
|
|
1145
1148
|
#private;
|
|
1146
1149
|
constructor(execution: Execution, field: Tree);
|
|
1147
|
-
setValue(v: string | number | (string | number)[]):
|
|
1150
|
+
setValue(v: string | number | (string | number)[]): Promise<boolean>;
|
|
1148
1151
|
}
|
|
1149
1152
|
|
|
1150
1153
|
declare class CheckField extends ApiaFieldWithAttribute {
|
|
1151
|
-
clearValue():
|
|
1152
|
-
setValue(value: string | boolean | number):
|
|
1154
|
+
clearValue(): Promise<boolean>;
|
|
1155
|
+
setValue(value: string | boolean | number): Promise<boolean>;
|
|
1153
1156
|
}
|
|
1154
1157
|
|
|
1155
1158
|
type TOptionsMap$1 = Map<string, PossibleValue>;
|
|
@@ -1171,10 +1174,10 @@ declare class MultipleField extends ApiaFieldWithAttribute<string[]> {
|
|
|
1171
1174
|
#private;
|
|
1172
1175
|
constructor(execution: Execution, field: Multiple);
|
|
1173
1176
|
addOption(optionValue: string | number, showValue: string, allowRepeatedValue: boolean): void;
|
|
1174
|
-
setValue(value: string[]):
|
|
1177
|
+
setValue(value: string[]): Promise<boolean>;
|
|
1175
1178
|
clearOptions(): void;
|
|
1176
1179
|
getSelectedOption(asObject: boolean): TOptionsMap | PossibleValue[] | null;
|
|
1177
|
-
getOptions():
|
|
1180
|
+
getOptions(asObject: boolean): TOptionsMap | PossibleValue[] | null;
|
|
1178
1181
|
setOptions(optionsArray: PossibleValue[]): void;
|
|
1179
1182
|
removeOption(optionValue: string | number): void;
|
|
1180
1183
|
}
|
|
@@ -1223,16 +1226,15 @@ declare class TextField extends ApiaField implements ITextField {
|
|
|
1223
1226
|
declare class GridField extends ApiaField {
|
|
1224
1227
|
#private;
|
|
1225
1228
|
constructor(execution: Execution, field: Grid);
|
|
1226
|
-
addRow():
|
|
1227
|
-
addRowAndWait(): Promise<IApiaField[]>;
|
|
1229
|
+
addRow(): Promise<IApiaField[]>;
|
|
1228
1230
|
clearGrid(): void;
|
|
1229
1231
|
clearPage(): void;
|
|
1230
|
-
clearRow(index: number):
|
|
1232
|
+
clearRow(index: number): Promise<void>;
|
|
1231
1233
|
closeForm(): GridField;
|
|
1232
|
-
deleteAllRows():
|
|
1233
|
-
deleteGrid(): void
|
|
1234
|
+
deleteAllRows(): Promise<void>;
|
|
1235
|
+
deleteGrid(): Promise<void>;
|
|
1234
1236
|
deletePage(): void;
|
|
1235
|
-
deleteRow(index: number):
|
|
1237
|
+
deleteRow(index: number): Promise<void>;
|
|
1236
1238
|
editRow(index: number): void;
|
|
1237
1239
|
getSelectedIndexes(useAbsoluteIndex?: boolean): number[];
|
|
1238
1240
|
getAllColumns(): (IApiaField<Readonly<{
|
|
@@ -1844,8 +1846,8 @@ declare class FileUploaderField extends ApiaFieldWithAttribute {
|
|
|
1844
1846
|
#private;
|
|
1845
1847
|
constructor(execution: Execution, field: File$1);
|
|
1846
1848
|
onChange(cb: (newValue: unknown) => unknown): void;
|
|
1847
|
-
setValue():
|
|
1848
|
-
downloadDocument():
|
|
1849
|
+
setValue(): Promise<boolean>;
|
|
1850
|
+
downloadDocument(): Promise<void>;
|
|
1849
1851
|
getValue(): string;
|
|
1850
1852
|
}
|
|
1851
1853
|
|
|
@@ -1856,8 +1858,8 @@ declare class ModalInputField extends ApiaFieldWithAttribute {
|
|
|
1856
1858
|
#private;
|
|
1857
1859
|
constructor(execution: Execution, field: ModalInput);
|
|
1858
1860
|
getObjectValue(): any | null;
|
|
1859
|
-
setValue(v: any):
|
|
1860
|
-
setValueFromInputWrite(value: string):
|
|
1861
|
+
setValue(v: any): Promise<boolean>;
|
|
1862
|
+
setValueFromInputWrite(value: string): Promise<void>;
|
|
1861
1863
|
}
|
|
1862
1864
|
|
|
1863
1865
|
type TCreateNewField = (execution: Execution, field: Field | FieldWithAttribute | CustomComponent) => IApiaField | null;
|
|
@@ -3343,6 +3345,7 @@ declare class Grid extends Field<GridProps, GridDefinition, GridState> {
|
|
|
3343
3345
|
protected readonly _footerController: GridFooterHandler;
|
|
3344
3346
|
protected readonly tableController: TableController;
|
|
3345
3347
|
get controller(): TableController;
|
|
3348
|
+
protected get isSmallGridMode(): boolean;
|
|
3346
3349
|
get currentPage(): number;
|
|
3347
3350
|
get editionModalHandler(): GridEditionModal | null;
|
|
3348
3351
|
/**
|
package/dist/index.js
CHANGED
|
@@ -307,6 +307,8 @@ const jsonDecode = (string) => {
|
|
|
307
307
|
return eval(`(${str})`);
|
|
308
308
|
};
|
|
309
309
|
const parseBool = (val) => {
|
|
310
|
+
if (typeof val === "boolean")
|
|
311
|
+
return val;
|
|
310
312
|
if (typeof val === "string") {
|
|
311
313
|
if (/^(?:true|T|t|1|1,00)$/i.test(val))
|
|
312
314
|
return true;
|
|
@@ -1643,10 +1645,11 @@ var __privateSet$k = (obj, member, value, setter) => {
|
|
|
1643
1645
|
};
|
|
1644
1646
|
var _lastOnChangeValue;
|
|
1645
1647
|
class Attribute {
|
|
1646
|
-
constructor(id, name, title, valueType) {
|
|
1648
|
+
constructor(id, name, title, description, valueType) {
|
|
1647
1649
|
this.id = id;
|
|
1648
1650
|
this.name = name;
|
|
1649
1651
|
this.title = title;
|
|
1652
|
+
this.description = description;
|
|
1650
1653
|
this.valueType = valueType;
|
|
1651
1654
|
}
|
|
1652
1655
|
}
|
|
@@ -1655,6 +1658,8 @@ class FieldWithAttribute extends Field {
|
|
|
1655
1658
|
attId,
|
|
1656
1659
|
attName,
|
|
1657
1660
|
attLabel,
|
|
1661
|
+
attDescription,
|
|
1662
|
+
attDesc,
|
|
1658
1663
|
valueType,
|
|
1659
1664
|
value,
|
|
1660
1665
|
...definition
|
|
@@ -1663,7 +1668,13 @@ class FieldWithAttribute extends Field {
|
|
|
1663
1668
|
__privateAdd$k(this, _lastOnChangeValue, null);
|
|
1664
1669
|
__publicField$l(this, "lastSynchronizationValue", null);
|
|
1665
1670
|
__publicField$l(this, "attribute");
|
|
1666
|
-
this.attribute = new Attribute(
|
|
1671
|
+
this.attribute = new Attribute(
|
|
1672
|
+
attId,
|
|
1673
|
+
attName,
|
|
1674
|
+
attLabel,
|
|
1675
|
+
attDescription ?? attDesc ?? definition.properties.tooltip ?? "",
|
|
1676
|
+
valueType
|
|
1677
|
+
);
|
|
1667
1678
|
this.state.value = value;
|
|
1668
1679
|
this.state.validation = {
|
|
1669
1680
|
dirty: false,
|
|
@@ -1840,6 +1851,7 @@ class FieldWithAttribute extends Field {
|
|
|
1840
1851
|
attId: this.attribute.id,
|
|
1841
1852
|
attName: this.attribute.name,
|
|
1842
1853
|
attLabel: this.attribute.title,
|
|
1854
|
+
attDescription: this.attribute.description,
|
|
1843
1855
|
valueType: this.attribute.valueType,
|
|
1844
1856
|
value: this.state.value
|
|
1845
1857
|
});
|
|
@@ -2990,12 +3002,20 @@ class Grid extends Field {
|
|
|
2990
3002
|
this.state.isLoading = false;
|
|
2991
3003
|
this.state.isMaximized = false;
|
|
2992
3004
|
this.controller.on("columnClick", (col) => {
|
|
2993
|
-
|
|
3005
|
+
const column = col.getState("properties")?.col;
|
|
3006
|
+
if (column) {
|
|
3007
|
+
this.sortColumn(column.fldId);
|
|
3008
|
+
}
|
|
2994
3009
|
});
|
|
2995
3010
|
}
|
|
2996
3011
|
get controller() {
|
|
2997
3012
|
return this.tableController;
|
|
2998
3013
|
}
|
|
3014
|
+
get isSmallGridMode() {
|
|
3015
|
+
const execution = this.getForm()?.execution;
|
|
3016
|
+
const dataGridConfig = (execution?.environment ? getWindow(execution) : globalThis.window)?.config?.execution?.components?.dataGrid;
|
|
3017
|
+
return dataGridConfig?.gridView === "small";
|
|
3018
|
+
}
|
|
2999
3019
|
get currentPage() {
|
|
3000
3020
|
return this.properties.currentPage;
|
|
3001
3021
|
}
|
|
@@ -3080,10 +3100,12 @@ class Grid extends Field {
|
|
|
3080
3100
|
].join("__");
|
|
3081
3101
|
}
|
|
3082
3102
|
resolveHeaderWidth(c) {
|
|
3103
|
+
const defaultWidth = this.isSmallGridMode ? "180px" : "150px";
|
|
3104
|
+
const wideWidth = this.isSmallGridMode ? "220px" : "200px";
|
|
3083
3105
|
if (c.fldType === "9" || c.fldType === "1" && c.dataType === "D" || c.fldType === "1" && c.hasQuery) {
|
|
3084
|
-
return
|
|
3106
|
+
return wideWidth;
|
|
3085
3107
|
}
|
|
3086
|
-
return
|
|
3108
|
+
return defaultWidth;
|
|
3087
3109
|
}
|
|
3088
3110
|
getGridActionFromEventName(eventName) {
|
|
3089
3111
|
switch (eventName) {
|
|
@@ -3395,7 +3417,7 @@ class Grid extends Field {
|
|
|
3395
3417
|
await super.init(form);
|
|
3396
3418
|
this.state.isMaximized = localStorage.getItem(this.getMaximizedStorageKey()) === "true";
|
|
3397
3419
|
const headerRow = new Row("header");
|
|
3398
|
-
if (this.properties.gridForm || !this.properties.hideDelButton && !this.properties.readonly && !this.properties.inputAsText && !this.getForm().definition.readOnly && !this.getForm().definition.readonly && getWindow(this.getForm().execution)?.config?.execution?.components?.dataGrid?.showDeleteButton)
|
|
3420
|
+
if (this.isSmallGridMode || this.properties.gridForm || !this.properties.hideDelButton && !this.properties.readonly && !this.properties.inputAsText && !this.getForm().definition.readOnly && !this.getForm().definition.readonly && getWindow(this.getForm().execution)?.config?.execution?.components?.dataGrid?.showDeleteButton)
|
|
3399
3421
|
headerRow.addCell(
|
|
3400
3422
|
new AdditionalCell(
|
|
3401
3423
|
this,
|
|
@@ -3599,7 +3621,7 @@ class Grid extends Field {
|
|
|
3599
3621
|
});
|
|
3600
3622
|
}
|
|
3601
3623
|
const newRow = new Row(String(this.rowId++));
|
|
3602
|
-
if (this.properties.gridForm || !this.properties.hideDelButton && !this.properties.readonly && !this.properties.inputAsText && !this.getForm().definition.readOnly && !this.getForm().definition.readonly && getWindow(this.getForm().execution)?.config?.execution?.components?.dataGrid?.showDeleteButton)
|
|
3624
|
+
if (this.isSmallGridMode || this.properties.gridForm || !this.properties.hideDelButton && !this.properties.readonly && !this.properties.inputAsText && !this.getForm().definition.readOnly && !this.getForm().definition.readonly && getWindow(this.getForm().execution)?.config?.execution?.components?.dataGrid?.showDeleteButton)
|
|
3603
3625
|
newRow.addCell(
|
|
3604
3626
|
new AdditionalCell(
|
|
3605
3627
|
this,
|
|
@@ -3677,7 +3699,7 @@ class Grid extends Field {
|
|
|
3677
3699
|
}
|
|
3678
3700
|
calculateMustShowAdditionalColumn() {
|
|
3679
3701
|
const { hideDelButton, shownDeleteButtons, shownEditionButtons, gridForm } = this.properties;
|
|
3680
|
-
const mustShowAdditionalColumn = !hideDelButton && [...shownDeleteButtons.values()].some((c) => c !== false) || !!gridForm && [...shownEditionButtons.values()].some((c) => c !== false);
|
|
3702
|
+
const mustShowAdditionalColumn = this.isSmallGridMode || !hideDelButton && [...shownDeleteButtons.values()].some((c) => c !== false) || !!gridForm && [...shownEditionButtons.values()].some((c) => c !== false);
|
|
3681
3703
|
this.controller.toggleColumnVisibility(
|
|
3682
3704
|
"additional",
|
|
3683
3705
|
mustShowAdditionalColumn
|
|
@@ -4942,16 +4964,16 @@ class ApiaFieldWithAttribute extends ApiaField {
|
|
|
4942
4964
|
return new ApiaAttribute(__privateGet$g(this, _field$c).attribute);
|
|
4943
4965
|
}
|
|
4944
4966
|
clearValue() {
|
|
4945
|
-
__privateGet$g(this, _field$c).setValue("");
|
|
4967
|
+
return __privateGet$g(this, _field$c).setValue("");
|
|
4946
4968
|
}
|
|
4947
4969
|
getValue() {
|
|
4948
4970
|
return __privateGet$g(this, _field$c).getValue();
|
|
4949
4971
|
}
|
|
4950
4972
|
setValue(v) {
|
|
4951
|
-
__privateGet$g(this, _field$c).setValue(v);
|
|
4973
|
+
return __privateGet$g(this, _field$c).setValue(v);
|
|
4952
4974
|
}
|
|
4953
4975
|
_setValue(v, options) {
|
|
4954
|
-
__privateGet$g(this, _field$c).setValue(v, options);
|
|
4976
|
+
return __privateGet$g(this, _field$c).setValue(v, options);
|
|
4955
4977
|
}
|
|
4956
4978
|
getLabel() {
|
|
4957
4979
|
return __privateGet$g(this, _field$c).attribute.title;
|
|
@@ -5094,9 +5116,9 @@ class InputField extends ApiaFieldWithAttribute {
|
|
|
5094
5116
|
}
|
|
5095
5117
|
setValue(v) {
|
|
5096
5118
|
if (__privateGet$e(this, _field$a).attribute.valueType === "D") {
|
|
5097
|
-
__privateGet$e(this, _field$a).setValue(v, { format: "d/m/Y" });
|
|
5119
|
+
return __privateGet$e(this, _field$a).setValue(v, { format: "d/m/Y" });
|
|
5098
5120
|
} else {
|
|
5099
|
-
__privateGet$e(this, _field$a).setValue(v);
|
|
5121
|
+
return __privateGet$e(this, _field$a).setValue(v);
|
|
5100
5122
|
}
|
|
5101
5123
|
}
|
|
5102
5124
|
}
|
|
@@ -5128,14 +5150,14 @@ class TreeField extends ApiaFieldWithAttribute {
|
|
|
5128
5150
|
__privateSet$d(this, _field$9, field);
|
|
5129
5151
|
}
|
|
5130
5152
|
setValue(v) {
|
|
5131
|
-
__privateGet$d(this, _field$9).setValue(arrayOrArray(v));
|
|
5153
|
+
return __privateGet$d(this, _field$9).setValue(arrayOrArray(v));
|
|
5132
5154
|
}
|
|
5133
5155
|
}
|
|
5134
5156
|
_field$9 = new WeakMap();
|
|
5135
5157
|
|
|
5136
5158
|
class CheckField extends ApiaFieldWithAttribute {
|
|
5137
5159
|
clearValue() {
|
|
5138
|
-
this.setValue(false);
|
|
5160
|
+
return this.setValue(false);
|
|
5139
5161
|
}
|
|
5140
5162
|
setValue(value) {
|
|
5141
5163
|
let val;
|
|
@@ -5147,7 +5169,7 @@ class CheckField extends ApiaFieldWithAttribute {
|
|
|
5147
5169
|
"Apia JSApi Error: The function setValue for a Checkbox field only accepts boolean or string type for value parameter."
|
|
5148
5170
|
);
|
|
5149
5171
|
}
|
|
5150
|
-
super.setValue(val);
|
|
5172
|
+
return super.setValue(val);
|
|
5151
5173
|
}
|
|
5152
5174
|
}
|
|
5153
5175
|
|
|
@@ -5244,7 +5266,7 @@ var __accessCheck$b = (obj, member, msg) => {
|
|
|
5244
5266
|
};
|
|
5245
5267
|
var __privateGet$b = (obj, member, getter) => {
|
|
5246
5268
|
__accessCheck$b(obj, member, "read from private field");
|
|
5247
|
-
return member.get(obj);
|
|
5269
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
5248
5270
|
};
|
|
5249
5271
|
var __privateAdd$b = (obj, member, value) => {
|
|
5250
5272
|
if (member.has(obj))
|
|
@@ -5282,8 +5304,9 @@ class MultipleField extends ApiaFieldWithAttribute {
|
|
|
5282
5304
|
}
|
|
5283
5305
|
setValue(value) {
|
|
5284
5306
|
if (__privateGet$b(this, _field$7).definition.id) {
|
|
5285
|
-
__privateGet$b(this, _field$7).setValue(value);
|
|
5307
|
+
return __privateGet$b(this, _field$7).setValue(value);
|
|
5286
5308
|
}
|
|
5309
|
+
return Promise.resolve(false);
|
|
5287
5310
|
}
|
|
5288
5311
|
clearOptions() {
|
|
5289
5312
|
if (__privateGet$b(this, _field$7).definition.id) {
|
|
@@ -5308,8 +5331,17 @@ class MultipleField extends ApiaFieldWithAttribute {
|
|
|
5308
5331
|
}
|
|
5309
5332
|
return null;
|
|
5310
5333
|
}
|
|
5311
|
-
getOptions() {
|
|
5312
|
-
|
|
5334
|
+
getOptions(asObject) {
|
|
5335
|
+
if (__privateGet$b(this, _field$7).definition.id) {
|
|
5336
|
+
const options = arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue);
|
|
5337
|
+
const obj = /* @__PURE__ */ new Map();
|
|
5338
|
+
if (asObject) {
|
|
5339
|
+
options.forEach((c) => obj.set(String(c.value), c));
|
|
5340
|
+
return obj;
|
|
5341
|
+
}
|
|
5342
|
+
return options;
|
|
5343
|
+
}
|
|
5344
|
+
return null;
|
|
5313
5345
|
}
|
|
5314
5346
|
setOptions(optionsArray) {
|
|
5315
5347
|
if (__privateGet$b(this, _field$7).definition.id) {
|
|
@@ -5609,34 +5641,27 @@ var __privateSet$6 = (obj, member, value, setter) => {
|
|
|
5609
5641
|
member.set(obj, value);
|
|
5610
5642
|
return value;
|
|
5611
5643
|
};
|
|
5612
|
-
var
|
|
5613
|
-
__accessCheck$6(obj, member, "access private method");
|
|
5614
|
-
return method;
|
|
5615
|
-
};
|
|
5616
|
-
var _execution$2, _field$2, _mutex, _pendingAction, _enqueueAction, enqueueAction_fn;
|
|
5644
|
+
var _execution$2, _field$2, _mutex;
|
|
5617
5645
|
class GridField extends ApiaField {
|
|
5618
5646
|
constructor(execution, field) {
|
|
5619
5647
|
super(execution, field);
|
|
5620
|
-
__privateAdd$6(this, _enqueueAction);
|
|
5621
5648
|
__privateAdd$6(this, _execution$2, void 0);
|
|
5622
5649
|
__privateAdd$6(this, _field$2, void 0);
|
|
5623
5650
|
__privateAdd$6(this, _mutex, new Mutex());
|
|
5624
|
-
__privateAdd$6(this, _pendingAction, Promise.resolve());
|
|
5625
5651
|
__privateSet$6(this, _execution$2, execution);
|
|
5626
5652
|
__privateSet$6(this, _field$2, field);
|
|
5627
5653
|
}
|
|
5628
|
-
addRow() {
|
|
5629
|
-
|
|
5630
|
-
await this.
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5654
|
+
async addRow() {
|
|
5655
|
+
try {
|
|
5656
|
+
await __privateGet$6(this, _mutex).acquire();
|
|
5657
|
+
const result = await __privateGet$6(this, _field$2).addRow();
|
|
5658
|
+
if (result) {
|
|
5659
|
+
return this.getRow(__privateGet$6(this, _field$2).finalIndex);
|
|
5660
|
+
}
|
|
5661
|
+
return [];
|
|
5662
|
+
} finally {
|
|
5663
|
+
__privateGet$6(this, _mutex).release();
|
|
5638
5664
|
}
|
|
5639
|
-
return [];
|
|
5640
5665
|
}
|
|
5641
5666
|
clearGrid() {
|
|
5642
5667
|
throw new Error("Method deprecated");
|
|
@@ -5644,8 +5669,9 @@ class GridField extends ApiaField {
|
|
|
5644
5669
|
clearPage() {
|
|
5645
5670
|
throw new Error("Method deprecated");
|
|
5646
5671
|
}
|
|
5647
|
-
clearRow(index) {
|
|
5648
|
-
|
|
5672
|
+
async clearRow(index) {
|
|
5673
|
+
try {
|
|
5674
|
+
await __privateGet$6(this, _mutex).acquire();
|
|
5649
5675
|
const row = __privateGet$6(this, _field$2).getRowByFieldIndex(index);
|
|
5650
5676
|
if (!row) {
|
|
5651
5677
|
throw new Error(`Row ${index} not found`);
|
|
@@ -5654,30 +5680,35 @@ class GridField extends ApiaField {
|
|
|
5654
5680
|
if (c instanceof FieldWithAttribute)
|
|
5655
5681
|
c.state.value = "";
|
|
5656
5682
|
});
|
|
5657
|
-
}
|
|
5658
|
-
|
|
5683
|
+
} finally {
|
|
5684
|
+
__privateGet$6(this, _mutex).release();
|
|
5685
|
+
}
|
|
5659
5686
|
}
|
|
5660
5687
|
closeForm() {
|
|
5661
5688
|
__privateGet$6(this, _field$2).closeEditionModal();
|
|
5662
5689
|
return this;
|
|
5663
5690
|
}
|
|
5664
|
-
deleteAllRows() {
|
|
5665
|
-
|
|
5691
|
+
async deleteAllRows() {
|
|
5692
|
+
try {
|
|
5693
|
+
await __privateGet$6(this, _mutex).acquire();
|
|
5666
5694
|
await __privateGet$6(this, _field$2).deleteAllRows();
|
|
5667
|
-
}
|
|
5668
|
-
|
|
5695
|
+
} finally {
|
|
5696
|
+
__privateGet$6(this, _mutex).release();
|
|
5697
|
+
}
|
|
5669
5698
|
}
|
|
5670
|
-
deleteGrid() {
|
|
5699
|
+
async deleteGrid() {
|
|
5671
5700
|
throw new Error("Method deprecated");
|
|
5672
5701
|
}
|
|
5673
5702
|
deletePage() {
|
|
5674
5703
|
throw new Error("Method deprecated");
|
|
5675
5704
|
}
|
|
5676
|
-
deleteRow(index) {
|
|
5677
|
-
|
|
5678
|
-
await __privateGet$6(this,
|
|
5679
|
-
|
|
5680
|
-
|
|
5705
|
+
async deleteRow(index) {
|
|
5706
|
+
try {
|
|
5707
|
+
await __privateGet$6(this, _mutex).acquire();
|
|
5708
|
+
__privateGet$6(this, _field$2).deleteRows(index);
|
|
5709
|
+
} finally {
|
|
5710
|
+
__privateGet$6(this, _mutex).release();
|
|
5711
|
+
}
|
|
5681
5712
|
}
|
|
5682
5713
|
editRow(index) {
|
|
5683
5714
|
getWindow(__privateGet$6(this, _execution$2)).dispatchEvent(
|
|
@@ -5764,20 +5795,6 @@ class GridField extends ApiaField {
|
|
|
5764
5795
|
_execution$2 = new WeakMap();
|
|
5765
5796
|
_field$2 = new WeakMap();
|
|
5766
5797
|
_mutex = new WeakMap();
|
|
5767
|
-
_pendingAction = new WeakMap();
|
|
5768
|
-
_enqueueAction = new WeakSet();
|
|
5769
|
-
enqueueAction_fn = function(action) {
|
|
5770
|
-
__privateSet$6(this, _pendingAction, __privateGet$6(this, _pendingAction).then(async () => {
|
|
5771
|
-
await __privateGet$6(this, _mutex).acquire();
|
|
5772
|
-
try {
|
|
5773
|
-
return await action();
|
|
5774
|
-
} finally {
|
|
5775
|
-
__privateGet$6(this, _mutex).release();
|
|
5776
|
-
}
|
|
5777
|
-
}).catch((error) => {
|
|
5778
|
-
console.error(error);
|
|
5779
|
-
}));
|
|
5780
|
-
};
|
|
5781
5798
|
|
|
5782
5799
|
class CaptchaField extends ApiaField {
|
|
5783
5800
|
}
|
|
@@ -5824,13 +5841,10 @@ class FileUploaderField extends ApiaFieldWithAttribute {
|
|
|
5824
5841
|
`Apia JSApi Error: The Field ${__privateGet$5(this, _field$1).definition.fieldType} does not support this function`
|
|
5825
5842
|
);
|
|
5826
5843
|
}
|
|
5827
|
-
return
|
|
5844
|
+
return Promise.resolve(false);
|
|
5828
5845
|
}
|
|
5829
5846
|
downloadDocument() {
|
|
5830
|
-
|
|
5831
|
-
console.error(error);
|
|
5832
|
-
});
|
|
5833
|
-
return this;
|
|
5847
|
+
return __privateGet$5(this, _field$1).downloadDocument();
|
|
5834
5848
|
}
|
|
5835
5849
|
getValue() {
|
|
5836
5850
|
return __privateGet$5(this, _field$1).uploader?.filesArray?.[0]?.docName ?? "";
|
|
@@ -5870,13 +5884,10 @@ class ModalInputField extends ApiaFieldWithAttribute {
|
|
|
5870
5884
|
return __privateGet$4(this, _field).getValue();
|
|
5871
5885
|
}
|
|
5872
5886
|
setValue(v) {
|
|
5873
|
-
__privateGet$4(this, _field).setValue(v);
|
|
5887
|
+
return __privateGet$4(this, _field).setValue(v);
|
|
5874
5888
|
}
|
|
5875
5889
|
setValueFromInputWrite(value) {
|
|
5876
|
-
|
|
5877
|
-
console.error(error);
|
|
5878
|
-
});
|
|
5879
|
-
return this;
|
|
5890
|
+
return __privateGet$4(this, _field).setValueFromInputWrite(value);
|
|
5880
5891
|
}
|
|
5881
5892
|
}
|
|
5882
5893
|
_field = new WeakMap();
|