@leav/ui 0.4.0-fd9dcf3f → 1.0.0-6e54bb6d

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 (240) hide show
  1. package/dist/_gqlTypes/index.d.ts +450 -211
  2. package/dist/_gqlTypes/index.js +246 -76
  3. package/dist/_gqlTypes/index.js.map +1 -1
  4. package/dist/_queries/attributes/attributeDetailsFragment.js +1 -0
  5. package/dist/_queries/attributes/attributeDetailsFragment.js.map +1 -1
  6. package/dist/_utils/attributeType.d.ts +2 -1
  7. package/dist/_utils/attributeType.js +2 -1
  8. package/dist/_utils/attributeType.js.map +1 -1
  9. package/dist/components/Explorer/DataView.js +3 -3
  10. package/dist/components/Explorer/DataView.js.map +1 -1
  11. package/dist/components/Explorer/Explorer.d.ts +1 -1
  12. package/dist/components/Explorer/Explorer.js +13 -4
  13. package/dist/components/Explorer/Explorer.js.map +1 -1
  14. package/dist/components/Explorer/ExplorerToolbar.js +11 -2
  15. package/dist/components/Explorer/ExplorerToolbar.js.map +1 -1
  16. package/dist/components/Explorer/TableCell.js +25 -9
  17. package/dist/components/Explorer/TableCell.js.map +1 -1
  18. package/dist/components/Explorer/_queries/prepareFiltersForRequest.d.ts +1 -1
  19. package/dist/components/Explorer/_queries/prepareFiltersForRequest.js +99 -31
  20. package/dist/components/Explorer/_queries/prepareFiltersForRequest.js.map +1 -1
  21. package/dist/components/Explorer/_queries/useExplorerData.js +32 -27
  22. package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
  23. package/dist/components/Explorer/_types.d.ts +74 -8
  24. package/dist/components/Explorer/_types.js +5 -0
  25. package/dist/components/Explorer/_types.js.map +1 -1
  26. package/dist/components/Explorer/actions-item/useReplaceItemAction.d.ts +2 -1
  27. package/dist/components/Explorer/actions-item/useReplaceItemAction.js +2 -2
  28. package/dist/components/Explorer/actions-item/useReplaceItemAction.js.map +1 -1
  29. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.d.ts +3 -1
  30. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +9 -19
  31. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
  32. package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.d.ts +6 -3
  33. package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js +5 -19
  34. package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js.map +1 -1
  35. package/dist/components/Explorer/link-item/LinkModal.d.ts +3 -0
  36. package/dist/components/Explorer/link-item/LinkModal.js +44 -4
  37. package/dist/components/Explorer/link-item/LinkModal.js.map +1 -1
  38. package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js +4 -4
  39. package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js.map +1 -1
  40. package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.d.ts +9 -3
  41. package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.js +78 -13
  42. package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.js.map +1 -1
  43. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +21 -8
  44. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -1
  45. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js +2 -2
  46. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js.map +1 -1
  47. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropdownContent.js +9 -1
  48. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropdownContent.js.map +1 -1
  49. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueListDropDown.d.ts +9 -0
  50. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueListDropDown.js +131 -0
  51. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueListDropDown.js.map +1 -0
  52. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TreeAttributeDropDown.d.ts +3 -0
  53. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TreeAttributeDropDown.js +69 -0
  54. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TreeAttributeDropDown.js.map +1 -0
  55. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/_types.d.ts +6 -1
  56. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.d.ts +3 -0
  57. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js +43 -4
  58. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js.map +1 -1
  59. package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js +29 -8
  60. package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js.map +1 -1
  61. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +2 -1
  62. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js.map +1 -1
  63. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.d.ts +3 -2
  64. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +57 -14
  65. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -1
  66. package/dist/components/Explorer/useLoadView.d.ts +1 -1
  67. package/dist/components/Explorer/useLoadView.js +32 -38
  68. package/dist/components/Explorer/useLoadView.js.map +1 -1
  69. package/dist/components/Explorer/useSearchInput.js +2 -0
  70. package/dist/components/Explorer/useSearchInput.js.map +1 -1
  71. package/dist/components/Explorer/useViewSettingsReducer.js.map +1 -1
  72. package/dist/components/LibraryItemsList/FiltersDropdown/FiltersDropdown.js +1 -12
  73. package/dist/components/LibraryItemsList/FiltersDropdown/FiltersDropdown.js.map +1 -1
  74. package/dist/components/RecordEdition/EditRecord/EditRecord.d.ts +2 -1
  75. package/dist/components/RecordEdition/EditRecord/EditRecord.js +33 -214
  76. package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
  77. package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.d.ts +3 -3
  78. package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +15 -22
  79. package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
  80. package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +6 -16
  81. package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
  82. package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.d.ts +5 -0
  83. package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.js +28 -0
  84. package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.js.map +1 -0
  85. package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.d.ts +11 -0
  86. package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js +35 -0
  87. package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js.map +1 -0
  88. package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.d.ts +1 -1
  89. package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js +2 -2
  90. package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js.map +1 -1
  91. package/dist/components/RecordEdition/EditRecordContent/uiElements/FormDivider/FormDivider.js.map +1 -1
  92. package/dist/components/RecordEdition/EditRecordContent/uiElements/FormTabs/FormTabs.d.ts +2 -1
  93. package/dist/components/RecordEdition/EditRecordContent/uiElements/FormTabs/FormTabs.js +6 -9
  94. package/dist/components/RecordEdition/EditRecordContent/uiElements/FormTabs/FormTabs.js.map +1 -1
  95. package/dist/components/RecordEdition/EditRecordContent/uiElements/Frame/Frame.js +1 -1
  96. package/dist/components/RecordEdition/EditRecordContent/uiElements/Frame/Frame.js.map +1 -1
  97. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +6 -33
  98. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
  99. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/ActionButton.d.ts +3 -0
  100. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/ActionButton.js +9 -0
  101. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/ActionButton.js.map +1 -0
  102. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/{link-record-in-edition/useLinkRecords.d.ts → link-record/useExplorerLinkRecords.d.ts} +2 -2
  103. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/{link-record-in-edition/useLinkRecords.js → link-record/useExplorerLinkRecords.js} +3 -3
  104. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useExplorerLinkRecords.js.map +1 -0
  105. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/{link-record-in-edition/useLinkRecordsInEdition.d.ts → link-record/useLinkRecords.d.ts} +5 -9
  106. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js +76 -0
  107. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js.map +1 -0
  108. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +26 -21
  109. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
  110. package/dist/components/RecordEdition/EditRecordContent/uiElements/TextBlock/TextBlock.js.map +1 -1
  111. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.d.ts +1 -1
  112. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js +10 -23
  113. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js.map +1 -1
  114. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/{useDisplayTreeNode.d.ts → TreeNodeList.d.ts} +3 -4
  115. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.js +5 -0
  116. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.js.map +1 -0
  117. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.d.ts +1 -9
  118. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js +12 -16
  119. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js.map +1 -1
  120. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.d.ts +2 -1
  121. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js +51 -63
  122. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js.map +1 -1
  123. package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.d.ts +1 -3
  124. package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.js +6 -10
  125. package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.js.map +1 -1
  126. package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +45 -7
  127. package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
  128. package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js +46 -8
  129. package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js.map +1 -1
  130. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +1 -1
  131. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js.map +1 -1
  132. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js +2 -1
  133. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js.map +1 -1
  134. package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.d.ts +3 -0
  135. package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js +7 -1
  136. package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js.map +1 -1
  137. package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.d.ts +2 -5
  138. package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js +1 -1
  139. package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js.map +1 -1
  140. package/dist/components/RecordEdition/index.d.ts +1 -1
  141. package/dist/components/RecordEdition/index.js +1 -1
  142. package/dist/components/RecordEdition/index.js.map +1 -1
  143. package/dist/components/RecordHistory/RecordHistory.d.ts +8 -0
  144. package/dist/components/RecordHistory/RecordHistory.js +33 -0
  145. package/dist/components/RecordHistory/RecordHistory.js.map +1 -0
  146. package/dist/components/RecordHistory/RecordHistoryLogEntry.d.ts +8 -0
  147. package/dist/components/RecordHistory/RecordHistoryLogEntry.js +53 -0
  148. package/dist/components/RecordHistory/RecordHistoryLogEntry.js.map +1 -0
  149. package/dist/components/RecordHistory/_types.d.ts +8 -0
  150. package/dist/components/RecordHistory/_types.js +2 -0
  151. package/dist/components/RecordHistory/_types.js.map +1 -0
  152. package/dist/components/RecordHistory/hooks/useFetchRecordHistory.d.ts +14 -0
  153. package/dist/components/RecordHistory/hooks/useFetchRecordHistory.js +25 -0
  154. package/dist/components/RecordHistory/hooks/useFetchRecordHistory.js.map +1 -0
  155. package/dist/components/RecordHistory/index.d.ts +1 -0
  156. package/dist/components/{LinkSelect → RecordHistory}/index.js +1 -2
  157. package/dist/components/RecordHistory/index.js.map +1 -0
  158. package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.d.ts +2 -0
  159. package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js +6 -4
  160. package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js.map +1 -1
  161. package/dist/components/SelectTreeNode/SelectTreeNode.d.ts +5 -3
  162. package/dist/components/SelectTreeNode/SelectTreeNode.js +2 -3
  163. package/dist/components/SelectTreeNode/SelectTreeNode.js.map +1 -1
  164. package/dist/components/SelectTreeNode/SelectTreeNodeContent.d.ts +3 -1
  165. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +68 -55
  166. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -1
  167. package/dist/components/SelectTreeNode/_types.d.ts +18 -0
  168. package/dist/components/SelectTreeNode/_types.js +2 -0
  169. package/dist/components/SelectTreeNode/_types.js.map +1 -0
  170. package/dist/components/index.d.ts +1 -0
  171. package/dist/components/index.js +1 -0
  172. package/dist/components/index.js.map +1 -1
  173. package/dist/hooks/useGetRecordForm/useGetRecordForm.d.ts +1 -1
  174. package/dist/hooks/useGetRecordForm/useGetRecordForm.js +2 -2
  175. package/dist/hooks/useGetRecordForm/useGetRecordForm.js.map +1 -1
  176. package/dist/hooks/useIFrameMessenger/types.d.ts +2 -0
  177. package/dist/hooks/useIFrameMessenger/useIFrameMessenger.d.ts +3 -3
  178. package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js +5 -1
  179. package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js.map +1 -1
  180. package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClient.d.ts +6 -3
  181. package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClient.js +1 -3
  182. package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClient.js.map +1 -1
  183. package/dist/locales/en/shared.json +14 -1
  184. package/dist/locales/fr/shared.json +13 -0
  185. package/package.json +17 -4
  186. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueList.d.ts +0 -10
  187. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueList.js +0 -75
  188. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueList.js.map +0 -1
  189. package/dist/components/LinkSelect/LinkSelect.d.ts +0 -15
  190. package/dist/components/LinkSelect/LinkSelect.js +0 -88
  191. package/dist/components/LinkSelect/LinkSelect.js.map +0 -1
  192. package/dist/components/LinkSelect/index.d.ts +0 -2
  193. package/dist/components/LinkSelect/index.js.map +0 -1
  194. package/dist/components/RecordEdition/EditRecord/creationErrorContext.d.ts +0 -6
  195. package/dist/components/RecordEdition/EditRecord/creationErrorContext.js +0 -7
  196. package/dist/components/RecordEdition/EditRecord/creationErrorContext.js.map +0 -1
  197. package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.d.ts +0 -5
  198. package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.js +0 -28
  199. package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.js.map +0 -1
  200. package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.d.ts +0 -121
  201. package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.js +0 -31
  202. package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.js.map +0 -1
  203. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useEditRecord.d.ts +0 -5
  204. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useEditRecord.js +0 -39
  205. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useEditRecord.js.map +0 -1
  206. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useUnselectRecord.d.ts +0 -8
  207. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useUnselectRecord.js +0 -23
  208. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useUnselectRecord.js.map +0 -1
  209. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-mass/useUnselectAllRecords.d.ts +0 -9
  210. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-mass/useUnselectAllRecords.js +0 -23
  211. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-mass/useUnselectAllRecords.js.map +0 -1
  212. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useCreateRecord.d.ts +0 -8
  213. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useCreateRecord.js +0 -26
  214. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useCreateRecord.js.map +0 -1
  215. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useRecordSelector.d.ts +0 -12
  216. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useRecordSelector.js +0 -24
  217. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useRecordSelector.js.map +0 -1
  218. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecords.d.ts +0 -19
  219. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecords.js +0 -103
  220. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecords.js.map +0 -1
  221. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecordsInCreation.d.ts +0 -22
  222. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecordsInCreation.js +0 -104
  223. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecordsInCreation.js.map +0 -1
  224. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecords.js.map +0 -1
  225. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.js +0 -311
  226. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.js.map +0 -1
  227. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/LinkActionsButtons.d.ts +0 -9
  228. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/LinkActionsButtons.js +0 -15
  229. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/LinkActionsButtons.js.map +0 -1
  230. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/utils.d.ts +0 -4
  231. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/utils.js +0 -22
  232. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/utils.js.map +0 -1
  233. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/ValuesList.d.ts +0 -16
  234. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/ValuesList.js +0 -35
  235. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/ValuesList.js.map +0 -1
  236. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/index.d.ts +0 -2
  237. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/index.js +0 -6
  238. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/index.js.map +0 -1
  239. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.js +0 -8
  240. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.js.map +0 -1
@@ -1,121 +0,0 @@
1
- import { IValueToSubmit } from '../_types';
2
- import { IValueVersion } from '../../../../types';
3
- export declare const useRunActionsListAndFormatOnValue: () => {
4
- runActionsListAndFormatOnValue: (library: string, valueToProcess: IValueToSubmit, version: IValueVersion) => Promise<{
5
- id_value?: string | null;
6
- isInherited?: boolean | null;
7
- isCalculated?: boolean | null;
8
- modified_at?: number | null;
9
- created_at?: number | null;
10
- payload?: any | null;
11
- raw_payload?: any | null;
12
- value?: any | null;
13
- raw_value?: any | null;
14
- modified_by?: {
15
- id: string;
16
- whoAmI: {
17
- id: string;
18
- label?: string | null;
19
- subLabel?: string | null;
20
- color?: string | null;
21
- preview?: import("@leav/utils").IPreviewScalar | null;
22
- library: {
23
- id: string;
24
- label?: any | null;
25
- };
26
- };
27
- } | null;
28
- created_by?: {
29
- id: string;
30
- whoAmI: {
31
- id: string;
32
- label?: string | null;
33
- subLabel?: string | null;
34
- color?: string | null;
35
- preview?: import("@leav/utils").IPreviewScalar | null;
36
- library: {
37
- id: string;
38
- label?: any | null;
39
- };
40
- };
41
- } | null;
42
- version?: Array<{
43
- treeId: string;
44
- treeNode?: {
45
- id: string;
46
- record: {
47
- id: string;
48
- whoAmI: {
49
- id: string;
50
- label?: string | null;
51
- library: {
52
- id: string;
53
- };
54
- };
55
- };
56
- } | null;
57
- } | null> | null;
58
- attribute: {
59
- id: string;
60
- format?: import("../../../../_gqlTypes").AttributeFormat | null;
61
- type: import("../../../../_gqlTypes").AttributeType;
62
- system: boolean;
63
- };
64
- metadata?: Array<{
65
- name: string;
66
- value?: {
67
- id_value?: string | null;
68
- modified_at?: number | null;
69
- created_at?: number | null;
70
- payload?: any | null;
71
- raw_payload?: any | null;
72
- modified_by?: {
73
- id: string;
74
- whoAmI: {
75
- id: string;
76
- label?: string | null;
77
- subLabel?: string | null;
78
- color?: string | null;
79
- preview?: import("@leav/utils").IPreviewScalar | null;
80
- library: {
81
- id: string;
82
- label?: any | null;
83
- };
84
- };
85
- } | null;
86
- created_by?: {
87
- id: string;
88
- whoAmI: {
89
- id: string;
90
- label?: string | null;
91
- subLabel?: string | null;
92
- color?: string | null;
93
- preview?: import("@leav/utils").IPreviewScalar | null;
94
- library: {
95
- id: string;
96
- label?: any | null;
97
- };
98
- };
99
- } | null;
100
- version?: Array<{
101
- treeId: string;
102
- treeNode?: {
103
- id: string;
104
- record: {
105
- id: string;
106
- whoAmI: {
107
- id: string;
108
- label?: string | null;
109
- library: {
110
- id: string;
111
- };
112
- };
113
- };
114
- } | null;
115
- } | null> | null;
116
- } | null;
117
- } | null> | null;
118
- }>;
119
- loading: boolean;
120
- error: import("@apollo/client").ApolloError;
121
- };
@@ -1,31 +0,0 @@
1
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
- // This file is released under LGPL V3
3
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
- import { useRunActionsListAndFormatOnValueLazyQuery } from '../../../../_gqlTypes';
5
- import { objectToNameValueArray } from '@leav/utils';
6
- export const useRunActionsListAndFormatOnValue = () => {
7
- const [runActionsListAndFormatOnValueLazyQuery, { loading, error }] = useRunActionsListAndFormatOnValueLazyQuery();
8
- const runActionsListAndFormatOnValue = async (library, valueToProcess, version) => {
9
- const result = await runActionsListAndFormatOnValueLazyQuery({
10
- variables: {
11
- library,
12
- value: {
13
- attribute: valueToProcess.attribute,
14
- payload: valueToProcess.value !== null ? String(valueToProcess.value) : null,
15
- metadata: valueToProcess.metadata
16
- ? objectToNameValueArray(valueToProcess.metadata).map(({ name, value }) => ({
17
- name,
18
- value: String(value)
19
- }))
20
- : null
21
- },
22
- version: version
23
- ? objectToNameValueArray(version).map(v => ({ treeId: v.name, treeNodeId: v.value.id }))
24
- : null
25
- }
26
- });
27
- return result.data.runActionsListAndFormatOnValue?.[0] ?? null;
28
- };
29
- return { runActionsListAndFormatOnValue, loading, error };
30
- };
31
- //# sourceMappingURL=useRunActionsListAndFormatOnValue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRunActionsListAndFormatOnValue.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,0CAA0C,EAAC,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAC,sBAAsB,EAAC,MAAM,aAAa,CAAC;AAGnD,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAG,EAAE;IAClD,MAAM,CAAC,uCAAuC,EAAE,EAAC,OAAO,EAAE,KAAK,EAAC,CAAC,GAAG,0CAA0C,EAAE,CAAC;IAEjH,MAAM,8BAA8B,GAAG,KAAK,EACxC,OAAe,EACf,cAA8B,EAC9B,OAAsB,EACxB,EAAE;QACA,MAAM,MAAM,GAAG,MAAM,uCAAuC,CAAC;YACzD,SAAS,EAAE;gBACP,OAAO;gBACP,KAAK,EAAE;oBACH,SAAS,EAAE,cAAc,CAAC,SAAS;oBACnC,OAAO,EAAE,cAAc,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;oBAC5E,QAAQ,EAAE,cAAc,CAAC,QAAQ;wBAC7B,CAAC,CAAC,sBAAsB,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC;4BACpE,IAAI;4BACJ,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;yBACvB,CAAC,CAAC;wBACL,CAAC,CAAC,IAAI;iBACb;gBACD,OAAO,EAAE,OAAO;oBACZ,CAAC,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAC,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAC,CAAC,CAAC;oBACtF,CAAC,CAAC,IAAI;aACb;SACJ,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,IAAI,CAAC,8BAA8B,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IACnE,CAAC,CAAC;IAEF,OAAO,EAAC,8BAA8B,EAAE,OAAO,EAAE,KAAK,EAAC,CAAC;AAC5D,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- import { IItemData } from '../../../../../../components/Explorer/_types';
2
- export declare const useEditRecord: () => {
3
- openModal: (item: IItemData) => void;
4
- EditRecordModal: JSX.Element;
5
- };
@@ -1,39 +0,0 @@
1
- import { jsx as _jsx } 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 { useState } from 'react';
6
- import { EditRecordModal } from '../../../../../../components/RecordEdition/EditRecordModal';
7
- import { RecordFilterCondition, useExplorerLibraryDataLazyQuery } from '../../../../../../_gqlTypes';
8
- import { EDIT_RECORD_MODAL_CLASSNAME } from '../../../../../../components/Explorer/_constants';
9
- export const useEditRecord = () => {
10
- const [editingItem, setEditingItem] = useState(null);
11
- const [isModalVisible, setIsModalVisible] = useState(false);
12
- const [refreshItem] = useExplorerLibraryDataLazyQuery({ fetchPolicy: 'network-only' });
13
- const openModal = (item) => {
14
- setEditingItem(item);
15
- setIsModalVisible(true);
16
- };
17
- const _handleEditModalClose = (item) => {
18
- refreshItem({
19
- variables: {
20
- libraryId: item.libraryId,
21
- attributeIds: ['id'],
22
- pagination: { limit: 1 },
23
- filters: [
24
- {
25
- condition: RecordFilterCondition.EQUAL,
26
- field: 'id',
27
- value: item.itemId
28
- }
29
- ]
30
- }
31
- });
32
- setEditingItem(null);
33
- };
34
- return {
35
- openModal,
36
- EditRecordModal: isModalVisible && editingItem !== null ? (_jsx(EditRecordModal, { className: EDIT_RECORD_MODAL_CLASSNAME, open: true, record: editingItem.whoAmI, library: editingItem.libraryId, onClose: () => _handleEditModalClose(editingItem) })) : null
37
- };
38
- };
39
- //# sourceMappingURL=useEditRecord.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEditRecord.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useEditRecord.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAE7E,OA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CAAC,qBAAqB,CAAC,WAAW,CAAC,GACnD,CACL,CAAC,CAAC,CAAC,IAAI;KACf,CAAC;AACN,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import { IItemData } from '../../../../../../components/Explorer/_types';
2
- interface IUnselectRecordProps {
3
- unlinkRecords: (recordIds: string[]) => void;
4
- }
5
- export declare const useUnselectRecord: ({ unlinkRecords }: IUnselectRecordProps) => {
6
- callback: (item: IItemData) => void;
7
- };
8
- export {};
@@ -1,23 +0,0 @@
1
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
- // This file is released under LGPL V3
3
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
- import { KitModal } from 'aristid-ds';
5
- import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
6
- export const useUnselectRecord = ({ unlinkRecords }) => {
7
- const { t } = useSharedTranslation();
8
- return {
9
- callback: (item) => {
10
- KitModal.confirm({
11
- type: 'confirm',
12
- dangerConfirm: true,
13
- content: t('record_edition.delete_link_confirm'),
14
- okText: t('global.submit') ?? undefined,
15
- cancelText: t('global.cancel') ?? undefined,
16
- onOk: async () => {
17
- unlinkRecords([item.itemId]);
18
- }
19
- });
20
- }
21
- };
22
- };
23
- //# sourceMappingURL=useUnselectRecord.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useUnselectRecord.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useUnselectRecord.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAOpE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAC,aAAa,EAAuB,EAAE,EAAE;IACvE,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,OAAO;QACH,QAAQ,EAAE,CAAC,IAAe,EAAE,EAAE;YAC1B,QAAQ,CAAC,OAAO,CAAC;gBACb,IAAI,EAAE,SAAS;gBACf,aAAa,EAAE,IAAI;gBACnB,OAAO,EAAE,CAAC,CAAC,oCAAoC,CAAC;gBAChD,MAAM,EAAE,CAAC,CAAC,eAAe,CAAC,IAAI,SAAS;gBACvC,UAAU,EAAE,CAAC,CAAC,eAAe,CAAC,IAAI,SAAS;gBAC3C,IAAI,EAAE,KAAK,IAAI,EAAE;oBACb,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBACjC,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- import { MassSelection } from '../../../../../../components/Explorer/_types';
2
- import { RecordFilterInput } from '../../../../../../_gqlTypes';
3
- interface IUnselectAllRecordsProps {
4
- unlinkRecords: (recordIds: string[]) => void;
5
- }
6
- export declare const useUnselectAllRecords: ({ unlinkRecords }: IUnselectAllRecordsProps) => {
7
- callback: (massSelectionFilter: RecordFilterInput[], _massSelection: MassSelection) => void;
8
- };
9
- export {};
@@ -1,23 +0,0 @@
1
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
- // This file is released under LGPL V3
3
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
- import { KitModal } from 'aristid-ds';
5
- import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
6
- export const useUnselectAllRecords = ({ unlinkRecords }) => {
7
- const { t } = useSharedTranslation();
8
- return {
9
- callback: (massSelectionFilter, _massSelection) => {
10
- KitModal.confirm({
11
- type: 'confirm',
12
- dangerConfirm: true,
13
- content: t('record_edition.delete_links_confirm'),
14
- okText: t('global.submit') ?? undefined,
15
- cancelText: t('global.cancel') ?? undefined,
16
- onOk: async () => {
17
- unlinkRecords(massSelectionFilter.map(filter => filter.value));
18
- }
19
- });
20
- }
21
- };
22
- };
23
- //# sourceMappingURL=useUnselectAllRecords.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useUnselectAllRecords.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-mass/useUnselectAllRecords.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAQpE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAC,aAAa,EAA2B,EAAE,EAAE;IAC/E,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,OAAO;QACH,QAAQ,EAAE,CAAC,mBAAwC,EAAE,cAA6B,EAAE,EAAE;YAClF,QAAQ,CAAC,OAAO,CAAC;gBACb,IAAI,EAAE,SAAS;gBACf,aAAa,EAAE,IAAI;gBACnB,OAAO,EAAE,CAAC,CAAC,qCAAqC,CAAC;gBACjD,MAAM,EAAE,CAAC,CAAC,eAAe,CAAC,IAAI,SAAS;gBACvC,UAAU,EAAE,CAAC,CAAC,eAAe,CAAC,IAAI,SAAS;gBAC3C,IAAI,EAAE,KAAK,IAAI,EAAE;oBACb,aAAa,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;gBACnE,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- interface IUseCreateRecordProps {
2
- linkRecords: (recordIds: string[]) => void;
3
- }
4
- export declare const useCreateRecord: ({ linkRecords }: IUseCreateRecordProps) => {
5
- openModal: (libraryIdParam: string) => void;
6
- CreateRecordModal: JSX.Element;
7
- };
8
- export {};
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx } 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 { useState } from 'react';
6
- import { EditRecordModal } from '../../../../../../components/RecordEdition/EditRecordModal';
7
- import { CREATE_RECORD_MODAL_CLASSNAME } from '../../../../../../components/Explorer/_constants';
8
- export const useCreateRecord = ({ linkRecords }) => {
9
- const [libraryId, setLibraryId] = useState(null);
10
- const [isModalVisible, setIsModalVisible] = useState(false);
11
- const openModal = (libraryIdParam) => {
12
- setLibraryId(libraryIdParam);
13
- setIsModalVisible(true);
14
- };
15
- const closeModal = () => {
16
- setIsModalVisible(false);
17
- };
18
- return {
19
- openModal,
20
- CreateRecordModal: isModalVisible && libraryId !== null ? (_jsx(EditRecordModal, { className: CREATE_RECORD_MODAL_CLASSNAME, open: true, record: null, library: libraryId, onClose: closeModal, onCreate: newRecord => {
21
- linkRecords([newRecord.id]);
22
- closeModal();
23
- }, submitButtons: ['create'] })) : null
24
- };
25
- };
26
- //# sourceMappingURL=useCreateRecord.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCreateRecord.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useCreateRecord.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAC,6BAA6B,EAAC,MAAM,oCAAoC,CAAC;AAMjF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAC,WAAW,EAAwB,EAAE,EAAE;IACpE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAChE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5D,MAAM,SAAS,GAAG,CAAC,cAAsB,EAAE,EAAE;QACzC,YAAY,CAAC,cAAc,CAAC,CAAC;QAC7B,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,GAAG,EAAE;QACpB,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO;QACH,SAAS;QACT,iBAAiB,EACb,cAAc,IAAI,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,CACnC,KAAC,eAAe,IACZ,SAAS,EAAE,6BAA6B,EACxC,IAAI,QACJ,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,SAAS,CAAC,EAAE;gBAClB,WAAW,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC5B,UAAU,EAAE,CAAC;YACjB,CAAC,EACD,aAAa,EAAE,CAAC,QAAQ,CAAC,GAC3B,CACL,CAAC,CAAC,CAAC,IAAI;KACf,CAAC;AACN,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- type SelectionMode = 'simple' | 'multiple';
2
- interface IUseRecordSelectorProps {
3
- libraryId: string;
4
- selectionMode: SelectionMode;
5
- isReplacementMode: boolean;
6
- linkRecords: (recordIds: string[]) => void;
7
- }
8
- export declare const useRecordSelector: ({ libraryId, selectionMode, isReplacementMode, linkRecords }: IUseRecordSelectorProps) => {
9
- openModal: () => void;
10
- RecordSelectorModal: JSX.Element;
11
- };
12
- export {};
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx } 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 { useState } from 'react';
6
- import { SelectRecordForLinkModal } from '../../../../../../components/SelectRecordForLinkModal';
7
- import { LINK_RECORDS_MODAL_CLASSNAME } from '../../../../../../components/Explorer/_constants';
8
- export const useRecordSelector = ({ libraryId, selectionMode, isReplacementMode, linkRecords }) => {
9
- const [isModalVisible, setIsModalVisible] = useState(false);
10
- const openModal = () => {
11
- setIsModalVisible(true);
12
- };
13
- const closeModal = () => {
14
- setIsModalVisible(false);
15
- };
16
- return {
17
- openModal,
18
- RecordSelectorModal: isModalVisible ? (_jsx(SelectRecordForLinkModal, { className: LINK_RECORDS_MODAL_CLASSNAME, open: true, replacementMode: isReplacementMode, childLibraryId: libraryId, selectionMode: selectionMode, hideSelectAllAction: selectionMode !== 'multiple', onSelectionCompleted: data => {
19
- linkRecords(data.records.list.map(record => record.id));
20
- closeModal();
21
- }, onClose: closeModal })) : null
22
- };
23
- };
24
- //# sourceMappingURL=useRecordSelector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRecordSelector.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useRecordSelector.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,wBAAwB,EAAC,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAC,4BAA4B,EAAC,MAAM,oCAAoC,CAAC;AAWhF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAC9B,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,WAAW,EACW,EAAE,EAAE;IAC1B,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5D,MAAM,SAAS,GAAG,GAAG,EAAE;QACnB,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,GAAG,EAAE;QACpB,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO;QACH,SAAS;QACT,mBAAmB,EAAE,cAAc,CAAC,CAAC,CAAC,CAClC,KAAC,wBAAwB,IACrB,SAAS,EAAE,4BAA4B,EACvC,IAAI,QACJ,eAAe,EAAE,iBAAiB,EAClC,cAAc,EAAE,SAAS,EACzB,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,aAAa,KAAK,UAAU,EACjD,oBAAoB,EAAE,IAAI,CAAC,EAAE;gBACzB,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;gBACxD,UAAU,EAAE,CAAC;YACjB,CAAC,EACD,OAAO,EAAE,UAAU,GACrB,CACL,CAAC,CAAC,CAAC,IAAI;KACX,CAAC;AACN,CAAC,CAAC"}
@@ -1,19 +0,0 @@
1
- import { RecordFormAttributeFragment } from '../../../../../../_gqlTypes';
2
- import { DeleteValueFunc, SubmitValueFunc } from '../../../_types';
3
- import { IExplorerFilterStandard } from '../../../../../../components/Explorer/_types';
4
- interface IUseLinkRecordsProps {
5
- attribute: RecordFormAttributeFragment;
6
- libraryId: string;
7
- onValueSubmit: SubmitValueFunc;
8
- onValueDelete: DeleteValueFunc;
9
- }
10
- export declare const useLinkRecords: ({ attribute, libraryId, onValueSubmit, onValueDelete }: IUseLinkRecordsProps) => {
11
- explorerFilters: IExplorerFilterStandard[];
12
- explorerKey: number;
13
- selectedRecordIds: string[];
14
- linkRecords: (recordIds: string[]) => void;
15
- unlinkRecords: (recordIds?: string[]) => void;
16
- hasNoSelectedRecord: boolean;
17
- canDeleteAllValues: boolean;
18
- };
19
- export {};
@@ -1,103 +0,0 @@
1
- import { useState } from 'react';
2
- import { FILTER_ON_ID_DEFAULT_FIELDS, NO_RECORD_FILTERS } from '../shared/utils';
3
- import { AntForm } from 'aristid-ds';
4
- import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
5
- export const useLinkRecords = ({ attribute, libraryId, onValueSubmit, onValueDelete }) => {
6
- const { t } = useSharedTranslation();
7
- const [selectedRecordIds, setSelectedRecordIds] = useState([]);
8
- const [explorerFilters, setExplorerFilters] = useState(NO_RECORD_FILTERS);
9
- const [explorerKey, setExplorerKey] = useState(0);
10
- const updateExplorerKey = () => setExplorerKey(explorerKey + 1);
11
- const form = AntForm.useFormInstance();
12
- const linkRecords = (recordIds) => {
13
- if (!attribute.multiple_values) {
14
- selectedRecordIds.forEach(id => {
15
- const originalIndex = selectedRecordIds.indexOf(id);
16
- // In Create mode, we don't really delete the value, we just remove them from the pending values
17
- onValueDelete({
18
- id_value: `pending_${originalIndex + 1}`
19
- }, attribute.id);
20
- });
21
- }
22
- const newSelectedRecordIds = attribute.multiple_values ? [...selectedRecordIds, ...recordIds] : [...recordIds];
23
- setSelectedRecordIds(newSelectedRecordIds);
24
- form.setFieldValue(attribute.id, newSelectedRecordIds);
25
- const newFilters = newSelectedRecordIds.map(id => ({
26
- ...FILTER_ON_ID_DEFAULT_FIELDS,
27
- value: id
28
- }));
29
- setExplorerFilters(newFilters.length > 0 ? newFilters : NO_RECORD_FILTERS);
30
- const valuesToAddInPending = recordIds.map(id => ({
31
- attribute,
32
- idValue: null,
33
- value: {
34
- id,
35
- whoAmI: {
36
- id,
37
- library: {
38
- id: libraryId
39
- }
40
- }
41
- }
42
- }));
43
- form.setFields([
44
- {
45
- name: attribute.id,
46
- errors: attribute.required && newSelectedRecordIds.length === 0 ? [t('errors.standard_field_required')] : []
47
- }
48
- ]);
49
- // In Create mode, we don't really submit the values, we just add them to the pending values
50
- onValueSubmit(valuesToAddInPending, null);
51
- updateExplorerKey();
52
- };
53
- const unlinkRecords = (recordIds) => {
54
- selectedRecordIds
55
- .filter(id => (recordIds ? recordIds.includes(id) : true))
56
- .forEach(id => {
57
- const originalIndex = selectedRecordIds.indexOf(id);
58
- // In Create mode, we don't really delete the value, we just remove them from the pending values
59
- onValueDelete({
60
- id_value: `pending_${originalIndex + 1}`
61
- }, attribute.id);
62
- });
63
- if (!recordIds) {
64
- setSelectedRecordIds([]);
65
- setExplorerFilters(NO_RECORD_FILTERS);
66
- form.setFieldValue(attribute.id, []);
67
- updateExplorerKey();
68
- if (attribute.required) {
69
- form.setFields([
70
- {
71
- name: attribute.id,
72
- errors: [t('errors.standard_field_required')]
73
- }
74
- ]);
75
- }
76
- return;
77
- }
78
- const newSelectedRecordIds = selectedRecordIds.filter(id => !recordIds.includes(id));
79
- setSelectedRecordIds(newSelectedRecordIds);
80
- form.setFieldValue(attribute.id, newSelectedRecordIds);
81
- form.setFields([
82
- {
83
- name: attribute.id,
84
- errors: attribute.required && newSelectedRecordIds.length === 0 ? [t('errors.standard_field_required')] : []
85
- }
86
- ]);
87
- const newExplorerFilters = explorerFilters.filter(filter => !recordIds.includes(filter.value));
88
- setExplorerFilters(newExplorerFilters.length > 0 ? newExplorerFilters : NO_RECORD_FILTERS);
89
- updateExplorerKey();
90
- };
91
- const hasNoSelectedRecord = selectedRecordIds.length === 0;
92
- const canDeleteAllValues = selectedRecordIds.length > 1 && attribute.multiple_values && !attribute.required;
93
- return {
94
- explorerFilters,
95
- explorerKey,
96
- selectedRecordIds,
97
- linkRecords,
98
- unlinkRecords,
99
- hasNoSelectedRecord,
100
- canDeleteAllValues
101
- };
102
- };
103
- //# sourceMappingURL=useLinkRecords.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLinkRecords.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecords.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,2BAA2B,EAAE,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AASpE,MA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AG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAE3F,iBAAiB,EAAE,CAAC;IACxB,CAAC,CAAC;IAEF,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,MAAM,KAAK,CAAC,CAAC;IAE3D,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;IAE5G,OAAO;QACH,eAAe;QACf,WAAW;QACX,iBAAiB;QACjB,WAAW;QACX,aAAa;QACb,mBAAmB;QACnB,kBAAkB;KACrB,CAAC;AACN,CAAC,CAAC"}
@@ -1,22 +0,0 @@
1
- import { RecordFormAttributeFragment } from '../../../../../../_gqlTypes';
2
- import { DeleteValueFunc, SubmitValueFunc } from '../../../_types';
3
- import { Dispatch } from 'react';
4
- import { RecordFormElementsValueLinkValue } from '../../../../../../hooks/useGetRecordForm';
5
- import { IEditRecordReducerActions, IRecordPropertyWithAttribute } from '../../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
6
- interface IUseLinkRecordsInCreationProps {
7
- attribute: RecordFormAttributeFragment;
8
- libraryId: string;
9
- pendingValues: RecordFormElementsValueLinkValue[];
10
- activeAttribute: IRecordPropertyWithAttribute | null;
11
- dispatch: Dispatch<IEditRecordReducerActions>;
12
- isHookUsed: boolean;
13
- isReadOnly: boolean;
14
- isFieldInError: boolean;
15
- onValueSubmit: SubmitValueFunc;
16
- onValueDelete: DeleteValueFunc;
17
- }
18
- export declare const useLinkRecordsInCreation: ({ attribute, libraryId, pendingValues, activeAttribute, dispatch, isHookUsed, isReadOnly, isFieldInError, onValueSubmit, onValueDelete }: IUseLinkRecordsInCreationProps) => {
19
- UnlinkAllRecordsInCreation: JSX.Element;
20
- LinkRecordsInCreation: JSX.Element;
21
- };
22
- export {};
@@ -1,104 +0,0 @@
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 { FaEye, FaList, FaPlus, FaTrash } from 'react-icons/fa';
6
- import { Explorer } from '../../../../../../components/Explorer';
7
- import { ExplorerWrapper } from '../shared/ExplorerWrapper';
8
- import { LinkActionsButtons } from '../shared/LinkActionsButtons';
9
- import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
10
- import { useRecordSelector } from '../action-primary/useRecordSelector';
11
- import { useEditRecord } from '../action-item/useEditRecord';
12
- import { useUnselectRecord } from '../action-item/useUnselectRecord';
13
- import { ACTION_ITEM_EMPTY_LABEL } from '../shared/utils';
14
- import { useCreateRecord } from '../action-primary/useCreateRecord';
15
- import { RecordFilterOperator } from '../../../../../../_gqlTypes';
16
- import { useUnselectAllRecords } from '../action-mass/useUnselectAllRecords';
17
- import { useLinkRecords } from './useLinkRecords';
18
- import { DeleteAllValuesButton } from '../../shared/DeleteAllValuesButton';
19
- import { useEffect } from 'react';
20
- import { AntForm } from 'aristid-ds';
21
- import { EditRecordReducerActionsTypes } from '../../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
22
- export const useLinkRecordsInCreation = ({ attribute, libraryId, pendingValues, activeAttribute, dispatch, isHookUsed, isReadOnly, isFieldInError, onValueSubmit, onValueDelete }) => {
23
- const { t } = useSharedTranslation();
24
- const form = AntForm.useFormInstance();
25
- const { explorerFilters, explorerKey, linkRecords, unlinkRecords, hasNoSelectedRecord, canDeleteAllValues } = useLinkRecords({
26
- attribute,
27
- libraryId,
28
- onValueSubmit,
29
- onValueDelete
30
- });
31
- const { openModal: openCreateRecordModal, CreateRecordModal } = useCreateRecord({
32
- linkRecords
33
- });
34
- const { openModal: openRecordSelectorModal, RecordSelectorModal } = useRecordSelector({
35
- libraryId,
36
- isReplacementMode: !attribute.multiple_values && !hasNoSelectedRecord,
37
- selectionMode: attribute.multiple_values ? 'multiple' : 'simple',
38
- linkRecords
39
- });
40
- const { openModal: openEditRecordModal, EditRecordModal } = useEditRecord();
41
- const { callback: unselectRecordCallback } = useUnselectRecord({
42
- unlinkRecords
43
- });
44
- const { callback: unselectAllRecordsCallback } = useUnselectAllRecords({
45
- unlinkRecords
46
- });
47
- useEffect(() => {
48
- if (isHookUsed && pendingValues.length === 0 && attribute.required) {
49
- // Set field in error when LinkField is displayed for the first time. Otherwise, errors will be handled by useLinkRecords
50
- form.setFields([
51
- {
52
- name: attribute.id,
53
- errors: [t('errors.standard_field_required')]
54
- }
55
- ]);
56
- }
57
- }, []);
58
- useEffect(() => {
59
- if (isHookUsed && activeAttribute?.attribute.id === attribute.id) {
60
- // Update active value used in the sidebar when pendingValues change
61
- dispatch({
62
- type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
63
- values: pendingValues
64
- });
65
- }
66
- }, [pendingValues]);
67
- return {
68
- UnlinkAllRecordsInCreation: isHookUsed && canDeleteAllValues && (_jsx(DeleteAllValuesButton, { handleDelete: unlinkRecords, disabled: isReadOnly, danger: isFieldInError })),
69
- LinkRecordsInCreation: isHookUsed && (_jsxs(_Fragment, { children: [_jsx(ExplorerWrapper, { children: _jsx(Explorer, { defaultViewSettings: {
70
- filters: explorerFilters,
71
- filtersOperator: RecordFilterOperator.OR
72
- }, entrypoint: {
73
- type: 'library',
74
- libraryId
75
- }, showTitle: false, showSearch: false, selectionMode: attribute.multiple_values ? 'multiple' : 'simple', hideSelectAllAction: !attribute.multiple_values, disableSelection: isReadOnly || !attribute.multiple_values, defaultActionsForItem: [], itemActions: [
76
- { label: ACTION_ITEM_EMPTY_LABEL, icon: _jsx(FaEye, {}), callback: openEditRecordModal },
77
- ...(attribute.multiple_values
78
- ? [
79
- {
80
- label: ACTION_ITEM_EMPTY_LABEL,
81
- icon: _jsx(FaTrash, {}),
82
- callback: unselectRecordCallback,
83
- isDanger: true
84
- }
85
- ]
86
- : [])
87
- ], defaultMassActions: [], massActions: attribute.multiple_values
88
- ? [{ icon: _jsx(FaTrash, {}), label: t('global.delete'), callback: unselectAllRecordsCallback }]
89
- : [], hidePrimaryActions: true, hideTableHeader: true, iconsOnlyItemActions: true, noPagination: true }, explorerKey) }), _jsx(LinkActionsButtons, { createButtonProps: {
90
- icon: _jsx(FaPlus, {}),
91
- label: t('explorer.create-one'),
92
- callback: () => openCreateRecordModal(libraryId),
93
- disabled: isReadOnly
94
- }, linkButtonProps: {
95
- icon: _jsx(FaList, {}),
96
- label: attribute.multiple_values || hasNoSelectedRecord
97
- ? t('explorer.add-existing-item')
98
- : t('record_edition.replace-by-existing-item'),
99
- callback: openRecordSelectorModal,
100
- disabled: isReadOnly
101
- }, hasNoValue: hasNoSelectedRecord }), CreateRecordModal, RecordSelectorModal, EditRecordModal] }))
102
- };
103
- };
104
- //# sourceMappingURL=useLinkRecordsInCreation.js.map