@apia/execution 4.0.58 → 4.0.60
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 +53 -6
- package/dist/index.js +177 -201
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1105,11 +1105,10 @@ declare class EditorField extends ApiaFieldWithAttribute {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
1107
1107
|
type TOptionsMap$2 = Map<string, PossibleValue>;
|
|
1108
|
-
type TOptionsAsArray = PossibleValue[];
|
|
1109
1108
|
declare class SelectField extends ApiaFieldWithAttribute<string | number | (string | number)[]> {
|
|
1110
1109
|
#private;
|
|
1111
1110
|
constructor(execution: Execution, field: Select);
|
|
1112
|
-
getOptions(
|
|
1111
|
+
getOptions(): SelectPossibleValue[];
|
|
1113
1112
|
getTextValue(value: string): any;
|
|
1114
1113
|
addOption(optionValue: string | number, showValue: string, allowRepeatedValue: boolean): void;
|
|
1115
1114
|
setOptions(optionsArray: PossibleValue[]): void;
|
|
@@ -1141,7 +1140,7 @@ type TOptionsMap$1 = Map<string, PossibleValue>;
|
|
|
1141
1140
|
declare class RadioField extends ApiaFieldWithAttribute {
|
|
1142
1141
|
#private;
|
|
1143
1142
|
constructor(execution: Execution, field: Radio);
|
|
1144
|
-
getOptions(
|
|
1143
|
+
getOptions(): RadioPossibleValue[];
|
|
1145
1144
|
clearOptions(): void | null;
|
|
1146
1145
|
getTextValue(value: string): any;
|
|
1147
1146
|
addOption(radioValue: string | number, showValue: string, allowRepeatedValue: boolean): void;
|
|
@@ -1159,12 +1158,12 @@ declare class MultipleField extends ApiaFieldWithAttribute<string[]> {
|
|
|
1159
1158
|
setValue(value: string[]): void;
|
|
1160
1159
|
clearOptions(): void;
|
|
1161
1160
|
getSelectedOption(asObject: boolean): TOptionsMap | PossibleValue[] | null;
|
|
1162
|
-
getOptions(
|
|
1161
|
+
getOptions(): SelectPossibleValue[];
|
|
1163
1162
|
setOptions(optionsArray: PossibleValue[]): void;
|
|
1164
1163
|
removeOption(optionValue: string | number): void;
|
|
1165
1164
|
}
|
|
1166
1165
|
|
|
1167
|
-
declare class HiddenField extends
|
|
1166
|
+
declare class HiddenField extends ApiaFieldWithAttribute {
|
|
1168
1167
|
}
|
|
1169
1168
|
|
|
1170
1169
|
declare class AreaField extends ApiaFieldWithAttribute {
|
|
@@ -1937,12 +1936,59 @@ type TFetchTaskActionResponse = {
|
|
|
1937
1936
|
label?: string;
|
|
1938
1937
|
};
|
|
1939
1938
|
};
|
|
1939
|
+
type TConfirmResponse = {
|
|
1940
|
+
onClose: string;
|
|
1941
|
+
pathSelection?: boolean | null;
|
|
1942
|
+
groupSelection?: boolean | null;
|
|
1943
|
+
load?: TApiaLoadForm & {
|
|
1944
|
+
type: 'form' | 'text' | 'table' | 'function';
|
|
1945
|
+
canClose: boolean;
|
|
1946
|
+
text?: {
|
|
1947
|
+
closeAll: string;
|
|
1948
|
+
title: string;
|
|
1949
|
+
addClass: string;
|
|
1950
|
+
label: string;
|
|
1951
|
+
};
|
|
1952
|
+
};
|
|
1953
|
+
actions?: {
|
|
1954
|
+
action: {
|
|
1955
|
+
toDo: 'functionTimedCall';
|
|
1956
|
+
param: [number, string];
|
|
1957
|
+
};
|
|
1958
|
+
};
|
|
1959
|
+
};
|
|
1960
|
+
type TConfirmEntityResponse = {
|
|
1961
|
+
onClose: string;
|
|
1962
|
+
load?: TApiaLoadForm & {
|
|
1963
|
+
type: 'form' | 'text' | 'table' | 'function';
|
|
1964
|
+
canClose: boolean;
|
|
1965
|
+
text?: {
|
|
1966
|
+
closeAll: string;
|
|
1967
|
+
title: string;
|
|
1968
|
+
addClass: string;
|
|
1969
|
+
label?: string;
|
|
1970
|
+
};
|
|
1971
|
+
};
|
|
1972
|
+
actions?: {
|
|
1973
|
+
action: {
|
|
1974
|
+
toDo: 'functionTimedCall';
|
|
1975
|
+
param: string[];
|
|
1976
|
+
};
|
|
1977
|
+
};
|
|
1978
|
+
};
|
|
1940
1979
|
type FieldError = {
|
|
1941
1980
|
id: string;
|
|
1942
1981
|
errorMessage: string;
|
|
1943
1982
|
title: string;
|
|
1944
1983
|
focus: string;
|
|
1945
1984
|
};
|
|
1985
|
+
type TAdmEntityEvent = {
|
|
1986
|
+
entName: string;
|
|
1987
|
+
entNum?: number;
|
|
1988
|
+
parameters?: string;
|
|
1989
|
+
width?: number;
|
|
1990
|
+
height?: number;
|
|
1991
|
+
};
|
|
1946
1992
|
|
|
1947
1993
|
declare class Form extends WithProperties<TApiaFormProperties> {
|
|
1948
1994
|
execution: Execution;
|
|
@@ -2707,6 +2753,7 @@ declare class Execution extends EventEmitter$1<{
|
|
|
2707
2753
|
componentName: string;
|
|
2708
2754
|
el: HTMLElement;
|
|
2709
2755
|
};
|
|
2756
|
+
adminEntity: TAdmEntityEvent;
|
|
2710
2757
|
}> {
|
|
2711
2758
|
environment: TExecutionEnvironment;
|
|
2712
2759
|
renderers?: TModalConfig['renderers'];
|
|
@@ -3702,5 +3749,5 @@ declare function parseFakeJSON<T extends Record<string, unknown>>(str: string):
|
|
|
3702
3749
|
|
|
3703
3750
|
declare function getFocusIdentifier(field: Field): string;
|
|
3704
3751
|
|
|
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 };
|
|
3752
|
+
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
3753
|
//# 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
|
});
|
|
@@ -3414,78 +3412,76 @@ class Grid extends Field {
|
|
|
3414
3412
|
}
|
|
3415
3413
|
async sortDown(index) {
|
|
3416
3414
|
return this.asyncAction(async () => {
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3415
|
+
const indices = arrayOrArray(index || this.selectedIndices).sort(
|
|
3416
|
+
(a, b) => b - a
|
|
3417
|
+
);
|
|
3418
|
+
if (this.hasServerNoAjaxEventsOfType("gridSort")) {
|
|
3419
|
+
await this.fireServerEvent("gridSort", {
|
|
3420
|
+
gridAction: "down",
|
|
3421
|
+
rowId: indices
|
|
3422
|
+
});
|
|
3423
|
+
} else {
|
|
3424
|
+
const currentRows = [...this.tableController.body.rows];
|
|
3425
|
+
const res = this.runAction({
|
|
3426
|
+
postData: {
|
|
3423
3427
|
gridAction: "down",
|
|
3424
|
-
rowId: indices
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3428
|
+
rowId: indices,
|
|
3429
|
+
fireEvents: this.hasServerAjaxEventsOfType("gridSort")
|
|
3430
|
+
}
|
|
3431
|
+
});
|
|
3432
|
+
this.swapRows(indices, "down");
|
|
3433
|
+
return await (this.hasServerAjaxEventsOfType("gridSort") ? inlineCaller : inlineTimeout)(() => {
|
|
3434
|
+
return this.asyncAction(async () => {
|
|
3435
|
+
const evs = (await res)?.data?.eventsXml;
|
|
3436
|
+
if (evs) {
|
|
3437
|
+
setAjaxFormResponse(this.form.execution, parseXml(evs));
|
|
3433
3438
|
}
|
|
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
|
-
}
|
|
3439
|
+
const scriptEvent = await this.fireScriptEvent("gridSort");
|
|
3440
|
+
if (!scriptEvent || !(await res)?.data?.success || !await this.fireEvent("gridSort", { mutex: false })) {
|
|
3441
|
+
this.tableController.body.setState("rows", currentRows);
|
|
3442
|
+
return false;
|
|
3443
|
+
}
|
|
3444
|
+
return true;
|
|
3445
|
+
}, !this.hasServerAjaxEventsOfType("gridSort"));
|
|
3446
|
+
}, 0);
|
|
3450
3447
|
}
|
|
3451
3448
|
return false;
|
|
3452
3449
|
});
|
|
3453
3450
|
}
|
|
3454
3451
|
async sortUp(index) {
|
|
3455
3452
|
return this.asyncAction(async () => {
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3453
|
+
const indices = arrayOrArray(index || this.selectedIndices).sort(
|
|
3454
|
+
(a, b) => a - b
|
|
3455
|
+
);
|
|
3456
|
+
if (this.hasServerNoAjaxEventsOfType("gridSort")) {
|
|
3457
|
+
await this.fireServerEvent("gridSort", {
|
|
3458
|
+
gridAction: "down",
|
|
3459
|
+
rowId: indices
|
|
3460
|
+
});
|
|
3461
|
+
} else {
|
|
3462
|
+
const currentRows = [...this.tableController.body.rows];
|
|
3463
|
+
const res = this.runAction({
|
|
3464
|
+
postData: {
|
|
3465
|
+
gridAction: "up",
|
|
3466
|
+
rowId: indices,
|
|
3467
|
+
fireEvents: this.hasServerAjaxEventsOfType("gridSort")
|
|
3468
|
+
}
|
|
3469
|
+
});
|
|
3470
|
+
this.swapRows(indices, "up");
|
|
3471
|
+
return await (this.hasServerAjaxEventsOfType("gridSort") ? inlineCaller : inlineTimeout)(() => {
|
|
3472
|
+
return this.asyncAction(async () => {
|
|
3473
|
+
const evs = (await res)?.data?.eventsXml;
|
|
3474
|
+
if (evs) {
|
|
3475
|
+
setAjaxFormResponse(this.form.execution, parseXml(evs));
|
|
3472
3476
|
}
|
|
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
|
-
}
|
|
3477
|
+
const scriptEvent = await this.fireScriptEvent("gridSort");
|
|
3478
|
+
if (!scriptEvent || !(await res)?.data?.success || !await this.fireEvent("gridSort", { mutex: false })) {
|
|
3479
|
+
this.tableController.body.setState("rows", currentRows);
|
|
3480
|
+
return false;
|
|
3481
|
+
}
|
|
3482
|
+
return true;
|
|
3483
|
+
}, !this.hasServerAjaxEventsOfType("gridSort"));
|
|
3484
|
+
}, 0);
|
|
3489
3485
|
}
|
|
3490
3486
|
return false;
|
|
3491
3487
|
});
|
|
@@ -4826,18 +4822,8 @@ class SelectField extends ApiaFieldWithAttribute {
|
|
|
4826
4822
|
__privateAdd$f(this, _field$b, void 0);
|
|
4827
4823
|
__privateSet$f(this, _field$b, field);
|
|
4828
4824
|
}
|
|
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;
|
|
4825
|
+
getOptions() {
|
|
4826
|
+
return arrayOrArray(__privateGet$f(this, _field$b).properties.possibleValue);
|
|
4841
4827
|
}
|
|
4842
4828
|
getTextValue(value) {
|
|
4843
4829
|
return __privateGet$f(this, _field$b).getTextValue(value);
|
|
@@ -5022,17 +5008,8 @@ class RadioField extends ApiaFieldWithAttribute {
|
|
|
5022
5008
|
__privateAdd$c(this, _field$8, void 0);
|
|
5023
5009
|
__privateSet$c(this, _field$8, field);
|
|
5024
5010
|
}
|
|
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;
|
|
5011
|
+
getOptions() {
|
|
5012
|
+
return arrayOrArray(__privateGet$c(this, _field$8).properties.possibleValue);
|
|
5036
5013
|
}
|
|
5037
5014
|
clearOptions() {
|
|
5038
5015
|
if (__privateGet$c(this, _field$8).definition.id) {
|
|
@@ -5163,17 +5140,8 @@ class MultipleField extends ApiaFieldWithAttribute {
|
|
|
5163
5140
|
}
|
|
5164
5141
|
return null;
|
|
5165
5142
|
}
|
|
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;
|
|
5143
|
+
getOptions() {
|
|
5144
|
+
return arrayOrArray(__privateGet$b(this, _field$7).properties.possibleValue);
|
|
5177
5145
|
}
|
|
5178
5146
|
setOptions(optionsArray) {
|
|
5179
5147
|
if (__privateGet$b(this, _field$7).definition.id) {
|
|
@@ -5190,7 +5158,7 @@ class MultipleField extends ApiaFieldWithAttribute {
|
|
|
5190
5158
|
}
|
|
5191
5159
|
_field$7 = new WeakMap();
|
|
5192
5160
|
|
|
5193
|
-
class HiddenField extends
|
|
5161
|
+
class HiddenField extends ApiaFieldWithAttribute {
|
|
5194
5162
|
}
|
|
5195
5163
|
|
|
5196
5164
|
class AreaField extends ApiaFieldWithAttribute {
|
|
@@ -5869,6 +5837,13 @@ class ApiaFunctions {
|
|
|
5869
5837
|
return null;
|
|
5870
5838
|
}
|
|
5871
5839
|
admEntity(entName, entNum, parameters, width, height) {
|
|
5840
|
+
__privateGet$2(this, _execution).emit("adminEntity", {
|
|
5841
|
+
entName,
|
|
5842
|
+
entNum,
|
|
5843
|
+
parameters,
|
|
5844
|
+
width,
|
|
5845
|
+
height
|
|
5846
|
+
});
|
|
5872
5847
|
}
|
|
5873
5848
|
clearMessages() {
|
|
5874
5849
|
}
|
|
@@ -8133,6 +8108,7 @@ class Execution extends EventEmitter$1 {
|
|
|
8133
8108
|
(c) => this.notifications.add(
|
|
8134
8109
|
new MessageNotification({
|
|
8135
8110
|
message: c.text,
|
|
8111
|
+
title: c.title,
|
|
8136
8112
|
type: parseNotificationType(c.type)
|
|
8137
8113
|
})
|
|
8138
8114
|
)
|