@leav/ui 0.3.6-c939f2f → 0.3.6-cc1031e
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/dist/__mocks__/common/attribute.d.ts +1 -0
- package/dist/__mocks__/common/attribute.js +9 -1
- package/dist/__mocks__/common/attribute.js.map +1 -1
- package/dist/__mocks__/common/form.d.ts +11 -5
- package/dist/__mocks__/common/form.js +18 -2
- package/dist/__mocks__/common/form.js.map +1 -1
- package/dist/__mocks__/common/record.d.ts +13 -2
- package/dist/__mocks__/common/record.js.map +1 -1
- package/dist/__mocks__/common/value.js +3 -1
- package/dist/__mocks__/common/value.js.map +1 -1
- package/dist/__mocks__/common/view.js +7 -5
- package/dist/__mocks__/common/view.js.map +1 -1
- package/dist/__mocks__/mockQuery/mockGetLibraryDetailExtendedQuery.js +1 -1
- package/dist/__mocks__/mockQuery/mockGetLibraryDetailExtendedQuery.js.map +1 -1
- package/dist/__mocks__/mockQuery/mockGetViewListQuery.js +2 -1
- package/dist/__mocks__/mockQuery/mockGetViewListQuery.js.map +1 -1
- package/dist/_gqlTypes/index.d.ts +462 -77
- package/dist/_gqlTypes/index.js +1274 -1055
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_queries/libraries/getLibraryDetailExtendQuery.d.ts +3 -4
- package/dist/_queries/libraries/getLibraryDetailExtendQuery.js +2 -3
- package/dist/_queries/libraries/getLibraryDetailExtendQuery.js.map +1 -1
- package/dist/_queries/records/getRecordColumnsValues.d.ts +5 -3
- package/dist/_queries/records/getRecordColumnsValues.js +4 -1
- package/dist/_queries/records/getRecordColumnsValues.js.map +1 -1
- package/dist/_queries/records/getRecordsFromLibraryQuery.js +1 -0
- package/dist/_queries/records/getRecordsFromLibraryQuery.js.map +1 -1
- package/dist/_queries/records/recordFormAttributeFragment.js +2 -0
- package/dist/_queries/records/recordFormAttributeFragment.js.map +1 -1
- package/dist/_queries/views/saveViewMutation.js +1 -1
- package/dist/_queries/views/viewDetailsFragment.js +14 -11
- package/dist/_queries/views/viewDetailsFragment.js.map +1 -1
- package/dist/_utils/index.js +5 -2
- package/dist/_utils/index.js.map +1 -1
- package/dist/_utils/interleaveElement.d.ts +1 -0
- package/dist/{components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.js → _utils/interleaveElement.js} +2 -6
- package/dist/_utils/interleaveElement.js.map +1 -0
- package/dist/antdTheme/index.d.ts +0 -3
- package/dist/antdTheme/index.js +3 -42
- package/dist/antdTheme/index.js.map +1 -1
- package/dist/components/CreateDirectory/CreateDirectory.js +1 -1
- package/dist/components/CreateDirectory/CreateDirectory.js.map +1 -1
- package/dist/components/EditApplication/EditApplication.js +2 -2
- package/dist/components/EditApplication/EditApplication.js.map +1 -1
- package/dist/components/EditApplication/_types.d.ts +2 -2
- package/dist/components/Explorer/DataView.d.ts +10 -1
- package/dist/components/Explorer/DataView.js +37 -36
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +9 -5
- package/dist/components/Explorer/Explorer.js +61 -17
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/ExplorerTitle.d.ts +9 -0
- package/dist/components/Explorer/ExplorerTitle.js +47 -0
- package/dist/components/Explorer/ExplorerTitle.js.map +1 -0
- package/dist/components/Explorer/IdCard.d.ts +7 -0
- package/dist/components/Explorer/IdCard.js +15 -0
- package/dist/components/Explorer/IdCard.js.map +1 -0
- package/dist/components/Explorer/TableCell.d.ts +8 -0
- package/dist/components/Explorer/TableCell.js +144 -0
- package/dist/components/Explorer/TableCell.js.map +1 -0
- package/dist/components/Explorer/TableTagGroup.d.ts +7 -0
- package/dist/components/Explorer/TableTagGroup.js +30 -0
- package/dist/components/Explorer/TableTagGroup.js.map +1 -0
- package/dist/components/Explorer/_constants.d.ts +4 -0
- package/dist/components/Explorer/_constants.js +17 -0
- package/dist/components/Explorer/_constants.js.map +1 -0
- package/dist/components/Explorer/_queries/useExplorerData.d.ts +31 -7
- package/dist/components/Explorer/_queries/useExplorerData.js +199 -19
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +63 -3
- package/dist/components/Explorer/conditionsHelper.d.ts +2 -0
- package/dist/components/Explorer/conditionsHelper.js +16 -0
- package/dist/components/Explorer/conditionsHelper.js.map +1 -0
- package/dist/components/Explorer/display-view-filters/ExplorerToolBar.d.ts +4 -0
- package/dist/components/Explorer/display-view-filters/ExplorerToolBar.js +47 -0
- package/dist/components/Explorer/display-view-filters/ExplorerToolBar.js.map +1 -0
- package/dist/components/Explorer/index.d.ts +1 -3
- package/dist/components/Explorer/index.js +1 -3
- package/dist/components/Explorer/index.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.d.ts +12 -0
- package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js +85 -0
- package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.d.ts +5 -0
- package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js +12 -0
- package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.d.ts +11 -0
- package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.js +61 -0
- package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/configure-display/ConfigureDisplay.d.ts +6 -0
- package/dist/components/Explorer/manage-view-settings/configure-display/ConfigureDisplay.js +28 -0
- package/dist/components/Explorer/manage-view-settings/configure-display/ConfigureDisplay.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.d.ts +6 -0
- package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js +56 -0
- package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/configure-display/view-type/SelectViewType.d.ts +8 -0
- package/dist/components/Explorer/manage-view-settings/configure-display/view-type/SelectViewType.js +12 -0
- package/dist/components/Explorer/manage-view-settings/configure-display/view-type/SelectViewType.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.d.ts +4 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +78 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.d.ts +9 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js +33 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.js +22 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ColorAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ColorAttributeDropDown.js +11 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ColorAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js +66 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateRangeAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateRangeAttributeDropDown.js +11 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateRangeAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/EncryptedAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/EncryptedAttributeDropDown.js +11 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/EncryptedAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ExtendedAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ExtendedAttributeDropDown.js +11 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ExtendedAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js +71 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueList.d.ts +10 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueList.js +75 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueList.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.js +19 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.js +28 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.d.ts +11 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js +100 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/index.d.ts +8 -0
- package/dist/components/Explorer/manage-view-settings/index.js +11 -0
- package/dist/components/Explorer/manage-view-settings/index.js.map +1 -0
- package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/EditSettingsContext.d.ts +2 -0
- package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/EditSettingsContext.js +1 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContext.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContextProvider.d.ts +7 -0
- package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/EditSettingsContextProvider.js +2 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContextProvider.js.map +1 -0
- package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/SidePanel.js +2 -2
- package/dist/components/Explorer/manage-view-settings/open-view-settings/SidePanel.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useEditSettings.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.d.ts +5 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js +39 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -0
- package/dist/components/Explorer/{edit-settings → manage-view-settings/router-menu}/SettingItem.d.ts +4 -2
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingItem.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.d.ts +8 -0
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +70 -0
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.d.ts +4 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js +109 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.d.ts +10 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js +32 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/ViewSettingsContext.d.ts +6 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/ViewSettingsContext.js +11 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/ViewSettingsContext.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/useViewSettingsContext.d.ts +4 -0
- package/dist/components/{RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.js → Explorer/manage-view-settings/store-view-settings/useViewSettingsContext.js} +3 -3
- package/dist/components/Explorer/manage-view-settings/store-view-settings/useViewSettingsContext.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.d.ts +4 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +24 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.d.ts +145 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +199 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -0
- package/dist/components/Explorer/{useCreateMainAction.d.ts → useCreateAction.d.ts} +5 -3
- package/dist/components/Explorer/useCreateAction.js +73 -0
- package/dist/components/Explorer/useCreateAction.js.map +1 -0
- package/dist/components/Explorer/useEditAction.js +9 -7
- package/dist/components/Explorer/useEditAction.js.map +1 -1
- package/dist/components/Explorer/usePagination.d.ts +7 -0
- package/dist/components/Explorer/usePagination.js +25 -0
- package/dist/components/Explorer/usePagination.js.map +1 -0
- package/dist/components/Explorer/usePrimaryActions.d.ts +12 -0
- package/dist/components/Explorer/usePrimaryActions.js +28 -0
- package/dist/components/Explorer/usePrimaryActions.js.map +1 -0
- package/dist/components/Explorer/useRemoveAction.d.ts +12 -0
- package/dist/components/Explorer/useRemoveAction.js +90 -0
- package/dist/components/Explorer/useRemoveAction.js.map +1 -0
- package/dist/components/Explorer/useSearchInput.d.ts +10 -0
- package/dist/components/Explorer/useSearchInput.js +31 -0
- package/dist/components/Explorer/useSearchInput.js.map +1 -0
- package/dist/components/Explorer/useTableScrollableHeight.d.ts +5 -0
- package/dist/components/Explorer/useTableScrollableHeight.js +15 -0
- package/dist/components/Explorer/useTableScrollableHeight.js.map +1 -0
- package/dist/components/Explorer/useViewSettingsReducer.d.ts +8 -0
- package/dist/components/Explorer/useViewSettingsReducer.js +126 -0
- package/dist/components/Explorer/useViewSettingsReducer.js.map +1 -0
- package/dist/components/ExportModal/ExportModal.js +2 -2
- package/dist/components/ExportModal/ExportModal.js.map +1 -1
- package/dist/components/ImportModal/ImportModalConfigStep/ImportModalConfigStep.js +5 -5
- package/dist/components/ImportModal/ImportModalConfigStep/ImportModalConfigStep.js.map +1 -1
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js +2 -2
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js.map +1 -1
- package/dist/components/LibraryItemsList/LibraryItemsListContent/LibraryItemsListContent.js +7 -11
- package/dist/components/LibraryItemsList/LibraryItemsListContent/LibraryItemsListContent.js.map +1 -1
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/StandardCell.js +7 -2
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/StandardCell.js.map +1 -1
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Header/Header.js +7 -5
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Header/Header.js.map +1 -1
- package/dist/components/LibraryItemsList/MenuView/MenuView.js +4 -9
- package/dist/components/LibraryItemsList/MenuView/MenuView.js.map +1 -1
- package/dist/components/LibraryItemsList/ViewPanel/EditView/EditView.js +2 -3
- package/dist/components/LibraryItemsList/ViewPanel/EditView/EditView.js.map +1 -1
- package/dist/components/LibraryItemsList/ViewPanel/View/View.js +3 -3
- package/dist/components/LibraryItemsList/ViewPanel/View/View.js.map +1 -1
- package/dist/components/LibraryItemsList/helpers/getFieldsFromView.js +4 -9
- package/dist/components/LibraryItemsList/helpers/getFieldsFromView.js.map +1 -1
- package/dist/components/LibraryItemsList/hooks/useLibraryView/useLibraryView.js +7 -5
- package/dist/components/LibraryItemsList/hooks/useLibraryView/useLibraryView.js.map +1 -1
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/_types.d.ts +1 -1
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.d.ts +1 -1
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.js +25 -33
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.js.map +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +10 -18
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +16 -3
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +10 -21
- package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.d.ts +5 -1
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.js +44 -34
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/extractFormElements/extractFormElements.d.ts +3 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/extractFormElements/extractFormElements.js +8 -2
- package/dist/components/RecordEdition/EditRecordContent/helpers/extractFormElements/extractFormElements.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.d.ts +3 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.js +2 -7
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.js +2 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.d.ts +6 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.js +18 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.d.ts +4 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.js +25 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.d.ts +5 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +178 -186
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.d.ts +2 -8
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js +11 -30
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.d.ts +2 -13
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js +73 -45
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.d.ts +3 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js +35 -46
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.d.ts +3 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js +11 -76
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.d.ts +3 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js +32 -49
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.d.ts +3 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js +38 -54
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.d.ts +3 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js +51 -63
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.d.ts +3 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js +33 -53
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.d.ts +17 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +67 -401
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.d.ts +4 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/{MonoValueSelect.js → DSListSelect.js} +48 -52
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/_types.d.ts +2 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.d.ts +16 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.js +2 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.d.ts +42 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js +55 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.d.ts +12 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js +32 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/ValuesAdd.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/ValuesAdd.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +10 -4
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.d.ts +2 -0
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js +2 -2
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.d.ts +4 -1
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +36 -3
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/PropertiesList/PropertiesList.d.ts +4 -7
- package/dist/components/RecordEdition/EditRecordSidebar/PropertiesList/PropertiesList.js +6 -8
- package/dist/components/RecordEdition/EditRecordSidebar/PropertiesList/PropertiesList.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.d.ts +9 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js +42 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.d.ts +6 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.js +35 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.d.ts +2 -281
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js +25 -56
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueDetails.js +1 -13
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueDetails.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNode.d.ts +4 -7
- package/dist/components/SelectTreeNode/SelectTreeNode.js +17 -135
- package/dist/components/SelectTreeNode/SelectTreeNode.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.d.ts +16 -0
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +131 -0
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -0
- package/dist/components/SelectTreeNode/index.d.ts +1 -1
- package/dist/components/SelectTreeNode/index.js +1 -1
- package/dist/components/SelectTreeNode/index.js.map +1 -1
- package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.d.ts +4 -7
- package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.js +10 -10
- package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.js.map +1 -1
- package/dist/components/SelectTreeNodeModal/index.d.ts +1 -2
- package/dist/components/SelectTreeNodeModal/index.js +1 -2
- package/dist/components/SelectTreeNodeModal/index.js.map +1 -1
- package/dist/components/UploadFiles/UploadFiles.js +1 -1
- package/dist/components/UploadFiles/UploadFiles.js.map +1 -1
- package/dist/components/ValuesVersionConfigurator/VersionTree/VersionTree.js +2 -2
- package/dist/components/ValuesVersionConfigurator/VersionTree/VersionTree.js.map +1 -1
- package/dist/constants.d.ts +3 -0
- package/dist/constants.js +3 -0
- package/dist/constants.js.map +1 -1
- package/dist/hooks/useDebouncedValue/index.d.ts +1 -0
- package/dist/{components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler → hooks/useDebouncedValue}/index.js +1 -1
- package/dist/hooks/useDebouncedValue/index.js.map +1 -0
- package/dist/hooks/useExecuteSaveViewMutation/index.d.ts +1 -0
- package/dist/{components/RecordEdition/EditRecordContent/reducers/standardFieldReducer → hooks/useExecuteSaveViewMutation}/index.js +1 -2
- package/dist/hooks/useExecuteSaveViewMutation/index.js.map +1 -0
- package/dist/hooks/useExecuteSaveViewMutation/useExecuteSaveViewMutation.d.ts +6 -0
- package/dist/hooks/{useExecuteAddViewMutation/useExecuteAddViewMutation.js → useExecuteSaveViewMutation/useExecuteSaveViewMutation.js} +6 -6
- package/dist/hooks/useExecuteSaveViewMutation/useExecuteSaveViewMutation.js.map +1 -0
- package/dist/hooks/useGetRecordForm/useGetRecordForm.d.ts +1 -0
- package/dist/hooks/useGetRecordForm/useGetRecordForm.js.map +1 -1
- package/dist/locales/en/shared.json +71 -10
- package/dist/locales/fr/shared.json +71 -10
- package/dist/types/views.d.ts +4 -4
- package/package.json +7 -2
- package/dist/components/Explorer/edit-settings/DisplayMode.d.ts +0 -2
- package/dist/components/Explorer/edit-settings/DisplayMode.js +0 -10
- package/dist/components/Explorer/edit-settings/DisplayMode.js.map +0 -1
- package/dist/components/Explorer/edit-settings/EditSettingsContext.js.map +0 -1
- package/dist/components/Explorer/edit-settings/EditSettingsContextProvider.d.ts +0 -2
- package/dist/components/Explorer/edit-settings/EditSettingsContextProvider.js.map +0 -1
- package/dist/components/Explorer/edit-settings/SettingItem.js.map +0 -1
- package/dist/components/Explorer/edit-settings/SettingsPanel.d.ts +0 -3
- package/dist/components/Explorer/edit-settings/SettingsPanel.js +0 -53
- package/dist/components/Explorer/edit-settings/SettingsPanel.js.map +0 -1
- package/dist/components/Explorer/edit-settings/SidePanel.js.map +0 -1
- package/dist/components/Explorer/edit-settings/useEditSettings.js.map +0 -1
- package/dist/components/Explorer/edit-settings/useOpenSettings.d.ts +0 -1
- package/dist/components/Explorer/edit-settings/useOpenSettings.js +0 -19
- package/dist/components/Explorer/edit-settings/useOpenSettings.js.map +0 -1
- package/dist/components/Explorer/useCreateMainAction.js +0 -36
- package/dist/components/Explorer/useCreateMainAction.js.map +0 -1
- package/dist/components/Explorer/useDeactivateAction.d.ts +0 -12
- package/dist/components/Explorer/useDeactivateAction.js +0 -51
- package/dist/components/Explorer/useDeactivateAction.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer.d.ts +0 -138
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer.js +0 -361
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.d.ts +0 -7
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton.d.ts +0 -8
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton.js +0 -23
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/CheckboxInput.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/CheckboxInput.js +0 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/CheckboxInput.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/ColorInput.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/ColorInput.js +0 -22
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/ColorInput.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/DateInput.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/DateInput.js +0 -22
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/DateInput.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/EncryptedInput.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/EncryptedInput.js +0 -19
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/EncryptedInput.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/NumberInput.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/NumberInput.js +0 -32
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/NumberInput.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/RichTextEditorInput.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/RichTextEditorInput.js +0 -51
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/RichTextEditorInput.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/TextInput.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/TextInput.js +0 -26
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/TextInput.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueDisplayHandler.d.ts +0 -13
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueDisplayHandler.js +0 -90
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueDisplayHandler.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/ColorPickerBlock.d.ts +0 -7
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/ColorPickerBlock.js +0 -45
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/ColorPickerBlock.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/StandardFieldValueRead.d.ts +0 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/StandardFieldValueRead.js +0 -141
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/StandardFieldValueRead.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/index.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.js.map +0 -1
- package/dist/hooks/useExecuteAddViewMutation/useExecuteAddViewMutation.d.ts +0 -6
- package/dist/hooks/useExecuteAddViewMutation/useExecuteAddViewMutation.js.map +0 -1
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/SidePanel.d.ts +0 -0
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/useEditSettings.d.ts +0 -0
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/useEditSettings.js +0 -0
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/router-menu}/SettingItem.js +0 -0
package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { v4 as uuid } from 'uuid';
|
|
2
|
+
import { hasOnlyNoValueConditions } from '../../conditionsHelper';
|
|
3
|
+
import { conditionsByFormat } from '../filter-items/filter-type/useConditionOptionsByType';
|
|
4
|
+
export const ViewSettingsActionTypes = {
|
|
5
|
+
RESET: 'RESET',
|
|
6
|
+
ADD_ATTRIBUTE: 'ADD_ATTRIBUTE',
|
|
7
|
+
REMOVE_ATTRIBUTE: 'REMOVE_ATTRIBUTE',
|
|
8
|
+
MOVE_ATTRIBUTE: 'MOVE_ATTRIBUTE',
|
|
9
|
+
RESET_ATTRIBUTES: 'RESET_ATTRIBUTES',
|
|
10
|
+
CHANGE_VIEW_TYPE: 'CHANGE_VIEW_TYPE',
|
|
11
|
+
ADD_SORT: 'ADD_SORT',
|
|
12
|
+
REMOVE_SORT: 'REMOVE_SORT',
|
|
13
|
+
MOVE_SORT: 'MOVE_SORT',
|
|
14
|
+
CHANGE_SORT_ORDER: 'CHANGE_SORT_ORDER',
|
|
15
|
+
CHANGE_PAGE_SIZE: 'CHANGE_PAGE_SIZE',
|
|
16
|
+
CHANGE_FULLTEXT_SEARCH: 'CHANGE_FULLTEXT_SEARCH',
|
|
17
|
+
CLEAR_FULLTEXT_SEARCH: 'CLEAR_FULLTEXT_SEARCH',
|
|
18
|
+
ADD_FILTER: 'ADD_FILTER',
|
|
19
|
+
RESET_FILTER: 'RESET_FILTER',
|
|
20
|
+
REMOVE_FILTER: 'REMOVE_FILTER',
|
|
21
|
+
MOVE_FILTER: 'MOVE_FILTER',
|
|
22
|
+
CHANGE_FILTER_CONFIG: 'CHANGE_FILTER_CONFIG',
|
|
23
|
+
RESTORE_INITIAL_VIEW_SETTINGS: 'RESTORE_INITIAL_VIEW_SETTINGS'
|
|
24
|
+
};
|
|
25
|
+
const changePageSize = (state, payload) => ({
|
|
26
|
+
...state,
|
|
27
|
+
pageSize: payload.pageSize
|
|
28
|
+
});
|
|
29
|
+
const addAttribute = (state, payload) => ({
|
|
30
|
+
...state,
|
|
31
|
+
attributesIds: [...state.attributesIds, payload.attributeId]
|
|
32
|
+
});
|
|
33
|
+
const removeAttribute = (state, payload) => ({
|
|
34
|
+
...state,
|
|
35
|
+
attributesIds: state.attributesIds.filter(attributesId => attributesId !== payload.attributeId)
|
|
36
|
+
});
|
|
37
|
+
const moveAttribute = (state, payload) => {
|
|
38
|
+
const attributesIds = [...state.attributesIds];
|
|
39
|
+
const [attributeIdToMove] = attributesIds.splice(payload.indexFrom, 1);
|
|
40
|
+
// TODO use newES6 syntax (toSpliced)
|
|
41
|
+
attributesIds.splice(payload.indexTo, 0, attributeIdToMove);
|
|
42
|
+
return {
|
|
43
|
+
...state,
|
|
44
|
+
attributesIds
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const resetAttributes = state => ({
|
|
48
|
+
...state,
|
|
49
|
+
attributesIds: []
|
|
50
|
+
});
|
|
51
|
+
const changeViewType = (state, payload) => ({
|
|
52
|
+
...state,
|
|
53
|
+
viewType: payload.viewType
|
|
54
|
+
});
|
|
55
|
+
const addSort = (state, payload) => ({
|
|
56
|
+
...state,
|
|
57
|
+
sort: [...state.sort, { field: payload.field, order: payload.order }]
|
|
58
|
+
});
|
|
59
|
+
const removeSort = (state, payload) => ({
|
|
60
|
+
...state,
|
|
61
|
+
sort: state.sort.filter(({ field: attributeId }) => attributeId !== payload.field)
|
|
62
|
+
});
|
|
63
|
+
const changeSortOrder = (state, payload) => ({
|
|
64
|
+
...state,
|
|
65
|
+
sort: state.sort.map(sort => (sort.field === payload.field ? { ...sort, order: payload.order } : sort))
|
|
66
|
+
});
|
|
67
|
+
const moveSort = (state, payload) => {
|
|
68
|
+
const attributesUsedToSort = [...state.sort];
|
|
69
|
+
const [sortToMove] = attributesUsedToSort.splice(payload.indexFrom, 1);
|
|
70
|
+
attributesUsedToSort.splice(payload.indexTo, 0, sortToMove);
|
|
71
|
+
return {
|
|
72
|
+
...state,
|
|
73
|
+
sort: attributesUsedToSort
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
const changeFulltextSearch = (state, payload) => ({
|
|
77
|
+
...state,
|
|
78
|
+
fulltextSearch: payload.search
|
|
79
|
+
});
|
|
80
|
+
export const clearFulltextSearch = state => ({
|
|
81
|
+
...state,
|
|
82
|
+
fulltextSearch: ''
|
|
83
|
+
});
|
|
84
|
+
const addFilter = (state, payload) => ({
|
|
85
|
+
...state,
|
|
86
|
+
filters: [
|
|
87
|
+
...state.filters,
|
|
88
|
+
{
|
|
89
|
+
...payload,
|
|
90
|
+
id: uuid(),
|
|
91
|
+
condition: hasOnlyNoValueConditions(payload.attribute.format)
|
|
92
|
+
? null
|
|
93
|
+
: (conditionsByFormat[payload.attribute.format][0] ?? null),
|
|
94
|
+
value: null
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
});
|
|
98
|
+
const resetFilter = (state, payload) => ({
|
|
99
|
+
...state,
|
|
100
|
+
filters: state.filters.map(filter => {
|
|
101
|
+
if (filter.id === payload.id) {
|
|
102
|
+
const initialViewFilter = state.initialViewSettings.filters.find(({ id }) => id === payload.id);
|
|
103
|
+
return (initialViewFilter ?? {
|
|
104
|
+
...filter,
|
|
105
|
+
condition: hasOnlyNoValueConditions(filter.attribute.format)
|
|
106
|
+
? null
|
|
107
|
+
: (conditionsByFormat[filter.attribute.format][0] ?? null),
|
|
108
|
+
value: null
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return filter;
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
const removeFilter = (state, payload) => ({
|
|
115
|
+
...state,
|
|
116
|
+
filters: state.filters.filter(({ id }) => id !== payload.id)
|
|
117
|
+
});
|
|
118
|
+
const changeFilterConfig = (state, payload) => ({
|
|
119
|
+
...state,
|
|
120
|
+
filters: state.filters.map(filter => (filter.id === payload.id ? { ...filter, ...payload } : filter))
|
|
121
|
+
});
|
|
122
|
+
const moveFilter = (state, payload) => {
|
|
123
|
+
const attributesUsedToFilter = [...state.filters];
|
|
124
|
+
const [filterToMove] = attributesUsedToFilter.splice(payload.indexFrom, 1);
|
|
125
|
+
attributesUsedToFilter.splice(payload.indexTo, 0, filterToMove);
|
|
126
|
+
return {
|
|
127
|
+
...state,
|
|
128
|
+
filters: attributesUsedToFilter
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
const reset = (_, payload) => payload;
|
|
132
|
+
const restoreInitialViewSettings = state => ({
|
|
133
|
+
...state,
|
|
134
|
+
...state.initialViewSettings
|
|
135
|
+
});
|
|
136
|
+
export const viewSettingsReducer = (state, action) => {
|
|
137
|
+
switch (action.type) {
|
|
138
|
+
case ViewSettingsActionTypes.CHANGE_PAGE_SIZE: {
|
|
139
|
+
return changePageSize(state, action.payload);
|
|
140
|
+
}
|
|
141
|
+
case ViewSettingsActionTypes.ADD_ATTRIBUTE: {
|
|
142
|
+
return addAttribute(state, action.payload);
|
|
143
|
+
}
|
|
144
|
+
case ViewSettingsActionTypes.REMOVE_ATTRIBUTE: {
|
|
145
|
+
return removeAttribute(state, action.payload);
|
|
146
|
+
}
|
|
147
|
+
case ViewSettingsActionTypes.MOVE_ATTRIBUTE: {
|
|
148
|
+
return moveAttribute(state, action.payload);
|
|
149
|
+
}
|
|
150
|
+
case ViewSettingsActionTypes.RESET_ATTRIBUTES: {
|
|
151
|
+
return resetAttributes(state);
|
|
152
|
+
}
|
|
153
|
+
case ViewSettingsActionTypes.CHANGE_VIEW_TYPE: {
|
|
154
|
+
return changeViewType(state, action.payload);
|
|
155
|
+
}
|
|
156
|
+
case ViewSettingsActionTypes.ADD_SORT: {
|
|
157
|
+
return addSort(state, action.payload);
|
|
158
|
+
}
|
|
159
|
+
case ViewSettingsActionTypes.REMOVE_SORT: {
|
|
160
|
+
return removeSort(state, action.payload);
|
|
161
|
+
}
|
|
162
|
+
case ViewSettingsActionTypes.MOVE_SORT: {
|
|
163
|
+
return moveSort(state, action.payload);
|
|
164
|
+
}
|
|
165
|
+
case ViewSettingsActionTypes.CHANGE_SORT_ORDER: {
|
|
166
|
+
return changeSortOrder(state, action.payload);
|
|
167
|
+
}
|
|
168
|
+
case ViewSettingsActionTypes.CHANGE_FULLTEXT_SEARCH: {
|
|
169
|
+
return changeFulltextSearch(state, action.payload);
|
|
170
|
+
}
|
|
171
|
+
case ViewSettingsActionTypes.CLEAR_FULLTEXT_SEARCH: {
|
|
172
|
+
return clearFulltextSearch(state);
|
|
173
|
+
}
|
|
174
|
+
case ViewSettingsActionTypes.ADD_FILTER: {
|
|
175
|
+
return addFilter(state, action.payload);
|
|
176
|
+
}
|
|
177
|
+
case ViewSettingsActionTypes.RESET_FILTER: {
|
|
178
|
+
return resetFilter(state, action.payload);
|
|
179
|
+
}
|
|
180
|
+
case ViewSettingsActionTypes.REMOVE_FILTER: {
|
|
181
|
+
return removeFilter(state, action.payload);
|
|
182
|
+
}
|
|
183
|
+
case ViewSettingsActionTypes.CHANGE_FILTER_CONFIG: {
|
|
184
|
+
return changeFilterConfig(state, action.payload);
|
|
185
|
+
}
|
|
186
|
+
case ViewSettingsActionTypes.MOVE_FILTER: {
|
|
187
|
+
return moveFilter(state, action.payload);
|
|
188
|
+
}
|
|
189
|
+
case ViewSettingsActionTypes.RESET: {
|
|
190
|
+
return reset(state, action.payload);
|
|
191
|
+
}
|
|
192
|
+
case ViewSettingsActionTypes.RESTORE_INITIAL_VIEW_SETTINGS: {
|
|
193
|
+
return restoreInitialViewSettings(state);
|
|
194
|
+
}
|
|
195
|
+
default:
|
|
196
|
+
return state;
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
//# sourceMappingURL=viewSettingsReducer.js.map
|
package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewSettingsReducer.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,EAAE,IAAI,IAAI,EAAC,MAAM,MAAM,CAAC;AAChC,OAAO,EAAC,wBAAwB,EAAC,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAC,kBAAkB,EAAC,MAAM,uDAAuD,CAAC;AAIzF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACnC,KAAK,EAAE,OAAO;IACd,aAAa,EAAE,eAAe;IAC9B,gBAAgB,EAAE,kBAAkB;IACpC,cAAc,EAAE,gBAAgB;IAChC,gBAAgB,EAAE,kBAAkB;IACpC,gBAAgB,EAAE,kBAAkB;IACpC,QAAQ,EAAE,UAAU;IACpB,W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KAAK,uBAAuB,CAAC,aAAa,CAAC,CAAC,CAAC;YACzC,OAAO,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;QACD,KAAK,uBAAuB,CAAC,oBAAoB,CAAC,CAAC,CAAC;YAChD,OAAO,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QACrD,CAAC;QACD,KAAK,uBAAuB,CAAC,WAAW,CAAC,CAAC,CAAC;YACvC,OAAO,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,CAAC;QACD,KAAK,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC;YACjC,OAAO,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;QACD,KAAK,uBAAuB,CAAC,6BAA6B,CAAC,CAAC,CAAC;YACzD,OAAO,0BAA0B,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC;QACD;YACI,OAAO,KAAK,CAAC;IACrB,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionHook } from './_types';
|
|
1
|
+
import { ActionHook, Entrypoint, IPrimaryAction } from './_types';
|
|
2
2
|
/**
|
|
3
3
|
* Hook used to get the action for `<DataView />` component.
|
|
4
4
|
*
|
|
@@ -10,10 +10,12 @@ import { ActionHook } from './_types';
|
|
|
10
10
|
* @param library - the library's id to add new item
|
|
11
11
|
* @param refetch - method to call to refresh the list. New item will be visible if it matches filters and sorts
|
|
12
12
|
*/
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const useCreateAction: ({ isEnabled, library, entrypoint, itemsCount, refetch }: ActionHook<{
|
|
14
14
|
library: string;
|
|
15
|
+
entrypoint: Entrypoint;
|
|
16
|
+
itemsCount: number;
|
|
15
17
|
refetch: () => void;
|
|
16
18
|
}>) => {
|
|
17
|
-
|
|
19
|
+
createAction: IPrimaryAction;
|
|
18
20
|
createModal: JSX.Element;
|
|
19
21
|
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
|
+
// This file is released under LGPL V3
|
|
4
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { FaPlus } from 'react-icons/fa';
|
|
7
|
+
import { EditRecordModal } from '../../components';
|
|
8
|
+
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
9
|
+
import useSaveValueBatchMutation from '../../components/RecordEdition/EditRecordContent/hooks/useExecuteSaveValueBatchMutation';
|
|
10
|
+
import { useExplorerLinkAttributeQuery } from '../../_gqlTypes';
|
|
11
|
+
/**
|
|
12
|
+
* Hook used to get the action for `<DataView />` component.
|
|
13
|
+
*
|
|
14
|
+
* When the creation is done, we refresh all data even if the new record will not be visible due to some filters.
|
|
15
|
+
*
|
|
16
|
+
* It returns also two parts : one for the call action button - one for displayed the modal required by the action.
|
|
17
|
+
*
|
|
18
|
+
* @param isEnabled - whether the action is present
|
|
19
|
+
* @param library - the library's id to add new item
|
|
20
|
+
* @param refetch - method to call to refresh the list. New item will be visible if it matches filters and sorts
|
|
21
|
+
*/
|
|
22
|
+
export const useCreateAction = ({ isEnabled, library, entrypoint, itemsCount, refetch }) => {
|
|
23
|
+
const { t } = useSharedTranslation();
|
|
24
|
+
const [isRecordCreationVisible, setRecordCreationVisible] = useState(false);
|
|
25
|
+
const [multipleValues, setIsMultivalues] = useState(false);
|
|
26
|
+
const { saveValues } = useSaveValueBatchMutation();
|
|
27
|
+
useExplorerLinkAttributeQuery({
|
|
28
|
+
skip: entrypoint.type !== 'link',
|
|
29
|
+
variables: {
|
|
30
|
+
id: entrypoint.linkAttributeId
|
|
31
|
+
},
|
|
32
|
+
onCompleted: data => {
|
|
33
|
+
const attributeData = data?.attributes?.list?.[0];
|
|
34
|
+
if (!attributeData) {
|
|
35
|
+
throw new Error('Unknown link attribute');
|
|
36
|
+
}
|
|
37
|
+
setIsMultivalues(attributeData.multiple_values);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const canCreateRecord = entrypoint.type === 'library' ? true : multipleValues || itemsCount === 0;
|
|
41
|
+
const createAction = {
|
|
42
|
+
callback: () => {
|
|
43
|
+
setRecordCreationVisible(true);
|
|
44
|
+
},
|
|
45
|
+
icon: _jsx(FaPlus, {}),
|
|
46
|
+
disabled: !canCreateRecord,
|
|
47
|
+
label: t('explorer.create-one')
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
createAction: isEnabled ? createAction : null,
|
|
51
|
+
createModal: isRecordCreationVisible ? (_jsx(EditRecordModal, { open: true, record: null, library: library, onClose: () => {
|
|
52
|
+
setRecordCreationVisible(false);
|
|
53
|
+
}, onCreate: newRecord => {
|
|
54
|
+
refetch();
|
|
55
|
+
setRecordCreationVisible(false);
|
|
56
|
+
if (entrypoint.type === 'link') {
|
|
57
|
+
saveValues({
|
|
58
|
+
id: entrypoint.parentRecordId,
|
|
59
|
+
library: {
|
|
60
|
+
id: entrypoint.parentLibraryId
|
|
61
|
+
}
|
|
62
|
+
}, [
|
|
63
|
+
{
|
|
64
|
+
attribute: entrypoint.linkAttributeId,
|
|
65
|
+
idValue: null,
|
|
66
|
+
value: newRecord.id
|
|
67
|
+
}
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
}, submitButtons: ['create'] })) : null
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=useCreateAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateAction.js","sourceRoot":"","sources":["../../../src/components/Explorer/useCreateAction.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,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C,CAAC;IAElG,MAAM,YAAY,GAAmB;QACjC,QAAQ,EAAE,GAAG,EAAE;YACX,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;QACD,IAAI,EAAE,KAAC,MAAM,KAAG;QAChB,QAAQ,EAAE,CAAC,eAAe;QAC1B,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC;KAClC,CAAC;IAEF,OAAO;QACH,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI;QAC7C,WAAW,EAAE,uBAAuB,CAAC,CAAC,CAAC,CACnC,KAAC,eAAe,IACZ,IAAI,QACJ,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,GAAG,EAAE;gBACV,wBAAwB,CAAC,KAAK,CAAC,CAAC;YACpC,CAAC,EACD,QAAQ,EAAE,SAAS,CAAC,EAAE;gBAClB,OAAO,EAAE,CAAC;gBACV,wBAAwB,CAAC,KAAK,CAAC,CAAC;gBAChC,IAAI,UAAU,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;oBAC7B,UAAU,CACN;wBACI,EAAE,EAAE,UAAU,CAAC,cAAc;wBAC7B,OAAO,EAAE;4BACL,EAAE,EAAE,UAAU,CAAC,eAAe;yBACjC;qBACJ,EACD;wBACI;4BACI,SAAS,EAAE,UAAU,CAAC,eAAe;4BACrC,OAAO,EAAE,IAAI;4BACb,KAAK,EAAE,SAAS,CAAC,EAAE;yBACtB;qBACJ,CACJ,CAAC;gBACN,CAAC;YACL,CAAC,EACD,aAAa,EAAE,CAAC,QAAQ,CAAC,GAC3B,CACL,CAAC,CAAC,CAAC,IAAI;KACX,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -2,11 +2,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
3
|
// This file is released under LGPL V3
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
-
import { useState } from 'react';
|
|
5
|
+
import { useMemo, useState } from 'react';
|
|
6
6
|
import { FaPen } from 'react-icons/fa';
|
|
7
7
|
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
8
|
-
import { EditRecordModal } from '../../components';
|
|
9
|
-
import { RecordFilterCondition,
|
|
8
|
+
import { EditRecordModal } from '../../components/RecordEdition/EditRecordModal';
|
|
9
|
+
import { RecordFilterCondition, useExplorerLibraryDataLazyQuery } from '../../_gqlTypes';
|
|
10
10
|
/**
|
|
11
11
|
* Hook used to get the action for `<DataView />` component.
|
|
12
12
|
*
|
|
@@ -19,7 +19,7 @@ import { RecordFilterCondition, useExplorerLazyQuery } from '../../_gqlTypes';
|
|
|
19
19
|
*/
|
|
20
20
|
export const useEditAction = ({ isEnabled }) => {
|
|
21
21
|
const { t } = useSharedTranslation();
|
|
22
|
-
const [refreshItem] =
|
|
22
|
+
const [refreshItem] = useExplorerLibraryDataLazyQuery({ fetchPolicy: 'network-only' });
|
|
23
23
|
const [editingItem, setEditingItem] = useState(null);
|
|
24
24
|
const _editAction = {
|
|
25
25
|
label: t('explorer.edit-item'),
|
|
@@ -32,7 +32,8 @@ export const useEditAction = ({ isEnabled }) => {
|
|
|
32
32
|
refreshItem({
|
|
33
33
|
variables: {
|
|
34
34
|
libraryId: item.libraryId,
|
|
35
|
-
attributeIds: ['id'],
|
|
35
|
+
attributeIds: ['id'], // TODO: get list of displayed attributes stored in the view
|
|
36
|
+
pagination: { limit: 1 },
|
|
36
37
|
filters: [
|
|
37
38
|
{
|
|
38
39
|
condition: RecordFilterCondition.EQUAL,
|
|
@@ -44,9 +45,10 @@ export const useEditAction = ({ isEnabled }) => {
|
|
|
44
45
|
});
|
|
45
46
|
setEditingItem(null);
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
+
const editAction = useMemo(() => ({
|
|
48
49
|
editAction: isEnabled ? _editAction : null,
|
|
49
50
|
editModal: isEnabled && editingItem !== null ? (_jsx(EditRecordModal, { open: true, record: editingItem.whoAmI, library: editingItem.libraryId, onClose: () => _handleEditModalClose(editingItem) })) : null
|
|
50
|
-
};
|
|
51
|
+
}), [isEnabled, editingItem]);
|
|
52
|
+
return editAction;
|
|
51
53
|
};
|
|
52
54
|
//# sourceMappingURL=useEditAction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditAction.js","sourceRoot":"","sources":["../../../src/components/Explorer/useEditAction.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useEditAction.js","sourceRoot":"","sources":["../../../src/components/Explorer/useEditAction.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAC,qBAAqB,EAAE,+BAA+B,EAAC,MAAM,eAAe,CAAC;AAGrF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAC,SAAS,EAAa,EAAE,EAAE;IACrD,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,CAAC,WAAW,CAAC,GAAG,+BAA+B,CAAC,EAAC,WAAW,EAAE,cAAc,EAAC,CAAC,CAAC;IAErF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAmB,IAAI,CAAC,CAAC;IAEvE,MAAM,WAAW,GAAgB;QAC7B,KAAK,EAAE,CAAC,CAAC,oBAAoB,CAAC;QAC9B,IAAI,EAAE,KAAC,KAAK,KAAG;QACf,QAAQ,EAAE,IAAI,CAAC,EAAE;YACb,cAAc,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;KACJ,CAAC;IAEF,MAAM,qBAAqB,GAAG,CAAC,IAAe,EAAE,EAAE;QAC9C,WAAW,CAAC;YACR,SAAS,EAAE;gBACP,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,YAAY,EAAE,CAAC,IAAI,CAAC,EAAE,4DAA4D;gBAClF,UAAU,EAAE,EAAC,KAAK,EAAE,CAAC,EAAC;gBACtB,OAAO,EAAE;oBACL;wBACI,SAAS,EAAE,qBAAqB,CAAC,KAAK;wBACtC,KAAK,EAAE,IAAI;wBACX,KAAK,EAAE,IAAI,CAAC,MAAM;qBACrB;iBACJ;aACJ;SACJ,CAAC,CAAC;QACH,cAAc,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,OAAO,CACtB,GAAG,EAAE,CAAC,CAAC;QACH,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI;QAC1C,SAAS,EACL,SAAS,IAAI,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,CAChC,KAAC,eAAe,IACZ,IAAI,QACJ,MAAM,EAAE,WAAW,CAAC,MAAM,EAC1B,OAAO,EAAE,WAAW,CAAC,SAAS,EAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,WAAW,CAAC,GACnD,CACL,CAAC,CAAC,CAAC,IAAI;KACf,CAAC,EACF,CAAC,SAAS,EAAE,WAAW,CAAC,CAC3B,CAAC;IAEF,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
import { IViewSettingsAction } from './manage-view-settings';
|
|
3
|
+
export declare const usePagination: (dispatch: Dispatch<IViewSettingsAction>) => {
|
|
4
|
+
currentPage: number;
|
|
5
|
+
setNewPage: (newCurrentPage: number, ignoredPageSize: number) => void;
|
|
6
|
+
setNewPageSize: (ignoredCurrentPage: number, newPageSize: number) => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
+
// This file is released under LGPL V3
|
|
3
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { ViewSettingsActionTypes } from './manage-view-settings';
|
|
6
|
+
export const usePagination = (dispatch) => {
|
|
7
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
8
|
+
const setNewPage = (newCurrentPage, ignoredPageSize) => {
|
|
9
|
+
setCurrentPage(newCurrentPage);
|
|
10
|
+
};
|
|
11
|
+
const setNewPageSize = (ignoredCurrentPage, newPageSize) => {
|
|
12
|
+
dispatch({
|
|
13
|
+
type: ViewSettingsActionTypes.CHANGE_PAGE_SIZE,
|
|
14
|
+
payload: {
|
|
15
|
+
pageSize: newPageSize
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
currentPage,
|
|
21
|
+
setNewPage,
|
|
22
|
+
setNewPageSize
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=usePagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePagination.js","sourceRoot":"","sources":["../../../src/components/Explorer/usePagination.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAW,QAAQ,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EAAsB,uBAAuB,EAAC,MAAM,wBAAwB,CAAC;AAEpF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAuC,EAAE,EAAE;IACrE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAElD,MAAM,UAAU,GAAG,CAAC,cAAsB,EAAE,eAAuB,EAAE,EAAE;QACnE,cAAc,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,CAAC,kBAA0B,EAAE,WAAmB,EAAE,EAAE;QACvE,QAAQ,CAAC;YACL,IAAI,EAAE,uBAAuB,CAAC,gBAAgB;YAC9C,OAAO,EAAE;gBACL,QAAQ,EAAE,WAAW;aACxB;SACJ,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,OAAO;QACH,WAAW;QACX,UAAU;QACV,cAAc;KACjB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IPrimaryAction } from './_types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook used to get the primary actions for `<DataView />` component.
|
|
4
|
+
*
|
|
5
|
+
* Based on default actions and custom actions, it returns a primary with first action as "main" action and the others
|
|
6
|
+
* in the dropdown accessible via a split button.
|
|
7
|
+
*
|
|
8
|
+
* @param {Object[]} actions - list of actions to be display as one button: the primary action button
|
|
9
|
+
*/
|
|
10
|
+
export declare const usePrimaryActionsButton: (actions: IPrimaryAction[]) => {
|
|
11
|
+
primaryButton: JSX.Element;
|
|
12
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
|
+
// This file is released under LGPL V3
|
|
4
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
+
import { FaEllipsisV } from 'react-icons/fa';
|
|
6
|
+
import { KitButton, KitDropDown, KitSpace } from 'aristid-ds';
|
|
7
|
+
/**
|
|
8
|
+
* Hook used to get the primary actions for `<DataView />` component.
|
|
9
|
+
*
|
|
10
|
+
* Based on default actions and custom actions, it returns a primary with first action as "main" action and the others
|
|
11
|
+
* in the dropdown accessible via a split button.
|
|
12
|
+
*
|
|
13
|
+
* @param {Object[]} actions - list of actions to be display as one button: the primary action button
|
|
14
|
+
*/
|
|
15
|
+
export const usePrimaryActionsButton = (actions) => {
|
|
16
|
+
const [firstAction, ...dropdownActions] = actions;
|
|
17
|
+
return {
|
|
18
|
+
primaryButton: actions.length === 0 ? null : (_jsxs(_Fragment, { children: [_jsx(KitButton, { type: "primary", icon: firstAction.icon, disabled: firstAction.disabled, onClick: firstAction.callback, children: firstAction.label }), dropdownActions.length > 0 && (_jsx(KitDropDown, { trigger: ['click'], menu: {
|
|
19
|
+
items: dropdownActions.map((action, index) => ({
|
|
20
|
+
key: index,
|
|
21
|
+
label: (_jsxs(KitSpace, { size: 8, children: [action.icon, " ", action.label] })),
|
|
22
|
+
disabled: action.disabled,
|
|
23
|
+
onClick: action.callback
|
|
24
|
+
}))
|
|
25
|
+
}, children: _jsx(KitButton, { "data-testid": "actions-dropdown", type: "secondary", icon: _jsx(FaEllipsisV, {}) }) }))] }))
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=usePrimaryActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrimaryActions.js","sourceRoot":"","sources":["../../../src/components/Explorer/usePrimaryActions.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAAyB,EAAE,EAAE;IACjE,MAAM,CAAC,WAAW,EAAE,GAAG,eAAe,CAAC,GAAG,OAAO,CAAC;IAElD,OAAO;QACH,aAAa,EACT,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC1B,8BACI,KAAC,SAAS,IACN,IAAI,EAAC,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,IAAI,EACtB,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAC9B,OAAO,EAAE,WAAW,CAAC,QAAQ,YAE5B,WAAW,CAAC,KAAK,GACV,EACX,eAAe,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3B,KAAC,WAAW,IACR,OAAO,EAAE,CAAC,OAAO,CAAC,EAClB,IAAI,EAAE;wBACF,KAAK,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;4BAC3C,GAAG,EAAE,KAAK;4BACV,KAAK,EAAE,CACH,MAAC,QAAQ,IAAC,IAAI,EAAE,CAAC,aACZ,MAAM,CAAC,IAAI,OAAG,MAAM,CAAC,KAAK,IACpB,CACd;4BACD,QAAQ,EAAE,MAAM,CAAC,QAAQ;4BACzB,OAAO,EAAE,MAAM,CAAC,QAAQ;yBAC3B,CAAC,CAAC;qBACN,YAED,KAAC,SAAS,mBAAa,kBAAkB,EAAC,IAAI,EAAC,WAAW,EAAC,IAAI,EAAE,KAAC,WAAW,KAAG,GAAI,GAC1E,CACjB,IACF,CACN;KACR,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ActionHook, Entrypoint, IItemAction } from './_types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook used to get the action for `<DataView />` component.
|
|
4
|
+
*
|
|
5
|
+
* When the mutation for removing is done, the Apollo cache will be clean (`Record` and `RecordIdentity`)
|
|
6
|
+
* from removed record.
|
|
7
|
+
*
|
|
8
|
+
* @param isEnabled - whether the action is present
|
|
9
|
+
*/
|
|
10
|
+
export declare const useRemoveAction: ({ isEnabled }: ActionHook, entrypoint: Entrypoint) => {
|
|
11
|
+
removeAction: IItemAction | null;
|
|
12
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
|
+
// This file is released under LGPL V3
|
|
4
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
+
import { FaTrash } from 'react-icons/fa';
|
|
6
|
+
import { KitModal } from 'aristid-ds';
|
|
7
|
+
import { useDeactivateRecordsMutation, useDeleteValueMutation } from '../../_gqlTypes';
|
|
8
|
+
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
9
|
+
import { useMemo } from 'react';
|
|
10
|
+
import { useValuesCacheUpdate } from '../../hooks';
|
|
11
|
+
/**
|
|
12
|
+
* Hook used to get the action for `<DataView />` component.
|
|
13
|
+
*
|
|
14
|
+
* When the mutation for removing is done, the Apollo cache will be clean (`Record` and `RecordIdentity`)
|
|
15
|
+
* from removed record.
|
|
16
|
+
*
|
|
17
|
+
* @param isEnabled - whether the action is present
|
|
18
|
+
*/
|
|
19
|
+
export const useRemoveAction = ({ isEnabled }, entrypoint) => {
|
|
20
|
+
const { t } = useSharedTranslation();
|
|
21
|
+
const updateValuesCache = useValuesCacheUpdate();
|
|
22
|
+
const [deactivateRecordsMutation] = useDeactivateRecordsMutation({
|
|
23
|
+
update(cache, deactivatedRecords) {
|
|
24
|
+
deactivatedRecords.data?.deactivateRecords.forEach(record => {
|
|
25
|
+
cache.evict({
|
|
26
|
+
id: cache.identify(record)
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
cache.gc();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const [deleteRecordLinkMutation] = useDeleteValueMutation({
|
|
33
|
+
update: (_, deletedRecord) => {
|
|
34
|
+
const parentRecord = {
|
|
35
|
+
id: entrypoint.parentRecordId,
|
|
36
|
+
library: {
|
|
37
|
+
id: entrypoint.parentLibraryId
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
updateValuesCache(parentRecord, deletedRecord.data?.deleteValue ?? []);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const _removeAction = useMemo(() => ({
|
|
44
|
+
label: entrypoint.type === 'library' ? t('explorer.deactivate-item') : t('explorer.delete-item'),
|
|
45
|
+
icon: _jsx(FaTrash, {}),
|
|
46
|
+
isDanger: true,
|
|
47
|
+
callback: ({ itemId, libraryId, id_value }) => {
|
|
48
|
+
KitModal.confirm({
|
|
49
|
+
type: 'confirm',
|
|
50
|
+
dangerConfirm: true,
|
|
51
|
+
content: entrypoint.type === 'library'
|
|
52
|
+
? t('records_deactivation.confirm_one')
|
|
53
|
+
: t('record_edition.delete_link_confirm'),
|
|
54
|
+
okText: t('global.submit') ?? undefined,
|
|
55
|
+
cancelText: t('global.cancel') ?? undefined,
|
|
56
|
+
onOk: () => {
|
|
57
|
+
switch (entrypoint.type) {
|
|
58
|
+
case 'library':
|
|
59
|
+
deactivateRecordsMutation({
|
|
60
|
+
variables: {
|
|
61
|
+
libraryId,
|
|
62
|
+
recordsIds: [itemId]
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
break;
|
|
66
|
+
case 'link':
|
|
67
|
+
deleteRecordLinkMutation({
|
|
68
|
+
variables: {
|
|
69
|
+
library: entrypoint.parentLibraryId,
|
|
70
|
+
attribute: entrypoint.linkAttributeId,
|
|
71
|
+
recordId: entrypoint.parentRecordId,
|
|
72
|
+
value: {
|
|
73
|
+
payload: itemId,
|
|
74
|
+
id_value
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}), [t, deactivateRecordsMutation, deleteRecordLinkMutation, entrypoint.type]);
|
|
86
|
+
return {
|
|
87
|
+
removeAction: isEnabled ? _removeAction : null
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=useRemoveAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRemoveAction.js","sourceRoot":"","sources":["../../../src/components/Explorer/useRemoveAction.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,4BAA4B,EAAE,sBAAsB,EAAC,MAAM,eAAe,CAAC;AACnF,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAC,oBAAoB,EAAC,MAAM,WAAW,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC3B,EAAC,SAAS,EAAa,EACvB,UAAsB,EACY,EAAE;IACpC,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;IAEjD,MAAM,CAAC,yBAAyB,CAAC,GAAG,4BAA4B,CAAC;QAC7D,MAAM,CAAC,KAAK,EAAE,kBAAkB;YAC5B,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;gBACxD,KAAK,CAAC,KAAK,CAAC;oBACR,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;iBAC7B,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,EAAE,EAAE,CAAC;QACf,CAAC;KACJ,CAAC,CAAC;IAEH,MAAM,CAAC,wBAAwB,CAAC,GAAG,sBAAsB,CAAC;QACtD,MAAM,EAAE,CAAC,CAAC,EAAE,aAAa,EAAE,EAAE;YACzB,MAAM,YAAY,G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EAAE,UAAU,CAAC,eAAe;oCACrC,QAAQ,EAAE,UAAU,CAAC,cAAc;oCACnC,KAAK,EAAE;wCACH,OAAO,EAAE,MAAM;wCACf,QAAQ;qCACX;iCACJ;6BACJ,CAAC,CAAC;4BACH,MAAM;wBACV;4BACI,OAAO;oBACf,CAAC;gBACL,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;KACJ,CAAC,EACF,CAAC,CAAC,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,UAAU,CAAC,IAAI,CAAC,CAC5E,CAAC;IAEF,OAAO;QACH,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI;KACjD,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
import { IViewSettingsAction, IViewSettingsState } from './manage-view-settings/store-view-settings/viewSettingsReducer';
|
|
3
|
+
interface IUseSearchInputParams {
|
|
4
|
+
view: IViewSettingsState;
|
|
5
|
+
dispatch: Dispatch<IViewSettingsAction>;
|
|
6
|
+
}
|
|
7
|
+
export declare const useSearchInput: ({ view, dispatch }: IUseSearchInputParams) => {
|
|
8
|
+
searchInput: JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
|
+
// This file is released under LGPL V3
|
|
4
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
+
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
6
|
+
import { KitInput } from 'aristid-ds';
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
9
|
+
import { faMagnifyingGlass } from '@fortawesome/free-solid-svg-icons';
|
|
10
|
+
import { ViewSettingsActionTypes } from './manage-view-settings/store-view-settings/viewSettingsReducer';
|
|
11
|
+
export const useSearchInput = ({ view, dispatch }) => {
|
|
12
|
+
const { t } = useSharedTranslation();
|
|
13
|
+
const [search, setSearch] = useState(view.fulltextSearch);
|
|
14
|
+
const _handleChange = e => {
|
|
15
|
+
if (!e.target.value) {
|
|
16
|
+
setSearch('');
|
|
17
|
+
dispatch({ type: ViewSettingsActionTypes.CLEAR_FULLTEXT_SEARCH });
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
setSearch(e.target.value);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const _handleSubmit = e => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
dispatch({ type: ViewSettingsActionTypes.CHANGE_FULLTEXT_SEARCH, payload: { search } });
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
searchInput: view.entrypoint.type === 'library' ? (_jsx("form", { onSubmit: _handleSubmit, children: _jsx(KitInput, { prefix: _jsx(FontAwesomeIcon, { icon: faMagnifyingGlass }), title: String(t('global.search')), placeholder: String(t('global.search')), value: search ?? '', onChange: _handleChange }) })) : null
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=useSearchInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSearchInput.js","sourceRoot":"","sources":["../../../src/components/Explorer/useSearchInput.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAA0C,QAAQ,EAAC,MAAM,OAAO,CAAC;AACxE,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,iBAAiB,EAAC,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAGH,uBAAuB,EAC1B,M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N,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
+
// This file is released under LGPL V3
|
|
3
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { useMeasure } from '@uidotdev/usehooks';
|
|
6
|
+
const headerTableHeight = 56;
|
|
7
|
+
export const defaultPaginationHeight = 56;
|
|
8
|
+
export const useTableScrollableHeight = (withPagination) => {
|
|
9
|
+
const [containerRef, { height }] = useMeasure();
|
|
10
|
+
const scrollHeight = useMemo(() => height === null
|
|
11
|
+
? '100vh'
|
|
12
|
+
: `${height - headerTableHeight - (withPagination ? defaultPaginationHeight : 0)}px`, [withPagination, height]);
|
|
13
|
+
return { containerRef, scrollHeight };
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=useTableScrollableHeight.js.map
|