@leav/ui 0.3.6-c780e07 → 0.3.6-c9a34f2
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.js +2 -1
- package/dist/__mocks__/common/attribute.js.map +1 -1
- package/dist/__mocks__/common/form.d.ts +11 -5
- package/dist/__mocks__/common/form.js +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/_gqlTypes/index.d.ts +135 -18
- package/dist/_gqlTypes/index.js +97 -5
- package/dist/_gqlTypes/index.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/recordFormAttributeFragment.js +2 -0
- package/dist/_queries/records/recordFormAttributeFragment.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 +36 -36
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +9 -4
- package/dist/components/Explorer/Explorer.js +56 -10
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/ExplorerTitle.d.ts +7 -0
- package/dist/components/Explorer/ExplorerTitle.js +30 -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 +143 -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/_queries/useExplorerData.d.ts +27 -0
- package/dist/components/Explorer/_queries/useExplorerData.js +66 -0
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -0
- package/dist/components/Explorer/_types.d.ts +48 -0
- package/dist/components/Explorer/_types.js +2 -0
- package/dist/components/Explorer/_types.js.map +1 -0
- package/dist/components/Explorer/display-view-filters/ExplorerFilterBar.d.ts +2 -0
- package/dist/components/Explorer/display-view-filters/ExplorerFilterBar.js +37 -0
- package/dist/components/Explorer/display-view-filters/ExplorerFilterBar.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 +78 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.d.ts +9 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js +33 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js +17 -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 +39 -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/SimpleFilterDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.js +69 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.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 +47 -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 +14 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js +82 -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 +14 -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 +3 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js +21 -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 +7 -0
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +53 -0
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.d.ts +4 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js +109 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.d.ts +10 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js +32 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/ViewSettingsContext.d.ts +6 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/ViewSettingsContext.js +11 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/ViewSettingsContext.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/useViewSettingsContext.d.ts +4 -0
- package/dist/components/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 +13 -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 +130 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +164 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -0
- package/dist/components/Explorer/{useCreateMainAction.d.ts → useCreateAction.d.ts} +3 -3
- package/dist/components/Explorer/{useCreateMainAction.js → useCreateAction.js} +11 -7
- package/dist/components/Explorer/useCreateAction.js.map +1 -0
- package/dist/components/Explorer/useDeactivateAction.d.ts +1 -1
- package/dist/components/Explorer/useDeactivateAction.js +4 -3
- package/dist/components/Explorer/useDeactivateAction.js.map +1 -1
- package/dist/components/Explorer/useEditAction.d.ts +1 -1
- package/dist/components/Explorer/useEditAction.js +7 -5
- 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 +21 -0
- package/dist/components/Explorer/usePrimaryActions.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/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/RecordEdition/EditRecord/EditRecord.js +2 -2
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +7 -20
- 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 +40 -33
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.js +3 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.d.ts +1 -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 +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.js +2 -7
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.js +2 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.d.ts +6 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.js +18 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.d.ts +4 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.js +25 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.d.ts +3 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +141 -193
- 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 +10 -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 +32 -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 +19 -48
- 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 +9 -77
- 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 +23 -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 +28 -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 +39 -64
- 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 +24 -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 +14 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +64 -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 +126 -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 +2 -6
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.d.ts +13 -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 +37 -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/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/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/useGetRecordForm/useGetRecordForm.d.ts +1 -0
- package/dist/hooks/useGetRecordForm/useGetRecordForm.js.map +1 -1
- package/dist/locales/en/shared.json +60 -7
- package/dist/locales/fr/shared.json +60 -7
- 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.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/reducers/standardFieldReducer/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer.d.ts +0 -138
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer.js +0 -361
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.d.ts +0 -7
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.js +0 -9
- 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/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 -89
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueDisplayHandler.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/ColorPickerBlock.d.ts +0 -7
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/ColorPickerBlock.js +0 -45
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/ColorPickerBlock.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/StandardFieldValueRead.d.ts +0 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/StandardFieldValueRead.js +0 -141
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/StandardFieldValueRead.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/index.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.js +0 -105
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.js.map +0 -1
|
@@ -1,32 +1,78 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
-
|
|
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
|
+
import { createPortal } from 'react-dom';
|
|
7
|
+
import { KitEmpty, KitSpace, KitTypography } from 'aristid-ds';
|
|
3
8
|
import styled from 'styled-components';
|
|
9
|
+
import { useExplorerData } from './_queries/useExplorerData';
|
|
4
10
|
import { DataView } from './DataView';
|
|
5
|
-
import { useExplorerData } from './useExplorerData';
|
|
6
11
|
import { useDeactivateAction } from './useDeactivateAction';
|
|
7
12
|
import { useEditAction } from './useEditAction';
|
|
8
|
-
import {
|
|
13
|
+
import { usePrimaryActionsButton } from './usePrimaryActions';
|
|
14
|
+
import { ExplorerTitle } from './ExplorerTitle';
|
|
15
|
+
import { useCreateAction } from './useCreateAction';
|
|
16
|
+
import { SidePanel, useEditSettings, useOpenViewSettings, ViewSettingsContext, viewSettingsInitialState, defaultPageSizeOptions, viewSettingsReducer } from './manage-view-settings';
|
|
17
|
+
import { useSearchInput } from './useSearchInput';
|
|
18
|
+
import { usePagination } from './usePagination';
|
|
19
|
+
import { Loading } from '../Loading';
|
|
20
|
+
import { ExplorerFilterBar } from './display-view-filters/ExplorerFilterBar';
|
|
21
|
+
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
9
22
|
const isNotEmpty = (union) => union.length > 0;
|
|
23
|
+
const emptyArray = [];
|
|
24
|
+
const emptyObject = {};
|
|
10
25
|
const ExplorerHeaderDivStyled = styled.div `
|
|
11
26
|
display: flex;
|
|
12
27
|
justify-content: space-between;
|
|
13
28
|
align-items: center;
|
|
14
29
|
padding-bottom: calc(var(--general-spacing-xs) * 1px);
|
|
15
30
|
`;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
const ExplorerPageDivStyled = styled.div `
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
height: 100%;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
`;
|
|
37
|
+
export const Explorer = ({ library, itemActions, primaryActions, title, noPagination, defaultActionsForItem = ['edit', 'deactivate'], defaultPrimaryActions = ['create'], defaultViewSettings }) => {
|
|
38
|
+
const { t } = useSharedTranslation();
|
|
39
|
+
const { panelElement } = useEditSettings();
|
|
40
|
+
const [view, dispatch] = useReducer(viewSettingsReducer, {
|
|
41
|
+
...viewSettingsInitialState,
|
|
42
|
+
...defaultViewSettings,
|
|
43
|
+
maxFilters: defaultViewSettings?.maxFilters ?? viewSettingsInitialState.maxFilters
|
|
44
|
+
});
|
|
45
|
+
const { currentPage, setNewPageSize, setNewPage } = usePagination(dispatch);
|
|
46
|
+
const { data, loading, refetch } = useExplorerData({
|
|
47
|
+
libraryId: library,
|
|
48
|
+
attributeIds: view.attributesIds,
|
|
49
|
+
fulltextSearch: view.fulltextSearch,
|
|
50
|
+
pagination: noPagination ? null : { limit: view.pageSize, offset: view.pageSize * (currentPage - 1) },
|
|
51
|
+
sorts: view.sort,
|
|
52
|
+
filters: view.filters
|
|
53
|
+
}); // TODO: refresh when go back on page
|
|
19
54
|
const { deactivateAction } = useDeactivateAction({
|
|
20
55
|
isEnabled: isNotEmpty(defaultActionsForItem) && defaultActionsForItem.includes('deactivate')
|
|
21
56
|
});
|
|
22
57
|
const { editAction, editModal } = useEditAction({
|
|
23
58
|
isEnabled: isNotEmpty(defaultActionsForItem) && defaultActionsForItem.includes('edit')
|
|
24
59
|
});
|
|
25
|
-
const {
|
|
26
|
-
isEnabled: isNotEmpty(
|
|
60
|
+
const { createAction, createModal } = useCreateAction({
|
|
61
|
+
isEnabled: isNotEmpty(defaultPrimaryActions) && defaultPrimaryActions.includes('create'),
|
|
27
62
|
library,
|
|
28
63
|
refetch
|
|
29
64
|
});
|
|
30
|
-
|
|
65
|
+
const { primaryButton } = usePrimaryActionsButton([createAction, ...(primaryActions ?? [])].filter(Boolean));
|
|
66
|
+
const { viewSettingsButton } = useOpenViewSettings(library);
|
|
67
|
+
const { searchInput } = useSearchInput({ view, dispatch });
|
|
68
|
+
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: "h1", children: _jsx(ExplorerTitle, { library: library, title: title }) }), _jsxs(KitSpace, { size: "xs", children: [searchInput, viewSettingsButton, primaryButton] })] }), _jsx(ExplorerFilterBar, {}), loading ? (_jsx(Loading, {})) : hasNoResults ? (_jsx(KitEmpty, { title: t('explorer.empty-data') })) : (_jsx(DataView, { dataGroupedFilteredSorted: data?.records ?? emptyArray, attributesProperties: data?.attributes ?? emptyObject, attributesToDisplay: ['whoAmI', ...view.attributesIds], paginationProps: {
|
|
70
|
+
pageSizeOptions: defaultPageSizeOptions,
|
|
71
|
+
currentPage,
|
|
72
|
+
pageSize: view.pageSize,
|
|
73
|
+
setNewPageSize,
|
|
74
|
+
setNewPage,
|
|
75
|
+
totalItems: data?.totalCount ?? 0
|
|
76
|
+
}, itemActions: [editAction, deactivateAction, ...(itemActions ?? emptyArray)].filter(Boolean) }))] }), panelElement && createPortal(_jsx(SidePanel, {}), panelElement), editModal, createModal] }));
|
|
31
77
|
};
|
|
32
78
|
//# 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":";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B,KAAC,iBAAiB,KAAG,EACpB,OAAO,CAAC,CAAC,CAAC,CACP,KAAC,OAAO,KAAG,CACd,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CACf,KAAC,QAAQ,IAAC,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC,GAAI,CAChD,CAAC,CAAC,CAAC,CACA,KAAC,QAAQ,IACL,yBAAyB,EAAE,IAAI,EAAE,OAAO,IAAI,UAAU,EACtD,oBAAoB,EAAE,IAAI,EAAE,UAAU,IAAI,WAAW,EACrD,mBAAmB,EAAE,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,EACtD,eAAe,EAAE;4BACb,eAAe,EAAE,sBAAsB;4BACvC,WAAW;4BACX,QAAQ,EAAE,IAAI,CAAC,QAAQ;4BACvB,cAAc;4BACd,UAAU;4BACV,UAAU,EAAE,IAAI,EAAE,UAAU,IAAI,CAAC;yBACpC,EACD,WAAW,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,GAAG,CAAC,WAAW,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAC7F,CACL,IACmB,EACvB,YAAY,IAAI,YAAY,CAAC,KAAC,SAAS,KAAG,EAAE,YAAY,CAAC,EACzD,SAAS,EACT,WAAW,IACe,CAClC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
|
+
// This file is released under LGPL V3
|
|
4
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
+
import { localizedTranslation } from '@leav/utils';
|
|
6
|
+
import { useExplorerLibraryDataQuery } from '../../_gqlTypes';
|
|
7
|
+
import useLang from '../../hooks/useLang';
|
|
8
|
+
import { AntSkeleton } from 'aristid-ds';
|
|
9
|
+
// TODO: use <h1 /> tag
|
|
10
|
+
export const ExplorerTitle = ({ title, library }) => {
|
|
11
|
+
const { data, loading, error } = useExplorerLibraryDataQuery({ variables: { libraryId: library }, skip: !!title });
|
|
12
|
+
const { lang } = useLang();
|
|
13
|
+
if (title) {
|
|
14
|
+
return _jsx("span", { children: title });
|
|
15
|
+
}
|
|
16
|
+
if (loading) {
|
|
17
|
+
return _jsx(AntSkeleton.Input, { style: { width: 400 }, active: true });
|
|
18
|
+
}
|
|
19
|
+
// TODO: handle error and bad library ID
|
|
20
|
+
if (error) {
|
|
21
|
+
return _jsx("span", { children: error.message });
|
|
22
|
+
}
|
|
23
|
+
const libraryData = data?.libraries?.list[0];
|
|
24
|
+
if (!libraryData) {
|
|
25
|
+
// TODO: make it i18n
|
|
26
|
+
return _jsx("span", { children: "Unknown library" });
|
|
27
|
+
}
|
|
28
|
+
return _jsx("span", { children: localizedTranslation(libraryData.label, lang) });
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=ExplorerTitle.js.map
|
|
@@ -0,0 +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,2BAA2B,EAAC,MAAM,eAAe,CAAC;AAC1D,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,YAAY,CAAC;AAQvC,uBAAuB;AACvB,MAAM,CAAC,MAAM,aAAa,GAA2C,CAAC,EAAC,KAAK,EAAE,OAAO,EAAC,EAAE,EAAE;IACtF,MAAM,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAC,GAAG,2BAA2B,CAAC,EAAC,SAAS,EAAE,EAAC,SAAS,EAAE,OAAO,EAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,EAAC,CAAC,CAAC;IAC7G,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,EAAE,CAAC;IAEzB,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,yBAAO,KAAK,GAAQ,CAAC;IAChC,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACV,OAAO,KAAC,WAAW,CAAC,KAAK,IAAC,KAAK,EAAE,EAAC,KAAK,EAAE,GAAG,EAAC,EAAE,MAAM,SAAG,CAAC;IAC7D,CAAC;IAED,wCAAwC;IACxC,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,yBAAO,KAAK,CAAC,OAAO,GAAQ,CAAC;IACxC,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAE7C,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,qBAAqB;QACrB,OAAO,6CAA4B,CAAC;IACxC,CAAC;IAED,OAAO,yBAAO,oBAAoB,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,GAAQ,CAAC;AACxE,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
|
+
// This file is released under LGPL V3
|
|
4
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
+
import { KitIdCard } from 'aristid-ds';
|
|
6
|
+
export const IdCard = ({ item }) => {
|
|
7
|
+
const { id, label, library, preview, subLabel } = item;
|
|
8
|
+
const itemLabel = label ?? id;
|
|
9
|
+
const avatarProps = { label: itemLabel };
|
|
10
|
+
if (preview) {
|
|
11
|
+
avatarProps.src = preview.small;
|
|
12
|
+
}
|
|
13
|
+
return _jsx(KitIdCard, { avatarProps: avatarProps, title: label ?? id, description: subLabel ?? library.id });
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=IdCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdCard.js","sourceRoot":"","sources":["../../../src/components/Explorer/IdCard.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AASrC,MAAM,CAAC,MAAM,MAAM,GAAoC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE;IAC9D,MAAM,EAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAC,GAAG,IAAI,CAAC;IACrD,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE,CAAC;IAC9B,MAAM,WAAW,GAAe,EAAC,KAAK,EAAE,SAAS,EAAC,CAAC;IAEnD,IAAI,OAAO,EAAE,CAAC;QACV,WAAW,CAAC,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC;IACpC,CAAC;IAED,OAAO,KAAC,SAAS,IAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,EAAE,WAAW,EAAE,QAAQ,IAAI,OAAO,CAAC,EAAE,GAAI,CAAC;AAC5G,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { AttributePropertiesFragment, PropertyValueFragment } from '../../_gqlTypes';
|
|
3
|
+
interface ITableCellProps {
|
|
4
|
+
values: PropertyValueFragment[];
|
|
5
|
+
attributeProperties: AttributePropertiesFragment;
|
|
6
|
+
}
|
|
7
|
+
export declare const TableCell: FunctionComponent<ITableCellProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
|
+
// This file is released under LGPL V3
|
|
4
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
+
import { useCallback } from 'react';
|
|
6
|
+
import { AttributeFormat, AttributeType } from '../../_gqlTypes';
|
|
7
|
+
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
8
|
+
import { FaArrowRight, FaCalendar, FaListAlt } from 'react-icons/fa';
|
|
9
|
+
import DOMPurify from 'dompurify';
|
|
10
|
+
import { KitAvatar, KitSpace, KitTag, KitTypography } from 'aristid-ds';
|
|
11
|
+
import styled from 'styled-components';
|
|
12
|
+
import { IdCard } from './IdCard';
|
|
13
|
+
import { multiColorTagAvatarClassName, TableTagGroup } from './TableTagGroup';
|
|
14
|
+
const isStandardValue = (v, attribute) => [AttributeType.simple, AttributeType.advanced].includes(attribute.type);
|
|
15
|
+
const isStandardValues = (values, attribute) => values.every(value => isStandardValue(value, attribute));
|
|
16
|
+
const isLinkValue = (v, attribute) => [AttributeType.simple_link, AttributeType.advanced_link].includes(attribute.type);
|
|
17
|
+
const isLinkValues = (values, attribute) => values.every(value => isLinkValue(value, attribute));
|
|
18
|
+
const isTreeValue = (v, attribute) => [AttributeType.tree].includes(attribute.type);
|
|
19
|
+
const isDateRangeValue = (v) => 'from' in v && 'to' in v;
|
|
20
|
+
const StyledCenteringWrapper = styled.div `
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: calc(var(--general-spacing-xs) * 1px);
|
|
24
|
+
`;
|
|
25
|
+
const StyledColorChip = styled.div `
|
|
26
|
+
height: calc(var(--general-spacing-s) * 1px);
|
|
27
|
+
width: calc(var(--general-spacing-s) * 1px);
|
|
28
|
+
border-radius: calc(var(--general-border-radius-xs) * 1px);
|
|
29
|
+
background-color: ${props => props.$colorTextContent};
|
|
30
|
+
`;
|
|
31
|
+
const StyledFaListAlt = styled(FaListAlt) `
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
`;
|
|
34
|
+
const StyledFaCalendar = styled(FaCalendar) `
|
|
35
|
+
flex-shrink: 0;
|
|
36
|
+
`;
|
|
37
|
+
export const TableCell = ({ values, attributeProperties }) => {
|
|
38
|
+
const { t } = useSharedTranslation();
|
|
39
|
+
const _getDateRangeValueContent = useCallback((value) => {
|
|
40
|
+
if (!isDateRangeValue(value)) {
|
|
41
|
+
return t('explorer.invalid-value');
|
|
42
|
+
}
|
|
43
|
+
return (_jsxs(KitSpace, { size: "xxs", children: [_jsx(StyledFaCalendar, {}), value.from, " ", _jsx(FaArrowRight, {}), " ", value.to] }));
|
|
44
|
+
}, []);
|
|
45
|
+
if (attributeProperties.multiple_values) {
|
|
46
|
+
if (isStandardValues(values, attributeProperties)) {
|
|
47
|
+
const tags = values.map(value => {
|
|
48
|
+
switch (attributeProperties.format) {
|
|
49
|
+
case AttributeFormat.boolean:
|
|
50
|
+
return {
|
|
51
|
+
idCardProps: {
|
|
52
|
+
description: value.valuePayload ? String(t('global.yes')) : String(t('global.no'))
|
|
53
|
+
},
|
|
54
|
+
type: value.valuePayload ? 'primary' : 'neutral'
|
|
55
|
+
};
|
|
56
|
+
case AttributeFormat.color:
|
|
57
|
+
const colorHexa = `#${value.valuePayload}`;
|
|
58
|
+
return {
|
|
59
|
+
idCardProps: {
|
|
60
|
+
description: colorHexa,
|
|
61
|
+
avatarProps: {
|
|
62
|
+
color: colorHexa,
|
|
63
|
+
shape: 'square',
|
|
64
|
+
className: multiColorTagAvatarClassName
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
case AttributeFormat.date_range:
|
|
69
|
+
return {
|
|
70
|
+
idCardProps: {
|
|
71
|
+
description: _getDateRangeValueContent(value.valuePayload)
|
|
72
|
+
},
|
|
73
|
+
type: 'primary'
|
|
74
|
+
};
|
|
75
|
+
default:
|
|
76
|
+
const valueContent = attributeProperties.format === AttributeFormat.encrypted
|
|
77
|
+
? '●●●●●●●●●●●●'
|
|
78
|
+
: value.valuePayload;
|
|
79
|
+
return {
|
|
80
|
+
idCardProps: { description: valueContent },
|
|
81
|
+
type: 'primary'
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
return _jsx(TableTagGroup, { tags: tags });
|
|
86
|
+
}
|
|
87
|
+
else if (isLinkValues(values, attributeProperties)) {
|
|
88
|
+
return (_jsx(KitAvatar.Group, { maxCount: 5, children: values.map((value, index) => {
|
|
89
|
+
if (!isLinkValue(value, attributeProperties)) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
return (_jsx(KitAvatar, { label: String(value?.linkPayload?.whoAmI.label), src: value?.linkPayload?.whoAmI.preview?.small, color: "primary", secondaryColorInvert: true }, index));
|
|
93
|
+
}) }));
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
// TODO: handle multiple tree values
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
const value = values[0]; // Not multiple_values attribute should not have more than one value
|
|
102
|
+
if (!value) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
let content = null;
|
|
106
|
+
if (isStandardValue(value, attributeProperties)) {
|
|
107
|
+
if (value.valuePayload === null) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
switch (attributeProperties.format) {
|
|
111
|
+
case AttributeFormat.boolean:
|
|
112
|
+
const valueToDisplay = value.valuePayload ? t('global.yes') : t('global.no');
|
|
113
|
+
content = (_jsx(KitTag, { type: !!value.valuePayload ? 'primary' : 'neutral', idCardProps: { description: valueToDisplay } }, attributeProperties.id));
|
|
114
|
+
break;
|
|
115
|
+
case AttributeFormat.rich_text:
|
|
116
|
+
const tmp = document.createElement('div');
|
|
117
|
+
tmp.innerHTML = DOMPurify.sanitize(value.valuePayload);
|
|
118
|
+
const textContent = tmp.textContent;
|
|
119
|
+
content = (_jsxs(_Fragment, { children: [_jsx(StyledFaListAlt, {}), _jsx(KitTypography.Text, { ellipsis: { tooltip: textContent }, children: textContent }, attributeProperties.id)] }));
|
|
120
|
+
break;
|
|
121
|
+
case AttributeFormat.color:
|
|
122
|
+
const colorTextContent = `#${value.valuePayload}`;
|
|
123
|
+
content = (_jsxs(_Fragment, { children: [_jsx(StyledColorChip, { "$colorTextContent": colorTextContent }), _jsx(KitTypography.Text, { ellipsis: { tooltip: colorTextContent }, children: colorTextContent }, attributeProperties.id)] }));
|
|
124
|
+
break;
|
|
125
|
+
case AttributeFormat.date_range:
|
|
126
|
+
content = _getDateRangeValueContent(value.valuePayload);
|
|
127
|
+
break;
|
|
128
|
+
default:
|
|
129
|
+
const valueContent = attributeProperties.format === AttributeFormat.encrypted ? '●●●●●●●●●●●●' : value.valuePayload;
|
|
130
|
+
content = (_jsx(KitTypography.Text, { ellipsis: { tooltip: valueContent }, children: valueContent }, attributeProperties.id));
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (isTreeValue(value, attributeProperties)) {
|
|
135
|
+
content = value.treePayload?.record.id ?? '';
|
|
136
|
+
}
|
|
137
|
+
if (isLinkValue(value, attributeProperties)) {
|
|
138
|
+
content = value.linkPayload?.whoAmI ? (_jsx(IdCard, { item: value.linkPayload?.whoAmI }, attributeProperties.id)) : null;
|
|
139
|
+
}
|
|
140
|
+
return _jsx(StyledCenteringWrapper, { children: content });
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=TableCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../src/components/Explorer/TableCell.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAA+B,WAAW,EAAC,MAAM,OAAO,CAAC;AAChE,OAAO,EACH,eAAe,EAEf,aAAa,EAKhB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,gBA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AAC,WAAW,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC;QACjD,CAAC;QAED,IAAI,WAAW,CAAC,KAAK,EAAE,mBAAmB,CAAC,EAAE,CAAC;YAC1C,OAAO,GAAG,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAClC,KAAC,MAAM,IAA8B,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE,MAAM,IAAvD,mBAAmB,CAAC,EAAE,CAAqC,CAC3E,CAAC,CAAC,CAAC,IAAI,CAAC;QACb,CAAC;QAED,OAAO,KAAC,sBAAsB,cAAE,OAAO,GAA0B,CAAC;IACtE,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IKitTag } from 'aristid-ds/dist/Kit/DataDisplay/Tag/types';
|
|
2
|
+
import { FunctionComponent } from 'react';
|
|
3
|
+
export declare const multiColorTagAvatarClassName = "multi-color-tag-avatar";
|
|
4
|
+
export declare const TableTagGroup: FunctionComponent<{
|
|
5
|
+
tags: IKitTag[];
|
|
6
|
+
maxTags?: number;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { KitTag, KitTooltip } from 'aristid-ds';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
export const multiColorTagAvatarClassName = 'multi-color-tag-avatar';
|
|
8
|
+
const StyledTagsGroupDiv = styled.div `
|
|
9
|
+
display: flex;
|
|
10
|
+
column-gap: calc(var(--general-spacing-xxs) * 1px);
|
|
11
|
+
row-gap: calc(var(--general-spacing-xxs) * 0.5px);
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
|
|
14
|
+
& > span {
|
|
15
|
+
margin-right: var(--general-spacing-none);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// TODO: wait DS to allow better customization on avatar
|
|
19
|
+
&&& .${multiColorTagAvatarClassName} {
|
|
20
|
+
height: calc(var(--general-spacing-s) * 1px);
|
|
21
|
+
width: calc(var(--general-spacing-s) * 1px);
|
|
22
|
+
border-radius: calc(var(--general-border-radius-xs) * 1px);
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
export const TableTagGroup = ({ tags, maxTags = 3 }) => {
|
|
26
|
+
const hiddenTags = tags.slice(maxTags);
|
|
27
|
+
const visibleTags = tags.slice(0, maxTags);
|
|
28
|
+
return (_jsxs(StyledTagsGroupDiv, { children: [visibleTags.map((tag, index) => (_jsx(KitTag, { ...tag }, index))), hiddenTags.length > 0 && (_jsx(KitTooltip, { overlay: hiddenTags.map((hiddenTag, index) => (_jsx("div", { children: hiddenTag.idCardProps?.description }, index))), children: _jsx(KitTag, { type: "primary", idCardProps: { description: `+${hiddenTags.length}` } }) }))] }));
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=TableTagGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableTagGroup.js","sourceRoot":"","sources":["../../../src/components/Explorer/TableTagGroup.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,YAAY,CAAC;AAG9C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,MAAM,4BAA4B,GAAG,wBAAwB,CAAC;AAErE,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;WAW1B,4BAA4B;;;;;CAKtC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAGrB,CAAC,EAAC,IAAI,EAAE,OAAO,GAAG,CAAC,EAAC,EAAE,EAAE;IACzB,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAE3C,OAAO,CACH,MAAC,kBAAkB,eACd,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAC7B,KAAC,MAAM,OAAiB,GAAG,IAAd,KAAK,CAAa,CAClC,CAAC,EACD,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,CACtB,KAAC,UAAU,IACP,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1C,wBAAkB,SAAS,CAAC,WAAW,EAAE,WAAW,IAA1C,KAAK,CAA4C,CAC9D,CAAC,YAEF,KAAC,MAAM,IAAC,IAAI,EAAC,SAAS,EAAC,WAAW,EAAE,EAAC,WAAW,EAAE,IAAI,UAAU,CAAC,MAAM,EAAE,EAAC,GAAI,GACrE,CAChB,IACgB,CACxB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IExplorerData, IExplorerFilter } from '../_types';
|
|
2
|
+
import { ExplorerQuery, SortOrder } from '../../../_gqlTypes';
|
|
3
|
+
export declare const useExplorerData: ({ libraryId, attributeIds, fulltextSearch, sorts, pagination, filters }: {
|
|
4
|
+
libraryId: string;
|
|
5
|
+
attributeIds: string[];
|
|
6
|
+
fulltextSearch: string;
|
|
7
|
+
sorts: Array<{
|
|
8
|
+
attributeId: string;
|
|
9
|
+
order: SortOrder;
|
|
10
|
+
}>;
|
|
11
|
+
pagination: null | {
|
|
12
|
+
limit: number;
|
|
13
|
+
offset: number;
|
|
14
|
+
};
|
|
15
|
+
filters: IExplorerFilter[];
|
|
16
|
+
}) => {
|
|
17
|
+
data: IExplorerData;
|
|
18
|
+
loading: boolean;
|
|
19
|
+
refetch: (variables?: Partial<import("../../../_gqlTypes").Exact<{
|
|
20
|
+
libraryId: import("../../../_gqlTypes").Scalars["ID"];
|
|
21
|
+
attributeIds: Array<import("../../../_gqlTypes").Scalars["ID"]> | import("../../../_gqlTypes").Scalars["ID"];
|
|
22
|
+
pagination?: import("../../../_gqlTypes").InputMaybe<import("../../../_gqlTypes").RecordsPagination>;
|
|
23
|
+
filters?: import("../../../_gqlTypes").InputMaybe<Array<import("../../../_gqlTypes").InputMaybe<import("../../../_gqlTypes").RecordFilterInput>> | import("../../../_gqlTypes").InputMaybe<import("../../../_gqlTypes").RecordFilterInput>>;
|
|
24
|
+
multipleSort?: import("../../../_gqlTypes").InputMaybe<Array<import("../../../_gqlTypes").RecordSortInput> | import("../../../_gqlTypes").RecordSortInput>;
|
|
25
|
+
searchQuery?: import("../../../_gqlTypes").InputMaybe<import("../../../_gqlTypes").Scalars["String"]>;
|
|
26
|
+
}>>) => Promise<import("@apollo/client").ApolloQueryResult<ExplorerQuery>>;
|
|
27
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
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 { RecordFilterCondition, useExplorerQuery } from '../../../_gqlTypes';
|
|
6
|
+
import { useLang } from '../../../hooks';
|
|
7
|
+
import { useMemo } from 'react';
|
|
8
|
+
const _mapping = (data, libraryId, availableLangs) => {
|
|
9
|
+
const attributes = data.records.list.length
|
|
10
|
+
? data.records.list[0].properties.reduce((acc, property) => {
|
|
11
|
+
acc[property.attributeId] = {
|
|
12
|
+
...property.attributeProperties,
|
|
13
|
+
label: localizedTranslation(property.attributeProperties.label, availableLangs)
|
|
14
|
+
};
|
|
15
|
+
return acc;
|
|
16
|
+
}, {})
|
|
17
|
+
: {};
|
|
18
|
+
const records = data.records.list.map(({ whoAmI, properties }) => ({
|
|
19
|
+
libraryId,
|
|
20
|
+
key: whoAmI.id, // For <KitTable /> only
|
|
21
|
+
itemId: whoAmI.id, // For <KitTable /> only
|
|
22
|
+
whoAmI: {
|
|
23
|
+
label: null,
|
|
24
|
+
subLabel: null,
|
|
25
|
+
color: null,
|
|
26
|
+
preview: null,
|
|
27
|
+
...whoAmI
|
|
28
|
+
},
|
|
29
|
+
propertiesById: properties.reduce((acc, { attributeId, values }) => ({ ...acc, [attributeId]: values }), {})
|
|
30
|
+
}));
|
|
31
|
+
return {
|
|
32
|
+
totalCount: data.records.totalCount ?? 0,
|
|
33
|
+
attributes,
|
|
34
|
+
records
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export const useExplorerData = ({ libraryId, attributeIds, fulltextSearch, sorts, pagination, filters }) => {
|
|
38
|
+
const { lang: availableLangs } = useLang();
|
|
39
|
+
const { data, loading, refetch } = useExplorerQuery({
|
|
40
|
+
variables: {
|
|
41
|
+
libraryId,
|
|
42
|
+
attributeIds,
|
|
43
|
+
pagination,
|
|
44
|
+
searchQuery: fulltextSearch,
|
|
45
|
+
multipleSort: sorts.map(({ order, attributeId }) => ({
|
|
46
|
+
field: attributeId,
|
|
47
|
+
order
|
|
48
|
+
})),
|
|
49
|
+
filters: filters
|
|
50
|
+
.filter(({ value, condition }) => value !== null ||
|
|
51
|
+
[RecordFilterCondition.IS_EMPTY, RecordFilterCondition.IS_NOT_EMPTY].includes(condition))
|
|
52
|
+
.map(({ field, condition, value }) => ({
|
|
53
|
+
field,
|
|
54
|
+
condition,
|
|
55
|
+
value
|
|
56
|
+
}))
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const memoizedData = useMemo(() => (data !== undefined ? _mapping(data, libraryId, availableLangs) : null), [data]);
|
|
60
|
+
return {
|
|
61
|
+
data: memoizedData,
|
|
62
|
+
loading,
|
|
63
|
+
refetch
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
//# 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,EAAgB,qBAAqB,EAAa,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAChG,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAE9B,MAAM,QAAQ,GAAG,CAAC,IAAmB,EAAE,SAAiB,EAAE,cAAwB,EAAiB,EAAE;IACjG,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM;QACvC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;YACrD,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG;gBACxB,GAAG,QAAQ,CAAC,mBAAmB;gBAC/B,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC;aAClF,CAAC;YAEF,OAAO,GAAG,CAAC;QACf,CAAC,EAAE,EAAE,CAAC;QACR,CAAC,CAAC,EAAE,CAAC;IAET,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAC,MAAM,EAAE,UAAU,EAAC,EAAE,EAAE,CAAC,CAAC;QAC7D,SAAS;QACT,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,wBAAwB;QACxC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,wBAAwB;QAC3C,MAAM,EAAE;YACJ,KAAK,EAAE,IAAI;YACX,QAAQ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CAAC;gBACjC,KAAK;gBACL,SAAS;gBACT,KAAK;aACR,CAAC,CAAC;SACV;KACJ,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEpH,OAAO;QACH,IAAI,EAAE,YAAY;QAClB,OAAO;QACP,OAAO;KACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Override } from '@leav/utils';
|
|
2
|
+
import { AttributeFormat, AttributePropertiesFragment, PropertyValueFragment, RecordFilterCondition, RecordIdentityFragment } from '../../_gqlTypes';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
|
+
export interface IExplorerData {
|
|
5
|
+
totalCount: number;
|
|
6
|
+
attributes: {
|
|
7
|
+
[attributeId: string]: Override<AttributePropertiesFragment, {
|
|
8
|
+
label: string;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
records: IItemData[];
|
|
12
|
+
}
|
|
13
|
+
export interface IItemData {
|
|
14
|
+
libraryId: string;
|
|
15
|
+
key: string;
|
|
16
|
+
itemId: string;
|
|
17
|
+
whoAmI: Required<RecordIdentityFragment['whoAmI']>;
|
|
18
|
+
propertiesById: {
|
|
19
|
+
[attributeId: string]: PropertyValueFragment[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface IItemAction {
|
|
23
|
+
callback: (item: IItemData) => void;
|
|
24
|
+
icon: ReactElement;
|
|
25
|
+
label: string;
|
|
26
|
+
isDanger?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface IPrimaryAction {
|
|
29
|
+
callback: () => void;
|
|
30
|
+
icon: ReactElement;
|
|
31
|
+
label: string;
|
|
32
|
+
}
|
|
33
|
+
export type ActionHook<T = {}> = {
|
|
34
|
+
isEnabled: boolean;
|
|
35
|
+
} & T;
|
|
36
|
+
export interface IExplorerFilter {
|
|
37
|
+
id: string;
|
|
38
|
+
attribute: {
|
|
39
|
+
format: AttributeFormat;
|
|
40
|
+
label: string;
|
|
41
|
+
};
|
|
42
|
+
field: string;
|
|
43
|
+
condition: RecordFilterCondition;
|
|
44
|
+
value: string | null;
|
|
45
|
+
}
|
|
46
|
+
export interface IFilterDropDownProps {
|
|
47
|
+
filter: IExplorerFilter;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../src/components/Explorer/_types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
const FilterStyled = styled(KitFilter) `
|
|
12
|
+
flex: 0 0 auto;
|
|
13
|
+
`;
|
|
14
|
+
const ExplorerFilterBarListStyled = styled.ul `
|
|
15
|
+
padding: calc(var(--general-spacing-xs) * 1px) calc(var(--general-spacing-xxs) * 1px)
|
|
16
|
+
calc(var(--general-spacing-m) * 1px) calc(var(--general-spacing-xxs) * 1px);
|
|
17
|
+
margin: 0;
|
|
18
|
+
list-style: none;
|
|
19
|
+
display: flex;
|
|
20
|
+
overflow: auto;
|
|
21
|
+
flex-wrap: nowrap;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 0;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
`;
|
|
26
|
+
const DividerStyled = styled(KitDivider) `
|
|
27
|
+
height: 2em;
|
|
28
|
+
`;
|
|
29
|
+
export const ExplorerFilterBar = () => {
|
|
30
|
+
const { t } = useSharedTranslation();
|
|
31
|
+
const { view: { filters } } = useViewSettingsContext();
|
|
32
|
+
if (filters.length === 0) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return (_jsxs(ExplorerFilterBarListStyled, { "aria-label": t('explorer.filter-list.active'), children: [_jsx(KitSpace, { size: "s", children: filters.map(filter => (_jsx("li", { children: _jsx(CommonFilterItem, { filter: filter }, filter.id) }, filter.id))) }), _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.delete-filters') }) })] }));
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=ExplorerFilterBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExplorerFilterBar.js","sourceRoot":"","sources":["../../../../src/components/Explorer/display-view-filters/ExplorerFilterBar.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;AAElF,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;;CAErC,CAAC;AAEF,MAAM,2BAA2B,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;;;;;CAW5C,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;;CAEvC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAsB,GAAG,EAAE;IACrD,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,EACF,IAAI,EAAE,EAAC,OAAO,EAAC,EAClB,GAAG,sBAAsB,EAAE,CAAC;IAE7B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CACH,MAAC,2BAA2B,kBAAa,CAAC,CAAC,6BAA6B,CAAC,aACrE,KAAC,QAAQ,IAAC,IAAI,EAAC,GAAG,YACb,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACnB,uBACI,KAAC,gBAAgB,IAAiB,MAAM,EAAE,MAAM,IAAzB,MAAM,CAAC,EAAE,CAAoB,IAD/C,MAAM,CAAC,EAAE,CAEb,CACR,CAAC,GACK,EACX,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,yBAAyB,CAAC,GAClB,GACd,IACqB,CACjC,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
|