@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
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { RecordFormAttributeFragment } from '../../../../../../_gqlTypes';
|
|
6
|
-
interface IDSInputWrapperProps extends IProvidedByAntFormItem<InputProps> {
|
|
7
|
-
state: IStandardFieldReducerState;
|
|
8
|
-
attribute: RecordFormAttributeFragment;
|
|
9
|
-
fieldValue: IStandardFieldValue;
|
|
10
|
-
handleSubmit: (value: string, id?: string) => void;
|
|
11
|
-
handleBlur: () => void;
|
|
12
|
-
shouldShowValueDetailsButton?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const DSInputWrapper: FunctionComponent<IDSInputWrapperProps>;
|
|
15
|
-
export {};
|
|
2
|
+
import { IStandFieldValueContentProps } from './_types';
|
|
3
|
+
import { IKitInput } from 'aristid-ds/dist/Kit/DataEntry/Input/types';
|
|
4
|
+
export declare const DSInputWrapper: FunctionComponent<IStandFieldValueContentProps<IKitInput>>;
|
|
@@ -3,85 +3,65 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
// This file is released under LGPL V3
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
5
|
import { KitInput } from 'aristid-ds';
|
|
6
|
-
import {
|
|
6
|
+
import { useState } from 'react';
|
|
7
7
|
import { Form } from 'antd';
|
|
8
|
-
import styled from 'styled-components';
|
|
9
8
|
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import { localizedTranslation } from '@leav/utils';
|
|
13
|
-
const KitInputStyled = styled(KitInput) `
|
|
14
|
-
color: ${({ $shouldHighlightColor }) => ($shouldHighlightColor ? 'var(--general-colors-primary-400)' : 'initial')};
|
|
15
|
-
`;
|
|
16
|
-
export const DSInputWrapper = ({ value, onChange, state, attribute, fieldValue, handleSubmit, handleBlur, shouldShowValueDetailsButton = false }) => {
|
|
9
|
+
import { EMPTY_INITIAL_VALUE_STRING } from '../../../antdUtils';
|
|
10
|
+
export const DSInputWrapper = ({ value, presentationValue, isLastValueOfMultivalues, removeLastValueOfMultivalues, onChange, attribute, readonly, handleSubmit, calculatedFlags, inheritedFlags }) => {
|
|
17
11
|
if (!onChange) {
|
|
18
12
|
throw Error('DSInputWrapper should be used inside a antd Form.Item');
|
|
19
13
|
}
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const { onValueDetailsButtonClick } = useValueDetailsButton({
|
|
23
|
-
value: fieldValue?.value,
|
|
24
|
-
attribute
|
|
25
|
-
});
|
|
14
|
+
const isNewValueOfMultivalues = isLastValueOfMultivalues && value === EMPTY_INITIAL_VALUE_STRING;
|
|
15
|
+
const focusedDefaultValue = attribute.multiple_values ? isNewValueOfMultivalues : false;
|
|
26
16
|
const [hasChanged, setHasChanged] = useState(false);
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, [fieldValue.isEditing]);
|
|
34
|
-
const _resetToInheritedOrCalculatedValue = () => {
|
|
17
|
+
const [isFocused, setIsFocused] = useState(focusedDefaultValue);
|
|
18
|
+
const { errors } = Form.Item.useStatus();
|
|
19
|
+
const { t } = useSharedTranslation();
|
|
20
|
+
const isErrors = errors.length > 0;
|
|
21
|
+
const valueToDisplay = isFocused || isErrors || !presentationValue ? value : presentationValue;
|
|
22
|
+
const _resetToInheritedOrCalculatedValue = async () => {
|
|
35
23
|
setHasChanged(false);
|
|
36
|
-
if (
|
|
37
|
-
onChange(
|
|
24
|
+
if (inheritedFlags.isInheritedValue) {
|
|
25
|
+
onChange(inheritedFlags.inheritedValue.raw_payload);
|
|
38
26
|
}
|
|
39
|
-
else if (
|
|
40
|
-
onChange(
|
|
27
|
+
else if (calculatedFlags.isCalculatedValue) {
|
|
28
|
+
onChange(calculatedFlags.calculatedValue.raw_payload);
|
|
41
29
|
}
|
|
42
|
-
handleSubmit(
|
|
30
|
+
await handleSubmit(null, attribute.id);
|
|
43
31
|
};
|
|
44
|
-
const _handleOnBlur = (event) => {
|
|
32
|
+
const _handleOnBlur = async (event) => {
|
|
45
33
|
if (!hasChanged) {
|
|
46
|
-
|
|
34
|
+
onChange(event);
|
|
35
|
+
setIsFocused(false);
|
|
36
|
+
if (isNewValueOfMultivalues) {
|
|
37
|
+
removeLastValueOfMultivalues();
|
|
38
|
+
}
|
|
47
39
|
return;
|
|
48
40
|
}
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
41
|
+
const inputValue = event.target.value;
|
|
42
|
+
if (inputValue === '' && (inheritedFlags.isInheritedValue || calculatedFlags.isCalculatedValue)) {
|
|
51
43
|
_resetToInheritedOrCalculatedValue();
|
|
52
44
|
return;
|
|
53
45
|
}
|
|
54
|
-
if (hasChanged || (!state.isInheritedValue && !state.isCalculatedValue)) {
|
|
55
|
-
handleSubmit(valueToSubmit, state.attribute.id);
|
|
56
|
-
}
|
|
57
46
|
onChange(event);
|
|
47
|
+
await handleSubmit(inputValue, attribute.id);
|
|
48
|
+
setIsFocused(false);
|
|
58
49
|
};
|
|
59
|
-
|
|
50
|
+
// TODO remove this function to use onClear Prop when ant is updated to 5.20+ (and other inputs too)
|
|
51
|
+
const _handleOnChange = async (event) => {
|
|
60
52
|
setHasChanged(true);
|
|
61
53
|
const inputValue = event.target.value;
|
|
62
|
-
if ((
|
|
54
|
+
if ((inheritedFlags.isInheritedValue || calculatedFlags.isCalculatedValue) &&
|
|
55
|
+
inputValue === '' &&
|
|
56
|
+
event.type === 'click') {
|
|
63
57
|
_resetToInheritedOrCalculatedValue();
|
|
64
58
|
return;
|
|
65
59
|
}
|
|
66
|
-
if (inputValue === '' && event.type === 'click') {
|
|
67
|
-
handleSubmit(inputValue, state.attribute.id);
|
|
68
|
-
}
|
|
69
60
|
onChange(event);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (state.isInheritedOverrideValue) {
|
|
73
|
-
return t('record_edition.inherited_input_helper', {
|
|
74
|
-
inheritedValue: state.inheritedValue.raw_value
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
else if (state.isCalculatedOverrideValue) {
|
|
78
|
-
return t('record_edition.calculated_input_helper', {
|
|
79
|
-
calculatedValue: state.calculatedValue.raw_value
|
|
80
|
-
});
|
|
61
|
+
if (inputValue === '' && event.type === 'click') {
|
|
62
|
+
await handleSubmit(null, attribute.id);
|
|
81
63
|
}
|
|
82
|
-
return;
|
|
83
64
|
};
|
|
84
|
-
|
|
85
|
-
return (_jsx(KitInputStyled, { ref: inputRef, required: state.formElement.settings.required, label: label, onInfoClick: shouldShowValueDetailsButton ? onValueDetailsButtonClick : null, status: errors.length > 0 ? 'error' : undefined, helper: _getHelper(), value: value, disabled: state.isReadOnly, allowClear: !state.isInheritedNotOverrideValue && !state.isCalculatedNotOverrideValue, onBlur: _handleOnBlur, onChange: _handleOnChange, "$shouldHighlightColor": !hasChanged && (state.isInheritedNotOverrideValue || state.isCalculatedNotOverrideValue) }));
|
|
65
|
+
return (_jsx(KitInput, { id: attribute.id, autoFocus: isFocused, disabled: readonly, helper: isErrors ? String(errors[0]) : undefined, status: isErrors ? 'error' : undefined, value: valueToDisplay, allowClear: !inheritedFlags.isInheritedNotOverrideValue && !calculatedFlags.isCalculatedNotOverrideValue, onChange: _handleOnChange, onFocus: () => setIsFocused(true), onBlur: _handleOnBlur, placeholder: t('record_edition.placeholder.enter_a_text') }));
|
|
86
66
|
};
|
|
87
67
|
//# sourceMappingURL=DSInputWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSInputWrapper.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAA6C,
|
|
1
|
+
{"version":3,"file":"DSInputWrapper.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAA6C,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAG1B,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,0BAA0B,EAAC,MAAM,oBAAoB,CAAC;AAE9D,MAAM,CAAC,MAAM,cAAc,GAA+D,CAAC,EACvF,KAAK,EACL,iBAAiB,EACjB,wBAAwB,EACxB,4BAA4B,EAC5B,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,cAAc,EACjB,EAAE,EAAE;IACD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,KAAK,CAAC,uDAAuD,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,uBAAuB,GAAG,wBAAwB,IAAI,KAAK,KAAK,0BAA0B,CAAC;IACjG,MAAM,mBAAmB,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,KAAK,CAAC;IAExF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IAChE,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;IACvC,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,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ragment } from '../../../../../../_gqlTypes';
|
|
6
|
-
interface IDSRangePickerWrapperProps extends IProvidedByAntFormItem<RangePickerProps> {
|
|
7
|
-
state: IStandardFieldReducerState;
|
|
8
|
-
attribute: RecordFormAttributeFragment;
|
|
9
|
-
fieldValue: IStandardFieldValue;
|
|
10
|
-
handleSubmit: (value: StandardValueTypes, id?: string) => void;
|
|
11
|
-
handleBlur: () => void;
|
|
12
|
-
shouldShowValueDetailsButton?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const DSRangePickerWrapper: FunctionComponent<IDSRangePickerWrapperProps>;
|
|
15
|
-
export {};
|
|
2
|
+
import { IStandFieldValueContentProps } from './_types';
|
|
3
|
+
import { IKitRangePicker } from 'aristid-ds/dist/Kit/DataEntry/DatePicker/types';
|
|
4
|
+
export declare const DSRangePickerWrapper: FunctionComponent<IStandFieldValueContentProps<IKitRangePicker>>;
|
|
@@ -3,52 +3,58 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
// This file is released under LGPL V3
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
5
|
import { KitDatePicker } from 'aristid-ds';
|
|
6
|
-
import { useEffect, useRef } from 'react';
|
|
6
|
+
import { useEffect, useRef, useState } from 'react';
|
|
7
7
|
import { Form } from 'antd';
|
|
8
8
|
import dayjs from 'dayjs';
|
|
9
9
|
import styled from 'styled-components';
|
|
10
|
-
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
11
|
-
import { useValueDetailsButton } from '../../../../../../components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton';
|
|
12
|
-
import { useLang } from '../../../../../../hooks';
|
|
13
|
-
import { localizedTranslation } from '@leav/utils';
|
|
14
10
|
import { setDateToUTCNoon } from '../../../../../../_utils';
|
|
11
|
+
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
12
|
+
import { EMPTY_INITIAL_VALUE_UNDEFINED } from '../../../antdUtils';
|
|
15
13
|
const KitDatePickerRangePickerStyled = styled(KitDatePicker.RangePicker) `
|
|
16
|
-
|
|
14
|
+
${({ $shouldUsePresentationLayout }) => $shouldUsePresentationLayout &&
|
|
15
|
+
` &.ant-picker.ant-picker-range {
|
|
16
|
+
grid-template-columns: 28px 1fr 0px 0px 12px;
|
|
17
|
+
|
|
18
|
+
.ant-picker-range-separator,
|
|
19
|
+
.ant-picker-input:nth-of-type(0) {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`}
|
|
17
24
|
`;
|
|
18
|
-
export const DSRangePickerWrapper = ({ value,
|
|
25
|
+
export const DSRangePickerWrapper = ({ value, presentationValue, isLastValueOfMultivalues, removeLastValueOfMultivalues, onChange, attribute, handleSubmit, readonly, calculatedFlags, inheritedFlags }) => {
|
|
19
26
|
if (!onChange) {
|
|
20
27
|
throw Error('DSRangePickerWrapper should be used inside a antd Form.Item');
|
|
21
28
|
}
|
|
22
|
-
const
|
|
23
|
-
const
|
|
29
|
+
const isNewValueOfMultivalues = isLastValueOfMultivalues && value === EMPTY_INITIAL_VALUE_UNDEFINED;
|
|
30
|
+
const focusedDefaultValue = attribute.multiple_values ? isNewValueOfMultivalues : false;
|
|
31
|
+
const hasChangedRef = useRef(false);
|
|
32
|
+
const [isFocused, setIsFocused] = useState(focusedDefaultValue);
|
|
24
33
|
const { errors } = Form.Item.useStatus();
|
|
25
|
-
const {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
}, [fieldValue.isEditing]);
|
|
35
|
-
const _resetToInheritedOrCalculatedValue = () => {
|
|
36
|
-
if (state.isInheritedValue) {
|
|
34
|
+
const { t } = useSharedTranslation();
|
|
35
|
+
const isErrors = errors.length > 0;
|
|
36
|
+
// we slow down the css so that presentationValue does not flash before being hidden
|
|
37
|
+
const [usePresentationLayout, setUsePresentationLayout] = useState(false);
|
|
38
|
+
useEffect(() => setUsePresentationLayout(!isFocused && !isErrors), [isFocused, isErrors]);
|
|
39
|
+
const _resetToInheritedOrCalculatedValue = async () => {
|
|
40
|
+
hasChangedRef.current = false;
|
|
41
|
+
if (inheritedFlags.isInheritedValue) {
|
|
37
42
|
onChange([
|
|
38
|
-
dayjs.unix(Number(
|
|
39
|
-
dayjs.unix(Number(
|
|
40
|
-
],
|
|
43
|
+
dayjs.unix(Number(inheritedFlags.inheritedValue.raw_payload.from)),
|
|
44
|
+
dayjs.unix(Number(inheritedFlags.inheritedValue.raw_payload.to))
|
|
45
|
+
], inheritedFlags.inheritedValue.raw_payload);
|
|
41
46
|
}
|
|
42
|
-
else if (
|
|
47
|
+
else if (calculatedFlags.isCalculatedValue) {
|
|
43
48
|
onChange([
|
|
44
|
-
dayjs.unix(Number(
|
|
45
|
-
dayjs.unix(Number(
|
|
46
|
-
],
|
|
49
|
+
dayjs.unix(Number(calculatedFlags.calculatedValue.raw_payload.from)),
|
|
50
|
+
dayjs.unix(Number(calculatedFlags.calculatedValue.raw_payload.to))
|
|
51
|
+
], calculatedFlags.calculatedValue.raw_payload);
|
|
47
52
|
}
|
|
48
|
-
handleSubmit(
|
|
53
|
+
await handleSubmit(null, attribute.id);
|
|
49
54
|
};
|
|
50
|
-
const _handleDateChange = (rangePickerDates, ...antOnChangeParams) => {
|
|
51
|
-
|
|
55
|
+
const _handleDateChange = async (rangePickerDates, ...antOnChangeParams) => {
|
|
56
|
+
hasChangedRef.current = true;
|
|
57
|
+
if ((inheritedFlags.isInheritedValue || calculatedFlags.isCalculatedValue) && rangePickerDates === null) {
|
|
52
58
|
_resetToInheritedOrCalculatedValue();
|
|
53
59
|
return;
|
|
54
60
|
}
|
|
@@ -57,46 +63,24 @@ export const DSRangePickerWrapper = ({ value, onChange, state, attribute, fieldV
|
|
|
57
63
|
}
|
|
58
64
|
onChange(rangePickerDates, ...antOnChangeParams);
|
|
59
65
|
// TODO : validate form with await form.validateFields(state.attribute.id)
|
|
60
|
-
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const datesToSave = { from: null, to: null };
|
|
66
|
+
let datesToSave = null;
|
|
64
67
|
if (rangePickerDates !== null) {
|
|
65
68
|
const [dateFrom, dateTo] = rangePickerDates;
|
|
66
|
-
datesToSave
|
|
67
|
-
datesToSave.to = String(dateTo.unix());
|
|
69
|
+
datesToSave = JSON.stringify({ from: dateFrom.unix(), to: dateTo.unix() });
|
|
68
70
|
}
|
|
69
|
-
handleSubmit(datesToSave,
|
|
71
|
+
await handleSubmit(datesToSave, attribute.id);
|
|
70
72
|
};
|
|
71
73
|
const _handleOpenChange = (open) => {
|
|
72
74
|
if (!open) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (state.isInheritedOverrideValue) {
|
|
78
|
-
return t('record_edition.inherited_input_helper', {
|
|
79
|
-
inheritedValue: t('record_edition.date_range_from_to', {
|
|
80
|
-
from: state.inheritedValue.value.from,
|
|
81
|
-
to: state.inheritedValue.value.to
|
|
82
|
-
})
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
else if (state.isCalculatedOverrideValue) {
|
|
86
|
-
return t('record_edition.calculated_input_helper', {
|
|
87
|
-
calculatedValue: t('record_edition.date_range_from_to', {
|
|
88
|
-
from: state.calculatedValue.value.from,
|
|
89
|
-
to: state.calculatedValue.value.to
|
|
90
|
-
})
|
|
91
|
-
});
|
|
75
|
+
setIsFocused(false);
|
|
76
|
+
if (!hasChangedRef.current && isNewValueOfMultivalues) {
|
|
77
|
+
removeLastValueOfMultivalues();
|
|
78
|
+
}
|
|
92
79
|
}
|
|
93
|
-
return;
|
|
94
80
|
};
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
, {
|
|
99
|
-
// @ts-expect-error - ref is not a valid prop for RangePicker but works at runtime
|
|
100
|
-
ref: inputRef, value: value, onChange: _handleDateChange, label: label, required: state.formElement.settings.required, disabled: state.isReadOnly, allowClear: !state.isInheritedNotOverrideValue && !state.isCalculatedNotOverrideValue, status: errors.length > 0 ? 'error' : undefined, onInfoClick: shouldShowValueDetailsButton ? onValueDetailsButtonClick : null, onOpenChange: _handleOpenChange, helper: _getHelper(), "$shouldHighlightColor": state.isInheritedNotOverrideValue || state.isCalculatedNotOverrideValue }));
|
|
81
|
+
const placeholderToDisplay = isFocused
|
|
82
|
+
? [t('record_edition.placeholder.start_date'), t('record_edition.placeholder.end_date')]
|
|
83
|
+
: [t('record_edition.placeholder.enter_a_period'), ''];
|
|
84
|
+
return (_jsx(KitDatePickerRangePickerStyled, { id: attribute.id, autoFocus: isFocused, open: attribute.multiple_values ? isFocused : undefined, value: value, format: !isFocused && !isErrors && !!presentationValue ? () => presentationValue : undefined, disabled: readonly, allowClear: !inheritedFlags.isInheritedNotOverrideValue && !calculatedFlags.isCalculatedNotOverrideValue, helper: isErrors ? String(errors[0]) : undefined, status: isErrors ? 'error' : undefined, onFocus: () => setIsFocused(true), onChange: _handleDateChange, onOpenChange: _handleOpenChange, placeholder: placeholderToDisplay, "$shouldUsePresentationLayout": usePresentationLayout }));
|
|
101
85
|
};
|
|
102
86
|
//# sourceMappingURL=DSRangePickerWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSRangePickerWrapper.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAoB,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DSRangePickerWrapper.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.tsx"],"names":[],"mappings":";A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,CAAC,uCAAuC,CAAC,EAAE,CAAC,CAAC,qCAAqC,CAAC,CAAC;QACxF,CAAC,CAAC,CAAC,CAAC,CAAC,2CAA2C,CAAC,EAAE,EAAE,CAAC,CAAC;IAE3D,OAAO,CACH,KAAC,8BAA8B,IAC3B,EAAE,EAAE,SAAS,CAAC,EAAE,EAChB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACvD,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,CAAC,SAAS,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,EAC5F,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,CAAC,cAAc,CAAC,2BAA2B,IAAI,CAAC,eAAe,CAAC,4BAA4B,EACxG,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAChD,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACtC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EACjC,QAAQ,EAAE,iBAAiB,EAC3B,YAAY,EAAE,iBAAiB,EAC/B,WAAW,EAAE,oBAAoB,kCACH,qBAAqB,GACrD,CACL,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { RecordFormAttributeFragment } from '../../../../../../_gqlTypes';
|
|
6
|
-
interface IDSRichTextWrapperProps extends IProvidedByAntFormItem<InputProps> {
|
|
7
|
-
state: IStandardFieldReducerState;
|
|
8
|
-
attribute: RecordFormAttributeFragment;
|
|
9
|
-
fieldValue: IStandardFieldValue;
|
|
10
|
-
handleSubmit: (value: string, id?: string) => void;
|
|
11
|
-
handleBlur: () => void;
|
|
12
|
-
shouldShowValueDetailsButton?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const DSRichTextWrapper: FunctionComponent<IDSRichTextWrapperProps>;
|
|
15
|
-
export {};
|
|
2
|
+
import { IStandFieldValueContentProps } from './_types';
|
|
3
|
+
import { KitRichTextProps } from 'aristid-ds/dist/Kit/DataEntry/RichText/types';
|
|
4
|
+
export declare const DSRichTextWrapper: FunctionComponent<IStandFieldValueContentProps<KitRichTextProps>>;
|
|
@@ -2,84 +2,61 @@ 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 {
|
|
5
|
+
import { useState } from 'react';
|
|
6
6
|
import { Form } from 'antd';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
|
-
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
9
|
-
import { useValueDetailsButton } from '../../../../../../components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton';
|
|
10
|
-
import { useLang } from '../../../../../../hooks';
|
|
11
|
-
import { localizedTranslation } from '@leav/utils';
|
|
12
7
|
import { KitRichText } from 'aristid-ds';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
`;
|
|
8
|
+
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
9
|
+
import { EMPTY_INITIAL_VALUE_STRING } from '../../../antdUtils';
|
|
16
10
|
const isEmptyValue = value => !value || value === '<p></p>';
|
|
17
|
-
export const DSRichTextWrapper = ({ value,
|
|
11
|
+
export const DSRichTextWrapper = ({ value, presentationValue, isLastValueOfMultivalues, removeLastValueOfMultivalues, onChange, attribute, readonly, handleSubmit, calculatedFlags, inheritedFlags }) => {
|
|
18
12
|
if (!onChange) {
|
|
19
13
|
throw Error('DSRichTextWrapper should be used inside a antd Form.Item');
|
|
20
14
|
}
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const { onValueDetailsButtonClick } = useValueDetailsButton({
|
|
24
|
-
value: fieldValue?.value,
|
|
25
|
-
attribute
|
|
26
|
-
});
|
|
15
|
+
const isNewValueOfMultivalues = isLastValueOfMultivalues && value === EMPTY_INITIAL_VALUE_STRING;
|
|
16
|
+
const focusedDefaultValue = attribute.multiple_values ? isNewValueOfMultivalues : false;
|
|
27
17
|
const [hasChanged, setHasChanged] = useState(false);
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, [fieldValue.isEditing]);
|
|
35
|
-
const _resetToInheritedOrCalculatedValue = () => {
|
|
18
|
+
const [isFocused, setIsFocused] = useState(focusedDefaultValue);
|
|
19
|
+
const { errors } = Form.Item.useStatus();
|
|
20
|
+
const { t } = useSharedTranslation();
|
|
21
|
+
const isErrors = errors.length > 0;
|
|
22
|
+
const valueToDisplay = isFocused || isErrors || !presentationValue ? value : presentationValue;
|
|
23
|
+
const _resetToInheritedOrCalculatedValue = async () => {
|
|
36
24
|
setHasChanged(false);
|
|
37
|
-
if (
|
|
38
|
-
onChange(
|
|
25
|
+
if (inheritedFlags.isInheritedValue) {
|
|
26
|
+
onChange(inheritedFlags.inheritedValue.raw_payload);
|
|
39
27
|
}
|
|
40
|
-
else if (
|
|
41
|
-
onChange(
|
|
28
|
+
else if (calculatedFlags.isCalculatedValue) {
|
|
29
|
+
onChange(calculatedFlags.calculatedValue.raw_payload);
|
|
42
30
|
}
|
|
43
|
-
handleSubmit(
|
|
31
|
+
await handleSubmit(null, attribute.id);
|
|
44
32
|
};
|
|
45
|
-
const
|
|
33
|
+
const _handleFocus = () => setIsFocused(true);
|
|
34
|
+
const _handleOnBlur = async (inputValue) => {
|
|
35
|
+
const valueToSubmit = isEmptyValue(inputValue) ? null : inputValue;
|
|
46
36
|
if (!hasChanged) {
|
|
47
|
-
|
|
37
|
+
onChange(valueToSubmit);
|
|
38
|
+
setIsFocused(false);
|
|
39
|
+
if (isNewValueOfMultivalues) {
|
|
40
|
+
removeLastValueOfMultivalues();
|
|
41
|
+
}
|
|
48
42
|
return;
|
|
49
43
|
}
|
|
50
|
-
|
|
51
|
-
if (valueToSubmit === '' && (state.isInheritedValue || state.isCalculatedValue)) {
|
|
44
|
+
if (valueToSubmit === null && (inheritedFlags.isInheritedValue || calculatedFlags.isCalculatedValue)) {
|
|
52
45
|
_resetToInheritedOrCalculatedValue();
|
|
53
46
|
return;
|
|
54
47
|
}
|
|
55
|
-
if (hasChanged || (!state.isInheritedValue && !state.isCalculatedValue)) {
|
|
56
|
-
handleSubmit(valueToSubmit, state.attribute.id);
|
|
57
|
-
}
|
|
58
48
|
onChange(valueToSubmit);
|
|
59
|
-
|
|
49
|
+
await handleSubmit(valueToSubmit, attribute.id);
|
|
50
|
+
setIsFocused(false);
|
|
60
51
|
};
|
|
61
52
|
const _handleOnChange = inputValue => {
|
|
62
53
|
setHasChanged(true);
|
|
63
|
-
if (
|
|
54
|
+
if (inheritedFlags.isInheritedValue && isEmptyValue(inputValue)) {
|
|
64
55
|
_resetToInheritedOrCalculatedValue();
|
|
65
56
|
return;
|
|
66
57
|
}
|
|
67
58
|
onChange(inputValue);
|
|
68
59
|
};
|
|
69
|
-
|
|
70
|
-
if (state.isInheritedOverrideValue) {
|
|
71
|
-
return t('record_edition.inherited_input_helper', {
|
|
72
|
-
inheritedValue: state.inheritedValue.raw_value
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
else if (state.isCalculatedOverrideValue) {
|
|
76
|
-
return t('record_edition.calculated_input_helper', {
|
|
77
|
-
calculatedValue: state.calculatedValue.raw_value
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return;
|
|
81
|
-
};
|
|
82
|
-
const label = localizedTranslation(state.formElement.settings.label, availableLang);
|
|
83
|
-
return (_jsx(KitRichTextStyled, { ref: inputRef, required: state.formElement.settings.required, label: label, onInfoClick: shouldShowValueDetailsButton ? onValueDetailsButtonClick : null, status: errors.length > 0 ? 'error' : undefined, helper: _getHelper(), value: value, disabled: state.isReadOnly, onChange: _handleOnChange, onBlur: _handleOnBlur, "$shouldHighlightColor": (!hasChanged && state.isInheritedNotOverrideValue) || state.isCalculatedNotOverrideValue }));
|
|
60
|
+
return (_jsx(KitRichText, { id: attribute.id, autoFocus: isFocused, helper: isErrors ? String(errors[0]) : undefined, status: isErrors ? 'error' : undefined, value: valueToDisplay, disabled: readonly, onChange: _handleOnChange, onFocus: _handleFocus, onBlur: _handleOnBlur, placeholder: t('record_edition.placeholder.enter_a_text') }));
|
|
84
61
|
};
|
|
85
62
|
//# sourceMappingURL=DSRichTextWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSRichTextWrapper.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,
|
|
1
|
+
{"version":3,"file":"DSRichTextWrapper.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,0BAA0B,EAAC,MAAM,oBAAoB,C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ACR,EAAE,EAAE,SAAS,CAAC,EAAE,EAChB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAChD,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACtC,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,CAAC,CAAC,yCAAyC,CAAC,GAC3D,CACL,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { AnyPrimitive } from '@leav/utils';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FormListFieldData } from 'antd';
|
|
3
|
+
import { ISubmitMultipleResult } from '../../../../../../components/RecordEdition/EditRecordContent/_types';
|
|
4
|
+
import { RecordFormAttributeStandardAttributeFragment } from '../../../../../../_gqlTypes';
|
|
5
|
+
import { CalculatedFlags, InheritedFlags } from '../calculatedInheritedFlags';
|
|
4
6
|
interface IStandardFieldValueProps {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
presentationValue: string;
|
|
8
|
+
handleSubmit: (value: AnyPrimitive | null) => Promise<void | ISubmitMultipleResult>;
|
|
9
|
+
attribute: RecordFormAttributeStandardAttributeFragment;
|
|
10
|
+
label: string;
|
|
11
|
+
required: boolean;
|
|
12
|
+
readonly: boolean;
|
|
13
|
+
calculatedFlags: CalculatedFlags;
|
|
14
|
+
inheritedFlags: InheritedFlags;
|
|
15
|
+
listField?: FormListFieldData;
|
|
16
|
+
removeLastValueOfMultivalues?: () => void;
|
|
17
|
+
isLastValueOfMultivalues?: boolean;
|
|
11
18
|
}
|
|
12
|
-
declare function StandardFieldValue({
|
|
19
|
+
declare function StandardFieldValue({ presentationValue, handleSubmit, attribute, label, required, readonly, calculatedFlags, inheritedFlags, listField, removeLastValueOfMultivalues, isLastValueOfMultivalues }: IStandardFieldValueProps): JSX.Element;
|
|
13
20
|
export default StandardFieldValue;
|