@astral/ui 4.13.0 → 4.14.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/components/CardGridInfinite/Card/Card.d.ts +3 -0
- package/components/CardGridInfinite/Card/Card.js +12 -0
- package/components/CardGridInfinite/Card/CardActionContext/CardActionContext.d.ts +10 -0
- package/components/CardGridInfinite/Card/CardActionContext/CardActionContext.js +8 -0
- package/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/CardActionContextProvider.d.ts +9 -0
- package/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/CardActionContextProvider.js +26 -0
- package/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/index.d.ts +1 -0
- package/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/index.js +1 -0
- package/components/CardGridInfinite/Card/CardActionContext/index.d.ts +2 -0
- package/components/CardGridInfinite/Card/CardActionContext/index.js +2 -0
- package/components/CardGridInfinite/Card/SecondaryActionButton/SecondaryActionButton.d.ts +7 -0
- package/components/CardGridInfinite/Card/SecondaryActionButton/SecondaryActionButton.js +21 -0
- package/components/CardGridInfinite/Card/SecondaryActionButton/index.d.ts +1 -0
- package/components/CardGridInfinite/Card/SecondaryActionButton/index.js +1 -0
- package/components/CardGridInfinite/Card/SecondaryActionButton/styles.d.ts +12 -0
- package/components/CardGridInfinite/Card/SecondaryActionButton/styles.js +5 -0
- package/components/CardGridInfinite/Card/index.d.ts +3 -0
- package/components/CardGridInfinite/Card/index.js +2 -0
- package/components/CardGridInfinite/Card/styles.d.ts +16 -0
- package/components/CardGridInfinite/Card/styles.js +22 -0
- package/components/CardGridInfinite/Card/types.d.ts +32 -0
- package/components/CardGridInfinite/Card/types.js +1 -0
- package/components/CardGridInfinite/Card/useLogic/index.d.ts +1 -0
- package/components/CardGridInfinite/Card/useLogic/index.js +1 -0
- package/components/CardGridInfinite/Card/useLogic/useLogic.d.ts +7 -0
- package/components/CardGridInfinite/Card/useLogic/useLogic.js +7 -0
- package/components/CardGridInfinite/CardGridInfinite.d.ts +3 -0
- package/components/CardGridInfinite/CardGridInfinite.js +21 -0
- package/components/CardGridInfinite/CardGridMainActions/Action/Action.d.ts +3 -0
- package/components/CardGridInfinite/CardGridMainActions/Action/Action.js +16 -0
- package/components/CardGridInfinite/CardGridMainActions/Action/index.d.ts +1 -0
- package/components/CardGridInfinite/CardGridMainActions/Action/index.js +1 -0
- package/components/CardGridInfinite/CardGridMainActions/Action/types.d.ts +13 -0
- package/components/CardGridInfinite/CardGridMainActions/Action/types.js +1 -0
- package/components/CardGridInfinite/CardGridMainActions/Action/useLogic/index.d.ts +1 -0
- package/components/CardGridInfinite/CardGridMainActions/Action/useLogic/index.js +1 -0
- package/components/CardGridInfinite/CardGridMainActions/Action/useLogic/useLogic.d.ts +11 -0
- package/components/CardGridInfinite/CardGridMainActions/Action/useLogic/useLogic.js +16 -0
- package/components/CardGridInfinite/CardGridMainActions/CardGridMainActions.d.ts +30 -0
- package/components/CardGridInfinite/CardGridMainActions/CardGridMainActions.js +29 -0
- package/components/CardGridInfinite/CardGridMainActions/index.d.ts +4 -0
- package/components/CardGridInfinite/CardGridMainActions/index.js +4 -0
- package/components/CardGridInfinite/CardGridMainActions/styles.d.ts +5 -0
- package/components/CardGridInfinite/CardGridMainActions/styles.js +9 -0
- package/components/CardGridInfinite/CardGridMainActions/types.d.ts +44 -0
- package/components/CardGridInfinite/CardGridMainActions/types.js +1 -0
- package/components/CardGridInfinite/CardGridMainActions/utils/index.d.ts +1 -0
- package/components/CardGridInfinite/CardGridMainActions/utils/index.js +1 -0
- package/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/index.d.ts +1 -0
- package/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/index.js +1 -0
- package/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/replaceActionComponent.d.ts +8 -0
- package/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/replaceActionComponent.js +11 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActions.d.ts +18 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActions.js +34 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/CardGridSecondaryActionsSkeleton.d.ts +2 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/CardGridSecondaryActionsSkeleton.js +4 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/index.d.ts +1 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/index.js +1 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/styles.d.ts +9 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/styles.js +31 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuContext.d.ts +12 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuContext.js +5 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/SecondaryActionsMenuProvider.d.ts +8 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/SecondaryActionsMenuProvider.js +5 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/index.d.ts +1 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/index.js +1 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/index.d.ts +2 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/index.js +2 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/index.d.ts +4 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/index.js +3 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/types.d.ts +59 -0
- package/components/CardGridInfinite/CardGridSecondaryAction/types.js +1 -0
- package/components/CardGridInfinite/EndData/EndData.d.ts +6 -0
- package/components/CardGridInfinite/EndData/EndData.js +4 -0
- package/components/CardGridInfinite/EndData/constants.d.ts +1 -0
- package/components/CardGridInfinite/EndData/constants.js +1 -0
- package/components/CardGridInfinite/EndData/index.d.ts +1 -0
- package/components/CardGridInfinite/EndData/index.js +1 -0
- package/components/CardGridInfinite/ErrorMessage/ErrorMessage.d.ts +6 -0
- package/components/CardGridInfinite/ErrorMessage/ErrorMessage.js +6 -0
- package/components/CardGridInfinite/ErrorMessage/constants.d.ts +1 -0
- package/components/CardGridInfinite/ErrorMessage/constants.js +1 -0
- package/components/CardGridInfinite/ErrorMessage/index.d.ts +1 -0
- package/components/CardGridInfinite/ErrorMessage/index.js +1 -0
- package/components/CardGridInfinite/ErrorMessage/styles.d.ts +5 -0
- package/components/CardGridInfinite/ErrorMessage/styles.js +17 -0
- package/components/CardGridInfinite/Footer/Footer.d.ts +10 -0
- package/components/CardGridInfinite/Footer/Footer.js +12 -0
- package/components/CardGridInfinite/Footer/index.d.ts +1 -0
- package/components/CardGridInfinite/Footer/index.js +1 -0
- package/components/CardGridInfinite/Footer/styles.d.ts +9 -0
- package/components/CardGridInfinite/Footer/styles.js +16 -0
- package/components/CardGridInfinite/List/List.d.ts +8 -0
- package/components/CardGridInfinite/List/List.js +4 -0
- package/components/CardGridInfinite/List/index.d.ts +1 -0
- package/components/CardGridInfinite/List/index.js +1 -0
- package/components/CardGridInfinite/List/styles.d.ts +10 -0
- package/components/CardGridInfinite/List/styles.js +10 -0
- package/components/CardGridInfinite/NoDataPlaceholder/NoDataPlaceholder.d.ts +6 -0
- package/components/CardGridInfinite/NoDataPlaceholder/NoDataPlaceholder.js +10 -0
- package/components/CardGridInfinite/NoDataPlaceholder/constants.d.ts +1 -0
- package/components/CardGridInfinite/NoDataPlaceholder/constants.js +1 -0
- package/components/CardGridInfinite/NoDataPlaceholder/index.d.ts +1 -0
- package/components/CardGridInfinite/NoDataPlaceholder/index.js +1 -0
- package/components/CardGridInfinite/OnTopButton/OnTopButton.d.ts +8 -0
- package/components/CardGridInfinite/OnTopButton/OnTopButton.js +10 -0
- package/components/CardGridInfinite/OnTopButton/index.d.ts +1 -0
- package/components/CardGridInfinite/OnTopButton/index.js +1 -0
- package/components/CardGridInfinite/OnTopButton/styles.d.ts +3 -0
- package/components/CardGridInfinite/OnTopButton/styles.js +9 -0
- package/components/CardGridInfinite/SkeletonGrid/SkeletonGrid.d.ts +11 -0
- package/components/CardGridInfinite/SkeletonGrid/SkeletonGrid.js +5 -0
- package/components/CardGridInfinite/SkeletonGrid/index.d.ts +1 -0
- package/components/CardGridInfinite/SkeletonGrid/index.js +1 -0
- package/components/CardGridInfinite/SkeletonGrid/styles.d.ts +12 -0
- package/components/CardGridInfinite/SkeletonGrid/styles.js +5 -0
- package/components/CardGridInfinite/constants.d.ts +7 -0
- package/components/CardGridInfinite/constants.js +8 -0
- package/components/CardGridInfinite/hooks/index.d.ts +1 -0
- package/components/CardGridInfinite/hooks/index.js +1 -0
- package/components/CardGridInfinite/hooks/useBlockingActions/index.d.ts +1 -0
- package/components/CardGridInfinite/hooks/useBlockingActions/index.js +1 -0
- package/components/CardGridInfinite/hooks/useBlockingActions/useBlockingActions.d.ts +9 -0
- package/components/CardGridInfinite/hooks/useBlockingActions/useBlockingActions.js +23 -0
- package/components/CardGridInfinite/index.d.ts +8 -0
- package/components/CardGridInfinite/index.js +4 -0
- package/components/CardGridInfinite/styles.d.ts +13 -0
- package/components/CardGridInfinite/styles.js +26 -0
- package/components/CardGridInfinite/types.d.ts +98 -0
- package/components/CardGridInfinite/types.js +1 -0
- package/components/CardGridInfinite/useLogic/index.d.ts +1 -0
- package/components/CardGridInfinite/useLogic/index.js +1 -0
- package/components/CardGridInfinite/useLogic/useLogic.d.ts +41 -0
- package/components/CardGridInfinite/useLogic/useLogic.js +73 -0
- package/components/DashboardLayout/Sidebar/styles.d.ts +1 -4
- package/components/DatePicker/styles.d.ts +1 -4
- package/components/DateRangePicker/styles.d.ts +1 -4
- package/components/Description/styles.js +1 -1
- package/components/InfiniteTreeList/useLogic/useLogic.js +2 -2
- package/components/PageLayout/PageContent/styles.js +5 -2
- package/components/PageLayout/PageLayoutContainer/index.d.ts +1 -0
- package/components/PageLayout/PageLayoutContainer/index.js +1 -0
- package/components/PageLayout/PageLayoutContainer/styles.d.ts +1 -4
- package/components/Paper/Paper.d.ts +1 -1
- package/components/Paper/Paper.js +4 -3
- package/components/Tag/styles.js +2 -0
- package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/useScrollManagement.d.ts +2 -1
- package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/useScrollManagement.js +13 -3
- package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/useStickyButton.js +2 -2
- package/components/hooks/index.d.ts +1 -0
- package/components/hooks/index.js +1 -0
- package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +4 -3
- package/components/placeholders/LoadingPlaceholder/constants.d.ts +3 -0
- package/components/placeholders/LoadingPlaceholder/constants.js +4 -0
- package/components/placeholders/LoadingPlaceholder/index.d.ts +1 -0
- package/components/placeholders/LoadingPlaceholder/index.js +1 -0
- package/node/components/CardGridInfinite/Card/Card.d.ts +3 -0
- package/node/components/CardGridInfinite/Card/Card.js +16 -0
- package/node/components/CardGridInfinite/Card/CardActionContext/CardActionContext.d.ts +10 -0
- package/node/components/CardGridInfinite/Card/CardActionContext/CardActionContext.js +11 -0
- package/node/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/CardActionContextProvider.d.ts +9 -0
- package/node/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/CardActionContextProvider.js +30 -0
- package/node/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/index.d.ts +1 -0
- package/node/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/index.js +17 -0
- package/node/components/CardGridInfinite/Card/CardActionContext/index.d.ts +2 -0
- package/node/components/CardGridInfinite/Card/CardActionContext/index.js +18 -0
- package/node/components/CardGridInfinite/Card/SecondaryActionButton/SecondaryActionButton.d.ts +7 -0
- package/node/components/CardGridInfinite/Card/SecondaryActionButton/SecondaryActionButton.js +25 -0
- package/node/components/CardGridInfinite/Card/SecondaryActionButton/index.d.ts +1 -0
- package/node/components/CardGridInfinite/Card/SecondaryActionButton/index.js +17 -0
- package/node/components/CardGridInfinite/Card/SecondaryActionButton/styles.d.ts +12 -0
- package/node/components/CardGridInfinite/Card/SecondaryActionButton/styles.js +8 -0
- package/node/components/CardGridInfinite/Card/index.d.ts +3 -0
- package/node/components/CardGridInfinite/Card/index.js +18 -0
- package/node/components/CardGridInfinite/Card/styles.d.ts +16 -0
- package/node/components/CardGridInfinite/Card/styles.js +25 -0
- package/node/components/CardGridInfinite/Card/types.d.ts +32 -0
- package/node/components/CardGridInfinite/Card/types.js +2 -0
- package/node/components/CardGridInfinite/Card/useLogic/index.d.ts +1 -0
- package/node/components/CardGridInfinite/Card/useLogic/index.js +17 -0
- package/node/components/CardGridInfinite/Card/useLogic/useLogic.d.ts +7 -0
- package/node/components/CardGridInfinite/Card/useLogic/useLogic.js +11 -0
- package/node/components/CardGridInfinite/CardGridInfinite.d.ts +3 -0
- package/node/components/CardGridInfinite/CardGridInfinite.js +25 -0
- package/node/components/CardGridInfinite/CardGridMainActions/Action/Action.d.ts +3 -0
- package/node/components/CardGridInfinite/CardGridMainActions/Action/Action.js +20 -0
- package/node/components/CardGridInfinite/CardGridMainActions/Action/index.d.ts +1 -0
- package/node/components/CardGridInfinite/CardGridMainActions/Action/index.js +17 -0
- package/node/components/CardGridInfinite/CardGridMainActions/Action/types.d.ts +13 -0
- package/node/components/CardGridInfinite/CardGridMainActions/Action/types.js +2 -0
- package/node/components/CardGridInfinite/CardGridMainActions/Action/useLogic/index.d.ts +1 -0
- package/node/components/CardGridInfinite/CardGridMainActions/Action/useLogic/index.js +17 -0
- package/node/components/CardGridInfinite/CardGridMainActions/Action/useLogic/useLogic.d.ts +11 -0
- package/node/components/CardGridInfinite/CardGridMainActions/Action/useLogic/useLogic.js +20 -0
- package/node/components/CardGridInfinite/CardGridMainActions/CardGridMainActions.d.ts +30 -0
- package/node/components/CardGridInfinite/CardGridMainActions/CardGridMainActions.js +33 -0
- package/node/components/CardGridInfinite/CardGridMainActions/index.d.ts +4 -0
- package/node/components/CardGridInfinite/CardGridMainActions/index.js +22 -0
- package/node/components/CardGridInfinite/CardGridMainActions/styles.d.ts +5 -0
- package/node/components/CardGridInfinite/CardGridMainActions/styles.js +12 -0
- package/node/components/CardGridInfinite/CardGridMainActions/types.d.ts +44 -0
- package/node/components/CardGridInfinite/CardGridMainActions/types.js +2 -0
- package/node/components/CardGridInfinite/CardGridMainActions/utils/index.d.ts +1 -0
- package/node/components/CardGridInfinite/CardGridMainActions/utils/index.js +17 -0
- package/node/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/index.d.ts +1 -0
- package/node/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/index.js +17 -0
- package/node/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/replaceActionComponent.d.ts +8 -0
- package/node/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/replaceActionComponent.js +15 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActions.d.ts +18 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActions.js +38 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/CardGridSecondaryActionsSkeleton.d.ts +2 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/CardGridSecondaryActionsSkeleton.js +8 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/index.d.ts +1 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/index.js +17 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/styles.d.ts +9 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/styles.js +34 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuContext.d.ts +12 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuContext.js +8 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/SecondaryActionsMenuProvider.d.ts +8 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/SecondaryActionsMenuProvider.js +9 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/index.d.ts +1 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/index.js +5 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/index.d.ts +2 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/index.js +18 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/index.d.ts +4 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/index.js +22 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/types.d.ts +59 -0
- package/node/components/CardGridInfinite/CardGridSecondaryAction/types.js +2 -0
- package/node/components/CardGridInfinite/EndData/EndData.d.ts +6 -0
- package/node/components/CardGridInfinite/EndData/EndData.js +8 -0
- package/node/components/CardGridInfinite/EndData/constants.d.ts +1 -0
- package/node/components/CardGridInfinite/EndData/constants.js +4 -0
- package/node/components/CardGridInfinite/EndData/index.d.ts +1 -0
- package/node/components/CardGridInfinite/EndData/index.js +17 -0
- package/node/components/CardGridInfinite/ErrorMessage/ErrorMessage.d.ts +6 -0
- package/node/components/CardGridInfinite/ErrorMessage/ErrorMessage.js +10 -0
- package/node/components/CardGridInfinite/ErrorMessage/constants.d.ts +1 -0
- package/node/components/CardGridInfinite/ErrorMessage/constants.js +4 -0
- package/node/components/CardGridInfinite/ErrorMessage/index.d.ts +1 -0
- package/node/components/CardGridInfinite/ErrorMessage/index.js +17 -0
- package/node/components/CardGridInfinite/ErrorMessage/styles.d.ts +5 -0
- package/node/components/CardGridInfinite/ErrorMessage/styles.js +20 -0
- package/node/components/CardGridInfinite/Footer/Footer.d.ts +10 -0
- package/node/components/CardGridInfinite/Footer/Footer.js +16 -0
- package/node/components/CardGridInfinite/Footer/index.d.ts +1 -0
- package/node/components/CardGridInfinite/Footer/index.js +17 -0
- package/node/components/CardGridInfinite/Footer/styles.d.ts +9 -0
- package/node/components/CardGridInfinite/Footer/styles.js +19 -0
- package/node/components/CardGridInfinite/List/List.d.ts +8 -0
- package/node/components/CardGridInfinite/List/List.js +7 -0
- package/node/components/CardGridInfinite/List/index.d.ts +1 -0
- package/node/components/CardGridInfinite/List/index.js +17 -0
- package/node/components/CardGridInfinite/List/styles.d.ts +10 -0
- package/node/components/CardGridInfinite/List/styles.js +13 -0
- package/node/components/CardGridInfinite/NoDataPlaceholder/NoDataPlaceholder.d.ts +6 -0
- package/node/components/CardGridInfinite/NoDataPlaceholder/NoDataPlaceholder.js +14 -0
- package/node/components/CardGridInfinite/NoDataPlaceholder/constants.d.ts +1 -0
- package/node/components/CardGridInfinite/NoDataPlaceholder/constants.js +4 -0
- package/node/components/CardGridInfinite/NoDataPlaceholder/index.d.ts +1 -0
- package/node/components/CardGridInfinite/NoDataPlaceholder/index.js +17 -0
- package/node/components/CardGridInfinite/OnTopButton/OnTopButton.d.ts +8 -0
- package/node/components/CardGridInfinite/OnTopButton/OnTopButton.js +14 -0
- package/node/components/CardGridInfinite/OnTopButton/index.d.ts +1 -0
- package/node/components/CardGridInfinite/OnTopButton/index.js +17 -0
- package/node/components/CardGridInfinite/OnTopButton/styles.d.ts +3 -0
- package/node/components/CardGridInfinite/OnTopButton/styles.js +12 -0
- package/node/components/CardGridInfinite/SkeletonGrid/SkeletonGrid.d.ts +11 -0
- package/node/components/CardGridInfinite/SkeletonGrid/SkeletonGrid.js +9 -0
- package/node/components/CardGridInfinite/SkeletonGrid/index.d.ts +1 -0
- package/node/components/CardGridInfinite/SkeletonGrid/index.js +5 -0
- package/node/components/CardGridInfinite/SkeletonGrid/styles.d.ts +12 -0
- package/node/components/CardGridInfinite/SkeletonGrid/styles.js +8 -0
- package/node/components/CardGridInfinite/constants.d.ts +7 -0
- package/node/components/CardGridInfinite/constants.js +11 -0
- package/node/components/CardGridInfinite/hooks/index.d.ts +1 -0
- package/node/components/CardGridInfinite/hooks/index.js +17 -0
- package/node/components/CardGridInfinite/hooks/useBlockingActions/index.d.ts +1 -0
- package/node/components/CardGridInfinite/hooks/useBlockingActions/index.js +17 -0
- package/node/components/CardGridInfinite/hooks/useBlockingActions/useBlockingActions.d.ts +9 -0
- package/node/components/CardGridInfinite/hooks/useBlockingActions/useBlockingActions.js +27 -0
- package/node/components/CardGridInfinite/index.d.ts +8 -0
- package/node/components/CardGridInfinite/index.js +13 -0
- package/node/components/CardGridInfinite/styles.d.ts +13 -0
- package/node/components/CardGridInfinite/styles.js +29 -0
- package/node/components/CardGridInfinite/types.d.ts +98 -0
- package/node/components/CardGridInfinite/types.js +2 -0
- package/node/components/CardGridInfinite/useLogic/index.d.ts +1 -0
- package/node/components/CardGridInfinite/useLogic/index.js +17 -0
- package/node/components/CardGridInfinite/useLogic/useLogic.d.ts +41 -0
- package/node/components/CardGridInfinite/useLogic/useLogic.js +77 -0
- package/node/components/DashboardLayout/Sidebar/styles.d.ts +1 -4
- package/node/components/DatePicker/styles.d.ts +1 -4
- package/node/components/DateRangePicker/styles.d.ts +1 -4
- package/node/components/Description/styles.js +1 -1
- package/node/components/InfiniteTreeList/useLogic/useLogic.js +3 -3
- package/node/components/PageLayout/PageContent/styles.js +5 -2
- package/node/components/PageLayout/PageLayoutContainer/index.d.ts +1 -0
- package/node/components/PageLayout/PageLayoutContainer/index.js +3 -0
- package/node/components/PageLayout/PageLayoutContainer/styles.d.ts +1 -4
- package/node/components/Paper/Paper.d.ts +1 -1
- package/node/components/Paper/Paper.js +4 -4
- package/node/components/Tag/styles.js +2 -0
- package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/useScrollManagement.d.ts +2 -1
- package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/useScrollManagement.js +13 -3
- package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/useStickyButton.js +3 -3
- package/node/components/hooks/index.d.ts +1 -0
- package/node/components/hooks/index.js +4 -1
- package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +4 -3
- package/node/components/placeholders/LoadingPlaceholder/constants.d.ts +3 -0
- package/node/components/placeholders/LoadingPlaceholder/constants.js +7 -0
- package/node/components/placeholders/LoadingPlaceholder/index.d.ts +1 -0
- package/node/components/placeholders/LoadingPlaceholder/index.js +3 -0
- package/package.json +8 -1
- /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/index.d.ts +0 -0
- /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/index.js +0 -0
- /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/index.d.ts +0 -0
- /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/index.js +0 -0
- /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/index.d.ts +0 -0
- /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/index.js +0 -0
- /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/useStickyButton.d.ts +0 -0
- /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/index.d.ts +0 -0
- /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/index.js +0 -0
- /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/index.d.ts +0 -0
- /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/index.js +0 -0
- /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/index.d.ts +0 -0
- /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/index.js +0 -0
- /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/useStickyButton.d.ts +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Paper } from '../../Paper';
|
|
3
|
+
import { Tooltip } from '../../Tooltip';
|
|
4
|
+
import { CardActionContextProvider } from './CardActionContext';
|
|
5
|
+
import { SecondaryActionButton } from './SecondaryActionButton';
|
|
6
|
+
import { CardHeader, HeaderWrapper, StyledDivider, Wrapper } from './styles';
|
|
7
|
+
import { useLogic } from './useLogic';
|
|
8
|
+
export const Card = (props) => {
|
|
9
|
+
const { handleActionClick } = useLogic(props);
|
|
10
|
+
const { isDisabled, mainActions: MainActions, content, header, disabledReason, secondaryActions, } = props;
|
|
11
|
+
return (_jsx(CardActionContextProvider, { onActionClick: handleActionClick, isDisabledCard: isDisabled, children: _jsx(Tooltip, { title: isDisabled && disabledReason, withoutContainer: !isDisabled, placement: "top", componentsProps: { popper: { disablePortal: true } }, children: _jsx(Paper, { variant: "outlined", inert: isDisabled ? '' : undefined, children: _jsxs(Wrapper, { children: [header && (_jsxs(_Fragment, { children: [_jsxs(CardHeader, { children: [_jsx(HeaderWrapper, { children: header }), secondaryActions && (_jsx(SecondaryActionButton, { renderActions: secondaryActions }))] }), _jsx(StyledDivider, {})] })), content, MainActions && _jsx(MainActions, {})] }) }) }) }));
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CardGridActionHandler } from '../../CardGridMainActions/types';
|
|
3
|
+
export type CardActionContextProps<TAction> = {
|
|
4
|
+
isDisabledCard?: boolean;
|
|
5
|
+
isDisabled: boolean;
|
|
6
|
+
onActionClick: CardGridActionHandler<TAction>;
|
|
7
|
+
setDisabledActions: () => void;
|
|
8
|
+
removeDisabledActions: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const CardActionContext: import("react").Context<CardActionContextProps<unknown>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { CardGridActionHandler } from '../../../CardGridMainActions';
|
|
3
|
+
type CardActionContextProviderProps<TAction> = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
onActionClick: CardGridActionHandler<TAction>;
|
|
6
|
+
isDisabledCard?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const CardActionContextProvider: <TAction>({ children, isDisabledCard, onActionClick, }: CardActionContextProviderProps<TAction>) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
3
|
+
import { CardActionContext } from '../CardActionContext';
|
|
4
|
+
export const CardActionContextProvider = ({ children, isDisabledCard, onActionClick, }) => {
|
|
5
|
+
const [isDisabled, setDisabled] = useState(false);
|
|
6
|
+
const setDisabledActions = useCallback(() => {
|
|
7
|
+
setDisabled(true);
|
|
8
|
+
}, []);
|
|
9
|
+
const removeDisabledActions = useCallback(() => {
|
|
10
|
+
setDisabled(false);
|
|
11
|
+
}, []);
|
|
12
|
+
const contextValue = useMemo(() => ({
|
|
13
|
+
isDisabled,
|
|
14
|
+
isDisabledCard,
|
|
15
|
+
setDisabledActions,
|
|
16
|
+
removeDisabledActions,
|
|
17
|
+
onActionClick,
|
|
18
|
+
}), [
|
|
19
|
+
isDisabled,
|
|
20
|
+
setDisabledActions,
|
|
21
|
+
removeDisabledActions,
|
|
22
|
+
onActionClick,
|
|
23
|
+
isDisabledCard,
|
|
24
|
+
]);
|
|
25
|
+
return (_jsx(CardActionContext.Provider, { value: contextValue, children: children }));
|
|
26
|
+
};
|
package/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CardActionContextProvider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CardActionContextProvider';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type CardGridSecondaryActionsProps } from '../../CardGridSecondaryAction';
|
|
3
|
+
type SecondaryActionButtonProps<TAction> = {
|
|
4
|
+
renderActions: (props: Omit<CardGridSecondaryActionsProps<TAction>, 'mobileTitle'>) => ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const SecondaryActionButton: <TAction>({ renderActions, }: SecondaryActionButtonProps<TAction>) => JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ClickAwayListener } from '@mui/material';
|
|
3
|
+
import { useContext, useRef, useState } from 'react';
|
|
4
|
+
import { DotsVOutlineMd } from '../../../../icons';
|
|
5
|
+
import { useMenu } from '../../../hooks';
|
|
6
|
+
import { SecondaryActionsMenuProvider, } from '../../CardGridSecondaryAction';
|
|
7
|
+
import { CardActionContext } from '../CardActionContext';
|
|
8
|
+
import { StyledIconButton } from './styles';
|
|
9
|
+
export const SecondaryActionButton = ({ renderActions, }) => {
|
|
10
|
+
const buttonRef = useRef(null);
|
|
11
|
+
const { open, anchorRef, handleOpenMenu, handleCloseMenu } = useMenu(buttonRef);
|
|
12
|
+
const { isDisabled, isDisabledCard } = useContext(CardActionContext);
|
|
13
|
+
// Если контент единожды отрендерился, то будем рендерить его дальше,
|
|
14
|
+
// чтобы были актуальные статусы loading для блокировки действий
|
|
15
|
+
const [isOnceOpen, setIsOnceOpen] = useState(false);
|
|
16
|
+
const handleOpen = () => {
|
|
17
|
+
setIsOnceOpen(true);
|
|
18
|
+
handleOpenMenu();
|
|
19
|
+
};
|
|
20
|
+
return (_jsxs(SecondaryActionsMenuProvider, { value: { open, anchorEl: anchorRef.current }, children: [_jsx(ClickAwayListener, { onClickAway: handleCloseMenu, mouseEvent: "onMouseUp", children: _jsx(StyledIconButton, { ref: anchorRef, onClick: handleOpen, selected: open, variant: "outlined", color: "grey", disabled: isDisabled || isDisabledCard, children: _jsx(DotsVOutlineMd, {}) }) }), isOnceOpen && renderActions({ isLoading: false })] }));
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SecondaryActionButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SecondaryActionButton';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledIconButton: import("@emotion/styled").StyledComponent<Omit<import("../../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "variant"> & {
|
|
3
|
+
variant?: "link" | "light" | "outlined" | "contained" | "text" | undefined;
|
|
4
|
+
loading?: boolean | undefined;
|
|
5
|
+
color?: "grey" | "error" | "success" | "warning" | "primary" | undefined;
|
|
6
|
+
component?: import("react").ElementType | undefined;
|
|
7
|
+
selected?: boolean | undefined;
|
|
8
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
9
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
10
|
+
}, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const StyledDivider: import("@emotion/styled").StyledComponent<import("../../Divider").DividerProps & {
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
}, {}, {}>;
|
|
9
|
+
export declare const CardHeader: import("@emotion/styled").StyledComponent<{
|
|
10
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
+
as?: import("react").ElementType<any> | undefined;
|
|
12
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
+
export declare const HeaderWrapper: import("@emotion/styled").StyledComponent<{
|
|
14
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
15
|
+
as?: import("react").ElementType<any> | undefined;
|
|
16
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Divider } from '../../Divider';
|
|
2
|
+
import { styled } from '../../styles';
|
|
3
|
+
export const Wrapper = styled.div `
|
|
4
|
+
padding: ${({ theme }) => theme.spacing(4, 5)};
|
|
5
|
+
|
|
6
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
7
|
+
padding: ${({ theme }) => theme.spacing(5, 4)};
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
export const StyledDivider = styled(Divider) `
|
|
11
|
+
margin: ${({ theme }) => theme.spacing(4, 0)}
|
|
12
|
+
`;
|
|
13
|
+
export const CardHeader = styled.div `
|
|
14
|
+
display: flex;
|
|
15
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
`;
|
|
19
|
+
export const HeaderWrapper = styled.div `
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
flex: 1;
|
|
22
|
+
`;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type FunctionComponent, type ReactNode } from 'react';
|
|
2
|
+
export type CardProps<TItem> = {
|
|
3
|
+
/**
|
|
4
|
+
* Header элемента
|
|
5
|
+
*/
|
|
6
|
+
header?: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Основные действия элемента отображающиеся в footer
|
|
9
|
+
* Может быть как функцией без параметров, так и React компонентом
|
|
10
|
+
*/
|
|
11
|
+
mainActions?: FunctionComponent;
|
|
12
|
+
/**
|
|
13
|
+
* Дополнительные действия элемента отображающиеся в header в виде кнопки с троеточием
|
|
14
|
+
*/
|
|
15
|
+
secondaryActions?: () => ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Основной контент отображающийся в центральной части элемента
|
|
18
|
+
*/
|
|
19
|
+
content: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Если `true`, элемент будет заблокирован для взаимодействия
|
|
22
|
+
*/
|
|
23
|
+
isDisabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Причина блокировки элемента
|
|
26
|
+
*/
|
|
27
|
+
disabledReason?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Данные элемента
|
|
30
|
+
*/
|
|
31
|
+
item: TItem;
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CardGridActionHandler } from '../../CardGridMainActions';
|
|
2
|
+
import type { CardProps } from '../types';
|
|
3
|
+
type UseLogicParams<TItem> = CardProps<TItem>;
|
|
4
|
+
export declare const useLogic: <TItem>({ item }: UseLogicParams<TItem>) => {
|
|
5
|
+
handleActionClick: CardGridActionHandler<TItem>;
|
|
6
|
+
};
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useMemo } from 'react';
|
|
3
|
+
import { VirtuosoGrid, } from 'react-virtuoso';
|
|
4
|
+
import { ContentState } from '../ContentState';
|
|
5
|
+
import { Card } from './Card';
|
|
6
|
+
import { cardGridClassnames } from './constants';
|
|
7
|
+
import { Footer } from './Footer';
|
|
8
|
+
import { List } from './List';
|
|
9
|
+
import { NoDataPlaceholder } from './NoDataPlaceholder';
|
|
10
|
+
import { OnTopButton } from './OnTopButton';
|
|
11
|
+
import { SkeletonGrid } from './SkeletonGrid';
|
|
12
|
+
import { ContentStateWrapper } from './styles';
|
|
13
|
+
import { useLogic } from './useLogic';
|
|
14
|
+
export const CardGridInfinite = (props) => {
|
|
15
|
+
const { contentStateProps, desktopCardWidth, virtuosoProps, scrollParent, skeleton, footerProps, onTopButtonProps, list, noDataImgSrc, defineCard, classnames, } = useLogic(props);
|
|
16
|
+
const VirtuosoList = useMemo(() => forwardRef((listProps, ref) => (_jsx(List, { ...listProps, ref: ref, desktopCardWidth: desktopCardWidth }))), [desktopCardWidth]);
|
|
17
|
+
return (_jsx(ContentStateWrapper, { className: classnames, children: _jsx(ContentState, { ...contentStateProps, loadingContent: _jsx(SkeletonGrid, { skeleton: skeleton, desktopCardWidth: desktopCardWidth }), children: list?.length && scrollParent ? (_jsxs(_Fragment, { children: [_jsx(VirtuosoGrid, { ...virtuosoProps, data: list, customScrollParent: scrollParent, listClassName: cardGridClassnames.list, components: {
|
|
18
|
+
List: VirtuosoList,
|
|
19
|
+
Footer: () => _jsx(Footer, { ...footerProps }),
|
|
20
|
+
}, itemContent: (_, item) => (_jsx(Card, { item: item, ...defineCard(item) })) }), _jsx(OnTopButton, { ...onTopButtonProps })] })) : (_jsx(NoDataPlaceholder, { noDataImgSrc: noDataImgSrc })) }) }));
|
|
21
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '../../../Button';
|
|
3
|
+
import { ConfirmAction, } from '../../../ConfirmAction';
|
|
4
|
+
import { Tooltip } from '../../../Tooltip';
|
|
5
|
+
import { useLogic } from './useLogic';
|
|
6
|
+
export const Action = (props) => {
|
|
7
|
+
const { tooltipProps } = useLogic(props);
|
|
8
|
+
const { action, onActionClick, isDisabled } = props;
|
|
9
|
+
const { name, needConfirm, confirmText, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, note, onClick, component, variant, color, ...restProps } = action;
|
|
10
|
+
const renderButton = (renderProps) => {
|
|
11
|
+
return (_jsx(Tooltip, { withoutContainer: !disabled, placement: "bottom", ...tooltipProps, children: _jsx(Button, { disabled: isDisabled || disabled, loading: loading, component: component, variant: variant, color: color, ...restProps, ...renderProps, children: name }) }, name));
|
|
12
|
+
};
|
|
13
|
+
return (_jsx(_Fragment, { children: needConfirm ? (_jsx(ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps, actionComponent: (renderProps) => renderButton(renderProps), onConfirm: onActionClick(onClick) })) : (renderButton({
|
|
14
|
+
onClick: onActionClick(onClick),
|
|
15
|
+
})) }));
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Action';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Action';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { CardGridActionHandler, CardGridMainActionComponent } from '../types';
|
|
3
|
+
export type ActionProps<TAction> = {
|
|
4
|
+
action: CardGridMainActionComponent<TAction, ElementType>;
|
|
5
|
+
/**
|
|
6
|
+
* Обработчик клика на действие
|
|
7
|
+
*/
|
|
8
|
+
onActionClick: CardGridActionHandler<TAction>;
|
|
9
|
+
/**
|
|
10
|
+
* Если true, action не доступен
|
|
11
|
+
*/
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ActionProps } from '../types';
|
|
2
|
+
type UseLogicParam<TAction> = ActionProps<TAction>;
|
|
3
|
+
export declare const useLogic: <TAction>({ action }: UseLogicParam<TAction>) => {
|
|
4
|
+
tooltipProps: {
|
|
5
|
+
title: string | undefined;
|
|
6
|
+
open: boolean;
|
|
7
|
+
onOpen: () => void;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
export const useLogic = ({ action }) => {
|
|
3
|
+
const { loading, disabledReason, note } = action;
|
|
4
|
+
const [isVisibleTooltip, setVisibleTooltip] = useState(false);
|
|
5
|
+
const handleOpenTooltip = () => setVisibleTooltip(true);
|
|
6
|
+
const handleCloseTooltip = () => setVisibleTooltip(false);
|
|
7
|
+
const title = note || disabledReason;
|
|
8
|
+
return {
|
|
9
|
+
tooltipProps: {
|
|
10
|
+
title,
|
|
11
|
+
open: isVisibleTooltip && !loading,
|
|
12
|
+
onOpen: handleOpenTooltip,
|
|
13
|
+
onClose: handleCloseTooltip,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CardGridMainAction } from './types';
|
|
3
|
+
export type CardGridMainActionsProps<TAction> = {
|
|
4
|
+
/**
|
|
5
|
+
* Действия отображаются слева направо в порядке, указанном в массиве
|
|
6
|
+
* Каждый элемент может иметь свой component (например, 'button', 'a', и т.д.)
|
|
7
|
+
* с соответствующими пропсами для этого компонента
|
|
8
|
+
*/
|
|
9
|
+
actions?: CardGridMainAction<TAction>[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Компонент для отображения основных действий в карточке CardGrid.
|
|
13
|
+
*
|
|
14
|
+
* Основные действия отображаются в виде отдельных кнопок в футере карточки
|
|
15
|
+
* и предназначены для наиболее часто используемых операций над ней
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* - Компонент автоматически обрабатывает блокирующие операции, что предотвращает одновременное выполнение нескольких действий
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <CardGridMainActions
|
|
23
|
+
* actions={[
|
|
24
|
+
* { name: 'Редактировать', onClick: handleEdit },
|
|
25
|
+
* { name: 'Удалить', onClick: handleDelete, isBlockingOperation: true }
|
|
26
|
+
* ]}
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const CardGridMainActions: <TAction>({ actions, }: CardGridMainActionsProps<TAction>) => JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useBlockingActions } from '../hooks';
|
|
3
|
+
import { Action } from './Action';
|
|
4
|
+
import { Wrapper } from './styles';
|
|
5
|
+
/**
|
|
6
|
+
* Компонент для отображения основных действий в карточке CardGrid.
|
|
7
|
+
*
|
|
8
|
+
* Основные действия отображаются в виде отдельных кнопок в футере карточки
|
|
9
|
+
* и предназначены для наиболее часто используемых операций над ней
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* - Компонент автоматически обрабатывает блокирующие операции, что предотвращает одновременное выполнение нескольких действий
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <CardGridMainActions
|
|
17
|
+
* actions={[
|
|
18
|
+
* { name: 'Редактировать', onClick: handleEdit },
|
|
19
|
+
* { name: 'Удалить', onClick: handleDelete, isBlockingOperation: true }
|
|
20
|
+
* ]}
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export const CardGridMainActions = ({ actions, }) => {
|
|
25
|
+
const { isDisabled, onActionClick } = useBlockingActions(actions);
|
|
26
|
+
return (_jsx(Wrapper, { children: actions?.map((action) => {
|
|
27
|
+
return (_jsx(Action, { action: action, onActionClick: onActionClick, isDisabled: isDisabled }, action.name));
|
|
28
|
+
}) }));
|
|
29
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ElementType, MouseEventHandler } from 'react';
|
|
2
|
+
import type { ButtonProps } from '../../Button';
|
|
3
|
+
import type { ConfirmActionProps } from '../../ConfirmAction';
|
|
4
|
+
export type CardGridMainActionBase<TItem> = {
|
|
5
|
+
/**
|
|
6
|
+
* Название действия (также используется как текст внутри кнопки)
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* Если `true`, при клике на кнопку будет вызываться подтверждение действия
|
|
11
|
+
*/
|
|
12
|
+
needConfirm?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Поясняющий текст для подтверждения действия
|
|
15
|
+
*/
|
|
16
|
+
confirmText?: ConfirmActionProps['text'];
|
|
17
|
+
/**
|
|
18
|
+
* Параметры кнопки подтверждения действия
|
|
19
|
+
*/
|
|
20
|
+
confirmButtonProps?: ConfirmActionProps['confirmButtonProps'];
|
|
21
|
+
/**
|
|
22
|
+
* Если true, блокирует взаимодействие с actions
|
|
23
|
+
*/
|
|
24
|
+
isBlockingOperation?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Причина блокировки действия
|
|
27
|
+
*/
|
|
28
|
+
disabledReason?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Текст тултипа при наведении на кнопку
|
|
31
|
+
*/
|
|
32
|
+
note?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Причина блокировки строки во время загрузки
|
|
35
|
+
*/
|
|
36
|
+
loadingNote?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Обработчик действия
|
|
39
|
+
*/
|
|
40
|
+
onClick?: (data: TItem) => void;
|
|
41
|
+
};
|
|
42
|
+
export type CardGridMainActionComponent<TItem, TComponent extends ElementType = ElementType> = CardGridMainActionBase<TItem> & Omit<ButtonProps<TComponent>, 'children' | 'onClick'>;
|
|
43
|
+
export type CardGridActionHandler<TItem> = (onClick: CardGridMainActionComponent<TItem>['onClick']) => MouseEventHandler<HTMLElement> | undefined;
|
|
44
|
+
export type CardGridMainAction<TItem> = CardGridMainActionComponent<TItem, ElementType>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './replaceActionComponent';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './replaceActionComponent';
|
package/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './replaceActionComponent';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './replaceActionComponent';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ElementType } from 'react';
|
|
2
|
+
import type { CardGridMainActionComponent } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Заменяет дефолтный параметр component на кастомный
|
|
5
|
+
* @param component - Кастомный компонент для замены Button
|
|
6
|
+
* @param props - Параметры компонента
|
|
7
|
+
*/
|
|
8
|
+
export declare const replaceActionComponent: <TItem, TComponent extends ElementType>(component: TComponent, props: Omit<CardGridMainActionComponent<TItem, TComponent>, "component">) => CardGridMainActionComponent<TItem, ElementType>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Заменяет дефолтный параметр component на кастомный
|
|
3
|
+
* @param component - Кастомный компонент для замены Button
|
|
4
|
+
* @param props - Параметры компонента
|
|
5
|
+
*/
|
|
6
|
+
export const replaceActionComponent = (component, props) => {
|
|
7
|
+
return {
|
|
8
|
+
...props,
|
|
9
|
+
component,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CardGridSecondaryActionsProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Компонент для отображения дополнительных действий в выпадающем меню.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <CardGridSecondaryActions
|
|
9
|
+
* actions={[
|
|
10
|
+
* { name: 'Дублировать', onClick: handleDuplicate },
|
|
11
|
+
* { name: 'Архивировать', onClick: handleArchive, disabled: !canArchive },
|
|
12
|
+
* { name: 'Экспортировать', onClick: handleExport }
|
|
13
|
+
* ]}
|
|
14
|
+
* isLoading={isActionsLoading}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const CardGridSecondaryActions: <TAction>({ actions, isLoading, mobileTitle, }: CardGridSecondaryActionsProps<TAction>) => JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as _createElement } from "react";
|
|
3
|
+
import { useContext } from 'react';
|
|
4
|
+
import { Menu } from '../../Menu';
|
|
5
|
+
import { MenuItem } from '../../MenuItem';
|
|
6
|
+
import { useBlockingActions } from '../hooks';
|
|
7
|
+
import { CardGridSecondaryActionsSkeleton } from './CardGridSecondaryActionsSkeleton';
|
|
8
|
+
import { SecondaryActionsMenuContext } from './SecondaryActionsMenuContext';
|
|
9
|
+
/**
|
|
10
|
+
* Компонент для отображения дополнительных действий в выпадающем меню.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <CardGridSecondaryActions
|
|
15
|
+
* actions={[
|
|
16
|
+
* { name: 'Дублировать', onClick: handleDuplicate },
|
|
17
|
+
* { name: 'Архивировать', onClick: handleArchive, disabled: !canArchive },
|
|
18
|
+
* { name: 'Экспортировать', onClick: handleExport }
|
|
19
|
+
* ]}
|
|
20
|
+
* isLoading={isActionsLoading}
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export const CardGridSecondaryActions = ({ actions, isLoading, mobileTitle, }) => {
|
|
25
|
+
const { onActionClick } = useBlockingActions(actions);
|
|
26
|
+
const { anchorEl, open } = useContext(SecondaryActionsMenuContext);
|
|
27
|
+
const renderActions = () => {
|
|
28
|
+
return actions?.map((action) => {
|
|
29
|
+
const { onClick, name, loading, isBlockingOperation, ...restProps } = action;
|
|
30
|
+
return (_createElement(MenuItem, { ...restProps, key: name, tooltipPlacement: "left", onClick: onActionClick(onClick) }, name));
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
return (_jsx(Menu, { open: open, title: mobileTitle, anchorEl: anchorEl, anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, transformOrigin: { vertical: 'top', horizontal: 'right' }, children: isLoading ? _jsx(CardGridSecondaryActionsSkeleton, {}) : renderActions() }));
|
|
34
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton } from '../../../Skeleton';
|
|
3
|
+
import { MenuItemWrapper, SkeletonWrapper } from './styles';
|
|
4
|
+
export const CardGridSecondaryActionsSkeleton = () => (_jsxs(SkeletonWrapper, { children: [_jsx(MenuItemWrapper, { children: _jsx(Skeleton, { variant: "rounded", width: 110 }) }), _jsx(MenuItemWrapper, { children: _jsx(Skeleton, { variant: "rounded", width: 60 }) }), _jsx(MenuItemWrapper, { children: _jsx(Skeleton, { variant: "rounded", width: 90 }) })] }));
|