@leav/ui 0.3.6-df40eff → 0.3.6-e218b23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__mocks__/common/attribute.d.ts +1 -0
- package/dist/__mocks__/common/attribute.js +8 -1
- package/dist/__mocks__/common/attribute.js.map +1 -1
- package/dist/__mocks__/common/form.d.ts +11 -5
- package/dist/__mocks__/common/form.js +18 -2
- package/dist/__mocks__/common/form.js.map +1 -1
- package/dist/__mocks__/common/record.d.ts +13 -2
- package/dist/__mocks__/common/record.js.map +1 -1
- package/dist/__mocks__/common/value.js +2 -1
- package/dist/__mocks__/common/value.js.map +1 -1
- package/dist/_gqlTypes/index.d.ts +118 -40
- package/dist/_gqlTypes/index.js +96 -8
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_queries/records/getRecordColumnsValues.d.ts +4 -2
- package/dist/_queries/records/getRecordColumnsValues.js +4 -1
- package/dist/_queries/records/getRecordColumnsValues.js.map +1 -1
- package/dist/_queries/records/recordFormAttributeFragment.js +1 -0
- package/dist/_queries/records/recordFormAttributeFragment.js.map +1 -1
- package/dist/_utils/interleaveElement.d.ts +1 -0
- package/dist/{components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.js → _utils/interleaveElement.js} +2 -6
- package/dist/_utils/interleaveElement.js.map +1 -0
- package/dist/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 +9 -1
- package/dist/components/Explorer/DataView.js +35 -16
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +3 -1
- package/dist/components/Explorer/Explorer.js +45 -26
- package/dist/components/Explorer/Explorer.js.map +1 -1
- 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 +2 -1
- package/dist/components/Explorer/TableCell.js +123 -20
- package/dist/components/Explorer/TableCell.js.map +1 -1
- 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 +22 -4
- package/dist/components/Explorer/_queries/useExplorerData.js +93 -11
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +28 -4
- 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 +1 -3
- package/dist/components/Explorer/index.js +1 -3
- package/dist/components/Explorer/index.js.map +1 -1
- package/dist/components/Explorer/{edit-settings → manage-view-settings/_shared}/ColumnItem.d.ts +1 -1
- package/dist/components/Explorer/{edit-settings → manage-view-settings/_shared}/ColumnItem.js +12 -5
- 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 +77 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.d.ts +9 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js +33 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.js +37 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js +90 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js +23 -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 +44 -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 +72 -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 +53 -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 +10 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js +110 -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.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContextProvider.js.map +1 -0
- package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/SidePanel.js +2 -2
- package/dist/components/Explorer/manage-view-settings/open-view-settings/SidePanel.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useEditSettings.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.d.ts +3 -0
- package/dist/components/Explorer/{edit-settings/useOpenSettings.js → manage-view-settings/open-view-settings/useOpenViewSettings.js} +7 -5
- 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.js.map +1 -0
- package/dist/components/Explorer/{edit-settings → manage-view-settings/router-menu}/SettingsPanel.d.ts +1 -1
- package/dist/components/Explorer/{edit-settings → manage-view-settings/router-menu}/SettingsPanel.js +10 -10
- 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/{edit-settings/ViewSetingsContext.d.ts → manage-view-settings/store-view-settings/ViewSettingsContext.d.ts} +1 -2
- package/dist/components/Explorer/{edit-settings/ViewSetingsContext.js → manage-view-settings/store-view-settings/ViewSettingsContext.js} +1 -5
- package/dist/components/Explorer/manage-view-settings/store-view-settings/ViewSettingsContext.js.map +1 -0
- package/dist/components/Explorer/{edit-settings → manage-view-settings/store-view-settings}/useViewSettingsContext.js +1 -1
- 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 +138 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +194 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -0
- package/dist/components/Explorer/nullValuesConditions.d.ts +1 -0
- package/dist/components/Explorer/nullValuesConditions.js +14 -0
- package/dist/components/Explorer/nullValuesConditions.js.map +1 -0
- package/dist/components/Explorer/useDeactivateAction.js +3 -2
- package/dist/components/Explorer/useDeactivateAction.js.map +1 -1
- package/dist/components/Explorer/useEditAction.js +5 -3
- 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 +1 -9
- package/dist/components/Explorer/usePrimaryActions.js +4 -12
- package/dist/components/Explorer/usePrimaryActions.js.map +1 -1
- package/dist/components/Explorer/useSearchInput.d.ts +10 -0
- package/dist/components/Explorer/useSearchInput.js +31 -0
- package/dist/components/Explorer/useSearchInput.js.map +1 -0
- package/dist/components/Explorer/useTableScrollableHeight.d.ts +5 -0
- package/dist/components/Explorer/useTableScrollableHeight.js +15 -0
- package/dist/components/Explorer/useTableScrollableHeight.js.map +1 -0
- package/dist/components/Explorer/useViewSettingsReducer.d.ts +7 -0
- package/dist/components/Explorer/useViewSettingsReducer.js +60 -0
- package/dist/components/Explorer/useViewSettingsReducer.js.map +1 -0
- package/dist/components/ExportModal/ExportModal.js +2 -2
- package/dist/components/ExportModal/ExportModal.js.map +1 -1
- package/dist/components/ImportModal/ImportModalConfigStep/ImportModalConfigStep.js +5 -5
- package/dist/components/ImportModal/ImportModalConfigStep/ImportModalConfigStep.js.map +1 -1
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js +2 -2
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js.map +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +15 -2
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +9 -20
- package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.d.ts +5 -1
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.js +44 -34
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.d.ts +3 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +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 +5 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +147 -191
- 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 +38 -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 +31 -46
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.d.ts +3 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js +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 +29 -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 +34 -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 +48 -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 +30 -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 +16 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +66 -401
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.d.ts +4 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/{MonoValueSelect.js → DSListSelect.js} +45 -52
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/_types.d.ts +2 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.d.ts +15 -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/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 +51 -13
- package/dist/locales/fr/shared.json +51 -13
- package/package.json +5 -2
- package/dist/components/Explorer/edit-settings/ColumnItem.js.map +0 -1
- package/dist/components/Explorer/edit-settings/DisplayMode.d.ts +0 -6
- package/dist/components/Explorer/edit-settings/DisplayMode.js +0 -34
- package/dist/components/Explorer/edit-settings/DisplayMode.js.map +0 -1
- package/dist/components/Explorer/edit-settings/DisplayModeTable.d.ts +0 -6
- package/dist/components/Explorer/edit-settings/DisplayModeTable.js +0 -89
- package/dist/components/Explorer/edit-settings/DisplayModeTable.js.map +0 -1
- package/dist/components/Explorer/edit-settings/EditSettingsContext.js.map +0 -1
- package/dist/components/Explorer/edit-settings/EditSettingsContextProvider.js.map +0 -1
- package/dist/components/Explorer/edit-settings/SettingItem.js.map +0 -1
- package/dist/components/Explorer/edit-settings/SettingsPanel.js.map +0 -1
- package/dist/components/Explorer/edit-settings/SidePanel.js.map +0 -1
- package/dist/components/Explorer/edit-settings/ViewSetingsContext.js.map +0 -1
- package/dist/components/Explorer/edit-settings/useEditSettings.js.map +0 -1
- package/dist/components/Explorer/edit-settings/useGetLibraryColumns.d.ts +0 -10
- package/dist/components/Explorer/edit-settings/useGetLibraryColumns.js +0 -24
- package/dist/components/Explorer/edit-settings/useGetLibraryColumns.js.map +0 -1
- package/dist/components/Explorer/edit-settings/useOpenSettings.d.ts +0 -1
- package/dist/components/Explorer/edit-settings/useOpenSettings.js.map +0 -1
- package/dist/components/Explorer/edit-settings/useViewSettingsContext.js.map +0 -1
- package/dist/components/Explorer/edit-settings/viewSettingsReducer.d.ts +0 -43
- package/dist/components/Explorer/edit-settings/viewSettingsReducer.js +0 -58
- package/dist/components/Explorer/edit-settings/viewSettingsReducer.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.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.js +0 -7
- 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 -90
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueDisplayHandler.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/ColorPickerBlock.d.ts +0 -7
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/ColorPickerBlock.js +0 -45
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/ColorPickerBlock.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/StandardFieldValueRead.d.ts +0 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/StandardFieldValueRead.js +0 -141
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/StandardFieldValueRead.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/index.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.js.map +0 -1
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/EditSettingsContext.d.ts +0 -0
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/EditSettingsContext.js +0 -0
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/EditSettingsContextProvider.d.ts +0 -0
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/EditSettingsContextProvider.js +0 -0
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/SidePanel.d.ts +0 -0
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/useEditSettings.d.ts +0 -0
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/useEditSettings.js +0 -0
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/router-menu}/SettingItem.d.ts +0 -0
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/router-menu}/SettingItem.js +0 -0
- /package/dist/components/Explorer/{edit-settings → manage-view-settings/store-view-settings}/useViewSettingsContext.d.ts +0 -0
|
@@ -2,17 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
3
|
// This file is released under LGPL V3
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
-
import {
|
|
5
|
+
import { useMemo, useState } from 'react';
|
|
6
6
|
import { KitSelect, KitTypography } from 'aristid-ds';
|
|
7
7
|
import useSharedTranslation from '../../../../../../../hooks/useSharedTranslation/useSharedTranslation';
|
|
8
8
|
import { AttributeFormat, useSaveAttributeMutation } from '../../../../../../../_gqlTypes';
|
|
9
9
|
import { Form } from 'antd';
|
|
10
|
-
import { useValueDetailsButton } from '../../../../../../../components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton';
|
|
11
|
-
import { useLang } from '../../../../../../../hooks';
|
|
12
|
-
import { localizedTranslation } from '@leav/utils';
|
|
13
10
|
import moment from 'moment';
|
|
14
11
|
import { stringifyDateRangeValue } from '../../../../../../../_utils';
|
|
15
12
|
import { EditRecordReducerActionsTypes } from '../../../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
|
|
13
|
+
import { useEditRecordReducer } from '../../../../../../../components/RecordEdition/editRecordReducer/useEditRecordReducer';
|
|
14
|
+
import { EMPTY_INITIAL_VALUE_STRING } from '../../../../../../../components/RecordEdition/EditRecordContent/antdUtils';
|
|
16
15
|
const isNewOption = (value, options) => value !== '' && !options.find(option => option.value === value);
|
|
17
16
|
const addOption = (options, optionToAdd) => {
|
|
18
17
|
const newOptions = options;
|
|
@@ -24,32 +23,25 @@ const addOption = (options, optionToAdd) => {
|
|
|
24
23
|
}
|
|
25
24
|
return newOptions;
|
|
26
25
|
};
|
|
27
|
-
export const
|
|
26
|
+
export const DSListSelect = ({ value, presentationValue, isLastValueOfMultivalues, removeLastValueOfMultivalues, onChange, attribute, required, readonly, handleSubmit, inheritedFlags, calculatedFlags }) => {
|
|
28
27
|
if (!onChange) {
|
|
29
|
-
throw Error('
|
|
28
|
+
throw Error('DSListSelect should be used inside a antd Form.Item');
|
|
30
29
|
}
|
|
31
30
|
if (!attribute.values_list || attribute.values_list.enable === false) {
|
|
32
|
-
throw Error('
|
|
31
|
+
throw Error('DSListSelect should have a values list');
|
|
33
32
|
}
|
|
33
|
+
const isNewValueOfMultivalues = isLastValueOfMultivalues && value === EMPTY_INITIAL_VALUE_STRING;
|
|
34
|
+
const focusedDefaultValue = attribute.multiple_values ? isNewValueOfMultivalues : false;
|
|
34
35
|
const { t } = useSharedTranslation();
|
|
36
|
+
const form = Form.useFormInstance();
|
|
35
37
|
const { errors } = Form.Item.useStatus();
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
attribute
|
|
39
|
-
});
|
|
40
|
-
const [isSelectOpen, setIsSelectOpen] = useState(false);
|
|
38
|
+
const [hasChanged, setHasChanged] = useState(false);
|
|
39
|
+
const [isFocused, setIsFocused] = useState(focusedDefaultValue);
|
|
41
40
|
const [searchedString, setSearchedString] = useState('');
|
|
42
|
-
const { lang: availableLang } = useLang();
|
|
43
|
-
const selectRef = useRef(null);
|
|
44
41
|
const [saveAttribute] = useSaveAttributeMutation();
|
|
42
|
+
const { dispatch: editRecordDispatch } = useEditRecordReducer();
|
|
45
43
|
const allowFreeEntry = attribute.values_list.allowFreeEntry;
|
|
46
44
|
const allowListUpdate = attribute.values_list.allowListUpdate;
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (fieldValue.isEditing && selectRef.current) {
|
|
49
|
-
selectRef.current.focus();
|
|
50
|
-
setIsSelectOpen(true);
|
|
51
|
-
}
|
|
52
|
-
}, [fieldValue.isEditing]);
|
|
53
45
|
const _getFilteredValuesList = () => {
|
|
54
46
|
let values = [];
|
|
55
47
|
if (attribute.format === AttributeFormat.date_range) {
|
|
@@ -73,8 +65,14 @@ export const MonoValueSelect = ({ value, onChange, state, editRecordDispatch, at
|
|
|
73
65
|
};
|
|
74
66
|
const initialOptions = _getFilteredValuesList();
|
|
75
67
|
let options = [...initialOptions];
|
|
68
|
+
if (attribute.multiple_values) {
|
|
69
|
+
const currentValues = form.getFieldValue(attribute.id);
|
|
70
|
+
options = options.filter(option => !currentValues.includes(option.value));
|
|
71
|
+
}
|
|
76
72
|
if (allowFreeEntry) {
|
|
77
|
-
|
|
73
|
+
if (!attribute.multiple_values) {
|
|
74
|
+
options = addOption(options, { value, label: value });
|
|
75
|
+
}
|
|
78
76
|
options = addOption(options, {
|
|
79
77
|
value: searchedString,
|
|
80
78
|
label: (allowListUpdate ? t('record_edition.create_and_select_option') : t('record_edition.select_option')) +
|
|
@@ -82,23 +80,20 @@ export const MonoValueSelect = ({ value, onChange, state, editRecordDispatch, at
|
|
|
82
80
|
});
|
|
83
81
|
}
|
|
84
82
|
const searchResultsCount = useMemo(() => options.filter(option => option.label.toLowerCase().includes(searchedString.toLowerCase())).length, [searchedString]);
|
|
85
|
-
const _resetToInheritedOrCalculatedValue = () => {
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
const _resetToInheritedOrCalculatedValue = async () => {
|
|
84
|
+
setHasChanged(false);
|
|
85
|
+
if (inheritedFlags.isInheritedValue) {
|
|
86
|
+
setTimeout(() => onChange(inheritedFlags.inheritedValue.raw_value, options), 0);
|
|
88
87
|
}
|
|
89
|
-
else if (
|
|
90
|
-
setTimeout(() => onChange(
|
|
88
|
+
else if (calculatedFlags.isCalculatedValue) {
|
|
89
|
+
setTimeout(() => onChange(calculatedFlags.calculatedValue.raw_value, options), 0);
|
|
91
90
|
}
|
|
92
|
-
handleSubmit(
|
|
93
|
-
};
|
|
94
|
-
const _handleOnBlur = () => {
|
|
95
|
-
handleBlur();
|
|
96
|
-
setIsSelectOpen(false);
|
|
91
|
+
await handleSubmit(null, attribute.id);
|
|
97
92
|
};
|
|
98
93
|
const _handleOnChange = async (selectedValue) => {
|
|
99
|
-
|
|
94
|
+
setHasChanged(true);
|
|
100
95
|
setSearchedString('');
|
|
101
|
-
if ((
|
|
96
|
+
if ((inheritedFlags.isInheritedValue || calculatedFlags.isCalculatedValue) && selectedValue === '') {
|
|
102
97
|
_resetToInheritedOrCalculatedValue();
|
|
103
98
|
return;
|
|
104
99
|
}
|
|
@@ -118,28 +113,26 @@ export const MonoValueSelect = ({ value, onChange, state, editRecordDispatch, at
|
|
|
118
113
|
});
|
|
119
114
|
editRecordDispatch({ type: EditRecordReducerActionsTypes.REQUEST_REFRESH });
|
|
120
115
|
}
|
|
121
|
-
handleSubmit(selectedValue, attribute.id);
|
|
116
|
+
await handleSubmit(selectedValue, attribute.id);
|
|
122
117
|
onChange(selectedValue, options);
|
|
123
118
|
};
|
|
124
|
-
const _handleOnClear = () => {
|
|
125
|
-
_handleOnChange('');
|
|
126
|
-
handleBlur();
|
|
119
|
+
const _handleOnClear = async () => {
|
|
120
|
+
await _handleOnChange('');
|
|
127
121
|
};
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
});
|
|
122
|
+
const _handleOnSearch = async (search) => {
|
|
123
|
+
setSearchedString(search);
|
|
124
|
+
if (search) {
|
|
125
|
+
setIsFocused(true);
|
|
133
126
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
127
|
+
};
|
|
128
|
+
const _handleDropdownVisibleChange = (visible) => {
|
|
129
|
+
setIsFocused(visible);
|
|
130
|
+
if (!hasChanged && isNewValueOfMultivalues) {
|
|
131
|
+
removeLastValueOfMultivalues();
|
|
138
132
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
return (_jsx(KitSelect, { ref: selectRef, "data-testid": attribute.id, open: isSelectOpen, value: value, required: required, allowClear: !required, label: label, options: options, status: errors.length > 0 && 'error', showSearch: true, helper: helper, onSelect: _handleOnChange, onChange: onChange, onClear: _handleOnClear, onBlur: _handleOnBlur, onSearch: setSearchedString, onInfoClick: shouldShowValueDetailsButton ? onValueDetailsButtonClick : null, dropdownRender: menu => (_jsxs(_Fragment, { children: [searchedString !== '' && searchResultsCount > 0 && (_jsxs("div", { style: { paddingBottom: 'calc(var(--general-spacing-xs) * 1px)' }, children: [_jsx(KitTypography.Text, { size: "fontSize7", children: t('record_edition.press_enter_to') }), _jsx(KitTypography.Text, { size: "fontSize7", weight: "medium", children: t('record_edition.select_this_value') })] })), menu] })), notFoundContent: _jsx("div", { style: { textAlign: 'center' }, children: _jsx(KitTypography.Text, { size: "fontSize5", weight: "medium", children: t('record_edition.search_not_found') }) }) }));
|
|
133
|
+
};
|
|
134
|
+
const valueToDisplay = isFocused ? value : presentationValue;
|
|
135
|
+
const isValueEmpty = value === '';
|
|
136
|
+
return (_jsx(KitSelect, { id: attribute.id, "data-testid": attribute.id, autoFocus: isFocused, open: isFocused, value: isValueEmpty ? undefined : valueToDisplay, allowClear: !required && value, disabled: readonly, options: options, status: errors.length > 0 && 'error', showSearch: true, onDropdownVisibleChange: _handleDropdownVisibleChange, onSelect: _handleOnChange, onChange: onChange, onClear: _handleOnClear, onSearch: _handleOnSearch, placeholder: t('record_edition.placeholder.select_an_option'), dropdownRender: menu => (_jsxs(_Fragment, { children: [searchedString !== '' && searchResultsCount > 0 && (_jsxs("div", { style: { paddingBottom: 'calc(var(--general-spacing-xs) * 1px)' }, children: [_jsx(KitTypography.Text, { size: "fontSize7", children: t('record_edition.press_enter_to') }), _jsx(KitTypography.Text, { size: "fontSize7", weight: "medium", children: t('record_edition.select_this_value') })] })), menu] })), notFoundContent: _jsx("div", { style: { textAlign: 'center' }, children: _jsx(KitTypography.Text, { size: "fontSize5", weight: "medium", children: t('record_edition.search_not_found') }) }) }));
|
|
144
137
|
};
|
|
145
|
-
//# sourceMappingURL=
|
|
138
|
+
//# sourceMappingURL=DSListSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DSListSelect.js","sourceRoot":"","sources":["../../../../../../../../src/components/RecordEdition/EditRecordContent/uiEl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W,YAC/B,CAAC,CAAC,+BAA+B,CAAC,GAClB,EACrB,KAAC,aAAa,CAAC,IAAI,IAAC,IAAI,EAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,YAC/C,CAAC,CAAC,kCAAkC,CAAC,GACrB,IACnB,CACT,EACA,IAAI,IACN,CACN,EACD,eAAe,EACX,cAAK,KAAK,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAC,YAC7B,KAAC,aAAa,CAAC,IAAI,IAAC,IAAI,EAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,YAC/C,CAAC,CAAC,iCAAiC,CAAC,GACpB,GACnB,GAEZ,CACL,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { RecordFormAttributeStandardAttributeFragment, StandardValuesListFragmentStandardDateRangeValuesListConfFragment, StandardValuesListFragmentStandardStringValuesListConfFragment } from '../../../../../../../_gqlTypes';
|
|
2
2
|
import { IProvidedByAntFormItem } from '../../../../../../../components/RecordEdition/EditRecordContent/_types';
|
|
3
|
-
import { IStandardFieldReducerState, IStandardFieldValue } from '../../../../../../../components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer';
|
|
4
|
-
import { IEditRecordReducerActions } from '../../../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
|
|
5
3
|
import { SelectProps } from 'antd';
|
|
6
|
-
import { Dispatch } from 'react';
|
|
7
4
|
export interface IMonoValueSelectProps extends IProvidedByAntFormItem<SelectProps> {
|
|
8
|
-
|
|
9
|
-
editRecordDispatch: Dispatch<IEditRecordReducerActions>;
|
|
5
|
+
presentationValue: string;
|
|
10
6
|
attribute: RecordFormAttributeStandardAttributeFragment;
|
|
11
|
-
|
|
12
|
-
handleSubmit: (value: string, id?: string) => void;
|
|
13
|
-
handleBlur: () => void;
|
|
14
|
-
shouldShowValueDetailsButton?: boolean;
|
|
7
|
+
handleSubmit: (value: string, id?: string) => Promise<void>;
|
|
15
8
|
}
|
|
16
9
|
export type IStringValuesListConf = StandardValuesListFragmentStandardStringValuesListConfFragment;
|
|
17
10
|
export type IDateRangeValuesListConf = StandardValuesListFragmentStandardDateRangeValuesListConfFragment;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RecordFormAttributeStandardAttributeFragment } from '../../../../../../_gqlTypes';
|
|
2
|
+
import { IProvidedByAntFormItem, ISubmitMultipleResult, StandardValueTypes } from '../../../../../../components/RecordEdition/EditRecordContent/_types';
|
|
3
|
+
import { CalculatedFlags, InheritedFlags } from '../calculatedInheritedFlags';
|
|
4
|
+
export interface IStandFieldValueContentProps<T> extends IProvidedByAntFormItem<T> {
|
|
5
|
+
presentationValue?: string;
|
|
6
|
+
attribute?: RecordFormAttributeStandardAttributeFragment;
|
|
7
|
+
label?: string;
|
|
8
|
+
isLastValueOfMultivalues?: boolean;
|
|
9
|
+
removeLastValueOfMultivalues?: () => void;
|
|
10
|
+
handleSubmit: (value: StandardValueTypes, id?: string) => Promise<void | ISubmitMultipleResult>;
|
|
11
|
+
readonly: boolean;
|
|
12
|
+
required: boolean;
|
|
13
|
+
calculatedFlags: CalculatedFlags;
|
|
14
|
+
inheritedFlags: InheritedFlags;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { RecordFormElementsValueStandardValue } from '../../../../../hooks/useGetRecordForm';
|
|
2
|
+
interface IInheritedNotOverride {
|
|
3
|
+
isInheritedValue: true;
|
|
4
|
+
isInheritedOverrideValue: false;
|
|
5
|
+
isInheritedNotOverrideValue: true;
|
|
6
|
+
inheritedValue: RecordFormElementsValueStandardValue;
|
|
7
|
+
}
|
|
8
|
+
interface IInheritedOverride {
|
|
9
|
+
isInheritedValue: true;
|
|
10
|
+
isInheritedOverrideValue: true;
|
|
11
|
+
isInheritedNotOverrideValue: false;
|
|
12
|
+
inheritedValue: RecordFormElementsValueStandardValue;
|
|
13
|
+
}
|
|
14
|
+
interface INotInherited {
|
|
15
|
+
isInheritedValue: false;
|
|
16
|
+
isInheritedOverrideValue: false;
|
|
17
|
+
isInheritedNotOverrideValue: false;
|
|
18
|
+
inheritedValue: null;
|
|
19
|
+
}
|
|
20
|
+
export type InheritedFlags = INotInherited | IInheritedOverride | IInheritedNotOverride;
|
|
21
|
+
export declare const computeInheritedFlags: (fieldValues: RecordFormElementsValueStandardValue[]) => InheritedFlags;
|
|
22
|
+
interface ICalculatedNotOverride {
|
|
23
|
+
isCalculatedValue: true;
|
|
24
|
+
isCalculatedOverrideValue: false;
|
|
25
|
+
isCalculatedNotOverrideValue: true;
|
|
26
|
+
calculatedValue: RecordFormElementsValueStandardValue;
|
|
27
|
+
}
|
|
28
|
+
interface ICalculatedOverride {
|
|
29
|
+
isCalculatedValue: true;
|
|
30
|
+
isCalculatedOverrideValue: true;
|
|
31
|
+
isCalculatedNotOverrideValue: false;
|
|
32
|
+
calculatedValue: RecordFormElementsValueStandardValue;
|
|
33
|
+
}
|
|
34
|
+
interface INotCalculated {
|
|
35
|
+
isCalculatedValue: false;
|
|
36
|
+
isCalculatedOverrideValue: false;
|
|
37
|
+
isCalculatedNotOverrideValue: false;
|
|
38
|
+
calculatedValue: null;
|
|
39
|
+
}
|
|
40
|
+
export type CalculatedFlags = INotCalculated | ICalculatedOverride | ICalculatedNotOverride;
|
|
41
|
+
export declare const computeCalculatedFlags: (fieldValues: RecordFormElementsValueStandardValue[]) => CalculatedFlags;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const computeInheritedFlags = (fieldValues) => {
|
|
2
|
+
const inheritedValue = fieldValues.find(fieldValue => fieldValue.isInherited);
|
|
3
|
+
const overrideValue = fieldValues.find(fieldValue => !fieldValue.isInherited && !fieldValue.isCalculated);
|
|
4
|
+
if (inheritedValue === undefined) {
|
|
5
|
+
return {
|
|
6
|
+
inheritedValue: null,
|
|
7
|
+
isInheritedValue: false,
|
|
8
|
+
isInheritedOverrideValue: false,
|
|
9
|
+
isInheritedNotOverrideValue: false
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const isInheritedValue = true;
|
|
13
|
+
if (!overrideValue || overrideValue.payload === null) {
|
|
14
|
+
return {
|
|
15
|
+
inheritedValue,
|
|
16
|
+
isInheritedValue,
|
|
17
|
+
isInheritedNotOverrideValue: true,
|
|
18
|
+
isInheritedOverrideValue: false
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
inheritedValue,
|
|
23
|
+
isInheritedValue,
|
|
24
|
+
isInheritedNotOverrideValue: false,
|
|
25
|
+
isInheritedOverrideValue: true
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export const computeCalculatedFlags = (fieldValues) => {
|
|
29
|
+
const calculatedValue = fieldValues.find(fieldValue => fieldValue.isCalculated);
|
|
30
|
+
const overrideValue = fieldValues.find(fieldValue => !fieldValue.isCalculated && !fieldValue.isInherited);
|
|
31
|
+
if (calculatedValue === undefined) {
|
|
32
|
+
return {
|
|
33
|
+
calculatedValue: null,
|
|
34
|
+
isCalculatedValue: false,
|
|
35
|
+
isCalculatedOverrideValue: false,
|
|
36
|
+
isCalculatedNotOverrideValue: false
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const isCalculatedValue = true;
|
|
40
|
+
if (!overrideValue || overrideValue.payload === null) {
|
|
41
|
+
return {
|
|
42
|
+
calculatedValue,
|
|
43
|
+
isCalculatedValue,
|
|
44
|
+
isCalculatedNotOverrideValue: true,
|
|
45
|
+
isCalculatedOverrideValue: false
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
calculatedValue,
|
|
50
|
+
isCalculatedValue,
|
|
51
|
+
isCalculatedNotOverrideValue: false,
|
|
52
|
+
isCalculatedOverrideValue: true
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=calculatedInheritedFlags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculatedInheritedFlags.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,WAAmD,EAAkB,EAAE;IACzG,MAAM,cAAc,GAAG,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC9E,MAAM,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,WAAW,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAE1G,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO;YACH,cAAc,EAAE,IAAI;YACpB,gBAAgB,EAAE,KAAK;YACvB,wBAAwB,EAAE,KAAK;YAC/B,2BAA2B,EAAE,KAAK;SACrC,CAAC;IACN,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI,CAAC;IAE9B,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QACnD,OAAO;YACH,cAAc;YACd,gBAAgB;YAChB,2BAA2B,EAAE,IAAI;YACjC,wBAAwB,EAAE,KAAK;SAClC,CAAC;IACN,CAAC;IAED,OAAO;QACH,cAAc;QACd,gBAAgB;QAChB,2BAA2B,EAAE,KAAK;QAClC,wBAAwB,EAAE,IAAI;KACjC,CAAC;AACN,CAAC,CAAC;AAyBF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,WAAmD,EAAmB,EAAE;IAC3G,MAAM,eAAe,GAAG,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAChF,MAAM,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,YAAY,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAE1G,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO;YACH,eAAe,EAAE,IAAI;YACrB,iBAAiB,EAAE,KAAK;YACxB,yBAAyB,EAAE,KAAK;YAChC,4BAA4B,EAAE,KAAK;SACtC,CAAC;IACN,CAAC;IAED,MAAM,iBAAiB,GAAG,IAAI,CAAC;IAE/B,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QACnD,OAAO;YACH,eAAe;YACf,iBAAiB;YACjB,4BAA4B,EAAE,IAAI;YAClC,yBAAyB,EAAE,KAAK;SACnC,CAAC;IACN,CAAC;IAED,OAAO;QACH,eAAe;QACf,iBAAiB;QACjB,4BAA4B,EAAE,KAAK;QACnC,yBAAyB,EAAE,IAAI;KAClC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AttributeFormat, ValueDetailsValueFragment } from '../../../../../_gqlTypes';
|
|
2
|
+
import { RecordFormElementsValueStandardValue } from '../../../../../hooks/useGetRecordForm';
|
|
3
|
+
interface IUseGetPresentationValues {
|
|
4
|
+
presentationValues: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare const useGetPresentationValues: ({ values, format, calculatedValue, inheritedValue }: {
|
|
7
|
+
values: ValueDetailsValueFragment[];
|
|
8
|
+
format: AttributeFormat;
|
|
9
|
+
calculatedValue: RecordFormElementsValueStandardValue;
|
|
10
|
+
inheritedValue: RecordFormElementsValueStandardValue;
|
|
11
|
+
}) => IUseGetPresentationValues;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
+
// This file is released under LGPL V3
|
|
3
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
+
import { AttributeFormat } from '../../../../../_gqlTypes';
|
|
5
|
+
import { useSharedTranslation } from '../../../../../hooks/useSharedTranslation';
|
|
6
|
+
const _isDateRangeValue = (value) => !!value && typeof value === 'object' && 'from' in value && 'to' in value;
|
|
7
|
+
export const useGetPresentationValues = ({ values, format, calculatedValue, inheritedValue }) => {
|
|
8
|
+
const { t } = useSharedTranslation();
|
|
9
|
+
const presentationValues = values.map(value => {
|
|
10
|
+
let presentationValue = value.payload || calculatedValue?.payload || inheritedValue?.payload || '';
|
|
11
|
+
switch (format) {
|
|
12
|
+
case AttributeFormat.date_range:
|
|
13
|
+
if (_isDateRangeValue(presentationValue)) {
|
|
14
|
+
const { from, to } = presentationValue;
|
|
15
|
+
presentationValue = t('record_edition.date_range_value', {
|
|
16
|
+
from,
|
|
17
|
+
to,
|
|
18
|
+
interpolation: {
|
|
19
|
+
escapeValue: false
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
presentationValue = '';
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
case AttributeFormat.color:
|
|
28
|
+
if (presentationValue) {
|
|
29
|
+
presentationValue = '#' + presentationValue;
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
return presentationValue;
|
|
34
|
+
});
|
|
35
|
+
return { presentationValues };
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=useGetPresentationValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGetPresentationValues.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,eAAe,EAA4B,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAC,oBAAoB,EAA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iElements/TreeField/ValuesAdd/ValuesAdd.js
CHANGED
|
@@ -42,7 +42,7 @@ const BreadcrumbRoot = styled(Breadcrumb) `
|
|
|
42
42
|
function ValuesAdd({ attribute, onAdd, onClose }) {
|
|
43
43
|
const { t } = useSharedTranslation();
|
|
44
44
|
const { lang } = useLang();
|
|
45
|
-
const valuesList = attribute
|
|
45
|
+
const valuesList = attribute.treeValuesList?.enable ? (attribute.treeValuesList.values ?? []) : [];
|
|
46
46
|
const wrapperRef = useRef();
|
|
47
47
|
const [selectedValuesFromTree, setSelectedValuesFromTree] = useState([]);
|
|
48
48
|
const [selectedValuesFromList, setSelectedValuesFromList] = useState([]);
|
|
@@ -100,7 +100,7 @@ function ValuesAdd({ attribute, onAdd, onClose }) {
|
|
|
100
100
|
});
|
|
101
101
|
return (_jsx(BreadcrumbWrapper, { children: _jsx(BreadcrumbRoot, { items: breadcrumbItems, separator: ">" }) }));
|
|
102
102
|
};
|
|
103
|
-
return (_jsx(_Fragment, { children: _jsxs(Wrapper, { "data-testid": "values-add", ref: wrapperRef, children: [_jsxs(SelectionWrapper, { children: [!!valuesList.length && (_jsxs(_Fragment, { children: [_jsx(Divider, { orientation: "left", children: t('record_edition.values_list') }), _jsx(List, { dataSource: valuesList, onItemClick: _handleItemClick, renderItemContent: _renderListItem, selectable: attribute.multiple_values, selectedItems: selectedValuesFromList, onSelectionChange: _handleSelectionChange, pagination: false })] })), _jsx(Divider, { orientation: "left", children: localizedTranslation(attribute.linked_tree.label, lang) }), _jsx(SelectTreeNode, {
|
|
103
|
+
return (_jsx(_Fragment, { children: _jsxs(Wrapper, { "data-testid": "values-add", ref: wrapperRef, children: [_jsxs(SelectionWrapper, { children: [!!valuesList.length && (_jsxs(_Fragment, { children: [_jsx(Divider, { orientation: "left", children: t('record_edition.values_list') }), _jsx(List, { dataSource: valuesList, onItemClick: _handleItemClick, renderItemContent: _renderListItem, selectable: attribute.multiple_values, selectedItems: selectedValuesFromList, onSelectionChange: _handleSelectionChange, pagination: false })] })), _jsx(Divider, { orientation: "left", children: localizedTranslation(attribute.linked_tree.label, lang) }), _jsx(SelectTreeNode, { treeId: attribute.linked_tree.id, onSelect: _handleSelect, onCheck: _handleCheck, multiple: attribute.multiple_values })] }), attribute.multiple_values && (_jsx(FooterWrapper, { children: _jsxs(Space, { children: [_jsx(Button, { size: "small", onClick: _handleClose, children: t('global.cancel') }), _jsx(Button, { type: "primary", size: "small", onClick: _handleSubmit, children: t('global.submit') })] }) }))] }) }));
|
|
104
104
|
}
|
|
105
105
|
export default ValuesAdd;
|
|
106
106
|
//# sourceMappingURL=ValuesAdd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValuesAdd.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/ValuesAdd.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAC,MAAM,MAAM,CAAC;AACxD,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,IAAI,MAAM,qBAAqB,CAAC;AACvC,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAGpE,OAAO,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAQ5C,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA;wBACF,SAAS,CAAC,SAAS;;;CAG1C,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIlC,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;;;kBAId,SAAS,CAAC,OAAO;CAClC,CAAC;AAEF,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAInC,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;;;CAGxC,CAAC;AAIF,SAAS,SAAS,CAAC,EAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAkB;IAC3D,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"ValuesAdd.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/ValuesAdd.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAC,MAAM,MAAM,CAAC;AACxD,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,IAAI,MAAM,qBAAqB,CAAC;AACvC,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;A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4B,CAAC,GAAW,EACvE,KAAC,IAAI,IACD,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,gBAAgB,EAC7B,iBAAiB,EAAE,eAAe,EAClC,UAAU,EAAE,SAAS,CAAC,eAAe,EACrC,aAAa,EAAE,sBAAsB,EACrC,iBAAiB,EAAE,sBAAsB,EACzC,UAAU,EAAE,KAAK,GACnB,IACH,CACN,EACD,KAAC,OAAO,IAAC,WAAW,EAAC,MAAM,YAAE,oBAAoB,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,GAAW,EAC/F,KAAC,cAAc,IACX,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,EAAE,EAChC,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,SAAS,CAAC,eAAe,GACrC,IACa,EAClB,SAAS,CAAC,eAAe,IAAI,CAC1B,KAAC,aAAa,cACV,MAAC,KAAK,eACF,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,YAAY,YACrC,CAAC,CAAC,eAAe,CAAC,GACd,EACT,KAAC,MAAM,IAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,aAAa,YACrD,CAAC,CAAC,eAAe,CAAC,GACd,IACL,GACI,CACnB,IACK,GACX,CACN,CAAC;AACN,CAAC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
2
|
import { ITreeNodeWithRecord } from '../../types/trees';
|
|
3
3
|
interface ISelectTreeNodeProps {
|
|
4
|
-
|
|
5
|
-
id: string;
|
|
6
|
-
label?: SystemTranslation | null;
|
|
7
|
-
};
|
|
4
|
+
treeId: string;
|
|
8
5
|
selectedNode?: string;
|
|
9
6
|
onSelect: (node: ITreeNodeWithRecord, selected: boolean) => void;
|
|
10
7
|
onCheck?: (selection: ITreeNodeWithRecord[]) => void;
|
|
@@ -12,5 +9,5 @@ interface ISelectTreeNodeProps {
|
|
|
12
9
|
canSelectRoot?: boolean;
|
|
13
10
|
selectableLibraries?: string[];
|
|
14
11
|
}
|
|
15
|
-
declare
|
|
16
|
-
export
|
|
12
|
+
export declare const SelectTreeNode: FunctionComponent<ISelectTreeNodeProps>;
|
|
13
|
+
export {};
|
|
@@ -2,147 +2,29 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
3
|
// This file is released under LGPL V3
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
-
import { DownOutlined } from '@ant-design/icons';
|
|
6
5
|
import { localizedTranslation } from '@leav/utils';
|
|
7
|
-
import { Spin, Tree } from 'antd';
|
|
8
|
-
import { useEffect, useState } from 'react';
|
|
9
6
|
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { useTreeDataQueryQuery } from '../../_gqlTypes';
|
|
8
|
+
import { ErrorDisplay } from '../..';
|
|
12
9
|
import useLang from '../../hooks/useLang';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
id: e.id,
|
|
17
|
-
key: e.id,
|
|
18
|
-
isLeaf: !e.childrenCount,
|
|
19
|
-
children: []
|
|
20
|
-
}));
|
|
21
|
-
const _getTreeNodeByKey = (key, treeContent) => {
|
|
22
|
-
for (const node of treeContent) {
|
|
23
|
-
if (key === node.key) {
|
|
24
|
-
return node;
|
|
25
|
-
}
|
|
26
|
-
const n = _getTreeNodeByKey(key, node.children);
|
|
27
|
-
if (!!n) {
|
|
28
|
-
return n;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
function SelectTreeNode({ tree, onSelect, onCheck, selectedNode: initSelectedNode, multiple = false, canSelectRoot = false, selectableLibraries }) {
|
|
10
|
+
import { SelectTreeNodeContent } from './SelectTreeNodeContent';
|
|
11
|
+
import { Skeleton } from 'antd';
|
|
12
|
+
export const SelectTreeNode = ({ treeId, onSelect, onCheck, selectedNode, multiple = false, canSelectRoot = false, selectableLibraries }) => {
|
|
33
13
|
const { lang } = useLang();
|
|
34
14
|
const { t } = useSharedTranslation();
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
record: null,
|
|
38
|
-
id: tree.id,
|
|
39
|
-
key: tree.id,
|
|
40
|
-
isLeaf: false,
|
|
41
|
-
paginationOffset: 0,
|
|
42
|
-
children: []
|
|
43
|
-
};
|
|
44
|
-
// As we'll fetch children when a node is expanded, we store the whole tree content in a hash map
|
|
45
|
-
// to make update easier and more efficient
|
|
46
|
-
const [treeMap, setTreeMap] = useState({
|
|
47
|
-
[tree.id]: rootNode
|
|
15
|
+
const { loading, error, data } = useTreeDataQueryQuery({
|
|
16
|
+
variables: { treeId }
|
|
48
17
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// Retrieve tree content
|
|
52
|
-
const [loadTreeContent, { error, called }] = useTreeNodeChildrenLazyQuery();
|
|
53
|
-
const _fetchTreeContent = async (key, offset = 0) => {
|
|
54
|
-
try {
|
|
55
|
-
const data = await loadTreeContent({
|
|
56
|
-
variables: {
|
|
57
|
-
treeId: tree.id,
|
|
58
|
-
node: key && key !== tree.id ? key : null,
|
|
59
|
-
pagination: {
|
|
60
|
-
limit: defaultPaginationPageSize,
|
|
61
|
-
offset
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
const formattedNodes = _constructTreeContent(data.data.treeNodeChildren.list);
|
|
66
|
-
const parentMapKey = key ?? tree.id;
|
|
67
|
-
const newTreeMap = { ...treeMap };
|
|
68
|
-
const totalCount = data.data.treeNodeChildren.totalCount;
|
|
69
|
-
const parentElement = newTreeMap[parentMapKey];
|
|
70
|
-
const showMoreKey = '__showMore' + parentMapKey + offset;
|
|
71
|
-
parentElement.children = parentElement.children.filter(child => !child.key.match(`__showMore${parentMapKey}`));
|
|
72
|
-
for (const node of formattedNodes) {
|
|
73
|
-
const nodeForTreeMap = { ...node, paginationOffset: 0 };
|
|
74
|
-
newTreeMap[nodeForTreeMap.key] = nodeForTreeMap;
|
|
75
|
-
parentElement.paginationOffset = offset;
|
|
76
|
-
parentElement.children.push(nodeForTreeMap);
|
|
77
|
-
}
|
|
78
|
-
if (totalCount > parentElement.paginationOffset + defaultPaginationPageSize) {
|
|
79
|
-
const showMoreElement = {
|
|
80
|
-
id: parentMapKey,
|
|
81
|
-
key: showMoreKey,
|
|
82
|
-
record: null,
|
|
83
|
-
title: t('tree-node-selection.show_more'),
|
|
84
|
-
isLeaf: false,
|
|
85
|
-
paginationOffset: 0,
|
|
86
|
-
isShowMore: true,
|
|
87
|
-
selectable: false,
|
|
88
|
-
children: []
|
|
89
|
-
};
|
|
90
|
-
parentElement.children.push(showMoreElement);
|
|
91
|
-
}
|
|
92
|
-
setTreeMap(newTreeMap);
|
|
93
|
-
setFetchError(null);
|
|
94
|
-
}
|
|
95
|
-
catch (err) {
|
|
96
|
-
setFetchError(err.message);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
setSelectedNode(initSelectedNode);
|
|
101
|
-
}, [initSelectedNode]);
|
|
102
|
-
useEffect(() => {
|
|
103
|
-
// Load root
|
|
104
|
-
_fetchTreeContent();
|
|
105
|
-
}, []);
|
|
106
|
-
const _handleLoadData = async (nodeData) => {
|
|
107
|
-
const { id, isShowMore } = nodeData;
|
|
108
|
-
// Handle offset if we get here through the "show more" element
|
|
109
|
-
const currentNodeOffset = treeMap[id]?.paginationOffset ?? 0;
|
|
110
|
-
const paginationOffset = isShowMore
|
|
111
|
-
? (treeMap[id]?.paginationOffset ?? 0) + defaultPaginationPageSize
|
|
112
|
-
: currentNodeOffset;
|
|
113
|
-
if (id === tree.id && !isShowMore) {
|
|
114
|
-
// Root has already been loaded
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
await _fetchTreeContent(String(id), paginationOffset);
|
|
118
|
-
};
|
|
119
|
-
const _handleSelect = (_, e) => {
|
|
120
|
-
const node = treeMap[e.node.key];
|
|
121
|
-
const isRoot = node.id === tree.id;
|
|
122
|
-
if ((!canSelectRoot && isRoot) ||
|
|
123
|
-
(!isRoot &&
|
|
124
|
-
typeof selectableLibraries !== 'undefined' &&
|
|
125
|
-
selectableLibraries.indexOf(node.record.whoAmI.library.id) === -1)) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
if (node) {
|
|
129
|
-
onSelect(node, e.selected);
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
const _handleCheck = (selection) => {
|
|
133
|
-
const checkedKeys = typeof selection === 'object' ? selection.checked : selection;
|
|
134
|
-
const nodes = checkedKeys.map(key => treeMap[key]);
|
|
135
|
-
onCheck(nodes);
|
|
136
|
-
};
|
|
137
|
-
if (!called) {
|
|
138
|
-
return _jsx(Spin, {});
|
|
18
|
+
if (loading) {
|
|
19
|
+
return _jsx(Skeleton.Input, {}); //TODO: use DS when export of KitSkeleton is fixed
|
|
139
20
|
}
|
|
140
|
-
if (error
|
|
141
|
-
return _jsx(ErrorDisplay, { message: error
|
|
21
|
+
if (error) {
|
|
22
|
+
return _jsx(ErrorDisplay, { message: error.message });
|
|
142
23
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
24
|
+
if (!data?.trees.list[0]) {
|
|
25
|
+
return _jsx(ErrorDisplay, { message: t('error.unknown_tree', { treeId }) });
|
|
26
|
+
}
|
|
27
|
+
const label = localizedTranslation(data.trees.list[0].label, lang) || treeId;
|
|
28
|
+
return (_jsx(SelectTreeNodeContent, { treeData: { id: treeId, label }, onCheck: onCheck, onSelect: onSelect, multiple: multiple, selectedNode: selectedNode, canSelectRoot: canSelectRoot, selectableLibraries: selectableLibraries }));
|
|
29
|
+
};
|
|
148
30
|
//# sourceMappingURL=SelectTreeNode.js.map
|