@leav/ui 0.3.6-eab60f2 → 0.3.6-ebd477a
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 -2
- package/dist/__mocks__/common/attribute.js.map +1 -1
- package/dist/__mocks__/common/form.d.ts +1 -0
- package/dist/__mocks__/common/form.js +15 -0
- package/dist/__mocks__/common/form.js.map +1 -1
- package/dist/__mocks__/common/value.js +3 -2
- 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 +541 -82
- package/dist/_gqlTypes/index.js +313 -56
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_queries/attributes/attributeDetailsFragment.js +0 -1
- package/dist/_queries/attributes/attributeDetailsFragment.js.map +1 -1
- package/dist/_queries/attributes/getAttributesByLib.js +7 -5
- package/dist/_queries/attributes/getAttributesByLib.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/createRecordMutation.js +2 -3
- package/dist/_queries/records/createRecordMutation.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/attributeType.d.ts +3 -0
- package/dist/_utils/attributeType.js +7 -0
- package/dist/_utils/attributeType.js.map +1 -0
- 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/_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/EditAttributeModal/EditAttribute/EditAttributeInfo/EditAttributeInfo.js +0 -1
- package/dist/components/EditAttributeModal/EditAttribute/EditAttributeInfo/EditAttributeInfo.js.map +1 -1
- package/dist/components/EditAttributeModal/EditAttribute/EditAttributeInfo/EditAttributeInfoForm/EditAttributeInfoForm.js +2 -5
- package/dist/components/EditAttributeModal/EditAttribute/EditAttributeInfo/EditAttributeInfoForm/EditAttributeInfoForm.js.map +1 -1
- package/dist/components/Explorer/DataView.d.ts +7 -1
- package/dist/components/Explorer/DataView.js +76 -21
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +9 -6
- package/dist/components/Explorer/Explorer.js +80 -37
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/ExplorerTitle.d.ts +2 -0
- package/dist/components/Explorer/ExplorerTitle.js +28 -11
- package/dist/components/Explorer/ExplorerTitle.js.map +1 -1
- package/dist/components/Explorer/ExplorerToolbar.d.ts +4 -0
- package/dist/components/Explorer/ExplorerToolbar.js +49 -0
- package/dist/components/Explorer/ExplorerToolbar.js.map +1 -0
- package/dist/components/Explorer/TableCell.js +15 -6
- package/dist/components/Explorer/TableCell.js.map +1 -1
- package/dist/components/Explorer/_constants.d.ts +5 -0
- package/dist/components/Explorer/_constants.js +18 -0
- package/dist/components/Explorer/_constants.js.map +1 -0
- package/dist/components/Explorer/_queries/prepareFiltersForRequest.d.ts +4 -0
- package/dist/components/Explorer/_queries/prepareFiltersForRequest.js +99 -0
- package/dist/components/Explorer/_queries/prepareFiltersForRequest.js.map +1 -0
- package/dist/components/Explorer/_queries/useExplorerData.d.ts +15 -7
- package/dist/components/Explorer/_queries/useExplorerData.js +73 -20
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +67 -8
- package/dist/components/Explorer/_types.js +7 -1
- package/dist/components/Explorer/_types.js.map +1 -1
- package/dist/components/Explorer/{useEditAction.d.ts → actions-item/useEditItemAction.d.ts} +4 -4
- package/dist/components/Explorer/{useEditAction.js → actions-item/useEditItemAction.js} +10 -10
- package/dist/components/Explorer/actions-item/useEditItemAction.js.map +1 -0
- package/dist/components/Explorer/actions-item/useRemoveItemAction.d.ts +23 -0
- package/dist/components/Explorer/actions-item/useRemoveItemAction.js +109 -0
- package/dist/components/Explorer/actions-item/useRemoveItemAction.js.map +1 -0
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.d.ts +27 -0
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js +71 -0
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js.map +1 -0
- package/dist/components/Explorer/actions-mass/useMassActions.d.ts +28 -0
- package/dist/components/Explorer/actions-mass/useMassActions.js +111 -0
- package/dist/components/Explorer/actions-mass/useMassActions.js.map +1 -0
- package/dist/components/Explorer/{useCreateAction.d.ts → actions-primary/useCreatePrimaryAction.d.ts} +9 -5
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +75 -0
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -0
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.d.ts +17 -0
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js +38 -0
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js.map +1 -0
- package/dist/components/Explorer/{usePrimaryActions.d.ts → actions-primary/usePrimaryActions.d.ts} +1 -1
- package/dist/components/Explorer/actions-primary/usePrimaryActions.js +25 -0
- package/dist/components/Explorer/actions-primary/usePrimaryActions.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/link-item/LinkModal.d.ts +7 -0
- package/dist/components/Explorer/link-item/LinkModal.js +72 -0
- package/dist/components/Explorer/link-item/LinkModal.js.map +1 -0
- package/dist/components/Explorer/link-item/useLinkMassAction.d.ts +22 -0
- package/dist/components/Explorer/link-item/useLinkMassAction.js +55 -0
- package/dist/components/Explorer/link-item/useLinkMassAction.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.d.ts +3 -2
- package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.d.ts +3 -1
- package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.js +9 -3
- package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +20 -10
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -1
- 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 +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js +32 -14
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropdownContent.d.ts +7 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropdownContent.js +40 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropdownContent.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueList.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/LinkAttributeDropdown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/LinkAttributeDropdown.js +79 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/LinkAttributeDropdown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.d.ts +2 -2
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.js +8 -28
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.d.ts +2 -2
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.js +8 -27
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/_types.d.ts +10 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/_types.js +2 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/_types.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.d.ts +11 -13
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js +34 -8
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContext.d.ts +3 -2
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContext.js +2 -2
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContext.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContextProvider.js +2 -2
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContextProvider.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/SidePanel.js +3 -3
- package/dist/components/Explorer/manage-view-settings/open-view-settings/SidePanel.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.d.ts +10 -2
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js +41 -7
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.d.ts +2 -1
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +23 -31
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/SaveViewModal.d.ts +7 -0
- package/dist/components/Explorer/manage-view-settings/save-view/SaveViewModal.js +42 -0
- package/dist/components/Explorer/manage-view-settings/save-view/SaveViewModal.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/save-view/useSaveView.d.ts +4 -0
- package/dist/components/Explorer/manage-view-settings/save-view/useSaveView.js +17 -0
- package/dist/components/Explorer/manage-view-settings/save-view/useSaveView.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js +25 -21
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +13 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.d.ts +49 -14
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +99 -23
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/useManageViews.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/useManageViews.js +48 -0
- package/dist/components/Explorer/manage-view-settings/useManageViews.js.map +1 -0
- package/dist/components/Explorer/useColumnWidth.d.ts +8 -0
- package/dist/components/Explorer/useColumnWidth.js +49 -0
- package/dist/components/Explorer/useColumnWidth.js.map +1 -0
- package/dist/components/Explorer/useSearchInput.d.ts +10 -4
- package/dist/components/Explorer/useSearchInput.js +9 -1
- package/dist/components/Explorer/useSearchInput.js.map +1 -1
- package/dist/components/Explorer/useViewSettingsReducer.d.ts +8 -0
- package/dist/components/Explorer/useViewSettingsReducer.js +215 -0
- package/dist/components/Explorer/useViewSettingsReducer.js.map +1 -0
- 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 +78 -76
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +17 -4
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +3 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.js +2 -1
- 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/useExecuteSaveValueBatchMutation.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.js +1 -7
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.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/StandardField/ComputeIndicator.js +2 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.d.ts +2 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +95 -28
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js +45 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js +9 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js +16 -8
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js +6 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js +7 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js +13 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js +6 -6
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.d.ts +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +4 -15
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js +5 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.d.ts +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js +3 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js +0 -5
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js +4 -7
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.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/AttributeSummary/AttributeSummary.d.ts +7 -0
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/AttributeSummary.js +9 -0
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/AttributeSummary.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/index.d.ts +2 -0
- package/dist/components/RecordEdition/EditRecordSidebar/{ValueDetails/AttributeDetails → AttributeSummary}/index.js +2 -2
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/index.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/useAttributeInformations.d.ts +2 -0
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/useAttributeInformations.js +25 -0
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/useAttributeInformations.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/Breadcrumb.d.ts +3 -0
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/Breadcrumb.js +53 -0
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/Breadcrumb.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/index.d.ts +2 -0
- package/dist/components/RecordEdition/EditRecordSidebar/{ValueDetails → Breacrumb}/index.js +2 -2
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/index.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.d.ts +4 -1
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +41 -6
- 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/ValuesSummary/ValuesSummary.d.ts +8 -0
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js +66 -0
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/index.d.ts +2 -0
- package/dist/components/RecordEdition/EditRecordSidebar/{ValueDetails/TreeValuePath → ValuesSummary}/index.js +2 -2
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/index.js.map +1 -0
- 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/{EditRecordSidebar/ValueDetails/ValueMetadata → EditRecordSkeleton}/index.js +2 -2
- package/dist/components/RecordEdition/EditRecordSkeleton/index.js.map +1 -0
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.d.ts +12 -10
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js +15 -13
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js.map +1 -1
- 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/SelectTreeNodeContent.js +1 -3
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.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/useExecuteSaveViewMutation/index.d.ts +1 -0
- package/dist/{components/RecordEdition/EditRecordSidebar/ValueDetails/ValueInfo → 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/locales/en/shared.json +56 -12
- package/dist/locales/fr/shared.json +58 -14
- package/dist/types/views.d.ts +4 -4
- package/package.json +2 -2
- package/dist/components/Explorer/display-view-filters/ExplorerFilterBar.d.ts +0 -2
- package/dist/components/Explorer/display-view-filters/ExplorerFilterBar.js +0 -37
- package/dist/components/Explorer/display-view-filters/ExplorerFilterBar.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.d.ts +0 -3
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.js +0 -69
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.js.map +0 -1
- package/dist/components/Explorer/useCreateAction.js +0 -40
- package/dist/components/Explorer/useCreateAction.js.map +0 -1
- package/dist/components/Explorer/useDeactivateAction.d.ts +0 -12
- package/dist/components/Explorer/useDeactivateAction.js +0 -52
- package/dist/components/Explorer/useDeactivateAction.js.map +0 -1
- package/dist/components/Explorer/useEditAction.js.map +0 -1
- package/dist/components/Explorer/usePrimaryActions.js +0 -21
- package/dist/components/Explorer/usePrimaryActions.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordSkeleton.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/EditRecordSidebar/ValueDetails/AttributeDetails/AttributeDetails.d.ts +0 -6
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/AttributeDetails/AttributeDetails.js +0 -56
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/AttributeDetails/AttributeDetails.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/AttributeDetails/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/AttributeDetails/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/TreeValuePath/TreeValuePath.d.ts +0 -8
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/TreeValuePath/TreeValuePath.js +0 -41
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/TreeValuePath/TreeValuePath.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/TreeValuePath/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/TreeValuePath/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueDetails.d.ts +0 -10
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueDetails.js +0 -63
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueDetails.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueInfo/ValueInfo.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueInfo/ValueInfo.js +0 -76
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueInfo/ValueInfo.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueInfo/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueInfo/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueMetadata/ValueMetadata.d.ts +0 -11
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueMetadata/ValueMetadata.js +0 -43
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueMetadata/ValueMetadata.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueMetadata/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueMetadata/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/index.js.map +0 -1
- package/dist/hooks/useExecuteAddViewMutation/useExecuteAddViewMutation.d.ts +0 -6
- package/dist/hooks/useExecuteAddViewMutation/useExecuteAddViewMutation.js.map +0 -1
|
@@ -3,15 +3,18 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
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
5
|
import { cloneElement, memo } from 'react';
|
|
6
|
-
import { KitButton, KitDropDown, KitPagination,
|
|
6
|
+
import { KitButton, KitDropDown, KitPagination, KitTable } from 'aristid-ds';
|
|
7
7
|
import { FaEllipsisH } from 'react-icons/fa';
|
|
8
8
|
import styled from 'styled-components';
|
|
9
|
+
import isEqual from 'lodash/isEqual';
|
|
9
10
|
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
10
11
|
import { TableCell } from './TableCell';
|
|
11
12
|
import { IdCard } from './IdCard';
|
|
12
13
|
import { defaultPaginationHeight, useTableScrollableHeight } from './useTableScrollableHeight';
|
|
13
|
-
import
|
|
14
|
+
import { useColumnWidth } from './useColumnWidth';
|
|
14
15
|
const USELESS = '';
|
|
16
|
+
const tableHeaderHeight = 56;
|
|
17
|
+
const tableHeaderMinLineHeight = 22;
|
|
15
18
|
const DataViewContainerDivStyled = styled.div `
|
|
16
19
|
flex: 1 1 min-content;
|
|
17
20
|
max-height: minmax(0, 1fr);
|
|
@@ -21,35 +24,69 @@ const DataViewContainerDivStyled = styled.div `
|
|
|
21
24
|
padding-bottom: ${defaultPaginationHeight}px;
|
|
22
25
|
position: relative;
|
|
23
26
|
}
|
|
27
|
+
|
|
24
28
|
.pagination {
|
|
25
29
|
flex: 0 0 auto;
|
|
26
|
-
justify-content:
|
|
30
|
+
justify-content: center;
|
|
27
31
|
display: flex;
|
|
28
32
|
padding-top: calc(var(--general-spacing-xs) * 1px);
|
|
29
33
|
}
|
|
30
34
|
`;
|
|
31
|
-
const
|
|
32
|
-
|
|
35
|
+
const StyledActionsList = styled.div `
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
gap: calc(var(--general-spacing-xs) * 1px);
|
|
38
|
+
`;
|
|
39
|
+
// TODO: Table component should be updated fix header display
|
|
40
|
+
const StyledTable = styled(KitTable) `
|
|
41
|
+
.ant-table-thead > tr > th {
|
|
42
|
+
padding-top: calc(var(--general-spacing-xxs) * 1px) !important;
|
|
43
|
+
padding-bottom: calc(var(--general-spacing-xxs) * 1px) !important;
|
|
44
|
+
height: ${tableHeaderHeight}px;
|
|
45
|
+
|
|
46
|
+
.ant-table-cell {
|
|
47
|
+
min-height: ${tableHeaderMinLineHeight}px;
|
|
48
|
+
height: auto !important;
|
|
49
|
+
padding: 0 calc(var(--general-spacing-s) * 1px) 0 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
const ActionsHeaderStyledDiv = styled.div `
|
|
54
|
+
justify-self: right;
|
|
55
|
+
text-align: left;
|
|
56
|
+
`;
|
|
57
|
+
// TODO: tests will fail if we don't check attributeToDisplay because we have a render with no attributes but data is present. We should check why there's this behavior
|
|
58
|
+
const arePropsEqual = (prevProps, nextProps) => isEqual({
|
|
59
|
+
attributesToDisplay: prevProps.attributesToDisplay,
|
|
60
|
+
data: prevProps.dataGroupedFilteredSorted,
|
|
61
|
+
selectedKeys: prevProps.selection.selectedKeys
|
|
62
|
+
}, {
|
|
63
|
+
attributesToDisplay: nextProps.attributesToDisplay,
|
|
64
|
+
data: nextProps.dataGroupedFilteredSorted,
|
|
65
|
+
selectedKeys: nextProps.selection.selectedKeys
|
|
66
|
+
});
|
|
67
|
+
export const DataView = memo(({ dataGroupedFilteredSorted, attributesToDisplay, attributesProperties, paginationProps, itemActions, selection: { onSelectionChange, selectedKeys, isMassSelectionAll }, iconsOnlyItemActions }) => {
|
|
33
68
|
const { t } = useSharedTranslation();
|
|
34
|
-
const { theme } = useKitTheme();
|
|
35
69
|
const { containerRef, scrollHeight } = useTableScrollableHeight(!!paginationProps);
|
|
36
|
-
const
|
|
70
|
+
const { ref, getFieldColumnWidth, columnWidth, actionsColumnHeaderWidth } = useColumnWidth();
|
|
71
|
+
const _getActionButtons = (actions, columnRef) => {
|
|
37
72
|
const isLessThanFourActions = actions.length < 4;
|
|
38
|
-
return isLessThanFourActions ? (_jsx(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
73
|
+
return (_jsx(StyledActionsList, { ref: columnRef, children: isLessThanFourActions ? (_jsx(_Fragment, { children: actions.map(({ label, icon, isDanger, iconOnly, callback, disabled }, actionIndex) => (_jsx(KitButton, { title: label, icon: icon, onClick: callback, danger: isDanger, disabled: disabled, children: !iconsOnlyItemActions && !iconOnly && label }, actionIndex))) })) : (_jsxs(_Fragment, { children: [_jsx(KitButton, { type: "tertiary", icon: actions[0].icon, title: actions[0].label, onClick: actions[0].callback, danger: actions[0].isDanger, disabled: actions[0].disabled }), _jsx(KitButton, { type: "tertiary", icon: actions[1].icon, onClick: actions[1].callback, title: actions[1].label, danger: actions[1].isDanger, disabled: actions[1].disabled }), _jsx(KitDropDown, { menu: {
|
|
74
|
+
items: actions.slice(2).map(({ callback, icon, label, isDanger, disabled }) => ({
|
|
75
|
+
key: label,
|
|
76
|
+
title: label,
|
|
77
|
+
danger: isDanger,
|
|
78
|
+
disabled,
|
|
79
|
+
label,
|
|
80
|
+
icon: icon ? cloneElement(icon, { size: '2em' }) : null, // TODO: find better tuning
|
|
81
|
+
onClick: callback
|
|
82
|
+
}))
|
|
83
|
+
}, children: _jsx(KitButton, { title: t('explorer.more-actions') ?? undefined, type: "tertiary", icon: _jsx(FaEllipsisH, {}) }) })] })) }));
|
|
48
84
|
};
|
|
49
85
|
const columns = attributesToDisplay
|
|
50
86
|
.map(attributeName => ({
|
|
51
87
|
title: attributeName === 'whoAmI' ? '' : attributesProperties[attributeName].label,
|
|
52
88
|
dataIndex: USELESS,
|
|
89
|
+
width: getFieldColumnWidth(attributesProperties[attributeName]),
|
|
53
90
|
shouldCellUpdate: (record, prevRecord) => attributeName === 'whoAmI'
|
|
54
91
|
? record.whoAmI !== prevRecord.whoAmI
|
|
55
92
|
: record.propertiesById[attributeName] !== prevRecord.propertiesById[attributeName],
|
|
@@ -59,16 +96,34 @@ export const DataView = memo(({ dataGroupedFilteredSorted, attributesToDisplay,
|
|
|
59
96
|
? []
|
|
60
97
|
: [
|
|
61
98
|
{
|
|
62
|
-
title: t('explorer.actions'),
|
|
99
|
+
title: (_jsx(ActionsHeaderStyledDiv, { style: { width: `${actionsColumnHeaderWidth}px` }, children: t('explorer.actions') })),
|
|
63
100
|
dataIndex: USELESS,
|
|
101
|
+
align: 'right',
|
|
102
|
+
className: 'actions',
|
|
64
103
|
shouldCellUpdate: () => false,
|
|
65
|
-
|
|
104
|
+
width: columnWidth,
|
|
105
|
+
render: (_, item, index) => _getActionButtons(itemActions.map(action => ({
|
|
66
106
|
...action,
|
|
67
107
|
callback: () => action.callback(item)
|
|
68
|
-
})))
|
|
108
|
+
})), index === 0 ? ref : null)
|
|
69
109
|
}
|
|
70
110
|
]);
|
|
111
|
+
const _rowSelection = onSelectionChange === null
|
|
112
|
+
? undefined
|
|
113
|
+
: {
|
|
114
|
+
type: 'checkbox',
|
|
115
|
+
columnTitle: ' ', // blank string to hide select all checkbox from <KitTable />
|
|
116
|
+
selectedRowKeys: selectedKeys,
|
|
117
|
+
preserveSelectedRowKeys: true,
|
|
118
|
+
// TODO: review types from antd directly
|
|
119
|
+
onChange: (selectedRowKeys, _selectedRows, _info) => onSelectionChange(selectedRowKeys),
|
|
120
|
+
getCheckboxProps: isMassSelectionAll
|
|
121
|
+
? () => ({
|
|
122
|
+
disabled: true
|
|
123
|
+
})
|
|
124
|
+
: undefined
|
|
125
|
+
};
|
|
71
126
|
// TODO: handle columns width based on attribute type/format
|
|
72
|
-
return (_jsxs(DataViewContainerDivStyled, { ref: containerRef, children: [_jsx(
|
|
127
|
+
return (_jsxs(DataViewContainerDivStyled, { ref: containerRef, children: [_jsx(StyledTable, { showHeader: dataGroupedFilteredSorted.length > 0, columns: columns, tableLayout: "fixed", scroll: { y: scrollHeight, x: '100%' }, dataSource: dataGroupedFilteredSorted, pagination: false, rowSelection: _rowSelection }), paginationProps && (_jsx("div", { className: "pagination", children: _jsx(KitPagination, { showSizeChanger: true, showTotal: (total, [from, to]) => t('explorer.pagination-total-number', { from, to, count: total }), total: paginationProps.totalCount, defaultCurrent: paginationProps.currentPage, defaultPageSize: paginationProps.pageSize, pageSizeOptions: paginationProps.pageSizeOptions, onChange: paginationProps.setNewPage, onShowSizeChange: paginationProps.setNewPageSize }) }))] }));
|
|
73
128
|
}, arePropsEqual);
|
|
74
129
|
//# sourceMappingURL=DataView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataView.js","sourceRoot":"","sources":["../../../src/components/Explorer/DataView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"DataView.js","sourceRoot":"","sources":["../../../src/components/Explorer/DataView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,YAAY,EAAqC,IAAI,EAAY,MAAM,OAAO,CAAC;AACvF,OAAO,EAAC,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAE3E,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,uBAAuB,EAAE,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,MAAM,OAAO,GAAG,EAAE,CAAC;AAEnB,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAEpC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;0BAMnB,uBAAuB;;;;;;;;;;CAUhD,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B,EAAE,KAAqB,EAAE,EAAE,CACvF,iBAAiB,CAAC,eAAe,CAAC;YACtC,gBAAgB,EAAE,kBAAkB;gBAChC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;oBACH,QAAQ,EAAE,IAAI;iBACjB,CAAC;gBACJ,CAAC,CAAC,SAAS;SAClB,CAAC;IAEZ,4DAA4D;IAC5D,OAAO,CACH,MAAC,0BAA0B,IAAC,GAAG,EAAE,YAAY,aACzC,KAAC,WAAW,IACR,UAAU,EAAE,yBAAyB,CAAC,MAAM,GAAG,CAAC,EAChD,OAAO,EAAE,OAAO,EAChB,WAAW,EAAC,OAAO,EACnB,MAAM,EAAE,EAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAC,EACpC,UAAU,EAAE,yBAAyB,EACrC,UAAU,EAAE,KAAK,EACjB,YAAY,EAAE,aAAa,GAC7B,EACD,eAAe,IAAI,CAChB,cAAK,SAAS,EAAC,YAAY,YACvB,KAAC,aAAa,IACV,eAAe,QACf,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAC7B,CAAC,CAAC,kCAAkC,EAAE,EAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAC,CAAC,EAEnE,KAAK,EAAE,eAAe,CAAC,UAAU,EACjC,cAAc,EAAE,eAAe,CAAC,WAAW,EAC3C,eAAe,EAAE,eAAe,CAAC,QAAQ,EACzC,eAAe,EAAE,eAAe,CAAC,eAAe,EAChD,QAAQ,EAAE,eAAe,CAAC,UAAU,EACpC,gBAAgB,EAAE,eAAe,CAAC,cAAc,GAClD,GACA,CACT,IACwB,CAChC,CAAC;AACN,CAAC,EACD,aAAa,CAChB,CAAC"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { IItemAction, IPrimaryAction } from './_types';
|
|
3
|
-
import { type IViewSettingsState } from './manage-view-settings';
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { DefaultViewSettings, Entrypoint, IItemAction, IMassActions, IPrimaryAction } from './_types';
|
|
4
3
|
interface IExplorerProps {
|
|
4
|
+
entrypoint: Entrypoint;
|
|
5
5
|
noPagination?: true;
|
|
6
|
-
library: string;
|
|
7
6
|
itemActions?: IItemAction[];
|
|
7
|
+
iconsOnlyItemActions?: boolean;
|
|
8
8
|
primaryActions?: IPrimaryAction[];
|
|
9
|
+
massActions?: IMassActions[];
|
|
9
10
|
title?: string;
|
|
10
|
-
|
|
11
|
+
emptyPlaceholder?: ReactNode;
|
|
12
|
+
defaultActionsForItem?: Array<'edit' | 'remove'>;
|
|
11
13
|
defaultPrimaryActions?: Array<'create'>;
|
|
12
|
-
|
|
14
|
+
defaultMassActions?: Array<'deactivate'>;
|
|
15
|
+
defaultViewSettings?: DefaultViewSettings;
|
|
13
16
|
}
|
|
14
17
|
export declare const Explorer: FunctionComponent<IExplorerProps>;
|
|
15
18
|
export {};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
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 { useReducer } from 'react';
|
|
6
2
|
import { createPortal } from 'react-dom';
|
|
7
3
|
import { KitEmpty, KitSpace, KitTypography } from 'aristid-ds';
|
|
8
4
|
import styled from 'styled-components';
|
|
5
|
+
import { Loading } from '../../components/Loading';
|
|
6
|
+
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
9
7
|
import { useExplorerData } from './_queries/useExplorerData';
|
|
10
8
|
import { DataView } from './DataView';
|
|
11
|
-
import { useDeactivateAction } from './useDeactivateAction';
|
|
12
|
-
import { useEditAction } from './useEditAction';
|
|
13
|
-
import { usePrimaryActionsButton } from './usePrimaryActions';
|
|
14
9
|
import { ExplorerTitle } from './ExplorerTitle';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
10
|
+
import { ExplorerToolbar } from './ExplorerToolbar';
|
|
11
|
+
import { useRemoveItemAction } from './actions-item/useRemoveItemAction';
|
|
12
|
+
import { useEditItemAction } from './actions-item/useEditItemAction';
|
|
13
|
+
import { usePrimaryActionsButton } from './actions-primary/usePrimaryActions';
|
|
14
|
+
import { useCreatePrimaryAction } from './actions-primary/useCreatePrimaryAction';
|
|
15
|
+
import { useLinkPrimaryAction } from './actions-primary/useLinkPrimaryAction';
|
|
16
|
+
import { useMassActions } from './actions-mass/useMassActions';
|
|
17
|
+
import { useDeactivateMassAction } from './actions-mass/useDeactivateMassAction';
|
|
18
|
+
import { defaultPageSizeOptions, SidePanel, useEditSettings, useOpenViewSettings, ViewSettingsContext } from './manage-view-settings';
|
|
17
19
|
import { useSearchInput } from './useSearchInput';
|
|
18
20
|
import { usePagination } from './usePagination';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
21
|
+
import { useViewSettingsReducer } from './useViewSettingsReducer';
|
|
22
|
+
import { MASS_SELECTION_ALL } from './_constants';
|
|
22
23
|
const isNotEmpty = (union) => union.length > 0;
|
|
23
24
|
const emptyArray = [];
|
|
24
25
|
const emptyObject = {};
|
|
@@ -27,6 +28,8 @@ const ExplorerHeaderDivStyled = styled.div `
|
|
|
27
28
|
justify-content: space-between;
|
|
28
29
|
align-items: center;
|
|
29
30
|
padding-bottom: calc(var(--general-spacing-xs) * 1px);
|
|
31
|
+
padding-right: calc(var(--general-spacing-xxs) * 1px);
|
|
32
|
+
padding-top: calc(var(--general-spacing-xxs) * 1px);
|
|
30
33
|
`;
|
|
31
34
|
const ExplorerPageDivStyled = styled.div `
|
|
32
35
|
display: flex;
|
|
@@ -34,45 +37,85 @@ const ExplorerPageDivStyled = styled.div `
|
|
|
34
37
|
height: 100%;
|
|
35
38
|
overflow: hidden;
|
|
36
39
|
`;
|
|
37
|
-
|
|
40
|
+
const ExplorerEmptyDataStyled = styled.div `
|
|
41
|
+
flex: 1;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
`;
|
|
47
|
+
export const Explorer = ({ entrypoint, itemActions = [], primaryActions = [], massActions = [], title, emptyPlaceholder, noPagination, iconsOnlyItemActions = false, defaultActionsForItem = ['edit', 'remove'], defaultPrimaryActions = ['create'], defaultMassActions = ['deactivate'], defaultViewSettings }) => {
|
|
38
48
|
const { t } = useSharedTranslation();
|
|
39
|
-
const { panelElement } = useEditSettings();
|
|
40
|
-
const
|
|
41
|
-
...viewSettingsInitialState,
|
|
42
|
-
...defaultViewSettings,
|
|
43
|
-
maxFilters: defaultViewSettings?.maxFilters ?? viewSettingsInitialState.maxFilters
|
|
44
|
-
});
|
|
49
|
+
const { panelElement: settingsPanelElement } = useEditSettings();
|
|
50
|
+
const { loading: viewSettingsLoading, view, dispatch } = useViewSettingsReducer(entrypoint, defaultViewSettings);
|
|
45
51
|
const { currentPage, setNewPageSize, setNewPage } = usePagination(dispatch);
|
|
46
|
-
const { data, loading, refetch } = useExplorerData({
|
|
47
|
-
|
|
52
|
+
const { data, loading: loadingData, refetch } = useExplorerData({
|
|
53
|
+
entrypoint,
|
|
54
|
+
libraryId: view.libraryId,
|
|
48
55
|
attributeIds: view.attributesIds,
|
|
49
56
|
fulltextSearch: view.fulltextSearch,
|
|
50
57
|
pagination: noPagination ? null : { limit: view.pageSize, offset: view.pageSize * (currentPage - 1) },
|
|
51
58
|
sorts: view.sort,
|
|
52
|
-
filters: view.filters
|
|
59
|
+
filters: view.filters,
|
|
60
|
+
skip: viewSettingsLoading
|
|
53
61
|
}); // TODO: refresh when go back on page
|
|
54
|
-
const
|
|
55
|
-
|
|
62
|
+
const isMassSelectionAll = view.massSelection === MASS_SELECTION_ALL;
|
|
63
|
+
const { removeItemAction } = useRemoveItemAction({
|
|
64
|
+
isEnabled: isNotEmpty(defaultActionsForItem) && defaultActionsForItem.includes('remove'),
|
|
65
|
+
store: { view, dispatch },
|
|
66
|
+
entrypoint
|
|
56
67
|
});
|
|
57
|
-
const {
|
|
68
|
+
const { editItemAction, editItemModal } = useEditItemAction({
|
|
58
69
|
isEnabled: isNotEmpty(defaultActionsForItem) && defaultActionsForItem.includes('edit')
|
|
59
70
|
});
|
|
60
|
-
const
|
|
71
|
+
const totalCount = data?.totalCount ?? 0;
|
|
72
|
+
const { createPrimaryAction, createModal } = useCreatePrimaryAction({
|
|
61
73
|
isEnabled: isNotEmpty(defaultPrimaryActions) && defaultPrimaryActions.includes('create'),
|
|
62
|
-
|
|
74
|
+
libraryId: view.libraryId,
|
|
75
|
+
entrypoint: view.entrypoint,
|
|
76
|
+
totalCount,
|
|
63
77
|
refetch
|
|
64
78
|
});
|
|
65
|
-
const {
|
|
66
|
-
|
|
79
|
+
const { linkPrimaryAction, linkModal } = useLinkPrimaryAction({
|
|
80
|
+
isEnabled: entrypoint.type === 'link',
|
|
81
|
+
maxItemsLeft: null // TODO: use KitTable.row
|
|
82
|
+
});
|
|
83
|
+
const allVisibleKeys = data?.records.map(({ key }) => key) ?? [];
|
|
84
|
+
const { deactivateMassAction } = useDeactivateMassAction({
|
|
85
|
+
isEnabled: isNotEmpty(defaultMassActions) && defaultMassActions.includes('deactivate'),
|
|
86
|
+
store: { view, dispatch },
|
|
87
|
+
allVisibleKeys,
|
|
88
|
+
refetch
|
|
89
|
+
});
|
|
90
|
+
const { setSelectedKeys, selectAllButton } = useMassActions({
|
|
91
|
+
isEnabled: totalCount > 0 && (isNotEmpty(defaultMassActions) || isNotEmpty(massActions)),
|
|
92
|
+
store: { view, dispatch },
|
|
93
|
+
totalCount,
|
|
94
|
+
allVisibleKeys,
|
|
95
|
+
massActions: [deactivateMassAction, ...massActions].filter(Boolean)
|
|
96
|
+
});
|
|
97
|
+
const { primaryButton } = usePrimaryActionsButton([createPrimaryAction, linkPrimaryAction, ...primaryActions].filter(Boolean));
|
|
98
|
+
const { viewSettingsButton } = useOpenViewSettings({ view, isEnabled: !isMassSelectionAll });
|
|
67
99
|
const { searchInput } = useSearchInput({ view, dispatch });
|
|
68
100
|
const hasNoResults = data === null || data.totalCount === 0;
|
|
69
|
-
return (_jsxs(ViewSettingsContext.Provider, { value: { view, dispatch }, children: [_jsxs(ExplorerPageDivStyled, { children: [_jsxs(ExplorerHeaderDivStyled, { children: [_jsx(KitTypography.Title, { level: "
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
101
|
+
return (_jsxs(ViewSettingsContext.Provider, { value: { view, dispatch }, children: [_jsxs(ExplorerPageDivStyled, { children: [_jsxs(ExplorerHeaderDivStyled, { children: [_jsx(KitTypography.Title, { level: "h3", children: !viewSettingsLoading && (_jsx(ExplorerTitle, { library: view.libraryId, title: title, entrypoint: entrypoint })) /*TODO: manage loading*/ }), !isMassSelectionAll && (_jsxs(KitSpace, { size: "xs", children: [searchInput, viewSettingsButton, primaryButton] }))] }), !viewSettingsLoading && (_jsx(ExplorerToolbar, { isMassSelectionAll: isMassSelectionAll, children: selectAllButton })), loadingData || viewSettingsLoading ? (_jsx(Loading, {})) : hasNoResults ? (_jsx(ExplorerEmptyDataStyled, { children: emptyPlaceholder || _jsx(KitEmpty, { title: t('explorer.empty-data') }) })) : (_jsx(DataView, { dataGroupedFilteredSorted: data?.records ?? emptyArray, attributesProperties: data?.attributes ?? emptyObject, attributesToDisplay: ['whoAmI', ...view.attributesIds], iconsOnlyItemActions: iconsOnlyItemActions, paginationProps: entrypoint.type === 'library'
|
|
102
|
+
? {
|
|
103
|
+
pageSizeOptions: defaultPageSizeOptions,
|
|
104
|
+
currentPage,
|
|
105
|
+
pageSize: view.pageSize,
|
|
106
|
+
setNewPageSize,
|
|
107
|
+
setNewPage,
|
|
108
|
+
totalCount
|
|
109
|
+
}
|
|
110
|
+
: undefined, itemActions: [editItemAction, removeItemAction, ...itemActions].filter(Boolean).map(action => ({
|
|
111
|
+
...action,
|
|
112
|
+
disabled: isMassSelectionAll
|
|
113
|
+
})), selection: {
|
|
114
|
+
onSelectionChange: setSelectedKeys,
|
|
115
|
+
isMassSelectionAll,
|
|
116
|
+
selectedKeys: isMassSelectionAll
|
|
117
|
+
? data?.records.map(({ whoAmI }) => whoAmI.id)
|
|
118
|
+
: view.massSelection
|
|
119
|
+
} }))] }), settingsPanelElement && createPortal(_jsx(SidePanel, {}), settingsPanelElement?.() ?? document.body), editItemModal, createModal, linkModal] }));
|
|
77
120
|
};
|
|
78
121
|
//# sourceMappingURL=Explorer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Explorer.js","sourceRoot":"","sources":["../../../src/components/Explorer/Explorer.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Explorer.js","sourceRoot":"","sources":["../../../src/components/Explorer/Explorer.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAC7D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,OAAO,EAAC,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,eAAe,EAAC,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAC,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,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b,WAAW,EACX,SAAS,IACiB,CAClC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
+
import { Entrypoint } from './_types';
|
|
2
3
|
interface IExplorerTitleProps {
|
|
3
4
|
title?: string;
|
|
4
5
|
library: string;
|
|
6
|
+
entrypoint: Entrypoint;
|
|
5
7
|
}
|
|
6
8
|
export declare const ExplorerTitle: FunctionComponent<IExplorerTitleProps>;
|
|
7
9
|
export {};
|
|
@@ -3,28 +3,45 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
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
5
|
import { localizedTranslation } from '@leav/utils';
|
|
6
|
-
import {
|
|
6
|
+
import { useExplorerLibraryDetailsQuery, useExplorerLinkAttributeQuery } from '../../_gqlTypes';
|
|
7
7
|
import useLang from '../../hooks/useLang';
|
|
8
8
|
import { AntSkeleton } from 'aristid-ds';
|
|
9
9
|
// TODO: use <h1 /> tag
|
|
10
|
-
export const ExplorerTitle = ({ title, library }) => {
|
|
11
|
-
const { data, loading, error } =
|
|
10
|
+
export const ExplorerTitle = ({ title, library, entrypoint }) => {
|
|
11
|
+
const { data, loading, error } = useExplorerLibraryDetailsQuery({ variables: { libraryId: library }, skip: !!title });
|
|
12
|
+
const { data: attributeData, loading: attributeLoading, error: attributeError } = useExplorerLinkAttributeQuery({
|
|
13
|
+
skip: !!title || entrypoint.type !== 'link',
|
|
14
|
+
variables: {
|
|
15
|
+
id: entrypoint.linkAttributeId
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
const { lang } = useLang();
|
|
13
19
|
if (title) {
|
|
14
20
|
return _jsx("span", { children: title });
|
|
15
21
|
}
|
|
16
|
-
if (loading) {
|
|
22
|
+
if (loading || attributeLoading) {
|
|
17
23
|
return _jsx(AntSkeleton.Input, { style: { width: 400 }, active: true });
|
|
18
24
|
}
|
|
19
25
|
// TODO: handle error and bad library ID
|
|
20
|
-
if (error) {
|
|
21
|
-
return _jsx("span", { children: error
|
|
26
|
+
if (error || attributeError) {
|
|
27
|
+
return _jsx("span", { children: error?.message ?? attributeError?.message });
|
|
22
28
|
}
|
|
23
|
-
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
let label;
|
|
30
|
+
if (entrypoint.type === 'library') {
|
|
31
|
+
const libraryData = data?.libraries?.list[0];
|
|
32
|
+
if (!libraryData) {
|
|
33
|
+
// TODO: make it i18n
|
|
34
|
+
return _jsx("span", { children: "Unknown library" });
|
|
35
|
+
}
|
|
36
|
+
label = libraryData.label;
|
|
27
37
|
}
|
|
28
|
-
|
|
38
|
+
else {
|
|
39
|
+
const linkAttributeData = attributeData?.attributes?.list[0];
|
|
40
|
+
if (!linkAttributeData) {
|
|
41
|
+
return _jsx("span", { children: "Unknown link attribute" });
|
|
42
|
+
}
|
|
43
|
+
label = 'label' in linkAttributeData ? linkAttributeData.label : null;
|
|
44
|
+
}
|
|
45
|
+
return _jsx("span", { children: localizedTranslation(label, lang) });
|
|
29
46
|
};
|
|
30
47
|
//# sourceMappingURL=ExplorerTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExplorerTitle.js","sourceRoot":"","sources":["../../../src/components/Explorer/ExplorerTitle.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"ExplorerTitle.js","sourceRoot":"","sources":["../../../src/components/Explorer/ExplorerTitle.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,8BAA8B,EAAE,6BAA6B,EAAC,MAAM,e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C,CAAC,CAAC,CAAC;QAE7C,IAAI,CAAC,WAAW,EAAE,CAAC;YACf,qBAAqB;YACrB,OAAO,6CAA4B,CAAC;QACxC,CAAC;QAED,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;IAC9B,CAAC;SAAM,CAAC;QACJ,MAAM,iBAAiB,GAAG,aAAa,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAE7D,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACrB,OAAO,oDAAmC,CAAC;QAC/C,CAAC;QAED,KAAK,GAAG,OAAO,IAAI,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1E,CAAC;IAED,OAAO,yBAAO,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,GAAQ,CAAC;AAC5D,CAAC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { KitDivider, KitFilter, KitSpace } from 'aristid-ds';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
5
|
+
import { SortOrder } from '../../_gqlTypes';
|
|
6
|
+
import { useViewSettingsContext } from './manage-view-settings/store-view-settings/useViewSettingsContext';
|
|
7
|
+
import { CommonFilterItem } from './manage-view-settings/_shared/CommonFilterItem';
|
|
8
|
+
import { useAttributeDetailsData } from './manage-view-settings/_shared/useAttributeDetailsData';
|
|
9
|
+
import { useOpenViewSettings } from './manage-view-settings';
|
|
10
|
+
const FilterStyled = styled(KitFilter) `
|
|
11
|
+
flex: 0 0 auto;
|
|
12
|
+
`;
|
|
13
|
+
const ExplorerToolbarListStyled = styled.ul `
|
|
14
|
+
padding: calc(var(--general-spacing-xs) * 1px);
|
|
15
|
+
margin: 0;
|
|
16
|
+
margin-bottom: calc(var(--general-spacing-s) * 1px);
|
|
17
|
+
background: var(--general-colors-neutral-grey-100);
|
|
18
|
+
border-radius: calc(var(--general-border-radius-s) * 1px);
|
|
19
|
+
list-style: none;
|
|
20
|
+
display: flex;
|
|
21
|
+
overflow: auto;
|
|
22
|
+
flex-wrap: nowrap;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: 0;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
min-height: 26px; // height of the filter chip
|
|
27
|
+
`;
|
|
28
|
+
const DividerStyled = styled(KitDivider) `
|
|
29
|
+
height: 2em;
|
|
30
|
+
`;
|
|
31
|
+
export const ExplorerToolbar = ({ isMassSelectionAll, children }) => {
|
|
32
|
+
const { t } = useSharedTranslation();
|
|
33
|
+
const { view } = useViewSettingsContext();
|
|
34
|
+
const { filters, sort } = view;
|
|
35
|
+
const { openSettingsPanel } = useOpenViewSettings({ view });
|
|
36
|
+
const { attributeDetailsById } = useAttributeDetailsData(view.libraryId);
|
|
37
|
+
if (filters.length === 0 && sort.length === 0 && children === null) {
|
|
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
|
+
const _handleClickOnSort = () => isMassSelectionAll ? undefined : () => openSettingsPanel('sort-items');
|
|
46
|
+
return (_jsxs(ExplorerToolbarListStyled, { "aria-label": t('explorer.toolbar'), children: [children !== null && (_jsxs(_Fragment, { children: [_jsx("li", { children: children }), filters.length !== 0 && _jsx(DividerStyled, { type: "vertical" })] })), _jsxs(KitSpace, { size: "s", children: [filters.length > 0 &&
|
|
47
|
+
filters.map(filter => (_jsx("li", { children: _jsx(CommonFilterItem, { filter: filter, disabled: isMassSelectionAll }, filter.id) }, filter.id))), sort.length > 0 && (_jsx("li", { children: _jsx(FilterStyled, { label: t('explorer.sort-items'), values: sortValues, disabled: isMassSelectionAll, onClick: _handleClickOnSort }) }))] })] }));
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=ExplorerToolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExplorerToolbar.js","sourceRoot":"","sources":["../../../src/components/Explorer/ExplorerToolbar.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAC3D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,sBAAsB,EAAC,MAAM,mEAAmE,CAAC;AACzG,OAAO,EAAC,gBAAgB,EAAC,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAC,uBAAuB,EAAC,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAE3D,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;;CAErC,CAAC;AAEF,MAAM,yBAAyB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;;;;;;;;CAc1C,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;;CAEvC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAEvB,CAAC,EAAC,kBAAkB,EAAE,QAAQ,EAAC,EAAE,EAAE;IACpC,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,EAAC,IAAI,EAAC,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAC,OAAO,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC;IAE7B,MAAM,EAAC,iBAAiB,EAAC,GAAG,mBAAmB,CAAC,EAAC,IAAI,EAAC,CAAC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AvD,MAAM,CAAC,EAAE,CAAkD,IAD7E,MAAM,CAAC,EAAE,CAEb,CACR,CAAC,EACL,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAChB,uBACI,KAAC,YAAY,IACT,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAC/B,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,kBAAkB,GAC7B,GACD,CACR,IACM,IACa,CAC/B,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -11,6 +11,7 @@ import { KitAvatar, KitSpace, KitTag, KitTypography } from 'aristid-ds';
|
|
|
11
11
|
import styled from 'styled-components';
|
|
12
12
|
import { IdCard } from './IdCard';
|
|
13
13
|
import { multiColorTagAvatarClassName, TableTagGroup } from './TableTagGroup';
|
|
14
|
+
import { ColorFactory } from 'antd/lib/color-picker/color';
|
|
14
15
|
const isStandardValue = (v, attribute) => [AttributeType.simple, AttributeType.advanced].includes(attribute.type);
|
|
15
16
|
const isStandardValues = (values, attribute) => values.every(value => isStandardValue(value, attribute));
|
|
16
17
|
const isLinkValue = (v, attribute) => [AttributeType.simple_link, AttributeType.advanced_link].includes(attribute.type);
|
|
@@ -42,6 +43,14 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
42
43
|
}
|
|
43
44
|
return (_jsxs(KitSpace, { size: "xxs", children: [_jsx(StyledFaCalendar, {}), value.from, " ", _jsx(FaArrowRight, {}), " ", value.to] }));
|
|
44
45
|
}, []);
|
|
46
|
+
const _getFirstValue = useCallback((value, attribute) => {
|
|
47
|
+
if (isStandardValue(value, attribute) && attribute.format === AttributeFormat.boolean) {
|
|
48
|
+
if (!value || value.valuePayload === null) {
|
|
49
|
+
return { valuePayload: false };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return value;
|
|
53
|
+
}, []);
|
|
45
54
|
if (attributeProperties.multiple_values) {
|
|
46
55
|
if (isStandardValues(values, attributeProperties)) {
|
|
47
56
|
const tags = values.map(value => {
|
|
@@ -54,12 +63,12 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
54
63
|
type: value.valuePayload ? 'primary' : 'neutral'
|
|
55
64
|
};
|
|
56
65
|
case AttributeFormat.color:
|
|
57
|
-
const
|
|
66
|
+
const color = new ColorFactory(value.valueRawPayload);
|
|
58
67
|
return {
|
|
59
68
|
idCardProps: {
|
|
60
|
-
description:
|
|
69
|
+
description: value.valuePayload,
|
|
61
70
|
avatarProps: {
|
|
62
|
-
color:
|
|
71
|
+
color: color.toHexString(),
|
|
63
72
|
shape: 'square',
|
|
64
73
|
className: multiColorTagAvatarClassName
|
|
65
74
|
}
|
|
@@ -98,7 +107,7 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
98
107
|
}
|
|
99
108
|
}
|
|
100
109
|
else {
|
|
101
|
-
const value = values[0]; // Not multiple_values attribute should not have more than one value
|
|
110
|
+
const value = _getFirstValue(values[0], attributeProperties); // Not multiple_values attribute should not have more than one value
|
|
102
111
|
if (!value) {
|
|
103
112
|
return null;
|
|
104
113
|
}
|
|
@@ -119,8 +128,8 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
119
128
|
content = (_jsxs(_Fragment, { children: [_jsx(StyledFaListAlt, {}), _jsx(KitTypography.Text, { ellipsis: { tooltip: textContent }, children: textContent }, attributeProperties.id)] }));
|
|
120
129
|
break;
|
|
121
130
|
case AttributeFormat.color:
|
|
122
|
-
const
|
|
123
|
-
content = (_jsxs(_Fragment, { children: [_jsx(StyledColorChip, { "$colorTextContent":
|
|
131
|
+
const color = new ColorFactory(value.valueRawPayload);
|
|
132
|
+
content = (_jsxs(_Fragment, { children: [_jsx(StyledColorChip, { "$colorTextContent": color.toHexString() }), _jsx(KitTypography.Text, { ellipsis: { tooltip: value.valuePayload }, children: value.valuePayload }, attributeProperties.id)] }));
|
|
124
133
|
break;
|
|
125
134
|
case AttributeFormat.date_range:
|
|
126
135
|
content = _getDateRangeValueContent(value.valuePayload);
|