@apia/execution 4.0.58 → 4.0.63
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 +57 -7
- package/dist/index.js +189 -202
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -220,6 +220,7 @@ type TApiaFieldCommonProperties = {
|
|
|
220
220
|
tooltip?: string;
|
|
221
221
|
tooltipHelp?: boolean;
|
|
222
222
|
visibilityHidden?: boolean;
|
|
223
|
+
value?: string;
|
|
223
224
|
};
|
|
224
225
|
type TApiaFieldSizableFieldProperties = {
|
|
225
226
|
size?: string;
|
|
@@ -850,7 +851,7 @@ declare class ApiaFunctions implements IApiaFunctions {
|
|
|
850
851
|
showMessage(_text: string): void;
|
|
851
852
|
showConfirm(_text: string, _title: string, _callbackFn: (win: boolean) => unknown): void;
|
|
852
853
|
getFormByType(frmName: string, frmType: TFrmParent): IApiaForm | null;
|
|
853
|
-
admEntity(entName: string, entNum?: number, parameters?: string, width?: number, height?: number): void;
|
|
854
|
+
admEntity(entName: string, entNum?: number, parameters?: Record<string, string>, width?: number, height?: number): void;
|
|
854
855
|
clearMessages(): void;
|
|
855
856
|
clickActionButton(button: number): void;
|
|
856
857
|
disableActionButton(id: number): void;
|
|
@@ -1105,11 +1106,10 @@ declare class EditorField extends ApiaFieldWithAttribute {
|
|
|
1105
1106
|
}
|
|
1106
1107
|
|
|
1107
1108
|
type TOptionsMap$2 = Map<string, PossibleValue>;
|
|
1108
|
-
type TOptionsAsArray = PossibleValue[];
|
|
1109
1109
|
declare class SelectField extends ApiaFieldWithAttribute<string | number | (string | number)[]> {
|
|
1110
1110
|
#private;
|
|
1111
1111
|
constructor(execution: Execution, field: Select);
|
|
1112
|
-
getOptions(
|
|
1112
|
+
getOptions(): SelectPossibleValue[];
|
|
1113
1113
|
getTextValue(value: string): any;
|
|
1114
1114
|
addOption(optionValue: string | number, showValue: string, allowRepeatedValue: boolean): void;
|
|
1115
1115
|
setOptions(optionsArray: PossibleValue[]): void;
|
|
@@ -1141,7 +1141,7 @@ type TOptionsMap$1 = Map<string, PossibleValue>;
|
|
|
1141
1141
|
declare class RadioField extends ApiaFieldWithAttribute {
|
|
1142
1142
|
#private;
|
|
1143
1143
|
constructor(execution: Execution, field: Radio);
|
|
1144
|
-
getOptions(
|
|
1144
|
+
getOptions(): RadioPossibleValue[];
|
|
1145
1145
|
clearOptions(): void | null;
|
|
1146
1146
|
getTextValue(value: string): any;
|
|
1147
1147
|
addOption(radioValue: string | number, showValue: string, allowRepeatedValue: boolean): void;
|
|
@@ -1159,12 +1159,12 @@ declare class MultipleField extends ApiaFieldWithAttribute<string[]> {
|
|
|
1159
1159
|
setValue(value: string[]): void;
|
|
1160
1160
|
clearOptions(): void;
|
|
1161
1161
|
getSelectedOption(asObject: boolean): TOptionsMap | PossibleValue[] | null;
|
|
1162
|
-
getOptions(
|
|
1162
|
+
getOptions(): SelectPossibleValue[];
|
|
1163
1163
|
setOptions(optionsArray: PossibleValue[]): void;
|
|
1164
1164
|
removeOption(optionValue: string | number): void;
|
|
1165
1165
|
}
|
|
1166
1166
|
|
|
1167
|
-
declare class HiddenField extends
|
|
1167
|
+
declare class HiddenField extends ApiaFieldWithAttribute {
|
|
1168
1168
|
}
|
|
1169
1169
|
|
|
1170
1170
|
declare class AreaField extends ApiaFieldWithAttribute {
|
|
@@ -1202,6 +1202,7 @@ declare class TextField extends ApiaField implements ITextField {
|
|
|
1202
1202
|
constructor(execution: Execution, field: Field);
|
|
1203
1203
|
getLabel(): void;
|
|
1204
1204
|
setValue(value: string): void;
|
|
1205
|
+
getValue(): any;
|
|
1205
1206
|
}
|
|
1206
1207
|
|
|
1207
1208
|
declare class GridField extends ApiaField {
|
|
@@ -1829,6 +1830,7 @@ declare class FileUploaderField extends ApiaFieldWithAttribute {
|
|
|
1829
1830
|
onChange(cb: (newValue: unknown) => unknown): void;
|
|
1830
1831
|
setValue(): null;
|
|
1831
1832
|
downloadDocument(): Promise<void>;
|
|
1833
|
+
getValue(): string;
|
|
1832
1834
|
}
|
|
1833
1835
|
|
|
1834
1836
|
declare class PasswordField extends ApiaField {
|
|
@@ -1937,12 +1939,59 @@ type TFetchTaskActionResponse = {
|
|
|
1937
1939
|
label?: string;
|
|
1938
1940
|
};
|
|
1939
1941
|
};
|
|
1942
|
+
type TConfirmResponse = {
|
|
1943
|
+
onClose: string;
|
|
1944
|
+
pathSelection?: boolean | null;
|
|
1945
|
+
groupSelection?: boolean | null;
|
|
1946
|
+
load?: TApiaLoadForm & {
|
|
1947
|
+
type: 'form' | 'text' | 'table' | 'function';
|
|
1948
|
+
canClose: boolean;
|
|
1949
|
+
text?: {
|
|
1950
|
+
closeAll: string;
|
|
1951
|
+
title: string;
|
|
1952
|
+
addClass: string;
|
|
1953
|
+
label: string;
|
|
1954
|
+
};
|
|
1955
|
+
};
|
|
1956
|
+
actions?: {
|
|
1957
|
+
action: {
|
|
1958
|
+
toDo: 'functionTimedCall';
|
|
1959
|
+
param: [number, string];
|
|
1960
|
+
};
|
|
1961
|
+
};
|
|
1962
|
+
};
|
|
1963
|
+
type TConfirmEntityResponse = {
|
|
1964
|
+
onClose: string;
|
|
1965
|
+
load?: TApiaLoadForm & {
|
|
1966
|
+
type: 'form' | 'text' | 'table' | 'function';
|
|
1967
|
+
canClose: boolean;
|
|
1968
|
+
text?: {
|
|
1969
|
+
closeAll: string;
|
|
1970
|
+
title: string;
|
|
1971
|
+
addClass: string;
|
|
1972
|
+
label?: string;
|
|
1973
|
+
};
|
|
1974
|
+
};
|
|
1975
|
+
actions?: {
|
|
1976
|
+
action: {
|
|
1977
|
+
toDo: 'functionTimedCall';
|
|
1978
|
+
param: string[];
|
|
1979
|
+
};
|
|
1980
|
+
};
|
|
1981
|
+
};
|
|
1940
1982
|
type FieldError = {
|
|
1941
1983
|
id: string;
|
|
1942
1984
|
errorMessage: string;
|
|
1943
1985
|
title: string;
|
|
1944
1986
|
focus: string;
|
|
1945
1987
|
};
|
|
1988
|
+
type TAdmEntityEvent = {
|
|
1989
|
+
entName: string;
|
|
1990
|
+
entNum?: number;
|
|
1991
|
+
parameters?: Record<string, string>;
|
|
1992
|
+
width?: number;
|
|
1993
|
+
height?: number;
|
|
1994
|
+
};
|
|
1946
1995
|
|
|
1947
1996
|
declare class Form extends WithProperties<TApiaFormProperties> {
|
|
1948
1997
|
execution: Execution;
|
|
@@ -2707,6 +2756,7 @@ declare class Execution extends EventEmitter$1<{
|
|
|
2707
2756
|
componentName: string;
|
|
2708
2757
|
el: HTMLElement;
|
|
2709
2758
|
};
|
|
2759
|
+
adminEntity: TAdmEntityEvent;
|
|
2710
2760
|
}> {
|
|
2711
2761
|
environment: TExecutionEnvironment;
|
|
2712
2762
|
renderers?: TModalConfig['renderers'];
|
|
@@ -3702,5 +3752,5 @@ declare function parseFakeJSON<T extends Record<string, unknown>>(str: string):
|
|
|
3702
3752
|
|
|
3703
3753
|
declare function getFocusIdentifier(field: Field): string;
|
|
3704
3754
|
|
|
3705
|
-
export { ActionsController, AdditionalCell, ApiaAttribute, ApiaField, ApiaFieldWithAttribute, ApiaForm, ApiaFunctions, BouncingEmitter, Button, ButtonField, Captcha, CaptchaField, CheckField, Checkbox, type ComponentEvent, CustomComponent, GridField as DataGridField, Editor, EditorField, EventEmitter, Execution, ExecutionState, Field, FieldWithAttribute, type FieldWithAttributeState, type FieldsMapping, File$1 as File, FileUploaderField, FlowModal, Form, FormsUploader, Grid, GridCell, GridField, GridPaginated, HeaderCell, Hidden, HiddenField, type IApiaField, type IApiaForm, type IApiaFunctions, type IIProperty, IProperty, type ISignatureData, Image, ImageField, Input, InputField, InvalidSessionException, Label, Link, LinkField, MessageNotification, ModalInput, ModalInputField, Multiple, MultipleField, Notifications, Password, PasswordField, type PossibleValue, Radio, RadioField, type RadioPossibleValue, SchedulerField, Select, SelectField, type SelectPossibleValue, ShowConfirmMessage, ShowPathSelection, ShowPoolSelection, ShowSign, ShowSignSelection, StatefulEmitter, type Status, StatusNotification, type TApiaButtonProperties, type TApiaCaptchaProperties, type TApiaCheckboxProperties, type TApiaEditorProperties, type TApiaFieldBaseDefinition, type TApiaFieldCommonProperties, type TApiaFieldDefinition, type TApiaFieldPossibleValue, type TApiaFieldSizableFieldProperties, type TApiaFieldType, type TApiaFieldValueType, type TApiaFieldWithAttributeBaseProps, type TApiaFieldWithAttributeProperties, type TApiaFileProperties, type TApiaForm, type TApiaFormProperties, type TApiaGridProperties, type TApiaGroupableFieldProperties, type TApiaHiddenProperties, type TApiaImageProperties, type TApiaInputProperties, type TApiaLabelProperties, type TApiaLinkProperties, type TApiaMultipleProperties, type TApiaPasswordProperties, type TApiaRadioProperties, type TApiaSchedulerProperties, type TApiaSelectProperties, type TApiaTextareaProperties, type TApiaTitleProperties, type TApiaTranslatableFieldProperties, type TApiaTreePossibleValue, type TApiaTreeProperties, type TApiaValuatedFieldProperties, type TCheckWizardResponse, type TCusCmpStateRequest, type TCustomComponentDefaultResponse, type TCustomComponentDefinition, type TExecutionConfig, type TFetchConfirmPathResponse, type TFieldEvent, type TFieldScriptEvent, type TFieldScriptEventParameters, type TFieldScriptEvents, type TFieldServerEvent, type TFieldServerEvents, type TFormEventName, type TFormScriptEvent, type TFormScriptEventParameters, type TFormScriptEvents, type TFrmParent, type TItemTreeObj, type TObservation, type TObservations, type TPathType, type TSignaturesData, AreaField as TextAreaField, TextField, Textarea, Title, TranslatableField, Translation, Tree, TreeField, UploaderApi, createNewField, deepEqual, get, getFocusIdentifier, getLabel, isHtmlResponse, isJsonResponse, isXmlResponse, makeApiaUrl, parseFakeJSON, parseSuccessfulResponse, parseXml, post, shallowEqual };
|
|
3755
|
+
export { ActionsController, AdditionalCell, ApiaAttribute, ApiaField, ApiaFieldWithAttribute, ApiaForm, ApiaFunctions, BouncingEmitter, Button, ButtonField, Captcha, CaptchaField, CheckField, Checkbox, type ComponentEvent, CustomComponent, GridField as DataGridField, Editor, EditorField, EventEmitter, Execution, ExecutionState, Field, type FieldError, FieldWithAttribute, type FieldWithAttributeState, type FieldsMapping, File$1 as File, FileUploaderField, FlowModal, Form, FormsUploader, Grid, GridCell, GridField, GridPaginated, HeaderCell, Hidden, HiddenField, type IApiaField, type IApiaForm, type IApiaFunctions, type IIProperty, IProperty, type ISignatureData, Image, ImageField, Input, InputField, InvalidSessionException, Label, Link, LinkField, MessageNotification, ModalInput, ModalInputField, Multiple, MultipleField, Notifications, Password, PasswordField, type PossibleValue, Radio, RadioField, type RadioPossibleValue, SchedulerField, Select, SelectField, type SelectPossibleValue, ShowConfirmMessage, ShowPathSelection, ShowPoolSelection, ShowSign, ShowSignSelection, StatefulEmitter, type Status, StatusNotification, type TAdmEntityEvent, type TApiaButtonProperties, type TApiaCaptchaProperties, type TApiaCheckboxProperties, type TApiaEditorProperties, type TApiaFieldBaseDefinition, type TApiaFieldCommonProperties, type TApiaFieldDefinition, type TApiaFieldPossibleValue, type TApiaFieldSizableFieldProperties, type TApiaFieldType, type TApiaFieldValueType, type TApiaFieldWithAttributeBaseProps, type TApiaFieldWithAttributeProperties, type TApiaFileProperties, type TApiaForm, type TApiaFormProperties, type TApiaGridProperties, type TApiaGroupableFieldProperties, type TApiaHiddenProperties, type TApiaImageProperties, type TApiaInputProperties, type TApiaLabelProperties, type TApiaLinkProperties, type TApiaMultipleProperties, type TApiaPasswordProperties, type TApiaRadioProperties, type TApiaSchedulerProperties, type TApiaSelectProperties, type TApiaTextareaProperties, type TApiaTitleProperties, type TApiaTranslatableFieldProperties, type TApiaTreePossibleValue, type TApiaTreeProperties, type TApiaValuatedFieldProperties, type TCheckWizardResponse, type TConfirmEntityResponse, type TConfirmResponse, type TCusCmpStateRequest, type TCustomComponentDefaultResponse, type TCustomComponentDefinition, type TErrMessage, type TExecutionConfig, type TFetchConfirmPathResponse, type TFetchTaskActionResponse, type TFieldEvent, type TFieldScriptEvent, type TFieldScriptEventParameters, type TFieldScriptEvents, type TFieldServerEvent, type TFieldServerEvents, type TFormEventName, type TFormScriptEvent, type TFormScriptEventParameters, type TFormScriptEvents, type TFrmParent, type TItemTreeObj, type TObservation, type TObservations, type TOnClose, type TPathType, type TSignaturesData, AreaField as TextAreaField, TextField, Textarea, Title, TranslatableField, Translation, Tree, TreeField, UploaderApi, createNewField, deepEqual, get, getFocusIdentifier, getLabel, isHtmlResponse, isJsonResponse, isXmlResponse, makeApiaUrl, parseFakeJSON, parseSuccessfulResponse, parseXml, post, shallowEqual };
|
|
3706
3756
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -3053,51 +3053,50 @@ class Grid extends Field {
|
|
|
3053
3053
|
*/
|
|
3054
3054
|
async addRow() {
|
|
3055
3055
|
return this.asyncAction(async () => {
|
|
3056
|
-
if (
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
fireEvents: this.hasServerAjaxEventsOfType("gridAdd")
|
|
3065
|
-
}
|
|
3066
|
-
});
|
|
3067
|
-
const response = await res;
|
|
3068
|
-
if (response?.data?.gridXml) {
|
|
3069
|
-
const xml = parseXml(response.data.gridXml);
|
|
3070
|
-
const fieldsArray = arrayOrArray(xml.field);
|
|
3071
|
-
this.newRowStates = fieldsArray.map(
|
|
3072
|
-
(current) => current.fieldValue || current.row ? arrayOrArray(current.fieldValue || current.row) : void 0
|
|
3073
|
-
).filter(Boolean);
|
|
3074
|
-
} else {
|
|
3075
|
-
throw new Error(
|
|
3076
|
-
!getWindow(this.form.execution).SERVER_MODE ? "Something went wrong on the add row action." : ""
|
|
3077
|
-
);
|
|
3056
|
+
if (this.hasServerNoAjaxEventsOfType("gridAdd")) {
|
|
3057
|
+
await this.fireServerEvent("gridAdd", {});
|
|
3058
|
+
} else {
|
|
3059
|
+
const res = this.runAction({
|
|
3060
|
+
postData: {
|
|
3061
|
+
gridAction: "add",
|
|
3062
|
+
addRowsCount: 1,
|
|
3063
|
+
fireEvents: this.hasServerAjaxEventsOfType("gridAdd")
|
|
3078
3064
|
}
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3065
|
+
});
|
|
3066
|
+
const response = await res;
|
|
3067
|
+
if (response?.data?.gridXml) {
|
|
3068
|
+
const xml = parseXml(response.data.gridXml);
|
|
3069
|
+
const fieldsArray = arrayOrArray(xml.field);
|
|
3070
|
+
this.newRowStates = fieldsArray.map(
|
|
3071
|
+
(current) => current.fieldValue || current.row ? arrayOrArray(current.fieldValue || current.row) : void 0
|
|
3072
|
+
).filter(Boolean);
|
|
3073
|
+
} else {
|
|
3074
|
+
throw new Error(
|
|
3075
|
+
!getWindow(this.form.execution).SERVER_MODE ? "Something went wrong on the add row action." : ""
|
|
3085
3076
|
);
|
|
3086
|
-
return await (this.hasServerAjaxEventsOfType("gridAdd") ? inlineCaller : inlineTimeout)(async () => {
|
|
3087
|
-
return this.asyncAction(async () => {
|
|
3088
|
-
const evs = (await res)?.data?.eventsXml;
|
|
3089
|
-
if (evs) {
|
|
3090
|
-
setAjaxFormResponse(this.form.execution, parseXml(evs));
|
|
3091
|
-
}
|
|
3092
|
-
if (!(await res)?.data?.success) {
|
|
3093
|
-
(await addedRow).remove();
|
|
3094
|
-
return false;
|
|
3095
|
-
} else {
|
|
3096
|
-
return true;
|
|
3097
|
-
}
|
|
3098
|
-
}, !this.hasServerAjaxEventsOfType("gridAdd"));
|
|
3099
|
-
}, 0);
|
|
3100
3077
|
}
|
|
3078
|
+
const addedRow = await this.addRowFromDefinitions(
|
|
3079
|
+
true,
|
|
3080
|
+
this.fieldsDefinitions.map((c, i) => ({
|
|
3081
|
+
...c,
|
|
3082
|
+
...this.newRowStates[i][0]
|
|
3083
|
+
}))
|
|
3084
|
+
);
|
|
3085
|
+
return await (this.hasServerAjaxEventsOfType("gridAdd") ? inlineCaller : inlineTimeout)(async () => {
|
|
3086
|
+
return this.asyncAction(async () => {
|
|
3087
|
+
const evs = (await res)?.data?.eventsXml;
|
|
3088
|
+
if (evs) {
|
|
3089
|
+
setAjaxFormResponse(this.form.execution, parseXml(evs));
|
|
3090
|
+
}
|
|
3091
|
+
const scriptResult = await this.fireScriptEvent("gridAdd");
|
|
3092
|
+
if (!scriptResult || !(await res)?.data?.success) {
|
|
3093
|
+
(await addedRow).remove();
|
|
3094
|
+
return false;
|
|
3095
|
+
} else {
|
|
3096
|
+
return true;
|
|
3097
|
+
}
|
|
3098
|
+
}, !this.hasServerAjaxEventsOfType("gridAdd"));
|
|
3099
|
+
}, 0);
|
|
3101
3100
|
}
|
|
3102
3101
|
return false;
|
|
3103
3102
|
});
|
|
@@ -3145,71 +3144,70 @@ class Grid extends Field {
|
|
|
3145
3144
|
*/
|
|
3146
3145
|
async deleteRows(index) {
|
|
3147
3146
|
return this.asyncAction(async () => {
|
|
3148
|
-
if (
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3147
|
+
if (void 0 === index) {
|
|
3148
|
+
index = [...this.controller.getState("selection")].map((c) => {
|
|
3149
|
+
return c.getIndex();
|
|
3150
|
+
});
|
|
3151
|
+
} else {
|
|
3152
|
+
this.controller.setSelection(arrayOrArray(index));
|
|
3153
|
+
}
|
|
3154
|
+
const deletingIndices = arrayOrArray(index).sort((a, b) => b - a);
|
|
3155
|
+
if (this.hasServerNoAjaxEventsOfType("gridDelete")) {
|
|
3156
|
+
await this.fireServerEvent("gridDelete", {
|
|
3157
|
+
gridAction: "delete",
|
|
3158
|
+
rowId: deletingIndices
|
|
3159
|
+
});
|
|
3160
|
+
} else {
|
|
3161
|
+
let minIndex = Infinity;
|
|
3162
|
+
deletingIndices.forEach((i) => {
|
|
3163
|
+
if (i < minIndex) {
|
|
3164
|
+
minIndex = i;
|
|
3165
|
+
}
|
|
3166
|
+
});
|
|
3167
|
+
this.cache.truncate(minIndex);
|
|
3168
|
+
const res = this.runAction({
|
|
3169
|
+
postData: {
|
|
3159
3170
|
gridAction: "delete",
|
|
3160
|
-
rowId: deletingIndices
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
this.
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3171
|
+
rowId: deletingIndices,
|
|
3172
|
+
fireEvents: this.hasServerAjaxEventsOfType("gridDelete")
|
|
3173
|
+
}
|
|
3174
|
+
});
|
|
3175
|
+
const currentRows = [...this.tableController.body.rows];
|
|
3176
|
+
const currentSelection = new Set(
|
|
3177
|
+
this.tableController.getState("selection")
|
|
3178
|
+
);
|
|
3179
|
+
deletingIndices.forEach(
|
|
3180
|
+
(c) => this.controller.body.getRowByIndex(c).remove()
|
|
3181
|
+
);
|
|
3182
|
+
for (let i = minIndex; i < this.controller.body.rows.length; i++) {
|
|
3183
|
+
this.controller.body.getRowByIndex(i).cells.forEach((c) => {
|
|
3184
|
+
if (c instanceof GridCell) {
|
|
3185
|
+
c.getField().definition.index = i;
|
|
3175
3186
|
}
|
|
3176
3187
|
});
|
|
3177
|
-
const currentRows = [...this.tableController.body.rows];
|
|
3178
|
-
const currentSelection = new Set(
|
|
3179
|
-
this.tableController.getState("selection")
|
|
3180
|
-
);
|
|
3181
|
-
deletingIndices.forEach(
|
|
3182
|
-
(c) => this.controller.body.getRowByIndex(c).remove()
|
|
3183
|
-
);
|
|
3184
|
-
for (let i = minIndex; i < this.controller.body.rows.length; i++) {
|
|
3185
|
-
this.controller.body.getRowByIndex(i).cells.forEach((c) => {
|
|
3186
|
-
if (c instanceof GridCell) {
|
|
3187
|
-
c.getField().definition.index = i;
|
|
3188
|
-
}
|
|
3189
|
-
});
|
|
3190
|
-
}
|
|
3191
|
-
this.tableController.clearSelection();
|
|
3192
|
-
if (this.tableController.body.rows.length === 0 && this.getProperty("includeFirstRow")) {
|
|
3193
|
-
await res;
|
|
3194
|
-
await this.actualRefreshAction();
|
|
3195
|
-
}
|
|
3196
|
-
(this.tableController.body.getRowByIndex(minIndex) || this.tableController.body.getRowByIndex(minIndex - 1))?.toggleSelection(true);
|
|
3197
|
-
(this.tableController.body.getRowByIndex(minIndex) || this.tableController.body.getRowByIndex(minIndex - 1) || this.tableController.head.getRowByIndex(0)).scrollIntoView();
|
|
3198
|
-
return await (this.hasServerAjaxEventsOfType("gridDelete") ? inlineCaller : inlineTimeout)(async () => {
|
|
3199
|
-
return this.asyncAction(async () => {
|
|
3200
|
-
const evs = (await res)?.data?.eventsXml;
|
|
3201
|
-
if (evs) {
|
|
3202
|
-
setAjaxFormResponse(this.form.execution, parseXml(evs));
|
|
3203
|
-
}
|
|
3204
|
-
if (!(await res)?.data?.success) {
|
|
3205
|
-
this.tableController.body.setState("rows", currentRows);
|
|
3206
|
-
this.tableController.setState("selection", currentSelection);
|
|
3207
|
-
return false;
|
|
3208
|
-
}
|
|
3209
|
-
return true;
|
|
3210
|
-
}, !this.hasServerAjaxEventsOfType("gridDelete"));
|
|
3211
|
-
}, 0);
|
|
3212
3188
|
}
|
|
3189
|
+
this.tableController.clearSelection();
|
|
3190
|
+
if (this.tableController.body.rows.length === 0 && this.getProperty("includeFirstRow")) {
|
|
3191
|
+
await res;
|
|
3192
|
+
await this.actualRefreshAction();
|
|
3193
|
+
}
|
|
3194
|
+
(this.tableController.body.getRowByIndex(minIndex) || this.tableController.body.getRowByIndex(minIndex - 1))?.toggleSelection(true);
|
|
3195
|
+
(this.tableController.body.getRowByIndex(minIndex) || this.tableController.body.getRowByIndex(minIndex - 1) || this.tableController.head.getRowByIndex(0)).scrollIntoView();
|
|
3196
|
+
return await (this.hasServerAjaxEventsOfType("gridDelete") ? inlineCaller : inlineTimeout)(async () => {
|
|
3197
|
+
return this.asyncAction(async () => {
|
|
3198
|
+
const evs = (await res)?.data?.eventsXml;
|
|
3199
|
+
if (evs) {
|
|
3200
|
+
setAjaxFormResponse(this.form.execution, parseXml(evs));
|
|
3201
|
+
}
|
|
3202
|
+
const scriptResult = await this.fireScriptEvent("gridAdd");
|
|
3203
|
+
if (!scriptResult || !(await res)?.data?.success) {
|
|
3204
|
+
this.tableController.body.setState("rows", currentRows);
|
|
3205
|
+
this.tableController.setState("selection", currentSelection);
|
|
3206
|
+
return false;
|
|
3207
|
+
}
|
|
3208
|
+
return true;
|
|
3209
|
+
}, !this.hasServerAjaxEventsOfType("gridDelete"));
|
|
3210
|
+
}, 0);
|
|
3213
3211
|
}
|
|
3214
3212
|
return false;
|
|
3215
3213
|
});
|
|
@@ -3340,6 +3338,7 @@ class Grid extends Field {
|
|
|
3340
3338
|
}
|
|
3341
3339
|
async init(form) {
|
|
3342
3340
|
await super.init(form);
|
|
3341
|
+
this.state.isMaximized = localStorage.getItem(`${this.definition.id}__isMaximized`) === "true";
|
|
3343
3342
|
const headerRow = new Row("header");
|
|
3344
3343
|
if (this.properties.gridForm || !this.properties.hideDelButton && !this.properties.readonly && !this.properties.inputAsText && !this.getForm().definition.readOnly && !this.getForm().definition.readonly)
|
|
3345
3344
|
headerRow.addCell(
|
|
@@ -3414,78 +3413,76 @@ class Grid extends Field {
|
|
|
3414
3413
|
}
|
|
3415
3414
|
async sortDown(index) {
|
|
3416
3415
|
return this.asyncAction(async () => {
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3416
|
+
const indices = arrayOrArray(index || this.selectedIndices).sort(
|
|
3417
|
+
(a, b) => b - a
|
|
3418
|
+
);
|
|
3419
|
+
if (this.hasServerNoAjaxEventsOfType("gridSort")) {
|
|
3420
|
+
await this.fireServerEvent("gridSort", {
|
|
3421
|
+
gridAction: "down",
|
|
3422
|
+
rowId: indices
|
|
3423
|
+
});
|
|
3424
|
+
} else {
|
|
3425
|
+
const currentRows = [...this.tableController.body.rows];
|
|
3426
|
+
const res = this.runAction({
|
|
3427
|
+
postData: {
|
|
3423
3428
|
gridAction: "down",
|
|
3424
|
-
rowId: indices
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3429
|
+
rowId: indices,
|
|
3430
|
+
fireEvents: this.hasServerAjaxEventsOfType("gridSort")
|
|
3431
|
+
}
|
|
3432
|
+
});
|
|
3433
|
+
this.swapRows(indices, "down");
|
|
3434
|
+
return await (this.hasServerAjaxEventsOfType("gridSort") ? inlineCaller : inlineTimeout)(() => {
|
|
3435
|
+
return this.asyncAction(async () => {
|
|
3436
|
+
const evs = (await res)?.data?.eventsXml;
|
|
3437
|
+
if (evs) {
|
|
3438
|
+
setAjaxFormResponse(this.form.execution, parseXml(evs));
|
|
3433
3439
|
}
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
if (!(await res)?.data?.success || !await this.fireEvent("gridSort", { mutex: false })) {
|
|
3443
|
-
this.tableController.body.setState("rows", currentRows);
|
|
3444
|
-
return false;
|
|
3445
|
-
}
|
|
3446
|
-
return true;
|
|
3447
|
-
}, !this.hasServerAjaxEventsOfType("gridSort"));
|
|
3448
|
-
}, 0);
|
|
3449
|
-
}
|
|
3440
|
+
const scriptEvent = await this.fireScriptEvent("gridSort");
|
|
3441
|
+
if (!scriptEvent || !(await res)?.data?.success || !await this.fireEvent("gridSort", { mutex: false })) {
|
|
3442
|
+
this.tableController.body.setState("rows", currentRows);
|
|
3443
|
+
return false;
|
|
3444
|
+
}
|
|
3445
|
+
return true;
|
|
3446
|
+
}, !this.hasServerAjaxEventsOfType("gridSort"));
|
|
3447
|
+
}, 0);
|
|
3450
3448
|
}
|
|
3451
3449
|
return false;
|
|
3452
3450
|
});
|
|
3453
3451
|
}
|
|
3454
3452
|
async sortUp(index) {
|
|
3455
3453
|
return this.asyncAction(async () => {
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3454
|
+
const indices = arrayOrArray(index || this.selectedIndices).sort(
|
|
3455
|
+
(a, b) => a - b
|
|
3456
|
+
);
|
|
3457
|
+
if (this.hasServerNoAjaxEventsOfType("gridSort")) {
|
|
3458
|
+
await this.fireServerEvent("gridSort", {
|
|
3459
|
+
gridAction: "down",
|
|
3460
|
+
rowId: indices
|
|
3461
|
+
});
|
|
3462
|
+
} else {
|
|
3463
|
+
const currentRows = [...this.tableController.body.rows];
|
|
3464
|
+
const res = this.runAction({
|
|
3465
|
+
postData: {
|
|
3466
|
+
gridAction: "up",
|
|
3467
|
+
rowId: indices,
|
|
3468
|
+
fireEvents: this.hasServerAjaxEventsOfType("gridSort")
|
|
3469
|
+
}
|
|
3470
|
+
});
|
|
3471
|
+
this.swapRows(indices, "up");
|
|
3472
|
+
return await (this.hasServerAjaxEventsOfType("gridSort") ? inlineCaller : inlineTimeout)(() => {
|
|
3473
|
+
return this.asyncAction(async () => {
|
|
3474
|
+
const evs = (await res)?.data?.eventsXml;
|
|
3475
|
+
if (evs) {
|
|
3476
|
+
setAjaxFormResponse(this.form.execution, parseXml(evs));
|
|
3472
3477
|
}
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
if (!(await res)?.data?.success || !await this.fireEvent("gridSort", { mutex: false })) {
|
|
3482
|
-
this.tableController.body.setState("rows", currentRows);
|
|
3483
|
-
return false;
|
|
3484
|
-
}
|
|
3485
|
-
return true;
|
|
3486
|
-
}, !this.hasServerAjaxEventsOfType("gridSort"));
|
|
3487
|
-
}, 0);
|
|
3488
|
-
}
|
|
3478
|
+
const scriptEvent = await this.fireScriptEvent("gridSort");
|
|
3479
|
+
if (!scriptEvent || !(await res)?.data?.success || !await this.fireEvent("gridSort", { mutex: false })) {
|
|
3480
|
+
this.tableController.body.setState("rows", currentRows);
|
|
3481
|
+
return false;
|
|
3482
|
+
}
|
|
3483
|
+
return true;
|
|
3484
|
+
}, !this.hasServerAjaxEventsOfType("gridSort"));
|
|
3485
|
+
}, 0);
|
|
3489
3486
|
}
|
|
3490
3487
|
return false;
|
|
3491
3488
|
});
|
|
@@ -3752,6 +3749,10 @@ class Grid extends Field {
|
|
|
3752
3749
|
}
|
|
3753
3750
|
toggleMaximize() {
|
|
3754
3751
|
this.state.isMaximized = !this.state.isMaximized;
|
|
3752
|
+
localStorage.setItem(
|
|
3753
|
+
`${this.definition.id}__isMaximized`,
|
|
3754
|
+
String(this.state.isMaximized)
|
|
3755
|
+
);
|
|
3755
3756
|
}
|
|
3756
3757
|
}
|
|
3757
3758
|
|
|
@@ -4826,18 +4827,8 @@ class SelectField extends ApiaFieldWithAttribute {
|
|
|
4826
4827
|
__privateAdd$f(this, _field$b, void 0);
|
|
4827
4828
|
__privateSet$f(this, _field$b, field);
|
|
4828
4829
|
}
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
if (__privateGet$f(this, _field$b).definition.id) {
|
|
4832
|
-
const options = arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue);
|
|
4833
|
-
const obj = /* @__PURE__ */ new Map();
|
|
4834
|
-
if (asObject) {
|
|
4835
|
-
options.forEach((c) => obj.set(String(c.value), c));
|
|
4836
|
-
return obj;
|
|
4837
|
-
}
|
|
4838
|
-
return options;
|
|
4839
|
-
}
|
|
4840
|
-
return null;
|
|
4830
|
+
getOptions() {
|
|
4831
|
+
return arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue);
|
|
4841
4832
|
}
|
|
4842
4833
|
getTextValue(value) {
|
|
4843
4834
|
return __privateGet$f(this, _field$b).getTextValue(value);
|
|
@@ -5022,17 +5013,8 @@ class RadioField extends ApiaFieldWithAttribute {
|
|
|
5022
5013
|
__privateAdd$c(this, _field$8, void 0);
|
|
5023
5014
|
__privateSet$c(this, _field$8, field);
|
|
5024
5015
|
}
|
|
5025
|
-
getOptions(
|
|
5026
|
-
|
|
5027
|
-
const radioValues = arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue);
|
|
5028
|
-
if (asObject) {
|
|
5029
|
-
const options = /* @__PURE__ */ new Map();
|
|
5030
|
-
radioValues.forEach((c) => options.set(String(c.value), c));
|
|
5031
|
-
return options;
|
|
5032
|
-
}
|
|
5033
|
-
return radioValues;
|
|
5034
|
-
}
|
|
5035
|
-
return null;
|
|
5016
|
+
getOptions() {
|
|
5017
|
+
return arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue);
|
|
5036
5018
|
}
|
|
5037
5019
|
clearOptions() {
|
|
5038
5020
|
if (__privateGet$c(this, _field$8).definition.id) {
|
|
@@ -5163,17 +5145,8 @@ class MultipleField extends ApiaFieldWithAttribute {
|
|
|
5163
5145
|
}
|
|
5164
5146
|
return null;
|
|
5165
5147
|
}
|
|
5166
|
-
getOptions(
|
|
5167
|
-
|
|
5168
|
-
const options = arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue);
|
|
5169
|
-
const obj = /* @__PURE__ */ new Map();
|
|
5170
|
-
if (asObject) {
|
|
5171
|
-
options.forEach((c) => obj.set(String(c.value), c));
|
|
5172
|
-
return obj;
|
|
5173
|
-
}
|
|
5174
|
-
return options;
|
|
5175
|
-
}
|
|
5176
|
-
return null;
|
|
5148
|
+
getOptions() {
|
|
5149
|
+
return arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue);
|
|
5177
5150
|
}
|
|
5178
5151
|
setOptions(optionsArray) {
|
|
5179
5152
|
if (__privateGet$b(this, _field$7).definition.id) {
|
|
@@ -5190,7 +5163,7 @@ class MultipleField extends ApiaFieldWithAttribute {
|
|
|
5190
5163
|
}
|
|
5191
5164
|
_field$7 = new WeakMap();
|
|
5192
5165
|
|
|
5193
|
-
class HiddenField extends
|
|
5166
|
+
class HiddenField extends ApiaFieldWithAttribute {
|
|
5194
5167
|
}
|
|
5195
5168
|
|
|
5196
5169
|
class AreaField extends ApiaFieldWithAttribute {
|
|
@@ -5321,6 +5294,9 @@ class TextField extends ApiaField {
|
|
|
5321
5294
|
setValue(value) {
|
|
5322
5295
|
this.setProperty("value", value);
|
|
5323
5296
|
}
|
|
5297
|
+
getValue() {
|
|
5298
|
+
return __privateGet$8(this, _field$4).properties.value;
|
|
5299
|
+
}
|
|
5324
5300
|
}
|
|
5325
5301
|
_field$4 = new WeakMap();
|
|
5326
5302
|
|
|
@@ -5675,6 +5651,9 @@ class FileUploaderField extends ApiaFieldWithAttribute {
|
|
|
5675
5651
|
async downloadDocument() {
|
|
5676
5652
|
await __privateGet$5(this, _field$1).downloadDocument();
|
|
5677
5653
|
}
|
|
5654
|
+
getValue() {
|
|
5655
|
+
return __privateGet$5(this, _field$1).uploader?.filesArray?.[0]?.docName ?? "";
|
|
5656
|
+
}
|
|
5678
5657
|
}
|
|
5679
5658
|
_field$1 = new WeakMap();
|
|
5680
5659
|
|
|
@@ -5869,6 +5848,13 @@ class ApiaFunctions {
|
|
|
5869
5848
|
return null;
|
|
5870
5849
|
}
|
|
5871
5850
|
admEntity(entName, entNum, parameters, width, height) {
|
|
5851
|
+
__privateGet$2(this, _execution).emit("adminEntity", {
|
|
5852
|
+
entName,
|
|
5853
|
+
entNum,
|
|
5854
|
+
parameters,
|
|
5855
|
+
width,
|
|
5856
|
+
height
|
|
5857
|
+
});
|
|
5872
5858
|
}
|
|
5873
5859
|
clearMessages() {
|
|
5874
5860
|
}
|
|
@@ -6014,7 +6000,7 @@ class ApiaFunctions {
|
|
|
6014
6000
|
ActionsController.instance.show(id);
|
|
6015
6001
|
}
|
|
6016
6002
|
viewAdmEntity(entName, entNum) {
|
|
6017
|
-
this.admEntity(entName, entNum);
|
|
6003
|
+
this.admEntity(entName, entNum, { viewMode: "true" });
|
|
6018
6004
|
}
|
|
6019
6005
|
changeTab(index) {
|
|
6020
6006
|
if (window.tabsController)
|
|
@@ -8133,6 +8119,7 @@ class Execution extends EventEmitter$1 {
|
|
|
8133
8119
|
(c) => this.notifications.add(
|
|
8134
8120
|
new MessageNotification({
|
|
8135
8121
|
message: c.text,
|
|
8122
|
+
title: c.title,
|
|
8136
8123
|
type: parseNotificationType(c.type)
|
|
8137
8124
|
})
|
|
8138
8125
|
)
|