@leav/ui 0.3.6-032b1da → 0.3.6-0a46784
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 +11 -2
- package/dist/__mocks__/common/attribute.js.map +1 -1
- package/dist/__mocks__/common/form.d.ts +11 -5
- package/dist/__mocks__/common/form.js +20 -4
- 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 +649 -77
- package/dist/_gqlTypes/index.js +319 -34
- 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/getRecordFormQuery.js +2 -0
- package/dist/_queries/records/getRecordFormQuery.js.map +1 -1
- package/dist/_queries/records/getRecordPropertiesQuery.js +2 -0
- package/dist/_queries/records/getRecordPropertiesQuery.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 +4 -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.d.ts +2 -0
- package/dist/_utils/index.js +9 -2
- package/dist/_utils/index.js.map +1 -1
- package/dist/_utils/interleaveElement.d.ts +1 -0
- package/dist/_utils/interleaveElement.js +5 -0
- 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 +73 -48
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +11 -6
- package/dist/components/Explorer/Explorer.js +60 -14
- 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 +152 -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 +35 -0
- package/dist/components/Explorer/_queries/useExplorerData.js +203 -0
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -0
- package/dist/components/Explorer/_types.d.ts +81 -0
- package/dist/components/Explorer/_types.js +2 -0
- package/dist/components/Explorer/_types.js.map +1 -0
- 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 +9 -1
- package/dist/components/Explorer/index.js +6 -1
- 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 +83 -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/manage-view-settings/open-view-settings/EditSettingsContext.d.ts +15 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContext.js +15 -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/manage-view-settings/open-view-settings/EditSettingsContextProvider.js +17 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContextProvider.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/SidePanel.d.ts +2 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/SidePanel.js +19 -0
- 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.d.ts +1 -0
- package/dist/components/{RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.js → Explorer/manage-view-settings/open-view-settings/useEditSettings.js} +3 -3
- 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/manage-view-settings/router-menu/SettingItem.d.ts +9 -0
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingItem.js +55 -0
- 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 +113 -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/Explorer/manage-view-settings/store-view-settings/useViewSettingsContext.js +7 -0
- 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/useColumnWidth.d.ts +6 -0
- package/dist/components/Explorer/useColumnWidth.js +48 -0
- package/dist/components/Explorer/useColumnWidth.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.d.ts +1 -1
- package/dist/components/Explorer/useEditAction.js +10 -8
- 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 +32 -22
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +18 -5
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +12 -23
- 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/hooks/useRunActionsListAndFormatOnValue.d.ts +121 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.js +31 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.js.map +1 -0
- 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 +16 -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 +14 -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 +76 -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 +41 -45
- 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 +13 -75
- 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 +41 -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 +57 -62
- 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 +36 -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/DSListSelect.js +141 -0
- 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 +10 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/_types.js +2 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/_types.js.map +1 -0
- 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/RecordEdition/{EditRecordContent → EditRecordSkeleton}/EditRecordSkeleton.d.ts +1 -1
- package/dist/components/RecordEdition/{EditRecordContent → EditRecordSkeleton}/EditRecordSkeleton.js +2 -2
- package/dist/components/RecordEdition/EditRecordSkeleton/EditRecordSkeleton.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordSkeleton/index.d.ts +2 -0
- package/dist/components/RecordEdition/{EditRecordContent/reducers/standardFieldReducer → EditRecordSkeleton}/index.js +2 -2
- package/dist/components/RecordEdition/EditRecordSkeleton/index.js.map +1 -0
- package/dist/components/RecordEdition/index.d.ts +1 -0
- package/dist/components/RecordEdition/index.js +1 -0
- package/dist/components/RecordEdition/index.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/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.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/standardFieldReducerContext.js → hooks/useExecuteSaveViewMutation/index.js} +2 -6
- 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 +80 -8
- package/dist/locales/fr/shared.json +80 -8
- package/dist/types/views.d.ts +4 -4
- package/package.json +7 -2
- package/dist/components/Explorer/types.d.ts +0 -21
- package/dist/components/Explorer/types.js +0 -2
- package/dist/components/Explorer/types.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/Explorer/useExplorerData.d.ts +0 -11
- package/dist/components/Explorer/useExplorerData.js +0 -23
- package/dist/components/Explorer/useExplorerData.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordSkeleton.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 -367
- 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 -80
- 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 -137
- 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/hooks/useExecuteAddViewMutation/useExecuteAddViewMutation.d.ts +0 -6
- package/dist/hooks/useExecuteAddViewMutation/useExecuteAddViewMutation.js.map +0 -1
|
@@ -0,0 +1,203 @@
|
|
|
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 { localizedTranslation } from '@leav/utils';
|
|
5
|
+
import { AttributeFormat, RecordFilterCondition, RecordFilterOperator, useExplorerLibraryDataQuery, useExplorerLinkDataQuery } from '../../../_gqlTypes';
|
|
6
|
+
import { useLang } from '../../../hooks';
|
|
7
|
+
import { useMemo } from 'react';
|
|
8
|
+
import { interleaveElement } from '../../../_utils/interleaveElement';
|
|
9
|
+
import dayjs from 'dayjs';
|
|
10
|
+
import { nullValueConditions } from '../conditionsHelper';
|
|
11
|
+
import { AttributeConditionFilter } from '../../../types';
|
|
12
|
+
export const dateValuesSeparator = '\n';
|
|
13
|
+
const _mappingLibrary = (data, libraryId, availableLangs) => {
|
|
14
|
+
const attributes = data.records.list.length
|
|
15
|
+
? data.records.list[0].properties.reduce((acc, property) => {
|
|
16
|
+
acc[property.attributeId] = {
|
|
17
|
+
...property.attributeProperties,
|
|
18
|
+
label: localizedTranslation(property.attributeProperties.label, availableLangs)
|
|
19
|
+
};
|
|
20
|
+
return acc;
|
|
21
|
+
}, {})
|
|
22
|
+
: {};
|
|
23
|
+
const records = data.records.list.map(({ whoAmI, properties }) => ({
|
|
24
|
+
libraryId,
|
|
25
|
+
key: whoAmI.id, // For <KitTable /> only
|
|
26
|
+
itemId: whoAmI.id, // For <KitTable /> only
|
|
27
|
+
whoAmI: {
|
|
28
|
+
label: null,
|
|
29
|
+
subLabel: null,
|
|
30
|
+
color: null,
|
|
31
|
+
preview: null,
|
|
32
|
+
...whoAmI
|
|
33
|
+
},
|
|
34
|
+
propertiesById: properties.reduce((acc, { attributeId, values }) => ({ ...acc, [attributeId]: values }), {})
|
|
35
|
+
}));
|
|
36
|
+
return {
|
|
37
|
+
totalCount: data.records.totalCount ?? 0,
|
|
38
|
+
attributes,
|
|
39
|
+
records
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const _mappingLink = (data, libraryId, availableLangs) => {
|
|
43
|
+
const attributes = data.records.list.length
|
|
44
|
+
? (data.records.list[0].property[0]?.payload?.properties ?? []).reduce((acc, property) => {
|
|
45
|
+
acc[property.attributeId] = {
|
|
46
|
+
...property.attributeProperties,
|
|
47
|
+
label: localizedTranslation(property.attributeProperties.label, availableLangs)
|
|
48
|
+
};
|
|
49
|
+
return acc;
|
|
50
|
+
}, {})
|
|
51
|
+
: {};
|
|
52
|
+
const records = data.records.list[0].property
|
|
53
|
+
.map((linkValue) => {
|
|
54
|
+
if (!linkValue.payload) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
libraryId,
|
|
59
|
+
key: linkValue.payload.whoAmI.id, // For <KitTable /> only
|
|
60
|
+
itemId: linkValue.payload.whoAmI.id, // For <KitTable /> only
|
|
61
|
+
whoAmI: {
|
|
62
|
+
label: null,
|
|
63
|
+
subLabel: null,
|
|
64
|
+
color: null,
|
|
65
|
+
preview: null,
|
|
66
|
+
...linkValue.payload.whoAmI
|
|
67
|
+
},
|
|
68
|
+
propertiesById: linkValue.payload.properties.reduce((acc, { attributeId, values }) => ({ ...acc, [attributeId]: values }), {}),
|
|
69
|
+
id_value: linkValue.id_value
|
|
70
|
+
};
|
|
71
|
+
})
|
|
72
|
+
.filter(Boolean);
|
|
73
|
+
return {
|
|
74
|
+
totalCount: records.length,
|
|
75
|
+
attributes,
|
|
76
|
+
records
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
const _getDateRequestFilters = ({ field, condition, value }) => {
|
|
80
|
+
switch (condition) {
|
|
81
|
+
case RecordFilterCondition.BETWEEN:
|
|
82
|
+
const [from, to] = value.split(dateValuesSeparator);
|
|
83
|
+
return [
|
|
84
|
+
{
|
|
85
|
+
field,
|
|
86
|
+
condition,
|
|
87
|
+
value: JSON.stringify({
|
|
88
|
+
from,
|
|
89
|
+
to
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
case RecordFilterCondition.NOT_EQUAL:
|
|
94
|
+
return [
|
|
95
|
+
{
|
|
96
|
+
field,
|
|
97
|
+
condition: RecordFilterCondition.LESS_THAN,
|
|
98
|
+
value: dayjs.unix(Number(value)).startOf('day').unix().toString()
|
|
99
|
+
},
|
|
100
|
+
{ operator: RecordFilterOperator.OR },
|
|
101
|
+
{
|
|
102
|
+
field,
|
|
103
|
+
condition: RecordFilterCondition.GREATER_THAN,
|
|
104
|
+
value: dayjs.unix(Number(value)).endOf('day').unix().toString()
|
|
105
|
+
},
|
|
106
|
+
{ operator: RecordFilterOperator.OR },
|
|
107
|
+
{
|
|
108
|
+
field,
|
|
109
|
+
condition: RecordFilterCondition.IS_EMPTY,
|
|
110
|
+
value: null
|
|
111
|
+
}
|
|
112
|
+
];
|
|
113
|
+
case RecordFilterCondition.EQUAL:
|
|
114
|
+
return [
|
|
115
|
+
{
|
|
116
|
+
field,
|
|
117
|
+
condition: RecordFilterCondition.BETWEEN,
|
|
118
|
+
value: JSON.stringify({
|
|
119
|
+
from: dayjs.unix(Number(value)).startOf('day').unix().toString(),
|
|
120
|
+
to: dayjs.unix(Number(value)).endOf('day').unix().toString()
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
];
|
|
124
|
+
default:
|
|
125
|
+
return [
|
|
126
|
+
{
|
|
127
|
+
field,
|
|
128
|
+
condition,
|
|
129
|
+
value
|
|
130
|
+
}
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const _getBooleanRequestFilters = ({ field, condition, value }) => {
|
|
135
|
+
if (value === 'false') {
|
|
136
|
+
return [
|
|
137
|
+
{
|
|
138
|
+
field,
|
|
139
|
+
condition: AttributeConditionFilter.NOT_EQUAL,
|
|
140
|
+
value: 'true'
|
|
141
|
+
}
|
|
142
|
+
];
|
|
143
|
+
}
|
|
144
|
+
return [{ field, condition, value }];
|
|
145
|
+
};
|
|
146
|
+
export const useExplorerData = ({ entrypoint, libraryId, attributeIds, fulltextSearch, sorts, pagination, filters, skip }) => {
|
|
147
|
+
const { lang: availableLangs } = useLang();
|
|
148
|
+
const queryFilters = interleaveElement({ operator: RecordFilterOperator.AND }, filters
|
|
149
|
+
.filter(({ value, condition }) => value !== null || nullValueConditions.includes(condition))
|
|
150
|
+
.map(({ attribute, field, condition, value }) => {
|
|
151
|
+
switch (attribute.format) {
|
|
152
|
+
case AttributeFormat.date:
|
|
153
|
+
return _getDateRequestFilters({ field, condition, value });
|
|
154
|
+
case AttributeFormat.boolean:
|
|
155
|
+
return _getBooleanRequestFilters({ field, condition, value });
|
|
156
|
+
default:
|
|
157
|
+
return [
|
|
158
|
+
{
|
|
159
|
+
field,
|
|
160
|
+
condition,
|
|
161
|
+
value
|
|
162
|
+
}
|
|
163
|
+
];
|
|
164
|
+
}
|
|
165
|
+
}));
|
|
166
|
+
const isLibrary = entrypoint.type === 'library';
|
|
167
|
+
const isLink = entrypoint.type === 'link';
|
|
168
|
+
const { data: linkData, loading: linkLoading, refetch: linkRefetch } = useExplorerLinkDataQuery({
|
|
169
|
+
skip: skip || !isLink,
|
|
170
|
+
variables: {
|
|
171
|
+
parentLibraryId: entrypoint.parentLibraryId,
|
|
172
|
+
parentRecordId: entrypoint.parentRecordId,
|
|
173
|
+
linkAttributeId: entrypoint.linkAttributeId,
|
|
174
|
+
attributeIds
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
const { data: libraryData, loading: libraryLoading, refetch: libraryRefetch } = useExplorerLibraryDataQuery({
|
|
178
|
+
skip: skip || !isLibrary,
|
|
179
|
+
variables: {
|
|
180
|
+
libraryId,
|
|
181
|
+
attributeIds,
|
|
182
|
+
pagination,
|
|
183
|
+
searchQuery: fulltextSearch,
|
|
184
|
+
multipleSort: sorts,
|
|
185
|
+
filters: queryFilters
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
const memoizedData = useMemo(() => {
|
|
189
|
+
if (isLibrary) {
|
|
190
|
+
return libraryData ? _mappingLibrary(libraryData, libraryId, availableLangs) : null;
|
|
191
|
+
}
|
|
192
|
+
if (isLink) {
|
|
193
|
+
return linkData ? _mappingLink(linkData, libraryId, availableLangs) : null;
|
|
194
|
+
}
|
|
195
|
+
return null;
|
|
196
|
+
}, [libraryData, linkData]);
|
|
197
|
+
return {
|
|
198
|
+
data: memoizedData,
|
|
199
|
+
loading: isLibrary ? libraryLoading : linkLoading,
|
|
200
|
+
refetch: isLibrary ? libraryRefetch : linkRefetch
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
//# sourceMappingURL=useExplorerData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useExplorerData.js","sourceRoot":"","sources":["../../../../src/components/Explorer/_queries/useExplorerData.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AAEjD,OAAO,EACH,eAAe,EAIf,qBAAqB,EAErB,oBAAoB,EAEpB,2BAA2B,EAC3B,wBAAwB,EAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,wBAAwB,EAAC,MAAM,WAAW,CAAC;AAEnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC,MAAM,eAAe,GAAG,CACpB,IAA8B,EAC9B,SAAiB,EACjB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,cAAc,EACvB,OAAO,EAAE,cAAc,EAC1B,GAAG,2BAA2B,CAAC;QAC5B,IAAI,EAAE,IAAI,IAAI,CAAC,SAAS;QACxB,SAAS,EAAE;YACP,SAAS;YACT,YAAY;YACZ,UAAU;YACV,WAAW,EAAE,cAAc;YAC3B,YAAY,EAAE,KAAK;YACnB,OAAO,EAAE,YAAY;SACxB;KACJ,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE;QAC9B,IAAI,SAAS,EAAE,CAAC;YACZ,OAAO,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACxF,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACT,OAAO,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/E,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5B,OAAO;QACH,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,WAAW;QACjD,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,WAAW;KACpD,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Override } from '@leav/utils';
|
|
2
|
+
import { AttributeFormat, AttributePropertiesFragment, PropertyValueFragment, RecordFilterCondition, RecordIdentityFragment } from '../../_gqlTypes';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
|
+
import { IViewSettingsState } from './manage-view-settings';
|
|
5
|
+
export interface IExplorerData {
|
|
6
|
+
totalCount: number;
|
|
7
|
+
attributes: {
|
|
8
|
+
[attributeId: string]: Override<AttributePropertiesFragment, {
|
|
9
|
+
label: string;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
records: IItemData[];
|
|
13
|
+
}
|
|
14
|
+
export interface IItemData {
|
|
15
|
+
libraryId: string;
|
|
16
|
+
key: string;
|
|
17
|
+
itemId: string;
|
|
18
|
+
whoAmI: Required<RecordIdentityFragment['whoAmI']>;
|
|
19
|
+
propertiesById: {
|
|
20
|
+
[attributeId: string]: PropertyValueFragment[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Can be named `linkId` too, but for historical reason we keep old name 👴🏼.
|
|
24
|
+
*/
|
|
25
|
+
id_value?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface IItemAction {
|
|
28
|
+
callback: (item: IItemData) => void;
|
|
29
|
+
icon: ReactElement;
|
|
30
|
+
label: string;
|
|
31
|
+
isDanger?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface IPrimaryAction {
|
|
34
|
+
callback: () => void;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
icon: ReactElement;
|
|
37
|
+
label: string;
|
|
38
|
+
}
|
|
39
|
+
export type ActionHook<T = {}> = {
|
|
40
|
+
isEnabled: boolean;
|
|
41
|
+
} & T;
|
|
42
|
+
export interface IExplorerFilter {
|
|
43
|
+
id: string;
|
|
44
|
+
attribute: {
|
|
45
|
+
format: AttributeFormat;
|
|
46
|
+
label: string;
|
|
47
|
+
};
|
|
48
|
+
field: string;
|
|
49
|
+
condition: RecordFilterCondition | null;
|
|
50
|
+
value: string | null;
|
|
51
|
+
}
|
|
52
|
+
export interface IFilterChildrenDropDownProps {
|
|
53
|
+
filter: IExplorerFilter;
|
|
54
|
+
onFilterChange: (filterData: IExplorerFilter) => void;
|
|
55
|
+
}
|
|
56
|
+
export interface IFilterDropDownProps {
|
|
57
|
+
filter: IExplorerFilter;
|
|
58
|
+
}
|
|
59
|
+
export type DefaultViewSettings = Override<Partial<IViewSettingsState>, {
|
|
60
|
+
filters?: Array<{
|
|
61
|
+
field: string;
|
|
62
|
+
condition: RecordFilterCondition;
|
|
63
|
+
value: string | null;
|
|
64
|
+
}>;
|
|
65
|
+
}>;
|
|
66
|
+
export interface IEntrypointTree {
|
|
67
|
+
type: 'tree';
|
|
68
|
+
treeId: string;
|
|
69
|
+
nodeId: string;
|
|
70
|
+
}
|
|
71
|
+
export interface IEntrypointLibrary {
|
|
72
|
+
type: 'library';
|
|
73
|
+
libraryId: string;
|
|
74
|
+
}
|
|
75
|
+
export interface IEntrypointLink {
|
|
76
|
+
type: 'link';
|
|
77
|
+
parentLibraryId: string;
|
|
78
|
+
parentRecordId: string;
|
|
79
|
+
linkAttributeId: string;
|
|
80
|
+
}
|
|
81
|
+
export type Entrypoint = IEntrypointTree | IEntrypointLibrary | IEntrypointLink;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../src/components/Explorer/_types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
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 { AttributeFormat } from '../../_gqlTypes';
|
|
5
|
+
import { AttributeConditionFilter } from '../../types';
|
|
6
|
+
export const hasOnlyNoValueConditions = (attributeFormat) => [AttributeFormat.color, AttributeFormat.date_range, AttributeFormat.encrypted, AttributeFormat.extended].includes(attributeFormat);
|
|
7
|
+
export const nullValueConditions = [
|
|
8
|
+
AttributeConditionFilter.IS_EMPTY,
|
|
9
|
+
AttributeConditionFilter.IS_NOT_EMPTY,
|
|
10
|
+
AttributeConditionFilter.TODAY,
|
|
11
|
+
AttributeConditionFilter.TOMORROW,
|
|
12
|
+
AttributeConditionFilter.YESTERDAY,
|
|
13
|
+
AttributeConditionFilter.LAST_MONTH,
|
|
14
|
+
AttributeConditionFilter.NEXT_MONTH
|
|
15
|
+
];
|
|
16
|
+
//# sourceMappingURL=conditionsHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionsHelper.js","sourceRoot":"","sources":["../../../src/components/Explorer/conditionsHelper.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,wBAAwB,EAAC,MAAM,WAAW,CAAC;AAEnD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,eAAuB,EAAW,EAAE,CACzE,CAAC,eAAe,CAAC,KAAK,EAAE,eAAe,CAAC,UAAU,EAAE,eAAe,CAAC,SAAS,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAC7G,eAAe,CAClB,CAAC;AAEN,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,wBAAwB,CAAC,QAAQ;IACjC,wBAAwB,CAAC,YAAY;IACrC,wBAAwB,CAAC,KAAK;IAC9B,wBAAwB,CAAC,QAAQ;IACjC,wBAAwB,CAAC,SAAS;IAClC,wBAAwB,CAAC,UAAU;IACnC,wBAAwB,CAAC,UAAU;CACtC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } 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 styled from 'styled-components';
|
|
6
|
+
import { useViewSettingsContext } from '../manage-view-settings/store-view-settings/useViewSettingsContext';
|
|
7
|
+
import { KitButton, KitDivider, KitFilter, KitSpace } from 'aristid-ds';
|
|
8
|
+
import { FaTrash } from 'react-icons/fa';
|
|
9
|
+
import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
|
|
10
|
+
import { CommonFilterItem } from '../manage-view-settings/_shared/CommonFilterItem';
|
|
11
|
+
import { SortOrder } from '../../../_gqlTypes';
|
|
12
|
+
import { useOpenViewSettings } from '../manage-view-settings';
|
|
13
|
+
import { useAttributeDetailsData } from '../manage-view-settings/_shared/useAttributeDetailsData';
|
|
14
|
+
const FilterStyled = styled(KitFilter) `
|
|
15
|
+
flex: 0 0 auto;
|
|
16
|
+
`;
|
|
17
|
+
const ExplorerToolBarListStyled = styled.ul `
|
|
18
|
+
padding: calc(var(--general-spacing-xs) * 1px) calc(var(--general-spacing-xxs) * 1px)
|
|
19
|
+
calc(var(--general-spacing-m) * 1px) calc(var(--general-spacing-xxs) * 1px);
|
|
20
|
+
margin: 0;
|
|
21
|
+
list-style: none;
|
|
22
|
+
display: flex;
|
|
23
|
+
overflow: auto;
|
|
24
|
+
flex-wrap: nowrap;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: 0;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
`;
|
|
29
|
+
const DividerStyled = styled(KitDivider) `
|
|
30
|
+
height: 2em;
|
|
31
|
+
`;
|
|
32
|
+
export const ExplorerToolBar = ({ libraryId }) => {
|
|
33
|
+
const { t } = useSharedTranslation();
|
|
34
|
+
const { view: { filters, sort } } = useViewSettingsContext();
|
|
35
|
+
const { openSettingsPanel } = useOpenViewSettings(libraryId);
|
|
36
|
+
const { attributeDetailsById } = useAttributeDetailsData(libraryId);
|
|
37
|
+
if (filters.length === 0 && sort.length === 0) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const sortValues = sort.length === 0
|
|
41
|
+
? undefined
|
|
42
|
+
: sort.map(({ field, order }) => (attributeDetailsById?.[field]?.label ?? field) +
|
|
43
|
+
' ' +
|
|
44
|
+
(order === SortOrder.asc ? t('explorer.sort-ascending') : t('explorer.sort-descending')));
|
|
45
|
+
return (_jsxs(ExplorerToolBarListStyled, { "aria-label": t('explorer.toolbar.active'), children: [_jsx(KitSpace, { size: "s", children: filters.map(filter => (_jsx("li", { children: _jsx(CommonFilterItem, { filter: filter }, filter.id) }, filter.id))) }), filters.length > 0 && sort.length > 0 && _jsx(DividerStyled, { type: "vertical" }), sort.length > 0 && (_jsx("li", { children: _jsx(FilterStyled, { label: t('explorer.sort-items'), values: sortValues, onClick: () => openSettingsPanel('sort-items') }) })), _jsx(DividerStyled, { type: "vertical" }), _jsx("li", { children: _jsx(FilterStyled, { as: KitButton, type: "secondary", size: "s", danger: true, icon: _jsx(FaTrash, {}), disabled: true, children: t('explorer.reset-view') }) })] }));
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=ExplorerToolBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExplorerToolBar.js","sourceRoot":"","sources":["../../../../src/components/Explorer/display-view-filters/ExplorerToolBar.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,sBAAsB,EAAC,MAAM,oEAAoE,CAAC;AAC1G,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEtE,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,gBAAgB,EAAC,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAC,uBAAuB,EAAC,MAAM,yDAAyD,CAAC;AAEhG,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;;CAErC,CAAC;AAEF,MAAM,yBAAyB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;;;;;CAW1C,CAAC;AAEF,MAAM,aAAa,GAAG,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K,EACV,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,aAAa,IAAC,IAAI,EAAC,UAAU,GAAG,EAC1E,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAChB,uBACI,KAAC,YAAY,IACT,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAC/B,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,YAAY,CAAC,GAChD,GACD,CACR,EACD,KAAC,aAAa,IAAC,IAAI,EAAC,UAAU,GAAG,EACjC,uBACI,KAAC,YAAY,IAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAC,WAAW,EAAC,IAAI,EAAC,GAAG,EAAC,MAAM,QAAC,IAAI,EAAE,KAAC,OAAO,KAAG,EAAE,QAAQ,kBACpF,CAAC,CAAC,qBAAqB,CAAC,GACd,GACd,IACmB,CAC/B,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { Explorer as InternalExplorer } from './Explorer';
|
|
2
|
+
import { useEditSettings, SidePanel, EditSettingsContextProvider } from './manage-view-settings';
|
|
3
|
+
type CompoundedComponent = typeof InternalExplorer & {
|
|
4
|
+
useEditSettings: typeof useEditSettings;
|
|
5
|
+
EditSettingsContextProvider: typeof EditSettingsContextProvider;
|
|
6
|
+
SettingsSidePanel: typeof SidePanel;
|
|
7
|
+
};
|
|
8
|
+
export declare const Explorer: CompoundedComponent;
|
|
9
|
+
export {};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
2
|
// This file is released under LGPL V3
|
|
3
3
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
-
|
|
4
|
+
import { Explorer as InternalExplorer } from './Explorer';
|
|
5
|
+
import { useEditSettings, SidePanel, EditSettingsContextProvider } from './manage-view-settings';
|
|
6
|
+
export const Explorer = InternalExplorer;
|
|
7
|
+
Explorer.EditSettingsContextProvider = EditSettingsContextProvider;
|
|
8
|
+
Explorer.useEditSettings = useEditSettings;
|
|
9
|
+
Explorer.SettingsSidePanel = SidePanel;
|
|
5
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Explorer/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Explorer/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,IAAI,gBAAgB,EAAC,MAAM,YAAY,CAAC;AACxD,OAAO,EAAC,eAAe,EAAE,SAAS,EAAE,2BAA2B,EAAC,MAAM,wBAAwB,CAAC;AAQ/F,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAkD,CAAC;AAC3E,QAAQ,CAAC,2BAA2B,GAAG,2BAA2B,CAAC;AACnE,QAAQ,CAAC,eAAe,GAAG,eAAe,CAAC;AAC3C,QAAQ,CAAC,iBAAiB,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
interface IColumnItemProps {
|
|
3
|
+
itemId: string;
|
|
4
|
+
dragHandler?: ReactNode;
|
|
5
|
+
visible: boolean;
|
|
6
|
+
title: string;
|
|
7
|
+
onVisibilityClick?: () => void;
|
|
8
|
+
value?: string;
|
|
9
|
+
locked?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const ColumnItem: FunctionComponent<IColumnItemProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } 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 { KitTypography } from 'aristid-ds';
|
|
6
|
+
import { FaEye, FaEyeSlash, FaLock } from 'react-icons/fa';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { useSortable } from '@dnd-kit/sortable';
|
|
9
|
+
import { CSS } from '@dnd-kit/utilities';
|
|
10
|
+
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
11
|
+
const StyledValue = styled(KitTypography.Text) `
|
|
12
|
+
color: var(--general-utilities-disabled);
|
|
13
|
+
`;
|
|
14
|
+
const StyledConfigurationItem = styled.li `
|
|
15
|
+
color: var(--general-utilities-text-primary);
|
|
16
|
+
display: flex;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 40px;
|
|
19
|
+
padding: 0 calc(var(--general-spacing-xs) * 1px);
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: calc(var(--general-spacing-xs) * 1px);
|
|
22
|
+
border-radius: calc(var(--general-spacing-xs) * 1px);
|
|
23
|
+
text-align: left;
|
|
24
|
+
|
|
25
|
+
&:first-child {
|
|
26
|
+
margin-top: calc(var(--general-spacing-xs) * 1px);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:hover {
|
|
30
|
+
background: var(--general-utilities-main-light);
|
|
31
|
+
|
|
32
|
+
${StyledValue} {
|
|
33
|
+
color: var(--general-utilities-text-primary);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.title {
|
|
38
|
+
flex: 1 1 auto;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
> svg {
|
|
42
|
+
flex: 0 0 calc(var(--general-spacing-s) * 1px);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
> button {
|
|
46
|
+
border: none;
|
|
47
|
+
background: transparent;
|
|
48
|
+
padding: 0;
|
|
49
|
+
&:not([disabled]) {
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
const StyledFaEye = styled(FaEye) `
|
|
55
|
+
display: flex;
|
|
56
|
+
color: currentColor;
|
|
57
|
+
`;
|
|
58
|
+
const StyledEyeSlash = styled(FaEyeSlash) `
|
|
59
|
+
display: flex;
|
|
60
|
+
color: var(--general-utilities-disabled);
|
|
61
|
+
`;
|
|
62
|
+
const StyledLocked = styled(FaLock) `
|
|
63
|
+
display: flex;
|
|
64
|
+
color: var(--general-utilities-disabled);
|
|
65
|
+
`;
|
|
66
|
+
const StyledDragHandle = styled.span `
|
|
67
|
+
display: flex;
|
|
68
|
+
cursor: ${props => (props.$isDragging ? 'grabbing' : 'grab')};
|
|
69
|
+
`;
|
|
70
|
+
const StyledEmptyIcon = styled.div `
|
|
71
|
+
width: calc(var(--general-spacing-s) * 1px);
|
|
72
|
+
`;
|
|
73
|
+
export const ColumnItem = ({ itemId, dragHandler, title, visible, onVisibilityClick, locked = false }) => {
|
|
74
|
+
const { t } = useSharedTranslation();
|
|
75
|
+
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id: itemId });
|
|
76
|
+
const style = {
|
|
77
|
+
transform: CSS.Transform.toString(transform),
|
|
78
|
+
transition
|
|
79
|
+
};
|
|
80
|
+
const _handleClick = () => onVisibilityClick?.();
|
|
81
|
+
const visibilityButtonLabel = visible ? t('explorer.hide') : t('explorer.show');
|
|
82
|
+
const visibilityIcon = locked ? _jsx(StyledLocked, {}) : visible ? _jsx(StyledFaEye, {}) : _jsx(StyledEyeSlash, {});
|
|
83
|
+
return (_jsxs(StyledConfigurationItem, { ref: setNodeRef, style: style, children: [dragHandler ? (_jsx(StyledDragHandle, { ...attributes, ...listeners, "$isDragging": isDragging, children: dragHandler })) : (_jsx(StyledEmptyIcon, {})), _jsx(KitTypography.Text, { size: "fontSize5", ellipsis: true, className: "title", children: title }), _jsx("button", { disabled: locked, onClick: _handleClick, title: visibilityButtonLabel, "aria-label": visibilityButtonLabel, children: visibilityIcon })] }));
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=ColumnItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnItem.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/_shared/ColumnItem.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,GAAG,EAAC,MAAM,oBAAoB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;;CAE7C,CAAC;AAEF,MAAM,uBAAuB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;;;;;;;;;;;;UAkB/B,WAAW;;;;;;;;;;;;;;;;;;;;;CAqBpB,CAAC;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;;;CAGhC,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;;;CAGxC,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;CAGlC,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAwB;;cAE9C,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;CAC/D,CAAC;AAEF,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEjC,CAAC;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KAAK,EAAE,qBAAqB,gBAChB,qBAAqB,YAEhC,cAAc,GACV,IACa,CAC7B,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FilterDropDown } from '../filter-items/filter-type/FilterDropDown';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { KitFilter } from 'aristid-ds';
|
|
5
|
+
const FilterStyled = styled(KitFilter) `
|
|
6
|
+
flex: 0 0 auto;
|
|
7
|
+
`;
|
|
8
|
+
export const CommonFilterItem = ({ filter }) => (_jsx(FilterStyled, { expandable: true, label: filter.attribute.label, values: filter.value === null ? [] : [filter.value], dropDownProps: {
|
|
9
|
+
placement: 'bottomLeft',
|
|
10
|
+
dropdownRender: () => _jsx(FilterDropDown, { filter: filter })
|
|
11
|
+
} }));
|
|
12
|
+
//# sourceMappingURL=CommonFilterItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommonFilterItem.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/_shared/CommonFilterItem.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,cAAc,EAAC,MAAM,4CAA4C,CAAC;AAC1E,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AAGrC,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;;CAErC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAiD,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,CACxF,KAAC,YAAY,IACT,UAAU,QACV,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,EAC7B,MAAM,EAAE,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACnD,aAAa,EAAE;QACX,SAAS,EAAE,YAAY;QACvB,cAAc,EAAE,GAAG,EAAE,CAAC,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,GAAI;KAC3D,GACH,CACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { AttributeDetailsFragment } from '../../../../_gqlTypes';
|
|
3
|
+
interface IColumnsById {
|
|
4
|
+
[attributeId: string]: AttributeDetailsFragment;
|
|
5
|
+
}
|
|
6
|
+
export declare const useAttributeDetailsData: (libraryId: string) => {
|
|
7
|
+
attributeDetailsById: IColumnsById;
|
|
8
|
+
searchFilteredColumnsIds: string[];
|
|
9
|
+
onSearchChanged: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
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, useState } from 'react';
|
|
5
|
+
import { useDebouncedValue } from '../../../../hooks/useDebouncedValue';
|
|
6
|
+
import { useGetAttributesByLibQuery } from '../../../../_gqlTypes';
|
|
7
|
+
import { localizedTranslation } from '@leav/utils';
|
|
8
|
+
import { useLang } from '../../../../hooks';
|
|
9
|
+
const _mapping = (data, availableLanguages) => data?.attributes?.list.reduce((acc, attribute) => {
|
|
10
|
+
acc[attribute.id] = {
|
|
11
|
+
...attribute,
|
|
12
|
+
label: localizedTranslation(attribute.label, availableLanguages)
|
|
13
|
+
};
|
|
14
|
+
return acc;
|
|
15
|
+
}, {}) ?? {};
|
|
16
|
+
export const useAttributeDetailsData = (libraryId) => {
|
|
17
|
+
const [searchInput, setSearchInput] = useState('');
|
|
18
|
+
const debouncedSearchInput = useDebouncedValue(searchInput, 300);
|
|
19
|
+
const { lang: availableLanguages } = useLang();
|
|
20
|
+
const { data } = useGetAttributesByLibQuery({
|
|
21
|
+
variables: {
|
|
22
|
+
library: libraryId
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const attributeDetailsById = _mapping(data, availableLanguages);
|
|
26
|
+
const searchFilteredColumns = useMemo(() => {
|
|
27
|
+
const columnIds = Object.keys(attributeDetailsById);
|
|
28
|
+
if (columnIds.length === 0) {
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
if (debouncedSearchInput === '') {
|
|
32
|
+
return attributeDetailsById;
|
|
33
|
+
}
|
|
34
|
+
return columnIds.reduce((acc, columnId) => {
|
|
35
|
+
if (attributeDetailsById[columnId].label.includes(debouncedSearchInput) ||
|
|
36
|
+
columnId.includes(debouncedSearchInput)) {
|
|
37
|
+
acc[columnId] = attributeDetailsById[columnId];
|
|
38
|
+
}
|
|
39
|
+
return acc;
|
|
40
|
+
}, {});
|
|
41
|
+
}, [debouncedSearchInput, attributeDetailsById]);
|
|
42
|
+
const searchFilteredColumnsIds = Object.keys(searchFilteredColumns);
|
|
43
|
+
const onSearchChanged = (event) => {
|
|
44
|
+
const shouldIgnoreInputChange = event.target.value.length < 3 && debouncedSearchInput.length < 3;
|
|
45
|
+
if (shouldIgnoreInputChange) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
setSearchInput(() => {
|
|
49
|
+
if (event.target.value.length > 2) {
|
|
50
|
+
return event.target.value;
|
|
51
|
+
}
|
|
52
|
+
return '';
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
attributeDetailsById,
|
|
57
|
+
searchFilteredColumnsIds,
|
|
58
|
+
onSearchChanged
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=useAttributeDetailsData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAttributeDetailsData.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.tsx"],"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