@hrbolek/uoisfrontend-template 0.6.0
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/index.html +104 -0
- package/package.json +24 -0
- package/src/Base/Components/Attribute.jsx +51 -0
- package/src/Base/Components/CardCapsule.jsx +353 -0
- package/src/Base/Components/Col.jsx +36 -0
- package/src/Base/Components/ConfirmEdit.jsx +61 -0
- package/src/Base/Components/CopyButton.jsx +33 -0
- package/src/Base/Components/LargeCard.jsx +22 -0
- package/src/Base/Components/Link.jsx +42 -0
- package/src/Base/Components/LiveEdit.jsx +64 -0
- package/src/Base/Components/MediumCard.jsx +30 -0
- package/src/Base/Components/MediumContent.jsx +74 -0
- package/src/Base/Components/MediumEditableContent.jsx +52 -0
- package/src/Base/Components/ProxyLink.jsx +132 -0
- package/src/Base/Components/Row.jsx +23 -0
- package/src/Base/Components/Table.jsx +275 -0
- package/src/Base/Components/index.js +14 -0
- package/src/Base/Components/style.js +278 -0
- package/src/Base/FormControls/Collapsible.jsx +46 -0
- package/src/Base/FormControls/Dialog.jsx +75 -0
- package/src/Base/FormControls/EntityLookup.jsx +175 -0
- package/src/Base/FormControls/Filter.jsx +834 -0
- package/src/Base/FormControls/Input.jsx +163 -0
- package/src/Base/FormControls/Label.jsx +40 -0
- package/src/Base/FormControls/Select.jsx +150 -0
- package/src/Base/FormControls/TextArea.jsx +86 -0
- package/src/Base/FormControls/index.js +8 -0
- package/src/Base/Helpers/AsyncStateIndicator.jsx +9 -0
- package/src/Base/Helpers/GQLEntityProvider.jsx +163 -0
- package/src/Base/Helpers/NavigationHistoryProvider.jsx +178 -0
- package/src/Base/Helpers/PlaceChild.jsx +13 -0
- package/src/Base/Helpers/generateQuery.js +508 -0
- package/src/Base/Helpers/index.js +5 -0
- package/src/Base/Mutations/Create.jsx +152 -0
- package/src/Base/Mutations/Delete.jsx +237 -0
- package/src/Base/Mutations/General.jsx +241 -0
- package/src/Base/Mutations/InteractiveMutations.jsx +32 -0
- package/src/Base/Mutations/Update.jsx +270 -0
- package/src/Base/Mutations/helpers.jsx +7 -0
- package/src/Base/Mutations/index.js +5 -0
- package/src/Base/Pages/Page.jsx +235 -0
- package/src/Base/Pages/PageCatch.jsx +235 -0
- package/src/Base/Pages/PageNavbar.jsx +70 -0
- package/src/Base/Pages/PageVector.jsx +229 -0
- package/src/Base/Pages/RouterSegment.jsx +66 -0
- package/src/Base/Pages/index.js +5 -0
- package/src/Base/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/Base/Queries/Fragments.jsx +101 -0
- package/src/Base/Queries/InsertAsyncAction.jsx +40 -0
- package/src/Base/Queries/ReadAsyncAction.jsx +44 -0
- package/src/Base/Queries/ReadPageAsyncAction.jsx +16 -0
- package/src/Base/Queries/SearchAsyncAction.jsx +16 -0
- package/src/Base/Queries/UpdateAsyncAction.jsx +40 -0
- package/src/Base/Queries/index.js +6 -0
- package/src/Base/Scalars/ScalarAttribute.jsx +49 -0
- package/src/Base/Scalars/index.js +1 -0
- package/src/Base/Vectors/VectorAttribute.jsx +137 -0
- package/src/Base/Vectors/index.js +1 -0
- package/src/Base/index.js +32 -0
- package/src/GroupGQLModel/Components/CUDButton.jsx +128 -0
- package/src/GroupGQLModel/Components/CardCapsule.jsx +44 -0
- package/src/GroupGQLModel/Components/Children.jsx +31 -0
- package/src/GroupGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/GroupGQLModel/Components/Filter.jsx +14 -0
- package/src/GroupGQLModel/Components/LargeCard.jsx +68 -0
- package/src/GroupGQLModel/Components/Link.jsx +54 -0
- package/src/GroupGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/GroupGQLModel/Components/MediumCard.jsx +51 -0
- package/src/GroupGQLModel/Components/MediumContent.jsx +56 -0
- package/src/GroupGQLModel/Components/MediumEditableContent.jsx +52 -0
- package/src/GroupGQLModel/Components/Table.jsx +70 -0
- package/src/GroupGQLModel/Components/index.js +14 -0
- package/src/GroupGQLModel/Mutations/AddMembership.jsx +156 -0
- package/src/GroupGQLModel/Mutations/Create.jsx +67 -0
- package/src/GroupGQLModel/Mutations/Delete.jsx +81 -0
- package/src/GroupGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/GroupGQLModel/Mutations/Update.jsx +74 -0
- package/src/GroupGQLModel/Pages/PageBase.jsx +56 -0
- package/src/GroupGQLModel/Pages/PageCreateItem.jsx +27 -0
- package/src/GroupGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/GroupGQLModel/Pages/PageNavbar.jsx +264 -0
- package/src/GroupGQLModel/Pages/PageReadItem.jsx +12 -0
- package/src/GroupGQLModel/Pages/PageReadItemEx.jsx +57 -0
- package/src/GroupGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/GroupGQLModel/Pages/PageVector.jsx +80 -0
- package/src/GroupGQLModel/Pages/RouterSegment.jsx +85 -0
- package/src/GroupGQLModel/Pages/index.js +2 -0
- package/src/GroupGQLModel/Queries/DeleteAsyncAction.jsx +22 -0
- package/src/GroupGQLModel/Queries/Fragments.jsx +129 -0
- package/src/GroupGQLModel/Queries/InsertAsyncAction.jsx +43 -0
- package/src/GroupGQLModel/Queries/ReadAsyncAction.jsx +44 -0
- package/src/GroupGQLModel/Queries/ReadPageAsyncAction.jsx +18 -0
- package/src/GroupGQLModel/Queries/SearchAsyncAction.jsx +15 -0
- package/src/GroupGQLModel/Queries/UpdateAsyncAction.jsx +56 -0
- package/src/GroupGQLModel/Queries/index.js +6 -0
- package/src/GroupGQLModel/Scalars/GroupRoles.jsx +69 -0
- package/src/GroupGQLModel/Scalars/MasterGroup.jsx +15 -0
- package/src/GroupGQLModel/Scalars/RBACObject.jsx +233 -0
- package/src/GroupGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/GroupGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/GroupGQLModel/Scalars/index.js +1 -0
- package/src/GroupGQLModel/Vectors/GroupMemberships.jsx +115 -0
- package/src/GroupGQLModel/Vectors/GroupRoles.jsx +112 -0
- package/src/GroupGQLModel/Vectors/GroupRolesOn.jsx +113 -0
- package/src/GroupGQLModel/Vectors/GroupSubgroups.jsx +97 -0
- package/src/GroupGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/GroupGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/GroupGQLModel/Vectors/index.js +1 -0
- package/src/GroupGQLModel/index.js +7 -0
- package/src/GroupTypeGQLModel/Components/CUDButton.jsx +128 -0
- package/src/GroupTypeGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/GroupTypeGQLModel/Components/Children.jsx +31 -0
- package/src/GroupTypeGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/GroupTypeGQLModel/Components/Filter.jsx +14 -0
- package/src/GroupTypeGQLModel/Components/LargeCard.jsx +49 -0
- package/src/GroupTypeGQLModel/Components/Link.jsx +53 -0
- package/src/GroupTypeGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/GroupTypeGQLModel/Components/MediumCard.jsx +39 -0
- package/src/GroupTypeGQLModel/Components/MediumContent.jsx +97 -0
- package/src/GroupTypeGQLModel/Components/MediumEditableContent.jsx +35 -0
- package/src/GroupTypeGQLModel/Components/Table.jsx +7 -0
- package/src/GroupTypeGQLModel/Components/index.js +14 -0
- package/src/GroupTypeGQLModel/Mutations/Create.jsx +67 -0
- package/src/GroupTypeGQLModel/Mutations/Delete.jsx +80 -0
- package/src/GroupTypeGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/GroupTypeGQLModel/Mutations/Update.jsx +74 -0
- package/src/GroupTypeGQLModel/Pages/Page.jsx +3 -0
- package/src/GroupTypeGQLModel/Pages/PageBase.jsx +26 -0
- package/src/GroupTypeGQLModel/Pages/PageCreateItem.jsx +21 -0
- package/src/GroupTypeGQLModel/Pages/PageDeleteItem.jsx +13 -0
- package/src/GroupTypeGQLModel/Pages/PageNavbar.jsx +148 -0
- package/src/GroupTypeGQLModel/Pages/PageReadItem.jsx +28 -0
- package/src/GroupTypeGQLModel/Pages/PageUpdateItem.jsx +25 -0
- package/src/GroupTypeGQLModel/Pages/PageVector.jsx +83 -0
- package/src/GroupTypeGQLModel/Pages/RouterSegment.jsx +68 -0
- package/src/GroupTypeGQLModel/Pages/index.js +10 -0
- package/src/GroupTypeGQLModel/Queries/DeleteAsyncAction.jsx +27 -0
- package/src/GroupTypeGQLModel/Queries/Fragments.jsx +96 -0
- package/src/GroupTypeGQLModel/Queries/InsertAsyncAction.jsx +41 -0
- package/src/GroupTypeGQLModel/Queries/ReadAsyncAction.jsx +45 -0
- package/src/GroupTypeGQLModel/Queries/ReadPageAsyncAction.jsx +14 -0
- package/src/GroupTypeGQLModel/Queries/SearchAsyncAction.jsx +16 -0
- package/src/GroupTypeGQLModel/Queries/UpdateAsyncAction.jsx +42 -0
- package/src/GroupTypeGQLModel/Queries/index.js +6 -0
- package/src/GroupTypeGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/GroupTypeGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/GroupTypeGQLModel/Scalars/index.js +1 -0
- package/src/GroupTypeGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/GroupTypeGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/GroupTypeGQLModel/Vectors/index.js +1 -0
- package/src/GroupTypeGQLModel/index.js +6 -0
- package/src/MembershipGQLModel/Components/CUDButton.jsx +128 -0
- package/src/MembershipGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/MembershipGQLModel/Components/Children.jsx +31 -0
- package/src/MembershipGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/MembershipGQLModel/Components/Filter.jsx +14 -0
- package/src/MembershipGQLModel/Components/LargeCard.jsx +49 -0
- package/src/MembershipGQLModel/Components/Link.jsx +54 -0
- package/src/MembershipGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/MembershipGQLModel/Components/MediumCard.jsx +39 -0
- package/src/MembershipGQLModel/Components/MediumContent.jsx +97 -0
- package/src/MembershipGQLModel/Components/MediumEditableContent.jsx +35 -0
- package/src/MembershipGQLModel/Components/Table.jsx +7 -0
- package/src/MembershipGQLModel/Components/index.js +14 -0
- package/src/MembershipGQLModel/Mutations/Create.jsx +67 -0
- package/src/MembershipGQLModel/Mutations/Delete.jsx +80 -0
- package/src/MembershipGQLModel/Mutations/InteractiveMutations.jsx +31 -0
- package/src/MembershipGQLModel/Mutations/Update.jsx +74 -0
- package/src/MembershipGQLModel/Mutations/helpers.jsx +7 -0
- package/src/MembershipGQLModel/Pages/PageBase.jsx +57 -0
- package/src/MembershipGQLModel/Pages/PageCreateItem.jsx +28 -0
- package/src/MembershipGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/MembershipGQLModel/Pages/PageNavbar.jsx +110 -0
- package/src/MembershipGQLModel/Pages/PageReadItem.jsx +11 -0
- package/src/MembershipGQLModel/Pages/PageReadItemEx.jsx +42 -0
- package/src/MembershipGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/MembershipGQLModel/Pages/PageVector.jsx +80 -0
- package/src/MembershipGQLModel/Pages/RouterSegment.jsx +73 -0
- package/src/MembershipGQLModel/Pages/index.js +2 -0
- package/src/MembershipGQLModel/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/MembershipGQLModel/Queries/Fragments.jsx +113 -0
- package/src/MembershipGQLModel/Queries/InsertAsyncAction.jsx +38 -0
- package/src/MembershipGQLModel/Queries/ReadAsyncAction.jsx +44 -0
- package/src/MembershipGQLModel/Queries/ReadPageAsyncAction.jsx +13 -0
- package/src/MembershipGQLModel/Queries/SearchAsyncAction.jsx +16 -0
- package/src/MembershipGQLModel/Queries/UpdateAsyncAction.jsx +40 -0
- package/src/MembershipGQLModel/Queries/index.js +6 -0
- package/src/MembershipGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/MembershipGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/MembershipGQLModel/Scalars/index.js +1 -0
- package/src/MembershipGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/MembershipGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/MembershipGQLModel/Vectors/index.js +1 -0
- package/src/MembershipGQLModel/WhatToDo.md +44 -0
- package/src/MembershipGQLModel/index.js +6 -0
- package/src/RBACGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/RBACGQLModel/Components/Children.jsx +31 -0
- package/src/RBACGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/RBACGQLModel/Components/Filter.jsx +14 -0
- package/src/RBACGQLModel/Components/LargeCard.jsx +50 -0
- package/src/RBACGQLModel/Components/Link.jsx +54 -0
- package/src/RBACGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/RBACGQLModel/Components/MediumCard.jsx +39 -0
- package/src/RBACGQLModel/Components/MediumContent.jsx +96 -0
- package/src/RBACGQLModel/Components/MediumEditableContent.jsx +212 -0
- package/src/RBACGQLModel/Components/Table.jsx +7 -0
- package/src/RBACGQLModel/Components/index.js +13 -0
- package/src/RBACGQLModel/Mutations/Create.jsx +202 -0
- package/src/RBACGQLModel/Mutations/Delete.jsx +173 -0
- package/src/RBACGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/RBACGQLModel/Mutations/Update.jsx +147 -0
- package/src/RBACGQLModel/Mutations/helpers.jsx +7 -0
- package/src/RBACGQLModel/Pages/PageBase.jsx +56 -0
- package/src/RBACGQLModel/Pages/PageCreateItem.jsx +28 -0
- package/src/RBACGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/RBACGQLModel/Pages/PageNavbar.jsx +160 -0
- package/src/RBACGQLModel/Pages/PageReadItem.jsx +11 -0
- package/src/RBACGQLModel/Pages/PageReadItemEx.jsx +42 -0
- package/src/RBACGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/RBACGQLModel/Pages/PageVector.jsx +80 -0
- package/src/RBACGQLModel/Pages/RouterSegment.jsx +72 -0
- package/src/RBACGQLModel/Pages/index.js +2 -0
- package/src/RBACGQLModel/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/RBACGQLModel/Queries/Fragments.jsx +101 -0
- package/src/RBACGQLModel/Queries/InsertAsyncAction.jsx +40 -0
- package/src/RBACGQLModel/Queries/ReadAsyncAction.jsx +44 -0
- package/src/RBACGQLModel/Queries/ReadPageAsyncAction.jsx +13 -0
- package/src/RBACGQLModel/Queries/SearchAsyncAction.jsx +16 -0
- package/src/RBACGQLModel/Queries/UpdateAsyncAction.jsx +40 -0
- package/src/RBACGQLModel/Queries/index.js +6 -0
- package/src/RBACGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/RBACGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/RBACGQLModel/Scalars/index.js +1 -0
- package/src/RBACGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/RBACGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/RBACGQLModel/Vectors/index.js +1 -0
- package/src/RBACGQLModel/WhatToDo.md +44 -0
- package/src/RBACGQLModel/index.js +71 -0
- package/src/RoleGQLModel/Components/CUDButton.jsx +128 -0
- package/src/RoleGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/RoleGQLModel/Components/Children.jsx +31 -0
- package/src/RoleGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/RoleGQLModel/Components/Filter.jsx +14 -0
- package/src/RoleGQLModel/Components/LargeCard.jsx +49 -0
- package/src/RoleGQLModel/Components/Link.jsx +55 -0
- package/src/RoleGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/RoleGQLModel/Components/MediumCard.jsx +39 -0
- package/src/RoleGQLModel/Components/MediumContent.jsx +97 -0
- package/src/RoleGQLModel/Components/MediumEditableContent.jsx +72 -0
- package/src/RoleGQLModel/Components/RBACObject.jsx +22 -0
- package/src/RoleGQLModel/Components/Table.jsx +82 -0
- package/src/RoleGQLModel/Components/index.js +14 -0
- package/src/RoleGQLModel/Mutations/AddRoleOnGroup.jsx +117 -0
- package/src/RoleGQLModel/Mutations/Create.jsx +67 -0
- package/src/RoleGQLModel/Mutations/Delete.jsx +80 -0
- package/src/RoleGQLModel/Mutations/InteractiveMutations.jsx +31 -0
- package/src/RoleGQLModel/Mutations/Update.jsx +74 -0
- package/src/RoleGQLModel/Pages/Page.jsx +3 -0
- package/src/RoleGQLModel/Pages/PageBase.jsx +26 -0
- package/src/RoleGQLModel/Pages/PageContent.jsx +31 -0
- package/src/RoleGQLModel/Pages/PageCreateItem.jsx +21 -0
- package/src/RoleGQLModel/Pages/PageDeleteItem.jsx +13 -0
- package/src/RoleGQLModel/Pages/PageNavbar.jsx +161 -0
- package/src/RoleGQLModel/Pages/PageReadItem.jsx +28 -0
- package/src/RoleGQLModel/Pages/PageUpdateItem.jsx +25 -0
- package/src/RoleGQLModel/Pages/PageVector.jsx +83 -0
- package/src/RoleGQLModel/Pages/RouterSegment.jsx +69 -0
- package/src/RoleGQLModel/Pages/index.js +10 -0
- package/src/RoleGQLModel/Queries/DeleteAsyncAction.jsx +22 -0
- package/src/RoleGQLModel/Queries/Fragments.jsx +123 -0
- package/src/RoleGQLModel/Queries/InsertAsyncAction.jsx +45 -0
- package/src/RoleGQLModel/Queries/ReadAsyncAction.jsx +45 -0
- package/src/RoleGQLModel/Queries/ReadPageAsyncAction.jsx +13 -0
- package/src/RoleGQLModel/Queries/UpdateAsyncAction.jsx +35 -0
- package/src/RoleGQLModel/Queries/index.js +6 -0
- package/src/RoleGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/RoleGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/RoleGQLModel/Scalars/index.js +1 -0
- package/src/RoleGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/RoleGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/RoleGQLModel/Vectors/index.js +1 -0
- package/src/RoleGQLModel/index.js +6 -0
- package/src/RoleTypeGQLModel/Components/CUDButton.jsx +128 -0
- package/src/RoleTypeGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/RoleTypeGQLModel/Components/Children.jsx +31 -0
- package/src/RoleTypeGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/RoleTypeGQLModel/Components/Filter.jsx +14 -0
- package/src/RoleTypeGQLModel/Components/LargeCard.jsx +49 -0
- package/src/RoleTypeGQLModel/Components/Link.jsx +55 -0
- package/src/RoleTypeGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/RoleTypeGQLModel/Components/MediumCard.jsx +39 -0
- package/src/RoleTypeGQLModel/Components/MediumContent.jsx +97 -0
- package/src/RoleTypeGQLModel/Components/MediumEditableContent.jsx +35 -0
- package/src/RoleTypeGQLModel/Components/Table.jsx +7 -0
- package/src/RoleTypeGQLModel/Components/index.js +14 -0
- package/src/RoleTypeGQLModel/Mutations/Create.jsx +67 -0
- package/src/RoleTypeGQLModel/Mutations/Delete.jsx +80 -0
- package/src/RoleTypeGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/RoleTypeGQLModel/Mutations/Update.jsx +74 -0
- package/src/RoleTypeGQLModel/Pages/Page.jsx +3 -0
- package/src/RoleTypeGQLModel/Pages/PageBase.jsx +56 -0
- package/src/RoleTypeGQLModel/Pages/PageCreateItem.jsx +27 -0
- package/src/RoleTypeGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/RoleTypeGQLModel/Pages/PageNavbar.jsx +148 -0
- package/src/RoleTypeGQLModel/Pages/PageReadItem.jsx +11 -0
- package/src/RoleTypeGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/RoleTypeGQLModel/Pages/PageVector.jsx +79 -0
- package/src/RoleTypeGQLModel/Pages/RouterSegment.jsx +69 -0
- package/src/RoleTypeGQLModel/Pages/index.js +10 -0
- package/src/RoleTypeGQLModel/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/RoleTypeGQLModel/Queries/Fragments.jsx +103 -0
- package/src/RoleTypeGQLModel/Queries/InsertAsyncAction.jsx +40 -0
- package/src/RoleTypeGQLModel/Queries/ReadAsyncAction.jsx +44 -0
- package/src/RoleTypeGQLModel/Queries/ReadPageAsyncAction.jsx +13 -0
- package/src/RoleTypeGQLModel/Queries/SearchAsyncAction.jsx +29 -0
- package/src/RoleTypeGQLModel/Queries/UpdateAsyncAction.jsx +40 -0
- package/src/RoleTypeGQLModel/Queries/index.js +6 -0
- package/src/RoleTypeGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/RoleTypeGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/RoleTypeGQLModel/Scalars/index.js +1 -0
- package/src/RoleTypeGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/RoleTypeGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/RoleTypeGQLModel/Vectors/index.js +1 -0
- package/src/RoleTypeGQLModel/index.js +6 -0
- package/src/StateGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/StateGQLModel/Components/Children.jsx +31 -0
- package/src/StateGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/StateGQLModel/Components/Filter.jsx +14 -0
- package/src/StateGQLModel/Components/LargeCard.jsx +50 -0
- package/src/StateGQLModel/Components/Link.jsx +54 -0
- package/src/StateGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/StateGQLModel/Components/MediumCard.jsx +39 -0
- package/src/StateGQLModel/Components/MediumContent.jsx +96 -0
- package/src/StateGQLModel/Components/MediumEditableContent.jsx +36 -0
- package/src/StateGQLModel/Components/Table.jsx +7 -0
- package/src/StateGQLModel/Components/index.js +13 -0
- package/src/StateGQLModel/Mutations/Create.jsx +79 -0
- package/src/StateGQLModel/Mutations/Delete.jsx +87 -0
- package/src/StateGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/StateGQLModel/Mutations/Update.jsx +76 -0
- package/src/StateGQLModel/Mutations/helpers.jsx +7 -0
- package/src/StateGQLModel/Pages/PageBase.jsx +56 -0
- package/src/StateGQLModel/Pages/PageCreateItem.jsx +28 -0
- package/src/StateGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/StateGQLModel/Pages/PageNavbar.jsx +160 -0
- package/src/StateGQLModel/Pages/PageReadItem.jsx +11 -0
- package/src/StateGQLModel/Pages/PageReadItemEx.jsx +42 -0
- package/src/StateGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/StateGQLModel/Pages/PageVector.jsx +80 -0
- package/src/StateGQLModel/Pages/RouterSegment.jsx +72 -0
- package/src/StateGQLModel/Pages/index.js +2 -0
- package/src/StateGQLModel/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/StateGQLModel/Queries/Fragments.jsx +109 -0
- package/src/StateGQLModel/Queries/InsertAsyncAction.jsx +104 -0
- package/src/StateGQLModel/Queries/ReadAsyncAction.jsx +48 -0
- package/src/StateGQLModel/Queries/ReadPageAsyncAction.jsx +23 -0
- package/src/StateGQLModel/Queries/SearchAsyncAction.jsx +16 -0
- package/src/StateGQLModel/Queries/UpdateAsyncAction.jsx +106 -0
- package/src/StateGQLModel/Queries/index.js +6 -0
- package/src/StateGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/StateGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/StateGQLModel/Scalars/index.js +1 -0
- package/src/StateGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/StateGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/StateGQLModel/Vectors/index.js +1 -0
- package/src/StateGQLModel/index.js +71 -0
- package/src/StateMachineGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/StateMachineGQLModel/Components/Children.jsx +31 -0
- package/src/StateMachineGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/StateMachineGQLModel/Components/Filter.jsx +14 -0
- package/src/StateMachineGQLModel/Components/LargeCard.jsx +50 -0
- package/src/StateMachineGQLModel/Components/Link.jsx +54 -0
- package/src/StateMachineGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/StateMachineGQLModel/Components/MediumCard.jsx +39 -0
- package/src/StateMachineGQLModel/Components/MediumContent.jsx +96 -0
- package/src/StateMachineGQLModel/Components/MediumEditableContent.jsx +989 -0
- package/src/StateMachineGQLModel/Components/Table.jsx +7 -0
- package/src/StateMachineGQLModel/Components/index.js +13 -0
- package/src/StateMachineGQLModel/Mutations/Create.jsx +79 -0
- package/src/StateMachineGQLModel/Mutations/Delete.jsx +80 -0
- package/src/StateMachineGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/StateMachineGQLModel/Mutations/Update.jsx +74 -0
- package/src/StateMachineGQLModel/Mutations/helpers.jsx +7 -0
- package/src/StateMachineGQLModel/Pages/PageBase.jsx +56 -0
- package/src/StateMachineGQLModel/Pages/PageCreateItem.jsx +28 -0
- package/src/StateMachineGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/StateMachineGQLModel/Pages/PageNavbar.jsx +160 -0
- package/src/StateMachineGQLModel/Pages/PageReadItem.jsx +11 -0
- package/src/StateMachineGQLModel/Pages/PageReadItemEx.jsx +42 -0
- package/src/StateMachineGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/StateMachineGQLModel/Pages/PageVector.jsx +80 -0
- package/src/StateMachineGQLModel/Pages/RouterSegment.jsx +72 -0
- package/src/StateMachineGQLModel/Pages/index.js +2 -0
- package/src/StateMachineGQLModel/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/StateMachineGQLModel/Queries/Fragments.jsx +148 -0
- package/src/StateMachineGQLModel/Queries/InsertAsyncAction.jsx +44 -0
- package/src/StateMachineGQLModel/Queries/ReadAsyncAction.jsx +48 -0
- package/src/StateMachineGQLModel/Queries/ReadPageAsyncAction.jsx +23 -0
- package/src/StateMachineGQLModel/Queries/SearchAsyncAction.jsx +16 -0
- package/src/StateMachineGQLModel/Queries/UpdateAsyncAction.jsx +40 -0
- package/src/StateMachineGQLModel/Queries/index.js +6 -0
- package/src/StateMachineGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/StateMachineGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/StateMachineGQLModel/Scalars/index.js +1 -0
- package/src/StateMachineGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/StateMachineGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/StateMachineGQLModel/Vectors/index.js +1 -0
- package/src/StateMachineGQLModel/WhatToDo.md +44 -0
- package/src/StateMachineGQLModel/index.js +71 -0
- package/src/StateTransitionGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/StateTransitionGQLModel/Components/Children.jsx +31 -0
- package/src/StateTransitionGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/StateTransitionGQLModel/Components/Filter.jsx +14 -0
- package/src/StateTransitionGQLModel/Components/LargeCard.jsx +50 -0
- package/src/StateTransitionGQLModel/Components/Link.jsx +54 -0
- package/src/StateTransitionGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/StateTransitionGQLModel/Components/MediumCard.jsx +39 -0
- package/src/StateTransitionGQLModel/Components/MediumContent.jsx +96 -0
- package/src/StateTransitionGQLModel/Components/MediumEditableContent.jsx +35 -0
- package/src/StateTransitionGQLModel/Components/Table.jsx +7 -0
- package/src/StateTransitionGQLModel/Components/index.js +13 -0
- package/src/StateTransitionGQLModel/Mutations/Create.jsx +79 -0
- package/src/StateTransitionGQLModel/Mutations/Delete.jsx +80 -0
- package/src/StateTransitionGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/StateTransitionGQLModel/Mutations/Update.jsx +75 -0
- package/src/StateTransitionGQLModel/Mutations/helpers.jsx +7 -0
- package/src/StateTransitionGQLModel/Pages/PageBase.jsx +56 -0
- package/src/StateTransitionGQLModel/Pages/PageCreateItem.jsx +28 -0
- package/src/StateTransitionGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/StateTransitionGQLModel/Pages/PageNavbar.jsx +160 -0
- package/src/StateTransitionGQLModel/Pages/PageReadItem.jsx +11 -0
- package/src/StateTransitionGQLModel/Pages/PageReadItemEx.jsx +42 -0
- package/src/StateTransitionGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/StateTransitionGQLModel/Pages/PageVector.jsx +80 -0
- package/src/StateTransitionGQLModel/Pages/RouterSegment.jsx +72 -0
- package/src/StateTransitionGQLModel/Pages/index.js +2 -0
- package/src/StateTransitionGQLModel/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/StateTransitionGQLModel/Queries/Fragments.jsx +150 -0
- package/src/StateTransitionGQLModel/Queries/InsertAsyncAction.jsx +107 -0
- package/src/StateTransitionGQLModel/Queries/ReadAsyncAction.jsx +48 -0
- package/src/StateTransitionGQLModel/Queries/ReadPageAsyncAction.jsx +23 -0
- package/src/StateTransitionGQLModel/Queries/SearchAsyncAction.jsx +16 -0
- package/src/StateTransitionGQLModel/Queries/UpdateAsyncAction.jsx +109 -0
- package/src/StateTransitionGQLModel/Queries/index.js +6 -0
- package/src/StateTransitionGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/StateTransitionGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/StateTransitionGQLModel/Scalars/index.js +1 -0
- package/src/StateTransitionGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/StateTransitionGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/StateTransitionGQLModel/Vectors/index.js +1 -0
- package/src/StateTransitionGQLModel/WhatToDo.md +44 -0
- package/src/StateTransitionGQLModel/index.js +71 -0
- package/src/Template/Attributes/TemplateTrivialAttribute.jsx +21 -0
- package/src/Template/Attributes/index.js +1 -0
- package/src/Template/Components/CUDButton.jsx +128 -0
- package/src/Template/Components/CardCapsule.jsx +43 -0
- package/src/Template/Components/Children.jsx +31 -0
- package/src/Template/Components/ConfirmEdit.jsx +61 -0
- package/src/Template/Components/LargeCard.jsx +48 -0
- package/src/Template/Components/Link.jsx +41 -0
- package/src/Template/Components/LiveEdit.jsx +111 -0
- package/src/Template/Components/MediumCard.jsx +39 -0
- package/src/Template/Components/MediumContent.jsx +97 -0
- package/src/Template/Components/MediumEditableContent.jsx +36 -0
- package/src/Template/Components/Table.jsx +7 -0
- package/src/Template/Components/index.js +14 -0
- package/src/Template/Pages/Page.jsx +28 -0
- package/src/Template/Pages/PageCapsule.jsx +13 -0
- package/src/Template/Pages/PageContent.jsx +34 -0
- package/src/Template/Pages/PageEdit.jsx +17 -0
- package/src/Template/Pages/PageNavbar.jsx +110 -0
- package/src/Template/Pages/RouterSegment.jsx +52 -0
- package/src/Template/Pages/VectorPage.jsx +133 -0
- package/src/Template/Pages/index.js +6 -0
- package/src/Template/Queries/DeleteAsyncAction.jsx +22 -0
- package/src/Template/Queries/Fragments.jsx +92 -0
- package/src/Template/Queries/InsertAsyncAction.jsx +22 -0
- package/src/Template/Queries/ReadAsyncAction.jsx +45 -0
- package/src/Template/Queries/ReadPageAsyncAction.jsx +13 -0
- package/src/Template/Queries/UpdateAsyncAction.jsx +76 -0
- package/src/Template/Queries/index.js +6 -0
- package/src/Template/Scalars/ScalarAttribute.jsx +54 -0
- package/src/Template/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/Template/Scalars/index.js +1 -0
- package/src/Template/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/Template/Vectors/VectorAttribute.jsx +56 -0
- package/src/Template/Vectors/index.js +1 -0
- package/src/Template/index.js +71 -0
- package/src/UserGQLModel/Components/CUDButton.jsx +128 -0
- package/src/UserGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/UserGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/UserGQLModel/Components/Filter.jsx +15 -0
- package/src/UserGQLModel/Components/LargeCard.jsx +82 -0
- package/src/UserGQLModel/Components/Link.jsx +54 -0
- package/src/UserGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/UserGQLModel/Components/MediumCard.jsx +40 -0
- package/src/UserGQLModel/Components/MediumContent.jsx +43 -0
- package/src/UserGQLModel/Components/MediumEditableContent.jsx +57 -0
- package/src/UserGQLModel/Components/Table.jsx +7 -0
- package/src/UserGQLModel/Components/index.js +13 -0
- package/src/UserGQLModel/Mutations/AddMembership.jsx +136 -0
- package/src/UserGQLModel/Mutations/Create.jsx +68 -0
- package/src/UserGQLModel/Mutations/Delete.jsx +81 -0
- package/src/UserGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/UserGQLModel/Mutations/Update.jsx +68 -0
- package/src/UserGQLModel/Mutations/helpers.jsx +7 -0
- package/src/UserGQLModel/Pages/PageAddMembership.jsx +15 -0
- package/src/UserGQLModel/Pages/PageBase.jsx +56 -0
- package/src/UserGQLModel/Pages/PageCreateItem.jsx +27 -0
- package/src/UserGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/UserGQLModel/Pages/PageNavbar.jsx +146 -0
- package/src/UserGQLModel/Pages/PageReadItem.jsx +12 -0
- package/src/UserGQLModel/Pages/PageReadItemEx.jsx +62 -0
- package/src/UserGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/UserGQLModel/Pages/PageVector.jsx +78 -0
- package/src/UserGQLModel/Pages/RouterSegment.jsx +77 -0
- package/src/UserGQLModel/Pages/index.js +9 -0
- package/src/UserGQLModel/Queries/DeleteAsyncAction.jsx +22 -0
- package/src/UserGQLModel/Queries/Fragments.jsx +114 -0
- package/src/UserGQLModel/Queries/InsertAsyncAction.jsx +22 -0
- package/src/UserGQLModel/Queries/ReadAsyncAction.jsx +45 -0
- package/src/UserGQLModel/Queries/ReadPageAsyncAction.jsx +17 -0
- package/src/UserGQLModel/Queries/SearchAsyncAction.jsx +15 -0
- package/src/UserGQLModel/Queries/UpdateAsyncAction.jsx +76 -0
- package/src/UserGQLModel/Queries/index.js +6 -0
- package/src/UserGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/UserGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/UserGQLModel/Scalars/index.js +1 -0
- package/src/UserGQLModel/Vectors/Roles.jsx +23 -0
- package/src/UserGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/UserGQLModel/Vectors/UserMemberships.jsx +56 -0
- package/src/UserGQLModel/Vectors/UserRoles.jsx +81 -0
- package/src/UserGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/UserGQLModel/Vectors/index.js +1 -0
- package/src/UserGQLModel/index.js +6 -0
- package/src/_Template/Components/CardCapsule.jsx +43 -0
- package/src/_Template/Components/Children.jsx +31 -0
- package/src/_Template/Components/ConfirmEdit.jsx +61 -0
- package/src/_Template/Components/Filter.jsx +14 -0
- package/src/_Template/Components/LargeCard.jsx +50 -0
- package/src/_Template/Components/Link.jsx +54 -0
- package/src/_Template/Components/LiveEdit.jsx +111 -0
- package/src/_Template/Components/MediumCard.jsx +39 -0
- package/src/_Template/Components/MediumContent.jsx +96 -0
- package/src/_Template/Components/MediumEditableContent.jsx +35 -0
- package/src/_Template/Components/Table.jsx +7 -0
- package/src/_Template/Components/index.js +13 -0
- package/src/_Template/Mutations/Create.jsx +202 -0
- package/src/_Template/Mutations/Delete.jsx +173 -0
- package/src/_Template/Mutations/InteractiveMutations.jsx +30 -0
- package/src/_Template/Mutations/Update.jsx +147 -0
- package/src/_Template/Mutations/helpers.jsx +7 -0
- package/src/_Template/Pages/PageBase.jsx +56 -0
- package/src/_Template/Pages/PageCreateItem.jsx +28 -0
- package/src/_Template/Pages/PageDeleteItem.jsx +16 -0
- package/src/_Template/Pages/PageNavbar.jsx +160 -0
- package/src/_Template/Pages/PageReadItem.jsx +11 -0
- package/src/_Template/Pages/PageReadItemEx.jsx +42 -0
- package/src/_Template/Pages/PageUpdateItem.jsx +14 -0
- package/src/_Template/Pages/PageVector.jsx +80 -0
- package/src/_Template/Pages/RouterSegment.jsx +72 -0
- package/src/_Template/Pages/index.js +2 -0
- package/src/_Template/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/_Template/Queries/Fragments.jsx +101 -0
- package/src/_Template/Queries/InsertAsyncAction.jsx +40 -0
- package/src/_Template/Queries/ReadAsyncAction.jsx +44 -0
- package/src/_Template/Queries/ReadPageAsyncAction.jsx +13 -0
- package/src/_Template/Queries/SearchAsyncAction.jsx +16 -0
- package/src/_Template/Queries/UpdateAsyncAction.jsx +40 -0
- package/src/_Template/Queries/index.js +6 -0
- package/src/_Template/Scalars/ScalarAttribute.jsx +54 -0
- package/src/_Template/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/_Template/Scalars/index.js +1 -0
- package/src/_Template/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/_Template/Vectors/VectorAttribute.jsx +56 -0
- package/src/_Template/Vectors/index.js +1 -0
- package/src/_Template/WhatToDo.md +44 -0
- package/src/_Template/index.js +71 -0
- package/src/index.js +8 -0
- package/src/uriroot.js +158 -0
- package/vite.config.js +47 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { ButtonWithDialog, ErrorHandler, LoadingSpinner } from "@hrbolek/uoisfrontend-shared";
|
|
2
|
+
|
|
3
|
+
import { useAsyncAction } from "@hrbolek/uoisfrontend-gql-shared";
|
|
4
|
+
import { DeleteAsyncAction, InsertAsyncAction, UpdateAsyncAction } from "../Queries";
|
|
5
|
+
import { MediumEditableContent } from "./MediumEditableContent";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* TemplateCUDButton Component
|
|
9
|
+
*
|
|
10
|
+
* A higher-order component that dynamically renders one of the following components
|
|
11
|
+
* based on the `operation` prop:
|
|
12
|
+
* - `InsertTemplateButton` for creating a new item (operation "C")
|
|
13
|
+
* - `UpdateTemplateButton` for updating an existing item (operation "U")
|
|
14
|
+
* - `DeleteTemplateButton` for deleting an existing item (operation "D")
|
|
15
|
+
*
|
|
16
|
+
* This component validates the `template` prop:
|
|
17
|
+
* - For "C" (create), `template` can be any object (no restrictions).
|
|
18
|
+
* - For "U" (update) and "D" (delete), `template` must include an `id` key.
|
|
19
|
+
*
|
|
20
|
+
* If the `operation` prop is invalid or required conditions for `template` are not met,
|
|
21
|
+
* an `ErrorHandler` component is rendered with an appropriate error message.
|
|
22
|
+
*
|
|
23
|
+
* @component
|
|
24
|
+
* @param {Object} props - The props for the TemplateCUDButton component.
|
|
25
|
+
* @param {string} props.operation - The operation type ("C" for create, "U" for update, "D" for delete).
|
|
26
|
+
* @param {React.ReactNode} props.children - The content or label for the button.
|
|
27
|
+
* @param {Object} props.template - The parameters for the operation. For "U" and "D", it must include an `id` key.
|
|
28
|
+
* @param {string} [props.template.id] - The unique identifier for the item (required for "U" and "D").
|
|
29
|
+
* @param {string} [props.template.name] - The name of the item (optional).
|
|
30
|
+
* @param {string} [props.template.name_en] - The English name of the item (optional).
|
|
31
|
+
* @param {Function} [props.onDone=(template) => {}] - Callback executed after the operation completes. Receives the `template` object.
|
|
32
|
+
* @param {...Object} props - Additional props passed to the underlying button components.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Example Usage
|
|
36
|
+
* const Example = () => {
|
|
37
|
+
* const handleDone = (data) => console.log("Operation completed:", data);
|
|
38
|
+
*
|
|
39
|
+
* return (
|
|
40
|
+
* <>
|
|
41
|
+
* <TemplateCUDButton
|
|
42
|
+
* operation="C"
|
|
43
|
+
* template={{ name: "New Item", name_en: "New Item EN" }}
|
|
44
|
+
* onDone={handleDone}
|
|
45
|
+
* >
|
|
46
|
+
* Insert
|
|
47
|
+
* </TemplateCUDButton>
|
|
48
|
+
*
|
|
49
|
+
* <TemplateCUDButton
|
|
50
|
+
* operation="U"
|
|
51
|
+
* template={{ id: "123", name: "Updated Item", name_en: "Updated Item EN" }}
|
|
52
|
+
* onDone={handleDone}
|
|
53
|
+
* >
|
|
54
|
+
* Update
|
|
55
|
+
* </TemplateCUDButton>
|
|
56
|
+
*
|
|
57
|
+
* <TemplateCUDButton
|
|
58
|
+
* operation="D"
|
|
59
|
+
* template={{ id: "123" }}
|
|
60
|
+
* onDone={handleDone}
|
|
61
|
+
* >
|
|
62
|
+
* Delete
|
|
63
|
+
* </TemplateCUDButton>
|
|
64
|
+
* </>
|
|
65
|
+
* );
|
|
66
|
+
* };
|
|
67
|
+
*
|
|
68
|
+
* @returns {JSX.Element} The dynamically selected button component for the specified operation.
|
|
69
|
+
*/
|
|
70
|
+
export const CUDButton = ({ operation, children, item, onDone = () => {}, onOptimistic = () => {}, ...props }) => {
|
|
71
|
+
const operationConfig = {
|
|
72
|
+
C: {
|
|
73
|
+
asyncAction: InsertAsyncAction,
|
|
74
|
+
dialogTitle: "Vložit novou template",
|
|
75
|
+
loadingMsg: "Vkládám novou template",
|
|
76
|
+
renderContent: () => <MediumEditableContent item={item} />,
|
|
77
|
+
},
|
|
78
|
+
U: {
|
|
79
|
+
asyncAction: UpdateAsyncAction,
|
|
80
|
+
dialogTitle: "Upravit template",
|
|
81
|
+
loadingMsg: "Ukládám template",
|
|
82
|
+
renderContent: () => <MediumEditableContent item={item} />,
|
|
83
|
+
},
|
|
84
|
+
D: {
|
|
85
|
+
asyncAction: DeleteAsyncAction,
|
|
86
|
+
dialogTitle: "Chcete odebrat template?",
|
|
87
|
+
loadingMsg: "Odstraňuji template",
|
|
88
|
+
renderContent: () => (
|
|
89
|
+
<h2>
|
|
90
|
+
{item?.name} ({item?.name_en})
|
|
91
|
+
</h2>
|
|
92
|
+
),
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
if (!operationConfig[operation]) {
|
|
97
|
+
return <ErrorHandler errors={`Invalid operation value: '${operation}'. Must be one of 'C', 'U', or 'D'.`} />;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const { asyncAction, dialogTitle, loadingMsg, renderContent } = operationConfig[operation];
|
|
101
|
+
|
|
102
|
+
const { error, loading, fetch, entity } = useAsyncAction(asyncAction, item, { deferred: true });
|
|
103
|
+
const handleClick = async (params = {}) => {
|
|
104
|
+
const fetchParams = { ...item, ...params };
|
|
105
|
+
onOptimistic(fetchParams);
|
|
106
|
+
const freshTemplate = await fetch(fetchParams);
|
|
107
|
+
onDone(freshTemplate); // Pass the result to the external callback
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// Validate required fields for "U" and "D"
|
|
111
|
+
if ((operation === 'U' || operation === 'D') && !item?.id) {
|
|
112
|
+
return <ErrorHandler errors={`For '${operation}' operation, 'template' must include an 'id' key.`} />;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return (<>
|
|
116
|
+
{error && <ErrorHandler errors={error} />}
|
|
117
|
+
{loading && <LoadingSpinner text={loadingMsg} />}
|
|
118
|
+
<ButtonWithDialog
|
|
119
|
+
buttonLabel={children}
|
|
120
|
+
dialogTitle={dialogTitle}
|
|
121
|
+
{...props}
|
|
122
|
+
params={item}
|
|
123
|
+
onClick={handleClick}
|
|
124
|
+
>
|
|
125
|
+
{renderContent()}
|
|
126
|
+
</ButtonWithDialog>
|
|
127
|
+
</>);
|
|
128
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CardCapsule as _CardCapsule} from "@hrbolek/uoisfrontend-shared"
|
|
2
|
+
import { PersonFill } from "react-bootstrap-icons"
|
|
3
|
+
import { Link } from "./Link"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A specialized card component that displays an `TemplateLink` as its title and encapsulates additional content.
|
|
7
|
+
*
|
|
8
|
+
* This component extends the `CardCapsule` component by using a combination of a `PersonFill` icon and
|
|
9
|
+
* an `TemplateLink` component in the card's header. The `children` prop is used to render any content
|
|
10
|
+
* inside the card body. It is designed for use with entities represented by the `template` object.
|
|
11
|
+
*
|
|
12
|
+
* @component
|
|
13
|
+
* @param {Object} props - The props for the TemplateCardCapsule component.
|
|
14
|
+
* @param {Object} props.template - The object representing the template entity.
|
|
15
|
+
* @param {string|number} props.template.id - The unique identifier for the template entity.
|
|
16
|
+
* @param {string} props.template.name - The display name for the template entity.
|
|
17
|
+
* @param {React.ReactNode} [props.children=null] - The content to render inside the card's body.
|
|
18
|
+
*
|
|
19
|
+
* @returns {JSX.Element} The rendered card component with a dynamic title and body content.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Example usage:
|
|
23
|
+
* import { TemplateCardCapsule } from './TemplateCardCapsule';
|
|
24
|
+
* import { Button } from 'react-bootstrap';
|
|
25
|
+
*
|
|
26
|
+
* const templateEntity = { id: 123, name: "Example Entity" };
|
|
27
|
+
*
|
|
28
|
+
* <TemplateCardCapsule template={templateEntity}>
|
|
29
|
+
* <Button variant="primary">Click Me</Button>
|
|
30
|
+
* </TemplateCardCapsule>
|
|
31
|
+
*/
|
|
32
|
+
export const CardCapsule = ({ item, children, title=null}) => {
|
|
33
|
+
|
|
34
|
+
if (!title) {
|
|
35
|
+
title = <><PersonFill /> <Link item={item} /></>
|
|
36
|
+
}
|
|
37
|
+
return (
|
|
38
|
+
|
|
39
|
+
<_CardCapsule title={title}>
|
|
40
|
+
{children}
|
|
41
|
+
</_CardCapsule>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ChildWrapper } from "@hrbolek/uoisfrontend-shared";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TemplateChildren Component
|
|
5
|
+
*
|
|
6
|
+
* A utility React component that wraps its children with the `ChildWrapper` component,
|
|
7
|
+
* passing down an `template` entity along with other props to all child elements.
|
|
8
|
+
* This component is useful for injecting a common `template` entity into multiple children
|
|
9
|
+
* while preserving their existing functionality.
|
|
10
|
+
*
|
|
11
|
+
* @component
|
|
12
|
+
* @param {Object} props - The props for the TemplateChildren component.
|
|
13
|
+
* @param {any} props.template - An entity (e.g., object, string, or other data) to be passed to the children.
|
|
14
|
+
* @param {React.ReactNode} props.children - The children elements to be wrapped and enhanced.
|
|
15
|
+
* @param {...any} props - Additional props to be passed to each child element.
|
|
16
|
+
*
|
|
17
|
+
* @returns {JSX.Element} A `ChildWrapper` component containing the children with the injected `template` entity.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Example usage:
|
|
21
|
+
* const templateEntity = { id: 1, message: "No data available" };
|
|
22
|
+
*
|
|
23
|
+
* <TemplateChildren template={templateEntity}>
|
|
24
|
+
* <CustomMessage />
|
|
25
|
+
* <CustomIcon />
|
|
26
|
+
* </TemplateChildren>
|
|
27
|
+
*
|
|
28
|
+
* // Result: Both <CustomMessage /> and <CustomIcon /> receive the 'template' prop with the specified entity.
|
|
29
|
+
*/
|
|
30
|
+
export const Children = ({item, children, ...props}) =>
|
|
31
|
+
<ChildWrapper item={item} children={children} {...props} />
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { UpdateAsyncAction } from "../Queries";
|
|
2
|
+
import { MediumEditableContent } from "./MediumEditableContent";
|
|
3
|
+
import { useEditAction } from "../../../../dynamic/src/Hooks/useEditAction";
|
|
4
|
+
import { useCallback } from "react";
|
|
5
|
+
import { useGQLEntityContext } from "../../../../_template/src/Base/Helpers/GQLEntityProvider";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export const ConfirmEdit = ({ item, children }) => {
|
|
9
|
+
const { run , error, loading, entity, data, onChange: contextOnChange, onBlur: contextOnBlur } = useGQLEntityContext()
|
|
10
|
+
|
|
11
|
+
const localOnMutationEvent = useCallback((mutationHandler, notifyHandler) => async (e) => {
|
|
12
|
+
const newItem = { ...item, [e.target.id]: e.target.value }
|
|
13
|
+
const newEvent = { target: { value: newItem } }
|
|
14
|
+
|
|
15
|
+
await notifyHandler(newEvent)
|
|
16
|
+
return await mutationHandler(e)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
draft,
|
|
21
|
+
dirty,
|
|
22
|
+
onChange,
|
|
23
|
+
onBlur,
|
|
24
|
+
onCancel,
|
|
25
|
+
onConfirm,
|
|
26
|
+
} = useEditAction(UpdateAsyncAction, item, {mode: "confirm"})
|
|
27
|
+
|
|
28
|
+
const handleConfirm = useCallback(async () => {
|
|
29
|
+
const result = await onConfirm();
|
|
30
|
+
console.log("ConfirmEdit handleConfirm result", result, "draft", draft)
|
|
31
|
+
if (result) {
|
|
32
|
+
const event = { target: { value: result } };
|
|
33
|
+
// důležité: použij params z kontextu (provider si je drží jako "poslední vars")
|
|
34
|
+
await contextOnChange(event);
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}, [onConfirm, contextOnChange]);
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<MediumEditableContent item={item} onChange={onChange} onBlur={onBlur} >
|
|
42
|
+
{children}
|
|
43
|
+
<hr />
|
|
44
|
+
{/* <pre>{JSON.stringify(item, null, 2)}</pre> */}
|
|
45
|
+
<button
|
|
46
|
+
className="btn btn-warning form-control"
|
|
47
|
+
onClick={onCancel}
|
|
48
|
+
disabled={!dirty || loading}
|
|
49
|
+
>
|
|
50
|
+
Zrušit změny
|
|
51
|
+
</button>
|
|
52
|
+
<button
|
|
53
|
+
className="btn btn-primary form-control"
|
|
54
|
+
onClick={handleConfirm}
|
|
55
|
+
disabled={!dirty || loading}
|
|
56
|
+
>
|
|
57
|
+
Uložit změny
|
|
58
|
+
</button>
|
|
59
|
+
</MediumEditableContent>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DateTimeFilter, Filter as BaseFilter, StringFilter, UUIDFilter } from "../../../../_template/src/Base/FormControls/Filter"
|
|
2
|
+
|
|
3
|
+
export const Filter = ({ id, onChange: handleChange, children }) => {
|
|
4
|
+
return (
|
|
5
|
+
<BaseFilter id={id} onChange={handleChange}>
|
|
6
|
+
<UUIDFilter id="id" />
|
|
7
|
+
<StringFilter id="name" />
|
|
8
|
+
<DateTimeFilter id="created" emitUtcIso={false} />
|
|
9
|
+
{/* <FloatFilter id="count" /> */}
|
|
10
|
+
{children}
|
|
11
|
+
</BaseFilter>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// import Row from "react-bootstrap/Row"
|
|
2
|
+
import { MediumCard } from "./MediumCard"
|
|
3
|
+
import { CardCapsule as CardCapsule_} from "./CardCapsule"
|
|
4
|
+
import { Row } from "../../../../_template/src/Base/Components/Row"
|
|
5
|
+
import { LeftColumn, MiddleColumn } from "@hrbolek/uoisfrontend-shared"
|
|
6
|
+
import { MediumContent as MediumContent_ } from "./MediumContent"
|
|
7
|
+
import { InteractiveMutations } from '../Mutations/InteractiveMutations'
|
|
8
|
+
/**
|
|
9
|
+
* A large card component for displaying detailed content and layout for an template entity.
|
|
10
|
+
*
|
|
11
|
+
* This component wraps an `TemplateCardCapsule` with a flexible layout that includes multiple
|
|
12
|
+
* columns. It uses a `Row` layout with a `LeftColumn` for displaying an `TemplateMediumCard`
|
|
13
|
+
* and a `MiddleColumn` for rendering additional children.
|
|
14
|
+
*
|
|
15
|
+
* @component
|
|
16
|
+
* @param {Object} props - The properties for the TemplateLargeCard component.
|
|
17
|
+
* @param {Object} props.template - The object representing the template entity.
|
|
18
|
+
* @param {string|number} props.template.id - The unique identifier for the template entity.
|
|
19
|
+
* @param {string} props.template.name - The name or label of the template entity.
|
|
20
|
+
* @param {React.ReactNode} [props.children=null] - Additional content to render in the middle column.
|
|
21
|
+
*
|
|
22
|
+
* @returns {JSX.Element} A JSX element combining a large card layout with dynamic content.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Example usage:
|
|
26
|
+
* const templateEntity = { id: 123, name: "Sample Entity" };
|
|
27
|
+
*
|
|
28
|
+
* <TemplateLargeCard template={templateEntity}>
|
|
29
|
+
* <p>Additional content for the middle column.</p>
|
|
30
|
+
* </TemplateLargeCard>
|
|
31
|
+
*/
|
|
32
|
+
export const LargeCard = ({ item, children, CardCapsule=CardCapsule_, MediumContent=MediumContent_ }) => {
|
|
33
|
+
// console.log("LargeCard.item", item)
|
|
34
|
+
return (
|
|
35
|
+
<CardCapsule item={item} >
|
|
36
|
+
<Row>
|
|
37
|
+
<LeftColumn>
|
|
38
|
+
<CardCapsule item={item} title="Detail">
|
|
39
|
+
<MediumContent item={item} />
|
|
40
|
+
</CardCapsule>
|
|
41
|
+
<InteractiveMutations item={item} />
|
|
42
|
+
</LeftColumn>
|
|
43
|
+
<MiddleColumn>
|
|
44
|
+
{children}
|
|
45
|
+
</MiddleColumn>
|
|
46
|
+
</Row>
|
|
47
|
+
</CardCapsule>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ProxyLink } from "@hrbolek/uoisfrontend-shared"
|
|
2
|
+
import { URIRoot } from "../../uriroot";
|
|
3
|
+
import { registerLink } from "../../../../_template/src/Base/Components/Link";
|
|
4
|
+
|
|
5
|
+
const modelURI = `${URIRoot}/template`
|
|
6
|
+
export const ListURI = `${modelURI}/list/`;
|
|
7
|
+
export const CreateURI = `${modelURI}/create/`;
|
|
8
|
+
export const ReadURI = `${modelURI}/view/`;
|
|
9
|
+
export const UpdateURI = `${modelURI}/edit/`;
|
|
10
|
+
export const DeleteURI = `${modelURI}/delete/`;
|
|
11
|
+
|
|
12
|
+
export const LinkURI = ReadURI;
|
|
13
|
+
export const VectorItemsURI = ListURI;
|
|
14
|
+
|
|
15
|
+
const idParam = ":id"
|
|
16
|
+
export const ReadItemURI = `${LinkURI}${idParam}`;
|
|
17
|
+
export const UpdateItemURI = `${UpdateURI}${idParam}`;
|
|
18
|
+
export const DeleteItemURI = `${DeleteURI}${idParam}`;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A React component that renders a `ProxyLink` to an "template" entity's view page.
|
|
22
|
+
*
|
|
23
|
+
* The target URL is dynamically constructed using the `template` object's `id`, and the link displays
|
|
24
|
+
* the `template` object's `name` as its clickable content.
|
|
25
|
+
*
|
|
26
|
+
* @function TemplateLink
|
|
27
|
+
* @param {Object} props - The properties for the `TemplateLink` component.
|
|
28
|
+
* @param {Object} props.template - The object representing the "template" entity.
|
|
29
|
+
* @param {string|number} props.template.id - The unique identifier for the "template" entity. Used to construct the target URL.
|
|
30
|
+
* @param {string} props.template.name - The display name for the "template" entity. Used as the link text.
|
|
31
|
+
*
|
|
32
|
+
* @returns {JSX.Element} A `ProxyLink` component linking to the specified "template" entity's view page.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Example usage with a sample template entity:
|
|
36
|
+
* const templateEntity = { id: 123, name: "Example Template Entity" };
|
|
37
|
+
*
|
|
38
|
+
* <TemplateLink template={templateEntity} />
|
|
39
|
+
* // Renders: <ProxyLink to="/template/template/view/123">Example Template Entity</ProxyLink>
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* - This component utilizes `ProxyLink` to ensure consistent link behavior, including parameter preservation and conditional reloads.
|
|
43
|
+
* - The URL format `/template/template/view/:id` must be supported by the application routing.
|
|
44
|
+
*
|
|
45
|
+
* @see ProxyLink - The base component used for rendering the link.
|
|
46
|
+
*/
|
|
47
|
+
export const Link = ({ item, LinkURI: LinkURI_ = LinkURI, action="view", children, ...props}) => {
|
|
48
|
+
const targetURI = LinkURI_.replace('view', action);
|
|
49
|
+
return <ProxyLink to={targetURI + item?.id} {...props}>{children || item?.fullname || item?.name || item?.id || "Nevim"}</ProxyLink>
|
|
50
|
+
// return <BaseUI.Link item={item} />
|
|
51
|
+
// return <a>{children || item?.fullname || item?.name || item?.id || "Nevim"}</a>
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
registerLink('TemplateGQLModel', Link)
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
|
|
4
|
+
import { UpdateAsyncAction } from "../Queries";
|
|
5
|
+
import { CreateDelayer, ErrorHandler, LoadingSpinner } from "@hrbolek/uoisfrontend-shared";
|
|
6
|
+
import { MediumEditableContent } from "./MediumEditableContent";
|
|
7
|
+
import { useEditAction } from "../../../../dynamic/src/Hooks/useEditAction";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* TemplateLiveEdit Component
|
|
11
|
+
*
|
|
12
|
+
* Interaktivní React komponenta pro live editaci entity `template` s podporou optimistického fetchování a debounce delaye.
|
|
13
|
+
*
|
|
14
|
+
* - Používá `useAsyncAction` k načítání a update entit (např. GraphQL mutation).
|
|
15
|
+
* - Pokud se hodnota pole změní, spustí se update po krátkém zpoždění (`delayer`) — uživatelské změny nejsou ihned posílány, ale až po pauze.
|
|
16
|
+
* - Zobrazuje loading a error stav pomocí komponent `LoadingSpinner` a `ErrorHandler`.
|
|
17
|
+
* - Předává editované hodnoty do komponenty `TemplateMediumEditableContent`, která zajišťuje zobrazení a editaci jednotlivých polí šablony (`template`).
|
|
18
|
+
*
|
|
19
|
+
* @component
|
|
20
|
+
* @param {Object} props - Props objekt.
|
|
21
|
+
* @param {Object} props.template - Objekt reprezentující editovanou šablonu (template entity).
|
|
22
|
+
* @param {React.ReactNode} [props.children] - Libovolné children, které se vloží pod editační komponentu.
|
|
23
|
+
* @param {Function} [props.asyncAction=TemplateUpdateAsyncAction] - Asynchronní akce pro update (`useAsyncAction`), typicky GraphQL update mutation.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Standardní použití
|
|
27
|
+
* <TemplateLiveEdit template={templateEntity} />
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // S vlastním asyncAction a doplňkovým obsahem
|
|
31
|
+
* <TemplateLiveEdit template={templateEntity} asyncAction={myUpdateAction}>
|
|
32
|
+
* <div>Extra obsah nebo poznámka</div>
|
|
33
|
+
* </TemplateLiveEdit>
|
|
34
|
+
*
|
|
35
|
+
* @returns {JSX.Element}
|
|
36
|
+
* Interaktivní komponenta pro live editaci šablony, včetně spinneru a error handleru.
|
|
37
|
+
*/
|
|
38
|
+
export const LiveEdit_ = ({ children, asyncAction=UpdateAsyncAction}) => {
|
|
39
|
+
const { onChange, onBlur, item } = useGQLEntityContext()
|
|
40
|
+
return (
|
|
41
|
+
<AsyncActionProvider
|
|
42
|
+
item={item}
|
|
43
|
+
queryAsyncAction={asyncAction}
|
|
44
|
+
options={{deferred: true, network: true}}
|
|
45
|
+
onChange={onChange}
|
|
46
|
+
onBlur={onBlur}
|
|
47
|
+
>
|
|
48
|
+
<LiveEditWrapper item={item}>
|
|
49
|
+
{children}
|
|
50
|
+
{/* <hr />
|
|
51
|
+
<pre>{JSON.stringify(item, null, 2)}</pre> */}
|
|
52
|
+
</LiveEditWrapper>
|
|
53
|
+
</AsyncActionProvider>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const LiveEditWrapper = ({ item, children }) => {
|
|
58
|
+
const { run , error, loading, entity, data, onChange, onBlur } = useGQLEntityContext()
|
|
59
|
+
|
|
60
|
+
const handleEvent = useCallback((handler) => async (e) => {
|
|
61
|
+
const {id, value} = e?.target || {}
|
|
62
|
+
if (id === undefined || value === undefined) return
|
|
63
|
+
if (item?.[id] === value) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const newItem = { ...item, [e.target.id]: e.target.value }
|
|
67
|
+
const newEvent = { target: { value: newItem } }
|
|
68
|
+
// console.log("LiveEditWrapper localOnChange start e", e, '=>', newEvent)
|
|
69
|
+
// const result = await delayer(()=>onChange(newEvent))
|
|
70
|
+
const result = await handler(newEvent)
|
|
71
|
+
// console.log("LiveEditWrapper localOnChange end e", e, '=>', newItem, '=>', result)
|
|
72
|
+
return result
|
|
73
|
+
}, [item])
|
|
74
|
+
|
|
75
|
+
const bindedOnChange = useMemo(() => handleEvent(onChange), [onChange, handleEvent])
|
|
76
|
+
const bindedOnBlur = useMemo(() => handleEvent(onBlur), [onBlur, handleEvent])
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<MediumEditableContent item={item} onChange={bindedOnChange} onBlur={bindedOnBlur} >
|
|
80
|
+
{children}
|
|
81
|
+
{/* <hr />
|
|
82
|
+
<pre>{JSON.stringify(item, null, 2)}</pre> */}
|
|
83
|
+
</MediumEditableContent>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
export const LiveEdit = ({ item, children, asyncMutationAction=UpdateAsyncAction }) => {
|
|
89
|
+
// const { run , error, loading, entity, data, onChange: contextOnChange, onBlur: contextOnBlur } = useGQLEntityContext()
|
|
90
|
+
const {
|
|
91
|
+
draft,
|
|
92
|
+
dirty,
|
|
93
|
+
loading: saving,
|
|
94
|
+
onChange,
|
|
95
|
+
onBlur,
|
|
96
|
+
onCancel,
|
|
97
|
+
onConfirm,
|
|
98
|
+
} = useEditAction(asyncMutationAction, item, {
|
|
99
|
+
mode: "live",
|
|
100
|
+
// onCommit: contextOnChange
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
|
|
105
|
+
<MediumEditableContent item={item} onChange={onChange} onBlur={onBlur} >
|
|
106
|
+
{saving && <LoadingSpinner/>}
|
|
107
|
+
{children}
|
|
108
|
+
</MediumEditableContent>
|
|
109
|
+
|
|
110
|
+
)
|
|
111
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PersonFill } from "react-bootstrap-icons"
|
|
2
|
+
import { CardCapsule } from "./CardCapsule"
|
|
3
|
+
import { MediumContent } from "./MediumContent"
|
|
4
|
+
import { Link } from "./Link"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A card component that displays detailed content for an template entity.
|
|
8
|
+
*
|
|
9
|
+
* This component combines `TemplateCardCapsule` and `TemplateMediumContent` to create a card layout
|
|
10
|
+
* with a title and medium-level content. The title includes a `PersonFill` icon and a link to
|
|
11
|
+
* the template entity's details, while the body displays serialized details of the entity along
|
|
12
|
+
* with any additional children passed to the component.
|
|
13
|
+
*
|
|
14
|
+
* @component
|
|
15
|
+
* @param {Object} props - The properties for the TemplateMediumCard component.
|
|
16
|
+
* @param {Object} props.template - The object representing the template entity.
|
|
17
|
+
* @param {string|number} props.template.id - The unique identifier for the template entity.
|
|
18
|
+
* @param {string} props.template.name - The name or label of the template entity.
|
|
19
|
+
* @param {React.ReactNode} [props.children=null] - Additional content to render inside the card body.
|
|
20
|
+
*
|
|
21
|
+
* @returns {JSX.Element} A JSX element combining a card with a title and detailed content.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Example usage:
|
|
25
|
+
* const templateEntity = { id: 123, name: "Sample Entity" };
|
|
26
|
+
*
|
|
27
|
+
* <TemplateMediumCard template={templateEntity}>
|
|
28
|
+
* <p>Additional details or actions for the entity.</p>
|
|
29
|
+
* </TemplateMediumCard>
|
|
30
|
+
*/
|
|
31
|
+
export const MediumCard = ({ item, children }) => {
|
|
32
|
+
return (
|
|
33
|
+
<CardCapsule title={<><PersonFill /> <Link item={item} /></>}>
|
|
34
|
+
{children}
|
|
35
|
+
<MediumContent item={item}>
|
|
36
|
+
</MediumContent>
|
|
37
|
+
</CardCapsule>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { BaseUI } from "../../Base"
|
|
2
|
+
import { Col } from "../../../../_template/src/Base/Components/Col"
|
|
3
|
+
import { Row } from "../../../../_template/src/Base/Components/Row"
|
|
4
|
+
import { Link } from "./Link"
|
|
5
|
+
/**
|
|
6
|
+
* A component that displays medium-level content for an template entity.
|
|
7
|
+
*
|
|
8
|
+
* This component renders a label "TemplateMediumContent" followed by a serialized representation of the `template` object
|
|
9
|
+
* and any additional child content. It is designed to handle and display information about an template entity object.
|
|
10
|
+
*
|
|
11
|
+
* @component
|
|
12
|
+
* @param {Object} props - The properties for the TemplateMediumContent component.
|
|
13
|
+
* @param {Object} props.template - The object representing the template entity.
|
|
14
|
+
* @param {string|number} props.template.id - The unique identifier for the template entity.
|
|
15
|
+
* @param {string} props.template.name - The name or label of the template entity.
|
|
16
|
+
* @param {React.ReactNode} [props.children=null] - Additional content to render after the serialized `template` object.
|
|
17
|
+
*
|
|
18
|
+
* @returns {JSX.Element} A JSX element displaying the entity's details and optional content.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Example usage:
|
|
22
|
+
* const templateEntity = { id: 123, name: "Sample Entity" };
|
|
23
|
+
*
|
|
24
|
+
* <TemplateMediumContent template={templateEntity}>
|
|
25
|
+
* <p>Additional information about the entity.</p>
|
|
26
|
+
* </TemplateMediumContent>
|
|
27
|
+
*/
|
|
28
|
+
// export const MediumContent = ({ item, children}) => {
|
|
29
|
+
// return (
|
|
30
|
+
// <MediumContent_ item={item}>
|
|
31
|
+
// {children}
|
|
32
|
+
// </MediumContent_>
|
|
33
|
+
// )
|
|
34
|
+
// }
|
|
35
|
+
|
|
36
|
+
// export const MediumContent_ = ({ item, children }) => {
|
|
37
|
+
// return (
|
|
38
|
+
// <>
|
|
39
|
+
// {Object.entries(item).map(([attribute_name, attribute_value]) => {
|
|
40
|
+
// // if (attribute_name !== "id") return null
|
|
41
|
+
// if (Array.isArray(attribute_value)) return null
|
|
42
|
+
// if (typeof attribute_value === "object" && attribute_value !== null) return null
|
|
43
|
+
// let attribute_value_result = attribute_value
|
|
44
|
+
// // let attribute_value_result = attribute_value
|
|
45
|
+
// if (Array.isArray(attribute_value))
|
|
46
|
+
// // attribute_value_result = <CardCapsule><Table data={attribute_value} /></CardCapsule>
|
|
47
|
+
// return null
|
|
48
|
+
// else if (typeof attribute_value === "object" && attribute_value !== null)
|
|
49
|
+
// // attribute_value_result = <MediumCard item={attribute_value} />
|
|
50
|
+
// return null
|
|
51
|
+
// else if (attribute_name === "__typename") {
|
|
52
|
+
// /*attribute_value_result = <Link item={attribute_value} />*/
|
|
53
|
+
// // console.log("else1", attribute_name, attribute_value)
|
|
54
|
+
// }
|
|
55
|
+
// if (attribute_name === "id")
|
|
56
|
+
// attribute_value_result = <Link item={item}>{item?.id || "Data error"}</Link>
|
|
57
|
+
// if (attribute_name === "name")
|
|
58
|
+
// attribute_value_result = <Link item={item} />
|
|
59
|
+
// // else return null
|
|
60
|
+
// if (attribute_value)
|
|
61
|
+
// return (
|
|
62
|
+
// <Row key={attribute_name}>
|
|
63
|
+
// <Col className="col-4"><b>{attribute_name}</b></Col>
|
|
64
|
+
// <Col className="col-8">{attribute_value_result}</Col>
|
|
65
|
+
// </Row>
|
|
66
|
+
// )
|
|
67
|
+
// else return null
|
|
68
|
+
// })}
|
|
69
|
+
// {Object.entries(item).map(([attribute_name, attribute_value]) => {
|
|
70
|
+
// if (attribute_value !== null) return null
|
|
71
|
+
// let attribute_value_result = JSON.stringify(attribute_value)
|
|
72
|
+
// if (Array.isArray(attribute_value))
|
|
73
|
+
// // attribute_value_result = <CardCapsule><Table data={attribute_value} /></CardCapsule>
|
|
74
|
+
// return null
|
|
75
|
+
// else if (typeof attribute_value === "object" && attribute_value !== null)
|
|
76
|
+
// // attribute_value_result = <MediumCard item={attribute_value} />
|
|
77
|
+
// return null
|
|
78
|
+
// else if (attribute_name === "__typename") {
|
|
79
|
+
// /*attribute_value_result = <Link item={attribute_value} />*/
|
|
80
|
+
// console.log("else2", attribute_name, attribute_value)
|
|
81
|
+
// }
|
|
82
|
+
// if (attribute_value)
|
|
83
|
+
// return null
|
|
84
|
+
// else
|
|
85
|
+
// return (
|
|
86
|
+
// <Row key={attribute_name}>
|
|
87
|
+
// <Col className="col-4"><b>{attribute_name}</b></Col>
|
|
88
|
+
// <Col className="col-8">{attribute_value_result}</Col>
|
|
89
|
+
// </Row>
|
|
90
|
+
// )
|
|
91
|
+
// })}
|
|
92
|
+
// {children}
|
|
93
|
+
// </>
|
|
94
|
+
// )
|
|
95
|
+
// }
|
|
96
|
+
|
|
97
|
+
export { MediumContent } from "../../../../_template/src/Base/Components/MediumContent"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Input } from "@hrbolek/uoisfrontend-shared"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A component that displays medium-level content for an template entity.
|
|
5
|
+
*
|
|
6
|
+
* This component renders a label "TemplateMediumContent" followed by a serialized representation of the `template` object
|
|
7
|
+
* and any additional child content. It is designed to handle and display information about an template entity object.
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @param {Object} props - The properties for the TemplateMediumContent component.
|
|
11
|
+
* @param {Object} props.template - The object representing the template entity.
|
|
12
|
+
* @param {string|number} props.template.id - The unique identifier for the template entity.
|
|
13
|
+
* @param {string} props.template.name - The name or label of the template entity.
|
|
14
|
+
* @param {React.ReactNode} [props.children=null] - Additional content to render after the serialized `template` object.
|
|
15
|
+
*
|
|
16
|
+
* @returns {JSX.Element} A JSX element displaying the entity's details and optional content.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Example usage:
|
|
20
|
+
* const templateEntity = { id: 123, name: "Sample Entity" };
|
|
21
|
+
*
|
|
22
|
+
* <TemplateMediumContent template={templateEntity}>
|
|
23
|
+
* <p>Additional information about the entity.</p>
|
|
24
|
+
* </TemplateMediumContent>
|
|
25
|
+
*/
|
|
26
|
+
export const MediumEditableContent = ({ item, onChange=(e)=>null, onBlur=(e)=>null, children}) => {
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
{/* defaultValue={item?.name|| "Název"} */}
|
|
30
|
+
<Input id={"name"} label={"Jméno"} className="form-control" value={item?.name|| "Název"} onChange={onChange} onBlur={onBlur} />
|
|
31
|
+
<Input id={"nameEn"} label={"Anglický název"} className="form-control" value={item?.nameEn|| "Anglický název"} onChange={onChange} onBlur={onBlur} />
|
|
32
|
+
{children}
|
|
33
|
+
</>
|
|
34
|
+
)
|
|
35
|
+
}
|