@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,275 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
import { Link } from "./Link";
|
|
4
|
+
import { CreateButton, CreateLink } from "../Mutations/Create";
|
|
5
|
+
import { UpdateButton, UpdateLink } from "../Mutations/Update";
|
|
6
|
+
import { DeleteButton } from "../Mutations/Delete";
|
|
7
|
+
import { r } from "happy-dom/lib/PropertySymbol";
|
|
8
|
+
|
|
9
|
+
const CellId = ({ row, name }) => (
|
|
10
|
+
<td key={name}>
|
|
11
|
+
<Link item={row}>{row?.id || "Data Error"}</Link>
|
|
12
|
+
</td>
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
export const CellName = ({ row, name }) => (
|
|
16
|
+
<td key={name}>
|
|
17
|
+
<Link item={row} />
|
|
18
|
+
</td>
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
const CellDefault = ({ row, name }) => {
|
|
22
|
+
const value = row?.[name] ?? ""
|
|
23
|
+
|
|
24
|
+
const idpos = name.indexOf("Id")
|
|
25
|
+
if (idpos === -1) {
|
|
26
|
+
return <td key={name}>{typeof value === "object" ? `${value}` : (value || "")}</td>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const scalarname = name.replace("Id", "")
|
|
30
|
+
const { id, __typename } = row?.[scalarname] || {}
|
|
31
|
+
|
|
32
|
+
if (id && __typename && id == value) {
|
|
33
|
+
return (
|
|
34
|
+
<td key={name}>
|
|
35
|
+
<Link item={row?.[scalarname]}>{value || ""}</Link>
|
|
36
|
+
</td>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return <td key={name}>{typeof value === "object" ? `${value}` : (value || "")}</td>
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// 2) Funkce, která z dat vyrobí table_def
|
|
44
|
+
export const buildTableDef = (data) => {
|
|
45
|
+
const row = data?.[0] ?? {}
|
|
46
|
+
const priority = ["__typename", "id", "name"]
|
|
47
|
+
|
|
48
|
+
const attribute_names = Object.keys(row).filter((attribute_name) => {
|
|
49
|
+
const v = row[attribute_name]
|
|
50
|
+
if (Array.isArray(v)) return false
|
|
51
|
+
if (typeof v === "object" && v !== null) return false
|
|
52
|
+
return true
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const columns = [
|
|
56
|
+
...priority.filter((a) => attribute_names.includes(a)),
|
|
57
|
+
...attribute_names.filter((a) => !priority.includes(a)),
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
// table_def: colname -> { label, component }
|
|
61
|
+
const result = Object.fromEntries(
|
|
62
|
+
columns.map((name) => {
|
|
63
|
+
let component = CellDefault
|
|
64
|
+
if (name === "id") component = CellId
|
|
65
|
+
if (name === "name") component = CellName
|
|
66
|
+
|
|
67
|
+
return [
|
|
68
|
+
name,
|
|
69
|
+
{
|
|
70
|
+
label: name, // tady si můžeš dát hezčí label
|
|
71
|
+
component, // React komponenta pro buňku
|
|
72
|
+
},
|
|
73
|
+
]
|
|
74
|
+
})
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
result["tools"] = {
|
|
78
|
+
label: "Nástroje",
|
|
79
|
+
component: ({row}) => <td><KebabMenu actions={[
|
|
80
|
+
// { label: "Editovat", onClick: () => console.log("edit") },
|
|
81
|
+
// { label: "Smazat", onClick: () => console.log("delete") },
|
|
82
|
+
// { label: "Detail", onClick: () => console.log("detail") },
|
|
83
|
+
{ children: <Link
|
|
84
|
+
className="btn btn-sm btn-outline-secondary border-0 text-start w-100"
|
|
85
|
+
item={row}
|
|
86
|
+
>Detail</Link> },
|
|
87
|
+
{ children: <UpdateLink
|
|
88
|
+
className="btn btn-sm btn-outline-secondary border-0 text-start w-100"
|
|
89
|
+
item={row}
|
|
90
|
+
action="edit"
|
|
91
|
+
>Editovat</UpdateLink> },
|
|
92
|
+
{ children: <UpdateButton
|
|
93
|
+
className="btn btn-sm btn-outline-secondary border-0 text-start w-100"
|
|
94
|
+
item={row}
|
|
95
|
+
>Editovat (zde)</UpdateButton> },
|
|
96
|
+
{ children: <DeleteButton
|
|
97
|
+
className="btn btn-sm btn-outline-secondary border-0 text-start w-100"
|
|
98
|
+
>Smazat</DeleteButton> },
|
|
99
|
+
]} /></td>,
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return result
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
export const KebabMenu = ({ actions = [] }) => {
|
|
107
|
+
const [open, setOpen] = useState(false);
|
|
108
|
+
const btnRef = useRef(null);
|
|
109
|
+
const menuRef = useRef(null);
|
|
110
|
+
const [pos, setPos] = useState({ left: 0, top: 0 });
|
|
111
|
+
|
|
112
|
+
const close = () => setOpen(false);
|
|
113
|
+
|
|
114
|
+
// zavření při kliku mimo (funguje i s portalem)
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (!open) return;
|
|
117
|
+
|
|
118
|
+
const onMouseDown = (e) => {
|
|
119
|
+
const btn = btnRef.current;
|
|
120
|
+
const menu = menuRef.current;
|
|
121
|
+
if (!btn || !menu) return;
|
|
122
|
+
|
|
123
|
+
if (btn.contains(e.target)) return;
|
|
124
|
+
if (menu.contains(e.target)) return;
|
|
125
|
+
|
|
126
|
+
close();
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const onKeyDown = (e) => {
|
|
130
|
+
if (e.key === "Escape") close();
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
document.addEventListener("mousedown", onMouseDown);
|
|
134
|
+
document.addEventListener("keydown", onKeyDown);
|
|
135
|
+
return () => {
|
|
136
|
+
document.removeEventListener("mousedown", onMouseDown);
|
|
137
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
138
|
+
};
|
|
139
|
+
}, [open]);
|
|
140
|
+
|
|
141
|
+
// spočítat pozici po otevření + při scroll/resize
|
|
142
|
+
useLayoutEffect(() => {
|
|
143
|
+
if (!open) return;
|
|
144
|
+
|
|
145
|
+
const update = () => {
|
|
146
|
+
const btn = btnRef.current;
|
|
147
|
+
if (!btn) return;
|
|
148
|
+
|
|
149
|
+
const r = btn.getBoundingClientRect();
|
|
150
|
+
// menu zarovnané doprava k tlačítku, pod tlačítkem
|
|
151
|
+
setPos({
|
|
152
|
+
left: r.right + window.scrollX,
|
|
153
|
+
top: r.bottom + window.scrollY,
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
update();
|
|
158
|
+
|
|
159
|
+
window.addEventListener("resize", update);
|
|
160
|
+
// scroll na capture, aby to fungovalo i při scrollu uvnitř wrapperů
|
|
161
|
+
window.addEventListener("scroll", update, true);
|
|
162
|
+
|
|
163
|
+
return () => {
|
|
164
|
+
window.removeEventListener("resize", update);
|
|
165
|
+
window.removeEventListener("scroll", update, true);
|
|
166
|
+
};
|
|
167
|
+
}, [open]);
|
|
168
|
+
|
|
169
|
+
const menu = open ? (
|
|
170
|
+
<div
|
|
171
|
+
ref={menuRef}
|
|
172
|
+
style={{
|
|
173
|
+
position: "absolute",
|
|
174
|
+
left: pos.left,
|
|
175
|
+
top: pos.top,
|
|
176
|
+
transform: "translateX(-100%)", // right align
|
|
177
|
+
background: "white",
|
|
178
|
+
border: "1px solid #ddd",
|
|
179
|
+
borderRadius: 4,
|
|
180
|
+
boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
|
|
181
|
+
zIndex: 2000,
|
|
182
|
+
minWidth: 140,
|
|
183
|
+
}}
|
|
184
|
+
role="menu"
|
|
185
|
+
>
|
|
186
|
+
{actions.map((action, i) => {
|
|
187
|
+
const children = action?.children;
|
|
188
|
+
if (children) return <div key={i}>{children}</div>;
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<button
|
|
192
|
+
key={i}
|
|
193
|
+
type="button"
|
|
194
|
+
className="btn btn-sm btn-outline-secondary border-0 text-start w-100"
|
|
195
|
+
onClick={() => {
|
|
196
|
+
close();
|
|
197
|
+
action?.onClick?.();
|
|
198
|
+
}}
|
|
199
|
+
style={{
|
|
200
|
+
padding: "8px 12px",
|
|
201
|
+
textDecoration: "none",
|
|
202
|
+
}}
|
|
203
|
+
role="menuitem"
|
|
204
|
+
>
|
|
205
|
+
{action?.label}
|
|
206
|
+
</button>
|
|
207
|
+
);
|
|
208
|
+
})}
|
|
209
|
+
</div>
|
|
210
|
+
) : null;
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
<>
|
|
214
|
+
<button
|
|
215
|
+
ref={btnRef}
|
|
216
|
+
className="btn btn-sm btn-outline-secondary border-1"
|
|
217
|
+
onClick={() => setOpen((o) => !o)}
|
|
218
|
+
aria-expanded={open}
|
|
219
|
+
aria-haspopup="menu"
|
|
220
|
+
aria-label="Menu"
|
|
221
|
+
type="button"
|
|
222
|
+
>
|
|
223
|
+
⋮
|
|
224
|
+
</button>
|
|
225
|
+
|
|
226
|
+
{open ? createPortal(menu, document.body) : null}
|
|
227
|
+
</>
|
|
228
|
+
);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export const TableRow = ({ row, table_def }) => {
|
|
232
|
+
return (
|
|
233
|
+
<tr>
|
|
234
|
+
{Object.keys(table_def).map((name) => {
|
|
235
|
+
const Cell = table_def[name].component
|
|
236
|
+
return <Cell key={name} row={row} name={name} />
|
|
237
|
+
})}
|
|
238
|
+
</tr>
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const TableRow_ = TableRow
|
|
243
|
+
// 3) Table už jen používá definici
|
|
244
|
+
export const TableBody = ({ data, table_def, TableRow = TableRow_ }) => {
|
|
245
|
+
return (
|
|
246
|
+
<tbody>
|
|
247
|
+
{data.map((row) => <TableRow key={row?.id} row={row} table_def={table_def} />)}
|
|
248
|
+
</tbody>
|
|
249
|
+
)
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const TableBody_ = TableBody
|
|
253
|
+
|
|
254
|
+
export const Table = ({ data, table_def = null, TableBody = TableBody_ }) => {
|
|
255
|
+
if (!data || data.length === 0) return null
|
|
256
|
+
|
|
257
|
+
const _table_def = useMemo(() => table_def || buildTableDef(data), [data, table_def])
|
|
258
|
+
const colnames = useMemo(() => Object.keys(_table_def).map((k) => _table_def[k].label), [_table_def])
|
|
259
|
+
// console.log(_table_def)
|
|
260
|
+
return (
|
|
261
|
+
<div className="table-responsive">
|
|
262
|
+
<table className="table table-stripped">
|
|
263
|
+
<thead>
|
|
264
|
+
<tr>
|
|
265
|
+
{colnames.map((name) => (
|
|
266
|
+
<th key={name}>{`${name}`}</th>
|
|
267
|
+
))}
|
|
268
|
+
</tr>
|
|
269
|
+
</thead>
|
|
270
|
+
|
|
271
|
+
<TableBody data={data} table_def={_table_def} />
|
|
272
|
+
</table>
|
|
273
|
+
</div>
|
|
274
|
+
)
|
|
275
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './Attribute'
|
|
2
|
+
export * from './CardCapsule'
|
|
3
|
+
export * from './Col'
|
|
4
|
+
export * from './ConfirmEdit'
|
|
5
|
+
export * from './CopyButton'
|
|
6
|
+
export * from './LargeCard'
|
|
7
|
+
export * from './Link'
|
|
8
|
+
export * from './MediumCard'
|
|
9
|
+
export * from './MediumContent'
|
|
10
|
+
export * from './MediumEditableContent'
|
|
11
|
+
export * from './ProxyLink'
|
|
12
|
+
export * from './Row'
|
|
13
|
+
export * from './LiveEdit'
|
|
14
|
+
export * from './Table'
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combines multiple class name inputs into a single space-separated string.
|
|
3
|
+
*
|
|
4
|
+
* This helper is a lightweight alternative to libraries like `classnames`.
|
|
5
|
+
* It accepts any number of arguments, flattens nested arrays, removes falsy
|
|
6
|
+
* values, and joins the remaining entries with spaces.
|
|
7
|
+
*
|
|
8
|
+
* Supported inputs:
|
|
9
|
+
* - string: "btn"
|
|
10
|
+
* - falsy values: false, null, undefined, "" (ignored)
|
|
11
|
+
* - arrays: ["btn", "btn-primary"]
|
|
12
|
+
* - nested arrays: ["btn", ["btn-sm", ["is-active"]]]
|
|
13
|
+
*
|
|
14
|
+
* Typical usage:
|
|
15
|
+
* ```js
|
|
16
|
+
* cx(
|
|
17
|
+
* "UiButton",
|
|
18
|
+
* isPrimary && "UiButton--primary",
|
|
19
|
+
* isDisabled && "is-disabled",
|
|
20
|
+
* ["btn", "btn-sm"]
|
|
21
|
+
* );
|
|
22
|
+
* // → "UiButton UiButton--primary btn btn-sm"
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* Partial / reusable usage:
|
|
26
|
+
* You can predefine commonly used class combinations and reuse them
|
|
27
|
+
* across components (layout slots, bootstrap adapters, etc.).
|
|
28
|
+
*
|
|
29
|
+
* ```js
|
|
30
|
+
* // prepare partials
|
|
31
|
+
* const bsCard = (...extra) => cx("card", "shadow-sm", extra);
|
|
32
|
+
* const leftColumn = (...extra) => cx("LargeCard__left", "col-12", "col-lg-4", extra);
|
|
33
|
+
*
|
|
34
|
+
* // use partials
|
|
35
|
+
* <div className={bsCard("LargeCard")}>
|
|
36
|
+
* <div className={leftColumn("is-collapsed")}>
|
|
37
|
+
* ...
|
|
38
|
+
* </div>
|
|
39
|
+
* </div>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* This pattern helps:
|
|
43
|
+
* - centralize layout / framework mappings (e.g. Bootstrap → custom CSS),
|
|
44
|
+
* - keep JSX readable,
|
|
45
|
+
* - make future theme or framework replacement easier.
|
|
46
|
+
*
|
|
47
|
+
* Notes:
|
|
48
|
+
* - The order of arguments does NOT affect CSS priority; it only affects
|
|
49
|
+
* the order of class names in the resulting string.
|
|
50
|
+
* - All falsy values are removed via `Boolean` filtering.
|
|
51
|
+
* - `flat(Infinity)` ensures arbitrarily nested arrays are supported.
|
|
52
|
+
*
|
|
53
|
+
* @param {...(string | false | null | undefined | Array<any>)} parts
|
|
54
|
+
* Class name fragments to be combined.
|
|
55
|
+
*
|
|
56
|
+
* @returns {string}
|
|
57
|
+
* A single space-separated `className` string.
|
|
58
|
+
*/
|
|
59
|
+
export function cx(...parts) {
|
|
60
|
+
return parts.flat(Infinity).filter(Boolean).join(" ");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Bootstrap class registry (theme adapter).
|
|
65
|
+
* Use these helpers with `cx(...)` to keep JSX readable and make it easy
|
|
66
|
+
* to swap Bootstrap for another styling system later.
|
|
67
|
+
*
|
|
68
|
+
* Usage:
|
|
69
|
+
* <div className={bs.card.root("LargeCard")} />
|
|
70
|
+
* <div className={bs.grid.row({ g: 3, align: "center" })} />
|
|
71
|
+
* <button className={bs.button({ variant: "primary", size: "sm" })}>OK</button>
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
export const bs = {
|
|
75
|
+
// ---- Layout / grid --------------------------------------------------------
|
|
76
|
+
grid: {
|
|
77
|
+
container: (...extra) => cx("container", extra),
|
|
78
|
+
containerFluid: (...extra) => cx("container-fluid", extra),
|
|
79
|
+
|
|
80
|
+
row: (opts = {}, ...extra) => {
|
|
81
|
+
const {
|
|
82
|
+
g, // number: 0..5
|
|
83
|
+
gx,
|
|
84
|
+
gy,
|
|
85
|
+
align, // "start" | "center" | "end"
|
|
86
|
+
justify, // "start" | "center" | "end" | "between" | "around" | "evenly"
|
|
87
|
+
} = opts || {};
|
|
88
|
+
return cx(
|
|
89
|
+
"row",
|
|
90
|
+
g != null && `g-${g}`,
|
|
91
|
+
gx != null && `gx-${gx}`,
|
|
92
|
+
gy != null && `gy-${gy}`,
|
|
93
|
+
align && `align-items-${align}`,
|
|
94
|
+
justify && `justify-content-${justify}`,
|
|
95
|
+
extra
|
|
96
|
+
);
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
col: (spans = {}, ...extra) => {
|
|
100
|
+
// spans: { xs, sm, md, lg, xl, xxl } each can be:
|
|
101
|
+
// - number 1..12
|
|
102
|
+
// - "auto"
|
|
103
|
+
// - true (meaning just "col-{bp}")
|
|
104
|
+
const bp = ["", "sm", "md", "lg", "xl", "xxl"];
|
|
105
|
+
const parts = [];
|
|
106
|
+
|
|
107
|
+
for (const k of bp) {
|
|
108
|
+
const key = k === "" ? "xs" : k;
|
|
109
|
+
const v = spans?.[key];
|
|
110
|
+
if (v == null) continue;
|
|
111
|
+
|
|
112
|
+
const prefix = k === "" ? "col" : `col-${k}`;
|
|
113
|
+
if (v === true) parts.push(prefix);
|
|
114
|
+
else parts.push(`${prefix}-${v}`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// default fallback if nothing provided
|
|
118
|
+
if (parts.length === 0) parts.push("col");
|
|
119
|
+
|
|
120
|
+
return cx(parts, extra);
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
// ---- Card -----------------------------------------------------------------
|
|
125
|
+
card: {
|
|
126
|
+
root: (...extra) => cx("card", extra),
|
|
127
|
+
header: (...extra) => cx("card-header", extra),
|
|
128
|
+
body: (...extra) => cx("card-body", extra),
|
|
129
|
+
footer: (...extra) => cx("card-footer", extra),
|
|
130
|
+
title: (...extra) => cx("card-title", extra),
|
|
131
|
+
subtitle: (...extra) => cx("card-subtitle", "mb-2", "text-muted", extra),
|
|
132
|
+
text: (...extra) => cx("card-text", extra),
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
// ---- Buttons --------------------------------------------------------------
|
|
136
|
+
button: (opts = {}, ...extra) => {
|
|
137
|
+
const {
|
|
138
|
+
variant = "secondary", // "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "link"
|
|
139
|
+
outline = false,
|
|
140
|
+
size, // "sm" | "lg"
|
|
141
|
+
active,
|
|
142
|
+
disabled,
|
|
143
|
+
} = opts || {};
|
|
144
|
+
|
|
145
|
+
const v = outline ? `btn-outline-${variant}` : `btn-${variant}`;
|
|
146
|
+
return cx(
|
|
147
|
+
"btn",
|
|
148
|
+
v,
|
|
149
|
+
size && `btn-${size}`,
|
|
150
|
+
active && "active",
|
|
151
|
+
disabled && "disabled",
|
|
152
|
+
extra
|
|
153
|
+
);
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
// ---- Table ----------------------------------------------------------------
|
|
157
|
+
table: (opts = {}, ...extra) => {
|
|
158
|
+
const {
|
|
159
|
+
striped,
|
|
160
|
+
bordered,
|
|
161
|
+
hover,
|
|
162
|
+
small,
|
|
163
|
+
responsive, // boolean or breakpoint: "sm"|"md"|"lg"|"xl"|"xxl"
|
|
164
|
+
variant, // "light" | "dark"
|
|
165
|
+
align, // "top" | "middle" | "bottom"
|
|
166
|
+
} = opts || {};
|
|
167
|
+
|
|
168
|
+
const tableClass = cx(
|
|
169
|
+
"table",
|
|
170
|
+
striped && "table-striped",
|
|
171
|
+
bordered && "table-bordered",
|
|
172
|
+
hover && "table-hover",
|
|
173
|
+
small && "table-sm",
|
|
174
|
+
variant && `table-${variant}`,
|
|
175
|
+
align && `align-${align}`,
|
|
176
|
+
extra
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
const wrapperClass =
|
|
180
|
+
responsive === true
|
|
181
|
+
? "table-responsive"
|
|
182
|
+
: typeof responsive === "string"
|
|
183
|
+
? `table-responsive-${responsive}`
|
|
184
|
+
: null;
|
|
185
|
+
|
|
186
|
+
return { tableClass, wrapperClass };
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
// ---- Forms ----------------------------------------------------------------
|
|
190
|
+
form: {
|
|
191
|
+
control: (opts = {}, ...extra) => {
|
|
192
|
+
const { size, plaintext, isValid, isInvalid } = opts || {};
|
|
193
|
+
return cx(
|
|
194
|
+
plaintext ? "form-control-plaintext" : "form-control",
|
|
195
|
+
size && `form-control-${size}`,
|
|
196
|
+
isValid && "is-valid",
|
|
197
|
+
isInvalid && "is-invalid",
|
|
198
|
+
extra
|
|
199
|
+
);
|
|
200
|
+
},
|
|
201
|
+
select: (opts = {}, ...extra) => {
|
|
202
|
+
const { size, isValid, isInvalid } = opts || {};
|
|
203
|
+
return cx(
|
|
204
|
+
"form-select",
|
|
205
|
+
size && `form-select-${size}`,
|
|
206
|
+
isValid && "is-valid",
|
|
207
|
+
isInvalid && "is-invalid",
|
|
208
|
+
extra
|
|
209
|
+
);
|
|
210
|
+
},
|
|
211
|
+
label: (...extra) => cx("form-label", extra),
|
|
212
|
+
check: {
|
|
213
|
+
wrapper: (...extra) => cx("form-check", extra),
|
|
214
|
+
input: (...extra) => cx("form-check-input", extra),
|
|
215
|
+
label: (...extra) => cx("form-check-label", extra),
|
|
216
|
+
},
|
|
217
|
+
inputGroup: {
|
|
218
|
+
wrapper: (...extra) => cx("input-group", extra),
|
|
219
|
+
text: (...extra) => cx("input-group-text", extra),
|
|
220
|
+
},
|
|
221
|
+
help: (...extra) => cx("form-text", extra),
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
// ---- Alerts / badges ------------------------------------------------------
|
|
225
|
+
alert: (variant = "info", ...extra) => cx("alert", `alert-${variant}`, extra),
|
|
226
|
+
badge: (opts = {}, ...extra) => {
|
|
227
|
+
const { variant = "secondary", pill = false } = opts || {};
|
|
228
|
+
return cx("badge", `text-bg-${variant}`, pill && "rounded-pill", extra);
|
|
229
|
+
},
|
|
230
|
+
|
|
231
|
+
// ---- Utilities (common) ---------------------------------------------------
|
|
232
|
+
util: {
|
|
233
|
+
d: (v, ...extra) => cx(v && `d-${v}`, extra), // e.g. "flex", "block"
|
|
234
|
+
flex: (opts = {}, ...extra) => {
|
|
235
|
+
const { dir, wrap, grow, shrink, align, justify } = opts || {};
|
|
236
|
+
return cx(
|
|
237
|
+
"d-flex",
|
|
238
|
+
dir && `flex-${dir}`,
|
|
239
|
+
wrap && `flex-${wrap}`,
|
|
240
|
+
grow != null && `flex-grow-${grow}`,
|
|
241
|
+
shrink != null && `flex-shrink-${shrink}`,
|
|
242
|
+
align && `align-items-${align}`,
|
|
243
|
+
justify && `justify-content-${justify}`,
|
|
244
|
+
extra
|
|
245
|
+
);
|
|
246
|
+
},
|
|
247
|
+
gap: (n, ...extra) => cx(n != null && `gap-${n}`, extra),
|
|
248
|
+
text: (opts = {}, ...extra) => {
|
|
249
|
+
const { align, muted, nowrap, truncate, wrap } = opts || {};
|
|
250
|
+
return cx(
|
|
251
|
+
align && `text-${align}`,
|
|
252
|
+
muted && "text-muted",
|
|
253
|
+
nowrap && "text-nowrap",
|
|
254
|
+
truncate && "text-truncate",
|
|
255
|
+
wrap === false && "text-nowrap",
|
|
256
|
+
extra
|
|
257
|
+
);
|
|
258
|
+
},
|
|
259
|
+
w: (v, ...extra) => cx(v && `w-${v}`, extra), // e.g. 100 => "w-100"
|
|
260
|
+
h: (v, ...extra) => cx(v && `h-${v}`, extra),
|
|
261
|
+
m: (side, n, ...extra) => cx(`m${side ?? ""}-${n}`, extra), // side: "", "t","b","s","e","x","y"
|
|
262
|
+
p: (side, n, ...extra) => cx(`p${side ?? ""}-${n}`, extra),
|
|
263
|
+
border: (opts = {}, ...extra) => {
|
|
264
|
+
const { top, end, bottom, start, color, rounded } = opts || {};
|
|
265
|
+
return cx(
|
|
266
|
+
top && "border-top",
|
|
267
|
+
end && "border-end",
|
|
268
|
+
bottom && "border-bottom",
|
|
269
|
+
start && "border-start",
|
|
270
|
+
color && `border-${color}`,
|
|
271
|
+
rounded && (rounded === true ? "rounded" : `rounded-${rounded}`),
|
|
272
|
+
extra
|
|
273
|
+
);
|
|
274
|
+
},
|
|
275
|
+
bg: (variant, ...extra) => cx(variant && `bg-${variant}`, extra),
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
export const Collapsible = ({
|
|
4
|
+
collapsed = true,
|
|
5
|
+
children,
|
|
6
|
+
buttonLabel,
|
|
7
|
+
buttonLabelCollapsed = "Zobrazit",
|
|
8
|
+
buttonLabelExpanded = "Skrýt",
|
|
9
|
+
onToggle,
|
|
10
|
+
...buttonProps
|
|
11
|
+
}) => {
|
|
12
|
+
const [isCollapsed, setIsCollapsed] = useState(collapsed);
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
setIsCollapsed(collapsed);
|
|
16
|
+
}, [collapsed]);
|
|
17
|
+
|
|
18
|
+
const toggle = useCallback(() => {
|
|
19
|
+
setIsCollapsed(prev => {
|
|
20
|
+
const next = !prev;
|
|
21
|
+
onToggle?.(next);
|
|
22
|
+
return next;
|
|
23
|
+
});
|
|
24
|
+
}, [onToggle]);
|
|
25
|
+
|
|
26
|
+
const label =
|
|
27
|
+
buttonLabel ?? (isCollapsed ? buttonLabelCollapsed : buttonLabelExpanded);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
{/* children zůstávají namountované => jejich state se neztratí */}
|
|
32
|
+
<div hidden={isCollapsed} aria-hidden={isCollapsed}>
|
|
33
|
+
{children}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<button
|
|
37
|
+
type="button"
|
|
38
|
+
{...buttonProps}
|
|
39
|
+
onClick={toggle}
|
|
40
|
+
aria-expanded={!isCollapsed}
|
|
41
|
+
>
|
|
42
|
+
{label}
|
|
43
|
+
</button>
|
|
44
|
+
</>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import Button from "react-bootstrap/Button"
|
|
2
|
+
import Modal from 'react-bootstrap/Modal';
|
|
3
|
+
import Row from "react-bootstrap/Row"
|
|
4
|
+
import Col from "react-bootstrap/Col"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A customizable dialog component with a title, content, and action buttons.
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} props - The properties for the Dialog component.
|
|
10
|
+
* @param {React.ReactNode} props.children - The content to display inside the dialog.
|
|
11
|
+
* @param {string} [props.title="Dialog"] - The title of the dialog.
|
|
12
|
+
* @param {string} [props.oklabel="Ok"] - The label for the confirmation button.
|
|
13
|
+
* @param {string} [props.cancellabel="Zrušit"] - The label for the cancel button.
|
|
14
|
+
* @param {function} props.onOk - Callback for when the confirmation button is clicked.
|
|
15
|
+
* @param {function} props.onCancel - Callback for when the cancel button or close button is clicked.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <Dialog
|
|
19
|
+
* title="Confirm Delete"
|
|
20
|
+
* oklabel="Delete"
|
|
21
|
+
* cancellabel="Cancel"
|
|
22
|
+
* onOk={handleConfirm}
|
|
23
|
+
* onCancel={handleCancel}
|
|
24
|
+
* >
|
|
25
|
+
* Are you sure you want to delete this item?
|
|
26
|
+
* </Dialog>
|
|
27
|
+
*
|
|
28
|
+
* @returns {JSX.Element} A styled modal dialog.
|
|
29
|
+
*/
|
|
30
|
+
export const Dialog = ({
|
|
31
|
+
children,
|
|
32
|
+
title = "Dialog",
|
|
33
|
+
oklabel = "Ok",
|
|
34
|
+
cancellabel = "Zrušit",
|
|
35
|
+
onOk,
|
|
36
|
+
onCancel,
|
|
37
|
+
}) => {
|
|
38
|
+
const handleFinish = () => {
|
|
39
|
+
if (onOk) onOk();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const handleCancel = () => {
|
|
43
|
+
if (onCancel) onCancel();
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<Modal
|
|
48
|
+
size="xl"
|
|
49
|
+
show={true}
|
|
50
|
+
onHide={handleCancel}
|
|
51
|
+
backdrop="static" // Prevent closing on outside click
|
|
52
|
+
>
|
|
53
|
+
<Modal.Header closeButton>
|
|
54
|
+
<Modal.Title>{title}</Modal.Title>
|
|
55
|
+
</Modal.Header>
|
|
56
|
+
<Modal.Body>{children}</Modal.Body>
|
|
57
|
+
<Modal.Footer>
|
|
58
|
+
<Row>
|
|
59
|
+
<Col>
|
|
60
|
+
<div className="d-flex justify-content-end">
|
|
61
|
+
<Button variant="outline-success" onClick={handleFinish}>
|
|
62
|
+
{oklabel}
|
|
63
|
+
</Button>
|
|
64
|
+
|
|
65
|
+
<Button variant="outline-danger" onClick={handleCancel}>
|
|
66
|
+
{cancellabel}
|
|
67
|
+
</Button>
|
|
68
|
+
</div>
|
|
69
|
+
</Col>
|
|
70
|
+
</Row>
|
|
71
|
+
</Modal.Footer>
|
|
72
|
+
</Modal>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|