@leav/ui 1.8.0 → 1.9.0-0dfef3bb

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 (549) hide show
  1. package/dist/_gqlTypes/index.d.ts +452 -172
  2. package/dist/_gqlTypes/index.js +259 -87
  3. package/dist/_gqlTypes/index.js.map +1 -1
  4. package/dist/_queries/attributes/attributeDetailsFragment.js +3 -0
  5. package/dist/_queries/attributes/attributeDetailsFragment.js.map +1 -1
  6. package/dist/_queries/records/createRecordMutation.js +2 -2
  7. package/dist/_queries/records/createRecordMutation.js.map +1 -1
  8. package/dist/_utils/getFiltersFromRequest.js +5 -6
  9. package/dist/_utils/getFiltersFromRequest.js.map +1 -1
  10. package/dist/_utils/index.js +3 -4
  11. package/dist/_utils/index.js.map +1 -1
  12. package/dist/_utils/typeguards.d.ts +5 -0
  13. package/dist/_utils/typeguards.js +6 -0
  14. package/dist/_utils/typeguards.js.map +1 -1
  15. package/dist/components/Explorer/Explorer.d.ts +2 -1
  16. package/dist/components/Explorer/Explorer.js +31 -13
  17. package/dist/components/Explorer/Explorer.js.map +1 -1
  18. package/dist/components/Explorer/ExplorerToolbar.js +2 -1
  19. package/dist/components/Explorer/ExplorerToolbar.js.map +1 -1
  20. package/dist/components/Explorer/_queries/useExplorerCountData.d.ts +16 -0
  21. package/dist/components/Explorer/_queries/useExplorerCountData.js +26 -0
  22. package/dist/components/Explorer/_queries/useExplorerCountData.js.map +1 -0
  23. package/dist/components/Explorer/_queries/useExplorerData.js +18 -20
  24. package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
  25. package/dist/components/Explorer/actions-mass/ResultsCount.d.ts +10 -0
  26. package/dist/components/Explorer/actions-mass/ResultsCount.js +8 -0
  27. package/dist/components/Explorer/actions-mass/ResultsCount.js.map +1 -0
  28. package/dist/components/Explorer/actions-mass/edit-attribute/EditAttributeMassActionModal.js +1 -1
  29. package/dist/components/Explorer/actions-mass/edit-attribute/EditAttributeMassActionModal.js.map +1 -1
  30. package/dist/components/Explorer/actions-mass/edit-attribute/useCountValuesOccurrencesHook.d.ts +9 -2
  31. package/dist/components/Explorer/actions-mass/edit-attribute/useCountValuesOccurrencesHook.js +18 -4
  32. package/dist/components/Explorer/actions-mass/edit-attribute/useCountValuesOccurrencesHook.js.map +1 -1
  33. package/dist/components/Explorer/actions-mass/generate-previews/GeneratePreviewsModal.d.ts +10 -0
  34. package/dist/components/Explorer/actions-mass/generate-previews/GeneratePreviewsModal.js +69 -0
  35. package/dist/components/Explorer/actions-mass/generate-previews/GeneratePreviewsModal.js.map +1 -0
  36. package/dist/components/Explorer/actions-mass/generate-previews/useGetPreviewSizesData.d.ts +18 -0
  37. package/dist/components/Explorer/actions-mass/generate-previews/useGetPreviewSizesData.js +57 -0
  38. package/dist/components/Explorer/actions-mass/generate-previews/useGetPreviewSizesData.js.map +1 -0
  39. package/dist/components/Explorer/actions-mass/useGeneratePreviewsMassAction.d.ts +19 -0
  40. package/dist/components/Explorer/actions-mass/useGeneratePreviewsMassAction.js +94 -0
  41. package/dist/components/Explorer/actions-mass/useGeneratePreviewsMassAction.js.map +1 -0
  42. package/dist/components/Explorer/actions-mass/useMassActions.d.ts +5 -3
  43. package/dist/components/Explorer/actions-mass/useMassActions.js +19 -13
  44. package/dist/components/Explorer/actions-mass/useMassActions.js.map +1 -1
  45. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.d.ts +3 -1
  46. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +5 -1
  47. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
  48. package/dist/components/Explorer/manage-view-settings/configure-display/view-type/SelectViewType.js +1 -1
  49. package/dist/components/Explorer/manage-view-settings/configure-display/view-type/SelectViewType.js.map +1 -1
  50. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +5 -2
  51. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -1
  52. package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js +17 -8
  53. package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js.map +1 -1
  54. package/dist/components/Filters/_queries/treeFiltersDataQuery.d.ts +6 -0
  55. package/dist/components/Filters/_queries/treeFiltersDataQuery.js +54 -0
  56. package/dist/components/Filters/_queries/treeFiltersDataQuery.js.map +1 -0
  57. package/dist/components/Filters/_types.d.ts +12 -1
  58. package/dist/components/Filters/_types.js +2 -1
  59. package/dist/components/Filters/_types.js.map +1 -1
  60. package/dist/components/Filters/context/filtersReducer.js +3 -2
  61. package/dist/components/Filters/context/filtersReducer.js.map +1 -1
  62. package/dist/components/Filters/context/useGetTreeFilters.js +24 -40
  63. package/dist/components/Filters/context/useGetTreeFilters.js.map +1 -1
  64. package/dist/components/Filters/filter-items/CommonFilterItem.js +2 -2
  65. package/dist/components/Filters/filter-items/CommonFilterItem.js.map +1 -1
  66. package/dist/components/Filters/filter-items/filter-type/ColorAttributeDropDown.js +1 -1
  67. package/dist/components/Filters/filter-items/filter-type/ColorAttributeDropDown.js.map +1 -1
  68. package/dist/components/Filters/filter-items/filter-type/FilterDropdownContent.js +5 -1
  69. package/dist/components/Filters/filter-items/filter-type/FilterDropdownContent.js.map +1 -1
  70. package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js +3 -3
  71. package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js.map +1 -1
  72. package/dist/components/Filters/filter-items/filter-type/_types.d.ts +6 -1
  73. package/dist/components/Filters/filter-items/filter-type/_types.js.map +1 -1
  74. package/dist/components/Filters/filter-items/filter-type/smart-filter/SmartFilterAttributeDropdown.d.ts +2 -0
  75. package/dist/components/Filters/filter-items/filter-type/smart-filter/SmartFilterAttributeDropdown.js +106 -0
  76. package/dist/components/Filters/filter-items/filter-type/smart-filter/SmartFilterAttributeDropdown.js.map +1 -0
  77. package/dist/components/Filters/filter-items/filter-type/smart-filter/useGetSmartFilterData.d.ts +25 -0
  78. package/dist/components/Filters/filter-items/filter-type/smart-filter/useGetSmartFilterData.js +59 -0
  79. package/dist/components/Filters/filter-items/filter-type/smart-filter/useGetSmartFilterData.js.map +1 -0
  80. package/dist/components/Filters/filter-items/filter-type/smart-filter/useSmartFilerSearch.d.ts +5 -0
  81. package/dist/components/Filters/filter-items/filter-type/smart-filter/useSmartFilerSearch.js +25 -0
  82. package/dist/components/Filters/filter-items/filter-type/smart-filter/useSmartFilerSearch.js.map +1 -0
  83. package/dist/components/Filters/filter-items/filter-type/tree/TreeAttributeDropDown.js +5 -4
  84. package/dist/components/Filters/filter-items/filter-type/tree/TreeAttributeDropDown.js.map +1 -1
  85. package/dist/components/Filters/filter-items/filter-type/tree/_queries/filterTreeDataQuery.d.ts +6 -0
  86. package/dist/components/Filters/filter-items/filter-type/tree/_queries/filterTreeDataQuery.js +54 -0
  87. package/dist/components/Filters/filter-items/filter-type/tree/_queries/filterTreeDataQuery.js.map +1 -0
  88. package/dist/components/Filters/filter-items/filter-type/tree/useGetTreeData.js +22 -41
  89. package/dist/components/Filters/filter-items/filter-type/tree/useGetTreeData.js.map +1 -1
  90. package/dist/components/Filters/filter-items/{EmptyValueCheckbox.d.ts → shared/EmptyValueCheckbox.d.ts} +2 -1
  91. package/dist/components/Filters/filter-items/shared/EmptyValueCheckbox.js +20 -0
  92. package/dist/components/Filters/filter-items/shared/EmptyValueCheckbox.js.map +1 -0
  93. package/dist/components/Filters/filter-items/shared/FilterTreeNodeTitle.d.ts +5 -0
  94. package/dist/components/Filters/filter-items/shared/FilterTreeNodeTitle.js +18 -0
  95. package/dist/components/Filters/filter-items/shared/FilterTreeNodeTitle.js.map +1 -0
  96. package/dist/components/Filters/filter-items/{SelectAllCheckbox.js → shared/SelectAllCheckbox.js} +1 -1
  97. package/dist/components/Filters/filter-items/shared/SelectAllCheckbox.js.map +1 -0
  98. package/dist/components/Filters/prepareFiltersForRequest.js +10 -5
  99. package/dist/components/Filters/prepareFiltersForRequest.js.map +1 -1
  100. package/dist/components/Filters/useFilters.d.ts +542 -0
  101. package/dist/components/Filters/useTransformFilters.js +3 -0
  102. package/dist/components/Filters/useTransformFilters.js.map +1 -1
  103. package/dist/components/Notifications/hooks/useNotificationSubscription.d.ts +9 -3
  104. package/dist/components/RecordEdition/EditRecord/EditRecord.d.ts +1 -0
  105. package/dist/components/RecordEdition/EditRecord/EditRecord.js +3 -3
  106. package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
  107. package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +4 -0
  108. package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
  109. package/dist/components/RecordEdition/EditRecordContent/antdUtils.js +1 -3
  110. package/dist/components/RecordEdition/EditRecordContent/antdUtils.js.map +1 -1
  111. package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +28 -17
  112. package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
  113. package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.d.ts +1 -0
  114. package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js +30 -18
  115. package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js.map +1 -1
  116. package/dist/components/RecordEdition/EditRecordPage/ErrorComponent.d.ts +2 -0
  117. package/dist/components/RecordEdition/EditRecordPage/ErrorComponent.js +11 -0
  118. package/dist/components/RecordEdition/EditRecordPage/ErrorComponent.js.map +1 -0
  119. package/dist/components/RecordEdition/EditRecordPage/getInitialRecordValues.d.ts +2 -0
  120. package/dist/components/RecordEdition/EditRecordPage/getInitialRecordValues.js +35 -0
  121. package/dist/components/RecordEdition/EditRecordPage/getInitialRecordValues.js.map +1 -0
  122. package/dist/components/RecordEdition/_types.d.ts +1 -1
  123. package/dist/components/RecordEdition/_types.js.map +1 -1
  124. package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js +7 -6
  125. package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js.map +1 -1
  126. package/dist/components/RecordEdition/hooks/useGetSubmitButtons.d.ts +1 -1
  127. package/dist/components/RecordEdition/hooks/useGetSubmitButtons.js +6 -2
  128. package/dist/components/RecordEdition/hooks/useGetSubmitButtons.js.map +1 -1
  129. package/dist/components/SearchModal/SearchModal.js +28 -18
  130. package/dist/components/SearchModal/SearchModal.js.map +1 -1
  131. package/dist/components/SelectTreeNode/SelectTreeNode.d.ts +0 -2
  132. package/dist/components/SelectTreeNode/SelectTreeNode.js +2 -2
  133. package/dist/components/SelectTreeNode/SelectTreeNode.js.map +1 -1
  134. package/dist/components/SelectTreeNode/SelectTreeNodeContent.d.ts +0 -2
  135. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +60 -115
  136. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -1
  137. package/dist/components/SelectTreeNode/TreeNodeTitle.d.ts +0 -1
  138. package/dist/components/SelectTreeNode/TreeNodeTitle.js +3 -7
  139. package/dist/components/SelectTreeNode/TreeNodeTitle.js.map +1 -1
  140. package/dist/components/SelectTreeNode/_queries/treeContentDataQuery.d.ts +6 -0
  141. package/dist/components/SelectTreeNode/_queries/treeContentDataQuery.js +56 -0
  142. package/dist/components/SelectTreeNode/_queries/treeContentDataQuery.js.map +1 -0
  143. package/dist/components/SelectTreeNode/_types.d.ts +0 -1
  144. package/dist/components/SelectTreeNode/_types.js.map +1 -1
  145. package/dist/components/index.d.ts +0 -3
  146. package/dist/components/index.js +0 -3
  147. package/dist/components/index.js.map +1 -1
  148. package/dist/hooks/useGetLibraryDetailExtendedQuery/useGetLibraryDetailExtendedQuery.d.ts +1 -1
  149. package/dist/hooks/useGetRecordUpdatesSubscription/useGetRecordUpdatesSubscription.d.ts +9 -3
  150. package/dist/hooks/useGetRecordValuesQuery/useGetRecordValuesQuery.js.map +1 -1
  151. package/dist/hooks/useIFrameMessenger/schema.d.ts +2 -2
  152. package/dist/hooks/useIFrameMessenger/schema.js +1 -1
  153. package/dist/hooks/useIFrameMessenger/schema.js.map +1 -1
  154. package/dist/hooks/useIFrameMessenger/types.d.ts +5 -0
  155. package/dist/hooks/useIFrameMessenger/types.js.map +1 -1
  156. package/dist/locales/en/shared.json +11 -4
  157. package/dist/locales/fr/shared.json +11 -4
  158. package/package.json +12 -21
  159. package/dist/__mocks__/common/mockSearchContextProvider.d.ts +0 -6
  160. package/dist/__mocks__/common/mockSearchContextProvider.js +0 -10
  161. package/dist/__mocks__/common/mockSearchContextProvider.js.map +0 -1
  162. package/dist/components/AttributesSelectionList/Attribute/Attribute.d.ts +0 -3
  163. package/dist/components/AttributesSelectionList/Attribute/Attribute.js +0 -50
  164. package/dist/components/AttributesSelectionList/Attribute/Attribute.js.map +0 -1
  165. package/dist/components/AttributesSelectionList/Attribute/index.d.ts +0 -2
  166. package/dist/components/AttributesSelectionList/Attribute/index.js +0 -6
  167. package/dist/components/AttributesSelectionList/Attribute/index.js.map +0 -1
  168. package/dist/components/AttributesSelectionList/AttributesSelectionList.d.ts +0 -10
  169. package/dist/components/AttributesSelectionList/AttributesSelectionList.js +0 -72
  170. package/dist/components/AttributesSelectionList/AttributesSelectionList.js.map +0 -1
  171. package/dist/components/AttributesSelectionList/SelectedAttributesList/SelectedAttribute/SelectedAttribute.d.ts +0 -7
  172. package/dist/components/AttributesSelectionList/SelectedAttributesList/SelectedAttribute/SelectedAttribute.js +0 -39
  173. package/dist/components/AttributesSelectionList/SelectedAttributesList/SelectedAttribute/SelectedAttribute.js.map +0 -1
  174. package/dist/components/AttributesSelectionList/SelectedAttributesList/SelectedAttribute/index.d.ts +0 -2
  175. package/dist/components/AttributesSelectionList/SelectedAttributesList/SelectedAttribute/index.js +0 -6
  176. package/dist/components/AttributesSelectionList/SelectedAttributesList/SelectedAttribute/index.js.map +0 -1
  177. package/dist/components/AttributesSelectionList/SelectedAttributesList/SelectedAttributesList.d.ts +0 -2
  178. package/dist/components/AttributesSelectionList/SelectedAttributesList/SelectedAttributesList.js +0 -63
  179. package/dist/components/AttributesSelectionList/SelectedAttributesList/SelectedAttributesList.js.map +0 -1
  180. package/dist/components/AttributesSelectionList/SelectedAttributesList/index.d.ts +0 -2
  181. package/dist/components/AttributesSelectionList/SelectedAttributesList/index.js +0 -6
  182. package/dist/components/AttributesSelectionList/SelectedAttributesList/index.js.map +0 -1
  183. package/dist/components/AttributesSelectionList/_types.d.ts +0 -8
  184. package/dist/components/AttributesSelectionList/_types.js +0 -2
  185. package/dist/components/AttributesSelectionList/_types.js.map +0 -1
  186. package/dist/components/AttributesSelectionList/helpers/attributeToSelectedAttribute.d.ts +0 -3
  187. package/dist/components/AttributesSelectionList/helpers/attributeToSelectedAttribute.js +0 -9
  188. package/dist/components/AttributesSelectionList/helpers/attributeToSelectedAttribute.js.map +0 -1
  189. package/dist/components/AttributesSelectionList/index.d.ts +0 -2
  190. package/dist/components/AttributesSelectionList/index.js +0 -6
  191. package/dist/components/AttributesSelectionList/index.js.map +0 -1
  192. package/dist/components/AttributesSelectionList/reducer/__mocks__/attributesSelectionListStateContext.d.ts +0 -11
  193. package/dist/components/AttributesSelectionList/reducer/__mocks__/attributesSelectionListStateContext.js +0 -10
  194. package/dist/components/AttributesSelectionList/reducer/__mocks__/attributesSelectionListStateContext.js.map +0 -1
  195. package/dist/components/AttributesSelectionList/reducer/attributesSelectionListReducer.d.ts +0 -33
  196. package/dist/components/AttributesSelectionList/reducer/attributesSelectionListReducer.js +0 -77
  197. package/dist/components/AttributesSelectionList/reducer/attributesSelectionListReducer.js.map +0 -1
  198. package/dist/components/AttributesSelectionList/reducer/attributesSelectionListStateContext.d.ts +0 -10
  199. package/dist/components/AttributesSelectionList/reducer/attributesSelectionListStateContext.js +0 -8
  200. package/dist/components/AttributesSelectionList/reducer/attributesSelectionListStateContext.js.map +0 -1
  201. package/dist/components/AttributesSelectionList/sharedComponents.d.ts +0 -809
  202. package/dist/components/AttributesSelectionList/sharedComponents.js +0 -16
  203. package/dist/components/AttributesSelectionList/sharedComponents.js.map +0 -1
  204. package/dist/components/DeactivateRecordsModal/DeactivateRecordsModal.d.ts +0 -10
  205. package/dist/components/DeactivateRecordsModal/DeactivateRecordsModal.js +0 -39
  206. package/dist/components/DeactivateRecordsModal/DeactivateRecordsModal.js.map +0 -1
  207. package/dist/components/DeactivateRecordsModal/index.d.ts +0 -1
  208. package/dist/components/DeactivateRecordsModal/index.js +0 -5
  209. package/dist/components/DeactivateRecordsModal/index.js.map +0 -1
  210. package/dist/components/Filters/filter-items/EmptyValueCheckbox.js +0 -16
  211. package/dist/components/Filters/filter-items/EmptyValueCheckbox.js.map +0 -1
  212. package/dist/components/Filters/filter-items/SelectAllCheckbox.js.map +0 -1
  213. package/dist/components/LibraryItemsList/CreateNewRecordButton/CreateNewRecordButton.d.ts +0 -13
  214. package/dist/components/LibraryItemsList/CreateNewRecordButton/CreateNewRecordButton.js +0 -50
  215. package/dist/components/LibraryItemsList/CreateNewRecordButton/CreateNewRecordButton.js.map +0 -1
  216. package/dist/components/LibraryItemsList/CreateNewRecordButton/index.d.ts +0 -2
  217. package/dist/components/LibraryItemsList/CreateNewRecordButton/index.js +0 -6
  218. package/dist/components/LibraryItemsList/CreateNewRecordButton/index.js.map +0 -1
  219. package/dist/components/LibraryItemsList/DisplayOptions/DisplayOptions.d.ts +0 -2
  220. package/dist/components/LibraryItemsList/DisplayOptions/DisplayOptions.js +0 -80
  221. package/dist/components/LibraryItemsList/DisplayOptions/DisplayOptions.js.map +0 -1
  222. package/dist/components/LibraryItemsList/DisplayOptions/index.d.ts +0 -2
  223. package/dist/components/LibraryItemsList/DisplayOptions/index.js +0 -6
  224. package/dist/components/LibraryItemsList/DisplayOptions/index.js.map +0 -1
  225. package/dist/components/LibraryItemsList/DisplayTypeSelector/DisplayTypeSelector.d.ts +0 -2
  226. package/dist/components/LibraryItemsList/DisplayTypeSelector/DisplayTypeSelector.js +0 -22
  227. package/dist/components/LibraryItemsList/DisplayTypeSelector/DisplayTypeSelector.js.map +0 -1
  228. package/dist/components/LibraryItemsList/DisplayTypeSelector/index.d.ts +0 -2
  229. package/dist/components/LibraryItemsList/DisplayTypeSelector/index.js +0 -6
  230. package/dist/components/LibraryItemsList/DisplayTypeSelector/index.js.map +0 -1
  231. package/dist/components/LibraryItemsList/FiltersDropdown/FiltersDropdown.d.ts +0 -13
  232. package/dist/components/LibraryItemsList/FiltersDropdown/FiltersDropdown.js +0 -229
  233. package/dist/components/LibraryItemsList/FiltersDropdown/FiltersDropdown.js.map +0 -1
  234. package/dist/components/LibraryItemsList/FiltersDropdown/index.d.ts +0 -2
  235. package/dist/components/LibraryItemsList/FiltersDropdown/index.js +0 -6
  236. package/dist/components/LibraryItemsList/FiltersDropdown/index.js.map +0 -1
  237. package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.d.ts +0 -11
  238. package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js +0 -328
  239. package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js.map +0 -1
  240. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterAttributeCondition/FilterAttributeCondition.d.ts +0 -7
  241. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterAttributeCondition/FilterAttributeCondition.js +0 -90
  242. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterAttributeCondition/FilterAttributeCondition.js.map +0 -1
  243. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterAttributeCondition/index.d.ts +0 -2
  244. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterAttributeCondition/index.js +0 -6
  245. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterAttributeCondition/index.js.map +0 -1
  246. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/BooleanFilter/BooleanFilter.d.ts +0 -3
  247. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/BooleanFilter/BooleanFilter.js +0 -13
  248. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/BooleanFilter/BooleanFilter.js.map +0 -1
  249. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/BooleanFilter/index.d.ts +0 -2
  250. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/BooleanFilter/index.js +0 -6
  251. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/BooleanFilter/index.js.map +0 -1
  252. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/DateBetweenFilter/DateBetweenFilter.d.ts +0 -3
  253. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/DateBetweenFilter/DateBetweenFilter.js +0 -26
  254. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/DateBetweenFilter/DateBetweenFilter.js.map +0 -1
  255. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/DateBetweenFilter/index.d.ts +0 -2
  256. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/DateBetweenFilter/index.js +0 -6
  257. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/DateBetweenFilter/index.js.map +0 -1
  258. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/DateFilter/DateFilter.d.ts +0 -3
  259. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/DateFilter/DateFilter.js +0 -22
  260. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/DateFilter/DateFilter.js.map +0 -1
  261. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/DateFilter/index.d.ts +0 -2
  262. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/DateFilter/index.js +0 -6
  263. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/DateFilter/index.js.map +0 -1
  264. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/NumericFilter/NumericFilter.d.ts +0 -3
  265. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/NumericFilter/NumericFilter.js +0 -35
  266. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/NumericFilter/NumericFilter.js.map +0 -1
  267. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/NumericFilter/index.d.ts +0 -2
  268. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/NumericFilter/index.js +0 -6
  269. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/NumericFilter/index.js.map +0 -1
  270. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/TextFilter/TextFilter.d.ts +0 -3
  271. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/TextFilter/TextFilter.js +0 -34
  272. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/TextFilter/TextFilter.js.map +0 -1
  273. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/TextFilter/index.d.ts +0 -2
  274. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/TextFilter/index.js +0 -6
  275. package/dist/components/LibraryItemsList/FiltersPanel/Filter/FilterInput/TextFilter/index.js.map +0 -1
  276. package/dist/components/LibraryItemsList/FiltersPanel/Filter/filterUtils.d.ts +0 -2
  277. package/dist/components/LibraryItemsList/FiltersPanel/Filter/filterUtils.js +0 -16
  278. package/dist/components/LibraryItemsList/FiltersPanel/Filter/filterUtils.js.map +0 -1
  279. package/dist/components/LibraryItemsList/FiltersPanel/Filter/index.d.ts +0 -2
  280. package/dist/components/LibraryItemsList/FiltersPanel/Filter/index.js +0 -6
  281. package/dist/components/LibraryItemsList/FiltersPanel/Filter/index.js.map +0 -1
  282. package/dist/components/LibraryItemsList/FiltersPanel/FilterDropdownButton/FilterDropdownButton.d.ts +0 -8
  283. package/dist/components/LibraryItemsList/FiltersPanel/FilterDropdownButton/FilterDropdownButton.js +0 -11
  284. package/dist/components/LibraryItemsList/FiltersPanel/FilterDropdownButton/FilterDropdownButton.js.map +0 -1
  285. package/dist/components/LibraryItemsList/FiltersPanel/FilterDropdownButton/index.d.ts +0 -2
  286. package/dist/components/LibraryItemsList/FiltersPanel/FilterDropdownButton/index.js +0 -6
  287. package/dist/components/LibraryItemsList/FiltersPanel/FilterDropdownButton/index.js.map +0 -1
  288. package/dist/components/LibraryItemsList/FiltersPanel/FilterTreeCondition/FilterTreeCondition.d.ts +0 -6
  289. package/dist/components/LibraryItemsList/FiltersPanel/FilterTreeCondition/FilterTreeCondition.js +0 -38
  290. package/dist/components/LibraryItemsList/FiltersPanel/FilterTreeCondition/FilterTreeCondition.js.map +0 -1
  291. package/dist/components/LibraryItemsList/FiltersPanel/FilterTreeCondition/index.d.ts +0 -2
  292. package/dist/components/LibraryItemsList/FiltersPanel/FilterTreeCondition/index.js +0 -6
  293. package/dist/components/LibraryItemsList/FiltersPanel/FilterTreeCondition/index.js.map +0 -1
  294. package/dist/components/LibraryItemsList/FiltersPanel/FiltersOptions.d.ts +0 -14
  295. package/dist/components/LibraryItemsList/FiltersPanel/FiltersOptions.js +0 -147
  296. package/dist/components/LibraryItemsList/FiltersPanel/FiltersOptions.js.map +0 -1
  297. package/dist/components/LibraryItemsList/FiltersPanel/FiltersPanel.d.ts +0 -2
  298. package/dist/components/LibraryItemsList/FiltersPanel/FiltersPanel.js +0 -121
  299. package/dist/components/LibraryItemsList/FiltersPanel/FiltersPanel.js.map +0 -1
  300. package/dist/components/LibraryItemsList/FiltersPanel/index.d.ts +0 -2
  301. package/dist/components/LibraryItemsList/FiltersPanel/index.js +0 -6
  302. package/dist/components/LibraryItemsList/FiltersPanel/index.js.map +0 -1
  303. package/dist/components/LibraryItemsList/FiltersPanel/mustHideValue.d.ts +0 -3
  304. package/dist/components/LibraryItemsList/FiltersPanel/mustHideValue.js +0 -17
  305. package/dist/components/LibraryItemsList/FiltersPanel/mustHideValue.js.map +0 -1
  306. package/dist/components/LibraryItemsList/IconViewType/IconViewType.d.ts +0 -8
  307. package/dist/components/LibraryItemsList/IconViewType/IconViewType.js +0 -18
  308. package/dist/components/LibraryItemsList/IconViewType/IconViewType.js.map +0 -1
  309. package/dist/components/LibraryItemsList/IconViewType/index.d.ts +0 -2
  310. package/dist/components/LibraryItemsList/IconViewType/index.js +0 -6
  311. package/dist/components/LibraryItemsList/IconViewType/index.js.map +0 -1
  312. package/dist/components/LibraryItemsList/LibraryItemsList.d.ts +0 -14
  313. package/dist/components/LibraryItemsList/LibraryItemsList.js +0 -18
  314. package/dist/components/LibraryItemsList/LibraryItemsList.js.map +0 -1
  315. package/dist/components/LibraryItemsList/LibraryItemsListContent/LibraryItemsListContent.d.ts +0 -16
  316. package/dist/components/LibraryItemsList/LibraryItemsListContent/LibraryItemsListContent.js +0 -202
  317. package/dist/components/LibraryItemsList/LibraryItemsListContent/LibraryItemsListContent.js.map +0 -1
  318. package/dist/components/LibraryItemsList/LibraryItemsListContent/index.d.ts +0 -2
  319. package/dist/components/LibraryItemsList/LibraryItemsListContent/index.js +0 -6
  320. package/dist/components/LibraryItemsList/LibraryItemsListContent/index.js.map +0 -1
  321. package/dist/components/LibraryItemsList/LibraryItemsListEmpty/LibraryItemsListEmpty.d.ts +0 -6
  322. package/dist/components/LibraryItemsList/LibraryItemsListEmpty/LibraryItemsListEmpty.js +0 -32
  323. package/dist/components/LibraryItemsList/LibraryItemsListEmpty/LibraryItemsListEmpty.js.map +0 -1
  324. package/dist/components/LibraryItemsList/LibraryItemsListEmpty/index.d.ts +0 -2
  325. package/dist/components/LibraryItemsList/LibraryItemsListEmpty/index.js +0 -6
  326. package/dist/components/LibraryItemsList/LibraryItemsListEmpty/index.js.map +0 -1
  327. package/dist/components/LibraryItemsList/LibraryItemsListPagination/LibraryItemsListPagination.d.ts +0 -2
  328. package/dist/components/LibraryItemsList/LibraryItemsListPagination/LibraryItemsListPagination.js +0 -21
  329. package/dist/components/LibraryItemsList/LibraryItemsListPagination/LibraryItemsListPagination.js.map +0 -1
  330. package/dist/components/LibraryItemsList/LibraryItemsListPagination/index.d.ts +0 -2
  331. package/dist/components/LibraryItemsList/LibraryItemsListPagination/index.js +0 -6
  332. package/dist/components/LibraryItemsList/LibraryItemsListPagination/index.js.map +0 -1
  333. package/dist/components/LibraryItemsList/LibraryItemsListTable/BodyCell/BodyCell.d.ts +0 -8
  334. package/dist/components/LibraryItemsList/LibraryItemsListTable/BodyCell/BodyCell.js +0 -56
  335. package/dist/components/LibraryItemsList/LibraryItemsListTable/BodyCell/BodyCell.js.map +0 -1
  336. package/dist/components/LibraryItemsList/LibraryItemsListTable/BodyCell/index.d.ts +0 -2
  337. package/dist/components/LibraryItemsList/LibraryItemsListTable/BodyCell/index.js +0 -6
  338. package/dist/components/LibraryItemsList/LibraryItemsListTable/BodyCell/index.js.map +0 -1
  339. package/dist/components/LibraryItemsList/LibraryItemsListTable/BodyRow/BodyRow.d.ts +0 -7
  340. package/dist/components/LibraryItemsList/LibraryItemsListTable/BodyRow/BodyRow.js +0 -54
  341. package/dist/components/LibraryItemsList/LibraryItemsListTable/BodyRow/BodyRow.js.map +0 -1
  342. package/dist/components/LibraryItemsList/LibraryItemsListTable/BodyRow/index.d.ts +0 -2
  343. package/dist/components/LibraryItemsList/LibraryItemsListTable/BodyRow/index.js +0 -6
  344. package/dist/components/LibraryItemsList/LibraryItemsListTable/BodyRow/index.js.map +0 -1
  345. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/AllValuesCount/AllValuesCount.d.ts +0 -8
  346. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/AllValuesCount/AllValuesCount.js +0 -66
  347. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/AllValuesCount/AllValuesCount.js.map +0 -1
  348. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/AllValuesCount/index.d.ts +0 -2
  349. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/AllValuesCount/index.js +0 -6
  350. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/AllValuesCount/index.js.map +0 -1
  351. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/Cell.d.ts +0 -8
  352. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/Cell.js +0 -59
  353. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/Cell.js.map +0 -1
  354. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/CellInfos/CellInfos.d.ts +0 -9
  355. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/CellInfos/CellInfos.js +0 -56
  356. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/CellInfos/CellInfos.js.map +0 -1
  357. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/CellInfos/index.d.ts +0 -2
  358. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/CellInfos/index.js +0 -6
  359. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/CellInfos/index.js.map +0 -1
  360. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/CellSelection/CellSelection.d.ts +0 -5
  361. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/CellSelection/CellSelection.js +0 -34
  362. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/CellSelection/CellSelection.js.map +0 -1
  363. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/CellSelection/index.d.ts +0 -2
  364. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/CellSelection/index.js +0 -6
  365. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/CellSelection/index.js.map +0 -1
  366. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/ElementsToDisplay/RichTextDisplay.d.ts +0 -5
  367. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/ElementsToDisplay/RichTextDisplay.js +0 -23
  368. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/ElementsToDisplay/RichTextDisplay.js.map +0 -1
  369. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/StandardCell.d.ts +0 -3
  370. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/StandardCell.js +0 -80
  371. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/StandardCell.js.map +0 -1
  372. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/index.d.ts +0 -2
  373. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/index.js +0 -6
  374. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/index.js.map +0 -1
  375. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/index.d.ts +0 -2
  376. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/index.js +0 -6
  377. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/index.js.map +0 -1
  378. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/typeGuards.d.ts +0 -12
  379. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/typeGuards.js +0 -11
  380. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/typeGuards.js.map +0 -1
  381. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/types.d.ts +0 -12
  382. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/types.js +0 -2
  383. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/types.js.map +0 -1
  384. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/utils.d.ts +0 -2
  385. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/utils.js +0 -40
  386. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/utils.js.map +0 -1
  387. package/dist/components/LibraryItemsList/LibraryItemsListTable/ChooseTableColumns/ChooseTableColumns.d.ts +0 -6
  388. package/dist/components/LibraryItemsList/LibraryItemsListTable/ChooseTableColumns/ChooseTableColumns.js +0 -81
  389. package/dist/components/LibraryItemsList/LibraryItemsListTable/ChooseTableColumns/ChooseTableColumns.js.map +0 -1
  390. package/dist/components/LibraryItemsList/LibraryItemsListTable/ChooseTableColumns/index.d.ts +0 -2
  391. package/dist/components/LibraryItemsList/LibraryItemsListTable/ChooseTableColumns/index.js +0 -6
  392. package/dist/components/LibraryItemsList/LibraryItemsListTable/ChooseTableColumns/index.js.map +0 -1
  393. package/dist/components/LibraryItemsList/LibraryItemsListTable/Header/Header.d.ts +0 -9
  394. package/dist/components/LibraryItemsList/LibraryItemsListTable/Header/Header.js +0 -142
  395. package/dist/components/LibraryItemsList/LibraryItemsListTable/Header/Header.js.map +0 -1
  396. package/dist/components/LibraryItemsList/LibraryItemsListTable/Header/index.d.ts +0 -2
  397. package/dist/components/LibraryItemsList/LibraryItemsListTable/Header/index.js +0 -6
  398. package/dist/components/LibraryItemsList/LibraryItemsListTable/Header/index.js.map +0 -1
  399. package/dist/components/LibraryItemsList/LibraryItemsListTable/Table.d.ts +0 -2
  400. package/dist/components/LibraryItemsList/LibraryItemsListTable/Table.js +0 -232
  401. package/dist/components/LibraryItemsList/LibraryItemsListTable/Table.js.map +0 -1
  402. package/dist/components/LibraryItemsList/LibraryItemsListTable/index.d.ts +0 -2
  403. package/dist/components/LibraryItemsList/LibraryItemsListTable/index.js +0 -6
  404. package/dist/components/LibraryItemsList/LibraryItemsListTable/index.js.map +0 -1
  405. package/dist/components/LibraryItemsList/MenuItemList/MenuItemList.d.ts +0 -9
  406. package/dist/components/LibraryItemsList/MenuItemList/MenuItemList.js +0 -27
  407. package/dist/components/LibraryItemsList/MenuItemList/MenuItemList.js.map +0 -1
  408. package/dist/components/LibraryItemsList/MenuItemList/index.d.ts +0 -2
  409. package/dist/components/LibraryItemsList/MenuItemList/index.js +0 -6
  410. package/dist/components/LibraryItemsList/MenuItemList/index.js.map +0 -1
  411. package/dist/components/LibraryItemsList/MenuItemListSelected/ActionsMenu/ActionsMenu.d.ts +0 -2
  412. package/dist/components/LibraryItemsList/MenuItemListSelected/ActionsMenu/ActionsMenu.js +0 -62
  413. package/dist/components/LibraryItemsList/MenuItemListSelected/ActionsMenu/ActionsMenu.js.map +0 -1
  414. package/dist/components/LibraryItemsList/MenuItemListSelected/ActionsMenu/index.d.ts +0 -2
  415. package/dist/components/LibraryItemsList/MenuItemListSelected/ActionsMenu/index.js +0 -6
  416. package/dist/components/LibraryItemsList/MenuItemListSelected/ActionsMenu/index.js.map +0 -1
  417. package/dist/components/LibraryItemsList/MenuItemListSelected/MenuItemListSelected.d.ts +0 -5
  418. package/dist/components/LibraryItemsList/MenuItemListSelected/MenuItemListSelected.js +0 -139
  419. package/dist/components/LibraryItemsList/MenuItemListSelected/MenuItemListSelected.js.map +0 -1
  420. package/dist/components/LibraryItemsList/MenuItemListSelected/index.d.ts +0 -2
  421. package/dist/components/LibraryItemsList/MenuItemListSelected/index.js +0 -6
  422. package/dist/components/LibraryItemsList/MenuItemListSelected/index.js.map +0 -1
  423. package/dist/components/LibraryItemsList/MenuSelection/MenuSelection.d.ts +0 -2
  424. package/dist/components/LibraryItemsList/MenuSelection/MenuSelection.js +0 -58
  425. package/dist/components/LibraryItemsList/MenuSelection/MenuSelection.js.map +0 -1
  426. package/dist/components/LibraryItemsList/MenuSelection/index.d.ts +0 -2
  427. package/dist/components/LibraryItemsList/MenuSelection/index.js +0 -6
  428. package/dist/components/LibraryItemsList/MenuSelection/index.js.map +0 -1
  429. package/dist/components/LibraryItemsList/MenuView/MenuView.d.ts +0 -6
  430. package/dist/components/LibraryItemsList/MenuView/MenuView.js +0 -162
  431. package/dist/components/LibraryItemsList/MenuView/MenuView.js.map +0 -1
  432. package/dist/components/LibraryItemsList/MenuView/index.d.ts +0 -2
  433. package/dist/components/LibraryItemsList/MenuView/index.js +0 -6
  434. package/dist/components/LibraryItemsList/MenuView/index.js.map +0 -1
  435. package/dist/components/LibraryItemsList/SearchItems/SearchItems.d.ts +0 -2
  436. package/dist/components/LibraryItemsList/SearchItems/SearchItems.js +0 -21
  437. package/dist/components/LibraryItemsList/SearchItems/SearchItems.js.map +0 -1
  438. package/dist/components/LibraryItemsList/SearchItems/index.d.ts +0 -2
  439. package/dist/components/LibraryItemsList/SearchItems/index.js +0 -6
  440. package/dist/components/LibraryItemsList/SearchItems/index.js.map +0 -1
  441. package/dist/components/LibraryItemsList/Sidebar/Sidebar.d.ts +0 -2
  442. package/dist/components/LibraryItemsList/Sidebar/Sidebar.js +0 -58
  443. package/dist/components/LibraryItemsList/Sidebar/Sidebar.js.map +0 -1
  444. package/dist/components/LibraryItemsList/Sidebar/index.d.ts +0 -2
  445. package/dist/components/LibraryItemsList/Sidebar/index.js +0 -6
  446. package/dist/components/LibraryItemsList/Sidebar/index.js.map +0 -1
  447. package/dist/components/LibraryItemsList/TileDisplay/ItemTileDisplay/ItemTileDisplay.d.ts +0 -6
  448. package/dist/components/LibraryItemsList/TileDisplay/ItemTileDisplay/ItemTileDisplay.js +0 -199
  449. package/dist/components/LibraryItemsList/TileDisplay/ItemTileDisplay/ItemTileDisplay.js.map +0 -1
  450. package/dist/components/LibraryItemsList/TileDisplay/ItemTileDisplay/index.d.ts +0 -2
  451. package/dist/components/LibraryItemsList/TileDisplay/ItemTileDisplay/index.js +0 -6
  452. package/dist/components/LibraryItemsList/TileDisplay/ItemTileDisplay/index.js.map +0 -1
  453. package/dist/components/LibraryItemsList/TileDisplay/TileDisplay.d.ts +0 -2
  454. package/dist/components/LibraryItemsList/TileDisplay/TileDisplay.js +0 -50
  455. package/dist/components/LibraryItemsList/TileDisplay/TileDisplay.js.map +0 -1
  456. package/dist/components/LibraryItemsList/TileDisplay/helpers/getItemPreviewSize.d.ts +0 -3
  457. package/dist/components/LibraryItemsList/TileDisplay/helpers/getItemPreviewSize.js +0 -11
  458. package/dist/components/LibraryItemsList/TileDisplay/helpers/getItemPreviewSize.js.map +0 -1
  459. package/dist/components/LibraryItemsList/TileDisplay/index.d.ts +0 -2
  460. package/dist/components/LibraryItemsList/TileDisplay/index.js +0 -6
  461. package/dist/components/LibraryItemsList/TileDisplay/index.js.map +0 -1
  462. package/dist/components/LibraryItemsList/VersionsPanel/VersionsPanel.d.ts +0 -2
  463. package/dist/components/LibraryItemsList/VersionsPanel/VersionsPanel.js +0 -66
  464. package/dist/components/LibraryItemsList/VersionsPanel/VersionsPanel.js.map +0 -1
  465. package/dist/components/LibraryItemsList/VersionsPanel/index.d.ts +0 -2
  466. package/dist/components/LibraryItemsList/VersionsPanel/index.js +0 -6
  467. package/dist/components/LibraryItemsList/VersionsPanel/index.js.map +0 -1
  468. package/dist/components/LibraryItemsList/ViewPanel/EditView/EditView.d.ts +0 -9
  469. package/dist/components/LibraryItemsList/ViewPanel/EditView/EditView.js +0 -85
  470. package/dist/components/LibraryItemsList/ViewPanel/EditView/EditView.js.map +0 -1
  471. package/dist/components/LibraryItemsList/ViewPanel/EditView/index.d.ts +0 -2
  472. package/dist/components/LibraryItemsList/ViewPanel/EditView/index.js +0 -6
  473. package/dist/components/LibraryItemsList/ViewPanel/EditView/index.js.map +0 -1
  474. package/dist/components/LibraryItemsList/ViewPanel/View/View.d.ts +0 -7
  475. package/dist/components/LibraryItemsList/ViewPanel/View/View.js +0 -152
  476. package/dist/components/LibraryItemsList/ViewPanel/View/View.js.map +0 -1
  477. package/dist/components/LibraryItemsList/ViewPanel/View/index.d.ts +0 -2
  478. package/dist/components/LibraryItemsList/ViewPanel/View/index.js +0 -6
  479. package/dist/components/LibraryItemsList/ViewPanel/View/index.js.map +0 -1
  480. package/dist/components/LibraryItemsList/ViewPanel/ViewPanel.d.ts +0 -2
  481. package/dist/components/LibraryItemsList/ViewPanel/ViewPanel.js +0 -209
  482. package/dist/components/LibraryItemsList/ViewPanel/ViewPanel.js.map +0 -1
  483. package/dist/components/LibraryItemsList/ViewPanel/index.d.ts +0 -2
  484. package/dist/components/LibraryItemsList/ViewPanel/index.js +0 -6
  485. package/dist/components/LibraryItemsList/ViewPanel/index.js.map +0 -1
  486. package/dist/components/LibraryItemsList/constants.d.ts +0 -12
  487. package/dist/components/LibraryItemsList/constants.js +0 -19
  488. package/dist/components/LibraryItemsList/constants.js.map +0 -1
  489. package/dist/components/LibraryItemsList/helpers/defaultFilterConditionByAttributeFormat.d.ts +0 -3
  490. package/dist/components/LibraryItemsList/helpers/defaultFilterConditionByAttributeFormat.js +0 -21
  491. package/dist/components/LibraryItemsList/helpers/defaultFilterConditionByAttributeFormat.js.map +0 -1
  492. package/dist/components/LibraryItemsList/helpers/displayTypeToPreviewSize.d.ts +0 -3
  493. package/dist/components/LibraryItemsList/helpers/displayTypeToPreviewSize.js +0 -18
  494. package/dist/components/LibraryItemsList/helpers/displayTypeToPreviewSize.js.map +0 -1
  495. package/dist/components/LibraryItemsList/helpers/extractAttributesFromLibrary.d.ts +0 -4
  496. package/dist/components/LibraryItemsList/helpers/extractAttributesFromLibrary.js +0 -64
  497. package/dist/components/LibraryItemsList/helpers/extractAttributesFromLibrary.js.map +0 -1
  498. package/dist/components/LibraryItemsList/helpers/getFieldFromKey.d.ts +0 -5
  499. package/dist/components/LibraryItemsList/helpers/getFieldFromKey.js +0 -40
  500. package/dist/components/LibraryItemsList/helpers/getFieldFromKey.js.map +0 -1
  501. package/dist/components/LibraryItemsList/helpers/getFieldsFromView.d.ts +0 -6
  502. package/dist/components/LibraryItemsList/helpers/getFieldsFromView.js +0 -10
  503. package/dist/components/LibraryItemsList/helpers/getFieldsFromView.js.map +0 -1
  504. package/dist/components/LibraryItemsList/helpers/getFieldsKeyFromAttribute.d.ts +0 -2
  505. package/dist/components/LibraryItemsList/helpers/getFieldsKeyFromAttribute.js +0 -13
  506. package/dist/components/LibraryItemsList/helpers/getFieldsKeyFromAttribute.js.map +0 -1
  507. package/dist/components/LibraryItemsList/helpers/getSortFieldByAttributeType.d.ts +0 -2
  508. package/dist/components/LibraryItemsList/helpers/getSortFieldByAttributeType.js +0 -18
  509. package/dist/components/LibraryItemsList/helpers/getSortFieldByAttributeType.js.map +0 -1
  510. package/dist/components/LibraryItemsList/hooks/useLibraryView/useLibraryView.d.ts +0 -8
  511. package/dist/components/LibraryItemsList/hooks/useLibraryView/useLibraryView.js +0 -99
  512. package/dist/components/LibraryItemsList/hooks/useLibraryView/useLibraryView.js.map +0 -1
  513. package/dist/components/LibraryItemsList/hooks/useSearchReducer/_types.d.ts +0 -82
  514. package/dist/components/LibraryItemsList/hooks/useSearchReducer/_types.js +0 -2
  515. package/dist/components/LibraryItemsList/hooks/useSearchReducer/_types.js.map +0 -1
  516. package/dist/components/LibraryItemsList/hooks/useSearchReducer/index.d.ts +0 -2
  517. package/dist/components/LibraryItemsList/hooks/useSearchReducer/index.js +0 -6
  518. package/dist/components/LibraryItemsList/hooks/useSearchReducer/index.js.map +0 -1
  519. package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchContext.d.ts +0 -7
  520. package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchContext.js +0 -7
  521. package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchContext.js.map +0 -1
  522. package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.d.ts +0 -121
  523. package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.js +0 -228
  524. package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.js.map +0 -1
  525. package/dist/components/LibraryItemsList/hooks/useSearchReducer/useSearchReducer.d.ts +0 -5
  526. package/dist/components/LibraryItemsList/hooks/useSearchReducer/useSearchReducer.js +0 -8
  527. package/dist/components/LibraryItemsList/hooks/useSearchReducer/useSearchReducer.js.map +0 -1
  528. package/dist/components/LibraryItemsList/hooks/useUpdateViewsOrderMutation.d.ts +0 -7
  529. package/dist/components/LibraryItemsList/hooks/useUpdateViewsOrderMutation.js +0 -40
  530. package/dist/components/LibraryItemsList/hooks/useUpdateViewsOrderMutation.js.map +0 -1
  531. package/dist/components/LibraryItemsList/index.d.ts +0 -1
  532. package/dist/components/LibraryItemsList/index.js +0 -5
  533. package/dist/components/LibraryItemsList/index.js.map +0 -1
  534. package/dist/components/LibraryItemsList/manageItems.d.ts +0 -11
  535. package/dist/components/LibraryItemsList/manageItems.js +0 -98
  536. package/dist/components/LibraryItemsList/manageItems.js.map +0 -1
  537. package/dist/components/LibraryItemsList/shared/DeactivateRecordBtn/DeactivateRecordBtn.d.ts +0 -7
  538. package/dist/components/LibraryItemsList/shared/DeactivateRecordBtn/DeactivateRecordBtn.js +0 -38
  539. package/dist/components/LibraryItemsList/shared/DeactivateRecordBtn/DeactivateRecordBtn.js.map +0 -1
  540. package/dist/components/LibraryItemsList/shared/DeactivateRecordBtn/index.d.ts +0 -2
  541. package/dist/components/LibraryItemsList/shared/DeactivateRecordBtn/index.js +0 -6
  542. package/dist/components/LibraryItemsList/shared/DeactivateRecordBtn/index.js.map +0 -1
  543. package/dist/components/LibraryItemsList/shared/SelectCellsBtn.d.ts +0 -12
  544. package/dist/components/LibraryItemsList/shared/SelectCellsBtn.js +0 -29
  545. package/dist/components/LibraryItemsList/shared/SelectCellsBtn.js.map +0 -1
  546. package/dist/components/LibraryItemsList/shared/sharedUtils.d.ts +0 -4
  547. package/dist/components/LibraryItemsList/shared/sharedUtils.js +0 -9
  548. package/dist/components/LibraryItemsList/shared/sharedUtils.js.map +0 -1
  549. /package/dist/components/Filters/filter-items/{SelectAllCheckbox.d.ts → shared/SelectAllCheckbox.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"prepareViewForRequest.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,+BAA+B,EAAC,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,EAAgB,MAAM,+BAA+B,CAAC;AAEpH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACjC,IAAwB,EACxB,OAAmB,EACnB,KAA6B,EACpB,EAAE,CAAC,CAAC;IACb,OAAO,EAAE,IAAI,CAAC,SAAS;IACvB,MAAM,EAAE,KAAK;IACb,OAAO,EAAE;QACL,IAAI,EAAE,+BAA+B,CAAC,IAAI,CAAC,QAAQ,CAAC;KACvD;IACD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAqB,EAAE;QAC/C,IAAI,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,OAAO;gBACH,oIAAoI;gBACpI,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,EAAE;gBAC1B,0FAA0F;gBAC1F,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBACxB,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,eAAe,EAAE,MAAM,CAAC,eAAe;aAC1C,CAAC;QACN,CAAC;QACD,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,OAAO;gBACH,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE;gBAC3C,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,SAAS,EAAE,MAAM,CAAC,YAAY;aACjC,CAAC;QACN,CAAC;QAED,IAAI,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9B,OAAO;gBACH,oIAAoI;gBACpI,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,EAAE;gBAC1B,qFAAqF;gBACrF,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBACxB,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,eAAe,EAAE,MAAM,CAAC,eAAe;aAC1C,CAAC;QACN,CAAC;QAED,OAAO;YACH,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,eAAe,EAAE,MAAM,CAAC,eAAe;SAC1C,CAAC;IACN,CAAC,CAAC;IACF,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC;IACzD,UAAU,EAAE,IAAI,CAAC,aAAa;IAC9B,KAAK;CACR,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type RecordFilterInput, type ViewInput} from '_ui/_gqlTypes';\nimport {mapViewTypeFromExplorerToLegacy} from '../../_constants';\nimport {type IViewSettingsState} from '../store-view-settings/viewSettingsReducer';\nimport {isUIFilterTree, isUIFilterThrough, isUIFilterValueList, type UIFilter} from '_ui/components/Filters/_types';\n\nexport const prepareViewForRequest = (\n view: IViewSettingsState,\n filters: UIFilter[],\n label: Record<string, string>,\n): ViewInput => ({\n library: view.libraryId,\n shared: false,\n display: {\n type: mapViewTypeFromExplorerToLegacy[view.viewType],\n },\n filters: filters.map((filter): RecordFilterInput => {\n if (isUIFilterTree(filter)) {\n return {\n // TODO save filter.field, but need to handle Through an other way in useTransformFilters.toValidFilters to keep that field as saved\n field: filter.attribute.id,\n // TODO : save filter values as string[] when tree filter and handle fields with libraries\n value: filter.value?.[0],\n condition: filter.condition,\n withEmptyValues: filter.withEmptyValues,\n };\n }\n if (isUIFilterThrough(filter)) {\n return {\n field: `${filter.field}.${filter.subField}`,\n value: filter.value,\n condition: filter.subCondition,\n };\n }\n\n if (isUIFilterValueList(filter)) {\n return {\n // TODO save filter.field, but need to handle Through an other way in useTransformFilters.toValidFilters to keep that field as saved\n field: filter.attribute.id,\n // TODO : save filter values as string[] when filter and handle fields with libraries\n value: filter.value?.[0],\n condition: filter.condition,\n withEmptyValues: filter.withEmptyValues,\n };\n }\n\n return {\n field: filter.field,\n value: filter.value,\n condition: filter.condition,\n withEmptyValues: filter.withEmptyValues,\n };\n }),\n sort: view.sort.map(({field, order}) => ({field, order})),\n attributes: view.attributesIds,\n label,\n});\n"]}
1
+ {"version":3,"file":"prepareViewForRequest.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,+BAA+B,EAAC,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EACH,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EAEnB,yBAAyB,GAC5B,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,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AAC;YAC5B,OAAO;gBACH,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE;gBAC3C,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,SAAS,EAAE,MAAM,CAAC,YAAY;aACjC,CAAC;QACN,CAAC;QAED,OAAO;YACH,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,eAAe,EAAE,MAAM,CAAC,eAAe;SAC1C,CAAC;IACN,CAAC,CAAC;IACF,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC;IACzD,UAAU,EAAE,IAAI,CAAC,aAAa;IAC9B,KAAK;CACR,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type RecordFilterInput, type ViewInput} from '_ui/_gqlTypes';\nimport {mapViewTypeFromExplorerToLegacy} from '../../_constants';\nimport {type IViewSettingsState} from '../store-view-settings/viewSettingsReducer';\nimport {\n isUIFilterTree,\n isUIFilterThrough,\n isUIFilterValueList,\n type UIFilter,\n isUIFilterWithSmartFilter,\n} from '_ui/components/Filters/_types';\n\nexport const prepareViewForRequest = (\n view: IViewSettingsState,\n filters: UIFilter[],\n label: Record<string, string>,\n): ViewInput => ({\n library: view.libraryId,\n shared: false,\n display: {\n type: mapViewTypeFromExplorerToLegacy[view.viewType],\n },\n filters: filters.map((filter): RecordFilterInput => {\n if (isUIFilterTree(filter)) {\n return {\n // TODO save filter.field, but need to handle Through an other way in useTransformFilters.toValidFilters to keep that field as saved\n field: filter.attribute.id,\n // TODO : save filter values as string[] when tree filter and handle fields with libraries\n value: filter.value?.[0],\n condition: filter.condition,\n withEmptyValues: filter.withEmptyValues,\n };\n }\n\n if (isUIFilterValueList(filter)) {\n return {\n // TODO save filter.field, but need to handle Through an other way in useTransformFilters.toValidFilters to keep that field as saved\n field: filter.attribute.id,\n // TODO : save filter values as string[] when filter and handle fields with libraries\n value: filter.value?.[0],\n condition: filter.condition,\n withEmptyValues: filter.withEmptyValues,\n };\n }\n\n if (isUIFilterWithSmartFilter(filter)) {\n return {\n field: filter.field, // We use the field here because we want to keep the full path to the attribute (ex: link_attribute.id)\n // TODO : save filter values as string[] when filter and handle fields with libraries\n value: filter.value?.[0],\n condition: filter.condition,\n withEmptyValues: filter.withEmptyValues,\n };\n }\n\n if (isUIFilterThrough(filter)) {\n return {\n field: `${filter.field}.${filter.subField}`,\n value: filter.value,\n condition: filter.subCondition,\n };\n }\n\n return {\n field: filter.field,\n value: filter.value,\n condition: filter.condition,\n withEmptyValues: filter.withEmptyValues,\n };\n }),\n sort: view.sort.map(({field, order}) => ({field, order})),\n attributes: view.attributesIds,\n label,\n});\n"]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Generates recursive GraphQL for tree node children.
3
+ * Used to fetch nested children up to the specified depth.
4
+ */
5
+ export declare const treeFiltersTreeNodeChildren: (depth?: number) => string;
6
+ export declare const treeFiltersDataQuery: (depthTreeNodes?: number) => import("@apollo/client").DocumentNode;
@@ -0,0 +1,54 @@
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 { gql } from '@apollo/client';
5
+ const DEFAULT_DEPTH_TREE_NODES = 10;
6
+ /**
7
+ * Generates recursive GraphQL for tree node children.
8
+ * Used to fetch nested children up to the specified depth.
9
+ */
10
+ export const treeFiltersTreeNodeChildren = (depth = 0) => `
11
+ children {
12
+ id
13
+ record {
14
+ id
15
+ whoAmI {
16
+ id
17
+ label
18
+ library {
19
+ id
20
+ }
21
+ }
22
+ }
23
+ accessRecordByDefaultPermission
24
+ ${depth > 0 ? treeFiltersTreeNodeChildren(depth - 1) : ''}
25
+ }
26
+ `;
27
+ export const treeFiltersDataQuery = (depthTreeNodes = DEFAULT_DEPTH_TREE_NODES) => gql `
28
+ query TreeFiltersDataQuery(
29
+ $treeId: ID!
30
+ $startAt: ID
31
+ $accessRecordByDefaultPermission: AccessRecordByDefaultPermissionInput
32
+ ) {
33
+ treeContent(
34
+ treeId: $treeId
35
+ startAt: $startAt
36
+ accessRecordByDefaultPermission: $accessRecordByDefaultPermission
37
+ ) {
38
+ id
39
+ record {
40
+ id
41
+ whoAmI {
42
+ id
43
+ label
44
+ library {
45
+ id
46
+ }
47
+ }
48
+ }
49
+ ${treeFiltersTreeNodeChildren(depthTreeNodes - 1)}
50
+ accessRecordByDefaultPermission
51
+ }
52
+ }
53
+ `;
54
+ //# sourceMappingURL=treeFiltersDataQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeFiltersDataQuery.js","sourceRoot":"","sources":["../../../../src/components/Filters/_queries/treeFiltersDataQuery.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,GAAG,EAAC,MAAM,gBAAgB,CAAC;AAEnC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAEpC;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC;;;;;;;;;;;;;;UAchD,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,2BAA2B,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;;CAEhE,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,cAAc,GAAG,wBAAwB,EAAE,EAAE,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;cAsBxE,2BAA2B,CAAC,cAAc,GAAG,CAAC,CAAC;;;;CAI5D,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {gql} from '@apollo/client';\n\nconst DEFAULT_DEPTH_TREE_NODES = 10;\n\n/**\n * Generates recursive GraphQL for tree node children.\n * Used to fetch nested children up to the specified depth.\n */\nexport const treeFiltersTreeNodeChildren = (depth = 0) => `\n children {\n id\n record {\n id\n whoAmI {\n id\n label\n library {\n id\n }\n }\n }\n accessRecordByDefaultPermission\n ${depth > 0 ? treeFiltersTreeNodeChildren(depth - 1) : ''}\n }\n`;\n\nexport const treeFiltersDataQuery = (depthTreeNodes = DEFAULT_DEPTH_TREE_NODES) => gql`\n query TreeFiltersDataQuery(\n $treeId: ID!\n $startAt: ID\n $accessRecordByDefaultPermission: AccessRecordByDefaultPermissionInput\n ) {\n treeContent(\n treeId: $treeId\n startAt: $startAt\n accessRecordByDefaultPermission: $accessRecordByDefaultPermission\n ) {\n id\n record {\n id\n whoAmI {\n id\n label\n library {\n id\n }\n }\n }\n ${treeFiltersTreeNodeChildren(depthTreeNodes - 1)}\n accessRecordByDefaultPermission\n }\n }\n`;\n"]}
@@ -24,6 +24,9 @@ export interface IUIFilterLinkAttribute extends IUIFilterBaseAttribute {
24
24
  linkedLibrary?: {
25
25
  id: string;
26
26
  };
27
+ smartFilter?: {
28
+ enable?: boolean;
29
+ };
27
30
  }
28
31
  export interface IUIFilterTreeAttribute extends IUIFilterBaseAttribute {
29
32
  linkedTree?: {
@@ -74,6 +77,13 @@ export interface IUIFilterTree extends Omit<IUIFilterBase, 'value' | 'formattedV
74
77
  }>;
75
78
  field: string[];
76
79
  }
80
+ export interface IUIFilterSmartFiler extends Omit<IUIFilterBase, 'value' | 'formattedValue'> {
81
+ attribute: IUIFilterLinkAttribute;
82
+ value: string[] | null;
83
+ formattedValue?: string[] | null;
84
+ condition: RecordFilterCondition | null;
85
+ field: string;
86
+ }
77
87
  export interface IUIFilterValueList extends Omit<IUIFilterBase, 'value' | 'formattedValue'> {
78
88
  attribute: (IUIFilterStandardAttribute | IUIFilterLinkAttribute) & {
79
89
  valuesList: NonNullable<StandardAttributeDetailsFragment['valuesList']> | NonNullable<LinkAttributeDetailsFragment['valuesList']>;
@@ -100,7 +110,7 @@ export interface IUIFilterTreeValueList extends Omit<IUIFilterTree, 'attribute'
100
110
  };
101
111
  field: string[];
102
112
  }
103
- export type UIFilter = IUIFilterStandard | IUIFilterLink | IUIFilterThrough | IUIFilterValueList | IUIFilterTree;
113
+ export type UIFilter = IUIFilterStandard | IUIFilterLink | IUIFilterThrough | IUIFilterValueList | IUIFilterTree | IUIFilterSmartFiler;
104
114
  export declare const isUIFilterStandard: (filter: UIFilter) => filter is IUIFilterStandard;
105
115
  export declare const isUIFilterLink: (filter: UIFilter) => filter is IUIFilterLink;
106
116
  export declare const isUIFilterThrough: (filter: UIFilter) => filter is IUIFilterThrough;
@@ -109,6 +119,7 @@ export declare const isUIFilterStandardWithValueList: (filter: UIFilter) => filt
109
119
  export declare const isUIFilterLinkWithValueList: (filter: UIFilter) => filter is IUIFilterLinkValueList;
110
120
  export declare const isUIFilterTree: (filter: UIFilter) => filter is IUIFilterTree;
111
121
  export declare const isUIFilterTreeWithValueList: (filter: UIFilter) => filter is IUIFilterTreeValueList;
122
+ export declare const isUIFilterWithSmartFilter: (filter: UIFilter) => filter is IUIFilterSmartFiler;
112
123
  export interface IUIFilterDropDownProps {
113
124
  filter: UIFilter;
114
125
  canReset: boolean;
@@ -5,10 +5,11 @@ export const isUIFilterLink = (filter) => [AttributeType.simple_link, AttributeT
5
5
  filter.condition !== ThroughConditionFilter.THROUGH;
6
6
  export const isUIFilterThrough = (filter) => [AttributeType.simple_link, AttributeType.advanced_link].includes(filter.attribute.type) &&
7
7
  filter.condition === ThroughConditionFilter.THROUGH;
8
- export const isUIFilterValueList = (filter) => (isUIFilterStandard(filter) || isUIFilterLink(filter)) && isValueList(filter);
8
+ export const isUIFilterValueList = (filter) => (isUIFilterStandard(filter) || isUIFilterLink(filter) || isUIFilterWithSmartFilter(filter)) && isValueList(filter);
9
9
  export const isUIFilterStandardWithValueList = (filter) => [AttributeType.simple, AttributeType.advanced].includes(filter.attribute.type) && isValueList(filter);
10
10
  export const isUIFilterLinkWithValueList = (filter) => [AttributeType.simple_link, AttributeType.advanced_link].includes(filter.attribute.type) && isValueList(filter);
11
11
  export const isUIFilterTree = (filter) => filter.attribute.type === AttributeType.tree;
12
12
  export const isUIFilterTreeWithValueList = (filter) => isUIFilterTree(filter) && isValueList(filter);
13
+ export const isUIFilterWithSmartFilter = (filter) => (isUIFilterLink(filter) || isUIFilterThrough(filter)) && filter.attribute.smartFilter?.enable;
13
14
  const isValueList = (filter) => !!filter.attribute?.valuesList && filter.attribute?.valuesList.enable;
14
15
  //# sourceMappingURL=_types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../src/components/Filters/_types.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,aAAa,GAKhB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AAqHxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAgB,EAA+B,EAAE,CAChF,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAEnF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAgB,EAA2B,EAAE,CACxE,CAAC,aAAa,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;IACxF,MAAM,CAAC,SAAS,KAAK,sBAAsB,CAAC,OAAO,CAAC;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAgB,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EAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type Override} from '@leav/utils';\nimport {\n type AttributeFormat,\n AttributeType,\n type LinkAttributeDetailsFragment,\n type RecordFilterCondition,\n type StandardAttributeDetailsFragment,\n type ViewDetailsFilterFragment,\n} from '_ui/_gqlTypes';\nimport {ThroughConditionFilter} from '_ui/types/search';\n\nexport type FiltersOperator = 'AND' | 'OR';\n\nexport interface IUIFilterBaseAttribute {\n type: AttributeType;\n /**\n * Used to display the label of the filter.\n *\n * > Not displayed when filter is hidden\n */\n label: string;\n /**\n * Used to verify unicity: one filter per attribute\n */\n id: string;\n format?: AttributeFormat | null | undefined;\n valuesList?:\n | NonNullable<StandardAttributeDetailsFragment['valuesList']>\n | NonNullable<LinkAttributeDetailsFragment['valuesList']>;\n}\n\nexport interface IUIFilterStandardAttribute extends IUIFilterBaseAttribute {\n format: AttributeFormat;\n}\n\nexport interface IUIFilterLinkAttribute extends IUIFilterBaseAttribute {\n linkedLibrary?: {\n id: string;\n };\n}\n\nexport interface IUIFilterTreeAttribute extends IUIFilterBaseAttribute {\n linkedTree?: {\n id: string;\n };\n}\n\ninterface IUIFilterBase {\n id: string;\n attribute: IUIFilterBaseAttribute;\n condition: RecordFilterCondition | ThroughConditionFilter | null;\n /**\n * Used to build filter field.\n *\n * - ex: `campaigns_id_pac`\n * - ex with **subField**: `campaigns_id_pac.id`\n */\n field: any;\n value: string | null;\n formattedValue?: string | null;\n hidden?: boolean | undefined;\n withEmptyValues?: boolean;\n}\n\nexport interface IUIFilterStandard extends Omit<IUIFilterBase, 'field'> {\n attribute: IUIFilterStandardAttribute;\n condition: RecordFilterCondition | null;\n field: string;\n}\n\nexport interface IUIFilterLink extends Omit<IUIFilterBase, 'field'> {\n attribute: IUIFilterLinkAttribute;\n condition: RecordFilterCondition | null;\n field: string;\n}\n\nexport interface IUIFilterThrough extends Omit<IUIFilterBase, 'field'> {\n attribute: IUIFilterLinkAttribute;\n condition: ThroughConditionFilter.THROUGH | null;\n subCondition: RecordFilterCondition | null;\n subField: string | null;\n field: string;\n}\n\nexport interface IUIFilterTree extends Omit<IUIFilterBase, 'value' | 'formattedValue' | 'field'> {\n attribute: IUIFilterTreeAttribute;\n condition: RecordFilterCondition | null;\n value: string[] | null;\n formattedValue?: string[] | null;\n nodes?: null | Array<{nodeId: string; libraryId: string}>;\n field: string[];\n}\n\nexport interface IUIFilterValueList extends Omit<IUIFilterBase, 'value' | 'formattedValue'> {\n attribute: (IUIFilterStandardAttribute | IUIFilterLinkAttribute) & {\n valuesList:\n | NonNullable<StandardAttributeDetailsFragment['valuesList']>\n | NonNullable<LinkAttributeDetailsFragment['valuesList']>;\n };\n value: string[] | null;\n condition: RecordFilterCondition | null;\n field: string | string[];\n}\n\nexport interface IUIFilterStandardValueList extends Omit<IUIFilterStandard, 'attribute' | 'value'>, IUIFilterValueList {\n attribute: IUIFilterStandardAttribute & {\n valuesList: NonNullable<StandardAttributeDetailsFragment['valuesList']>;\n };\n field: string;\n}\n\nexport interface IUIFilterLinkValueList extends Omit<IUIFilterLink, 'attribute' | 'value'>, IUIFilterValueList {\n attribute: IUIFilterLinkAttribute & {\n valuesList: NonNullable<LinkAttributeDetailsFragment['valuesList']>;\n };\n field: string;\n}\nexport interface IUIFilterTreeValueList extends Omit<IUIFilterTree, 'attribute' | 'value'>, IUIFilterValueList {\n attribute: IUIFilterLinkAttribute & {\n valuesList: NonNullable<LinkAttributeDetailsFragment['valuesList']>;\n };\n field: string[];\n}\n\nexport type UIFilter = IUIFilterStandard | IUIFilterLink | IUIFilterThrough | IUIFilterValueList | IUIFilterTree;\n\nexport const isUIFilterStandard = (filter: UIFilter): filter is IUIFilterStandard =>\n [AttributeType.simple, AttributeType.advanced].includes(filter.attribute.type);\n\nexport const isUIFilterLink = (filter: UIFilter): filter is IUIFilterLink =>\n [AttributeType.simple_link, AttributeType.advanced_link].includes(filter.attribute.type) &&\n filter.condition !== ThroughConditionFilter.THROUGH;\n\nexport const isUIFilterThrough = (filter: UIFilter): filter is IUIFilterThrough =>\n [AttributeType.simple_link, AttributeType.advanced_link].includes(filter.attribute.type) &&\n filter.condition === ThroughConditionFilter.THROUGH;\n\nexport const isUIFilterValueList = (filter: UIFilter): filter is IUIFilterValueList =>\n (isUIFilterStandard(filter) || isUIFilterLink(filter)) && isValueList(filter);\n\nexport const isUIFilterStandardWithValueList = (filter: UIFilter): filter is IUIFilterStandardValueList =>\n [AttributeType.simple, AttributeType.advanced].includes(filter.attribute.type) && isValueList(filter);\n\nexport const isUIFilterLinkWithValueList = (filter: UIFilter): filter is IUIFilterLinkValueList =>\n [AttributeType.simple_link, AttributeType.advanced_link].includes(filter.attribute.type) && isValueList(filter);\n\nexport const isUIFilterTree = (filter: UIFilter): filter is IUIFilterTree =>\n filter.attribute.type === AttributeType.tree;\n\nexport const isUIFilterTreeWithValueList = (filter: UIFilter): filter is IUIFilterTreeValueList =>\n isUIFilterTree(filter) && isValueList(filter);\n\nconst isValueList = (filter: UIFilter): filter is UIFilter & {attribute: {valuesList: {enabled: true}}} =>\n !!filter.attribute?.valuesList && filter.attribute?.valuesList.enable;\n\nexport interface IUIFilterDropDownProps {\n filter: UIFilter;\n canReset: boolean;\n canRemove: boolean;\n}\n\nexport type ValidFieldFilter = Override<\n ViewDetailsFilterFragment,\n {\n field: NonNullable<ViewDetailsFilterFragment['field']>;\n condition: NonNullable<ViewDetailsFilterFragment['condition']>;\n hidden: boolean;\n withEmptyValues?: boolean;\n }\n>;\n\nexport type ValidFieldFilterStandardValuesList = Override<\n ValidFieldFilter,\n {\n valuesList: StandardAttributeDetailsFragment['valuesList'];\n }\n>;\n\nexport type ValidFieldFilterLinkValuesList = Override<\n ValidFieldFilter,\n {\n valuesList: LinkAttributeDetailsFragment['valuesList'];\n }\n>;\n\nexport type ValidFieldFilterThrough = Override<\n ValidFieldFilter,\n {\n condition: ThroughConditionFilter.THROUGH;\n hidden: boolean;\n }\n> & {\n subField: NonNullable<ViewDetailsFilterFragment['field']>;\n subCondition?: ViewDetailsFilterFragment['condition'];\n};\n\nexport type ValidFilter =\n | ValidFieldFilter\n | ValidFieldFilterThrough\n | ValidFieldFilterStandardValuesList\n | ValidFieldFilterLinkValuesList;\n"]}
1
+ {"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../src/components/Filters/_types.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,aAAa,GAKhB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AAsIxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAgB,EAA+B,EAAE,CAChF,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAEnF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAgB,EAA2B,EAAE,CACxE,CAAC,aAAa,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;IACxF,MAAM,CAAC,SAAS,KAAK,sBAAsB,CAAC,OAAO,CAAC;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAgB,EAA8B,EAAE,CAC9E,CAAC,aAAa,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;IACxF,MAAM,CAAC,SAAS,KAAK,sBAAsB,CAAC,OAAO,CAAC;AAExD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAgB,EAAgC,EAAE,CAClF,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;AAEvH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,MAAgB,EAAwC,EAAE,CACtG,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;AAE1G,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,MAAgB,EAAoC,EAAE,CAC9F,CAAC,aAAa,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;AAEpH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAgB,EAA2B,EAAE,CACxE,MAAM,CAAC,SAAS,CAAC,IAAI,KAAK,aAAa,CAAC,IAAI,CAAC;AAEjD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,MAAgB,EAAoC,EAAE,CAC9F,cAAc,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;AAElD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,MAAgB,EAAiC,EAAE,CACzF,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;AAElG,MAAM,WAAW,GAAG,CAAC,MAAgB,EAAmE,EAAE,CACtG,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,IAAI,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type Override} from '@leav/utils';\nimport {\n type AttributeFormat,\n AttributeType,\n type LinkAttributeDetailsFragment,\n type RecordFilterCondition,\n type StandardAttributeDetailsFragment,\n type ViewDetailsFilterFragment,\n} from '_ui/_gqlTypes';\nimport {ThroughConditionFilter} from '_ui/types/search';\n\nexport type FiltersOperator = 'AND' | 'OR';\n\nexport interface IUIFilterBaseAttribute {\n type: AttributeType;\n /**\n * Used to display the label of the filter.\n *\n * > Not displayed when filter is hidden\n */\n label: string;\n /**\n * Used to verify unicity: one filter per attribute\n */\n id: string;\n format?: AttributeFormat | null | undefined;\n valuesList?:\n | NonNullable<StandardAttributeDetailsFragment['valuesList']>\n | NonNullable<LinkAttributeDetailsFragment['valuesList']>;\n}\n\nexport interface IUIFilterStandardAttribute extends IUIFilterBaseAttribute {\n format: AttributeFormat;\n}\n\nexport interface IUIFilterLinkAttribute extends IUIFilterBaseAttribute {\n linkedLibrary?: {\n id: string;\n };\n smartFilter?: {\n enable?: boolean;\n };\n}\n\nexport interface IUIFilterTreeAttribute extends IUIFilterBaseAttribute {\n linkedTree?: {\n id: string;\n };\n}\n\ninterface IUIFilterBase {\n id: string;\n attribute: IUIFilterBaseAttribute;\n condition: RecordFilterCondition | ThroughConditionFilter | null;\n /**\n * Used to build filter field.\n *\n * - ex: `campaigns_id_pac`\n * - ex with **subField**: `campaigns_id_pac.id`\n */\n field: any;\n value: string | null;\n formattedValue?: string | null;\n hidden?: boolean | undefined;\n withEmptyValues?: boolean;\n}\n\nexport interface IUIFilterStandard extends Omit<IUIFilterBase, 'field'> {\n attribute: IUIFilterStandardAttribute;\n condition: RecordFilterCondition | null;\n field: string;\n}\n\nexport interface IUIFilterLink extends Omit<IUIFilterBase, 'field'> {\n attribute: IUIFilterLinkAttribute;\n condition: RecordFilterCondition | null;\n field: string;\n}\n\nexport interface IUIFilterThrough extends Omit<IUIFilterBase, 'field'> {\n attribute: IUIFilterLinkAttribute;\n condition: ThroughConditionFilter.THROUGH | null;\n subCondition: RecordFilterCondition | null;\n subField: string | null;\n field: string;\n}\n\nexport interface IUIFilterTree extends Omit<IUIFilterBase, 'value' | 'formattedValue' | 'field'> {\n attribute: IUIFilterTreeAttribute;\n condition: RecordFilterCondition | null;\n value: string[] | null;\n formattedValue?: string[] | null;\n nodes?: null | Array<{nodeId: string; libraryId: string}>;\n field: string[];\n}\n\nexport interface IUIFilterSmartFiler extends Omit<IUIFilterBase, 'value' | 'formattedValue'> {\n attribute: IUIFilterLinkAttribute;\n value: string[] | null;\n formattedValue?: string[] | null;\n condition: RecordFilterCondition | null;\n field: string;\n}\n\nexport interface IUIFilterValueList extends Omit<IUIFilterBase, 'value' | 'formattedValue'> {\n attribute: (IUIFilterStandardAttribute | IUIFilterLinkAttribute) & {\n valuesList:\n | NonNullable<StandardAttributeDetailsFragment['valuesList']>\n | NonNullable<LinkAttributeDetailsFragment['valuesList']>;\n };\n value: string[] | null;\n condition: RecordFilterCondition | null;\n field: string | string[];\n}\n\nexport interface IUIFilterStandardValueList extends Omit<IUIFilterStandard, 'attribute' | 'value'>, IUIFilterValueList {\n attribute: IUIFilterStandardAttribute & {\n valuesList: NonNullable<StandardAttributeDetailsFragment['valuesList']>;\n };\n field: string;\n}\n\nexport interface IUIFilterLinkValueList extends Omit<IUIFilterLink, 'attribute' | 'value'>, IUIFilterValueList {\n attribute: IUIFilterLinkAttribute & {\n valuesList: NonNullable<LinkAttributeDetailsFragment['valuesList']>;\n };\n field: string;\n}\nexport interface IUIFilterTreeValueList extends Omit<IUIFilterTree, 'attribute' | 'value'>, IUIFilterValueList {\n attribute: IUIFilterLinkAttribute & {\n valuesList: NonNullable<LinkAttributeDetailsFragment['valuesList']>;\n };\n field: string[];\n}\n\nexport type UIFilter =\n | IUIFilterStandard\n | IUIFilterLink\n | IUIFilterThrough\n | IUIFilterValueList\n | IUIFilterTree\n | IUIFilterSmartFiler;\n\nexport const isUIFilterStandard = (filter: UIFilter): filter is IUIFilterStandard =>\n [AttributeType.simple, AttributeType.advanced].includes(filter.attribute.type);\n\nexport const isUIFilterLink = (filter: UIFilter): filter is IUIFilterLink =>\n [AttributeType.simple_link, AttributeType.advanced_link].includes(filter.attribute.type) &&\n filter.condition !== ThroughConditionFilter.THROUGH;\n\nexport const isUIFilterThrough = (filter: UIFilter): filter is IUIFilterThrough =>\n [AttributeType.simple_link, AttributeType.advanced_link].includes(filter.attribute.type) &&\n filter.condition === ThroughConditionFilter.THROUGH;\n\nexport const isUIFilterValueList = (filter: UIFilter): filter is IUIFilterValueList =>\n (isUIFilterStandard(filter) || isUIFilterLink(filter) || isUIFilterWithSmartFilter(filter)) && isValueList(filter);\n\nexport const isUIFilterStandardWithValueList = (filter: UIFilter): filter is IUIFilterStandardValueList =>\n [AttributeType.simple, AttributeType.advanced].includes(filter.attribute.type) && isValueList(filter);\n\nexport const isUIFilterLinkWithValueList = (filter: UIFilter): filter is IUIFilterLinkValueList =>\n [AttributeType.simple_link, AttributeType.advanced_link].includes(filter.attribute.type) && isValueList(filter);\n\nexport const isUIFilterTree = (filter: UIFilter): filter is IUIFilterTree =>\n filter.attribute.type === AttributeType.tree;\n\nexport const isUIFilterTreeWithValueList = (filter: UIFilter): filter is IUIFilterTreeValueList =>\n isUIFilterTree(filter) && isValueList(filter);\n\nexport const isUIFilterWithSmartFilter = (filter: UIFilter): filter is IUIFilterSmartFiler =>\n (isUIFilterLink(filter) || isUIFilterThrough(filter)) && filter.attribute.smartFilter?.enable;\n\nconst isValueList = (filter: UIFilter): filter is UIFilter & {attribute: {valuesList: {enabled: true}}} =>\n !!filter.attribute?.valuesList && filter.attribute?.valuesList.enable;\n\nexport interface IUIFilterDropDownProps {\n filter: UIFilter;\n canReset: boolean;\n canRemove: boolean;\n}\n\nexport type ValidFieldFilter = Override<\n ViewDetailsFilterFragment,\n {\n field: NonNullable<ViewDetailsFilterFragment['field']>;\n condition: NonNullable<ViewDetailsFilterFragment['condition']>;\n hidden: boolean;\n withEmptyValues?: boolean;\n }\n>;\n\nexport type ValidFieldFilterStandardValuesList = Override<\n ValidFieldFilter,\n {\n valuesList: StandardAttributeDetailsFragment['valuesList'];\n }\n>;\n\nexport type ValidFieldFilterLinkValuesList = Override<\n ValidFieldFilter,\n {\n valuesList: LinkAttributeDetailsFragment['valuesList'];\n }\n>;\n\nexport type ValidFieldFilterThrough = Override<\n ValidFieldFilter,\n {\n condition: ThroughConditionFilter.THROUGH;\n hidden: boolean;\n }\n> & {\n subField: NonNullable<ViewDetailsFilterFragment['field']>;\n subCondition?: ViewDetailsFilterFragment['condition'];\n};\n\nexport type ValidFilter =\n | ValidFieldFilter\n | ValidFieldFilterThrough\n | ValidFieldFilterStandardValuesList\n | ValidFieldFilterLinkValuesList;\n"]}
@@ -2,7 +2,7 @@
2
2
  // This file is released under LGPL V3
3
3
  // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
4
  import { AttributeFormat } from '../../../_gqlTypes';
5
- import { isUIFilterLink, isUIFilterStandard, isUIFilterThrough, isUIFilterTree, isUIFilterValueList, } from '../_types';
5
+ import { isUIFilterLink, isUIFilterStandard, isUIFilterThrough, isUIFilterTree, isUIFilterValueList, isUIFilterWithSmartFilter, } from '../_types';
6
6
  import { hasOnlyNoValueConditions, nullValueConditions } from '../conditionsHelper';
7
7
  import { conditionsByFormat, getFirstConditionByFilterType } from '../filter-items/filter-type/useConditionOptionsByType';
8
8
  import { AttributeConditionFilter, ThroughConditionFilter } from '../../../types';
@@ -20,10 +20,11 @@ export const FiltersActionTypes = {
20
20
  };
21
21
  const addFilter = (state, payload) => {
22
22
  const hasValueList = payload.attribute.valuesList?.enable;
23
+ const isSmartFilter = isUIFilterWithSmartFilter(payload);
23
24
  let condition = hasOnlyNoValueConditions(payload.attribute.format)
24
25
  ? null
25
26
  : (conditionsByFormat[payload.attribute.format][0] ?? null);
26
- if (hasValueList) {
27
+ if (hasValueList || isSmartFilter) {
27
28
  condition = AttributeConditionFilter.EQUAL;
28
29
  }
29
30
  let filterToAdd;
@@ -1 +1 @@
1
- {"version":3,"file":"filtersReducer.js","sourceRoot":"","sources":["../../../../src/components/Filters/context/filtersReducer.ts"],"names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solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {AttributeFormat, type RecordFilterCondition} from '_ui/_gqlTypes';\nimport {\n type UIFilter,\n type IUIFilterStandard,\n type IUIFilterTree,\n isUIFilterLink,\n isUIFilterStandard,\n isUIFilterThrough,\n isUIFilterTree,\n isUIFilterValueList,\n type FiltersOperator,\n} from '../_types';\nimport {hasOnlyNoValueConditions, nullValueConditions} from '../conditionsHelper';\nimport {conditionsByFormat, getFirstConditionByFilterType} from '../filter-items/filter-type/useConditionOptionsByType';\nimport {AttributeConditionFilter, ThroughConditionFilter} from '_ui/types';\nimport {isLinkAttribute} from '_ui/_utils/attributeType';\nimport {type AttributesById} from '../useTransformFilters';\n\nexport type ViewType = 'table' | 'list' | 'timeline' | 'mosaic';\n\nexport const FiltersActionTypes = {\n ADD_FILTER: 'ADD_FILTER',\n RESET_FILTER: 'RESET_FILTER',\n REMOVE_FILTER: 'REMOVE_FILTER',\n MOVE_FILTER: 'MOVE_FILTER',\n CHANGE_FILTER_CONFIG: 'CHANGE_FILTER_CONFIG',\n LOAD_VIEW: 'LOAD_VIEW',\n RESET: 'RESET',\n RESTORE_INITIAL_VIEW_SETTINGS: 'RESTORE_INITIAL_VIEW_SETTINGS',\n UPDATE_VIEWS: 'UPDATE_VIEWS',\n} as const;\n\nexport interface IUIFiltersState {\n libraryId: string;\n viewId: string | null;\n filtersOperator: FiltersOperator;\n filters: UIFilter[] | IUIFilterTree[];\n initialFilters: UIFilter[] | IUIFilterTree[];\n attributesDataById: AttributesById;\n loading: boolean;\n}\n\ninterface IUIFiltersActionAddFilter {\n type: typeof FiltersActionTypes.ADD_FILTER;\n payload: Omit<UIFilter, 'id' | 'value' | 'condition'>;\n}\n\ninterface IIUIFiltersActionResetFilter {\n type: typeof FiltersActionTypes.RESET_FILTER;\n payload: Pick<UIFilter, 'id'>;\n}\n\ninterface IUIFiltersActionRemoveFilter {\n type: typeof FiltersActionTypes.REMOVE_FILTER;\n payload: Pick<UIFilter, 'id'>;\n}\n\ninterface IUIFiltersActionChangeFilterConfig {\n type: typeof FiltersActionTypes.CHANGE_FILTER_CONFIG;\n payload: UIFilter | IUIFilterTree;\n}\n\ninterface IUIFiltersActionMoveFilter {\n type: typeof FiltersActionTypes.MOVE_FILTER;\n payload: {\n indexFrom: number;\n indexTo: number;\n };\n}\n\ninterface IUIFiltersActionReset {\n type: typeof FiltersActionTypes.RESET;\n payload: IUIFiltersState;\n}\n\ninterface IUIFiltersActionLoadView {\n type: typeof FiltersActionTypes.LOAD_VIEW;\n payload: Pick<IUIFiltersState, 'filters' | 'viewId' | 'attributesDataById'>;\n}\n\ninterface IUIFiltersActionRestoreInitialViewSettings {\n type: typeof FiltersActionTypes.RESTORE_INITIAL_VIEW_SETTINGS;\n}\n\ninterface IUIFiltersActionUpdateViewListAndCurrentView {\n type: typeof FiltersActionTypes.UPDATE_VIEWS;\n payload: IUIFiltersState;\n}\n\ntype Reducer<\n PAYLOAD extends {\n type: keyof typeof FiltersActionTypes;\n payload?: unknown;\n } = {type: any; payload: 'no_payload'},\n> = PAYLOAD['payload'] extends 'no_payload'\n ? (state: IUIFiltersState) => IUIFiltersState\n : (state: IUIFiltersState, payload: PAYLOAD['payload']) => IUIFiltersState;\n\nexport type UIFiltersAction =\n | IUIFiltersActionAddFilter\n | IIUIFiltersActionResetFilter\n | IUIFiltersActionRemoveFilter\n | IUIFiltersActionChangeFilterConfig\n | IUIFiltersActionMoveFilter\n | IUIFiltersActionReset\n | IUIFiltersActionLoadView\n | IUIFiltersActionRestoreInitialViewSettings\n | IUIFiltersActionUpdateViewListAndCurrentView;\n\nconst addFilter: Reducer<IUIFiltersActionAddFilter> = (state, payload) => {\n const hasValueList = payload.attribute.valuesList?.enable;\n let condition = hasOnlyNoValueConditions((payload as IUIFilterStandard).attribute.format)\n ? null\n : (conditionsByFormat[(payload as IUIFilterStandard).attribute.format][0] ?? null);\n if (hasValueList) {\n condition = AttributeConditionFilter.EQUAL;\n }\n\n let filterToAdd;\n if (isUIFilterTree(payload as UIFilter)) {\n const filterWithDefaultValues = state.initialFilters.find(\n initialFilter => initialFilter.attribute.id === payload.attribute.id,\n );\n if (filterWithDefaultValues !== undefined) {\n filterToAdd = filterWithDefaultValues;\n } else {\n filterToAdd = {\n ...payload,\n id: window.crypto.randomUUID(),\n field: Array.isArray(payload.field) ? payload.field : [payload.field],\n condition: hasOnlyNoValueConditions((payload as IUIFilterStandard).attribute.format)\n ? null\n : (getFirstConditionByFilterType(payload as UIFilter) as RecordFilterCondition[])[0],\n value: null,\n };\n }\n } else {\n filterToAdd = {\n ...payload,\n field: isLinkAttribute(payload.attribute.type) ? `${payload.field}.id` : (payload.field as string),\n id: window.crypto.randomUUID(),\n condition,\n value: null,\n valuesList: hasValueList ? payload.attribute.valuesList : undefined,\n };\n }\n\n return {\n ...state,\n filters: [...state.filters, filterToAdd],\n viewModified: true,\n };\n};\n\nconst resetFilter: Reducer<IIUIFiltersActionResetFilter> = (state, payload) => ({\n ...state,\n filters: state.filters.map(filter => {\n if (filter.id === payload.id) {\n const initialFilter = state.initialFilters.find(({id}) => id === payload.id);\n if (initialFilter) {\n return initialFilter;\n }\n\n if (isUIFilterValueList(filter)) {\n return {\n ...filter,\n condition: null,\n value: null,\n };\n }\n\n if (isUIFilterStandard(filter)) {\n return {\n ...filter,\n condition: hasOnlyNoValueConditions(filter.attribute.format)\n ? null\n : conditionsByFormat[filter.attribute.format][0],\n value: null,\n formattedValue: null,\n };\n }\n\n if (isUIFilterThrough(filter)) {\n return {\n ...filter,\n condition: ThroughConditionFilter.THROUGH,\n value: null,\n formattedValue: null,\n };\n }\n\n if (isUIFilterLink(filter)) {\n return {\n ...filter,\n condition: conditionsByFormat[AttributeFormat.text][0],\n value: null,\n formattedValue: null,\n };\n }\n\n if (isUIFilterTree(filter)) {\n return {\n ...filter,\n condition: null,\n value: null,\n formattedValue: null,\n };\n }\n }\n return filter;\n }),\n});\n\nconst removeFilter: Reducer<IUIFiltersActionRemoveFilter> = (state, payload) => ({\n ...state,\n filters: state.filters.filter(({id}) => id !== payload.id),\n viewModified: true,\n});\n\nconst changeFilterConfig: Reducer<IUIFiltersActionChangeFilterConfig> = (state, payload) => ({\n ...state,\n filters: state.filters.map(filter => {\n if (filter.id !== payload.id) {\n return filter;\n }\n if (isUIFilterTree(filter) && payload.value && payload.value.length === 0) {\n return {...filter, ...payload, value: null};\n }\n if (isUIFilterValueList(filter) && filter.condition && nullValueConditions.includes(filter.condition)) {\n return {...filter, ...payload, value: null};\n }\n return {...filter, ...payload};\n }),\n viewModified: true,\n});\n\nconst moveFilter: Reducer<IUIFiltersActionMoveFilter> = (state, payload) => {\n const attributesUsedToFilter = [...state.filters];\n const [filterToMove] = attributesUsedToFilter.splice(payload.indexFrom, 1);\n attributesUsedToFilter.splice(payload.indexTo, 0, filterToMove);\n return {\n ...state,\n filters: attributesUsedToFilter,\n viewModified: true,\n };\n};\n\nconst reset: Reducer<IUIFiltersActionReset> = (_, payload) => payload;\n\nconst loadView: Reducer<IUIFiltersActionLoadView> = (state, payload) => ({\n ...state,\n ...payload,\n initialFilters: payload.filters,\n});\n\nconst restoreInitialViewSettings: Reducer = state => ({\n ...state,\n filters: state.initialFilters,\n});\n\nexport const filtersReducer =\n setRefetchViews =>\n (state: IUIFiltersState, action: UIFiltersAction): IUIFiltersState => {\n switch (action.type) {\n case FiltersActionTypes.ADD_FILTER: {\n return addFilter(state, action.payload);\n }\n case FiltersActionTypes.RESET_FILTER: {\n return resetFilter(state, action.payload);\n }\n case FiltersActionTypes.REMOVE_FILTER: {\n return removeFilter(state, action.payload);\n }\n case FiltersActionTypes.CHANGE_FILTER_CONFIG: {\n return changeFilterConfig(state, action.payload);\n }\n case FiltersActionTypes.MOVE_FILTER: {\n return moveFilter(state, action.payload);\n }\n case FiltersActionTypes.RESET: {\n return reset(state, action.payload);\n }\n case FiltersActionTypes.LOAD_VIEW: {\n return loadView(state, action.payload);\n }\n case FiltersActionTypes.RESTORE_INITIAL_VIEW_SETTINGS: {\n return restoreInitialViewSettings(state);\n }\n case FiltersActionTypes.UPDATE_VIEWS: {\n setRefetchViews?.(true);\n return state;\n }\n default:\n return state;\n }\n };\n"]}
1
+ {"version":3,"file":"filtersReducer.js","sourceRoot":"","sources":["../../../../src/components/Filters/context/filtersReducer.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,eAAe,EAA6B,MAAM,eAAe,CAAC;AAC1E,OAAO,EAIH,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,yBAAyB,GAE5B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,wBAAwB,EAAE,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAC,kBAAkB,EAAE,6BAA6B,EAAC,MAAM,uDAAuD,CAAC;AACxH,OAAO,EAAC,wBAAwB,EAAE,sBAAsB,EAAC,MAAM,WAAW,CAAC;AAC3E,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AAKzD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,aAAa;IAC1B,oBAAoB,EAAE,sBAAsB;IAC5C,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,6BAA6B,EAAE,+BAA+B;IAC9D,YAAY,EAAE,cAAc;CACtB,CAAC;AA+EX,MAAM,SAAS,GAAuC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACrE,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC;IAC1D,MAAM,aAAa,GAAG,yBAAyB,CAAC,OAAmB,CAAC,CAAC;IACrE,IAAI,SAAS,GAAG,wBAAwB,CAAE,OAA6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C,CAAC;QACD,KAAK,kBAAkB,CAAC,6BAA6B,CAAC,CAAC,CAAC;YACpD,OAAO,0BAA0B,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC;QACD,KAAK,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC;YACnC,eAAe,EAAE,CAAC,IAAI,CAAC,CAAC;YACxB,OAAO,KAAK,CAAC;QACjB,CAAC;QACD;YACI,OAAO,KAAK,CAAC;IACrB,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {AttributeFormat, type RecordFilterCondition} from '_ui/_gqlTypes';\nimport {\n type UIFilter,\n type IUIFilterStandard,\n type IUIFilterTree,\n isUIFilterLink,\n isUIFilterStandard,\n isUIFilterThrough,\n isUIFilterTree,\n isUIFilterValueList,\n isUIFilterWithSmartFilter,\n type FiltersOperator,\n} from '../_types';\nimport {hasOnlyNoValueConditions, nullValueConditions} from '../conditionsHelper';\nimport {conditionsByFormat, getFirstConditionByFilterType} from '../filter-items/filter-type/useConditionOptionsByType';\nimport {AttributeConditionFilter, ThroughConditionFilter} from '_ui/types';\nimport {isLinkAttribute} from '_ui/_utils/attributeType';\nimport {type AttributesById} from '../useTransformFilters';\n\nexport type ViewType = 'table' | 'list' | 'timeline' | 'mosaic';\n\nexport const FiltersActionTypes = {\n ADD_FILTER: 'ADD_FILTER',\n RESET_FILTER: 'RESET_FILTER',\n REMOVE_FILTER: 'REMOVE_FILTER',\n MOVE_FILTER: 'MOVE_FILTER',\n CHANGE_FILTER_CONFIG: 'CHANGE_FILTER_CONFIG',\n LOAD_VIEW: 'LOAD_VIEW',\n RESET: 'RESET',\n RESTORE_INITIAL_VIEW_SETTINGS: 'RESTORE_INITIAL_VIEW_SETTINGS',\n UPDATE_VIEWS: 'UPDATE_VIEWS',\n} as const;\n\nexport interface IUIFiltersState {\n libraryId: string;\n viewId: string | null;\n filtersOperator: FiltersOperator;\n filters: UIFilter[] | IUIFilterTree[];\n initialFilters: UIFilter[] | IUIFilterTree[];\n attributesDataById: AttributesById;\n loading: boolean;\n}\n\ninterface IUIFiltersActionAddFilter {\n type: typeof FiltersActionTypes.ADD_FILTER;\n payload: Omit<UIFilter, 'id' | 'value' | 'condition'>;\n}\n\ninterface IIUIFiltersActionResetFilter {\n type: typeof FiltersActionTypes.RESET_FILTER;\n payload: Pick<UIFilter, 'id'>;\n}\n\ninterface IUIFiltersActionRemoveFilter {\n type: typeof FiltersActionTypes.REMOVE_FILTER;\n payload: Pick<UIFilter, 'id'>;\n}\n\ninterface IUIFiltersActionChangeFilterConfig {\n type: typeof FiltersActionTypes.CHANGE_FILTER_CONFIG;\n payload: UIFilter | IUIFilterTree;\n}\n\ninterface IUIFiltersActionMoveFilter {\n type: typeof FiltersActionTypes.MOVE_FILTER;\n payload: {\n indexFrom: number;\n indexTo: number;\n };\n}\n\ninterface IUIFiltersActionReset {\n type: typeof FiltersActionTypes.RESET;\n payload: IUIFiltersState;\n}\n\ninterface IUIFiltersActionLoadView {\n type: typeof FiltersActionTypes.LOAD_VIEW;\n payload: Pick<IUIFiltersState, 'filters' | 'viewId' | 'attributesDataById'>;\n}\n\ninterface IUIFiltersActionRestoreInitialViewSettings {\n type: typeof FiltersActionTypes.RESTORE_INITIAL_VIEW_SETTINGS;\n}\n\ninterface IUIFiltersActionUpdateViewListAndCurrentView {\n type: typeof FiltersActionTypes.UPDATE_VIEWS;\n payload: IUIFiltersState;\n}\n\ntype Reducer<\n PAYLOAD extends {\n type: keyof typeof FiltersActionTypes;\n payload?: unknown;\n } = {type: any; payload: 'no_payload'},\n> = PAYLOAD['payload'] extends 'no_payload'\n ? (state: IUIFiltersState) => IUIFiltersState\n : (state: IUIFiltersState, payload: PAYLOAD['payload']) => IUIFiltersState;\n\nexport type UIFiltersAction =\n | IUIFiltersActionAddFilter\n | IIUIFiltersActionResetFilter\n | IUIFiltersActionRemoveFilter\n | IUIFiltersActionChangeFilterConfig\n | IUIFiltersActionMoveFilter\n | IUIFiltersActionReset\n | IUIFiltersActionLoadView\n | IUIFiltersActionRestoreInitialViewSettings\n | IUIFiltersActionUpdateViewListAndCurrentView;\n\nconst addFilter: Reducer<IUIFiltersActionAddFilter> = (state, payload) => {\n const hasValueList = payload.attribute.valuesList?.enable;\n const isSmartFilter = isUIFilterWithSmartFilter(payload as UIFilter);\n let condition = hasOnlyNoValueConditions((payload as IUIFilterStandard).attribute.format)\n ? null\n : (conditionsByFormat[(payload as IUIFilterStandard).attribute.format][0] ?? null);\n if (hasValueList || isSmartFilter) {\n condition = AttributeConditionFilter.EQUAL;\n }\n\n let filterToAdd;\n if (isUIFilterTree(payload as UIFilter)) {\n const filterWithDefaultValues = state.initialFilters.find(\n initialFilter => initialFilter.attribute.id === payload.attribute.id,\n );\n if (filterWithDefaultValues !== undefined) {\n filterToAdd = filterWithDefaultValues;\n } else {\n filterToAdd = {\n ...payload,\n id: window.crypto.randomUUID(),\n field: Array.isArray(payload.field) ? payload.field : [payload.field],\n condition: hasOnlyNoValueConditions((payload as IUIFilterStandard).attribute.format)\n ? null\n : (getFirstConditionByFilterType(payload as UIFilter) as RecordFilterCondition[])[0],\n value: null,\n };\n }\n } else {\n filterToAdd = {\n ...payload,\n field: isLinkAttribute(payload.attribute.type) ? `${payload.field}.id` : (payload.field as string),\n id: window.crypto.randomUUID(),\n condition,\n value: null,\n valuesList: hasValueList ? payload.attribute.valuesList : undefined,\n };\n }\n\n return {\n ...state,\n filters: [...state.filters, filterToAdd],\n viewModified: true,\n };\n};\n\nconst resetFilter: Reducer<IIUIFiltersActionResetFilter> = (state, payload) => ({\n ...state,\n filters: state.filters.map(filter => {\n if (filter.id === payload.id) {\n const initialFilter = state.initialFilters.find(({id}) => id === payload.id);\n if (initialFilter) {\n return initialFilter;\n }\n\n if (isUIFilterValueList(filter)) {\n return {\n ...filter,\n condition: null,\n value: null,\n };\n }\n\n if (isUIFilterStandard(filter)) {\n return {\n ...filter,\n condition: hasOnlyNoValueConditions(filter.attribute.format)\n ? null\n : conditionsByFormat[filter.attribute.format][0],\n value: null,\n formattedValue: null,\n };\n }\n\n if (isUIFilterThrough(filter)) {\n return {\n ...filter,\n condition: ThroughConditionFilter.THROUGH,\n value: null,\n formattedValue: null,\n };\n }\n\n if (isUIFilterLink(filter)) {\n return {\n ...filter,\n condition: conditionsByFormat[AttributeFormat.text][0],\n value: null,\n formattedValue: null,\n };\n }\n\n if (isUIFilterTree(filter)) {\n return {\n ...filter,\n condition: null,\n value: null,\n formattedValue: null,\n };\n }\n }\n return filter;\n }),\n});\n\nconst removeFilter: Reducer<IUIFiltersActionRemoveFilter> = (state, payload) => ({\n ...state,\n filters: state.filters.filter(({id}) => id !== payload.id),\n viewModified: true,\n});\n\nconst changeFilterConfig: Reducer<IUIFiltersActionChangeFilterConfig> = (state, payload) => ({\n ...state,\n filters: state.filters.map(filter => {\n if (filter.id !== payload.id) {\n return filter;\n }\n if (isUIFilterTree(filter) && payload.value && payload.value.length === 0) {\n return {...filter, ...payload, value: null};\n }\n if (isUIFilterValueList(filter) && filter.condition && nullValueConditions.includes(filter.condition)) {\n return {...filter, ...payload, value: null};\n }\n return {...filter, ...payload};\n }),\n viewModified: true,\n});\n\nconst moveFilter: Reducer<IUIFiltersActionMoveFilter> = (state, payload) => {\n const attributesUsedToFilter = [...state.filters];\n const [filterToMove] = attributesUsedToFilter.splice(payload.indexFrom, 1);\n attributesUsedToFilter.splice(payload.indexTo, 0, filterToMove);\n return {\n ...state,\n filters: attributesUsedToFilter,\n viewModified: true,\n };\n};\n\nconst reset: Reducer<IUIFiltersActionReset> = (_, payload) => payload;\n\nconst loadView: Reducer<IUIFiltersActionLoadView> = (state, payload) => ({\n ...state,\n ...payload,\n initialFilters: payload.filters,\n});\n\nconst restoreInitialViewSettings: Reducer = state => ({\n ...state,\n filters: state.initialFilters,\n});\n\nexport const filtersReducer =\n setRefetchViews =>\n (state: IUIFiltersState, action: UIFiltersAction): IUIFiltersState => {\n switch (action.type) {\n case FiltersActionTypes.ADD_FILTER: {\n return addFilter(state, action.payload);\n }\n case FiltersActionTypes.RESET_FILTER: {\n return resetFilter(state, action.payload);\n }\n case FiltersActionTypes.REMOVE_FILTER: {\n return removeFilter(state, action.payload);\n }\n case FiltersActionTypes.CHANGE_FILTER_CONFIG: {\n return changeFilterConfig(state, action.payload);\n }\n case FiltersActionTypes.MOVE_FILTER: {\n return moveFilter(state, action.payload);\n }\n case FiltersActionTypes.RESET: {\n return reset(state, action.payload);\n }\n case FiltersActionTypes.LOAD_VIEW: {\n return loadView(state, action.payload);\n }\n case FiltersActionTypes.RESTORE_INITIAL_VIEW_SETTINGS: {\n return restoreInitialViewSettings(state);\n }\n case FiltersActionTypes.UPDATE_VIEWS: {\n setRefetchViews?.(true);\n return state;\n }\n default:\n return state;\n }\n };\n"]}
@@ -1,13 +1,27 @@
1
1
  // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
2
  // This file is released under LGPL V3
3
3
  // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
- import { useGetLibraryByIdQuery, useGetTreeNodeChildrenWithAccessByDefaultPermissionQueryLazyQuery, } from '../../../_gqlTypes';
4
+ import { useLazyQuery } from '@apollo/client';
5
+ import { useGetLibraryByIdQuery } from '../../../_gqlTypes';
5
6
  import { useEffect, useState } from 'react';
6
- import { defaultPaginationPageSize } from '../../../constants';
7
+ import { treeFiltersDataQuery } from '../_queries/treeFiltersDataQuery';
8
+ const _flattenNodes = (nodes) => nodes.flatMap(node => [
9
+ ...(node.accessRecordByDefaultPermission
10
+ ? [
11
+ {
12
+ nodeId: node.id,
13
+ libraryId: node.record.whoAmI.library.id,
14
+ value: node.record.id,
15
+ label: node.record.whoAmI.label,
16
+ },
17
+ ]
18
+ : []),
19
+ ..._flattenNodes(node.children ?? []),
20
+ ]);
7
21
  export const useGetTreeFilters = ({ libraryId, skip }) => {
8
22
  const [treeFilters, setTreeFilters] = useState({});
9
23
  const [treeFiltersLoading, setTreeFiltersLoading] = useState(true);
10
- const [loadTreeContent] = useGetTreeNodeChildrenWithAccessByDefaultPermissionQueryLazyQuery();
24
+ const [loadTreeFilters] = useLazyQuery(treeFiltersDataQuery());
11
25
  const { data: libraryData, loading: libraryLoading } = useGetLibraryByIdQuery({
12
26
  variables: {
13
27
  id: libraryId,
@@ -23,50 +37,20 @@ export const useGetTreeFilters = ({ libraryId, skip }) => {
23
37
  attributeId: attribute.id,
24
38
  treeId: libraryData?.libraries.list[0]?.attributes.find(tree => tree.id === attribute.id)?.linked_tree?.id,
25
39
  })) || [];
26
- const _fetchChildrenPage = async (treeId, attributeId, parentNodeKey, offset) => {
27
- const { data } = await loadTreeContent({
40
+ const treeResponse = await Promise.all(treeAttributesWithExtendedPermissions.map(async (attribute) => {
41
+ const { data } = await loadTreeFilters({
28
42
  variables: {
29
- treeId,
30
- node: parentNodeKey,
31
- pagination: { offset, limit: defaultPaginationPageSize },
43
+ treeId: attribute.treeId,
32
44
  accessRecordByDefaultPermission: {
33
- attributeId,
45
+ attributeId: attribute.attributeId,
34
46
  libraryId,
35
47
  },
36
48
  },
37
49
  });
38
- const { list, totalCount } = data?.treeNodeChildren ?? { list: [], totalCount: 0 };
39
- const records = [];
40
- for (const node of list) {
41
- if (node.accessRecordByDefaultPermission) {
42
- records.push({
43
- nodeId: node.id,
44
- libraryId: node.record.whoAmI.library.id,
45
- value: node.record.id,
46
- label: node.record.whoAmI.label,
47
- });
48
- }
49
- if (node.childrenCount > 0) {
50
- const childrenRecords = await _fetchAllChildren(treeId, attributeId, node.id);
51
- records.push(...childrenRecords);
52
- }
53
- }
54
- return { records, totalCount };
55
- };
56
- const _fetchAllChildren = async (treeId, attributeId, parentNodeKey, offset = 0, accumulated = []) => {
57
- const { records, totalCount } = await _fetchChildrenPage(treeId, attributeId, parentNodeKey, offset);
58
- const allRecords = [...accumulated, ...records];
59
- const nextOffset = offset + defaultPaginationPageSize;
60
- if (nextOffset < totalCount) {
61
- return _fetchAllChildren(treeId, attributeId, parentNodeKey, nextOffset, allRecords);
62
- }
63
- return allRecords;
64
- };
65
- const treeResponse = await Promise.all(treeAttributesWithExtendedPermissions.map(async (attribute) => {
66
- const recordIds = await _fetchAllChildren(attribute.treeId, attribute.attributeId, null);
50
+ const flatNodes = _flattenNodes(data?.treeContent ?? []);
67
51
  return {
68
52
  attributeId: attribute.attributeId,
69
- recordIds,
53
+ recordIds: flatNodes,
70
54
  };
71
55
  }));
72
56
  const attributeRecords = treeResponse.reduce((acc, item) => {
@@ -79,7 +63,7 @@ export const useGetTreeFilters = ({ libraryId, skip }) => {
79
63
  setTreeFiltersLoading(false);
80
64
  };
81
65
  fetchTreeFilters();
82
- }, [skip, libraryId, libraryLoading, libraryData, loadTreeContent]);
66
+ }, [skip, libraryId, libraryLoading, libraryData, loadTreeFilters]);
83
67
  return {
84
68
  data: treeFilters,
85
69
  loading: treeFiltersLoading,
@@ -1 +1 @@
1
- {"version":3,"file":"useGetTreeFilters.js","sourceRoot":"","sources":["../../../../src/components/Filters/context/useGetTreeFilters.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAEH,sBAAsB,EACtB,iEAAiE,GACpE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAC,yBAAyB,EAAC,MAAM,eAAe,CAAC;AAaxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAC,SAAS,EAAE,IAAI,EAAqC,EAAE,EAAE;IACvF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAe,EAAE,CAAC,CAAC;IACjE,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnE,MAAM,CAAC,eAAe,CAAC,GAAG,iEAAiE,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E,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;gBACzF,CAAC;gBAED,OAAO,UAAU,CAAC;YACtB,CAAC,CAAC;YAEF,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,GAAG,CAClC,qCAAqC,CAAC,GAAG,CAAC,KAAK,EAAC,SAAS,EAAC,EAAE;gBACxD,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBAEzF,OAAO;oBACH,WAAW,EAAE,SAAS,CAAC,WAAW;oBAClC,SAAS;iBACZ,CAAC;YACN,CAAC,CAAC,CACL,CAAC;YAEF,MAAM,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;gBACvD,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC5B,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;gBAC3C,CAAC;gBACD,OAAO,GAAG,CAAC;YACf,CAAC,EAAE,EAAE,CAAC,CAAC;YAEP,cAAc,CAAC,gBAAgB,CAAC,CAAC;YACjC,qBAAqB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC;QAEF,gBAAgB,EAAE,CAAC;IACvB,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;IAEpE,OAAO;QACH,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,kBAAkB;KAC9B,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {\n type TreeAttributeDetailsFragment,\n useGetLibraryByIdQuery,\n useGetTreeNodeChildrenWithAccessByDefaultPermissionQueryLazyQuery,\n} from '_ui/_gqlTypes';\nimport {useEffect, useState} from 'react';\nimport {defaultPaginationPageSize} from '_ui/constants';\n\ninterface ITreeNode {\n nodeId: string;\n libraryId: string;\n value: string;\n label: string;\n}\n\nexport interface ITreeFilters {\n [x: string]: ITreeNode[];\n}\n\nexport const useGetTreeFilters = ({libraryId, skip}: {libraryId: string; skip: boolean}) => {\n const [treeFilters, setTreeFilters] = useState<ITreeFilters>({});\n const [treeFiltersLoading, setTreeFiltersLoading] = useState(true);\n const [loadTreeContent] = useGetTreeNodeChildrenWithAccessByDefaultPermissionQueryLazyQuery();\n\n const {data: libraryData, loading: libraryLoading} = useGetLibraryByIdQuery({\n variables: {\n id: libraryId,\n },\n skip: skip || !libraryId,\n });\n\n useEffect(() => {\n if (skip || !libraryId || libraryLoading || !libraryData) {\n return;\n }\n\n const fetchTreeFilters = async () => {\n const treeAttributesWithExtendedPermissions: Array<{attributeId: string; treeId: string}> =\n libraryData?.libraries.list[0]?.permissions_conf?.permissionTreeAttributes.map(attribute => ({\n attributeId: attribute.id,\n treeId: (\n libraryData?.libraries.list[0]?.attributes.find(\n tree => tree.id === attribute.id,\n ) as TreeAttributeDetailsFragment\n )?.linked_tree?.id,\n })) || [];\n\n const _fetchChildrenPage = async (\n treeId: string,\n attributeId: string,\n parentNodeKey: string | null,\n offset: number,\n ) => {\n const {data} = await loadTreeContent({\n variables: {\n treeId,\n node: parentNodeKey,\n pagination: {offset, limit: defaultPaginationPageSize},\n accessRecordByDefaultPermission: {\n attributeId,\n libraryId,\n },\n },\n });\n\n const {list, totalCount} = data?.treeNodeChildren ?? {list: [], totalCount: 0};\n\n const records: ITreeNode[] = [];\n\n for (const node of list) {\n if (node.accessRecordByDefaultPermission) {\n records.push({\n nodeId: node.id,\n libraryId: node.record.whoAmI.library.id,\n value: node.record.id,\n label: node.record.whoAmI.label,\n });\n }\n\n if (node.childrenCount > 0) {\n const childrenRecords = await _fetchAllChildren(treeId, attributeId, node.id);\n records.push(...childrenRecords);\n }\n }\n\n return {records, totalCount};\n };\n\n const _fetchAllChildren = async (\n treeId: string,\n attributeId: string,\n parentNodeKey: string | null,\n offset = 0,\n accumulated: ITreeNode[] = [],\n ): Promise<ITreeNode[]> => {\n const {records, totalCount} = await _fetchChildrenPage(treeId, attributeId, parentNodeKey, offset);\n const allRecords = [...accumulated, ...records];\n\n const nextOffset = offset + defaultPaginationPageSize;\n if (nextOffset < totalCount) {\n return _fetchAllChildren(treeId, attributeId, parentNodeKey, nextOffset, allRecords);\n }\n\n return allRecords;\n };\n\n const treeResponse = await Promise.all(\n treeAttributesWithExtendedPermissions.map(async attribute => {\n const recordIds = await _fetchAllChildren(attribute.treeId, attribute.attributeId, null);\n\n return {\n attributeId: attribute.attributeId,\n recordIds,\n };\n }),\n );\n\n const attributeRecords = treeResponse.reduce((acc, item) => {\n if (item.recordIds.length > 0) {\n acc[item.attributeId] = item.recordIds;\n }\n return acc;\n }, {});\n\n setTreeFilters(attributeRecords);\n setTreeFiltersLoading(false);\n };\n\n fetchTreeFilters();\n }, [skip, libraryId, libraryLoading, libraryData, loadTreeContent]);\n\n return {\n data: treeFilters,\n loading: treeFiltersLoading,\n };\n};\n"]}
1
+ {"version":3,"file":"useGetTreeFilters.js","sourceRoot":"","sources":["../../../../src/components/Filters/context/useGetTreeFilters.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAoC,sBAAsB,EAAiC,MAAM,eAAe,CAAC;AACxH,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAatE,MAAM,aAAa,GAAG,CAClB,KAIC,EACU,EAAE,CACb,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;IAClB,GAAG,CAAC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AAC,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;IAEpE,OAAO;QACH,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,kBAAkB;KAC9B,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {useLazyQuery} from '@apollo/client';\nimport {type TreeAttributeDetailsFragment, useGetLibraryByIdQuery, type TreeFiltersDataQueryQuery} from '_ui/_gqlTypes';\nimport {useEffect, useState} from 'react';\nimport {treeFiltersDataQuery} from '../_queries/treeFiltersDataQuery';\n\ninterface ITreeNode {\n nodeId: string;\n libraryId: string;\n value: string;\n label: string;\n}\n\nexport interface ITreeFilters {\n [x: string]: ITreeNode[];\n}\n\nconst _flattenNodes = (\n nodes: Array<\n TreeFiltersDataQueryQuery['treeContent'][number] & {\n children?: Array<TreeFiltersDataQueryQuery['treeContent'][number]>;\n }\n >,\n): ITreeNode[] =>\n nodes.flatMap(node => [\n ...(node.accessRecordByDefaultPermission\n ? [\n {\n nodeId: node.id,\n libraryId: node.record.whoAmI.library.id,\n value: node.record.id,\n label: node.record.whoAmI.label,\n },\n ]\n : []),\n ..._flattenNodes(node.children ?? []),\n ]);\n\nexport const useGetTreeFilters = ({libraryId, skip}: {libraryId: string; skip: boolean}) => {\n const [treeFilters, setTreeFilters] = useState<ITreeFilters>({});\n const [treeFiltersLoading, setTreeFiltersLoading] = useState(true);\n const [loadTreeFilters] = useLazyQuery(treeFiltersDataQuery());\n\n const {data: libraryData, loading: libraryLoading} = useGetLibraryByIdQuery({\n variables: {\n id: libraryId,\n },\n skip: skip || !libraryId,\n });\n\n useEffect(() => {\n if (skip || !libraryId || libraryLoading || !libraryData) {\n return;\n }\n\n const fetchTreeFilters = async () => {\n const treeAttributesWithExtendedPermissions: Array<{attributeId: string; treeId: string}> =\n libraryData?.libraries.list[0]?.permissions_conf?.permissionTreeAttributes.map(attribute => ({\n attributeId: attribute.id,\n treeId: (\n libraryData?.libraries.list[0]?.attributes.find(\n tree => tree.id === attribute.id,\n ) as TreeAttributeDetailsFragment\n )?.linked_tree?.id,\n })) || [];\n\n const treeResponse = await Promise.all(\n treeAttributesWithExtendedPermissions.map(async attribute => {\n const {data} = await loadTreeFilters({\n variables: {\n treeId: attribute.treeId,\n accessRecordByDefaultPermission: {\n attributeId: attribute.attributeId,\n libraryId,\n },\n },\n });\n\n const flatNodes = _flattenNodes(data?.treeContent ?? []);\n\n return {\n attributeId: attribute.attributeId,\n recordIds: flatNodes,\n };\n }),\n );\n\n const attributeRecords = treeResponse.reduce((acc, item) => {\n if (item.recordIds.length > 0) {\n acc[item.attributeId] = item.recordIds;\n }\n return acc;\n }, {});\n\n setTreeFilters(attributeRecords);\n setTreeFiltersLoading(false);\n };\n\n fetchTreeFilters();\n }, [skip, libraryId, libraryLoading, libraryData, loadTreeFilters]);\n\n return {\n data: treeFilters,\n loading: treeFiltersLoading,\n };\n};\n"]}
@@ -5,7 +5,7 @@ import { KitFilter } from 'aristid-ds';
5
5
  import { AttributeFormat } from '../../../_gqlTypes';
6
6
  import { getAttributeConditionOptions } from '../filter-items/filter-type/useConditionOptionsByType';
7
7
  import { nullValueConditions } from '../conditionsHelper';
8
- import { isUIFilterStandard, isUIFilterTree } from '../_types';
8
+ import { isUIFilterStandard, isUIFilterTree, isUIFilterWithSmartFilter, } from '../_types';
9
9
  import { ACTIVE_ATTRIBUTE_ID } from '../../../constants';
10
10
  import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
11
11
  const FilterStyled = styled(KitFilter) `
@@ -17,7 +17,7 @@ const getFilterValues = (filter, t) => {
17
17
  return [conditionOption?.label ?? ''];
18
18
  }
19
19
  const filterValues = filter.withEmptyValues ? [t('filters.empty-value')] : [];
20
- if (isUIFilterTree(filter)) {
20
+ if (isUIFilterTree(filter) || isUIFilterWithSmartFilter(filter)) {
21
21
  return [...filterValues, ...(filter.formattedValue ?? [])];
22
22
  }
23
23
  if (isUIFilterStandard(filter) &&
@@ -1 +1 @@
1
- {"version":3,"file":"CommonFilterItem.js","sourceRoot":"","sources":["../../../../src/components/Filters/filter-items/CommonFilterItem.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,cAAc,EAAC,MAAM,4CAA4C,CAAC;AAC1E,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,4BAA4B,EAAC,MAAM,uDAAuD,CAAC;AAEnG,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAwC,MAAM,WAAW,CAAC;AACpG,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;;CAErC,CAAC;AACF,MAAM,eAAe,GAAG,CAAC,MAAgB,EAAE,CAAY,EAAY,EAAE;IACjE,IAAI,MAAM,CAAC,SAAS,IAAI,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;QACrE,MAAM,eAAe,GAAG,4BAA4B,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,SAAS,CAAC,CAAC;QAC1G,OAAO,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,YAAY,GAAa,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAA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;IACvE,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,QAAQ,GAAG,KAAK,CAAC;QAEjB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC;YACtB,MAAM,CAAC,cAAc,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC;IAED,OAAO,CACH,KAAC,YAAY,IACT,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,CAAC,QAAQ,EACrB,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,EAC7B,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,EAClC,aAAa,EAAE;YACX,SAAS,EAAE,YAAY;YACvB,cAAc,EAAE,GAAG,EAAE,CAAC,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,QAAQ,GAAI;SACrG,EACD,eAAe,SACjB,CACL,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type FunctionComponent} from 'react';\nimport {FilterDropDown} from '../filter-items/filter-type/FilterDropDown';\nimport styled from 'styled-components';\nimport {KitFilter} from 'aristid-ds';\nimport {AttributeFormat} from '_ui/_gqlTypes';\nimport {getAttributeConditionOptions} from '../filter-items/filter-type/useConditionOptionsByType';\nimport {type TFunction} from 'i18next';\nimport {nullValueConditions} from '../conditionsHelper';\nimport {isUIFilterStandard, isUIFilterTree, type IUIFilterStandard, type UIFilter} from '../_types';\nimport {ACTIVE_ATTRIBUTE_ID} from '_ui/constants';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\n\nconst FilterStyled = styled(KitFilter)`\n flex: 0 0 auto;\n`;\nconst getFilterValues = (filter: UIFilter, t: TFunction): string[] => {\n if (filter.condition && nullValueConditions.includes(filter.condition)) {\n const conditionOption = getAttributeConditionOptions(t).find(option => option.value === filter.condition);\n return [conditionOption?.label ?? ''];\n }\n\n const filterValues: string[] = filter.withEmptyValues ? [t('filters.empty-value')] : [];\n\n if (isUIFilterTree(filter)) {\n return [...filterValues, ...(filter.formattedValue ?? [])];\n }\n\n if (\n isUIFilterStandard(filter) &&\n [AttributeFormat.date, AttributeFormat.boolean].includes(filter.attribute.format)\n ) {\n return filter.formattedValue ? [...filterValues, filter.formattedValue] : filterValues;\n }\n\n if (Array.isArray(filter.value)) {\n return [...filterValues, ...filter.value];\n } else if (filter.value) {\n return [...filterValues, filter.value];\n }\n return filterValues;\n};\n\nexport interface ICommonFilterProps {\n filter: UIFilter;\n isPinned?: boolean;\n disabled?: boolean;\n readonly?: boolean;\n}\n\nconst isActiveAttribute = (filter: UIFilter): filter is IUIFilterStandard =>\n filter.attribute.format === AttributeFormat.boolean &&\n filter.attribute.id === ACTIVE_ATTRIBUTE_ID &&\n isUIFilterStandard(filter);\n\nexport const CommonFilterItem: FunctionComponent<ICommonFilterProps> = ({\n filter,\n isPinned = false,\n readonly = false,\n disabled,\n}) => {\n const {t} = useSharedTranslation();\n\n let canReset = true;\n\n // Active attribute is a special case, we need to handle it differently\n if (isActiveAttribute(filter)) {\n canReset = false;\n\n if (!filter.value) {\n filter.value = 'true';\n filter.formattedValue = t('explorer.true');\n }\n }\n\n return (\n <FilterStyled\n disabled={disabled}\n readonly={readonly}\n expandable={!readonly}\n label={filter.attribute.label}\n values={getFilterValues(filter, t)}\n dropDownProps={{\n placement: 'bottomLeft',\n dropdownRender: () => <FilterDropDown filter={filter} canReset={canReset} canRemove={!isPinned} />,\n }}\n showSingleValue\n />\n );\n};\n"]}
1
+ {"version":3,"file":"CommonFilterItem.js","sourceRoot":"","sources":["../../../../src/components/Filters/filter-items/CommonFilterItem.tsx"],"names":[],"mappings":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AC,KAAK,GAAG,MAAM,CAAC;YACtB,MAAM,CAAC,cAAc,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC;IAED,OAAO,CACH,KAAC,YAAY,IACT,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,CAAC,QAAQ,EACrB,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,EAC7B,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,EAClC,aAAa,EAAE;YACX,SAAS,EAAE,YAAY;YACvB,cAAc,EAAE,GAAG,EAAE,CAAC,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,QAAQ,GAAI;SACrG,EACD,eAAe,SACjB,CACL,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type FunctionComponent} from 'react';\nimport {FilterDropDown} from '../filter-items/filter-type/FilterDropDown';\nimport styled from 'styled-components';\nimport {KitFilter} from 'aristid-ds';\nimport {AttributeFormat} from '_ui/_gqlTypes';\nimport {getAttributeConditionOptions} from '../filter-items/filter-type/useConditionOptionsByType';\nimport {type TFunction} from 'i18next';\nimport {nullValueConditions} from '../conditionsHelper';\nimport {\n isUIFilterStandard,\n isUIFilterTree,\n isUIFilterWithSmartFilter,\n type IUIFilterStandard,\n type UIFilter,\n} from '../_types';\nimport {ACTIVE_ATTRIBUTE_ID} from '_ui/constants';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\n\nconst FilterStyled = styled(KitFilter)`\n flex: 0 0 auto;\n`;\nconst getFilterValues = (filter: UIFilter, t: TFunction): string[] => {\n if (filter.condition && nullValueConditions.includes(filter.condition)) {\n const conditionOption = getAttributeConditionOptions(t).find(option => option.value === filter.condition);\n return [conditionOption?.label ?? ''];\n }\n\n const filterValues: string[] = filter.withEmptyValues ? [t('filters.empty-value')] : [];\n\n if (isUIFilterTree(filter) || isUIFilterWithSmartFilter(filter)) {\n return [...filterValues, ...(filter.formattedValue ?? [])];\n }\n\n if (\n isUIFilterStandard(filter) &&\n [AttributeFormat.date, AttributeFormat.boolean].includes(filter.attribute.format)\n ) {\n return filter.formattedValue ? [...filterValues, filter.formattedValue] : filterValues;\n }\n\n if (Array.isArray(filter.value)) {\n return [...filterValues, ...filter.value];\n } else if (filter.value) {\n return [...filterValues, filter.value];\n }\n return filterValues;\n};\n\nexport interface ICommonFilterProps {\n filter: UIFilter;\n isPinned?: boolean;\n disabled?: boolean;\n readonly?: boolean;\n}\n\nconst isActiveAttribute = (filter: UIFilter): filter is IUIFilterStandard =>\n filter.attribute.format === AttributeFormat.boolean &&\n filter.attribute.id === ACTIVE_ATTRIBUTE_ID &&\n isUIFilterStandard(filter);\n\nexport const CommonFilterItem: FunctionComponent<ICommonFilterProps> = ({\n filter,\n isPinned = false,\n readonly = false,\n disabled,\n}) => {\n const {t} = useSharedTranslation();\n\n let canReset = true;\n\n // Active attribute is a special case, we need to handle it differently\n if (isActiveAttribute(filter)) {\n canReset = false;\n\n if (!filter.value) {\n filter.value = 'true';\n filter.formattedValue = t('explorer.true');\n }\n }\n\n return (\n <FilterStyled\n disabled={disabled}\n readonly={readonly}\n expandable={!readonly}\n label={filter.attribute.label}\n values={getFilterValues(filter, t)}\n dropDownProps={{\n placement: 'bottomLeft',\n dropdownRender: () => <FilterDropDown filter={filter} canReset={canReset} canRemove={!isPinned} />,\n }}\n showSingleValue\n />\n );\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { EmptyValueCheckbox } from '../EmptyValueCheckbox';
2
+ import { EmptyValueCheckbox } from '../shared/EmptyValueCheckbox';
3
3
  export const ColorAttributeDropDown = ({ filter, onFilterChange }) => {
4
4
  const _handleOnCheckEmptyValue = (selected) => {
5
5
  onFilterChange({
@@ -1 +1 @@
1
- {"version":3,"file":"ColorAttributeDropDown.js","sourceRoot":"","sources":["../../../../../src/components/Filters/filter-items/filter-type/ColorAttributeDropDown.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,MAAM,sBAAsB,GAAoD,CAAC,EAAC,MAAM,EAAE,cAAc,EAAC,EAAE,EAAE;IAChH,MAAM,wBAAwB,GAAG,CAAC,QAAiB,EAAE,EAAE;QACnD,cAAc,CAAC;YACX,GAAG,MAAM;YACT,eAAe,EAAE,QAAQ;SAC5B,CAAC,CAAC;IACP,CAAC,CAAC;IACF,OAAO,KAAC,kBAAkB,IAAC,QAAQ,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,GAAI,CAAC;AACtF,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type FunctionComponent} from 'react';\nimport {type IFilterChildrenDropDownProps} from './_types';\nimport {EmptyValueCheckbox} from '../EmptyValueCheckbox';\n\nexport const ColorAttributeDropDown: FunctionComponent<IFilterChildrenDropDownProps> = ({filter, onFilterChange}) => {\n const _handleOnCheckEmptyValue = (selected: boolean) => {\n onFilterChange({\n ...filter,\n withEmptyValues: selected,\n });\n };\n return <EmptyValueCheckbox onSelect={_handleOnCheckEmptyValue} filter={filter} />;\n};\n"]}
1
+ {"version":3,"file":"ColorAttributeDropDown.js","sourceRoot":"","sources":["../../../../../src/components/Filters/filter-items/filter-type/ColorAttributeDropDown.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAEhE,MAAM,CAAC,MAAM,sBAAsB,GAAoD,CAAC,EAAC,MAAM,EAAE,cAAc,EAAC,EAAE,EAAE;IAChH,MAAM,wBAAwB,GAAG,CAAC,QAAiB,EAAE,EAAE;QACnD,cAAc,CAAC;YACX,GAAG,MAAM;YACT,eAAe,EAAE,QAAQ;SAC5B,CAAC,CAAC;IACP,CAAC,CAAC;IACF,OAAO,KAAC,kBAAkB,IAAC,QAAQ,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,GAAI,CAAC;AACtF,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type FunctionComponent} from 'react';\nimport {type IFilterChildrenDropDownProps} from './_types';\nimport {EmptyValueCheckbox} from '../shared/EmptyValueCheckbox';\n\nexport const ColorAttributeDropDown: FunctionComponent<IFilterChildrenDropDownProps> = ({filter, onFilterChange}) => {\n const _handleOnCheckEmptyValue = (selected: boolean) => {\n onFilterChange({\n ...filter,\n withEmptyValues: selected,\n });\n };\n return <EmptyValueCheckbox onSelect={_handleOnCheckEmptyValue} filter={filter} />;\n};\n"]}
@@ -14,11 +14,15 @@ import { NumericAttributeDropDown } from './NumericAttributeDropDown';
14
14
  import { TextAttributeDropDown } from './TextAttributeDropDown';
15
15
  import { TreeAttributeDropDown } from './tree/TreeAttributeDropDown';
16
16
  import { FilterValueListDropDown } from './FilterValueListDropDown';
17
- import { isUIFilterLink, isUIFilterStandard, isUIFilterThrough, isUIFilterTree, isUIFilterValueList, } from '../../_types';
17
+ import { isUIFilterLink, isUIFilterStandard, isUIFilterThrough, isUIFilterTree, isUIFilterValueList, isUIFilterWithSmartFilter, } from '../../_types';
18
+ import { SmartFilterAttributeDropdown } from './smart-filter/SmartFilterAttributeDropdown';
18
19
  export const FilterDropdownContent = ({ filter, onFilterChange, selectDropDownRef, removeThroughCondition = false }) => {
19
20
  if (isUIFilterValueList(filter)) {
20
21
  return _jsx(FilterValueListDropDown, { filter: filter, onFilterChange: onFilterChange });
21
22
  }
23
+ if (isUIFilterWithSmartFilter(filter)) {
24
+ return _jsx(SmartFilterAttributeDropdown, { filter: filter, onFilterChange: onFilterChange });
25
+ }
22
26
  if (isUIFilterStandard(filter)) {
23
27
  const commonDropDownProps = {
24
28
  filter,
@@ -1 +1 @@
1
- {"version":3,"file":"FilterDropdownContent.js","sourceRoot":"","sources":["../../../../../src/components/Filters/filter-items/filter-type/FilterDropdownContent.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,0BAA0B,EAAC,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAC,0BAA0B,EAAC,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAC,yBAAyB,EAAC,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,qBAAqB,EAAC,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAClE,OAAO,EACH,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,GAEtB,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,qBAAqB,GAK7B,CAAC,EAAC,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,sBAAsB,GAAG,KAAK,EAAC,EAAE,EAAE;IACjF,IAAI,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC;QA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AC;IACN,CAAC;IAED,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtD,OAAO,CACH,KAAC,qBAAqB,IAClB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,sBAAsB,EAC9C,iBAAiB,EAAE,iBAAiB,GACtC,CACL,CAAC;IACN,CAAC;IAED,OAAO,mBAAK,CAAC;AACjB,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {AttributeFormat} from '_ui/_gqlTypes';\nimport {type FunctionComponent, type RefObject} from 'react';\nimport {BooleanAttributeDropDown} from './BooleanAttributeDropdown';\nimport {ColorAttributeDropDown} from './ColorAttributeDropDown';\nimport {DateAttributeDropDown} from './DateAttributeDropDown';\nimport {DateRangeAttributeDropDown} from './DateRangeAttributeDropDown';\nimport {EncryptedAttributeDropDown} from './EncryptedAttributeDropDown';\nimport {ExtendedAttributeDropDown} from './ExtendedAttributeDropDown';\nimport {LinkAttributeDropDown} from './LinkAttributeDropdown';\nimport {NumericAttributeDropDown} from './NumericAttributeDropDown';\nimport {TextAttributeDropDown} from './TextAttributeDropDown';\nimport {TreeAttributeDropDown} from './tree/TreeAttributeDropDown';\nimport {FilterValueListDropDown} from './FilterValueListDropDown';\nimport {\n isUIFilterLink,\n isUIFilterStandard,\n isUIFilterThrough,\n isUIFilterTree,\n isUIFilterValueList,\n type UIFilter,\n} from '../../_types';\n\nexport const FilterDropdownContent: FunctionComponent<{\n filter: UIFilter;\n onFilterChange: (filterData: UIFilter) => void;\n selectDropDownRef?: RefObject<HTMLDivElement>;\n removeThroughCondition?: boolean;\n}> = ({filter, onFilterChange, selectDropDownRef, removeThroughCondition = false}) => {\n if (isUIFilterValueList(filter)) {\n return <FilterValueListDropDown filter={filter} onFilterChange={onFilterChange} />;\n }\n\n if (isUIFilterStandard(filter)) {\n const commonDropDownProps = {\n filter,\n onFilterChange,\n selectDropDownRef,\n };\n const standardFormatDropdown: Record<AttributeFormat, JSX.Element> = {\n [AttributeFormat.text]: <TextAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.rich_text]: <TextAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.numeric]: <NumericAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.date]: <DateAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.boolean]: <BooleanAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.encrypted]: <EncryptedAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.extended]: <ExtendedAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.color]: <ColorAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.date_range]: <DateRangeAttributeDropDown {...commonDropDownProps} />,\n };\n return standardFormatDropdown[filter.attribute.format ?? AttributeFormat.text];\n }\n\n if (isUIFilterTree(filter)) {\n return (\n <TreeAttributeDropDown\n filter={filter}\n onFilterChange={onFilterChange}\n selectDropDownRef={selectDropDownRef}\n />\n );\n }\n\n if (isUIFilterLink(filter) || isUIFilterThrough(filter)) {\n return (\n <LinkAttributeDropDown\n filter={filter}\n onFilterChange={onFilterChange}\n removeThroughCondition={removeThroughCondition}\n selectDropDownRef={selectDropDownRef}\n />\n );\n }\n\n return <></>;\n};\n"]}
1
+ {"version":3,"file":"FilterDropdownContent.js","sourceRoot":"","sources":["../../../../../src/components/Filters/filter-items/filter-type/FilterDropdownContent.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAC,qBAAqB,EA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AC;AACjB,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {AttributeFormat} from '_ui/_gqlTypes';\nimport {type FunctionComponent, type RefObject} from 'react';\nimport {BooleanAttributeDropDown} from './BooleanAttributeDropdown';\nimport {ColorAttributeDropDown} from './ColorAttributeDropDown';\nimport {DateAttributeDropDown} from './DateAttributeDropDown';\nimport {DateRangeAttributeDropDown} from './DateRangeAttributeDropDown';\nimport {EncryptedAttributeDropDown} from './EncryptedAttributeDropDown';\nimport {ExtendedAttributeDropDown} from './ExtendedAttributeDropDown';\nimport {LinkAttributeDropDown} from './LinkAttributeDropdown';\nimport {NumericAttributeDropDown} from './NumericAttributeDropDown';\nimport {TextAttributeDropDown} from './TextAttributeDropDown';\nimport {TreeAttributeDropDown} from './tree/TreeAttributeDropDown';\nimport {FilterValueListDropDown} from './FilterValueListDropDown';\nimport {\n isUIFilterLink,\n isUIFilterStandard,\n isUIFilterThrough,\n isUIFilterTree,\n isUIFilterValueList,\n isUIFilterWithSmartFilter,\n type UIFilter,\n} from '../../_types';\nimport {SmartFilterAttributeDropdown} from './smart-filter/SmartFilterAttributeDropdown';\n\nexport const FilterDropdownContent: FunctionComponent<{\n filter: UIFilter;\n onFilterChange: (filterData: UIFilter) => void;\n selectDropDownRef?: RefObject<HTMLDivElement>;\n removeThroughCondition?: boolean;\n}> = ({filter, onFilterChange, selectDropDownRef, removeThroughCondition = false}) => {\n if (isUIFilterValueList(filter)) {\n return <FilterValueListDropDown filter={filter} onFilterChange={onFilterChange} />;\n }\n\n if (isUIFilterWithSmartFilter(filter)) {\n return <SmartFilterAttributeDropdown filter={filter} onFilterChange={onFilterChange} />;\n }\n\n if (isUIFilterStandard(filter)) {\n const commonDropDownProps = {\n filter,\n onFilterChange,\n selectDropDownRef,\n };\n const standardFormatDropdown: Record<AttributeFormat, JSX.Element> = {\n [AttributeFormat.text]: <TextAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.rich_text]: <TextAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.numeric]: <NumericAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.date]: <DateAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.boolean]: <BooleanAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.encrypted]: <EncryptedAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.extended]: <ExtendedAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.color]: <ColorAttributeDropDown {...commonDropDownProps} />,\n [AttributeFormat.date_range]: <DateRangeAttributeDropDown {...commonDropDownProps} />,\n };\n return standardFormatDropdown[filter.attribute.format ?? AttributeFormat.text];\n }\n\n if (isUIFilterTree(filter)) {\n return (\n <TreeAttributeDropDown\n filter={filter}\n onFilterChange={onFilterChange}\n selectDropDownRef={selectDropDownRef}\n />\n );\n }\n\n if (isUIFilterLink(filter) || isUIFilterThrough(filter)) {\n return (\n <LinkAttributeDropDown\n filter={filter}\n onFilterChange={onFilterChange}\n removeThroughCondition={removeThroughCondition}\n selectDropDownRef={selectDropDownRef}\n />\n );\n }\n\n return <></>;\n};\n"]}
@@ -10,7 +10,7 @@ import { RecordFilterCondition } from '../../../../_gqlTypes';
10
10
  import { isUIFilterLinkWithValueList, isUIFilterStandardWithValueList, } from '../../_types';
11
11
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
12
12
  import { faCheck, faSearch } from '@fortawesome/free-solid-svg-icons';
13
- import { EmptyValueCheckbox } from '../EmptyValueCheckbox';
13
+ import { EmptyValueCheckbox } from '../shared/EmptyValueCheckbox';
14
14
  const ListDivStyled = styled.div `
15
15
  display: flex;
16
16
  flex-direction: column;
@@ -117,9 +117,9 @@ export const FilterValueListDropDown = ({ filter, onFilterChange }) => {
117
117
  _handleToggle(value);
118
118
  }
119
119
  };
120
- return (_jsxs(_Fragment, { children: [_jsx(KitInput, { prefix: _jsx(FontAwesomeIcon, { icon: faSearch }), placeholder: t('global.search'), value: searchText, onChange: e => setSearchText(e.target.value), allowClear: true }), _jsx(EmptyValueCheckbox, { onSelect: _handleOnCheckEmptyValue, filter: filter }), filter.condition === RecordFilterCondition.EQUAL && (_jsx(ListDivStyled, { role: "group", "aria-label": String(t('explorer.filter-value')), children: filteredOptions.map(opt => {
120
+ return (_jsxs(_Fragment, { children: [_jsx(KitInput, { prefix: _jsx(FontAwesomeIcon, { icon: faSearch }), placeholder: t('global.search'), value: searchText, onChange: e => setSearchText(e.target.value), allowClear: true }), _jsx(EmptyValueCheckbox, { onSelect: _handleOnCheckEmptyValue, filter: filter }), _jsx(ListDivStyled, { role: "group", "aria-label": String(t('explorer.filter-value')), children: filteredOptions.map(opt => {
121
121
  const selected = isChecked(opt.value);
122
122
  return (_jsxs(OptionRow, { "$selected": selected, role: "button", "aria-pressed": selected, tabIndex: 0, onClick: () => _handleToggle(opt.value), onKeyDown: e => onKeyToggle(e, opt.value), children: [_jsx(Label, { children: opt.label }), _jsx(RightIcon, { "$visible": selected, icon: faCheck })] }, opt.value));
123
- }) }))] }));
123
+ }) })] }));
124
124
  };
125
125
  //# sourceMappingURL=FilterValueListDropDown.js.map