@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,989 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { Input } from "../../Base/FormControls/Input"
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import { UpdateButton as UpdateTransitionButton } from "../../StateTransitionGQLModel/Mutations/Update";
|
|
6
|
+
import { DeleteButton as DeleteTransitionButton} from "../../StateTransitionGQLModel/Mutations/Delete";
|
|
7
|
+
import { useAsyncThunkAction } from "../../../../dynamic/src/Hooks";
|
|
8
|
+
import { InsertAsyncAction, ReadAsyncAction } from "../Queries";
|
|
9
|
+
import { CreateButton as CreateTransitionButton } from "../../StateTransitionGQLModel/Mutations/Create";
|
|
10
|
+
import { UpdateButton as UpdateStateButton } from "../../StateGQLModel/Mutations/Update";
|
|
11
|
+
import { CreateButton as CreateStateButton } from "../../StateGQLModel/Mutations/Create";
|
|
12
|
+
import { DeleteButton as DeleteStateButton } from "../../StateGQLModel/Mutations/Delete";
|
|
13
|
+
import { Arrow90degRight, ArrowRight, PencilFill, Trash } from "react-bootstrap-icons";
|
|
14
|
+
import { useGQLEntityContext } from "../../Base/Helpers/GQLEntityProvider";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A component that displays medium-level content for an template entity.
|
|
18
|
+
*
|
|
19
|
+
* This component renders a label "TemplateMediumContent" followed by a serialized representation of the `template` object
|
|
20
|
+
* and any additional child content. It is designed to handle and display information about an template entity object.
|
|
21
|
+
*
|
|
22
|
+
* @component
|
|
23
|
+
* @param {Object} props - The properties for the TemplateMediumContent component.
|
|
24
|
+
* @param {Object} props.template - The object representing the template entity.
|
|
25
|
+
* @param {string|number} props.template.id - The unique identifier for the template entity.
|
|
26
|
+
* @param {string} props.template.name - The name or label of the template entity.
|
|
27
|
+
* @param {React.ReactNode} [props.children=null] - Additional content to render after the serialized `template` object.
|
|
28
|
+
*
|
|
29
|
+
* @returns {JSX.Element} A JSX element displaying the entity's details and optional content.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Example usage:
|
|
33
|
+
* const templateEntity = { id: 123, name: "Sample Entity" };
|
|
34
|
+
*
|
|
35
|
+
* <TemplateMediumContent template={templateEntity}>
|
|
36
|
+
* <p>Additional information about the entity.</p>
|
|
37
|
+
* </TemplateMediumContent>
|
|
38
|
+
*/
|
|
39
|
+
export const MediumEditableContent = ({ item, onChange = (e) => null, onBlur = (e) => null, children }) => {
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
{/* defaultValue={item?.name|| "Název"} */}
|
|
43
|
+
<Input id={"name"} label={"Jméno"} className="form-control" value={item?.name || "Název"} onChange={onChange} onBlur={onBlur} />
|
|
44
|
+
<Input id={"nameEn"} label={"Anglický název"} className="form-control" value={item?.nameEn || "Anglický název"} onChange={onChange} onBlur={onBlur} />
|
|
45
|
+
{children}
|
|
46
|
+
|
|
47
|
+
<StateMachineFlowVisualization item={item?.statemachine} />
|
|
48
|
+
</>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Kompletní vizualizace (Flow SVG + volitelná incidence tabulka).
|
|
56
|
+
*
|
|
57
|
+
* Props:
|
|
58
|
+
* - item: StateMachineGQLModel
|
|
59
|
+
* - showMatrix: boolean (default true)
|
|
60
|
+
* - currentId?: string (controlled) – pokud nedáš, bude se řídit interně
|
|
61
|
+
* - onCurrentIdChange?: (id) => void – pro controlled mód
|
|
62
|
+
*
|
|
63
|
+
* Pozn.: Handlery jsou lokální (jak chceš). Všechny jsou připravené a volají "TODO".
|
|
64
|
+
*/
|
|
65
|
+
export function StateMachineFlowVisualization({
|
|
66
|
+
item,
|
|
67
|
+
showMatrix = true,
|
|
68
|
+
currentId: currentIdProp,
|
|
69
|
+
onCurrentIdChange,
|
|
70
|
+
}) {
|
|
71
|
+
const sm = item;
|
|
72
|
+
|
|
73
|
+
const { states, transitions } = useMemo(() => {
|
|
74
|
+
const states = (sm?.states ?? [])
|
|
75
|
+
.slice()
|
|
76
|
+
.sort((a, b) => (a?.order ?? 0) - (b?.order ?? 0));
|
|
77
|
+
|
|
78
|
+
const transitions = (sm?.transitions ?? [])
|
|
79
|
+
.slice()
|
|
80
|
+
.sort((a, b) =>
|
|
81
|
+
String(a?.name ?? "").localeCompare(String(b?.name ?? ""), "cs")
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
return { states, transitions };
|
|
85
|
+
}, [sm]);
|
|
86
|
+
|
|
87
|
+
// currentId: controlled/uncontrolled
|
|
88
|
+
const [currentIdLocal, setCurrentIdLocal] = useState(null);
|
|
89
|
+
const currentId = currentIdProp ?? currentIdLocal;
|
|
90
|
+
const setCurrentId = onCurrentIdChange ?? setCurrentIdLocal;
|
|
91
|
+
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (!states.length) return;
|
|
94
|
+
const exists = currentId && states.some((s) => s?.id === currentId);
|
|
95
|
+
if (!exists) setCurrentId(states[0].id);
|
|
96
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
97
|
+
}, [states]);
|
|
98
|
+
|
|
99
|
+
const current = useMemo(
|
|
100
|
+
() => states.find((s) => s?.id === currentId) ?? null,
|
|
101
|
+
[states, currentId]
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
// ---- Handlery (stejné jako u incidence tabulky) ----
|
|
105
|
+
const handleStateClick = (state) => () => {
|
|
106
|
+
setCurrentId(state?.id ?? null);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const handleStateEdit = (state) => () => {
|
|
110
|
+
// open dialog for edit
|
|
111
|
+
console.log("edit state", state);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const handleStateRemove = (state) => () => {
|
|
115
|
+
// confirm delete
|
|
116
|
+
console.log("remove state", state);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const handleStateAdd = () => {
|
|
120
|
+
// open dialog for state add
|
|
121
|
+
console.log("add state");
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const handleTransitionAdd = (stateFrom, stateTo) => () => {
|
|
125
|
+
// open dialog for transition add
|
|
126
|
+
console.log("add transition", { from: stateFrom, to: stateTo });
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const handleTransitionEdit = (transition) => () => {
|
|
130
|
+
// open dialog for transition edit
|
|
131
|
+
console.log("edit transition", transition);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const handleTransitionRemove = (transition) => () => {
|
|
135
|
+
// confirm delete
|
|
136
|
+
console.log("remove transition", transition);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
if (!sm) {
|
|
141
|
+
return (
|
|
142
|
+
<div className="alert alert-warning" role="alert">
|
|
143
|
+
Nebyla dodána data state machine.
|
|
144
|
+
</div>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (!states.length) {
|
|
149
|
+
return (
|
|
150
|
+
<div className="alert alert-info" role="alert">
|
|
151
|
+
State machine neobsahuje žádné stavy.
|
|
152
|
+
<CreateStateButton
|
|
153
|
+
className="btn btn-outline-primary form-control"
|
|
154
|
+
item={{
|
|
155
|
+
statemachineId: item?.id,
|
|
156
|
+
name: "Nový stavAAAAAAAAAAAA",
|
|
157
|
+
order: 0
|
|
158
|
+
}}
|
|
159
|
+
>+ Přidat stav {item?.statemachine?.id}</CreateStateButton>
|
|
160
|
+
</div>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<div>
|
|
166
|
+
{/* Header */}
|
|
167
|
+
{/* <div className="mb-2">
|
|
168
|
+
<div className="h5 mb-1">{sm.name ?? "StateMachine"}</div>
|
|
169
|
+
<div className="text-muted">
|
|
170
|
+
Stavy: {states.length} • Přechody: {transitions.length}
|
|
171
|
+
{current ? <> • Aktuální: {current.name}</> : null}
|
|
172
|
+
</div>
|
|
173
|
+
</div> */}
|
|
174
|
+
|
|
175
|
+
{/* Toolbar */}
|
|
176
|
+
{/* <div className="d-flex flex-wrap gap-2 mb-2">
|
|
177
|
+
<button className="btn btn-sm btn-outline-primary" onClick={handleStateAdd}>
|
|
178
|
+
+ Přidat stav
|
|
179
|
+
</button>
|
|
180
|
+
{current ? (
|
|
181
|
+
<>
|
|
182
|
+
<button
|
|
183
|
+
className="btn btn-sm btn-outline-secondary"
|
|
184
|
+
onClick={handleStateEdit(current)}
|
|
185
|
+
>
|
|
186
|
+
Edit aktuálního stavu
|
|
187
|
+
</button>
|
|
188
|
+
|
|
189
|
+
<button
|
|
190
|
+
className="btn btn-sm btn-outline-danger"
|
|
191
|
+
onClick={handleStateRemove(current)}
|
|
192
|
+
>
|
|
193
|
+
Smazat aktuální stav
|
|
194
|
+
</button>
|
|
195
|
+
</>
|
|
196
|
+
) : null}
|
|
197
|
+
</div> */}
|
|
198
|
+
|
|
199
|
+
{/* SVG Flow Graph */}
|
|
200
|
+
<div className="mb-3">
|
|
201
|
+
<StateMachineFlowSvg
|
|
202
|
+
item={item}
|
|
203
|
+
states={states}
|
|
204
|
+
transitions={transitions}
|
|
205
|
+
currentId={currentId}
|
|
206
|
+
onStateClick={(s) => handleStateClick(s)()}
|
|
207
|
+
onStateEdit={(s) => handleStateEdit(s)()}
|
|
208
|
+
onStateRemove={(s) => handleStateRemove(s)()}
|
|
209
|
+
onTransitionAdd={(from, to) => handleTransitionAdd(from, to)()}
|
|
210
|
+
onTransitionEdit={(t) => handleTransitionEdit(t)()}
|
|
211
|
+
onTransitionRemove={(t) => handleTransitionRemove(t)()}
|
|
212
|
+
TransitionEdgeComponent={TransitionEdge} // <- vyměnitelné!
|
|
213
|
+
/>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
{/* Incidence matrix (volitelné) */}
|
|
217
|
+
{showMatrix ? (
|
|
218
|
+
<MatrixTable
|
|
219
|
+
item={item}
|
|
220
|
+
states={states}
|
|
221
|
+
transitions={transitions}
|
|
222
|
+
currentId={currentId}
|
|
223
|
+
onStateClick={(s) => handleStateClick(s)()}
|
|
224
|
+
onStateEdit={(s) => handleStateEdit(s)()}
|
|
225
|
+
onStateRemove={(s) => handleStateRemove(s)()}
|
|
226
|
+
onStateAdd={() => handleStateAdd()}
|
|
227
|
+
onTransitionAdd={(from, to) => handleTransitionAdd(from, to)()}
|
|
228
|
+
onTransitionEdit={(t) => handleTransitionEdit(t)()}
|
|
229
|
+
onTransitionRemove={(t) => handleTransitionRemove(t)()}
|
|
230
|
+
/>
|
|
231
|
+
) : null}
|
|
232
|
+
</div>
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* ------------------------- FLOW SVG ------------------------- */
|
|
237
|
+
|
|
238
|
+
export function StateMachineFlowSvg({
|
|
239
|
+
states,
|
|
240
|
+
transitions,
|
|
241
|
+
currentId,
|
|
242
|
+
onStateClick,
|
|
243
|
+
onStateEdit,
|
|
244
|
+
onStateRemove,
|
|
245
|
+
onTransitionAdd,
|
|
246
|
+
onTransitionEdit,
|
|
247
|
+
onTransitionRemove,
|
|
248
|
+
TransitionEdgeComponent,
|
|
249
|
+
width = 1100,
|
|
250
|
+
height = 200, // může být menší, protože uzly jsou menší
|
|
251
|
+
}) {
|
|
252
|
+
const layout = useMemo(() => {
|
|
253
|
+
// ↓↓↓ poloviční uzly
|
|
254
|
+
const nodeW = 95;
|
|
255
|
+
const nodeH = 26;
|
|
256
|
+
|
|
257
|
+
// přiměřeně menší mezera a padding
|
|
258
|
+
const gapX = 26;
|
|
259
|
+
const paddingX = 18;
|
|
260
|
+
|
|
261
|
+
const yBase = Math.round(height / 2);
|
|
262
|
+
|
|
263
|
+
const pos = new Map();
|
|
264
|
+
for (let i = 0; i < states.length; i++) {
|
|
265
|
+
const x = paddingX + i * (nodeW + gapX);
|
|
266
|
+
const y = yBase - nodeH / 2;
|
|
267
|
+
pos.set(states[i].id, { x, y, w: nodeW, h: nodeH, cx: x + nodeW / 2, cy: yBase });
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const indexById = new Map(states.map((s, i) => [s.id, i]));
|
|
271
|
+
|
|
272
|
+
const forward = [];
|
|
273
|
+
const backward = [];
|
|
274
|
+
for (const t of transitions) {
|
|
275
|
+
const a = indexById.get(t.sourceId);
|
|
276
|
+
const b = indexById.get(t.targetId);
|
|
277
|
+
if (a == null || b == null) continue;
|
|
278
|
+
const span = Math.abs(b - a);
|
|
279
|
+
const dir = b >= a ? "forward" : "backward";
|
|
280
|
+
const edge = { t, a, b, span, dir };
|
|
281
|
+
(dir === "forward" ? forward : backward).push(edge);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function assignLanes(edges) {
|
|
285
|
+
edges.sort((e1, e2) => e2.span - e1.span || (e1.a - e2.a));
|
|
286
|
+
const lanes = [];
|
|
287
|
+
for (const e of edges) {
|
|
288
|
+
const start = Math.min(e.a, e.b);
|
|
289
|
+
const end = Math.max(e.a, e.b);
|
|
290
|
+
const interval = { start, end };
|
|
291
|
+
|
|
292
|
+
let placed = false;
|
|
293
|
+
for (let li = 0; li < lanes.length; li++) {
|
|
294
|
+
const lane = lanes[li];
|
|
295
|
+
const fits = lane.every((it) => interval.end < it.start || interval.start > it.end);
|
|
296
|
+
if (fits) {
|
|
297
|
+
lane.push(interval);
|
|
298
|
+
e.lane = li;
|
|
299
|
+
placed = true;
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (!placed) {
|
|
304
|
+
lanes.push([interval]);
|
|
305
|
+
e.lane = lanes.length - 1;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return { edges, laneCount: lanes.length };
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
const f = assignLanes(forward);
|
|
312
|
+
const b = assignLanes(backward);
|
|
313
|
+
|
|
314
|
+
// menší amplitudy, aby křivky nebyly zbytečně vysoké
|
|
315
|
+
const base = 60;
|
|
316
|
+
const laneStep = 20;
|
|
317
|
+
const spanStep = 8;
|
|
318
|
+
|
|
319
|
+
function edgeGeom(e) {
|
|
320
|
+
const from = pos.get(e.t.sourceId);
|
|
321
|
+
const to = pos.get(e.t.targetId);
|
|
322
|
+
if (!from || !to) return null;
|
|
323
|
+
|
|
324
|
+
// středy uzlů
|
|
325
|
+
const sx = from.cx;
|
|
326
|
+
const sy = from.cy;
|
|
327
|
+
const tx = to.cx;
|
|
328
|
+
const ty = to.cy;
|
|
329
|
+
|
|
330
|
+
// posun na "hranu" uzlu, ale symetricky od středu (half-width + padding)
|
|
331
|
+
// (u tebe je pad záporný, aby se hrany víc přiblížily středu)
|
|
332
|
+
const pad = -16;
|
|
333
|
+
const fromHalf = from.w / 2 + pad;
|
|
334
|
+
const toHalf = to.w / 2 + pad;
|
|
335
|
+
|
|
336
|
+
// směr podle X (dopředná/zpětná)
|
|
337
|
+
const dirX = tx >= sx ? 1 : -1;
|
|
338
|
+
|
|
339
|
+
const x1 = sx + dirX * fromHalf;
|
|
340
|
+
const y1 = sy;
|
|
341
|
+
const x2 = tx - dirX * toHalf;
|
|
342
|
+
const y2 = ty;
|
|
343
|
+
|
|
344
|
+
const span = e.span || 1;
|
|
345
|
+
|
|
346
|
+
// parametry pro větší oblouky + clearance pro label
|
|
347
|
+
const labelH = 22;
|
|
348
|
+
const labelMargin = 8;
|
|
349
|
+
|
|
350
|
+
const base = 12 + labelH + labelMargin; // 42
|
|
351
|
+
const laneStep = 14;
|
|
352
|
+
const spanStep = 10;
|
|
353
|
+
|
|
354
|
+
const Araw = base + spanStep * (span - 1) + laneStep * (e.lane ?? 0);
|
|
355
|
+
const minClearance = labelH + labelMargin;
|
|
356
|
+
const A = Math.max(minClearance, Araw);
|
|
357
|
+
|
|
358
|
+
// NEW: odsazení hran od osy (baseline) v ose Y
|
|
359
|
+
// dopředné nahoru, zpětné dolů
|
|
360
|
+
const axisGap = 16; // dolaď (např. 16–26)
|
|
361
|
+
const dirY = e.dir === "forward" ? -1 : 1;
|
|
362
|
+
|
|
363
|
+
const y1o = y1 + dirY * axisGap;
|
|
364
|
+
const y2o = y2 + dirY * axisGap;
|
|
365
|
+
|
|
366
|
+
const mx = (x1 + x2) / 2;
|
|
367
|
+
const ctrlY = y1o + dirY * A;
|
|
368
|
+
|
|
369
|
+
const d = `M ${x1} ${y1o} Q ${mx} ${ctrlY} ${x2} ${y2o}`;
|
|
370
|
+
|
|
371
|
+
const labelX = mx;
|
|
372
|
+
const labelY = (y1o + y2o) / 2 + (ctrlY - y1o) * 0.55;
|
|
373
|
+
|
|
374
|
+
return { d, labelX, labelY };
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
const edges = [...f.edges, ...b.edges].map((e) => ({
|
|
378
|
+
...e,
|
|
379
|
+
geom: edgeGeom(e),
|
|
380
|
+
}));
|
|
381
|
+
|
|
382
|
+
return { pos, edges, nodeW, nodeH, yBase };
|
|
383
|
+
}, [states, transitions, height]);
|
|
384
|
+
|
|
385
|
+
const viewW = Math.max(width, 18 + states.length * (95 + 26));
|
|
386
|
+
const viewH = height;
|
|
387
|
+
|
|
388
|
+
const stroke = "#212529";
|
|
389
|
+
const primary = "#0d6efd";
|
|
390
|
+
const light = "#f8f9fa7f";
|
|
391
|
+
const border = "#dee2e6";
|
|
392
|
+
|
|
393
|
+
return (
|
|
394
|
+
<svg width="100%" viewBox={`0 0 ${viewW} ${viewH}`} role="img" aria-label="State machine flow graph">
|
|
395
|
+
<defs>
|
|
396
|
+
<marker id="arrow" markerWidth="4" markerHeight="4" refX="3.3" refY="2" orient="auto">
|
|
397
|
+
<path d="M0,0 L4,2 L0,4 Z" fill={stroke} />
|
|
398
|
+
</marker>
|
|
399
|
+
|
|
400
|
+
<marker id="arrowPrimary" markerWidth="4" markerHeight="4" refX="3.3" refY="2" orient="auto">
|
|
401
|
+
<path d="M0,0 L4,2 L0,4 Z" fill={primary} />
|
|
402
|
+
</marker>
|
|
403
|
+
</defs>
|
|
404
|
+
|
|
405
|
+
{/* edges */}
|
|
406
|
+
{layout.edges.map(({ t, geom }) => {
|
|
407
|
+
if (!geom) return null;
|
|
408
|
+
const isRelatedToCurrent = t.sourceId === currentId //|| t.targetId === currentId;
|
|
409
|
+
|
|
410
|
+
return (
|
|
411
|
+
<TransitionEdgeComponent
|
|
412
|
+
key={t.id}
|
|
413
|
+
transition={t}
|
|
414
|
+
d={geom.d}
|
|
415
|
+
labelX={geom.labelX}
|
|
416
|
+
labelY={geom.labelY}
|
|
417
|
+
markerEnd={isRelatedToCurrent ? "url(#arrowPrimary)" : "url(#arrow)"}
|
|
418
|
+
stroke={isRelatedToCurrent ? primary : stroke}
|
|
419
|
+
labelFill={isRelatedToCurrent ? primary : stroke}
|
|
420
|
+
labelBg={light}
|
|
421
|
+
labelBorder={border}
|
|
422
|
+
onEdit={() => onTransitionEdit?.(t)}
|
|
423
|
+
onRemove={() => onTransitionRemove?.(t)}
|
|
424
|
+
/>
|
|
425
|
+
);
|
|
426
|
+
})}
|
|
427
|
+
|
|
428
|
+
{/* nodes */}
|
|
429
|
+
{states.map((s) => {
|
|
430
|
+
const p = layout.pos.get(s.id);
|
|
431
|
+
if (!p) return null;
|
|
432
|
+
|
|
433
|
+
const isCurrent = s.id === currentId;
|
|
434
|
+
const fill = isCurrent ? "#e7f1ff" : light;
|
|
435
|
+
const outline = isCurrent ? primary : stroke;
|
|
436
|
+
|
|
437
|
+
return (
|
|
438
|
+
<g key={s.id}>
|
|
439
|
+
<rect
|
|
440
|
+
x={p.x}
|
|
441
|
+
y={p.y}
|
|
442
|
+
width={p.w}
|
|
443
|
+
height={p.h}
|
|
444
|
+
rx="10"
|
|
445
|
+
fill={fill}
|
|
446
|
+
stroke={outline}
|
|
447
|
+
strokeWidth={isCurrent ? 3 : 2}
|
|
448
|
+
onClick={() => onStateClick?.(s)}
|
|
449
|
+
style={{ cursor: onStateClick ? "pointer" : "default" }}
|
|
450
|
+
/>
|
|
451
|
+
<text
|
|
452
|
+
x={p.cx}
|
|
453
|
+
y={p.cy + 4}
|
|
454
|
+
textAnchor="middle"
|
|
455
|
+
fontSize="10.5"
|
|
456
|
+
fill={outline}
|
|
457
|
+
fontFamily="system-ui, -apple-system, Segoe UI, Roboto, Arial"
|
|
458
|
+
pointerEvents="none"
|
|
459
|
+
>
|
|
460
|
+
{shortLabel(s.name, 12)}
|
|
461
|
+
</text>
|
|
462
|
+
|
|
463
|
+
{/* mini actions (menší) */}
|
|
464
|
+
{/* <g transform={`translate(${p.x + p.w - 34 + 10}, ${p.y + 4 - 10})`}>
|
|
465
|
+
<rect
|
|
466
|
+
x="0"
|
|
467
|
+
y="0"
|
|
468
|
+
width="14"
|
|
469
|
+
height="14"
|
|
470
|
+
rx="4"
|
|
471
|
+
fill="#ffffff"
|
|
472
|
+
stroke={border}
|
|
473
|
+
onClick={() => onStateEdit?.(s)}
|
|
474
|
+
style={{ cursor: onStateEdit ? "pointer" : "default" }}
|
|
475
|
+
/>
|
|
476
|
+
<text
|
|
477
|
+
x="7"
|
|
478
|
+
y="10.5"
|
|
479
|
+
textAnchor="middle"
|
|
480
|
+
fontSize="9"
|
|
481
|
+
fill={stroke}
|
|
482
|
+
fontFamily="system-ui, -apple-system, Segoe UI, Roboto, Arial"
|
|
483
|
+
pointerEvents="none"
|
|
484
|
+
>
|
|
485
|
+
E
|
|
486
|
+
</text>
|
|
487
|
+
|
|
488
|
+
<rect
|
|
489
|
+
x="16"
|
|
490
|
+
y="0"
|
|
491
|
+
width="14"
|
|
492
|
+
height="14"
|
|
493
|
+
rx="4"
|
|
494
|
+
fill="#ffffff"
|
|
495
|
+
stroke={border}
|
|
496
|
+
onClick={() => onStateRemove?.(s)}
|
|
497
|
+
style={{ cursor: onStateRemove ? "pointer" : "default" }}
|
|
498
|
+
/>
|
|
499
|
+
<text
|
|
500
|
+
x="23"
|
|
501
|
+
y="10.5"
|
|
502
|
+
textAnchor="middle"
|
|
503
|
+
fontSize="10"
|
|
504
|
+
fill={stroke}
|
|
505
|
+
fontFamily="system-ui, -apple-system, Segoe UI, Roboto, Arial"
|
|
506
|
+
pointerEvents="none"
|
|
507
|
+
>
|
|
508
|
+
×
|
|
509
|
+
</text>
|
|
510
|
+
</g> */}
|
|
511
|
+
</g>
|
|
512
|
+
);
|
|
513
|
+
})}
|
|
514
|
+
|
|
515
|
+
{/* "+" hotspot mezi sousedy (menší) */}
|
|
516
|
+
{/* {states.slice(0, -1).map((fromState, i) => {
|
|
517
|
+
const toState = states[i + 1];
|
|
518
|
+
const a = layout.pos.get(fromState.id);
|
|
519
|
+
const b = layout.pos.get(toState.id);
|
|
520
|
+
if (!a || !b) return null;
|
|
521
|
+
|
|
522
|
+
const x = (a.x + a.w + b.x) / 2 - 8;
|
|
523
|
+
const y = layout.yBase - 8;
|
|
524
|
+
|
|
525
|
+
return (
|
|
526
|
+
<g key={`${fromState.id}->${toState.id}`}>
|
|
527
|
+
<rect
|
|
528
|
+
x={x}
|
|
529
|
+
y={y}
|
|
530
|
+
width="16"
|
|
531
|
+
height="16"
|
|
532
|
+
rx="5"
|
|
533
|
+
fill="#ffffff"
|
|
534
|
+
stroke="#dee2e6"
|
|
535
|
+
onClick={() => onTransitionAdd?.(fromState, toState)}
|
|
536
|
+
style={{ cursor: onTransitionAdd ? "pointer" : "default" }}
|
|
537
|
+
/>
|
|
538
|
+
<text
|
|
539
|
+
x={x + 8}
|
|
540
|
+
y={y + 12}
|
|
541
|
+
textAnchor="middle"
|
|
542
|
+
fontSize="12"
|
|
543
|
+
fill="#0d6efd"
|
|
544
|
+
fontFamily="system-ui, -apple-system, Segoe UI, Roboto, Arial"
|
|
545
|
+
pointerEvents="none"
|
|
546
|
+
>
|
|
547
|
+
+
|
|
548
|
+
</text>
|
|
549
|
+
</g>
|
|
550
|
+
);
|
|
551
|
+
})} */}
|
|
552
|
+
</svg>
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
function shortLabel(name, max = 12) {
|
|
557
|
+
const s = String(name ?? "").trim();
|
|
558
|
+
if (!s) return "—";
|
|
559
|
+
return s.length > max ? s.slice(0, max - 1) + "…" : s;
|
|
560
|
+
}
|
|
561
|
+
/* ---------------- TransitionEdge: samostatná komponenta ----------------
|
|
562
|
+
Tuhle můžeš vyměnit za jinou implementaci (ortho routing, jiné labely, ikony, ...)
|
|
563
|
+
*/
|
|
564
|
+
export function TransitionEdge({
|
|
565
|
+
transition,
|
|
566
|
+
d,
|
|
567
|
+
labelX,
|
|
568
|
+
labelY,
|
|
569
|
+
markerEnd,
|
|
570
|
+
stroke,
|
|
571
|
+
labelFill,
|
|
572
|
+
labelBg,
|
|
573
|
+
labelBorder,
|
|
574
|
+
onEdit,
|
|
575
|
+
onRemove,
|
|
576
|
+
|
|
577
|
+
// NEW:
|
|
578
|
+
labelWidth = 95, // default = tvoje poloviční šířka stavu
|
|
579
|
+
labelHeight = 22, // nechávám
|
|
580
|
+
labelPadX = 8, // pro výpočet zkrácení textu
|
|
581
|
+
}) {
|
|
582
|
+
const name = transition?.name ?? "—";
|
|
583
|
+
|
|
584
|
+
const w = labelWidth;
|
|
585
|
+
const h = labelHeight;
|
|
586
|
+
const rx = h / 2;
|
|
587
|
+
|
|
588
|
+
// kolik místa sežerou 2 mini tlačítka vpravo + mezery
|
|
589
|
+
const btnW = 14;
|
|
590
|
+
const btnGap = 2;
|
|
591
|
+
const btnBlockW = btnW * 2 + btnGap; // 38
|
|
592
|
+
const rightPad = -6;
|
|
593
|
+
const leftPad = 6;
|
|
594
|
+
|
|
595
|
+
// oblast pro text uvnitř labelu
|
|
596
|
+
const textBoxW = Math.max(10, w - btnBlockW - leftPad - rightPad - labelPadX);
|
|
597
|
+
|
|
598
|
+
// velmi jednoduchý odhad: ~6px na znak při font-size 11
|
|
599
|
+
const approxCharW = 6;
|
|
600
|
+
const maxChars = Math.max(3, Math.floor(textBoxW / approxCharW));
|
|
601
|
+
const text =
|
|
602
|
+
name.length > maxChars ? name.slice(0, Math.max(1, maxChars - 1)) + "…" : name;
|
|
603
|
+
|
|
604
|
+
const x0 = labelX - w / 2;
|
|
605
|
+
const y0 = labelY - h / 2;
|
|
606
|
+
|
|
607
|
+
return (
|
|
608
|
+
<g>
|
|
609
|
+
<path
|
|
610
|
+
d={d}
|
|
611
|
+
fill="none"
|
|
612
|
+
stroke={stroke}
|
|
613
|
+
strokeWidth="2.3"
|
|
614
|
+
markerEnd={markerEnd}
|
|
615
|
+
/>
|
|
616
|
+
|
|
617
|
+
{/* label group */}
|
|
618
|
+
<g>
|
|
619
|
+
{/* <rect
|
|
620
|
+
x={x0}
|
|
621
|
+
y={y0}
|
|
622
|
+
width={w}
|
|
623
|
+
height={h}
|
|
624
|
+
rx={rx}
|
|
625
|
+
fill={labelBg}
|
|
626
|
+
stroke={labelBorder}
|
|
627
|
+
/> */}
|
|
628
|
+
|
|
629
|
+
{/* text je vlevo od tlačítek, ne přesně na střed pill */}
|
|
630
|
+
<text
|
|
631
|
+
x={x0 + leftPad + (w - btnBlockW - leftPad - rightPad) / 2}
|
|
632
|
+
y={labelY + 4}
|
|
633
|
+
textAnchor="middle"
|
|
634
|
+
fontSize="11"
|
|
635
|
+
fill={labelFill}
|
|
636
|
+
fontFamily="system-ui, -apple-system, Segoe UI, Roboto, Arial"
|
|
637
|
+
pointerEvents="none"
|
|
638
|
+
>
|
|
639
|
+
{text}
|
|
640
|
+
</text>
|
|
641
|
+
|
|
642
|
+
{/* buttons in right side */}
|
|
643
|
+
{/* <rect
|
|
644
|
+
x={x0 + w - btnBlockW - rightPad}
|
|
645
|
+
y={labelY - 16}
|
|
646
|
+
width={btnW}
|
|
647
|
+
height={btnW}
|
|
648
|
+
rx="5"
|
|
649
|
+
fill="#ffffff"
|
|
650
|
+
stroke={labelBorder}
|
|
651
|
+
onClick={onEdit}
|
|
652
|
+
style={{ cursor: onEdit ? "pointer" : "default" }}
|
|
653
|
+
/>
|
|
654
|
+
<text
|
|
655
|
+
x={x0 + w - btnBlockW - rightPad + btnW / 2}
|
|
656
|
+
y={labelY - 5}
|
|
657
|
+
textAnchor="middle"
|
|
658
|
+
fontSize="9"
|
|
659
|
+
fill="#212529"
|
|
660
|
+
fontFamily="system-ui, -apple-system, Segoe UI, Roboto, Arial"
|
|
661
|
+
pointerEvents="none"
|
|
662
|
+
>
|
|
663
|
+
E
|
|
664
|
+
</text>
|
|
665
|
+
|
|
666
|
+
<rect
|
|
667
|
+
x={x0 + w - btnW - rightPad}
|
|
668
|
+
y={labelY - 16}
|
|
669
|
+
width={btnW}
|
|
670
|
+
height={btnW}
|
|
671
|
+
rx="5"
|
|
672
|
+
fill="#ffffff"
|
|
673
|
+
stroke={labelBorder}
|
|
674
|
+
onClick={onRemove}
|
|
675
|
+
style={{ cursor: onRemove ? "pointer" : "default" }}
|
|
676
|
+
/>
|
|
677
|
+
<text
|
|
678
|
+
x={x0 + w - rightPad - btnW / 2}
|
|
679
|
+
y={labelY - 5}
|
|
680
|
+
textAnchor="middle"
|
|
681
|
+
fontSize="9"
|
|
682
|
+
fill="#212529"
|
|
683
|
+
fontFamily="system-ui, -apple-system, Segoe UI, Roboto, Arial"
|
|
684
|
+
pointerEvents="none"
|
|
685
|
+
>
|
|
686
|
+
×
|
|
687
|
+
</text> */}
|
|
688
|
+
</g>
|
|
689
|
+
</g>
|
|
690
|
+
);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/* ------------------------- Incidence table ------------------------- */
|
|
694
|
+
|
|
695
|
+
function MatrixTable({
|
|
696
|
+
item,
|
|
697
|
+
states: states_,
|
|
698
|
+
transitions,
|
|
699
|
+
currentId,
|
|
700
|
+
onStateClick,
|
|
701
|
+
onStateEdit,
|
|
702
|
+
onStateRemove,
|
|
703
|
+
onStateAdd,
|
|
704
|
+
onTransitionAdd,
|
|
705
|
+
onTransitionEdit,
|
|
706
|
+
onTransitionRemove,
|
|
707
|
+
}) {
|
|
708
|
+
const states = useMemo(()=> states_.toSorted((a,b) => ((a?.order ?? 0)-(b?.order ?? 0))), [
|
|
709
|
+
states_
|
|
710
|
+
])
|
|
711
|
+
|
|
712
|
+
const { matrix } = useMemo(() => {
|
|
713
|
+
const indexById = new Map(states.map((s, i) => [s.id, i]));
|
|
714
|
+
const n = states.length;
|
|
715
|
+
|
|
716
|
+
const matrix = Array.from({ length: n }, () =>
|
|
717
|
+
Array.from({ length: n }, () => [])
|
|
718
|
+
);
|
|
719
|
+
|
|
720
|
+
for (const t of transitions) {
|
|
721
|
+
const r = indexById.get(t.sourceId);
|
|
722
|
+
const c = indexById.get(t.targetId);
|
|
723
|
+
if (r == null || c == null) continue;
|
|
724
|
+
matrix[r][c].push(t);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
// seřadit podle názvu v buňkách
|
|
728
|
+
// for (let r = 0; r < n; r++) {
|
|
729
|
+
// for (let c = 0; c < n; c++) {
|
|
730
|
+
// matrix[r][c].sort((a, b) =>
|
|
731
|
+
// String(a?.name ?? "").localeCompare(String(b?.name ?? ""), "cs")
|
|
732
|
+
// );
|
|
733
|
+
// }
|
|
734
|
+
// }
|
|
735
|
+
|
|
736
|
+
return { matrix };
|
|
737
|
+
}, [states, transitions]);
|
|
738
|
+
|
|
739
|
+
const currentRowIndex = useMemo(() => {
|
|
740
|
+
const idx = states.findIndex((s) => s?.id === currentId);
|
|
741
|
+
return idx >= 0 ? idx : 0;
|
|
742
|
+
}, [states, currentId]);
|
|
743
|
+
|
|
744
|
+
const current = useMemo(
|
|
745
|
+
() => states.find((s) => s?.id === currentId) ?? null,
|
|
746
|
+
[states, currentId]
|
|
747
|
+
);
|
|
748
|
+
|
|
749
|
+
// const { run: reRead } = useAsyncThunkAction(ReadAsyncAction, item, {deferred: true})
|
|
750
|
+
const { reRead } = useGQLEntityContext()
|
|
751
|
+
const handleDeleteTransition = (t) => () => {
|
|
752
|
+
console.log("handleDeleteTransition", t)
|
|
753
|
+
reRead()
|
|
754
|
+
}
|
|
755
|
+
const handleReRead = () => {
|
|
756
|
+
reRead()
|
|
757
|
+
}
|
|
758
|
+
// const handleAddTransition = (t) => () => {}
|
|
759
|
+
|
|
760
|
+
return (
|
|
761
|
+
<div className="table-responsive">
|
|
762
|
+
<table className="table table-sm align-top table-bordered ">
|
|
763
|
+
<thead className="table-light">
|
|
764
|
+
<tr>
|
|
765
|
+
<th rowSpan={2} scope="col" className="align-middle table-primary">
|
|
766
|
+
<div className="d-flex gap-2 justify-content-center">
|
|
767
|
+
Zdroj
|
|
768
|
+
</div>
|
|
769
|
+
</th>
|
|
770
|
+
<th
|
|
771
|
+
colSpan={states.length}
|
|
772
|
+
scope="col"
|
|
773
|
+
className="text-center table-warning me-3"
|
|
774
|
+
>
|
|
775
|
+
<div className="d-flex gap-2 justify-content-center">
|
|
776
|
+
Cíl
|
|
777
|
+
<CreateStateButton
|
|
778
|
+
className="btn btn-sm btn-outline-secondary"
|
|
779
|
+
item={{
|
|
780
|
+
statemachineId: current?.statemachineId,
|
|
781
|
+
name: "Nový stav",
|
|
782
|
+
order: states.length
|
|
783
|
+
}}
|
|
784
|
+
onOk={handleReRead}
|
|
785
|
+
>
|
|
786
|
+
+
|
|
787
|
+
</CreateStateButton>
|
|
788
|
+
</div>
|
|
789
|
+
</th>
|
|
790
|
+
</tr>
|
|
791
|
+
<tr>
|
|
792
|
+
{states.map((s) => (
|
|
793
|
+
<th key={s.id} scope="col" className="table-warning mx-3">
|
|
794
|
+
<div className="d-flex gap-2 justify-content-center">
|
|
795
|
+
<button
|
|
796
|
+
className="btn btn-sm btn-outline-secondary"
|
|
797
|
+
onClick={() => onStateClick?.(s)}
|
|
798
|
+
>
|
|
799
|
+
{s.name}
|
|
800
|
+
</button>
|
|
801
|
+
<UpdateStateButton
|
|
802
|
+
className="btn btn-sm btn-outline-secondary"
|
|
803
|
+
item={s}
|
|
804
|
+
>
|
|
805
|
+
<PencilFill />
|
|
806
|
+
</UpdateStateButton>
|
|
807
|
+
<DeleteStateButton
|
|
808
|
+
className="btn btn-sm btn-outline-secondary"
|
|
809
|
+
item={s}
|
|
810
|
+
onOk={handleDeleteTransition(s)}
|
|
811
|
+
>
|
|
812
|
+
<Trash />
|
|
813
|
+
</DeleteStateButton>
|
|
814
|
+
</div>
|
|
815
|
+
</th>
|
|
816
|
+
))}
|
|
817
|
+
</tr>
|
|
818
|
+
</thead>
|
|
819
|
+
|
|
820
|
+
<tbody>
|
|
821
|
+
{/* {states.map((rowState, r) => (
|
|
822
|
+
<tr key={rowState.id}>
|
|
823
|
+
<th scope="row">
|
|
824
|
+
<div className="d-flex flex-wrap gap-1">
|
|
825
|
+
<button
|
|
826
|
+
className="btn btn-sm btn-outline-secondary"
|
|
827
|
+
onClick={() => onStateClick?.(rowState)}
|
|
828
|
+
>
|
|
829
|
+
{rowState.name}
|
|
830
|
+
</button>
|
|
831
|
+
<button
|
|
832
|
+
className="btn btn-sm btn-outline-secondary"
|
|
833
|
+
onClick={() => onStateEdit?.(rowState)}
|
|
834
|
+
>
|
|
835
|
+
Edit
|
|
836
|
+
</button>
|
|
837
|
+
<button
|
|
838
|
+
className="btn btn-sm btn-outline-secondary"
|
|
839
|
+
onClick={() => onStateRemove?.(rowState)}
|
|
840
|
+
>
|
|
841
|
+
Remove
|
|
842
|
+
</button>
|
|
843
|
+
</div>
|
|
844
|
+
</th>
|
|
845
|
+
|
|
846
|
+
{states.map((colState, c) => {
|
|
847
|
+
const list = matrix[r][c];
|
|
848
|
+
return (
|
|
849
|
+
<td key={colState.id}>
|
|
850
|
+
{(list.length === 0) && (r !== c) && (
|
|
851
|
+
<CreateButton
|
|
852
|
+
className="btn btn-sm btn-outline-light w-100"
|
|
853
|
+
item={{
|
|
854
|
+
name: (r>c)?"Vrátit":"Schválit",
|
|
855
|
+
sourceId: rowState?.id,
|
|
856
|
+
targetId: colState?.id,
|
|
857
|
+
statemachineId: rowState?.statemachineId
|
|
858
|
+
}}
|
|
859
|
+
>
|
|
860
|
+
+
|
|
861
|
+
</CreateButton>
|
|
862
|
+
)}
|
|
863
|
+
{(list.length !== 0) && (
|
|
864
|
+
<div className="d-flex flex-wrap gap-1">
|
|
865
|
+
{list.map((t) => (
|
|
866
|
+
<span key={t.id} title={t.id}>
|
|
867
|
+
<button className="btn btn-sm btn-secondary border-0">
|
|
868
|
+
{t.name} ({})
|
|
869
|
+
</button>
|
|
870
|
+
<button
|
|
871
|
+
className="btn btn-sm btn-outline-danger"
|
|
872
|
+
onClick={() => onTransitionEdit?.(t)}
|
|
873
|
+
>
|
|
874
|
+
Edit
|
|
875
|
+
</button>
|
|
876
|
+
<UpdateTransitionButton
|
|
877
|
+
item={t}
|
|
878
|
+
className="btn btn-sm btn-outline-primary"
|
|
879
|
+
>
|
|
880
|
+
Pencil
|
|
881
|
+
</UpdateTransitionButton>
|
|
882
|
+
<DeleteTransitionButton
|
|
883
|
+
item={t}
|
|
884
|
+
className="btn btn-sm btn-outline-danger"
|
|
885
|
+
onOk={handleDeleteTransition(t)}
|
|
886
|
+
>
|
|
887
|
+
"trash"
|
|
888
|
+
</DeleteTransitionButton>
|
|
889
|
+
<button
|
|
890
|
+
className="btn btn-sm btn-outline-danger"
|
|
891
|
+
onClick={() => onTransitionRemove?.(t)}
|
|
892
|
+
>
|
|
893
|
+
-
|
|
894
|
+
</button>
|
|
895
|
+
</span>
|
|
896
|
+
))}
|
|
897
|
+
</div>
|
|
898
|
+
)}
|
|
899
|
+
</td>
|
|
900
|
+
);
|
|
901
|
+
})}
|
|
902
|
+
</tr>
|
|
903
|
+
))} */}
|
|
904
|
+
|
|
905
|
+
{/* “current” řádek pro rychlou práci */}
|
|
906
|
+
<tr>
|
|
907
|
+
<th scope="row" className="table-primary">
|
|
908
|
+
<div className="d-flex gap-2 justify-content-center">
|
|
909
|
+
{current ? (
|
|
910
|
+
<button className="btn btn-sm btn-primary">{current.name}</button>
|
|
911
|
+
) : (
|
|
912
|
+
<span className="text-muted">—</span>
|
|
913
|
+
)}
|
|
914
|
+
</div>
|
|
915
|
+
</th>
|
|
916
|
+
{states.map((colState, c) => {
|
|
917
|
+
const list = matrix?.[currentRowIndex]?.[c] ?? [];
|
|
918
|
+
return (
|
|
919
|
+
<td key={colState.id}>
|
|
920
|
+
<div className="d-flex gap-2 justify-content-center">
|
|
921
|
+
{(list.length === 0) && (current !== colState) && (
|
|
922
|
+
<CreateTransitionButton
|
|
923
|
+
className="btn btn-sm btn-outline-secondary w-100"
|
|
924
|
+
item={{
|
|
925
|
+
// name: (r>c)?"Vrátit":"Schválit",
|
|
926
|
+
name: (current?.order < colState?.order)?"Vrátit":"Schválit",
|
|
927
|
+
sourceId: current?.id,
|
|
928
|
+
targetId: colState?.id,
|
|
929
|
+
statemachineId: current?.statemachineId
|
|
930
|
+
}}
|
|
931
|
+
onOk={handleReRead}
|
|
932
|
+
>
|
|
933
|
+
Přidat: {current?.name} <ArrowRight/> {colState?.name}
|
|
934
|
+
</CreateTransitionButton>
|
|
935
|
+
)}
|
|
936
|
+
{(current === colState) && (
|
|
937
|
+
<span className="form-control btn btn-sm btn-outline-danger border-0">
|
|
938
|
+
Nelze do stejného stavu
|
|
939
|
+
</span>
|
|
940
|
+
)}
|
|
941
|
+
{(list.length !== 0) && (
|
|
942
|
+
list.map((t) => (
|
|
943
|
+
<span key={t.id} title={t.id}>
|
|
944
|
+
<button
|
|
945
|
+
className="btn btn-sm btn-primary border-0 me-2"
|
|
946
|
+
onClick={() => onStateClick?.(colState)}
|
|
947
|
+
>
|
|
948
|
+
{t.name}
|
|
949
|
+
</button>
|
|
950
|
+
<UpdateTransitionButton
|
|
951
|
+
className="btn btn-sm btn-outline-danger me-2"
|
|
952
|
+
item={t}
|
|
953
|
+
>
|
|
954
|
+
<PencilFill />
|
|
955
|
+
</UpdateTransitionButton>
|
|
956
|
+
<DeleteTransitionButton
|
|
957
|
+
className="btn btn-sm btn-outline-danger me-2"
|
|
958
|
+
item={t}
|
|
959
|
+
onOk={handleDeleteTransition(t)}
|
|
960
|
+
>
|
|
961
|
+
<Trash />
|
|
962
|
+
</DeleteTransitionButton>
|
|
963
|
+
</span>
|
|
964
|
+
))
|
|
965
|
+
|
|
966
|
+
)}
|
|
967
|
+
</div>
|
|
968
|
+
</td>
|
|
969
|
+
);
|
|
970
|
+
})}
|
|
971
|
+
</tr>
|
|
972
|
+
|
|
973
|
+
{/* add state row */}
|
|
974
|
+
{/* <tr>
|
|
975
|
+
<th>
|
|
976
|
+
<button
|
|
977
|
+
className="form-control btn btn-outline-primary"
|
|
978
|
+
onClick={() => onStateAdd?.()}
|
|
979
|
+
>
|
|
980
|
+
+
|
|
981
|
+
</button>
|
|
982
|
+
</th>
|
|
983
|
+
<td colSpan={states.length}></td>
|
|
984
|
+
</tr> */}
|
|
985
|
+
</tbody>
|
|
986
|
+
</table>
|
|
987
|
+
</div>
|
|
988
|
+
);
|
|
989
|
+
}
|