@apia/execution 4.0.102 → 5.0.1
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 +92 -3784
- package/dist/index.js +83 -8740
- package/dist/index.js.map +1 -1
- package/dist/main/Execution/Entity/index.d.ts +30 -0
- package/dist/main/Execution/Entity/index.d.ts.map +1 -0
- package/dist/main/Execution/Entity/index.js +268 -0
- package/dist/main/Execution/Entity/index.js.map +1 -0
- package/dist/main/Execution/Entity/type.d.ts +98 -0
- package/dist/main/Execution/Entity/type.d.ts.map +1 -0
- package/dist/main/Execution/EntityFlowModals/confirmFlow.js +200 -0
- package/dist/main/Execution/EntityFlowModals/confirmFlow.js.map +1 -0
- package/dist/main/Execution/FlowModals/FlowModal.d.ts +18 -0
- package/dist/main/Execution/FlowModals/FlowModal.d.ts.map +1 -0
- package/dist/main/Execution/FlowModals/FlowModal.js +5 -0
- package/dist/main/Execution/FlowModals/FlowModal.js.map +1 -0
- package/dist/main/Execution/FlowModals/ShowConfirmMessage.d.ts +16 -0
- package/dist/main/Execution/FlowModals/ShowConfirmMessage.d.ts.map +1 -0
- package/dist/main/Execution/FlowModals/ShowConfirmMessage.js +12 -0
- package/dist/main/Execution/FlowModals/ShowConfirmMessage.js.map +1 -0
- package/dist/main/Execution/FlowModals/ShowPathSelection.d.ts +29 -0
- package/dist/main/Execution/FlowModals/ShowPathSelection.d.ts.map +1 -0
- package/dist/main/Execution/FlowModals/ShowPathSelection.js +50 -0
- package/dist/main/Execution/FlowModals/ShowPathSelection.js.map +1 -0
- package/dist/main/Execution/FlowModals/ShowPoolSelection.d.ts +20 -0
- package/dist/main/Execution/FlowModals/ShowPoolSelection.d.ts.map +1 -0
- package/dist/main/Execution/FlowModals/ShowPoolSelection.js +12 -0
- package/dist/main/Execution/FlowModals/ShowPoolSelection.js.map +1 -0
- package/dist/main/Execution/FlowModals/ShowSign.d.ts +16 -0
- package/dist/main/Execution/FlowModals/ShowSign.d.ts.map +1 -0
- package/dist/main/Execution/FlowModals/ShowSign.js +12 -0
- package/dist/main/Execution/FlowModals/ShowSign.js.map +1 -0
- package/dist/main/Execution/FlowModals/ShowSignSelection.d.ts +19 -0
- package/dist/main/Execution/FlowModals/ShowSignSelection.d.ts.map +1 -0
- package/dist/main/Execution/FlowModals/ShowSignSelection.js +12 -0
- package/dist/main/Execution/FlowModals/ShowSignSelection.js.map +1 -0
- package/dist/main/Execution/FlowModals/confirmFlow.js +420 -0
- package/dist/main/Execution/FlowModals/confirmFlow.js.map +1 -0
- package/dist/main/Execution/FlowModals/types.d.ts +44 -0
- package/dist/main/Execution/FlowModals/types.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/Field.d.ts +43 -0
- package/dist/main/Execution/FormsExecution/Field.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/Field.js +289 -0
- package/dist/main/Execution/FormsExecution/Field.js.map +1 -0
- package/dist/main/Execution/FormsExecution/FieldWithAttribute.d.ts +43 -0
- package/dist/main/Execution/FormsExecution/FieldWithAttribute.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/FieldWithAttribute.js +244 -0
- package/dist/main/Execution/FormsExecution/FieldWithAttribute.js.map +1 -0
- package/dist/main/Execution/FormsExecution/Form.d.ts +83 -0
- package/dist/main/Execution/FormsExecution/Form.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/Form.js +378 -0
- package/dist/main/Execution/FormsExecution/Form.js.map +1 -0
- package/dist/main/Execution/FormsExecution/TranslatableField/Translation.d.ts +19 -0
- package/dist/main/Execution/FormsExecution/TranslatableField/Translation.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/TranslatableField/Translation.js +72 -0
- package/dist/main/Execution/FormsExecution/TranslatableField/Translation.js.map +1 -0
- package/dist/main/Execution/FormsExecution/TranslatableField/index.d.ts +38 -0
- package/dist/main/Execution/FormsExecution/TranslatableField/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/TranslatableField/index.js +141 -0
- package/dist/main/Execution/FormsExecution/TranslatableField/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/TranslatableField/types.d.ts +11 -0
- package/dist/main/Execution/FormsExecution/TranslatableField/types.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/TranslatableField/util.js +9 -0
- package/dist/main/Execution/FormsExecution/TranslatableField/util.js.map +1 -0
- package/dist/main/Execution/FormsExecution/WithProperties.d.ts +17 -0
- package/dist/main/Execution/FormsExecution/WithProperties.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/WithProperties.js +38 -0
- package/dist/main/Execution/FormsExecution/WithProperties.js.map +1 -0
- package/dist/main/Execution/FormsExecution/constants/IProperty.js +10 -0
- package/dist/main/Execution/FormsExecution/constants/IProperty.js.map +1 -0
- package/dist/main/Execution/FormsExecution/constants/actions.js +5 -0
- package/dist/main/Execution/FormsExecution/constants/actions.js.map +1 -0
- package/dist/main/Execution/FormsExecution/constants/eventTypes.js +5 -0
- package/dist/main/Execution/FormsExecution/constants/eventTypes.js.map +1 -0
- package/dist/main/Execution/FormsExecution/constants/fieldProps.js +124 -0
- package/dist/main/Execution/FormsExecution/constants/fieldProps.js.map +1 -0
- package/dist/main/Execution/FormsExecution/constants/formProps.js +18 -0
- package/dist/main/Execution/FormsExecution/constants/formProps.js.map +1 -0
- package/dist/main/Execution/FormsExecution/constants/props/booleanProps.js +67 -0
- package/dist/main/Execution/FormsExecution/constants/props/booleanProps.js.map +1 -0
- package/dist/main/Execution/FormsExecution/constants/props/numberProps.js +14 -0
- package/dist/main/Execution/FormsExecution/constants/props/numberProps.js.map +1 -0
- package/dist/main/Execution/FormsExecution/customComponents/CustomComponent.d.ts +62 -0
- package/dist/main/Execution/FormsExecution/customComponents/CustomComponent.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/customComponents/CustomComponent.js +378 -0
- package/dist/main/Execution/FormsExecution/customComponents/CustomComponent.js.map +1 -0
- package/dist/main/Execution/FormsExecution/events/setAjaxFormResponse.js +150 -0
- package/dist/main/Execution/FormsExecution/events/setAjaxFormResponse.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Button/index.d.ts +10 -0
- package/dist/main/Execution/FormsExecution/fields/Button/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Button/index.js +10 -0
- package/dist/main/Execution/FormsExecution/fields/Button/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Captcha/index.d.ts +28 -0
- package/dist/main/Execution/FormsExecution/fields/Captcha/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Captcha/index.js +71 -0
- package/dist/main/Execution/FormsExecution/fields/Captcha/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Checkbox/index.d.ts +12 -0
- package/dist/main/Execution/FormsExecution/fields/Checkbox/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Checkbox/index.js +19 -0
- package/dist/main/Execution/FormsExecution/fields/Checkbox/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Editor/index.d.ts +14 -0
- package/dist/main/Execution/FormsExecution/fields/Editor/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Editor/index.js +18 -0
- package/dist/main/Execution/FormsExecution/fields/Editor/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/File/index.d.ts +22 -0
- package/dist/main/Execution/FormsExecution/fields/File/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/File/index.js +116 -0
- package/dist/main/Execution/FormsExecution/fields/File/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/AdditionalCell.d.ts +15 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/AdditionalCell.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/AdditionalCell.js +17 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/AdditionalCell.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/FieldsCache.d.ts +24 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/FieldsCache.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/FieldsCache.js +43 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/FieldsCache.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/GridCell.d.ts +9 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/GridCell.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/GridCell.js +10 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/GridCell.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/GridEditionModal.d.ts +7 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/GridEditionModal.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/GridFooterHandler.d.ts +27 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/GridFooterHandler.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/GridFooterHandler.js +100 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/GridFooterHandler.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/HeaderCell.d.ts +14 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/HeaderCell.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/HeaderCell.js +17 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/HeaderCell.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/index.d.ts +122 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/index.js +961 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/types.d.ts +47 -0
- package/dist/main/Execution/FormsExecution/fields/Grid/types.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/GridPaginated/index.d.ts +21 -0
- package/dist/main/Execution/FormsExecution/fields/GridPaginated/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/GridPaginated/index.js +204 -0
- package/dist/main/Execution/FormsExecution/fields/GridPaginated/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Hidden/index.d.ts +8 -0
- package/dist/main/Execution/FormsExecution/fields/Hidden/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Hidden/index.js +7 -0
- package/dist/main/Execution/FormsExecution/fields/Hidden/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Image/index.d.ts +8 -0
- package/dist/main/Execution/FormsExecution/fields/Image/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Image/index.js +7 -0
- package/dist/main/Execution/FormsExecution/fields/Image/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Input/index.d.ts +18 -0
- package/dist/main/Execution/FormsExecution/fields/Input/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Input/index.js +146 -0
- package/dist/main/Execution/FormsExecution/fields/Input/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Label/index.d.ts +9 -0
- package/dist/main/Execution/FormsExecution/fields/Label/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Label/index.js +7 -0
- package/dist/main/Execution/FormsExecution/fields/Label/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Link/index.d.ts +8 -0
- package/dist/main/Execution/FormsExecution/fields/Link/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Link/index.js +7 -0
- package/dist/main/Execution/FormsExecution/fields/Link/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/ModalInput/index.d.ts +25 -0
- package/dist/main/Execution/FormsExecution/fields/ModalInput/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/ModalInput/index.js +145 -0
- package/dist/main/Execution/FormsExecution/fields/ModalInput/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Multiple/index.d.ts +19 -0
- package/dist/main/Execution/FormsExecution/fields/Multiple/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Multiple/index.js +42 -0
- package/dist/main/Execution/FormsExecution/fields/Multiple/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Password/index.d.ts +9 -0
- package/dist/main/Execution/FormsExecution/fields/Password/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Password/index.js +10 -0
- package/dist/main/Execution/FormsExecution/fields/Password/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Radio/index.d.ts +15 -0
- package/dist/main/Execution/FormsExecution/fields/Radio/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Radio/index.js +26 -0
- package/dist/main/Execution/FormsExecution/fields/Radio/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Scheduler/index.d.ts +36 -0
- package/dist/main/Execution/FormsExecution/fields/Scheduler/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Scheduler/index.js +156 -0
- package/dist/main/Execution/FormsExecution/fields/Scheduler/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Select/index.d.ts +15 -0
- package/dist/main/Execution/FormsExecution/fields/Select/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Select/index.js +35 -0
- package/dist/main/Execution/FormsExecution/fields/Select/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Textarea/index.d.ts +11 -0
- package/dist/main/Execution/FormsExecution/fields/Textarea/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Textarea/index.js +15 -0
- package/dist/main/Execution/FormsExecution/fields/Textarea/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Title/index.d.ts +8 -0
- package/dist/main/Execution/FormsExecution/fields/Title/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Title/index.js +7 -0
- package/dist/main/Execution/FormsExecution/fields/Title/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Tree/index.d.ts +30 -0
- package/dist/main/Execution/FormsExecution/fields/Tree/index.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fields/Tree/index.js +115 -0
- package/dist/main/Execution/FormsExecution/fields/Tree/index.js.map +1 -0
- package/dist/main/Execution/FormsExecution/fieldsMap.d.ts +9 -0
- package/dist/main/Execution/FormsExecution/fieldsMap.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/fieldsMap.js +64 -0
- package/dist/main/Execution/FormsExecution/fieldsMap.js.map +1 -0
- package/dist/main/Execution/FormsExecution/types.d.ts +55 -0
- package/dist/main/Execution/FormsExecution/types.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/util/isFieldShowAsText.js +8 -0
- package/dist/main/Execution/FormsExecution/util/isFieldShowAsText.js.map +1 -0
- package/dist/main/Execution/FormsExecution/util/util.d.ts +6 -0
- package/dist/main/Execution/FormsExecution/util/util.d.ts.map +1 -0
- package/dist/main/Execution/FormsExecution/util/util.js +7 -0
- package/dist/main/Execution/FormsExecution/util/util.js.map +1 -0
- package/dist/main/Execution/Observations/index.d.ts +16 -0
- package/dist/main/Execution/Observations/index.d.ts.map +1 -0
- package/dist/main/Execution/Observations/index.js +89 -0
- package/dist/main/Execution/Observations/index.js.map +1 -0
- package/dist/main/Execution/Observations/types.d.ts +26 -0
- package/dist/main/Execution/Observations/types.d.ts.map +1 -0
- package/dist/main/Execution/Process/index.d.ts +23 -0
- package/dist/main/Execution/Process/index.d.ts.map +1 -0
- package/dist/main/Execution/Process/index.js +77 -0
- package/dist/main/Execution/Process/index.js.map +1 -0
- package/dist/main/Execution/Process/types.d.ts +95 -0
- package/dist/main/Execution/Process/types.d.ts.map +1 -0
- package/dist/main/Execution/Signature/SignatureController.d.ts +23 -0
- package/dist/main/Execution/Signature/SignatureController.d.ts.map +1 -0
- package/dist/main/Execution/Signature/SignatureController.js +71 -0
- package/dist/main/Execution/Signature/SignatureController.js.map +1 -0
- package/dist/main/Execution/Task.d.ts +9 -0
- package/dist/main/Execution/Task.d.ts.map +1 -0
- package/dist/main/Execution/Task.js +34 -0
- package/dist/main/Execution/Task.js.map +1 -0
- package/dist/main/Execution/Uploader/FormsUploader.d.ts +145 -0
- package/dist/main/Execution/Uploader/FormsUploader.d.ts.map +1 -0
- package/dist/main/Execution/Uploader/FormsUploader.js +299 -0
- package/dist/main/Execution/Uploader/FormsUploader.js.map +1 -0
- package/dist/main/Execution/Uploader/UploaderApi.d.ts +40 -0
- package/dist/main/Execution/Uploader/UploaderApi.d.ts.map +1 -0
- package/dist/main/Execution/Uploader/UploaderApi.js +127 -0
- package/dist/main/Execution/Uploader/UploaderApi.js.map +1 -0
- package/dist/main/Execution/index.d.ts +184 -0
- package/dist/main/Execution/index.d.ts.map +1 -0
- package/dist/main/Execution/index.js +662 -0
- package/dist/main/Execution/index.js.map +1 -0
- package/dist/main/Execution/types.d.ts +99 -0
- package/dist/main/Execution/types.d.ts.map +1 -0
- package/dist/main/Execution/types.js +12 -0
- package/dist/main/Execution/types.js.map +1 -0
- package/dist/main/InitialData/bootstrap/readFormsDefinition.js +55 -0
- package/dist/main/InitialData/bootstrap/readFormsDefinition.js.map +1 -0
- package/dist/main/InitialData/index.js +10 -0
- package/dist/main/InitialData/index.js.map +1 -0
- package/dist/main/InitialData/types/TApiaField.d.ts +73 -0
- package/dist/main/InitialData/types/TApiaField.d.ts.map +1 -0
- package/dist/main/InitialData/types/TApiaForm.d.ts +102 -0
- package/dist/main/InitialData/types/TApiaForm.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaButtonDefinition.d.ts +9 -0
- package/dist/main/InitialData/types/fields/TApiaButtonDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaCaptchaDefinition.d.ts +11 -0
- package/dist/main/InitialData/types/fields/TApiaCaptchaDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaCheckboxDefinition.d.ts +10 -0
- package/dist/main/InitialData/types/fields/TApiaCheckboxDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaEditorDefinition.d.ts +10 -0
- package/dist/main/InitialData/types/fields/TApiaEditorDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaFieldProperties.d.ts +194 -0
- package/dist/main/InitialData/types/fields/TApiaFieldProperties.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaFileUploaderDefinition.d.ts +11 -0
- package/dist/main/InitialData/types/fields/TApiaFileUploaderDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaGridDefinition.d.ts +33 -0
- package/dist/main/InitialData/types/fields/TApiaGridDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaHiddenInputDefinition.d.ts +11 -0
- package/dist/main/InitialData/types/fields/TApiaHiddenInputDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaImageDefinition.d.ts +9 -0
- package/dist/main/InitialData/types/fields/TApiaImageDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaInputDefinition.d.ts +21 -0
- package/dist/main/InitialData/types/fields/TApiaInputDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaLabelDefinition.d.ts +10 -0
- package/dist/main/InitialData/types/fields/TApiaLabelDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaLinkDefinition.d.ts +10 -0
- package/dist/main/InitialData/types/fields/TApiaLinkDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaModalInputDefinition.d.ts +24 -0
- package/dist/main/InitialData/types/fields/TApiaModalInputDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaMultipleDefinition.d.ts +11 -0
- package/dist/main/InitialData/types/fields/TApiaMultipleDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaPasswordDefinition.d.ts +10 -0
- package/dist/main/InitialData/types/fields/TApiaPasswordDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaRadioButtonDefinition.d.ts +11 -0
- package/dist/main/InitialData/types/fields/TApiaRadioButtonDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaSelectDefinition.d.ts +11 -0
- package/dist/main/InitialData/types/fields/TApiaSelectDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaTextareaDefinition.d.ts +11 -0
- package/dist/main/InitialData/types/fields/TApiaTextareaDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaTitleDefinition.d.ts +9 -0
- package/dist/main/InitialData/types/fields/TApiaTitleDefinition.d.ts.map +1 -0
- package/dist/main/InitialData/types/fields/TApiaTreeDefinition.d.ts +17 -0
- package/dist/main/InitialData/types/fields/TApiaTreeDefinition.d.ts.map +1 -0
- package/dist/main/Notifications/MessageNotification.d.ts +8 -0
- package/dist/main/Notifications/MessageNotification.d.ts.map +1 -0
- package/dist/main/Notifications/MessageNotification.js +10 -0
- package/dist/main/Notifications/MessageNotification.js.map +1 -0
- package/dist/main/Notifications/Notification.d.ts +26 -0
- package/dist/main/Notifications/Notification.d.ts.map +1 -0
- package/dist/main/Notifications/Notification.js +40 -0
- package/dist/main/Notifications/Notification.js.map +1 -0
- package/dist/main/Notifications/StatusNotification.d.ts +15 -0
- package/dist/main/Notifications/StatusNotification.d.ts.map +1 -0
- package/dist/main/Notifications/StatusNotification.js +11 -0
- package/dist/main/Notifications/StatusNotification.js.map +1 -0
- package/dist/main/Notifications/index.d.ts +26 -0
- package/dist/main/Notifications/index.d.ts.map +1 -0
- package/dist/main/Notifications/index.js +48 -0
- package/dist/main/Notifications/index.js.map +1 -0
- package/dist/programming/ActionController/index.d.ts +36 -0
- package/dist/programming/ActionController/index.d.ts.map +1 -0
- package/dist/programming/ActionController/index.js +69 -0
- package/dist/programming/ActionController/index.js.map +1 -0
- package/dist/programming/ApiaField.d.ts +21 -0
- package/dist/programming/ApiaField.d.ts.map +1 -0
- package/dist/programming/ApiaField.js +58 -0
- package/dist/programming/ApiaField.js.map +1 -0
- package/dist/programming/ApiaFieldWithAttribute.d.ts +31 -0
- package/dist/programming/ApiaFieldWithAttribute.d.ts.map +1 -0
- package/dist/programming/ApiaFieldWithAttribute.js +72 -0
- package/dist/programming/ApiaFieldWithAttribute.js.map +1 -0
- package/dist/programming/ApiaForm.d.ts +148 -0
- package/dist/programming/ApiaForm.d.ts.map +1 -0
- package/dist/programming/ApiaForm.js +105 -0
- package/dist/programming/ApiaForm.js.map +1 -0
- package/dist/programming/ApiaFunctions.d.ts +54 -0
- package/dist/programming/ApiaFunctions.d.ts.map +1 -0
- package/dist/programming/ApiaFunctions.js +223 -0
- package/dist/programming/ApiaFunctions.js.map +1 -0
- package/dist/programming/constants/BooleanProps.d.ts +4 -0
- package/dist/programming/constants/BooleanProps.d.ts.map +1 -0
- package/dist/programming/constants/BooleanProps.js +67 -0
- package/dist/programming/constants/BooleanProps.js.map +1 -0
- package/dist/programming/constants/FieldConstants.d.ts +121 -0
- package/dist/programming/constants/FieldConstants.d.ts.map +1 -0
- package/dist/programming/constants/FieldConstants.js +127 -0
- package/dist/programming/constants/FieldConstants.js.map +1 -0
- package/dist/programming/constants/FormConstants.d.ts +15 -0
- package/dist/programming/constants/FormConstants.d.ts.map +1 -0
- package/dist/programming/constants/FormConstants.js +15 -0
- package/dist/programming/constants/FormConstants.js.map +1 -0
- package/dist/programming/constants/IProperty.d.ts +131 -0
- package/dist/programming/constants/IProperty.d.ts.map +1 -0
- package/dist/programming/constants/IProperty.js +10 -0
- package/dist/programming/constants/IProperty.js.map +1 -0
- package/dist/programming/constants/NumberProps.d.ts +4 -0
- package/dist/programming/constants/NumberProps.d.ts.map +1 -0
- package/dist/programming/constants/NumberProps.js +14 -0
- package/dist/programming/constants/NumberProps.js.map +1 -0
- package/dist/programming/fields/AreaField.d.ts +7 -0
- package/dist/programming/fields/AreaField.d.ts.map +1 -0
- package/dist/programming/fields/AreaField.js +7 -0
- package/dist/programming/fields/AreaField.js.map +1 -0
- package/dist/programming/fields/ButtonField.d.ts +22 -0
- package/dist/programming/fields/ButtonField.d.ts.map +1 -0
- package/dist/programming/fields/ButtonField.js +49 -0
- package/dist/programming/fields/ButtonField.js.map +1 -0
- package/dist/programming/fields/CaptchaField.d.ts +9 -0
- package/dist/programming/fields/CaptchaField.d.ts.map +1 -0
- package/dist/programming/fields/CaptchaField.js +7 -0
- package/dist/programming/fields/CaptchaField.js.map +1 -0
- package/dist/programming/fields/CheckField.d.ts +9 -0
- package/dist/programming/fields/CheckField.d.ts.map +1 -0
- package/dist/programming/fields/CheckField.js +23 -0
- package/dist/programming/fields/CheckField.js.map +1 -0
- package/dist/programming/fields/CustomComponentField.js +56 -0
- package/dist/programming/fields/CustomComponentField.js.map +1 -0
- package/dist/programming/fields/EditorField.d.ts +7 -0
- package/dist/programming/fields/EditorField.d.ts.map +1 -0
- package/dist/programming/fields/EditorField.js +7 -0
- package/dist/programming/fields/EditorField.js.map +1 -0
- package/dist/programming/fields/FileUploaderField.d.ts +17 -0
- package/dist/programming/fields/FileUploaderField.d.ts.map +1 -0
- package/dist/programming/fields/FileUploaderField.js +58 -0
- package/dist/programming/fields/FileUploaderField.js.map +1 -0
- package/dist/programming/fields/GridField.d.ts +624 -0
- package/dist/programming/fields/GridField.d.ts.map +1 -0
- package/dist/programming/fields/GridField.js +181 -0
- package/dist/programming/fields/GridField.js.map +1 -0
- package/dist/programming/fields/HiddenField.d.ts +7 -0
- package/dist/programming/fields/HiddenField.d.ts.map +1 -0
- package/dist/programming/fields/HiddenField.js +7 -0
- package/dist/programming/fields/HiddenField.js.map +1 -0
- package/dist/programming/fields/ImageField.d.ts +24 -0
- package/dist/programming/fields/ImageField.d.ts.map +1 -0
- package/dist/programming/fields/ImageField.js +61 -0
- package/dist/programming/fields/ImageField.js.map +1 -0
- package/dist/programming/fields/InputField.d.ts +15 -0
- package/dist/programming/fields/InputField.d.ts.map +1 -0
- package/dist/programming/fields/InputField.js +42 -0
- package/dist/programming/fields/InputField.js.map +1 -0
- package/dist/programming/fields/LinkField.d.ts +18 -0
- package/dist/programming/fields/LinkField.d.ts.map +1 -0
- package/dist/programming/fields/LinkField.js +39 -0
- package/dist/programming/fields/LinkField.js.map +1 -0
- package/dist/programming/fields/ModalInput.d.ts +16 -0
- package/dist/programming/fields/ModalInput.d.ts.map +1 -0
- package/dist/programming/fields/ModalInput.js +41 -0
- package/dist/programming/fields/ModalInput.js.map +1 -0
- package/dist/programming/fields/MultipleField.d.ts +22 -0
- package/dist/programming/fields/MultipleField.d.ts.map +1 -0
- package/dist/programming/fields/MultipleField.js +102 -0
- package/dist/programming/fields/MultipleField.js.map +1 -0
- package/dist/programming/fields/PasswordField.d.ts +7 -0
- package/dist/programming/fields/PasswordField.d.ts.map +1 -0
- package/dist/programming/fields/PasswordField.js +7 -0
- package/dist/programming/fields/PasswordField.js.map +1 -0
- package/dist/programming/fields/RadioField.d.ts +22 -0
- package/dist/programming/fields/RadioField.d.ts.map +1 -0
- package/dist/programming/fields/RadioField.js +98 -0
- package/dist/programming/fields/RadioField.js.map +1 -0
- package/dist/programming/fields/SelectField.d.ts +24 -0
- package/dist/programming/fields/SelectField.d.ts.map +1 -0
- package/dist/programming/fields/SelectField.js +104 -0
- package/dist/programming/fields/SelectField.js.map +1 -0
- package/dist/programming/fields/TextField.d.ts +18 -0
- package/dist/programming/fields/TextField.d.ts.map +1 -0
- package/dist/programming/fields/TextField.js +43 -0
- package/dist/programming/fields/TextField.js.map +1 -0
- package/dist/programming/fields/TreeField.d.ts +14 -0
- package/dist/programming/fields/TreeField.d.ts.map +1 -0
- package/dist/programming/fields/TreeField.js +36 -0
- package/dist/programming/fields/TreeField.js.map +1 -0
- package/dist/programming/types.d.ts +73 -0
- package/dist/programming/types.d.ts.map +1 -0
- package/dist/programming/utils/asynCreateApiaField.d.ts +10 -0
- package/dist/programming/utils/asynCreateApiaField.d.ts.map +1 -0
- package/dist/programming/utils/asynCreateApiaField.js +10 -0
- package/dist/programming/utils/asynCreateApiaField.js.map +1 -0
- package/dist/programming/utils/createApiaField.d.ts +6 -0
- package/dist/programming/utils/createApiaField.d.ts.map +1 -0
- package/dist/programming/utils/createApiaField.js +94 -0
- package/dist/programming/utils/createApiaField.js.map +1 -0
- package/dist/util/api/apiaApi.d.ts +159 -0
- package/dist/util/api/apiaApi.d.ts.map +1 -0
- package/dist/util/api/apiaApi.js +243 -0
- package/dist/util/api/apiaApi.js.map +1 -0
- package/dist/util/api/types.d.ts +38 -0
- package/dist/util/api/types.d.ts.map +1 -0
- package/dist/util/app/getCurrentTabsString.js +13 -0
- package/dist/util/app/getCurrentTabsString.js.map +1 -0
- package/dist/util/comparators/deepEqual.d.ts +5 -0
- package/dist/util/comparators/deepEqual.d.ts.map +1 -0
- package/dist/util/comparators/deepEqual.js +38 -0
- package/dist/util/comparators/deepEqual.js.map +1 -0
- package/dist/util/comparators/shallowEqual.d.ts +5 -0
- package/dist/util/comparators/shallowEqual.d.ts.map +1 -0
- package/dist/util/comparators/shallowEqual.js +38 -0
- package/dist/util/comparators/shallowEqual.js.map +1 -0
- package/dist/util/dataTypes/parseBoolean.js +12 -0
- package/dist/util/dataTypes/parseBoolean.js.map +1 -0
- package/dist/util/dom/getDocument.js +6 -0
- package/dist/util/dom/getDocument.js.map +1 -0
- package/dist/util/dom/getWindow.js +6 -0
- package/dist/util/dom/getWindow.js.map +1 -0
- package/dist/util/events/BouncingEmitter.d.ts +66 -0
- package/dist/util/events/BouncingEmitter.d.ts.map +1 -0
- package/dist/util/events/BouncingEmitter.js +78 -0
- package/dist/util/events/BouncingEmitter.js.map +1 -0
- package/dist/util/events/EventEmitter.d.ts +47 -0
- package/dist/util/events/EventEmitter.d.ts.map +1 -0
- package/dist/util/events/EventEmitter.js +81 -0
- package/dist/util/events/EventEmitter.js.map +1 -0
- package/dist/util/events/StatefulEmitter.d.ts +37 -0
- package/dist/util/events/StatefulEmitter.d.ts.map +1 -0
- package/dist/util/events/StatefulEmitter.js +51 -0
- package/dist/util/events/StatefulEmitter.js.map +1 -0
- package/dist/util/events/types.d.ts +30 -0
- package/dist/util/events/types.d.ts.map +1 -0
- package/dist/util/labels/labels.d.ts +12 -0
- package/dist/util/labels/labels.d.ts.map +1 -0
- package/dist/util/labels/labels.js +35 -0
- package/dist/util/labels/labels.js.map +1 -0
- package/dist/util/number/noNaN.js +9 -0
- package/dist/util/number/noNaN.js.map +1 -0
- package/dist/util/other/asyncRetry.js +32 -0
- package/dist/util/other/asyncRetry.js.map +1 -0
- package/dist/util/other/parseFakeJSON.d.ts +4 -0
- package/dist/util/other/parseFakeJSON.d.ts.map +1 -0
- package/dist/util/other/parseFakeJSON.js +45 -0
- package/dist/util/other/parseFakeJSON.js.map +1 -0
- package/dist/util/xml/parseXml.d.ts +10 -0
- package/dist/util/xml/parseXml.d.ts.map +1 -0
- package/dist/util/xml/parseXml.js +172 -0
- package/dist/util/xml/parseXml.js.map +1 -0
- package/package.json +7 -8
- package/LICENSE.md +0 -6
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Form } from '../Form.js';
|
|
2
|
+
import { TCustomComponentDefinition, TCustomComponentDefaultResponse, ComponentEvent } from '../../../InitialData/types/TApiaForm.js';
|
|
3
|
+
import { DeepReadonly } from '@apia/util';
|
|
4
|
+
import { TFncParams } from '../Field.js';
|
|
5
|
+
import '../../../../programming/ApiaFunctions.js';
|
|
6
|
+
import { Execution } from '../../index.js';
|
|
7
|
+
import { AxiosRequestConfig } from 'axios';
|
|
8
|
+
import '../../../../util/api/apiaApi.js';
|
|
9
|
+
import { ApiaForm } from '../../../../programming/ApiaForm.js';
|
|
10
|
+
|
|
11
|
+
type TCustomComponentState = {
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
attributes: Record<string, any[]>;
|
|
14
|
+
properties: Record<string, any>;
|
|
15
|
+
additional: any;
|
|
16
|
+
component: any;
|
|
17
|
+
};
|
|
18
|
+
declare class CustomComponent {
|
|
19
|
+
#private;
|
|
20
|
+
execution: Execution;
|
|
21
|
+
readonly definition: TCustomComponentDefinition;
|
|
22
|
+
private form;
|
|
23
|
+
private _state;
|
|
24
|
+
constructor(execution: Execution, definition: TCustomComponentDefinition);
|
|
25
|
+
get state(): DeepReadonly<TCustomComponentState>;
|
|
26
|
+
getAdditional<T>(): DeepReadonly<T>;
|
|
27
|
+
getCurrentForm(): ApiaForm;
|
|
28
|
+
init(form: Form): Promise<void>;
|
|
29
|
+
private parseStateObject;
|
|
30
|
+
processResult<Result extends Record<string, unknown> = Record<string, unknown>>(res?: TCustomComponentDefaultResponse | null): Promise<(Result & {
|
|
31
|
+
success: boolean;
|
|
32
|
+
}) | undefined>;
|
|
33
|
+
protected getScriptEventParams(fncParams: TFncParams[]): unknown[];
|
|
34
|
+
protected fireScriptEvents(event: ComponentEvent): Promise<boolean>;
|
|
35
|
+
fireEvent(evtName: string): Promise<boolean>;
|
|
36
|
+
getProperty(prpName: string): any;
|
|
37
|
+
private postMessage;
|
|
38
|
+
setStringValue(attName: string, value: string): Promise<boolean>;
|
|
39
|
+
getStringValue(attName: string): string;
|
|
40
|
+
getValue(attName: string, index?: number): any;
|
|
41
|
+
getValues(attName: string): any[];
|
|
42
|
+
removeIndex(attName: string, index: number): Promise<boolean>;
|
|
43
|
+
setValue(attName: string, value: any, index: number): Promise<boolean>;
|
|
44
|
+
setProperty(prpName: string, value: any): Promise<boolean>;
|
|
45
|
+
sendMessage<T extends Record<string, unknown> = Record<string, unknown>>(payload: any): Promise<(T & {
|
|
46
|
+
success: boolean;
|
|
47
|
+
}) | undefined>;
|
|
48
|
+
download(attName: string, index: number): Promise<void>;
|
|
49
|
+
upload(attName: string, file: File, options?: {
|
|
50
|
+
onUploadProgress?: (percent: number) => unknown;
|
|
51
|
+
params?: Record<string, any>;
|
|
52
|
+
} & Pick<AxiosRequestConfig<any>, 'signal'>): Promise<({
|
|
53
|
+
index: number;
|
|
54
|
+
fileName: string;
|
|
55
|
+
} & {
|
|
56
|
+
success: boolean;
|
|
57
|
+
}) | undefined>;
|
|
58
|
+
setState<K extends keyof TCustomComponentState>(prop: K, value: TCustomComponentState[K]): void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { CustomComponent, type TCustomComponentState };
|
|
62
|
+
//# sourceMappingURL=CustomComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomComponent.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { makeObservable, computed, observable, toJS } from 'mobx';
|
|
2
|
+
import { actions } from '../constants/actions.js';
|
|
3
|
+
import { setAjaxFormResponse } from '../events/setAjaxFormResponse.js';
|
|
4
|
+
import { arrayOrArray, decodeBase64ToUtf8, encodeStrToBase64Utf8 } from '@apia/util';
|
|
5
|
+
import { MessageNotification } from '../../../Notifications/MessageNotification.js';
|
|
6
|
+
import { labels } from '../../../../util/labels/labels.js';
|
|
7
|
+
import { getWindow } from '../../../../util/dom/getWindow.js';
|
|
8
|
+
import axios from 'axios';
|
|
9
|
+
import { makeApiaUrl, post, parseSuccessfulResponse } from '../../../../util/api/apiaApi.js';
|
|
10
|
+
import { ApiaForm } from '../../../../programming/ApiaForm.js';
|
|
11
|
+
import { parseXml } from '../../../../util/xml/parseXml.js';
|
|
12
|
+
import { ApiaFunctions } from '../../../../programming/ApiaFunctions.js';
|
|
13
|
+
|
|
14
|
+
var __defProp = Object.defineProperty;
|
|
15
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16
|
+
var __publicField = (obj, key, value) => {
|
|
17
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18
|
+
return value;
|
|
19
|
+
};
|
|
20
|
+
var __accessCheck = (obj, member, msg) => {
|
|
21
|
+
if (!member.has(obj))
|
|
22
|
+
throw TypeError("Cannot " + msg);
|
|
23
|
+
};
|
|
24
|
+
var __privateGet = (obj, member, getter) => {
|
|
25
|
+
__accessCheck(obj, member, "read from private field");
|
|
26
|
+
return member.get(obj);
|
|
27
|
+
};
|
|
28
|
+
var __privateAdd = (obj, member, value) => {
|
|
29
|
+
if (member.has(obj))
|
|
30
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
31
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
32
|
+
};
|
|
33
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
34
|
+
__accessCheck(obj, member, "write to private field");
|
|
35
|
+
member.set(obj, value);
|
|
36
|
+
return value;
|
|
37
|
+
};
|
|
38
|
+
var _hasInited;
|
|
39
|
+
class CustomComponent {
|
|
40
|
+
constructor(execution, definition) {
|
|
41
|
+
this.execution = execution;
|
|
42
|
+
this.definition = definition;
|
|
43
|
+
__privateAdd(this, _hasInited, false);
|
|
44
|
+
__publicField(this, "form", {});
|
|
45
|
+
__publicField(this, "_state", {
|
|
46
|
+
isLoading: false,
|
|
47
|
+
attributes: {},
|
|
48
|
+
properties: {},
|
|
49
|
+
additional: {},
|
|
50
|
+
component: null
|
|
51
|
+
});
|
|
52
|
+
if (definition.error_while_processing) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
`Cannot initialize custom component ${definition.name}: ${definition.error_while_processing}`
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
makeObservable(this, {
|
|
58
|
+
_state: observable,
|
|
59
|
+
state: computed
|
|
60
|
+
});
|
|
61
|
+
this.parseStateObject(definition.state.state);
|
|
62
|
+
}
|
|
63
|
+
get state() {
|
|
64
|
+
return toJS(this._state);
|
|
65
|
+
}
|
|
66
|
+
getAdditional() {
|
|
67
|
+
return this.state.additional;
|
|
68
|
+
}
|
|
69
|
+
getCurrentForm() {
|
|
70
|
+
return new ApiaForm(this.execution, this.form);
|
|
71
|
+
}
|
|
72
|
+
async init(form) {
|
|
73
|
+
if (__privateGet(this, _hasInited))
|
|
74
|
+
throw new Error("Cannot init field twice");
|
|
75
|
+
__privateSet(this, _hasInited, true);
|
|
76
|
+
this.form = form;
|
|
77
|
+
}
|
|
78
|
+
parseStateObject(o) {
|
|
79
|
+
if (o.additional) {
|
|
80
|
+
try {
|
|
81
|
+
this._state.additional = JSON.parse(o.additional);
|
|
82
|
+
} catch (e) {
|
|
83
|
+
console.error(e);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
arrayOrArray(o.attribute).forEach((c) => {
|
|
87
|
+
this._state.attributes[c.name] = arrayOrArray(
|
|
88
|
+
JSON.parse(decodeBase64ToUtf8(c.values))
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
arrayOrArray(o.property).forEach((c) => {
|
|
92
|
+
this._state.properties[c.name] = c.value;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
async processResult(res) {
|
|
96
|
+
let proceed = true;
|
|
97
|
+
const scheduledEvents = [];
|
|
98
|
+
const newState = res?.processResult?.state;
|
|
99
|
+
if (newState) {
|
|
100
|
+
for (const directive of arrayOrArray(newState.directive)) {
|
|
101
|
+
if (directive.type === "RELOAD") {
|
|
102
|
+
proceed = false;
|
|
103
|
+
getWindow(this.execution).location.assign(
|
|
104
|
+
makeApiaUrl(this.execution, {
|
|
105
|
+
ajaxUrl: actions.forms,
|
|
106
|
+
action: "reload",
|
|
107
|
+
nuevo: true,
|
|
108
|
+
cmpId: this.definition.id,
|
|
109
|
+
frmId: this.form.definition.id,
|
|
110
|
+
frmParent: this.form.definition.frmParent
|
|
111
|
+
})
|
|
112
|
+
);
|
|
113
|
+
} else if (directive.type === "FIRE") {
|
|
114
|
+
scheduledEvents.push(directive.content);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (proceed) {
|
|
119
|
+
if (res.ajaxUpdated) {
|
|
120
|
+
const result = parseXml(res.ajaxUpdated);
|
|
121
|
+
setAjaxFormResponse(
|
|
122
|
+
this.execution,
|
|
123
|
+
result
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
if (newState) {
|
|
127
|
+
this.parseStateObject(newState);
|
|
128
|
+
}
|
|
129
|
+
for await (const event of scheduledEvents) {
|
|
130
|
+
await this.fireEvent(event);
|
|
131
|
+
}
|
|
132
|
+
this._state.isLoading = false;
|
|
133
|
+
return res.processResult?.state?.result;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
getScriptEventParams(fncParams) {
|
|
137
|
+
const fncParamsArray = [];
|
|
138
|
+
for (let e = 0; e < fncParams.length; e += 1) {
|
|
139
|
+
if (fncParams[e].type === "V") {
|
|
140
|
+
fncParamsArray.push(fncParams[e].value);
|
|
141
|
+
} else if (fncParams[e].type === "E" || fncParams[e].type === "P") {
|
|
142
|
+
const paraAttId = fncParams[e].attId;
|
|
143
|
+
if (paraAttId) {
|
|
144
|
+
fncParamsArray.push(
|
|
145
|
+
new ApiaFunctions(this.execution).getForm(
|
|
146
|
+
this.form.definition.formName,
|
|
147
|
+
this.form.definition.frmParent
|
|
148
|
+
).getField(paraAttId)
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return fncParamsArray;
|
|
154
|
+
}
|
|
155
|
+
async fireScriptEvents(event) {
|
|
156
|
+
let result = true;
|
|
157
|
+
for await (const script of arrayOrArray(event.script)) {
|
|
158
|
+
const def = JSON.parse(script.text);
|
|
159
|
+
try {
|
|
160
|
+
const fn = window[def.fncName];
|
|
161
|
+
result = result && await fn(
|
|
162
|
+
this,
|
|
163
|
+
...this.getScriptEventParams(arrayOrArray(def.fncParams))
|
|
164
|
+
);
|
|
165
|
+
} catch (e) {
|
|
166
|
+
console.error(e);
|
|
167
|
+
this.form.execution.notifications.add(
|
|
168
|
+
new MessageNotification({
|
|
169
|
+
message: labels.errorOnEvent(this.execution, def.fncName),
|
|
170
|
+
type: "error"
|
|
171
|
+
})
|
|
172
|
+
);
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
178
|
+
async fireEvent(evtName) {
|
|
179
|
+
this._state.isLoading = true;
|
|
180
|
+
try {
|
|
181
|
+
const event = arrayOrArray(this.definition.event).find(
|
|
182
|
+
(c) => c.name === evtName
|
|
183
|
+
);
|
|
184
|
+
if (!event) {
|
|
185
|
+
throw new Error("Unknown event " + evtName);
|
|
186
|
+
}
|
|
187
|
+
const scriptsResult = !event.script || await this.fireScriptEvents(event);
|
|
188
|
+
if (scriptsResult && event.serverEvents) {
|
|
189
|
+
return (await this.processResult(
|
|
190
|
+
(await this.postMessage("fireEvent", evtName))?.data
|
|
191
|
+
))?.success || false;
|
|
192
|
+
}
|
|
193
|
+
return scriptsResult && !event.serverEvents;
|
|
194
|
+
} finally {
|
|
195
|
+
this._state.isLoading = false;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
getProperty(prpName) {
|
|
199
|
+
return this._state.properties[prpName];
|
|
200
|
+
}
|
|
201
|
+
async postMessage(method, body) {
|
|
202
|
+
return post(
|
|
203
|
+
this.execution,
|
|
204
|
+
makeApiaUrl(this.execution, {
|
|
205
|
+
ajaxUrl: actions.forms,
|
|
206
|
+
action: "cusCmpProcess",
|
|
207
|
+
method,
|
|
208
|
+
cmpId: this.definition.id,
|
|
209
|
+
frmId: this.form.definition.id,
|
|
210
|
+
frmParent: this.form.definition.frmParent
|
|
211
|
+
}),
|
|
212
|
+
{
|
|
213
|
+
postData: typeof body === "string" ? {
|
|
214
|
+
payload: encodeStrToBase64Utf8(body)
|
|
215
|
+
} : body,
|
|
216
|
+
postDataTreatment: "stringify"
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
async setStringValue(attName, value) {
|
|
221
|
+
this._state.isLoading = true;
|
|
222
|
+
try {
|
|
223
|
+
return (await this.processResult(
|
|
224
|
+
(await this.postMessage(
|
|
225
|
+
"setValue",
|
|
226
|
+
JSON.stringify({
|
|
227
|
+
attName,
|
|
228
|
+
clear: true,
|
|
229
|
+
value
|
|
230
|
+
})
|
|
231
|
+
))?.data
|
|
232
|
+
))?.success || false;
|
|
233
|
+
} finally {
|
|
234
|
+
this._state.isLoading = false;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
getStringValue(attName) {
|
|
238
|
+
return this._state.attributes[attName]?.join("");
|
|
239
|
+
}
|
|
240
|
+
getValue(attName, index = 0) {
|
|
241
|
+
return this._state.attributes[attName]?.[index];
|
|
242
|
+
}
|
|
243
|
+
getValues(attName) {
|
|
244
|
+
return this._state.attributes[attName];
|
|
245
|
+
}
|
|
246
|
+
async removeIndex(attName, index) {
|
|
247
|
+
this._state.isLoading = true;
|
|
248
|
+
try {
|
|
249
|
+
return (await this.processResult(
|
|
250
|
+
(await post(
|
|
251
|
+
this.execution,
|
|
252
|
+
makeApiaUrl(this.execution, {
|
|
253
|
+
ajaxUrl: actions.forms,
|
|
254
|
+
action: "cusCmpProcess",
|
|
255
|
+
method: "removeIndex",
|
|
256
|
+
cmpId: this.definition.id,
|
|
257
|
+
frmId: this.form.definition.id,
|
|
258
|
+
frmParent: this.form.definition.frmParent
|
|
259
|
+
}),
|
|
260
|
+
{
|
|
261
|
+
postData: {
|
|
262
|
+
attName,
|
|
263
|
+
index
|
|
264
|
+
},
|
|
265
|
+
postDataTreatment: "stringify"
|
|
266
|
+
}
|
|
267
|
+
))?.data
|
|
268
|
+
))?.success || false;
|
|
269
|
+
} finally {
|
|
270
|
+
this._state.isLoading = false;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
async setValue(attName, value, index) {
|
|
274
|
+
this._state.isLoading = true;
|
|
275
|
+
try {
|
|
276
|
+
return (await this.processResult(
|
|
277
|
+
(await this.postMessage(
|
|
278
|
+
"setValue",
|
|
279
|
+
JSON.stringify({
|
|
280
|
+
index,
|
|
281
|
+
attName,
|
|
282
|
+
value
|
|
283
|
+
})
|
|
284
|
+
))?.data
|
|
285
|
+
))?.success || false;
|
|
286
|
+
} finally {
|
|
287
|
+
this._state.isLoading = false;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
async setProperty(prpName, value) {
|
|
291
|
+
this._state.isLoading = true;
|
|
292
|
+
try {
|
|
293
|
+
return (await this.processResult(
|
|
294
|
+
(await this.postMessage(
|
|
295
|
+
"setProperty",
|
|
296
|
+
JSON.stringify({
|
|
297
|
+
prpName,
|
|
298
|
+
value
|
|
299
|
+
})
|
|
300
|
+
))?.data
|
|
301
|
+
))?.success || false;
|
|
302
|
+
} finally {
|
|
303
|
+
this._state.isLoading = false;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
async sendMessage(payload) {
|
|
307
|
+
this._state.isLoading = true;
|
|
308
|
+
try {
|
|
309
|
+
return await this.processResult(
|
|
310
|
+
(await this.postMessage(
|
|
311
|
+
"message",
|
|
312
|
+
typeof payload === "object" && payload ? JSON.stringify(payload) : payload
|
|
313
|
+
))?.data
|
|
314
|
+
);
|
|
315
|
+
} finally {
|
|
316
|
+
this._state.isLoading = false;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
async download(attName, index) {
|
|
320
|
+
this._state.isLoading = true;
|
|
321
|
+
try {
|
|
322
|
+
const data = await this.processResult(
|
|
323
|
+
(await this.postMessage("download", { attName, index }))?.data
|
|
324
|
+
);
|
|
325
|
+
if (data?.url) {
|
|
326
|
+
window.open(data.url, "_blank");
|
|
327
|
+
}
|
|
328
|
+
} finally {
|
|
329
|
+
this._state.isLoading = false;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
async upload(attName, file, options) {
|
|
333
|
+
this._state.isLoading = true;
|
|
334
|
+
try {
|
|
335
|
+
const formData = new FormData();
|
|
336
|
+
formData.append("file", file);
|
|
337
|
+
Object.entries(options?.params || {}).forEach(
|
|
338
|
+
([key, value]) => formData.append(key, value)
|
|
339
|
+
);
|
|
340
|
+
const response = await axios.post(
|
|
341
|
+
await makeApiaUrl(this.execution, {
|
|
342
|
+
ajaxUrl: actions.forms,
|
|
343
|
+
action: "cusCmpProcess",
|
|
344
|
+
method: "upload",
|
|
345
|
+
cmpId: this.definition.id,
|
|
346
|
+
frmId: this.form.definition.id,
|
|
347
|
+
frmParent: this.form.definition.frmParent,
|
|
348
|
+
attName,
|
|
349
|
+
originalName: file.name
|
|
350
|
+
}),
|
|
351
|
+
formData,
|
|
352
|
+
{
|
|
353
|
+
signal: options?.signal,
|
|
354
|
+
onUploadProgress({ total, progress }) {
|
|
355
|
+
const percent = Math.round((progress || 0) / (total || 1) * 100 * 100) / 100;
|
|
356
|
+
options?.onUploadProgress?.(percent);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
);
|
|
360
|
+
const result = await parseSuccessfulResponse(
|
|
361
|
+
this.execution,
|
|
362
|
+
response
|
|
363
|
+
);
|
|
364
|
+
return await this.processResult(
|
|
365
|
+
result
|
|
366
|
+
);
|
|
367
|
+
} finally {
|
|
368
|
+
this._state.isLoading = false;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
setState(prop, value) {
|
|
372
|
+
this._state[prop] = value;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
_hasInited = new WeakMap();
|
|
376
|
+
|
|
377
|
+
export { CustomComponent };
|
|
378
|
+
//# sourceMappingURL=CustomComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomComponent.js","sources":["../../../../../src/main/Execution/FormsExecution/customComponents/CustomComponent.ts"],"sourcesContent":["import { computed, makeObservable, observable, toJS } from 'mobx';\r\nimport { makeApiaUrl } from '../../../../util';\r\nimport { actions } from '../constants/actions';\r\nimport { parseXml, post } from '../../../../util';\r\nimport type { Form } from '../Form';\r\nimport { setAjaxFormResponse } from '../events/setAjaxFormResponse';\r\nimport { TFieldAjaxEventResponsePayload } from '../types';\r\nimport { ResponseSysMessages } from '../../../../util/api/types';\r\nimport {\r\n ComponentEvent,\r\n TCusCmpStateRequest,\r\n TCustomComponentDefaultResponse,\r\n TCustomComponentDefinition,\r\n} from '../../../InitialData/types/TApiaForm';\r\nimport {\r\n arrayOrArray,\r\n decodeBase64ToUtf8,\r\n DeepReadonly,\r\n encodeStrToBase64Utf8,\r\n} from '@apia/util';\r\nimport { TFncParams } from '../Field';\r\nimport { MessageNotification } from '../../../Notifications/MessageNotification';\r\nimport { labels } from '../../../../util/labels/labels';\r\nimport { ApiaForm, ApiaFunctions } from '../../../../programming';\r\nimport { getWindow } from '../../../../util/dom/getWindow';\r\nimport type { Execution } from '../..';\r\nimport axios, { AxiosRequestConfig } from 'axios';\r\nimport { parseSuccessfulResponse } from '../../../../util/api/apiaApi';\r\n\r\nexport type TCustomComponentState = {\r\n isLoading: boolean;\r\n\r\n attributes: Record<string, any[]>;\r\n properties: Record<string, any>;\r\n additional: any;\r\n\r\n component: any;\r\n};\r\n\r\nexport class CustomComponent {\r\n #hasInited = false;\r\n private form: Form = {} as Form;\r\n private _state: TCustomComponentState = {\r\n isLoading: false,\r\n attributes: {},\r\n properties: {},\r\n additional: {},\r\n component: null,\r\n };\r\n\r\n constructor(\r\n public execution: Execution,\r\n public readonly definition: TCustomComponentDefinition,\r\n ) {\r\n if (definition.error_while_processing) {\r\n throw new Error(\r\n `Cannot initialize custom component ${definition.name}: ${definition.error_while_processing}`,\r\n );\r\n }\r\n\r\n makeObservable<CustomComponent, '_state'>(this, {\r\n _state: observable,\r\n state: computed,\r\n });\r\n this.parseStateObject(definition.state.state);\r\n }\r\n\r\n public get state(): DeepReadonly<TCustomComponentState> {\r\n return toJS(this._state);\r\n }\r\n\r\n public getAdditional<T>() {\r\n return this.state.additional as DeepReadonly<T>;\r\n }\r\n\r\n public getCurrentForm() {\r\n return new ApiaForm(this.execution!, this.form);\r\n }\r\n\r\n async init(form: Form) {\r\n if (this.#hasInited) throw new Error('Cannot init field twice');\r\n this.#hasInited = true;\r\n this.form = form;\r\n }\r\n\r\n private parseStateObject(o: TCusCmpStateRequest) {\r\n if (o.additional) {\r\n try {\r\n this._state.additional = JSON.parse(o.additional);\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n }\r\n\r\n arrayOrArray(o.attribute).forEach((c) => {\r\n this._state.attributes[c.name] = arrayOrArray(\r\n JSON.parse(decodeBase64ToUtf8(c.values)),\r\n );\r\n });\r\n arrayOrArray(o.property).forEach((c) => {\r\n this._state.properties[c.name] = c.value;\r\n });\r\n }\r\n\r\n public async processResult<\r\n Result extends Record<string, unknown> = Record<string, unknown>,\r\n >(res?: TCustomComponentDefaultResponse | null) {\r\n let proceed = true;\r\n const scheduledEvents: string[] = [];\r\n\r\n const newState = res?.processResult?.state;\r\n\r\n if (newState) {\r\n for (const directive of arrayOrArray(newState.directive)) {\r\n if (directive.type === 'RELOAD') {\r\n proceed = false;\r\n getWindow(this.execution).location.assign(\r\n makeApiaUrl(this.execution, {\r\n ajaxUrl: actions.forms,\r\n action: 'reload',\r\n nuevo: true,\r\n\r\n cmpId: this.definition.id,\r\n frmId: this.form.definition.id,\r\n frmParent: this.form.definition.frmParent,\r\n }),\r\n );\r\n } else if (directive.type === 'FIRE') {\r\n scheduledEvents.push(directive.content);\r\n }\r\n }\r\n }\r\n\r\n if (proceed) {\r\n if (res!.ajaxUpdated) {\r\n const result = parseXml(res!.ajaxUpdated);\r\n\r\n setAjaxFormResponse(\r\n this.execution,\r\n result as TFieldAjaxEventResponsePayload & ResponseSysMessages,\r\n );\r\n }\r\n\r\n if (newState) {\r\n this.parseStateObject(newState);\r\n }\r\n\r\n for await (const event of scheduledEvents) {\r\n await this.fireEvent(event);\r\n }\r\n\r\n this._state.isLoading = false;\r\n\r\n return res!.processResult?.state?.result as Result & { success: boolean };\r\n }\r\n }\r\n\r\n protected getScriptEventParams(fncParams: TFncParams[]): unknown[] {\r\n const fncParamsArray = [];\r\n for (let e = 0; e < fncParams.length; e += 1) {\r\n if (fncParams[e].type === 'V') {\r\n fncParamsArray.push(fncParams[e].value);\r\n } else if (fncParams[e].type === 'E' || fncParams[e].type === 'P') {\r\n const paraAttId = fncParams[e].attId;\r\n if (paraAttId) {\r\n fncParamsArray.push(\r\n new ApiaFunctions(this.execution)\r\n .getForm(\r\n this.form.definition.formName,\r\n this.form.definition.frmParent,\r\n )!\r\n .getField(paraAttId),\r\n );\r\n }\r\n }\r\n }\r\n return fncParamsArray;\r\n }\r\n protected async fireScriptEvents(event: ComponentEvent): Promise<boolean> {\r\n let result = true;\r\n\r\n for await (const script of arrayOrArray(event.script)) {\r\n const def = JSON.parse(script.text) as {\r\n fncName: string;\r\n fncParams: {\r\n type: 'P' | 'E';\r\n attId: number;\r\n }[];\r\n };\r\n\r\n try {\r\n const fn = (window as any)[def.fncName] as (\r\n src: CustomComponent | Form,\r\n ...parameters: unknown[]\r\n ) => Promise<boolean>;\r\n result =\r\n result &&\r\n (await fn(\r\n this,\r\n ...this.getScriptEventParams(arrayOrArray(def.fncParams)),\r\n ));\r\n } catch (e) {\r\n console.error(e);\r\n this.form.execution.notifications.add(\r\n new MessageNotification({\r\n message: labels.errorOnEvent(this.execution, def.fncName),\r\n type: 'error',\r\n }),\r\n );\r\n return false;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n async fireEvent(evtName: string) {\r\n this._state.isLoading = true;\r\n\r\n try {\r\n const event = arrayOrArray(this.definition.event).find(\r\n (c) => c.name === evtName,\r\n );\r\n if (!event) {\r\n throw new Error('Unknown event ' + evtName);\r\n }\r\n\r\n const scriptsResult =\r\n !event.script || (await this.fireScriptEvents(event));\r\n\r\n if (scriptsResult && event.serverEvents) {\r\n return (\r\n (\r\n await this.processResult(\r\n (await this.postMessage('fireEvent', evtName))?.data,\r\n )\r\n )?.success || false\r\n );\r\n }\r\n\r\n return scriptsResult && !event.serverEvents;\r\n } finally {\r\n this._state.isLoading = false;\r\n }\r\n }\r\n\r\n getProperty(prpName: string) {\r\n return this._state.properties[prpName];\r\n }\r\n\r\n private async postMessage(method: string, body: any) {\r\n return post<TCustomComponentDefaultResponse>(\r\n this.execution,\r\n makeApiaUrl(this.execution, {\r\n ajaxUrl: actions.forms,\r\n action: 'cusCmpProcess',\r\n method,\r\n\r\n cmpId: this.definition.id,\r\n frmId: this.form.definition.id,\r\n frmParent: this.form.definition.frmParent,\r\n }),\r\n {\r\n postData:\r\n typeof body === 'string'\r\n ? {\r\n payload: encodeStrToBase64Utf8(body),\r\n }\r\n : body,\r\n postDataTreatment: 'stringify',\r\n },\r\n );\r\n }\r\n\r\n async setStringValue(attName: string, value: string) {\r\n this._state.isLoading = true;\r\n\r\n try {\r\n return (\r\n (\r\n await this.processResult(\r\n (\r\n await this.postMessage(\r\n 'setValue',\r\n JSON.stringify({\r\n attName,\r\n clear: true,\r\n value,\r\n }),\r\n )\r\n )?.data,\r\n )\r\n )?.success || false\r\n );\r\n } finally {\r\n this._state.isLoading = false;\r\n }\r\n }\r\n\r\n getStringValue(attName: string) {\r\n return this._state.attributes[attName]?.join('');\r\n }\r\n\r\n getValue(attName: string, index: number = 0) {\r\n return this._state.attributes[attName]?.[index];\r\n }\r\n\r\n getValues(attName: string) {\r\n return this._state.attributes[attName];\r\n }\r\n\r\n async removeIndex(attName: string, index: number) {\r\n this._state.isLoading = true;\r\n\r\n try {\r\n return (\r\n (\r\n await this.processResult(\r\n (\r\n await post<TCustomComponentDefaultResponse>(\r\n this.execution,\r\n makeApiaUrl(this.execution, {\r\n ajaxUrl: actions.forms,\r\n action: 'cusCmpProcess',\r\n method: 'removeIndex',\r\n\r\n cmpId: this.definition.id,\r\n frmId: this.form.definition.id,\r\n frmParent: this.form.definition.frmParent,\r\n }),\r\n {\r\n postData: {\r\n attName,\r\n index,\r\n },\r\n postDataTreatment: 'stringify',\r\n },\r\n )\r\n )?.data,\r\n )\r\n )?.success || false\r\n );\r\n } finally {\r\n this._state.isLoading = false;\r\n }\r\n }\r\n\r\n async setValue(attName: string, value: any, index: number) {\r\n this._state.isLoading = true;\r\n\r\n try {\r\n return (\r\n (\r\n await this.processResult(\r\n (\r\n await this.postMessage(\r\n 'setValue',\r\n JSON.stringify({\r\n index,\r\n attName,\r\n value,\r\n }),\r\n )\r\n )?.data,\r\n )\r\n )?.success || false\r\n );\r\n } finally {\r\n this._state.isLoading = false;\r\n }\r\n }\r\n\r\n async setProperty(prpName: string, value: any) {\r\n this._state.isLoading = true;\r\n\r\n try {\r\n return (\r\n (\r\n await this.processResult(\r\n (\r\n await this.postMessage(\r\n 'setProperty',\r\n JSON.stringify({\r\n prpName,\r\n value,\r\n }),\r\n )\r\n )?.data,\r\n )\r\n )?.success || false\r\n );\r\n } finally {\r\n this._state.isLoading = false;\r\n }\r\n }\r\n\r\n async sendMessage<\r\n T extends Record<string, unknown> = Record<string, unknown>,\r\n >(payload: any) {\r\n this._state.isLoading = true;\r\n\r\n try {\r\n return await this.processResult<T>(\r\n (\r\n await this.postMessage(\r\n 'message',\r\n typeof payload === 'object' && payload\r\n ? JSON.stringify(payload)\r\n : payload,\r\n )\r\n )?.data,\r\n );\r\n } finally {\r\n this._state.isLoading = false;\r\n }\r\n }\r\n\r\n async download(attName: string, index: number) {\r\n this._state.isLoading = true;\r\n\r\n try {\r\n const data = await this.processResult<{ url: string }>(\r\n (await this.postMessage('download', { attName, index }))?.data,\r\n );\r\n\r\n if (data?.url) {\r\n window.open(data.url, '_blank');\r\n }\r\n } finally {\r\n this._state.isLoading = false;\r\n }\r\n }\r\n\r\n async upload(\r\n attName: string,\r\n file: File,\r\n options?: {\r\n onUploadProgress?: (percent: number) => unknown;\r\n params?: Record<string, any>;\r\n } & Pick<AxiosRequestConfig<any>, 'signal'>,\r\n ) {\r\n this._state.isLoading = true;\r\n\r\n try {\r\n const formData = new FormData();\r\n formData.append('file', file);\r\n\r\n Object.entries(options?.params || {}).forEach(([key, value]) =>\r\n formData.append(key, value),\r\n );\r\n\r\n const response = await axios.post<string>(\r\n await makeApiaUrl(this.execution, {\r\n ajaxUrl: actions.forms,\r\n action: 'cusCmpProcess',\r\n method: 'upload',\r\n\r\n cmpId: this.definition.id,\r\n frmId: this.form.definition.id,\r\n frmParent: this.form.definition.frmParent,\r\n attName,\r\n originalName: file.name,\r\n }),\r\n formData,\r\n {\r\n signal: options?.signal,\r\n onUploadProgress({ total, progress }) {\r\n const percent =\r\n Math.round(((progress || 0) / (total || 1)) * 100 * 100) / 100;\r\n options?.onUploadProgress?.(percent);\r\n },\r\n },\r\n );\r\n\r\n const result =\r\n await parseSuccessfulResponse<TCustomComponentDefaultResponse>(\r\n this.execution,\r\n response,\r\n );\r\n\r\n return await this.processResult<{ index: number; fileName: string }>(\r\n result,\r\n );\r\n } finally {\r\n this._state.isLoading = false;\r\n }\r\n }\r\n\r\n public setState<K extends keyof TCustomComponentState>(\r\n prop: K,\r\n value: TCustomComponentState[K],\r\n ) {\r\n this._state[prop] = value;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,UAAA;AAuCO,MAAM,eAAA,CAAgB;AAAA,EAW3B,WAAA,CACS,WACS,UAAA,EAChB;AAFO,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA;AACS,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AAZlB,IAAA,YAAA,CAAA,IAAA,EAAA,UAAA,EAAa,KAAA,CAAA;AACb,IAAA,aAAA,CAAA,IAAA,EAAQ,QAAa,EAAC,CAAA;AACtB,IAAA,aAAA,CAAA,IAAA,EAAQ,QAAA,EAAgC;AAAA,MACtC,SAAA,EAAW,KAAA;AAAA,MACX,YAAY,EAAC;AAAA,MACb,YAAY,EAAC;AAAA,MACb,YAAY,EAAC;AAAA,MACb,SAAA,EAAW;AAAA,KACb,CAAA;AAME,IAAA,IAAI,WAAW,sBAAA,EAAwB;AACrC,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,CAAA,mCAAA,EAAsC,UAAA,CAAW,IAAI,CAAA,EAAA,EAAK,WAAW,sBAAsB,CAAA;AAAA,OAC7F;AAAA;AAGF,IAAA,cAAA,CAA0C,IAAA,EAAM;AAAA,MAC9C,MAAA,EAAQ,UAAA;AAAA,MACR,KAAA,EAAO;AAAA,KACR,CAAA;AACD,IAAA,IAAA,CAAK,g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A,EAAO,IAAA,CAAK,IAAA,CAAK,UAAA,CAAW,EAAA;AAAA,UAC5B,SAAA,EAAW,IAAA,CAAK,IAAA,CAAK,UAAA,CAAW,SAAA;AAAA,UAChC,OAAA;AAAA,UACA,cAAc,IAAA,CAAK;AAAA,SACpB,CAAA;AAAA,QACD,QAAA;AAAA,QACA;AAAA,UACE,QAAQ,OAAA,EAAS,MAAA;AAAA,UACjB,gBAAA,CAAiB,EAAE,KAAA,EAAO,QAAA,EAAS,EAAG;AACpC,YAAA,MAAM,OAAA,GACJ,KAAK,KAAA,CAAA,CAAQ,QAAA,IAAY,MAAM,KAAA,IAAS,CAAA,CAAA,GAAM,GAAA,GAAM,GAAG,CAAA,GAAI,GAAA;AAC7D,YAAA,OAAA,EAAS,mBAAmB,OAAO,CAAA;AAAA;AACrC;AACF,OACF;AAEA,MAAA,MAAM,SACJ,MAAM,uBAAA;AAAA,QACJ,IAAA,CAAK,SAAA;AAAA,QACL;AAAA,OACF;AAEF,MAAA,OAAO,MAAM,IAAA,CAAK,aAAA;AAAA,QAChB;AAAA,OACF;AAAA,KACF,SAAE;AACA,MAAA,IAAA,CAAK,OAAO,SAAA,GAAY,KAAA;AAAA;AAC1B;AACF,EAEO,QAAA,CACL,MACA,KAAA,EACA;AACA,IAAA,IAAA,CAAK,MAAA,CAAO,IAAI,CAAA,GAAI,KAAA;AAAA;AAExB;AAtcE,UAAA,GAAA,IAAA,OAAA,EAAA;;;;"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import IProperty from '../constants/IProperty.js';
|
|
2
|
+
import { MessageNotification } from '../../../Notifications/MessageNotification.js';
|
|
3
|
+
import { parseMessages } from '../../../../util/api/apiaApi.js';
|
|
4
|
+
import { arrayOrArray } from '@apia/util';
|
|
5
|
+
|
|
6
|
+
const setAjaxFormResponse = async (execution, response) => {
|
|
7
|
+
const forms = arrayOrArray(response.form);
|
|
8
|
+
for (let i = 0; i < forms.length; i += 1) {
|
|
9
|
+
const formId = forms[i].i;
|
|
10
|
+
const form = forms[i];
|
|
11
|
+
const [frmParent, id] = formId.split("_");
|
|
12
|
+
const apiaForm = execution.getFormById(id, frmParent);
|
|
13
|
+
arrayOrArray(form.cusCmp).forEach((c) => {
|
|
14
|
+
apiaForm?.getCustomComponentByFldId(Number.parseInt(String(c.id)))?.processResult({ processResult: { state: c.state } });
|
|
15
|
+
});
|
|
16
|
+
const changedGrids = arrayOrArray(form.changedGrids.grdId);
|
|
17
|
+
changedGrids.forEach(({ id: id2 }) => {
|
|
18
|
+
apiaForm?.getFieldById(id2)?.refresh();
|
|
19
|
+
});
|
|
20
|
+
if (!apiaForm) {
|
|
21
|
+
execution.notifications.add(
|
|
22
|
+
new MessageNotification({
|
|
23
|
+
message: `Form with id ${formId} not found`
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const ajaxFields = arrayOrArray(forms[i].field);
|
|
29
|
+
for (let f = 0; f < ajaxFields.length; f += 1) {
|
|
30
|
+
const apiField = apiaForm?.getFieldById(ajaxFields[f].i);
|
|
31
|
+
if (apiField) {
|
|
32
|
+
if (ajaxFields[f].possibleValues !== void 0) {
|
|
33
|
+
const possibleValuesItems = arrayOrArray(
|
|
34
|
+
ajaxFields[f].possibleValues
|
|
35
|
+
);
|
|
36
|
+
const items = arrayOrArray(possibleValuesItems[0]?.item);
|
|
37
|
+
if (items) {
|
|
38
|
+
if (["multiple", "radio", "select"].includes(
|
|
39
|
+
apiField.definition.fieldType
|
|
40
|
+
)) {
|
|
41
|
+
apiField.setProperty(
|
|
42
|
+
"possibleValue",
|
|
43
|
+
items.map((current) => {
|
|
44
|
+
const v = current.v;
|
|
45
|
+
const l = current.text;
|
|
46
|
+
const value = typeof v === "boolean" ? String(v) : v;
|
|
47
|
+
const label = typeof l === "boolean" ? String(l) : l;
|
|
48
|
+
return {
|
|
49
|
+
value,
|
|
50
|
+
label
|
|
51
|
+
};
|
|
52
|
+
})
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (["tree"].includes(apiField.definition.fieldType) && ajaxFields[f].field) {
|
|
58
|
+
const propertiesObj = ajaxFields[f]?.field?.properties || {};
|
|
59
|
+
Object.keys(propertiesObj).forEach((key) => {
|
|
60
|
+
let value = propertiesObj[key];
|
|
61
|
+
if (typeof value === "string") {
|
|
62
|
+
const lowerValue = value.toLowerCase();
|
|
63
|
+
if (lowerValue === "t" || lowerValue === "true") {
|
|
64
|
+
value = true;
|
|
65
|
+
} else if (lowerValue === "f" || lowerValue === "false") {
|
|
66
|
+
value = false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
apiField.setProperty(key, value);
|
|
70
|
+
});
|
|
71
|
+
const possibleValues = arrayOrArray(
|
|
72
|
+
ajaxFields[f]?.field?.possibleValue
|
|
73
|
+
);
|
|
74
|
+
apiField.setProperty("possibleValue", possibleValues);
|
|
75
|
+
}
|
|
76
|
+
if (["file"].includes(apiField.definition.fieldType) && ajaxFields[f].field) {
|
|
77
|
+
const fileField = apiField;
|
|
78
|
+
if (ajaxFields[f]?.field?.file_prp) {
|
|
79
|
+
fileField.loadFromDefinition(
|
|
80
|
+
ajaxFields[f]?.field?.file_prp
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (ajaxFields[f].c !== void 0) {
|
|
86
|
+
const { c } = ajaxFields[f];
|
|
87
|
+
let value = void 0;
|
|
88
|
+
if (typeof c !== "object" || c.k !== "t") {
|
|
89
|
+
if (typeof c === "string") {
|
|
90
|
+
value = c;
|
|
91
|
+
} else {
|
|
92
|
+
const valuesArray = arrayOrArray(c?.valueAttr);
|
|
93
|
+
value = valuesArray.reduce((reduced, current) => {
|
|
94
|
+
return reduced + current.v;
|
|
95
|
+
}, "");
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (apiField.attribute && value !== void 0) {
|
|
99
|
+
apiField.setValue(value, {
|
|
100
|
+
force: true,
|
|
101
|
+
synchronize: false
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (ajaxFields[f].e !== void 0) {
|
|
106
|
+
const ajaxProps = arrayOrArray(ajaxFields[f].e);
|
|
107
|
+
for (let c = 0; c < ajaxProps.length; c += 1) {
|
|
108
|
+
if (ajaxProps[c]?.f) {
|
|
109
|
+
const prop = arrayOrArray(ajaxProps[c]?.f);
|
|
110
|
+
for (let p = 0; p < prop.length; p += 1) {
|
|
111
|
+
if (prop[p]?.i) {
|
|
112
|
+
if (prop[p]?.i) {
|
|
113
|
+
if (prop[p]?.v.toLowerCase() === "f") {
|
|
114
|
+
apiField.setProperty(prop[p]?.i, false);
|
|
115
|
+
} else if (prop[p]?.v.toLowerCase() === "t") {
|
|
116
|
+
apiField.setProperty(prop[p]?.i, true);
|
|
117
|
+
} else {
|
|
118
|
+
apiField.setProperty(prop[p]?.i, prop[p]?.v);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
} else if (ajaxFields[f]?.field) {
|
|
126
|
+
const ajaxProps = ajaxFields[f]?.field?.properties;
|
|
127
|
+
apiField.properties = ajaxProps;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (form.v === "t" && String(apiaForm.properties[IProperty.PROPERTY_FORM_HIDDEN]) !== "true") {
|
|
131
|
+
apiaForm.setProperty(IProperty.PROPERTY_FORM_HIDDEN, true);
|
|
132
|
+
} else if (form.v === "f" && String(apiaForm.getProperty(IProperty.PROPERTY_FORM_HIDDEN)) === "true") {
|
|
133
|
+
apiaForm.setProperty(IProperty.PROPERTY_FORM_HIDDEN, false);
|
|
134
|
+
}
|
|
135
|
+
if (form.c === "t" && String(apiaForm.getProperty(IProperty.PROPERTY_FORM_CLOSED)) !== "true") {
|
|
136
|
+
apiaForm.toggleFormCollapse();
|
|
137
|
+
} else if (form.c === "f" && String(apiaForm.getProperty(IProperty.PROPERTY_FORM_CLOSED)) === "true") {
|
|
138
|
+
apiaForm.openForm();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (response.proccess?.p) {
|
|
142
|
+
execution.getProcess()?.setPriority(response.proccess.p);
|
|
143
|
+
}
|
|
144
|
+
if (response.data) {
|
|
145
|
+
parseMessages(execution, response.data);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export { setAjaxFormResponse };
|
|
150
|
+
//# sourceMappingURL=setAjaxFormResponse.js.map
|