@leav/ui 0.3.6-806e07e → 0.3.6-807b6b5

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.
Files changed (361) hide show
  1. package/dist/__mocks__/common/attribute.d.ts +1 -0
  2. package/dist/__mocks__/common/attribute.js +9 -1
  3. package/dist/__mocks__/common/attribute.js.map +1 -1
  4. package/dist/__mocks__/common/form.d.ts +1 -0
  5. package/dist/__mocks__/common/form.js +18 -2
  6. package/dist/__mocks__/common/form.js.map +1 -1
  7. package/dist/__mocks__/common/value.js +3 -1
  8. package/dist/__mocks__/common/value.js.map +1 -1
  9. package/dist/__mocks__/common/view.js +7 -5
  10. package/dist/__mocks__/common/view.js.map +1 -1
  11. package/dist/__mocks__/mockQuery/mockGetLibraryDetailExtendedQuery.js +1 -1
  12. package/dist/__mocks__/mockQuery/mockGetLibraryDetailExtendedQuery.js.map +1 -1
  13. package/dist/__mocks__/mockQuery/mockGetViewListQuery.js +2 -1
  14. package/dist/__mocks__/mockQuery/mockGetViewListQuery.js.map +1 -1
  15. package/dist/_gqlTypes/index.d.ts +418 -72
  16. package/dist/_gqlTypes/index.js +248 -49
  17. package/dist/_gqlTypes/index.js.map +1 -1
  18. package/dist/_queries/libraries/getLibraryDetailExtendQuery.d.ts +3 -4
  19. package/dist/_queries/libraries/getLibraryDetailExtendQuery.js +2 -3
  20. package/dist/_queries/libraries/getLibraryDetailExtendQuery.js.map +1 -1
  21. package/dist/_queries/records/getRecordColumnsValues.d.ts +5 -3
  22. package/dist/_queries/records/getRecordColumnsValues.js +4 -1
  23. package/dist/_queries/records/getRecordColumnsValues.js.map +1 -1
  24. package/dist/_queries/records/getRecordsFromLibraryQuery.js +1 -0
  25. package/dist/_queries/records/getRecordsFromLibraryQuery.js.map +1 -1
  26. package/dist/_queries/records/recordFormAttributeFragment.js +2 -0
  27. package/dist/_queries/records/recordFormAttributeFragment.js.map +1 -1
  28. package/dist/_queries/views/saveViewMutation.js +1 -1
  29. package/dist/_queries/views/viewDetailsFragment.js +14 -11
  30. package/dist/_queries/views/viewDetailsFragment.js.map +1 -1
  31. package/dist/_utils/index.js +5 -2
  32. package/dist/_utils/index.js.map +1 -1
  33. package/dist/_utils/interleaveElement.d.ts +1 -0
  34. package/dist/_utils/interleaveElement.js +5 -0
  35. package/dist/_utils/interleaveElement.js.map +1 -0
  36. package/dist/antdTheme/index.d.ts +0 -3
  37. package/dist/antdTheme/index.js +3 -42
  38. package/dist/antdTheme/index.js.map +1 -1
  39. package/dist/components/CreateDirectory/CreateDirectory.js +1 -1
  40. package/dist/components/CreateDirectory/CreateDirectory.js.map +1 -1
  41. package/dist/components/Explorer/DataView.d.ts +13 -0
  42. package/dist/components/Explorer/DataView.js +92 -19
  43. package/dist/components/Explorer/DataView.js.map +1 -1
  44. package/dist/components/Explorer/Explorer.d.ts +9 -6
  45. package/dist/components/Explorer/Explorer.js +80 -20
  46. package/dist/components/Explorer/Explorer.js.map +1 -1
  47. package/dist/components/Explorer/ExplorerTitle.d.ts +2 -0
  48. package/dist/components/Explorer/ExplorerTitle.js +28 -11
  49. package/dist/components/Explorer/ExplorerTitle.js.map +1 -1
  50. package/dist/components/Explorer/ExplorerToolbar.d.ts +5 -0
  51. package/dist/components/Explorer/ExplorerToolbar.js +45 -0
  52. package/dist/components/Explorer/ExplorerToolbar.js.map +1 -0
  53. package/dist/components/Explorer/TableCell.d.ts +1 -1
  54. package/dist/components/Explorer/TableCell.js +50 -8
  55. package/dist/components/Explorer/TableCell.js.map +1 -1
  56. package/dist/components/Explorer/TableTagGroup.d.ts +1 -0
  57. package/dist/components/Explorer/TableTagGroup.js +8 -0
  58. package/dist/components/Explorer/TableTagGroup.js.map +1 -1
  59. package/dist/components/Explorer/_constants.d.ts +5 -0
  60. package/dist/components/Explorer/_constants.js +18 -0
  61. package/dist/components/Explorer/_constants.js.map +1 -0
  62. package/dist/components/Explorer/_queries/prepareFiltersForRequest.d.ts +4 -0
  63. package/dist/components/Explorer/_queries/prepareFiltersForRequest.js +95 -0
  64. package/dist/components/Explorer/_queries/prepareFiltersForRequest.js.map +1 -0
  65. package/dist/components/Explorer/_queries/useExplorerData.d.ts +22 -6
  66. package/dist/components/Explorer/_queries/useExplorerData.js +73 -11
  67. package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
  68. package/dist/components/Explorer/_types.d.ts +54 -1
  69. package/dist/components/Explorer/conditionsHelper.d.ts +2 -0
  70. package/dist/components/Explorer/conditionsHelper.js +16 -0
  71. package/dist/components/Explorer/conditionsHelper.js.map +1 -0
  72. package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.d.ts +1 -1
  73. package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js +11 -3
  74. package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js.map +1 -1
  75. package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.d.ts +6 -0
  76. package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js +12 -0
  77. package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js.map +1 -0
  78. package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.d.ts +3 -1
  79. package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.js +9 -3
  80. package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.js.map +1 -1
  81. package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js +11 -13
  82. package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js.map +1 -1
  83. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.d.ts +4 -0
  84. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +83 -0
  85. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -0
  86. package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.d.ts +9 -0
  87. package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js +33 -0
  88. package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js.map +1 -0
  89. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.d.ts +3 -0
  90. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.js +22 -0
  91. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.js.map +1 -0
  92. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ColorAttributeDropDown.d.ts +3 -0
  93. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ColorAttributeDropDown.js +11 -0
  94. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ColorAttributeDropDown.js.map +1 -0
  95. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.d.ts +3 -0
  96. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js +66 -0
  97. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js.map +1 -0
  98. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateRangeAttributeDropDown.d.ts +3 -0
  99. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateRangeAttributeDropDown.js +11 -0
  100. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateRangeAttributeDropDown.js.map +1 -0
  101. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/EncryptedAttributeDropDown.d.ts +3 -0
  102. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/EncryptedAttributeDropDown.js +11 -0
  103. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/EncryptedAttributeDropDown.js.map +1 -0
  104. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ExtendedAttributeDropDown.d.ts +3 -0
  105. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ExtendedAttributeDropDown.js +11 -0
  106. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ExtendedAttributeDropDown.js.map +1 -0
  107. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.d.ts +3 -0
  108. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js +71 -0
  109. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js.map +1 -0
  110. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueList.d.ts +10 -0
  111. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueList.js +75 -0
  112. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueList.js.map +1 -0
  113. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.d.ts +3 -0
  114. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.js +19 -0
  115. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.js.map +1 -0
  116. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.d.ts +3 -0
  117. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.js +28 -0
  118. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.js.map +1 -0
  119. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.d.ts +11 -0
  120. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js +100 -0
  121. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js.map +1 -0
  122. package/dist/components/Explorer/manage-view-settings/index.d.ts +3 -3
  123. package/dist/components/Explorer/manage-view-settings/index.js +2 -2
  124. package/dist/components/Explorer/manage-view-settings/index.js.map +1 -1
  125. package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContext.d.ts +1 -0
  126. package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContext.js.map +1 -1
  127. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.d.ts +2 -0
  128. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js +24 -6
  129. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -1
  130. package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.d.ts +2 -1
  131. package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +47 -29
  132. package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -1
  133. package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js +25 -21
  134. package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js.map +1 -1
  135. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.d.ts +2 -0
  136. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +20 -1
  137. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js.map +1 -1
  138. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.d.ts +85 -5
  139. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +122 -4
  140. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -1
  141. package/dist/components/Explorer/useColumnWidth.d.ts +6 -0
  142. package/dist/components/Explorer/useColumnWidth.js +48 -0
  143. package/dist/components/Explorer/useColumnWidth.js.map +1 -0
  144. package/dist/components/Explorer/useCreateAction.d.ts +4 -2
  145. package/dist/components/Explorer/useCreateAction.js +35 -2
  146. package/dist/components/Explorer/useCreateAction.js.map +1 -1
  147. package/dist/components/Explorer/useDeactivateMassAction.d.ts +27 -0
  148. package/dist/components/Explorer/useDeactivateMassAction.js +71 -0
  149. package/dist/components/Explorer/useDeactivateMassAction.js.map +1 -0
  150. package/dist/components/Explorer/useEditAction.js +8 -6
  151. package/dist/components/Explorer/useEditAction.js.map +1 -1
  152. package/dist/components/Explorer/useMassActions.d.ts +27 -0
  153. package/dist/components/Explorer/useMassActions.js +109 -0
  154. package/dist/components/Explorer/useMassActions.js.map +1 -0
  155. package/dist/components/Explorer/usePagination.d.ts +7 -0
  156. package/dist/components/Explorer/usePagination.js +25 -0
  157. package/dist/components/Explorer/usePagination.js.map +1 -0
  158. package/dist/components/Explorer/usePrimaryActions.js +14 -7
  159. package/dist/components/Explorer/usePrimaryActions.js.map +1 -1
  160. package/dist/components/Explorer/useRemoveAction.d.ts +23 -0
  161. package/dist/components/Explorer/useRemoveAction.js +109 -0
  162. package/dist/components/Explorer/useRemoveAction.js.map +1 -0
  163. package/dist/components/Explorer/useSearchInput.d.ts +16 -0
  164. package/dist/components/Explorer/useSearchInput.js +39 -0
  165. package/dist/components/Explorer/useSearchInput.js.map +1 -0
  166. package/dist/components/Explorer/useTableScrollableHeight.d.ts +5 -0
  167. package/dist/components/Explorer/useTableScrollableHeight.js +15 -0
  168. package/dist/components/Explorer/useTableScrollableHeight.js.map +1 -0
  169. package/dist/components/Explorer/useViewSettingsReducer.d.ts +8 -0
  170. package/dist/components/Explorer/useViewSettingsReducer.js +126 -0
  171. package/dist/components/Explorer/useViewSettingsReducer.js.map +1 -0
  172. package/dist/components/ExportModal/ExportModal.js +2 -2
  173. package/dist/components/ExportModal/ExportModal.js.map +1 -1
  174. package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js +2 -2
  175. package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js.map +1 -1
  176. package/dist/components/LibraryItemsList/LibraryItemsListContent/LibraryItemsListContent.js +7 -11
  177. package/dist/components/LibraryItemsList/LibraryItemsListContent/LibraryItemsListContent.js.map +1 -1
  178. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/StandardCell.js +7 -2
  179. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/StandardCell.js.map +1 -1
  180. package/dist/components/LibraryItemsList/LibraryItemsListTable/Header/Header.js +7 -5
  181. package/dist/components/LibraryItemsList/LibraryItemsListTable/Header/Header.js.map +1 -1
  182. package/dist/components/LibraryItemsList/MenuView/MenuView.js +4 -9
  183. package/dist/components/LibraryItemsList/MenuView/MenuView.js.map +1 -1
  184. package/dist/components/LibraryItemsList/ViewPanel/EditView/EditView.js +2 -3
  185. package/dist/components/LibraryItemsList/ViewPanel/EditView/EditView.js.map +1 -1
  186. package/dist/components/LibraryItemsList/ViewPanel/View/View.js +3 -3
  187. package/dist/components/LibraryItemsList/ViewPanel/View/View.js.map +1 -1
  188. package/dist/components/LibraryItemsList/helpers/getFieldsFromView.js +4 -9
  189. package/dist/components/LibraryItemsList/helpers/getFieldsFromView.js.map +1 -1
  190. package/dist/components/LibraryItemsList/hooks/useLibraryView/useLibraryView.js +7 -5
  191. package/dist/components/LibraryItemsList/hooks/useLibraryView/useLibraryView.js.map +1 -1
  192. package/dist/components/LibraryItemsList/hooks/useSearchReducer/_types.d.ts +1 -1
  193. package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.d.ts +1 -1
  194. package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.js +25 -33
  195. package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.js.map +1 -1
  196. package/dist/components/RecordEdition/EditRecord/EditRecord.d.ts +1 -0
  197. package/dist/components/RecordEdition/EditRecord/EditRecord.js +9 -17
  198. package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
  199. package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +17 -4
  200. package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
  201. package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +6 -17
  202. package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
  203. package/dist/components/RecordEdition/EditRecordContent/antdUtils.d.ts +5 -1
  204. package/dist/components/RecordEdition/EditRecordContent/antdUtils.js +15 -8
  205. package/dist/components/RecordEdition/EditRecordContent/antdUtils.js.map +1 -1
  206. package/dist/components/RecordEdition/EditRecordContent/helpers/extractFormElements/extractFormElements.d.ts +3 -1
  207. package/dist/components/RecordEdition/EditRecordContent/helpers/extractFormElements/extractFormElements.js +8 -2
  208. package/dist/components/RecordEdition/EditRecordContent/helpers/extractFormElements/extractFormElements.js.map +1 -1
  209. package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.d.ts +3 -1
  210. package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js +2 -2
  211. package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js.map +1 -1
  212. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +2 -2
  213. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
  214. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.d.ts +0 -1
  215. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.js +2 -7
  216. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.js.map +1 -1
  217. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.d.ts +0 -1
  218. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.js +2 -9
  219. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.js.map +1 -1
  220. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.d.ts +6 -0
  221. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.js +16 -0
  222. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.js.map +1 -0
  223. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.d.ts +4 -2
  224. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +126 -290
  225. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
  226. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js +9 -9
  227. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js.map +1 -1
  228. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js +63 -22
  229. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js.map +1 -1
  230. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js +30 -18
  231. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js.map +1 -1
  232. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js +5 -2
  233. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js.map +1 -1
  234. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js +20 -14
  235. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js.map +1 -1
  236. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js +26 -19
  237. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js.map +1 -1
  238. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js +47 -41
  239. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js.map +1 -1
  240. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js +23 -20
  241. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js.map +1 -1
  242. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.d.ts +14 -9
  243. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +26 -402
  244. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js.map +1 -1
  245. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/{MonoValueSelect.d.ts → DSListSelect.d.ts} +1 -1
  246. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/{MonoValueSelect.js → DSListSelect.js} +35 -13
  247. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js.map +1 -0
  248. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/_types.d.ts +0 -2
  249. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.d.ts +11 -4
  250. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.d.ts +42 -0
  251. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js +55 -0
  252. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js.map +1 -0
  253. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.d.ts +12 -0
  254. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js +32 -0
  255. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js.map +1 -0
  256. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/ValuesAdd.js +2 -2
  257. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/ValuesAdd.js.map +1 -1
  258. package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +10 -4
  259. package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
  260. package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.d.ts +2 -0
  261. package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js +2 -2
  262. package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js.map +1 -1
  263. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.d.ts +4 -1
  264. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +36 -3
  265. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js.map +1 -1
  266. package/dist/components/RecordEdition/EditRecordSidebar/PropertiesList/PropertiesList.d.ts +4 -7
  267. package/dist/components/RecordEdition/EditRecordSidebar/PropertiesList/PropertiesList.js +6 -8
  268. package/dist/components/RecordEdition/EditRecordSidebar/PropertiesList/PropertiesList.js.map +1 -1
  269. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.d.ts +9 -0
  270. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js +42 -0
  271. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js.map +1 -0
  272. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.d.ts +6 -0
  273. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.js +35 -0
  274. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.js.map +1 -0
  275. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.d.ts +2 -281
  276. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js +25 -56
  277. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js.map +1 -1
  278. package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueDetails.js +1 -13
  279. package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueDetails.js.map +1 -1
  280. package/dist/components/RecordEdition/{EditRecordContent → EditRecordSkeleton}/EditRecordSkeleton.d.ts +1 -1
  281. package/dist/components/RecordEdition/{EditRecordContent → EditRecordSkeleton}/EditRecordSkeleton.js +2 -2
  282. package/dist/components/RecordEdition/EditRecordSkeleton/EditRecordSkeleton.js.map +1 -0
  283. package/dist/components/RecordEdition/EditRecordSkeleton/index.d.ts +2 -0
  284. package/dist/components/RecordEdition/{EditRecordContent/reducers/standardFieldReducer → EditRecordSkeleton}/index.js +2 -2
  285. package/dist/components/RecordEdition/EditRecordSkeleton/index.js.map +1 -0
  286. package/dist/components/RecordEdition/index.d.ts +1 -0
  287. package/dist/components/RecordEdition/index.js +1 -0
  288. package/dist/components/RecordEdition/index.js.map +1 -1
  289. package/dist/components/SelectTreeNode/SelectTreeNode.d.ts +4 -7
  290. package/dist/components/SelectTreeNode/SelectTreeNode.js +17 -135
  291. package/dist/components/SelectTreeNode/SelectTreeNode.js.map +1 -1
  292. package/dist/components/SelectTreeNode/SelectTreeNodeContent.d.ts +16 -0
  293. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +131 -0
  294. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -0
  295. package/dist/components/SelectTreeNode/index.d.ts +1 -1
  296. package/dist/components/SelectTreeNode/index.js +1 -1
  297. package/dist/components/SelectTreeNode/index.js.map +1 -1
  298. package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.d.ts +4 -7
  299. package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.js +10 -10
  300. package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.js.map +1 -1
  301. package/dist/components/SelectTreeNodeModal/index.d.ts +1 -2
  302. package/dist/components/SelectTreeNodeModal/index.js +1 -2
  303. package/dist/components/SelectTreeNodeModal/index.js.map +1 -1
  304. package/dist/components/UploadFiles/UploadFiles.js +1 -1
  305. package/dist/components/UploadFiles/UploadFiles.js.map +1 -1
  306. package/dist/components/ValuesVersionConfigurator/VersionTree/VersionTree.js +2 -2
  307. package/dist/components/ValuesVersionConfigurator/VersionTree/VersionTree.js.map +1 -1
  308. package/dist/constants.d.ts +3 -0
  309. package/dist/constants.js +3 -0
  310. package/dist/constants.js.map +1 -1
  311. package/dist/hooks/useExecuteSaveViewMutation/index.d.ts +1 -0
  312. package/dist/{components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.js → hooks/useExecuteSaveViewMutation/index.js} +2 -6
  313. package/dist/hooks/useExecuteSaveViewMutation/index.js.map +1 -0
  314. package/dist/hooks/useExecuteSaveViewMutation/useExecuteSaveViewMutation.d.ts +6 -0
  315. package/dist/hooks/{useExecuteAddViewMutation/useExecuteAddViewMutation.js → useExecuteSaveViewMutation/useExecuteSaveViewMutation.js} +6 -6
  316. package/dist/hooks/useExecuteSaveViewMutation/useExecuteSaveViewMutation.js.map +1 -0
  317. package/dist/locales/en/shared.json +55 -7
  318. package/dist/locales/fr/shared.json +57 -9
  319. package/dist/types/views.d.ts +4 -4
  320. package/package.json +5 -2
  321. package/dist/components/Explorer/useDeactivateAction.d.ts +0 -12
  322. package/dist/components/Explorer/useDeactivateAction.js +0 -51
  323. package/dist/components/Explorer/useDeactivateAction.js.map +0 -1
  324. package/dist/components/RecordEdition/EditRecordContent/EditRecordSkeleton.js.map +0 -1
  325. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/index.d.ts +0 -2
  326. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/index.js.map +0 -1
  327. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer.d.ts +0 -138
  328. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer.js +0 -361
  329. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer.js.map +0 -1
  330. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.d.ts +0 -7
  331. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.js.map +0 -1
  332. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.d.ts +0 -1
  333. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.js +0 -7
  334. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.js.map +0 -1
  335. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton.d.ts +0 -8
  336. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton.js +0 -23
  337. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton.js.map +0 -1
  338. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/CheckboxInput.d.ts +0 -3
  339. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/CheckboxInput.js +0 -14
  340. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/CheckboxInput.js.map +0 -1
  341. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/ColorInput.d.ts +0 -3
  342. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/ColorInput.js +0 -22
  343. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/ColorInput.js.map +0 -1
  344. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/DateInput.d.ts +0 -3
  345. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/DateInput.js +0 -22
  346. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/DateInput.js.map +0 -1
  347. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/EncryptedInput.d.ts +0 -3
  348. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/EncryptedInput.js +0 -19
  349. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/EncryptedInput.js.map +0 -1
  350. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/NumberInput.d.ts +0 -3
  351. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/NumberInput.js +0 -32
  352. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/NumberInput.js.map +0 -1
  353. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/RichTextEditorInput.d.ts +0 -3
  354. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/RichTextEditorInput.js +0 -51
  355. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/RichTextEditorInput.js.map +0 -1
  356. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/TextInput.d.ts +0 -3
  357. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/TextInput.js +0 -26
  358. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/TextInput.js.map +0 -1
  359. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.js.map +0 -1
  360. package/dist/hooks/useExecuteAddViewMutation/useExecuteAddViewMutation.d.ts +0 -6
  361. package/dist/hooks/useExecuteAddViewMutation/useExecuteAddViewMutation.js.map +0 -1
@@ -15,7 +15,6 @@ interface IMultiValueSelectProps extends IProvidedByAntFormItem<SelectProps<stri
15
15
  idValue: string;
16
16
  }>) => void;
17
17
  required?: boolean;
18
- shouldShowValueDetailsButton?: boolean;
19
18
  }
20
19
  export declare const MultiValueSelect: FunctionComponent<IMultiValueSelectProps>;
21
20
  export {};
@@ -6,8 +6,7 @@ import { useState } from 'react';
6
6
  import { AntForm, KitSelect } from 'aristid-ds';
7
7
  import useSharedTranslation from '../../../../../../hooks/useSharedTranslation/useSharedTranslation';
8
8
  import { useGetOptionsQuery } from './useGetOptionsQuery';
9
- import { useValueDetailsButton } from '../../../../../../components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton';
10
- export const MultiValueSelect = ({ value, onChange, activeValues, attribute, label, onValueDeselect, onSelectChange, required = false, shouldShowValueDetailsButton = false }) => {
9
+ export const MultiValueSelect = ({ value, onChange, activeValues, attribute, label, onValueDeselect, onSelectChange, required = false }) => {
11
10
  if (!onChange) {
12
11
  throw Error('MultiValueSelect should be used inside a antd Form.Item');
13
12
  }
@@ -19,10 +18,6 @@ export const MultiValueSelect = ({ value, onChange, activeValues, attribute, lab
19
18
  attribute,
20
19
  onSelectChange
21
20
  });
22
- const { onValueDetailsButtonClick } = useValueDetailsButton({
23
- value: null,
24
- attribute
25
- });
26
21
  const _handleSelect = (optionValue, ...antOnChangeParams) => {
27
22
  const newValues = Array.isArray(value) ? [...value, optionValue] : [optionValue];
28
23
  onChange(newValues, antOnChangeParams);
@@ -71,8 +66,6 @@ export const MultiValueSelect = ({ value, onChange, activeValues, attribute, lab
71
66
  onValueDeselect(activeLinkValueToDeselect);
72
67
  }
73
68
  };
74
- return (_jsx(KitSelect, { htmlFor: attribute.id, loading: loading, value: value, required: required, mode: "multiple", label: label, options: selectOptions, showSearch: true, optionFilterProp: "label", placeholder: t('record_edition.placeholder.record_select'), onSelect: _handleSelect, onClear: _clearValues, onBlur: _handleBlur,
75
- // @ts-expect-error
76
- onDeselect: _handleDeselect, onChange: onChange, onInfoClick: shouldShowValueDetailsButton ? onValueDetailsButtonClick : null }));
69
+ return (_jsx(KitSelect, { htmlFor: attribute.id, loading: loading, value: value, required: required, mode: "multiple", label: label, options: selectOptions, showSearch: true, optionFilterProp: "label", placeholder: t('record_edition.placeholder.record_select'), onSelect: _handleSelect, onClear: _clearValues, onBlur: _handleBlur, onDeselect: _handleDeselect, onChange: onChange }));
77
70
  };
78
71
  //# sourceMappingURL=MultiValueSelect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MultiValueSelect.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,YAAY,CAAC;AAE9C,OAAO,oBAAoB,MAAM,qDAAqD,CAAC;AAIvF,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAIxD,OAAO,EAAC,qBAAqB,EAAC,MAAM,6FAA6F,CAAC;AAYlI,MAAM,CAAC,MAAM,gBAAgB,GAA8C,CAAC,EACxE,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,KAAK,EACL,eAAe,EACf,cAAc,EACd,QAAQ,GAAG,KAAK,EAChB,4BAA4B,GAAG,KAAK,EACvC,EAAE,EAAE;IACD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC3E,CAAC;IAED,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAEvC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IAC7D,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IAEjE,MAAM,EAAC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAC,GAAG,kBAAkB,CAAC;QACjE,SAAS;QACT,cAAc;KACjB,CAAC,CAAC;IAEH,MAAM,EAAC,yBAAyB,EAAC,GAAG,qB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AC,GAAG,KAAK,eAAe,CAAC,CAAC;QAC/D,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QAE5C,MAAM,yBAAyB,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,KAAK,eAAe,CAAC,CAAC;QACjG,IAAI,yBAAyB,EAAE,CAAC;YAC5B,eAAe,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,SAAS,IACN,OAAO,EAAE,SAAS,CAAC,EAAE,EACrB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,aAAa,EACtB,UAAU,QACV,gBAAgB,EAAC,OAAO,EACxB,WAAW,EAAE,CAAC,CAAC,0CAA0C,CAAC,EAC1D,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,eAAe,EAC3B,QAAQ,EAAE,QAAQ,GACpB,CACL,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { CalculatedFlags, InheritedFlags } from './calculatedInheritedFlags';
3
+ export declare const ComputeIndicator: FunctionComponent<{
4
+ calculatedFlags: CalculatedFlags;
5
+ inheritedFlags: InheritedFlags;
6
+ }>;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { KitTooltip } from 'aristid-ds';
3
+ import { FaLayerGroup, FaSquareRootAlt } from 'react-icons/fa';
4
+ import styled from 'styled-components';
5
+ import { useSharedTranslation } from '../../../../../hooks/useSharedTranslation';
6
+ import { TOOLTIP_DEFAULT_DELAY_IN_SECONDS } from '../../../../../constants';
7
+ const ComputeIndicatorWrapper = styled.div `
8
+ font-size: calc(var(--general-typography-fontSize7) * 1px);
9
+ `;
10
+ export const ComputeIndicator = ({ calculatedFlags, inheritedFlags }) => {
11
+ const { t } = useSharedTranslation();
12
+ const shouldDisplayComputedIcon = calculatedFlags.isCalculatedNotOverrideValue || inheritedFlags.isInheritedNotOverrideValue;
13
+ const shouldDisplayOverridedIcon = calculatedFlags.isCalculatedOverrideValue || inheritedFlags.isInheritedOverrideValue;
14
+ return (_jsxs(ComputeIndicatorWrapper, { children: [shouldDisplayComputedIcon && (_jsx(KitTooltip, { title: t('record_edition.calculated_value'), mouseEnterDelay: TOOLTIP_DEFAULT_DELAY_IN_SECONDS, children: _jsx(FaSquareRootAlt, {}) })), shouldDisplayOverridedIcon && (_jsx(KitTooltip, { title: t('record_edition.overrided_value'), mouseEnterDelay: TOOLTIP_DEFAULT_DELAY_IN_SECONDS, children: _jsx(FaLayerGroup, {}) }))] }));
15
+ };
16
+ //# sourceMappingURL=ComputeIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComputeIndicator.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AACtC,OAAO,EAAC,YAAY,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC7D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,gCAAgC,EAAC,MAAM,eAAe,CAAC;AAE/D,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEzC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAGxB,CAAC,EAAC,eAAe,EAAE,cAAc,EAAC,EAAE,EAAE;IACvC,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,yBAAyB,GAC3B,eAAe,CAAC,4BAA4B,IAAI,cAAc,CAAC,2BAA2B,CAAC;IAC/F,MAAM,0BAA0B,GAC5B,eAAe,CAAC,yBAAyB,IAAI,cAAc,CAAC,wBAAwB,CAAC;IAEzF,OAAO,CACH,MAAC,uBAAuB,eACnB,yBAAyB,IAAI,CAC1B,KAAC,UAAU,IACP,KAAK,EAAE,CAAC,CAAC,iCAAiC,CAAC,EAC3C,eAAe,EAAE,gCAAgC,YAEjD,KAAC,eAAe,KAAG,GACV,CAChB,EACA,0BAA0B,IAAI,CAC3B,KAAC,UAAU,IACP,KAAK,EAAE,CAAC,CAAC,gCAAgC,CAAC,EAC1C,eAAe,EAAE,gCAAgC,YAEjD,KAAC,YAAY,KAAG,GACP,CAChB,IACqB,CAC7B,CAAC;AACN,CAAC,CAAC"}
@@ -1,9 +1,11 @@
1
- import { ICommonFieldsSettings } from '@leav/utils';
1
+ import { IRequiredFieldsSettings } from '@leav/utils';
2
2
  import { FunctionComponent } from 'react';
3
3
  import { RecordFormElementsValueStandardValue } from '../../../../../hooks/useGetRecordForm/useGetRecordForm';
4
4
  import { IFormElementProps } from '../../_types';
5
5
  import { FormInstance } from 'antd';
6
- declare const StandardField: FunctionComponent<IFormElementProps<ICommonFieldsSettings, RecordFormElementsValueStandardValue> & {
6
+ import { GetRecordColumnsValuesRecord, IRecordColumnValueStandard } from '../../../../../_queries/records/getRecordColumnsValues';
7
+ declare const StandardField: FunctionComponent<IFormElementProps<IRequiredFieldsSettings, RecordFormElementsValueStandardValue> & {
7
8
  antdForm?: FormInstance;
9
+ computedValues?: GetRecordColumnsValuesRecord<IRecordColumnValueStandard>;
8
10
  }>;
9
11
  export default StandardField;
@@ -3,28 +3,25 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
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 { ErrorTypes, localizedTranslation } from '@leav/utils';
6
- import { useContext, useEffect, useMemo, useReducer, useRef, useState } from 'react';
7
- import { useTranslation } from 'react-i18next';
6
+ import { useEffect, useRef, useState } from 'react';
8
7
  import styled from 'styled-components';
9
8
  import { ErrorDisplay } from '../../../../../components';
10
- import CreationErrorContext from '../../../../../components/RecordEdition/EditRecord/creationErrorContext';
11
- import { EditRecordReducerActionsTypes } from '../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
12
- import { useEditRecordReducer } from '../../../../../components/RecordEdition/editRecordReducer/useEditRecordReducer';
13
- import { useRefreshFieldValues } from '../../../../../hooks/useRefreshFieldValues';
14
9
  import { AttributeFormat } from '../../../../../_gqlTypes';
15
- import { useRecordEditionContext } from '../../hooks/useRecordEditionContext';
16
- import standardFieldReducer, { computeInitialState, newValueId, StandardFieldReducerActionsTypes } from '../../reducers/standardFieldReducer/standardFieldReducer';
17
- import FieldFooter from '../../shared/FieldFooter';
18
- import ValuesVersionBtn from '../../shared/ValuesVersionBtn';
19
- import { APICallStatus, VersionFieldScope } from '../../_types';
10
+ import { APICallStatus } from '../../_types';
20
11
  import StandardFieldValue from './StandardFieldValue';
21
12
  import { Form } from 'antd';
22
- import { StandardFieldReducerContext } from '../../reducers/standardFieldReducer/standardFieldReducerContext';
23
- import { KitButton, KitInputWrapper } from 'aristid-ds';
13
+ import { KitButton, KitInputWrapper, KitTooltip } from 'aristid-ds';
24
14
  import { useLang } from '../../../../../hooks';
25
- import { useValueDetailsButton } from '../../shared/ValueDetailsBtn/useValueDetailsButton';
26
15
  import { FaPlus, FaTrash } from 'react-icons/fa';
27
16
  import { DeleteAllValuesButton } from './DeleteAllValuesButton';
17
+ import { computeCalculatedFlags, computeInheritedFlags } from './calculatedInheritedFlags';
18
+ import { useGetPresentationValues } from './useGetPresentationValues';
19
+ import { useSharedTranslation } from '../../../../../hooks/useSharedTranslation';
20
+ import { ComputeIndicator } from './ComputeIndicator';
21
+ import { getAntdDisplayedValue, getEmptyInitialValue } from '../../antdUtils';
22
+ import { useEditRecordReducer } from '../../../../../components/RecordEdition/editRecordReducer/useEditRecordReducer';
23
+ import { EditRecordReducerActionsTypes } from '../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
24
+ import { EDIT_RECORD_SIDEBAR_ID, STANDARDFIELD_ID_PREFIX } from '../../../../../constants';
28
25
  const Wrapper = styled.div `
29
26
  margin-bottom: ${props => (props.$metadataEdit ? 0 : '1.5em')};
30
27
  `;
@@ -48,6 +45,10 @@ const KitInputWrapperStyled = styled(KitInputWrapper) `
48
45
  }
49
46
  }
50
47
  `;
48
+ const KitInputExtraAlignLeft = styled.div `
49
+ margin-right: auto;
50
+ line-height: 12px;
51
+ `;
51
52
  const KitDeleteValueButton = styled(KitButton) `
52
53
  margin: 3px;
53
54
  `;
@@ -55,329 +56,164 @@ const KitAddValueButton = styled(KitButton) `
55
56
  margin-top: calc((var(--general-spacing-xs) - 3) * 1px);
56
57
  margin-bottom: 3px;
57
58
  `;
58
- const _isDateRangeValue = (value) => !!value && typeof value === 'object' && 'from' in value && 'to' in value;
59
- const _getPresentationValue = ({ t, format, value, calculatedValue, inheritedValue }) => {
60
- let presentationValue = value || calculatedValue?.payload || inheritedValue?.payload || '';
61
- switch (format) {
62
- case AttributeFormat.date_range:
63
- if (!_isDateRangeValue(presentationValue)) {
64
- presentationValue = '';
65
- }
66
- else {
67
- const { from, to } = presentationValue;
68
- presentationValue = t('record_edition.date_range_value', { from, to });
69
- }
70
- break;
71
- case AttributeFormat.color:
72
- if (!presentationValue) {
73
- presentationValue = '#00000000';
74
- }
75
- else {
76
- presentationValue = '#' + presentationValue;
77
- }
78
- break;
79
- }
80
- return presentationValue;
81
- };
82
- const StandardField = ({ element, antdForm, onValueSubmit, onValueDelete, onDeleteMultipleValues, metadataEdit = false }) => {
83
- const { t } = useTranslation();
59
+ const StandardField = ({ element, computedValues, antdForm, readonly, onValueSubmit, onValueDelete, onDeleteMultipleValues, metadataEdit = false }) => {
60
+ const { t } = useSharedTranslation();
84
61
  const { lang: availableLang } = useLang();
85
- const { readOnly: isRecordReadOnly, record } = useRecordEditionContext();
86
- const { state: editRecordState, dispatch: editRecordDispatch } = useEditRecordReducer();
87
62
  const antdListFieldsRef = useRef(null);
88
- const { fetchValues } = useRefreshFieldValues(editRecordState.record?.library?.id, element.attribute?.id, editRecordState.record?.id);
89
- const isMultipleValues = element.attribute.multiple_values;
90
63
  const { attribute } = element;
91
- const creationErrors = useContext(CreationErrorContext);
92
- const isInCreationMode = record === null;
93
- const initialState = useMemo(() => computeInitialState({
94
- element,
95
- record,
96
- isRecordReadOnly,
97
- formVersion: editRecordState.valuesVersion,
98
- metadataEdit
99
- }), []);
100
- const [state, dispatch] = useReducer(standardFieldReducer, initialState);
101
- const [presentationValues, setPresentationValues] = useState(element.values.map(value => _getPresentationValue({
102
- t,
103
- format: attribute.format,
104
- value: value.payload,
105
- calculatedValue: state.calculatedValue,
106
- inheritedValue: state.inheritedValue
107
- })));
108
64
  useEffect(() => {
109
- if (creationErrors[attribute.id]) {
110
- // Affect error to each invalid value to display it on form
111
- for (const fieldError of creationErrors[attribute.id]) {
112
- const idValue = fieldError.id_value ?? null;
65
+ if (computedValues && computedValues[attribute.id]) {
66
+ setBackendValues(computedValues[attribute.id]);
67
+ antdForm.setFieldValue(attribute.id, getAntdDisplayedValue(computedValues[attribute.id], attribute));
68
+ }
69
+ }, [computedValues]);
70
+ if (!attribute) {
71
+ return _jsx(ErrorDisplay, { message: t('record_edition.missing_attribute') });
72
+ }
73
+ const { state, dispatch } = useEditRecordReducer();
74
+ useEffect(() => {
75
+ const _handleClickOutside = (event) => {
76
+ if (state.activeValue?.attribute?.id !== attribute.id) {
77
+ return;
78
+ }
79
+ const target = event.target;
80
+ const sideBarSelector = '#' + EDIT_RECORD_SIDEBAR_ID;
81
+ const inputWrapperSelector = '#' + STANDARDFIELD_ID_PREFIX + attribute.id;
82
+ const colorDropdownSelector = '.ant-popover.ant-color-picker';
83
+ const pickerDropdownSelector = '.ant-picker-dropdown';
84
+ const richTextModalSelector = '.kit-modal-wrapper.link-modal';
85
+ const allowedElementsToKeepValueDetailsDisplayed = target.closest(`${sideBarSelector}, ${inputWrapperSelector}, ${colorDropdownSelector}, ${pickerDropdownSelector}, ${richTextModalSelector}`);
86
+ if (!allowedElementsToKeepValueDetailsDisplayed) {
113
87
  dispatch({
114
- type: StandardFieldReducerActionsTypes.SET_ERROR,
115
- idValue,
116
- error: fieldError.message
88
+ type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
89
+ value: null
117
90
  });
118
91
  }
119
- }
120
- }, [creationErrors, attribute.id]);
121
- const setAntdErrorField = (error, fieldName) => {
92
+ };
93
+ document.addEventListener('mousedown', _handleClickOutside);
94
+ return () => {
95
+ document.removeEventListener('mousedown', _handleClickOutside);
96
+ };
97
+ }, [state.activeValue, attribute.id, dispatch]);
98
+ const [backendValues, setBackendValues] = useState(element.values);
99
+ const calculatedFlags = computeCalculatedFlags(backendValues);
100
+ const inheritedFlags = computeInheritedFlags(backendValues);
101
+ const defaultValueToAddInAntdForm = getEmptyInitialValue(attribute);
102
+ const backendWithoutCalculatedOrInheritedValues = backendValues
103
+ .filter(backendValue => !backendValue.isCalculated && !backendValue.isInherited)
104
+ .sort((a, b) => Number(a.id_value) - Number(b.id_value));
105
+ const { presentationValues } = useGetPresentationValues({
106
+ //TODO fix type
107
+ values: backendWithoutCalculatedOrInheritedValues,
108
+ format: attribute.format,
109
+ calculatedValue: calculatedFlags.calculatedValue,
110
+ inheritedValue: inheritedFlags.inheritedValue
111
+ });
112
+ const _handleSubmit = (idValue, fieldName) => async (valueToSave) => {
113
+ const submitRes = await onValueSubmit([{ value: valueToSave, idValue: idValue ?? null, attribute }], null);
122
114
  const shouldSpecifyFieldName = attribute.multiple_values && fieldName !== undefined;
123
115
  const name = shouldSpecifyFieldName ? [attribute.id, fieldName] : attribute.id;
124
- antdForm.setFields([
125
- {
126
- name,
127
- errors: error ? [error] : null
128
- }
129
- ]);
130
- };
131
- const _handleSubmit = async (idValue, valueToSave, fieldName) => {
132
- const isSavingNewValue = idValue === newValueId;
133
- dispatch({
134
- type: StandardFieldReducerActionsTypes.CLEAR_ERROR,
135
- idValue
136
- });
137
- const valueVersion = state.values[state.activeScope].version;
138
- const submitRes = await onValueSubmit([{ value: valueToSave, idValue: isSavingNewValue ? null : idValue, attribute }], valueVersion);
139
116
  if (submitRes.status === APICallStatus.SUCCESS) {
140
117
  if (antdForm) {
141
- setAntdErrorField(null, fieldName);
142
- }
143
- const submitResValue = submitRes.values[0];
144
- let resultValue;
145
- if (state.metadataEdit) {
146
- resultValue = {
147
- id_value: submitResValue.id_value,
148
- created_at: null,
149
- modified_at: null,
150
- created_by: null,
151
- modified_by: null,
152
- version: null,
153
- raw_payload: '',
154
- payload: '',
155
- metadata: null,
156
- attribute
157
- };
158
- if (state.metadataEdit) {
159
- const metadataValue = (submitResValue.metadata ?? []).find(({ name }) => name === element.attribute.id)?.value ?? null;
160
- resultValue.raw_payload = metadataValue.raw_payload ?? metadataValue.payload;
161
- resultValue.payload = metadataValue.payload;
162
- }
163
- }
164
- else {
165
- resultValue = submitResValue;
118
+ antdForm.setFields([
119
+ {
120
+ name,
121
+ errors: null
122
+ }
123
+ ]);
166
124
  }
167
- if (valueToSave === null) {
168
- dispatch({
169
- type: StandardFieldReducerActionsTypes.UPDATE_AFTER_DELETE,
170
- idValue
171
- });
125
+ if (!attribute.multiple_values) {
126
+ setBackendValues(submitRes.values);
172
127
  }
173
128
  else {
174
- dispatch({
175
- type: StandardFieldReducerActionsTypes.UPDATE_AFTER_SUBMIT,
176
- newValue: resultValue,
177
- idValue
129
+ setBackendValues(previousBackendValues => {
130
+ const newBackendValues = [...previousBackendValues, ...submitRes.values].reduce((acc, backendValue) => {
131
+ const existingValue = acc.find(o => o.id_value === backendValue.id_value &&
132
+ o.isCalculated === backendValue.isCalculated &&
133
+ o.isInherited === backendValue.isInherited);
134
+ if (existingValue) {
135
+ Object.assign(existingValue, backendValue);
136
+ }
137
+ else {
138
+ acc.push(backendValue);
139
+ }
140
+ return acc;
141
+ }, []);
142
+ return newBackendValues;
178
143
  });
179
144
  }
180
- const index = fieldName ?? 0;
181
- setPresentationValues(previousPresentationValues => {
182
- const nextPresentationValues = [...previousPresentationValues];
183
- nextPresentationValues[index] = _getPresentationValue({
184
- t,
185
- format: attribute.format,
186
- value: resultValue.payload,
187
- calculatedValue: state.calculatedValue,
188
- inheritedValue: state.inheritedValue
189
- });
190
- return nextPresentationValues;
191
- });
192
- const newActiveValue = state.metadataEdit
193
- ? {
194
- ...editRecordState.activeValue,
195
- value: {
196
- ...editRecordState.activeValue.value,
197
- metadata: [
198
- ...(editRecordState.activeValue?.value?.metadata ?? []),
199
- {
200
- name: element.attribute.id,
201
- value: {
202
- ...resultValue,
203
- version: null,
204
- metadata: null
205
- }
206
- }
207
- ]
208
- }
209
- }
210
- : null;
211
- editRecordDispatch({
212
- type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
213
- value: newActiveValue
214
- });
215
145
  return submitRes;
216
146
  }
217
- let errorMessage = submitRes.error;
218
- if (!errorMessage && submitRes.errors) {
219
- const attributeError = (submitRes?.errors ?? []).filter(err => err.attribute === attribute.id)?.[0];
147
+ if (!submitRes.error && submitRes.errors) {
148
+ const attributeError = submitRes.errors.filter(err => err.attribute === attribute.id)?.[0];
220
149
  if (attributeError) {
221
- errorMessage =
150
+ submitRes.error =
222
151
  attributeError.type === ErrorTypes.VALIDATION_ERROR
223
152
  ? attributeError.message
224
153
  : t(`errors.${attributeError.type}`);
225
- if (antdForm) {
226
- setAntdErrorField(errorMessage, fieldName);
227
- }
228
154
  }
229
155
  }
230
- dispatch({
231
- type: StandardFieldReducerActionsTypes.SET_ERROR,
232
- idValue,
233
- error: errorMessage
234
- });
235
- return submitRes;
236
- };
237
- const _handleDelete = async (idValue) => {
238
- dispatch({
239
- type: StandardFieldReducerActionsTypes.UNEDIT_FIELD,
240
- idValue
241
- });
242
- const deleteRes = await onValueDelete({ id_value: idValue }, attribute.id);
243
- if (deleteRes.status === APICallStatus.SUCCESS) {
244
- dispatch({
245
- type: StandardFieldReducerActionsTypes.UPDATE_AFTER_DELETE,
246
- idValue
247
- });
248
- if (!isInCreationMode) {
249
- const freshValues = await fetchValues(state.values[state.activeScope].version);
250
- dispatch({
251
- type: StandardFieldReducerActionsTypes.REFRESH_VALUES,
252
- formVersion: editRecordState.valuesVersion,
253
- values: freshValues
254
- });
255
- }
256
- return;
156
+ if (submitRes.error && antdForm) {
157
+ antdForm.setFields([
158
+ {
159
+ name,
160
+ errors: [submitRes.error]
161
+ }
162
+ ]);
257
163
  }
258
- dispatch({
259
- type: StandardFieldReducerActionsTypes.SET_ERROR,
260
- idValue,
261
- error: deleteRes.error
262
- });
263
- };
264
- const _handleAddValue = async (antdAdd) => {
265
- dispatch({
266
- type: StandardFieldReducerActionsTypes.ADD_VALUE
267
- });
268
- antdAdd();
164
+ return submitRes;
269
165
  };
270
- const _handleDeleteValue = async (field, antdRemove, deletedFieldIndex) => {
271
- if (field.idValue !== newValueId) {
272
- await onValueDelete({ id_value: field.idValue }, attribute.id);
166
+ const _handleDeleteValue = async (idValue, antdRemove, deletedFieldIndex) => {
167
+ if (idValue) {
168
+ await onValueDelete({ id_value: idValue }, attribute.id);
169
+ setBackendValues(previousBackendValues => previousBackendValues.filter(backendValue => backendValue.id_value !== idValue));
273
170
  }
274
171
  antdRemove(deletedFieldIndex);
275
- setPresentationValues(previousPresentationValues => previousPresentationValues.filter((_, index) => index !== deletedFieldIndex));
276
- dispatch({
277
- type: StandardFieldReducerActionsTypes.UPDATE_AFTER_DELETE,
278
- idValue: field.idValue
279
- });
280
- };
281
- const _handleScopeChange = (scope) => {
282
- dispatch({
283
- type: StandardFieldReducerActionsTypes.CHANGE_VERSION_SCOPE,
284
- scope
285
- });
286
172
  };
287
173
  const _handleDeleteAllValues = async () => {
288
- const deleteRes = await onDeleteMultipleValues(attribute.id, Object.values(state.values[state.activeScope].values).map(v => v.value), null);
174
+ const deleteRes = await onDeleteMultipleValues(attribute.id, backendValues.filter(b => b.id_value), null);
289
175
  if (deleteRes.status === APICallStatus.SUCCESS) {
290
176
  antdListFieldsRef.current.remove(antdListFieldsRef.current.indexes);
291
- antdListFieldsRef.current.add();
292
- setPresentationValues(['']);
293
- dispatch({
294
- type: StandardFieldReducerActionsTypes.UPDATE_AFTER_DELETE,
295
- allDeleted: true
296
- });
297
- if (!isInCreationMode) {
298
- const freshValues = await fetchValues(state.values[state.activeScope].version);
299
- dispatch({
300
- type: StandardFieldReducerActionsTypes.REFRESH_VALUES,
301
- formVersion: editRecordState.valuesVersion,
302
- values: freshValues
303
- });
304
- }
177
+ antdListFieldsRef.current.add(defaultValueToAddInAntdForm);
178
+ setBackendValues(previousBackendValues => previousBackendValues.filter(backendValue => !backendValue.id_value));
305
179
  return;
306
180
  }
181
+ };
182
+ const setActiveValue = () => {
307
183
  dispatch({
308
- type: StandardFieldReducerActionsTypes.SET_ERROR,
309
- idValue: state.values[state.activeScope].values[0]?.idValue,
310
- error: deleteRes.error
184
+ type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
185
+ value: {
186
+ value: null, // Value is needed for Tree or Metadata (for now it seems that we don't need it)
187
+ editingValue: null, // Set to null because it is only use to compute value.length but it will no longer be used (TO REMOVE IN XSTREAM-1094)
188
+ attribute
189
+ }
311
190
  });
312
191
  };
313
- if (!element.attribute) {
314
- return _jsx(ErrorDisplay, { message: t('record_edition.missing_attribute') });
315
- }
316
- const valuesToDisplay = Object.values(state.values[state.activeScope].values).sort((valueA, valueB) => valueA.index - valueB.index);
317
- const hasValue = valuesToDisplay[0].idValue !== newValueId && valuesToDisplay[0].idValue !== null;
318
- const canAddAnotherValue = !state.isReadOnly &&
192
+ const isMultipleValues = element.attribute.multiple_values;
193
+ const hasValue = isMultipleValues && backendValues.length > 0;
194
+ const canAddAnotherValue = !readonly &&
319
195
  isMultipleValues &&
320
196
  attribute.format !== AttributeFormat.boolean &&
321
197
  attribute.format !== AttributeFormat.encrypted;
322
- const canDeleteAllValues = !state.isReadOnly && hasValue && valuesToDisplay.length > 1;
323
- const isAttributeVersionable = attribute?.versions_conf?.versionable;
324
- const versions = {
325
- [VersionFieldScope.CURRENT]: state.values[VersionFieldScope.CURRENT]?.version ?? null,
326
- [VersionFieldScope.INHERITED]: state.values[VersionFieldScope.INHERITED]?.version ?? null
327
- };
328
- const label = localizedTranslation(state.formElement.settings.label, availableLang);
329
- const { onValueDetailsButtonClick } = useValueDetailsButton({
330
- value: valuesToDisplay[0]?.value,
331
- attribute: state.attribute
332
- });
333
- const shouldShowValueDetailsButton = editRecordState.withInfoButton;
334
- const _getFormattedValueForHelper = (valueToFormat) => {
335
- switch (state.attribute.format) {
336
- case AttributeFormat.date_range:
337
- return t('record_edition.date_range_from_to', {
338
- from: valueToFormat.payload.from,
339
- to: valueToFormat.payload.to
340
- });
341
- case AttributeFormat.encrypted:
342
- return valueToFormat.payload ? '●●●●●●●' : '';
343
- case AttributeFormat.color:
344
- return '#' + valueToFormat.payload;
345
- default:
346
- return valueToFormat.payload;
347
- }
348
- };
349
- const _getHelper = () => {
350
- if (attribute.multiple_values) {
351
- return;
352
- }
353
- if (state.isInheritedOverrideValue) {
354
- return t('record_edition.inherited_input_helper', {
355
- inheritedValue: _getFormattedValueForHelper(state.inheritedValue)
356
- });
357
- }
358
- if (state.isCalculatedOverrideValue) {
359
- return t('record_edition.calculated_input_helper', {
360
- calculatedValue: _getFormattedValueForHelper(state.calculatedValue)
361
- });
362
- }
363
- return;
364
- };
198
+ const canDeleteAllValues = !readonly && hasValue && backendValues.length > 1;
199
+ const label = localizedTranslation(element.settings.label, availableLang);
365
200
  let isFieldInError = false;
366
201
  if (antdForm) {
367
- const hasErrorsInFormList = valuesToDisplay.some((_, index) => {
202
+ const hasErrorsInFormList = backendValues.some((_, index) => {
368
203
  const errors = antdForm.getFieldError([attribute.id, index]);
369
204
  return errors.length > 0;
370
205
  });
371
206
  isFieldInError = antdForm.getFieldError(attribute.id).length > 0 || hasErrorsInFormList;
372
207
  }
373
- return (_jsx(StandardFieldReducerContext.Provider, { value: { state, dispatch }, children: _jsxs(Wrapper, { "$metadataEdit": metadataEdit, children: [_jsxs(KitInputWrapperStyled, { label: label, onInfoClick: shouldShowValueDetailsButton ? onValueDetailsButtonClick : null, helper: _getHelper(), required: state.formElement.settings.required, disabled: state.isReadOnly, bordered: attribute.multiple_values, status: isFieldInError ? 'error' : undefined, actions: canDeleteAllValues
374
- ? [_jsx(DeleteAllValuesButton, { handleDelete: _handleDeleteAllValues })]
375
- : undefined, htmlFor: attribute.id, children: [!attribute.multiple_values && (_jsx(StandardFieldValue, { value: valuesToDisplay[0], presentationValue: presentationValues[0], state: state, dispatch: dispatch, onSubmit: _handleSubmit, onDelete: _handleDelete, onScopeChange: _handleScopeChange }, valuesToDisplay[0].idValue)), attribute.multiple_values && (_jsx(Form.List, { name: attribute.id, children: (fields, { add, remove }) => {
376
- antdListFieldsRef.current = { add, remove, indexes: fields.map((_, index) => index) };
377
- return (_jsxs(_Fragment, { children: [_jsx(KitFieldsWrapper, { children: fields.map((field, index) => (_jsxs(RowValueWrapper, { children: [_jsx(StandardFieldValueWrapper, { children: _jsx(StandardFieldValue, { listField: field, value: valuesToDisplay[index], presentationValue: presentationValues[index], state: state, dispatch: dispatch, onSubmit: _handleSubmit, onDelete: _handleDelete, onScopeChange: _handleScopeChange }) }), fields.length > 1 && (_jsx(KitDeleteValueButton, { type: "tertiary", icon: _jsx(FaTrash, {}), onClick: () => _handleDeleteValue(valuesToDisplay[index], remove, index) }))] }, field.key))) }), canAddAnotherValue && (_jsx(KitAddValueButton, { type: "secondary", size: "m", icon: _jsx(FaPlus, {}), onClick: () => _handleAddValue(add), disabled: valuesToDisplay.some(value => value.idValue === newValueId), children: t('record_edition.add_value') }))] }));
378
- } }))] }), attribute?.versions_conf?.versionable && (_jsx(FieldFooter, { bordered: true, style: {
379
- flexDirection: !isAttributeVersionable ? 'row' : 'row-reverse'
380
- }, children: _jsx("div", { children: isAttributeVersionable && (_jsx(ValuesVersionBtn, { basic: true, versions: versions, activeScope: state.activeScope, onScopeChange: _handleScopeChange })) }) }))] }) }));
208
+ const isReadOnly = attribute.readonly || readonly;
209
+ return (_jsx(Wrapper, { "$metadataEdit": metadataEdit, children: _jsxs(KitInputWrapperStyled, { id: STANDARDFIELD_ID_PREFIX + attribute.id, label: label, required: attribute.required, disabled: isReadOnly, bordered: attribute.multiple_values, status: isFieldInError ? 'error' : undefined, extra: _jsxs(_Fragment, { children: [_jsx(KitInputExtraAlignLeft, { children: _jsx(ComputeIndicator, { calculatedFlags: calculatedFlags, inheritedFlags: inheritedFlags }) }), canDeleteAllValues && _jsx(DeleteAllValuesButton, { handleDelete: _handleDeleteAllValues })] }), htmlFor: attribute.id, children: [!attribute.multiple_values && (_jsx(StandardFieldValue, { presentationValue: presentationValues[0], handleSubmit: _handleSubmit(backendWithoutCalculatedOrInheritedValues[0]?.id_value), attribute: attribute, required: attribute.required, readonly: isReadOnly, label: label, calculatedFlags: calculatedFlags, inheritedFlags: inheritedFlags, setActiveValue: setActiveValue })), attribute.multiple_values && (_jsx(Form.List, { name: attribute.id, children: (fields, { add, remove }) => {
210
+ antdListFieldsRef.current = { add, remove, indexes: fields.map((_, index) => index) };
211
+ const shouldDisabledAddValueButton = fields.length > backendWithoutCalculatedOrInheritedValues.length;
212
+ return (_jsxs(_Fragment, { children: [_jsx(KitFieldsWrapper, { children: fields.map((field, index) => (_jsxs(RowValueWrapper, { children: [_jsx(StandardFieldValueWrapper, { children: _jsx(StandardFieldValue, { listField: field, presentationValue: presentationValues[index] ?? '', handleSubmit: _handleSubmit(backendWithoutCalculatedOrInheritedValues[index]?.id_value, field.name), attribute: attribute, label: label, required: attribute.required, readonly: isReadOnly, calculatedFlags: calculatedFlags, inheritedFlags: inheritedFlags, isLastValueOfMultivalues: index === fields.length - 1 && index !== 0, removeLastValueOfMultivalues: () => remove(index), setActiveValue: setActiveValue }) }), fields.length > 1 && (_jsx(KitDeleteValueButton, { type: "tertiary", title: t('record_edition.delete_value'), icon: _jsx(FaTrash, {}), onClick: () => _handleDeleteValue(backendWithoutCalculatedOrInheritedValues[index]
213
+ ?.id_value, remove, index) }))] }, field.key))) }), canAddAnotherValue && (_jsx(KitTooltip, { title: shouldDisabledAddValueButton
214
+ ? t('record_edition.please_select_value_before_adding')
215
+ : undefined, children: _jsx(KitAddValueButton, { type: "secondary", size: "m", icon: _jsx(FaPlus, {}), onClick: () => add(defaultValueToAddInAntdForm), disabled: shouldDisabledAddValueButton, children: t('record_edition.add_value') }) }))] }));
216
+ } }))] }) }));
381
217
  };
382
218
  export default StandardField;
383
219
  //# sourceMappingURL=StandardField.js.map