@dwidge/json-forms-expo 0.0.2 → 0.0.3
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/cjs/{FileAttachment → Attachment}/AttachmentEdit.js +3 -2
- package/dist/cjs/Attachment/AttachmentEdit.js.map +1 -0
- package/dist/cjs/Attachment/AttachmentListEdit.js +21 -0
- package/dist/cjs/Attachment/AttachmentListEdit.js.map +1 -0
- package/dist/cjs/{FileAttachment → Attachment}/AttachmentListView.js +2 -2
- package/dist/cjs/Attachment/AttachmentListView.js.map +1 -0
- package/dist/cjs/Attachment/AttachmentScreen.js.map +1 -0
- package/dist/cjs/{FileAttachment → Attachment}/AttachmentView.js +3 -2
- package/dist/cjs/Attachment/AttachmentView.js.map +1 -0
- package/dist/cjs/{FileAttachment → Attachment}/index.js +7 -7
- package/dist/cjs/Attachment/index.js.map +1 -0
- package/dist/cjs/{FileAttachment → Attachment}/useFileAttachmentUrl.js +3 -2
- package/dist/cjs/Attachment/useFileAttachmentUrl.js.map +1 -0
- package/dist/cjs/{FileAttachment → Attachment}/useFileUrl.js +2 -1
- package/dist/cjs/Attachment/useFileUrl.js.map +1 -0
- package/dist/cjs/Form/FormEdit.js +22 -3
- package/dist/cjs/Form/FormEdit.js.map +1 -1
- package/dist/cjs/Form/FormEditScreen.js +4 -17
- package/dist/cjs/Form/FormEditScreen.js.map +1 -1
- package/dist/cjs/Form/FormListEdit.js +9 -4
- package/dist/cjs/Form/FormListEdit.js.map +1 -1
- package/dist/cjs/Form/FormListScreen.js +9 -6
- package/dist/cjs/Form/FormListScreen.js.map +1 -1
- package/dist/cjs/Form/FormListView.js +5 -2
- package/dist/cjs/Form/FormListView.js.map +1 -1
- package/dist/cjs/Form/FormView.js +5 -1
- package/dist/cjs/Form/FormView.js.map +1 -1
- package/dist/cjs/Form/index.js +6 -9
- package/dist/cjs/Form/index.js.map +1 -1
- package/dist/cjs/{Form/EditFormAttachmentScreen.js → Schema/EditSchemaScreen.js} +4 -4
- package/dist/cjs/Schema/EditSchemaScreen.js.map +1 -0
- package/dist/cjs/Schema/SchemaEdit.js +12 -0
- package/dist/cjs/Schema/SchemaEdit.js.map +1 -0
- package/dist/cjs/Schema/SchemaEditScreen.js +30 -0
- package/dist/cjs/Schema/SchemaEditScreen.js.map +1 -0
- package/dist/cjs/Schema/SchemaListEdit.js +22 -0
- package/dist/cjs/Schema/SchemaListEdit.js.map +1 -0
- package/dist/cjs/Schema/SchemaListScreen.js +28 -0
- package/dist/cjs/Schema/SchemaListScreen.js.map +1 -0
- package/dist/cjs/Schema/SchemaListView.js +18 -0
- package/dist/cjs/Schema/SchemaListView.js.map +1 -0
- package/dist/cjs/Schema/SchemaSelectScreen.js +21 -0
- package/dist/cjs/Schema/SchemaSelectScreen.js.map +1 -0
- package/dist/cjs/Schema/SchemaSelectView.js +16 -0
- package/dist/cjs/Schema/SchemaSelectView.js.map +1 -0
- package/dist/cjs/Schema/SchemaView.js +12 -0
- package/dist/cjs/Schema/SchemaView.js.map +1 -0
- package/dist/cjs/{FormAttachment → Schema}/index.js +9 -6
- package/dist/cjs/Schema/index.js.map +1 -0
- package/dist/cjs/hooks/{FileAttachmentApi.js → AttachmentApi.js} +4 -4
- package/dist/cjs/hooks/AttachmentApi.js.map +1 -0
- package/dist/cjs/hooks/FileApi.js +1 -1
- package/dist/cjs/hooks/FileApi.js.map +1 -1
- package/dist/cjs/hooks/FormApi.js +3 -4
- package/dist/cjs/hooks/FormApi.js.map +1 -1
- package/dist/cjs/hooks/FormsContext.js +4 -4
- package/dist/cjs/hooks/FormsContext.js.map +1 -1
- package/dist/cjs/hooks/{FormAttachmentApi.js → SchemaApi.js} +6 -5
- package/dist/cjs/hooks/SchemaApi.js.map +1 -0
- package/dist/cjs/hooks/createApi.js +11 -12
- package/dist/cjs/hooks/createApi.js.map +1 -1
- package/dist/cjs/hooks/index.js +11 -10
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useCreateBlankAttachment.js +2 -2
- package/dist/cjs/hooks/useCreateBlankAttachment.js.map +1 -1
- package/dist/cjs/hooks/useCreateBlankForm.js +5 -3
- package/dist/cjs/hooks/useCreateBlankForm.js.map +1 -1
- package/dist/cjs/hooks/useCreateBlankSchema.js +12 -0
- package/dist/cjs/hooks/useCreateBlankSchema.js.map +1 -0
- package/dist/cjs/hooks/useIdFilter.js +6 -0
- package/dist/cjs/hooks/useIdFilter.js.map +1 -0
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/{FileAttachment.js → File1.js} +1 -1
- package/dist/cjs/types/File1.js.map +1 -0
- package/dist/cjs/types/{FormAttachment.js → Schema1.js} +1 -1
- package/dist/cjs/types/Schema1.js.map +1 -0
- package/dist/cjs/types/index.js +4 -4
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/esm/{FileAttachment → Attachment}/AttachmentEdit.js +3 -2
- package/dist/esm/Attachment/AttachmentEdit.js.map +1 -0
- package/dist/esm/Attachment/AttachmentListEdit.js +14 -0
- package/dist/esm/Attachment/AttachmentListEdit.js.map +1 -0
- package/dist/esm/{FileAttachment → Attachment}/AttachmentListView.js +2 -2
- package/dist/esm/Attachment/AttachmentListView.js.map +1 -0
- package/dist/esm/Attachment/AttachmentScreen.js.map +1 -0
- package/dist/esm/{FileAttachment → Attachment}/AttachmentView.js +3 -2
- package/dist/esm/Attachment/AttachmentView.js.map +1 -0
- package/dist/esm/Attachment/index.js +8 -0
- package/dist/esm/Attachment/index.js.map +1 -0
- package/dist/esm/{FileAttachment → Attachment}/useFileAttachmentUrl.js +3 -2
- package/dist/esm/Attachment/useFileAttachmentUrl.js.map +1 -0
- package/dist/esm/{FileAttachment → Attachment}/useFileUrl.js +2 -1
- package/dist/esm/Attachment/useFileUrl.js.map +1 -0
- package/dist/esm/Form/FormEdit.js +22 -3
- package/dist/esm/Form/FormEdit.js.map +1 -1
- package/dist/esm/Form/FormEditScreen.js +5 -18
- package/dist/esm/Form/FormEditScreen.js.map +1 -1
- package/dist/esm/Form/FormListEdit.js +10 -5
- package/dist/esm/Form/FormListEdit.js.map +1 -1
- package/dist/esm/Form/FormListScreen.js +10 -7
- package/dist/esm/Form/FormListScreen.js.map +1 -1
- package/dist/esm/Form/FormListView.js +5 -2
- package/dist/esm/Form/FormListView.js.map +1 -1
- package/dist/esm/Form/FormView.js +7 -3
- package/dist/esm/Form/FormView.js.map +1 -1
- package/dist/esm/Form/index.js +6 -9
- package/dist/esm/Form/index.js.map +1 -1
- package/dist/esm/{Form/EditFormAttachmentScreen.js → Schema/EditSchemaScreen.js} +2 -2
- package/dist/esm/Schema/EditSchemaScreen.js.map +1 -0
- package/dist/esm/Schema/SchemaEdit.js +8 -0
- package/dist/esm/Schema/SchemaEdit.js.map +1 -0
- package/dist/esm/Schema/SchemaEditScreen.js +26 -0
- package/dist/esm/Schema/SchemaEditScreen.js.map +1 -0
- package/dist/esm/Schema/SchemaListEdit.js +15 -0
- package/dist/esm/Schema/SchemaListEdit.js.map +1 -0
- package/dist/esm/Schema/SchemaListScreen.js +24 -0
- package/dist/esm/Schema/SchemaListScreen.js.map +1 -0
- package/dist/esm/Schema/SchemaListView.js +11 -0
- package/dist/esm/Schema/SchemaListView.js.map +1 -0
- package/dist/esm/Schema/SchemaSelectScreen.js +17 -0
- package/dist/esm/Schema/SchemaSelectScreen.js.map +1 -0
- package/dist/esm/Schema/SchemaSelectView.js +12 -0
- package/dist/esm/Schema/SchemaSelectView.js.map +1 -0
- package/dist/esm/Schema/SchemaView.js +8 -0
- package/dist/esm/Schema/SchemaView.js.map +1 -0
- package/dist/esm/Schema/index.js +10 -0
- package/dist/esm/Schema/index.js.map +1 -0
- package/dist/esm/hooks/{FileAttachmentApi.js → AttachmentApi.js} +3 -3
- package/dist/esm/hooks/AttachmentApi.js.map +1 -0
- package/dist/esm/hooks/FileApi.js +1 -1
- package/dist/esm/hooks/FileApi.js.map +1 -1
- package/dist/esm/hooks/FormApi.js +3 -4
- package/dist/esm/hooks/FormApi.js.map +1 -1
- package/dist/esm/hooks/FormsContext.js +4 -4
- package/dist/esm/hooks/FormsContext.js.map +1 -1
- package/dist/esm/hooks/SchemaApi.js +10 -0
- package/dist/esm/hooks/SchemaApi.js.map +1 -0
- package/dist/esm/hooks/createApi.js +11 -12
- package/dist/esm/hooks/createApi.js.map +1 -1
- package/dist/esm/hooks/index.js +11 -10
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/useCreateBlankAttachment.js +2 -2
- package/dist/esm/hooks/useCreateBlankAttachment.js.map +1 -1
- package/dist/esm/hooks/useCreateBlankForm.js +5 -3
- package/dist/esm/hooks/useCreateBlankForm.js.map +1 -1
- package/dist/esm/hooks/useCreateBlankSchema.js +8 -0
- package/dist/esm/hooks/useCreateBlankSchema.js.map +1 -0
- package/dist/esm/hooks/useIdFilter.js +2 -0
- package/dist/esm/hooks/useIdFilter.js.map +1 -0
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/File1.js +2 -0
- package/dist/esm/types/File1.js.map +1 -0
- package/dist/esm/types/Schema1.js +2 -0
- package/dist/esm/types/Schema1.js.map +1 -0
- package/dist/esm/types/index.js +4 -4
- package/dist/esm/types/index.js.map +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/Attachment/AttachmentEdit.d.ts +6 -0
- package/dist/types/Attachment/AttachmentEdit.d.ts.map +1 -0
- package/dist/types/{FileAttachment → Attachment}/AttachmentListEdit.d.ts +3 -3
- package/dist/types/Attachment/AttachmentListEdit.d.ts.map +1 -0
- package/dist/types/{FileAttachment → Attachment}/AttachmentListView.d.ts +2 -2
- package/dist/types/Attachment/AttachmentListView.d.ts.map +1 -0
- package/dist/types/{FileAttachment → Attachment}/AttachmentScreen.d.ts +1 -1
- package/dist/types/Attachment/AttachmentScreen.d.ts.map +1 -0
- package/dist/types/Attachment/AttachmentView.d.ts +6 -0
- package/dist/types/Attachment/AttachmentView.d.ts.map +1 -0
- package/dist/types/Attachment/index.d.ts +8 -0
- package/dist/types/Attachment/index.d.ts.map +1 -0
- package/dist/types/Attachment/useFileAttachmentUrl.d.ts.map +1 -0
- package/dist/types/Attachment/useFileUrl.d.ts.map +1 -0
- package/dist/types/Form/FormEdit.d.ts +6 -2
- package/dist/types/Form/FormEdit.d.ts.map +1 -1
- package/dist/types/Form/FormEditScreen.d.ts +3 -2
- package/dist/types/Form/FormEditScreen.d.ts.map +1 -1
- package/dist/types/Form/FormListEdit.d.ts +7 -2
- package/dist/types/Form/FormListEdit.d.ts.map +1 -1
- package/dist/types/Form/FormListScreen.d.ts +4 -5
- package/dist/types/Form/FormListScreen.d.ts.map +1 -1
- package/dist/types/Form/FormListView.d.ts +3 -3
- package/dist/types/Form/FormListView.d.ts.map +1 -1
- package/dist/types/Form/FormView.d.ts +4 -3
- package/dist/types/Form/FormView.d.ts.map +1 -1
- package/dist/types/Form/index.d.ts +6 -9
- package/dist/types/Form/index.d.ts.map +1 -1
- package/dist/types/{Form/EditFormAttachmentScreen.d.ts → Schema/EditSchemaScreen.d.ts} +2 -2
- package/dist/types/Schema/EditSchemaScreen.d.ts.map +1 -0
- package/dist/types/Schema/SchemaEdit.d.ts +4 -0
- package/dist/types/Schema/SchemaEdit.d.ts.map +1 -0
- package/dist/types/Schema/SchemaEditScreen.d.ts +4 -0
- package/dist/types/Schema/SchemaEditScreen.d.ts.map +1 -0
- package/dist/types/Schema/SchemaListEdit.d.ts +6 -0
- package/dist/types/Schema/SchemaListEdit.d.ts.map +1 -0
- package/dist/types/Schema/SchemaListScreen.d.ts +8 -0
- package/dist/types/Schema/SchemaListScreen.d.ts.map +1 -0
- package/dist/types/Schema/SchemaListView.d.ts +5 -0
- package/dist/types/Schema/SchemaListView.d.ts.map +1 -0
- package/dist/types/Schema/SchemaSelectScreen.d.ts +6 -0
- package/dist/types/Schema/SchemaSelectScreen.d.ts.map +1 -0
- package/dist/types/Schema/SchemaSelectView.d.ts +8 -0
- package/dist/types/Schema/SchemaSelectView.d.ts.map +1 -0
- package/dist/types/Schema/SchemaView.d.ts +5 -0
- package/dist/types/Schema/SchemaView.d.ts.map +1 -0
- package/dist/types/Schema/index.d.ts +10 -0
- package/dist/types/Schema/index.d.ts.map +1 -0
- package/dist/types/hooks/AttachmentApi.d.ts +23 -0
- package/dist/types/hooks/AttachmentApi.d.ts.map +1 -0
- package/dist/types/hooks/FileApi.d.ts +7 -19
- package/dist/types/hooks/FileApi.d.ts.map +1 -1
- package/dist/types/hooks/FormApi.d.ts +7 -19
- package/dist/types/hooks/FormApi.d.ts.map +1 -1
- package/dist/types/hooks/FormsContext.d.ts +7 -7
- package/dist/types/hooks/SchemaApi.d.ts +23 -0
- package/dist/types/hooks/SchemaApi.d.ts.map +1 -0
- package/dist/types/hooks/createApi.d.ts +8 -20
- package/dist/types/hooks/createApi.d.ts.map +1 -1
- package/dist/types/hooks/index.d.ts +11 -10
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/useCreateBlankAttachment.d.ts +3 -3
- package/dist/types/hooks/useCreateBlankAttachment.d.ts.map +1 -1
- package/dist/types/hooks/useCreateBlankForm.d.ts +10 -3
- package/dist/types/hooks/useCreateBlankForm.d.ts.map +1 -1
- package/dist/types/hooks/useCreateBlankSchema.d.ts +6 -0
- package/dist/types/hooks/useCreateBlankSchema.d.ts.map +1 -0
- package/dist/types/hooks/useIdFilter.d.ts +4 -0
- package/dist/types/hooks/useIdFilter.d.ts.map +1 -0
- package/dist/types/hooks/useParams.d.ts +1 -1
- package/dist/types/hooks/useParams.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/{FileAttachment.d.ts → File1.d.ts} +3 -3
- package/dist/types/types/File1.d.ts.map +1 -0
- package/dist/types/types/Form1.d.ts +2 -3
- package/dist/types/types/Form1.d.ts.map +1 -1
- package/dist/types/types/Schema1.d.ts +14 -0
- package/dist/types/types/Schema1.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +4 -4
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/{FileAttachment → Attachment}/AttachmentEdit.tsx +4 -3
- package/src/{FileAttachment → Attachment}/AttachmentListEdit.tsx +3 -3
- package/src/{FileAttachment → Attachment}/AttachmentListView.tsx +2 -2
- package/src/{FileAttachment → Attachment}/AttachmentView.tsx +4 -3
- package/src/Attachment/index.ts +7 -0
- package/src/{FileAttachment → Attachment}/useFileAttachmentUrl.ts +4 -3
- package/src/{FileAttachment → Attachment}/useFileUrl.ts +2 -1
- package/src/Form/FormEdit.tsx +60 -7
- package/src/Form/FormEditScreen.tsx +10 -42
- package/src/Form/FormListEdit.tsx +22 -14
- package/src/Form/FormListScreen.tsx +24 -19
- package/src/Form/FormListView.tsx +13 -6
- package/src/Form/FormView.tsx +26 -11
- package/src/Form/index.ts +6 -9
- package/src/{Form/EditFormAttachmentScreen.tsx → Schema/EditSchemaScreen.tsx} +4 -4
- package/src/Schema/SchemaEdit.tsx +15 -0
- package/src/Schema/SchemaEditScreen.tsx +57 -0
- package/src/{FormAttachment/FormAttachmentListView.tsx → Schema/SchemaListEdit.tsx} +13 -11
- package/src/Schema/SchemaListScreen.tsx +54 -0
- package/src/Schema/SchemaListView.tsx +23 -0
- package/src/{Form/FormSelectScreen.tsx → Schema/SchemaSelectScreen.tsx} +12 -17
- package/src/{Form/FormSelectView.tsx → Schema/SchemaSelectView.tsx} +8 -8
- package/src/Schema/SchemaView.tsx +11 -0
- package/src/Schema/index.ts +9 -0
- package/src/hooks/{FileAttachmentApi.ts → AttachmentApi.ts} +3 -3
- package/src/hooks/FileApi.ts +1 -1
- package/src/hooks/FormApi.ts +3 -4
- package/src/hooks/FormsContext.ts +4 -4
- package/src/hooks/SchemaApi.ts +11 -0
- package/src/hooks/createApi.ts +22 -19
- package/src/hooks/index.ts +11 -10
- package/src/hooks/useCreateBlankAttachment.ts +2 -2
- package/src/hooks/useCreateBlankForm.ts +11 -3
- package/src/hooks/useCreateBlankSchema.ts +12 -0
- package/src/hooks/useIdFilter.ts +2 -0
- package/src/hooks/useParams.ts +1 -1
- package/src/index.ts +5 -5
- package/src/types/{FileAttachment.ts → File1.ts} +2 -2
- package/src/types/Form1.ts +2 -3
- package/src/types/Schema1.ts +17 -0
- package/src/types/index.ts +4 -4
- package/dist/cjs/FileAttachment/AttachmentEdit.js.map +0 -1
- package/dist/cjs/FileAttachment/AttachmentListEdit.js +0 -21
- package/dist/cjs/FileAttachment/AttachmentListEdit.js.map +0 -1
- package/dist/cjs/FileAttachment/AttachmentListView.js.map +0 -1
- package/dist/cjs/FileAttachment/AttachmentScreen.js.map +0 -1
- package/dist/cjs/FileAttachment/AttachmentView.js.map +0 -1
- package/dist/cjs/FileAttachment/index.js.map +0 -1
- package/dist/cjs/FileAttachment/useFileAttachmentUrl.js.map +0 -1
- package/dist/cjs/FileAttachment/useFileUrl.js.map +0 -1
- package/dist/cjs/Form/EditFormAttachmentScreen.js.map +0 -1
- package/dist/cjs/Form/FormSelectScreen.js +0 -21
- package/dist/cjs/Form/FormSelectScreen.js.map +0 -1
- package/dist/cjs/Form/FormSelectView.js +0 -16
- package/dist/cjs/Form/FormSelectView.js.map +0 -1
- package/dist/cjs/FormAttachment/FormAttachmentEdit.js +0 -30
- package/dist/cjs/FormAttachment/FormAttachmentEdit.js.map +0 -1
- package/dist/cjs/FormAttachment/FormAttachmentEditScreen.js +0 -15
- package/dist/cjs/FormAttachment/FormAttachmentEditScreen.js.map +0 -1
- package/dist/cjs/FormAttachment/FormAttachmentListEdit.js +0 -27
- package/dist/cjs/FormAttachment/FormAttachmentListEdit.js.map +0 -1
- package/dist/cjs/FormAttachment/FormAttachmentListScreen.js +0 -31
- package/dist/cjs/FormAttachment/FormAttachmentListScreen.js.map +0 -1
- package/dist/cjs/FormAttachment/FormAttachmentListView.js +0 -21
- package/dist/cjs/FormAttachment/FormAttachmentListView.js.map +0 -1
- package/dist/cjs/FormAttachment/FormAttachmentView.js +0 -15
- package/dist/cjs/FormAttachment/FormAttachmentView.js.map +0 -1
- package/dist/cjs/FormAttachment/index.js.map +0 -1
- package/dist/cjs/hooks/FileAttachmentApi.js.map +0 -1
- package/dist/cjs/hooks/FormAttachmentApi.js.map +0 -1
- package/dist/cjs/hooks/useCreateBlankFormAttachment.js +0 -14
- package/dist/cjs/hooks/useCreateBlankFormAttachment.js.map +0 -1
- package/dist/cjs/types/FileAttachment.js.map +0 -1
- package/dist/cjs/types/FormAttachment.js.map +0 -1
- package/dist/esm/FileAttachment/AttachmentEdit.js.map +0 -1
- package/dist/esm/FileAttachment/AttachmentListEdit.js +0 -14
- package/dist/esm/FileAttachment/AttachmentListEdit.js.map +0 -1
- package/dist/esm/FileAttachment/AttachmentListView.js.map +0 -1
- package/dist/esm/FileAttachment/AttachmentScreen.js.map +0 -1
- package/dist/esm/FileAttachment/AttachmentView.js.map +0 -1
- package/dist/esm/FileAttachment/index.js +0 -8
- package/dist/esm/FileAttachment/index.js.map +0 -1
- package/dist/esm/FileAttachment/useFileAttachmentUrl.js.map +0 -1
- package/dist/esm/FileAttachment/useFileUrl.js.map +0 -1
- package/dist/esm/Form/EditFormAttachmentScreen.js.map +0 -1
- package/dist/esm/Form/FormSelectScreen.js +0 -17
- package/dist/esm/Form/FormSelectScreen.js.map +0 -1
- package/dist/esm/Form/FormSelectView.js +0 -12
- package/dist/esm/Form/FormSelectView.js.map +0 -1
- package/dist/esm/FormAttachment/FormAttachmentEdit.js +0 -26
- package/dist/esm/FormAttachment/FormAttachmentEdit.js.map +0 -1
- package/dist/esm/FormAttachment/FormAttachmentEditScreen.js +0 -11
- package/dist/esm/FormAttachment/FormAttachmentEditScreen.js.map +0 -1
- package/dist/esm/FormAttachment/FormAttachmentListEdit.js +0 -20
- package/dist/esm/FormAttachment/FormAttachmentListEdit.js.map +0 -1
- package/dist/esm/FormAttachment/FormAttachmentListScreen.js +0 -27
- package/dist/esm/FormAttachment/FormAttachmentListScreen.js.map +0 -1
- package/dist/esm/FormAttachment/FormAttachmentListView.js +0 -14
- package/dist/esm/FormAttachment/FormAttachmentListView.js.map +0 -1
- package/dist/esm/FormAttachment/FormAttachmentView.js +0 -11
- package/dist/esm/FormAttachment/FormAttachmentView.js.map +0 -1
- package/dist/esm/FormAttachment/index.js +0 -7
- package/dist/esm/FormAttachment/index.js.map +0 -1
- package/dist/esm/hooks/FileAttachmentApi.js.map +0 -1
- package/dist/esm/hooks/FormAttachmentApi.js +0 -9
- package/dist/esm/hooks/FormAttachmentApi.js.map +0 -1
- package/dist/esm/hooks/useCreateBlankFormAttachment.js +0 -10
- package/dist/esm/hooks/useCreateBlankFormAttachment.js.map +0 -1
- package/dist/esm/types/FileAttachment.js +0 -2
- package/dist/esm/types/FileAttachment.js.map +0 -1
- package/dist/esm/types/FormAttachment.js +0 -2
- package/dist/esm/types/FormAttachment.js.map +0 -1
- package/dist/types/FileAttachment/AttachmentEdit.d.ts +0 -6
- package/dist/types/FileAttachment/AttachmentEdit.d.ts.map +0 -1
- package/dist/types/FileAttachment/AttachmentListEdit.d.ts.map +0 -1
- package/dist/types/FileAttachment/AttachmentListView.d.ts.map +0 -1
- package/dist/types/FileAttachment/AttachmentScreen.d.ts.map +0 -1
- package/dist/types/FileAttachment/AttachmentView.d.ts +0 -6
- package/dist/types/FileAttachment/AttachmentView.d.ts.map +0 -1
- package/dist/types/FileAttachment/index.d.ts +0 -8
- package/dist/types/FileAttachment/index.d.ts.map +0 -1
- package/dist/types/FileAttachment/useFileAttachmentUrl.d.ts.map +0 -1
- package/dist/types/FileAttachment/useFileUrl.d.ts.map +0 -1
- package/dist/types/Form/EditFormAttachmentScreen.d.ts.map +0 -1
- package/dist/types/Form/FormSelectScreen.d.ts +0 -6
- package/dist/types/Form/FormSelectScreen.d.ts.map +0 -1
- package/dist/types/Form/FormSelectView.d.ts +0 -8
- package/dist/types/Form/FormSelectView.d.ts.map +0 -1
- package/dist/types/FormAttachment/FormAttachmentEdit.d.ts +0 -9
- package/dist/types/FormAttachment/FormAttachmentEdit.d.ts.map +0 -1
- package/dist/types/FormAttachment/FormAttachmentEditScreen.d.ts +0 -5
- package/dist/types/FormAttachment/FormAttachmentEditScreen.d.ts.map +0 -1
- package/dist/types/FormAttachment/FormAttachmentListEdit.d.ts +0 -11
- package/dist/types/FormAttachment/FormAttachmentListEdit.d.ts.map +0 -1
- package/dist/types/FormAttachment/FormAttachmentListScreen.d.ts +0 -7
- package/dist/types/FormAttachment/FormAttachmentListScreen.d.ts.map +0 -1
- package/dist/types/FormAttachment/FormAttachmentListView.d.ts +0 -5
- package/dist/types/FormAttachment/FormAttachmentListView.d.ts.map +0 -1
- package/dist/types/FormAttachment/FormAttachmentView.d.ts +0 -6
- package/dist/types/FormAttachment/FormAttachmentView.d.ts.map +0 -1
- package/dist/types/FormAttachment/index.d.ts +0 -7
- package/dist/types/FormAttachment/index.d.ts.map +0 -1
- package/dist/types/hooks/FileAttachmentApi.d.ts +0 -35
- package/dist/types/hooks/FileAttachmentApi.d.ts.map +0 -1
- package/dist/types/hooks/FormAttachmentApi.d.ts +0 -35
- package/dist/types/hooks/FormAttachmentApi.d.ts.map +0 -1
- package/dist/types/hooks/useCreateBlankFormAttachment.d.ts +0 -13
- package/dist/types/hooks/useCreateBlankFormAttachment.d.ts.map +0 -1
- package/dist/types/types/FileAttachment.d.ts.map +0 -1
- package/dist/types/types/FormAttachment.d.ts +0 -13
- package/dist/types/types/FormAttachment.d.ts.map +0 -1
- package/src/FileAttachment/index.ts +0 -7
- package/src/FormAttachment/FormAttachmentEdit.tsx +0 -72
- package/src/FormAttachment/FormAttachmentEditScreen.tsx +0 -21
- package/src/FormAttachment/FormAttachmentListEdit.tsx +0 -40
- package/src/FormAttachment/FormAttachmentListScreen.tsx +0 -62
- package/src/FormAttachment/FormAttachmentView.tsx +0 -25
- package/src/FormAttachment/index.ts +0 -6
- package/src/hooks/FormAttachmentApi.ts +0 -10
- package/src/hooks/useCreateBlankFormAttachment.ts +0 -20
- package/src/types/FormAttachment.ts +0 -19
- /package/dist/cjs/{FileAttachment → Attachment}/AttachmentScreen.js +0 -0
- /package/dist/esm/{FileAttachment → Attachment}/AttachmentScreen.js +0 -0
- /package/dist/types/{FileAttachment → Attachment}/useFileAttachmentUrl.d.ts +0 -0
- /package/dist/types/{FileAttachment → Attachment}/useFileUrl.d.ts +0 -0
- /package/src/{FileAttachment → Attachment}/AttachmentScreen.tsx +0 -0
|
@@ -3,21 +3,28 @@
|
|
|
3
3
|
// https://www.boost.org/LICENSE_1_0.txt
|
|
4
4
|
|
|
5
5
|
import { UnstyledList, viewStyles } from "@dwidge/components-rnw";
|
|
6
|
+
import { useNavAction2 } from "@dwidge/hooks-expo";
|
|
6
7
|
import assert from "assert";
|
|
7
|
-
import { useState } from "react";
|
|
8
8
|
import { FormApi } from "../hooks/FormApi";
|
|
9
|
+
import { useNavRoutes } from "../hooks/FormsContext";
|
|
9
10
|
import { FormView } from "./FormView";
|
|
10
11
|
|
|
11
12
|
export const FormListView = ({
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
attachments = FormApi.useGetList({}),
|
|
14
|
+
onPressItem = useNavAction2(
|
|
15
|
+
useNavRoutes().FORM_EDIT_SCREEN,
|
|
16
|
+
async (id: string) => ({
|
|
17
|
+
FormId: id,
|
|
18
|
+
}),
|
|
19
|
+
),
|
|
14
20
|
}) => (
|
|
15
21
|
<UnstyledList
|
|
16
|
-
items={
|
|
22
|
+
items={attachments}
|
|
17
23
|
keyExtractor={(item) => (assert(item.id), item.id)}
|
|
18
|
-
selection={[
|
|
19
|
-
render={(item) => <FormView
|
|
24
|
+
selection={[[], () => {}]}
|
|
25
|
+
render={(item) => <FormView id={item.id} />}
|
|
20
26
|
selectStyle={viewStyles.select}
|
|
21
27
|
style={viewStyles.unselect}
|
|
28
|
+
onPress={onPressItem}
|
|
22
29
|
/>
|
|
23
30
|
);
|
package/src/Form/FormView.tsx
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
// Copyright DWJ 2024.
|
|
2
|
-
// Distributed under the Boost Software License, Version 1.0.
|
|
3
|
-
// https://www.boost.org/LICENSE_1_0.txt
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
// Copyright DWJ 2024.
|
|
2
|
+
// Distributed under the Boost Software License, Version 1.0.
|
|
3
|
+
// https://www.boost.org/LICENSE_1_0.txt
|
|
4
|
+
|
|
5
|
+
import { StyledDate } from "@dwidge/components-expo";
|
|
6
|
+
import { StyledLoader, StyledText, StyledView } from "@dwidge/components-rnw";
|
|
7
|
+
import { SchemaApi } from "../hooks/SchemaApi";
|
|
8
|
+
import { FormApi } from "../hooks/FormApi";
|
|
9
|
+
import { useParams } from "../hooks/useParams";
|
|
10
|
+
import { filterId } from "../hooks";
|
|
11
|
+
|
|
12
|
+
export const FormView = ({
|
|
13
|
+
id = useParams().FormId,
|
|
14
|
+
attachment: [attachment, setAttachment] = FormApi.useItem(filterId(id)),
|
|
15
|
+
form = SchemaApi.useGetItem(filterId(attachment?.SchemaId)),
|
|
16
|
+
}) =>
|
|
17
|
+
attachment && form ? (
|
|
18
|
+
<StyledView space outline gap pad flex>
|
|
19
|
+
<StyledText>{form.name || "untitled"}</StyledText>
|
|
20
|
+
{attachment.createdAt && (
|
|
21
|
+
<StyledDate>{attachment.createdAt * 1000}</StyledDate>
|
|
22
|
+
)}
|
|
23
|
+
</StyledView>
|
|
24
|
+
) : (
|
|
25
|
+
<StyledLoader />
|
|
26
|
+
);
|
package/src/Form/index.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./FormSelectScreen";
|
|
8
|
-
export * from "./FormSelectView";
|
|
9
|
-
export * from "./FormView";
|
|
1
|
+
export * from "./FormEdit.js";
|
|
2
|
+
export * from "./FormEditScreen.js";
|
|
3
|
+
export * from "./FormListEdit.js";
|
|
4
|
+
export * from "./FormListScreen.js";
|
|
5
|
+
export * from "./FormListView.js";
|
|
6
|
+
export * from "./FormView.js";
|
|
@@ -76,21 +76,21 @@ const Form = z.object({
|
|
|
76
76
|
schema: JsonFormSchema,
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
export const
|
|
79
|
+
export const EditSchemaScreen = ({
|
|
80
80
|
form: [form, setForm] = useForm(useFormId()),
|
|
81
81
|
}) => (
|
|
82
82
|
<ScreenView>
|
|
83
|
-
<StyledHeader title="Edit
|
|
83
|
+
<StyledHeader title="Edit Schema" />
|
|
84
84
|
{form == null || !form ? (
|
|
85
85
|
<CenterView>
|
|
86
86
|
<StyledText>
|
|
87
|
-
{form === null ? "The form does not exist." : "Loading..."}
|
|
87
|
+
{form === null ? "The form schema does not exist." : "Loading..."}
|
|
88
88
|
</StyledText>
|
|
89
89
|
</CenterView>
|
|
90
90
|
) : (
|
|
91
91
|
<ScrollView flex gap wide pad selfcenter>
|
|
92
92
|
<JSONSchemaForm
|
|
93
|
-
name="
|
|
93
|
+
name="Schema"
|
|
94
94
|
schema={formSchema}
|
|
95
95
|
value={form}
|
|
96
96
|
onChange={setForm}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright DWJ 2024.
|
|
2
|
+
// Distributed under the Boost Software License, Version 1.0.
|
|
3
|
+
// https://www.boost.org/LICENSE_1_0.txt
|
|
4
|
+
|
|
5
|
+
import { StyledLoader, StyledText, StyledView } from "@dwidge/components-rnw";
|
|
6
|
+
import { SchemaApi } from "../hooks/SchemaApi";
|
|
7
|
+
|
|
8
|
+
export const SchemaCard = ({ form = SchemaApi.useGetItem() }) =>
|
|
9
|
+
form ? (
|
|
10
|
+
<StyledView flex card row>
|
|
11
|
+
<StyledText>{form.name ?? "untitled"}</StyledText>
|
|
12
|
+
</StyledView>
|
|
13
|
+
) : (
|
|
14
|
+
<StyledLoader />
|
|
15
|
+
);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Copyright DWJ 2024.
|
|
2
|
+
// Distributed under the Boost Software License, Version 1.0.
|
|
3
|
+
// https://www.boost.org/LICENSE_1_0.txt
|
|
4
|
+
|
|
5
|
+
import { StyledHeader } from "@dwidge/components-expo";
|
|
6
|
+
import {
|
|
7
|
+
CenterView,
|
|
8
|
+
ScreenView,
|
|
9
|
+
ScrollView,
|
|
10
|
+
StyledText,
|
|
11
|
+
} from "@dwidge/components-rnw";
|
|
12
|
+
import {
|
|
13
|
+
defaultFormSchemaString,
|
|
14
|
+
FormDesigner,
|
|
15
|
+
FormSchema,
|
|
16
|
+
} from "@dwidge/json-forms-designer";
|
|
17
|
+
import { SchemaApi } from "../hooks/SchemaApi";
|
|
18
|
+
import { useParams } from "../hooks/useParams";
|
|
19
|
+
import { filterId } from "../hooks";
|
|
20
|
+
|
|
21
|
+
export const SchemaEditScreen = ({
|
|
22
|
+
schema: [schema, setSchema] = SchemaApi.useItem(
|
|
23
|
+
filterId(useParams().SchemaId),
|
|
24
|
+
),
|
|
25
|
+
}) => (
|
|
26
|
+
<ScreenView>
|
|
27
|
+
<StyledHeader title={["Form", schema?.name].filter(Boolean).join(" - ")} />
|
|
28
|
+
{schema == null || !schema ? (
|
|
29
|
+
<CenterView>
|
|
30
|
+
<StyledText>
|
|
31
|
+
{schema === null ? "The form does not exist." : "Loading..."}
|
|
32
|
+
</StyledText>
|
|
33
|
+
</CenterView>
|
|
34
|
+
) : (
|
|
35
|
+
<ScrollView flex gap wide pad selfcenter>
|
|
36
|
+
<FormDesigner
|
|
37
|
+
schemaString={[
|
|
38
|
+
schema.schema ?? defaultFormSchemaString,
|
|
39
|
+
setSchema &&
|
|
40
|
+
((updater) => {
|
|
41
|
+
const next =
|
|
42
|
+
typeof updater === "function"
|
|
43
|
+
? updater(schema.schema ?? defaultFormSchemaString)
|
|
44
|
+
: updater;
|
|
45
|
+
const parsed = FormSchema.parse(JSON.parse(next));
|
|
46
|
+
setSchema?.((prev) => ({
|
|
47
|
+
...prev,
|
|
48
|
+
name: parsed.schema.title,
|
|
49
|
+
schema: next,
|
|
50
|
+
}));
|
|
51
|
+
}),
|
|
52
|
+
]}
|
|
53
|
+
/>
|
|
54
|
+
</ScrollView>
|
|
55
|
+
)}
|
|
56
|
+
</ScreenView>
|
|
57
|
+
);
|
|
@@ -5,26 +5,28 @@
|
|
|
5
5
|
import { UnstyledList, viewStyles } from "@dwidge/components-rnw";
|
|
6
6
|
import { useNavAction2 } from "@dwidge/hooks-expo";
|
|
7
7
|
import assert from "assert";
|
|
8
|
-
import {
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { SchemaApi } from "../hooks/SchemaApi";
|
|
9
10
|
import { useNavRoutes } from "../hooks/FormsContext";
|
|
10
|
-
import {
|
|
11
|
+
import { SchemaCard } from "./SchemaEdit";
|
|
11
12
|
|
|
12
|
-
export const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export const SchemaListEdit = ({
|
|
14
|
+
elements = SchemaApi.useGetList(),
|
|
15
|
+
selection: [selection, setSelection] = useState<string[]>([]),
|
|
16
|
+
onPress = useNavAction2(
|
|
17
|
+
useNavRoutes().SCHEMA_EDIT_SCREEN,
|
|
16
18
|
async (id: string) => ({
|
|
17
|
-
|
|
19
|
+
SchemaId: id,
|
|
18
20
|
}),
|
|
19
21
|
),
|
|
20
22
|
}) => (
|
|
21
23
|
<UnstyledList
|
|
22
|
-
items={
|
|
24
|
+
items={elements}
|
|
23
25
|
keyExtractor={(item) => (assert(item.id), item.id)}
|
|
24
|
-
selection={[
|
|
25
|
-
render={(item) => <
|
|
26
|
+
selection={[selection, setSelection]}
|
|
27
|
+
render={(item) => <SchemaCard form={item} />}
|
|
26
28
|
selectStyle={viewStyles.select}
|
|
27
29
|
style={viewStyles.unselect}
|
|
28
|
-
onPress={
|
|
30
|
+
onPress={onPress}
|
|
29
31
|
/>
|
|
30
32
|
);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright DWJ 2024.
|
|
2
|
+
// Distributed under the Boost Software License, Version 1.0.
|
|
3
|
+
// https://www.boost.org/LICENSE_1_0.txt
|
|
4
|
+
|
|
5
|
+
import { StyledHeader } from "@dwidge/components-expo";
|
|
6
|
+
import {
|
|
7
|
+
CenterView,
|
|
8
|
+
ScreenView,
|
|
9
|
+
ScrollView,
|
|
10
|
+
StyledFontAwesome,
|
|
11
|
+
StyledView,
|
|
12
|
+
} from "@dwidge/components-rnw";
|
|
13
|
+
import { useMemoState } from "@dwidge/hooks-react";
|
|
14
|
+
import { TouchableOpacity } from "react-native";
|
|
15
|
+
import { SchemaApi } from "../hooks/SchemaApi";
|
|
16
|
+
import { SchemaListEdit } from "./SchemaListEdit";
|
|
17
|
+
import { useCreateBlankSchema } from "../hooks/useCreateBlankSchema";
|
|
18
|
+
|
|
19
|
+
export const SchemaListScreen = ({
|
|
20
|
+
onCreate = useCreateBlankSchema(),
|
|
21
|
+
onDeleteList = SchemaApi.useDeleteList(),
|
|
22
|
+
selection = useMemoState<string[]>([]),
|
|
23
|
+
}) => (
|
|
24
|
+
<ScreenView>
|
|
25
|
+
<StyledHeader
|
|
26
|
+
title="Schemas"
|
|
27
|
+
actions={[
|
|
28
|
+
{
|
|
29
|
+
icon: "remove-circle",
|
|
30
|
+
onPress:
|
|
31
|
+
onDeleteList && selection[0].length
|
|
32
|
+
? () => onDeleteList(selection[0].map((id) => ({ id })))
|
|
33
|
+
: undefined,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
icon: "add-circle",
|
|
37
|
+
onPress: onCreate,
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
<ScrollView gap pad>
|
|
42
|
+
<StyledView flex column>
|
|
43
|
+
<StyledView>
|
|
44
|
+
<SchemaListEdit selection={selection} />
|
|
45
|
+
</StyledView>
|
|
46
|
+
<TouchableOpacity style={{ flex: 1 }} onPress={onCreate}>
|
|
47
|
+
<CenterView row gap>
|
|
48
|
+
<StyledFontAwesome name="plus" size={30} />
|
|
49
|
+
</CenterView>
|
|
50
|
+
</TouchableOpacity>
|
|
51
|
+
</StyledView>
|
|
52
|
+
</ScrollView>
|
|
53
|
+
</ScreenView>
|
|
54
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright DWJ 2024.
|
|
2
|
+
// Distributed under the Boost Software License, Version 1.0.
|
|
3
|
+
// https://www.boost.org/LICENSE_1_0.txt
|
|
4
|
+
|
|
5
|
+
import { UnstyledList, viewStyles } from "@dwidge/components-rnw";
|
|
6
|
+
import assert from "assert";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { SchemaApi } from "../hooks/SchemaApi";
|
|
9
|
+
import { SchemaView } from "./SchemaView";
|
|
10
|
+
|
|
11
|
+
export const SchemaListView = ({
|
|
12
|
+
elements = SchemaApi.useGetList(),
|
|
13
|
+
selection: [selection, setSelection] = useState<string[]>([]),
|
|
14
|
+
}) => (
|
|
15
|
+
<UnstyledList
|
|
16
|
+
items={elements}
|
|
17
|
+
keyExtractor={(item) => (assert(item.id), item.id)}
|
|
18
|
+
selection={[selection, setSelection]}
|
|
19
|
+
render={(item) => <SchemaView form={item} />}
|
|
20
|
+
selectStyle={viewStyles.select}
|
|
21
|
+
style={viewStyles.unselect}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
@@ -11,38 +11,33 @@ import {
|
|
|
11
11
|
} from "@dwidge/components-rnw";
|
|
12
12
|
import { useNavAction2 } from "@dwidge/hooks-expo";
|
|
13
13
|
import { StyledButton } from "@dwidge/components-rnw";
|
|
14
|
-
import {
|
|
14
|
+
import { SchemaSelectView } from "./SchemaSelectView";
|
|
15
15
|
import { useNavRoutes } from "../hooks/FormsContext";
|
|
16
16
|
import { StyledHeader } from "@dwidge/components-expo";
|
|
17
|
-
import {
|
|
17
|
+
import { useCreateBlankForm } from "../hooks";
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
useNavAction2(
|
|
21
|
-
useNavRoutes().FORM_ATTACHMENT_EDIT_SCREEN,
|
|
22
|
-
useCreateBlankFormAttachment({}),
|
|
23
|
-
);
|
|
19
|
+
const useOnSelectSchema = () =>
|
|
20
|
+
useNavAction2(useNavRoutes().FORM_EDIT_SCREEN, useCreateBlankForm({}));
|
|
24
21
|
|
|
25
|
-
export const
|
|
26
|
-
|
|
22
|
+
export const SchemaSelectScreen = ({
|
|
23
|
+
onSelectSchema = useOnSelectSchema(),
|
|
27
24
|
selected: [selected, setSelected] = useState<string[]>([]),
|
|
28
25
|
}) => (
|
|
29
26
|
<ScreenView>
|
|
30
|
-
<StyledHeader title="Select
|
|
27
|
+
<StyledHeader title="Select Schema" />
|
|
31
28
|
<ScrollView gap pad>
|
|
32
29
|
<StyledView>
|
|
33
|
-
<StyledText center>
|
|
34
|
-
Select from the list of forms below, or use the search option above.
|
|
35
|
-
</StyledText>
|
|
30
|
+
<StyledText center>Select one or more</StyledText>
|
|
36
31
|
</StyledView>
|
|
37
|
-
<
|
|
32
|
+
<SchemaSelectView selected={[selected, setSelected]} />
|
|
38
33
|
<StyledButton
|
|
39
34
|
onPress={
|
|
40
|
-
selected.length > 0 &&
|
|
41
|
-
? () =>
|
|
35
|
+
selected.length > 0 && onSelectSchema
|
|
36
|
+
? () => onSelectSchema(selected.map((id) => ({ id })))
|
|
42
37
|
: undefined
|
|
43
38
|
}
|
|
44
39
|
>
|
|
45
|
-
Select
|
|
40
|
+
Select Schema
|
|
46
41
|
</StyledButton>
|
|
47
42
|
</ScrollView>
|
|
48
43
|
</ScreenView>
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import { StyledButton } from "@dwidge/components-rnw";
|
|
6
6
|
import { ReactNode, useState } from "react";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { SchemaApi } from "../hooks/SchemaApi";
|
|
8
|
+
import { SchemaListView } from "./SchemaListView";
|
|
9
9
|
|
|
10
|
-
export const
|
|
11
|
-
formList =
|
|
10
|
+
export const SchemaSelectView = ({
|
|
11
|
+
formList = SchemaApi.useGetList(),
|
|
12
12
|
selected: [selected, setSelected] = useState<string[]>([]),
|
|
13
13
|
searchValue: [searchValue, setSearchValue] = useState(""),
|
|
14
|
-
|
|
14
|
+
createSchemaList = SchemaApi.useCreateList(),
|
|
15
15
|
}): ReactNode => (
|
|
16
16
|
<>
|
|
17
|
-
<
|
|
17
|
+
<SchemaListView
|
|
18
18
|
elements={
|
|
19
19
|
searchValue
|
|
20
20
|
? formList?.filter((form) =>
|
|
@@ -24,8 +24,8 @@ export const FormSelectView = ({
|
|
|
24
24
|
}
|
|
25
25
|
selection={[selected, setSelected]}
|
|
26
26
|
/>
|
|
27
|
-
<StyledButton onPress={
|
|
28
|
-
Create New
|
|
27
|
+
<StyledButton onPress={createSchemaList && (() => createSchemaList([{}]))}>
|
|
28
|
+
Create New Schema
|
|
29
29
|
</StyledButton>
|
|
30
30
|
</>
|
|
31
31
|
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright DWJ 2024.
|
|
2
|
+
// Distributed under the Boost Software License, Version 1.0.
|
|
3
|
+
// https://www.boost.org/LICENSE_1_0.txt
|
|
4
|
+
|
|
5
|
+
import { StyledText } from "@dwidge/components-rnw";
|
|
6
|
+
import { SchemaApi } from "../hooks/SchemaApi";
|
|
7
|
+
|
|
8
|
+
export const SchemaView = ({
|
|
9
|
+
form = SchemaApi.useGetItem(),
|
|
10
|
+
onPress = () => {},
|
|
11
|
+
}) => <StyledText>{form?.name || "untitled"}</StyledText>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./EditSchemaScreen.js";
|
|
2
|
+
export * from "./SchemaEdit.js";
|
|
3
|
+
export * from "./SchemaEditScreen.js";
|
|
4
|
+
export * from "./SchemaListEdit.js";
|
|
5
|
+
export * from "./SchemaListScreen.js";
|
|
6
|
+
export * from "./SchemaListView.js";
|
|
7
|
+
export * from "./SchemaSelectScreen.js";
|
|
8
|
+
export * from "./SchemaSelectView.js";
|
|
9
|
+
export * from "./SchemaView.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { File1 } from "../types/File1.js";
|
|
2
2
|
import { createApi } from "./createApi.js";
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const AttachmentApi = createApi<File1>("Attachment", {
|
|
5
5
|
id: undefined,
|
|
6
6
|
createdAt: undefined,
|
|
7
7
|
createdBy: undefined,
|
|
8
8
|
FileId: undefined,
|
|
9
|
+
SchemaId: undefined,
|
|
9
10
|
FormId: undefined,
|
|
10
|
-
FormAttachmentId: undefined,
|
|
11
11
|
});
|
package/src/hooks/FileApi.ts
CHANGED
package/src/hooks/FormApi.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Form1 } from "../types/Form1.js";
|
|
2
2
|
import { createApi } from "./createApi.js";
|
|
3
3
|
|
|
4
|
-
export const FormApi = createApi<Form1>({
|
|
4
|
+
export const FormApi = createApi<Form1>("Form", {
|
|
5
5
|
id: undefined,
|
|
6
6
|
createdAt: undefined,
|
|
7
7
|
createdBy: undefined,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
schema: undefined,
|
|
8
|
+
SchemaId: undefined,
|
|
9
|
+
data: undefined,
|
|
11
10
|
});
|
|
@@ -8,16 +8,16 @@ import { z } from "zod";
|
|
|
8
8
|
|
|
9
9
|
export const FormsContext = createContext({
|
|
10
10
|
routes: {
|
|
11
|
-
|
|
12
|
-
FORM_ATTACHMENT_EDIT_SCREEN: "",
|
|
11
|
+
FORM_LIST_SCREEN: "",
|
|
13
12
|
FORM_EDIT_SCREEN: "",
|
|
14
|
-
|
|
13
|
+
SCHEMA_EDIT_SCREEN: "",
|
|
14
|
+
SCHEMA_SELECT_SCREEN: "",
|
|
15
15
|
},
|
|
16
16
|
useParams: () =>
|
|
17
17
|
z
|
|
18
18
|
.object({
|
|
19
19
|
FormId: z.coerce.string().nullable(),
|
|
20
|
-
|
|
20
|
+
SchemaId: z.coerce.string().nullable(),
|
|
21
21
|
AttachmentId: z.coerce.string().nullable(),
|
|
22
22
|
})
|
|
23
23
|
.partial()
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Schema1 } from "../types/Schema1.js";
|
|
2
|
+
import { createApi } from "./createApi.js";
|
|
3
|
+
|
|
4
|
+
export const SchemaApi = createApi<Schema1>("Schema", {
|
|
5
|
+
id: undefined,
|
|
6
|
+
createdAt: undefined,
|
|
7
|
+
createdBy: undefined,
|
|
8
|
+
name: undefined,
|
|
9
|
+
type: undefined,
|
|
10
|
+
schema: undefined,
|
|
11
|
+
});
|
package/src/hooks/createApi.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AsyncState
|
|
1
|
+
import { AsyncState } from "@dwidge/hooks-react";
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
|
-
import { useParams } from "./useParams";
|
|
4
3
|
|
|
5
4
|
export type ApiItem = Record<string, string | number | boolean | null>;
|
|
6
5
|
|
|
7
6
|
export const createApi = <T extends ApiItem>(
|
|
7
|
+
name: string,
|
|
8
8
|
defaultFilter: Partial<T> = {},
|
|
9
9
|
) => {
|
|
10
10
|
type Get = Partial<T>;
|
|
@@ -22,35 +22,38 @@ export const createApi = <T extends ApiItem>(
|
|
|
22
22
|
deleteItem: (item: Key) => Promise<Key | null>;
|
|
23
23
|
|
|
24
24
|
const message =
|
|
25
|
-
|
|
25
|
+
name +
|
|
26
|
+
": createApiW1: Please wrap App with <Context.Provider value={{}}></Context.Provider>";
|
|
26
27
|
|
|
27
28
|
const Context = createContext<{
|
|
28
29
|
useGetList: (filter?: Filter) => undefined | Get[];
|
|
29
30
|
useCreateList: () => ((list: Set[]) => Promise<(Get | null)[]>) | undefined;
|
|
30
31
|
useDeleteList: () => ((list: Key[]) => Promise<(Get | null)[]>) | undefined;
|
|
31
|
-
useGetItem: (
|
|
32
|
-
useItem: (
|
|
32
|
+
useGetItem: (filter?: Filter) => undefined | Get | null;
|
|
33
|
+
useItem: (filter?: Filter) => AsyncState<Get | null>;
|
|
33
34
|
}>({
|
|
34
|
-
useGetList: () => (console.warn(message), undefined),
|
|
35
|
-
useCreateList: () => (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
useGetList: () => (console.warn("useGetList1: " + message), undefined),
|
|
36
|
+
useCreateList: () => (
|
|
37
|
+
console.warn("useCreateList1: " + message), undefined
|
|
38
|
+
),
|
|
39
|
+
useDeleteList: () => (
|
|
40
|
+
console.warn("useDeleteList1: " + message), undefined
|
|
41
|
+
),
|
|
42
|
+
useGetItem: () => (console.warn("useGetItem1: " + message), undefined),
|
|
43
|
+
useItem: () => (console.warn("useItem1: " + message), []),
|
|
39
44
|
});
|
|
40
45
|
|
|
41
|
-
const useGetList = (filter
|
|
42
|
-
useContext(Context).useGetList({ ...
|
|
46
|
+
const useGetList = (filter?: Filter) =>
|
|
47
|
+
useContext(Context).useGetList({ ...defaultFilter, ...filter });
|
|
43
48
|
const useCreateList = () => useContext(Context).useCreateList();
|
|
44
49
|
const useDeleteList = () => useContext(Context).useDeleteList();
|
|
45
|
-
const useGetItem = (
|
|
50
|
+
const useGetItem = (filter?: Filter) =>
|
|
46
51
|
useContext(Context).useGetItem(
|
|
47
|
-
|
|
52
|
+
filter ? { ...defaultFilter, ...filter } : undefined,
|
|
48
53
|
);
|
|
49
|
-
const useItem = (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
id ? { ...ids, ...defaultFilter, id } : undefined,
|
|
53
|
-
),
|
|
54
|
+
const useItem = (filter?: Filter) =>
|
|
55
|
+
useContext(Context).useItem(
|
|
56
|
+
filter ? { ...defaultFilter, ...filter } : undefined,
|
|
54
57
|
);
|
|
55
58
|
|
|
56
59
|
return {
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export * from "./FileApi";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./FormsContext";
|
|
6
|
-
export * from "./createApi";
|
|
7
|
-
export * from "./useCreateBlankAttachment";
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./useParams";
|
|
1
|
+
export * from "./FileApi.js";
|
|
2
|
+
export * from "./AttachmentApi.js";
|
|
3
|
+
export * from "./SchemaApi.js";
|
|
4
|
+
export * from "./FormApi.js";
|
|
5
|
+
export * from "./FormsContext.js";
|
|
6
|
+
export * from "./createApi.js";
|
|
7
|
+
export * from "./useCreateBlankAttachment.js";
|
|
8
|
+
export * from "./useCreateBlankSchema.js";
|
|
9
|
+
export * from "./useCreateBlankForm.js";
|
|
10
|
+
export * from "./useParams.js";
|
|
11
|
+
export * from "./useIdFilter.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
2
|
import { useParams } from "./useParams";
|
|
3
3
|
import { FileApi } from "./FileApi";
|
|
4
|
-
import {
|
|
4
|
+
import { AttachmentApi } from "./AttachmentApi";
|
|
5
5
|
|
|
6
6
|
export const useCreateBlankAttachment = ({
|
|
7
|
-
createAttachmentList =
|
|
7
|
+
createAttachmentList = AttachmentApi.useCreateList(),
|
|
8
8
|
createFileList = FileApi.useCreateList(),
|
|
9
9
|
AttachIds = useParams(),
|
|
10
10
|
} = {}) =>
|
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
// Distributed under the Boost Software License, Version 1.0.
|
|
3
3
|
// https://www.boost.org/LICENSE_1_0.txt
|
|
4
4
|
|
|
5
|
+
import { Schema1Key } from "../types/Schema1";
|
|
6
|
+
import { SchemaApi } from "./SchemaApi";
|
|
5
7
|
import { FormApi } from "./FormApi";
|
|
8
|
+
import { useParams } from "./useParams";
|
|
6
9
|
|
|
7
10
|
export const useCreateBlankForm = ({
|
|
11
|
+
createSchemaList = SchemaApi.useCreateList(),
|
|
8
12
|
createFormList = FormApi.useCreateList(),
|
|
13
|
+
AttachmentIds = useParams(),
|
|
9
14
|
} = {}) =>
|
|
10
|
-
createFormList
|
|
11
|
-
? (
|
|
12
|
-
|
|
15
|
+
createSchemaList && createFormList
|
|
16
|
+
? async (forms: Schema1Key[]) =>
|
|
17
|
+
createFormList(
|
|
18
|
+
forms.map((form) => ({ ...AttachmentIds, FormId: form.id })),
|
|
19
|
+
).then(([r]) => ({ FormId: r?.id }))
|
|
20
|
+
: async () => undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright DWJ 2024.
|
|
2
|
+
// Distributed under the Boost Software License, Version 1.0.
|
|
3
|
+
// https://www.boost.org/LICENSE_1_0.txt
|
|
4
|
+
|
|
5
|
+
import { SchemaApi } from "./SchemaApi";
|
|
6
|
+
|
|
7
|
+
export const useCreateBlankSchema = ({
|
|
8
|
+
createList = SchemaApi.useCreateList(),
|
|
9
|
+
} = {}) =>
|
|
10
|
+
createList
|
|
11
|
+
? () => createList([{}]).then(([v]) => ({ SchemaId: v?.id }))
|
|
12
|
+
: undefined;
|