@leav/ui 0.3.6-df40eff → 0.3.6-e865e1b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/dist/__mocks__/common/form.d.ts +11 -5
  2. package/dist/__mocks__/common/form.js +18 -2
  3. package/dist/__mocks__/common/form.js.map +1 -1
  4. package/dist/__mocks__/common/record.d.ts +13 -2
  5. package/dist/__mocks__/common/record.js.map +1 -1
  6. package/dist/_gqlTypes/index.d.ts +65 -36
  7. package/dist/_gqlTypes/index.js +59 -8
  8. package/dist/_gqlTypes/index.js.map +1 -1
  9. package/dist/components/CreateDirectory/CreateDirectory.js +1 -1
  10. package/dist/components/CreateDirectory/CreateDirectory.js.map +1 -1
  11. package/dist/components/EditApplication/EditApplication.js +2 -2
  12. package/dist/components/EditApplication/EditApplication.js.map +1 -1
  13. package/dist/components/EditApplication/_types.d.ts +2 -2
  14. package/dist/components/Explorer/DataView.d.ts +9 -1
  15. package/dist/components/Explorer/DataView.js +30 -14
  16. package/dist/components/Explorer/DataView.js.map +1 -1
  17. package/dist/components/Explorer/Explorer.d.ts +3 -0
  18. package/dist/components/Explorer/Explorer.js +44 -21
  19. package/dist/components/Explorer/Explorer.js.map +1 -1
  20. package/dist/components/Explorer/IdCard.d.ts +7 -0
  21. package/dist/components/Explorer/IdCard.js +15 -0
  22. package/dist/components/Explorer/IdCard.js.map +1 -0
  23. package/dist/components/Explorer/TableCell.d.ts +2 -1
  24. package/dist/components/Explorer/TableCell.js +123 -20
  25. package/dist/components/Explorer/TableCell.js.map +1 -1
  26. package/dist/components/Explorer/TableTagGroup.d.ts +7 -0
  27. package/dist/components/Explorer/TableTagGroup.js +30 -0
  28. package/dist/components/Explorer/TableTagGroup.js.map +1 -0
  29. package/dist/components/Explorer/_queries/useExplorerData.d.ts +17 -2
  30. package/dist/components/Explorer/_queries/useExplorerData.js +23 -9
  31. package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
  32. package/dist/components/Explorer/_types.d.ts +7 -4
  33. package/dist/components/Explorer/index.d.ts +1 -3
  34. package/dist/components/Explorer/index.js +1 -3
  35. package/dist/components/Explorer/index.js.map +1 -1
  36. package/dist/components/Explorer/{edit-settings → manage-view-settings/_shared}/ColumnItem.d.ts +1 -1
  37. package/dist/components/Explorer/{edit-settings → manage-view-settings/_shared}/ColumnItem.js +12 -5
  38. package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js.map +1 -0
  39. package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.d.ts +11 -0
  40. package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.js +61 -0
  41. package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.js.map +1 -0
  42. package/dist/components/Explorer/manage-view-settings/configure-display/ConfigureDisplay.d.ts +6 -0
  43. package/dist/components/Explorer/manage-view-settings/configure-display/ConfigureDisplay.js +28 -0
  44. package/dist/components/Explorer/manage-view-settings/configure-display/ConfigureDisplay.js.map +1 -0
  45. package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.d.ts +6 -0
  46. package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js +56 -0
  47. package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js.map +1 -0
  48. package/dist/components/Explorer/manage-view-settings/configure-display/view-type/SelectViewType.d.ts +8 -0
  49. package/dist/components/Explorer/manage-view-settings/configure-display/view-type/SelectViewType.js +12 -0
  50. package/dist/components/Explorer/manage-view-settings/configure-display/view-type/SelectViewType.js.map +1 -0
  51. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.d.ts +4 -0
  52. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +89 -0
  53. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -0
  54. package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.d.ts +10 -0
  55. package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js +33 -0
  56. package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js.map +1 -0
  57. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.d.ts +8 -0
  58. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.js +100 -0
  59. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.js.map +1 -0
  60. package/dist/components/Explorer/manage-view-settings/index.d.ts +8 -0
  61. package/dist/components/Explorer/manage-view-settings/index.js +11 -0
  62. package/dist/components/Explorer/manage-view-settings/index.js.map +1 -0
  63. package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContext.js.map +1 -0
  64. package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContextProvider.js.map +1 -0
  65. package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/SidePanel.js +2 -2
  66. package/dist/components/Explorer/manage-view-settings/open-view-settings/SidePanel.js.map +1 -0
  67. package/dist/components/Explorer/manage-view-settings/open-view-settings/useEditSettings.js.map +1 -0
  68. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.d.ts +3 -0
  69. package/dist/components/Explorer/{edit-settings/useOpenSettings.js → manage-view-settings/open-view-settings/useOpenViewSettings.js} +7 -5
  70. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -0
  71. package/dist/components/Explorer/manage-view-settings/router-menu/SettingItem.js.map +1 -0
  72. package/dist/components/Explorer/{edit-settings → manage-view-settings/router-menu}/SettingsPanel.d.ts +1 -1
  73. package/dist/components/Explorer/{edit-settings → manage-view-settings/router-menu}/SettingsPanel.js +10 -10
  74. package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -0
  75. package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.d.ts +4 -0
  76. package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js +109 -0
  77. package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js.map +1 -0
  78. package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.d.ts +10 -0
  79. package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js +32 -0
  80. package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js.map +1 -0
  81. package/dist/components/Explorer/{edit-settings/ViewSetingsContext.d.ts → manage-view-settings/store-view-settings/ViewSettingsContext.d.ts} +1 -2
  82. package/dist/components/Explorer/{edit-settings/ViewSetingsContext.js → manage-view-settings/store-view-settings/ViewSettingsContext.js} +1 -5
  83. package/dist/components/Explorer/manage-view-settings/store-view-settings/ViewSettingsContext.js.map +1 -0
  84. package/dist/components/Explorer/{edit-settings → manage-view-settings/store-view-settings}/useViewSettingsContext.js +1 -1
  85. package/dist/components/Explorer/manage-view-settings/store-view-settings/useViewSettingsContext.js.map +1 -0
  86. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.d.ts +4 -0
  87. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +13 -0
  88. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js.map +1 -0
  89. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.d.ts +135 -0
  90. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +164 -0
  91. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -0
  92. package/dist/components/Explorer/useEditAction.js +1 -0
  93. package/dist/components/Explorer/useEditAction.js.map +1 -1
  94. package/dist/components/Explorer/usePagination.d.ts +7 -0
  95. package/dist/components/Explorer/usePagination.js +25 -0
  96. package/dist/components/Explorer/usePagination.js.map +1 -0
  97. package/dist/components/Explorer/usePrimaryActions.d.ts +1 -9
  98. package/dist/components/Explorer/usePrimaryActions.js +4 -12
  99. package/dist/components/Explorer/usePrimaryActions.js.map +1 -1
  100. package/dist/components/Explorer/useSearchInput.d.ts +10 -0
  101. package/dist/components/Explorer/useSearchInput.js +31 -0
  102. package/dist/components/Explorer/useSearchInput.js.map +1 -0
  103. package/dist/components/Explorer/useTableScrollableHeight.d.ts +5 -0
  104. package/dist/components/Explorer/useTableScrollableHeight.js +15 -0
  105. package/dist/components/Explorer/useTableScrollableHeight.js.map +1 -0
  106. package/dist/components/ExportModal/ExportModal.js +2 -2
  107. package/dist/components/ExportModal/ExportModal.js.map +1 -1
  108. package/dist/components/ImportModal/ImportModalConfigStep/ImportModalConfigStep.js +5 -5
  109. package/dist/components/ImportModal/ImportModalConfigStep/ImportModalConfigStep.js.map +1 -1
  110. package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js +2 -2
  111. package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js.map +1 -1
  112. package/dist/components/RecordEdition/EditRecord/EditRecord.js +1 -1
  113. package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
  114. package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +1 -1
  115. package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
  116. package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +7 -20
  117. package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
  118. package/dist/components/RecordEdition/EditRecordContent/antdUtils.d.ts +2 -1
  119. package/dist/components/RecordEdition/EditRecordContent/antdUtils.js +40 -33
  120. package/dist/components/RecordEdition/EditRecordContent/antdUtils.js.map +1 -1
  121. package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.d.ts +1 -1
  122. package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js +2 -2
  123. package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js.map +1 -1
  124. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.js +1 -1
  125. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.js.map +1 -1
  126. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.js +1 -1
  127. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.js.map +1 -1
  128. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.d.ts +4 -0
  129. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.js +25 -0
  130. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.js.map +1 -0
  131. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.d.ts +3 -2
  132. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +165 -192
  133. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
  134. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.d.ts +2 -8
  135. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js +10 -29
  136. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js.map +1 -1
  137. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.d.ts +2 -13
  138. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js +33 -43
  139. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js.map +1 -1
  140. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.d.ts +3 -14
  141. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js +19 -47
  142. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js.map +1 -1
  143. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.d.ts +3 -14
  144. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js +9 -77
  145. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js.map +1 -1
  146. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.d.ts +3 -14
  147. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js +24 -46
  148. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js.map +1 -1
  149. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.d.ts +3 -14
  150. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js +29 -50
  151. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js.map +1 -1
  152. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.d.ts +3 -14
  153. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js +43 -62
  154. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js.map +1 -1
  155. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.d.ts +3 -14
  156. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js +28 -50
  157. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js.map +1 -1
  158. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.d.ts +14 -9
  159. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +64 -401
  160. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js.map +1 -1
  161. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.d.ts +3 -2
  162. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.js +23 -49
  163. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/MonoValueSelect.js.map +1 -1
  164. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/_types.d.ts +2 -9
  165. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.d.ts +13 -0
  166. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.js +2 -0
  167. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.js.map +1 -0
  168. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.d.ts +42 -0
  169. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js +55 -0
  170. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js.map +1 -0
  171. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.d.ts +12 -0
  172. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js +31 -0
  173. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js.map +1 -0
  174. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/ValuesAdd.js +2 -2
  175. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/ValuesAdd.js.map +1 -1
  176. package/dist/components/SelectTreeNode/SelectTreeNode.d.ts +4 -7
  177. package/dist/components/SelectTreeNode/SelectTreeNode.js +17 -135
  178. package/dist/components/SelectTreeNode/SelectTreeNode.js.map +1 -1
  179. package/dist/components/SelectTreeNode/SelectTreeNodeContent.d.ts +16 -0
  180. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +131 -0
  181. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -0
  182. package/dist/components/SelectTreeNode/index.d.ts +1 -1
  183. package/dist/components/SelectTreeNode/index.js +1 -1
  184. package/dist/components/SelectTreeNode/index.js.map +1 -1
  185. package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.d.ts +4 -7
  186. package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.js +10 -10
  187. package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.js.map +1 -1
  188. package/dist/components/SelectTreeNodeModal/index.d.ts +1 -2
  189. package/dist/components/SelectTreeNodeModal/index.js +1 -2
  190. package/dist/components/SelectTreeNodeModal/index.js.map +1 -1
  191. package/dist/components/UploadFiles/UploadFiles.js +1 -1
  192. package/dist/components/UploadFiles/UploadFiles.js.map +1 -1
  193. package/dist/components/ValuesVersionConfigurator/VersionTree/VersionTree.js +2 -2
  194. package/dist/components/ValuesVersionConfigurator/VersionTree/VersionTree.js.map +1 -1
  195. package/dist/hooks/useDebouncedValue/index.d.ts +1 -0
  196. package/dist/{components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler → hooks/useDebouncedValue}/index.js +1 -1
  197. package/dist/hooks/useDebouncedValue/index.js.map +1 -0
  198. package/dist/hooks/useGetRecordForm/useGetRecordForm.d.ts +1 -0
  199. package/dist/hooks/useGetRecordForm/useGetRecordForm.js.map +1 -1
  200. package/dist/locales/en/shared.json +44 -11
  201. package/dist/locales/fr/shared.json +44 -11
  202. package/package.json +3 -2
  203. package/dist/components/Explorer/edit-settings/ColumnItem.js.map +0 -1
  204. package/dist/components/Explorer/edit-settings/DisplayMode.d.ts +0 -6
  205. package/dist/components/Explorer/edit-settings/DisplayMode.js +0 -34
  206. package/dist/components/Explorer/edit-settings/DisplayMode.js.map +0 -1
  207. package/dist/components/Explorer/edit-settings/DisplayModeTable.d.ts +0 -6
  208. package/dist/components/Explorer/edit-settings/DisplayModeTable.js +0 -89
  209. package/dist/components/Explorer/edit-settings/DisplayModeTable.js.map +0 -1
  210. package/dist/components/Explorer/edit-settings/EditSettingsContext.js.map +0 -1
  211. package/dist/components/Explorer/edit-settings/EditSettingsContextProvider.js.map +0 -1
  212. package/dist/components/Explorer/edit-settings/SettingItem.js.map +0 -1
  213. package/dist/components/Explorer/edit-settings/SettingsPanel.js.map +0 -1
  214. package/dist/components/Explorer/edit-settings/SidePanel.js.map +0 -1
  215. package/dist/components/Explorer/edit-settings/ViewSetingsContext.js.map +0 -1
  216. package/dist/components/Explorer/edit-settings/useEditSettings.js.map +0 -1
  217. package/dist/components/Explorer/edit-settings/useGetLibraryColumns.d.ts +0 -10
  218. package/dist/components/Explorer/edit-settings/useGetLibraryColumns.js +0 -24
  219. package/dist/components/Explorer/edit-settings/useGetLibraryColumns.js.map +0 -1
  220. package/dist/components/Explorer/edit-settings/useOpenSettings.d.ts +0 -1
  221. package/dist/components/Explorer/edit-settings/useOpenSettings.js.map +0 -1
  222. package/dist/components/Explorer/edit-settings/useViewSettingsContext.js.map +0 -1
  223. package/dist/components/Explorer/edit-settings/viewSettingsReducer.d.ts +0 -43
  224. package/dist/components/Explorer/edit-settings/viewSettingsReducer.js +0 -58
  225. package/dist/components/Explorer/edit-settings/viewSettingsReducer.js.map +0 -1
  226. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/index.d.ts +0 -2
  227. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/index.js +0 -6
  228. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/index.js.map +0 -1
  229. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer.d.ts +0 -138
  230. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer.js +0 -361
  231. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducer.js.map +0 -1
  232. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.d.ts +0 -7
  233. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.js +0 -9
  234. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/standardFieldReducerContext.js.map +0 -1
  235. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.d.ts +0 -1
  236. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.js +0 -7
  237. package/dist/components/RecordEdition/EditRecordContent/reducers/standardFieldReducer/useStandardFieldReducer.js.map +0 -1
  238. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/CheckboxInput.d.ts +0 -3
  239. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/CheckboxInput.js +0 -14
  240. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/CheckboxInput.js.map +0 -1
  241. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/ColorInput.d.ts +0 -3
  242. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/ColorInput.js +0 -22
  243. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/ColorInput.js.map +0 -1
  244. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/DateInput.d.ts +0 -3
  245. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/DateInput.js +0 -22
  246. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/DateInput.js.map +0 -1
  247. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/EncryptedInput.d.ts +0 -3
  248. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/EncryptedInput.js +0 -19
  249. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/EncryptedInput.js.map +0 -1
  250. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/NumberInput.d.ts +0 -3
  251. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/NumberInput.js +0 -32
  252. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/NumberInput.js.map +0 -1
  253. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/RichTextEditorInput.d.ts +0 -3
  254. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/RichTextEditorInput.js +0 -51
  255. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/RichTextEditorInput.js.map +0 -1
  256. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/TextInput.d.ts +0 -3
  257. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/TextInput.js +0 -26
  258. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/Inputs/TextInput.js.map +0 -1
  259. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueDisplayHandler.d.ts +0 -13
  260. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueDisplayHandler.js +0 -90
  261. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueDisplayHandler.js.map +0 -1
  262. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/ColorPickerBlock.d.ts +0 -7
  263. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/ColorPickerBlock.js +0 -45
  264. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/ColorPickerBlock.js.map +0 -1
  265. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/StandardFieldValueRead.d.ts +0 -9
  266. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/StandardFieldValueRead.js +0 -141
  267. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/StandardFieldValueRead/StandardFieldValueRead.js.map +0 -1
  268. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/index.d.ts +0 -1
  269. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValueDisplayHandler/index.js.map +0 -1
  270. /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/EditSettingsContext.d.ts +0 -0
  271. /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/EditSettingsContext.js +0 -0
  272. /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/EditSettingsContextProvider.d.ts +0 -0
  273. /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/EditSettingsContextProvider.js +0 -0
  274. /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/SidePanel.d.ts +0 -0
  275. /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/useEditSettings.d.ts +0 -0
  276. /package/dist/components/Explorer/{edit-settings → manage-view-settings/open-view-settings}/useEditSettings.js +0 -0
  277. /package/dist/components/Explorer/{edit-settings → manage-view-settings/router-menu}/SettingItem.d.ts +0 -0
  278. /package/dist/components/Explorer/{edit-settings → manage-view-settings/router-menu}/SettingItem.js +0 -0
  279. /package/dist/components/Explorer/{edit-settings → manage-view-settings/store-view-settings}/useViewSettingsContext.d.ts +0 -0
@@ -1,405 +1,19 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
3
- // This file is released under LGPL V3
4
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
- import { CloseOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
6
- import { localizedTranslation } from '@leav/utils';
7
- import { Button, Input, Popover, Space, theme } from 'antd';
8
- import moment from 'moment';
9
- import React, { useEffect, useRef } from 'react';
10
- import styled from 'styled-components';
11
- import { themeVars } from '../../../../../../antdTheme';
12
- import { FloatingMenu } from '../../../../../../components';
13
- import Dimmer from '../../../../../../components/Dimmer';
14
- import DeleteValueBtn from '../../../../../../components/RecordEdition/EditRecordContent/shared/DeleteValueBtn';
15
- import InheritedFieldLabel from '../../../../../../components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel';
16
- import UpdatedFieldIcon from '../../../../../../components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon';
17
- import ValueDetailsBtn from '../../../../../../components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn';
18
- import ValuesVersionBtn from '../../../../../../components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn';
19
- import ValuesVersionIndicator from '../../../../../../components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator';
20
- import { VersionFieldScope } from '../../../../../../components/RecordEdition/EditRecordContent/_types';
21
- import { EditRecordReducerActionsTypes } from '../../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
22
- import { useEditRecordReducer } from '../../../../../../components/RecordEdition/editRecordReducer/useEditRecordReducer';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Form } from 'antd';
23
3
  import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
24
4
  import { AttributeFormat } from '../../../../../../_gqlTypes';
25
- import { stringifyDateRangeValue } from '../../../../../../_utils';
26
- import { newValueId, StandardFieldReducerActionsTypes, StandardFieldValueState } from '../../../reducers/standardFieldReducer/standardFieldReducer';
27
- import ColorInput from './Inputs/ColorInput';
28
- import TextInput from './Inputs/TextInput';
29
- import ValuesList from './ValuesList';
30
- import { useLang } from '../../../../../../hooks';
31
- import { StandardFieldValueDisplayHandler } from './StandardFieldValueDisplayHandler';
32
- const ErrorMessage = styled.div `
33
- color: ${themeVars.errorColor};
34
- font-weight: bold;
35
- `;
36
- const FormWrapper = styled.div `
37
- position: relative;
38
- z-index: ${p => (p.$isEditing ? 2 : 0)};
39
- `;
40
- const InputWrapper = styled.div `
41
- position: relative;
42
-
43
- && input {
44
- background: ${themeVars.defaultBg};
45
- transition: none;
46
- border-radius: 0;
47
- line-height: 2.5em;
48
- padding-left: 17px;
49
- }
50
-
51
- ${FormWrapper}:not(:last-child) & input:not(:hover) {
52
- border-bottom: none;
53
- }
54
-
55
- ${FormWrapper}:first-child & input {
56
- border-top-left-radius: 5px;
57
- border-top-right-radius: 5px;
58
- }
59
-
60
- ${FormWrapper}:last-child & input {
61
- border-bottom-left-radius: 5px;
62
- border-bottom-right-radius: 5px;
63
- }
64
-
65
- &.editing input {
66
- border-radius: 5px;
67
- }
68
-
69
- &.editing .field-wrapper,
70
- &.editing .nested-input {
71
- z-index: 0;
72
- }
73
-
74
- &.format-boolean label {
75
- margin-right: 1em;
76
- }
77
-
78
- &:not(.format-boolean) label {
79
- position: absolute;
80
- left: 11px;
81
- top: calc(50% - 0.9em);
82
- font-size: 1.1em;
83
- background: transparent;
84
- padding: 0 0.5em;
85
- color: ${themeVars.secondaryTextColor};
86
- transition: all 0.2s ease;
87
- transition-property: left, top, font-size;
88
- z-index: 1;
89
- white-space: nowrap;
90
- text-overflow: ellipsis;
91
- overflow: hidden;
92
- width: 100%;
93
- }
94
-
95
- &:not(.format-boolean):not(.editing):not(.has-value) label {
96
- padding-right: 3rem;
97
- }
98
-
99
- input:disabled {
100
- background: ${themeVars.defaultBg};
101
- }
102
-
103
- &.has-value:not(.format-boolean) label,
104
- &.editing:not(.format-boolean) label {
105
- top: 0px;
106
- font-size: 0.9em;
107
- background: transparent;
108
- text-shadow: 0px 0px 4px #fff;
109
- z-index: 2;
110
- border-radius: 5px;
111
- }
112
-
113
- ${FormWrapper}.first-value &.has-value:not(.format-boolean) input:not(:first-child),
114
- ${FormWrapper}.first-value &.editing:not(.format-boolean) input:not(:only-child),
115
- ${FormWrapper}.first-value &.editing.format-date_range input,
116
- ${FormWrapper}.first-value &.editing.format-date_range .ant-picker-range-separator {
117
- padding-top: 1em;
118
- }
119
-
120
- &:not(.has-value):not(.editing):not(.format-boolean) input {
121
- padding: 9px 0;
122
- }
123
-
124
- &:not(:hover) .floating-menu {
125
- display: none;
126
- }
127
-
128
- .floating-menu {
129
- top: 50%;
130
- transform: translateY(-50%);
131
- }
132
- `;
133
- const ActionsWrapper = styled.div `
134
- position: absolute;
135
- display: flex;
136
- width: 100%;
137
- flex-direction: column;
138
- `;
139
- const ButtonsWrapper = styled.div `
140
- display: flex;
141
- margin: 0.5em 0;
142
- justify-content: flex-end;
143
-
144
- & > button {
145
- margin-left: 0.5em;
146
- }
147
- `;
148
- const RichTextEditorInput = React.lazy(() => import('./Inputs/RichTextEditorInput'));
149
- const inputComponentByFormat = {
150
- [AttributeFormat.text]: null,
151
- [AttributeFormat.date]: null,
152
- [AttributeFormat.date_range]: null,
153
- [AttributeFormat.boolean]: null,
154
- [AttributeFormat.numeric]: null,
155
- [AttributeFormat.encrypted]: null,
156
- [AttributeFormat.extended]: TextInput,
157
- [AttributeFormat.color]: ColorInput,
158
- [AttributeFormat.rich_text]: RichTextEditorInput
159
- };
160
- function StandardFieldValue({ value: fieldValue, onSubmit, onDelete, onScopeChange, state, dispatch }) {
161
- const { t, i18n } = useSharedTranslation();
162
- const { token } = theme.useToken();
163
- const { lang: availableLangs } = useLang();
164
- const actionsWrapperRef = useRef();
165
- const inputRef = useRef();
166
- const { state: editRecordState, dispatch: editRecordDispatch } = useEditRecordReducer();
167
- const attribute = state.formElement.attribute;
5
+ import { MonoValueSelect } from './ValuesList/MonoValueSelect';
6
+ import { DSInputWrapper } from './DSInputWrapper';
7
+ import { DSDatePickerWrapper } from './DSDatePickerWrapper';
8
+ import { DSRangePickerWrapper } from './DSRangePickerWrapper';
9
+ import { DSInputNumberWrapper } from './DSInputNumberWrapper';
10
+ import { DSInputEncryptedWrapper } from './DSInputEncryptedWrapper';
11
+ import { DSBooleanWrapper } from './DSBooleanWrapper';
12
+ import { DSRichTextWrapper } from './DSRichTextWrapper';
13
+ import { DSColorPickerWrapper } from './DSColorPickerWrapper';
14
+ function StandardFieldValue({ presentationValue, handleSubmit, attribute, label, listField, required, readonly, calculatedFlags, inheritedFlags }) {
15
+ const { t } = useSharedTranslation();
168
16
  const isValuesListEnabled = !!attribute?.values_list?.enable;
169
- const isValuesListOpen = !!attribute?.values_list?.allowFreeEntry;
170
- // Scroll to input when editing field
171
- useEffect(() => {
172
- if (fieldValue.isEditing) {
173
- actionsWrapperRef?.current?.scrollIntoView({ block: 'nearest' });
174
- }
175
- }, [fieldValue.isEditing]);
176
- // Cancel value editing if value details panel is closed
177
- useEffect(() => {
178
- if (editRecordState.activeValue === null && fieldValue.isEditing) {
179
- dispatch({
180
- type: StandardFieldReducerActionsTypes.CANCEL_EDITING,
181
- idValue: fieldValue.idValue
182
- });
183
- }
184
- }, [editRecordState.activeValue]);
185
- useEffect(() => {
186
- if (fieldValue.isEditing) {
187
- editRecordDispatch({
188
- type: EditRecordReducerActionsTypes.SET_EDITING_VALUE,
189
- value: fieldValue.editingValue
190
- });
191
- }
192
- }, [fieldValue.isEditing, fieldValue.editingValue]);
193
- const _handleSubmit = async (valueToSave, id) => {
194
- if (valueToSave === '') {
195
- return _handleDelete();
196
- }
197
- const convertedValue = typeof valueToSave === 'object' ? JSON.stringify(valueToSave) : valueToSave;
198
- await onSubmit(fieldValue.idValue, convertedValue);
199
- };
200
- const _handlePressEnter = async () => {
201
- if (!isValuesListEnabled) {
202
- return _handleSubmit(fieldValue.editingValue);
203
- }
204
- const valuesList = _getFilteredValuesList();
205
- if (!valuesList.length) {
206
- return;
207
- }
208
- return _handleSubmit(valuesList[0].value);
209
- };
210
- const _handleDelete = async () => {
211
- if (fieldValue.idValue === newValueId) {
212
- return _handleCancel();
213
- }
214
- await onDelete(fieldValue.idValue);
215
- };
216
- const _handleFocus = () => {
217
- if (state.isReadOnly || fieldValue.isEditing || attribute.format === AttributeFormat.boolean) {
218
- return;
219
- }
220
- dispatch({
221
- type: StandardFieldReducerActionsTypes.FOCUS_FIELD,
222
- idValue: fieldValue.idValue
223
- });
224
- if (!state.metadataEdit) {
225
- editRecordDispatch({
226
- type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
227
- value: { value: fieldValue.value, editingValue: fieldValue.editingValue, attribute }
228
- });
229
- }
230
- };
231
- const _handleValueChange = (value) => {
232
- dispatch({
233
- type: StandardFieldReducerActionsTypes.CHANGE_VALUE,
234
- idValue: fieldValue.idValue,
235
- value
236
- });
237
- };
238
- const _handleCloseError = () => dispatch({
239
- type: StandardFieldReducerActionsTypes.SET_ERROR_DISPLAY,
240
- displayError: false,
241
- idValue: fieldValue.idValue
242
- });
243
- const _handleCancel = () => {
244
- dispatch({
245
- type: StandardFieldReducerActionsTypes.CANCEL_EDITING,
246
- idValue: fieldValue.idValue
247
- });
248
- if (!state.metadataEdit) {
249
- editRecordDispatch({
250
- type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
251
- value: null
252
- });
253
- }
254
- };
255
- const _handleClickSubmit = () => {
256
- _handleSubmit(fieldValue.editingValue);
257
- };
258
- const _handleValueCopy = (value) => {
259
- inputRef?.current?.focus();
260
- _handleValueChange(value);
261
- };
262
- const _getInput = () => {
263
- let inputStyle = {};
264
- if (!fieldValue.isEditing &&
265
- attribute.format !== AttributeFormat.boolean &&
266
- attribute.format !== AttributeFormat.rich_text) {
267
- let displayedValue = String(fieldValue.displayValue);
268
- let prefixValue;
269
- if (attribute.format === AttributeFormat.color &&
270
- (fieldValue.value === null || fieldValue.value.payload === null)) {
271
- fieldValue.value = null;
272
- }
273
- const hasValue = fieldValue.value !== null;
274
- if (hasValue) {
275
- switch (attribute.format) {
276
- case AttributeFormat.encrypted:
277
- displayedValue = '•••••••••';
278
- break;
279
- case AttributeFormat.date:
280
- if (!isNaN(fieldValue.displayValue)) {
281
- displayedValue = new Intl.DateTimeFormat(i18n.language).format(new Date(Number(displayedValue) * 1000));
282
- }
283
- break;
284
- case AttributeFormat.color:
285
- prefixValue = _getColorDisplay();
286
- displayedValue = '#' + displayedValue;
287
- inputStyle = {
288
- paddingLeft: '39px'
289
- };
290
- }
291
- }
292
- return (_jsxs(_Fragment, { children: [prefixValue, _jsx(Input, { style: inputStyle, className: hasValue ? 'has-value' : '', value: displayedValue, onFocus: _handleFocus, disabled: state.isReadOnly }, "display")] }));
293
- }
294
- const InputComponent = inputComponentByFormat[attribute.format];
295
- // This should never happen, unless we have some bad settings in DB
296
- if (!InputComponent) {
297
- return _jsx("div", { children: t('record_edition.invalid_format') });
298
- }
299
- return (_jsx(InputComponent, { state: state, fieldValue: fieldValue, onChange: _handleValueChange, onFocus: _handleFocus, onSubmit: _handleSubmit, onPressEnter: _handlePressEnter, settings: state.formElement.settings, inputRef: inputRef }));
300
- };
301
- const _getColorDisplay = () => {
302
- const colorValue = '#' + String(fieldValue.displayValue);
303
- const colorPickerStyle = {
304
- width: '16px',
305
- height: '16px',
306
- borderRadius: '2px',
307
- backgroundColor: colorValue,
308
- marginTop: fieldValue.index ? '15px' : '25px',
309
- marginLeft: '5px'
310
- };
311
- return _jsx("label", { style: colorPickerStyle });
312
- };
313
- const _getFilteredValuesList = () => {
314
- let values = [];
315
- if (isValuesListEnabled) {
316
- if (attribute.format === AttributeFormat.date_range) {
317
- const valuesList = attribute?.values_list?.dateRangeValues ?? [];
318
- values = valuesList
319
- .filter(val => fieldValue.state === StandardFieldValueState.PRISTINE || !fieldValue.editingValue)
320
- .map(v => {
321
- const rangeValue = {
322
- from: moment(Number(v.from) * 1000).format('L'),
323
- to: moment(Number(v.to) * 1000).format('L')
324
- };
325
- return {
326
- value: stringifyDateRangeValue(rangeValue, t),
327
- rawValue: { from: v.from, to: v.to }
328
- };
329
- });
330
- }
331
- else {
332
- const valuesList = attribute?.values_list?.values ?? [];
333
- values = valuesList
334
- .filter(val => fieldValue.state === StandardFieldValueState.PRISTINE ||
335
- !fieldValue.editingValue ||
336
- attribute.format === AttributeFormat.date ||
337
- val.match(new RegExp(String(fieldValue.editingValue), 'i')))
338
- .map(v => ({ value: v, rawValue: v }));
339
- }
340
- }
341
- const hydratedValues = values.map(value => ({
342
- ...value,
343
- isNewValue: false,
344
- canCopy: isValuesListOpen &&
345
- attribute.format !== AttributeFormat.date &&
346
- attribute.format !== AttributeFormat.date_range
347
- }));
348
- // Display current value on top of values list as "new value". Don't do that for date range attribute as it
349
- // doesn't make much sense
350
- if (isValuesListOpen &&
351
- String(fieldValue.editingValue) &&
352
- attribute.format !== AttributeFormat.date_range &&
353
- !(attribute?.values_list?.values ?? []).some(v => v === fieldValue.editingValue)) {
354
- hydratedValues.unshift({
355
- value: String(fieldValue.editingValue),
356
- rawValue: String(fieldValue.editingValue),
357
- isNewValue: true,
358
- canCopy: false
359
- });
360
- }
361
- return hydratedValues;
362
- };
363
- const errorContent = (_jsx(ErrorMessage, { children: _jsxs(Space, { size: "small", children: [_jsx(ExclamationCircleOutlined, {}), fieldValue.error, _jsx(Button, { onClick: _handleCloseError, size: "small", icon: _jsx(CloseOutlined, {}), style: { border: 'none' } })] }) }));
364
- const isErrorVisible = fieldValue.isErrorDisplayed;
365
- const wrapperClasses = `
366
- ${attribute.format ? `format-${attribute.format}` : ''}
367
- ${fieldValue?.value?.payload ? 'has-value' : ''}
368
- ${fieldValue.isEditing ? 'editing' : ''}
369
- `;
370
- const canDeleteValue = !state.isReadOnly && fieldValue.idValue !== newValueId && attribute.format !== AttributeFormat.boolean;
371
- const valuesList = _getFilteredValuesList();
372
- const valueActions = [];
373
- if (!fieldValue.isEditing) {
374
- valueActions.push({
375
- button: _jsx(ValueDetailsBtn, { value: fieldValue.value, attribute: attribute, shape: "circle" })
376
- });
377
- }
378
- const hasMultipleValuesDisplay = attribute.multiple_values && !!Object.keys(state.values[state.activeScope].values).length;
379
- if (attribute?.versions_conf?.versionable) {
380
- const versions = {
381
- [VersionFieldScope.CURRENT]: state.values[VersionFieldScope.CURRENT]?.version ?? null,
382
- [VersionFieldScope.INHERITED]: state.values[VersionFieldScope.INHERITED]?.version ?? null
383
- };
384
- if (!hasMultipleValuesDisplay) {
385
- valueActions.push({
386
- title: t('values_version.title'),
387
- button: (_jsx(ValuesVersionBtn, { versions: versions, activeScope: state.activeScope, onScopeChange: onScopeChange }))
388
- });
389
- }
390
- }
391
- if (canDeleteValue && !fieldValue.isEditing && fieldValue.displayValue) {
392
- valueActions.push({
393
- title: t('global.delete'),
394
- button: _jsx(DeleteValueBtn, { onDelete: _handleDelete, shape: "circle" })
395
- });
396
- }
397
- const valuesVersionIndicatorStyle = {
398
- top: '1px',
399
- left: '1px',
400
- bottom: hasMultipleValuesDisplay ? '0' : '1px',
401
- borderRadius: hasMultipleValuesDisplay ? 'none' : token.borderRadius
402
- };
403
17
  const attributeFormatsWithDS = [
404
18
  AttributeFormat.text,
405
19
  AttributeFormat.date_range,
@@ -410,8 +24,57 @@ function StandardFieldValue({ value: fieldValue, onSubmit, onDelete, onScopeChan
410
24
  AttributeFormat.rich_text,
411
25
  AttributeFormat.color
412
26
  ];
413
- const attributeFormatsWithoutDS = [AttributeFormat.extended];
414
- return (_jsxs(_Fragment, { children: [attributeFormatsWithDS.includes(attribute.format) && (_jsx(StandardFieldValueDisplayHandler, { state: state, attribute: attribute, fieldValue: fieldValue, handleSubmit: _handleSubmit })), attributeFormatsWithoutDS.includes(attribute.format) && (_jsxs(_Fragment, { children: [fieldValue.isEditing && _jsx(Dimmer, { onClick: _handleCancel }), _jsxs(FormWrapper, { "$isEditing": fieldValue.isEditing, className: fieldValue.index === 0 ? 'first-value' : '', children: [_jsx(Popover, { placement: "topLeft", open: isErrorVisible, content: errorContent, children: _jsxs(InputWrapper, { "$isEditing": fieldValue.isEditing, className: wrapperClasses, "data-testid": "input-wrapper", children: [_jsx(ValuesVersionIndicator, { activeScope: state.activeScope, style: valuesVersionIndicatorStyle }), !fieldValue.index && (_jsxs("label", { className: "attribute-label", onClick: _handleFocus, children: [localizedTranslation(state.formElement.settings.label, availableLangs), editRecordState.externalUpdate.updatedValues[attribute?.id] && (_jsx(UpdatedFieldIcon, {})), state.activeScope === VersionFieldScope.INHERITED && (_jsx(InheritedFieldLabel, { version: state.values[VersionFieldScope.INHERITED].version }))] })), _getInput(), !state.metadataEdit && _jsx(FloatingMenu, { actions: valueActions })] }) }), _jsxs(ActionsWrapper, { ref: actionsWrapperRef, children: [fieldValue.isEditing && attribute?.values_list?.enable && (_jsx(ValuesList, { attribute: attribute, valuesList: valuesList, onValueSelect: _handleSubmit, onValueCopy: _handleValueCopy })), fieldValue.isEditing && (_jsxs(ButtonsWrapper, { children: [_jsx(Button, { size: "small", onClick: _handleCancel, style: { background: '#FFF' }, children: t('global.cancel') }), (!isValuesListEnabled || isValuesListOpen) && (_jsx(Button, { type: "primary", size: "small", onClick: _handleClickSubmit, children: t('global.submit') }))] }))] })] })] }))] }));
27
+ const commonProps = {
28
+ handleSubmit,
29
+ attribute,
30
+ presentationValue,
31
+ readonly,
32
+ label,
33
+ required,
34
+ calculatedFlags,
35
+ inheritedFlags
36
+ };
37
+ let valueContent;
38
+ if (isValuesListEnabled) {
39
+ valueContent = _jsx(MonoValueSelect, { ...commonProps });
40
+ }
41
+ else {
42
+ switch (attribute.format) {
43
+ case AttributeFormat.text:
44
+ valueContent = _jsx(DSInputWrapper, { ...commonProps });
45
+ break;
46
+ case AttributeFormat.date:
47
+ valueContent = _jsx(DSDatePickerWrapper, { ...commonProps });
48
+ break;
49
+ case AttributeFormat.date_range:
50
+ valueContent = _jsx(DSRangePickerWrapper, { ...commonProps });
51
+ break;
52
+ case AttributeFormat.numeric:
53
+ valueContent = _jsx(DSInputNumberWrapper, { ...commonProps });
54
+ break;
55
+ case AttributeFormat.encrypted:
56
+ valueContent = _jsx(DSInputEncryptedWrapper, { ...commonProps });
57
+ break;
58
+ case AttributeFormat.boolean:
59
+ valueContent = _jsx(DSBooleanWrapper, { ...commonProps });
60
+ break;
61
+ case AttributeFormat.rich_text:
62
+ valueContent = _jsx(DSRichTextWrapper, { ...commonProps });
63
+ break;
64
+ case AttributeFormat.color:
65
+ valueContent = _jsx(DSColorPickerWrapper, { ...commonProps });
66
+ }
67
+ }
68
+ return (attributeFormatsWithDS.includes(attribute.format) && (_jsx(Form.Item, { name: attribute.id, ...listField, rules:
69
+ //TODO: Remove this rule when required is implemented in the backend
70
+ !attribute.multiple_values
71
+ ? [
72
+ {
73
+ required,
74
+ message: t('errors.standard_field_required')
75
+ }
76
+ ]
77
+ : undefined, noStyle: true, children: valueContent })));
415
78
  }
416
79
  export default StandardFieldValue;
417
80
  //# sourceMappingURL=StandardFieldValue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StandardFieldValue.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAE,yBAAyB,EAAC,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAgC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AAChF,OAAO,EAAC,MAAM,EAAE,KAAK,EAAY,OA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../../../src/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,IAAI,EAAoB,MAAM,MAAM,CAAC;AAG7C,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,eAAe,EAA+C,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAe5D,SAAS,kBAAkB,CAAC,EACxB,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,cAAc,EACS;IACvB,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,mBAAmB,GAAG,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC;IAE7D,MAAM,sBAAsB,GAAG;QAC3B,eAAe,CAAC,IAAI;QACpB,eAAe,CAAC,UAAU;QAC1B,eAAe,CAAC,OAAO;QACvB,eAAe,CAAC,SAAS;QACzB,eAAe,CAAC,IAAI;QACpB,eAAe,CAAC,OAAO;QACvB,eAAe,CAAC,SAAS;QACzB,eAAe,CAAC,KAAK;KACxB,CAAC;IAEF,MAAM,WAAW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,CAAC,EAAE,KACd,SAAS,EACb,KAAK;QACD,oEAAoE;QACpE,CAAC,SAAS,CAAC,eAAe;YACtB,CAAC,CAAC;gBACI;oBACI,QAAQ;oBACR,OAAO,EAAE,CAAC,CAAC,gCAAgC,CAAC;iBAC/C;aACJ;YACH,CAAC,CAAC,SAAS,EAEnB,OAAO,kBAEN,YAAY,GACL,CACf,CACJ,CAAC;AACN,CAAC;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { IMonoValueSelectProps } from './_types';
3
- export declare const MonoValueSelect: FunctionComponent<IMonoValueSelectProps>;
2
+ import { IStandFieldValueContentProps } from '../_types';
3
+ import { IKitSelect } from 'aristid-ds/dist/Kit/DataEntry/Select/types';
4
+ export declare const MonoValueSelect: FunctionComponent<IStandFieldValueContentProps<IKitSelect>>;
@@ -2,17 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
3
3
  // This file is released under LGPL V3
4
4
  // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
- import { useEffect, useMemo, useRef, useState } from 'react';
5
+ import { useMemo, useState } from 'react';
6
6
  import { KitSelect, KitTypography } from 'aristid-ds';
7
7
  import useSharedTranslation from '../../../../../../../hooks/useSharedTranslation/useSharedTranslation';
8
8
  import { AttributeFormat, useSaveAttributeMutation } from '../../../../../../../_gqlTypes';
9
9
  import { Form } from 'antd';
10
- import { useValueDetailsButton } from '../../../../../../../components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton';
11
- import { useLang } from '../../../../../../../hooks';
12
- import { localizedTranslation } from '@leav/utils';
13
10
  import moment from 'moment';
14
11
  import { stringifyDateRangeValue } from '../../../../../../../_utils';
15
12
  import { EditRecordReducerActionsTypes } from '../../../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
13
+ import { useEditRecordReducer } from '../../../../../../../components/RecordEdition/editRecordReducer/useEditRecordReducer';
16
14
  const isNewOption = (value, options) => value !== '' && !options.find(option => option.value === value);
17
15
  const addOption = (options, optionToAdd) => {
18
16
  const newOptions = options;
@@ -24,7 +22,7 @@ const addOption = (options, optionToAdd) => {
24
22
  }
25
23
  return newOptions;
26
24
  };
27
- export const MonoValueSelect = ({ value, onChange, state, editRecordDispatch, attribute, fieldValue, handleSubmit, handleBlur, shouldShowValueDetailsButton = false }) => {
25
+ export const MonoValueSelect = ({ value, presentationValue, onChange, attribute, required, readonly, handleSubmit, inheritedFlags, calculatedFlags }) => {
28
26
  if (!onChange) {
29
27
  throw Error('MonoValueSelect should be used inside a antd Form.Item');
30
28
  }
@@ -33,23 +31,12 @@ export const MonoValueSelect = ({ value, onChange, state, editRecordDispatch, at
33
31
  }
34
32
  const { t } = useSharedTranslation();
35
33
  const { errors } = Form.Item.useStatus();
36
- const { onValueDetailsButtonClick } = useValueDetailsButton({
37
- value: fieldValue?.value,
38
- attribute
39
- });
40
- const [isSelectOpen, setIsSelectOpen] = useState(false);
34
+ const [isFocused, setIsFocused] = useState(false);
41
35
  const [searchedString, setSearchedString] = useState('');
42
- const { lang: availableLang } = useLang();
43
- const selectRef = useRef(null);
44
36
  const [saveAttribute] = useSaveAttributeMutation();
37
+ const { dispatch: editRecordDispatch } = useEditRecordReducer();
45
38
  const allowFreeEntry = attribute.values_list.allowFreeEntry;
46
39
  const allowListUpdate = attribute.values_list.allowListUpdate;
47
- useEffect(() => {
48
- if (fieldValue.isEditing && selectRef.current) {
49
- selectRef.current.focus();
50
- setIsSelectOpen(true);
51
- }
52
- }, [fieldValue.isEditing]);
53
40
  const _getFilteredValuesList = () => {
54
41
  let values = [];
55
42
  if (attribute.format === AttributeFormat.date_range) {
@@ -82,23 +69,18 @@ export const MonoValueSelect = ({ value, onChange, state, editRecordDispatch, at
82
69
  });
83
70
  }
84
71
  const searchResultsCount = useMemo(() => options.filter(option => option.label.toLowerCase().includes(searchedString.toLowerCase())).length, [searchedString]);
85
- const _resetToInheritedOrCalculatedValue = () => {
86
- if (state.isInheritedValue) {
87
- setTimeout(() => onChange(state.inheritedValue.raw_value, options), 0);
72
+ const _resetToInheritedOrCalculatedValue = async () => {
73
+ if (inheritedFlags.isInheritedValue) {
74
+ setTimeout(() => onChange(inheritedFlags.inheritedValue.raw_value, options), 0);
88
75
  }
89
- else if (state.isCalculatedValue) {
90
- setTimeout(() => onChange(state.calculatedValue.raw_value, options), 0);
76
+ else if (calculatedFlags.isCalculatedValue) {
77
+ setTimeout(() => onChange(calculatedFlags.calculatedValue.raw_value, options), 0);
91
78
  }
92
- handleSubmit('', attribute.id);
93
- };
94
- const _handleOnBlur = () => {
95
- handleBlur();
96
- setIsSelectOpen(false);
79
+ await handleSubmit(null, attribute.id);
97
80
  };
98
81
  const _handleOnChange = async (selectedValue) => {
99
- setIsSelectOpen(false);
100
82
  setSearchedString('');
101
- if ((state.isInheritedValue || state.isCalculatedValue) && selectedValue === '') {
83
+ if ((inheritedFlags.isInheritedValue || calculatedFlags.isCalculatedValue) && selectedValue === '') {
102
84
  _resetToInheritedOrCalculatedValue();
103
85
  return;
104
86
  }
@@ -118,28 +100,20 @@ export const MonoValueSelect = ({ value, onChange, state, editRecordDispatch, at
118
100
  });
119
101
  editRecordDispatch({ type: EditRecordReducerActionsTypes.REQUEST_REFRESH });
120
102
  }
121
- handleSubmit(selectedValue, attribute.id);
103
+ await handleSubmit(selectedValue, attribute.id);
122
104
  onChange(selectedValue, options);
123
105
  };
124
- const _handleOnClear = () => {
125
- _handleOnChange('');
126
- handleBlur();
106
+ const _handleOnClear = async () => {
107
+ await _handleOnChange('');
127
108
  };
128
- const helper = useMemo(() => {
129
- if (state.isInheritedOverrideValue) {
130
- return t('record_edition.inherited_input_helper', {
131
- inheritedValue: state.inheritedValue.raw_value
132
- });
109
+ const _handleOnSearch = async (search) => {
110
+ setSearchedString(search);
111
+ if (search) {
112
+ setIsFocused(true);
133
113
  }
134
- else if (state.isCalculatedOverrideValue) {
135
- return t('record_edition.calculated_input_helper', {
136
- calculatedValue: state.calculatedValue.raw_value
137
- });
138
- }
139
- return '';
140
- }, [state.isInheritedOverrideValue, state.isCalculatedOverrideValue]);
141
- const label = localizedTranslation(state.formElement.settings.label, availableLang);
142
- const required = state.formElement.settings.required;
143
- return (_jsx(KitSelect, { ref: selectRef, "data-testid": attribute.id, open: isSelectOpen, value: value, required: required, allowClear: !required, label: label, options: options, status: errors.length > 0 && 'error', showSearch: true, helper: helper, onSelect: _handleOnChange, onChange: onChange, onClear: _handleOnClear, onBlur: _handleOnBlur, onSearch: setSearchedString, onInfoClick: shouldShowValueDetailsButton ? onValueDetailsButtonClick : null, dropdownRender: menu => (_jsxs(_Fragment, { children: [searchedString !== '' && searchResultsCount > 0 && (_jsxs("div", { style: { paddingBottom: 'calc(var(--general-spacing-xs) * 1px)' }, children: [_jsx(KitTypography.Text, { size: "fontSize7", children: t('record_edition.press_enter_to') }), _jsx(KitTypography.Text, { size: "fontSize7", weight: "medium", children: t('record_edition.select_this_value') })] })), menu] })), notFoundContent: _jsx("div", { style: { textAlign: 'center' }, children: _jsx(KitTypography.Text, { size: "fontSize5", weight: "medium", children: t('record_edition.search_not_found') }) }) }));
114
+ };
115
+ const valueToDisplay = isFocused ? value : presentationValue;
116
+ const isValueEmpty = value === '';
117
+ return (_jsx(KitSelect, { id: attribute.id, "data-testid": attribute.id, value: isValueEmpty ? undefined : valueToDisplay, allowClear: !required && value, disabled: readonly, options: options, open: isFocused, status: errors.length > 0 && 'error', showSearch: true, onDropdownVisibleChange: visible => setIsFocused(visible), onSelect: _handleOnChange, onChange: onChange, onClear: _handleOnClear, onSearch: _handleOnSearch, placeholder: t('record_edition.placeholder.select_an_option'), dropdownRender: menu => (_jsxs(_Fragment, { children: [searchedString !== '' && searchResultsCount > 0 && (_jsxs("div", { style: { paddingBottom: 'calc(var(--general-spacing-xs) * 1px)' }, children: [_jsx(KitTypography.Text, { size: "fontSize7", children: t('record_edition.press_enter_to') }), _jsx(KitTypography.Text, { size: "fontSize7", weight: "medium", children: t('record_edition.select_this_value') })] })), menu] })), notFoundContent: _jsx("div", { style: { textAlign: 'center' }, children: _jsx(KitTypography.Text, { size: "fontSize5", weight: "medium", children: t('record_edition.search_not_found') }) }) }));
144
118
  };
145
119
  //# sourceMappingURL=MonoValueSelect.js.map