@leav/ui 1.6.0 → 1.7.0-143193eb
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/README.md +13 -12
- package/dist/__mocks__/common/library.d.ts +1 -0
- package/dist/__mocks__/react-i18next.d.ts +1 -1
- package/dist/_gqlTypes/index.d.ts +1128 -713
- package/dist/_gqlTypes/index.js +233 -75
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_queries/attributes/attributeDetailsFragment.js +5 -0
- package/dist/_queries/attributes/attributeDetailsFragment.js.map +1 -1
- package/dist/_queries/attributes/getAttributeWithEmbeddedFields.d.ts +1 -1
- package/dist/_queries/libraries/libraryDetailsFragment.js +1 -0
- package/dist/_queries/libraries/libraryDetailsFragment.js.map +1 -1
- package/dist/_queries/trees/treeNodeChildrenQuery.js +2 -0
- package/dist/_queries/trees/treeNodeChildrenQuery.js.map +1 -1
- package/dist/_queries/views/viewDetailsFragment.js +1 -0
- package/dist/_queries/views/viewDetailsFragment.js.map +1 -1
- package/dist/components/AttributePicker/AttributesList/AttributesList.js +3 -7
- package/dist/components/AttributePicker/AttributesList/AttributesList.js.map +1 -1
- package/dist/components/AttributesSelectionList/SelectedAttributesList/SelectedAttributesList.js +20 -12
- package/dist/components/AttributesSelectionList/SelectedAttributesList/SelectedAttributesList.js.map +1 -1
- package/dist/components/AttributesSelectionList/reducer/__mocks__/attributesSelectionListStateContext.d.ts +1 -1
- package/dist/components/AttributesSelectionList/sharedComponents.d.ts +159 -153
- package/dist/components/EditLibraryModal/EditLibrary/EditLibraryAttributes/AttributesList/AttributesList.js +3 -7
- package/dist/components/EditLibraryModal/EditLibrary/EditLibraryAttributes/AttributesList/AttributesList.js.map +1 -1
- package/dist/components/Explorer/DataView.d.ts +2 -0
- package/dist/components/Explorer/DataView.js +6 -3
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +2 -0
- package/dist/components/Explorer/Explorer.js +7 -5
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/ExplorerFiltersAndSorts.js +1 -1
- package/dist/components/Explorer/ExplorerFiltersAndSorts.js.map +1 -1
- package/dist/components/Explorer/TableCell.js +15 -23
- package/dist/components/Explorer/TableCell.js.map +1 -1
- package/dist/components/Explorer/TableNameCell.js +3 -2
- package/dist/components/Explorer/TableNameCell.js.map +1 -1
- package/dist/components/Explorer/_queries/useExplorerData.d.ts +7 -7
- package/dist/components/Explorer/_queries/useExplorerData.js +19 -7
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/actions-item/useEditStatusItemAction.js +3 -2
- package/dist/components/Explorer/actions-item/useEditStatusItemAction.js.map +1 -1
- package/dist/components/Explorer/actions-item/useReplaceItemAction.d.ts +2 -1
- package/dist/components/Explorer/actions-item/useReplaceItemAction.js +5 -4
- package/dist/components/Explorer/actions-item/useReplaceItemAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/edit-attribute/EditTreeAttributeValueLine.d.ts +2 -4
- package/dist/components/Explorer/actions-mass/edit-attribute/EditTreeAttributeValueLine.js +18 -16
- package/dist/components/Explorer/actions-mass/edit-attribute/EditTreeAttributeValueLine.js.map +1 -1
- package/dist/components/Explorer/actions-mass/edit-attribute/EditTreeAttributeValuesMapping.js +2 -2
- package/dist/components/Explorer/actions-mass/edit-attribute/EditTreeAttributeValuesMapping.js.map +1 -1
- package/dist/components/Explorer/actions-mass/edit-attribute/useListEditableAttributeHook.js +9 -1
- package/dist/components/Explorer/actions-mass/edit-attribute/useListEditableAttributeHook.js.map +1 -1
- package/dist/components/Explorer/actions-mass/edit-attribute/useListTreeAttributeValuesHook.d.ts +10 -3
- package/dist/components/Explorer/actions-mass/edit-attribute/useListTreeAttributeValuesHook.js +16 -6
- package/dist/components/Explorer/actions-mass/edit-attribute/useListTreeAttributeValuesHook.js.map +1 -1
- package/dist/components/Explorer/actions-mass/export/ExportProfileSelectionModal.d.ts +10 -0
- package/dist/components/Explorer/actions-mass/export/ExportProfileSelectionModal.js +46 -0
- package/dist/components/Explorer/actions-mass/export/ExportProfileSelectionModal.js.map +1 -0
- package/dist/components/Explorer/actions-mass/export/content/NoProfiles.d.ts +1 -0
- package/dist/components/Explorer/actions-mass/export/content/NoProfiles.js +17 -0
- package/dist/components/Explorer/actions-mass/export/content/NoProfiles.js.map +1 -0
- package/dist/components/Explorer/actions-mass/export/content/ProfilesSelection.d.ts +8 -0
- package/dist/components/Explorer/actions-mass/export/content/ProfilesSelection.js +49 -0
- package/dist/components/Explorer/actions-mass/export/content/ProfilesSelection.js.map +1 -0
- package/dist/components/Explorer/actions-mass/export/useGetLibraryExportProfiles.d.ts +27 -0
- package/dist/components/Explorer/actions-mass/export/useGetLibraryExportProfiles.js +48 -0
- package/dist/components/Explorer/actions-mass/export/useGetLibraryExportProfiles.js.map +1 -0
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js +3 -2
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js +3 -2
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useEditAttributeMassAction.js +3 -2
- package/dist/components/Explorer/actions-mass/useEditAttributeMassAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useExportMassAction.d.ts +7 -4
- package/dist/components/Explorer/actions-mass/useExportMassAction.js +80 -73
- package/dist/components/Explorer/actions-mass/useExportMassAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useMassActions.js +3 -2
- package/dist/components/Explorer/actions-mass/useMassActions.js.map +1 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +3 -2
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.d.ts +2 -1
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js +5 -4
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js.map +1 -1
- package/dist/components/Explorer/link-item/LinkModal.d.ts +1 -0
- package/dist/components/Explorer/link-item/LinkModal.js +2 -2
- package/dist/components/Explorer/link-item/LinkModal.js.map +1 -1
- package/dist/components/Explorer/list-saved-views/SavedViews.js +4 -3
- package/dist/components/Explorer/list-saved-views/SavedViews.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js +5 -8
- package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js +3 -2
- package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/configure-display/view-type/SelectViewType.js +2 -2
- package/dist/components/Explorer/manage-view-settings/configure-display/view-type/SelectViewType.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +7 -6
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js +3 -2
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js +5 -4
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingItem.js +3 -2
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingItem.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +3 -2
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js +3 -2
- package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js +3 -0
- package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js +3 -2
- package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js +4 -3
- package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useEditLabelView.js +3 -2
- package/dist/components/Explorer/manage-view-settings/save-view/useEditLabelView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js +3 -2
- package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js +3 -2
- package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.js +3 -2
- package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js +7 -6
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js +3 -2
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -1
- package/dist/components/Explorer/useSearchInput.js +6 -2
- package/dist/components/Explorer/useSearchInput.js.map +1 -1
- package/dist/components/Filters/FiltersProvider.d.ts +2 -2
- package/dist/components/Filters/FiltersProvider.js.map +1 -1
- package/dist/components/Filters/_types.d.ts +3 -0
- package/dist/components/Filters/_types.js.map +1 -1
- package/dist/components/Filters/context/filtersReducer.js +7 -4
- package/dist/components/Filters/context/filtersReducer.js.map +1 -1
- package/dist/components/Filters/context/useGetTreeFilters.d.ts +8 -6
- package/dist/components/Filters/context/useGetTreeFilters.js +41 -18
- package/dist/components/Filters/context/useGetTreeFilters.js.map +1 -1
- package/dist/components/Filters/filter-items/CommonFilterItem.d.ts +1 -0
- package/dist/components/Filters/filter-items/CommonFilterItem.js +29 -9
- package/dist/components/Filters/filter-items/CommonFilterItem.js.map +1 -1
- package/dist/components/Filters/filter-items/EmptyValueCheckbox.d.ts +8 -0
- package/dist/components/Filters/filter-items/EmptyValueCheckbox.js +16 -0
- package/dist/components/Filters/filter-items/EmptyValueCheckbox.js.map +1 -0
- package/dist/components/Filters/filter-items/SelectAllCheckbox.d.ts +8 -0
- package/dist/components/Filters/filter-items/SelectAllCheckbox.js +22 -0
- package/dist/components/Filters/filter-items/SelectAllCheckbox.js.map +1 -0
- package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js +23 -9
- package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/ColorAttributeDropDown.js +9 -8
- package/dist/components/Filters/filter-items/filter-type/ColorAttributeDropDown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/FilterDropDown.js +4 -3
- package/dist/components/Filters/filter-items/filter-type/FilterDropDown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/FilterDropdownContent.js +2 -2
- package/dist/components/Filters/filter-items/filter-type/FilterDropdownContent.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.d.ts +0 -1
- package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js +17 -23
- package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/{TreeAttributeDropDown.d.ts → tree/TreeAttributeDropDown.d.ts} +1 -1
- package/dist/components/Filters/filter-items/filter-type/tree/TreeAttributeDropDown.js +130 -0
- package/dist/components/Filters/filter-items/filter-type/tree/TreeAttributeDropDown.js.map +1 -0
- package/dist/components/Filters/filter-items/filter-type/tree/useGetTreeData.d.ts +20 -0
- package/dist/components/Filters/filter-items/filter-type/tree/useGetTreeData.js +72 -0
- package/dist/components/Filters/filter-items/filter-type/tree/useGetTreeData.js.map +1 -0
- package/dist/components/Filters/filter-items/filter-type/tree/useTreesSearch.d.ts +7 -0
- package/dist/components/Filters/filter-items/filter-type/tree/useTreesSearch.js +36 -0
- package/dist/components/Filters/filter-items/filter-type/tree/useTreesSearch.js.map +1 -0
- package/dist/components/Filters/filter-items/filter-type/tree/utils/buildFlattenTreeMap.d.ts +2 -0
- package/dist/components/Filters/filter-items/filter-type/tree/utils/buildFlattenTreeMap.js +14 -0
- package/dist/components/Filters/filter-items/filter-type/tree/utils/buildFlattenTreeMap.js.map +1 -0
- package/dist/components/Filters/filter-items/filter-type/tree/utils/filterTreeByPermission.d.ts +2 -0
- package/dist/components/Filters/filter-items/filter-type/tree/utils/filterTreeByPermission.js +15 -0
- package/dist/components/Filters/filter-items/filter-type/tree/utils/filterTreeByPermission.js.map +1 -0
- package/dist/components/Filters/filter-items/filter-type/tree/utils/getSelectAllState.d.ts +5 -0
- package/dist/components/Filters/filter-items/filter-type/tree/utils/getSelectAllState.js +17 -0
- package/dist/components/Filters/filter-items/filter-type/tree/utils/getSelectAllState.js.map +1 -0
- package/dist/components/Filters/filter-items/filter-type/useConditionOptionsByType.js +3 -13
- package/dist/components/Filters/filter-items/filter-type/useConditionOptionsByType.js.map +1 -1
- package/dist/components/Filters/index.d.ts +1 -0
- package/dist/components/Filters/index.js +1 -0
- package/dist/components/Filters/index.js.map +1 -1
- package/dist/components/Filters/prepareFiltersForRequest.js +36 -3
- package/dist/components/Filters/prepareFiltersForRequest.js.map +1 -1
- package/dist/components/Filters/useFilters.d.ts +5 -0
- package/dist/components/Filters/useTransformFilters.js +4 -0
- package/dist/components/Filters/useTransformFilters.js.map +1 -1
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.d.ts +1 -3
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js +6 -2
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js.map +1 -1
- package/dist/components/LibraryItemsList/FiltersPanel/FiltersOptions.js +1 -8
- package/dist/components/LibraryItemsList/FiltersPanel/FiltersOptions.js.map +1 -1
- package/dist/components/LibraryItemsList/FiltersPanel/FiltersPanel.js +15 -17
- package/dist/components/LibraryItemsList/FiltersPanel/FiltersPanel.js.map +1 -1
- package/dist/components/LibraryItemsList/LibraryItemsListTable/ChooseTableColumns/ChooseTableColumns.js +0 -6
- package/dist/components/LibraryItemsList/LibraryItemsListTable/ChooseTableColumns/ChooseTableColumns.js.map +1 -1
- package/dist/components/LibraryItemsList/MenuView/MenuView.js +4 -4
- package/dist/components/LibraryItemsList/MenuView/MenuView.js.map +1 -1
- package/dist/components/LibraryItemsList/ViewPanel/View/View.d.ts +1 -3
- package/dist/components/LibraryItemsList/ViewPanel/View/View.js +9 -4
- package/dist/components/LibraryItemsList/ViewPanel/View/View.js.map +1 -1
- package/dist/components/LibraryItemsList/ViewPanel/ViewPanel.js +36 -14
- package/dist/components/LibraryItemsList/ViewPanel/ViewPanel.js.map +1 -1
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/useSearchReducer.d.ts +1 -1
- package/dist/components/Notifications/hooks/useNotificationSubscription.js +5 -4
- package/dist/components/Notifications/hooks/useNotificationSubscription.js.map +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +3 -3
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.js +2 -0
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/hooks/__mocks__/useDeleteValueMutation.d.ts +1 -1
- package/dist/components/RecordEdition/EditRecordContent/hooks/__mocks__/useSaveValueMutation.d.ts +1 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js +5 -20
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.d.ts +1 -11
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +8 -95
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/_types.d.ts +8 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/_types.js +2 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/_types.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.d.ts +6 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.js +77 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/{link-record → explorer/link-record}/useExplorerLinkRecords.d.ts +5 -7
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/{link-record → explorer/link-record}/useExplorerLinkRecords.js +3 -10
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/link-record/useExplorerLinkRecords.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/{link-record → explorer/link-record}/useLinkRecords.d.ts +5 -6
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/link-record/useLinkRecords.js +98 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/link-record/useLinkRecords.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/{ExplorerWrapper.d.ts → InputExtraAlignLeft.d.ts} +54 -52
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/{link-record/ActionButton.js → shared/InputExtraAlignLeft.js} +4 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/InputExtraAlignLeft.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/InputWrapper.d.ts +3 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/InputWrapper.js +31 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/InputWrapper.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/Wrapper.d.ts +3 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/Wrapper.js +8 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/Wrapper.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/tag/LinkFieldTags.d.ts +3 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/tag/LinkFieldTags.js +57 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/tag/LinkFieldTags.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/tag/link-record/useLinkRecord.d.ts +16 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/tag/link-record/useLinkRecord.js +85 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/tag/link-record/useLinkRecord.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/tag/unlink-record/useUnlinkRecord.d.ts +19 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/tag/unlink-record/useUnlinkRecord.js +43 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/tag/unlink-record/useUnlinkRecord.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/unlink-all-records/useUnlinkAllRecords.d.ts +16 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/unlink-all-records/useUnlinkAllRecords.js +27 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/unlink-all-records/useUnlinkAllRecords.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +4 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +2 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js +9 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeFieldWrapper.d.ts +53 -51
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js +3 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js +4 -7
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.d.ts +3 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.js +3 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.d.ts +1 -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/RecordSummary/RecordInformations/RecordInformations.js +3 -2
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js +4 -3
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.js +3 -2
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.js.map +1 -1
- package/dist/components/RecordEdition/hooks/useGetSubmitButtons.js +2 -2
- package/dist/components/RecordEdition/hooks/useGetSubmitButtons.js.map +1 -1
- package/dist/components/RecordHistory/RecordHistoryLogEntry.js +10 -2
- package/dist/components/RecordHistory/RecordHistoryLogEntry.js.map +1 -1
- package/dist/components/RecordHistory/_queries/recordHistoryQuery.d.ts +7 -0
- package/dist/components/RecordHistory/_queries/recordHistoryQuery.js +64 -0
- package/dist/components/RecordHistory/_queries/recordHistoryQuery.js.map +1 -0
- package/dist/components/RecordHistory/hooks/useFetchRecordHistory.js +5 -2
- package/dist/components/RecordHistory/hooks/useFetchRecordHistory.js.map +1 -1
- package/dist/components/RecordHistory/utils/extendedAttribute.d.ts +13 -0
- package/dist/components/RecordHistory/utils/extendedAttribute.js +40 -0
- package/dist/components/RecordHistory/utils/extendedAttribute.js.map +1 -0
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.d.ts +1 -0
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js +7 -7
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNode.d.ts +2 -1
- package/dist/components/SelectTreeNode/SelectTreeNode.js +3 -3
- package/dist/components/SelectTreeNode/SelectTreeNode.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.d.ts +2 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +6 -2
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -1
- package/dist/components/SelectTreeNode/TreeNodeTitle.js +5 -4
- package/dist/components/SelectTreeNode/TreeNodeTitle.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/messageHandlers.d.ts +3 -1
- package/dist/hooks/useIFrameMessenger/messageHandlers.js +16 -0
- package/dist/hooks/useIFrameMessenger/messageHandlers.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/schema.d.ts +6 -3
- package/dist/hooks/useIFrameMessenger/schema.js +2 -1
- package/dist/hooks/useIFrameMessenger/schema.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/types.d.ts +32 -2
- package/dist/hooks/useIFrameMessenger/types.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.d.ts +2 -0
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js +16 -2
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js.map +1 -1
- package/dist/hooks/useIFrameMessengerClient/iFrameMessengerClientContext.d.ts +2 -0
- package/dist/hooks/useIFrameMessengerClient/useIFrameMessengerClient.d.ts +2 -0
- package/dist/locales/en/shared.json +23 -4
- package/dist/locales/fr/shared.json +23 -4
- package/dist/types/records.d.ts +1 -0
- package/dist/types/records.js.map +1 -1
- package/package.json +41 -43
- package/dist/components/Filters/filter-items/filter-type/TreeAttributeDropDown.js +0 -73
- package/dist/components/Filters/filter-items/filter-type/TreeAttributeDropDown.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/ActionButton.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/ActionButton.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useExplorerLinkRecords.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js +0 -100
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/ExplorerWrapper.js +0 -13
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/ExplorerWrapper.js.map +0 -1
|
@@ -1,12 +1,13 @@
|
|
|
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
|
-
import { useGetLibraryByIdQuery,
|
|
4
|
+
import { useGetLibraryByIdQuery, useGetTreeNodeChildrenWithAccessByDefaultPermissionQueryLazyQuery, } from '../../../_gqlTypes';
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
|
+
import { defaultPaginationPageSize } from '../../../constants';
|
|
6
7
|
export const useGetTreeFilters = ({ libraryId, skip }) => {
|
|
7
8
|
const [treeFilters, setTreeFilters] = useState({});
|
|
8
9
|
const [treeFiltersLoading, setTreeFiltersLoading] = useState(true);
|
|
9
|
-
const [
|
|
10
|
+
const [loadTreeContent] = useGetTreeNodeChildrenWithAccessByDefaultPermissionQueryLazyQuery();
|
|
10
11
|
const { data: libraryData, loading: libraryLoading } = useGetLibraryByIdQuery({
|
|
11
12
|
variables: {
|
|
12
13
|
id: libraryId,
|
|
@@ -14,7 +15,7 @@ export const useGetTreeFilters = ({ libraryId, skip }) => {
|
|
|
14
15
|
skip: skip || !libraryId,
|
|
15
16
|
});
|
|
16
17
|
useEffect(() => {
|
|
17
|
-
if (skip || !libraryId || libraryLoading) {
|
|
18
|
+
if (skip || !libraryId || libraryLoading || !libraryData) {
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
21
|
const fetchTreeFilters = async () => {
|
|
@@ -22,28 +23,50 @@ export const useGetTreeFilters = ({ libraryId, skip }) => {
|
|
|
22
23
|
attributeId: attribute.id,
|
|
23
24
|
treeId: libraryData?.libraries.list[0]?.attributes.find(tree => tree.id === attribute.id)?.linked_tree?.id,
|
|
24
25
|
})) || [];
|
|
25
|
-
const
|
|
26
|
-
const
|
|
26
|
+
const _fetchChildrenPage = async (treeId, attributeId, parentNodeKey, offset) => {
|
|
27
|
+
const { data } = await loadTreeContent({
|
|
27
28
|
variables: {
|
|
28
|
-
treeId
|
|
29
|
+
treeId,
|
|
30
|
+
node: parentNodeKey,
|
|
31
|
+
pagination: { offset, limit: defaultPaginationPageSize },
|
|
29
32
|
accessRecordByDefaultPermission: {
|
|
30
|
-
attributeId
|
|
33
|
+
attributeId,
|
|
31
34
|
libraryId,
|
|
32
35
|
},
|
|
33
36
|
},
|
|
34
37
|
});
|
|
38
|
+
const { list, totalCount } = data?.treeNodeChildren ?? { list: [], totalCount: 0 };
|
|
39
|
+
const records = [];
|
|
40
|
+
for (const node of list) {
|
|
41
|
+
if (node.accessRecordByDefaultPermission) {
|
|
42
|
+
records.push({
|
|
43
|
+
nodeId: node.id,
|
|
44
|
+
libraryId: node.record.whoAmI.library.id,
|
|
45
|
+
value: node.record.id,
|
|
46
|
+
label: node.record.whoAmI.label,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (node.childrenCount > 0) {
|
|
50
|
+
const childrenRecords = await _fetchAllChildren(treeId, attributeId, node.id);
|
|
51
|
+
records.push(...childrenRecords);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return { records, totalCount };
|
|
55
|
+
};
|
|
56
|
+
const _fetchAllChildren = async (treeId, attributeId, parentNodeKey, offset = 0, accumulated = []) => {
|
|
57
|
+
const { records, totalCount } = await _fetchChildrenPage(treeId, attributeId, parentNodeKey, offset);
|
|
58
|
+
const allRecords = [...accumulated, ...records];
|
|
59
|
+
const nextOffset = offset + defaultPaginationPageSize;
|
|
60
|
+
if (nextOffset < totalCount) {
|
|
61
|
+
return _fetchAllChildren(treeId, attributeId, parentNodeKey, nextOffset, allRecords);
|
|
62
|
+
}
|
|
63
|
+
return allRecords;
|
|
64
|
+
};
|
|
65
|
+
const treeResponse = await Promise.all(treeAttributesWithExtendedPermissions.map(async (attribute) => {
|
|
66
|
+
const recordIds = await _fetchAllChildren(attribute.treeId, attribute.attributeId, null);
|
|
35
67
|
return {
|
|
36
68
|
attributeId: attribute.attributeId,
|
|
37
|
-
recordIds
|
|
38
|
-
?.map(item => item.accessRecordByDefaultPermission
|
|
39
|
-
? {
|
|
40
|
-
nodeId: item.id,
|
|
41
|
-
libraryId: item.record.whoAmI.library.id,
|
|
42
|
-
value: item.record.id,
|
|
43
|
-
label: item.record.whoAmI.label,
|
|
44
|
-
}
|
|
45
|
-
: undefined)
|
|
46
|
-
.filter(Boolean) || [],
|
|
69
|
+
recordIds,
|
|
47
70
|
};
|
|
48
71
|
}));
|
|
49
72
|
const attributeRecords = treeResponse.reduce((acc, item) => {
|
|
@@ -56,7 +79,7 @@ export const useGetTreeFilters = ({ libraryId, skip }) => {
|
|
|
56
79
|
setTreeFiltersLoading(false);
|
|
57
80
|
};
|
|
58
81
|
fetchTreeFilters();
|
|
59
|
-
}, [skip, libraryId, libraryLoading]);
|
|
82
|
+
}, [skip, libraryId, libraryLoading, libraryData, loadTreeContent]);
|
|
60
83
|
return {
|
|
61
84
|
data: treeFilters,
|
|
62
85
|
loading: treeFiltersLoading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetTreeFilters.js","sourceRoot":"","sources":["../../../../src/components/Filters/context/useGetTreeFilters.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAEH,sBAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"useGetTreeFilters.js","sourceRoot":"","sources":["../../../../src/components/Filters/context/useGetTreeFilters.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAEH,sBAAsB,EACtB,iEAAiE,GACpE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAC,yBAAyB,EAAC,MAAM,eAAe,CAAC;AAaxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAC,SAAS,EAAE,IAAI,EAAqC,EAAE,EAAE;IACvF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAe,EAAE,CAAC,CAAC;IACjE,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnE,MAAM,CAAC,eAAe,CAAC,GAAG,iEAAiE,EAAE,CAAC;IAE9F,MAAM,EAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAC,GAAG,sBAAsB,CAAC;QACxE,SAAS,EAAE;YACP,EAAE,EAAE,SAAS;SAChB;QACD,IAAI,EAAE,IAAI,IAAI,CAAC,SAAS;KAC3B,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,IAAI,IAAI,CAAC,SAAS,IAAI,cAAc,IAAI,CAAC,WAAW,EAAE,CAAC;YACvD,OAAO;QACX,CAAC;QAED,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;YAChC,MAAM,qCAAqC,GACvC,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,wBAAwB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;gBACzF,WAAW,EAAE,SAAS,CAAC,EAAE;gBACzB,MAAM,EACF,W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AAC;oBAC5B,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;gBAC3C,CAAC;gBACD,OAAO,GAAG,CAAC;YACf,CAAC,EAAE,EAAE,CAAC,CAAC;YAEP,cAAc,CAAC,gBAAgB,CAAC,CAAC;YACjC,qBAAqB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC;QAEF,gBAAgB,EAAE,CAAC;IACvB,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;IAEpE,OAAO;QACH,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,kBAAkB;KAC9B,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {\n type TreeAttributeDetailsFragment,\n useGetLibraryByIdQuery,\n useGetTreeNodeChildrenWithAccessByDefaultPermissionQueryLazyQuery,\n} from '_ui/_gqlTypes';\nimport {useEffect, useState} from 'react';\nimport {defaultPaginationPageSize} from '_ui/constants';\n\ninterface ITreeNode {\n nodeId: string;\n libraryId: string;\n value: string;\n label: string;\n}\n\nexport interface ITreeFilters {\n [x: string]: ITreeNode[];\n}\n\nexport const useGetTreeFilters = ({libraryId, skip}: {libraryId: string; skip: boolean}) => {\n const [treeFilters, setTreeFilters] = useState<ITreeFilters>({});\n const [treeFiltersLoading, setTreeFiltersLoading] = useState(true);\n const [loadTreeContent] = useGetTreeNodeChildrenWithAccessByDefaultPermissionQueryLazyQuery();\n\n const {data: libraryData, loading: libraryLoading} = useGetLibraryByIdQuery({\n variables: {\n id: libraryId,\n },\n skip: skip || !libraryId,\n });\n\n useEffect(() => {\n if (skip || !libraryId || libraryLoading || !libraryData) {\n return;\n }\n\n const fetchTreeFilters = async () => {\n const treeAttributesWithExtendedPermissions: Array<{attributeId: string; treeId: string}> =\n libraryData?.libraries.list[0]?.permissions_conf?.permissionTreeAttributes.map(attribute => ({\n attributeId: attribute.id,\n treeId: (\n libraryData?.libraries.list[0]?.attributes.find(\n tree => tree.id === attribute.id,\n ) as TreeAttributeDetailsFragment\n )?.linked_tree?.id,\n })) || [];\n\n const _fetchChildrenPage = async (\n treeId: string,\n attributeId: string,\n parentNodeKey: string | null,\n offset: number,\n ) => {\n const {data} = await loadTreeContent({\n variables: {\n treeId,\n node: parentNodeKey,\n pagination: {offset, limit: defaultPaginationPageSize},\n accessRecordByDefaultPermission: {\n attributeId,\n libraryId,\n },\n },\n });\n\n const {list, totalCount} = data?.treeNodeChildren ?? {list: [], totalCount: 0};\n\n const records: ITreeNode[] = [];\n\n for (const node of list) {\n if (node.accessRecordByDefaultPermission) {\n records.push({\n nodeId: node.id,\n libraryId: node.record.whoAmI.library.id,\n value: node.record.id,\n label: node.record.whoAmI.label,\n });\n }\n\n if (node.childrenCount > 0) {\n const childrenRecords = await _fetchAllChildren(treeId, attributeId, node.id);\n records.push(...childrenRecords);\n }\n }\n\n return {records, totalCount};\n };\n\n const _fetchAllChildren = async (\n treeId: string,\n attributeId: string,\n parentNodeKey: string | null,\n offset = 0,\n accumulated: ITreeNode[] = [],\n ): Promise<ITreeNode[]> => {\n const {records, totalCount} = await _fetchChildrenPage(treeId, attributeId, parentNodeKey, offset);\n const allRecords = [...accumulated, ...records];\n\n const nextOffset = offset + defaultPaginationPageSize;\n if (nextOffset < totalCount) {\n return _fetchAllChildren(treeId, attributeId, parentNodeKey, nextOffset, allRecords);\n }\n\n return allRecords;\n };\n\n const treeResponse = await Promise.all(\n treeAttributesWithExtendedPermissions.map(async attribute => {\n const recordIds = await _fetchAllChildren(attribute.treeId, attribute.attributeId, null);\n\n return {\n attributeId: attribute.attributeId,\n recordIds,\n };\n }),\n );\n\n const attributeRecords = treeResponse.reduce((acc, item) => {\n if (item.recordIds.length > 0) {\n acc[item.attributeId] = item.recordIds;\n }\n return acc;\n }, {});\n\n setTreeFilters(attributeRecords);\n setTreeFiltersLoading(false);\n };\n\n fetchTreeFilters();\n }, [skip, libraryId, libraryLoading, libraryData, loadTreeContent]);\n\n return {\n data: treeFilters,\n loading: treeFiltersLoading,\n };\n};\n"]}
|
|
@@ -3,10 +3,11 @@ import { FilterDropDown } from '../filter-items/filter-type/FilterDropDown';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { KitFilter } from 'aristid-ds';
|
|
5
5
|
import { AttributeFormat } from '../../../_gqlTypes';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
6
|
import { getAttributeConditionOptions } from '../filter-items/filter-type/useConditionOptionsByType';
|
|
8
7
|
import { nullValueConditions } from '../conditionsHelper';
|
|
9
8
|
import { isUIFilterStandard, isUIFilterTree } from '../_types';
|
|
9
|
+
import { ACTIVE_ATTRIBUTE_ID } from '../../../constants';
|
|
10
|
+
import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
|
|
10
11
|
const FilterStyled = styled(KitFilter) `
|
|
11
12
|
flex: 0 0 auto;
|
|
12
13
|
`;
|
|
@@ -15,20 +16,39 @@ const getFilterValues = (filter, t) => {
|
|
|
15
16
|
const conditionOption = getAttributeConditionOptions(t).find(option => option.value === filter.condition);
|
|
16
17
|
return [conditionOption?.label ?? ''];
|
|
17
18
|
}
|
|
19
|
+
const filterValues = filter.withEmptyValues ? [t('filters.empty-value')] : [];
|
|
18
20
|
if (isUIFilterTree(filter)) {
|
|
19
|
-
return filter.formattedValue ?? [];
|
|
21
|
+
return [...filterValues, ...(filter.formattedValue ?? [])];
|
|
20
22
|
}
|
|
21
23
|
if (isUIFilterStandard(filter) &&
|
|
22
24
|
[AttributeFormat.date, AttributeFormat.boolean].includes(filter.attribute.format)) {
|
|
23
|
-
return filter.formattedValue ? [filter.formattedValue] :
|
|
25
|
+
return filter.formattedValue ? [...filterValues, filter.formattedValue] : filterValues;
|
|
24
26
|
}
|
|
25
|
-
|
|
27
|
+
if (Array.isArray(filter.value)) {
|
|
28
|
+
return [...filterValues, ...filter.value];
|
|
29
|
+
}
|
|
30
|
+
else if (filter.value) {
|
|
31
|
+
return [...filterValues, filter.value];
|
|
32
|
+
}
|
|
33
|
+
return filterValues;
|
|
26
34
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
const isActiveAttribute = (filter) => filter.attribute.format === AttributeFormat.boolean &&
|
|
36
|
+
filter.attribute.id === ACTIVE_ATTRIBUTE_ID &&
|
|
37
|
+
isUIFilterStandard(filter);
|
|
38
|
+
export const CommonFilterItem = ({ filter, isPinned = false, readonly = false, disabled, }) => {
|
|
39
|
+
const { t } = useSharedTranslation();
|
|
40
|
+
let canReset = true;
|
|
41
|
+
// Active attribute is a special case, we need to handle it differently
|
|
42
|
+
if (isActiveAttribute(filter)) {
|
|
43
|
+
canReset = false;
|
|
44
|
+
if (!filter.value) {
|
|
45
|
+
filter.value = 'true';
|
|
46
|
+
filter.formattedValue = t('explorer.true');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return (_jsx(FilterStyled, { disabled: disabled, readonly: readonly, expandable: !readonly, label: filter.attribute.label, values: getFilterValues(filter, t), dropDownProps: {
|
|
30
50
|
placement: 'bottomLeft',
|
|
31
|
-
dropdownRender: () => _jsx(FilterDropDown, { filter: filter, canRemove: !isPinned }),
|
|
32
|
-
} }));
|
|
51
|
+
dropdownRender: () => _jsx(FilterDropDown, { filter: filter, canReset: canReset, canRemove: !isPinned }),
|
|
52
|
+
}, showSingleValue: true }));
|
|
33
53
|
};
|
|
34
54
|
//# sourceMappingURL=CommonFilterItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonFilterItem.js","sourceRoot":"","sources":["../../../../src/components/Filters/filter-items/CommonFilterItem.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,cAAc,EAAC,MAAM,4CAA4C,CAAC;AAC1E,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAC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I,CAAC;IAEpB,uEAAuE;IACvE,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,QAAQ,GAAG,KAAK,CAAC;QAEjB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC;YACtB,MAAM,CAAC,cAAc,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC;IAED,OAAO,CACH,KAAC,YAAY,IACT,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,CAAC,QAAQ,EACrB,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,EAC7B,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,EAClC,aAAa,EAAE;YACX,SAAS,EAAE,YAAY;YACvB,cAAc,EAAE,GAAG,EAAE,CAAC,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,QAAQ,GAAI;SACrG,EACD,eAAe,SACjB,CACL,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type FunctionComponent} from 'react';\nimport {FilterDropDown} from '../filter-items/filter-type/FilterDropDown';\nimport styled from 'styled-components';\nimport {KitFilter} from 'aristid-ds';\nimport {AttributeFormat} from '_ui/_gqlTypes';\nimport {getAttributeConditionOptions} from '../filter-items/filter-type/useConditionOptionsByType';\nimport {type TFunction} from 'i18next';\nimport {nullValueConditions} from '../conditionsHelper';\nimport {isUIFilterStandard, isUIFilterTree, type IUIFilterStandard, type UIFilter} from '../_types';\nimport {ACTIVE_ATTRIBUTE_ID} from '_ui/constants';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\n\nconst FilterStyled = styled(KitFilter)`\n flex: 0 0 auto;\n`;\nconst getFilterValues = (filter: UIFilter, t: TFunction): string[] => {\n if (filter.condition && nullValueConditions.includes(filter.condition)) {\n const conditionOption = getAttributeConditionOptions(t).find(option => option.value === filter.condition);\n return [conditionOption?.label ?? ''];\n }\n\n const filterValues: string[] = filter.withEmptyValues ? [t('filters.empty-value')] : [];\n\n if (isUIFilterTree(filter)) {\n return [...filterValues, ...(filter.formattedValue ?? [])];\n }\n\n if (\n isUIFilterStandard(filter) &&\n [AttributeFormat.date, AttributeFormat.boolean].includes(filter.attribute.format)\n ) {\n return filter.formattedValue ? [...filterValues, filter.formattedValue] : filterValues;\n }\n\n if (Array.isArray(filter.value)) {\n return [...filterValues, ...filter.value];\n } else if (filter.value) {\n return [...filterValues, filter.value];\n }\n return filterValues;\n};\n\nexport interface ICommonFilterProps {\n filter: UIFilter;\n isPinned?: boolean;\n disabled?: boolean;\n readonly?: boolean;\n}\n\nconst isActiveAttribute = (filter: UIFilter): filter is IUIFilterStandard =>\n filter.attribute.format === AttributeFormat.boolean &&\n filter.attribute.id === ACTIVE_ATTRIBUTE_ID &&\n isUIFilterStandard(filter);\n\nexport const CommonFilterItem: FunctionComponent<ICommonFilterProps> = ({\n filter,\n isPinned = false,\n readonly = false,\n disabled,\n}) => {\n const {t} = useSharedTranslation();\n\n let canReset = true;\n\n // Active attribute is a special case, we need to handle it differently\n if (isActiveAttribute(filter)) {\n canReset = false;\n\n if (!filter.value) {\n filter.value = 'true';\n filter.formattedValue = t('explorer.true');\n }\n }\n\n return (\n <FilterStyled\n disabled={disabled}\n readonly={readonly}\n expandable={!readonly}\n label={filter.attribute.label}\n values={getFilterValues(filter, t)}\n dropDownProps={{\n placement: 'bottomLeft',\n dropdownRender: () => <FilterDropDown filter={filter} canReset={canReset} canRemove={!isPinned} />,\n }}\n showSingleValue\n />\n );\n};\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FunctionComponent } from 'react';
|
|
2
|
+
import { type UIFilter } from '../_types';
|
|
3
|
+
interface IEmptyValueCheckboxProps {
|
|
4
|
+
filter: UIFilter;
|
|
5
|
+
onSelect: (selected: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const EmptyValueCheckbox: FunctionComponent<IEmptyValueCheckboxProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { KitTree } from 'aristid-ds';
|
|
4
|
+
import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
|
|
5
|
+
const TreeStyled = styled(KitTree) `
|
|
6
|
+
font-style: italic;
|
|
7
|
+
`;
|
|
8
|
+
const EMPTY_VALUE_KEY = '0';
|
|
9
|
+
export const EmptyValueCheckbox = ({ filter, onSelect }) => {
|
|
10
|
+
const { t } = useSharedTranslation();
|
|
11
|
+
const onChange = () => {
|
|
12
|
+
onSelect(!filter.withEmptyValues);
|
|
13
|
+
};
|
|
14
|
+
return (_jsx(TreeStyled, { checkable: true, treeData: [{ title: t('filters.empty-value'), key: EMPTY_VALUE_KEY, isLeaf: true }], checkedKeys: filter.withEmptyValues ? [EMPTY_VALUE_KEY] : [], selectedKeys: filter.withEmptyValues ? [EMPTY_VALUE_KEY] : [], onSelect: onChange, onCheck: onChange }));
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=EmptyValueCheckbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyValueCheckbox.js","sourceRoot":"","sources":["../../../../src/components/Filters/filter-items/EmptyValueCheckbox.tsx"],"names":[],"mappings":";AAIA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAQpE,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;;CAEjC,CAAC;AAEF,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,MAAM,CAAC,MAAM,kBAAkB,GAAgD,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAC,EAAE,EAAE;IAClG,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,QAAQ,GAAG,GAAG,EAAE;QAClB,QAAQ,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,UAAU,IACP,SAAS,QACT,QAAQ,EAAE,CAAC,EAAC,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC,EACjF,WAAW,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,EAC5D,YAAY,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,EAC7D,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,QAAQ,GACnB,CACL,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type FunctionComponent} from 'react';\nimport styled from 'styled-components';\nimport {KitTree} from 'aristid-ds';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {type UIFilter} from '../_types';\n\ninterface IEmptyValueCheckboxProps {\n filter: UIFilter;\n onSelect: (selected: boolean) => void;\n}\n\nconst TreeStyled = styled(KitTree)`\n font-style: italic;\n`;\n\nconst EMPTY_VALUE_KEY = '0';\n\nexport const EmptyValueCheckbox: FunctionComponent<IEmptyValueCheckboxProps> = ({filter, onSelect}) => {\n const {t} = useSharedTranslation();\n\n const onChange = () => {\n onSelect(!filter.withEmptyValues);\n };\n\n return (\n <TreeStyled\n checkable\n treeData={[{title: t('filters.empty-value'), key: EMPTY_VALUE_KEY, isLeaf: true}]}\n checkedKeys={filter.withEmptyValues ? [EMPTY_VALUE_KEY] : []}\n selectedKeys={filter.withEmptyValues ? [EMPTY_VALUE_KEY] : []}\n onSelect={onChange}\n onCheck={onChange}\n />\n );\n};\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FunctionComponent } from 'react';
|
|
2
|
+
interface ISelectAllCheckboxProps {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
indeterminate: boolean;
|
|
5
|
+
onChange: (nextChecked: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const SelectAllCheckbox: FunctionComponent<ISelectAllCheckboxProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { KitCheckbox, KitSpace, KitTree } from 'aristid-ds';
|
|
3
|
+
import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
const TreeStyled = styled(KitTree) `
|
|
6
|
+
font-style: italic;
|
|
7
|
+
`;
|
|
8
|
+
const SELECT_ALL_KEY = 'select-all';
|
|
9
|
+
export const SelectAllCheckbox = ({ checked, indeterminate, onChange }) => {
|
|
10
|
+
const { t } = useSharedTranslation();
|
|
11
|
+
const handleChange = () => {
|
|
12
|
+
onChange(!checked);
|
|
13
|
+
};
|
|
14
|
+
return (_jsx(TreeStyled, { treeData: [
|
|
15
|
+
{
|
|
16
|
+
title: (_jsxs(KitSpace, { direction: "horizontal", size: "xs", children: [_jsx(KitCheckbox, { checked: checked, indeterminate: indeterminate, onChange: handleChange }), t('filters.select-all')] })),
|
|
17
|
+
key: SELECT_ALL_KEY,
|
|
18
|
+
isLeaf: true,
|
|
19
|
+
},
|
|
20
|
+
], checkedKeys: checked ? [SELECT_ALL_KEY] : [], selectedKeys: checked ? [SELECT_ALL_KEY] : [], onSelect: handleChange, onCheck: handleChange }));
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=SelectAllCheckbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectAllCheckbox.js","sourceRoot":"","sources":["../../../../src/components/Filters/filter-items/SelectAllCheckbox.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAQvC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;;CAEjC,CAAC;AAEF,MAAM,cAAc,GAAG,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,iBAAiB,GAA+C,CAAC,EAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAC,EAAE,EAAE;IAChH,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,YAAY,GAAG,GAAG,EAAE;QACtB,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,UAAU,IACP,QAAQ,EAAE;YACN;gBACI,KAAK,EAAE,CACH,MAAC,QAAQ,IAAC,SAAS,EAAC,YAAY,EAAC,IAAI,EAAC,IAAI,aACtC,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,GAAI,EACtF,CAAC,CAAC,oBAAoB,CAAC,IACjB,CACd;gBACD,GAAG,EAAE,cAAc;gBACnB,MAAM,EAAE,IAAI;aACf;SACJ,EACD,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,EAC5C,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,EAC7C,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,YAAY,GACvB,CACL,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type FunctionComponent} from 'react';\nimport {KitCheckbox, KitSpace, KitTree} from 'aristid-ds';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport styled from 'styled-components';\n\ninterface ISelectAllCheckboxProps {\n checked: boolean;\n indeterminate: boolean;\n onChange: (nextChecked: boolean) => void;\n}\n\nconst TreeStyled = styled(KitTree)`\n font-style: italic;\n`;\n\nconst SELECT_ALL_KEY = 'select-all';\n\nexport const SelectAllCheckbox: FunctionComponent<ISelectAllCheckboxProps> = ({checked, indeterminate, onChange}) => {\n const {t} = useSharedTranslation();\n\n const handleChange = () => {\n onChange(!checked);\n };\n\n return (\n <TreeStyled\n treeData={[\n {\n title: (\n <KitSpace direction=\"horizontal\" size=\"xs\">\n <KitCheckbox checked={checked} indeterminate={indeterminate} onChange={handleChange} />\n {t('filters.select-all')}\n </KitSpace>\n ),\n key: SELECT_ALL_KEY,\n isLeaf: true,\n },\n ]}\n checkedKeys={checked ? [SELECT_ALL_KEY] : []}\n selectedKeys={checked ? [SELECT_ALL_KEY] : []}\n onSelect={handleChange}\n onCheck={handleChange}\n />\n );\n};\n"]}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { KitTree, KitTypography } from 'aristid-ds';
|
|
3
3
|
import { AttributeConditionFilter } from '../../../../types';
|
|
4
4
|
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
5
|
-
|
|
5
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
6
|
+
import { faCheck } from '@fortawesome/free-solid-svg-icons';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
const TreeNodeTitleContainer = styled.div `
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
`;
|
|
13
|
+
const CheckIcon = styled(FontAwesomeIcon) `
|
|
14
|
+
color: var(--general-utilities-text-blue);
|
|
15
|
+
font-size: calc(var(--general-typography-fontSize7) * 1px);
|
|
16
|
+
`;
|
|
17
|
+
export const BooleanAttributeDropDown = ({ filter, onFilterChange }) => {
|
|
6
18
|
const { t } = useSharedTranslation();
|
|
7
|
-
const _onSelectionChanged =
|
|
19
|
+
const _onSelectionChanged = values => {
|
|
20
|
+
const value = values[0] ? String(values[0]) : undefined;
|
|
8
21
|
const filterData = value === undefined
|
|
9
22
|
? {
|
|
10
23
|
...filter,
|
|
@@ -22,14 +35,15 @@ export const BooleanAttributeDropDown = ({ filter, onFilterChange, selectDropDow
|
|
|
22
35
|
};
|
|
23
36
|
const valuesOptions = [
|
|
24
37
|
{
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
title: t('explorer.true'),
|
|
39
|
+
key: 'true',
|
|
27
40
|
},
|
|
28
41
|
{
|
|
29
|
-
|
|
30
|
-
|
|
42
|
+
title: t('explorer.false'),
|
|
43
|
+
key: 'false',
|
|
31
44
|
},
|
|
32
45
|
];
|
|
33
|
-
|
|
46
|
+
const TreeNodeTitle = ({ node }) => (_jsxs(TreeNodeTitleContainer, { children: [_jsx(KitTypography.Text, { size: "fontSize5", children: node.title }), node.key === filter.value && _jsx(CheckIcon, { icon: faCheck })] }));
|
|
47
|
+
return (_jsx(KitTree, { treeData: valuesOptions, selectedKeys: [filter.value], titleRender: node => _jsx(TreeNodeTitle, { node: node }), onSelect: _onSelectionChanged }));
|
|
34
48
|
};
|
|
35
49
|
//# sourceMappingURL=BooleanAttributeDropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanAttributeDropdown.js","sourceRoot":"","sources":["../../../../../src/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"BooleanAttributeDropdown.js","sourceRoot":"","sources":["../../../../../src/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,OAAO,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAClD,OAAO,EAAC,wBAAwB,EAAC,MAAM,WAAW,CAAC;AACnD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAGpE,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,OAAO,EAAC,MAAM,mCAAmC,CAAC;AAC1D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIxC,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,eAAe,CAAC,CAAA;;;CAGxC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAoD,CAAC,EAAC,MAAM,EAAE,cAAc,EAAC,EAAE,EAAE;IAClH,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,mBAAmB,GAA+C,MAAM,CAAC,EAAE;QAC7E,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAExD,MAAM,UAAU,GACZ,KAAK,KAAK,SAAS;YACf,CAAC,CAAC;gBACI,GAAG,MAAM;gBACT,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,IAAI;gBACX,cAAc,EAAE,SAAS;aAC5B;YACH,CAAC,CAAC;gBACI,GAAG,MAAM;gBACT,SAAS,EAAE,wBAAwB,CAAC,KAAK;gBACzC,KAAK;gBACL,cAAc,EAAE,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;aAC9E,CAAC;QAEZ,cAAc,CAAC,UAAU,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG;QAClB;YACI,KAAK,EAAE,CAAC,CAAC,eAAe,CAAC;YACzB,GAAG,EAAE,MAAM;SACd;QACD;YACI,KAAK,EAAE,CAAC,CAAC,gBAAgB,CAAC;YAC1B,GAAG,EAAE,OAAO;SACf;KACJ,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,EAAC,IAAI,EAA0B,EAAE,EAAE,CAAC,CACvD,MAAC,sBAAsB,eACnB,KAAC,aAAa,CAAC,IAAI,IAAC,IAAI,EAAC,WAAW,YAAE,IAAI,CAAC,KAAK,GAAsB,EACrE,IAAI,CAAC,GAAG,KAAK,MAAM,CAAC,KAAK,IAAI,KAAC,SAAS,IAAC,IAAI,EAAE,OAAO,GAAI,IACrC,CAC5B,CAAC;IAEF,OAAO,CACH,KAAC,OAAO,IACJ,QAAQ,EAAE,aAAa,EACvB,YAAY,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5B,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,KAAC,aAAa,IAAC,IAAI,EAAE,IAAuB,GAAI,EACrE,QAAQ,EAAE,mBAAmB,GAC/B,CACL,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type ComponentProps, type FunctionComponent} from 'react';\nimport {KitTree, KitTypography} from 'aristid-ds';\nimport {AttributeConditionFilter} from '_ui/types';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {type IFilterChildrenDropDownProps} from './_types';\nimport {type ITreeMapElement} from '_ui/components/SelectTreeNode/_types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faCheck} from '@fortawesome/free-solid-svg-icons';\nimport styled from 'styled-components';\n\nconst TreeNodeTitleContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n`;\n\nconst CheckIcon = styled(FontAwesomeIcon)`\n color: var(--general-utilities-text-blue);\n font-size: calc(var(--general-typography-fontSize7) * 1px);\n`;\n\nexport const BooleanAttributeDropDown: FunctionComponent<IFilterChildrenDropDownProps> = ({filter, onFilterChange}) => {\n const {t} = useSharedTranslation();\n\n const _onSelectionChanged: ComponentProps<typeof KitTree>['onSelect'] = values => {\n const value = values[0] ? String(values[0]) : undefined;\n\n const filterData =\n value === undefined\n ? {\n ...filter,\n condition: null,\n value: null,\n formattedValue: undefined,\n }\n : {\n ...filter,\n condition: AttributeConditionFilter.EQUAL,\n value,\n formattedValue: value === 'true' ? t('explorer.true') : t('explorer.false'),\n };\n\n onFilterChange(filterData);\n };\n\n const valuesOptions = [\n {\n title: t('explorer.true'),\n key: 'true',\n },\n {\n title: t('explorer.false'),\n key: 'false',\n },\n ];\n\n const TreeNodeTitle = ({node}: {node: ITreeMapElement}) => (\n <TreeNodeTitleContainer>\n <KitTypography.Text size=\"fontSize5\">{node.title}</KitTypography.Text>\n {node.key === filter.value && <CheckIcon icon={faCheck} />}\n </TreeNodeTitleContainer>\n );\n\n return (\n <KitTree\n treeData={valuesOptions}\n selectedKeys={[filter.value]}\n titleRender={node => <TreeNodeTitle node={node as ITreeMapElement} />}\n onSelect={_onSelectionChanged}\n />\n );\n};\n"]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { EmptyValueCheckbox } from '../EmptyValueCheckbox';
|
|
3
|
+
export const ColorAttributeDropDown = ({ filter, onFilterChange }) => {
|
|
4
|
+
const _handleOnCheckEmptyValue = (selected) => {
|
|
5
|
+
onFilterChange({
|
|
6
|
+
...filter,
|
|
7
|
+
withEmptyValues: selected,
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
return _jsx(EmptyValueCheckbox, { onSelect: _handleOnCheckEmptyValue, filter: filter });
|
|
10
11
|
};
|
|
11
12
|
//# sourceMappingURL=ColorAttributeDropDown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorAttributeDropDown.js","sourceRoot":"","sources":["../../../../../src/components/Filters/filter-items/filter-type/ColorAttributeDropDown.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ColorAttributeDropDown.js","sourceRoot":"","sources":["../../../../../src/components/Filters/filter-items/filter-type/ColorAttributeDropDown.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,MAAM,sBAAsB,GAAoD,CAAC,EAAC,MAAM,EAAE,cAAc,EAAC,EAAE,EAAE;IAChH,MAAM,wBAAwB,GAAG,CAAC,QAAiB,EAAE,EAAE;QACnD,cAAc,CAAC;YACX,GAAG,MAAM;YACT,eAAe,EAAE,QAAQ;SAC5B,CAAC,CAAC;IACP,CAAC,CAAC;IACF,OAAO,KAAC,kBAAkB,IAAC,QAAQ,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,GAAI,CAAC;AACtF,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type FunctionComponent} from 'react';\nimport {type IFilterChildrenDropDownProps} from './_types';\nimport {EmptyValueCheckbox} from '../EmptyValueCheckbox';\n\nexport const ColorAttributeDropDown: FunctionComponent<IFilterChildrenDropDownProps> = ({filter, onFilterChange}) => {\n const _handleOnCheckEmptyValue = (selected: boolean) => {\n onFilterChange({\n ...filter,\n withEmptyValues: selected,\n });\n };\n return <EmptyValueCheckbox onSelect={_handleOnCheckEmptyValue} filter={filter} />;\n};\n"]}
|
|
@@ -3,19 +3,20 @@ import { jsx as _jsx, jsxs as _jsxs } 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 { useRef } from 'react';
|
|
6
|
-
import { FaClock, FaTrash } from 'react-icons/fa';
|
|
7
6
|
import styled from 'styled-components';
|
|
8
7
|
import { KitDivider, KitButton } from 'aristid-ds';
|
|
9
8
|
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
10
9
|
import { FilterDropdownContent } from './FilterDropdownContent';
|
|
11
10
|
import { useFiltersContext } from '../../useFiltersContext';
|
|
12
11
|
import { FiltersActionTypes } from '../../context/filtersReducer';
|
|
12
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
13
|
+
import { faClockRotateLeft, faTrash } from '@fortawesome/free-solid-svg-icons';
|
|
13
14
|
const FilterDropDownStyledDiv = styled.div `
|
|
14
15
|
display: flex;
|
|
15
16
|
flex-direction: column;
|
|
16
17
|
gap: calc(var(--general-spacing-xxs) * 1px);
|
|
17
18
|
`;
|
|
18
|
-
export const FilterDropDown = ({ filter, canRemove }) => {
|
|
19
|
+
export const FilterDropDown = ({ filter, canReset, canRemove }) => {
|
|
19
20
|
const { t } = useSharedTranslation();
|
|
20
21
|
const { dispatch } = useFiltersContext();
|
|
21
22
|
const selectDropDownRef = useRef(null);
|
|
@@ -35,6 +36,6 @@ export const FilterDropDown = ({ filter, canRemove }) => {
|
|
|
35
36
|
id: filter.id,
|
|
36
37
|
},
|
|
37
38
|
});
|
|
38
|
-
return (_jsxs(FilterDropDownStyledDiv, { children: [_jsx(FilterDropdownContent, { filter: filter, onFilterChange: onFilterChange, selectDropDownRef: selectDropDownRef }), _jsx("div", { ref: selectDropDownRef }), _jsx(KitDivider, { noMargin: true }), _jsx(KitButton, { type: "action", icon: _jsx(
|
|
39
|
+
return (_jsxs(FilterDropDownStyledDiv, { children: [_jsx(FilterDropdownContent, { filter: filter, onFilterChange: onFilterChange, selectDropDownRef: selectDropDownRef }), _jsx("div", { ref: selectDropDownRef }), _jsx(KitDivider, { noMargin: true }), canReset && (_jsx(KitButton, { type: "action", icon: _jsx(FontAwesomeIcon, { icon: faClockRotateLeft }), onClick: _onResetFilter, children: t('global.reset') })), canRemove && (_jsx(KitButton, { type: "action", icon: _jsx(FontAwesomeIcon, { icon: faTrash }), onClick: _onDeleteFilter, danger: true, children: t('global.delete') }))] }));
|
|
39
40
|
};
|
|
40
41
|
//# sourceMappingURL=FilterDropDown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterDropDown.js","sourceRoot":"","sources":["../../../../../src/components/Filters/filter-items/filter-type/FilterDropDown.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAA8C,MAAM,EAAC,MAAM,OAAO,CAAC;AAC1E,OAAO,
|
|
1
|
+
{"version":3,"file":"FilterDropDown.js","sourceRoot":"","sources":["../../../../../src/components/Filters/filter-items/filter-type/FilterDropDown.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAA8C,MAAM,EAAC,MAAM,OAAO,CAAC;AAC1E,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,YAAY,CAAC;AACjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AA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EAC/B,KAAC,UAAU,IAAC,QAAQ,SAAG,EACtB,QAAQ,IAAI,CACT,KAAC,SAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,iBAAiB,GAAI,EAAE,OAAO,EAAE,cAAc,YAC/F,CAAC,CAAC,cAAc,CAAC,GACV,CACf,EACA,SAAS,IAAI,CACV,KAAC,SAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,OAAO,GAAI,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAC9F,CAAC,CAAC,eAAe,CAAC,GACX,CACf,IACqB,CAC7B,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type ComponentProps, type FunctionComponent, useRef} from 'react';\nimport styled from 'styled-components';\nimport {KitDivider, KitButton} from 'aristid-ds';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {FilterDropdownContent} from './FilterDropdownContent';\nimport {useFiltersContext} from '../../useFiltersContext';\nimport {FiltersActionTypes} from '../../context/filtersReducer';\nimport {type IUIFilterDropDownProps, type UIFilter} from '../../_types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faClockRotateLeft, faTrash} from '@fortawesome/free-solid-svg-icons';\n\nconst FilterDropDownStyledDiv = styled.div`\n display: flex;\n flex-direction: column;\n gap: calc(var(--general-spacing-xxs) * 1px);\n`;\n\nexport const FilterDropDown: FunctionComponent<IUIFilterDropDownProps> = ({filter, canReset, canRemove}) => {\n const {t} = useSharedTranslation();\n const {dispatch} = useFiltersContext();\n const selectDropDownRef = useRef<HTMLDivElement>(null);\n\n const onFilterChange: ComponentProps<typeof FilterDropdownContent>['onFilterChange'] = (filterData: UIFilter) =>\n dispatch({\n type: FiltersActionTypes.CHANGE_FILTER_CONFIG,\n payload: filterData,\n });\n\n const _onResetFilter: ComponentProps<typeof KitButton>['onClick'] = () =>\n dispatch({\n type: FiltersActionTypes.RESET_FILTER,\n payload: {\n id: filter.id,\n },\n });\n\n const _onDeleteFilter: ComponentProps<typeof KitButton>['onClick'] = () =>\n dispatch({\n type: FiltersActionTypes.REMOVE_FILTER,\n payload: {\n id: filter.id,\n },\n });\n\n return (\n <FilterDropDownStyledDiv>\n <FilterDropdownContent\n filter={filter}\n onFilterChange={onFilterChange}\n selectDropDownRef={selectDropDownRef}\n />\n <div ref={selectDropDownRef} />\n <KitDivider noMargin />\n {canReset && (\n <KitButton type=\"action\" icon={<FontAwesomeIcon icon={faClockRotateLeft} />} onClick={_onResetFilter}>\n {t('global.reset')}\n </KitButton>\n )}\n {canRemove && (\n <KitButton type=\"action\" icon={<FontAwesomeIcon icon={faTrash} />} onClick={_onDeleteFilter} danger>\n {t('global.delete')}\n </KitButton>\n )}\n </FilterDropDownStyledDiv>\n );\n};\n"]}
|
|
@@ -12,12 +12,12 @@ import { ExtendedAttributeDropDown } from './ExtendedAttributeDropDown';
|
|
|
12
12
|
import { LinkAttributeDropDown } from './LinkAttributeDropdown';
|
|
13
13
|
import { NumericAttributeDropDown } from './NumericAttributeDropDown';
|
|
14
14
|
import { TextAttributeDropDown } from './TextAttributeDropDown';
|
|
15
|
-
import { TreeAttributeDropDown } from './TreeAttributeDropDown';
|
|
15
|
+
import { TreeAttributeDropDown } from './tree/TreeAttributeDropDown';
|
|
16
16
|
import { FilterValueListDropDown } from './FilterValueListDropDown';
|
|
17
17
|
import { isUIFilterLink, isUIFilterStandard, isUIFilterThrough, isUIFilterTree, isUIFilterValueList, } from '../../_types';
|
|
18
18
|
export const FilterDropdownContent = ({ filter, onFilterChange, selectDropDownRef, removeThroughCondition = false }) => {
|
|
19
19
|
if (isUIFilterValueList(filter)) {
|
|
20
|
-
return
|
|
20
|
+
return _jsx(FilterValueListDropDown, { filter: filter, onFilterChange: onFilterChange });
|
|
21
21
|
}
|
|
22
22
|
if (isUIFilterStandard(filter)) {
|
|
23
23
|
const commonDropDownProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterDropdownContent.js","sourceRoot":"","sources":["../../../../../src/components/Filters/filter-items/filter-type/FilterDropdownContent.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,0BAA0B,EAAC,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAC,0BAA0B,EAAC,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAC,yBAAyB,EAAC,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,qBAAqB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"FilterDropdownContent.js","sourceRoot":"","sources":["../../../../../src/components/Filters/filter-items/filter-type/FilterDropdownContent.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,0BAA0B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AAmB,GAAI;YAC1E,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,KAAC,wBAAwB,OAAK,mBAAmB,GAAI;YAChF,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,KAAC,0BAA0B,OAAK,mBAAmB,GAAI;YACpF,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,KAAC,yBAAyB,OAAK,mBAAmB,GAAI;YAClF,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,KAAC,sBAAsB,OAAK,mBAAmB,GAAI;YAC5E,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,KAAC,0BAA0B,OAAK,mBAAmB,GAAI;SACxF,CAAC;QACF,OAAO,sBAAsB,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IACnF,CAAC;IAED,IAAI,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,OAAO,CACH,KAAC,qBAAqB,IAClB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,iBAAiB,GACtC,CACL,CAAC;IACN,CAAC;IAED,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtD,OAAO,CACH,KAAC,qBAAqB,IAClB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,sBAAsB,EAC9C,iBAAiB,EAAE,iBAAiB,GACtC,CACL,CAAC;IACN,CAAC;IAED,OAAO,mBAAK,CAAC;AACjB,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {AttributeFormat} from '_ui/_gqlTypes';\nimport {type FunctionComponent, type RefObject} from 'react';\nimport {BooleanAttributeDropDown} from './BooleanAttributeDropdown';\nimport {ColorAttributeDropDown} from './ColorAttributeDropDown';\nimport {DateAttributeDropDown} from './DateAttributeDropDown';\nimport {DateRangeAttributeDropDown} from './DateRangeAttributeDropDown';\nimport {EncryptedAttributeDropDown} from './EncryptedAttributeDropDown';\nimport {ExtendedAttributeDropDown} from './ExtendedAttributeDropDown';\nimport {LinkAttributeDropDown} from './LinkAttributeDropdown';\nimport {NumericAttributeDropDown} from './NumericAttributeDropDown';\nimport {TextAttributeDropDown} from './TextAttributeDropDown';\nimport {TreeAttributeDropDown} from './tree/TreeAttributeDropDown';\nimport {FilterValueListDropDown} from './FilterValueListDropDown';\nimport {\n isUIFilterLink,\n isUIFilterStandard,\n isUIFilterThrough,\n isUIFilterTree,\n isUIFilterValueList,\n type UIFilter,\n} from '../../_types';\n\nexport const FilterDropdownContent: FunctionComponent<{\n filter: UIFilter;\n onFilterChange: (filterData: UIFilter) => void;\n selectDropDownRef?: RefObject<HTMLDivElement>;\n removeThroughCondition?: boolean;\n}> = ({filter, onFilterChange, selectDropDownRef, removeThroughCondition = false}) => {\n if (isUIFilterValueList(filter)) {\n return <FilterValueListDropDown filter={filter} onFilterChange={onFilterChange} />;\n }\n\n if (isUIFilterStandard(filter)) {\n const commonDropDownProps = {\n filter,\n onFilterChange,\n selectDropDownRef,\n };\n const standardFormatDropdown: Record<AttributeFormat, JSX.Element> = {\n [AttributeFormat.text]: <TextAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.rich_text]: <TextAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.numeric]: <NumericAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.date]: <DateAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.boolean]: <BooleanAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.encrypted]: <EncryptedAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.extended]: <ExtendedAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.color]: <ColorAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.date_range]: <DateRangeAttributeDropDown {...commonDropDownProps} />,\n };\n return standardFormatDropdown[filter.attribute.format ?? AttributeFormat.text];\n }\n\n if (isUIFilterTree(filter)) {\n return (\n <TreeAttributeDropDown\n filter={filter}\n onFilterChange={onFilterChange}\n selectDropDownRef={selectDropDownRef}\n />\n );\n }\n\n if (isUIFilterLink(filter) || isUIFilterThrough(filter)) {\n return (\n <LinkAttributeDropDown\n filter={filter}\n onFilterChange={onFilterChange}\n removeThroughCondition={removeThroughCondition}\n selectDropDownRef={selectDropDownRef}\n />\n );\n }\n\n return <></>;\n};\n"]}
|
|
@@ -3,7 +3,6 @@ import { type IUIFilterValueList, type UIFilter } from '../../_types';
|
|
|
3
3
|
interface IFilterValueListDropDownProps {
|
|
4
4
|
filter: IUIFilterValueList;
|
|
5
5
|
onFilterChange: (filter: UIFilter) => void;
|
|
6
|
-
selectDropDownRef?: React.RefObject<HTMLDivElement>;
|
|
7
6
|
}
|
|
8
7
|
export declare const FilterValueListDropDown: FunctionComponent<IFilterValueListDropDownProps>;
|
|
9
8
|
export {};
|