@astral/ui 4.4.1 → 4.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/components/DataGrid/Head/Head.js +5 -4
- package/components/DataGrid/HeadCell/styles.js +5 -0
- package/components/DataGrid/types.d.ts +4 -0
- package/components/DataGridColumnHintIcon/DataGridColumnHintIcon.d.ts +4 -0
- package/components/DataGridColumnHintIcon/DataGridColumnHintIcon.js +6 -0
- package/components/DataGridColumnHintIcon/index.d.ts +1 -0
- package/components/DataGridColumnHintIcon/index.js +1 -0
- package/components/HintIcon/HintIcon.d.ts +2 -35
- package/components/HintIcon/HintIcon.js +2 -2
- package/components/HintIcon/Icon/Icon.d.ts +4 -5
- package/components/HintIcon/Icon/Icon.js +2 -1
- package/components/HintIcon/Icon/useLogic/hooks/useIconColor/useIconColor.d.ts +3 -1
- package/components/HintIcon/Icon/useLogic/hooks/useIconColor/useIconColor.js +4 -1
- package/components/HintIcon/Icon/useLogic/useLogic.d.ts +3 -3
- package/components/HintIcon/Icon/useLogic/useLogic.js +5 -2
- package/components/HintIcon/constants.d.ts +3 -0
- package/components/HintIcon/constants.js +4 -0
- package/components/HintIcon/index.d.ts +2 -0
- package/components/HintIcon/index.js +1 -0
- package/components/HintIcon/styles.d.ts +0 -6
- package/components/HintIcon/styles.js +0 -7
- package/components/HintIcon/types.d.ts +38 -0
- package/components/HintIcon/useLogic/useLogic.d.ts +3 -2
- package/components/HintIcon/useLogic/useLogic.js +4 -2
- package/components/Tree/MultipleTreeList/MultipleTreeList.d.ts +2 -2
- package/components/Tree/MultipleTreeList/MultipleTreeList.js +1 -1
- package/components/Tree/MultipleTreeList/TreeItem/TreeItem.d.ts +10 -6
- package/components/Tree/MultipleTreeList/TreeItem/TreeItem.js +3 -2
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.d.ts +3 -2
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.js +24 -18
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsIndeterminate/checkIsIndeterminate.d.ts +2 -1
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsIndeterminate/checkIsIndeterminate.js +2 -1
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.d.ts +2 -1
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.js +2 -1
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.d.ts +5 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.js +22 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/index.d.ts +1 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/index.js +1 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.d.ts +5 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.js +6 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/index.d.ts +1 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/index.js +1 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/getItemsToAdd.d.ts +5 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/getItemsToAdd.js +14 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/index.d.ts +1 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/index.js +1 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/index.d.ts +3 -0
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/index.js +3 -0
- package/components/Tree/MultipleTreeList/types.d.ts +8 -4
- package/components/TreeAsyncAutocomplete/types.d.ts +14 -2
- package/components/TreeLikeAsyncAutocomplete/Input/Input.d.ts +3 -0
- package/components/TreeLikeAsyncAutocomplete/Input/Input.js +20 -0
- package/components/TreeLikeAsyncAutocomplete/Input/constants.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/Input/constants.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/Input/index.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/Input/index.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/Input/styles.d.ts +11 -0
- package/components/TreeLikeAsyncAutocomplete/Input/styles.js +27 -0
- package/components/TreeLikeAsyncAutocomplete/Input/types.d.ts +7 -0
- package/components/TreeLikeAsyncAutocomplete/Input/types.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/Input/useLogic/index.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/Input/useLogic/index.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.d.ts +18 -0
- package/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.js +50 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/ErrorMessage.d.ts +13 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/ErrorMessage.js +6 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/index.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/index.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/styles.d.ts +5 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/styles.js +10 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/Loader.d.ts +2 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/Loader.js +4 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/index.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/index.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/styles.d.ts +5 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/styles.js +8 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/NoData.d.ts +2 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/NoData.js +6 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/index.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/index.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/styles.d.ts +5 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/styles.js +8 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/OptionsModal.d.ts +3 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/OptionsModal.js +33 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/SearchSuggestion.d.ts +2 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/SearchSuggestion.js +6 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/index.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/index.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/styles.d.ts +5 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/styles.js +8 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/constants.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/constants.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/index.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/index.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.d.ts +19 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.js +48 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/types.d.ts +69 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/types.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/index.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/index.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.d.ts +27 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.js +92 -0
- package/components/TreeLikeAsyncAutocomplete/TreeLikeAsyncAutocomplete.d.ts +3 -0
- package/components/TreeLikeAsyncAutocomplete/TreeLikeAsyncAutocomplete.js +9 -0
- package/components/TreeLikeAsyncAutocomplete/constants.d.ts +2 -0
- package/components/TreeLikeAsyncAutocomplete/constants.js +2 -0
- package/components/TreeLikeAsyncAutocomplete/index.d.ts +2 -0
- package/components/TreeLikeAsyncAutocomplete/index.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/types.d.ts +69 -0
- package/components/TreeLikeAsyncAutocomplete/types.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/useLogic/index.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/useLogic/index.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/useLogic/useLogic.d.ts +626 -0
- package/components/TreeLikeAsyncAutocomplete/useLogic/useLogic.js +82 -0
- package/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/deepMultipleFind.d.ts +3 -0
- package/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/deepMultipleFind.js +12 -0
- package/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/index.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/index.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/useLogic/utils/index.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/useLogic/utils/index.js +1 -0
- package/components/TreeLikeList/TreeItem/TreeItem.d.ts +3 -51
- package/components/TreeLikeList/TreeItem/TreeItem.js +3 -2
- package/components/TreeLikeList/TreeItem/types.d.ts +56 -0
- package/components/TreeLikeList/TreeItem/types.js +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/useLogic.d.ts +4 -3
- package/components/TreeLikeList/TreeItem/useLogic/useLogic.js +22 -13
- package/components/TreeLikeList/TreeItem/useLogic/utils/addItem/addItem.d.ts +6 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/addItem/addItem.js +8 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/addItem/index.d.ts +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/addItem/index.js +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/addItemsByIds.d.ts +6 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/addItemsByIds.js +15 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/index.d.ts +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/index.js +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.d.ts +2 -1
- package/components/TreeLikeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.js +2 -1
- package/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.d.ts +5 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.js +22 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/index.d.ts +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/index.js +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/getCurrentValueIds.d.ts +5 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/getCurrentValueIds.js +10 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/index.d.ts +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/index.js +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.d.ts +5 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.js +6 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/index.d.ts +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/index.js +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/index.d.ts +7 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/index.js +7 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/index.d.ts +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/index.js +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/removeItem.d.ts +5 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/removeItem.js +10 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/index.d.ts +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/index.js +1 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/removeItemsByIds.d.ts +5 -0
- package/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/removeItemsByIds.js +11 -0
- package/components/TreeLikeList/TreeLikeList.d.ts +2 -3
- package/components/TreeLikeList/TreeLikeList.js +1 -1
- package/components/TreeLikeList/index.d.ts +1 -0
- package/components/TreeLikeList/types.d.ts +8 -4
- package/components/TreeLikeList/useLogic/useLogic.d.ts +3 -3
- package/components/TreeLikeList/useLogic/useLogic.js +3 -2
- package/components/TreeLikeList/useLogic/utils/getChainsId/getChainsId.js +17 -10
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/hook-form/FormTreeLikeAsyncAutocomplete/FormTreeLikeAsyncAutocomplete.d.ts +13 -0
- package/hook-form/FormTreeLikeAsyncAutocomplete/FormTreeLikeAsyncAutocomplete.js +13 -0
- package/hook-form/FormTreeLikeAsyncAutocomplete/index.d.ts +0 -0
- package/hook-form/FormTreeLikeAsyncAutocomplete/index.js +1 -0
- package/node/components/DataGrid/Head/Head.js +4 -3
- package/node/components/DataGrid/HeadCell/styles.js +5 -0
- package/node/components/DataGrid/types.d.ts +4 -0
- package/node/components/DataGridColumnHintIcon/DataGridColumnHintIcon.d.ts +4 -0
- package/node/components/DataGridColumnHintIcon/DataGridColumnHintIcon.js +10 -0
- package/node/components/DataGridColumnHintIcon/index.d.ts +1 -0
- package/node/components/DataGridColumnHintIcon/index.js +17 -0
- package/node/components/HintIcon/HintIcon.d.ts +2 -35
- package/node/components/HintIcon/HintIcon.js +2 -2
- package/node/components/HintIcon/Icon/Icon.d.ts +4 -5
- package/node/components/HintIcon/Icon/Icon.js +2 -1
- package/node/components/HintIcon/Icon/useLogic/hooks/useIconColor/useIconColor.d.ts +3 -1
- package/node/components/HintIcon/Icon/useLogic/hooks/useIconColor/useIconColor.js +4 -1
- package/node/components/HintIcon/Icon/useLogic/useLogic.d.ts +3 -3
- package/node/components/HintIcon/Icon/useLogic/useLogic.js +5 -2
- package/node/components/HintIcon/constants.d.ts +3 -0
- package/node/components/HintIcon/constants.js +5 -1
- package/node/components/HintIcon/index.d.ts +2 -0
- package/node/components/HintIcon/index.js +3 -0
- package/node/components/HintIcon/styles.d.ts +0 -6
- package/node/components/HintIcon/styles.js +1 -8
- package/node/components/HintIcon/types.d.ts +38 -0
- package/node/components/HintIcon/useLogic/useLogic.d.ts +3 -2
- package/node/components/HintIcon/useLogic/useLogic.js +4 -2
- package/node/components/Tree/MultipleTreeList/MultipleTreeList.d.ts +2 -2
- package/node/components/Tree/MultipleTreeList/MultipleTreeList.js +1 -1
- package/node/components/Tree/MultipleTreeList/TreeItem/TreeItem.d.ts +10 -6
- package/node/components/Tree/MultipleTreeList/TreeItem/TreeItem.js +3 -2
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.d.ts +3 -2
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.js +23 -17
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsIndeterminate/checkIsIndeterminate.d.ts +2 -1
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsIndeterminate/checkIsIndeterminate.js +2 -1
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.d.ts +2 -1
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.js +2 -1
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.d.ts +5 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.js +26 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/index.d.ts +1 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/index.js +17 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.d.ts +5 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.js +10 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/index.d.ts +1 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/index.js +17 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/getItemsToAdd.d.ts +5 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/getItemsToAdd.js +18 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/index.d.ts +1 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/index.js +17 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/index.d.ts +3 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/index.js +7 -1
- package/node/components/Tree/MultipleTreeList/types.d.ts +8 -4
- package/node/components/TreeAsyncAutocomplete/types.d.ts +14 -2
- package/node/components/TreeLikeAsyncAutocomplete/Input/Input.d.ts +3 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/Input.js +23 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/constants.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/constants.js +4 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/index.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/index.js +17 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/styles.d.ts +11 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/styles.js +30 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/types.d.ts +7 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/types.js +2 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/index.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/index.js +17 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.d.ts +18 -0
- package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.js +54 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/ErrorMessage.d.ts +13 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/ErrorMessage.js +10 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/index.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/index.js +17 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/styles.d.ts +5 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/styles.js +13 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/Loader.d.ts +2 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/Loader.js +8 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/index.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/index.js +17 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/styles.d.ts +5 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/styles.js +11 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/NoData.d.ts +2 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/NoData.js +10 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/index.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/index.js +17 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/styles.d.ts +5 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/styles.js +11 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/OptionsModal.d.ts +3 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/OptionsModal.js +37 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/SearchSuggestion.d.ts +2 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/SearchSuggestion.js +10 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/index.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/index.js +17 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/styles.d.ts +5 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/styles.js +11 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/constants.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/constants.js +4 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/index.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/index.js +17 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.d.ts +19 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.js +51 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/types.d.ts +69 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/types.js +2 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/index.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/index.js +17 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.d.ts +27 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.js +96 -0
- package/node/components/TreeLikeAsyncAutocomplete/TreeLikeAsyncAutocomplete.d.ts +3 -0
- package/node/components/TreeLikeAsyncAutocomplete/TreeLikeAsyncAutocomplete.js +12 -0
- package/node/components/TreeLikeAsyncAutocomplete/constants.d.ts +2 -0
- package/node/components/TreeLikeAsyncAutocomplete/constants.js +5 -0
- package/node/components/TreeLikeAsyncAutocomplete/index.d.ts +2 -0
- package/node/components/TreeLikeAsyncAutocomplete/index.js +17 -0
- package/node/components/TreeLikeAsyncAutocomplete/types.d.ts +69 -0
- package/node/components/TreeLikeAsyncAutocomplete/types.js +2 -0
- package/node/components/TreeLikeAsyncAutocomplete/useLogic/index.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/useLogic/index.js +17 -0
- package/node/components/TreeLikeAsyncAutocomplete/useLogic/useLogic.d.ts +626 -0
- package/node/components/TreeLikeAsyncAutocomplete/useLogic/useLogic.js +86 -0
- package/node/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/deepMultipleFind.d.ts +3 -0
- package/node/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/deepMultipleFind.js +16 -0
- package/node/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/index.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/index.js +17 -0
- package/node/components/TreeLikeAsyncAutocomplete/useLogic/utils/index.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/useLogic/utils/index.js +5 -0
- package/node/components/TreeLikeList/TreeItem/TreeItem.d.ts +3 -51
- package/node/components/TreeLikeList/TreeItem/TreeItem.js +3 -2
- package/node/components/TreeLikeList/TreeItem/types.d.ts +56 -0
- package/node/components/TreeLikeList/TreeItem/types.js +2 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/useLogic.d.ts +4 -3
- package/node/components/TreeLikeList/TreeItem/useLogic/useLogic.js +21 -12
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItem/addItem.d.ts +6 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItem/addItem.js +12 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItem/index.d.ts +1 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItem/index.js +5 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/addItemsByIds.d.ts +6 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/addItemsByIds.js +19 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/index.d.ts +1 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/index.js +5 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.d.ts +2 -1
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.js +2 -1
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.d.ts +5 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.js +26 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/index.d.ts +1 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/index.js +5 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/getCurrentValueIds.d.ts +5 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/getCurrentValueIds.js +14 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/index.d.ts +1 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/index.js +5 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.d.ts +5 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.js +10 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/index.d.ts +1 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/index.js +17 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/index.d.ts +7 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/index.js +15 -1
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/index.d.ts +1 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/index.js +5 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/removeItem.d.ts +5 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/removeItem.js +14 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/index.d.ts +1 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/index.js +5 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/removeItemsByIds.d.ts +5 -0
- package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/removeItemsByIds.js +15 -0
- package/node/components/TreeLikeList/TreeLikeList.d.ts +2 -3
- package/node/components/TreeLikeList/TreeLikeList.js +1 -1
- package/node/components/TreeLikeList/index.d.ts +1 -0
- package/node/components/TreeLikeList/types.d.ts +8 -4
- package/node/components/TreeLikeList/useLogic/useLogic.d.ts +3 -3
- package/node/components/TreeLikeList/useLogic/useLogic.js +3 -2
- package/node/components/TreeLikeList/useLogic/utils/getChainsId/getChainsId.js +17 -10
- package/node/components/index.d.ts +1 -0
- package/node/components/index.js +4 -2
- package/node/hook-form/FormTreeLikeAsyncAutocomplete/FormTreeLikeAsyncAutocomplete.d.ts +13 -0
- package/node/hook-form/FormTreeLikeAsyncAutocomplete/FormTreeLikeAsyncAutocomplete.js +17 -0
- package/node/hook-form/FormTreeLikeAsyncAutocomplete/index.d.ts +0 -0
- package/node/hook-form/FormTreeLikeAsyncAutocomplete/index.js +1 -0
- package/package.json +15 -1
|
@@ -2,14 +2,15 @@ import { useEffect, useMemo, useRef } from 'react';
|
|
|
2
2
|
import { useId } from '../../hooks/useId';
|
|
3
3
|
import { getFormatDisabledItems } from '../../Tree/utils';
|
|
4
4
|
import { getChainsId } from './utils';
|
|
5
|
-
export const useLogic = ({ data, value, disabledItems }) => {
|
|
5
|
+
export const useLogic = ({ data, value, disabledItems, }) => {
|
|
6
6
|
const prefixId = useId();
|
|
7
7
|
const listRef = useRef(null);
|
|
8
8
|
useEffect(() => {
|
|
9
9
|
if (listRef.current && value?.length) {
|
|
10
10
|
// Выбираем первый элемент из списка value
|
|
11
|
+
const firstItemId = typeof value[0] === 'string' ? value[0] : value[0].id;
|
|
11
12
|
const targetItem = listRef.current.querySelector(`
|
|
12
|
-
li[id="${prefixId}${
|
|
13
|
+
li[id="${prefixId}${firstItemId}"]`);
|
|
13
14
|
if (targetItem) {
|
|
14
15
|
targetItem.scrollIntoView({ block: 'center' });
|
|
15
16
|
}
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Возвращает цепочки идентификаторов до целевых элементов
|
|
3
|
+
*/
|
|
1
4
|
export const getChainsId = (tree, targetId) => {
|
|
2
5
|
const chainIds = [];
|
|
6
|
+
if (!targetId || targetId.length === 0) {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
// Создаем набор идентификаторов для быстрого поиска
|
|
10
|
+
const targetIdsSet = new Set(targetId.map((item) => (typeof item === 'string' ? item : item.id)));
|
|
3
11
|
const findChain = (node, chainId) => {
|
|
4
|
-
chainId
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (node.children) {
|
|
10
|
-
for (const child of node.children) {
|
|
11
|
-
findChain(child, [...chainId]);
|
|
12
|
-
}
|
|
12
|
+
const currentChain = [...chainId, node.id];
|
|
13
|
+
// Проверяем по набору идентификаторов
|
|
14
|
+
if (targetIdsSet.has(node.id)) {
|
|
15
|
+
chainIds.push(currentChain);
|
|
16
|
+
// Не делаем return, так как элемент может иметь дочерние элементы с целевыми id
|
|
13
17
|
}
|
|
18
|
+
node.children?.forEach((child) => findChain(child, currentChain));
|
|
14
19
|
};
|
|
15
|
-
|
|
20
|
+
for (const node of tree) {
|
|
21
|
+
findChain(node, []);
|
|
22
|
+
}
|
|
16
23
|
return chainIds;
|
|
17
24
|
};
|
package/components/index.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export { MinimalisticPagination, type MinimalisticPaginationProps, } from './Min
|
|
|
94
94
|
export * from './NavMenu';
|
|
95
95
|
export { type DataGridColumns, type DataGridRow, type DataGridRowOptions, type DataGridSort, DataGrid, type DataGridProps, } from './DataGrid';
|
|
96
96
|
export { DataGridInfinite, type DataGridInfiniteProps, } from './DataGridInfinite';
|
|
97
|
+
export { DataGridColumnHintIcon, type DataGridColumnHintIconProps, } from './DataGridColumnHintIcon';
|
|
97
98
|
export { type DateItemProps, type DateRangePickerProps, type DateRangePickerValue, DateRangePicker, } from './DateRangePicker';
|
|
98
99
|
export { MenuOrganization, type MenuOrganizationProps, MenuOrganizationSkeleton, } from './MenuOrganization';
|
|
99
100
|
export { NotFoundPage, type NotFoundPageProps, notFoundPageClassnames, } from './NotFoundPage';
|
package/components/index.js
CHANGED
|
@@ -94,6 +94,7 @@ export { MinimalisticPagination, } from './MinimalisticPagination';
|
|
|
94
94
|
export * from './NavMenu';
|
|
95
95
|
export { DataGrid, } from './DataGrid';
|
|
96
96
|
export { DataGridInfinite, } from './DataGridInfinite';
|
|
97
|
+
export { DataGridColumnHintIcon, } from './DataGridColumnHintIcon';
|
|
97
98
|
export { DateRangePicker, } from './DateRangePicker';
|
|
98
99
|
export { MenuOrganization, MenuOrganizationSkeleton, } from './MenuOrganization';
|
|
99
100
|
export { NotFoundPage, notFoundPageClassnames, } from './NotFoundPage';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type FetchOptionsResult, type TreeLikeAsyncAutocompleteProps, type TreeLikeAsyncAutocompleteValue } from '../../components/TreeLikeAsyncAutocomplete';
|
|
3
|
+
import { type WithFormFieldProps } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Тип значения, которое сетится в state формы
|
|
6
|
+
*/
|
|
7
|
+
export type FormTreeLikeAsyncAutocompleteValue = TreeLikeAsyncAutocompleteValue;
|
|
8
|
+
export type FormFetchOptionsResult = FetchOptionsResult;
|
|
9
|
+
export type FormTreeLikeAutocompleteProps<TFieldValues extends object> = WithFormFieldProps<TreeLikeAsyncAutocompleteProps, TFieldValues>;
|
|
10
|
+
/**
|
|
11
|
+
* Обертка TreeLikeAsyncAutocomplete для формы
|
|
12
|
+
*/
|
|
13
|
+
export declare const FormTreeLikeAsyncAutocomplete: <TFieldValues extends object>(props: FormTreeLikeAutocompleteProps<TFieldValues>) => JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TreeLikeAsyncAutocomplete, } from '../../components/TreeLikeAsyncAutocomplete';
|
|
3
|
+
import { useFormFieldProps } from '../hooks';
|
|
4
|
+
/**
|
|
5
|
+
* Обертка TreeLikeAsyncAutocomplete для формы
|
|
6
|
+
*/
|
|
7
|
+
export const FormTreeLikeAsyncAutocomplete = (props) => {
|
|
8
|
+
const { error, ...fieldProps } = useFormFieldProps({
|
|
9
|
+
...props,
|
|
10
|
+
defaultValue: props.defaultValue || '',
|
|
11
|
+
});
|
|
12
|
+
return _jsx(TreeLikeAsyncAutocomplete, { isError: error, ...fieldProps });
|
|
13
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -12,13 +12,14 @@ const Head = (props) => {
|
|
|
12
12
|
const { checkboxProps, handleSort } = (0, useLogic_1.useLogic)(props);
|
|
13
13
|
const { columns, gridColumns, isSelectable, sorting, onSelectAllRows, isHideSelectAll, } = props;
|
|
14
14
|
const renderColumns = (0, react_1.useMemo)(() => {
|
|
15
|
-
return columns.map(({ field, label, sortable, align }, index) => {
|
|
15
|
+
return columns.map(({ field, label, sortable, align, columnHint }, index) => {
|
|
16
16
|
const isFirstCell = !index;
|
|
17
17
|
const startAdornmentRender = () => {
|
|
18
|
-
|
|
18
|
+
const showCheckbox = isFirstCell && isSelectable && !isHideSelectAll;
|
|
19
|
+
if (!showCheckbox && !columnHint) {
|
|
19
20
|
return null;
|
|
20
21
|
}
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.CheckboxCell, { children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { ...checkboxProps, onChange: onSelectAllRows }) }));
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showCheckbox && ((0, jsx_runtime_1.jsx)(styles_1.CheckboxCell, { children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { ...checkboxProps, onChange: onSelectAllRows }) })), columnHint] }));
|
|
22
23
|
};
|
|
23
24
|
return ((0, jsx_runtime_1.jsx)(HeadCell_1.HeadCell, { sorting: sorting, field: field, label: label, isSortable: sortable, align: align, startAdornment: startAdornmentRender(), onSort: handleSort }, label));
|
|
24
25
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Wrapper = void 0;
|
|
4
|
+
const HintIcon_1 = require("../../HintIcon");
|
|
4
5
|
const styles_1 = require("../../styles");
|
|
5
6
|
const utils_1 = require("../utils");
|
|
6
7
|
exports.Wrapper = (0, styles_1.styled)('div', {
|
|
@@ -23,4 +24,8 @@ exports.Wrapper = (0, styles_1.styled)('div', {
|
|
|
23
24
|
width: 16px;
|
|
24
25
|
height: 16px;
|
|
25
26
|
}
|
|
27
|
+
|
|
28
|
+
.${HintIcon_1.hintIconClassnames.iconWrapper} {
|
|
29
|
+
margin-right: ${({ theme }) => theme.spacing(1)};
|
|
30
|
+
}
|
|
26
31
|
`;
|
|
@@ -223,6 +223,10 @@ export type DataGridColumns<TData extends Record<string, CellValue>> = {
|
|
|
223
223
|
* Скрывает содержимое столбца от инструментов мониторинга
|
|
224
224
|
*/
|
|
225
225
|
isHidePersonalData?: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* Принимает компонент DataGridColumnHintIcon - подсказка в шапке колонки
|
|
228
|
+
*/
|
|
229
|
+
columnHint?: ReactNode;
|
|
226
230
|
};
|
|
227
231
|
export type DataGridRowOptionColumns<TData extends Record<string, CellValue>> = {
|
|
228
232
|
/**
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type HintIconProps } from '../HintIcon';
|
|
3
|
+
export type DataGridColumnHintIconProps = Omit<HintIconProps, 'renderIcon' | 'variant' | 'iconOption'>;
|
|
4
|
+
export declare const DataGridColumnHintIcon: (props: DataGridColumnHintIconProps) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataGridColumnHintIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const icons_1 = require("../../icons");
|
|
6
|
+
const HintIcon_1 = require("../HintIcon");
|
|
7
|
+
const DataGridColumnHintIcon = (props) => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(HintIcon_1.HintIcon, { renderIcon: () => (0, jsx_runtime_1.jsx)(icons_1.InfoOutlineSm, {}), variant: "info", ...props }));
|
|
9
|
+
};
|
|
10
|
+
exports.DataGridColumnHintIcon = DataGridColumnHintIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DataGridColumnHintIcon';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DataGridColumnHintIcon"), exports);
|
|
@@ -1,36 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type
|
|
3
|
-
export
|
|
4
|
-
/**
|
|
5
|
-
* Определяет иконку отображения
|
|
6
|
-
*/
|
|
7
|
-
variant: 'question' | 'info';
|
|
8
|
-
/**
|
|
9
|
-
* Опции для иконки
|
|
10
|
-
*/
|
|
11
|
-
iconOption?: {
|
|
12
|
-
/**
|
|
13
|
-
* Определяет тип иконки
|
|
14
|
-
* @default fill
|
|
15
|
-
*/
|
|
16
|
-
variant?: 'fill' | 'outline';
|
|
17
|
-
/**
|
|
18
|
-
* Определяет цвет иконки
|
|
19
|
-
* @default lightGrey
|
|
20
|
-
*/
|
|
21
|
-
color?: 'warning' | 'grey' | 'lightGrey';
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Текст заголовка BottomDrawer
|
|
25
|
-
*/
|
|
26
|
-
title: string;
|
|
27
|
-
/**
|
|
28
|
-
* Текст тултипа или контента BottomDrawer
|
|
29
|
-
*/
|
|
30
|
-
note: string;
|
|
31
|
-
/**
|
|
32
|
-
* Положение тултипа
|
|
33
|
-
*/
|
|
34
|
-
tooltipPlacement?: TooltipPlacement;
|
|
35
|
-
};
|
|
36
|
-
export declare const HintIcon: ({ variant, title, note, iconOption, tooltipPlacement, }: HintIconProps) => JSX.Element;
|
|
2
|
+
import { type HintIconProps } from './types';
|
|
3
|
+
export declare const HintIcon: ({ variant, title, note, iconOption, tooltipPlacement, renderIcon, }: HintIconProps) => JSX.Element;
|
|
@@ -6,8 +6,8 @@ const BottomDrawer_1 = require("../BottomDrawer");
|
|
|
6
6
|
const Icon_1 = require("./Icon");
|
|
7
7
|
const styles_1 = require("./styles");
|
|
8
8
|
const useLogic_1 = require("./useLogic");
|
|
9
|
-
const HintIcon = ({ variant, title, note, iconOption, tooltipPlacement = 'bottom', }) => {
|
|
9
|
+
const HintIcon = ({ variant, title, note, iconOption, tooltipPlacement = 'bottom', renderIcon, }) => {
|
|
10
10
|
const { handleClose, handleOpen, open } = (0, useLogic_1.useLogic)();
|
|
11
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { onClick: handleOpen, variant: variant, iconOption: iconOption, note: note, tooltipPlacement: tooltipPlacement }), (0, jsx_runtime_1.jsx)(BottomDrawer_1.BottomDrawer, { title: title, open: open, onClose: handleClose, children: (0, jsx_runtime_1.jsx)(styles_1.DrawerContent, { children: note }) })] }));
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { onClick: handleOpen, variant: variant, iconOption: iconOption, note: note, tooltipPlacement: tooltipPlacement, renderIcon: renderIcon }), (0, jsx_runtime_1.jsx)(BottomDrawer_1.BottomDrawer, { title: title, open: open, onClose: handleClose, children: (0, jsx_runtime_1.jsx)(styles_1.DrawerContent, { children: note }) })] }));
|
|
12
12
|
};
|
|
13
13
|
exports.HintIcon = HintIcon;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
onClick: () => void;
|
|
1
|
+
import type { SyntheticEvent } from 'react';
|
|
2
|
+
import type { HintIconProps, TooltipPlacement } from '../types';
|
|
3
|
+
export type IconProps = Pick<HintIconProps, 'variant' | 'iconOption' | 'note' | 'renderIcon'> & {
|
|
4
|
+
onClick: (e: SyntheticEvent) => void;
|
|
6
5
|
tooltipPlacement: TooltipPlacement;
|
|
7
6
|
};
|
|
8
7
|
export declare const Icon: (props: IconProps) => JSX.Element;
|
|
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Icon = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const Tooltip_1 = require("../../Tooltip");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
6
7
|
const styles_1 = require("./styles");
|
|
7
8
|
const useLogic_1 = require("./useLogic");
|
|
8
9
|
const Icon = (props) => {
|
|
9
10
|
const { getIcon, iconColor } = (0, useLogic_1.useLogic)(props);
|
|
10
11
|
const { onClick, note, tooltipPlacement } = props;
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: note, placement: tooltipPlacement, children: (0, jsx_runtime_1.jsx)(styles_1.IconWrapper, { onClick: onClick, "$color": iconColor, children: getIcon() }) }));
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: note, placement: tooltipPlacement, children: (0, jsx_runtime_1.jsx)(styles_1.IconWrapper, { onClick: onClick, "$color": iconColor, className: constants_1.hintIconClassnames.iconWrapper, children: getIcon() }) }));
|
|
12
13
|
};
|
|
13
14
|
exports.Icon = Icon;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
1
2
|
type UseIconColorParams = {
|
|
2
3
|
color?: 'warning' | 'grey' | 'lightGrey';
|
|
4
|
+
renderIcon?: () => ReactNode;
|
|
3
5
|
};
|
|
4
|
-
export declare const useIconColor: ({ color }: UseIconColorParams) => string;
|
|
6
|
+
export declare const useIconColor: ({ color, renderIcon }: UseIconColorParams) => string;
|
|
5
7
|
export {};
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useIconColor = void 0;
|
|
4
4
|
const theme_1 = require("../../../../../theme");
|
|
5
|
-
const useIconColor = ({ color }) => {
|
|
5
|
+
const useIconColor = ({ color, renderIcon }) => {
|
|
6
6
|
const theme = (0, theme_1.useTheme)();
|
|
7
7
|
const colorMap = {
|
|
8
8
|
warning: theme.palette.yellow[800],
|
|
9
9
|
grey: theme.palette.grey[800],
|
|
10
10
|
lightGrey: theme.palette.grey[400],
|
|
11
11
|
};
|
|
12
|
+
if (renderIcon) {
|
|
13
|
+
return 'currentColor';
|
|
14
|
+
}
|
|
12
15
|
if (color) {
|
|
13
16
|
return colorMap[color];
|
|
14
17
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import { type IconProps } from '../Icon';
|
|
3
3
|
type UseLogicParams = IconProps;
|
|
4
|
-
export declare const useLogic: ({ iconOption, variant }: UseLogicParams) => {
|
|
5
|
-
getIcon: () =>
|
|
4
|
+
export declare const useLogic: ({ iconOption, variant, renderIcon, }: UseLogicParams) => {
|
|
5
|
+
getIcon: () => ReactNode;
|
|
6
6
|
iconColor: string;
|
|
7
7
|
};
|
|
8
8
|
export {};
|
|
@@ -3,10 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useLogic = void 0;
|
|
4
4
|
const constants_1 = require("../../constants");
|
|
5
5
|
const hooks_1 = require("./hooks");
|
|
6
|
-
const useLogic = ({ iconOption, variant }) => {
|
|
7
|
-
const iconColor = (0, hooks_1.useIconColor)({ color: iconOption?.color });
|
|
6
|
+
const useLogic = ({ iconOption, variant, renderIcon, }) => {
|
|
7
|
+
const iconColor = (0, hooks_1.useIconColor)({ color: iconOption?.color, renderIcon });
|
|
8
8
|
const { variant: iconOptionVariant = 'fill' } = iconOption || {};
|
|
9
9
|
const getIcon = () => {
|
|
10
|
+
if (renderIcon) {
|
|
11
|
+
return renderIcon();
|
|
12
|
+
}
|
|
10
13
|
const icon = constants_1.ICONS[variant][iconOptionVariant];
|
|
11
14
|
if (icon) {
|
|
12
15
|
return icon;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ICONS = void 0;
|
|
3
|
+
exports.ICONS = exports.hintIconClassnames = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const icons_1 = require("../../icons");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
exports.hintIconClassnames = {
|
|
8
|
+
iconWrapper: (0, utils_1.createUIKitClassname)('hint-icon__icon-wrapper'),
|
|
9
|
+
};
|
|
6
10
|
exports.ICONS = {
|
|
7
11
|
question: {
|
|
8
12
|
fill: (0, jsx_runtime_1.jsx)(icons_1.QuestionFillMd, {}),
|
|
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.hintIconClassnames = void 0;
|
|
17
18
|
__exportStar(require("./HintIcon"), exports);
|
|
19
|
+
var constants_1 = require("./constants");
|
|
20
|
+
Object.defineProperty(exports, "hintIconClassnames", { enumerable: true, get: function () { return constants_1.hintIconClassnames; } });
|
|
@@ -3,9 +3,3 @@ export declare const DrawerContent: import("@emotion/styled").StyledComponent<{
|
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
-
export declare const IconWrapper: import("@emotion/styled").StyledComponent<{
|
|
7
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
-
as?: import("react").ElementType<any> | undefined;
|
|
9
|
-
} & {
|
|
10
|
-
$color: string;
|
|
11
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DrawerContent = void 0;
|
|
4
4
|
const styles_1 = require("../styles");
|
|
5
5
|
exports.DrawerContent = styles_1.styled.div `
|
|
6
6
|
padding: ${({ theme }) => theme.spacing(5, 4)};
|
|
7
7
|
`;
|
|
8
|
-
exports.IconWrapper = (0, styles_1.styled)('div', {
|
|
9
|
-
shouldForwardProp: (prop) => !['$color'].includes(prop),
|
|
10
|
-
}) `
|
|
11
|
-
display: flex;
|
|
12
|
-
|
|
13
|
-
color: ${({ $color }) => $color};
|
|
14
|
-
`;
|
|
@@ -1 +1,39 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
1
2
|
export type TooltipPlacement = 'left' | 'top' | 'right' | 'bottom';
|
|
3
|
+
export type HintIconProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Определяет иконку отображения
|
|
6
|
+
*/
|
|
7
|
+
variant: 'question' | 'info';
|
|
8
|
+
/**
|
|
9
|
+
* Опции для иконки
|
|
10
|
+
*/
|
|
11
|
+
iconOption?: {
|
|
12
|
+
/**
|
|
13
|
+
* Определяет тип иконки
|
|
14
|
+
* @default fill
|
|
15
|
+
*/
|
|
16
|
+
variant?: 'fill' | 'outline';
|
|
17
|
+
/**
|
|
18
|
+
* Определяет цвет иконки
|
|
19
|
+
* @default lightGrey
|
|
20
|
+
*/
|
|
21
|
+
color?: 'warning' | 'grey' | 'lightGrey';
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Текст заголовка BottomDrawer
|
|
25
|
+
*/
|
|
26
|
+
title: string;
|
|
27
|
+
/**
|
|
28
|
+
* Текст тултипа или контента BottomDrawer
|
|
29
|
+
*/
|
|
30
|
+
note: string;
|
|
31
|
+
/**
|
|
32
|
+
* Положение тултипа
|
|
33
|
+
*/
|
|
34
|
+
tooltipPlacement?: TooltipPlacement;
|
|
35
|
+
/**
|
|
36
|
+
* Задание кастомной иконки
|
|
37
|
+
*/
|
|
38
|
+
renderIcon?: () => ReactNode;
|
|
39
|
+
};
|
|
@@ -6,12 +6,14 @@ const hooks_1 = require("../../hooks");
|
|
|
6
6
|
const useLogic = () => {
|
|
7
7
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
8
8
|
const { isMobile } = (0, hooks_1.useViewportType)();
|
|
9
|
-
const handleOpen = () => {
|
|
9
|
+
const handleOpen = (e) => {
|
|
10
|
+
e.stopPropagation();
|
|
10
11
|
if (isMobile) {
|
|
11
12
|
setOpen((prevState) => !prevState);
|
|
12
13
|
}
|
|
13
14
|
};
|
|
14
|
-
const handleClose = () => {
|
|
15
|
+
const handleClose = (e) => {
|
|
16
|
+
e.stopPropagation();
|
|
15
17
|
if (isMobile) {
|
|
16
18
|
setOpen(false);
|
|
17
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type MultipleTreeListProps } from './types';
|
|
2
|
+
import { type MultipleTreeListProps, type MultipleValue } from './types';
|
|
3
3
|
export type { MultipleTreeListProps };
|
|
4
|
-
export declare const MultipleTreeList: ({ data, value, className, expandedLevel, disabledItems, ...props }: MultipleTreeListProps) => JSX.Element;
|
|
4
|
+
export declare const MultipleTreeList: <TValue extends MultipleValue = string[]>({ data, value, className, expandedLevel, disabledItems, ...props }: MultipleTreeListProps<TValue>) => JSX.Element;
|
|
@@ -8,6 +8,6 @@ const useLogic_1 = require("./useLogic");
|
|
|
8
8
|
const INITIAL_LEVEL = 0;
|
|
9
9
|
const MultipleTreeList = ({ data, value, className, expandedLevel = 10, disabledItems, ...props }) => {
|
|
10
10
|
const { formattedDisabledItems } = (0, useLogic_1.useLogic)({ disabledItems });
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.List, { className: className, children: data.map((item) => ((0, jsx_runtime_1.jsx)(TreeItem_1.TreeItem, { value: value,
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.List, { className: className, children: data.map((item) => ((0, jsx_runtime_1.jsx)(TreeItem_1.TreeItem, { item: item, value: value, level: INITIAL_LEVEL, expandedLevel: expandedLevel, disabledItems: formattedDisabledItems, ...props }, item.id))) }));
|
|
12
12
|
};
|
|
13
13
|
exports.MultipleTreeList = MultipleTreeList;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { type FunctionComponent } from 'react';
|
|
2
2
|
import type { TreeListData } from '../../types';
|
|
3
3
|
import type { MultipleValue } from '../types';
|
|
4
|
-
type FormatDisableItem = {
|
|
4
|
+
export type FormatDisableItem = {
|
|
5
5
|
id: string;
|
|
6
6
|
disabledReason?: string;
|
|
7
7
|
};
|
|
8
|
-
export type TreeItemProps =
|
|
8
|
+
export type TreeItemProps<TValue extends MultipleValue = string[]> = {
|
|
9
|
+
item: TreeListData;
|
|
9
10
|
/**
|
|
10
11
|
* Выбранные значения
|
|
11
12
|
*/
|
|
12
|
-
value?:
|
|
13
|
+
value?: TValue;
|
|
13
14
|
/**
|
|
14
15
|
* Render-props, позволяет более гибко настраивать содержимое item
|
|
15
16
|
*/
|
|
@@ -34,7 +35,10 @@ export type TreeItemProps = TreeListData & {
|
|
|
34
35
|
/**
|
|
35
36
|
* Функция, которая запускается при выборе item
|
|
36
37
|
*/
|
|
37
|
-
onChange: (value:
|
|
38
|
+
onChange: (value: TValue) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Переключает компонент в режим работы с объектами а не с id элементов
|
|
41
|
+
*/
|
|
42
|
+
isObjectMode?: boolean;
|
|
38
43
|
};
|
|
39
|
-
export declare const TreeItem: (props: TreeItemProps) => JSX.Element;
|
|
40
|
-
export {};
|
|
44
|
+
export declare const TreeItem: <TValue extends MultipleValue = string[]>(props: TreeItemProps<TValue>) => JSX.Element;
|
|
@@ -7,12 +7,13 @@ const styles_1 = require("./styles");
|
|
|
7
7
|
const useLogic_1 = require("./useLogic");
|
|
8
8
|
const TreeItem = (props) => {
|
|
9
9
|
const { isSelected, isIndeterminate, isDefaultExpanded, disabledReason, isDisabled, handleChange, } = (0, useLogic_1.useLogic)(props);
|
|
10
|
-
const {
|
|
10
|
+
const { level, renderItem, value, isInitialExpanded, expandedLevel, disabledItems, onChange, item, isObjectMode, } = props;
|
|
11
|
+
const { id, label, note, children = [], options } = item;
|
|
11
12
|
const handleClick = (event) => {
|
|
12
13
|
event.stopPropagation();
|
|
13
14
|
};
|
|
14
15
|
if (children.length) {
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTreeItem, { isSelected: isSelected, isDefaultExpanded: isDefaultExpanded, isForceExpanded: options?.isForceExpanded, isDisabled: isDisabled, disabledReason: disabledReason, note: renderItem ? null : note, component: "li", label: (0, jsx_runtime_1.jsx)(FormControlLabel_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(styles_1.StyledCheckbox, { checked: isSelected, indeterminate: isSelected ? false : isIndeterminate }), label: renderItem ? renderItem({ label, note, id }) : label, disabled: isDisabled, onChange: handleChange, onClick: handleClick }), level: level, onClick: handleChange, children: (0, jsx_runtime_1.jsx)(styles_1.List, { children: children.map((child) => ((0, jsx_runtime_1.jsx)(exports.TreeItem, {
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTreeItem, { isSelected: isSelected, isDefaultExpanded: isDefaultExpanded, isForceExpanded: options?.isForceExpanded, isDisabled: isDisabled, disabledReason: disabledReason, note: renderItem ? null : note, component: "li", label: (0, jsx_runtime_1.jsx)(FormControlLabel_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(styles_1.StyledCheckbox, { checked: isSelected, indeterminate: isSelected ? false : isIndeterminate }), label: renderItem ? renderItem({ label, note, id }) : label, disabled: isDisabled, onChange: handleChange, onClick: handleClick }), level: level, onClick: handleChange, children: (0, jsx_runtime_1.jsx)(styles_1.List, { children: children.map((child) => ((0, jsx_runtime_1.jsx)(exports.TreeItem, { item: child, renderItem: renderItem, level: level + 1, isInitialExpanded: isInitialExpanded, expandedLevel: expandedLevel, disabledItems: disabledItems, value: value, onChange: onChange, isObjectMode: isObjectMode }, child.id))) }) }));
|
|
16
17
|
}
|
|
17
18
|
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTreeItem, { isSelected: isSelected, isDisabled: isDisabled, disabledReason: disabledReason, note: renderItem ? null : note, component: "li", label: (0, jsx_runtime_1.jsx)(FormControlLabel_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(styles_1.StyledCheckbox, { checked: isSelected }), label: renderItem ? renderItem({ label, note, id }) : label, disabled: isDisabled, onChange: handleChange, onClick: handleClick }), level: level, onClick: handleChange }));
|
|
18
19
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { MultipleValue } from '../../types';
|
|
1
2
|
import { type TreeItemProps } from '../TreeItem';
|
|
2
|
-
type UseLogicProps = TreeItemProps
|
|
3
|
-
export declare const useLogic: ({
|
|
3
|
+
type UseLogicProps<TValue extends MultipleValue = string[]> = TreeItemProps<TValue>;
|
|
4
|
+
export declare const useLogic: <TValue extends MultipleValue = string[]>({ item, value, level, isInitialExpanded, expandedLevel, disabledItems, onChange, isObjectMode, }: UseLogicProps<TValue>) => {
|
|
4
5
|
isSelected: boolean;
|
|
5
6
|
isIndeterminate: boolean;
|
|
6
7
|
isDefaultExpanded: boolean | undefined;
|
|
@@ -3,39 +3,45 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useLogic = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const utils_1 = require("./utils");
|
|
6
|
-
const useLogic = ({
|
|
6
|
+
const useLogic = ({ item, value = [], level, isInitialExpanded, expandedLevel, disabledItems, onChange, isObjectMode, }) => {
|
|
7
|
+
const { id, children } = item;
|
|
7
8
|
const childrenIds = (0, react_1.useMemo)(() => (0, utils_1.getAllChildrenId)(children, disabledItems), [children, disabledItems]);
|
|
8
9
|
const isSelected = (0, utils_1.checkIsSelected)(value, id);
|
|
9
10
|
const isIndeterminate = (0, utils_1.checkIsIndeterminate)(value, childrenIds);
|
|
10
11
|
const isDefaultExpanded = isInitialExpanded && level <= expandedLevel - 1;
|
|
11
|
-
const disabledItem = disabledItems?.find((
|
|
12
|
+
const disabledItem = disabledItems?.find((formatDisableItem) => formatDisableItem.id === id);
|
|
12
13
|
const isDisabled = Boolean(disabledItem);
|
|
13
14
|
const disabledReason = disabledItem?.disabledReason;
|
|
14
15
|
(0, react_1.useEffect)(() => {
|
|
15
16
|
if (!childrenIds.length) {
|
|
16
17
|
return undefined;
|
|
17
18
|
}
|
|
18
|
-
const isEveryChildChecked = childrenIds.every((childrenId) => value?.
|
|
19
|
+
const isEveryChildChecked = childrenIds.every((childrenId) => value?.some((treeItem) => (0, utils_1.getIdFromValue)(treeItem) === childrenId));
|
|
19
20
|
if (!isSelected && isEveryChildChecked) {
|
|
20
|
-
|
|
21
|
+
const addItem = isObjectMode ? item : id;
|
|
22
|
+
const newValue = value ? [...value, addItem] : [addItem];
|
|
23
|
+
onChange(newValue);
|
|
21
24
|
}
|
|
22
25
|
if (isSelected && !isEveryChildChecked) {
|
|
23
|
-
|
|
26
|
+
const removeItem = value?.filter((selectedItem) => (0, utils_1.getIdFromValue)(selectedItem) !== id);
|
|
27
|
+
onChange(removeItem);
|
|
24
28
|
}
|
|
25
|
-
}, [value, childrenIds]);
|
|
29
|
+
}, [value, childrenIds, isSelected]);
|
|
26
30
|
const handleChange = () => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
onChange([...value, id]);
|
|
31
|
+
const isValueIncludesId = value?.some((treeItem) => (0, utils_1.getIdFromValue)(treeItem) === id);
|
|
32
|
+
if (isValueIncludesId) {
|
|
33
|
+
// Удаление элемента и всех его дочерних элементов
|
|
34
|
+
const idsToRemove = children ? [id, ...childrenIds] : [id];
|
|
35
|
+
const filteredValue = value?.filter((selectedItem) => {
|
|
36
|
+
const selectedId = (0, utils_1.getIdFromValue)(selectedItem);
|
|
37
|
+
return !idsToRemove.includes(selectedId);
|
|
38
|
+
});
|
|
39
|
+
return onChange(filteredValue);
|
|
38
40
|
}
|
|
41
|
+
// Добавление элемента и всех его дочерних элементов
|
|
42
|
+
const itemsToAdd = (0, utils_1.getItemsToAdd)(item, children, childrenIds, isObjectMode);
|
|
43
|
+
const newValue = value ? [...value, ...itemsToAdd] : itemsToAdd;
|
|
44
|
+
onChange(newValue);
|
|
39
45
|
};
|
|
40
46
|
return {
|
|
41
47
|
isSelected,
|