@leav/ui 0.3.6-df40eff → 0.3.6-e865e1b
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/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/_gqlTypes/index.d.ts +65 -36
- package/dist/_gqlTypes/index.js +59 -8
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/components/CreateDirectory/CreateDirectory.js +1 -1
- package/dist/components/CreateDirectory/CreateDirectory.js.map +1 -1
- package/dist/components/EditApplication/EditApplication.js +2 -2
- package/dist/components/EditApplication/EditApplication.js.map +1 -1
- package/dist/components/EditApplication/_types.d.ts +2 -2
- package/dist/components/Explorer/DataView.d.ts +9 -1
- package/dist/components/Explorer/DataView.js +30 -14
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +3 -0
- package/dist/components/Explorer/Explorer.js +44 -21
- 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 +17 -2
- package/dist/components/Explorer/_queries/useExplorerData.js +23 -9
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +7 -4
- 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/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 +89 -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 +10 -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/SimpleFilterDropDown.d.ts +8 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.js +100 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.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 +135 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +164 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -0
- package/dist/components/Explorer/useEditAction.js +1 -0
- 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/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 +1 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +7 -20
- package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.js +40 -33
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.d.ts +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.d.ts +4 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.js +25 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.d.ts +3 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +165 -192
- 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 -29
- 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 +33 -43
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.d.ts +3 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js +19 -47
- 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 +24 -46
- 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 +29 -50
- 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 +43 -62
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.d.ts +3 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js +28 -50
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.d.ts +14 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +64 -401
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.d.ts +3 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.js +23 -49
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.js.map +1 -1
- 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 +13 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.js +2 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.d.ts +42 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js +55 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.d.ts +12 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js +31 -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 +44 -11
- package/dist/locales/fr/shared.json +44 -11
- package/package.json +3 -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 +0 -9
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.js +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/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
package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js
CHANGED
|
@@ -1,227 +1,200 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { ErrorTypes } from '@leav/utils';
|
|
6
|
-
import {
|
|
7
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { ErrorTypes, localizedTranslation } from '@leav/utils';
|
|
6
|
+
import { useRef, useState } from 'react';
|
|
8
7
|
import styled from 'styled-components';
|
|
9
8
|
import { ErrorDisplay } from '../../../../../components';
|
|
10
|
-
import CreationErrorContext from '../../../../../components/RecordEdition/EditRecord/creationErrorContext';
|
|
11
|
-
import { EditRecordReducerActionsTypes } from '../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
|
|
12
|
-
import { useEditRecordReducer } from '../../../../../components/RecordEdition/editRecordReducer/useEditRecordReducer';
|
|
13
|
-
import { useRefreshFieldValues } from '../../../../../hooks/useRefreshFieldValues';
|
|
14
9
|
import { AttributeFormat } from '../../../../../_gqlTypes';
|
|
15
|
-
import {
|
|
16
|
-
import standardFieldReducer, { computeInitialState, newValueId, StandardFieldReducerActionsTypes } from '../../reducers/standardFieldReducer/standardFieldReducer';
|
|
17
|
-
import AddValueBtn from '../../shared/AddValueBtn';
|
|
18
|
-
import DeleteAllValuesBtn from '../../shared/DeleteAllValuesBtn';
|
|
19
|
-
import FieldFooter from '../../shared/FieldFooter';
|
|
20
|
-
import ValuesVersionBtn from '../../shared/ValuesVersionBtn';
|
|
21
|
-
import { APICallStatus, VersionFieldScope } from '../../_types';
|
|
10
|
+
import { APICallStatus } from '../../_types';
|
|
22
11
|
import StandardFieldValue from './StandardFieldValue';
|
|
23
|
-
import {
|
|
12
|
+
import { Form } from 'antd';
|
|
13
|
+
import { KitButton, KitInputWrapper, KitTooltip } from 'aristid-ds';
|
|
14
|
+
import { useLang } from '../../../../../hooks';
|
|
15
|
+
import { FaPlus, FaTrash } from 'react-icons/fa';
|
|
16
|
+
import { DeleteAllValuesButton } from './DeleteAllValuesButton';
|
|
17
|
+
import { computeCalculatedFlags, computeInheritedFlags } from './calculatedInheritedFlags';
|
|
18
|
+
import { useGetPresentationValues } from './useGetPresentationValues';
|
|
19
|
+
import { useSharedTranslation } from '../../../../../hooks/useSharedTranslation';
|
|
20
|
+
import { getEmptyInitialValue } from '../../antdUtils';
|
|
24
21
|
const Wrapper = styled.div `
|
|
25
22
|
margin-bottom: ${props => (props.$metadataEdit ? 0 : '1.5em')};
|
|
26
23
|
`;
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (creationErrors[attribute.id]) {
|
|
46
|
-
// Affect error to each invalid value to display it on form
|
|
47
|
-
for (const fieldError of creationErrors[attribute.id]) {
|
|
48
|
-
const idValue = fieldError.id_value ?? null;
|
|
49
|
-
dispatch({
|
|
50
|
-
type: StandardFieldReducerActionsTypes.SET_ERROR,
|
|
51
|
-
idValue,
|
|
52
|
-
error: fieldError.message
|
|
53
|
-
});
|
|
54
|
-
}
|
|
24
|
+
const KitFieldsWrapper = styled.div `
|
|
25
|
+
max-height: 322px;
|
|
26
|
+
overflow-y: scroll;
|
|
27
|
+
`;
|
|
28
|
+
const RowValueWrapper = styled.div `
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: row;
|
|
31
|
+
`;
|
|
32
|
+
const StandardFieldValueWrapper = styled.div `
|
|
33
|
+
flex: 1;
|
|
34
|
+
`;
|
|
35
|
+
const KitInputWrapperStyled = styled(KitInputWrapper) `
|
|
36
|
+
&.bordered > .kit-input-wrapper-content {
|
|
37
|
+
padding: calc((var(--general-spacing-xs) - 3) * 1px);
|
|
38
|
+
|
|
39
|
+
.kit-input-wrapper-content {
|
|
40
|
+
margin: 3px;
|
|
55
41
|
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
const KitDeleteValueButton = styled(KitButton) `
|
|
45
|
+
margin: 3px;
|
|
46
|
+
`;
|
|
47
|
+
const KitAddValueButton = styled(KitButton) `
|
|
48
|
+
margin-top: calc((var(--general-spacing-xs) - 3) * 1px);
|
|
49
|
+
margin-bottom: 3px;
|
|
50
|
+
`;
|
|
51
|
+
const StandardField = ({ element, antdForm, readonly, onValueSubmit, onValueDelete, onDeleteMultipleValues, metadataEdit = false }) => {
|
|
52
|
+
const { t } = useSharedTranslation();
|
|
53
|
+
const { lang: availableLang } = useLang();
|
|
54
|
+
const antdListFieldsRef = useRef(null);
|
|
55
|
+
const { attribute } = element;
|
|
56
|
+
if (!attribute) {
|
|
57
|
+
return _jsx(ErrorDisplay, { message: t('record_edition.missing_attribute') });
|
|
58
|
+
}
|
|
59
|
+
const [backendValues, setBackendValues] = useState(element.values);
|
|
60
|
+
const calculatedFlags = computeCalculatedFlags(backendValues);
|
|
61
|
+
const inheritedFlags = computeInheritedFlags(backendValues);
|
|
62
|
+
const defaultValueToAddInAntdForm = getEmptyInitialValue(attribute);
|
|
63
|
+
const backendWithoutCalculatedOrInheritedValues = backendValues
|
|
64
|
+
.filter(backendValue => !backendValue.isCalculated && !backendValue.isInherited)
|
|
65
|
+
.sort((a, b) => Number(a.id_value) - Number(b.id_value));
|
|
66
|
+
const { presentationValues } = useGetPresentationValues({
|
|
67
|
+
//TODO fix type
|
|
68
|
+
values: backendWithoutCalculatedOrInheritedValues,
|
|
69
|
+
format: attribute.format,
|
|
70
|
+
calculatedValue: calculatedFlags.calculatedValue,
|
|
71
|
+
inheritedValue: inheritedFlags.inheritedValue
|
|
72
|
+
});
|
|
73
|
+
const _handleSubmit = (idValue, fieldName) => async (valueToSave) => {
|
|
74
|
+
const submitRes = await onValueSubmit([{ value: valueToSave, idValue: idValue ?? null, attribute }], null);
|
|
75
|
+
const shouldSpecifyFieldName = attribute.multiple_values && fieldName !== undefined;
|
|
76
|
+
const name = shouldSpecifyFieldName ? [attribute.id, fieldName] : attribute.id;
|
|
65
77
|
if (submitRes.status === APICallStatus.SUCCESS) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
version: null,
|
|
77
|
-
raw_payload: metadataValue.raw_payload ?? metadataValue.payload,
|
|
78
|
-
payload: metadataValue.payload,
|
|
79
|
-
metadata: null,
|
|
80
|
-
attribute
|
|
81
|
-
};
|
|
78
|
+
if (antdForm) {
|
|
79
|
+
antdForm.setFields([
|
|
80
|
+
{
|
|
81
|
+
name,
|
|
82
|
+
errors: null
|
|
83
|
+
}
|
|
84
|
+
]);
|
|
85
|
+
}
|
|
86
|
+
if (!attribute.multiple_values) {
|
|
87
|
+
setBackendValues(submitRes.values);
|
|
82
88
|
}
|
|
83
89
|
else {
|
|
84
|
-
|
|
90
|
+
setBackendValues(previousBackendValues => {
|
|
91
|
+
const newBackendValues = [...previousBackendValues, ...submitRes.values].reduce((acc, backendValue) => {
|
|
92
|
+
const existingValue = acc.find(o => o.id_value === backendValue.id_value &&
|
|
93
|
+
o.isCalculated === backendValue.isCalculated &&
|
|
94
|
+
o.isInherited === backendValue.isInherited);
|
|
95
|
+
if (existingValue) {
|
|
96
|
+
Object.assign(existingValue, backendValue);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
acc.push(backendValue);
|
|
100
|
+
}
|
|
101
|
+
return acc;
|
|
102
|
+
}, []);
|
|
103
|
+
return newBackendValues;
|
|
104
|
+
});
|
|
85
105
|
}
|
|
86
|
-
|
|
87
|
-
type: StandardFieldReducerActionsTypes.UPDATE_AFTER_SUBMIT,
|
|
88
|
-
newValue: resultValue,
|
|
89
|
-
idValue
|
|
90
|
-
});
|
|
91
|
-
const newActiveValue = state.metadataEdit
|
|
92
|
-
? {
|
|
93
|
-
...editRecordState.activeValue,
|
|
94
|
-
value: {
|
|
95
|
-
...editRecordState.activeValue.value,
|
|
96
|
-
metadata: [
|
|
97
|
-
...(editRecordState.activeValue?.value?.metadata ?? []),
|
|
98
|
-
{
|
|
99
|
-
name: element.attribute.id,
|
|
100
|
-
value: {
|
|
101
|
-
...resultValue,
|
|
102
|
-
version: null,
|
|
103
|
-
metadata: null
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
: null;
|
|
110
|
-
editRecordDispatch({
|
|
111
|
-
type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
|
|
112
|
-
value: newActiveValue
|
|
113
|
-
});
|
|
114
|
-
return;
|
|
106
|
+
return submitRes;
|
|
115
107
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const attributeError = (submitRes?.errors ?? []).filter(err => err.attribute === attribute.id)?.[0];
|
|
108
|
+
if (!submitRes.error && submitRes.errors) {
|
|
109
|
+
const attributeError = submitRes.errors.filter(err => err.attribute === attribute.id)?.[0];
|
|
119
110
|
if (attributeError) {
|
|
120
|
-
|
|
111
|
+
submitRes.error =
|
|
121
112
|
attributeError.type === ErrorTypes.VALIDATION_ERROR
|
|
122
113
|
? attributeError.message
|
|
123
114
|
: t(`errors.${attributeError.type}`);
|
|
124
|
-
if (antdForm) {
|
|
125
|
-
antdForm.setFields([
|
|
126
|
-
{
|
|
127
|
-
name: attributeError.attribute,
|
|
128
|
-
errors: [errorMessage]
|
|
129
|
-
}
|
|
130
|
-
]);
|
|
131
|
-
}
|
|
132
115
|
}
|
|
133
116
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
dispatch({
|
|
142
|
-
type: StandardFieldReducerActionsTypes.UNEDIT_FIELD,
|
|
143
|
-
idValue
|
|
144
|
-
});
|
|
145
|
-
const deleteRes = await onValueDelete({ id_value: idValue }, attribute.id);
|
|
146
|
-
if (deleteRes.status === APICallStatus.SUCCESS) {
|
|
147
|
-
dispatch({
|
|
148
|
-
type: StandardFieldReducerActionsTypes.UPDATE_AFTER_DELETE,
|
|
149
|
-
idValue
|
|
150
|
-
});
|
|
151
|
-
if (!isInCreationMode) {
|
|
152
|
-
const freshValues = await fetchValues(state.values[state.activeScope].version);
|
|
153
|
-
dispatch({
|
|
154
|
-
type: StandardFieldReducerActionsTypes.REFRESH_VALUES,
|
|
155
|
-
formVersion: editRecordState.valuesVersion,
|
|
156
|
-
values: freshValues
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
return;
|
|
117
|
+
if (submitRes.error && antdForm) {
|
|
118
|
+
antdForm.setFields([
|
|
119
|
+
{
|
|
120
|
+
name,
|
|
121
|
+
errors: [submitRes.error]
|
|
122
|
+
}
|
|
123
|
+
]);
|
|
160
124
|
}
|
|
161
|
-
|
|
162
|
-
type: StandardFieldReducerActionsTypes.SET_ERROR,
|
|
163
|
-
idValue,
|
|
164
|
-
error: deleteRes.error
|
|
165
|
-
});
|
|
125
|
+
return submitRes;
|
|
166
126
|
};
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
dispatch({
|
|
176
|
-
type: StandardFieldReducerActionsTypes.ADD_VALUE
|
|
177
|
-
});
|
|
178
|
-
};
|
|
179
|
-
const _handleScopeChange = (scope) => {
|
|
180
|
-
dispatch({
|
|
181
|
-
type: StandardFieldReducerActionsTypes.CHANGE_VERSION_SCOPE,
|
|
182
|
-
scope
|
|
183
|
-
});
|
|
127
|
+
const _handleDeleteValue = async (idValue, antdRemove, deletedFieldIndex) => {
|
|
128
|
+
if (idValue) {
|
|
129
|
+
await onValueDelete({ id_value: idValue }, attribute.id);
|
|
130
|
+
setBackendValues(previousBackendValues => previousBackendValues.filter(backendValue => backendValue.id_value !== idValue));
|
|
131
|
+
}
|
|
132
|
+
antdRemove(deletedFieldIndex);
|
|
184
133
|
};
|
|
185
134
|
const _handleDeleteAllValues = async () => {
|
|
186
|
-
const deleteRes = await onDeleteMultipleValues(attribute.id,
|
|
135
|
+
const deleteRes = await onDeleteMultipleValues(attribute.id, backendValues.filter(b => b.id_value), null);
|
|
187
136
|
if (deleteRes.status === APICallStatus.SUCCESS) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
137
|
+
antdListFieldsRef.current.remove(antdListFieldsRef.current.indexes);
|
|
138
|
+
antdListFieldsRef.current.add(defaultValueToAddInAntdForm);
|
|
139
|
+
setBackendValues(previousBackendValues => previousBackendValues.filter(backendValue => !backendValue.id_value));
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
const isMultipleValues = element.attribute.multiple_values;
|
|
144
|
+
const hasValue = isMultipleValues && backendValues.length > 0;
|
|
145
|
+
const canAddAnotherValue = !readonly &&
|
|
146
|
+
isMultipleValues &&
|
|
147
|
+
attribute.format !== AttributeFormat.boolean &&
|
|
148
|
+
attribute.format !== AttributeFormat.encrypted;
|
|
149
|
+
const canDeleteAllValues = !readonly && hasValue && backendValues.length > 1;
|
|
150
|
+
const label = localizedTranslation(element.settings.label, availableLang);
|
|
151
|
+
const _getFormattedValueForHelper = (valueToFormat) => {
|
|
152
|
+
switch (attribute.format) {
|
|
153
|
+
case AttributeFormat.date_range:
|
|
154
|
+
return t('record_edition.date_range_from_to', {
|
|
155
|
+
from: valueToFormat.payload.from,
|
|
156
|
+
to: valueToFormat.payload.to
|
|
198
157
|
});
|
|
199
|
-
|
|
158
|
+
case AttributeFormat.encrypted:
|
|
159
|
+
return valueToFormat.payload ? '●●●●●●●' : '';
|
|
160
|
+
case AttributeFormat.color:
|
|
161
|
+
return '#' + valueToFormat.payload;
|
|
162
|
+
default:
|
|
163
|
+
return valueToFormat.payload;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
const _getHelper = () => {
|
|
167
|
+
if (attribute.multiple_values) {
|
|
200
168
|
return;
|
|
201
169
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
170
|
+
if (inheritedFlags.isInheritedOverrideValue) {
|
|
171
|
+
return t('record_edition.inherited_input_helper', {
|
|
172
|
+
inheritedValue: _getFormattedValueForHelper(inheritedFlags.inheritedValue)
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
if (calculatedFlags.isCalculatedOverrideValue) {
|
|
176
|
+
return t('record_edition.calculated_input_helper', {
|
|
177
|
+
calculatedValue: _getFormattedValueForHelper(calculatedFlags.calculatedValue)
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
return;
|
|
207
181
|
};
|
|
208
|
-
|
|
209
|
-
|
|
182
|
+
let isFieldInError = false;
|
|
183
|
+
if (antdForm) {
|
|
184
|
+
const hasErrorsInFormList = backendValues.some((_, index) => {
|
|
185
|
+
const errors = antdForm.getFieldError([attribute.id, index]);
|
|
186
|
+
return errors.length > 0;
|
|
187
|
+
});
|
|
188
|
+
isFieldInError = antdForm.getFieldError(attribute.id).length > 0 || hasErrorsInFormList;
|
|
210
189
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
};
|
|
220
|
-
return (_jsx(StandardFieldReducerContext.Provider, { value: { state, dispatch }, children: _jsxs(Wrapper, { "$metadataEdit": metadataEdit, children: [valuesToDisplay.map(value => (_jsx(StandardFieldValue, { value: value, state: state, dispatch: dispatch, onSubmit: _handleSubmit, onDelete: _handleDelete, onScopeChange: _handleScopeChange }, value.idValue))), (canDeleteAllValues || canAddAnotherValue || attribute?.versions_conf?.versionable) && (_jsxs(FieldFooter, { bordered: true, style: {
|
|
221
|
-
flexDirection: canAddAnotherValue && !canDeleteAllValues && !isAttributeVersionable
|
|
222
|
-
? 'row'
|
|
223
|
-
: 'row-reverse'
|
|
224
|
-
}, children: [_jsxs("div", { children: [isAttributeVersionable && (_jsx(ValuesVersionBtn, { basic: true, versions: versions, activeScope: state.activeScope, onScopeChange: _handleScopeChange })), canDeleteAllValues && _jsx(DeleteAllValuesBtn, { onDelete: _handleDeleteAllValues })] }), canAddAnotherValue && (_jsx(AddValueBtn, { activeScope: state.activeScope, onClick: _handleAddValue }))] }))] }) }));
|
|
190
|
+
return (_jsx(Wrapper, { "$metadataEdit": metadataEdit, children: _jsxs(KitInputWrapperStyled, { label: label, helper: _getHelper(), required: element.settings.required, disabled: readonly, bordered: attribute.multiple_values, status: isFieldInError ? 'error' : undefined, actions: canDeleteAllValues ? [_jsx(DeleteAllValuesButton, { handleDelete: _handleDeleteAllValues })] : undefined, htmlFor: attribute.id, children: [!attribute.multiple_values && (_jsx(StandardFieldValue, { presentationValue: presentationValues[0], handleSubmit: _handleSubmit(backendWithoutCalculatedOrInheritedValues[0]?.id_value), attribute: attribute, required: element.settings.required, readonly: readonly, label: label, calculatedFlags: calculatedFlags, inheritedFlags: inheritedFlags })), attribute.multiple_values && (_jsx(Form.List, { name: attribute.id, children: (fields, { add, remove }) => {
|
|
191
|
+
antdListFieldsRef.current = { add, remove, indexes: fields.map((_, index) => index) };
|
|
192
|
+
const shouldDisabledAddValueButton = fields.length > backendWithoutCalculatedOrInheritedValues.length;
|
|
193
|
+
return (_jsxs(_Fragment, { children: [_jsx(KitFieldsWrapper, { children: fields.map((field, index) => (_jsxs(RowValueWrapper, { children: [_jsx(StandardFieldValueWrapper, { children: _jsx(StandardFieldValue, { listField: field, presentationValue: presentationValues[index] ?? '', handleSubmit: _handleSubmit(backendWithoutCalculatedOrInheritedValues[index]?.id_value, field.name), attribute: attribute, label: label, required: element.settings.required, readonly: readonly, calculatedFlags: calculatedFlags, inheritedFlags: inheritedFlags }) }), fields.length > 1 && (_jsx(KitDeleteValueButton, { type: "tertiary", title: t('record_edition.delete_value'), icon: _jsx(FaTrash, {}), onClick: () => _handleDeleteValue(backendWithoutCalculatedOrInheritedValues[index]
|
|
194
|
+
?.id_value, remove, index) }))] }, field.key))) }), canAddAnotherValue && (_jsx(KitTooltip, { title: shouldDisabledAddValueButton
|
|
195
|
+
? t('record_edition.please_select_value_before_adding')
|
|
196
|
+
: undefined, children: _jsx(KitAddValueButton, { type: "secondary", size: "m", icon: _jsx(FaPlus, {}), onClick: () => add(defaultValueToAddInAntdForm), disabled: shouldDisabledAddValueButton, children: t('record_edition.add_value') }) }))] }));
|
|
197
|
+
} }))] }) }));
|
|
225
198
|
};
|
|
226
199
|
export default StandardField;
|
|
227
200
|
//# sourceMappingURL=StandardField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardField.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAe,UAAU,
|
|
1
|
+
{"version":3,"file":"StandardField.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAe,UAAU,EAA2B,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACpG,OAAO,EAAoB,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAC,eAAe,EAAuB,MAAM,eAAe,CAAC;AACpE,OAAO,EAAC,aAAa,EAA2C,MAAM,cAAc,CAAC;AACrF,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAC,IAAI,EAAkC,MAAM,MAAM,CAAC;AAC3D,OAAO,EAAC,SAAS,EAAE,eAAe,EA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AAiB,IACd,IAAI,EAAC,WAAW,EAChB,IAAI,EAAC,GAAG,EACR,IAAI,EAAE,KAAC,MAAM,KAAG,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,2BAA2B,CAAC,EAC/C,QAAQ,EAAE,4BAA4B,YAErC,CAAC,CAAC,0BAA0B,CAAC,GACd,GACX,CAChB,IACF,CACN,CAAC;oBACN,CAAC,GACO,CACf,IACmB,GAClB,CACb,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
-
import { IStandardFieldReducerState } from '../../../reducers/standardFieldReducer/standardFieldReducer';
|
|
3
|
-
import { IProvidedByAntFormItem } from '../../../../../../components/RecordEdition/EditRecordContent/_types';
|
|
4
2
|
import { IKitSwitch } from 'aristid-ds/dist/Kit/DataEntry/Switch/types';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
handleSubmit: (value: string, id?: string) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const DSBooleanWrapper: FunctionComponent<IDSBooleanWrapperProps>;
|
|
10
|
-
export {};
|
|
3
|
+
import { IStandFieldValueContentProps } from './_types';
|
|
4
|
+
export declare const DSBooleanWrapper: FunctionComponent<IStandFieldValueContentProps<IKitSwitch>>;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 {
|
|
6
|
-
import { Form } from 'antd';
|
|
5
|
+
import { KitSwitch, KitTypography } from 'aristid-ds';
|
|
7
6
|
import styled from 'styled-components';
|
|
8
7
|
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
9
|
-
import { useLang } from '../../../../../../hooks';
|
|
10
|
-
import { localizedTranslation } from '@leav/utils';
|
|
11
8
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
12
9
|
import { faCircleXmark } from '@fortawesome/free-solid-svg-icons';
|
|
13
10
|
const KitTypographyTextStyled = styled(KitTypography.Text) `
|
|
@@ -22,40 +19,24 @@ const FontAwesomeIconStyled = styled(FontAwesomeIcon) `
|
|
|
22
19
|
cursor: pointer;
|
|
23
20
|
`;
|
|
24
21
|
const _getBooleanValueAsStringForTranslation = (value) => (value ? 'global.yes' : 'global.no');
|
|
25
|
-
export const DSBooleanWrapper = ({ value, onChange,
|
|
22
|
+
export const DSBooleanWrapper = ({ value, onChange, handleSubmit, attribute, readonly, inheritedFlags, calculatedFlags }) => {
|
|
26
23
|
if (!onChange) {
|
|
27
24
|
throw Error('DSBooleanWrapper should be used inside a antd Form.Item');
|
|
28
25
|
}
|
|
29
26
|
const { t } = useSharedTranslation();
|
|
30
|
-
const { errors } = Form.Item.useStatus();
|
|
31
|
-
const { lang: availableLang } = useLang();
|
|
32
27
|
const _resetToInheritedOrCalculatedValue = () => {
|
|
33
|
-
if (
|
|
34
|
-
onChange(
|
|
28
|
+
if (inheritedFlags.isInheritedValue) {
|
|
29
|
+
onChange(inheritedFlags.inheritedValue.raw_payload, undefined);
|
|
35
30
|
}
|
|
36
|
-
else if (
|
|
37
|
-
onChange(
|
|
31
|
+
else if (calculatedFlags.isCalculatedValue) {
|
|
32
|
+
onChange(calculatedFlags.calculatedValue.raw_payload, undefined);
|
|
38
33
|
}
|
|
39
|
-
handleSubmit(
|
|
34
|
+
handleSubmit(null, attribute.id);
|
|
40
35
|
};
|
|
41
36
|
const _handleOnChange = (checked, event) => {
|
|
42
|
-
handleSubmit(String(checked), state.attribute.id);
|
|
43
37
|
onChange(checked, event);
|
|
38
|
+
handleSubmit(String(checked), attribute.id);
|
|
44
39
|
};
|
|
45
|
-
|
|
46
|
-
if (state.isInheritedOverrideValue) {
|
|
47
|
-
return t('record_edition.inherited_input_helper', {
|
|
48
|
-
inheritedValue: t(_getBooleanValueAsStringForTranslation(state.inheritedValue.raw_value))
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
else if (state.isCalculatedOverrideValue) {
|
|
52
|
-
return t('record_edition.calculated_input_helper', {
|
|
53
|
-
calculatedValue: t(_getBooleanValueAsStringForTranslation(state.calculatedValue.raw_value))
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return undefined;
|
|
57
|
-
};
|
|
58
|
-
const label = localizedTranslation(state.formElement.settings.label, availableLang);
|
|
59
|
-
return (_jsxs(KitInputWrapper, { label: label, helper: _getHelper(), status: errors.length > 0 ? 'error' : undefined, disabled: state.isReadOnly, children: [_jsxs("label", { children: [_jsx(KitSwitch, { checked: value, disabled: state.isReadOnly, onChange: _handleOnChange }), _jsx(KitTypographyTextStyled, { size: "fontSize5", weight: "medium", "$shouldHighlightColor": state.isInheritedNotOverrideValue || state.isCalculatedNotOverrideValue, children: t(_getBooleanValueAsStringForTranslation(value)) })] }), (state.isInheritedOverrideValue || state.isCalculatedOverrideValue) && (_jsx("span", { role: "button", onClick: _resetToInheritedOrCalculatedValue, children: _jsx(FontAwesomeIconStyled, { "aria-label": "clear", icon: faCircleXmark }) }))] }));
|
|
40
|
+
return (_jsxs(_Fragment, { children: [_jsxs("label", { children: [_jsx(KitSwitch, { id: attribute.id, checked: value, disabled: readonly, onChange: _handleOnChange }), _jsx(KitTypographyTextStyled, { size: "fontSize5", weight: "medium", "$shouldHighlightColor": inheritedFlags.isInheritedNotOverrideValue || calculatedFlags.isCalculatedNotOverrideValue, children: t(_getBooleanValueAsStringForTranslation(value)) })] }), (inheritedFlags.isInheritedOverrideValue || calculatedFlags.isCalculatedOverrideValue) && (_jsx("span", { role: "button", onClick: _resetToInheritedOrCalculatedValue, children: _jsx(FontAwesomeIconStyled, { "aria-label": "clear", icon: faCircleXmark }) }))] }));
|
|
60
41
|
};
|
|
61
42
|
//# sourceMappingURL=DSBooleanWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSBooleanWrapper.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"DSBooleanWrapper.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAEpD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,aAAa,EAAC,MAAM,mCAAmC,CAAC;AAGhE,MAAM,uBAAuB,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAkC;;;aAG/E,CAAC,EAAC,qBAAqB,EAAC,EAAE,EAAE,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,SAAS,CAAC;CAClH,CAAC;AAEF,MAAM,qBAAqB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAA;;;;;CAKpD,CAAC;AAEF,MAAM,sCAAsC,GAAG,CAAC,KAAc,EAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;AAEhH,MAAM,CAAC,MAAM,gBAAgB,GAAgE,CAAC,EAC1F,KAA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AAC,IAAI,CACvF,eAAM,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,kCAAkC,YAC3D,KAAC,qBAAqB,kBAAY,OAAO,EAAC,IAAI,EAAE,aAAa,GAAI,GAC9D,CACV,IACF,CACN,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
-
import { IStandardFieldReducerState, IStandardFieldValue } from '../../../reducers/standardFieldReducer/standardFieldReducer';
|
|
3
|
-
import { IProvidedByAntFormItem } from '../../../../../../components/RecordEdition/EditRecordContent/_types';
|
|
4
|
-
import { RecordFormAttributeFragment } from '../../../../../../_gqlTypes';
|
|
5
2
|
import { KitColorPickerProps } from 'aristid-ds/dist/Kit/DataEntry/ColorPicker/types';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attribute: RecordFormAttributeFragment;
|
|
9
|
-
fieldValue: IStandardFieldValue;
|
|
10
|
-
handleSubmit: (value: string, id?: string) => void;
|
|
11
|
-
handleBlur: () => void;
|
|
12
|
-
shouldShowValueDetailsButton?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const DSColorPickerWrapper: FunctionComponent<IDSColorPickerWrapperProps>;
|
|
15
|
-
export {};
|
|
3
|
+
import { IStandFieldValueContentProps } from './_types';
|
|
4
|
+
export declare const DSColorPickerWrapper: FunctionComponent<IStandFieldValueContentProps<KitColorPickerProps>>;
|