@leav/ui 0.3.6-7338b86 → 0.3.6-75eae8d
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 +1 -0
- package/dist/__mocks__/common/form.js +18 -2
- package/dist/__mocks__/common/form.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 +102 -4
- package/dist/_gqlTypes/index.js +83 -2
- 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 +8 -0
- package/dist/components/Explorer/DataView.js +33 -7
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +3 -3
- package/dist/components/Explorer/Explorer.js +42 -19
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/TableCell.d.ts +1 -1
- package/dist/components/Explorer/TableCell.js +116 -36
- package/dist/components/Explorer/TableCell.js.map +1 -1
- package/dist/components/Explorer/TableTagGroup.d.ts +1 -0
- package/dist/components/Explorer/TableTagGroup.js +9 -1
- package/dist/components/Explorer/TableTagGroup.js.map +1 -1
- package/dist/components/Explorer/_queries/useExplorerData.d.ts +22 -4
- package/dist/components/Explorer/_queries/useExplorerData.js +88 -4
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +23 -1
- 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/manage-view-settings/_shared/ColumnItem.d.ts +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js +11 -4
- package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js.map +1 -1
- 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/attributes/SelectVisibleAttributes.js +19 -52
- package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js.map +1 -1
- 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 +76 -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 +89 -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 +15 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js +114 -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 +4 -4
- package/dist/components/Explorer/manage-view-settings/index.js +3 -3
- package/dist/components/Explorer/manage-view-settings/index.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/SidePanel.js +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/SidePanel.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/open-view-settings/{useOpenSettings.js → useOpenViewSettings.js} +5 -3
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.d.ts +1 -1
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +5 -5
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.d.ts +4 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js +109 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.d.ts +10 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js +32 -0
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.d.ts +2 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +9 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.d.ts +111 -16
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +161 -24
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -1
- 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/EditRecordContent/EditRecordContent.js +15 -2
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +5 -16
- 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 +15 -8
- 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/StandardField.d.ts +4 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +94 -294
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js +8 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js +28 -22
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js +26 -18
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js +16 -13
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js +22 -19
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js +44 -42
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js +19 -19
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.d.ts +13 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +25 -402
- 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 → DSListSelect.d.ts} +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/{MonoValueSelect.js → DSListSelect.js} +32 -13
- 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 +0 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.d.ts +10 -4
- 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/reducers/standardFieldReducer → hooks/useDebouncedValue}/index.js +1 -2
- package/dist/hooks/useDebouncedValue/index.js.map +1 -0
- package/dist/locales/en/shared.json +34 -6
- package/dist/locales/fr/shared.json +34 -6
- package/package.json +5 -2
- package/dist/components/Explorer/manage-view-settings/_shared/useGetLibraryColumns.d.ts +0 -10
- package/dist/components/Explorer/manage-view-settings/_shared/useGetLibraryColumns.js +0 -24
- package/dist/components/Explorer/manage-view-settings/_shared/useGetLibraryColumns.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenSettings.d.ts +0 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenSettings.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.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/ValuesList/MonoValueSelect.js.map +0 -1
|
@@ -1,47 +1,60 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
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 { KitDatePicker
|
|
6
|
-
import { useState } from 'react';
|
|
5
|
+
import { KitDatePicker } from 'aristid-ds';
|
|
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
10
|
import { setDateToUTCNoon } from '../../../../../../_utils';
|
|
11
|
-
import { FaCalendar } from 'react-icons/fa';
|
|
12
11
|
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
12
|
+
import { EMPTY_INITIAL_VALUE_UNDEFINED } from '../../../antdUtils';
|
|
13
13
|
const KitDatePickerRangePickerStyled = styled(KitDatePicker.RangePicker) `
|
|
14
|
-
|
|
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
|
+
`}
|
|
15
24
|
`;
|
|
16
|
-
const
|
|
17
|
-
color: ${({ $shouldHighlightColor }) => ($shouldHighlightColor ? 'var(--general-colors-primary-400)' : 'initial')};
|
|
18
|
-
`;
|
|
19
|
-
export const DSRangePickerWrapper = ({ presentationValue, value, onChange, state, attribute, handleSubmit }) => {
|
|
25
|
+
export const DSRangePickerWrapper = ({ value, presentationValue, isLastValueOfMultivalues, removeLastValueOfMultivalues, onChange, attribute, handleSubmit, readonly, calculatedFlags, inheritedFlags }) => {
|
|
20
26
|
if (!onChange) {
|
|
21
27
|
throw Error('DSRangePickerWrapper should be used inside a antd Form.Item');
|
|
22
28
|
}
|
|
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
34
|
const { t } = useSharedTranslation();
|
|
26
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]);
|
|
27
39
|
const _resetToInheritedOrCalculatedValue = async () => {
|
|
28
|
-
|
|
40
|
+
hasChangedRef.current = false;
|
|
41
|
+
if (inheritedFlags.isInheritedValue) {
|
|
29
42
|
onChange([
|
|
30
|
-
dayjs.unix(Number(
|
|
31
|
-
dayjs.unix(Number(
|
|
32
|
-
],
|
|
43
|
+
dayjs.unix(Number(inheritedFlags.inheritedValue.raw_payload.from)),
|
|
44
|
+
dayjs.unix(Number(inheritedFlags.inheritedValue.raw_payload.to))
|
|
45
|
+
], inheritedFlags.inheritedValue.raw_payload);
|
|
33
46
|
}
|
|
34
|
-
else if (
|
|
47
|
+
else if (calculatedFlags.isCalculatedValue) {
|
|
35
48
|
onChange([
|
|
36
|
-
dayjs.unix(Number(
|
|
37
|
-
dayjs.unix(Number(
|
|
38
|
-
],
|
|
49
|
+
dayjs.unix(Number(calculatedFlags.calculatedValue.raw_payload.from)),
|
|
50
|
+
dayjs.unix(Number(calculatedFlags.calculatedValue.raw_payload.to))
|
|
51
|
+
], calculatedFlags.calculatedValue.raw_payload);
|
|
39
52
|
}
|
|
40
|
-
await handleSubmit(null,
|
|
53
|
+
await handleSubmit(null, attribute.id);
|
|
41
54
|
};
|
|
42
|
-
const _handleFocus = () => setIsFocused(true);
|
|
43
55
|
const _handleDateChange = async (rangePickerDates, ...antOnChangeParams) => {
|
|
44
|
-
|
|
56
|
+
hasChangedRef.current = true;
|
|
57
|
+
if ((inheritedFlags.isInheritedValue || calculatedFlags.isCalculatedValue) && rangePickerDates === null) {
|
|
45
58
|
_resetToInheritedOrCalculatedValue();
|
|
46
59
|
return;
|
|
47
60
|
}
|
|
@@ -50,35 +63,24 @@ export const DSRangePickerWrapper = ({ presentationValue, value, onChange, state
|
|
|
50
63
|
}
|
|
51
64
|
onChange(rangePickerDates, ...antOnChangeParams);
|
|
52
65
|
// TODO : validate form with await form.validateFields(state.attribute.id)
|
|
53
|
-
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
let datesToSave = '';
|
|
66
|
+
let datesToSave = null;
|
|
57
67
|
if (rangePickerDates !== null) {
|
|
58
68
|
const [dateFrom, dateTo] = rangePickerDates;
|
|
59
|
-
datesToSave = { from:
|
|
69
|
+
datesToSave = JSON.stringify({ from: dateFrom.unix(), to: dateTo.unix() });
|
|
60
70
|
}
|
|
61
|
-
await handleSubmit(datesToSave,
|
|
71
|
+
await handleSubmit(datesToSave, attribute.id);
|
|
62
72
|
};
|
|
63
73
|
const _handleOpenChange = (open) => {
|
|
64
74
|
if (!open) {
|
|
65
75
|
setIsFocused(false);
|
|
76
|
+
if (!hasChangedRef.current && isNewValueOfMultivalues) {
|
|
77
|
+
removeLastValueOfMultivalues();
|
|
78
|
+
}
|
|
66
79
|
}
|
|
67
80
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
_resetToInheritedOrCalculatedValue();
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
onChange(null, null);
|
|
76
|
-
if (inputValue === '' && event.type === 'click') {
|
|
77
|
-
await handleSubmit('', state.attribute.id);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
return (_jsxs(_Fragment, { children: [!isFocused && !isErrors && (_jsx(KitInputStyled, { prefix: _jsx(FaCalendar, {}), helper: isErrors ? String(errors[0]) : undefined, status: isErrors ? 'error' : undefined, value: presentationValue, onFocus: _handleFocus, onChange: _handleClear, "$shouldHighlightColor": state.isInheritedNotOverrideValue || state.isCalculatedNotOverrideValue, placeholder: t('record_edition.placeholder.enter_a_period') }))
|
|
81
|
-
//TODO: Léger décalage car l'icon n'est pas exactement le même que celui du DS (MAJ React-icons ?)
|
|
82
|
-
, (isFocused || isErrors) && (_jsx(KitDatePickerRangePickerStyled, { open: true, autoFocus: true, value: value, disabled: state.isReadOnly, allowClear: !state.isInheritedNotOverrideValue && !state.isCalculatedNotOverrideValue, helper: isErrors ? String(errors[0]) : undefined, status: isErrors ? 'error' : undefined, onChange: _handleDateChange, onOpenChange: _handleOpenChange, "$shouldHighlightColor": state.isInheritedNotOverrideValue || state.isCalculatedNotOverrideValue, placeholder: [t('record_edition.placeholder.start_date'), t('record_edition.placeholder.end_date')] }))] }));
|
|
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 }));
|
|
83
85
|
};
|
|
84
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,
|
|
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,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACrE,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAG5C,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,6BAA6B,EAAC,MAAM,oBAAoB,CAAC;AAEjE,MAAM,8BAA8B,GAAG,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,CAEtE;MACI,CAAC,EAAC,4BAA4B,EAAC,EAAE,EAAE,CACjC,4BAA4B;IAC5B;;;;;;;;SAQC;CACR,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAqE,CAAC,EACnG,KAAK,EACL,iBAAiB,EACjB,wBAAwB,EACxB,4BAA4B,EAC5B,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,cAAc,EACjB,EAAE,EAAE;IACD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,KAAK,CAAC,6DAA6D,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,uBAAuB,GAAG,wBAAwB,IAAI,KAAK,KAAK,6BAA6B,CAAC;IACpG,MAAM,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-4,59 +4,59 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import { Form } from 'antd';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
7
|
import { KitRichText } from 'aristid-ds';
|
|
9
8
|
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
10
|
-
|
|
11
|
-
.tiptap.ProseMirror {
|
|
12
|
-
color: ${({ $shouldHighlightColor }) => $shouldHighlightColor ? 'var(--general-colors-primary-400)' : 'initial'};
|
|
13
|
-
}
|
|
14
|
-
`;
|
|
9
|
+
import { EMPTY_INITIAL_VALUE_STRING } from '../../../antdUtils';
|
|
15
10
|
const isEmptyValue = value => !value || value === '<p></p>';
|
|
16
|
-
export const DSRichTextWrapper = ({ value, presentationValue,
|
|
11
|
+
export const DSRichTextWrapper = ({ value, presentationValue, isLastValueOfMultivalues, removeLastValueOfMultivalues, onChange, attribute, readonly, handleSubmit, calculatedFlags, inheritedFlags }) => {
|
|
17
12
|
if (!onChange) {
|
|
18
13
|
throw Error('DSRichTextWrapper should be used inside a antd Form.Item');
|
|
19
14
|
}
|
|
15
|
+
const isNewValueOfMultivalues = isLastValueOfMultivalues && value === EMPTY_INITIAL_VALUE_STRING;
|
|
16
|
+
const focusedDefaultValue = attribute.multiple_values ? isNewValueOfMultivalues : false;
|
|
20
17
|
const [hasChanged, setHasChanged] = useState(false);
|
|
21
|
-
const [isFocused, setIsFocused] = useState(
|
|
18
|
+
const [isFocused, setIsFocused] = useState(focusedDefaultValue);
|
|
22
19
|
const { errors } = Form.Item.useStatus();
|
|
23
20
|
const { t } = useSharedTranslation();
|
|
24
21
|
const isErrors = errors.length > 0;
|
|
25
|
-
const valueToDisplay = isFocused || isErrors ? value : presentationValue;
|
|
22
|
+
const valueToDisplay = isFocused || isErrors || !presentationValue ? value : presentationValue;
|
|
26
23
|
const _resetToInheritedOrCalculatedValue = async () => {
|
|
27
24
|
setHasChanged(false);
|
|
28
|
-
if (
|
|
29
|
-
onChange(
|
|
25
|
+
if (inheritedFlags.isInheritedValue) {
|
|
26
|
+
onChange(inheritedFlags.inheritedValue.raw_payload);
|
|
30
27
|
}
|
|
31
|
-
else if (
|
|
32
|
-
onChange(
|
|
28
|
+
else if (calculatedFlags.isCalculatedValue) {
|
|
29
|
+
onChange(calculatedFlags.calculatedValue.raw_payload);
|
|
33
30
|
}
|
|
34
|
-
await handleSubmit(null,
|
|
31
|
+
await handleSubmit(null, attribute.id);
|
|
35
32
|
};
|
|
36
33
|
const _handleFocus = () => setIsFocused(true);
|
|
37
34
|
const _handleOnBlur = async (inputValue) => {
|
|
38
|
-
const valueToSubmit = isEmptyValue(inputValue) ?
|
|
35
|
+
const valueToSubmit = isEmptyValue(inputValue) ? null : inputValue;
|
|
39
36
|
if (!hasChanged) {
|
|
40
37
|
onChange(valueToSubmit);
|
|
41
38
|
setIsFocused(false);
|
|
39
|
+
if (isNewValueOfMultivalues) {
|
|
40
|
+
removeLastValueOfMultivalues();
|
|
41
|
+
}
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
if (valueToSubmit ===
|
|
44
|
+
if (valueToSubmit === null && (inheritedFlags.isInheritedValue || calculatedFlags.isCalculatedValue)) {
|
|
45
45
|
_resetToInheritedOrCalculatedValue();
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
onChange(valueToSubmit);
|
|
49
|
+
await handleSubmit(valueToSubmit, attribute.id);
|
|
49
50
|
setIsFocused(false);
|
|
50
|
-
await handleSubmit(valueToSubmit, state.attribute.id);
|
|
51
51
|
};
|
|
52
52
|
const _handleOnChange = inputValue => {
|
|
53
53
|
setHasChanged(true);
|
|
54
|
-
if (
|
|
54
|
+
if (inheritedFlags.isInheritedValue && isEmptyValue(inputValue)) {
|
|
55
55
|
_resetToInheritedOrCalculatedValue();
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
onChange(inputValue);
|
|
59
59
|
};
|
|
60
|
-
return (_jsx(
|
|
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') }));
|
|
61
61
|
};
|
|
62
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,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC1B,OAAO,
|
|
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,CAAC;AAE9D,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,SAAS,CAAC;AAE5D,MAAM,CAAC,MAAM,iBAAiB,GAAsE,CAAC,EACjG,KAAK,EACL,iBAAiB,EACjB,wBAA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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,16 +1,20 @@
|
|
|
1
1
|
import { AnyPrimitive } from '@leav/utils';
|
|
2
2
|
import { FormListFieldData } from 'antd';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ISubmitMultipleResult } from '../../../../../../components/RecordEdition/EditRecordContent/_types';
|
|
4
|
+
import { RecordFormAttributeStandardAttributeFragment } from '../../../../../../_gqlTypes';
|
|
5
|
+
import { CalculatedFlags, InheritedFlags } from '../calculatedInheritedFlags';
|
|
5
6
|
interface IStandardFieldValueProps {
|
|
6
|
-
value: IStandardFieldValue;
|
|
7
7
|
presentationValue: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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;
|
|
13
15
|
listField?: FormListFieldData;
|
|
16
|
+
removeLastValueOfMultivalues?: () => void;
|
|
17
|
+
isLastValueOfMultivalues?: boolean;
|
|
14
18
|
}
|
|
15
|
-
declare function StandardFieldValue({
|
|
19
|
+
declare function StandardFieldValue({ presentationValue, handleSubmit, attribute, label, required, readonly, calculatedFlags, inheritedFlags, listField, removeLastValueOfMultivalues, isLastValueOfMultivalues }: IStandardFieldValueProps): JSX.Element;
|
|
16
20
|
export default StandardFieldValue;
|