@apia/execution 5.0.0 → 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 -3688
- package/dist/index.js +83 -8379
- 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 +8 -8
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import { getLabel, labels } from '../../../../../util/labels/labels.js';
|
|
3
|
+
import { TranslatableField } from '../../TranslatableField/index.js';
|
|
4
|
+
import { getDateFormat } from '@apia/util';
|
|
5
|
+
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __publicField = (obj, key, value) => {
|
|
10
|
+
__defNormalProp(obj, key + "" , value);
|
|
11
|
+
return value;
|
|
12
|
+
};
|
|
13
|
+
dayjs.extend(customParseFormat);
|
|
14
|
+
function escapeRegExp(value) {
|
|
15
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
16
|
+
}
|
|
17
|
+
function parseNumber(value) {
|
|
18
|
+
const charThousSeparator = window.CHAR_THOUS_SEPARATOR || ".";
|
|
19
|
+
const charDecimalSeparator = window.CHAR_DECIMAL_SEPARATOR || ",";
|
|
20
|
+
const regexpThousSeparator = escapeRegExp(charThousSeparator);
|
|
21
|
+
const regexpDecimalSeparator = escapeRegExp(charDecimalSeparator);
|
|
22
|
+
const regexp = new RegExp(
|
|
23
|
+
`^-?(?:(?:\\d+)|(?:\\d{1,3}${regexpThousSeparator}\\d{3}(?:${regexpThousSeparator}\\d{3})*))(?:${regexpDecimalSeparator}\\d+)?$`
|
|
24
|
+
);
|
|
25
|
+
const trimmedValue = value.trim();
|
|
26
|
+
if (!trimmedValue.match(regexp)) {
|
|
27
|
+
return NaN;
|
|
28
|
+
}
|
|
29
|
+
let aux = trimmedValue.replaceAll(charThousSeparator, "");
|
|
30
|
+
aux = aux.replaceAll(charDecimalSeparator, ".");
|
|
31
|
+
return parseFloat(aux);
|
|
32
|
+
}
|
|
33
|
+
class Input extends TranslatableField {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
__publicField(this, "validDate", true);
|
|
37
|
+
}
|
|
38
|
+
fireEvent(eventName, options) {
|
|
39
|
+
return super.fireEvent(eventName, options);
|
|
40
|
+
}
|
|
41
|
+
async setValue(newValue, options) {
|
|
42
|
+
if (this.attribute.valueType === "S") {
|
|
43
|
+
if (!this.definition.regExp || this.validateRegex(String(newValue))) {
|
|
44
|
+
if (String(newValue) !== "")
|
|
45
|
+
this.state.validation.errorMessage = null;
|
|
46
|
+
return super.setValue(String(newValue), options);
|
|
47
|
+
}
|
|
48
|
+
} else if (this.attribute.valueType === "N") {
|
|
49
|
+
if (newValue instanceof Date) {
|
|
50
|
+
throw new Error("A numeric input cannot be set from a date");
|
|
51
|
+
}
|
|
52
|
+
let actualValue = newValue;
|
|
53
|
+
if (typeof newValue === "string") {
|
|
54
|
+
actualValue = parseNumber(newValue);
|
|
55
|
+
if (isNaN(actualValue)) {
|
|
56
|
+
this.setError("Wrong value format");
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
actualValue = String(actualValue).replaceAll(".", ",");
|
|
60
|
+
}
|
|
61
|
+
return super.setValue(actualValue, options);
|
|
62
|
+
} else if (this.attribute.valueType === "D") {
|
|
63
|
+
this.validDate = true;
|
|
64
|
+
const inFmt = getDateFormat(options?.format);
|
|
65
|
+
const outFmt = getDateFormat();
|
|
66
|
+
if (typeof newValue === "string") {
|
|
67
|
+
const trimmed = newValue.trim();
|
|
68
|
+
if (/^\d+$/.test(trimmed)) {
|
|
69
|
+
let ms = Number(trimmed);
|
|
70
|
+
if (trimmed.length === 10)
|
|
71
|
+
ms *= 1e3;
|
|
72
|
+
const d2 = dayjs(ms);
|
|
73
|
+
if (!d2.isValid() && trimmed !== "") {
|
|
74
|
+
this.state.validation.errorMessage = getLabel(
|
|
75
|
+
this.getForm().execution,
|
|
76
|
+
"msgInvalidDate"
|
|
77
|
+
).text;
|
|
78
|
+
this.validDate = false;
|
|
79
|
+
}
|
|
80
|
+
return super.setValue(d2.isValid() ? d2.format(outFmt) : "", options);
|
|
81
|
+
}
|
|
82
|
+
const formats = [`${inFmt} HH:mm`, inFmt];
|
|
83
|
+
const d = dayjs(trimmed, formats, true);
|
|
84
|
+
if (!d.isValid() && trimmed !== "") {
|
|
85
|
+
this.state.validation.errorMessage = getLabel(
|
|
86
|
+
this.getForm().execution,
|
|
87
|
+
"msgInvalidDate"
|
|
88
|
+
).text;
|
|
89
|
+
this.validDate = false;
|
|
90
|
+
}
|
|
91
|
+
if (!d.isValid()) {
|
|
92
|
+
return super.setValue("", options);
|
|
93
|
+
}
|
|
94
|
+
const hasTime = trimmed.includes(":");
|
|
95
|
+
const finalFormat = hasTime ? `${outFmt} HH:mm` : outFmt;
|
|
96
|
+
return super.setValue(d.format(finalFormat), options);
|
|
97
|
+
}
|
|
98
|
+
if (typeof newValue === "number") {
|
|
99
|
+
const d = dayjs(newValue);
|
|
100
|
+
if (!d.isValid()) {
|
|
101
|
+
this.state.validation.errorMessage = getLabel(
|
|
102
|
+
this.getForm().execution,
|
|
103
|
+
"msgInvalidDate"
|
|
104
|
+
).text;
|
|
105
|
+
this.validDate = false;
|
|
106
|
+
}
|
|
107
|
+
return super.setValue(d.isValid() ? d.format(outFmt) : "", options);
|
|
108
|
+
}
|
|
109
|
+
if (newValue instanceof Date) {
|
|
110
|
+
const d = dayjs(newValue);
|
|
111
|
+
if (!d.isValid()) {
|
|
112
|
+
this.state.validation.errorMessage = getLabel(
|
|
113
|
+
this.getForm().execution,
|
|
114
|
+
"msgInvalidDate"
|
|
115
|
+
).text;
|
|
116
|
+
this.validDate = false;
|
|
117
|
+
}
|
|
118
|
+
return super.setValue(d.isValid() ? d.format(outFmt) : "", options);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
validateRegex(value) {
|
|
124
|
+
if (!value) {
|
|
125
|
+
this.state.validation.errorMessage = "";
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
const regex = new RegExp(this.definition.regExp ?? "");
|
|
129
|
+
if (!regex.test(String(value)) && value !== "") {
|
|
130
|
+
this.state.validation.errorMessage = this.properties.regExpMessage || labels.errorRegexNotValidated();
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
async validate() {
|
|
136
|
+
if (this.state.validation.errorMessage && !this.validDate)
|
|
137
|
+
return false;
|
|
138
|
+
return super.validate();
|
|
139
|
+
}
|
|
140
|
+
isValidValue() {
|
|
141
|
+
return !!String(this.getValue()).trim();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export { Input };
|
|
146
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/Input/index.ts"],"sourcesContent":["import dayjs from 'dayjs';\r\nimport { getLabel, labels } from '../../../../../util/labels/labels';\r\nimport { TApiaInputProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { TApiaInputDefinition } from '../../../../InitialData/types/fields/TApiaInputDefinition';\r\nimport { TranslatableField } from '../../TranslatableField';\r\nimport { SetValueOptions } from '../../types';\r\nimport { getDateFormat } from '@apia/util';\r\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\r\nimport { TFireEventOptions } from '../../FieldWithAttribute';\r\n\r\n// Enable format-aware strict parsing so invalid dates (e.g., \"31/02/2025\") are rejected instead of auto-rolling to \"03/03/2025\".\r\ndayjs.extend(customParseFormat);\r\n\r\ntype InputEvents = 'onChange' | 'onModalReturn';\n\nfunction escapeRegExp(value: string) {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction parseNumber(value: string) {\n const charThousSeparator = window.CHAR_THOUS_SEPARATOR || '.';\n const charDecimalSeparator = window.CHAR_DECIMAL_SEPARATOR || ',';\n\n const regexpThousSeparator = escapeRegExp(charThousSeparator);\n const regexpDecimalSeparator = escapeRegExp(charDecimalSeparator);\n\n const regexp = new RegExp(\n `^-?(?:(?:\\\\d+)|(?:\\\\d{1,3}${regexpThousSeparator}\\\\d{3}(?:${regexpThousSeparator}\\\\d{3})*))(?:${regexpDecimalSeparator}\\\\d+)?$`,\n );\n\n const trimmedValue = value.trim();\n\n if (!trimmedValue.match(regexp)) {\n return NaN;\n }\n\n let aux = trimmedValue.replaceAll(charThousSeparator, '');\n aux = aux.replaceAll(charDecimalSeparator, '.');\n return parseFloat(aux);\n}\n\r\nexport class Input extends TranslatableField<\r\n TApiaInputProperties,\r\n string | number,\r\n TApiaInputDefinition\r\n> {\r\n private validDate = true;\r\n\r\n fireEvent(\r\n eventName: InputEvents,\r\n options?: TFireEventOptions,\r\n ): Promise<boolean> {\r\n return super.fireEvent(eventName, options);\r\n }\r\n\r\n public async setValue(\r\n newValue: string | Date | number,\r\n options?: SetValueOptions,\r\n ): Promise<boolean> {\r\n if (this.attribute.valueType === 'S') {\r\n if (!this.definition.regExp || this.validateRegex(String(newValue))) {\r\n if (String(newValue) !== '') this.state.validation.errorMessage = null;\r\n return super.setValue(String(newValue), options);\r\n }\r\n } else if (this.attribute.valueType === 'N') {\r\n if (newValue instanceof Date) {\r\n throw new Error('A numeric input cannot be set from a date');\r\n }\r\n\r\n let actualValue: number | string = newValue;\r\n\r\n if (typeof newValue === 'string') {\r\n actualValue = parseNumber(newValue);\r\n if (isNaN(actualValue)) {\r\n this.setError('Wrong value format');\r\n return false;\r\n }\r\n actualValue = String(actualValue).replaceAll('.', ',');\r\n }\r\n\r\n return super.setValue(actualValue, options);\r\n } else if (this.attribute.valueType === 'D') {\r\n this.validDate = true;\r\n const inFmt = getDateFormat(options?.format);\r\n const outFmt = getDateFormat();\r\n\r\n if (typeof newValue === 'string') {\r\n const trimmed = newValue.trim();\r\n\r\n if (/^\\d+$/.test(trimmed)) {\r\n let ms = Number(trimmed);\r\n if (trimmed.length === 10) ms *= 1000;\r\n\r\n const d = dayjs(ms);\r\n\r\n if (!d.isValid() && trimmed !== '') {\r\n this.state.validation.errorMessage = getLabel(\r\n this.getForm().execution,\r\n 'msgInvalidDate',\r\n ).text;\r\n this.validDate = false;\r\n }\r\n\r\n return super.setValue(d.isValid() ? d.format(outFmt) : '', options);\r\n }\r\n\r\n const formats = [`${inFmt} HH:mm`, inFmt];\r\n\r\n const d = dayjs(trimmed, formats, true);\r\n\r\n if (!d.isValid() && trimmed !== '') {\r\n this.state.validation.errorMessage = getLabel(\r\n this.getForm().execution,\r\n 'msgInvalidDate',\r\n ).text;\r\n this.validDate = false;\r\n }\r\n\r\n if (!d.isValid()) {\r\n return super.setValue('', options);\r\n }\r\n\r\n const hasTime = trimmed.includes(':');\r\n const finalFormat = hasTime ? `${outFmt} HH:mm` : outFmt;\r\n\r\n return super.setValue(d.format(finalFormat), options);\r\n }\r\n\r\n if (typeof newValue === 'number') {\r\n const d = dayjs(newValue);\r\n if (!d.isValid()) {\r\n this.state.validation.errorMessage = getLabel(\r\n this.getForm().execution,\r\n 'msgInvalidDate',\r\n ).text;\r\n this.validDate = false;\r\n }\r\n return super.setValue(d.isValid() ? d.format(outFmt) : '', options);\r\n }\r\n\r\n if (newValue instanceof Date) {\r\n const d = dayjs(newValue);\r\n if (!d.isValid()) {\r\n this.state.validation.errorMessage = getLabel(\r\n this.getForm().execution,\r\n 'msgInvalidDate',\r\n ).text;\r\n this.validDate = false;\r\n }\r\n return super.setValue(d.isValid() ? d.format(outFmt) : '', options);\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private validateRegex(value: string): boolean {\r\n if (!value) {\r\n this.state.validation.errorMessage = '';\r\n return true;\r\n }\r\n\r\n const regex = new RegExp(this.definition.regExp ?? '');\r\n\r\n if (!regex.test(String(value)) && value !== '') {\r\n this.state.validation.errorMessage =\r\n this.properties.regExpMessage || labels.errorRegexNotValidated();\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public async validate(): Promise<boolean> {\r\n if (this.state.validation.errorMessage && !this.validDate) return false;\r\n return super.validate();\r\n }\r\n\r\n protected isValidValue(): boolean {\r\n return !!String(this.getValue()).trim();\r\n }\r\n}\r\n"],"names":["d"],"mappings":";;;;;;;;;;;;AAWA,KAAA,CAAM,OAAO,iBAAiB,CAAA;AAI9B,SAAS,aAAa,KAAA,EAAe;AACnC,EAAA,OAAO,KAAA,CAAM,OAAA,CAAQ,qBAAA,EAAuB,MAAM,CAAA;AACpD;AAEA,SAAS,YAAY,KAAA,EAAe;AAClC,EAAA,MAAM,kBAAA,GAAqB,OAAO,oBAAA,IAAwB,GAAA;AAC1D,EAAA,MAAM,oBAAA,GAAuB,OAAO,sBAAA,IAA0B,GAAA;AAE9D,EAAA,MAAM,oBAAA,GAAuB,aAAa,kBAAkB,CAAA;AAC5D,EAAA,MAAM,sBAAA,GAAyB,aAAa,oBAAoB,CAAA;AAEhE,EAAA,MAAM,SAAS,IAAI,MAAA;AAAA,IACjB,CAAA,0BAAA,EAA6B,oBAAoB,CAAA,SAAA,EAAY,oBAAoB,gBAAg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IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,YAAA,IAAgB,CAAC,IAAA,CAAK,SAAA;AAAW,MAAA,OAAO,KAAA;AAClE,IAAA,OAAO,MAAM,QAAA,EAAS;AAAA;AACxB,EAEU,YAAA,GAAwB;AAChC,IAAA,OAAO,CAAC,CAAC,MAAA,CAAO,KAAK,QAAA,EAAU,EAAE,IAAA,EAAK;AAAA;AAE1C;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TApiaLabelProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
|
|
2
|
+
import { TApiaLabelDefinition } from '../../../../InitialData/types/fields/TApiaLabelDefinition.js';
|
|
3
|
+
import { Field } from '../../Field.js';
|
|
4
|
+
|
|
5
|
+
declare class Label extends Field<TApiaLabelProperties, TApiaLabelDefinition> {
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { Label };
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/Label/index.ts"],"sourcesContent":["import { TApiaLabelProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { TApiaLabelDefinition } from '../../../../InitialData/types/fields/TApiaLabelDefinition';\r\nimport { Field } from '../../Field';\r\n\r\nexport class Label extends Field<TApiaLabelProperties, TApiaLabelDefinition> {}\r\n"],"names":[],"mappings":";;AAIO,MAAM,cAAc,KAAA,CAAkD;AAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/Link/index.ts"],"sourcesContent":["import { TApiaLinkProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { Field } from '../../Field';\r\n\r\nexport class Link extends Field<TApiaLinkProperties> {}\r\n"],"names":[],"mappings":";;AAGO,MAAM,aAAa,KAAA,CAA2B;AAAC;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IApiaApiPostConfig } from '../../../../../util/api/types.js';
|
|
2
|
+
import { TApiaInputProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
|
|
3
|
+
import { TApiaModalInputDefinition } from '../../../../InitialData/types/fields/TApiaModalInputDefinition.js';
|
|
4
|
+
import { FieldWithAttribute, TFireEventOptions } from '../../FieldWithAttribute.js';
|
|
5
|
+
import { SetValueOptions } from '../../types.js';
|
|
6
|
+
|
|
7
|
+
type InputEvents = 'onChange' | 'onModalReturn';
|
|
8
|
+
type ModalInputValue = {
|
|
9
|
+
showValue: string;
|
|
10
|
+
storeValue?: string;
|
|
11
|
+
};
|
|
12
|
+
declare class ModalInput extends FieldWithAttribute<TApiaInputProperties, ModalInputValue> {
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
constructor({ value, ...definition }: TApiaModalInputDefinition);
|
|
15
|
+
fireEvent(eventName: InputEvents, options?: TFireEventOptions): Promise<boolean>;
|
|
16
|
+
protected hasValue(): boolean;
|
|
17
|
+
setValueFromInputWrite(value: string): Promise<void>;
|
|
18
|
+
setValueFromModalSelection(rowId: string): Promise<void>;
|
|
19
|
+
validate(): Promise<boolean>;
|
|
20
|
+
setValue(newValue: any, options?: SetValueOptions): Promise<boolean>;
|
|
21
|
+
protected getSynchronizePostConfiguration(value: ModalInputValue): IApiaApiPostConfig<any>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { ModalInput };
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { shallowEqual } from '@apia/util';
|
|
2
|
+
import { getWindow } from '../../../../../util/dom/getWindow.js';
|
|
3
|
+
import { labels } from '../../../../../util/labels/labels.js';
|
|
4
|
+
import { FieldWithAttribute } from '../../FieldWithAttribute.js';
|
|
5
|
+
import { isFieldShowAsText } from '../../util/isFieldShowAsText.js';
|
|
6
|
+
import { makeObservable, observable } from 'mobx';
|
|
7
|
+
import { post, makeApiaUrl } from '../../../../../util/api/apiaApi.js';
|
|
8
|
+
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __publicField = (obj, key, value) => {
|
|
12
|
+
__defNormalProp(obj, key + "" , value);
|
|
13
|
+
return value;
|
|
14
|
+
};
|
|
15
|
+
class ModalInput extends FieldWithAttribute {
|
|
16
|
+
constructor({ value, ...definition }) {
|
|
17
|
+
super({
|
|
18
|
+
...definition,
|
|
19
|
+
properties: {
|
|
20
|
+
...definition.properties
|
|
21
|
+
},
|
|
22
|
+
value: { storeValue: value, showValue: definition.qry_show_value }
|
|
23
|
+
});
|
|
24
|
+
__publicField(this, "isLoading", false);
|
|
25
|
+
makeObservable(this, { isLoading: observable });
|
|
26
|
+
}
|
|
27
|
+
fireEvent(eventName, options) {
|
|
28
|
+
return super.fireEvent(eventName, options);
|
|
29
|
+
}
|
|
30
|
+
hasValue() {
|
|
31
|
+
return this.getValue().showValue !== "" && this.getValue().storeValue !== "";
|
|
32
|
+
}
|
|
33
|
+
async setValueFromInputWrite(value) {
|
|
34
|
+
this.isLoading = true;
|
|
35
|
+
try {
|
|
36
|
+
if (isFieldShowAsText(this) || shallowEqual(value, this.getValue().showValue) || value === "")
|
|
37
|
+
return;
|
|
38
|
+
if (value !== this.getValue().showValue) {
|
|
39
|
+
const result = await post(
|
|
40
|
+
this.form.execution,
|
|
41
|
+
makeApiaUrl(this.form.execution, {
|
|
42
|
+
action: "checkModalValue",
|
|
43
|
+
ajaxUrl: "/apia.execution.FormAction.run"
|
|
44
|
+
}),
|
|
45
|
+
{
|
|
46
|
+
postData: {
|
|
47
|
+
frmId: this.form.definition.id,
|
|
48
|
+
frmParent: this.form.definition.frmParent,
|
|
49
|
+
fldId: this.definition.id,
|
|
50
|
+
attId: this.attribute.id,
|
|
51
|
+
qryId: this.definition.qryId,
|
|
52
|
+
index: this.definition.index,
|
|
53
|
+
value
|
|
54
|
+
},
|
|
55
|
+
postDataTreatment: "stringify"
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
if (result?.data?.ret_value) {
|
|
59
|
+
const setValueResult = await this.setValue({
|
|
60
|
+
storeValue: result?.data?.ret_value.value,
|
|
61
|
+
showValue: result?.data?.ret_value.show_value
|
|
62
|
+
});
|
|
63
|
+
if (setValueResult) {
|
|
64
|
+
this.fireEvent("onChange");
|
|
65
|
+
}
|
|
66
|
+
this.setError("");
|
|
67
|
+
} else {
|
|
68
|
+
this.setValue({ showValue: "", storeValue: "" });
|
|
69
|
+
this.setError(getWindow(this.form.execution).MSG_VAL_NOT_FOUND);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
} finally {
|
|
73
|
+
this.isLoading = false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async setValueFromModalSelection(rowId) {
|
|
77
|
+
this.isLoading = true;
|
|
78
|
+
try {
|
|
79
|
+
const result = await post(
|
|
80
|
+
this.form.execution,
|
|
81
|
+
makeApiaUrl(this.form.execution, {
|
|
82
|
+
ajaxUrl: "/apia.query.ModalAction.run",
|
|
83
|
+
action: "getValues"
|
|
84
|
+
}),
|
|
85
|
+
{ postData: { id: rowId }, postDataTreatment: "stringify" }
|
|
86
|
+
);
|
|
87
|
+
if (result?.data?.row?.cell) {
|
|
88
|
+
const setValueResult = await this.setValue({
|
|
89
|
+
storeValue: result.data.row.cell[0],
|
|
90
|
+
showValue: result.data.row.cell[1]
|
|
91
|
+
});
|
|
92
|
+
this.form.execution.setLastModalReturn(result.data.row.cell);
|
|
93
|
+
if (setValueResult) {
|
|
94
|
+
this.fireEvent("onModalReturn");
|
|
95
|
+
this.fireEvent("onChange");
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
} finally {
|
|
99
|
+
this.isLoading = false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async validate() {
|
|
103
|
+
if (this.state.validation.errorMessage)
|
|
104
|
+
return false;
|
|
105
|
+
const isValid = !!this.getValue().storeValue || !this.properties.required || this.properties.inputAsText || this.properties.visibilityHidden || this.properties.disabled;
|
|
106
|
+
if (!isValid) {
|
|
107
|
+
this.state.validation.errorMessage = labels.errorFieldRequired(
|
|
108
|
+
this.form.execution
|
|
109
|
+
);
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
setValue(newValue, options) {
|
|
115
|
+
if (!options?.force && (isFieldShowAsText(this) || shallowEqual(newValue, this.getValue())))
|
|
116
|
+
return Promise.resolve(true);
|
|
117
|
+
this.state.value = newValue;
|
|
118
|
+
this.state.validation.errorMessage = null;
|
|
119
|
+
if (options?.synchronize === false) {
|
|
120
|
+
this.lastSynchronizationValue = newValue;
|
|
121
|
+
return Promise.resolve(true);
|
|
122
|
+
}
|
|
123
|
+
return this.synchronize(newValue).then((res) => {
|
|
124
|
+
if (res) {
|
|
125
|
+
if (options?.markAsDirty !== false) {
|
|
126
|
+
this.form.execution.state.hasChangedAnything = true;
|
|
127
|
+
}
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
return Promise.resolve(false);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
getSynchronizePostConfiguration(value) {
|
|
134
|
+
const storeIdValue = this.properties.storeMdlQryResult;
|
|
135
|
+
return {
|
|
136
|
+
...super.getSynchronizePostConfiguration(value),
|
|
137
|
+
postData: {
|
|
138
|
+
value: storeIdValue ? [this.getValue().storeValue, this.getValue().showValue] : this.getValue().storeValue
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export { ModalInput };
|
|
145
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/ModalInput/index.ts"],"sourcesContent":["import { shallowEqual } from '@apia/util';\r\nimport { makeApiaUrl, post } from '../../../../../util';\r\nimport { IApiaApiPostConfig } from '../../../../../util/api/types';\r\nimport { getWindow } from '../../../../../util/dom/getWindow';\r\nimport { labels } from '../../../../../util/labels/labels';\r\nimport { TApiaInputProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { TApiaModalInputDefinition } from '../../../../InitialData/types/fields/TApiaModalInputDefinition';\r\nimport {\r\n FieldWithAttribute,\r\n TFireEventOptions,\r\n} from '../../FieldWithAttribute';\r\nimport { isFieldShowAsText } from '../../util/isFieldShowAsText';\r\nimport { SetValueOptions } from '../../types';\r\nimport { makeObservable, observable } from 'mobx';\r\n\r\ntype InputEvents = 'onChange' | 'onModalReturn';\r\ntype ModalInputValue = { showValue: string; storeValue?: string };\r\n\r\nexport class ModalInput extends FieldWithAttribute<\r\n TApiaInputProperties,\r\n ModalInputValue\r\n> {\r\n isLoading = false;\r\n\r\n constructor({ value, ...definition }: TApiaModalInputDefinition) {\r\n super({\r\n ...definition,\r\n properties: {\r\n ...definition.properties,\r\n },\r\n value: { storeValue: value, showValue: definition.qry_show_value },\r\n });\r\n\r\n makeObservable(this, { isLoading: observable });\r\n }\r\n\r\n fireEvent(\r\n eventName: InputEvents,\r\n options?: TFireEventOptions,\r\n ): Promise<boolean> {\r\n return super.fireEvent(eventName, options);\r\n }\r\n\r\n protected hasValue(): boolean {\r\n return (\r\n this.getValue().showValue !== '' && this.getValue().storeValue !== ''\r\n );\r\n }\r\n\r\n public async setValueFromInputWrite(value: string) {\r\n this.isLoading = true;\r\n try {\r\n if (\r\n isFieldShowAsText(this) ||\r\n shallowEqual(value, this.getValue().showValue) ||\r\n value === ''\r\n )\r\n return;\r\n if (value !== this.getValue().showValue) {\r\n const result = await post<{\r\n ret_value: { show_value: string; value: string };\r\n }>(\r\n this.form.execution,\r\n makeApiaUrl(this.form.execution, {\r\n action: 'checkModalValue',\r\n ajaxUrl: '/apia.execution.FormAction.run',\r\n }),\r\n {\r\n postData: {\r\n frmId: this.form.definition.id,\r\n frmParent: this.form.definition.frmParent,\r\n fldId: this.definition.id,\r\n attId: this.attribute.id,\r\n qryId: this.definition.qryId,\r\n index: this.definition.index,\r\n value,\r\n },\r\n postDataTreatment: 'stringify',\r\n },\r\n );\r\n\r\n if (result?.data?.ret_value) {\r\n const setValueResult = await this.setValue({\r\n storeValue: result?.data?.ret_value.value,\r\n showValue: result?.data?.ret_value.show_value,\r\n });\r\n if (setValueResult) {\r\n this.fireEvent('onChange');\r\n }\r\n this.setError('');\r\n } else {\r\n this.setValue({ showValue: '', storeValue: '' });\r\n this.setError(getWindow(this.form.execution).MSG_VAL_NOT_FOUND);\r\n }\r\n }\r\n } finally {\r\n this.isLoading = false;\r\n }\r\n }\r\n\r\n public async setValueFromModalSelection(rowId: string) {\r\n this.isLoading = true;\r\n\r\n try {\r\n const result = await post<{ row: { cell: string[] } }>(\r\n this.form.execution,\r\n makeApiaUrl(this.form.execution, {\r\n ajaxUrl: '/apia.query.ModalAction.run',\r\n action: 'getValues',\r\n }),\r\n { postData: { id: rowId }, postDataTreatment: 'stringify' },\r\n );\r\n\r\n if (result?.data?.row?.cell) {\r\n const setValueResult = await this.setValue({\r\n storeValue: result.data.row.cell[0],\r\n showValue: result.data.row.cell[1],\r\n });\r\n this.form.execution.setLastModalReturn(result.data.row.cell);\r\n\r\n if (setValueResult) {\r\n this.fireEvent('onModalReturn');\r\n this.fireEvent('onChange');\r\n }\r\n }\r\n } finally {\r\n this.isLoading = false;\r\n }\r\n }\r\n\r\n public async validate(): Promise<boolean> {\r\n if (this.state.validation.errorMessage) return false;\r\n\r\n const isValid =\r\n !!this.getValue().storeValue ||\r\n !this.properties.required ||\r\n this.properties.inputAsText ||\r\n this.properties.visibilityHidden ||\r\n this.properties.disabled;\r\n\r\n if (!isValid) {\r\n this.state.validation.errorMessage = labels.errorFieldRequired(\r\n this.form.execution,\r\n );\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n public setValue(newValue: any, options?: SetValueOptions) {\r\n if (\r\n !options?.force &&\r\n (isFieldShowAsText(this) || shallowEqual(newValue, this.getValue()))\r\n )\r\n return Promise.resolve(true);\r\n\r\n this.state.value = newValue;\r\n this.state.validation.errorMessage = null;\r\n\r\n if (options?.synchronize === false) {\r\n this.lastSynchronizationValue = newValue;\r\n return Promise.resolve(true);\r\n }\r\n\r\n return this.synchronize(newValue).then((res) => {\r\n if (res) {\r\n if (options?.markAsDirty !== false) {\r\n this.form.execution.state.hasChangedAnything = true;\r\n }\r\n return true;\r\n }\r\n return Promise.resolve(false);\r\n });\r\n }\r\n\r\n protected getSynchronizePostConfiguration(\r\n value: ModalInputValue,\r\n ): IApiaApiPostConfig<any> {\r\n const storeIdValue = this.properties.storeMdlQryResult;\r\n\r\n return {\r\n ...super.getSynchronizePostConfiguration(value),\r\n postData: {\r\n value: storeIdValue\r\n ? [this.getValue().storeValue!, this.getValue().showValue]\r\n : this.getValue().storeValue,\r\n },\r\n };\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAkBO,MAAM,mBAAmB,kBAAA,CAG9B;AAAA,EAGA,WAAA,CAAY,EAAE,KAAA,EAAO,GAAG,YAAW,EAA8B;AAC/D,IAAA,KAAA,CAAM;AAAA,MACJ,GAAG,UAAA;AAAA,MACH,UAAA,EAAY;AAAA,QACV,GAAG,UAAA,CAAW;AAAA,OAChB;AAAA,MACA,OAAO,EAAE,UAAA,EAAY,KAAA,EAAO,SAAA,EAAW,WAAW,cAAA;AAAe,KAClE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AAQ,QAAQ,IAAI,CAAA;AAE7B,IAAA,IAAA,CAAK,MAAM,KAAA,GAAQ,QAAA;AACnB,IAAA,IAAA,CAAK,KAAA,CAAM,WAAW,YAAA,GAAe,IAAA;AAErC,IAAA,IAAI,OAAA,EAAS,gBAAgB,KAAA,EAAO;AAClC,MAAA,IAAA,CAAK,wBAAA,GAA2B,QAAA;AAChC,MAAA,OAAO,OAAA,CAAQ,QAAQ,IAAI,CAAA;AAAA;AAG7B,IAAA,OAAO,KAAK,WAAA,CAAY,QAAQ,CAAA,CAAE,IAAA,CAAK,CAAC,GAAA,KAAQ;AAC9C,MAAA,IAAI,GAAA,EAAK;AACP,QAAA,IAAI,OAAA,EAAS,gBAAgB,KAAA,EAAO;AAClC,UAAA,IAAA,CAAK,IAAA,CAAK,SAAA,CAAU,KAAA,CAAM,kBAAA,GAAqB,IAAA;AAAA;AAEjD,QAAA,OAAO,IAAA;AAAA;AAET,MAAA,OAAO,OAAA,CAAQ,QAAQ,KAAK,CAAA;AAAA,KAC7B,CAAA;AAAA;AACH,EAEU,gCACR,KAAA,EACyB;AACzB,IAAA,MAAM,YAAA,GAAe,KAAK,UAAA,CAAW,iBAAA;AAErC,IAAA,OAAO;AAAA,MACL,GAAG,KAAA,CAAM,+BAAA,CAAgC,KAAK,CAAA;AAAA,MAC9C,QAAA,EAAU;AAAA,QACR,KAAA,EAAO,YAAA,GACH,CAAC,IAAA,CAAK,UAAS,CAAE,UAAA,EAAa,IAAA,CAAK,QAAA,EAAS,CAAE,SAAS,CAAA,GACvD,IAAA,CAAK,UAAS,CAAE;AAAA;AACtB,KACF;AAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TApiaMultipleProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
|
|
2
|
+
import { TApiaMultipleDefinition } from '../../../../InitialData/types/fields/TApiaMultipleDefinition.js';
|
|
3
|
+
import { FieldWithAttribute } from '../../FieldWithAttribute.js';
|
|
4
|
+
import { Comparator } from '../../../../../util/comparators/shallowEqual.js';
|
|
5
|
+
|
|
6
|
+
declare class Multiple extends FieldWithAttribute<TApiaMultipleProperties, string[]> {
|
|
7
|
+
constructor({ possibleValue, value, ...definition }: TApiaMultipleDefinition);
|
|
8
|
+
protected hasValue(): boolean;
|
|
9
|
+
setValue(newValue: string[], options?: Partial<{
|
|
10
|
+
comparator: Comparator<any>;
|
|
11
|
+
format: 'd/m/Y' | 'apia';
|
|
12
|
+
markAsDirty: boolean;
|
|
13
|
+
synchronize: boolean;
|
|
14
|
+
}> | undefined): Promise<boolean>;
|
|
15
|
+
validate(): Promise<boolean>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { Multiple };
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { arrayOrArray } from '@apia/util';
|
|
2
|
+
import { labels } from '../../../../../util/labels/labels.js';
|
|
3
|
+
import { FieldWithAttribute } from '../../FieldWithAttribute.js';
|
|
4
|
+
|
|
5
|
+
class Multiple extends FieldWithAttribute {
|
|
6
|
+
constructor({
|
|
7
|
+
possibleValue,
|
|
8
|
+
value,
|
|
9
|
+
...definition
|
|
10
|
+
}) {
|
|
11
|
+
super({
|
|
12
|
+
...{
|
|
13
|
+
...definition,
|
|
14
|
+
value: arrayOrArray(possibleValue).filter((c) => c.selected).map((c) => c.value)
|
|
15
|
+
},
|
|
16
|
+
properties: {
|
|
17
|
+
...definition.properties,
|
|
18
|
+
possibleValue: arrayOrArray(possibleValue)
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
hasValue() {
|
|
23
|
+
return this.state.value.length > 0;
|
|
24
|
+
}
|
|
25
|
+
setValue(newValue, options) {
|
|
26
|
+
return super.setValue(arrayOrArray(newValue), options);
|
|
27
|
+
}
|
|
28
|
+
async validate() {
|
|
29
|
+
if (this.state.validation.dirty) {
|
|
30
|
+
if (!await this.synchronize(this.state.value)) {
|
|
31
|
+
this.state.validation.errorMessage = labels.errorCouldNotSync();
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const isValid = !!this.getValue()[0] || !this.properties.required || this.properties.inputAsText || this.properties.visibilityHidden || this.properties.disabled;
|
|
36
|
+
this.state.validation.errorMessage = isValid ? null : labels.errorFieldRequired(this.form.execution);
|
|
37
|
+
return !this.state.validation.errorMessage;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { Multiple };
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/Multiple/index.ts"],"sourcesContent":["import { arrayOrArray } from '@apia/util';\r\nimport { labels } from '../../../../../util/labels/labels';\r\nimport { TApiaMultipleProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { TApiaMultipleDefinition } from '../../../../InitialData/types/fields/TApiaMultipleDefinition';\r\nimport { FieldWithAttribute } from '../../FieldWithAttribute';\r\nimport { Comparator } from '../../../../../util/comparators/shallowEqual';\r\n\r\nexport class Multiple extends FieldWithAttribute<\r\n TApiaMultipleProperties,\r\n string[]\r\n> {\r\n constructor({\r\n possibleValue,\r\n value,\r\n ...definition\r\n }: TApiaMultipleDefinition) {\r\n super({\r\n ...{\r\n ...definition,\r\n value: arrayOrArray(possibleValue)\r\n .filter((c) => c.selected)\r\n .map((c) => c.value),\r\n },\r\n properties: {\r\n ...definition.properties,\r\n possibleValue: arrayOrArray(possibleValue),\r\n },\r\n });\r\n }\r\n\r\n protected hasValue() {\r\n return this.state.value.length > 0;\r\n }\r\n\r\n public setValue(\r\n newValue: string[],\r\n options?:\r\n | Partial<{\r\n comparator: Comparator<any>;\r\n format: 'd/m/Y' | 'apia';\r\n markAsDirty: boolean;\r\n synchronize: boolean;\r\n }>\r\n | undefined,\r\n ): Promise<boolean> {\r\n return super.setValue(arrayOrArray(newValue), options);\r\n }\r\n\r\n public async validate(): Promise<boolean> {\r\n if (this.state.validation.dirty) {\r\n if (!(await this.synchronize(this.state.value))) {\r\n this.state.validation.errorMessage = labels.errorCouldNotSync();\r\n return false;\r\n }\r\n }\r\n\r\n const isValid =\r\n !!this.getValue()[0] ||\r\n !this.properties.required ||\r\n this.properties.inputAsText ||\r\n this.properties.visibilityHidden ||\r\n this.properties.disabled;\r\n\r\n this.state.validation.errorMessage = isValid\r\n ? null\r\n : labels.errorFieldRequired(this.form.execution);\r\n\r\n return !this.state.validation.errorMessage;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;AAOO,MAAM,iBAAiB,kBAAA,CAG5B;AAAA,EACA,WAAA,CAAY;AAAA,IACV,aAAA;AAAA,IACA,KAAA;AAAA,IACA,GAAG;AAAA,GACL,EAA4B;AAC1B,IAAA,KAAA,CAAM;AAAA,MACJ,GAAG;AAAA,QACD,GAAG,UAAA;AAAA,QACH,KAAA,EAAO,YAAA,CAAa,aAAa,CAAA,CAC9B,OAAO,CAAC,CAAA,KAAM,CAAA,CAAE,QAAQ,CAAA,CACxB,GAAA,CAAI,CAAC,CAAA,KAAM,EAAE,KAAK;AAAA,OACvB;AAAA,MACA,UAAA,EAAY;AAAA,QACV,GAAG,UAAA,CAAW,UAAA;AAAA,QACd,aAAA,EAAe,aAAa,aAAa;AAAA;AAC3C,KACD,CAAA;AAAA;AACH,EAEU,QAAA,GAAW;AACnB,IAAA,OAAO,IAAA,CAAK,KAAA,CAAM,KAAA,CAAM,MAAA,GAAS,CAAA;AAAA;AACnC,EAEO,QAAA,CACL,UACA,OAAA,EAQkB;AAClB,IAAA,OAAO,KAAA,CAAM,QAAA,CAAS,YAAA,CAAa,QAAQ,GAAG,OAAO,CAAA;AAAA;AACvD,EAEA,MAAa,QAAA,GAA6B;AACxC,IAAA,IAAI,IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,KAAA,EAAO;AAC/B,MAAA,IAAI,CAAE,MAAM,IAAA,CAAK,YAAY,IAAA,CAAK,KAAA,CAAM,KAAK,CAAA,EAAI;AAC/C,QAAA,IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,YAAA,GAAe,MAAA,CAAO,iBAAA,EAAkB;AAC9D,QAAA,OAAO,KAAA;AAAA;AACT;AAGF,IAAA,MAAM,UACJ,CAAC,CAAC,KAAK,QAAA,EAAS,CAAE,CAAC,CAAA,IACnB,CAAC,KAAK,UAAA,CAAW,QAAA,IACjB,KAAK,UAAA,CAAW,WAAA,IAChB,KAAK,UAAA,CAAW,gBAAA,IAChB,KAAK,UAAA,CAAW,QAAA;AAElB,IAAA,IAAA,CAAK,KAAA,CAAM,WAAW,YAAA,GAAe,OAAA,GACjC,OACA,MAAA,CAAO,kBAAA,CAAmB,IAAA,CAAK,IAAA,CAAK,SAAS,CAAA;AAEjD,IAAA,OAAO,CAAC,IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,YAAA;AAAA;AAElC;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TApiaPasswordProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
|
|
2
|
+
import { FieldWithAttribute } from '../../FieldWithAttribute.js';
|
|
3
|
+
|
|
4
|
+
declare class Password extends FieldWithAttribute<TApiaPasswordProperties, string> {
|
|
5
|
+
protected isValidValue(): boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { Password };
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/Password/index.ts"],"sourcesContent":["import { TApiaPasswordProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { FieldWithAttribute } from '../../FieldWithAttribute';\r\n\r\nexport class Password extends FieldWithAttribute<\r\n TApiaPasswordProperties,\r\n string\r\n> {\r\n protected isValidValue(): boolean {\r\n return !!String(this.getValue()).trim();\r\n }\r\n}\r\n"],"names":[],"mappings":";;AAGO,MAAM,iBAAiB,kBAAA,CAG5B;AAAA,EACU,YAAA,GAAwB;AAChC,IAAA,OAAO,CAAC,CAAC,MAAA,CAAO,KAAK,QAAA,EAAU,EAAE,IAAA,EAAK;AAAA;AAE1C;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TApiaRadioProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
|
|
2
|
+
import { TApiaRadioButtonDefinition } from '../../../../InitialData/types/fields/TApiaRadioButtonDefinition.js';
|
|
3
|
+
import { Form } from '../../Form.js';
|
|
4
|
+
import { FieldWithAttribute, TFireEventOptions } from '../../FieldWithAttribute.js';
|
|
5
|
+
|
|
6
|
+
type RadioEvents = 'onPopulate' | 'onChange' | 'onClick';
|
|
7
|
+
declare class Radio extends FieldWithAttribute<TApiaRadioProperties, number | string, TApiaRadioButtonDefinition> {
|
|
8
|
+
constructor({ possibleValue, ...definition }: TApiaRadioButtonDefinition);
|
|
9
|
+
init(form: Form): Promise<void>;
|
|
10
|
+
fireEvent(eventName: RadioEvents, options?: TFireEventOptions): Promise<boolean>;
|
|
11
|
+
getTextValue(value: any): any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { Radio };
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FieldWithAttribute } from '../../FieldWithAttribute.js';
|
|
2
|
+
import { arrayOrArray } from '@apia/util';
|
|
3
|
+
|
|
4
|
+
class Radio extends FieldWithAttribute {
|
|
5
|
+
constructor({ possibleValue, ...definition }) {
|
|
6
|
+
super({
|
|
7
|
+
...definition,
|
|
8
|
+
properties: { ...definition.properties, possibleValue }
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
async init(form) {
|
|
12
|
+
await super.init(form);
|
|
13
|
+
await this.fireEvent("onPopulate");
|
|
14
|
+
}
|
|
15
|
+
fireEvent(eventName, options) {
|
|
16
|
+
return super.fireEvent(eventName, options);
|
|
17
|
+
}
|
|
18
|
+
getTextValue(value) {
|
|
19
|
+
return this.properties.possibleValue ? arrayOrArray(this.properties.possibleValue).find(
|
|
20
|
+
(c) => c.value === value
|
|
21
|
+
)?.label : value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { Radio };
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/Radio/index.ts"],"sourcesContent":["import { TApiaRadioProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { TApiaRadioButtonDefinition } from '../../../../InitialData/types/fields/TApiaRadioButtonDefinition';\r\nimport { Form } from '../../Form';\r\nimport {\r\n FieldWithAttribute,\r\n TFireEventOptions,\r\n} from '../../FieldWithAttribute';\r\nimport { arrayOrArray } from '@apia/util';\r\n\r\ntype RadioEvents = 'onPopulate' | 'onChange' | 'onClick';\r\n\r\nexport class Radio extends FieldWithAttribute<\r\n TApiaRadioProperties,\r\n number | string,\r\n TApiaRadioButtonDefinition\r\n> {\r\n constructor({ possibleValue, ...definition }: TApiaRadioButtonDefinition) {\r\n super({\r\n ...definition,\r\n properties: { ...definition.properties, possibleValue },\r\n });\r\n }\r\n\r\n async init(form: Form): Promise<void> {\r\n await super.init(form);\r\n\r\n await this.fireEvent('onPopulate');\r\n }\r\n\r\n fireEvent(\r\n eventName: RadioEvents,\r\n options?: TFireEventOptions,\r\n ): Promise<boolean> {\r\n return super.fireEvent(eventName, options);\r\n }\r\n\r\n public getTextValue(value: any) {\r\n return this.properties.possibleValue\r\n ? arrayOrArray(this.properties.possibleValue).find(\r\n (c) => c.value === value,\r\n )?.label\r\n : value;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;AAWO,MAAM,cAAc,kBAAA,CAIzB;AAAA,EACA,WAAA,CAAY,EAAE,aAAA,EAAe,GAAG,YAAW,EAA+B;AACxE,IAAA,KAAA,CAAM;AAAA,MACJ,GAAG,UAAA;AAAA,MACH,UAAA,EAAY,EAAE,GAAG,UAAA,CAAW,YAAY,aAAA;AAAc,KACvD,CAAA;AAAA;AACH,EAEA,MAAM,KAAK,IAAA,EAA2B;AACpC,IAAA,MAAM,KAAA,CAAM,KAAK,IAAI,CAAA;AAErB,IAAA,MAAM,IAAA,CAAK,UAAU,YAAY,CAAA;AAAA;AACnC,EAEA,SAAA,CACE,WACA,OAAA,EACkB;AAClB,IAAA,OAAO,KAAA,CAAM,SAAA,CAAU,SAAA,EAAW,OAAO,CAAA;AAAA;AAC3C,EAEO,aAAa,KAAA,EAAY;AAC9B,IAAA,OAAO,KAAK,UAAA,CAAW,aAAA,GACnB,aAAa,IAAA,CAAK,UAAA,CAAW,aAAa,CAAA,CAAE,IAAA;AAAA,MAC1C,CAAC,CAAA,KAAM,CAAA,CAAE,KAAA,KAAU;AAAA,OAClB,KAAA,GACH,KAAA;AAAA;AAER;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as _apia_scheduler_controller from '@apia/scheduler-controller';
|
|
2
|
+
import { TScheduleResult, TTskSchDay, Scheduler } from '@apia/scheduler-controller';
|
|
3
|
+
import { ResponseSysMessages } from '../../../../../util/api/types.js';
|
|
4
|
+
import { TApiaSchedulerProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
|
|
5
|
+
import { TApiaFieldBaseDefinition } from '../../../../InitialData/types/TApiaField.js';
|
|
6
|
+
import { Field } from '../../Field.js';
|
|
7
|
+
import { Form } from '../../Form.js';
|
|
8
|
+
|
|
9
|
+
declare class SchedulerField extends Field<TApiaSchedulerProperties> {
|
|
10
|
+
private _schedController;
|
|
11
|
+
constructor(definition: TApiaFieldBaseDefinition<TApiaSchedulerProperties>);
|
|
12
|
+
deleteDate(): Promise<boolean>;
|
|
13
|
+
get parsedInitialProperties(): {
|
|
14
|
+
schId: string;
|
|
15
|
+
proId: string;
|
|
16
|
+
proVerId: string;
|
|
17
|
+
tskId: string;
|
|
18
|
+
showDisponibility: string;
|
|
19
|
+
showAttributes: string;
|
|
20
|
+
};
|
|
21
|
+
init(form: Form): Promise<void>;
|
|
22
|
+
loadWeek(weekDay: string, schId: string, proId: string, proVerId: string, tskId: string): Promise<(TScheduleResult & ResponseSysMessages) | null>;
|
|
23
|
+
loadInfo(schId: string, weekDay: string, dayNumber: number, hour: string): Promise<_apia_scheduler_controller.TProcesses>;
|
|
24
|
+
markDay(weekDay: string, hour: string, dayNumber: number): Promise<void>;
|
|
25
|
+
selectDayHandler({ cellId, currentDayDefinition, dayNumber, hour, weekDay, }: {
|
|
26
|
+
cellId: string;
|
|
27
|
+
weekDay: string;
|
|
28
|
+
dayNumber: number;
|
|
29
|
+
hour: string;
|
|
30
|
+
currentDayDefinition: TTskSchDay;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
get schedController(): Scheduler | undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { SchedulerField };
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|