@apia/execution 4.0.20 → 4.0.25

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 CHANGED
@@ -450,18 +450,14 @@ type TCusCmpStateRequest = {
450
450
  type: 'RELOAD' | 'FIRE';
451
451
  content: string;
452
452
  }[];
453
- additional?: {
454
- text: string;
455
- };
453
+ additional?: string;
454
+ result?: any;
456
455
  };
457
456
  type TCustomComponentDefaultResponse = {
458
457
  processResult?: {
459
458
  state: TCusCmpStateRequest;
460
459
  };
461
- state?: TCusCmpStateRequest;
462
- ajaxUpdated?: {
463
- text: string;
464
- };
460
+ ajaxUpdated?: string;
465
461
  };
466
462
  type TCustomComponentDefinition = {
467
463
  name: string;
@@ -609,6 +605,7 @@ declare abstract class FieldWithAttribute<FieldProps extends TApiaFieldWithAttri
609
605
  protected getSynchronizeUrl(params?: Record<string, unknown>): string;
610
606
  protected processSynchronizeError(e: unknown): void;
611
607
  protected synchronize(newValue: ValueType): Promise<boolean>;
608
+ protected hasValue(): boolean;
612
609
  protected isValidValue(): boolean;
613
610
  validate(): Promise<boolean>;
614
611
  setError(err: string): void;
@@ -633,18 +630,33 @@ declare class CustomComponent {
633
630
  getAdditional<T>(): DeepReadonly<T>;
634
631
  init(form: Form): Promise<void>;
635
632
  private parseStateObject;
636
- processResult(res?: TCustomComponentDefaultResponse | null): Promise<void>;
633
+ processResult<Result extends Record<string, unknown> = Record<string, unknown>>(res?: TCustomComponentDefaultResponse | null): Promise<(Result & {
634
+ success: boolean;
635
+ }) | undefined>;
637
636
  protected getScriptEventParams(fncParams: TFncParams[]): unknown[];
638
637
  protected fireScriptEvents(event: ComponentEvent): Promise<boolean>;
639
- fireEvent(evtName: string): Promise<void>;
638
+ fireEvent(evtName: string): Promise<boolean>;
640
639
  getProperty(prpName: string): any;
641
640
  private postMessage;
642
- setStringValue(attName: string, value: string): Promise<void>;
641
+ setStringValue(attName: string, value: string): Promise<boolean>;
643
642
  getStringValue(attName: string): string;
644
643
  getValue(attName: string, index?: number): any;
645
- setValue(attName: string, value: any, index: number): Promise<void>;
646
- setProperty(prpName: string, value: any): Promise<void>;
647
- sendMessage(payload: any): Promise<void>;
644
+ getValues(attName: string): any[];
645
+ removeIndex(attName: string, index: number): Promise<boolean>;
646
+ setValue(attName: string, value: any, index: number): Promise<boolean>;
647
+ setProperty(prpName: string, value: any): Promise<boolean>;
648
+ sendMessage<T extends Record<string, unknown> = Record<string, unknown>>(payload: any): Promise<(T & {
649
+ success: boolean;
650
+ }) | undefined>;
651
+ upload(attName: string, file: File, options?: {
652
+ onUploadProgress?: (percent: number) => unknown;
653
+ params?: Record<string, any>;
654
+ } & Pick<AxiosRequestConfig<any>, 'signal'>): Promise<({
655
+ index: number;
656
+ fileName: string;
657
+ } & {
658
+ success: boolean;
659
+ }) | undefined>;
648
660
  }
649
661
 
650
662
  declare class Form extends WithProperties<TApiaFormProperties> {
@@ -901,6 +913,7 @@ type TProcess = {
901
913
  * nombre.
902
914
  */
903
915
  declare function returnExactlyTheSame(defaultParameters: Record<string, unknown>): Record<string, unknown>;
916
+ declare function isOneClickUploadEnabled(oneClickUploadProp?: boolean): string | boolean;
904
917
  declare const parseFileDefinition: (execution: Execution, fileDefinition: TFileUploaded | TUploaderFileInfo, isSignRequired: boolean) => TUploaderFileInfo;
905
918
  type TOnUploadProgress = (progress: number) => void;
906
919
  declare class UploaderApi extends EventEmitter$1<{
@@ -924,7 +937,7 @@ declare class UploaderApi extends EventEmitter$1<{
924
937
  onTranslateUpload(conf: {
925
938
  langId: number;
926
939
  translatingFile: TUploaderFileInfo;
927
- }): Promise<void>;
940
+ }, files?: File[]): Promise<void>;
928
941
  onVersionUpload(file: TUploaderFileInfo, conf?: {
929
942
  newFiles?: File[];
930
943
  langId?: number;
@@ -1357,7 +1370,7 @@ declare class FormsUploader extends UploaderApi {
1357
1370
  execution: Execution;
1358
1371
  type: 'E' | 'P';
1359
1372
  modalConfig: TModalConfig;
1360
- private field;
1373
+ field: File$1;
1361
1374
  constructor(execution: Execution, type: 'E' | 'P', modalConfig: TModalConfig, field: File$1);
1362
1375
  isEditionMode: boolean | undefined;
1363
1376
  index(): number;
@@ -2688,6 +2701,7 @@ type ModalInputValue = {
2688
2701
  declare class ModalInput extends FieldWithAttribute<TApiaInputProperties, ModalInputValue> {
2689
2702
  constructor({ value, ...definition }: TApiaModalInputDefinition);
2690
2703
  fireEvent(eventName: InputEvents): Promise<boolean>;
2704
+ protected hasValue(): boolean;
2691
2705
  setValueFromInputWrite(value: string): Promise<void>;
2692
2706
  setValueFromModalSelection(rowId: string): Promise<void>;
2693
2707
  validate(): Promise<boolean>;
@@ -2696,6 +2710,7 @@ declare class ModalInput extends FieldWithAttribute<TApiaInputProperties, ModalI
2696
2710
 
2697
2711
  declare class Multiple extends FieldWithAttribute<TApiaMultipleProperties, string[]> {
2698
2712
  constructor({ possibleValue, value, ...definition }: TApiaMultipleDefinition);
2713
+ protected hasValue(): boolean;
2699
2714
  setValue(newValue: string[], options?: Partial<{
2700
2715
  comparator: Comparator$1<any>;
2701
2716
  format: 'd/m/Y' | 'apia';
@@ -2736,6 +2751,7 @@ declare class Tree extends FieldWithAttribute<TApiaTreeProperties, TTreeValue[],
2736
2751
  constructor({ possibleValue, ...props }: TApiaTreeDefinition);
2737
2752
  protected getSynchronizePostConfiguration(value: TTreeValue[]): IApiaApiPostConfig<any>;
2738
2753
  fireEvent(eventName: TreeEvents): Promise<boolean>;
2754
+ protected hasValue(): boolean;
2739
2755
  setProperty<K extends keyof TApiaTreeProperties>(propName: K, propValue: TApiaTreeProperties[K]): void;
2740
2756
  init(form: Form): Promise<void>;
2741
2757
  protected isValidValue(): boolean;
@@ -3173,6 +3189,8 @@ declare function getLabel(execution: Execution, label: string, replacers?: Parti
3173
3189
 
3174
3190
  declare const parseXml: <T = Record<string, unknown>>(xml: XMLDocument | string) => T;
3175
3191
 
3192
+ declare function parseFakeJSON<T extends Record<string, unknown>>(str: string): T;
3193
+
3176
3194
  type TCheckWizardResponse = {
3177
3195
  url: string;
3178
3196
  };
@@ -3290,5 +3308,5 @@ declare class ShowSign extends FlowModal<{
3290
3308
  }) => Promise<Status>);
3291
3309
  }
3292
3310
 
3293
- 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 IButton, type IIProperty, type ILabelSelectedDay, type IPoolsPermissions, IProperty, type IScheduleInitialProps, type ISchedulerStore, type ISelectedDay, type ISignatureData, type IStage, type IStageButton, type IUsersPermissions, Image, ImageField, Input, InputField, InvalidSessionException, Label, Link, LinkField, MessageNotification, ModalInput, ModalInputField, Multiple, MultipleField, Notifications, Password, PasswordField, type PossibleValue, Radio, RadioField, type RadioPossibleValue, Scheduler, Select, SelectField, type SelectPossibleValue, ShowConfirmMessage, ShowPathSelection, ShowPoolSelection, ShowSign, ShowSignSelection, StatefulEmitter, type Status, StatusNotification, type TActionButtons, type TAjaxUploadFileStatus, type TAjaxUploadStart, type TApiaButtonProperties, type TApiaCaptchaProperties, type TApiaCheckboxProperties, type TApiaDocumentDefinition, 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 TConfirmDropModal, type TCusCmpStateRequest, type TCustomComponentDefaultResponse, type TCustomComponentDefinition, type TDocInfo, type TDocType, type TDocumentDownloadHistory, type TDocumentInformation, type TDocumentMetadata, type TDocumentPermission, type TDocumentVersion, type TExecutionConfig, type TFetchConfirmPathResponse, type TFieldEvent, type TFieldScriptEvent, type TFieldScriptEventParameters, type TFieldScriptEvents, type TFieldServerEvent, type TFieldServerEvents, type TFileUploaded, type TFormEventName, type TFormScriptEvent, type TFormScriptEventParameters, type TFormScriptEvents, type TFrmParent, type TItemTreeObj, type TModalConfig, type TObservation, type TObservations, type TOnUploadProgress, type TPathType, type TProcessDroppedFiles, type TProcesses, type TRequireOnlyOne, type TSaveDroppedFilesConf, type TSchInfoResult, type TScheduleResult, type TSchedulerState, type TSelectedDateResponse, type TSignaturesData, type TTskSchDay, type TTskSchHour, type TUploadModalOpener, type TUploaderFileInfo, type TUploaderLoadCurrentFunction, type TUploaderLoadCurrentFunctionMessages, AreaField as TextAreaField, TextField, Textarea, Title, TranslatableField, Translation, Tree, TreeField, UploaderApi, UploaderModalController, type UploaderModalState, type UploaderState, createNewField, deepEqual, get, getCurrentDate, getLabel, isHtmlResponse, isJsonResponse, isXmlResponse, makeApiaUrl, parseFileDefinition, parseSuccessfulResponse, parseXml, post, returnExactlyTheSame, shallowEqual };
3311
+ 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 IButton, type IIProperty, type ILabelSelectedDay, type IPoolsPermissions, IProperty, type IScheduleInitialProps, type ISchedulerStore, type ISelectedDay, type ISignatureData, type IStage, type IStageButton, type IUsersPermissions, Image, ImageField, Input, InputField, InvalidSessionException, Label, Link, LinkField, MessageNotification, ModalInput, ModalInputField, Multiple, MultipleField, Notifications, Password, PasswordField, type PossibleValue, Radio, RadioField, type RadioPossibleValue, Scheduler, Select, SelectField, type SelectPossibleValue, ShowConfirmMessage, ShowPathSelection, ShowPoolSelection, ShowSign, ShowSignSelection, StatefulEmitter, type Status, StatusNotification, type TActionButtons, type TAjaxUploadFileStatus, type TAjaxUploadStart, type TApiaButtonProperties, type TApiaCaptchaProperties, type TApiaCheckboxProperties, type TApiaDocumentDefinition, 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 TConfirmDropModal, type TCusCmpStateRequest, type TCustomComponentDefaultResponse, type TCustomComponentDefinition, type TDocInfo, type TDocType, type TDocumentDownloadHistory, type TDocumentInformation, type TDocumentMetadata, type TDocumentPermission, type TDocumentVersion, type TExecutionConfig, type TFetchConfirmPathResponse, type TFieldEvent, type TFieldScriptEvent, type TFieldScriptEventParameters, type TFieldScriptEvents, type TFieldServerEvent, type TFieldServerEvents, type TFileUploaded, type TFormEventName, type TFormScriptEvent, type TFormScriptEventParameters, type TFormScriptEvents, type TFrmParent, type TItemTreeObj, type TModalConfig, type TObservation, type TObservations, type TOnUploadProgress, type TPathType, type TProcessDroppedFiles, type TProcesses, type TRequireOnlyOne, type TSaveDroppedFilesConf, type TSchInfoResult, type TScheduleResult, type TSchedulerState, type TSelectedDateResponse, type TSignaturesData, type TTskSchDay, type TTskSchHour, type TUploadModalOpener, type TUploaderFileInfo, type TUploaderLoadCurrentFunction, type TUploaderLoadCurrentFunctionMessages, AreaField as TextAreaField, TextField, Textarea, Title, TranslatableField, Translation, Tree, TreeField, UploaderApi, UploaderModalController, type UploaderModalState, type UploaderState, createNewField, deepEqual, get, getCurrentDate, getLabel, isHtmlResponse, isJsonResponse, isOneClickUploadEnabled, isXmlResponse, makeApiaUrl, parseFakeJSON, parseFileDefinition, parseSuccessfulResponse, parseXml, post, returnExactlyTheSame, shallowEqual };
3294
3312
  //# sourceMappingURL=index.d.ts.map